1 /*****************************************************************************
2 * audio_constants.h : defines the MPEG1 Layer I-II audio constants and tables
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
22 *****************************************************************************/
25 /*****************************************************************************
26 * 32 bits (4 bytes) audio frame header definitions
27 *****************************************************************************/
29 * syncword == `1111 1111 1111'
31 #define ADEC_HEADER_SYNCWORD_MASK 0xFFF00000
32 #define ADEC_HEADER_SYNCWORD_SHIFT 20
37 * `1' == ISO/CEI 11172-3
39 #define ADEC_HEADER_ID_MASK 0x00080000
40 #define ADEC_HEADER_ID_SHIFT 19
50 #define ADEC_HEADER_LAYER_MASK 0x00060000
51 #define ADEC_HEADER_LAYER_SHIFT 17
53 #define ADEC_HEADER_LAYER_1 0x00060000
54 #define ADEC_HEADER_LAYER_2 0x00040000
55 #define ADEC_HEADER_LAYER_3 0x00020000
58 #define ADEC_HEADER_PROTECTION_BIT_MASK 0x00010000
59 #define ADEC_HEADER_PROTECTION_BIT_SHIFT 16
62 #define ADEC_HEADER_BITRATE_INDEX_MASK 0x0000F000
63 #define ADEC_HEADER_BITRATE_INDEX_SHIFT 12
66 * sampling_frequency :
73 #define ADEC_HEADER_SAMPLING_FREQUENCY_MASK 0x00000C00
74 #define ADEC_HEADER_SAMPLING_FREQUENCY_SHIFT 10
77 #define ADEC_HEADER_PADDING_BIT_MASK 0x00000200
78 #define ADEC_HEADER_PADDING_BIT_SHIFT 9
81 #define ADEC_HEADER_PRIVATE_BIT_MASK 0x00000100
82 #define ADEC_HEADER_PRIVATE_BIT_SHIFT 8
87 * - `00' == stereo (stereo mode)
88 * - `01' == combined stereo (stereo mode)
89 * - `10' == two channels (stereo mode)
90 * - `11' == one channel (mono mode)
92 #define ADEC_HEADER_MODE_MASK 0x000000C0
93 #define ADEC_HEADER_MODE_SHIFT 6
96 #define ADEC_HEADER_MODE_EXTENSION_MASK 0x00000030
97 #define ADEC_HEADER_MODE_EXTENSION_SHIFT 4
100 #define ADEC_HEADER_COPYRIGHT_MASK 0x00000008
101 #define ADEC_HEADER_COPYRIGHT_SHIFT 3
104 #define ADEC_HEADER_ORIGINAL_COPY_MASK 0x00000004
105 #define ADEC_HEADER_ORIGINAL_COPY_SHIFT 2
108 #define ADEC_HEADER_EMPHASIS_MASK 0x00000003
109 #define ADEC_HEADER_EMPHASIS_SHIFT 0
112 /*****************************************************************************
113 * frame sizes = f( layer, padding_bit, sampling_frequency, bitrate_index )
114 *****************************************************************************
115 * ISO/IEC 11172-3 2.4.3.1 explains how to find out the number of bytes between
116 * two consecutive syncwords. In order to work out the body size of the frame,
117 * we just have to substract 4 bytes for the header size.
119 * = Layer I : (slot_size == 4 bytes)
120 * - padding_bit == 0 :
121 * frame_size = ( floor( 12 * bitrate(layer, bitrate_index) / sampling_frequency ) * 4 ) - 4
122 * - padding_bit == 1 :
123 * frame_size = ( ceil( 12 * bitrate(layer, bitrate_index) / sampling_frequency ) * 4 ) - 4
125 * = Layer II : (slot_size == 1 byte)
126 * - padding_bit == 0 :
127 * frame_size = ( floor( 144 * bitrate(layer, bitrate_index) / sampling_frequency ) * 1 ) - 4
128 * - padding_bit == 1 :
129 * frame_size = ( ceil( 144 * bitrate(layer, bitrate_index) / sampling_frequency ) * 1 ) - 4
131 * The frame sizes are stored in the following array :
132 * frame_size = ADEC_FRAME_SIZE[ 128*layer + 64*padding_bit + 16*sampling_frequency + bitrate_index ]
133 *****************************************************************************/
135 #define ADEC_FRAME_SIZE \
137 /* Layer == `00' (reserved) */ \
139 /* padding_bit == `0' */ \
141 /* sampling_frequency == `00' (44100 Hz) */ \
142 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
143 /* sampling_frequency == `01' (48000 Hz) */ \
144 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
145 /* sampling_frequency == `10' (32000 Hz) */ \
146 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
147 /* sampling_frequency == `11' (reserved) */ \
148 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
150 /* padding_bit == `1' */ \
152 /* sampling_frequency == `00' (44100 Hz) */ \
153 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
154 /* sampling_frequency == `01' (48000 Hz) */ \
155 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
156 /* sampling_frequency == `10' (32000 Hz) */ \
157 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
158 /* sampling_frequency == `11' (reserved) */ \
159 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
162 /* Layer == `01' (III) */ \
164 /* padding_bit == `0' */ \
166 /* sampling_frequency == `00' (44100 Hz) */ \
167 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
168 /* sampling_frequency == `01' (48000 Hz) */ \
169 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
170 /* sampling_frequency == `10' (32000 Hz) */ \
171 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
172 /* sampling_frequency == `11' (reserved) */ \
173 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
175 /* padding_bit == `1' */ \
177 /* sampling_frequency == `00' (44100 Hz) */ \
178 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
179 /* sampling_frequency == `01' (48000 Hz) */ \
180 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
181 /* sampling_frequency == `10' (32000 Hz) */ \
182 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
183 /* sampling_frequency == `11' (reserved) */ \
184 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
187 /* Layer == `10' (II) */ \
189 /* padding_bit == `0' */ \
191 /* sampling_frequency == `00' (44100 Hz) */ \
192 0, 100, 152, 178, 204, 257, 309, 361, 413, 518, 622, 727, 831, 1040, 1249, 0, \
193 /* sampling_frequency == `01' (48000 Hz) */ \
194 0, 92, 140, 164, 188, 236, 284, 332, 380, 476, 572, 668, 764, 956, 1148, 0, \
195 /* sampling_frequency == `10' (32000 Hz) */ \
196 0, 140, 212, 248, 284, 356, 428, 500, 572, 716, 860, 1004, 1148, 1436, 1724, 0, \
197 /* sampling_frequency == `11' (reserved) */ \
198 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
200 /* padding_bit == `1' */ \
202 /* sampling_frequency == `00' (44100 Hz) */ \
203 0, 101, 153, 179, 205, 258, 310, 362, 414, 519, 623, 728, 832, 1041, 1250, 0, \
204 /* sampling_frequency == `01' (48000 Hz) */ \
205 0, 92, 140, 164, 188, 236, 284, 332, 380, 476, 572, 668, 764, 956, 1148, 0, \
206 /* sampling_frequency == `10' (32000 Hz) */ \
207 0, 140, 212, 248, 284, 356, 428, 500, 572, 716, 860, 1004, 1148, 1436, 1724, 0, \
208 /* sampling_frequency == `11' (reserved) */ \
209 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
212 /* Layer == `11' (I) */ \
214 /* padding_bit == `0' */ \
216 /* sampling_frequency == `00' (44100 Hz) */ \
217 0, 28, 64, 100, 132, 168, 204, 236, 272, 308, 344, 376, 412, 448, 480, 0, \
218 /* sampling_frequency == `01' (48000 Hz) */ \
219 0, 28, 60, 92, 124, 156, 188, 220, 252, 284, 316, 348, 380, 412, 444, 0, \
220 /* sampling_frequency == `10' (32000 Hz) */ \
221 0, 44, 92, 140, 188, 236, 284, 332, 380, 428, 476, 524, 572, 620, 668, 0, \
222 /* sampling_frequency == `11' (reserved) */ \
223 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
225 /* padding_bit == `1' */ \
227 /* sampling_frequency == `00' (44100 Hz) */ \
228 0, 32, 68, 104, 136, 172, 208, 240, 276, 312, 348, 380, 416, 452, 484, 0, \
229 /* sampling_frequency == `01' (48000 Hz) */ \
230 0, 28, 60, 92, 124, 156, 188, 220, 252, 284, 316, 348, 380, 412, 444, 0, \
231 /* sampling_frequency == `10' (32000 Hz) */ \
232 0, 44, 92, 140, 188, 236, 284, 332, 380, 428, 476, 524, 572, 620, 668, 0, \
233 /* sampling_frequency == `11' (reserved) */ \
234 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 \
239 /*****************************************************************************
240 * scale factors = f( scalefactor ) (Layer I & II, see ISO/IEC 11172-3 2.4.1)
241 *****************************************************************************
242 * Theses values are 2^(1 - index/3) (see ISO/IEC 11172-3 2.4.2.5)
243 *****************************************************************************/
244 #define ADEC_SCALE_FACTOR \
246 /* 0*/ 2.00000000000000, /* 1*/ 1.58740105196820, /* 2*/ 1.25992104989487,\
247 /* 3*/ 1.00000000000000, /* 4*/ 0.79370052598410, /* 5*/ 0.62996052494744,\
248 /* 6*/ 0.50000000000000, /* 7*/ 0.39685026299205, /* 8*/ 0.31498026247372,\
249 /* 9*/ 0.25000000000000, /*10*/ 0.19842513149602, /*11*/ 0.15749013123686,\
250 /*12*/ 0.12500000000000, /*13*/ 0.09921256574801, /*14*/ 0.07874506561843,\
251 /*15*/ 0.06250000000000, /*16*/ 0.04960628287401, /*17*/ 0.03937253280921,\
252 /*18*/ 0.03125000000000, /*19*/ 0.02480314143700, /*20*/ 0.01968626640461,\
253 /*21*/ 0.01562500000000, /*22*/ 0.01240157071850, /*23*/ 0.00984313320230,\
254 /*24*/ 0.00781250000000, /*25*/ 0.00620078535925, /*26*/ 0.00492156660115,\
255 /*27*/ 0.00390625000000, /*28*/ 0.00310039267963, /*29*/ 0.00246078330058,\
256 /*30*/ 0.00195312500000, /*31*/ 0.00155019633981, /*32*/ 0.00123039165029,\
257 /*33*/ 0.00097656250000, /*34*/ 0.00077509816991, /*35*/ 0.00061519582514,\
258 /*36*/ 0.00048828125000, /*37*/ 0.00038754908495, /*38*/ 0.00030759791257,\
259 /*39*/ 0.00024414062500, /*40*/ 0.00019377454248, /*41*/ 0.00015379895629,\
260 /*42*/ 0.00012207031250, /*43*/ 0.00009688727124, /*44*/ 0.00007689947814,\
261 /*45*/ 0.00006103515625, /*46*/ 0.00004844363562, /*47*/ 0.00003844973907,\
262 /*48*/ 0.00003051757813, /*49*/ 0.00002422181781, /*50*/ 0.00001922486954,\
263 /*51*/ 0.00001525878906, /*52*/ 0.00001211090890, /*53*/ 0.00000961243477,\
264 /*54*/ 0.00000762939453, /*55*/ 0.00000605545445, /*56*/ 0.00000480621738,\
265 /*57*/ 0.00000381469727, /*58*/ 0.00000302772723, /*59*/ 0.00000240310869,\
266 /*60*/ 0.00000190734863, /*61*/ 0.00000151386361, /*62*/ 0.00000120155435,\
267 /*63*/ 0.0 /* XXX?? invalid scale factor ? */ \
271 /*****************************************************************************
272 * Layer I definitions
273 *****************************************************************************/
276 * slope table = f( allocation[ch][sb] (see ISO/IEC 11171-3 2.4.1) )
278 #define ADEC_LAYER1_SLOPE \
280 /* 0*/ 0.0, /* no sample */ \
295 /*15*/ 0.0 /* invalid bit allocation */ \
299 * offset table = f( allocation[ch][sb] (see ISO/IEC 11172-3 2.4.1) )
301 #define ADEC_LAYER1_OFFSET \
303 /* 0*/ 0.0, /* no sample */ \
312 /* 9*/ -1022.0/1023, \
313 /*10*/ -2046.0/2047, \
314 /*11*/ -4094.0/4095, \
315 /*12*/ -8190.0/8191, \
316 /*13*/ -16382.0/16383, \
317 /*14*/ -32766.0/32767, \
318 /*15*/ 0.0 /* invalid bit allocation */ \
322 /*****************************************************************************
323 * Layer II definitions
324 *****************************************************************************/
327 * Bitrate PER CHANNEL index = f( mode, bitrate_index )
328 * (see ISO/IEC 11172-3 2.4.2.3)
330 * - This index is used in the ADEC_LAYER2_SBLIMIT and ADEC_LAYER2_NBAL tables.
332 * - 0 == forbidden mode/bitrate_index combination
333 * - 1 == 32 kbits/s per channel
334 * - 2 == 48 kbits/s per channel
335 * - 3 == 56 kbits/s per channel
336 * - 4 == 64 kbits/s per channel
337 * - 5 == 80 kbits/s per channel
338 * - 6 == 96 kbits/s per channel
339 * - 7 == 112 kbits/s per channel
340 * - 8 == 128 kbits/s per channel
341 * - 9 == 160 kbits/s per channel
342 * - 10 == 192 kbits/s per channel
344 #define ADEC_LAYER2_BITRATE_PER_CHANNEL_INDEX \
346 /* mode == `00' (stereo) */ \
347 { 0, 0, 0, 0, 1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, \
348 /* mode == `01' (combined stereo) */ \
349 { 0, 0, 0, 0, 1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, \
350 /* mode == `10' (two channels) */ \
351 { 0, 0, 0, 0, 1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, \
352 /* mode == `11' (one channel) */ \
353 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 0, 0, 0 } \
357 * Number of subbands = f( sampling_frequency, bitrate_per_channel_index )
358 * (see ISO/IEC 11172-3 Annex B.2)
360 #define ADEC_LAYER2_SBLIMIT \
362 /* sampling_frequency == `00' (44100 Hz) */ \
363 { 0, 8, 8, 27, 27, 27, 30, 30, 30, 30, 30}, \
364 /* sampling_frequency == `01' (48000 Hz) */ \
365 { 0, 8, 8, 27, 27, 27, 27, 27, 27, 27, 27}, \
366 /* sampling_frequency == `10' (32000 Hz) */ \
367 { 0, 12, 12, 27, 27, 27, 30, 30, 30, 30, 30} \
371 * Number of bits allocated = f( bitrate_per_channel_index, subband )
372 * (see ISO/IEC 11172-3 Annex B.2)
374 #define ADEC_LAYER2_NBAL \
376 /* bitrate_per_channel_index <= 2 */ \
377 { 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}, \
378 /* bitrate_per_channel_index > 2 */ \
379 { 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} \
383 * = When 3 samples are grouped in one codeword, we have to ungroup them in
384 * order to dequantize the samples (see ISO/IEC 11172-3 2.4.3.3.4) :
386 * for ( i = 0; i < 3; i++ )
388 * s[i] = c % nlevels;
393 * = We pre-calculated all this, and stored the results in the following
394 * ungroup`nlevels' tables. ISO/IEC 11172-3 Annex B.4 tells us that the
395 * samples are grouped only when nlevels == 3, 5, or 9.
397 * = ADEC_LAYER2_UNGROUPn = f(3 * n*n*n)
399 #define ADEC_LAYER2_UNGROUP3 \
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, \
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 -2.0/3, -2.0/3, .0 , \
412 2.0/3, -2.0/3, .0 , \
416 -2.0/3, 2.0/3, .0 , \
419 -2.0/3, -2.0/3, 2.0/3, \
420 .0 , -2.0/3, 2.0/3, \
421 2.0/3, -2.0/3, 2.0/3, \
422 -2.0/3, .0 , 2.0/3, \
425 -2.0/3, 2.0/3, 2.0/3, \
427 2.0/3, 2.0/3, 2.0/3 \
430 #define ADEC_LAYER2_UNGROUP5 \
559 #define ADEC_LAYER2_UNGROUP9 \
561 -8.0/9, -8.0/9, -8.0/9, \
562 -6.0/9, -8.0/9, -8.0/9, \
563 -4.0/9, -8.0/9, -8.0/9, \
564 -2.0/9, -8.0/9, -8.0/9, \
565 .0 , -8.0/9, -8.0/9, \
566 2.0/9, -8.0/9, -8.0/9, \
567 4.0/9, -8.0/9, -8.0/9, \
568 6.0/9, -8.0/9, -8.0/9, \
569 8.0/9, -8.0/9, -8.0/9, \
570 -8.0/9, -6.0/9, -8.0/9, \
571 -6.0/9, -6.0/9, -8.0/9, \
572 -4.0/9, -6.0/9, -8.0/9, \
573 -2.0/9, -6.0/9, -8.0/9, \
574 .0 , -6.0/9, -8.0/9, \
575 2.0/9, -6.0/9, -8.0/9, \
576 4.0/9, -6.0/9, -8.0/9, \
577 6.0/9, -6.0/9, -8.0/9, \
578 8.0/9, -6.0/9, -8.0/9, \
579 -8.0/9, -4.0/9, -8.0/9, \
580 -6.0/9, -4.0/9, -8.0/9, \
581 -4.0/9, -4.0/9, -8.0/9, \
582 -2.0/9, -4.0/9, -8.0/9, \
583 .0 , -4.0/9, -8.0/9, \
584 2.0/9, -4.0/9, -8.0/9, \
585 4.0/9, -4.0/9, -8.0/9, \
586 6.0/9, -4.0/9, -8.0/9, \
587 8.0/9, -4.0/9, -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, .0 , -8.0/9, \
598 -6.0/9, .0 , -8.0/9, \
599 -4.0/9, .0 , -8.0/9, \
600 -2.0/9, .0 , -8.0/9, \
602 2.0/9, .0 , -8.0/9, \
603 4.0/9, .0 , -8.0/9, \
604 6.0/9, .0 , -8.0/9, \
605 8.0/9, .0 , -8.0/9, \
606 -8.0/9, 2.0/9, -8.0/9, \
607 -6.0/9, 2.0/9, -8.0/9, \
608 -4.0/9, 2.0/9, -8.0/9, \
609 -2.0/9, 2.0/9, -8.0/9, \
610 .0 , 2.0/9, -8.0/9, \
611 2.0/9, 2.0/9, -8.0/9, \
612 4.0/9, 2.0/9, -8.0/9, \
613 6.0/9, 2.0/9, -8.0/9, \
614 8.0/9, 2.0/9, -8.0/9, \
615 -8.0/9, 4.0/9, -8.0/9, \
616 -6.0/9, 4.0/9, -8.0/9, \
617 -4.0/9, 4.0/9, -8.0/9, \
618 -2.0/9, 4.0/9, -8.0/9, \
619 .0 , 4.0/9, -8.0/9, \
620 2.0/9, 4.0/9, -8.0/9, \
621 4.0/9, 4.0/9, -8.0/9, \
622 6.0/9, 4.0/9, -8.0/9, \
623 8.0/9, 4.0/9, -8.0/9, \
624 -8.0/9, 6.0/9, -8.0/9, \
625 -6.0/9, 6.0/9, -8.0/9, \
626 -4.0/9, 6.0/9, -8.0/9, \
627 -2.0/9, 6.0/9, -8.0/9, \
628 .0 , 6.0/9, -8.0/9, \
629 2.0/9, 6.0/9, -8.0/9, \
630 4.0/9, 6.0/9, -8.0/9, \
631 6.0/9, 6.0/9, -8.0/9, \
632 8.0/9, 6.0/9, -8.0/9, \
633 -8.0/9, 8.0/9, -8.0/9, \
634 -6.0/9, 8.0/9, -8.0/9, \
635 -4.0/9, 8.0/9, -8.0/9, \
636 -2.0/9, 8.0/9, -8.0/9, \
637 .0 , 8.0/9, -8.0/9, \
638 2.0/9, 8.0/9, -8.0/9, \
639 4.0/9, 8.0/9, -8.0/9, \
640 6.0/9, 8.0/9, -8.0/9, \
641 8.0/9, 8.0/9, -8.0/9, \
642 -8.0/9, -8.0/9, -6.0/9, \
643 -6.0/9, -8.0/9, -6.0/9, \
644 -4.0/9, -8.0/9, -6.0/9, \
645 -2.0/9, -8.0/9, -6.0/9, \
646 .0 , -8.0/9, -6.0/9, \
647 2.0/9, -8.0/9, -6.0/9, \
648 4.0/9, -8.0/9, -6.0/9, \
649 6.0/9, -8.0/9, -6.0/9, \
650 8.0/9, -8.0/9, -6.0/9, \
651 -8.0/9, -6.0/9, -6.0/9, \
652 -6.0/9, -6.0/9, -6.0/9, \
653 -4.0/9, -6.0/9, -6.0/9, \
654 -2.0/9, -6.0/9, -6.0/9, \
655 .0 , -6.0/9, -6.0/9, \
656 2.0/9, -6.0/9, -6.0/9, \
657 4.0/9, -6.0/9, -6.0/9, \
658 6.0/9, -6.0/9, -6.0/9, \
659 8.0/9, -6.0/9, -6.0/9, \
660 -8.0/9, -4.0/9, -6.0/9, \
661 -6.0/9, -4.0/9, -6.0/9, \
662 -4.0/9, -4.0/9, -6.0/9, \
663 -2.0/9, -4.0/9, -6.0/9, \
664 .0 , -4.0/9, -6.0/9, \
665 2.0/9, -4.0/9, -6.0/9, \
666 4.0/9, -4.0/9, -6.0/9, \
667 6.0/9, -4.0/9, -6.0/9, \
668 8.0/9, -4.0/9, -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, .0 , -6.0/9, \
679 -6.0/9, .0 , -6.0/9, \
680 -4.0/9, .0 , -6.0/9, \
681 -2.0/9, .0 , -6.0/9, \
683 2.0/9, .0 , -6.0/9, \
684 4.0/9, .0 , -6.0/9, \
685 6.0/9, .0 , -6.0/9, \
686 8.0/9, .0 , -6.0/9, \
687 -8.0/9, 2.0/9, -6.0/9, \
688 -6.0/9, 2.0/9, -6.0/9, \
689 -4.0/9, 2.0/9, -6.0/9, \
690 -2.0/9, 2.0/9, -6.0/9, \
691 .0 , 2.0/9, -6.0/9, \
692 2.0/9, 2.0/9, -6.0/9, \
693 4.0/9, 2.0/9, -6.0/9, \
694 6.0/9, 2.0/9, -6.0/9, \
695 8.0/9, 2.0/9, -6.0/9, \
696 -8.0/9, 4.0/9, -6.0/9, \
697 -6.0/9, 4.0/9, -6.0/9, \
698 -4.0/9, 4.0/9, -6.0/9, \
699 -2.0/9, 4.0/9, -6.0/9, \
700 .0 , 4.0/9, -6.0/9, \
701 2.0/9, 4.0/9, -6.0/9, \
702 4.0/9, 4.0/9, -6.0/9, \
703 6.0/9, 4.0/9, -6.0/9, \
704 8.0/9, 4.0/9, -6.0/9, \
705 -8.0/9, 6.0/9, -6.0/9, \
706 -6.0/9, 6.0/9, -6.0/9, \
707 -4.0/9, 6.0/9, -6.0/9, \
708 -2.0/9, 6.0/9, -6.0/9, \
709 .0 , 6.0/9, -6.0/9, \
710 2.0/9, 6.0/9, -6.0/9, \
711 4.0/9, 6.0/9, -6.0/9, \
712 6.0/9, 6.0/9, -6.0/9, \
713 8.0/9, 6.0/9, -6.0/9, \
714 -8.0/9, 8.0/9, -6.0/9, \
715 -6.0/9, 8.0/9, -6.0/9, \
716 -4.0/9, 8.0/9, -6.0/9, \
717 -2.0/9, 8.0/9, -6.0/9, \
718 .0 , 8.0/9, -6.0/9, \
719 2.0/9, 8.0/9, -6.0/9, \
720 4.0/9, 8.0/9, -6.0/9, \
721 6.0/9, 8.0/9, -6.0/9, \
722 8.0/9, 8.0/9, -6.0/9, \
723 -8.0/9, -8.0/9, -4.0/9, \
724 -6.0/9, -8.0/9, -4.0/9, \
725 -4.0/9, -8.0/9, -4.0/9, \
726 -2.0/9, -8.0/9, -4.0/9, \
727 .0 , -8.0/9, -4.0/9, \
728 2.0/9, -8.0/9, -4.0/9, \
729 4.0/9, -8.0/9, -4.0/9, \
730 6.0/9, -8.0/9, -4.0/9, \
731 8.0/9, -8.0/9, -4.0/9, \
732 -8.0/9, -6.0/9, -4.0/9, \
733 -6.0/9, -6.0/9, -4.0/9, \
734 -4.0/9, -6.0/9, -4.0/9, \
735 -2.0/9, -6.0/9, -4.0/9, \
736 .0 , -6.0/9, -4.0/9, \
737 2.0/9, -6.0/9, -4.0/9, \
738 4.0/9, -6.0/9, -4.0/9, \
739 6.0/9, -6.0/9, -4.0/9, \
740 8.0/9, -6.0/9, -4.0/9, \
741 -8.0/9, -4.0/9, -4.0/9, \
742 -6.0/9, -4.0/9, -4.0/9, \
743 -4.0/9, -4.0/9, -4.0/9, \
744 -2.0/9, -4.0/9, -4.0/9, \
745 .0 , -4.0/9, -4.0/9, \
746 2.0/9, -4.0/9, -4.0/9, \
747 4.0/9, -4.0/9, -4.0/9, \
748 6.0/9, -4.0/9, -4.0/9, \
749 8.0/9, -4.0/9, -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, .0 , -4.0/9, \
760 -6.0/9, .0 , -4.0/9, \
761 -4.0/9, .0 , -4.0/9, \
762 -2.0/9, .0 , -4.0/9, \
764 2.0/9, .0 , -4.0/9, \
765 4.0/9, .0 , -4.0/9, \
766 6.0/9, .0 , -4.0/9, \
767 8.0/9, .0 , -4.0/9, \
768 -8.0/9, 2.0/9, -4.0/9, \
769 -6.0/9, 2.0/9, -4.0/9, \
770 -4.0/9, 2.0/9, -4.0/9, \
771 -2.0/9, 2.0/9, -4.0/9, \
772 .0 , 2.0/9, -4.0/9, \
773 2.0/9, 2.0/9, -4.0/9, \
774 4.0/9, 2.0/9, -4.0/9, \
775 6.0/9, 2.0/9, -4.0/9, \
776 8.0/9, 2.0/9, -4.0/9, \
777 -8.0/9, 4.0/9, -4.0/9, \
778 -6.0/9, 4.0/9, -4.0/9, \
779 -4.0/9, 4.0/9, -4.0/9, \
780 -2.0/9, 4.0/9, -4.0/9, \
781 .0 , 4.0/9, -4.0/9, \
782 2.0/9, 4.0/9, -4.0/9, \
783 4.0/9, 4.0/9, -4.0/9, \
784 6.0/9, 4.0/9, -4.0/9, \
785 8.0/9, 4.0/9, -4.0/9, \
786 -8.0/9, 6.0/9, -4.0/9, \
787 -6.0/9, 6.0/9, -4.0/9, \
788 -4.0/9, 6.0/9, -4.0/9, \
789 -2.0/9, 6.0/9, -4.0/9, \
790 .0 , 6.0/9, -4.0/9, \
791 2.0/9, 6.0/9, -4.0/9, \
792 4.0/9, 6.0/9, -4.0/9, \
793 6.0/9, 6.0/9, -4.0/9, \
794 8.0/9, 6.0/9, -4.0/9, \
795 -8.0/9, 8.0/9, -4.0/9, \
796 -6.0/9, 8.0/9, -4.0/9, \
797 -4.0/9, 8.0/9, -4.0/9, \
798 -2.0/9, 8.0/9, -4.0/9, \
799 .0 , 8.0/9, -4.0/9, \
800 2.0/9, 8.0/9, -4.0/9, \
801 4.0/9, 8.0/9, -4.0/9, \
802 6.0/9, 8.0/9, -4.0/9, \
803 8.0/9, 8.0/9, -4.0/9, \
804 -8.0/9, -8.0/9, -2.0/9, \
805 -6.0/9, -8.0/9, -2.0/9, \
806 -4.0/9, -8.0/9, -2.0/9, \
807 -2.0/9, -8.0/9, -2.0/9, \
808 .0 , -8.0/9, -2.0/9, \
809 2.0/9, -8.0/9, -2.0/9, \
810 4.0/9, -8.0/9, -2.0/9, \
811 6.0/9, -8.0/9, -2.0/9, \
812 8.0/9, -8.0/9, -2.0/9, \
813 -8.0/9, -6.0/9, -2.0/9, \
814 -6.0/9, -6.0/9, -2.0/9, \
815 -4.0/9, -6.0/9, -2.0/9, \
816 -2.0/9, -6.0/9, -2.0/9, \
817 .0 , -6.0/9, -2.0/9, \
818 2.0/9, -6.0/9, -2.0/9, \
819 4.0/9, -6.0/9, -2.0/9, \
820 6.0/9, -6.0/9, -2.0/9, \
821 8.0/9, -6.0/9, -2.0/9, \
822 -8.0/9, -4.0/9, -2.0/9, \
823 -6.0/9, -4.0/9, -2.0/9, \
824 -4.0/9, -4.0/9, -2.0/9, \
825 -2.0/9, -4.0/9, -2.0/9, \
826 .0 , -4.0/9, -2.0/9, \
827 2.0/9, -4.0/9, -2.0/9, \
828 4.0/9, -4.0/9, -2.0/9, \
829 6.0/9, -4.0/9, -2.0/9, \
830 8.0/9, -4.0/9, -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, .0 , -2.0/9, \
841 -6.0/9, .0 , -2.0/9, \
842 -4.0/9, .0 , -2.0/9, \
843 -2.0/9, .0 , -2.0/9, \
845 2.0/9, .0 , -2.0/9, \
846 4.0/9, .0 , -2.0/9, \
847 6.0/9, .0 , -2.0/9, \
848 8.0/9, .0 , -2.0/9, \
849 -8.0/9, 2.0/9, -2.0/9, \
850 -6.0/9, 2.0/9, -2.0/9, \
851 -4.0/9, 2.0/9, -2.0/9, \
852 -2.0/9, 2.0/9, -2.0/9, \
853 .0 , 2.0/9, -2.0/9, \
854 2.0/9, 2.0/9, -2.0/9, \
855 4.0/9, 2.0/9, -2.0/9, \
856 6.0/9, 2.0/9, -2.0/9, \
857 8.0/9, 2.0/9, -2.0/9, \
858 -8.0/9, 4.0/9, -2.0/9, \
859 -6.0/9, 4.0/9, -2.0/9, \
860 -4.0/9, 4.0/9, -2.0/9, \
861 -2.0/9, 4.0/9, -2.0/9, \
862 .0 , 4.0/9, -2.0/9, \
863 2.0/9, 4.0/9, -2.0/9, \
864 4.0/9, 4.0/9, -2.0/9, \
865 6.0/9, 4.0/9, -2.0/9, \
866 8.0/9, 4.0/9, -2.0/9, \
867 -8.0/9, 6.0/9, -2.0/9, \
868 -6.0/9, 6.0/9, -2.0/9, \
869 -4.0/9, 6.0/9, -2.0/9, \
870 -2.0/9, 6.0/9, -2.0/9, \
871 .0 , 6.0/9, -2.0/9, \
872 2.0/9, 6.0/9, -2.0/9, \
873 4.0/9, 6.0/9, -2.0/9, \
874 6.0/9, 6.0/9, -2.0/9, \
875 8.0/9, 6.0/9, -2.0/9, \
876 -8.0/9, 8.0/9, -2.0/9, \
877 -6.0/9, 8.0/9, -2.0/9, \
878 -4.0/9, 8.0/9, -2.0/9, \
879 -2.0/9, 8.0/9, -2.0/9, \
880 .0 , 8.0/9, -2.0/9, \
881 2.0/9, 8.0/9, -2.0/9, \
882 4.0/9, 8.0/9, -2.0/9, \
883 6.0/9, 8.0/9, -2.0/9, \
884 8.0/9, 8.0/9, -2.0/9, \
885 -8.0/9, -8.0/9, .0 , \
886 -6.0/9, -8.0/9, .0 , \
887 -4.0/9, -8.0/9, .0 , \
888 -2.0/9, -8.0/9, .0 , \
890 2.0/9, -8.0/9, .0 , \
891 4.0/9, -8.0/9, .0 , \
892 6.0/9, -8.0/9, .0 , \
893 8.0/9, -8.0/9, .0 , \
894 -8.0/9, -6.0/9, .0 , \
895 -6.0/9, -6.0/9, .0 , \
896 -4.0/9, -6.0/9, .0 , \
897 -2.0/9, -6.0/9, .0 , \
899 2.0/9, -6.0/9, .0 , \
900 4.0/9, -6.0/9, .0 , \
901 6.0/9, -6.0/9, .0 , \
902 8.0/9, -6.0/9, .0 , \
903 -8.0/9, -4.0/9, .0 , \
904 -6.0/9, -4.0/9, .0 , \
905 -4.0/9, -4.0/9, .0 , \
906 -2.0/9, -4.0/9, .0 , \
908 2.0/9, -4.0/9, .0 , \
909 4.0/9, -4.0/9, .0 , \
910 6.0/9, -4.0/9, .0 , \
911 8.0/9, -4.0/9, .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 , \
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 , \
930 -8.0/9, 2.0/9, .0 , \
931 -6.0/9, 2.0/9, .0 , \
932 -4.0/9, 2.0/9, .0 , \
933 -2.0/9, 2.0/9, .0 , \
939 -8.0/9, 4.0/9, .0 , \
940 -6.0/9, 4.0/9, .0 , \
941 -4.0/9, 4.0/9, .0 , \
942 -2.0/9, 4.0/9, .0 , \
948 -8.0/9, 6.0/9, .0 , \
949 -6.0/9, 6.0/9, .0 , \
950 -4.0/9, 6.0/9, .0 , \
951 -2.0/9, 6.0/9, .0 , \
957 -8.0/9, 8.0/9, .0 , \
958 -6.0/9, 8.0/9, .0 , \
959 -4.0/9, 8.0/9, .0 , \
960 -2.0/9, 8.0/9, .0 , \
966 -8.0/9, -8.0/9, 2.0/9, \
967 -6.0/9, -8.0/9, 2.0/9, \
968 -4.0/9, -8.0/9, 2.0/9, \
969 -2.0/9, -8.0/9, 2.0/9, \
970 .0 , -8.0/9, 2.0/9, \
971 2.0/9, -8.0/9, 2.0/9, \
972 4.0/9, -8.0/9, 2.0/9, \
973 6.0/9, -8.0/9, 2.0/9, \
974 8.0/9, -8.0/9, 2.0/9, \
975 -8.0/9, -6.0/9, 2.0/9, \
976 -6.0/9, -6.0/9, 2.0/9, \
977 -4.0/9, -6.0/9, 2.0/9, \
978 -2.0/9, -6.0/9, 2.0/9, \
979 .0 , -6.0/9, 2.0/9, \
980 2.0/9, -6.0/9, 2.0/9, \
981 4.0/9, -6.0/9, 2.0/9, \
982 6.0/9, -6.0/9, 2.0/9, \
983 8.0/9, -6.0/9, 2.0/9, \
984 -8.0/9, -4.0/9, 2.0/9, \
985 -6.0/9, -4.0/9, 2.0/9, \
986 -4.0/9, -4.0/9, 2.0/9, \
987 -2.0/9, -4.0/9, 2.0/9, \
988 .0 , -4.0/9, 2.0/9, \
989 2.0/9, -4.0/9, 2.0/9, \
990 4.0/9, -4.0/9, 2.0/9, \
991 6.0/9, -4.0/9, 2.0/9, \
992 8.0/9, -4.0/9, 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, .0 , 2.0/9, \
1003 -6.0/9, .0 , 2.0/9, \
1004 -4.0/9, .0 , 2.0/9, \
1005 -2.0/9, .0 , 2.0/9, \
1007 2.0/9, .0 , 2.0/9, \
1008 4.0/9, .0 , 2.0/9, \
1009 6.0/9, .0 , 2.0/9, \
1010 8.0/9, .0 , 2.0/9, \
1011 -8.0/9, 2.0/9, 2.0/9, \
1012 -6.0/9, 2.0/9, 2.0/9, \
1013 -4.0/9, 2.0/9, 2.0/9, \
1014 -2.0/9, 2.0/9, 2.0/9, \
1015 .0 , 2.0/9, 2.0/9, \
1016 2.0/9, 2.0/9, 2.0/9, \
1017 4.0/9, 2.0/9, 2.0/9, \
1018 6.0/9, 2.0/9, 2.0/9, \
1019 8.0/9, 2.0/9, 2.0/9, \
1020 -8.0/9, 4.0/9, 2.0/9, \
1021 -6.0/9, 4.0/9, 2.0/9, \
1022 -4.0/9, 4.0/9, 2.0/9, \
1023 -2.0/9, 4.0/9, 2.0/9, \
1024 .0 , 4.0/9, 2.0/9, \
1025 2.0/9, 4.0/9, 2.0/9, \
1026 4.0/9, 4.0/9, 2.0/9, \
1027 6.0/9, 4.0/9, 2.0/9, \
1028 8.0/9, 4.0/9, 2.0/9, \
1029 -8.0/9, 6.0/9, 2.0/9, \
1030 -6.0/9, 6.0/9, 2.0/9, \
1031 -4.0/9, 6.0/9, 2.0/9, \
1032 -2.0/9, 6.0/9, 2.0/9, \
1033 .0 , 6.0/9, 2.0/9, \
1034 2.0/9, 6.0/9, 2.0/9, \
1035 4.0/9, 6.0/9, 2.0/9, \
1036 6.0/9, 6.0/9, 2.0/9, \
1037 8.0/9, 6.0/9, 2.0/9, \
1038 -8.0/9, 8.0/9, 2.0/9, \
1039 -6.0/9, 8.0/9, 2.0/9, \
1040 -4.0/9, 8.0/9, 2.0/9, \
1041 -2.0/9, 8.0/9, 2.0/9, \
1042 .0 , 8.0/9, 2.0/9, \
1043 2.0/9, 8.0/9, 2.0/9, \
1044 4.0/9, 8.0/9, 2.0/9, \
1045 6.0/9, 8.0/9, 2.0/9, \
1046 8.0/9, 8.0/9, 2.0/9, \
1047 -8.0/9, -8.0/9, 4.0/9, \
1048 -6.0/9, -8.0/9, 4.0/9, \
1049 -4.0/9, -8.0/9, 4.0/9, \
1050 -2.0/9, -8.0/9, 4.0/9, \
1051 .0 , -8.0/9, 4.0/9, \
1052 2.0/9, -8.0/9, 4.0/9, \
1053 4.0/9, -8.0/9, 4.0/9, \
1054 6.0/9, -8.0/9, 4.0/9, \
1055 8.0/9, -8.0/9, 4.0/9, \
1056 -8.0/9, -6.0/9, 4.0/9, \
1057 -6.0/9, -6.0/9, 4.0/9, \
1058 -4.0/9, -6.0/9, 4.0/9, \
1059 -2.0/9, -6.0/9, 4.0/9, \
1060 .0 , -6.0/9, 4.0/9, \
1061 2.0/9, -6.0/9, 4.0/9, \
1062 4.0/9, -6.0/9, 4.0/9, \
1063 6.0/9, -6.0/9, 4.0/9, \
1064 8.0/9, -6.0/9, 4.0/9, \
1065 -8.0/9, -4.0/9, 4.0/9, \
1066 -6.0/9, -4.0/9, 4.0/9, \
1067 -4.0/9, -4.0/9, 4.0/9, \
1068 -2.0/9, -4.0/9, 4.0/9, \
1069 .0 , -4.0/9, 4.0/9, \
1070 2.0/9, -4.0/9, 4.0/9, \
1071 4.0/9, -4.0/9, 4.0/9, \
1072 6.0/9, -4.0/9, 4.0/9, \
1073 8.0/9, -4.0/9, 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, .0 , 4.0/9, \
1084 -6.0/9, .0 , 4.0/9, \
1085 -4.0/9, .0 , 4.0/9, \
1086 -2.0/9, .0 , 4.0/9, \
1088 2.0/9, .0 , 4.0/9, \
1089 4.0/9, .0 , 4.0/9, \
1090 6.0/9, .0 , 4.0/9, \
1091 8.0/9, .0 , 4.0/9, \
1092 -8.0/9, 2.0/9, 4.0/9, \
1093 -6.0/9, 2.0/9, 4.0/9, \
1094 -4.0/9, 2.0/9, 4.0/9, \
1095 -2.0/9, 2.0/9, 4.0/9, \
1096 .0 , 2.0/9, 4.0/9, \
1097 2.0/9, 2.0/9, 4.0/9, \
1098 4.0/9, 2.0/9, 4.0/9, \
1099 6.0/9, 2.0/9, 4.0/9, \
1100 8.0/9, 2.0/9, 4.0/9, \
1101 -8.0/9, 4.0/9, 4.0/9, \
1102 -6.0/9, 4.0/9, 4.0/9, \
1103 -4.0/9, 4.0/9, 4.0/9, \
1104 -2.0/9, 4.0/9, 4.0/9, \
1105 .0 , 4.0/9, 4.0/9, \
1106 2.0/9, 4.0/9, 4.0/9, \
1107 4.0/9, 4.0/9, 4.0/9, \
1108 6.0/9, 4.0/9, 4.0/9, \
1109 8.0/9, 4.0/9, 4.0/9, \
1110 -8.0/9, 6.0/9, 4.0/9, \
1111 -6.0/9, 6.0/9, 4.0/9, \
1112 -4.0/9, 6.0/9, 4.0/9, \
1113 -2.0/9, 6.0/9, 4.0/9, \
1114 .0 , 6.0/9, 4.0/9, \
1115 2.0/9, 6.0/9, 4.0/9, \
1116 4.0/9, 6.0/9, 4.0/9, \
1117 6.0/9, 6.0/9, 4.0/9, \
1118 8.0/9, 6.0/9, 4.0/9, \
1119 -8.0/9, 8.0/9, 4.0/9, \
1120 -6.0/9, 8.0/9, 4.0/9, \
1121 -4.0/9, 8.0/9, 4.0/9, \
1122 -2.0/9, 8.0/9, 4.0/9, \
1123 .0 , 8.0/9, 4.0/9, \
1124 2.0/9, 8.0/9, 4.0/9, \
1125 4.0/9, 8.0/9, 4.0/9, \
1126 6.0/9, 8.0/9, 4.0/9, \
1127 8.0/9, 8.0/9, 4.0/9, \
1128 -8.0/9, -8.0/9, 6.0/9, \
1129 -6.0/9, -8.0/9, 6.0/9, \
1130 -4.0/9, -8.0/9, 6.0/9, \
1131 -2.0/9, -8.0/9, 6.0/9, \
1132 .0 , -8.0/9, 6.0/9, \
1133 2.0/9, -8.0/9, 6.0/9, \
1134 4.0/9, -8.0/9, 6.0/9, \
1135 6.0/9, -8.0/9, 6.0/9, \
1136 8.0/9, -8.0/9, 6.0/9, \
1137 -8.0/9, -6.0/9, 6.0/9, \
1138 -6.0/9, -6.0/9, 6.0/9, \
1139 -4.0/9, -6.0/9, 6.0/9, \
1140 -2.0/9, -6.0/9, 6.0/9, \
1141 .0 , -6.0/9, 6.0/9, \
1142 2.0/9, -6.0/9, 6.0/9, \
1143 4.0/9, -6.0/9, 6.0/9, \
1144 6.0/9, -6.0/9, 6.0/9, \
1145 8.0/9, -6.0/9, 6.0/9, \
1146 -8.0/9, -4.0/9, 6.0/9, \
1147 -6.0/9, -4.0/9, 6.0/9, \
1148 -4.0/9, -4.0/9, 6.0/9, \
1149 -2.0/9, -4.0/9, 6.0/9, \
1150 .0 , -4.0/9, 6.0/9, \
1151 2.0/9, -4.0/9, 6.0/9, \
1152 4.0/9, -4.0/9, 6.0/9, \
1153 6.0/9, -4.0/9, 6.0/9, \
1154 8.0/9, -4.0/9, 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, .0 , 6.0/9, \
1165 -6.0/9, .0 , 6.0/9, \
1166 -4.0/9, .0 , 6.0/9, \
1167 -2.0/9, .0 , 6.0/9, \
1169 2.0/9, .0 , 6.0/9, \
1170 4.0/9, .0 , 6.0/9, \
1171 6.0/9, .0 , 6.0/9, \
1172 8.0/9, .0 , 6.0/9, \
1173 -8.0/9, 2.0/9, 6.0/9, \
1174 -6.0/9, 2.0/9, 6.0/9, \
1175 -4.0/9, 2.0/9, 6.0/9, \
1176 -2.0/9, 2.0/9, 6.0/9, \
1177 .0 , 2.0/9, 6.0/9, \
1178 2.0/9, 2.0/9, 6.0/9, \
1179 4.0/9, 2.0/9, 6.0/9, \
1180 6.0/9, 2.0/9, 6.0/9, \
1181 8.0/9, 2.0/9, 6.0/9, \
1182 -8.0/9, 4.0/9, 6.0/9, \
1183 -6.0/9, 4.0/9, 6.0/9, \
1184 -4.0/9, 4.0/9, 6.0/9, \
1185 -2.0/9, 4.0/9, 6.0/9, \
1186 .0 , 4.0/9, 6.0/9, \
1187 2.0/9, 4.0/9, 6.0/9, \
1188 4.0/9, 4.0/9, 6.0/9, \
1189 6.0/9, 4.0/9, 6.0/9, \
1190 8.0/9, 4.0/9, 6.0/9, \
1191 -8.0/9, 6.0/9, 6.0/9, \
1192 -6.0/9, 6.0/9, 6.0/9, \
1193 -4.0/9, 6.0/9, 6.0/9, \
1194 -2.0/9, 6.0/9, 6.0/9, \
1195 .0 , 6.0/9, 6.0/9, \
1196 2.0/9, 6.0/9, 6.0/9, \
1197 4.0/9, 6.0/9, 6.0/9, \
1198 6.0/9, 6.0/9, 6.0/9, \
1199 8.0/9, 6.0/9, 6.0/9, \
1200 -8.0/9, 8.0/9, 6.0/9, \
1201 -6.0/9, 8.0/9, 6.0/9, \
1202 -4.0/9, 8.0/9, 6.0/9, \
1203 -2.0/9, 8.0/9, 6.0/9, \
1204 .0 , 8.0/9, 6.0/9, \
1205 2.0/9, 8.0/9, 6.0/9, \
1206 4.0/9, 8.0/9, 6.0/9, \
1207 6.0/9, 8.0/9, 6.0/9, \
1208 8.0/9, 8.0/9, 6.0/9, \
1209 -8.0/9, -8.0/9, 8.0/9, \
1210 -6.0/9, -8.0/9, 8.0/9, \
1211 -4.0/9, -8.0/9, 8.0/9, \
1212 -2.0/9, -8.0/9, 8.0/9, \
1213 .0 , -8.0/9, 8.0/9, \
1214 2.0/9, -8.0/9, 8.0/9, \
1215 4.0/9, -8.0/9, 8.0/9, \
1216 6.0/9, -8.0/9, 8.0/9, \
1217 8.0/9, -8.0/9, 8.0/9, \
1218 -8.0/9, -6.0/9, 8.0/9, \
1219 -6.0/9, -6.0/9, 8.0/9, \
1220 -4.0/9, -6.0/9, 8.0/9, \
1221 -2.0/9, -6.0/9, 8.0/9, \
1222 .0 , -6.0/9, 8.0/9, \
1223 2.0/9, -6.0/9, 8.0/9, \
1224 4.0/9, -6.0/9, 8.0/9, \
1225 6.0/9, -6.0/9, 8.0/9, \
1226 8.0/9, -6.0/9, 8.0/9, \
1227 -8.0/9, -4.0/9, 8.0/9, \
1228 -6.0/9, -4.0/9, 8.0/9, \
1229 -4.0/9, -4.0/9, 8.0/9, \
1230 -2.0/9, -4.0/9, 8.0/9, \
1231 .0 , -4.0/9, 8.0/9, \
1232 2.0/9, -4.0/9, 8.0/9, \
1233 4.0/9, -4.0/9, 8.0/9, \
1234 6.0/9, -4.0/9, 8.0/9, \
1235 8.0/9, -4.0/9, 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, .0 , 8.0/9, \
1246 -6.0/9, .0 , 8.0/9, \
1247 -4.0/9, .0 , 8.0/9, \
1248 -2.0/9, .0 , 8.0/9, \
1250 2.0/9, .0 , 8.0/9, \
1251 4.0/9, .0 , 8.0/9, \
1252 6.0/9, .0 , 8.0/9, \
1253 8.0/9, .0 , 8.0/9, \
1254 -8.0/9, 2.0/9, 8.0/9, \
1255 -6.0/9, 2.0/9, 8.0/9, \
1256 -4.0/9, 2.0/9, 8.0/9, \
1257 -2.0/9, 2.0/9, 8.0/9, \
1258 .0 , 2.0/9, 8.0/9, \
1259 2.0/9, 2.0/9, 8.0/9, \
1260 4.0/9, 2.0/9, 8.0/9, \
1261 6.0/9, 2.0/9, 8.0/9, \
1262 8.0/9, 2.0/9, 8.0/9, \
1263 -8.0/9, 4.0/9, 8.0/9, \
1264 -6.0/9, 4.0/9, 8.0/9, \
1265 -4.0/9, 4.0/9, 8.0/9, \
1266 -2.0/9, 4.0/9, 8.0/9, \
1267 .0 , 4.0/9, 8.0/9, \
1268 2.0/9, 4.0/9, 8.0/9, \
1269 4.0/9, 4.0/9, 8.0/9, \
1270 6.0/9, 4.0/9, 8.0/9, \
1271 8.0/9, 4.0/9, 8.0/9, \
1272 -8.0/9, 6.0/9, 8.0/9, \
1273 -6.0/9, 6.0/9, 8.0/9, \
1274 -4.0/9, 6.0/9, 8.0/9, \
1275 -2.0/9, 6.0/9, 8.0/9, \
1276 .0 , 6.0/9, 8.0/9, \
1277 2.0/9, 6.0/9, 8.0/9, \
1278 4.0/9, 6.0/9, 8.0/9, \
1279 6.0/9, 6.0/9, 8.0/9, \
1280 8.0/9, 6.0/9, 8.0/9, \
1281 -8.0/9, 8.0/9, 8.0/9, \
1282 -6.0/9, 8.0/9, 8.0/9, \
1283 -4.0/9, 8.0/9, 8.0/9, \
1284 -2.0/9, 8.0/9, 8.0/9, \
1285 .0 , 8.0/9, 8.0/9, \
1286 2.0/9, 8.0/9, 8.0/9, \
1287 4.0/9, 8.0/9, 8.0/9, \
1288 6.0/9, 8.0/9, 8.0/9, \
1289 8.0/9, 8.0/9, 8.0/9 \
1293 * Requantization tables : see ISO/IEC 11172-3 Annex B.2 and B.4
1295 * = We store the requantization information in the following structures :
1296 * typedef struct requantization_s
1298 * byte_t i_bits_per_codeword;
1299 * const float * pf_ungroup;
1302 * } requantization_t;
1304 * = Theses values depend on the bitrate per channel, on the subband number
1305 * and on the allocation[ch][sb] (see ISO/IEC 11172-3 2.4.2.6 and Annex B.2).
1307 * = But, in order to avoid data redundancy, we use the following properties :
1309 * - When bitrate_per_channel == 32 or 48 kbits/s (ie when
1310 * bitrate_per_channel_index == 1 or 2), the requantization values depend
1311 * only on allocation[ch][sb] (see ISO/IEC 11172-3 Annex B.2c and B.2d).
1312 * That's why ADEC_LAYER2_REQUANTIZATION_CD = f(allocation).
1314 * - In the other cases (see ISO/IEC 11172-3 Annex B.2a and B.2b), we can
1315 * divide the tables in 4 subtables :
1316 * + ADEC_LAYER2_REQUANTIZATION_AB1 for sb in [0..2]
1317 * + ADEC_LAYER2_REQUANTIZATION_AB2 for sb in [3..10]
1318 * + ADEC_LAYER2_REQUANTIZATION_AB3 for sb in [11..22]
1319 * + ADEC_LAYER2_REQUANTIZATION_AB4 for sb in [23..29]
1320 * That's why ADEC_LAYER2_REQUANTIZATION_AB = f(sb, allocation)
1322 * = When these tables are used, pf_ungroup3, pf_ungroup5, pf_ungroup9,
1323 * requantization_ab1, requantization_ab2, requantization_ab3 and
1324 * requantization_ab4 must already have been defined.
1326 #define ADEC_LAYER2_REQUANTIZATION_CD \
1328 { 0, NULL, .0 , .0 }, /* allocation 0 */ \
1329 { 5, pf_ungroup3, .0 , .0 }, /* allocation 1 */ \
1330 { 7, pf_ungroup5, .0 , .0 }, /* allocation 2 */ \
1331 {10, pf_ungroup9, .0 , .0 }, /* allocation 3 */ \
1332 { 4, NULL, .133333333332 , -.933333333328}, /* allocation 4 */ \
1333 { 5, NULL, .0645161290325 , -.967741935488}, /* allocation 5 */ \
1334 { 6, NULL, .0317460317459 , -.984126984124}, /* allocation 6 */ \
1335 { 7, NULL, .0157480314961 , -.992125984254}, /* allocation 7 */ \
1336 { 8, NULL, .00784313725492 , -.996078431375}, /* allocation 8 */ \
1337 { 9, NULL, .00391389432484 , -.998043052835}, /* allocation 9 */ \
1338 {10, NULL, .00195503421311 , -.999022482897}, /* allocation 10 */ \
1339 {11, NULL, .000977039570107 , -.99951148022 }, /* allocation 11 */ \
1340 {12, NULL, .000488400488398 , -.999755799752}, /* allocation 12 */ \
1341 {13, NULL, .000244170430962 , -.999877914789}, /* allocation 13 */ \
1342 {14, NULL, .000122077763535 , -.999938961117}, /* allocation 14 */ \
1343 {15, NULL, .000061037018952 , -.999969481491} /* allocation 15 */ \
1346 #define ADEC_LAYER2_REQUANTIZATION_AB1 \
1348 { 0, NULL, .0 , .0 }, /* allocation 0 */ \
1349 { 5, pf_ungroup3, .0 , .0 }, /* allocation 1 */ \
1350 { 3, NULL, .285714285715 , -.857142857145}, /* allocation 2 */ \
1351 { 4, NULL, .133333333332 , -.933333333328}, /* allocation 3 */ \
1352 { 5, NULL, .0645161290325 , -.967741935488}, /* allocation 4 */ \
1353 { 6, NULL, .0317460317459 , -.984126984124}, /* allocation 5 */ \
1354 { 7, NULL, .0157480314961 , -.992125984254}, /* allocation 6 */ \
1355 { 8, NULL, .00784313725492 , -.996078431375}, /* allocation 7 */ \
1356 { 9, NULL, .00391389432484 , -.998043052835}, /* allocation 8 */ \
1357 {10, NULL, .00195503421311 , -.999022482897}, /* allocation 9 */ \
1358 {11, NULL, .000977039570107 , -.99951148022 }, /* allocation 10 */ \
1359 {12, NULL, .000488400488398 , -.999755799752}, /* allocation 11 */ \
1360 {13, NULL, .000244170430962 , -.999877914789}, /* allocation 12 */ \
1361 {14, NULL, .000122077763535 , -.999938961117}, /* allocation 13 */ \
1362 {15, NULL, .000061037018952 , -.999969481491}, /* allocation 14 */ \
1363 {16, NULL, .0000305180437933, -.999984740976} /* allocation 15 */ \
1366 #define ADEC_LAYER2_REQUANTIZATION_AB2 \
1368 { 0, NULL, .0 , .0 }, /* allocation 0 */ \
1369 { 5, pf_ungroup3, .0 , .0 }, /* allocation 1 */ \
1370 { 7, pf_ungroup5, .0 , .0 }, /* allocation 2 */ \
1371 { 3, NULL, .285714285715 , -.857142857145}, /* allocation 3 */ \
1372 {10, pf_ungroup9, .0 , .0 }, /* allocation 4 */ \
1373 { 4, NULL, .133333333332 , -.933333333328}, /* allocation 5 */ \
1374 { 5, NULL, .0645161290325 , -.967741935488}, /* allocation 6 */ \
1375 { 6, NULL, .0317460317459 , -.984126984124}, /* allocation 7 */ \
1376 { 7, NULL, .0157480314961 , -.992125984254}, /* allocation 8 */ \
1377 { 8, NULL, .00784313725492 , -.996078431375}, /* allocation 9 */ \
1378 { 9, NULL, .00391389432484 , -.998043052835}, /* allocation 10 */ \
1379 {10, NULL, .00195503421311 , -.999022482897}, /* allocation 11 */ \
1380 {11, NULL, .000977039570107 , -.99951148022 }, /* allocation 12 */ \
1381 {12, NULL, .000488400488398 , -.999755799752}, /* allocation 13 */ \
1382 {13, NULL, .000244170430962 , -.999877914789}, /* allocation 14 */ \
1383 {16, NULL, .0000305180437933, -.999984740976} /* allocation 15 */ \
1386 #define ADEC_LAYER2_REQUANTIZATION_AB3 \
1388 { 0, NULL, .0 , .0 }, /* allocation 0 */ \
1389 { 5, pf_ungroup3, .0 , .0 }, /* allocation 1 */ \
1390 { 7, pf_ungroup5, .0 , .0 }, /* allocation 2 */ \
1391 { 3, NULL, .285714285715 , -.857142857145}, /* allocation 3 */ \
1392 {10, pf_ungroup9, .0 , .0 }, /* allocation 4 */ \
1393 { 4, NULL, .133333333332 , -.933333333328}, /* allocation 5 */ \
1394 { 5, NULL, .0645161290325 , -.967741935488}, /* allocation 6 */ \
1395 {16, NULL, .0000305180437933, -.999984740976}, /* allocation 7 */ \
1396 { 0, NULL, .0 , .0 }, /* allocation 8 */ \
1397 { 0, NULL, .0 , .0 }, /* allocation 9 */ \
1398 { 0, NULL, .0 , .0 }, /* allocation 10 */ \
1399 { 0, NULL, .0 , .0 }, /* allocation 11 */ \
1400 { 0, NULL, .0 , .0 }, /* allocation 12 */ \
1401 { 0, NULL, .0 , .0 }, /* allocation 13 */ \
1402 { 0, NULL, .0 , .0 }, /* allocation 14 */ \
1403 { 0, NULL, .0 , .0 } /* allocation 15 */ \
1406 #define ADEC_LAYER2_REQUANTIZATION_AB4 \
1408 { 0, NULL, .0 , .0 }, /* allocation 0 */ \
1409 { 5, pf_ungroup3, .0 , .0 }, /* allocation 1 */ \
1410 { 7, pf_ungroup5, .0 , .0 }, /* allocation 2 */ \
1411 {16, NULL, .0000305180437933, -.999984740976}, /* allocation 3 */ \
1412 { 0, NULL, .0 , .0 }, /* allocation 4 */ \
1413 { 0, NULL, .0 , .0 }, /* allocation 5 */ \
1414 { 0, NULL, .0 , .0 }, /* allocation 6 */ \
1415 { 0, NULL, .0 , .0 }, /* allocation 7 */ \
1416 { 0, NULL, .0 , .0 }, /* allocation 8 */ \
1417 { 0, NULL, .0 , .0 }, /* allocation 9 */ \
1418 { 0, NULL, .0 , .0 }, /* allocation 10 */ \
1419 { 0, NULL, .0 , .0 }, /* allocation 11 */ \
1420 { 0, NULL, .0 , .0 }, /* allocation 12 */ \
1421 { 0, NULL, .0 , .0 }, /* allocation 13 */ \
1422 { 0, NULL, .0 , .0 }, /* allocation 14 */ \
1423 { 0, NULL, .0 , .0 } /* allocation 15 */ \
1426 #define ADEC_LAYER2_REQUANTIZATION_AB \
1428 p_requantization_ab1, /* subband == 0 */ \
1429 p_requantization_ab1, /* subband == 1 */ \
1430 p_requantization_ab1, /* subband == 2 */ \
1431 p_requantization_ab2, /* subband == 3 */ \
1432 p_requantization_ab2, /* subband == 4 */ \
1433 p_requantization_ab2, /* subband == 5 */ \
1434 p_requantization_ab2, /* subband == 6 */ \
1435 p_requantization_ab2, /* subband == 7 */ \
1436 p_requantization_ab2, /* subband == 8 */ \
1437 p_requantization_ab2, /* subband == 9 */ \
1438 p_requantization_ab2, /* subband == 10 */ \
1439 p_requantization_ab3, /* subband == 11 */ \
1440 p_requantization_ab3, /* subband == 12 */ \
1441 p_requantization_ab3, /* subband == 13 */ \
1442 p_requantization_ab3, /* subband == 14 */ \
1443 p_requantization_ab3, /* subband == 15 */ \
1444 p_requantization_ab3, /* subband == 16 */ \
1445 p_requantization_ab3, /* subband == 17 */ \
1446 p_requantization_ab3, /* subband == 18 */ \
1447 p_requantization_ab3, /* subband == 19 */ \
1448 p_requantization_ab3, /* subband == 20 */ \
1449 p_requantization_ab3, /* subband == 21 */ \
1450 p_requantization_ab3, /* subband == 22 */ \
1451 p_requantization_ab4, /* subband == 23 */ \
1452 p_requantization_ab4, /* subband == 24 */ \
1453 p_requantization_ab4, /* subband == 25 */ \
1454 p_requantization_ab4, /* subband == 26 */ \
1455 p_requantization_ab4, /* subband == 27 */ \
1456 p_requantization_ab4, /* subband == 28 */ \
1457 p_requantization_ab4 /* subband == 29 */ \