xref: /plan9/sys/src/games/mp3enc/l3side.h (revision 8f5875f3e9b20916b4c52ad4336922bc8653eb7b)
1 /*
2  *	Layer 3 side include file
3  *
4  *	Copyright (c) 1999 Mark Taylor
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
22 #ifndef LAME_L3SIDE_H
23 #define LAME_L3SIDE_H
24 
25 #include "encoder.h"
26 #include "machine.h"
27 
28 /* Layer III side information. */
29 
30 typedef FLOAT8	D576[576];
31 typedef int	I576[576];
32 typedef FLOAT8	D192_3[192][3];
33 typedef int	I192_3[192][3];
34 
35 
36 typedef struct
37 {
38    int l[1+SBMAX_l];
39    int s[1+SBMAX_s];
40 } scalefac_struct;
41 
42 
43 typedef struct {
44 	FLOAT8	l[SBMAX_l];
45 	FLOAT8	s[SBMAX_s][3];
46 } III_psy_xmin;
47 
48 typedef struct {
49     III_psy_xmin thm;
50     III_psy_xmin en;
51 } III_psy_ratio;
52 
53 typedef struct {
54 	int part2_3_length;
55 	int big_values;
56 	int count1;
57  	int global_gain;
58 	int scalefac_compress;
59 	int window_switching_flag;
60 	int block_type;
61 	int mixed_block_flag;
62 	int table_select[3];
63 	 int subblock_gain[3];
64 	 int region0_count;
65 	 int region1_count;
66 	 int preflag;
67 	 int scalefac_scale;
68 	 int count1table_select;
69 
70 	 int part2_length;
71 	 int sfb_lmax;
72 	 int sfb_smin;
73 	 int count1bits;
74 	/* added for LSF */
75 	 const int *sfb_partition_table;
76 	 int slen[4];
77 } gr_info;
78 
79 typedef struct {
80 	int main_data_begin;
81 	int private_bits;
82 	int resvDrain_pre;
83 	int resvDrain_post;
84 	int scfsi[2][4];
85 	struct {
86 		struct gr_info_ss {
87 			gr_info tt;
88 			} ch[2];
89 		} gr[2];
90 	} III_side_info_t;
91 
92 /* Layer III scale factors. */
93 /* note: there are only SBPSY_l=(SBMAX_l-1) and SBPSY_s=(SBMAX_s-1) scalefactors.
94  * Dont know why these would be dimensioned SBMAX_l and SBMAX-s */
95 typedef struct {
96 	int l[SBMAX_l];            /* [cb] */
97 	int s[SBMAX_s][3];         /* [window][cb] */
98 } III_scalefac_t;  /* [gr][ch] */
99 
100 #endif
101