]> git.sesse.net Git - vlc/blob - include/audio_constants.h
1d4893beec005dc31efb3dabc83e72450c515cbc
[vlc] / include / audio_constants.h
1 /*****************************************************************************
2  * audio_constants.h : defines the MPEG1 Layer I-II audio constants and tables
3  * (c)1999 VideoLAN
4  *****************************************************************************/
5
6
7 /*****************************************************************************
8  * 32 bits (4 bytes) audio frame header definitions
9  *****************************************************************************/
10 /*
11  * syncword == `1111 1111 1111'
12  */
13 #define ADEC_HEADER_SYNCWORD_MASK               0xFFF00000
14 #define ADEC_HEADER_SYNCWORD_SHIFT              20
15
16 /* ID :
17  *
18  * `0' == reserved
19  * `1' == ISO/CEI 11172-3
20  */
21 #define ADEC_HEADER_ID_MASK                     0x00080000
22 #define ADEC_HEADER_ID_SHIFT                    19
23
24 /*
25  * Layer :
26  *
27  * - `00' == reserved
28  * - `01' == Layer III
29  * - `10' == Layer II
30  * - `11' == Layer I
31  */
32 #define ADEC_HEADER_LAYER_MASK                  0x00060000
33 #define ADEC_HEADER_LAYER_SHIFT                 17
34
35 #define ADEC_HEADER_LAYER_1                     0x00060000
36 #define ADEC_HEADER_LAYER_2                     0x00040000
37 #define ADEC_HEADER_LAYER_3                     0x00020000
38
39 /* protection_bit */
40 #define ADEC_HEADER_PROTECTION_BIT_MASK         0x00010000
41 #define ADEC_HEADER_PROTECTION_BIT_SHIFT        16
42
43 /* bitrate_index */
44 #define ADEC_HEADER_BITRATE_INDEX_MASK          0x0000F000
45 #define ADEC_HEADER_BITRATE_INDEX_SHIFT         12
46
47 /*
48  * sampling_frequency :
49  *
50  * - `00' == 44100 Hz
51  * - `01' == 48000 Hz
52  * - `10' == 32000 Hz
53  * - `11' == reserved
54  */
55 #define ADEC_HEADER_SAMPLING_FREQUENCY_MASK     0x00000C00
56 #define ADEC_HEADER_SAMPLING_FREQUENCY_SHIFT    10
57
58 /* padding_bit */
59 #define ADEC_HEADER_PADDING_BIT_MASK            0x00000200
60 #define ADEC_HEADER_PADDING_BIT_SHIFT           9
61
62 /* private_bit */
63 #define ADEC_HEADER_PRIVATE_BIT_MASK            0x00000100
64 #define ADEC_HEADER_PRIVATE_BIT_SHIFT           8
65
66 /*
67  * mode :
68  *
69  * - `00' == stereo (stereo mode)
70  * - `01' == combined stereo (stereo mode)
71  * - `10' == two channels (stereo mode)
72  * - `11' == one channel (mono mode)
73  */
74 #define ADEC_HEADER_MODE_MASK                   0x000000C0
75 #define ADEC_HEADER_MODE_SHIFT                  6
76
77 /* mode_extension */
78 #define ADEC_HEADER_MODE_EXTENSION_MASK         0x00000030
79 #define ADEC_HEADER_MODE_EXTENSION_SHIFT        4
80
81 /* copyright */
82 #define ADEC_HEADER_COPYRIGHT_MASK              0x00000008
83 #define ADEC_HEADER_COPYRIGHT_SHIFT             3
84
85 /* original/copy */
86 #define ADEC_HEADER_ORIGINAL_COPY_MASK          0x00000004
87 #define ADEC_HEADER_ORIGINAL_COPY_SHIFT         2
88
89 /* emphasis */
90 #define ADEC_HEADER_EMPHASIS_MASK               0x00000003
91 #define ADEC_HEADER_EMPHASIS_SHIFT              0
92
93
94 /*****************************************************************************
95  * frame sizes = f( layer, padding_bit, sampling_frequency, bitrate_index )
96  *****************************************************************************
97  * ISO/IEC 11172-3 2.4.3.1 explains how to find out the number of bytes between
98  * two consecutive syncwords. In order to work out the body size of the frame,
99  * we just have to substract 4 bytes for the header size.
100  *
101  * = Layer I : (slot_size == 4 bytes)
102  *   - padding_bit == 0 :
103  *     frame_size = ( floor(  12 * bitrate(layer, bitrate_index) / sampling_frequency ) * 4 ) - 4
104  *   - padding_bit == 1 :
105  *     frame_size = (  ceil(  12 * bitrate(layer, bitrate_index) / sampling_frequency ) * 4 ) - 4
106  *
107  * = Layer II : (slot_size == 1 byte)
108  *   - padding_bit == 0 :
109  *     frame_size = ( floor( 144 * bitrate(layer, bitrate_index) / sampling_frequency ) * 1 ) - 4
110  *   - padding_bit == 1 :
111  *     frame_size = (  ceil( 144 * bitrate(layer, bitrate_index) / sampling_frequency ) * 1 ) - 4
112  *
113  * The frame sizes are stored in the following array :
114  * frame_size = ADEC_FRAME_SIZE[ 128*layer + 64*padding_bit + 16*sampling_frequency + bitrate_index ]
115  *****************************************************************************/
116 #if 0
117 #define ADEC_FRAME_SIZE \
118 { \
119     /* Layer == `00' (reserved) */ \
120 \
121         /* padding_bit == `0' */ \
122 \
123             /* sampling_frequency == `00' (44100 Hz) */ \
124                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
125             /* sampling_frequency == `01' (48000 Hz) */ \
126                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
127             /* sampling_frequency == `10' (32000 Hz) */ \
128                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
129             /* sampling_frequency == `11' (reserved) */ \
130                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
131 \
132         /* padding_bit == `1' */ \
133 \
134             /* sampling_frequency == `00' (44100 Hz) */ \
135                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
136             /* sampling_frequency == `01' (48000 Hz) */ \
137                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
138             /* sampling_frequency == `10' (32000 Hz) */ \
139                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
140             /* sampling_frequency == `11' (reserved) */ \
141                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
142 \
143 \
144     /* Layer == `01' (III) */ \
145 \
146         /* padding_bit == `0' */ \
147 \
148             /* sampling_frequency == `00' (44100 Hz) */ \
149                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
150             /* sampling_frequency == `01' (48000 Hz) */ \
151                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
152             /* sampling_frequency == `10' (32000 Hz) */ \
153                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
154             /* sampling_frequency == `11' (reserved) */ \
155                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
156 \
157         /* padding_bit == `1' */ \
158 \
159             /* sampling_frequency == `00' (44100 Hz) */ \
160                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
161             /* sampling_frequency == `01' (48000 Hz) */ \
162                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
163             /* sampling_frequency == `10' (32000 Hz) */ \
164                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
165             /* sampling_frequency == `11' (reserved) */ \
166                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
167 \
168 \
169     /* Layer == `10' (II) */ \
170 \
171         /* padding_bit == `0' */ \
172 \
173             /* sampling_frequency == `00' (44100 Hz) */ \
174                 0,  100,  152,  178,  204,  257,  309,  361,  413,  518,  622,  727,  831, 1040, 1249,    0, \
175             /* sampling_frequency == `01' (48000 Hz) */ \
176                 0,   92,  140,  164,  188,  236,  284,  332,  380,  476,  572,  668,  764,  956, 1148,    0, \
177             /* sampling_frequency == `10' (32000 Hz) */ \
178                 0,  140,  212,  248,  284,  356,  428,  500,  572,  716,  860, 1004, 1148, 1436, 1724,    0, \
179             /* sampling_frequency == `11' (reserved) */ \
180                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
181 \
182         /* padding_bit == `1' */ \
183 \
184             /* sampling_frequency == `00' (44100 Hz) */ \
185                 0,  101,  153,  179,  205,  258,  310,  362,  414,  519,  623,  728,  832, 1041, 1250,    0, \
186             /* sampling_frequency == `01' (48000 Hz) */ \
187                 0,   92,  140,  164,  188,  236,  284,  332,  380,  476,  572,  668,  764,  956, 1148,    0, \
188             /* sampling_frequency == `10' (32000 Hz) */ \
189                 0,  140,  212,  248,  284,  356,  428,  500,  572,  716,  860, 1004, 1148, 1436, 1724,    0, \
190             /* sampling_frequency == `11' (reserved) */ \
191                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
192 \
193 \
194     /* Layer == `11' (I) */ \
195 \
196         /* padding_bit == `0' */ \
197 \
198             /* sampling_frequency == `00' (44100 Hz) */ \
199                 0,   28,   64,  100,  132,  168,  204,  236,  272,  308,  344,  376,  412,  448,  480,    0, \
200             /* sampling_frequency == `01' (48000 Hz) */ \
201                 0,   28,   60,   92,  124,  156,  188,  220,  252,  284,  316,  348,  380,  412,  444,    0, \
202             /* sampling_frequency == `10' (32000 Hz) */ \
203                 0,   44,   92,  140,  188,  236,  284,  332,  380,  428,  476,  524,  572,  620,  668,    0, \
204             /* sampling_frequency == `11' (reserved) */ \
205                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, \
206 \
207         /* padding_bit == `1' */ \
208 \
209             /* sampling_frequency == `00' (44100 Hz) */ \
210                 0,   32,   68,  104,  136,  172,  208,  240,  276,  312,  348,  380,  416,  452,  484,    0, \
211             /* sampling_frequency == `01' (48000 Hz) */ \
212                 0,   28,   60,   92,  124,  156,  188,  220,  252,  284,  316,  348,  380,  412,  444,    0, \
213             /* sampling_frequency == `10' (32000 Hz) */ \
214                 0,   44,   92,  140,  188,  236,  284,  332,  380,  428,  476,  524,  572,  620,  668,    0, \
215             /* sampling_frequency == `11' (reserved) */ \
216                 0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0 \
217 }
218 #endif
219
220
221 /*****************************************************************************
222  * scale factors = f( scalefactor ) (Layer I & II, see ISO/IEC 11172-3 2.4.1)
223  *****************************************************************************
224  * Theses values are 2^(1 - index/3) (see ISO/IEC 11172-3 2.4.2.5)
225  *****************************************************************************/
226 #define ADEC_SCALE_FACTOR \
227 { \
228     /* 0*/ 2.00000000000000, /* 1*/ 1.58740105196820, /* 2*/ 1.25992104989487,\
229     /* 3*/ 1.00000000000000, /* 4*/ 0.79370052598410, /* 5*/ 0.62996052494744,\
230     /* 6*/ 0.50000000000000, /* 7*/ 0.39685026299205, /* 8*/ 0.31498026247372,\
231     /* 9*/ 0.25000000000000, /*10*/ 0.19842513149602, /*11*/ 0.15749013123686,\
232     /*12*/ 0.12500000000000, /*13*/ 0.09921256574801, /*14*/ 0.07874506561843,\
233     /*15*/ 0.06250000000000, /*16*/ 0.04960628287401, /*17*/ 0.03937253280921,\
234     /*18*/ 0.03125000000000, /*19*/ 0.02480314143700, /*20*/ 0.01968626640461,\
235     /*21*/ 0.01562500000000, /*22*/ 0.01240157071850, /*23*/ 0.00984313320230,\
236     /*24*/ 0.00781250000000, /*25*/ 0.00620078535925, /*26*/ 0.00492156660115,\
237     /*27*/ 0.00390625000000, /*28*/ 0.00310039267963, /*29*/ 0.00246078330058,\
238     /*30*/ 0.00195312500000, /*31*/ 0.00155019633981, /*32*/ 0.00123039165029,\
239     /*33*/ 0.00097656250000, /*34*/ 0.00077509816991, /*35*/ 0.00061519582514,\
240     /*36*/ 0.00048828125000, /*37*/ 0.00038754908495, /*38*/ 0.00030759791257,\
241     /*39*/ 0.00024414062500, /*40*/ 0.00019377454248, /*41*/ 0.00015379895629,\
242     /*42*/ 0.00012207031250, /*43*/ 0.00009688727124, /*44*/ 0.00007689947814,\
243     /*45*/ 0.00006103515625, /*46*/ 0.00004844363562, /*47*/ 0.00003844973907,\
244     /*48*/ 0.00003051757813, /*49*/ 0.00002422181781, /*50*/ 0.00001922486954,\
245     /*51*/ 0.00001525878906, /*52*/ 0.00001211090890, /*53*/ 0.00000961243477,\
246     /*54*/ 0.00000762939453, /*55*/ 0.00000605545445, /*56*/ 0.00000480621738,\
247     /*57*/ 0.00000381469727, /*58*/ 0.00000302772723, /*59*/ 0.00000240310869,\
248     /*60*/ 0.00000190734863, /*61*/ 0.00000151386361, /*62*/ 0.00000120155435,\
249     /*63*/ 0.0 /* ?? invalid scale factor ?? */ \
250 }
251
252
253 /*****************************************************************************
254  * Layer I definitions
255  *****************************************************************************/
256
257 /*
258  * slope table = f( allocation[ch][sb] (see ISO/IEC 11171-3 2.4.1) )
259  */
260 #define ADEC_LAYER1_SLOPE \
261 { \
262     /* 0*/ 0.0, /* no sample */ \
263     /* 1*/ 2.0/3, \
264     /* 2*/ 2.0/7, \
265     /* 3*/ 2.0/15, \
266     /* 4*/ 2.0/31, \
267     /* 5*/ 2.0/63, \
268     /* 6*/ 2.0/127, \
269     /* 7*/ 2.0/255, \
270     /* 8*/ 2.0/511, \
271     /* 9*/ 2.0/1023, \
272     /*10*/ 2.0/2047, \
273     /*11*/ 2.0/4095, \
274     /*12*/ 2.0/8191, \
275     /*13*/ 2.0/16383, \
276     /*14*/ 2.0/32767, \
277     /*15*/ 0.0 /* invalid bit allocation */ \
278 }
279
280 /*
281  * offset table = f( allocation[ch][sb] (see ISO/IEC 11172-3 2.4.1) )
282  */
283 #define ADEC_LAYER1_OFFSET \
284 { \
285     /* 0*/      0.0, /* no sample */ \
286     /* 1*/     -2.0/3, \
287     /* 2*/     -6.0/7, \
288     /* 3*/    -14.0/15, \
289     /* 4*/    -30.0/31, \
290     /* 5*/    -62.0/63, \
291     /* 6*/   -126.0/127, \
292     /* 7*/   -254.0/255, \
293     /* 8*/   -510.0/511, \
294     /* 9*/  -1022.0/1023, \
295     /*10*/  -2046.0/2047, \
296     /*11*/  -4094.0/4095, \
297     /*12*/  -8190.0/8191, \
298     /*13*/ -16382.0/16383, \
299     /*14*/ -32766.0/32767, \
300     /*15*/      0.0 /* invalid bit allocation */ \
301 }
302
303
304 /*****************************************************************************
305  * Layer II definitions
306  *****************************************************************************/
307
308 /*
309  * Bitrate PER CHANNEL index = f( mode, bitrate_index )
310  * (see ISO/IEC 11172-3 2.4.2.3)
311  *
312  * - This index is used in the ADEC_LAYER2_SBLIMIT and ADEC_LAYER2_NBAL tables.
313  *
314  * -  0 == forbidden mode/bitrate_index combination
315  * -  1 ==  32 kbits/s per channel
316  * -  2 ==  48 kbits/s per channel
317  * -  3 ==  56 kbits/s per channel
318  * -  4 ==  64 kbits/s per channel
319  * -  5 ==  80 kbits/s per channel
320  * -  6 ==  96 kbits/s per channel
321  * -  7 == 112 kbits/s per channel
322  * -  8 == 128 kbits/s per channel
323  * -  9 == 160 kbits/s per channel
324  * - 10 == 192 kbits/s per channel
325  */
326 #define ADEC_LAYER2_BITRATE_PER_CHANNEL_INDEX \
327 { \
328     /* mode == `00' (stereo) */ \
329     {  0,  0,  0,  0,  1,  0,  2,  3,  4,  5,  6,  7,  8,  9, 10 }, \
330     /* mode == `01' (combined stereo) */ \
331     {  0,  0,  0,  0,  1,  0,  2,  3,  4,  5,  6,  7,  8,  9, 10 }, \
332     /* mode == `10' (two channels) */ \
333     {  0,  0,  0,  0,  1,  0,  2,  3,  4,  5,  6,  7,  8,  9, 10 }, \
334     /* mode == `11' (one channel) */ \
335     {  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10,  0,  0,  0,  0 } \
336 }
337
338 /*
339  * Number of subbands = f( sampling_frequency, bitrate_per_channel_index )
340  * (see ISO/IEC 11172-3 Annex B.2)
341  */
342 #define ADEC_LAYER2_SBLIMIT \
343 { \
344     /* sampling_frequency == `00' (44100 Hz) */ \
345     {  0,  8,  8, 27, 27, 27, 30, 30, 30, 30, 30}, \
346     /* sampling_frequency == `01' (48000 Hz) */ \
347     {  0,  8,  8, 27, 27, 27, 27, 27, 27, 27, 27}, \
348     /* sampling_frequency == `10' (32000 Hz) */ \
349     {  0, 12, 12, 27, 27, 27, 30, 30, 30, 30, 30} \
350 }
351
352 /*
353  * Number of bits allocated = f( bitrate_per_channel_index, subband )
354  * (see ISO/IEC 11172-3 Annex B.2)
355  */
356 #define ADEC_LAYER2_NBAL \
357 { \
358     /* bitrate_per_channel_index <= 2 */ \
359     { 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, \
360     /* bitrate_per_channel_index > 2 */ \
361     { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 0, 0} \
362 }
363
364 /*
365  * = When 3 samples are grouped in one codeword, we have to ungroup them in
366  *   order to dequantize the samples (see ISO/IEC 11172-3 2.4.3.3.4) :
367  *   1) Ungrouping
368  *          for ( i = 0; i < 3; i++ )
369  *          {
370  *              s[i] = c % nlevels;
371  *              c = c / nlevels;
372  *          }
373  *   2) Requantization
374  *
375  * = We pre-calculated all this, and stored the results in the following
376  *   ungroup`nlevels' tables. ISO/IEC 11172-3 Annex B.4 tells us that the
377  *   samples are grouped only when nlevels == 3, 5, or 9.
378  *
379  * = ADEC_LAYER2_UNGROUPn = f(3 * n*n*n)
380  */
381 #define ADEC_LAYER2_UNGROUP3 \
382 { \
383     -2.0/3, -2.0/3, -2.0/3, \
384       .0  , -2.0/3, -2.0/3, \
385      2.0/3, -2.0/3, -2.0/3, \
386     -2.0/3,   .0  , -2.0/3, \
387       .0  ,   .0  , -2.0/3, \
388      2.0/3,   .0  , -2.0/3, \
389     -2.0/3,  2.0/3, -2.0/3, \
390       .0  ,  2.0/3, -2.0/3, \
391      2.0/3,  2.0/3, -2.0/3, \
392     -2.0/3, -2.0/3,   .0  , \
393       .0  , -2.0/3,   .0  , \
394      2.0/3, -2.0/3,   .0  , \
395     -2.0/3,   .0  ,   .0  , \
396       .0  ,   .0  ,   .0  , \
397      2.0/3,   .0  ,   .0  , \
398     -2.0/3,  2.0/3,   .0  , \
399       .0  ,  2.0/3,   .0  , \
400      2.0/3,  2.0/3,   .0  , \
401     -2.0/3, -2.0/3,  2.0/3, \
402       .0  , -2.0/3,  2.0/3, \
403      2.0/3, -2.0/3,  2.0/3, \
404     -2.0/3,   .0  ,  2.0/3, \
405       .0  ,   .0  ,  2.0/3, \
406      2.0/3,   .0  ,  2.0/3, \
407     -2.0/3,  2.0/3,  2.0/3, \
408       .0  ,  2.0/3,  2.0/3, \
409      2.0/3,  2.0/3,  2.0/3 \
410 }
411
412 #define ADEC_LAYER2_UNGROUP5 \
413 { \
414     -.8, -.8, -.8, \
415     -.4, -.8, -.8, \
416      .0, -.8, -.8, \
417      .4, -.8, -.8, \
418      .8, -.8, -.8, \
419     -.8, -.4, -.8, \
420     -.4, -.4, -.8, \
421      .0, -.4, -.8, \
422      .4, -.4, -.8, \
423      .8, -.4, -.8, \
424     -.8,  .0, -.8, \
425     -.4,  .0, -.8, \
426      .0,  .0, -.8, \
427      .4,  .0, -.8, \
428      .8,  .0, -.8, \
429     -.8,  .4, -.8, \
430     -.4,  .4, -.8, \
431      .0,  .4, -.8, \
432      .4,  .4, -.8, \
433      .8,  .4, -.8, \
434     -.8,  .8, -.8, \
435     -.4,  .8, -.8, \
436      .0,  .8, -.8, \
437      .4,  .8, -.8, \
438      .8,  .8, -.8, \
439     -.8, -.8, -.4, \
440     -.4, -.8, -.4, \
441      .0, -.8, -.4, \
442      .4, -.8, -.4, \
443      .8, -.8, -.4, \
444     -.8, -.4, -.4, \
445     -.4, -.4, -.4, \
446      .0, -.4, -.4, \
447      .4, -.4, -.4, \
448      .8, -.4, -.4, \
449     -.8,  .0, -.4, \
450     -.4,  .0, -.4, \
451      .0,  .0, -.4, \
452      .4,  .0, -.4, \
453      .8,  .0, -.4, \
454     -.8,  .4, -.4, \
455     -.4,  .4, -.4, \
456      .0,  .4, -.4, \
457      .4,  .4, -.4, \
458      .8,  .4, -.4, \
459     -.8,  .8, -.4, \
460     -.4,  .8, -.4, \
461      .0,  .8, -.4, \
462      .4,  .8, -.4, \
463      .8,  .8, -.4, \
464     -.8, -.8,  .0, \
465     -.4, -.8,  .0, \
466      .0, -.8,  .0, \
467      .4, -.8,  .0, \
468      .8, -.8,  .0, \
469     -.8, -.4,  .0, \
470     -.4, -.4,  .0, \
471      .0, -.4,  .0, \
472      .4, -.4,  .0, \
473      .8, -.4,  .0, \
474     -.8,  .0,  .0, \
475     -.4,  .0,  .0, \
476      .0,  .0,  .0, \
477      .4,  .0,  .0, \
478      .8,  .0,  .0, \
479     -.8,  .4,  .0, \
480     -.4,  .4,  .0, \
481      .0,  .4,  .0, \
482      .4,  .4,  .0, \
483      .8,  .4,  .0, \
484     -.8,  .8,  .0, \
485     -.4,  .8,  .0, \
486      .0,  .8,  .0, \
487      .4,  .8,  .0, \
488      .8,  .8,  .0, \
489     -.8, -.8,  .4, \
490     -.4, -.8,  .4, \
491      .0, -.8,  .4, \
492      .4, -.8,  .4, \
493      .8, -.8,  .4, \
494     -.8, -.4,  .4, \
495     -.4, -.4,  .4, \
496      .0, -.4,  .4, \
497      .4, -.4,  .4, \
498      .8, -.4,  .4, \
499     -.8,  .0,  .4, \
500     -.4,  .0,  .4, \
501      .0,  .0,  .4, \
502      .4,  .0,  .4, \
503      .8,  .0,  .4, \
504     -.8,  .4,  .4, \
505     -.4,  .4,  .4, \
506      .0,  .4,  .4, \
507      .4,  .4,  .4, \
508      .8,  .4,  .4, \
509     -.8,  .8,  .4, \
510     -.4,  .8,  .4, \
511      .0,  .8,  .4, \
512      .4,  .8,  .4, \
513      .8,  .8,  .4, \
514     -.8, -.8,  .8, \
515     -.4, -.8,  .8, \
516      .0, -.8,  .8, \
517      .4, -.8,  .8, \
518      .8, -.8,  .8, \
519     -.8, -.4,  .8, \
520     -.4, -.4,  .8, \
521      .0, -.4,  .8, \
522      .4, -.4,  .8, \
523      .8, -.4,  .8, \
524     -.8,  .0,  .8, \
525     -.4,  .0,  .8, \
526      .0,  .0,  .8, \
527      .4,  .0,  .8, \
528      .8,  .0,  .8, \
529     -.8,  .4,  .8, \
530     -.4,  .4,  .8, \
531      .0,  .4,  .8, \
532      .4,  .4,  .8, \
533      .8,  .4,  .8, \
534     -.8,  .8,  .8, \
535     -.4,  .8,  .8, \
536      .0,  .8,  .8, \
537      .4,  .8,  .8, \
538      .8,  .8,  .8 \
539 }
540
541 #define ADEC_LAYER2_UNGROUP9 \
542 { \
543     -8.0/9, -8.0/9, -8.0/9, \
544     -6.0/9, -8.0/9, -8.0/9, \
545     -4.0/9, -8.0/9, -8.0/9, \
546     -2.0/9, -8.0/9, -8.0/9, \
547       .0  , -8.0/9, -8.0/9, \
548      2.0/9, -8.0/9, -8.0/9, \
549      4.0/9, -8.0/9, -8.0/9, \
550      6.0/9, -8.0/9, -8.0/9, \
551      8.0/9, -8.0/9, -8.0/9, \
552     -8.0/9, -6.0/9, -8.0/9, \
553     -6.0/9, -6.0/9, -8.0/9, \
554     -4.0/9, -6.0/9, -8.0/9, \
555     -2.0/9, -6.0/9, -8.0/9, \
556       .0  , -6.0/9, -8.0/9, \
557      2.0/9, -6.0/9, -8.0/9, \
558      4.0/9, -6.0/9, -8.0/9, \
559      6.0/9, -6.0/9, -8.0/9, \
560      8.0/9, -6.0/9, -8.0/9, \
561     -8.0/9, -4.0/9, -8.0/9, \
562     -6.0/9, -4.0/9, -8.0/9, \
563     -4.0/9, -4.0/9, -8.0/9, \
564     -2.0/9, -4.0/9, -8.0/9, \
565       .0  , -4.0/9, -8.0/9, \
566      2.0/9, -4.0/9, -8.0/9, \
567      4.0/9, -4.0/9, -8.0/9, \
568      6.0/9, -4.0/9, -8.0/9, \
569      8.0/9, -4.0/9, -8.0/9, \
570     -8.0/9, -2.0/9, -8.0/9, \
571     -6.0/9, -2.0/9, -8.0/9, \
572     -4.0/9, -2.0/9, -8.0/9, \
573     -2.0/9, -2.0/9, -8.0/9, \
574       .0  , -2.0/9, -8.0/9, \
575      2.0/9, -2.0/9, -8.0/9, \
576      4.0/9, -2.0/9, -8.0/9, \
577      6.0/9, -2.0/9, -8.0/9, \
578      8.0/9, -2.0/9, -8.0/9, \
579     -8.0/9,   .0  , -8.0/9, \
580     -6.0/9,   .0  , -8.0/9, \
581     -4.0/9,   .0  , -8.0/9, \
582     -2.0/9,   .0  , -8.0/9, \
583       .0  ,   .0  , -8.0/9, \
584      2.0/9,   .0  , -8.0/9, \
585      4.0/9,   .0  , -8.0/9, \
586      6.0/9,   .0  , -8.0/9, \
587      8.0/9,   .0  , -8.0/9, \
588     -8.0/9,  2.0/9, -8.0/9, \
589     -6.0/9,  2.0/9, -8.0/9, \
590     -4.0/9,  2.0/9, -8.0/9, \
591     -2.0/9,  2.0/9, -8.0/9, \
592       .0  ,  2.0/9, -8.0/9, \
593      2.0/9,  2.0/9, -8.0/9, \
594      4.0/9,  2.0/9, -8.0/9, \
595      6.0/9,  2.0/9, -8.0/9, \
596      8.0/9,  2.0/9, -8.0/9, \
597     -8.0/9,  4.0/9, -8.0/9, \
598     -6.0/9,  4.0/9, -8.0/9, \
599     -4.0/9,  4.0/9, -8.0/9, \
600     -2.0/9,  4.0/9, -8.0/9, \
601       .0  ,  4.0/9, -8.0/9, \
602      2.0/9,  4.0/9, -8.0/9, \
603      4.0/9,  4.0/9, -8.0/9, \
604      6.0/9,  4.0/9, -8.0/9, \
605      8.0/9,  4.0/9, -8.0/9, \
606     -8.0/9,  6.0/9, -8.0/9, \
607     -6.0/9,  6.0/9, -8.0/9, \
608     -4.0/9,  6.0/9, -8.0/9, \
609     -2.0/9,  6.0/9, -8.0/9, \
610       .0  ,  6.0/9, -8.0/9, \
611      2.0/9,  6.0/9, -8.0/9, \
612      4.0/9,  6.0/9, -8.0/9, \
613      6.0/9,  6.0/9, -8.0/9, \
614      8.0/9,  6.0/9, -8.0/9, \
615     -8.0/9,  8.0/9, -8.0/9, \
616     -6.0/9,  8.0/9, -8.0/9, \
617     -4.0/9,  8.0/9, -8.0/9, \
618     -2.0/9,  8.0/9, -8.0/9, \
619       .0  ,  8.0/9, -8.0/9, \
620      2.0/9,  8.0/9, -8.0/9, \
621      4.0/9,  8.0/9, -8.0/9, \
622      6.0/9,  8.0/9, -8.0/9, \
623      8.0/9,  8.0/9, -8.0/9, \
624     -8.0/9, -8.0/9, -6.0/9, \
625     -6.0/9, -8.0/9, -6.0/9, \
626     -4.0/9, -8.0/9, -6.0/9, \
627     -2.0/9, -8.0/9, -6.0/9, \
628       .0  , -8.0/9, -6.0/9, \
629      2.0/9, -8.0/9, -6.0/9, \
630      4.0/9, -8.0/9, -6.0/9, \
631      6.0/9, -8.0/9, -6.0/9, \
632      8.0/9, -8.0/9, -6.0/9, \
633     -8.0/9, -6.0/9, -6.0/9, \
634     -6.0/9, -6.0/9, -6.0/9, \
635     -4.0/9, -6.0/9, -6.0/9, \
636     -2.0/9, -6.0/9, -6.0/9, \
637       .0  , -6.0/9, -6.0/9, \
638      2.0/9, -6.0/9, -6.0/9, \
639      4.0/9, -6.0/9, -6.0/9, \
640      6.0/9, -6.0/9, -6.0/9, \
641      8.0/9, -6.0/9, -6.0/9, \
642     -8.0/9, -4.0/9, -6.0/9, \
643     -6.0/9, -4.0/9, -6.0/9, \
644     -4.0/9, -4.0/9, -6.0/9, \
645     -2.0/9, -4.0/9, -6.0/9, \
646       .0  , -4.0/9, -6.0/9, \
647      2.0/9, -4.0/9, -6.0/9, \
648      4.0/9, -4.0/9, -6.0/9, \
649      6.0/9, -4.0/9, -6.0/9, \
650      8.0/9, -4.0/9, -6.0/9, \
651     -8.0/9, -2.0/9, -6.0/9, \
652     -6.0/9, -2.0/9, -6.0/9, \
653     -4.0/9, -2.0/9, -6.0/9, \
654     -2.0/9, -2.0/9, -6.0/9, \
655       .0  , -2.0/9, -6.0/9, \
656      2.0/9, -2.0/9, -6.0/9, \
657      4.0/9, -2.0/9, -6.0/9, \
658      6.0/9, -2.0/9, -6.0/9, \
659      8.0/9, -2.0/9, -6.0/9, \
660     -8.0/9,   .0  , -6.0/9, \
661     -6.0/9,   .0  , -6.0/9, \
662     -4.0/9,   .0  , -6.0/9, \
663     -2.0/9,   .0  , -6.0/9, \
664       .0  ,   .0  , -6.0/9, \
665      2.0/9,   .0  , -6.0/9, \
666      4.0/9,   .0  , -6.0/9, \
667      6.0/9,   .0  , -6.0/9, \
668      8.0/9,   .0  , -6.0/9, \
669     -8.0/9,  2.0/9, -6.0/9, \
670     -6.0/9,  2.0/9, -6.0/9, \
671     -4.0/9,  2.0/9, -6.0/9, \
672     -2.0/9,  2.0/9, -6.0/9, \
673       .0  ,  2.0/9, -6.0/9, \
674      2.0/9,  2.0/9, -6.0/9, \
675      4.0/9,  2.0/9, -6.0/9, \
676      6.0/9,  2.0/9, -6.0/9, \
677      8.0/9,  2.0/9, -6.0/9, \
678     -8.0/9,  4.0/9, -6.0/9, \
679     -6.0/9,  4.0/9, -6.0/9, \
680     -4.0/9,  4.0/9, -6.0/9, \
681     -2.0/9,  4.0/9, -6.0/9, \
682       .0  ,  4.0/9, -6.0/9, \
683      2.0/9,  4.0/9, -6.0/9, \
684      4.0/9,  4.0/9, -6.0/9, \
685      6.0/9,  4.0/9, -6.0/9, \
686      8.0/9,  4.0/9, -6.0/9, \
687     -8.0/9,  6.0/9, -6.0/9, \
688     -6.0/9,  6.0/9, -6.0/9, \
689     -4.0/9,  6.0/9, -6.0/9, \
690     -2.0/9,  6.0/9, -6.0/9, \
691       .0  ,  6.0/9, -6.0/9, \
692      2.0/9,  6.0/9, -6.0/9, \
693      4.0/9,  6.0/9, -6.0/9, \
694      6.0/9,  6.0/9, -6.0/9, \
695      8.0/9,  6.0/9, -6.0/9, \
696     -8.0/9,  8.0/9, -6.0/9, \
697     -6.0/9,  8.0/9, -6.0/9, \
698     -4.0/9,  8.0/9, -6.0/9, \
699     -2.0/9,  8.0/9, -6.0/9, \
700       .0  ,  8.0/9, -6.0/9, \
701      2.0/9,  8.0/9, -6.0/9, \
702      4.0/9,  8.0/9, -6.0/9, \
703      6.0/9,  8.0/9, -6.0/9, \
704      8.0/9,  8.0/9, -6.0/9, \
705     -8.0/9, -8.0/9, -4.0/9, \
706     -6.0/9, -8.0/9, -4.0/9, \
707     -4.0/9, -8.0/9, -4.0/9, \
708     -2.0/9, -8.0/9, -4.0/9, \
709       .0  , -8.0/9, -4.0/9, \
710      2.0/9, -8.0/9, -4.0/9, \
711      4.0/9, -8.0/9, -4.0/9, \
712      6.0/9, -8.0/9, -4.0/9, \
713      8.0/9, -8.0/9, -4.0/9, \
714     -8.0/9, -6.0/9, -4.0/9, \
715     -6.0/9, -6.0/9, -4.0/9, \
716     -4.0/9, -6.0/9, -4.0/9, \
717     -2.0/9, -6.0/9, -4.0/9, \
718       .0  , -6.0/9, -4.0/9, \
719      2.0/9, -6.0/9, -4.0/9, \
720      4.0/9, -6.0/9, -4.0/9, \
721      6.0/9, -6.0/9, -4.0/9, \
722      8.0/9, -6.0/9, -4.0/9, \
723     -8.0/9, -4.0/9, -4.0/9, \
724     -6.0/9, -4.0/9, -4.0/9, \
725     -4.0/9, -4.0/9, -4.0/9, \
726     -2.0/9, -4.0/9, -4.0/9, \
727       .0  , -4.0/9, -4.0/9, \
728      2.0/9, -4.0/9, -4.0/9, \
729      4.0/9, -4.0/9, -4.0/9, \
730      6.0/9, -4.0/9, -4.0/9, \
731      8.0/9, -4.0/9, -4.0/9, \
732     -8.0/9, -2.0/9, -4.0/9, \
733     -6.0/9, -2.0/9, -4.0/9, \
734     -4.0/9, -2.0/9, -4.0/9, \
735     -2.0/9, -2.0/9, -4.0/9, \
736       .0  , -2.0/9, -4.0/9, \
737      2.0/9, -2.0/9, -4.0/9, \
738      4.0/9, -2.0/9, -4.0/9, \
739      6.0/9, -2.0/9, -4.0/9, \
740      8.0/9, -2.0/9, -4.0/9, \
741     -8.0/9,   .0  , -4.0/9, \
742     -6.0/9,   .0  , -4.0/9, \
743     -4.0/9,   .0  , -4.0/9, \
744     -2.0/9,   .0  , -4.0/9, \
745       .0  ,   .0  , -4.0/9, \
746      2.0/9,   .0  , -4.0/9, \
747      4.0/9,   .0  , -4.0/9, \
748      6.0/9,   .0  , -4.0/9, \
749      8.0/9,   .0  , -4.0/9, \
750     -8.0/9,  2.0/9, -4.0/9, \
751     -6.0/9,  2.0/9, -4.0/9, \
752     -4.0/9,  2.0/9, -4.0/9, \
753     -2.0/9,  2.0/9, -4.0/9, \
754       .0  ,  2.0/9, -4.0/9, \
755      2.0/9,  2.0/9, -4.0/9, \
756      4.0/9,  2.0/9, -4.0/9, \
757      6.0/9,  2.0/9, -4.0/9, \
758      8.0/9,  2.0/9, -4.0/9, \
759     -8.0/9,  4.0/9, -4.0/9, \
760     -6.0/9,  4.0/9, -4.0/9, \
761     -4.0/9,  4.0/9, -4.0/9, \
762     -2.0/9,  4.0/9, -4.0/9, \
763       .0  ,  4.0/9, -4.0/9, \
764      2.0/9,  4.0/9, -4.0/9, \
765      4.0/9,  4.0/9, -4.0/9, \
766      6.0/9,  4.0/9, -4.0/9, \
767      8.0/9,  4.0/9, -4.0/9, \
768     -8.0/9,  6.0/9, -4.0/9, \
769     -6.0/9,  6.0/9, -4.0/9, \
770     -4.0/9,  6.0/9, -4.0/9, \
771     -2.0/9,  6.0/9, -4.0/9, \
772       .0  ,  6.0/9, -4.0/9, \
773      2.0/9,  6.0/9, -4.0/9, \
774      4.0/9,  6.0/9, -4.0/9, \
775      6.0/9,  6.0/9, -4.0/9, \
776      8.0/9,  6.0/9, -4.0/9, \
777     -8.0/9,  8.0/9, -4.0/9, \
778     -6.0/9,  8.0/9, -4.0/9, \
779     -4.0/9,  8.0/9, -4.0/9, \
780     -2.0/9,  8.0/9, -4.0/9, \
781       .0  ,  8.0/9, -4.0/9, \
782      2.0/9,  8.0/9, -4.0/9, \
783      4.0/9,  8.0/9, -4.0/9, \
784      6.0/9,  8.0/9, -4.0/9, \
785      8.0/9,  8.0/9, -4.0/9, \
786     -8.0/9, -8.0/9, -2.0/9, \
787     -6.0/9, -8.0/9, -2.0/9, \
788     -4.0/9, -8.0/9, -2.0/9, \
789     -2.0/9, -8.0/9, -2.0/9, \
790       .0  , -8.0/9, -2.0/9, \
791      2.0/9, -8.0/9, -2.0/9, \
792      4.0/9, -8.0/9, -2.0/9, \
793      6.0/9, -8.0/9, -2.0/9, \
794      8.0/9, -8.0/9, -2.0/9, \
795     -8.0/9, -6.0/9, -2.0/9, \
796     -6.0/9, -6.0/9, -2.0/9, \
797     -4.0/9, -6.0/9, -2.0/9, \
798     -2.0/9, -6.0/9, -2.0/9, \
799       .0  , -6.0/9, -2.0/9, \
800      2.0/9, -6.0/9, -2.0/9, \
801      4.0/9, -6.0/9, -2.0/9, \
802      6.0/9, -6.0/9, -2.0/9, \
803      8.0/9, -6.0/9, -2.0/9, \
804     -8.0/9, -4.0/9, -2.0/9, \
805     -6.0/9, -4.0/9, -2.0/9, \
806     -4.0/9, -4.0/9, -2.0/9, \
807     -2.0/9, -4.0/9, -2.0/9, \
808       .0  , -4.0/9, -2.0/9, \
809      2.0/9, -4.0/9, -2.0/9, \
810      4.0/9, -4.0/9, -2.0/9, \
811      6.0/9, -4.0/9, -2.0/9, \
812      8.0/9, -4.0/9, -2.0/9, \
813     -8.0/9, -2.0/9, -2.0/9, \
814     -6.0/9, -2.0/9, -2.0/9, \
815     -4.0/9, -2.0/9, -2.0/9, \
816     -2.0/9, -2.0/9, -2.0/9, \
817       .0  , -2.0/9, -2.0/9, \
818      2.0/9, -2.0/9, -2.0/9, \
819      4.0/9, -2.0/9, -2.0/9, \
820      6.0/9, -2.0/9, -2.0/9, \
821      8.0/9, -2.0/9, -2.0/9, \
822     -8.0/9,   .0  , -2.0/9, \
823     -6.0/9,   .0  , -2.0/9, \
824     -4.0/9,   .0  , -2.0/9, \
825     -2.0/9,   .0  , -2.0/9, \
826       .0  ,   .0  , -2.0/9, \
827      2.0/9,   .0  , -2.0/9, \
828      4.0/9,   .0  , -2.0/9, \
829      6.0/9,   .0  , -2.0/9, \
830      8.0/9,   .0  , -2.0/9, \
831     -8.0/9,  2.0/9, -2.0/9, \
832     -6.0/9,  2.0/9, -2.0/9, \
833     -4.0/9,  2.0/9, -2.0/9, \
834     -2.0/9,  2.0/9, -2.0/9, \
835       .0  ,  2.0/9, -2.0/9, \
836      2.0/9,  2.0/9, -2.0/9, \
837      4.0/9,  2.0/9, -2.0/9, \
838      6.0/9,  2.0/9, -2.0/9, \
839      8.0/9,  2.0/9, -2.0/9, \
840     -8.0/9,  4.0/9, -2.0/9, \
841     -6.0/9,  4.0/9, -2.0/9, \
842     -4.0/9,  4.0/9, -2.0/9, \
843     -2.0/9,  4.0/9, -2.0/9, \
844       .0  ,  4.0/9, -2.0/9, \
845      2.0/9,  4.0/9, -2.0/9, \
846      4.0/9,  4.0/9, -2.0/9, \
847      6.0/9,  4.0/9, -2.0/9, \
848      8.0/9,  4.0/9, -2.0/9, \
849     -8.0/9,  6.0/9, -2.0/9, \
850     -6.0/9,  6.0/9, -2.0/9, \
851     -4.0/9,  6.0/9, -2.0/9, \
852     -2.0/9,  6.0/9, -2.0/9, \
853       .0  ,  6.0/9, -2.0/9, \
854      2.0/9,  6.0/9, -2.0/9, \
855      4.0/9,  6.0/9, -2.0/9, \
856      6.0/9,  6.0/9, -2.0/9, \
857      8.0/9,  6.0/9, -2.0/9, \
858     -8.0/9,  8.0/9, -2.0/9, \
859     -6.0/9,  8.0/9, -2.0/9, \
860     -4.0/9,  8.0/9, -2.0/9, \
861     -2.0/9,  8.0/9, -2.0/9, \
862       .0  ,  8.0/9, -2.0/9, \
863      2.0/9,  8.0/9, -2.0/9, \
864      4.0/9,  8.0/9, -2.0/9, \
865      6.0/9,  8.0/9, -2.0/9, \
866      8.0/9,  8.0/9, -2.0/9, \
867     -8.0/9, -8.0/9,   .0  , \
868     -6.0/9, -8.0/9,   .0  , \
869     -4.0/9, -8.0/9,   .0  , \
870     -2.0/9, -8.0/9,   .0  , \
871       .0  , -8.0/9,   .0  , \
872      2.0/9, -8.0/9,   .0  , \
873      4.0/9, -8.0/9,   .0  , \
874      6.0/9, -8.0/9,   .0  , \
875      8.0/9, -8.0/9,   .0  , \
876     -8.0/9, -6.0/9,   .0  , \
877     -6.0/9, -6.0/9,   .0  , \
878     -4.0/9, -6.0/9,   .0  , \
879     -2.0/9, -6.0/9,   .0  , \
880       .0  , -6.0/9,   .0  , \
881      2.0/9, -6.0/9,   .0  , \
882      4.0/9, -6.0/9,   .0  , \
883      6.0/9, -6.0/9,   .0  , \
884      8.0/9, -6.0/9,   .0  , \
885     -8.0/9, -4.0/9,   .0  , \
886     -6.0/9, -4.0/9,   .0  , \
887     -4.0/9, -4.0/9,   .0  , \
888     -2.0/9, -4.0/9,   .0  , \
889       .0  , -4.0/9,   .0  , \
890      2.0/9, -4.0/9,   .0  , \
891      4.0/9, -4.0/9,   .0  , \
892      6.0/9, -4.0/9,   .0  , \
893      8.0/9, -4.0/9,   .0  , \
894     -8.0/9, -2.0/9,   .0  , \
895     -6.0/9, -2.0/9,   .0  , \
896     -4.0/9, -2.0/9,   .0  , \
897     -2.0/9, -2.0/9,   .0  , \
898       .0  , -2.0/9,   .0  , \
899      2.0/9, -2.0/9,   .0  , \
900      4.0/9, -2.0/9,   .0  , \
901      6.0/9, -2.0/9,   .0  , \
902      8.0/9, -2.0/9,   .0  , \
903     -8.0/9,   .0  ,   .0  , \
904     -6.0/9,   .0  ,   .0  , \
905     -4.0/9,   .0  ,   .0  , \
906     -2.0/9,   .0  ,   .0  , \
907       .0  ,   .0  ,   .0  , \
908      2.0/9,   .0  ,   .0  , \
909      4.0/9,   .0  ,   .0  , \
910      6.0/9,   .0  ,   .0  , \
911      8.0/9,   .0  ,   .0  , \
912     -8.0/9,  2.0/9,   .0  , \
913     -6.0/9,  2.0/9,   .0  , \
914     -4.0/9,  2.0/9,   .0  , \
915     -2.0/9,  2.0/9,   .0  , \
916       .0  ,  2.0/9,   .0  , \
917      2.0/9,  2.0/9,   .0  , \
918      4.0/9,  2.0/9,   .0  , \
919      6.0/9,  2.0/9,   .0  , \
920      8.0/9,  2.0/9,   .0  , \
921     -8.0/9,  4.0/9,   .0  , \
922     -6.0/9,  4.0/9,   .0  , \
923     -4.0/9,  4.0/9,   .0  , \
924     -2.0/9,  4.0/9,   .0  , \
925       .0  ,  4.0/9,   .0  , \
926      2.0/9,  4.0/9,   .0  , \
927      4.0/9,  4.0/9,   .0  , \
928      6.0/9,  4.0/9,   .0  , \
929      8.0/9,  4.0/9,   .0  , \
930     -8.0/9,  6.0/9,   .0  , \
931     -6.0/9,  6.0/9,   .0  , \
932     -4.0/9,  6.0/9,   .0  , \
933     -2.0/9,  6.0/9,   .0  , \
934       .0  ,  6.0/9,   .0  , \
935      2.0/9,  6.0/9,   .0  , \
936      4.0/9,  6.0/9,   .0  , \
937      6.0/9,  6.0/9,   .0  , \
938      8.0/9,  6.0/9,   .0  , \
939     -8.0/9,  8.0/9,   .0  , \
940     -6.0/9,  8.0/9,   .0  , \
941     -4.0/9,  8.0/9,   .0  , \
942     -2.0/9,  8.0/9,   .0  , \
943       .0  ,  8.0/9,   .0  , \
944      2.0/9,  8.0/9,   .0  , \
945      4.0/9,  8.0/9,   .0  , \
946      6.0/9,  8.0/9,   .0  , \
947      8.0/9,  8.0/9,   .0  , \
948     -8.0/9, -8.0/9,  2.0/9, \
949     -6.0/9, -8.0/9,  2.0/9, \
950     -4.0/9, -8.0/9,  2.0/9, \
951     -2.0/9, -8.0/9,  2.0/9, \
952       .0  , -8.0/9,  2.0/9, \
953      2.0/9, -8.0/9,  2.0/9, \
954      4.0/9, -8.0/9,  2.0/9, \
955      6.0/9, -8.0/9,  2.0/9, \
956      8.0/9, -8.0/9,  2.0/9, \
957     -8.0/9, -6.0/9,  2.0/9, \
958     -6.0/9, -6.0/9,  2.0/9, \
959     -4.0/9, -6.0/9,  2.0/9, \
960     -2.0/9, -6.0/9,  2.0/9, \
961       .0  , -6.0/9,  2.0/9, \
962      2.0/9, -6.0/9,  2.0/9, \
963      4.0/9, -6.0/9,  2.0/9, \
964      6.0/9, -6.0/9,  2.0/9, \
965      8.0/9, -6.0/9,  2.0/9, \
966     -8.0/9, -4.0/9,  2.0/9, \
967     -6.0/9, -4.0/9,  2.0/9, \
968     -4.0/9, -4.0/9,  2.0/9, \
969     -2.0/9, -4.0/9,  2.0/9, \
970       .0  , -4.0/9,  2.0/9, \
971      2.0/9, -4.0/9,  2.0/9, \
972      4.0/9, -4.0/9,  2.0/9, \
973      6.0/9, -4.0/9,  2.0/9, \
974      8.0/9, -4.0/9,  2.0/9, \
975     -8.0/9, -2.0/9,  2.0/9, \
976     -6.0/9, -2.0/9,  2.0/9, \
977     -4.0/9, -2.0/9,  2.0/9, \
978     -2.0/9, -2.0/9,  2.0/9, \
979       .0  , -2.0/9,  2.0/9, \
980      2.0/9, -2.0/9,  2.0/9, \
981      4.0/9, -2.0/9,  2.0/9, \
982      6.0/9, -2.0/9,  2.0/9, \
983      8.0/9, -2.0/9,  2.0/9, \
984     -8.0/9,   .0  ,  2.0/9, \
985     -6.0/9,   .0  ,  2.0/9, \
986     -4.0/9,   .0  ,  2.0/9, \
987     -2.0/9,   .0  ,  2.0/9, \
988       .0  ,   .0  ,  2.0/9, \
989      2.0/9,   .0  ,  2.0/9, \
990      4.0/9,   .0  ,  2.0/9, \
991      6.0/9,   .0  ,  2.0/9, \
992      8.0/9,   .0  ,  2.0/9, \
993     -8.0/9,  2.0/9,  2.0/9, \
994     -6.0/9,  2.0/9,  2.0/9, \
995     -4.0/9,  2.0/9,  2.0/9, \
996     -2.0/9,  2.0/9,  2.0/9, \
997       .0  ,  2.0/9,  2.0/9, \
998      2.0/9,  2.0/9,  2.0/9, \
999      4.0/9,  2.0/9,  2.0/9, \
1000      6.0/9,  2.0/9,  2.0/9, \
1001      8.0/9,  2.0/9,  2.0/9, \
1002     -8.0/9,  4.0/9,  2.0/9, \
1003     -6.0/9,  4.0/9,  2.0/9, \
1004     -4.0/9,  4.0/9,  2.0/9, \
1005     -2.0/9,  4.0/9,  2.0/9, \
1006       .0  ,  4.0/9,  2.0/9, \
1007      2.0/9,  4.0/9,  2.0/9, \
1008      4.0/9,  4.0/9,  2.0/9, \
1009      6.0/9,  4.0/9,  2.0/9, \
1010      8.0/9,  4.0/9,  2.0/9, \
1011     -8.0/9,  6.0/9,  2.0/9, \
1012     -6.0/9,  6.0/9,  2.0/9, \
1013     -4.0/9,  6.0/9,  2.0/9, \
1014     -2.0/9,  6.0/9,  2.0/9, \
1015       .0  ,  6.0/9,  2.0/9, \
1016      2.0/9,  6.0/9,  2.0/9, \
1017      4.0/9,  6.0/9,  2.0/9, \
1018      6.0/9,  6.0/9,  2.0/9, \
1019      8.0/9,  6.0/9,  2.0/9, \
1020     -8.0/9,  8.0/9,  2.0/9, \
1021     -6.0/9,  8.0/9,  2.0/9, \
1022     -4.0/9,  8.0/9,  2.0/9, \
1023     -2.0/9,  8.0/9,  2.0/9, \
1024       .0  ,  8.0/9,  2.0/9, \
1025      2.0/9,  8.0/9,  2.0/9, \
1026      4.0/9,  8.0/9,  2.0/9, \
1027      6.0/9,  8.0/9,  2.0/9, \
1028      8.0/9,  8.0/9,  2.0/9, \
1029     -8.0/9, -8.0/9,  4.0/9, \
1030     -6.0/9, -8.0/9,  4.0/9, \
1031     -4.0/9, -8.0/9,  4.0/9, \
1032     -2.0/9, -8.0/9,  4.0/9, \
1033       .0  , -8.0/9,  4.0/9, \
1034      2.0/9, -8.0/9,  4.0/9, \
1035      4.0/9, -8.0/9,  4.0/9, \
1036      6.0/9, -8.0/9,  4.0/9, \
1037      8.0/9, -8.0/9,  4.0/9, \
1038     -8.0/9, -6.0/9,  4.0/9, \
1039     -6.0/9, -6.0/9,  4.0/9, \
1040     -4.0/9, -6.0/9,  4.0/9, \
1041     -2.0/9, -6.0/9,  4.0/9, \
1042       .0  , -6.0/9,  4.0/9, \
1043      2.0/9, -6.0/9,  4.0/9, \
1044      4.0/9, -6.0/9,  4.0/9, \
1045      6.0/9, -6.0/9,  4.0/9, \
1046      8.0/9, -6.0/9,  4.0/9, \
1047     -8.0/9, -4.0/9,  4.0/9, \
1048     -6.0/9, -4.0/9,  4.0/9, \
1049     -4.0/9, -4.0/9,  4.0/9, \
1050     -2.0/9, -4.0/9,  4.0/9, \
1051       .0  , -4.0/9,  4.0/9, \
1052      2.0/9, -4.0/9,  4.0/9, \
1053      4.0/9, -4.0/9,  4.0/9, \
1054      6.0/9, -4.0/9,  4.0/9, \
1055      8.0/9, -4.0/9,  4.0/9, \
1056     -8.0/9, -2.0/9,  4.0/9, \
1057     -6.0/9, -2.0/9,  4.0/9, \
1058     -4.0/9, -2.0/9,  4.0/9, \
1059     -2.0/9, -2.0/9,  4.0/9, \
1060       .0  , -2.0/9,  4.0/9, \
1061      2.0/9, -2.0/9,  4.0/9, \
1062      4.0/9, -2.0/9,  4.0/9, \
1063      6.0/9, -2.0/9,  4.0/9, \
1064      8.0/9, -2.0/9,  4.0/9, \
1065     -8.0/9,   .0  ,  4.0/9, \
1066     -6.0/9,   .0  ,  4.0/9, \
1067     -4.0/9,   .0  ,  4.0/9, \
1068     -2.0/9,   .0  ,  4.0/9, \
1069       .0  ,   .0  ,  4.0/9, \
1070      2.0/9,   .0  ,  4.0/9, \
1071      4.0/9,   .0  ,  4.0/9, \
1072      6.0/9,   .0  ,  4.0/9, \
1073      8.0/9,   .0  ,  4.0/9, \
1074     -8.0/9,  2.0/9,  4.0/9, \
1075     -6.0/9,  2.0/9,  4.0/9, \
1076     -4.0/9,  2.0/9,  4.0/9, \
1077     -2.0/9,  2.0/9,  4.0/9, \
1078       .0  ,  2.0/9,  4.0/9, \
1079      2.0/9,  2.0/9,  4.0/9, \
1080      4.0/9,  2.0/9,  4.0/9, \
1081      6.0/9,  2.0/9,  4.0/9, \
1082      8.0/9,  2.0/9,  4.0/9, \
1083     -8.0/9,  4.0/9,  4.0/9, \
1084     -6.0/9,  4.0/9,  4.0/9, \
1085     -4.0/9,  4.0/9,  4.0/9, \
1086     -2.0/9,  4.0/9,  4.0/9, \
1087       .0  ,  4.0/9,  4.0/9, \
1088      2.0/9,  4.0/9,  4.0/9, \
1089      4.0/9,  4.0/9,  4.0/9, \
1090      6.0/9,  4.0/9,  4.0/9, \
1091      8.0/9,  4.0/9,  4.0/9, \
1092     -8.0/9,  6.0/9,  4.0/9, \
1093     -6.0/9,  6.0/9,  4.0/9, \
1094     -4.0/9,  6.0/9,  4.0/9, \
1095     -2.0/9,  6.0/9,  4.0/9, \
1096       .0  ,  6.0/9,  4.0/9, \
1097      2.0/9,  6.0/9,  4.0/9, \
1098      4.0/9,  6.0/9,  4.0/9, \
1099      6.0/9,  6.0/9,  4.0/9, \
1100      8.0/9,  6.0/9,  4.0/9, \
1101     -8.0/9,  8.0/9,  4.0/9, \
1102     -6.0/9,  8.0/9,  4.0/9, \
1103     -4.0/9,  8.0/9,  4.0/9, \
1104     -2.0/9,  8.0/9,  4.0/9, \
1105       .0  ,  8.0/9,  4.0/9, \
1106      2.0/9,  8.0/9,  4.0/9, \
1107      4.0/9,  8.0/9,  4.0/9, \
1108      6.0/9,  8.0/9,  4.0/9, \
1109      8.0/9,  8.0/9,  4.0/9, \
1110     -8.0/9, -8.0/9,  6.0/9, \
1111     -6.0/9, -8.0/9,  6.0/9, \
1112     -4.0/9, -8.0/9,  6.0/9, \
1113     -2.0/9, -8.0/9,  6.0/9, \
1114       .0  , -8.0/9,  6.0/9, \
1115      2.0/9, -8.0/9,  6.0/9, \
1116      4.0/9, -8.0/9,  6.0/9, \
1117      6.0/9, -8.0/9,  6.0/9, \
1118      8.0/9, -8.0/9,  6.0/9, \
1119     -8.0/9, -6.0/9,  6.0/9, \
1120     -6.0/9, -6.0/9,  6.0/9, \
1121     -4.0/9, -6.0/9,  6.0/9, \
1122     -2.0/9, -6.0/9,  6.0/9, \
1123       .0  , -6.0/9,  6.0/9, \
1124      2.0/9, -6.0/9,  6.0/9, \
1125      4.0/9, -6.0/9,  6.0/9, \
1126      6.0/9, -6.0/9,  6.0/9, \
1127      8.0/9, -6.0/9,  6.0/9, \
1128     -8.0/9, -4.0/9,  6.0/9, \
1129     -6.0/9, -4.0/9,  6.0/9, \
1130     -4.0/9, -4.0/9,  6.0/9, \
1131     -2.0/9, -4.0/9,  6.0/9, \
1132       .0  , -4.0/9,  6.0/9, \
1133      2.0/9, -4.0/9,  6.0/9, \
1134      4.0/9, -4.0/9,  6.0/9, \
1135      6.0/9, -4.0/9,  6.0/9, \
1136      8.0/9, -4.0/9,  6.0/9, \
1137     -8.0/9, -2.0/9,  6.0/9, \
1138     -6.0/9, -2.0/9,  6.0/9, \
1139     -4.0/9, -2.0/9,  6.0/9, \
1140     -2.0/9, -2.0/9,  6.0/9, \
1141       .0  , -2.0/9,  6.0/9, \
1142      2.0/9, -2.0/9,  6.0/9, \
1143      4.0/9, -2.0/9,  6.0/9, \
1144      6.0/9, -2.0/9,  6.0/9, \
1145      8.0/9, -2.0/9,  6.0/9, \
1146     -8.0/9,   .0  ,  6.0/9, \
1147     -6.0/9,   .0  ,  6.0/9, \
1148     -4.0/9,   .0  ,  6.0/9, \
1149     -2.0/9,   .0  ,  6.0/9, \
1150       .0  ,   .0  ,  6.0/9, \
1151      2.0/9,   .0  ,  6.0/9, \
1152      4.0/9,   .0  ,  6.0/9, \
1153      6.0/9,   .0  ,  6.0/9, \
1154      8.0/9,   .0  ,  6.0/9, \
1155     -8.0/9,  2.0/9,  6.0/9, \
1156     -6.0/9,  2.0/9,  6.0/9, \
1157     -4.0/9,  2.0/9,  6.0/9, \
1158     -2.0/9,  2.0/9,  6.0/9, \
1159       .0  ,  2.0/9,  6.0/9, \
1160      2.0/9,  2.0/9,  6.0/9, \
1161      4.0/9,  2.0/9,  6.0/9, \
1162      6.0/9,  2.0/9,  6.0/9, \
1163      8.0/9,  2.0/9,  6.0/9, \
1164     -8.0/9,  4.0/9,  6.0/9, \
1165     -6.0/9,  4.0/9,  6.0/9, \
1166     -4.0/9,  4.0/9,  6.0/9, \
1167     -2.0/9,  4.0/9,  6.0/9, \
1168       .0  ,  4.0/9,  6.0/9, \
1169      2.0/9,  4.0/9,  6.0/9, \
1170      4.0/9,  4.0/9,  6.0/9, \
1171      6.0/9,  4.0/9,  6.0/9, \
1172      8.0/9,  4.0/9,  6.0/9, \
1173     -8.0/9,  6.0/9,  6.0/9, \
1174     -6.0/9,  6.0/9,  6.0/9, \
1175     -4.0/9,  6.0/9,  6.0/9, \
1176     -2.0/9,  6.0/9,  6.0/9, \
1177       .0  ,  6.0/9,  6.0/9, \
1178      2.0/9,  6.0/9,  6.0/9, \
1179      4.0/9,  6.0/9,  6.0/9, \
1180      6.0/9,  6.0/9,  6.0/9, \
1181      8.0/9,  6.0/9,  6.0/9, \
1182     -8.0/9,  8.0/9,  6.0/9, \
1183     -6.0/9,  8.0/9,  6.0/9, \
1184     -4.0/9,  8.0/9,  6.0/9, \
1185     -2.0/9,  8.0/9,  6.0/9, \
1186       .0  ,  8.0/9,  6.0/9, \
1187      2.0/9,  8.0/9,  6.0/9, \
1188      4.0/9,  8.0/9,  6.0/9, \
1189      6.0/9,  8.0/9,  6.0/9, \
1190      8.0/9,  8.0/9,  6.0/9, \
1191     -8.0/9, -8.0/9,  8.0/9, \
1192     -6.0/9, -8.0/9,  8.0/9, \
1193     -4.0/9, -8.0/9,  8.0/9, \
1194     -2.0/9, -8.0/9,  8.0/9, \
1195       .0  , -8.0/9,  8.0/9, \
1196      2.0/9, -8.0/9,  8.0/9, \
1197      4.0/9, -8.0/9,  8.0/9, \
1198      6.0/9, -8.0/9,  8.0/9, \
1199      8.0/9, -8.0/9,  8.0/9, \
1200     -8.0/9, -6.0/9,  8.0/9, \
1201     -6.0/9, -6.0/9,  8.0/9, \
1202     -4.0/9, -6.0/9,  8.0/9, \
1203     -2.0/9, -6.0/9,  8.0/9, \
1204       .0  , -6.0/9,  8.0/9, \
1205      2.0/9, -6.0/9,  8.0/9, \
1206      4.0/9, -6.0/9,  8.0/9, \
1207      6.0/9, -6.0/9,  8.0/9, \
1208      8.0/9, -6.0/9,  8.0/9, \
1209     -8.0/9, -4.0/9,  8.0/9, \
1210     -6.0/9, -4.0/9,  8.0/9, \
1211     -4.0/9, -4.0/9,  8.0/9, \
1212     -2.0/9, -4.0/9,  8.0/9, \
1213       .0  , -4.0/9,  8.0/9, \
1214      2.0/9, -4.0/9,  8.0/9, \
1215      4.0/9, -4.0/9,  8.0/9, \
1216      6.0/9, -4.0/9,  8.0/9, \
1217      8.0/9, -4.0/9,  8.0/9, \
1218     -8.0/9, -2.0/9,  8.0/9, \
1219     -6.0/9, -2.0/9,  8.0/9, \
1220     -4.0/9, -2.0/9,  8.0/9, \
1221     -2.0/9, -2.0/9,  8.0/9, \
1222       .0  , -2.0/9,  8.0/9, \
1223      2.0/9, -2.0/9,  8.0/9, \
1224      4.0/9, -2.0/9,  8.0/9, \
1225      6.0/9, -2.0/9,  8.0/9, \
1226      8.0/9, -2.0/9,  8.0/9, \
1227     -8.0/9,   .0  ,  8.0/9, \
1228     -6.0/9,   .0  ,  8.0/9, \
1229     -4.0/9,   .0  ,  8.0/9, \
1230     -2.0/9,   .0  ,  8.0/9, \
1231       .0  ,   .0  ,  8.0/9, \
1232      2.0/9,   .0  ,  8.0/9, \
1233      4.0/9,   .0  ,  8.0/9, \
1234      6.0/9,   .0  ,  8.0/9, \
1235      8.0/9,   .0  ,  8.0/9, \
1236     -8.0/9,  2.0/9,  8.0/9, \
1237     -6.0/9,  2.0/9,  8.0/9, \
1238     -4.0/9,  2.0/9,  8.0/9, \
1239     -2.0/9,  2.0/9,  8.0/9, \
1240       .0  ,  2.0/9,  8.0/9, \
1241      2.0/9,  2.0/9,  8.0/9, \
1242      4.0/9,  2.0/9,  8.0/9, \
1243      6.0/9,  2.0/9,  8.0/9, \
1244      8.0/9,  2.0/9,  8.0/9, \
1245     -8.0/9,  4.0/9,  8.0/9, \
1246     -6.0/9,  4.0/9,  8.0/9, \
1247     -4.0/9,  4.0/9,  8.0/9, \
1248     -2.0/9,  4.0/9,  8.0/9, \
1249       .0  ,  4.0/9,  8.0/9, \
1250      2.0/9,  4.0/9,  8.0/9, \
1251      4.0/9,  4.0/9,  8.0/9, \
1252      6.0/9,  4.0/9,  8.0/9, \
1253      8.0/9,  4.0/9,  8.0/9, \
1254     -8.0/9,  6.0/9,  8.0/9, \
1255     -6.0/9,  6.0/9,  8.0/9, \
1256     -4.0/9,  6.0/9,  8.0/9, \
1257     -2.0/9,  6.0/9,  8.0/9, \
1258       .0  ,  6.0/9,  8.0/9, \
1259      2.0/9,  6.0/9,  8.0/9, \
1260      4.0/9,  6.0/9,  8.0/9, \
1261      6.0/9,  6.0/9,  8.0/9, \
1262      8.0/9,  6.0/9,  8.0/9, \
1263     -8.0/9,  8.0/9,  8.0/9, \
1264     -6.0/9,  8.0/9,  8.0/9, \
1265     -4.0/9,  8.0/9,  8.0/9, \
1266     -2.0/9,  8.0/9,  8.0/9, \
1267       .0  ,  8.0/9,  8.0/9, \
1268      2.0/9,  8.0/9,  8.0/9, \
1269      4.0/9,  8.0/9,  8.0/9, \
1270      6.0/9,  8.0/9,  8.0/9, \
1271      8.0/9,  8.0/9,  8.0/9 \
1272 }
1273
1274 /*
1275  * Requantization tables : see ISO/IEC 11172-3 Annex B.2 and B.4
1276  *
1277  * = We store the requantization information in the following structures :
1278  *     typedef struct requantization_s
1279  *     {
1280  *         byte_t               i_bits_per_codeword;
1281  *         const float *        pf_ungroup;
1282  *         float                f_slope;
1283  *         float                f_offset;
1284  *     } requantization_t;
1285  *
1286  * = Theses values depend on the bitrate per channel, on the subband number
1287  *   and on the allocation[ch][sb] (see ISO/IEC 11172-3 2.4.2.6 and Annex B.2).
1288  *
1289  * = But, in order to avoid data redundancy, we use the following properties :
1290  *
1291  *   - When bitrate_per_channel == 32 or 48 kbits/s (ie when
1292  *     bitrate_per_channel_index == 1 or 2), the requantization values depend
1293  *     only on allocation[ch][sb] (see ISO/IEC 11172-3 Annex B.2c and B.2d).
1294  *     That's why ADEC_LAYER2_REQUANTIZATION_CD = f(allocation).
1295  *
1296  *   - In the other cases (see ISO/IEC 11172-3 Annex B.2a and B.2b), we can
1297  *     divide the tables in 4 subtables :
1298  *       + ADEC_LAYER2_REQUANTIZATION_AB1 for sb in [0..2]
1299  *       + ADEC_LAYER2_REQUANTIZATION_AB2 for sb in [3..10]
1300  *       + ADEC_LAYER2_REQUANTIZATION_AB3 for sb in [11..22]
1301  *       + ADEC_LAYER2_REQUANTIZATION_AB4 for sb in [23..29]
1302  *     That's why ADEC_LAYER2_REQUANTIZATION_AB = f(sb, allocation)
1303  *
1304  * = When these tables are used, pf_ungroup3, pf_ungroup5, pf_ungroup9,
1305  *   requantization_ab1, requantization_ab2, requantization_ab3 and
1306  *   requantization_ab4 must already have been defined.
1307  */
1308 #define ADEC_LAYER2_REQUANTIZATION_CD \
1309 { \
1310     { 0,        NULL, .0               ,  .0           }, /* allocation  0 */ \
1311     { 5, pf_ungroup3, .0               ,  .0           }, /* allocation  1 */ \
1312     { 7, pf_ungroup5, .0               ,  .0           }, /* allocation  2 */ \
1313     {10, pf_ungroup9, .0               ,  .0           }, /* allocation  3 */ \
1314     { 4,        NULL, .133333333332    , -.933333333328}, /* allocation  4 */ \
1315     { 5,        NULL, .0645161290325   , -.967741935488}, /* allocation  5 */ \
1316     { 6,        NULL, .0317460317459   , -.984126984124}, /* allocation  6 */ \
1317     { 7,        NULL, .0157480314961   , -.992125984254}, /* allocation  7 */ \
1318     { 8,        NULL, .00784313725492  , -.996078431375}, /* allocation  8 */ \
1319     { 9,        NULL, .00391389432484  , -.998043052835}, /* allocation  9 */ \
1320     {10,        NULL, .00195503421311  , -.999022482897}, /* allocation 10 */ \
1321     {11,        NULL, .000977039570107 , -.99951148022 }, /* allocation 11 */ \
1322     {12,        NULL, .000488400488398 , -.999755799752}, /* allocation 12 */ \
1323     {13,        NULL, .000244170430962 , -.999877914789}, /* allocation 13 */ \
1324     {14,        NULL, .000122077763535 , -.999938961117}, /* allocation 14 */ \
1325     {15,        NULL, .000061037018952 , -.999969481491}  /* allocation 15 */ \
1326 }
1327
1328 #define ADEC_LAYER2_REQUANTIZATION_AB1 \
1329 { \
1330     { 0,        NULL, .0               ,  .0           }, /* allocation  0 */ \
1331     { 5, pf_ungroup3, .0               ,  .0           }, /* allocation  1 */ \
1332     { 3,        NULL, .285714285715    , -.857142857145}, /* allocation  2 */ \
1333     { 4,        NULL, .133333333332    , -.933333333328}, /* allocation  3 */ \
1334     { 5,        NULL, .0645161290325   , -.967741935488}, /* allocation  4 */ \
1335     { 6,        NULL, .0317460317459   , -.984126984124}, /* allocation  5 */ \
1336     { 7,        NULL, .0157480314961   , -.992125984254}, /* allocation  6 */ \
1337     { 8,        NULL, .00784313725492  , -.996078431375}, /* allocation  7 */ \
1338     { 9,        NULL, .00391389432484  , -.998043052835}, /* allocation  8 */ \
1339     {10,        NULL, .00195503421311  , -.999022482897}, /* allocation  9 */ \
1340     {11,        NULL, .000977039570107 , -.99951148022 }, /* allocation 10 */ \
1341     {12,        NULL, .000488400488398 , -.999755799752}, /* allocation 11 */ \
1342     {13,        NULL, .000244170430962 , -.999877914789}, /* allocation 12 */ \
1343     {14,        NULL, .000122077763535 , -.999938961117}, /* allocation 13 */ \
1344     {15,        NULL, .000061037018952 , -.999969481491}, /* allocation 14 */ \
1345     {16,        NULL, .0000305180437933, -.999984740976}  /* allocation 15 */ \
1346 }
1347
1348 #define ADEC_LAYER2_REQUANTIZATION_AB2 \
1349 { \
1350     { 0,        NULL, .0               ,  .0           }, /* allocation  0 */ \
1351     { 5, pf_ungroup3, .0               ,  .0           }, /* allocation  1 */ \
1352     { 7, pf_ungroup5, .0               ,  .0           }, /* allocation  2 */ \
1353     { 3,        NULL, .285714285715    , -.857142857145}, /* allocation  3 */ \
1354     {10, pf_ungroup9, .0               ,  .0           }, /* allocation  4 */ \
1355     { 4,        NULL, .133333333332    , -.933333333328}, /* allocation  5 */ \
1356     { 5,        NULL, .0645161290325   , -.967741935488}, /* allocation  6 */ \
1357     { 6,        NULL, .0317460317459   , -.984126984124}, /* allocation  7 */ \
1358     { 7,        NULL, .0157480314961   , -.992125984254}, /* allocation  8 */ \
1359     { 8,        NULL, .00784313725492  , -.996078431375}, /* allocation  9 */ \
1360     { 9,        NULL, .00391389432484  , -.998043052835}, /* allocation 10 */ \
1361     {10,        NULL, .00195503421311  , -.999022482897}, /* allocation 11 */ \
1362     {11,        NULL, .000977039570107 , -.99951148022 }, /* allocation 12 */ \
1363     {12,        NULL, .000488400488398 , -.999755799752}, /* allocation 13 */ \
1364     {13,        NULL, .000244170430962 , -.999877914789}, /* allocation 14 */ \
1365     {16,        NULL, .0000305180437933, -.999984740976}  /* allocation 15 */ \
1366 }
1367
1368 #define ADEC_LAYER2_REQUANTIZATION_AB3 \
1369 { \
1370     { 0,        NULL, .0               ,  .0           }, /* allocation  0 */ \
1371     { 5, pf_ungroup3, .0               ,  .0           }, /* allocation  1 */ \
1372     { 7, pf_ungroup5, .0               ,  .0           }, /* allocation  2 */ \
1373     { 3,        NULL, .285714285715    , -.857142857145}, /* allocation  3 */ \
1374     {10, pf_ungroup9, .0               ,  .0           }, /* allocation  4 */ \
1375     { 4,        NULL, .133333333332    , -.933333333328}, /* allocation  5 */ \
1376     { 5,        NULL, .0645161290325   , -.967741935488}, /* allocation  6 */ \
1377     {16,        NULL, .0000305180437933, -.999984740976}, /* allocation  7 */ \
1378     { 0,        NULL, .0               ,  .0           }, /* allocation  8 */ \
1379     { 0,        NULL, .0               ,  .0           }, /* allocation  9 */ \
1380     { 0,        NULL, .0               ,  .0           }, /* allocation 10 */ \
1381     { 0,        NULL, .0               ,  .0           }, /* allocation 11 */ \
1382     { 0,        NULL, .0               ,  .0           }, /* allocation 12 */ \
1383     { 0,        NULL, .0               ,  .0           }, /* allocation 13 */ \
1384     { 0,        NULL, .0               ,  .0           }, /* allocation 14 */ \
1385     { 0,        NULL, .0               ,  .0           }  /* allocation 15 */ \
1386 }
1387
1388 #define ADEC_LAYER2_REQUANTIZATION_AB4 \
1389 { \
1390     { 0,        NULL, .0               ,  .0           }, /* allocation  0 */ \
1391     { 5, pf_ungroup3, .0               ,  .0           }, /* allocation  1 */ \
1392     { 7, pf_ungroup5, .0               ,  .0           }, /* allocation  2 */ \
1393     {16,        NULL, .0000305180437933, -.999984740976}, /* allocation  3 */ \
1394     { 0,        NULL, .0               ,  .0           }, /* allocation  4 */ \
1395     { 0,        NULL, .0               ,  .0           }, /* allocation  5 */ \
1396     { 0,        NULL, .0               ,  .0           }, /* allocation  6 */ \
1397     { 0,        NULL, .0               ,  .0           }, /* allocation  7 */ \
1398     { 0,        NULL, .0               ,  .0           }, /* allocation  8 */ \
1399     { 0,        NULL, .0               ,  .0           }, /* allocation  9 */ \
1400     { 0,        NULL, .0               ,  .0           }, /* allocation 10 */ \
1401     { 0,        NULL, .0               ,  .0           }, /* allocation 11 */ \
1402     { 0,        NULL, .0               ,  .0           }, /* allocation 12 */ \
1403     { 0,        NULL, .0               ,  .0           }, /* allocation 13 */ \
1404     { 0,        NULL, .0               ,  .0           }, /* allocation 14 */ \
1405     { 0,        NULL, .0               ,  .0           }  /* allocation 15 */ \
1406 }
1407
1408 #define ADEC_LAYER2_REQUANTIZATION_AB \
1409 { \
1410     p_requantization_ab1, /* subband ==  0 */ \
1411     p_requantization_ab1, /* subband ==  1 */ \
1412     p_requantization_ab1, /* subband ==  2 */ \
1413     p_requantization_ab2, /* subband ==  3 */ \
1414     p_requantization_ab2, /* subband ==  4 */ \
1415     p_requantization_ab2, /* subband ==  5 */ \
1416     p_requantization_ab2, /* subband ==  6 */ \
1417     p_requantization_ab2, /* subband ==  7 */ \
1418     p_requantization_ab2, /* subband ==  8 */ \
1419     p_requantization_ab2, /* subband ==  9 */ \
1420     p_requantization_ab2, /* subband == 10 */ \
1421     p_requantization_ab3, /* subband == 11 */ \
1422     p_requantization_ab3, /* subband == 12 */ \
1423     p_requantization_ab3, /* subband == 13 */ \
1424     p_requantization_ab3, /* subband == 14 */ \
1425     p_requantization_ab3, /* subband == 15 */ \
1426     p_requantization_ab3, /* subband == 16 */ \
1427     p_requantization_ab3, /* subband == 17 */ \
1428     p_requantization_ab3, /* subband == 18 */ \
1429     p_requantization_ab3, /* subband == 19 */ \
1430     p_requantization_ab3, /* subband == 20 */ \
1431     p_requantization_ab3, /* subband == 21 */ \
1432     p_requantization_ab3, /* subband == 22 */ \
1433     p_requantization_ab4, /* subband == 23 */ \
1434     p_requantization_ab4, /* subband == 24 */ \
1435     p_requantization_ab4, /* subband == 25 */ \
1436     p_requantization_ab4, /* subband == 26 */ \
1437     p_requantization_ab4, /* subband == 27 */ \
1438     p_requantization_ab4, /* subband == 28 */ \
1439     p_requantization_ab4  /* subband == 29 */ \
1440 }