~gryle-devel/gryle/trunk-deleted

« back to all changes in this revision

Viewing changes to src/javazoom/jl/decoder/LayerIIDecoder.java

  • Committer: Chris Lamb
  • Date: 2007-01-13 22:14:47 UTC
  • mfrom: (1.2.4 gryle)
  • mto: (1.2.6 gryle)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: csueaj@viglab-29-20070113221447-9rl7yytjuzuibi1g
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
package javazoom.jl.decoder;
 
31
 
 
32
/**
 
33
 * Implements decoding of MPEG Audio Layer II frames.
 
34
 */
 
35
class LayerIIDecoder extends LayerIDecoder implements FrameDecoder {
 
36
 
 
37
        public LayerIIDecoder() {
 
38
        }
 
39
 
 
40
        protected void createSubbands() {
 
41
                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
                for (int i = 0; i < num_subbands; ++i)
 
59
                        ((SubbandLayer2) subbands[i]).read_scalefactor_selection(stream,
 
60
                                        crc);
 
61
        }
 
62
 
 
63
        /**
 
64
         * Class for layer II subbands in single channel mode.
 
65
         */
 
66
        static class SubbandLayer2 extends Subband {
 
67
                // this table contains 3 requantized samples for each legal codeword
 
68
                // when grouped in 5 bits, i.e. 3 quantizationsteps per sample
 
69
                public static final float grouping_5bits[] = new float[] {
 
70
                                -2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f, 0.0f, -2.0f / 3.0f,
 
71
                                -2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f,
 
72
                                -2.0f / 3.0f, 0.0f, -2.0f / 3.0f, 0.0f, 0.0f, -2.0f / 3.0f,
 
73
                                2.0f / 3.0f, 0.0f, -2.0f / 3.0f, -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,
 
75
                                2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f, 0.0f,
 
76
                                0.0f, -2.0f / 3.0f, 0.0f, 2.0f / 3.0f, -2.0f / 3.0f, 0.0f,
 
77
                                -2.0f / 3.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f / 3.0f, 0.0f,
 
78
                                0.0f, -2.0f / 3.0f, 2.0f / 3.0f, 0.0f, 0.0f, 2.0f / 3.0f, 0.0f,
 
79
                                2.0f / 3.0f, 2.0f / 3.0f, 0.0f, -2.0f / 3.0f, -2.0f / 3.0f,
 
80
                                2.0f / 3.0f, 0.0f, -2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f,
 
81
                                -2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, 0.0f, 2.0f / 3.0f,
 
82
                                0.0f, 0.0f, 2.0f / 3.0f, 2.0f / 3.0f, 0.0f, 2.0f / 3.0f,
 
83
                                -2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, 0.0f, 2.0f / 3.0f,
 
84
                                2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, 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,
 
89
                                -0.8f, -0.8f, -0.4f, -0.8f, -0.8f, 0.0f, -0.8f, -0.8f, 0.4f,
 
90
                                -0.8f, -0.8f, 0.8f, -0.8f, -0.8f, -0.8f, -0.4f, -0.8f, -0.4f,
 
91
                                -0.4f, -0.8f, 0.0f, -0.4f, -0.8f, 0.4f, -0.4f, -0.8f, 0.8f,
 
92
                                -0.4f, -0.8f, -0.8f, 0.0f, -0.8f, -0.4f, 0.0f, -0.8f, 0.0f,
 
93
                                0.0f, -0.8f, 0.4f, 0.0f, -0.8f, 0.8f, 0.0f, -0.8f, -0.8f, 0.4f,
 
94
                                -0.8f, -0.4f, 0.4f, -0.8f, 0.0f, 0.4f, -0.8f, 0.4f, 0.4f,
 
95
                                -0.8f, 0.8f, 0.4f, -0.8f, -0.8f, 0.8f, -0.8f, -0.4f, 0.8f,
 
96
                                -0.8f, 0.0f, 0.8f, -0.8f, 0.4f, 0.8f, -0.8f, 0.8f, 0.8f, -0.8f,
 
97
                                -0.8f, -0.8f, -0.4f, -0.4f, -0.8f, -0.4f, 0.0f, -0.8f, -0.4f,
 
98
                                0.4f, -0.8f, -0.4f, 0.8f, -0.8f, -0.4f, -0.8f, -0.4f, -0.4f,
 
99
                                -0.4f, -0.4f, -0.4f, 0.0f, -0.4f, -0.4f, 0.4f, -0.4f, -0.4f,
 
100
                                0.8f, -0.4f, -0.4f, -0.8f, 0.0f, -0.4f, -0.4f, 0.0f, -0.4f,
 
101
                                0.0f, 0.0f, -0.4f, 0.4f, 0.0f, -0.4f, 0.8f, 0.0f, -0.4f, -0.8f,
 
102
                                0.4f, -0.4f, -0.4f, 0.4f, -0.4f, 0.0f, 0.4f, -0.4f, 0.4f, 0.4f,
 
103
                                -0.4f, 0.8f, 0.4f, -0.4f, -0.8f, 0.8f, -0.4f, -0.4f, 0.8f,
 
104
                                -0.4f, 0.0f, 0.8f, -0.4f, 0.4f, 0.8f, -0.4f, 0.8f, 0.8f, -0.4f,
 
105
                                -0.8f, -0.8f, 0.0f, -0.4f, -0.8f, 0.0f, 0.0f, -0.8f, 0.0f,
 
106
                                0.4f, -0.8f, 0.0f, 0.8f, -0.8f, 0.0f, -0.8f, -0.4f, 0.0f,
 
107
                                -0.4f, -0.4f, 0.0f, 0.0f, -0.4f, 0.0f, 0.4f, -0.4f, 0.0f, 0.8f,
 
108
                                -0.4f, 0.0f, -0.8f, 0.0f, 0.0f, -0.4f, 0.0f, 0.0f, 0.0f, 0.0f,
 
109
                                0.0f, 0.4f, 0.0f, 0.0f, 0.8f, 0.0f, 0.0f, -0.8f, 0.4f, 0.0f,
 
110
                                -0.4f, 0.4f, 0.0f, 0.0f, 0.4f, 0.0f, 0.4f, 0.4f, 0.0f, 0.8f,
 
111
                                0.4f, 0.0f, -0.8f, 0.8f, 0.0f, -0.4f, 0.8f, 0.0f, 0.0f, 0.8f,
 
112
                                0.0f, 0.4f, 0.8f, 0.0f, 0.8f, 0.8f, 0.0f, -0.8f, -0.8f, 0.4f,
 
113
                                -0.4f, -0.8f, 0.4f, 0.0f, -0.8f, 0.4f, 0.4f, -0.8f, 0.4f, 0.8f,
 
114
                                -0.8f, 0.4f, -0.8f, -0.4f, 0.4f, -0.4f, -0.4f, 0.4f, 0.0f,
 
115
                                -0.4f, 0.4f, 0.4f, -0.4f, 0.4f, 0.8f, -0.4f, 0.4f, -0.8f, 0.0f,
 
116
                                0.4f, -0.4f, 0.0f, 0.4f, 0.0f, 0.0f, 0.4f, 0.4f, 0.0f, 0.4f,
 
117
                                0.8f, 0.0f, 0.4f, -0.8f, 0.4f, 0.4f, -0.4f, 0.4f, 0.4f, 0.0f,
 
118
                                0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.8f, 0.4f, 0.4f, -0.8f, 0.8f,
 
119
                                0.4f, -0.4f, 0.8f, 0.4f, 0.0f, 0.8f, 0.4f, 0.4f, 0.8f, 0.4f,
 
120
                                0.8f, 0.8f, 0.4f, -0.8f, -0.8f, 0.8f, -0.4f, -0.8f, 0.8f, 0.0f,
 
121
                                -0.8f, 0.8f, 0.4f, -0.8f, 0.8f, 0.8f, -0.8f, 0.8f, -0.8f,
 
122
                                -0.4f, 0.8f, -0.4f, -0.4f, 0.8f, 0.0f, -0.4f, 0.8f, 0.4f,
 
123
                                -0.4f, 0.8f, 0.8f, -0.4f, 0.8f, -0.8f, 0.0f, 0.8f, -0.4f, 0.0f,
 
124
                                0.8f, 0.0f, 0.0f, 0.8f, 0.4f, 0.0f, 0.8f, 0.8f, 0.0f, 0.8f,
 
125
                                -0.8f, 0.4f, 0.8f, -0.4f, 0.4f, 0.8f, 0.0f, 0.4f, 0.8f, 0.4f,
 
126
                                0.4f, 0.8f, 0.8f, 0.4f, 0.8f, -0.8f, 0.8f, 0.8f, -0.4f, 0.8f,
 
127
                                0.8f, 0.0f, 0.8f, 0.8f, 0.4f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f };
 
128
 
 
129
                // this table contains 3 requantized samples for each legal codeword
 
130
                // when grouped in 10 bits, i.e. 9 quantizationsteps per sample
 
131
                public static final float grouping_10bits[] = { -8.0f / 9.0f,
 
132
                                -8.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f,
 
133
                                -8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
 
134
                                -2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 0.0f, -8.0f / 9.0f,
 
135
                                -8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
 
136
                                4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f,
 
137
                                -8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f,
 
138
                                -8.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f,
 
139
                                -6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f,
 
140
                                -6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
 
141
                                -8.0f / 9.0f, 0.0f, -6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f,
 
142
                                -6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f,
 
143
                                -8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f,
 
144
                                8.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
 
145
                                -4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f,
 
146
                                -8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
 
147
                                -2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 0.0f, -4.0f / 9.0f,
 
148
                                -8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
 
149
                                4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f,
 
150
                                -4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f,
 
151
                                -8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f,
 
152
                                -6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f,
 
153
                                -2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
 
154
                                -8.0f / 9.0f, 0.0f, -2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f,
 
155
                                -2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f,
 
156
                                -8.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f,
 
157
                                8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 0.0f,
 
158
                                -8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -8.0f / 9.0f, -4.0f / 9.0f,
 
159
                                0.0f, -8.0f / 9.0f, -2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 0.0f,
 
160
                                0.0f, -8.0f / 9.0f, 2.0f / 9.0f, 0.0f, -8.0f / 9.0f,
 
161
                                4.0f / 9.0f, 0.0f, -8.0f / 9.0f, 6.0f / 9.0f, 0.0f,
 
162
                                -8.0f / 9.0f, 8.0f / 9.0f, 0.0f, -8.0f / 9.0f, -8.0f / 9.0f,
 
163
                                2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
 
164
                                -8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f,
 
165
                                -2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 0.0f, 2.0f / 9.0f,
 
166
                                -8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f,
 
167
                                4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f,
 
168
                                2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f,
 
169
                                -8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f,
 
170
                                -6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f,
 
171
                                4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f,
 
172
                                -8.0f / 9.0f, 0.0f, 4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f,
 
173
                                4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f,
 
174
                                -8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f,
 
175
                                8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
 
176
                                6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f,
 
177
                                -8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f,
 
178
                                -2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 0.0f, 6.0f / 9.0f,
 
179
                                -8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f,
 
180
                                4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f,
 
181
                                6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f,
 
182
                                -8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f,
 
183
                                -6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f,
 
184
                                8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f,
 
185
                                -8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f,
 
186
                                8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f,
 
187
                                -8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f,
 
188
                                8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
 
189
                                -8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f,
 
190
                                -6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f,
 
191
                                -2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -8.0f / 9.0f,
 
192
                                -6.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f,
 
193
                                4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f,
 
194
                                -8.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f,
 
195
                                -6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f,
 
196
                                -6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f,
 
197
                                -6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
 
198
                                -6.0f / 9.0f, 0.0f, -6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
 
199
                                -6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f,
 
200
                                -6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f,
 
201
                                8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f,
 
202
                                -4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f,
 
203
                                -6.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f,
 
204
                                -2.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 0.0f, -4.0f / 9.0f,
 
205
                                -6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f,
 
206
                                4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f,
 
207
                                -4.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f,
 
208
                                -6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
 
209
                                -6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f,
 
210
                                -2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
 
211
                                -6.0f / 9.0f, 0.0f, -2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
 
212
                                -2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f,
 
213
                                -6.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
 
214
                                8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 0.0f,
 
215
                                -6.0f / 9.0f, -6.0f / 9.0f, 0.0f, -6.0f / 9.0f, -4.0f / 9.0f,
 
216
                                0.0f, -6.0f / 9.0f, -2.0f / 9.0f, 0.0f, -6.0f / 9.0f, 0.0f,
 
217
                                0.0f, -6.0f / 9.0f, 2.0f / 9.0f, 0.0f, -6.0f / 9.0f,
 
218
                                4.0f / 9.0f, 0.0f, -6.0f / 9.0f, 6.0f / 9.0f, 0.0f,
 
219
                                -6.0f / 9.0f, 8.0f / 9.0f, 0.0f, -6.0f / 9.0f, -8.0f / 9.0f,
 
220
                                2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
 
221
                                -6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f,
 
222
                                -2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 0.0f, 2.0f / 9.0f,
 
223
                                -6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f,
 
224
                                4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f,
 
225
                                2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f,
 
226
                                -6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f,
 
227
                                -6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f,
 
228
                                4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f,
 
229
                                -6.0f / 9.0f, 0.0f, 4.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
 
230
                                4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f,
 
231
                                -6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f,
 
232
                                8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f,
 
233
                                6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f,
 
234
                                -6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f,
 
235
                                -2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 0.0f, 6.0f / 9.0f,
 
236
                                -6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f,
 
237
                                4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f,
 
238
                                6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f,
 
239
                                -6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f,
 
240
                                -6.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f,
 
241
                                8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f,
 
242
                                -6.0f / 9.0f, 0.0f, 8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
 
243
                                8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f,
 
244
                                -6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f,
 
245
                                8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f,
 
246
                                -8.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f,
 
247
                                -4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f,
 
248
                                -2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 0.0f, -8.0f / 9.0f,
 
249
                                -4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f,
 
250
                                4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f,
 
251
                                -8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f,
 
252
                                -4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f,
 
253
                                -6.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f,
 
254
                                -6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
 
255
                                -4.0f / 9.0f, 0.0f, -6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f,
 
256
                                -6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f,
 
257
                                -4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f,
 
258
                                8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
 
259
                                -4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f,
 
260
                                -4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f,
 
261
                                -2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 0.0f, -4.0f / 9.0f,
 
262
                                -4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f,
 
263
                                4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f,
 
264
                                -4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f,
 
265
                                -4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f,
 
266
                                -6.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f,
 
267
                                -2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
 
268
                                -4.0f / 9.0f, 0.0f, -2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f,
 
269
                                -2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f,
 
270
                                -4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f,
 
271
                                8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 0.0f,
 
272
                                -4.0f / 9.0f, -6.0f / 9.0f, 0.0f, -4.0f / 9.0f, -4.0f / 9.0f,
 
273
                                0.0f, -4.0f / 9.0f, -2.0f / 9.0f, 0.0f, -4.0f / 9.0f, 0.0f,
 
274
                                0.0f, -4.0f / 9.0f, 2.0f / 9.0f, 0.0f, -4.0f / 9.0f,
 
275
                                4.0f / 9.0f, 0.0f, -4.0f / 9.0f, 6.0f / 9.0f, 0.0f,
 
276
                                -4.0f / 9.0f, 8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -8.0f / 9.0f,
 
277
                                2.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
 
278
                                -4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
 
279
                                -2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 2.0f / 9.0f,
 
280
                                -4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
 
281
                                4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f,
 
282
                                2.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f,
 
283
                                -4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f,
 
284
                                -6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f,
 
285
                                4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f,
 
286
                                -4.0f / 9.0f, 0.0f, 4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f,
 
287
                                4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f,
 
288
                                -4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f,
 
289
                                8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
 
290
                                6.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f,
 
291
                                -4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f,
 
292
                                -2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 0.0f, 6.0f / 9.0f,
 
293
                                -4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f,
 
294
                                4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f,
 
295
                                6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f,
 
296
                                -4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f,
 
297
                                -6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f,
 
298
                                8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f,
 
299
                                -4.0f / 9.0f, 0.0f, 8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f,
 
300
                                8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f,
 
301
                                -4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f,
 
302
                                8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
 
303
                                -8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f,
 
304
                                -2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
 
305
                                -2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 0.0f, -8.0f / 9.0f,
 
306
                                -2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
 
307
                                4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f,
 
308
                                -8.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f,
 
309
                                -2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f,
 
310
                                -6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f,
 
311
                                -6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
 
312
                                -2.0f / 9.0f, 0.0f, -6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f,
 
313
                                -6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f,
 
314
                                -2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f,
 
315
                                8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f,
 
316
                                -4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f,
 
317
                                -2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
 
318
                                -2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 0.0f, -4.0f / 9.0f,
 
319
                                -2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
 
320
                                4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f,
 
321
                                -4.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f,
 
322
                                -2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
 
323
                                -6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f,
 
324
                                -2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
 
325
                                -2.0f / 9.0f, 0.0f, -2.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f,
 
326
                                -2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f,
 
327
                                -2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
 
328
                                8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 0.0f,
 
329
                                -2.0f / 9.0f, -6.0f / 9.0f, 0.0f, -2.0f / 9.0f, -4.0f / 9.0f,
 
330
                                0.0f, -2.0f / 9.0f, -2.0f / 9.0f, 0.0f, -2.0f / 9.0f, 0.0f,
 
331
                                0.0f, -2.0f / 9.0f, 2.0f / 9.0f, 0.0f, -2.0f / 9.0f,
 
332
                                4.0f / 9.0f, 0.0f, -2.0f / 9.0f, 6.0f / 9.0f, 0.0f,
 
333
                                -2.0f / 9.0f, 8.0f / 9.0f, 0.0f, -2.0f / 9.0f, -8.0f / 9.0f,
 
334
                                2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
 
335
                                -2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f,
 
336
                                -2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 0.0f, 2.0f / 9.0f,
 
337
                                -2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f,
 
338
                                4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f,
 
339
                                2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f,
 
340
                                -2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f,
 
341
                                -6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f,
 
342
                                4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f,
 
343
                                -2.0f / 9.0f, 0.0f, 4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f,
 
344
                                4.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f,
 
345
                                -2.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f,
 
346
                                8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f,
 
347
                                6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f,
 
348
                                -2.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f,
 
349
                                -2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 0.0f, 6.0f / 9.0f,
 
350
                                -2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f,
 
351
                                4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f,
 
352
                                6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f,
 
353
                                -2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f,
 
354
                                -6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f,
 
355
                                8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f,
 
356
                                -2.0f / 9.0f, 0.0f, 8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f,
 
357
                                8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f,
 
358
                                -2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f,
 
359
                                8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f,
 
360
                                -8.0f / 9.0f, 0.0f, -6.0f / 9.0f, -8.0f / 9.0f, 0.0f,
 
361
                                -4.0f / 9.0f, -8.0f / 9.0f, 0.0f, -2.0f / 9.0f, -8.0f / 9.0f,
 
362
                                0.0f, 0.0f, -8.0f / 9.0f, 0.0f, 2.0f / 9.0f, -8.0f / 9.0f,
 
363
                                0.0f, 4.0f / 9.0f, -8.0f / 9.0f, 0.0f, 6.0f / 9.0f,
 
364
                                -8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -8.0f / 9.0f, 0.0f,
 
365
                                -8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -6.0f / 9.0f, -6.0f / 9.0f,
 
366
                                0.0f, -4.0f / 9.0f, -6.0f / 9.0f, 0.0f, -2.0f / 9.0f,
 
367
                                -6.0f / 9.0f, 0.0f, 0.0f, -6.0f / 9.0f, 0.0f, 2.0f / 9.0f,
 
368
                                -6.0f / 9.0f, 0.0f, 4.0f / 9.0f, -6.0f / 9.0f, 0.0f,
 
369
                                6.0f / 9.0f, -6.0f / 9.0f, 0.0f, 8.0f / 9.0f, -6.0f / 9.0f,
 
370
                                0.0f, -8.0f / 9.0f, -4.0f / 9.0f, 0.0f, -6.0f / 9.0f,
 
371
                                -4.0f / 9.0f, 0.0f, -4.0f / 9.0f, -4.0f / 9.0f, 0.0f,
 
372
                                -2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 0.0f, -4.0f / 9.0f, 0.0f,
 
373
                                2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 4.0f / 9.0f, -4.0f / 9.0f,
 
374
                                0.0f, 6.0f / 9.0f, -4.0f / 9.0f, 0.0f, 8.0f / 9.0f,
 
375
                                -4.0f / 9.0f, 0.0f, -8.0f / 9.0f, -2.0f / 9.0f, 0.0f,
 
376
                                -6.0f / 9.0f, -2.0f / 9.0f, 0.0f, -4.0f / 9.0f, -2.0f / 9.0f,
 
377
                                0.0f, -2.0f / 9.0f, -2.0f / 9.0f, 0.0f, 0.0f, -2.0f / 9.0f,
 
378
                                0.0f, 2.0f / 9.0f, -2.0f / 9.0f, 0.0f, 4.0f / 9.0f,
 
379
                                -2.0f / 9.0f, 0.0f, 6.0f / 9.0f, -2.0f / 9.0f, 0.0f,
 
380
                                8.0f / 9.0f, -2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 0.0f, 0.0f,
 
381
                                -6.0f / 9.0f, 0.0f, 0.0f, -4.0f / 9.0f, 0.0f, 0.0f,
 
382
                                -2.0f / 9.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f / 9.0f, 0.0f,
 
383
                                0.0f, 4.0f / 9.0f, 0.0f, 0.0f, 6.0f / 9.0f, 0.0f, 0.0f,
 
384
                                8.0f / 9.0f, 0.0f, 0.0f, -8.0f / 9.0f, 2.0f / 9.0f, 0.0f,
 
385
                                -6.0f / 9.0f, 2.0f / 9.0f, 0.0f, -4.0f / 9.0f, 2.0f / 9.0f,
 
386
                                0.0f, -2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 0.0f, 2.0f / 9.0f, 0.0f,
 
387
                                2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 2.0f / 9.0f, 0.0f,
 
388
                                6.0f / 9.0f, 2.0f / 9.0f, 0.0f, 8.0f / 9.0f, 2.0f / 9.0f, 0.0f,
 
389
                                -8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -6.0f / 9.0f, 4.0f / 9.0f,
 
390
                                0.0f, -4.0f / 9.0f, 4.0f / 9.0f, 0.0f, -2.0f / 9.0f,
 
391
                                4.0f / 9.0f, 0.0f, 0.0f, 4.0f / 9.0f, 0.0f, 2.0f / 9.0f,
 
392
                                4.0f / 9.0f, 0.0f, 4.0f / 9.0f, 4.0f / 9.0f, 0.0f, 6.0f / 9.0f,
 
393
                                4.0f / 9.0f, 0.0f, 8.0f / 9.0f, 4.0f / 9.0f, 0.0f,
 
394
                                -8.0f / 9.0f, 6.0f / 9.0f, 0.0f, -6.0f / 9.0f, 6.0f / 9.0f,
 
395
                                0.0f, -4.0f / 9.0f, 6.0f / 9.0f, 0.0f, -2.0f / 9.0f,
 
396
                                6.0f / 9.0f, 0.0f, 0.0f, 6.0f / 9.0f, 0.0f, 2.0f / 9.0f,
 
397
                                6.0f / 9.0f, 0.0f, 4.0f / 9.0f, 6.0f / 9.0f, 0.0f, 6.0f / 9.0f,
 
398
                                6.0f / 9.0f, 0.0f, 8.0f / 9.0f, 6.0f / 9.0f, 0.0f,
 
399
                                -8.0f / 9.0f, 8.0f / 9.0f, 0.0f, -6.0f / 9.0f, 8.0f / 9.0f,
 
400
                                0.0f, -4.0f / 9.0f, 8.0f / 9.0f, 0.0f, -2.0f / 9.0f,
 
401
                                8.0f / 9.0f, 0.0f, 0.0f, 8.0f / 9.0f, 0.0f, 2.0f / 9.0f,
 
402
                                8.0f / 9.0f, 0.0f, 4.0f / 9.0f, 8.0f / 9.0f, 0.0f, 6.0f / 9.0f,
 
403
                                8.0f / 9.0f, 0.0f, 8.0f / 9.0f, 8.0f / 9.0f, 0.0f,
 
404
                                -8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f,
 
405
                                -8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
 
406
                                2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 0.0f,
 
407
                                -8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f,
 
408
                                2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f,
 
409
                                6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f,
 
410
                                -8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f,
 
411
                                2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
 
412
                                -4.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f,
 
413
                                -6.0f / 9.0f, 2.0f / 9.0f, 0.0f, -6.0f / 9.0f, 2.0f / 9.0f,
 
414
                                2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f,
 
415
                                -6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f,
 
416
                                2.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
 
417
                                -8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f,
 
418
                                -4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f,
 
419
                                2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 0.0f,
 
420
                                -4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
 
421
                                2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f,
 
422
                                6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f,
 
423
                                -4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
 
424
                                2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f,
 
425
                                -4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f,
 
426
                                -2.0f / 9.0f, 2.0f / 9.0f, 0.0f, -2.0f / 9.0f, 2.0f / 9.0f,
 
427
                                2.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f,
 
428
                                -2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f,
 
429
                                2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f,
 
430
                                -8.0f / 9.0f, 0.0f, 2.0f / 9.0f, -6.0f / 9.0f, 0.0f,
 
431
                                2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 2.0f / 9.0f, -2.0f / 9.0f,
 
432
                                0.0f, 2.0f / 9.0f, 0.0f, 0.0f, 2.0f / 9.0f, 2.0f / 9.0f, 0.0f,
 
433
                                2.0f / 9.0f, 4.0f / 9.0f, 0.0f, 2.0f / 9.0f, 6.0f / 9.0f, 0.0f,
 
434
                                2.0f / 9.0f, 8.0f / 9.0f, 0.0f, 2.0f / 9.0f, -8.0f / 9.0f,
 
435
                                2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
 
436
                                2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f,
 
437
                                -2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 2.0f / 9.0f,
 
438
                                2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f,
 
439
                                4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f,
 
440
                                2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f,
 
441
                                2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
 
442
                                -6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
 
443
                                4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f,
 
444
                                2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f,
 
445
                                4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f,
 
446
                                2.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
 
447
                                8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f,
 
448
                                6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f,
 
449
                                2.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
 
450
                                -2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 0.0f, 6.0f / 9.0f,
 
451
                                2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
 
452
                                4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f,
 
453
                                6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f,
 
454
                                2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f,
 
455
                                -6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
 
456
                                8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f,
 
457
                                2.0f / 9.0f, 0.0f, 8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f,
 
458
                                8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f,
 
459
                                2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f,
 
460
                                8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f,
 
461
                                -8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f,
 
462
                                4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f,
 
463
                                -2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -8.0f / 9.0f,
 
464
                                4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f,
 
465
                                4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f,
 
466
                                -8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f,
 
467
                                4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f,
 
468
                                -6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f,
 
469
                                -6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
 
470
                                4.0f / 9.0f, 0.0f, -6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
 
471
                                -6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f,
 
472
                                4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f,
 
473
                                8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f,
 
474
                                -4.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f,
 
475
                                4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
 
476
                                -2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 0.0f, -4.0f / 9.0f,
 
477
                                4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
 
478
                                4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f,
 
479
                                -4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f,
 
480
                                4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f,
 
481
                                -6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f,
 
482
                                -2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
 
483
                                4.0f / 9.0f, 0.0f, -2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
 
484
                                -2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f,
 
485
                                4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f,
 
486
                                8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 0.0f,
 
487
                                4.0f / 9.0f, -6.0f / 9.0f, 0.0f, 4.0f / 9.0f, -4.0f / 9.0f,
 
488
                                0.0f, 4.0f / 9.0f, -2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 0.0f, 0.0f,
 
489
                                4.0f / 9.0f, 2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 4.0f / 9.0f, 0.0f,
 
490
                                4.0f / 9.0f, 6.0f / 9.0f, 0.0f, 4.0f / 9.0f, 8.0f / 9.0f, 0.0f,
 
491
                                4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f,
 
492
                                -6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f,
 
493
                                2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f,
 
494
                                4.0f / 9.0f, 0.0f, 2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
 
495
                                2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
 
496
                                4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f,
 
497
                                8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f,
 
498
                                4.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f,
 
499
                                4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f,
 
500
                                -2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 0.0f, 4.0f / 9.0f,
 
501
                                4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f,
 
502
                                4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f,
 
503
                                4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f,
 
504
                                4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f,
 
505
                                -6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f,
 
506
                                6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f,
 
507
                                4.0f / 9.0f, 0.0f, 6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
 
508
                                6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f,
 
509
                                4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f,
 
510
                                8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f,
 
511
                                8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f,
 
512
                                4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f,
 
513
                                -2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 0.0f, 8.0f / 9.0f,
 
514
                                4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f,
 
515
                                4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f,
 
516
                                8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f,
 
517
                                4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f,
 
518
                                -6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f,
 
519
                                -8.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f,
 
520
                                6.0f / 9.0f, 0.0f, -8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
 
521
                                -8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f,
 
522
                                6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f,
 
523
                                8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f,
 
524
                                -6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f,
 
525
                                6.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f,
 
526
                                -2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 0.0f, -6.0f / 9.0f,
 
527
                                6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f,
 
528
                                4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f,
 
529
                                -6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f,
 
530
                                6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f,
 
531
                                -6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f,
 
532
                                -4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f,
 
533
                                6.0f / 9.0f, 0.0f, -4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
 
534
                                -4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f,
 
535
                                6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f,
 
536
                                8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f,
 
537
                                -2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f,
 
538
                                6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f,
 
539
                                -2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 0.0f, -2.0f / 9.0f,
 
540
                                6.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f,
 
541
                                4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f,
 
542
                                -2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f,
 
543
                                6.0f / 9.0f, -8.0f / 9.0f, 0.0f, 6.0f / 9.0f, -6.0f / 9.0f,
 
544
                                0.0f, 6.0f / 9.0f, -4.0f / 9.0f, 0.0f, 6.0f / 9.0f,
 
545
                                -2.0f / 9.0f, 0.0f, 6.0f / 9.0f, 0.0f, 0.0f, 6.0f / 9.0f,
 
546
                                2.0f / 9.0f, 0.0f, 6.0f / 9.0f, 4.0f / 9.0f, 0.0f, 6.0f / 9.0f,
 
547
                                6.0f / 9.0f, 0.0f, 6.0f / 9.0f, 8.0f / 9.0f, 0.0f, 6.0f / 9.0f,
 
548
                                -8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f,
 
549
                                2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f,
 
550
                                6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 0.0f,
 
551
                                2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f,
 
552
                                6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f,
 
553
                                6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
 
554
                                2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f,
 
555
                                6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f,
 
556
                                -4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f,
 
557
                                4.0f / 9.0f, 6.0f / 9.0f, 0.0f, 4.0f / 9.0f, 6.0f / 9.0f,
 
558
                                2.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f,
 
559
                                4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f,
 
560
                                6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f,
 
561
                                -8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f,
 
562
                                6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f,
 
563
                                6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 0.0f,
 
564
                                6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f,
 
565
                                6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f,
 
566
                                6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
 
567
                                6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f,
 
568
                                6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f,
 
569
                                -4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f,
 
570
                                8.0f / 9.0f, 6.0f / 9.0f, 0.0f, 8.0f / 9.0f, 6.0f / 9.0f,
 
571
                                2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f,
 
572
                                8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
 
573
                                6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f,
 
574
                                -8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f,
 
575
                                -8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
 
576
                                8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 0.0f,
 
577
                                -8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f,
 
578
                                8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f,
 
579
                                6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f,
 
580
                                -8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f,
 
581
                                8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f,
 
582
                                -4.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f,
 
583
                                -6.0f / 9.0f, 8.0f / 9.0f, 0.0f, -6.0f / 9.0f, 8.0f / 9.0f,
 
584
                                2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f,
 
585
                                -6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f,
 
586
                                8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f,
 
587
                                -8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f,
 
588
                                -4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f,
 
589
                                8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 0.0f,
 
590
                                -4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
 
591
                                8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f,
 
592
                                6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f,
 
593
                                -4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
 
594
                                8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f,
 
595
                                -4.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f,
 
596
                                -2.0f / 9.0f, 8.0f / 9.0f, 0.0f, -2.0f / 9.0f, 8.0f / 9.0f,
 
597
                                2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f,
 
598
                                -2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f,
 
599
                                8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f,
 
600
                                -8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -6.0f / 9.0f, 0.0f,
 
601
                                8.0f / 9.0f, -4.0f / 9.0f, 0.0f, 8.0f / 9.0f, -2.0f / 9.0f,
 
602
                                0.0f, 8.0f / 9.0f, 0.0f, 0.0f, 8.0f / 9.0f, 2.0f / 9.0f, 0.0f,
 
603
                                8.0f / 9.0f, 4.0f / 9.0f, 0.0f, 8.0f / 9.0f, 6.0f / 9.0f, 0.0f,
 
604
                                8.0f / 9.0f, 8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -8.0f / 9.0f,
 
605
                                2.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
 
606
                                8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f,
 
607
                                -2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 0.0f, 2.0f / 9.0f,
 
608
                                8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f,
 
609
                                4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f,
 
610
                                2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f,
 
611
                                8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f,
 
612
                                -6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f,
 
613
                                4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f,
 
614
                                8.0f / 9.0f, 0.0f, 4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f,
 
615
                                4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f,
 
616
                                8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f,
 
617
                                8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f,
 
618
                                6.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f,
 
619
                                8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
 
620
                                -2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 0.0f, 6.0f / 9.0f,
 
621
                                8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
 
622
                                4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f,
 
623
                                6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f,
 
624
                                8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f,
 
625
                                -6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f,
 
626
                                8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f,
 
627
                                8.0f / 9.0f, 0.0f, 8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f,
 
628
                                8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f,
 
629
                                8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f,
 
630
                                8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f };
 
631
 
 
632
                // data taken from ISO/IEC DIS 11172, Annexes 3-B.2[abcd] and 3-B.4:
 
633
 
 
634
                // subbands 0-2 in tables 3-B.2a and 2b: (index is allocation)
 
635
                public static final int table_ab1_codelength[] =
 
636
                // bits per codeword
 
637
                { 0, 5, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
 
638
 
 
639
                public static final float table_ab1_groupingtables[][] =
 
640
                // pointer to sample grouping table, or NULL-pointer if ungrouped
 
641
                { null, grouping_5bits, null, null, null, null, null, null, null, null,
 
642
                                null, null, null, null, null, null };
 
643
 
 
644
                public static final float table_ab1_factor[] =
 
645
                // factor for requantization: (real)sample * factor - 1.0 gives
 
646
                // requantized sample
 
647
                { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 8.0f, 1.0f / 16.0f,
 
648
                                1.0f / 32.0f, 1.0f / 64.0f, 1.0f / 128.0f, 1.0f / 256.0f,
 
649
                                1.0f / 512.0f, 1.0f / 1024.0f, 1.0f / 2048.0f, 1.0f / 4096.0f,
 
650
                                1.0f / 8192.0f, 1.0f / 16384.0f, 1.0f / 32768.0f };
 
651
 
 
652
                public static final float table_ab1_c[] =
 
653
                // factor c for requantization from table 3-B.4
 
654
                { 0.0f, 1.33333333333f, 1.14285714286f, 1.06666666666f, 1.03225806452f,
 
655
                                1.01587301587f, 1.00787401575f, 1.00392156863f, 1.00195694716f,
 
656
                                1.00097751711f, 1.00048851979f, 1.00024420024f, 1.00012208522f,
 
657
                                1.00006103888f, 1.00003051851f, 1.00001525902f };
 
658
 
 
659
                public static final float table_ab1_d[] =
 
660
                // addend d for requantization from table 3-B.4
 
661
                { 0.0f, 0.50000000000f, 0.25000000000f, 0.12500000000f, 0.06250000000f,
 
662
                                0.03125000000f, 0.01562500000f, 0.00781250000f, 0.00390625000f,
 
663
                                0.00195312500f, 0.00097656250f, 0.00048828125f, 0.00024414063f,
 
664
                                0.00012207031f, 0.00006103516f, 0.00003051758f };
 
665
 
 
666
                // subbands 3-... tables 3-B.2a and 2b:
 
667
                public static final float[] table_ab234_groupingtables[] = { null,
 
668
                                grouping_5bits, grouping_7bits, null, grouping_10bits, null,
 
669
                                null, null, null, null, null, null, null, null, null, null };
 
670
 
 
671
                // subbands 3-10 in tables 3-B.2a and 2b:
 
672
                public static final int table_ab2_codelength[] = { 0, 5, 7, 3, 10, 4,
 
673
                                5, 6, 7, 8, 9, 10, 11, 12, 13, 16 };
 
674
 
 
675
                public static final float table_ab2_factor[] = { 0.0f, 1.0f / 2.0f,
 
676
                                1.0f / 4.0f, 1.0f / 4.0f, 1.0f / 8.0f, 1.0f / 8.0f,
 
677
                                1.0f / 16.0f, 1.0f / 32.0f, 1.0f / 64.0f, 1.0f / 128.0f,
 
678
                                1.0f / 256.0f, 1.0f / 512.0f, 1.0f / 1024.0f, 1.0f / 2048.0f,
 
679
                                1.0f / 4096.0f, 1.0f / 32768.0f };
 
680
 
 
681
                public static final float table_ab2_c[] = { 0.0f, 1.33333333333f,
 
682
                                1.60000000000f, 1.14285714286f, 1.77777777777f, 1.06666666666f,
 
683
                                1.03225806452f, 1.01587301587f, 1.00787401575f, 1.00392156863f,
 
684
                                1.00195694716f, 1.00097751711f, 1.00048851979f, 1.00024420024f,
 
685
                                1.00012208522f, 1.00001525902f };
 
686
 
 
687
                public static final float table_ab2_d[] = { 0.0f, 0.50000000000f,
 
688
                                0.50000000000f, 0.25000000000f, 0.50000000000f, 0.12500000000f,
 
689
                                0.06250000000f, 0.03125000000f, 0.01562500000f, 0.00781250000f,
 
690
                                0.00390625000f, 0.00195312500f, 0.00097656250f, 0.00048828125f,
 
691
                                0.00024414063f, 0.00003051758f };
 
692
 
 
693
                // subbands 11-22 in tables 3-B.2a and 2b:
 
694
                public static final int table_ab3_codelength[] = { 0, 5, 7, 3, 10, 4,
 
695
                                5, 16 };
 
696
 
 
697
                public static final float table_ab3_factor[] = { 0.0f, 1.0f / 2.0f,
 
698
                                1.0f / 4.0f, 1.0f / 4.0f, 1.0f / 8.0f, 1.0f / 8.0f,
 
699
                                1.0f / 16.0f, 1.0f / 32768.0f };
 
700
 
 
701
                public static final float table_ab3_c[] = { 0.0f, 1.33333333333f,
 
702
                                1.60000000000f, 1.14285714286f, 1.77777777777f, 1.06666666666f,
 
703
                                1.03225806452f, 1.00001525902f };
 
704
 
 
705
                public static final float table_ab3_d[] = { 0.0f, 0.50000000000f,
 
706
                                0.50000000000f, 0.25000000000f, 0.50000000000f, 0.12500000000f,
 
707
                                0.06250000000f, 0.00003051758f };
 
708
 
 
709
                // subbands 23-... in tables 3-B.2a and 2b:
 
710
                public static final int table_ab4_codelength[] = { 0, 5, 7, 16 };
 
711
 
 
712
                public static final float table_ab4_factor[] = { 0.0f, 1.0f / 2.0f,
 
713
                                1.0f / 4.0f, 1.0f / 32768.0f };
 
714
 
 
715
                public static final float table_ab4_c[] = { 0.0f, 1.33333333333f,
 
716
                                1.60000000000f, 1.00001525902f };
 
717
 
 
718
                public static final float table_ab4_d[] = { 0.0f, 0.50000000000f,
 
719
                                0.50000000000f, 0.00003051758f };
 
720
 
 
721
                // subbands in tables 3-B.2c and 2d:
 
722
                public static final int table_cd_codelength[] = { 0, 5, 7, 10, 4, 5, 6,
 
723
                                7, 8, 9, 10, 11, 12, 13, 14, 15 };
 
724
 
 
725
                public static final float table_cd_groupingtables[][] = { null,
 
726
                                grouping_5bits, grouping_7bits, grouping_10bits, null, null,
 
727
                                null, null, null, null, null, null, null, null, null, null };
 
728
 
 
729
                public static final float table_cd_factor[] = { 0.0f, 1.0f / 2.0f,
 
730
                                1.0f / 4.0f, 1.0f / 8.0f, 1.0f / 8.0f, 1.0f / 16.0f,
 
731
                                1.0f / 32.0f, 1.0f / 64.0f, 1.0f / 128.0f, 1.0f / 256.0f,
 
732
                                1.0f / 512.0f, 1.0f / 1024.0f, 1.0f / 2048.0f, 1.0f / 4096.0f,
 
733
                                1.0f / 8192.0f, 1.0f / 16384.0f };
 
734
 
 
735
                public static final float table_cd_c[] = { 0.0f, 1.33333333333f,
 
736
                                1.60000000000f, 1.77777777777f, 1.06666666666f, 1.03225806452f,
 
737
                                1.01587301587f, 1.00787401575f, 1.00392156863f, 1.00195694716f,
 
738
                                1.00097751711f, 1.00048851979f, 1.00024420024f, 1.00012208522f,
 
739
                                1.00006103888f, 1.00003051851f };
 
740
 
 
741
                public static final float table_cd_d[] = { 0.0f, 0.50000000000f,
 
742
                                0.50000000000f, 0.50000000000f, 0.12500000000f, 0.06250000000f,
 
743
                                0.03125000000f, 0.01562500000f, 0.00781250000f, 0.00390625000f,
 
744
                                0.00195312500f, 0.00097656250f, 0.00048828125f, 0.00024414063f,
 
745
                                0.00012207031f, 0.00006103516f };
 
746
 
 
747
                protected int subbandnumber;
 
748
 
 
749
                protected int allocation;
 
750
 
 
751
                protected int scfsi;
 
752
 
 
753
                protected float scalefactor1, scalefactor2, scalefactor3;
 
754
 
 
755
                protected int[] codelength = { 0 };
 
756
 
 
757
                protected float groupingtable[][] = new float[2][];
 
758
 
 
759
                // protected float[][] groupingtable = {{0},{0}} ;
 
760
                protected float[] factor = { 0.0f };
 
761
 
 
762
                protected int groupnumber;
 
763
 
 
764
                protected int samplenumber;
 
765
 
 
766
                protected float[] samples = new float[3];
 
767
 
 
768
                protected float[] c = { 0 };
 
769
 
 
770
                protected float[] d = { 0 };
 
771
 
 
772
                /**
 
773
                 * Constructor
 
774
                 */
 
775
                public SubbandLayer2(int subbandnumber) {
 
776
                        this.subbandnumber = subbandnumber;
 
777
                        groupnumber = samplenumber = 0;
 
778
                }
 
779
 
 
780
                /**
 
781
                 * 
 
782
                 */
 
783
                protected int get_allocationlength(Header header) {
 
784
                        if (header.version() == Header.MPEG1) {
 
785
                                int channel_bitrate = header.bitrate_index();
 
786
 
 
787
                                // calculate bitrate per channel:
 
788
                                if (header.mode() != Header.SINGLE_CHANNEL)
 
789
                                        if (channel_bitrate == 4)
 
790
                                                channel_bitrate = 1;
 
791
                                        else
 
792
                                                channel_bitrate -= 4;
 
793
 
 
794
                                if (channel_bitrate == 1 || channel_bitrate == 2)
 
795
                                        // table 3-B.2c or 3-B.2d
 
796
                                        if (subbandnumber <= 1)
 
797
                                                return 4;
 
798
                                        else
 
799
                                                return 3;
 
800
                                else
 
801
                                // tables 3-B.2a or 3-B.2b
 
802
                                if (subbandnumber <= 10)
 
803
                                        return 4;
 
804
                                else if (subbandnumber <= 22)
 
805
                                        return 3;
 
806
                                else
 
807
                                        return 2;
 
808
                        } else { // MPEG-2 LSF -- Jeff
 
809
 
 
810
                                // table B.1 of ISO/IEC 13818-3
 
811
                                if (subbandnumber <= 3)
 
812
                                        return 4;
 
813
                                else if (subbandnumber <= 10)
 
814
                                        return 3;
 
815
                                else
 
816
                                        return 2;
 
817
                        }
 
818
                }
 
819
 
 
820
                /**
 
821
                 * 
 
822
                 */
 
823
                protected void prepare_sample_reading(Header header, int allocation,
 
824
                                // float[][] groupingtable,
 
825
                                int channel, float[] factor, int[] codelength, float[] c,
 
826
                                float[] d) {
 
827
                        int channel_bitrate = header.bitrate_index();
 
828
                        // calculate bitrate per channel:
 
829
                        if (header.mode() != Header.SINGLE_CHANNEL)
 
830
                                if (channel_bitrate == 4)
 
831
                                        channel_bitrate = 1;
 
832
                                else
 
833
                                        channel_bitrate -= 4;
 
834
 
 
835
                        if (channel_bitrate == 1 || channel_bitrate == 2) {
 
836
                                // table 3-B.2c or 3-B.2d
 
837
                                groupingtable[channel] = table_cd_groupingtables[allocation];
 
838
                                factor[0] = table_cd_factor[allocation];
 
839
                                codelength[0] = table_cd_codelength[allocation];
 
840
                                c[0] = table_cd_c[allocation];
 
841
                                d[0] = table_cd_d[allocation];
 
842
                        } else {
 
843
                                // tables 3-B.2a or 3-B.2b
 
844
                                if (subbandnumber <= 2) {
 
845
                                        groupingtable[channel] = table_ab1_groupingtables[allocation];
 
846
                                        factor[0] = table_ab1_factor[allocation];
 
847
                                        codelength[0] = table_ab1_codelength[allocation];
 
848
                                        c[0] = table_ab1_c[allocation];
 
849
                                        d[0] = table_ab1_d[allocation];
 
850
                                } else {
 
851
                                        groupingtable[channel] = table_ab234_groupingtables[allocation];
 
852
                                        if (subbandnumber <= 10) {
 
853
                                                factor[0] = table_ab2_factor[allocation];
 
854
                                                codelength[0] = table_ab2_codelength[allocation];
 
855
                                                c[0] = table_ab2_c[allocation];
 
856
                                                d[0] = table_ab2_d[allocation];
 
857
                                        } else if (subbandnumber <= 22) {
 
858
                                                factor[0] = table_ab3_factor[allocation];
 
859
                                                codelength[0] = table_ab3_codelength[allocation];
 
860
                                                c[0] = table_ab3_c[allocation];
 
861
                                                d[0] = table_ab3_d[allocation];
 
862
                                        } else {
 
863
                                                factor[0] = table_ab4_factor[allocation];
 
864
                                                codelength[0] = table_ab4_codelength[allocation];
 
865
                                                c[0] = table_ab4_c[allocation];
 
866
                                                d[0] = table_ab4_d[allocation];
 
867
                                        }
 
868
                                }
 
869
                        }
 
870
                }
 
871
 
 
872
                /**
 
873
                 * 
 
874
                 */
 
875
                public void read_allocation(Bitstream stream, Header header, Crc16 crc) {
 
876
                        int length = get_allocationlength(header);
 
877
                        allocation = stream.get_bits(length);
 
878
                        if (crc != null)
 
879
                                crc.add_bits(allocation, length);
 
880
                }
 
881
 
 
882
                /**
 
883
                 * 
 
884
                 */
 
885
                public void read_scalefactor_selection(Bitstream stream, Crc16 crc) {
 
886
                        if (allocation != 0) {
 
887
                                scfsi = stream.get_bits(2);
 
888
                                if (crc != null)
 
889
                                        crc.add_bits(scfsi, 2);
 
890
                        }
 
891
                }
 
892
 
 
893
                /**
 
894
                 * 
 
895
                 */
 
896
                public void read_scalefactor(Bitstream stream, Header header) {
 
897
                        if (allocation != 0) {
 
898
                                switch (scfsi) {
 
899
                                case 0:
 
900
                                        scalefactor1 = scalefactors[stream.get_bits(6)];
 
901
                                        scalefactor2 = scalefactors[stream.get_bits(6)];
 
902
                                        scalefactor3 = scalefactors[stream.get_bits(6)];
 
903
                                        break;
 
904
                                case 1:
 
905
                                        scalefactor1 = scalefactor2 = scalefactors[stream
 
906
                                                        .get_bits(6)];
 
907
                                        scalefactor3 = scalefactors[stream.get_bits(6)];
 
908
                                        break;
 
909
                                case 2:
 
910
                                        scalefactor1 = scalefactor2 = scalefactor3 = scalefactors[stream
 
911
                                                        .get_bits(6)];
 
912
                                        break;
 
913
                                case 3:
 
914
                                        scalefactor1 = scalefactors[stream.get_bits(6)];
 
915
                                        scalefactor2 = scalefactor3 = scalefactors[stream
 
916
                                                        .get_bits(6)];
 
917
                                        break;
 
918
                                }
 
919
                                prepare_sample_reading(header, allocation, 0, factor,
 
920
                                                codelength, c, d);
 
921
                        }
 
922
                }
 
923
 
 
924
                /**
 
925
                 * 
 
926
                 */
 
927
                public boolean read_sampledata(Bitstream stream) {
 
928
                        if (allocation != 0)
 
929
                                if (groupingtable[0] != null) {
 
930
                                        int samplecode = stream.get_bits(codelength[0]);
 
931
                                        // create requantized samples:
 
932
                                        samplecode += samplecode << 1;
 
933
                                        float[] target = samples;
 
934
                                        float[] source = groupingtable[0];
 
935
                                        /*
 
936
                                         * int tmp = 0; int temp = 0; target[tmp++] =
 
937
                                         * source[samplecode + temp]; temp++; target[tmp++] =
 
938
                                         * source[samplecode + temp]; temp++; target[tmp] =
 
939
                                         * source[samplecode + temp];
 
940
                                         */
 
941
                                        // Bugfix:
 
942
                                        int tmp = 0;
 
943
                                        int temp = samplecode;
 
944
 
 
945
                                        if (temp > source.length - 3)
 
946
                                                temp = source.length - 3;
 
947
 
 
948
                                        target[tmp] = source[temp];
 
949
                                        temp++;
 
950
                                        tmp++;
 
951
                                        target[tmp] = source[temp];
 
952
                                        temp++;
 
953
                                        tmp++;
 
954
                                        target[tmp] = source[temp];
 
955
 
 
956
                                        // memcpy (samples, groupingtable + samplecode, 3 * sizeof
 
957
                                        // (real));
 
958
                                } else {
 
959
                                        samples[0] = (float) ((stream.get_bits(codelength[0]))
 
960
                                                        * factor[0] - 1.0);
 
961
                                        samples[1] = (float) ((stream.get_bits(codelength[0]))
 
962
                                                        * factor[0] - 1.0);
 
963
                                        samples[2] = (float) ((stream.get_bits(codelength[0]))
 
964
                                                        * factor[0] - 1.0);
 
965
                                }
 
966
 
 
967
                        samplenumber = 0;
 
968
                        if (++groupnumber == 12)
 
969
                                return true;
 
970
                        else
 
971
                                return false;
 
972
                }
 
973
 
 
974
                /**
 
975
                 * 
 
976
                 */
 
977
                public boolean put_next_sample(int channels, SynthesisFilter filter1,
 
978
                                SynthesisFilter filter2) {
 
979
                        if ((allocation != 0) && (channels != OutputChannels.RIGHT_CHANNEL)) {
 
980
                                float sample = samples[samplenumber];
 
981
 
 
982
                                if (groupingtable[0] == null)
 
983
                                        sample = (sample + d[0]) * c[0];
 
984
                                if (groupnumber <= 4)
 
985
                                        sample *= scalefactor1;
 
986
                                else if (groupnumber <= 8)
 
987
                                        sample *= scalefactor2;
 
988
                                else
 
989
                                        sample *= scalefactor3;
 
990
                                filter1.input_sample(sample, subbandnumber);
 
991
                        }
 
992
 
 
993
                        if (++samplenumber == 3)
 
994
                                return true;
 
995
                        else
 
996
                                return false;
 
997
                }
 
998
        };
 
999
 
 
1000
        /**
 
1001
         * Class for layer II subbands in joint stereo mode.
 
1002
         */
 
1003
        static class SubbandLayer2IntensityStereo extends SubbandLayer2 {
 
1004
                protected int channel2_scfsi;
 
1005
 
 
1006
                protected float channel2_scalefactor1, channel2_scalefactor2,
 
1007
                                channel2_scalefactor3;
 
1008
 
 
1009
                /**
 
1010
                 * Constructor
 
1011
                 */
 
1012
                public SubbandLayer2IntensityStereo(int subbandnumber) {
 
1013
                        super(subbandnumber);
 
1014
                }
 
1015
 
 
1016
                /**
 
1017
                 * 
 
1018
                 */
 
1019
                public void read_allocation(Bitstream stream, Header header, Crc16 crc) {
 
1020
                        super.read_allocation(stream, header, crc);
 
1021
                }
 
1022
 
 
1023
                /**
 
1024
                 * 
 
1025
                 */
 
1026
                public void read_scalefactor_selection(Bitstream stream, Crc16 crc) {
 
1027
                        if (allocation != 0) {
 
1028
                                scfsi = stream.get_bits(2);
 
1029
                                channel2_scfsi = stream.get_bits(2);
 
1030
                                if (crc != null) {
 
1031
                                        crc.add_bits(scfsi, 2);
 
1032
                                        crc.add_bits(channel2_scfsi, 2);
 
1033
                                }
 
1034
                        }
 
1035
                }
 
1036
 
 
1037
                /**
 
1038
                 * 
 
1039
                 */
 
1040
                public void read_scalefactor(Bitstream stream, Header header) {
 
1041
                        if (allocation != 0) {
 
1042
                                super.read_scalefactor(stream, header);
 
1043
                                switch (channel2_scfsi) {
 
1044
                                case 0:
 
1045
                                        channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
 
1046
                                        channel2_scalefactor2 = scalefactors[stream.get_bits(6)];
 
1047
                                        channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
 
1048
                                        break;
 
1049
 
 
1050
                                case 1:
 
1051
                                        channel2_scalefactor1 = channel2_scalefactor2 = scalefactors[stream
 
1052
                                                        .get_bits(6)];
 
1053
                                        channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
 
1054
                                        break;
 
1055
 
 
1056
                                case 2:
 
1057
                                        channel2_scalefactor1 = channel2_scalefactor2 = channel2_scalefactor3 = scalefactors[stream
 
1058
                                                        .get_bits(6)];
 
1059
                                        break;
 
1060
 
 
1061
                                case 3:
 
1062
                                        channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
 
1063
                                        channel2_scalefactor2 = channel2_scalefactor3 = scalefactors[stream
 
1064
                                                        .get_bits(6)];
 
1065
                                        break;
 
1066
                                }
 
1067
                        }
 
1068
 
 
1069
                }
 
1070
 
 
1071
                /**
 
1072
                 * 
 
1073
                 */
 
1074
                public boolean read_sampledata(Bitstream stream) {
 
1075
                        return super.read_sampledata(stream);
 
1076
                }
 
1077
 
 
1078
                /**
 
1079
                 * 
 
1080
                 */
 
1081
                public boolean put_next_sample(int channels, SynthesisFilter filter1,
 
1082
                                SynthesisFilter filter2) {
 
1083
                        if (allocation != 0) {
 
1084
                                float sample = samples[samplenumber];
 
1085
 
 
1086
                                if (groupingtable[0] == null)
 
1087
                                        sample = (sample + d[0]) * c[0];
 
1088
                                if (channels == OutputChannels.BOTH_CHANNELS) {
 
1089
                                        float sample2 = sample;
 
1090
                                        if (groupnumber <= 4) {
 
1091
                                                sample *= scalefactor1;
 
1092
                                                sample2 *= channel2_scalefactor1;
 
1093
                                        } else if (groupnumber <= 8) {
 
1094
                                                sample *= scalefactor2;
 
1095
                                                sample2 *= channel2_scalefactor2;
 
1096
                                        } else {
 
1097
                                                sample *= scalefactor3;
 
1098
                                                sample2 *= channel2_scalefactor3;
 
1099
                                        }
 
1100
                                        filter1.input_sample(sample, subbandnumber);
 
1101
                                        filter2.input_sample(sample2, subbandnumber);
 
1102
                                } else if (channels == OutputChannels.LEFT_CHANNEL) {
 
1103
                                        if (groupnumber <= 4)
 
1104
                                                sample *= scalefactor1;
 
1105
                                        else if (groupnumber <= 8)
 
1106
                                                sample *= scalefactor2;
 
1107
                                        else
 
1108
                                                sample *= scalefactor3;
 
1109
                                        filter1.input_sample(sample, subbandnumber);
 
1110
                                } else {
 
1111
                                        if (groupnumber <= 4)
 
1112
                                                sample *= channel2_scalefactor1;
 
1113
                                        else if (groupnumber <= 8)
 
1114
                                                sample *= channel2_scalefactor2;
 
1115
                                        else
 
1116
                                                sample *= channel2_scalefactor3;
 
1117
                                        filter1.input_sample(sample, subbandnumber);
 
1118
                                }
 
1119
                        }
 
1120
 
 
1121
                        if (++samplenumber == 3)
 
1122
                                return true;
 
1123
                        else
 
1124
                                return false;
 
1125
                }
 
1126
        };
 
1127
 
 
1128
        /**
 
1129
         * Class for layer II subbands in stereo mode.
 
1130
         */
 
1131
        static class SubbandLayer2Stereo extends SubbandLayer2 {
 
1132
                protected int channel2_allocation;
 
1133
 
 
1134
                protected int channel2_scfsi;
 
1135
 
 
1136
                protected float channel2_scalefactor1, channel2_scalefactor2,
 
1137
                                channel2_scalefactor3;
 
1138
 
 
1139
                // protected boolean channel2_grouping; ???? Never used!
 
1140
                protected int[] channel2_codelength = { 0 };
 
1141
 
 
1142
                // protected float[][] channel2_groupingtable = {{0},{0}};
 
1143
                protected float[] channel2_factor = { 0 };
 
1144
 
 
1145
                protected float[] channel2_samples;
 
1146
 
 
1147
                protected float[] channel2_c = { 0 };
 
1148
 
 
1149
                protected float[] channel2_d = { 0 };
 
1150
 
 
1151
                /**
 
1152
                 * Constructor
 
1153
                 */
 
1154
                public SubbandLayer2Stereo(int subbandnumber) {
 
1155
                        super(subbandnumber);
 
1156
                        channel2_samples = new float[3];
 
1157
                }
 
1158
 
 
1159
                /**
 
1160
                 * 
 
1161
                 */
 
1162
                public void read_allocation(Bitstream stream, Header header, Crc16 crc) {
 
1163
                        int length = get_allocationlength(header);
 
1164
                        allocation = stream.get_bits(length);
 
1165
                        channel2_allocation = stream.get_bits(length);
 
1166
                        if (crc != null) {
 
1167
                                crc.add_bits(allocation, length);
 
1168
                                crc.add_bits(channel2_allocation, length);
 
1169
                        }
 
1170
                }
 
1171
 
 
1172
                /**
 
1173
                 * 
 
1174
                 */
 
1175
                public void read_scalefactor_selection(Bitstream stream, Crc16 crc) {
 
1176
                        if (allocation != 0) {
 
1177
                                scfsi = stream.get_bits(2);
 
1178
                                if (crc != null)
 
1179
                                        crc.add_bits(scfsi, 2);
 
1180
                        }
 
1181
                        if (channel2_allocation != 0) {
 
1182
                                channel2_scfsi = stream.get_bits(2);
 
1183
                                if (crc != null)
 
1184
                                        crc.add_bits(channel2_scfsi, 2);
 
1185
                        }
 
1186
                }
 
1187
 
 
1188
                /**
 
1189
                 * 
 
1190
                 */
 
1191
                public void read_scalefactor(Bitstream stream, Header header) {
 
1192
                        super.read_scalefactor(stream, header);
 
1193
                        if (channel2_allocation != 0) {
 
1194
                                switch (channel2_scfsi) {
 
1195
                                case 0:
 
1196
                                        channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
 
1197
                                        channel2_scalefactor2 = scalefactors[stream.get_bits(6)];
 
1198
                                        channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
 
1199
                                        break;
 
1200
 
 
1201
                                case 1:
 
1202
                                        channel2_scalefactor1 = channel2_scalefactor2 = scalefactors[stream
 
1203
                                                        .get_bits(6)];
 
1204
                                        channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
 
1205
                                        break;
 
1206
 
 
1207
                                case 2:
 
1208
                                        channel2_scalefactor1 = channel2_scalefactor2 = channel2_scalefactor3 = scalefactors[stream
 
1209
                                                        .get_bits(6)];
 
1210
                                        break;
 
1211
 
 
1212
                                case 3:
 
1213
                                        channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
 
1214
                                        channel2_scalefactor2 = channel2_scalefactor3 = scalefactors[stream
 
1215
                                                        .get_bits(6)];
 
1216
                                        break;
 
1217
                                }
 
1218
                                prepare_sample_reading(header, channel2_allocation, 1,
 
1219
                                                channel2_factor, channel2_codelength, channel2_c,
 
1220
                                                channel2_d);
 
1221
                        }
 
1222
                }
 
1223
 
 
1224
                /**
 
1225
                 * 
 
1226
                 */
 
1227
                public boolean read_sampledata(Bitstream stream) {
 
1228
                        boolean returnvalue = super.read_sampledata(stream);
 
1229
 
 
1230
                        if (channel2_allocation != 0)
 
1231
                                if (groupingtable[1] != null) {
 
1232
                                        int samplecode = stream.get_bits(channel2_codelength[0]);
 
1233
                                        // create requantized samples:
 
1234
                                        samplecode += samplecode << 1;
 
1235
                                        /*
 
1236
                                         * float[] target = channel2_samples; float[] source =
 
1237
                                         * channel2_groupingtable[0]; int tmp = 0; int temp = 0;
 
1238
                                         * target[tmp++] = source[samplecode + temp]; temp++;
 
1239
                                         * target[tmp++] = source[samplecode + temp]; temp++;
 
1240
                                         * target[tmp] = source[samplecode + temp]; // memcpy
 
1241
                                         * (channel2_samples, channel2_groupingtable + samplecode, 3 *
 
1242
                                         * sizeof (real));
 
1243
                                         */
 
1244
                                        float[] target = channel2_samples;
 
1245
                                        float[] source = groupingtable[1];
 
1246
                                        int tmp = 0;
 
1247
                                        int temp = samplecode;
 
1248
                                        target[tmp] = source[temp];
 
1249
                                        temp++;
 
1250
                                        tmp++;
 
1251
                                        target[tmp] = source[temp];
 
1252
                                        temp++;
 
1253
                                        tmp++;
 
1254
                                        target[tmp] = source[temp];
 
1255
 
 
1256
                                } else {
 
1257
                                        channel2_samples[0] = (float) ((stream
 
1258
                                                        .get_bits(channel2_codelength[0]))
 
1259
                                                        * channel2_factor[0] - 1.0);
 
1260
                                        channel2_samples[1] = (float) ((stream
 
1261
                                                        .get_bits(channel2_codelength[0]))
 
1262
                                                        * channel2_factor[0] - 1.0);
 
1263
                                        channel2_samples[2] = (float) ((stream
 
1264
                                                        .get_bits(channel2_codelength[0]))
 
1265
                                                        * channel2_factor[0] - 1.0);
 
1266
                                }
 
1267
                        return returnvalue;
 
1268
                }
 
1269
 
 
1270
                /**
 
1271
                 * 
 
1272
                 */
 
1273
                public boolean put_next_sample(int channels, SynthesisFilter filter1,
 
1274
                                SynthesisFilter filter2) {
 
1275
                        boolean returnvalue = super.put_next_sample(channels, filter1,
 
1276
                                        filter2);
 
1277
                        if ((channel2_allocation != 0)
 
1278
                                        && (channels != OutputChannels.LEFT_CHANNEL)) {
 
1279
                                float sample = channel2_samples[samplenumber - 1];
 
1280
 
 
1281
                                if (groupingtable[1] == null)
 
1282
                                        sample = (sample + channel2_d[0]) * channel2_c[0];
 
1283
 
 
1284
                                if (groupnumber <= 4)
 
1285
                                        sample *= channel2_scalefactor1;
 
1286
                                else if (groupnumber <= 8)
 
1287
                                        sample *= channel2_scalefactor2;
 
1288
                                else
 
1289
                                        sample *= channel2_scalefactor3;
 
1290
                                if (channels == OutputChannels.BOTH_CHANNELS)
 
1291
                                        filter2.input_sample(sample, subbandnumber);
 
1292
                                else
 
1293
                                        filter1.input_sample(sample, subbandnumber);
 
1294
                        }
 
1295
                        return returnvalue;
 
1296
                }
 
1297
        }
 
1298
}