1
/*____________________________________________________________________________
3
FreeAmp - The Free MP3 Player
5
MP3 Decoder originally Copyright (C) 1996-1997 Xing Technology
6
Corp. http://www.xingtech.com
8
Portions Copyright (C) 1998-1999 Emusic.com
10
This program is free software; you can redistribute it and/or modify
11
it under the terms of the GNU General Public License as published by
12
the Free Software Foundation; either version 2 of the License, or
13
(at your option) any later version.
15
This program is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
GNU General Public License for more details.
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24
$Id: L3.h,v 1.1 1999/12/07 05:46:01 markster Exp $
25
____________________________________________________________________________*/
27
/**** L3.h ***************************************************
31
*** Layer III is 32 bit only ***
32
*** Layer III code assumes 32 bit int ***
34
******************************************************************/
36
#define GLOBAL_GAIN_SCALE (4*15)
37
/* #define GLOBAL_GAIN_SCALE 0 */
41
#define LITTLE_ENDIAN 1
45
#define LITTLE_ENDIAN 1
49
#define LITTLE_ENDIAN 0
53
#error Layer III LITTLE_ENDIAN must be defined 0 or 1
56
/*-----------------------------------------------------------*/
57
/*---- huffman lookup tables ---*/
58
/* endian dependent !!! */
65
unsigned char signbits;
68
unsigned char purgebits; // 0 = esc
75
#else /* big endian machines */
78
int ptr; /* int must be 32 bits or more */
81
unsigned char purgebits; // 0 = esc
85
unsigned char signbits;
92
/*--------------------------------------------------------------*/
97
unsigned char *bs_ptr;
98
unsigned char *bs_ptr0;
99
unsigned char *bs_ptr_end; // optional for overrun test
110
int scalefac_compress;
111
int window_switching_flag;
113
int mixed_block_flag;
115
int subblock_gain[3];
120
int count1table_select;
128
int main_data_begin; /* beginning, not end, my spec wrong */
131
int scfsi[2]; /* 4 bit flags [ch] */
132
GR gr[2][2]; /* [gran][ch] */
136
/*-----------------------------------------------------------*/
137
/*-- scale factors ---*/
138
// check dimensions - need 21 long, 3*12 short
139
// plus extra for implicit sf=0 above highest cb
142
int l[23]; /* [cb] */
143
int s[3][13]; /* [window][cb] */
147
/*-----------------------------------------------------------*/
150
int cbtype; /* long=0 short=1 */
151
int cbmax; /* max crit band */
152
// int lb_type; /* long block type 0 1 3 */
153
int cbs0; /* short band start index 0 3 12 (12=no shorts */
154
int ncbl; /* number long cb's 0 8 21 */
155
int cbmax_s[3]; /* cbmax by individual short blocks */
159
/*-----------------------------------------------------------*/
160
/* scale factor infor for MPEG2 intensity stereo */
169
/*-----------------------------------------------------------*/
177
/*-----------------------------------------------------------*/