58847a0164fcd419958da1e9a89f394242fcb175
[IRC.git] / Robust / src / Tests / ssJava / mp3decoder / LayerIIDecoder.java
1 /*
2  * 11/19/04  1.0 moved to LGPL.
3  * 
4  * 29/05/01  Michael Scheerer,  Fixed some C++ to Java porting bugs. 
5  *
6  * 16/07/01  Michael Scheerer, Catched a bug in method
7  *           read_sampledata, which causes an outOfIndexException.
8  * 
9  * 12/12/99  Initial version. Adapted from javalayer.java
10  *                       and Subband*.java. mdm@techie.com
11  *
12  * 02/28/99  Initial version : javalayer.java by E.B
13  *-----------------------------------------------------------------------
14  *   This program is free software; you can redistribute it and/or modify
15  *   it under the terms of the GNU Library General Public License as published
16  *   by the Free Software Foundation; either version 2 of the License, or
17  *   (at your option) any later version.
18  *
19  *   This program is distributed in the hope that it will be useful,
20  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
21  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  *   GNU Library General Public License for more details.
23  *
24  *   You should have received a copy of the GNU Library General Public
25  *   License along with this program; if not, write to the Free Software
26  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  *----------------------------------------------------------------------
28  */
29
30 /**
31  * Implements decoding of MPEG Audio Layer II frames.
32  */
33 @LATTICE("SB<H,H<SH,SH*,,SB*")
34 @METHODDEFAULT("MODE<THIS,THIS<C,C<IN,THISLOC=THIS,C*")
35 class LayerIIDecoder extends LayerIDecoder implements FrameDecoder {
36
37   public LayerIIDecoder() {
38   }
39
40   protected void createSubbands() {
41     @LOC("THIS,LayerIIDecoder.SB") int i;
42     if (mode == Header.SINGLE_CHANNEL)
43       for (i = 0; i < num_subbands; ++i)
44         subbands[i] = new SubbandLayer2(i);
45     else if (mode == Header.JOINT_STEREO) {
46       for (i = 0; i < header.intensity_stereo_bound(); ++i)
47         subbands[i] = new SubbandLayer2Stereo(i);
48       for (; i < num_subbands; ++i)
49         subbands[i] = new SubbandLayer2IntensityStereo(i);
50     } else {
51       for (i = 0; i < num_subbands; ++i)
52         subbands[i] = new SubbandLayer2Stereo(i);
53     }
54
55   }
56
57   protected void readScaleFactorSelection() {
58     // eom note: num_subbands is defined in LayerIDecoder so it has (THIS,
59     // LayerIDecoder) Loc
60     for (@LOC("THIS,LayerIIDecoder.SB") int i = 0; i < num_subbands; ++i) {
61       ((SubbandLayer2) subbands[i]).read_scalefactor_selection(stream, crc);
62     }
63   }
64
65   /**
66    * Class for layer II subbands in single channel mode.
67    */
68   @LATTICE("S<L,L<H,L<SM,SM<H,H<SH,SH<SH0,SH*,SM*,SH0*")
69   @METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
70   static class SubbandLayer2 extends Subband {
71     // this table contains 3 requantized samples for each legal codeword
72     // when grouped in 5 bits, i.e. 3 quantizationsteps per sample
73     public static final float grouping_5bits[] = new float[] { -2.0f / 3.0f, -2.0f / 3.0f,
74         -2.0f / 3.0f, 0.0f, -2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f,
75         -2.0f / 3.0f, 0.0f, -2.0f / 3.0f, 0.0f, 0.0f, -2.0f / 3.0f, 2.0f / 3.0f, 0.0f,
76         -2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, 0.0f, 2.0f / 3.0f, -2.0f / 3.0f,
77         2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f, 0.0f, 0.0f,
78         -2.0f / 3.0f, 0.0f, 2.0f / 3.0f, -2.0f / 3.0f, 0.0f, -2.0f / 3.0f, 0.0f, 0.0f, 0.0f, 0.0f,
79         0.0f, 2.0f / 3.0f, 0.0f, 0.0f, -2.0f / 3.0f, 2.0f / 3.0f, 0.0f, 0.0f, 2.0f / 3.0f, 0.0f,
80         2.0f / 3.0f, 2.0f / 3.0f, 0.0f, -2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, 0.0f,
81         -2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, 0.0f,
82         2.0f / 3.0f, 0.0f, 0.0f, 2.0f / 3.0f, 2.0f / 3.0f, 0.0f, 2.0f / 3.0f, -2.0f / 3.0f,
83         2.0f / 3.0f, 2.0f / 3.0f, 0.0f, 2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f,
84         2.0f / 3.0f };
85
86     // this table contains 3 requantized samples for each legal codeword
87     // when grouped in 7 bits, i.e. 5 quantizationsteps per sample
88     public static final float grouping_7bits[] = new float[] { -0.8f, -0.8f, -0.8f, -0.4f, -0.8f,
89         -0.8f, 0.0f, -0.8f, -0.8f, 0.4f, -0.8f, -0.8f, 0.8f, -0.8f, -0.8f, -0.8f, -0.4f, -0.8f,
90         -0.4f, -0.4f, -0.8f, 0.0f, -0.4f, -0.8f, 0.4f, -0.4f, -0.8f, 0.8f, -0.4f, -0.8f, -0.8f,
91         0.0f, -0.8f, -0.4f, 0.0f, -0.8f, 0.0f, 0.0f, -0.8f, 0.4f, 0.0f, -0.8f, 0.8f, 0.0f, -0.8f,
92         -0.8f, 0.4f, -0.8f, -0.4f, 0.4f, -0.8f, 0.0f, 0.4f, -0.8f, 0.4f, 0.4f, -0.8f, 0.8f, 0.4f,
93         -0.8f, -0.8f, 0.8f, -0.8f, -0.4f, 0.8f, -0.8f, 0.0f, 0.8f, -0.8f, 0.4f, 0.8f, -0.8f, 0.8f,
94         0.8f, -0.8f, -0.8f, -0.8f, -0.4f, -0.4f, -0.8f, -0.4f, 0.0f, -0.8f, -0.4f, 0.4f, -0.8f,
95         -0.4f, 0.8f, -0.8f, -0.4f, -0.8f, -0.4f, -0.4f, -0.4f, -0.4f, -0.4f, 0.0f, -0.4f, -0.4f,
96         0.4f, -0.4f, -0.4f, 0.8f, -0.4f, -0.4f, -0.8f, 0.0f, -0.4f, -0.4f, 0.0f, -0.4f, 0.0f, 0.0f,
97         -0.4f, 0.4f, 0.0f, -0.4f, 0.8f, 0.0f, -0.4f, -0.8f, 0.4f, -0.4f, -0.4f, 0.4f, -0.4f, 0.0f,
98         0.4f, -0.4f, 0.4f, 0.4f, -0.4f, 0.8f, 0.4f, -0.4f, -0.8f, 0.8f, -0.4f, -0.4f, 0.8f, -0.4f,
99         0.0f, 0.8f, -0.4f, 0.4f, 0.8f, -0.4f, 0.8f, 0.8f, -0.4f, -0.8f, -0.8f, 0.0f, -0.4f, -0.8f,
100         0.0f, 0.0f, -0.8f, 0.0f, 0.4f, -0.8f, 0.0f, 0.8f, -0.8f, 0.0f, -0.8f, -0.4f, 0.0f, -0.4f,
101         -0.4f, 0.0f, 0.0f, -0.4f, 0.0f, 0.4f, -0.4f, 0.0f, 0.8f, -0.4f, 0.0f, -0.8f, 0.0f, 0.0f,
102         -0.4f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.4f, 0.0f, 0.0f, 0.8f, 0.0f, 0.0f, -0.8f, 0.4f, 0.0f,
103         -0.4f, 0.4f, 0.0f, 0.0f, 0.4f, 0.0f, 0.4f, 0.4f, 0.0f, 0.8f, 0.4f, 0.0f, -0.8f, 0.8f, 0.0f,
104         -0.4f, 0.8f, 0.0f, 0.0f, 0.8f, 0.0f, 0.4f, 0.8f, 0.0f, 0.8f, 0.8f, 0.0f, -0.8f, -0.8f,
105         0.4f, -0.4f, -0.8f, 0.4f, 0.0f, -0.8f, 0.4f, 0.4f, -0.8f, 0.4f, 0.8f, -0.8f, 0.4f, -0.8f,
106         -0.4f, 0.4f, -0.4f, -0.4f, 0.4f, 0.0f, -0.4f, 0.4f, 0.4f, -0.4f, 0.4f, 0.8f, -0.4f, 0.4f,
107         -0.8f, 0.0f, 0.4f, -0.4f, 0.0f, 0.4f, 0.0f, 0.0f, 0.4f, 0.4f, 0.0f, 0.4f, 0.8f, 0.0f, 0.4f,
108         -0.8f, 0.4f, 0.4f, -0.4f, 0.4f, 0.4f, 0.0f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.8f, 0.4f, 0.4f,
109         -0.8f, 0.8f, 0.4f, -0.4f, 0.8f, 0.4f, 0.0f, 0.8f, 0.4f, 0.4f, 0.8f, 0.4f, 0.8f, 0.8f, 0.4f,
110         -0.8f, -0.8f, 0.8f, -0.4f, -0.8f, 0.8f, 0.0f, -0.8f, 0.8f, 0.4f, -0.8f, 0.8f, 0.8f, -0.8f,
111         0.8f, -0.8f, -0.4f, 0.8f, -0.4f, -0.4f, 0.8f, 0.0f, -0.4f, 0.8f, 0.4f, -0.4f, 0.8f, 0.8f,
112         -0.4f, 0.8f, -0.8f, 0.0f, 0.8f, -0.4f, 0.0f, 0.8f, 0.0f, 0.0f, 0.8f, 0.4f, 0.0f, 0.8f,
113         0.8f, 0.0f, 0.8f, -0.8f, 0.4f, 0.8f, -0.4f, 0.4f, 0.8f, 0.0f, 0.4f, 0.8f, 0.4f, 0.4f, 0.8f,
114         0.8f, 0.4f, 0.8f, -0.8f, 0.8f, 0.8f, -0.4f, 0.8f, 0.8f, 0.0f, 0.8f, 0.8f, 0.4f, 0.8f, 0.8f,
115         0.8f, 0.8f, 0.8f };
116
117     // this table contains 3 requantized samples for each legal codeword
118     // when grouped in 10 bits, i.e. 9 quantizationsteps per sample
119     public static final float grouping_10bits[] = { -8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
120         -6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
121         -2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 0.0f, -8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f,
122         -8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f,
123         -8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
124         -6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f,
125         -6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 0.0f, -6.0f / 9.0f,
126         -8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f,
127         -8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f,
128         -8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f,
129         -8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f,
130         -8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
131         4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
132         8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f,
133         -6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f,
134         -2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 0.0f, -2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f,
135         -2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f,
136         -2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 0.0f,
137         -8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -8.0f / 9.0f, -4.0f / 9.0f, 0.0f, -8.0f / 9.0f,
138         -2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 0.0f, 0.0f, -8.0f / 9.0f, 2.0f / 9.0f, 0.0f,
139         -8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -8.0f / 9.0f, 6.0f / 9.0f, 0.0f, -8.0f / 9.0f,
140         8.0f / 9.0f, 0.0f, -8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f,
141         2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
142         2.0f / 9.0f, -8.0f / 9.0f, 0.0f, 2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f,
143         -8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
144         -8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f,
145         -8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
146         -8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 0.0f, 4.0f / 9.0f, -8.0f / 9.0f,
147         2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f,
148         6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f,
149         -8.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f,
150         -4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 0.0f,
151         6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f,
152         6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f,
153         6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f,
154         8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
155         8.0f / 9.0f, -8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f,
156         -8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
157         -8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
158         -6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
159         -6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -8.0f / 9.0f, -6.0f / 9.0f,
160         2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f,
161         6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f,
162         -8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f,
163         -4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 0.0f,
164         -6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f,
165         -6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f,
166         -6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f,
167         -4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f,
168         -4.0f / 9.0f, -6.0f / 9.0f, 0.0f, -4.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
169         -6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f,
170         -6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
171         -6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
172         -6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 0.0f, -2.0f / 9.0f, -6.0f / 9.0f,
173         2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
174         6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
175         -8.0f / 9.0f, 0.0f, -6.0f / 9.0f, -6.0f / 9.0f, 0.0f, -6.0f / 9.0f, -4.0f / 9.0f, 0.0f,
176         -6.0f / 9.0f, -2.0f / 9.0f, 0.0f, -6.0f / 9.0f, 0.0f, 0.0f, -6.0f / 9.0f, 2.0f / 9.0f,
177         0.0f, -6.0f / 9.0f, 4.0f / 9.0f, 0.0f, -6.0f / 9.0f, 6.0f / 9.0f, 0.0f, -6.0f / 9.0f,
178         8.0f / 9.0f, 0.0f, -6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f,
179         2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f,
180         2.0f / 9.0f, -6.0f / 9.0f, 0.0f, 2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f,
181         -6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
182         -6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f,
183         -6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
184         -6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 0.0f, 4.0f / 9.0f, -6.0f / 9.0f,
185         2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f,
186         6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f,
187         -8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f,
188         -4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 0.0f,
189         6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f,
190         6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f,
191         6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f,
192         8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f,
193         8.0f / 9.0f, -6.0f / 9.0f, 0.0f, 8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f,
194         -6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
195         -6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
196         -4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
197         -4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 0.0f, -8.0f / 9.0f, -4.0f / 9.0f,
198         2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f,
199         6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f,
200         -8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f,
201         -4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 0.0f,
202         -6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
203         -6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f,
204         -6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f,
205         -4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
206         -4.0f / 9.0f, -4.0f / 9.0f, 0.0f, -4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
207         -4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f,
208         -4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
209         -4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
210         -4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 0.0f, -2.0f / 9.0f, -4.0f / 9.0f,
211         2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f,
212         6.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f,
213         -8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -6.0f / 9.0f, 0.0f, -4.0f / 9.0f, -4.0f / 9.0f, 0.0f,
214         -4.0f / 9.0f, -2.0f / 9.0f, 0.0f, -4.0f / 9.0f, 0.0f, 0.0f, -4.0f / 9.0f, 2.0f / 9.0f,
215         0.0f, -4.0f / 9.0f, 4.0f / 9.0f, 0.0f, -4.0f / 9.0f, 6.0f / 9.0f, 0.0f, -4.0f / 9.0f,
216         8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f,
217         2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
218         2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f,
219         -4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
220         -4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f,
221         -4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
222         -4.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 0.0f, 4.0f / 9.0f, -4.0f / 9.0f,
223         2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f,
224         6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f,
225         -8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f,
226         -4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 0.0f,
227         6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
228         6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f,
229         6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f,
230         8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
231         8.0f / 9.0f, -4.0f / 9.0f, 0.0f, 8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f,
232         -4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
233         -4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
234         -2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
235         -2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 0.0f, -8.0f / 9.0f, -2.0f / 9.0f,
236         2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
237         6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
238         -8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f,
239         -4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 0.0f,
240         -6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f,
241         -6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f,
242         -6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
243         -4.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
244         -4.0f / 9.0f, -2.0f / 9.0f, 0.0f, -4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
245         -2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f,
246         -2.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
247         -2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
248         -2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 0.0f, -2.0f / 9.0f, -2.0f / 9.0f,
249         2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
250         6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
251         -8.0f / 9.0f, 0.0f, -2.0f / 9.0f, -6.0f / 9.0f, 0.0f, -2.0f / 9.0f, -4.0f / 9.0f, 0.0f,
252         -2.0f / 9.0f, -2.0f / 9.0f, 0.0f, -2.0f / 9.0f, 0.0f, 0.0f, -2.0f / 9.0f, 2.0f / 9.0f,
253         0.0f, -2.0f / 9.0f, 4.0f / 9.0f, 0.0f, -2.0f / 9.0f, 6.0f / 9.0f, 0.0f, -2.0f / 9.0f,
254         8.0f / 9.0f, 0.0f, -2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
255         2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
256         2.0f / 9.0f, -2.0f / 9.0f, 0.0f, 2.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f,
257         -2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
258         -2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f,
259         -2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
260         -2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 0.0f, 4.0f / 9.0f, -2.0f / 9.0f,
261         2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f,
262         6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f,
263         -8.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f,
264         -4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 0.0f,
265         6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f,
266         6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f,
267         6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
268         8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
269         8.0f / 9.0f, -2.0f / 9.0f, 0.0f, 8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f,
270         -2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
271         -2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 0.0f,
272         -6.0f / 9.0f, -8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -8.0f / 9.0f, 0.0f, -2.0f / 9.0f,
273         -8.0f / 9.0f, 0.0f, 0.0f, -8.0f / 9.0f, 0.0f, 2.0f / 9.0f, -8.0f / 9.0f, 0.0f, 4.0f / 9.0f,
274         -8.0f / 9.0f, 0.0f, 6.0f / 9.0f, -8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -8.0f / 9.0f, 0.0f,
275         -8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -6.0f / 9.0f, -6.0f / 9.0f, 0.0f, -4.0f / 9.0f,
276         -6.0f / 9.0f, 0.0f, -2.0f / 9.0f, -6.0f / 9.0f, 0.0f, 0.0f, -6.0f / 9.0f, 0.0f,
277         2.0f / 9.0f, -6.0f / 9.0f, 0.0f, 4.0f / 9.0f, -6.0f / 9.0f, 0.0f, 6.0f / 9.0f,
278         -6.0f / 9.0f, 0.0f, 8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -8.0f / 9.0f, -4.0f / 9.0f, 0.0f,
279         -6.0f / 9.0f, -4.0f / 9.0f, 0.0f, -4.0f / 9.0f, -4.0f / 9.0f, 0.0f, -2.0f / 9.0f,
280         -4.0f / 9.0f, 0.0f, 0.0f, -4.0f / 9.0f, 0.0f, 2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 4.0f / 9.0f,
281         -4.0f / 9.0f, 0.0f, 6.0f / 9.0f, -4.0f / 9.0f, 0.0f, 8.0f / 9.0f, -4.0f / 9.0f, 0.0f,
282         -8.0f / 9.0f, -2.0f / 9.0f, 0.0f, -6.0f / 9.0f, -2.0f / 9.0f, 0.0f, -4.0f / 9.0f,
283         -2.0f / 9.0f, 0.0f, -2.0f / 9.0f, -2.0f / 9.0f, 0.0f, 0.0f, -2.0f / 9.0f, 0.0f,
284         2.0f / 9.0f, -2.0f / 9.0f, 0.0f, 4.0f / 9.0f, -2.0f / 9.0f, 0.0f, 6.0f / 9.0f,
285         -2.0f / 9.0f, 0.0f, 8.0f / 9.0f, -2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 0.0f, 0.0f,
286         -6.0f / 9.0f, 0.0f, 0.0f, -4.0f / 9.0f, 0.0f, 0.0f, -2.0f / 9.0f, 0.0f, 0.0f, 0.0f, 0.0f,
287         0.0f, 2.0f / 9.0f, 0.0f, 0.0f, 4.0f / 9.0f, 0.0f, 0.0f, 6.0f / 9.0f, 0.0f, 0.0f,
288         8.0f / 9.0f, 0.0f, 0.0f, -8.0f / 9.0f, 2.0f / 9.0f, 0.0f, -6.0f / 9.0f, 2.0f / 9.0f, 0.0f,
289         -4.0f / 9.0f, 2.0f / 9.0f, 0.0f, -2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 0.0f, 2.0f / 9.0f, 0.0f,
290         2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 2.0f / 9.0f, 0.0f, 6.0f / 9.0f, 2.0f / 9.0f,
291         0.0f, 8.0f / 9.0f, 2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -6.0f / 9.0f,
292         4.0f / 9.0f, 0.0f, -4.0f / 9.0f, 4.0f / 9.0f, 0.0f, -2.0f / 9.0f, 4.0f / 9.0f, 0.0f, 0.0f,
293         4.0f / 9.0f, 0.0f, 2.0f / 9.0f, 4.0f / 9.0f, 0.0f, 4.0f / 9.0f, 4.0f / 9.0f, 0.0f,
294         6.0f / 9.0f, 4.0f / 9.0f, 0.0f, 8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -8.0f / 9.0f, 6.0f / 9.0f,
295         0.0f, -6.0f / 9.0f, 6.0f / 9.0f, 0.0f, -4.0f / 9.0f, 6.0f / 9.0f, 0.0f, -2.0f / 9.0f,
296         6.0f / 9.0f, 0.0f, 0.0f, 6.0f / 9.0f, 0.0f, 2.0f / 9.0f, 6.0f / 9.0f, 0.0f, 4.0f / 9.0f,
297         6.0f / 9.0f, 0.0f, 6.0f / 9.0f, 6.0f / 9.0f, 0.0f, 8.0f / 9.0f, 6.0f / 9.0f, 0.0f,
298         -8.0f / 9.0f, 8.0f / 9.0f, 0.0f, -6.0f / 9.0f, 8.0f / 9.0f, 0.0f, -4.0f / 9.0f,
299         8.0f / 9.0f, 0.0f, -2.0f / 9.0f, 8.0f / 9.0f, 0.0f, 0.0f, 8.0f / 9.0f, 0.0f, 2.0f / 9.0f,
300         8.0f / 9.0f, 0.0f, 4.0f / 9.0f, 8.0f / 9.0f, 0.0f, 6.0f / 9.0f, 8.0f / 9.0f, 0.0f,
301         8.0f / 9.0f, 8.0f / 9.0f, 0.0f, -8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f,
302         -8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f,
303         -8.0f / 9.0f, 2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f,
304         2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f,
305         2.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f,
306         2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f,
307         2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 0.0f, -6.0f / 9.0f, 2.0f / 9.0f,
308         2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
309         6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
310         -8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f,
311         -4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 0.0f,
312         -4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f,
313         -4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f,
314         -4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f,
315         -2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f,
316         -2.0f / 9.0f, 2.0f / 9.0f, 0.0f, -2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f,
317         2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f,
318         2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 0.0f, 2.0f / 9.0f,
319         -6.0f / 9.0f, 0.0f, 2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 2.0f / 9.0f, -2.0f / 9.0f, 0.0f,
320         2.0f / 9.0f, 0.0f, 0.0f, 2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 2.0f / 9.0f, 4.0f / 9.0f, 0.0f,
321         2.0f / 9.0f, 6.0f / 9.0f, 0.0f, 2.0f / 9.0f, 8.0f / 9.0f, 0.0f, 2.0f / 9.0f, -8.0f / 9.0f,
322         2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
323         2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 2.0f / 9.0f,
324         2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f,
325         6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f,
326         4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
327         4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 0.0f, 4.0f / 9.0f,
328         2.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
329         6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f,
330         6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
331         6.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 0.0f, 6.0f / 9.0f,
332         2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
333         6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f,
334         8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
335         8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 0.0f, 8.0f / 9.0f,
336         2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f,
337         6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f,
338         -8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f,
339         -8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -8.0f / 9.0f,
340         4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f,
341         4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f,
342         4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f,
343         4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
344         4.0f / 9.0f, 0.0f, -6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f,
345         4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f,
346         8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
347         -6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
348         -2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 0.0f, -4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
349         -4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f,
350         -4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f,
351         -2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f,
352         -2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 0.0f, -2.0f / 9.0f,
353         4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f,
354         4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f,
355         4.0f / 9.0f, -8.0f / 9.0f, 0.0f, 4.0f / 9.0f, -6.0f / 9.0f, 0.0f, 4.0f / 9.0f,
356         -4.0f / 9.0f, 0.0f, 4.0f / 9.0f, -2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 0.0f, 0.0f, 4.0f / 9.0f,
357         2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 4.0f / 9.0f, 0.0f, 4.0f / 9.0f, 6.0f / 9.0f, 0.0f,
358         4.0f / 9.0f, 8.0f / 9.0f, 0.0f, 4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f,
359         -6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f,
360         -2.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 0.0f, 2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
361         2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
362         4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f,
363         -6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f,
364         -2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 0.0f, 4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
365         4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f,
366         4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f,
367         -6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f,
368         -2.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 0.0f, 6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
369         6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f,
370         4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f,
371         -6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f,
372         -2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 0.0f, 8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
373         8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
374         4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
375         6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
376         6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 0.0f, -8.0f / 9.0f, 6.0f / 9.0f,
377         2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f,
378         6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f,
379         -8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f,
380         -4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 0.0f,
381         -6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f,
382         -6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
383         -6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f,
384         -4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f,
385         -4.0f / 9.0f, 6.0f / 9.0f, 0.0f, -4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
386         6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f,
387         6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
388         6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
389         6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 0.0f, -2.0f / 9.0f, 6.0f / 9.0f,
390         2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f,
391         6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f,
392         -8.0f / 9.0f, 0.0f, 6.0f / 9.0f, -6.0f / 9.0f, 0.0f, 6.0f / 9.0f, -4.0f / 9.0f, 0.0f,
393         6.0f / 9.0f, -2.0f / 9.0f, 0.0f, 6.0f / 9.0f, 0.0f, 0.0f, 6.0f / 9.0f, 2.0f / 9.0f, 0.0f,
394         6.0f / 9.0f, 4.0f / 9.0f, 0.0f, 6.0f / 9.0f, 6.0f / 9.0f, 0.0f, 6.0f / 9.0f, 8.0f / 9.0f,
395         0.0f, 6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
396         6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f,
397         6.0f / 9.0f, 0.0f, 2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f,
398         4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
399         2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f,
400         4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f,
401         4.0f / 9.0f, 6.0f / 9.0f, 0.0f, 4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f,
402         6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f,
403         8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f,
404         -6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f,
405         -2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 0.0f, 6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
406         6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f,
407         6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f,
408         -6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f,
409         -2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 0.0f, 8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
410         8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
411         6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
412         8.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
413         8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 0.0f, -8.0f / 9.0f, 8.0f / 9.0f,
414         2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f,
415         6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f,
416         -8.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f,
417         -4.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 0.0f,
418         -6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f,
419         -6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f,
420         -6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f,
421         -4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f,
422         -4.0f / 9.0f, 8.0f / 9.0f, 0.0f, -4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
423         8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f,
424         8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
425         8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
426         8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 0.0f, -2.0f / 9.0f, 8.0f / 9.0f,
427         2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f,
428         6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f,
429         -8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -6.0f / 9.0f, 0.0f, 8.0f / 9.0f, -4.0f / 9.0f, 0.0f,
430         8.0f / 9.0f, -2.0f / 9.0f, 0.0f, 8.0f / 9.0f, 0.0f, 0.0f, 8.0f / 9.0f, 2.0f / 9.0f, 0.0f,
431         8.0f / 9.0f, 4.0f / 9.0f, 0.0f, 8.0f / 9.0f, 6.0f / 9.0f, 0.0f, 8.0f / 9.0f, 8.0f / 9.0f,
432         0.0f, 8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
433         8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f,
434         8.0f / 9.0f, 0.0f, 2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f,
435         4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f,
436         2.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f,
437         4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f,
438         4.0f / 9.0f, 8.0f / 9.0f, 0.0f, 4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f,
439         8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f,
440         8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
441         -6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
442         -2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 0.0f, 6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f,
443         6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f,
444         8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f,
445         -6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f,
446         -2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 0.0f, 8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f,
447         8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
448         8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f };
449
450     // data taken from ISO/IEC DIS 11172, Annexes 3-B.2[abcd] and 3-B.4:
451
452     // subbands 0-2 in tables 3-B.2a and 2b: (index is allocation)
453     public static final int table_ab1_codelength[] =
454     // bits per codeword
455         { 0, 5, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
456
457     public static final float table_ab1_groupingtables[][] =
458     // pointer to sample grouping table, or NULL-pointer if ungrouped
459         { null, grouping_5bits, null, null, null, null, null, null, null, null, null, null, null,
460             null, null, null };
461
462     public static final float table_ab1_factor[] =
463     // factor for requantization: (real)sample * factor - 1.0 gives requantized
464     // sample
465         { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32.0f, 1.0f / 64.0f,
466             1.0f / 128.0f, 1.0f / 256.0f, 1.0f / 512.0f, 1.0f / 1024.0f, 1.0f / 2048.0f,
467             1.0f / 4096.0f, 1.0f / 8192.0f, 1.0f / 16384.0f, 1.0f / 32768.0f };
468
469     public static final float table_ab1_c[] =
470     // factor c for requantization from table 3-B.4
471         { 0.0f, 1.33333333333f, 1.14285714286f, 1.06666666666f, 1.03225806452f, 1.01587301587f,
472             1.00787401575f, 1.00392156863f, 1.00195694716f, 1.00097751711f, 1.00048851979f,
473             1.00024420024f, 1.00012208522f, 1.00006103888f, 1.00003051851f, 1.00001525902f };
474
475     public static final float table_ab1_d[] =
476     // addend d for requantization from table 3-B.4
477         { 0.0f, 0.50000000000f, 0.25000000000f, 0.12500000000f, 0.06250000000f, 0.03125000000f,
478             0.01562500000f, 0.00781250000f, 0.00390625000f, 0.00195312500f, 0.00097656250f,
479             0.00048828125f, 0.00024414063f, 0.00012207031f, 0.00006103516f, 0.00003051758f };
480
481     // subbands 3-... tables 3-B.2a and 2b:
482     public static final float[] table_ab234_groupingtables[] = { null, grouping_5bits,
483         grouping_7bits, null, grouping_10bits, null, null, null, null, null, null, null, null,
484         null, null, null };
485
486     // subbands 3-10 in tables 3-B.2a and 2b:
487     public static final int table_ab2_codelength[] = { 0, 5, 7, 3, 10, 4, 5, 6, 7, 8, 9, 10, 11,
488         12, 13, 16 };
489     public static final float table_ab2_factor[] = { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 4.0f,
490         1.0f / 8.0f, 1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32.0f, 1.0f / 64.0f, 1.0f / 128.0f,
491         1.0f / 256.0f, 1.0f / 512.0f, 1.0f / 1024.0f, 1.0f / 2048.0f, 1.0f / 4096.0f,
492         1.0f / 32768.0f };
493     public static final float table_ab2_c[] = { 0.0f, 1.33333333333f, 1.60000000000f,
494         1.14285714286f, 1.77777777777f, 1.06666666666f, 1.03225806452f, 1.01587301587f,
495         1.00787401575f, 1.00392156863f, 1.00195694716f, 1.00097751711f, 1.00048851979f,
496         1.00024420024f, 1.00012208522f, 1.00001525902f };
497     public static final float table_ab2_d[] = { 0.0f, 0.50000000000f, 0.50000000000f,
498         0.25000000000f, 0.50000000000f, 0.12500000000f, 0.06250000000f, 0.03125000000f,
499         0.01562500000f, 0.00781250000f, 0.00390625000f, 0.00195312500f, 0.00097656250f,
500         0.00048828125f, 0.00024414063f, 0.00003051758f };
501
502     // subbands 11-22 in tables 3-B.2a and 2b:
503     public static final int table_ab3_codelength[] = { 0, 5, 7, 3, 10, 4, 5, 16 };
504     public static final float table_ab3_factor[] = { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 4.0f,
505         1.0f / 8.0f, 1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32768.0f };
506     public static final float table_ab3_c[] = { 0.0f, 1.33333333333f, 1.60000000000f,
507         1.14285714286f, 1.77777777777f, 1.06666666666f, 1.03225806452f, 1.00001525902f };
508     public static final float table_ab3_d[] = { 0.0f, 0.50000000000f, 0.50000000000f,
509         0.25000000000f, 0.50000000000f, 0.12500000000f, 0.06250000000f, 0.00003051758f };
510
511     // subbands 23-... in tables 3-B.2a and 2b:
512     public static final int table_ab4_codelength[] = { 0, 5, 7, 16 };
513     public static final float table_ab4_factor[] = { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f,
514         1.0f / 32768.0f };
515     public static final float table_ab4_c[] = { 0.0f, 1.33333333333f, 1.60000000000f,
516         1.00001525902f };
517     public static final float table_ab4_d[] = { 0.0f, 0.50000000000f, 0.50000000000f,
518         0.00003051758f };
519
520     // subbands in tables 3-B.2c and 2d:
521     public static final int table_cd_codelength[] = { 0, 5, 7, 10, 4, 5, 6, 7, 8, 9, 10, 11, 12,
522         13, 14, 15 };
523     public static final float table_cd_groupingtables[][] = { null, grouping_5bits, grouping_7bits,
524         grouping_10bits, null, null, null, null, null, null, null, null, null, null, null, null };
525     public static final float table_cd_factor[] = { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 8.0f,
526         1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32.0f, 1.0f / 64.0f, 1.0f / 128.0f, 1.0f / 256.0f,
527         1.0f / 512.0f, 1.0f / 1024.0f, 1.0f / 2048.0f, 1.0f / 4096.0f, 1.0f / 8192.0f,
528         1.0f / 16384.0f };
529     public static final float table_cd_c[] = { 0.0f, 1.33333333333f, 1.60000000000f,
530         1.77777777777f, 1.06666666666f, 1.03225806452f, 1.01587301587f, 1.00787401575f,
531         1.00392156863f, 1.00195694716f, 1.00097751711f, 1.00048851979f, 1.00024420024f,
532         1.00012208522f, 1.00006103888f, 1.00003051851f };
533     public static final float table_cd_d[] = { 0.0f, 0.50000000000f, 0.50000000000f,
534         0.50000000000f, 0.12500000000f, 0.06250000000f, 0.03125000000f, 0.01562500000f,
535         0.00781250000f, 0.00390625000f, 0.00195312500f, 0.00097656250f, 0.00048828125f,
536         0.00024414063f, 0.00012207031f, 0.00006103516f };
537
538     @LOC("SH")
539     protected int subbandnumber;
540     @LOC("SH")
541     protected int allocation;
542     @LOC("SH")
543     protected int scfsi;
544     @LOC("SH")
545     protected float scalefactor1;
546     @LOC("SH")
547     protected float scalefactor2;
548     @LOC("SH")
549     protected float scalefactor3;
550     @LOC("H")
551     protected int[] codelength = { 0 };
552     @LOC("SH")
553     protected float groupingtable[][] = new float[2][];
554     // protected float[][] groupingtable = {{0},{0}} ;
555     @LOC("SM")
556     protected float[] factor = { 0.0f };
557     @LOC("SH")
558     protected int groupnumber;
559     @LOC("SM")
560     protected int samplenumber;
561     @LOC("SM")
562     protected float[] samples = new float[3];
563     @LOC("SM")
564     protected float[] c = { 0.0f };
565     @LOC("SM")
566     protected float[] d = { 0.0f };
567
568     /**
569      * Constructor
570      */
571     public SubbandLayer2(@LOC("IN") int subbandnumber) {
572       this.subbandnumber = subbandnumber;
573       groupnumber = samplenumber = 0;
574     }
575
576     /**
577            *
578            */
579     protected int get_allocationlength(@LOC("THIS,LayerIIDecoder$SubbandLayer2.SH") Header header) {
580
581       if (header.version() == Header.MPEG1) {
582
583         @LOC("THIS,LayerIIDecoder$SubbandLayer2.SH") int channel_bitrate = header.bitrate_index();
584
585         // calculate bitrate per channel:
586         if (header.mode() != Header.SINGLE_CHANNEL)
587           if (channel_bitrate == 4)
588             channel_bitrate = 1;
589           else
590             channel_bitrate -= 4;
591
592         if (channel_bitrate == 1 || channel_bitrate == 2)
593           // table 3-B.2c or 3-B.2d
594           if (subbandnumber <= 1)
595             return 4;
596           else
597             return 3;
598         else
599         // tables 3-B.2a or 3-B.2b
600         if (subbandnumber <= 10)
601           return 4;
602         else if (subbandnumber <= 22)
603           return 3;
604         else
605           return 2;
606       } else { // MPEG-2 LSF -- Jeff
607
608         // table B.1 of ISO/IEC 13818-3
609         if (subbandnumber <= 3)
610           return 4;
611         else if (subbandnumber <= 10)
612           return 3;
613         else
614           return 2;
615       }
616     }
617
618     /**
619            *
620            */
621     @LATTICE("OUT<THIS,THIS<IN,THISLOC=THIS")
622     protected void prepare_sample_reading(@LOC("IN") Header header,
623         @LOC("THIS,LayerIIDecoder$SubbandLayer2.SH0") int allocation,
624         // float[][] groupingtable,
625         @LOC("IN") int channel, @LOC("OUT") float[] factor, @LOC("OUT") int[] codelength,
626         @LOC("OUT") float[] c, @LOC("OUT") float[] d) {
627
628       // header.bitrate_index() will generate at most DELTA(THIS,SH*)
629       @LOC("THIS,LayerIIDecoder$SubbandLayer2.SH") int channel_bitrate = header.bitrate_index();
630
631       // calculate bitrate per channel:
632       if (header.mode() != Header.SINGLE_CHANNEL) {
633         if (channel_bitrate == 4) {
634           channel_bitrate = 1;
635         } else {
636           channel_bitrate -= 4;
637         }
638       }
639
640       if (channel_bitrate == 1 || channel_bitrate == 2) {
641         // table 3-B.2c or 3-B.2d
642         groupingtable[channel] = table_cd_groupingtables[allocation];
643         factor[0] = table_cd_factor[allocation];
644         codelength[0] = table_cd_codelength[allocation];
645         c[0] = table_cd_c[allocation];
646         d[0] = table_cd_d[allocation];
647       } else {
648         // tables 3-B.2a or 3-B.2b
649         if (subbandnumber <= 2) {
650           groupingtable[channel] = table_ab1_groupingtables[allocation];
651           factor[0] = table_ab1_factor[allocation];
652           codelength[0] = table_ab1_codelength[allocation];
653           c[0] = table_ab1_c[allocation];
654           d[0] = table_ab1_d[allocation];
655         } else {
656           groupingtable[channel] = table_ab234_groupingtables[allocation];
657           if (subbandnumber <= 10) {
658             factor[0] = table_ab2_factor[allocation];
659             codelength[0] = table_ab2_codelength[allocation];
660             c[0] = table_ab2_c[allocation];
661             d[0] = table_ab2_d[allocation];
662           } else if (subbandnumber <= 22) {
663             factor[0] = table_ab3_factor[allocation];
664             codelength[0] = table_ab3_codelength[allocation];
665             c[0] = table_ab3_c[allocation];
666             d[0] = table_ab3_d[allocation];
667           } else {
668             factor[0] = table_ab4_factor[allocation];
669             codelength[0] = table_ab4_codelength[allocation];
670             c[0] = table_ab4_c[allocation];
671             d[0] = table_ab4_d[allocation];
672           }
673         }
674       }
675     }
676
677     /**
678            *
679            */
680     @LATTICE("V<THIS,THIS<IN,THISLOC=THIS")
681     // ssjava
682     public void read_allocation(@LOC("THIS,LayerIIDecoder$SubbandLayer2.SH") Bitstream stream,
683         @LOC("THIS,LayerIIDecoder$SubbandLayer2.SH0") Header header,
684         @LOC("THIS,LayerIIDecoder$SubbandLayer2.H") Crc16 crc) {
685
686       @LOC("THIS,LayerIIDecoder$SubbandLayer2.SH0") int length = get_allocationlength(header);
687
688       allocation = stream.get_bits(length);
689       if (crc != null) {
690         crc.add_bits(allocation, length);
691       }
692     }
693
694     /**
695            *
696            */
697     public void read_scalefactor_selection(@LOC("IN") Bitstream stream,
698         @LOC("THIS,LayerIIDecoder$SubbandLayer2.H") Crc16 crc) {
699       if (allocation != 0) {
700         scfsi = stream.get_bits(2);
701         if (crc != null)
702           crc.add_bits(scfsi, 2);
703       }
704     }
705
706     /**
707            *
708            */
709     public void read_scalefactor(@LOC("IN") Bitstream stream, @LOC("IN") Header header) {
710       if (allocation != 0) {
711         switch (scfsi) {
712         case 0:
713           scalefactor1 = scalefactors[stream.get_bits(6)];
714           scalefactor2 = scalefactors[stream.get_bits(6)];
715           scalefactor3 = scalefactors[stream.get_bits(6)];
716           break;
717         case 1:
718           scalefactor1 = scalefactor2 = scalefactors[stream.get_bits(6)];
719           scalefactor3 = scalefactors[stream.get_bits(6)];
720           break;
721         case 2:
722           scalefactor1 = scalefactor2 = scalefactor3 = scalefactors[stream.get_bits(6)];
723           break;
724         case 3:
725           scalefactor1 = scalefactors[stream.get_bits(6)];
726           scalefactor2 = scalefactor3 = scalefactors[stream.get_bits(6)];
727           break;
728         }
729         prepare_sample_reading(header, allocation, 0, factor, codelength, c, d);
730       }
731     }
732
733     /**
734            *
735            */
736     // ssjava
737     public boolean read_sampledata(@LOC("THIS,LayerIIDecoder$SubbandLayer2.SM") Bitstream stream) {
738       if (allocation != 0) {
739         if (groupingtable[0] != null) {
740
741           @LOC("THIS,LayerIIDecoder$SubbandLayer2.SM") int samplecode =
742               stream.get_bits(codelength[0]);
743           // create requantized samples:
744           samplecode += samplecode << 1;
745           // float[] target = samples; //subbed in variable to reduce areas
746           // float[] source = groupingtable[0]; //subbed in variable to reduce
747           // areas
748           /*
749            * int tmp = 0; int temp = 0; target[tmp++] = source[samplecode +
750            * temp]; temp++; target[tmp++] = source[samplecode + temp]; temp++;
751            * target[tmp] = source[samplecode + temp];
752            */
753           // Bugfix:
754           @LOC("THIS,LayerIIDecoder$SubbandLayer2.SM") int tmp = 0;
755           @LOC("THIS,LayerIIDecoder$SubbandLayer2.SM") int temp = samplecode;
756
757           // if(temp > source.length - 3) temp = source.length - 3;
758           if (temp > groupingtable[0].length - 3) {
759             temp = groupingtable[0].length - 3;
760           }
761
762           samples[tmp] = groupingtable[0][temp];
763           temp++;
764           tmp++;
765           samples[tmp] = groupingtable[0][temp];
766           temp++;
767           tmp++;
768           samples[tmp] = groupingtable[0][temp];
769
770           // memcpy (samples, groupingtable + samplecode, 3 * sizeof (real));
771         } else {
772           samples[0] = (float) ((stream.get_bits(codelength[0])) * factor[0] - 1.0);
773           samples[1] = (float) ((stream.get_bits(codelength[0])) * factor[0] - 1.0);
774           samples[2] = (float) ((stream.get_bits(codelength[0])) * factor[0] - 1.0);
775         }
776       }
777       samplenumber = 0;
778       if (++groupnumber == 12)
779         return true;
780       else
781         return false;
782     }
783
784     // ssjava
785     public boolean put_next_sample(@LOC("IN") int channels, @LOC("IN") SynthesisFilter filter1,
786         @LOC("IN") SynthesisFilter filter2) {
787
788       if ((allocation != 0) && (channels != OutputChannels.RIGHT_CHANNEL)) {
789
790         @LOC("THIS,LayerIIDecoder$SubbandLayer2.SM") float sample = samples[samplenumber];
791
792         if (groupingtable[0] == null) {
793           sample = (sample + d[0]) * c[0];
794         }
795         if (groupnumber <= 4) {
796           sample *= scalefactor1;
797         } else if (groupnumber <= 8) {
798           sample *= scalefactor2;
799         } else {
800           sample *= scalefactor3;
801         }
802         filter1.input_sample(sample, subbandnumber);
803       }
804
805       if (++samplenumber == 3)
806         return true;
807       else
808         return false;
809     }
810   };
811
812   /**
813    * Class for layer II subbands in joint stereo mode.
814    */
815   @LATTICE("S<L,L<H,L<SM,SM<H,H<SH,SH<SH0,SH*,SM*")
816   @METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
817   static class SubbandLayer2IntensityStereo extends SubbandLayer2 {
818     @LOC("SH")
819     protected int channel2_scfsi;
820     @LOC("SH")
821     protected float channel2_scalefactor1;
822     @LOC("SH")
823     protected float channel2_scalefactor2;
824     @LOC("SH")
825     protected float channel2_scalefactor3;
826
827     /**
828      * Constructor
829      */
830     public SubbandLayer2IntensityStereo(@LOC("IN") int subbandnumber) {
831       super(subbandnumber);
832     }
833
834     /**
835            *
836            */
837     @LATTICE("THIS<IN2,IN2<IN1,IN1<IN0,THISLOC=THIS")
838     public void read_allocation(@LOC("IN1") Bitstream stream, @LOC("IN0") Header header,
839         @LOC("IN2") Crc16 crc) {
840       super.read_allocation(stream, header, crc);
841     }
842
843     /**
844            *
845            */
846     public void read_scalefactor_selection(@LOC("IN") Bitstream stream,
847         @LOC("THIS,LayerIIDecoder$SubbandLayer2IntensityStereo.H") Crc16 crc) {
848       if (allocation != 0) {
849         scfsi = stream.get_bits(2);
850         channel2_scfsi = stream.get_bits(2);
851         if (crc != null) {
852           crc.add_bits(scfsi, 2);
853           crc.add_bits(channel2_scfsi, 2);
854         }
855       }
856     }
857
858     /**
859            *
860            */
861     public void read_scalefactor(@LOC("IN") Bitstream stream, @LOC("IN") Header header) {
862       if (allocation != 0) {
863         super.read_scalefactor(stream, header);
864         switch (channel2_scfsi) {
865         case 0:
866           channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
867           channel2_scalefactor2 = scalefactors[stream.get_bits(6)];
868           channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
869           break;
870
871         case 1:
872           channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
873           channel2_scalefactor2 = channel2_scalefactor1;
874           channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
875           break;
876
877         case 2:
878           channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
879           channel2_scalefactor2 = channel2_scalefactor1;
880           channel2_scalefactor3 = channel2_scalefactor2;
881           break;
882
883         case 3:
884           channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
885           channel2_scalefactor2 = scalefactors[stream.get_bits(6)];
886           channel2_scalefactor3 = channel2_scalefactor2;
887           break;
888         }
889       }
890
891     }
892
893     /**
894            *
895            */
896     public boolean read_sampledata(@LOC("IN") Bitstream stream) {
897       return super.read_sampledata(stream);
898     }
899
900     /**
901            *
902            */
903     @LATTICE("S2<S1,S1<THIS,THIS<GLOBAL,GLOBAL<IN,S1*,THISLOC=THIS,GLOBALLOC=GLOBAL")
904     @RETURNLOC("S2")
905     public boolean put_next_sample(@LOC("IN") int channels, @LOC("IN") SynthesisFilter filter1,
906         @LOC("IN") SynthesisFilter filter2) {
907       if (allocation != 0) {
908         @LOC("S1") float sample = samples[samplenumber];
909
910         if (groupingtable[0] == null)
911           sample = (sample + d[0]) * c[0];
912         if (channels == OutputChannels.BOTH_CHANNELS) {
913           @LOC("S2") float sample2 = sample;
914           if (groupnumber <= 4) {
915             sample *= scalefactor1;
916             sample2 *= channel2_scalefactor1;
917           } else if (groupnumber <= 8) {
918             sample *= scalefactor2;
919             sample2 *= channel2_scalefactor2;
920           } else {
921             sample *= scalefactor3;
922             sample2 *= channel2_scalefactor3;
923           }
924           filter1.input_sample(sample, subbandnumber);
925           filter2.input_sample(sample2, subbandnumber);
926         } else if (channels == OutputChannels.LEFT_CHANNEL) {
927           if (groupnumber <= 4)
928             sample *= scalefactor1;
929           else if (groupnumber <= 8)
930             sample *= scalefactor2;
931           else
932             sample *= scalefactor3;
933           filter1.input_sample(sample, subbandnumber);
934         } else {
935           if (groupnumber <= 4)
936             sample *= channel2_scalefactor1;
937           else if (groupnumber <= 8)
938             sample *= channel2_scalefactor2;
939           else
940             sample *= channel2_scalefactor3;
941           filter1.input_sample(sample, subbandnumber);
942         }
943       }
944
945       if (++samplenumber == 3)
946         return true;
947       else
948         return false;
949     }
950   };
951
952   /**
953    * Class for layer II subbands in stereo mode.
954    */
955   @LATTICE("S<L,L<H,L<SM,SM<H,H<SH,SH<SH0,SH*,SM*,SH0*")
956   @METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
957   static class SubbandLayer2Stereo extends SubbandLayer2 {
958     @LOC("SH")
959     protected int channel2_allocation;
960     @LOC("SH")
961     protected int channel2_scfsi;
962     @LOC("SH")
963     protected float channel2_scalefactor1;
964     @LOC("SH")
965     protected float channel2_scalefactor2;
966     @LOC("SH")
967     protected float channel2_scalefactor3;
968     // protected boolean channel2_grouping; ???? Never used!
969     @LOC("H")
970     protected int[] channel2_codelength = { 0 };
971     // protected float[][] channel2_groupingtable = {{0},{0}};
972     @LOC("H")
973     protected float[] channel2_factor = { 0.0f };
974     @LOC("SM")
975     protected float[] channel2_samples;
976     @LOC("SM")
977     protected float[] channel2_c = { 0.0f };
978     @LOC("SM")
979     protected float[] channel2_d = { 0.0f };
980
981     /**
982      * Constructor
983      */
984     public SubbandLayer2Stereo(@LOC("IN") int subbandnumber) {
985       super(subbandnumber);
986       channel2_samples = new float[3];
987     }
988
989     /**
990            *
991            */
992     @LATTICE("V<THIS,THIS<IN,THISLOC=THIS")
993     // ssjava
994     public void read_allocation(
995         @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SH") Bitstream stream,
996         @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SH0") Header header,
997         @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.H") Crc16 crc) {
998
999       @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SH0") int length = get_allocationlength(header);
1000       allocation = stream.get_bits(length);
1001       channel2_allocation = stream.get_bits(length);
1002       if (crc != null) {
1003         crc.add_bits(allocation, length);
1004         crc.add_bits(channel2_allocation, length);
1005       }
1006
1007     }
1008
1009     /**
1010            *
1011            */
1012     public void read_scalefactor_selection(@LOC("IN") Bitstream stream,
1013         @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.H") Crc16 crc) {
1014       if (allocation != 0) {
1015         scfsi = stream.get_bits(2);
1016         if (crc != null)
1017           crc.add_bits(scfsi, 2);
1018       }
1019       if (channel2_allocation != 0) {
1020         channel2_scfsi = stream.get_bits(2);
1021         if (crc != null)
1022           crc.add_bits(channel2_scfsi, 2);
1023       }
1024     }
1025
1026     /**
1027            *
1028            */
1029     public void read_scalefactor(@LOC("IN") Bitstream stream, @LOC("IN") Header header) {
1030       super.read_scalefactor(stream, header);
1031       if (channel2_allocation != 0) {
1032         switch (channel2_scfsi) {
1033         case 0:
1034           channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
1035           channel2_scalefactor2 = scalefactors[stream.get_bits(6)];
1036           channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
1037           break;
1038
1039         case 1:
1040           channel2_scalefactor1 = channel2_scalefactor2 = scalefactors[stream.get_bits(6)];
1041           channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
1042           break;
1043
1044         case 2:
1045           channel2_scalefactor1 =
1046               channel2_scalefactor2 = channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
1047           break;
1048
1049         case 3:
1050           channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
1051           channel2_scalefactor2 = channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
1052           break;
1053         }
1054         prepare_sample_reading(header, channel2_allocation, 1, channel2_factor,
1055             channel2_codelength, channel2_c, channel2_d);
1056       }
1057     }
1058
1059     /**
1060            *
1061            */
1062     // ssjava
1063     public boolean read_sampledata(
1064         @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SM") Bitstream stream) {
1065       @LOC("V") boolean returnvalue = super.read_sampledata(stream);
1066
1067       if (channel2_allocation != 0)
1068         if (groupingtable[1] != null) {
1069           @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SM") int samplecode =
1070               stream.get_bits(channel2_codelength[0]);
1071           // create requantized samples:
1072           samplecode += samplecode << 1;
1073
1074           @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SM") int tmp = 0;
1075           @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SM") int temp = samplecode;
1076
1077           channel2_samples[tmp] = groupingtable[1][temp];
1078           temp++;
1079           tmp++;
1080           channel2_samples[tmp] = groupingtable[1][temp];
1081           temp++;
1082           tmp++;
1083           channel2_samples[tmp] = groupingtable[1][temp];
1084
1085         } else {
1086           channel2_samples[0] =
1087               (float) ((stream.get_bits(channel2_codelength[0])) * channel2_factor[0] - 1.0);
1088           channel2_samples[1] =
1089               (float) ((stream.get_bits(channel2_codelength[0])) * channel2_factor[0] - 1.0);
1090           channel2_samples[2] =
1091               (float) ((stream.get_bits(channel2_codelength[0])) * channel2_factor[0] - 1.0);
1092         }
1093       return returnvalue;
1094     }
1095
1096     // ssjava
1097     public boolean put_next_sample(@LOC("IN") int channels, @LOC("IN") SynthesisFilter filter1,
1098         @LOC("IN") SynthesisFilter filter2) {
1099
1100       @LOC("OUT") boolean returnvalue = super.put_next_sample(channels, filter1, filter2);
1101
1102       if ((channel2_allocation != 0) && (channels != OutputChannels.LEFT_CHANNEL)) {
1103
1104         @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SM") float sample =
1105             channel2_samples[samplenumber - 1];
1106
1107         if (groupingtable[1] == null) {
1108           sample = (sample + channel2_d[0]) * channel2_c[0];
1109         }
1110
1111         if (groupnumber <= 4) {
1112           sample *= channel2_scalefactor1;
1113         } else if (groupnumber <= 8) {
1114           sample *= channel2_scalefactor2;
1115         } else {
1116           sample *= channel2_scalefactor3;
1117         }
1118
1119         if (channels == OutputChannels.BOTH_CHANNELS) {
1120           filter2.input_sample(sample, subbandnumber);
1121         } else {
1122           filter1.input_sample(sample, subbandnumber);
1123         }
1124       }
1125
1126       return returnvalue;
1127
1128     }
1129   }
1130 }