add multiple inclusion guards to headers
[libav.git] / libavcodec / mpegaudiotab.h
CommitLineData
de6d9b64
FB
1/*
2 * mpeg audio layer 2 tables. Most of them come from the mpeg audio
3 * specification.
115329f1 4 *
ff4ec49e 5 * Copyright (c) 2000, 2001 Fabrice Bellard.
de6d9b64 6 *
b78e7197
DB
7 * This file is part of FFmpeg.
8 *
9 * FFmpeg is free software; you can redistribute it and/or
712ae911
DB
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
b78e7197 12 * version 2.1 of the License, or (at your option) any later version.
712ae911 13 *
b78e7197 14 * FFmpeg is distributed in the hope that it will be useful,
712ae911
DB
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
b78e7197 20 * License along with FFmpeg; if not, write to the Free Software
712ae911 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
de6d9b64
FB
22 */
23
983e3246
MN
24/**
25 * @file mpegaudiotab.h
115329f1 26 * mpeg audio layer 2 tables.
983e3246
MN
27 * Most of them come from the mpeg audio specification.
28 */
115329f1 29
699b3f99
MR
30#ifndef AVCODEC_MPEGAUDIOTAB_H
31#define AVCODEC_MPEGAUDIOTAB_H
32
99545457
MR
33#include <stdint.h>
34#include "mpegaudio.h"
35
de6d9b64
FB
36#define SQRT2 1.41421356237309514547
37
38static const int costab32[30] = {
39 FIX(0.54119610014619701222),
40 FIX(1.3065629648763763537),
115329f1 41
de6d9b64
FB
42 FIX(0.50979557910415917998),
43 FIX(2.5629154477415054814),
44 FIX(0.89997622313641556513),
45 FIX(0.60134488693504528634),
115329f1 46
de6d9b64
FB
47 FIX(0.5024192861881556782),
48 FIX(5.1011486186891552563),
49 FIX(0.78815462345125020249),
50 FIX(0.64682178335999007679),
51 FIX(0.56694403481635768927),
52 FIX(1.0606776859903470633),
53 FIX(1.7224470982383341955),
54 FIX(0.52249861493968885462),
115329f1 55
de6d9b64
FB
56 FIX(10.19000812354803287),
57 FIX(0.674808341455005678),
58 FIX(1.1694399334328846596),
59 FIX(0.53104259108978413284),
60 FIX(2.0577810099534108446),
61 FIX(0.58293496820613388554),
62 FIX(0.83934964541552681272),
63 FIX(0.50547095989754364798),
64 FIX(3.4076084184687189804),
65 FIX(0.62250412303566482475),
66 FIX(0.97256823786196078263),
67 FIX(0.51544730992262455249),
68 FIX(1.4841646163141661852),
69 FIX(0.5531038960344445421),
70 FIX(0.74453627100229857749),
71 FIX(0.5006029982351962726),
72};
73
74static const int bitinv32[32] = {
75 0, 16, 8, 24, 4, 20, 12, 28,
76 2, 18, 10, 26, 6, 22, 14, 30,
77 1, 17, 9, 25, 5, 21, 13, 29,
78 3, 19, 11, 27, 7, 23, 15, 31
79};
80
81
0c1a9eda 82static int16_t filter_bank[512];
de6d9b64
FB
83
84static int scale_factor_table[64];
85#ifdef USE_FLOATS
86static float scale_factor_inv_table[64];
87#else
0c1a9eda 88static int8_t scale_factor_shift[64];
de6d9b64
FB
89static unsigned short scale_factor_mult[64];
90#endif
91static unsigned char scale_diff_table[128];
92
2456e28d
FB
93/* total number of bits per allocation group */
94static unsigned short total_quant_bits[17];
de6d9b64
FB
95
96/* signal to noise ratio of each quantification step (could be
115329f1 97 computed from quant_steps[]). The values are dB multiplied by 10
de6d9b64 98*/
115329f1 99static const unsigned short quant_snr[17] = {
de6d9b64
FB
100 70, 110, 160, 208,
101 253, 316, 378, 439,
115329f1
DB
102 499, 559, 620, 680,
103 740, 800, 861, 920,
de6d9b64
FB
104 980
105};
106
de6d9b64
FB
107/* fixed psycho acoustic model. Values of SNR taken from the 'toolame'
108 project */
2456e28d 109static const float fixed_smr[SBLIMIT] = {
de6d9b64
FB
110 30, 17, 16, 10, 3, 12, 8, 2.5,
111 5, 5, 6, 6, 5, 6, 10, 6,
112 -4, -10, -21, -30, -42, -55, -68, -75,
113 -75, -75, -75, -75, -91, -107, -110, -108
114};
115
2456e28d
FB
116static const unsigned char nb_scale_factors[4] = { 3, 2, 1, 2 };
117
699b3f99 118#endif