FFmpeg
mpegaudiodata.c
Go to the documentation of this file.
1 /*
2  * MPEG Audio common tables
3  * copyright (c) 2002 Fabrice Bellard
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 /**
23  * @file
24  * mpeg audio layer common tables.
25  */
26 
27 #include "mpegaudiodata.h"
28 
29 /*******************************************************/
30 /* layer 2 tables */
31 
32 const int ff_mpa_sblimit_table[5] = { 27 , 30 , 8, 12 , 30 };
33 
34 const int ff_mpa_quant_steps[17] = {
35  3, 5, 7, 9, 15,
36  31, 63, 127, 255, 511,
37  1023, 2047, 4095, 8191, 16383,
38  32767, 65535
39 };
40 
41 /* we use a negative value if grouped */
42 const int ff_mpa_quant_bits[17] = {
43  -5, -7, 3, -10, 4,
44  5, 6, 7, 8, 9,
45  10, 11, 12, 13, 14,
46  15, 16
47 };
48 
49 /* encoding tables which give the quantization index. Note how it is
50  possible to store them efficiently ! */
51 static const unsigned char alloc_table_1[] = {
52  4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
53  4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
54  4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
55  4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
56  4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
57  4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
58  4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
59  4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
60  4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
61  4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
62  4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
63  3, 0, 1, 2, 3, 4, 5, 16,
64  3, 0, 1, 2, 3, 4, 5, 16,
65  3, 0, 1, 2, 3, 4, 5, 16,
66  3, 0, 1, 2, 3, 4, 5, 16,
67  3, 0, 1, 2, 3, 4, 5, 16,
68  3, 0, 1, 2, 3, 4, 5, 16,
69  3, 0, 1, 2, 3, 4, 5, 16,
70  3, 0, 1, 2, 3, 4, 5, 16,
71  3, 0, 1, 2, 3, 4, 5, 16,
72  3, 0, 1, 2, 3, 4, 5, 16,
73  3, 0, 1, 2, 3, 4, 5, 16,
74  3, 0, 1, 2, 3, 4, 5, 16,
75  2, 0, 1, 16,
76  2, 0, 1, 16,
77  2, 0, 1, 16,
78  2, 0, 1, 16,
79  2, 0, 1, 16,
80  2, 0, 1, 16,
81  2, 0, 1, 16,
82 };
83 
84 static const unsigned char alloc_table_3[] = {
85  4, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
86  4, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
87  3, 0, 1, 3, 4, 5, 6, 7,
88  3, 0, 1, 3, 4, 5, 6, 7,
89  3, 0, 1, 3, 4, 5, 6, 7,
90  3, 0, 1, 3, 4, 5, 6, 7,
91  3, 0, 1, 3, 4, 5, 6, 7,
92  3, 0, 1, 3, 4, 5, 6, 7,
93  3, 0, 1, 3, 4, 5, 6, 7,
94  3, 0, 1, 3, 4, 5, 6, 7,
95  3, 0, 1, 3, 4, 5, 6, 7,
96  3, 0, 1, 3, 4, 5, 6, 7,
97 };
98 
99 static const unsigned char alloc_table_4[] = {
100  4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
101  4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
102  4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
103  4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
104  3, 0, 1, 3, 4, 5, 6, 7,
105  3, 0, 1, 3, 4, 5, 6, 7,
106  3, 0, 1, 3, 4, 5, 6, 7,
107  3, 0, 1, 3, 4, 5, 6, 7,
108  3, 0, 1, 3, 4, 5, 6, 7,
109  3, 0, 1, 3, 4, 5, 6, 7,
110  3, 0, 1, 3, 4, 5, 6, 7,
111  2, 0, 1, 3,
112  2, 0, 1, 3,
113  2, 0, 1, 3,
114  2, 0, 1, 3,
115  2, 0, 1, 3,
116  2, 0, 1, 3,
117  2, 0, 1, 3,
118  2, 0, 1, 3,
119  2, 0, 1, 3,
120  2, 0, 1, 3,
121  2, 0, 1, 3,
122  2, 0, 1, 3,
123  2, 0, 1, 3,
124  2, 0, 1, 3,
125  2, 0, 1, 3,
126  2, 0, 1, 3,
127  2, 0, 1, 3,
128  2, 0, 1, 3,
129  2, 0, 1, 3,
130 };
131 
132 const unsigned char * const ff_mpa_alloc_tables[5] =
ff_mpa_quant_bits
const int ff_mpa_quant_bits[17]
Definition: mpegaudiodata.c:42
alloc_table_3
static const unsigned char alloc_table_3[]
Definition: mpegaudiodata.c:84
alloc_table_4
static const unsigned char alloc_table_4[]
Definition: mpegaudiodata.c:99
ff_mpa_quant_steps
const int ff_mpa_quant_steps[17]
Definition: mpegaudiodata.c:34
ff_mpa_alloc_tables
const unsigned char *const ff_mpa_alloc_tables[5]
Definition: mpegaudiodata.c:132
ff_mpa_sblimit_table
const int ff_mpa_sblimit_table[5]
Definition: mpegaudiodata.c:32
mpegaudiodata.h
alloc_table_1
static const unsigned char alloc_table_1[]
Definition: mpegaudiodata.c:51