Codebase list faad2 / upstream/2.6.1
Imported Upstream version 2.6.1 Andres Mejia 14 years ago
259 changed file(s) with 97600 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0
1 M. Bakker (mbakker(at)nero.com)
2 - complete library
3
4 Alexander Kurpiers (a.kurpiers(at)nt.tu-darmstadt.de)
5 - HCR code
6 - DRM stuff
7 - lot's of bug fixes
8
9 Volker Fischer (v.fischer(at)nt.tu-darmstadt.de)
10 - DRM code
11 - lot's of bug fixes
12
13 Gian-Carlo Pascutto (gpascutto(at)nero.com)
14 - DRM PS code
15 - bugfixes
16
0
1 Any non-GPL usage of this software or parts of this software is strictly
2 forbidden.
3
4 Commercial non-GPL licensing of this software is possible.
5 For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
6
7
8
9
10 GNU GENERAL PUBLIC LICENSE
11 Version 2, June 1991
12
13 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
14 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 Everyone is permitted to copy and distribute verbatim copies
16 of this license document, but changing it is not allowed.
17
18 Preamble
19
20 The licenses for most software are designed to take away your
21 freedom to share and change it. By contrast, the GNU General Public
22 License is intended to guarantee your freedom to share and change free
23 software--to make sure the software is free for all its users. This
24 General Public License applies to most of the Free Software
25 Foundation's software and to any other program whose authors commit to
26 using it. (Some other Free Software Foundation software is covered by
27 the GNU Library General Public License instead.) You can apply it to
28 your programs, too.
29
30 When we speak of free software, we are referring to freedom, not
31 price. Our General Public Licenses are designed to make sure that you
32 have the freedom to distribute copies of free software (and charge for
33 this service if you wish), that you receive source code or can get it
34 if you want it, that you can change the software or use pieces of it
35 in new free programs; and that you know you can do these things.
36
37 To protect your rights, we need to make restrictions that forbid
38 anyone to deny you these rights or to ask you to surrender the rights.
39 These restrictions translate to certain responsibilities for you if you
40 distribute copies of the software, or if you modify it.
41
42 For example, if you distribute copies of such a program, whether
43 gratis or for a fee, you must give the recipients all the rights that
44 you have. You must make sure that they, too, receive or can get the
45 source code. And you must show them these terms so they know their
46 rights.
47
48 We protect your rights with two steps: (1) copyright the software, and
49 (2) offer you this license which gives you legal permission to copy,
50 distribute and/or modify the software.
51
52 Also, for each author's protection and ours, we want to make certain
53 that everyone understands that there is no warranty for this free
54 software. If the software is modified by someone else and passed on, we
55 want its recipients to know that what they have is not the original, so
56 that any problems introduced by others will not reflect on the original
57 authors' reputations.
58
59 Finally, any free program is threatened constantly by software
60 patents. We wish to avoid the danger that redistributors of a free
61 program will individually obtain patent licenses, in effect making the
62 program proprietary. To prevent this, we have made it clear that any
63 patent must be licensed for everyone's free use or not licensed at all.
64
65 The precise terms and conditions for copying, distribution and
66 modification follow.
67
68 GNU GENERAL PUBLIC LICENSE
69 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
70
71 0. This License applies to any program or other work which contains
72 a notice placed by the copyright holder saying it may be distributed
73 under the terms of this General Public License. The "Program", below,
74 refers to any such program or work, and a "work based on the Program"
75 means either the Program or any derivative work under copyright law:
76 that is to say, a work containing the Program or a portion of it,
77 either verbatim or with modifications and/or translated into another
78 language. (Hereinafter, translation is included without limitation in
79 the term "modification".) Each licensee is addressed as "you".
80
81 Activities other than copying, distribution and modification are not
82 covered by this License; they are outside its scope. The act of
83 running the Program is not restricted, and the output from the Program
84 is covered only if its contents constitute a work based on the
85 Program (independent of having been made by running the Program).
86 Whether that is true depends on what the Program does.
87
88 1. You may copy and distribute verbatim copies of the Program's
89 source code as you receive it, in any medium, provided that you
90 conspicuously and appropriately publish on each copy an appropriate
91 copyright notice and disclaimer of warranty; keep intact all the
92 notices that refer to this License and to the absence of any warranty;
93 and give any other recipients of the Program a copy of this License
94 along with the Program.
95
96 You may charge a fee for the physical act of transferring a copy, and
97 you may at your option offer warranty protection in exchange for a fee.
98
99 2. You may modify your copy or copies of the Program or any portion
100 of it, thus forming a work based on the Program, and copy and
101 distribute such modifications or work under the terms of Section 1
102 above, provided that you also meet all of these conditions:
103
104 a) You must cause the modified files to carry prominent notices
105 stating that you changed the files and the date of any change.
106
107 b) You must cause any work that you distribute or publish, that in
108 whole or in part contains or is derived from the Program or any
109 part thereof, to be licensed as a whole at no charge to all third
110 parties under the terms of this License.
111
112 c) If the modified program normally reads commands interactively
113 when run, you must cause it, when started running for such
114 interactive use in the most ordinary way, to print or display an
115 announcement including an appropriate copyright notice and a
116 notice that there is no warranty (or else, saying that you provide
117 a warranty) and that users may redistribute the program under
118 these conditions, and telling the user how to view a copy of this
119 License. (Exception: if the Program itself is interactive but
120 does not normally print such an announcement, your work based on
121 the Program is not required to print an announcement.)
122
123 These requirements apply to the modified work as a whole. If
124 identifiable sections of that work are not derived from the Program,
125 and can be reasonably considered independent and separate works in
126 themselves, then this License, and its terms, do not apply to those
127 sections when you distribute them as separate works. But when you
128 distribute the same sections as part of a whole which is a work based
129 on the Program, the distribution of the whole must be on the terms of
130 this License, whose permissions for other licensees extend to the
131 entire whole, and thus to each and every part regardless of who wrote it.
132
133 Thus, it is not the intent of this section to claim rights or contest
134 your rights to work written entirely by you; rather, the intent is to
135 exercise the right to control the distribution of derivative or
136 collective works based on the Program.
137
138 In addition, mere aggregation of another work not based on the Program
139 with the Program (or with a work based on the Program) on a volume of
140 a storage or distribution medium does not bring the other work under
141 the scope of this License.
142
143 3. You may copy and distribute the Program (or a work based on it,
144 under Section 2) in object code or executable form under the terms of
145 Sections 1 and 2 above provided that you also do one of the following:
146
147 a) Accompany it with the complete corresponding machine-readable
148 source code, which must be distributed under the terms of Sections
149 1 and 2 above on a medium customarily used for software interchange; or,
150
151 b) Accompany it with a written offer, valid for at least three
152 years, to give any third party, for a charge no more than your
153 cost of physically performing source distribution, a complete
154 machine-readable copy of the corresponding source code, to be
155 distributed under the terms of Sections 1 and 2 above on a medium
156 customarily used for software interchange; or,
157
158 c) Accompany it with the information you received as to the offer
159 to distribute corresponding source code. (This alternative is
160 allowed only for noncommercial distribution and only if you
161 received the program in object code or executable form with such
162 an offer, in accord with Subsection b above.)
163
164 The source code for a work means the preferred form of the work for
165 making modifications to it. For an executable work, complete source
166 code means all the source code for all modules it contains, plus any
167 associated interface definition files, plus the scripts used to
168 control compilation and installation of the executable. However, as a
169 special exception, the source code distributed need not include
170 anything that is normally distributed (in either source or binary
171 form) with the major components (compiler, kernel, and so on) of the
172 operating system on which the executable runs, unless that component
173 itself accompanies the executable.
174
175 If distribution of executable or object code is made by offering
176 access to copy from a designated place, then offering equivalent
177 access to copy the source code from the same place counts as
178 distribution of the source code, even though third parties are not
179 compelled to copy the source along with the object code.
180
181 4. You may not copy, modify, sublicense, or distribute the Program
182 except as expressly provided under this License. Any attempt
183 otherwise to copy, modify, sublicense or distribute the Program is
184 void, and will automatically terminate your rights under this License.
185 However, parties who have received copies, or rights, from you under
186 this License will not have their licenses terminated so long as such
187 parties remain in full compliance.
188
189 5. You are not required to accept this License, since you have not
190 signed it. However, nothing else grants you permission to modify or
191 distribute the Program or its derivative works. These actions are
192 prohibited by law if you do not accept this License. Therefore, by
193 modifying or distributing the Program (or any work based on the
194 Program), you indicate your acceptance of this License to do so, and
195 all its terms and conditions for copying, distributing or modifying
196 the Program or works based on it.
197
198 6. Each time you redistribute the Program (or any work based on the
199 Program), the recipient automatically receives a license from the
200 original licensor to copy, distribute or modify the Program subject to
201 these terms and conditions. You may not impose any further
202 restrictions on the recipients' exercise of the rights granted herein.
203 You are not responsible for enforcing compliance by third parties to
204 this License.
205
206 7. If, as a consequence of a court judgment or allegation of patent
207 infringement or for any other reason (not limited to patent issues),
208 conditions are imposed on you (whether by court order, agreement or
209 otherwise) that contradict the conditions of this License, they do not
210 excuse you from the conditions of this License. If you cannot
211 distribute so as to satisfy simultaneously your obligations under this
212 License and any other pertinent obligations, then as a consequence you
213 may not distribute the Program at all. For example, if a patent
214 license would not permit royalty-free redistribution of the Program by
215 all those who receive copies directly or indirectly through you, then
216 the only way you could satisfy both it and this License would be to
217 refrain entirely from distribution of the Program.
218
219 If any portion of this section is held invalid or unenforceable under
220 any particular circumstance, the balance of the section is intended to
221 apply and the section as a whole is intended to apply in other
222 circumstances.
223
224 It is not the purpose of this section to induce you to infringe any
225 patents or other property right claims or to contest validity of any
226 such claims; this section has the sole purpose of protecting the
227 integrity of the free software distribution system, which is
228 implemented by public license practices. Many people have made
229 generous contributions to the wide range of software distributed
230 through that system in reliance on consistent application of that
231 system; it is up to the author/donor to decide if he or she is willing
232 to distribute software through any other system and a licensee cannot
233 impose that choice.
234
235 This section is intended to make thoroughly clear what is believed to
236 be a consequence of the rest of this License.
237
238 8. If the distribution and/or use of the Program is restricted in
239 certain countries either by patents or by copyrighted interfaces, the
240 original copyright holder who places the Program under this License
241 may add an explicit geographical distribution limitation excluding
242 those countries, so that distribution is permitted only in or among
243 countries not thus excluded. In such case, this License incorporates
244 the limitation as if written in the body of this License.
245
246 9. The Free Software Foundation may publish revised and/or new versions
247 of the General Public License from time to time. Such new versions will
248 be similar in spirit to the present version, but may differ in detail to
249 address new problems or concerns.
250
251 Each version is given a distinguishing version number. If the Program
252 specifies a version number of this License which applies to it and "any
253 later version", you have the option of following the terms and conditions
254 either of that version or of any later version published by the Free
255 Software Foundation. If the Program does not specify a version number of
256 this License, you may choose any version ever published by the Free Software
257 Foundation.
258
259 10. If you wish to incorporate parts of the Program into other free
260 programs whose distribution conditions are different, write to the author
261 to ask for permission. For software which is copyrighted by the Free
262 Software Foundation, write to the Free Software Foundation; we sometimes
263 make exceptions for this. Our decision will be guided by the two goals
264 of preserving the free status of all derivatives of our free software and
265 of promoting the sharing and reuse of software generally.
266
267 NO WARRANTY
268
269 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
270 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
271 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
272 PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
273 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
274 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
275 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
276 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
277 REPAIR OR CORRECTION.
278
279 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
280 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
281 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
282 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
283 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
284 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
285 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
286 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
287 POSSIBILITY OF SUCH DAMAGES.
288
289 END OF TERMS AND CONDITIONS
290
291 How to Apply These Terms to Your New Programs
292
293 If you develop a new program, and you want it to be of the greatest
294 possible use to the public, the best way to achieve this is to make it
295 free software which everyone can redistribute and change under these terms.
296
297 To do so, attach the following notices to the program. It is safest
298 to attach them to the start of each source file to most effectively
299 convey the exclusion of warranty; and each file should have at least
300 the "copyright" line and a pointer to where the full notice is found.
301
302 <one line to give the program's name and a brief idea of what it does.>
303 Copyright (C) 19yy <name of author>
304
305 This program is free software; you can redistribute it and/or modify
306 it under the terms of the GNU General Public License as published by
307 the Free Software Foundation; either version 2 of the License, or
308 (at your option) any later version.
309
310 This program is distributed in the hope that it will be useful,
311 but WITHOUT ANY WARRANTY; without even the implied warranty of
312 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
313 GNU General Public License for more details.
314
315 You should have received a copy of the GNU General Public License
316 along with this program; if not, write to the Free Software
317 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
318
319
320 Also add information on how to contact you by electronic and paper mail.
321
322 If the program is interactive, make it output a short notice like this
323 when it starts in an interactive mode:
324
325 Gnomovision version 69, Copyright (C) 19yy name of author
326 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
327 This is free software, and you are welcome to redistribute it
328 under certain conditions; type `show c' for details.
329
330 The hypothetical commands `show w' and `show c' should show the appropriate
331 parts of the General Public License. Of course, the commands you use may
332 be called something other than `show w' and `show c'; they could even be
333 mouse-clicks or menu items--whatever suits your program.
334
335 You should also get your employer (if you work as a programmer) or your
336 school, if any, to sign a "copyright disclaimer" for the program, if
337 necessary. Here is a sample; alter the names:
338
339 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
340 `Gnomovision' (which makes passes at compilers) written by James Hacker.
341
342 <signature of Ty Coon>, 1 April 1989
343 Ty Coon, President of Vice
344
345 This General Public License does not permit incorporating your program into
346 proprietary programs. If your program is a subroutine library, you may
347 consider it more useful to permit linking proprietary applications with the
348 library. If this is what you want to do, use the GNU Library General
349 Public License instead of this License.
0 21 january 2005 gpascutto(at)nero.com
1 - hcr.c, drm_dec.c: updates for DRM PS standard, error resilience changes
2 - reverted above error resilience changes
3
4 8 december 2004 mbakker(at)nero.com
5 - ps_dec.c, ps_syntax.c: PS fixes (OPD huffman table and modulo decoding)
6
7 6 december 2004 gpascutto(at)nero.com
8 - drm_dec.c, drm_dec.h, sbr_dec.c: DRM PS Standards update
9
10 5 december 2004 gpascutto(at)nero.com
11 - syntax.c, hcr.c, decoder.c, sbr_syntax.c, specrec.c:
12 Improved (DRM) error resilience
13
14 18 october 2004 mbakker(at)nero.com
15 - sbr_dec.c, sbr_hfadj.c, common.h: fixed Low Power SBR decoding
16
17 18 october 2004 mbakker(at)nero.com
18 - main.c: added "quiet" option to frontend
19
20 5 october 2004 mbakker(at)nero.com
21 - decoder.c: skip ID3 tags in library
22
23 24 september 2004 mbakker(at)nero.com
24 - syntax.c,h, lt_predict.c, mp4.c, decoder.c:
25 Added stereo DRM support, removed fake scalable support
26
27 21 september 2004 mbakker(at)nero.com
28 - specrec.c, bits.h, common.h, error.h, sbr_hfadj.h, structs.h,
29 decoder.c, error.c, hcr.c, sbr_dec.c, sbr_hfadj.c, sbr_syntax.c, syntax.c:
30 Improved error detection and handling.
31
32 16 september 2004 mbakker(at)nero.com
33 - specrec.c, bits.h, common.h, error.h, sbr_hfadj.h, structs.h,
34 decoder.c, error.c, hcr.c, sbr_dec.c, sbr_hfadj.c, sbr_syntax.c, syntax.c:
35 Improved error detection and handling.
36
37 8 september 2004 mbakker(at)nero.com
38 - specrec.c: fixed compilation without PS
39
40 4 september 2004 mbakker(at)nero.com
41 - sbr_fbt.c, sbr_hfgen.c: fixed possible lockup with bad data.
42
43 4 september 2004 mbakker(at)nero.com
44 - cfft.c,h, common.c,h, filtbank.c,h, mdct.h, sbr_qmf.h, structs.h, decoder.c, specrec.c:
45 Removed USE_SSE
46
47 4 september 2004 gpascutto(at)nero.com
48 - specrec.c: small optimizations to inverse quant
49
50 3 september 2004 mbakker(at)nero.com
51 - neaacdec.h, decoder.c, syntax.c, structs.h: added output flag for PS
52
53 3 september 2004 mbakker(at)nero.com
54 - common.c: added log2_fix()
55
56 28 august 2004 gpascutto(at)nero.com
57 - sbr_syntax.c: bugfix with PS_DEC and DRM_PS defines
58
59 21 august 2004 mbakker(at)nero.com
60 - cfft.c, cfft_tab.h: added size 128 fixed point FFT tables for HVXC
61
62 18 august 2004 mbakker(at)nero.com
63 - sbr_syntax.c: allow only 1 PS data element per SBR extension data
64
65 18 august 2004 gpascutto(at)nero.com
66 - specrec.c: safeguard against PS suddenly going on
67
68 4 august 2004 gpascutto(at)nero.com
69 - drm_dec.c: make sure we still copy to the right channel if there's no data
70
71 2 august 2004 gpascutto(at)nero.com
72 - hcr.c: bugfix
73
74 31 july 2004 gpascutto(at)nero.com
75 - hcr.c: Rewritten and optimized
76
77 29 july 2004 mbakker(at)nero.com
78 - /mp4ff/mp4ff.c,mp4atoms.c: support video decoding better
79
80 28 july 2004 gpascutto(at)nero.com
81 - drm_dec.*, sbr_dec.c, syntax.c: improved error concealment
82
83 27 july 2004 gpascutto(at)nero.com
84 - sbr_dec.c, sbr_syntax.c: duplicate code removal
85
86 25 july 2004 gpascutto(at)nero.com
87 - syntax.c: re-enable SBR CRC checking for DRM
88
89 22 july 2004 gpascutto(at)nero.com
90 - drm_dec.*: changed delay filter to 2 samples plus fractional delay, as in normal PS AAC
91 (DRM standard is wrong here)
92
93 2 july 2004 mbakker(at)nero.com
94 - huffman.c: Implemented VCB11 error concealment
95
96 22 june 2004 mbakker(at)nero.com
97 - ps_dec.c: Removed samplerate dependancy in PS, likely to be updated in corrigendum
98
99 15 june 2004 mbakker(at)nero.com
100 - sbr_dct.c,h: Removed huge ugly DCT_4_64...
101 - sbr_qmf.c: replaced DCT_IV in qmf synthesis
102
103 13 june 2004 mbakker(at)nero.com
104 - ps_dec.c: Fixed fixed point code, no more cos() and sin() used
105
106 7 june 2004 mbakker(at)nero.com
107 - sbr_*.c,h: Overall speedups and improvements in SBR code.
108
109 4 june 2004 gpascutto(at)nero.com
110 - drm_dec.c: Fixed a bug in the standard (PAN mixing)
111
112 3 june 2004 mbakker(at)nero.com
113 - ps_syntax.c: fixed a bug in one of the huffman tables
114
115 2 june 2004 gpascutto(at)nero.com
116 - drm_dec.c: Fully working fixed point support
117
118 27 may 2004 mbakker(at)nero.com
119 - sbr_qmf.c, sbr_dec.h: Fixed fixed point problems with downsampled QMF
120
121 17 may 2004 mbakker(at)nero.com
122 - syntax.c, decoder.c: Added some logging output
123
124 17 may 2004 mbakker(at)nero.com
125 - mp4atom.c: Fixed an issue with broken MP4 files
126
127 16 may 2004 mbakker(at)nero.com
128 - ps_dec.c: fixed point: forgot to convert a few multiplies
129
130 14 may 2004 mbakker(at)nero.com
131 - sbr_*.c: reduced memory usage
132
133 6 may 2004 mbakker(at)nero.com
134 - common.c: added some bit tricks and fixed point log2/pow2
135 - sbr_hfadj.c: log2/pow2 based gain calculation for SBR
136 - sbr_hfgen.c: use block exponent instead of stupid search to find max value
137
138 5 may 2004 mbakker(at)nero.com
139 - decoder.c, neaacdec.h, decoder.h: added extra decode function to which a
140 buffer can be provided. Instead of the library providing a buffer.
141
142 5 may 2004 mbakker(at)nero.com
143 - mdct.c: fixed fixed point MDCT with framesizes 960, 480, 120
144
145 2 may 2004 mbakker(at)nero.com
146 - mdct_tab.h, mdct.c: Added tables for MDCT, for increased accuracy in fixed point
147 - specrec.c: Moved quantisation, scaling and reordering to 1 function
148
149 20 april 2004 gpacutto(at)nero.com
150 - drm_dec.c, drm_dec.h: Don't do PS processing if no data was read this frame.
151 Fix for bitstread reading bug in specification.
152
153 15 april 2004 mbakker(at)nero.com
154 - sbr_hfadj.c: fixed buffer overflow
155 - multiple: fixed some eVC problems
156
157 12 april 2004 mbakker(at)nero.com
158 - common.h, ps_dec.c: Updates for PS fixed point, should completely work now
159
160 12 april 2004 gpascutto(at)nero.com
161 - drm_dec.c, drm_dec.h: eliminated sqrt and SA mapping/dequantization from DRM PS decoder
162
0 SUBDIRS = libfaad common frontend plugins
1
2 EXTRA_DIST = faad2.spec
3
4 rpm: Makefile
5 make dist
6 $(RPMBUILD) -ta $(PACKAGE)-$(VERSION).tar.gz
7 rm $(PACKAGE)-$(VERSION).tar.gz
0
1 6 February 2004
2 - FAAD2 version 2.0 released
3
4 25 July 2003
5 - Release version with SBR decoding
6
0
1 Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 http://www.audiocoding.com/
3
4 FAAD2 is a HE, LC, MAIN and LTP profile, MPEG2 and MPEG-4 AAC decoder.
5 FAAD2 includes code for SBR (HE AAC) decoding.
6 FAAD2 is licensed under the GPL.
7
8
9 __________
10 COPYRIGHTS
11
12 For FAAD2 the following license applies:
13
14 ******************************************************************************
15 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
16 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
17 **
18 ** This program is free software; you can redistribute it and/or modify
19 ** it under the terms of the GNU General Public License as published by
20 ** the Free Software Foundation; either version 2 of the License, or
21 ** (at your option) any later version.
22 **
23 ** This program is distributed in the hope that it will be useful,
24 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
25 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ** GNU General Public License for more details.
27 **
28 ** You should have received a copy of the GNU General Public License
29 ** along with this program; if not, write to the Free Software
30 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 **
32 ** Any non-GPL usage of this software or parts of this software is strictly
33 ** forbidden.
34 **
35 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
36 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
37 **
38 ** Commercial non-GPL licensing of this software is possible.
39 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
40 ******************************************************************************
41
42
43 Please note that the use of this software may require the payment of
44 patent royalties. You need to consider this issue before you start
45 building derivative works. We are not warranting or indemnifying you in
46 any way for patent royalities! YOU ARE SOLELY RESPONSIBLE FOR YOUR OWN
47 ACTIONS!
48
49
50 ______
51 PEOPLE
52
53 FAAD2 is written by:
54 - M. Bakker (mbakker(at)nero.com).
55
56
57 _______________
58 VERSION HISTORY
59
60 Sorry, try building a ChangeLog from CVS.
61
62 ___________________
63 DIRECTORY STRUCTURE
64
65 faad2 - top level directory.
66
67 aacDECdrop - windows decoder/player with drag'n'drop functionality
68
69 common - generally used libraries and code.
70
71 faad - general common functions like filereading and streaming
72 as well as getting info from aac files.
73
74 mp4ff - Small MP4 file format library (includes tagging abilities).
75
76 frontend - command line frontend to the FAAD2 library, also supports
77 MPEG-4 file decoding.
78
79 include - inlude file for the FAAD2 library.
80
81 libfaad - the FAAD2 AAC decoder library including SBR.
82
83 codebook - Huffman codebooks
84
85 plugins - plugins for all kinds of pograms.
86
87 in_mp4 - winamp MPEG-4 AAC file input plugin.
88
89 QCD - Quintessential player AAC plugin.
90
91 QCDMp4 - Quintessential player MP4 plugin.
92
93 xmms - xmms AAC plugin
94
95 mpeg4ip - plugin for the mpeg4ip player
96
0 To compile under Linux.
1 ----------------------
2 just run :
3
4 autoreconf -vif
5 ./configure --with-mp4v2
6 make
7 sudo make install
8
9
10 about the xmms plugin.
11 ---------------------
12 The xmms plugin need to be build after the install of the faad project.
13 so after you have installed correctly faad (--with-xmms options) you need
14 to configure and build the xmms plugin part in the plugins/xmms directory.
15 Read the README and INSTALL files into the xmms directory.
0
1 - Not much...
0 // Microsoft Visual C++ generated resource script.
1 //
2 #include "resource.h"
3
4 #define APSTUDIO_READONLY_SYMBOLS
5 /////////////////////////////////////////////////////////////////////////////
6 //
7 // Generated from the TEXTINCLUDE 2 resource.
8 //
9 #include "winres.h"
10
11 /////////////////////////////////////////////////////////////////////////////
12 #undef APSTUDIO_READONLY_SYMBOLS
13
14 /////////////////////////////////////////////////////////////////////////////
15 // English (U.S.) resources
16
17 #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
18 #ifdef _WIN32
19 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
20 #pragma code_page(1252)
21 #endif //_WIN32
22
23 /////////////////////////////////////////////////////////////////////////////
24 //
25 // Bitmap
26 //
27
28 IDB_TF01 BITMAP "resource/AAC01.bmp"
29 IDB_TF02 BITMAP "resource/AAC02.bmp"
30 IDB_TF03 BITMAP "resource/AAC03.bmp"
31 IDB_TF04 BITMAP "resource/AAC04.bmp"
32 IDB_TF05 BITMAP "resource/AAC05.bmp"
33 IDB_TF06 BITMAP "resource/AAC06.bmp"
34 IDB_TF07 BITMAP "resource/AAC07.bmp"
35 IDB_TF08 BITMAP "resource/AAC08.bmp"
36
37 #ifdef APSTUDIO_INVOKED
38 /////////////////////////////////////////////////////////////////////////////
39 //
40 // TEXTINCLUDE
41 //
42
43 1 TEXTINCLUDE
44 BEGIN
45 "resource.h\0"
46 END
47
48 2 TEXTINCLUDE
49 BEGIN
50 "#include ""winres.h""\r\n"
51 "\0"
52 END
53
54 3 TEXTINCLUDE
55 BEGIN
56 "\r\n"
57 "\0"
58 END
59
60 #endif // APSTUDIO_INVOKED
61
62
63 /////////////////////////////////////////////////////////////////////////////
64 //
65 // Menu
66 //
67
68 IDR_MENU1 MENU
69 BEGIN
70 POPUP "Menu"
71 BEGIN
72 MENUITEM "&Decoder Options", IDM_VOLUME
73 MENUITEM "&Stop Decoding", IDM_STOP_DEC
74 MENUITEM "&About", IDM_ABOUT
75 MENUITEM SEPARATOR
76 MENUITEM "&Errors to Log File", IDM_LOGERR
77 MENUITEM "&Always on Top", IDM_ONTOP
78 MENUITEM SEPARATOR
79 MENUITEM "E&xit\tAlt+F4", IDM_QUIT
80 END
81 MENUITEM SEPARATOR
82 END
83
84
85 /////////////////////////////////////////////////////////////////////////////
86 //
87 // Icon
88 //
89
90 // Icon with lowest ID value placed first to ensure application icon
91 // remains consistent on all systems.
92 IDI_ICON1 ICON "resource/AAC01.ico"
93
94 /////////////////////////////////////////////////////////////////////////////
95 //
96 // Dialog
97 //
98
99 IDD_VOLUME DIALOGEX 0, 0, 255, 257
100 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION |
101 WS_SYSMENU
102 CAPTION "Decoder Options V1.2"
103 FONT 8, "MS Sans Serif", 0, 0, 0x0
104 BEGIN
105 GROUPBOX "Decoding Settings",IDC_STATIC,7,7,241,23
106 CONTROL "Playback",IDC_PLAYBACK,"Button",BS_AUTORADIOBUTTON |
107 WS_GROUP,15,17,55,10
108 CONTROL "Decode to File",IDC_DECODE,"Button",BS_AUTORADIOBUTTON,
109 125,17,65,10
110 GROUPBOX "Output Format Settings",IDC_STATIC,7,31,241,50
111 CONTROL "Microsoft WAV",IDC_WAV,"Button",BS_AUTORADIOBUTTON |
112 WS_GROUP,15,45,65,10
113 CONTROL "Apple/SGI AIFF",IDC_AIFF,"Button",BS_AUTORADIOBUTTON |
114 WS_DISABLED,125,45,65,10
115 CONTROL "Sun/NeXT AU",IDC_SUNAU,"Button",BS_AUTORADIOBUTTON |
116 WS_DISABLED,15,60,65,10
117 CONTROL "DEC AU",IDC_DECAU,"Button",BS_AUTORADIOBUTTON |
118 WS_DISABLED,125,60,65,10
119 GROUPBOX "Output Sample Format Settings",IDC_STATIC,7,82,241,91
120 CONTROL "16 bit PCM",IDC_16BIT,"Button",BS_AUTORADIOBUTTON |
121 WS_GROUP,15,96,65,10
122 CONTROL "24 bit PCM",IDC_24BIT,"Button",BS_AUTORADIOBUTTON,125,
123 96,65,10
124 CONTROL "32 bit PCM",IDC_32BIT,"Button",BS_AUTORADIOBUTTON,15,
125 111,65,10
126 CONTROL "32 bit floats",IDC_FLOATS,"Button",BS_AUTORADIOBUTTON,
127 125,111,65,10
128 CONTROL "16 bit PCM - Dithered",IDC_16BIT_DITHER,"Button",
129 BS_AUTORADIOBUTTON,15,126,83,10
130 CONTROL "16 bit PCM - Dithered with",IDC_16BIT_L_SHAPE,"Button",
131 BS_AUTORADIOBUTTON,125,126,98,10
132 CONTROL "16 bit PCM - Dithered with",IDC_16BIT_M_SHAPE,"Button",
133 BS_AUTORADIOBUTTON,15,146,98,10
134 CONTROL "16 bit PCM - Dithered with",IDC_16BIT_H_SHAPE,"Button",
135 BS_AUTORADIOBUTTON,125,146,98,10
136 LTEXT "LIGHT Noise Shaping",IDC_STATIC,138,136,70,8
137 LTEXT "HEAVY Noise Shaping",IDC_STATIC,138,156,73,8
138 LTEXT "MEDIUM Noise Shaping",IDC_STATIC,28,156,78,8
139 GROUPBOX "Object Type Settings",IDC_STATIC,7,174,241,50
140 CONTROL "Main",IDC_MAIN,"Button",BS_AUTORADIOBUTTON | WS_GROUP,
141 15,188,65,10
142 CONTROL "Low Complexity",IDC_LC,"Button",BS_AUTORADIOBUTTON,125,
143 188,65,10
144 CONTROL "Long Term Prediction",IDC_LTP,"Button",
145 BS_AUTORADIOBUTTON,15,203,85,10
146 CONTROL "Low Delay",IDC_LD,"Button",BS_AUTORADIOBUTTON,125,203,
147 65,10
148 DEFPUSHBUTTON "Accept",IDC_BUTTON1,102,233,50,16
149 END
150
151 IDD_ABOUT DIALOGEX 0, 0, 255, 194
152 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION |
153 WS_SYSMENU
154 CAPTION "About aacDECdrop V1.22"
155 FONT 8, "MS Sans Serif", 0, 0, 0x0
156 BEGIN
157 GROUPBOX "",IDC_STATIC,7,5,241,157
158 CTEXT "A decoder to decode/playback aac/Mpeg4 files.",
159 IDC_STATIC,70,13,155,8
160 CTEXT "Copyright 2002 John Edwards.",IDC_STATIC,70,30,97,8
161 CTEXT "Utilises standard libfaad2 from Menno Bakker.",
162 IDC_STATIC,70,46,145,8
163 LTEXT "This program is free software; you can redistribute it and/or modify it",
164 IDC_STATIC,13,62,212,8
165 LTEXT "under the terms of the GNU Public Licence as published by the Free",
166 IDC_STATIC,13,72,215,8
167 LTEXT "Software Foundation; either version 2 of the Licence, or (at your option)",
168 IDC_STATIC,13,82,224,8
169 LTEXT "any later version.",IDC_STATIC,13,92,54,8
170 LTEXT "This program is distributed in the hope that it will be useful, but",
171 IDC_STATIC,13,112,195,8
172 LTEXT "WITHOUT ANY WARRANTY; without even the implied warranty of",
173 IDC_STATIC,13,122,213,8
174 LTEXT "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.",
175 IDC_STATIC,13,132,218,8
176 LTEXT "See the GNU General Public Licence for more details.",
177 IDC_STATIC,13,142,170,8
178 DEFPUSHBUTTON "OK",IDC_BUTTON6,102,171,50,16
179 CONTROL 112,IDC_STATIC,"Static",SS_BITMAP | SS_SUNKEN,12,13,43,
180 40
181 END
182
183
184 /////////////////////////////////////////////////////////////////////////////
185 //
186 // DESIGNINFO
187 //
188
189 #ifdef APSTUDIO_INVOKED
190 GUIDELINES DESIGNINFO
191 BEGIN
192 IDD_VOLUME, DIALOG
193 BEGIN
194 BOTTOMMARGIN, 256
195 END
196 END
197 #endif // APSTUDIO_INVOKED
198
199 #endif // English (U.S.) resources
200 /////////////////////////////////////////////////////////////////////////////
201
202
203
204 #ifndef APSTUDIO_INVOKED
205 /////////////////////////////////////////////////////////////////////////////
206 //
207 // Generated from the TEXTINCLUDE 3 resource.
208 //
209
210
211 /////////////////////////////////////////////////////////////////////////////
212 #endif // not APSTUDIO_INVOKED
213
0 # Microsoft Developer Studio Project File - Name="aacDECdrop" - Package Owner=<4>
1 # Microsoft Developer Studio Generated Build File, Format Version 6.00
2 # ** DO NOT EDIT **
3
4 # TARGTYPE "Win32 (x86) Application" 0x0101
5
6 CFG=aacDECdrop - Win32 Debug
7 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
8 !MESSAGE use the Export Makefile command and run
9 !MESSAGE
10 !MESSAGE NMAKE /f "aacDECdrop.mak".
11 !MESSAGE
12 !MESSAGE You can specify a configuration when running NMAKE
13 !MESSAGE by defining the macro CFG on the command line. For example:
14 !MESSAGE
15 !MESSAGE NMAKE /f "aacDECdrop.mak" CFG="aacDECdrop - Win32 Debug"
16 !MESSAGE
17 !MESSAGE Possible choices for configuration are:
18 !MESSAGE
19 !MESSAGE "aacDECdrop - Win32 Release" (based on "Win32 (x86) Application")
20 !MESSAGE "aacDECdrop - Win32 Debug" (based on "Win32 (x86) Application")
21 !MESSAGE
22
23 # Begin Project
24 # PROP AllowPerConfigDependencies 0
25 # PROP Scc_ProjName ""
26 # PROP Scc_LocalPath ""
27 CPP=cl.exe
28 MTL=midl.exe
29 RSC=rc.exe
30
31 !IF "$(CFG)" == "aacDECdrop - Win32 Release"
32
33 # PROP BASE Use_MFC 0
34 # PROP BASE Use_Debug_Libraries 0
35 # PROP BASE Output_Dir "Release"
36 # PROP BASE Intermediate_Dir "Release"
37 # PROP BASE Target_Dir ""
38 # PROP Use_MFC 0
39 # PROP Use_Debug_Libraries 0
40 # PROP Output_Dir "Release"
41 # PROP Intermediate_Dir "Release"
42 # PROP Ignore_Export_Lib 0
43 # PROP Target_Dir ""
44 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
45 # ADD CPP /nologo /G6 /MD /GX /O2 /I "..\..\include" /I "..\..\common\mp4ff" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /QaxK /Qsox- /Qip /c
46 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
47 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
48 # ADD BASE RSC /l 0x809 /d "NDEBUG"
49 # ADD RSC /l 0x809 /d "NDEBUG"
50 BSC32=bscmake.exe
51 # ADD BASE BSC32 /nologo
52 # ADD BSC32 /nologo
53 LINK32=link.exe
54 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
55 # ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"LIBCMT.lib"
56
57 !ELSEIF "$(CFG)" == "aacDECdrop - Win32 Debug"
58
59 # PROP BASE Use_MFC 0
60 # PROP BASE Use_Debug_Libraries 1
61 # PROP BASE Output_Dir "Debug"
62 # PROP BASE Intermediate_Dir "Debug"
63 # PROP BASE Target_Dir ""
64 # PROP Use_MFC 0
65 # PROP Use_Debug_Libraries 1
66 # PROP Output_Dir "Debug"
67 # PROP Intermediate_Dir "Debug"
68 # PROP Ignore_Export_Lib 0
69 # PROP Target_Dir ""
70 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
71 # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "..\..\common\mp4ff" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
72 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
73 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
74 # ADD BASE RSC /l 0x809 /d "_DEBUG"
75 # ADD RSC /l 0x809 /d "_DEBUG"
76 BSC32=bscmake.exe
77 # ADD BASE BSC32 /nologo
78 # ADD BSC32 /nologo
79 LINK32=link.exe
80 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
81 # ADD LINK32 ws2_32.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
82
83 !ENDIF
84
85 # Begin Target
86
87 # Name "aacDECdrop - Win32 Release"
88 # Name "aacDECdrop - Win32 Debug"
89 # Begin Group "Source Files"
90
91 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
92 # Begin Source File
93
94 SOURCE=..\audio.c
95 # End Source File
96 # Begin Source File
97
98 SOURCE=..\decode.c
99 # End Source File
100 # Begin Source File
101
102 SOURCE=..\decthread.c
103 # End Source File
104 # Begin Source File
105
106 SOURCE=..\main.c
107 # End Source File
108 # Begin Source File
109
110 SOURCE=..\misc.c
111 # End Source File
112 # Begin Source File
113
114 SOURCE=..\wave_out.c
115 # End Source File
116 # End Group
117 # Begin Group "Header Files"
118
119 # PROP Default_Filter "h;hpp;hxx;hm;inl"
120 # Begin Source File
121
122 SOURCE=..\audio.h
123 # End Source File
124 # Begin Source File
125
126 SOURCE=..\decode.h
127 # End Source File
128 # Begin Source File
129
130 SOURCE=..\decthread.h
131 # End Source File
132 # Begin Source File
133
134 SOURCE=..\misc.h
135 # End Source File
136 # Begin Source File
137
138 SOURCE=..\resource.h
139 # End Source File
140 # Begin Source File
141
142 SOURCE=..\wave_out.h
143 # End Source File
144 # End Group
145 # Begin Group "Resource Files"
146
147 # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
148 # Begin Source File
149
150 SOURCE=..\resource\AAC01.bmp
151 # End Source File
152 # Begin Source File
153
154 SOURCE=..\resource\AAC01.ico
155 # End Source File
156 # Begin Source File
157
158 SOURCE=..\Script.rc
159 # End Source File
160 # End Group
161 # End Target
162 # End Project
0 Microsoft Developer Studio Workspace File, Format Version 6.00
1 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
2
3 ###############################################################################
4
5 Project: "aacDECdrop"=.\aacDECdrop.dsp - Package Owner=<4>
6
7 Package=<5>
8 {{{
9 }}}
10
11 Package=<4>
12 {{{
13 Begin Project Dependency
14 Project_Dep_Name libfaad
15 End Project Dependency
16 Begin Project Dependency
17 Project_Dep_Name mp4ff
18 End Project Dependency
19 }}}
20
21 ###############################################################################
22
23 Project: "libfaad"=..\..\libfaad\libfaad.dsp - Package Owner=<4>
24
25 Package=<5>
26 {{{
27 }}}
28
29 Package=<4>
30 {{{
31 }}}
32
33 ###############################################################################
34
35 Project: "mp4ff"=..\..\common\mp4ff\mp4ff.dsp - Package Owner=<4>
36
37 Package=<5>
38 {{{
39 }}}
40
41 Package=<4>
42 {{{
43 }}}
44
45 ###############################################################################
46
47 Global:
48
49 Package=<5>
50 {{{
51 }}}
52
53 Package=<3>
54 {{{
55 }}}
56
57 ###############################################################################
58
0 Microsoft Visual Studio Solution File, Format Version 9.00
1 # Visual C++ Express 2005
2 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aacDECdrop", "aacDECdrop.vcproj", "{C23A88D7-4997-4026-BBDB-5B0B2B22FDFF}"
3 ProjectSection(ProjectDependencies) = postProject
4 {F470BB4A-7675-4D6A-B310-41F33AC6F987} = {F470BB4A-7675-4D6A-B310-41F33AC6F987}
5 {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114} = {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}
6 EndProjectSection
7 EndProject
8 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "..\..\libfaad\libfaad.vcproj", "{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}"
9 EndProject
10 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mp4ff", "..\..\common\mp4ff\mp4ff.vcproj", "{F470BB4A-7675-4D6A-B310-41F33AC6F987}"
11 EndProject
12 Global
13 GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 Debug|Win32 = Debug|Win32
15 Release|Win32 = Release|Win32
16 EndGlobalSection
17 GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 {C23A88D7-4997-4026-BBDB-5B0B2B22FDFF}.Debug|Win32.ActiveCfg = Debug|Win32
19 {C23A88D7-4997-4026-BBDB-5B0B2B22FDFF}.Debug|Win32.Build.0 = Debug|Win32
20 {C23A88D7-4997-4026-BBDB-5B0B2B22FDFF}.Release|Win32.ActiveCfg = Release|Win32
21 {C23A88D7-4997-4026-BBDB-5B0B2B22FDFF}.Release|Win32.Build.0 = Release|Win32
22 {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|Win32.ActiveCfg = Debug|Win32
23 {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|Win32.ActiveCfg = Release|Win32
24 {F470BB4A-7675-4D6A-B310-41F33AC6F987}.Debug|Win32.ActiveCfg = Debug|Win32
25 {F470BB4A-7675-4D6A-B310-41F33AC6F987}.Debug|Win32.Build.0 = Debug|Win32
26 {F470BB4A-7675-4D6A-B310-41F33AC6F987}.Release|Win32.ActiveCfg = Release|Win32
27 {F470BB4A-7675-4D6A-B310-41F33AC6F987}.Release|Win32.Build.0 = Release|Win32
28 EndGlobalSection
29 GlobalSection(SolutionProperties) = preSolution
30 HideSolutionNode = FALSE
31 EndGlobalSection
32 EndGlobal
0 <?xml version="1.0" encoding="Windows-1252"?>
1 <VisualStudioProject
2 ProjectType="Visual C++"
3 Version="8,00"
4 Name="aacDECdrop"
5 ProjectGUID="{C23A88D7-4997-4026-BBDB-5B0B2B22FDFF}"
6 RootNamespace="aacDECdrop"
7 >
8 <Platforms>
9 <Platform
10 Name="Win32"
11 />
12 </Platforms>
13 <ToolFiles>
14 </ToolFiles>
15 <Configurations>
16 <Configuration
17 Name="Release|Win32"
18 OutputDirectory=".\Release"
19 IntermediateDirectory=".\Release"
20 ConfigurationType="1"
21 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
22 UseOfMFC="0"
23 ATLMinimizesCRunTimeLibraryUsage="false"
24 CharacterSet="2"
25 >
26 <Tool
27 Name="VCPreBuildEventTool"
28 />
29 <Tool
30 Name="VCCustomBuildTool"
31 />
32 <Tool
33 Name="VCXMLDataGeneratorTool"
34 />
35 <Tool
36 Name="VCWebServiceProxyGeneratorTool"
37 />
38 <Tool
39 Name="VCMIDLTool"
40 PreprocessorDefinitions="NDEBUG"
41 MkTypLibCompatible="true"
42 SuppressStartupBanner="true"
43 TargetEnvironment="1"
44 TypeLibraryName=".\Release/aacDECdrop.tlb"
45 />
46 <Tool
47 Name="VCCLCompilerTool"
48 Optimization="2"
49 InlineFunctionExpansion="1"
50 EnableIntrinsicFunctions="true"
51 FavorSizeOrSpeed="1"
52 AdditionalIncludeDirectories="..\..\include;..\..\common\mp4ff"
53 PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
54 StringPooling="true"
55 RuntimeLibrary="2"
56 UsePrecompiledHeader="0"
57 PrecompiledHeaderFile=".\Release/aacDECdrop.pch"
58 AssemblerListingLocation=".\Release/"
59 ObjectFile=".\Release/"
60 ProgramDataBaseFileName=".\Release/"
61 WarningLevel="3"
62 SuppressStartupBanner="true"
63 CompileAs="0"
64 />
65 <Tool
66 Name="VCManagedResourceCompilerTool"
67 />
68 <Tool
69 Name="VCResourceCompilerTool"
70 PreprocessorDefinitions="NDEBUG"
71 Culture="2057"
72 />
73 <Tool
74 Name="VCPreLinkEventTool"
75 />
76 <Tool
77 Name="VCLinkerTool"
78 AdditionalOptions="/MACHINE:I386"
79 AdditionalDependencies="advapi32.lib shell32.lib gdi32.lib odbc32.lib odbccp32.lib winmm.lib ws2_32.lib user32.lib"
80 OutputFile=".\Release/aacDECdrop.exe"
81 LinkIncremental="1"
82 SuppressStartupBanner="true"
83 IgnoreDefaultLibraryNames=""
84 ProgramDatabaseFile=".\Release/aacDECdrop.pdb"
85 SubSystem="2"
86 />
87 <Tool
88 Name="VCALinkTool"
89 />
90 <Tool
91 Name="VCManifestTool"
92 />
93 <Tool
94 Name="VCXDCMakeTool"
95 />
96 <Tool
97 Name="VCBscMakeTool"
98 />
99 <Tool
100 Name="VCFxCopTool"
101 />
102 <Tool
103 Name="VCAppVerifierTool"
104 />
105 <Tool
106 Name="VCWebDeploymentTool"
107 />
108 <Tool
109 Name="VCPostBuildEventTool"
110 Description="Compressing using UPX..."
111 CommandLine="upx --best .\release\aacDECdrop.exe"
112 />
113 </Configuration>
114 <Configuration
115 Name="Debug|Win32"
116 OutputDirectory=".\Debug"
117 IntermediateDirectory=".\Debug"
118 ConfigurationType="1"
119 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
120 UseOfMFC="0"
121 ATLMinimizesCRunTimeLibraryUsage="false"
122 CharacterSet="2"
123 >
124 <Tool
125 Name="VCPreBuildEventTool"
126 />
127 <Tool
128 Name="VCCustomBuildTool"
129 />
130 <Tool
131 Name="VCXMLDataGeneratorTool"
132 />
133 <Tool
134 Name="VCWebServiceProxyGeneratorTool"
135 />
136 <Tool
137 Name="VCMIDLTool"
138 PreprocessorDefinitions="_DEBUG"
139 MkTypLibCompatible="true"
140 SuppressStartupBanner="true"
141 TargetEnvironment="1"
142 TypeLibraryName=".\Debug/aacDECdrop.tlb"
143 />
144 <Tool
145 Name="VCCLCompilerTool"
146 Optimization="0"
147 AdditionalIncludeDirectories="..\..\include;..\..\common\mp4ff"
148 PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
149 BasicRuntimeChecks="3"
150 RuntimeLibrary="3"
151 UsePrecompiledHeader="0"
152 PrecompiledHeaderFile=".\Debug/aacDECdrop.pch"
153 AssemblerListingLocation=".\Debug/"
154 ObjectFile=".\Debug/"
155 ProgramDataBaseFileName=".\Debug/"
156 WarningLevel="3"
157 SuppressStartupBanner="true"
158 DebugInformationFormat="4"
159 CompileAs="0"
160 />
161 <Tool
162 Name="VCManagedResourceCompilerTool"
163 />
164 <Tool
165 Name="VCResourceCompilerTool"
166 PreprocessorDefinitions="_DEBUG"
167 Culture="2057"
168 />
169 <Tool
170 Name="VCPreLinkEventTool"
171 />
172 <Tool
173 Name="VCLinkerTool"
174 AdditionalOptions="/MACHINE:I386"
175 AdditionalDependencies="advapi32.lib shell32.lib gdi32.lib odbc32.lib odbccp32.lib winmm.lib ws2_32.lib user32.lib"
176 OutputFile=".\Debug/aacDECdrop.exe"
177 LinkIncremental="2"
178 SuppressStartupBanner="true"
179 GenerateDebugInformation="true"
180 ProgramDatabaseFile=".\Debug/aacDECdrop.pdb"
181 SubSystem="2"
182 />
183 <Tool
184 Name="VCALinkTool"
185 />
186 <Tool
187 Name="VCManifestTool"
188 />
189 <Tool
190 Name="VCXDCMakeTool"
191 />
192 <Tool
193 Name="VCBscMakeTool"
194 />
195 <Tool
196 Name="VCFxCopTool"
197 />
198 <Tool
199 Name="VCAppVerifierTool"
200 />
201 <Tool
202 Name="VCWebDeploymentTool"
203 />
204 <Tool
205 Name="VCPostBuildEventTool"
206 />
207 </Configuration>
208 </Configurations>
209 <References>
210 </References>
211 <Files>
212 <Filter
213 Name="Source Files"
214 Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
215 >
216 <File
217 RelativePath="..\audio.c"
218 >
219 </File>
220 <File
221 RelativePath="..\decode.c"
222 >
223 </File>
224 <File
225 RelativePath="..\decthread.c"
226 >
227 </File>
228 <File
229 RelativePath="..\main.c"
230 >
231 </File>
232 <File
233 RelativePath="..\misc.c"
234 >
235 </File>
236 <File
237 RelativePath="..\wave_out.c"
238 >
239 </File>
240 </Filter>
241 <Filter
242 Name="Header Files"
243 Filter="h;hpp;hxx;hm;inl"
244 >
245 <File
246 RelativePath="..\audio.h"
247 >
248 </File>
249 <File
250 RelativePath="..\decode.h"
251 >
252 </File>
253 <File
254 RelativePath="..\decthread.h"
255 >
256 </File>
257 <File
258 RelativePath="..\misc.h"
259 >
260 </File>
261 <File
262 RelativePath="..\resource.h"
263 >
264 </File>
265 <File
266 RelativePath="..\wave_out.h"
267 >
268 </File>
269 </Filter>
270 <Filter
271 Name="Resource Files"
272 Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
273 >
274 <File
275 RelativePath="..\resource\AAC01.bmp"
276 >
277 </File>
278 <File
279 RelativePath="..\resource\AAC01.ico"
280 >
281 </File>
282 <File
283 RelativePath="..\resource\AAC02.bmp"
284 >
285 </File>
286 <File
287 RelativePath="..\resource\AAC03.bmp"
288 >
289 </File>
290 <File
291 RelativePath="..\resource\AAC04.bmp"
292 >
293 </File>
294 <File
295 RelativePath="..\resource\AAC05.bmp"
296 >
297 </File>
298 <File
299 RelativePath="..\resource\AAC06.bmp"
300 >
301 </File>
302 <File
303 RelativePath="..\resource\AAC07.bmp"
304 >
305 </File>
306 <File
307 RelativePath="..\resource\AAC08.bmp"
308 >
309 </File>
310 <File
311 RelativePath="..\Script.rc"
312 >
313 <FileConfiguration
314 Name="Release|Win32"
315 >
316 <Tool
317 Name="VCResourceCompilerTool"
318 AdditionalIncludeDirectories="\aac\cvsrep\faad2\aacDECdrop;$(NoInherit)"
319 />
320 </FileConfiguration>
321 <FileConfiguration
322 Name="Debug|Win32"
323 >
324 <Tool
325 Name="VCResourceCompilerTool"
326 AdditionalIncludeDirectories="\aac\cvsrep\faad2\aacDECdrop;$(NoInherit)"
327 />
328 </FileConfiguration>
329 </File>
330 </Filter>
331 </Files>
332 <Globals>
333 </Globals>
334 </VisualStudioProject>
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: audio.c,v 1.11 2004/02/06 10:23:27 menno Exp $
25 **/
26
27 #ifdef _WIN32
28 #include <io.h>
29 #endif
30 #include <stdlib.h>
31 #include <stdio.h>
32 #include <fcntl.h>
33 #include <math.h>
34 #include <faad.h>
35 #include "audio.h"
36
37
38 audio_file *open_audio_file(char *infile, int samplerate, int channels,
39 int outputFormat, int fileType, long channelMask)
40 {
41 audio_file *aufile = malloc(sizeof(audio_file));
42
43 aufile->outputFormat = outputFormat;
44
45 aufile->samplerate = samplerate;
46 aufile->channels = channels;
47 aufile->total_samples = 0;
48 aufile->fileType = fileType;
49 aufile->channelMask = channelMask;
50
51 switch (outputFormat)
52 {
53 case FAAD_FMT_16BIT:
54 aufile->bits_per_sample = 16;
55 break;
56 case FAAD_FMT_24BIT:
57 aufile->bits_per_sample = 24;
58 break;
59 case FAAD_FMT_32BIT:
60 case FAAD_FMT_FLOAT:
61 aufile->bits_per_sample = 32;
62 break;
63 default:
64 if (aufile) free(aufile);
65 return NULL;
66 }
67
68 if(infile[0] == '-')
69 {
70 #ifdef _WIN32
71 setmode(fileno(stdout), O_BINARY);
72 #endif
73 aufile->sndfile = stdout;
74 } else {
75 aufile->sndfile = fopen(infile, "wb");
76 }
77
78 if (aufile->sndfile == NULL)
79 {
80 if (aufile) free(aufile);
81 return NULL;
82 }
83
84 if (aufile->fileType == OUTPUT_WAV)
85 {
86 if (aufile->channelMask)
87 write_wav_extensible_header(aufile, aufile->channelMask);
88 else
89 write_wav_header(aufile);
90 }
91
92 return aufile;
93 }
94
95 int write_audio_file(audio_file *aufile, void *sample_buffer, int samples, int offset)
96 {
97 char *buf = (char *)sample_buffer;
98 switch (aufile->outputFormat)
99 {
100 case FAAD_FMT_16BIT:
101 return write_audio_16bit(aufile, buf + offset*2, samples);
102 case FAAD_FMT_24BIT:
103 return write_audio_24bit(aufile, buf + offset*4, samples);
104 case FAAD_FMT_32BIT:
105 return write_audio_32bit(aufile, buf + offset*4, samples);
106 case FAAD_FMT_FLOAT:
107 return write_audio_float(aufile, buf + offset*4, samples);
108 default:
109 return 0;
110 }
111
112 return 0;
113 }
114
115 void close_audio_file(audio_file *aufile)
116 {
117 if (aufile->fileType == OUTPUT_WAV)
118 {
119 fseek(aufile->sndfile, 0, SEEK_SET);
120
121 if (aufile->channelMask)
122 write_wav_extensible_header(aufile, aufile->channelMask);
123 else
124 write_wav_header(aufile);
125 }
126
127 fclose(aufile->sndfile);
128
129 if (aufile) free(aufile);
130 }
131
132 static int write_wav_header(audio_file *aufile)
133 {
134 unsigned char header[44];
135 unsigned char* p = header;
136 unsigned int bytes = (aufile->bits_per_sample + 7) / 8;
137 float data_size = (float)bytes * aufile->total_samples;
138 unsigned long word32;
139
140 *p++ = 'R'; *p++ = 'I'; *p++ = 'F'; *p++ = 'F';
141
142 word32 = (data_size + (44 - 8) < (float)MAXWAVESIZE) ?
143 (unsigned long)data_size + (44 - 8) : (unsigned long)MAXWAVESIZE;
144 *p++ = (unsigned char)(word32 >> 0);
145 *p++ = (unsigned char)(word32 >> 8);
146 *p++ = (unsigned char)(word32 >> 16);
147 *p++ = (unsigned char)(word32 >> 24);
148
149 *p++ = 'W'; *p++ = 'A'; *p++ = 'V'; *p++ = 'E';
150
151 *p++ = 'f'; *p++ = 'm'; *p++ = 't'; *p++ = ' ';
152
153 *p++ = 0x10; *p++ = 0x00; *p++ = 0x00; *p++ = 0x00;
154
155 if (aufile->outputFormat == FAAD_FMT_FLOAT)
156 {
157 *p++ = 0x03; *p++ = 0x00;
158 } else {
159 *p++ = 0x01; *p++ = 0x00;
160 }
161
162 *p++ = (unsigned char)(aufile->channels >> 0);
163 *p++ = (unsigned char)(aufile->channels >> 8);
164
165 word32 = (unsigned long)(aufile->samplerate + 0.5);
166 *p++ = (unsigned char)(word32 >> 0);
167 *p++ = (unsigned char)(word32 >> 8);
168 *p++ = (unsigned char)(word32 >> 16);
169 *p++ = (unsigned char)(word32 >> 24);
170
171 word32 = aufile->samplerate * bytes * aufile->channels;
172 *p++ = (unsigned char)(word32 >> 0);
173 *p++ = (unsigned char)(word32 >> 8);
174 *p++ = (unsigned char)(word32 >> 16);
175 *p++ = (unsigned char)(word32 >> 24);
176
177 word32 = bytes * aufile->channels;
178 *p++ = (unsigned char)(word32 >> 0);
179 *p++ = (unsigned char)(word32 >> 8);
180
181 *p++ = (unsigned char)(aufile->bits_per_sample >> 0);
182 *p++ = (unsigned char)(aufile->bits_per_sample >> 8);
183
184 *p++ = 'd'; *p++ = 'a'; *p++ = 't'; *p++ = 'a';
185
186 word32 = data_size < MAXWAVESIZE ?
187 (unsigned long)data_size : (unsigned long)MAXWAVESIZE;
188 *p++ = (unsigned char)(word32 >> 0);
189 *p++ = (unsigned char)(word32 >> 8);
190 *p++ = (unsigned char)(word32 >> 16);
191 *p++ = (unsigned char)(word32 >> 24);
192
193 return fwrite(header, sizeof(header), 1, aufile->sndfile);
194 }
195
196 static int write_wav_extensible_header(audio_file *aufile, long channelMask)
197 {
198 unsigned char header[68];
199 unsigned char* p = header;
200 unsigned int bytes = (aufile->bits_per_sample + 7) / 8;
201 float data_size = (float)bytes * aufile->total_samples;
202 unsigned long word32;
203
204 *p++ = 'R'; *p++ = 'I'; *p++ = 'F'; *p++ = 'F';
205
206 word32 = (data_size + (68 - 8) < (float)MAXWAVESIZE) ?
207 (unsigned long)data_size + (68 - 8) : (unsigned long)MAXWAVESIZE;
208 *p++ = (unsigned char)(word32 >> 0);
209 *p++ = (unsigned char)(word32 >> 8);
210 *p++ = (unsigned char)(word32 >> 16);
211 *p++ = (unsigned char)(word32 >> 24);
212
213 *p++ = 'W'; *p++ = 'A'; *p++ = 'V'; *p++ = 'E';
214
215 *p++ = 'f'; *p++ = 'm'; *p++ = 't'; *p++ = ' ';
216
217 *p++ = /*0x10*/0x28; *p++ = 0x00; *p++ = 0x00; *p++ = 0x00;
218
219 /* WAVE_FORMAT_EXTENSIBLE */
220 *p++ = 0xFE; *p++ = 0xFF;
221
222 *p++ = (unsigned char)(aufile->channels >> 0);
223 *p++ = (unsigned char)(aufile->channels >> 8);
224
225 word32 = (unsigned long)(aufile->samplerate + 0.5);
226 *p++ = (unsigned char)(word32 >> 0);
227 *p++ = (unsigned char)(word32 >> 8);
228 *p++ = (unsigned char)(word32 >> 16);
229 *p++ = (unsigned char)(word32 >> 24);
230
231 word32 = aufile->samplerate * bytes * aufile->channels;
232 *p++ = (unsigned char)(word32 >> 0);
233 *p++ = (unsigned char)(word32 >> 8);
234 *p++ = (unsigned char)(word32 >> 16);
235 *p++ = (unsigned char)(word32 >> 24);
236
237 word32 = bytes * aufile->channels;
238 *p++ = (unsigned char)(word32 >> 0);
239 *p++ = (unsigned char)(word32 >> 8);
240
241 *p++ = (unsigned char)(aufile->bits_per_sample >> 0);
242 *p++ = (unsigned char)(aufile->bits_per_sample >> 8);
243
244 /* cbSize */
245 *p++ = (unsigned char)(22);
246 *p++ = (unsigned char)(0);
247
248 /* WAVEFORMATEXTENSIBLE */
249
250 /* wValidBitsPerSample */
251 *p++ = (unsigned char)(aufile->bits_per_sample >> 0);
252 *p++ = (unsigned char)(aufile->bits_per_sample >> 8);
253
254 /* dwChannelMask */
255 word32 = channelMask;
256 *p++ = (unsigned char)(word32 >> 0);
257 *p++ = (unsigned char)(word32 >> 8);
258 *p++ = (unsigned char)(word32 >> 16);
259 *p++ = (unsigned char)(word32 >> 24);
260
261 /* SubFormat */
262 if (aufile->outputFormat == FAAD_FMT_FLOAT)
263 {
264 /* KSDATAFORMAT_SUBTYPE_IEEE_FLOAT: 00000003-0000-0010-8000-00aa00389b71 */
265 *p++ = 0x03;
266 *p++ = 0x00;
267 *p++ = 0x00;
268 *p++ = 0x00;
269 *p++ = 0x00; *p++ = 0x00; *p++ = 0x10; *p++ = 0x00; *p++ = 0x80; *p++ = 0x00;
270 *p++ = 0x00; *p++ = 0xaa; *p++ = 0x00; *p++ = 0x38; *p++ = 0x9b; *p++ = 0x71;
271 } else {
272 /* KSDATAFORMAT_SUBTYPE_PCM: 00000001-0000-0010-8000-00aa00389b71 */
273 *p++ = 0x01;
274 *p++ = 0x00;
275 *p++ = 0x00;
276 *p++ = 0x00;
277 *p++ = 0x00; *p++ = 0x00; *p++ = 0x10; *p++ = 0x00; *p++ = 0x80; *p++ = 0x00;
278 *p++ = 0x00; *p++ = 0xaa; *p++ = 0x00; *p++ = 0x38; *p++ = 0x9b; *p++ = 0x71;
279 }
280
281 /* end WAVEFORMATEXTENSIBLE */
282
283 *p++ = 'd'; *p++ = 'a'; *p++ = 't'; *p++ = 'a';
284
285 word32 = data_size < MAXWAVESIZE ?
286 (unsigned long)data_size : (unsigned long)MAXWAVESIZE;
287 *p++ = (unsigned char)(word32 >> 0);
288 *p++ = (unsigned char)(word32 >> 8);
289 *p++ = (unsigned char)(word32 >> 16);
290 *p++ = (unsigned char)(word32 >> 24);
291
292 return fwrite(header, sizeof(header), 1, aufile->sndfile);
293 }
294
295 static int write_audio_16bit(audio_file *aufile, void *sample_buffer,
296 unsigned int samples)
297 {
298 int ret;
299 unsigned int i;
300 short *sample_buffer16 = (short*)sample_buffer;
301 char *data = malloc(samples*aufile->bits_per_sample*sizeof(char)/8);
302
303 aufile->total_samples += samples;
304
305 if (aufile->channels == 6 && aufile->channelMask)
306 {
307 for (i = 0; i < samples; i += aufile->channels)
308 {
309 short r1, r2, r3, r4, r5, r6;
310 r1 = sample_buffer16[i];
311 r2 = sample_buffer16[i+1];
312 r3 = sample_buffer16[i+2];
313 r4 = sample_buffer16[i+3];
314 r5 = sample_buffer16[i+4];
315 r6 = sample_buffer16[i+5];
316 sample_buffer16[i] = r2;
317 sample_buffer16[i+1] = r3;
318 sample_buffer16[i+2] = r1;
319 sample_buffer16[i+3] = r6;
320 sample_buffer16[i+4] = r4;
321 sample_buffer16[i+5] = r5;
322 }
323 }
324
325 for (i = 0; i < samples; i++)
326 {
327 data[i*2] = (char)(sample_buffer16[i] & 0xFF);
328 data[i*2+1] = (char)((sample_buffer16[i] >> 8) & 0xFF);
329 }
330
331 ret = fwrite(data, samples, aufile->bits_per_sample/8, aufile->sndfile);
332
333 if (data) free(data);
334
335 return ret;
336 }
337
338 static int write_audio_24bit(audio_file *aufile, void *sample_buffer,
339 unsigned int samples)
340 {
341 int ret;
342 unsigned int i;
343 long *sample_buffer24 = (long*)sample_buffer;
344 char *data = malloc(samples*aufile->bits_per_sample*sizeof(char)/8);
345
346 aufile->total_samples += samples;
347
348 if (aufile->channels == 6 && aufile->channelMask)
349 {
350 for (i = 0; i < samples; i += aufile->channels)
351 {
352 long r1, r2, r3, r4, r5, r6;
353 r1 = sample_buffer24[i];
354 r2 = sample_buffer24[i+1];
355 r3 = sample_buffer24[i+2];
356 r4 = sample_buffer24[i+3];
357 r5 = sample_buffer24[i+4];
358 r6 = sample_buffer24[i+5];
359 sample_buffer24[i] = r2;
360 sample_buffer24[i+1] = r3;
361 sample_buffer24[i+2] = r1;
362 sample_buffer24[i+3] = r6;
363 sample_buffer24[i+4] = r4;
364 sample_buffer24[i+5] = r5;
365 }
366 }
367
368 for (i = 0; i < samples; i++)
369 {
370 data[i*3] = (char)(sample_buffer24[i] & 0xFF);
371 data[i*3+1] = (char)((sample_buffer24[i] >> 8) & 0xFF);
372 data[i*3+2] = (char)((sample_buffer24[i] >> 16) & 0xFF);
373 }
374
375 ret = fwrite(data, samples, aufile->bits_per_sample/8, aufile->sndfile);
376
377 if (data) free(data);
378
379 return ret;
380 }
381
382 static int write_audio_32bit(audio_file *aufile, void *sample_buffer,
383 unsigned int samples)
384 {
385 int ret;
386 unsigned int i;
387 long *sample_buffer32 = (long*)sample_buffer;
388 char *data = malloc(samples*aufile->bits_per_sample*sizeof(char)/8);
389
390 aufile->total_samples += samples;
391
392 if (aufile->channels == 6 && aufile->channelMask)
393 {
394 for (i = 0; i < samples; i += aufile->channels)
395 {
396 long r1, r2, r3, r4, r5, r6;
397 r1 = sample_buffer32[i];
398 r2 = sample_buffer32[i+1];
399 r3 = sample_buffer32[i+2];
400 r4 = sample_buffer32[i+3];
401 r5 = sample_buffer32[i+4];
402 r6 = sample_buffer32[i+5];
403 sample_buffer32[i] = r2;
404 sample_buffer32[i+1] = r3;
405 sample_buffer32[i+2] = r1;
406 sample_buffer32[i+3] = r6;
407 sample_buffer32[i+4] = r4;
408 sample_buffer32[i+5] = r5;
409 }
410 }
411
412 for (i = 0; i < samples; i++)
413 {
414 data[i*4] = (char)(sample_buffer32[i] & 0xFF);
415 data[i*4+1] = (char)((sample_buffer32[i] >> 8) & 0xFF);
416 data[i*4+2] = (char)((sample_buffer32[i] >> 16) & 0xFF);
417 data[i*4+3] = (char)((sample_buffer32[i] >> 24) & 0xFF);
418 }
419
420 ret = fwrite(data, samples, aufile->bits_per_sample/8, aufile->sndfile);
421
422 if (data) free(data);
423
424 return ret;
425 }
426
427 static int write_audio_float(audio_file *aufile, void *sample_buffer,
428 unsigned int samples)
429 {
430 int ret;
431 unsigned int i;
432 float *sample_buffer_f = (float*)sample_buffer;
433 unsigned char *data = malloc(samples*aufile->bits_per_sample*sizeof(char)/8);
434
435 aufile->total_samples += samples;
436
437 if (aufile->channels == 6 && aufile->channelMask)
438 {
439 for (i = 0; i < samples; i += aufile->channels)
440 {
441 float r1, r2, r3, r4, r5, r6;
442 r1 = sample_buffer_f[i];
443 r2 = sample_buffer_f[i+1];
444 r3 = sample_buffer_f[i+2];
445 r4 = sample_buffer_f[i+3];
446 r5 = sample_buffer_f[i+4];
447 r6 = sample_buffer_f[i+5];
448 sample_buffer_f[i] = r2;
449 sample_buffer_f[i+1] = r3;
450 sample_buffer_f[i+2] = r1;
451 sample_buffer_f[i+3] = r6;
452 sample_buffer_f[i+4] = r4;
453 sample_buffer_f[i+5] = r5;
454 }
455 }
456
457 for (i = 0; i < samples; i++)
458 {
459 int exponent, mantissa, negative = 0 ;
460 float in = sample_buffer_f[i];
461
462 data[i*4] = 0; data[i*4+1] = 0; data[i*4+2] = 0; data[i*4+3] = 0;
463 if (in == 0.0)
464 continue;
465
466 if (in < 0.0)
467 {
468 in *= -1.0;
469 negative = 1;
470 }
471 in = (float)frexp(in, &exponent);
472 exponent += 126;
473 in *= (float)0x1000000;
474 mantissa = (((int)in) & 0x7FFFFF);
475
476 if (negative)
477 data[i*4+3] |= 0x80;
478
479 if (exponent & 0x01)
480 data[i*4+2] |= 0x80;
481
482 data[i*4] = mantissa & 0xFF;
483 data[i*4+1] = (mantissa >> 8) & 0xFF;
484 data[i*4+2] |= (mantissa >> 16) & 0x7F;
485 data[i*4+3] |= (exponent >> 1) & 0x7F;
486 }
487
488 ret = fwrite(data, samples, aufile->bits_per_sample/8, aufile->sndfile);
489
490 if (data) free(data);
491
492 return ret;
493 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: audio.h,v 1.9 2004/02/06 10:23:27 menno Exp $
25 **/
26
27 #ifndef AUDIO_H_INCLUDED
28 #define AUDIO_H_INCLUDED
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 #define MAXWAVESIZE 4294967040LU
35
36 #define OUTPUT_WAV 1
37 #define OUTPUT_RAW 2
38
39 typedef struct
40 {
41 int outputFormat;
42 FILE *sndfile;
43 unsigned int fileType;
44 unsigned long samplerate;
45 unsigned int bits_per_sample;
46 unsigned int channels;
47 unsigned long total_samples;
48 long channelMask;
49 } audio_file;
50
51 audio_file *open_audio_file(char *infile, int samplerate, int channels,
52 int outputFormat, int fileType, long channelMask);
53 int write_audio_file(audio_file *aufile, void *sample_buffer, int samples, int offset);
54 void close_audio_file(audio_file *aufile);
55 static int write_wav_header(audio_file *aufile);
56 static int write_wav_extensible_header(audio_file *aufile, long channelMask);
57 static int write_audio_16bit(audio_file *aufile, void *sample_buffer,
58 unsigned int samples);
59 static int write_audio_24bit(audio_file *aufile, void *sample_buffer,
60 unsigned int samples);
61 static int write_audio_32bit(audio_file *aufile, void *sample_buffer,
62 unsigned int samples);
63 static int write_audio_float(audio_file *aufile, void *sample_buffer,
64 unsigned int samples);
65
66
67 #ifdef __cplusplus
68 }
69 #endif
70 #endif
0 /*
1 ** FAAD - Freeware Advanced Audio Decoder
2 ** Copyright (C) 2002 M. Bakker
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** $Id: decode.c,v 1.16 2004/04/03 19:08:37 menno Exp $
19 ** $Id: decode.c,v 1.16 2004/04/03 19:08:37 menno Exp $
20 **/
21
22 #ifdef _WIN32
23 #define WIN32_LEAN_AND_MEAN
24 #include <windows.h>
25 #define off_t __int64
26 #else
27 #include <time.h>
28 #endif
29
30 #include <stdio.h>
31 #include <stdlib.h>
32
33 #include <neaacdec.h>
34 #include <mp4ff.h>
35
36 #include "audio.h"
37 #include "decode.h"
38 #include "misc.h"
39 #include "wave_out.h"
40
41 #ifndef min
42 #define min(a,b) ( (a) < (b) ? (a) : (b) )
43 #endif
44
45 #define MAX_CHANNELS 8 /* make this higher to support files with
46 more channels */
47
48 /* FAAD file buffering routines */
49 /* declare buffering variables */
50 #define DEC_BUFF_VARS \
51 int fileread, bytesconsumed, k; \
52 int buffercount = 0, buffer_index = 0; \
53 unsigned char *buffer; \
54 unsigned int bytes_in_buffer = 0;
55
56 /* initialise buffering */
57 #define INIT_BUFF(file) \
58 fseek(file, 0, SEEK_END); \
59 fileread = ftell(file); \
60 fseek(file, 0, SEEK_SET); \
61 buffer = (unsigned char*)malloc(FAAD_MIN_STREAMSIZE*MAX_CHANNELS); \
62 memset(buffer, 0, FAAD_MIN_STREAMSIZE*MAX_CHANNELS); \
63 bytes_in_buffer = fread(buffer, 1, FAAD_MIN_STREAMSIZE*MAX_CHANNELS, file);
64
65 /* skip bytes in buffer */
66 #define UPDATE_BUFF_SKIP(bytes) \
67 fseek(infile, bytes, SEEK_SET); \
68 buffer_index += bytes; \
69 buffercount = 0; \
70 bytes_in_buffer = fread(buffer, 1, FAAD_MIN_STREAMSIZE*MAX_CHANNELS, infile);
71
72 /* update buffer */
73 #define UPDATE_BUFF_READ \
74 if (bytesconsumed > 0) { \
75 for (k = 0; k < (FAAD_MIN_STREAMSIZE*MAX_CHANNELS - bytesconsumed); k++) \
76 buffer[k] = buffer[k + bytesconsumed]; \
77 bytes_in_buffer += fread(buffer + (FAAD_MIN_STREAMSIZE*MAX_CHANNELS) - bytesconsumed, 1, bytesconsumed, infile); \
78 bytesconsumed = 0; \
79 }
80
81 /* update buffer indices after NeAACDecDecode */
82 #define UPDATE_BUFF_IDX(frame) \
83 bytesconsumed += frame.bytesconsumed; \
84 buffer_index += frame.bytesconsumed; \
85 bytes_in_buffer -= frame.bytesconsumed;
86
87 /* true if decoding has to stop because of EOF */
88 #define IS_FILE_END buffer_index >= fileread
89
90 /* end buffering */
91 #define END_BUFF if (buffer) free(buffer);
92
93
94
95 /* globals */
96 char *progName;
97 extern int stop_decoding;
98
99 int id3v2_tag(unsigned char *buffer)
100 {
101 if (strncmp(buffer, "ID3", 3) == 0) {
102 unsigned long tagsize;
103
104 /* high bit is not used */
105 tagsize = (buffer[6] << 21) | (buffer[7] << 14) |
106 (buffer[8] << 7) | (buffer[9] << 0);
107
108 tagsize += 10;
109
110 return tagsize;
111 } else {
112 return 0;
113 }
114 }
115
116 char *file_ext[] =
117 {
118 NULL,
119 ".wav",
120 ".aif",
121 ".au",
122 ".au",
123 NULL
124 };
125
126 /* MicroSoft channel definitions */
127 #define SPEAKER_FRONT_LEFT 0x1
128 #define SPEAKER_FRONT_RIGHT 0x2
129 #define SPEAKER_FRONT_CENTER 0x4
130 #define SPEAKER_LOW_FREQUENCY 0x8
131 #define SPEAKER_BACK_LEFT 0x10
132 #define SPEAKER_BACK_RIGHT 0x20
133 #define SPEAKER_FRONT_LEFT_OF_CENTER 0x40
134 #define SPEAKER_FRONT_RIGHT_OF_CENTER 0x80
135 #define SPEAKER_BACK_CENTER 0x100
136 #define SPEAKER_SIDE_LEFT 0x200
137 #define SPEAKER_SIDE_RIGHT 0x400
138 #define SPEAKER_TOP_CENTER 0x800
139 #define SPEAKER_TOP_FRONT_LEFT 0x1000
140 #define SPEAKER_TOP_FRONT_CENTER 0x2000
141 #define SPEAKER_TOP_FRONT_RIGHT 0x4000
142 #define SPEAKER_TOP_BACK_LEFT 0x8000
143 #define SPEAKER_TOP_BACK_CENTER 0x10000
144 #define SPEAKER_TOP_BACK_RIGHT 0x20000
145 #define SPEAKER_RESERVED 0x80000000
146
147 long aacChannelConfig2wavexChannelMask(NeAACDecFrameInfo *hInfo)
148 {
149 if (hInfo->channels == 6 && hInfo->num_lfe_channels)
150 {
151 return SPEAKER_FRONT_LEFT + SPEAKER_FRONT_RIGHT +
152 SPEAKER_FRONT_CENTER + SPEAKER_LOW_FREQUENCY +
153 SPEAKER_BACK_LEFT + SPEAKER_BACK_RIGHT;
154 } else {
155 return 0;
156 }
157 }
158
159 int decodeAACfile(char *sndfile, int def_srate, aac_dec_opt *opt)
160 {
161 int tagsize;
162 unsigned long samplerate;
163 unsigned char channels;
164 void *sample_buffer;
165
166 FILE *infile;
167
168 audio_file *aufile;
169
170 NeAACDecHandle hDecoder;
171 NeAACDecFrameInfo frameInfo;
172 NeAACDecConfigurationPtr config;
173
174 int first_time = 1;
175
176
177 /* declare variables for buffering */
178 DEC_BUFF_VARS
179
180 infile = fopen(opt->filename, "rb");
181 if (infile == NULL)
182 {
183 /* unable to open file */
184 error_handler("Error opening file: %s\n", opt->filename);
185 return 1;
186 }
187 INIT_BUFF(infile)
188
189 tagsize = id3v2_tag(buffer);
190 if (tagsize)
191 {
192 UPDATE_BUFF_SKIP(tagsize)
193 }
194
195 hDecoder = NeAACDecOpen();
196
197 /* Set the default object type and samplerate */
198 /* This is useful for RAW AAC files */
199 config = NeAACDecGetCurrentConfiguration(hDecoder);
200 if (def_srate)
201 config->defSampleRate = def_srate;
202 config->defObjectType = opt->object_type;
203 config->outputFormat = opt->output_format;
204
205 NeAACDecSetConfiguration(hDecoder, config);
206
207 if ((bytesconsumed = NeAACDecInit(hDecoder, buffer, bytes_in_buffer,
208 &samplerate, &channels)) < 0)
209 {
210 /* If some error initializing occured, skip the file */
211 error_handler("Error initializing decoder library.\n");
212 END_BUFF
213 NeAACDecClose(hDecoder);
214 fclose(infile);
215 return 1;
216 }
217 buffer_index += bytesconsumed;
218
219 do
220 {
221 /* update buffer */
222 UPDATE_BUFF_READ
223
224 sample_buffer = NeAACDecDecode(hDecoder, &frameInfo, buffer, bytes_in_buffer);
225
226 /* update buffer indices */
227 UPDATE_BUFF_IDX(frameInfo)
228
229 if (frameInfo.error > 0)
230 {
231 error_handler("Error: %s\n",
232 NeAACDecGetErrorMessage(frameInfo.error));
233 }
234
235 opt->progress_update((long)fileread, buffer_index);
236
237 /* open the sound file now that the number of channels are known */
238 if (first_time && !frameInfo.error)
239 {
240 if(opt->decode_mode == 0)
241 {
242 if (Set_WIN_Params (INVALID_FILEDESC, samplerate, SAMPLE_SIZE,
243 frameInfo.channels) < 0)
244 {
245 error_handler("\nCan't access %s\n", "WAVE OUT");
246 END_BUFF
247 NeAACDecClose(hDecoder);
248 fclose(infile);
249 return (0);
250 }
251 }
252 else
253 {
254 aufile = open_audio_file(sndfile, samplerate, frameInfo.channels,
255 opt->output_format, opt->file_type, aacChannelConfig2wavexChannelMask(&frameInfo));
256
257 if (aufile == NULL)
258 {
259 END_BUFF
260 NeAACDecClose(hDecoder);
261 fclose(infile);
262 return 0;
263 }
264 }
265 first_time = 0;
266 }
267
268 if ((frameInfo.error == 0) && (frameInfo.samples > 0))
269 {
270 if(opt->decode_mode == 0)
271 WIN_Play_Samples((short*)sample_buffer, frameInfo.channels*frameInfo.samples);
272 else
273 write_audio_file(aufile, sample_buffer, frameInfo.samples, 0);
274 }
275
276 if (buffer_index >= fileread)
277 sample_buffer = NULL; /* to make sure it stops now */
278
279 if(stop_decoding)
280 break;
281
282 } while (sample_buffer != NULL);
283
284 NeAACDecClose(hDecoder);
285
286 fclose(infile);
287
288 if(opt->decode_mode == 0)
289 WIN_Audio_close();
290 else
291 {
292 if (!first_time)
293 close_audio_file(aufile);
294 }
295
296 END_BUFF
297
298 return frameInfo.error;
299 }
300
301 int GetAACTrack(mp4ff_t *infile)
302 {
303 /* find AAC track */
304 int i, rc;
305 int numTracks = mp4ff_total_tracks(infile);
306
307 for (i = 0; i < numTracks; i++)
308 {
309 unsigned char *buff = NULL;
310 int buff_size = 0;
311 mp4AudioSpecificConfig mp4ASC;
312
313 mp4ff_get_decoder_config(infile, i, &buff, &buff_size);
314
315 if (buff)
316 {
317 rc = NeAACDecAudioSpecificConfig(buff, buff_size, &mp4ASC);
318 free(buff);
319
320 if (rc < 0)
321 continue;
322 return i;
323 }
324 }
325
326 /* can't decode this */
327 return -1;
328 }
329
330 unsigned long srates[] =
331 {
332 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000,
333 12000, 11025, 8000
334 };
335
336 uint32_t read_callback(void *user_data, void *buffer, uint32_t length)
337 {
338 return fread(buffer, 1, length, (FILE*)user_data);
339 }
340
341 uint32_t seek_callback(void *user_data, uint64_t position)
342 {
343 return fseek((FILE*)user_data, position, SEEK_SET);
344 }
345
346 int decodeMP4file(char *sndfile, aac_dec_opt *opt)
347 {
348 int track;
349 unsigned long samplerate;
350 unsigned char channels;
351 void *sample_buffer;
352
353 mp4ff_t *infile;
354 FILE *mp4File;
355 int sampleId, numSamples;
356
357 audio_file *aufile;
358
359 NeAACDecHandle hDecoder;
360 NeAACDecFrameInfo frameInfo;
361
362 unsigned char *buffer;
363 int buffer_size;
364
365 int first_time = 1;
366
367 /* initialise the callback structure */
368 mp4ff_callback_t *mp4cb = malloc(sizeof(mp4ff_callback_t));
369
370 mp4File = fopen(opt->filename, "rb");
371 mp4cb->read = read_callback;
372 mp4cb->seek = seek_callback;
373 mp4cb->user_data = mp4File;
374
375 infile = mp4ff_open_read(mp4cb);
376 if (!infile)
377 {
378 /* unable to open file */
379 error_handler("Error opening file: %s\n", opt->filename);
380 return 1;
381 }
382
383 if ((track = GetAACTrack(infile)) < 0)
384 {
385 error_handler("Unable to find correct AAC sound track in the MP4 file.\n");
386 mp4ff_close(infile);
387 free(mp4cb);
388 fclose(mp4File);
389 return 1;
390 }
391
392 buffer = NULL;
393 buffer_size = 0;
394 mp4ff_get_decoder_config(infile, track, &buffer, &buffer_size);
395
396 hDecoder = NeAACDecOpen();
397
398 if(NeAACDecInit2(hDecoder, buffer, buffer_size, &samplerate, &channels) < 0)
399 {
400 /* If some error initializing occured, skip the file */
401 error_handler("Error initializing decoder library.\n");
402 NeAACDecClose(hDecoder);
403 mp4ff_close(infile);
404 free(mp4cb);
405 fclose(mp4File);
406 return 1;
407 }
408 if (buffer)
409 free(buffer);
410
411 numSamples = mp4ff_num_samples(infile, track);
412
413 for (sampleId = 0; sampleId < numSamples; sampleId++)
414 {
415 int rc;
416
417 /* get access unit from MP4 file */
418 buffer = NULL;
419 buffer_size = 0;
420
421 rc = mp4ff_read_sample(infile, track, sampleId, &buffer, &buffer_size);
422 if (rc == 0)
423 {
424 error_handler("Reading from MP4 file failed.\n");
425 NeAACDecClose(hDecoder);
426 mp4ff_close(infile);
427 free(mp4cb);
428 fclose(mp4File);
429 return 1;
430 }
431
432 sample_buffer = NeAACDecDecode(hDecoder, &frameInfo, buffer, buffer_size);
433
434 if (buffer)
435 free(buffer);
436
437 opt->progress_update((long)numSamples, sampleId);
438
439 /* open the sound file now that the number of channels are known */
440 if (first_time && !frameInfo.error)
441 {
442 if(opt->decode_mode == 0)
443 {
444 if (Set_WIN_Params (INVALID_FILEDESC, samplerate, SAMPLE_SIZE,
445 frameInfo.channels) < 0)
446 {
447 error_handler("\nCan't access %s\n", "WAVE OUT");
448 NeAACDecClose(hDecoder);
449 mp4ff_close(infile);
450 free(mp4cb);
451 fclose(mp4File);
452 return (0);
453 }
454 }
455 else
456 {
457 aufile = open_audio_file(sndfile, samplerate, frameInfo.channels,
458 opt->output_format, opt->file_type, aacChannelConfig2wavexChannelMask(&frameInfo));
459
460 if (aufile == NULL)
461 {
462 NeAACDecClose(hDecoder);
463 mp4ff_close(infile);
464 free(mp4cb);
465 fclose(mp4File);
466 return 0;
467 }
468 }
469 first_time = 0;
470 }
471
472 if ((frameInfo.error == 0) && (frameInfo.samples > 0))
473 {
474 if(opt->decode_mode == 0)
475 WIN_Play_Samples((short*)sample_buffer, frameInfo.channels*frameInfo.samples);
476 else
477 write_audio_file(aufile, sample_buffer, frameInfo.samples, 0);
478 }
479
480 if (frameInfo.error > 0)
481 {
482 error_handler("Error: %s\n",
483 NeAACDecGetErrorMessage(frameInfo.error));
484 break;
485 }
486 if(stop_decoding)
487 break;
488 }
489
490
491 NeAACDecClose(hDecoder);
492
493
494 mp4ff_close(infile);
495 free(mp4cb);
496 fclose(mp4File);
497
498 if(opt->decode_mode == 0)
499 WIN_Audio_close();
500 else
501 {
502 if (!first_time)
503 close_audio_file(aufile);
504 }
505
506 return frameInfo.error;
507 }
508
509 int str_no_case_comp(char const *str1, char const *str2, unsigned long len)
510 {
511 signed int c1 = 0, c2 = 0;
512
513 while (len--)
514 {
515 c1 = tolower(*str1++);
516 c2 = tolower(*str2++);
517
518 if (c1 == 0 || c1 != c2)
519 break;
520 }
521
522 return c1 - c2;
523 }
524
525 int aac_decode(aac_dec_opt *opt)
526 {
527 int result;
528 int def_srate = 0;
529 int outfile_set = 0;
530 int mp4file = 0;
531 char *fnp;
532 char audioFileName[MAX_PATH];
533 unsigned char header[8];
534 FILE *hMP4File;
535
536
537 /* point to the specified file name */
538 strcpy(audioFileName, opt->filename);
539 fnp = (char *)strrchr(audioFileName,'.');
540 if (fnp)
541 fnp[0] = '\0';
542 strcat(audioFileName, file_ext[opt->file_type]);
543
544 mp4file = 0;
545 hMP4File = fopen(opt->filename, "rb");
546 if (!hMP4File)
547 {
548 return 1;
549 }
550 fread(header, 1, 8, hMP4File);
551 fclose(hMP4File);
552 if (header[4] == 'f' && header[5] == 't' && header[6] == 'y' && header[7] == 'p')
553 mp4file = 1;
554
555 if (mp4file)
556 {
557 result = decodeMP4file(audioFileName, opt);
558 }
559 else
560 {
561 result = decodeAACfile(audioFileName, def_srate, opt);
562 }
563
564 return 0;
565 }
0 /*
1 * function: Header file for aacDECdrop
2 *
3 * This program is distributed under the GNU General Public License, version 2.
4 * A copy of this license is included with this source.
5 *
6 * Copyright (C) 2002 John Edwards
7 */
8
9 #ifndef __DECODE_H__
10 #define __DECODE_H__
11
12 #include <stdio.h>
13
14 typedef void (*progress_func)(long totalsamples, long samples);
15 typedef void (*error_func)(char *errormessage);
16
17 typedef struct
18 {
19 progress_func progress_update;
20 error_func error;
21 int decode_mode;
22 int output_format;
23 int file_type;
24 int object_type;
25 char *filename;
26 } aac_dec_opt;
27
28
29 int aac_decode(aac_dec_opt *opt);
30
31 /*
32 * Put this here for convenience
33 */
34
35 typedef struct {
36 char TitleFormat[32];
37 int window_x;
38 int window_y;
39 int always_on_top;
40 int logerr;
41 int decode_mode;
42 int outputFormat;
43 int fileType;
44 int object_type;
45 } SettingsAAC;
46
47 /*
48 * GLOBALS
49 */
50
51 extern SettingsAAC iniSettings;
52
53
54 #endif /* __DECODE_H__ */
0 /*
1 * function: Decoding thread for aacDECdrop
2 *
3 * This program is distributed under the GNU General Public License, version 2.
4 * A copy of this license is included with this source.
5 *
6 * Copyright (C) 2002 John Edwards
7 *
8 * last mod: aacDecdrop decoder last updated 2002-03-14
9 */
10
11 #include <windows.h>
12 #include <time.h>
13 #include <string.h>
14
15 #include "wave_out.h"
16 #include "decode.h"
17 #include "misc.h"
18
19 extern int decoding_done;
20 extern int animate;
21 extern double file_complete;
22 extern int totalfiles;
23 extern int numfiles;
24 int dec_mode;
25 int outputFormat;
26 int fileType;
27 int object_type;
28 extern char* fileName;
29 int stop_decoding;
30
31 typedef struct enclist_tag {
32 char *filename;
33 struct enclist_tag *next;
34 } enclist_t;
35
36 enclist_t *head = NULL;
37
38 CRITICAL_SECTION mutex;
39
40 DWORD WINAPI decode_thread(LPVOID arg);
41
42 void decthread_init(void)
43 {
44 int thread_id;
45 HANDLE thand;
46
47 numfiles = 0;
48 totalfiles = 0;
49 file_complete = 0.0;
50
51 InitializeCriticalSection(&mutex);
52
53 thand = CreateThread(NULL, 0, decode_thread, NULL, 0, &thread_id);
54 if (thand == NULL) {
55 // something bad happened, might want to deal with that, maybe...
56 }
57 }
58
59 void decthread_addfile(char *file)
60 {
61 char *filename;
62 enclist_t *entry, *node;
63
64 if (file == NULL) return;
65
66 // create entry
67 filename = strdup(file);
68 entry = (enclist_t *)malloc(sizeof(enclist_t));
69
70 entry->filename = filename;
71 entry->next = NULL;
72
73 EnterCriticalSection(&mutex);
74
75 // insert entry
76 if (head == NULL) {
77 head = entry;
78 } else {
79 node = head;
80 while (node->next != NULL)
81 node = node->next;
82
83 node->next = entry;
84 }
85 numfiles++;
86 totalfiles++;
87
88 LeaveCriticalSection(&mutex);
89 }
90
91 /*
92 * the caller is responsible for deleting the pointer
93 */
94
95 char *_getfile()
96 {
97 char *filename;
98 enclist_t *entry;
99
100 EnterCriticalSection(&mutex);
101
102 if (head == NULL) {
103 LeaveCriticalSection(&mutex);
104 return NULL;
105 }
106
107 // pop entry
108 entry = head;
109 head = head->next;
110
111 filename = entry->filename;
112 free(entry);
113
114 LeaveCriticalSection(&mutex);
115
116 return filename;
117 }
118
119 void decthread_set_decode_mode(int decode_mode)
120 {
121 dec_mode = decode_mode;
122 }
123
124 void decthread_set_outputFormat(int output_format)
125 {
126 outputFormat = output_format;
127 }
128
129 void decthread_set_fileType(int file_type)
130 {
131 fileType = file_type;
132 }
133
134 void decthread_set_object_type(int object_type)
135 {
136 object_type = object_type;
137 }
138
139 void _error(char *errormessage)
140 {
141 // do nothing
142 }
143
144 void _update(long total, long done)
145 {
146 file_complete = (double)done / (double)total;
147 }
148
149 DWORD WINAPI decode_thread(LPVOID arg)
150 {
151 char *in_file;
152
153 while (!decoding_done)
154 {
155 while (in_file = _getfile())
156 {
157 aac_dec_opt dec_opts;
158 animate = 1;
159
160 if(stop_decoding){
161 numfiles--;
162 break;
163 }
164 set_filename(in_file);
165
166 dec_opts.progress_update = _update;
167 dec_opts.filename = in_file;
168 dec_opts.decode_mode = dec_mode;
169 dec_opts.output_format = outputFormat;
170 dec_opts.file_type = fileType;
171 dec_opts.object_type = object_type;
172 fileName = in_file;
173
174 aac_decode(&dec_opts);
175
176 numfiles--;
177 } /* Finished this file, loop around to next... */
178
179 file_complete = 0.0;
180 animate = 0;
181 totalfiles = 0;
182 numfiles = 0;
183
184 Sleep(500);
185 }
186
187 DeleteCriticalSection(&mutex);
188
189 return 0;
190 }
191
192 /******************************** end of decthread.c ********************************/
193
0 /*
1 * function: Header file for decthread.c
2 *
3 * This program is distributed under the GNU General Public License, version 2.
4 * A copy of this license is included with this source.
5 *
6 * Copyright (C) 2002 John Edwards
7 */
8 #ifndef __DECTHREAD_H__
9 #define __DECTHREAD_H__
10
11 void decthread_init(void);
12 void decthread_addfile(char *file);
13 void decthread_set_decode_mode(int decode_mode);
14 void decthread_set_outputFormat(int output_format);
15 void decthread_set_fileType(int file_type);
16 void decthread_set_object_type(int object_type);
17
18 #endif /* __DECTHREAD_H__ */
0 /*
1 * function: Main control program for aacDECdrop
2 *
3 * This program is distributed under the GNU General Public License, version 2.
4 * A copy of this license is included with this source.
5 *
6 * Copyright (C) 2002 John Edwards
7 *
8 * last mod: aacDECdrop decoder last updated 2002-03-14
9 */
10
11 #include <windows.h>
12 #include <shellapi.h>
13 #include <string.h>
14 #include <stdio.h>
15 #include <commctrl.h>
16
17 #include "resource.h"
18 #include "decthread.h"
19 #include "decode.h"
20 #include "misc.h"
21
22 #define LOSHORT(l) ((SHORT)(l))
23 #define HISHORT(l) ((SHORT)(((DWORD)(l) >> 16) & 0xFFFF))
24
25 #define INI_FILE "aacDECdrop.ini"
26
27 #define CREATEFONT(sz) \
28 CreateFont((sz), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
29 VARIABLE_PITCH | FF_SWISS, "")
30
31 HANDLE event = NULL;
32 int width = 130, height = 130;
33 RECT bar1, bar2, vbrBR;
34 int prog1 = 0, prog2 = 0;
35 int moving = 0;
36 POINT pt;
37 HINSTANCE hinst;
38 int frame = 0;
39 HBITMAP hbm[12], temp;
40 HMENU menu;
41 int decoding_done = 0;
42 int stop_decoding = 0;
43 double file_complete;
44 int totalfiles;
45 int numfiles;
46 HWND g_hwnd;
47 HWND qcwnd;
48 HFONT font2;
49 char *fileName;
50
51 SettingsAAC iniSettings; // iniSettings holds the parameters for the aacDECdrop configuration
52
53 int animate = 0;
54
55 LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
56
57 BOOL CALLBACK QCProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) ;
58
59
60 /*
61 * Write the .ini file using the current aacDECdrop settings
62 */
63
64 int
65 WriteIniFile ( const char* Filename )
66 {
67 FILE* fp;
68
69 if ( (fp = fopen (Filename, "w")) == NULL )
70 return EOF; // could not open file
71
72 fprintf (fp, "[aacDECdrop]\n");
73 fprintf (fp, "Window_X=%i\n" , iniSettings.window_x );
74 fprintf (fp, "Window_Y=%i\n" , iniSettings.window_y );
75 fprintf (fp, "Always_on_top=%i\n" , iniSettings.always_on_top);
76 fprintf (fp, "Logerr=%i\n" , iniSettings.logerr );
77 fprintf (fp, "DecodeMode=%i\n" , iniSettings.decode_mode );
78 fprintf (fp, "OutputFormat=%i\n" , iniSettings.outputFormat );
79 fprintf (fp, "FileType=%i\n" , iniSettings.fileType );
80 fprintf (fp, "ObjectType=%i\n" , iniSettings.object_type );
81 return fclose (fp);
82 }
83
84 /*
85 * Read the .ini file and set the aacDECdrop settings
86 */
87
88 int
89 ReadIniFile ( FILE* fp )
90 {
91 char buff [256];
92 int val;
93
94 rewind ( fp );
95 fgets ( buff, sizeof buff, fp );
96
97 if ( 0 != memcmp ( buff, "[aacDECdrop]", 12 ) )
98 return EOF;
99
100 while ( fgets ( buff, sizeof buff, fp ) != NULL ) {
101 if ( 1 == sscanf ( buff, "Window_X=%d" , &val ) ) iniSettings.window_x = val;
102 else if ( 1 == sscanf ( buff, "Window_Y=%d" , &val ) ) iniSettings.window_y = val;
103 else if ( 1 == sscanf ( buff, "Always_on_top=%d", &val ) ) iniSettings.always_on_top = val;
104 else if ( 1 == sscanf ( buff, "Logerr=%d" , &val ) ) iniSettings.logerr = val;
105 else if ( 1 == sscanf ( buff, "DecodeMode=%d" , &val ) ) iniSettings.decode_mode = val;
106 else if ( 1 == sscanf ( buff, "OutputFormat=%d" , &val ) ) iniSettings.outputFormat = val;
107 else if ( 1 == sscanf ( buff, "FileType=%d" , &val ) ) iniSettings.fileType = val;
108 else if ( 1 == sscanf ( buff, "ObjectType=%d" , &val ) ) iniSettings.object_type = val;
109 }
110
111 return 0;
112 }
113
114
115 /*
116 * Get aacDECdrop settings at startup, writes .ini file, if not present
117 */
118
119 void
120 GetAACdecSettings ( void )
121 {
122 FILE* fp = NULL;
123 char PathAndName [] = {INI_FILE};
124
125 // set default values
126 iniSettings.window_x = 64; // default box position (x co-ord)
127 iniSettings.window_y = 64; // default box position (y co-ord)
128 iniSettings.always_on_top = 8; // default = on
129 iniSettings.logerr = 0; // default = off
130 iniSettings.decode_mode = 1; // default = 1 (decode to file)
131 iniSettings.outputFormat = 1; // default = 1 (16 bit PCM)
132 iniSettings.fileType = 1; // default = 1 (Microsoft WAV)
133 iniSettings.object_type = 1; // default = 1 (Low Complexity)
134
135 // Read INI_FILE
136 if ( (fp = fopen (PathAndName, "r")) == NULL ) { // file does not exist: write it!
137 WriteIniFile ( PathAndName );
138 }
139 else { // file does exist: read it!
140 ReadIniFile (fp);
141 fclose (fp);
142 }
143
144 return;
145 }
146
147 void set_always_on_top(HWND hwnd, int v)
148 {
149 CheckMenuItem(menu, IDM_ONTOP, v ? MF_CHECKED : MF_UNCHECKED);
150 SetWindowPos(hwnd, v ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW | SWP_NOMOVE);
151 iniSettings.always_on_top = v;
152 }
153
154 void set_logerr(HWND hwnd, int v)
155 {
156 CheckMenuItem(menu, IDM_LOGERR, v ? MF_CHECKED : MF_UNCHECKED);
157 iniSettings.logerr = v;
158 set_use_dialogs(v);
159 }
160
161 void set_decode_mode(int v)
162 {
163 decthread_set_decode_mode(v);
164 iniSettings.decode_mode = v;
165 }
166
167 void set_outputFormat(int v)
168 {
169 decthread_set_outputFormat(v);
170 iniSettings.outputFormat = v;
171 }
172
173 void set_fileType(int v)
174 {
175 decthread_set_fileType(v);
176 iniSettings.fileType = v;
177 }
178
179 void set_object_type(int v)
180 {
181 decthread_set_object_type(v);
182 iniSettings.object_type = v;
183 }
184
185 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
186 {
187 static char szAppName[] = "aacDECdrop";
188 HWND hwnd;
189 MSG msg;
190 WNDCLASS wndclass;
191 const int width = 130;
192 const int height = 130;
193 int x;
194 int y;
195
196 hinst = hInstance;
197
198 wndclass.style = CS_HREDRAW | CS_VREDRAW;
199 wndclass.lpfnWndProc = WndProc;
200 wndclass.cbClsExtra = 0;
201 wndclass.cbWndExtra = 0;
202 wndclass.hInstance = hInstance;
203 wndclass.hIcon = LoadIcon(hinst, MAKEINTRESOURCE(IDI_ICON1));
204 wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
205 wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
206 wndclass.lpszMenuName = NULL;
207 wndclass.lpszClassName = szAppName;
208
209 RegisterClass(&wndclass);
210
211 GetAACdecSettings();
212
213 x = max(min(iniSettings.window_x, GetSystemMetrics(SM_CXSCREEN) - width), 0);
214 y = max(min(iniSettings.window_y, GetSystemMetrics(SM_CYSCREEN) - height), 0);
215
216 hwnd = CreateWindow(szAppName, "aacDECdrop", WS_POPUP | WS_DLGFRAME, x, y,
217 width, height, NULL, NULL, hInstance, NULL);
218
219 g_hwnd = hwnd;
220
221 ShowWindow(hwnd, iCmdShow);
222 UpdateWindow(hwnd);
223
224 font2 = CREATEFONT(10);
225
226 SetTimer(hwnd, 1, 80, NULL);
227
228 set_always_on_top(hwnd, iniSettings.always_on_top);
229 set_logerr(hwnd, iniSettings.logerr);
230 set_decode_mode(iniSettings.decode_mode);
231 set_outputFormat(iniSettings.outputFormat);
232 set_fileType(iniSettings.fileType);
233 set_object_type(iniSettings.object_type);
234
235 for (frame = 0; frame < 8; frame++)
236 hbm[frame] = LoadImage(hinst, MAKEINTRESOURCE(IDB_TF01 + frame), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
237 frame = 0;
238
239 while (GetMessage(&msg, NULL, 0, 0))
240 {
241 TranslateMessage(&msg);
242 DispatchMessage(&msg);
243 }
244
245 for (frame = 0; frame < 8; frame++)
246 DeleteObject(hbm[frame]);
247
248 return msg.wParam;
249 }
250
251 void HandleDrag(HWND hwnd, HDROP hDrop)
252 {
253 int cFiles, i;
254 char szFile[MAX_PATH];
255 char *ext;
256 int flag = 0;
257
258 cFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);
259 for (i = 0; i < cFiles; i++)
260 {
261 DragQueryFile(hDrop, i, szFile, sizeof(szFile));
262
263 if (ext = strrchr(szFile, '.'))
264 {
265 if (stricmp(ext, ".aac") == 0 || stricmp(ext, ".mp4") == 0 ||
266 stricmp(ext, ".m4a") == 0 || stricmp(ext, ".m4p") == 0)
267 {
268 flag = 1;
269 decthread_addfile(szFile);
270 stop_decoding = 0;
271 }
272 }
273 }
274
275 DragFinish(hDrop);
276
277 if (flag)
278 SetEvent(event);
279 }
280
281 LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
282 {
283 HDC hdc, hmem;
284 static HDC offscreen;
285 PAINTSTRUCT ps;
286 RECT rect, rect2;
287 BITMAP bm;
288 POINT point;
289 static POINT start;
290 static int dragging = 0;
291 HDC desktop;
292 HBITMAP hbitmap;
293 HANDLE hdrop;
294 HFONT dfltFont;
295 int dfltBGMode;
296 double percomp;
297
298 switch (message)
299 {
300 case WM_CREATE:
301 menu = LoadMenu(hinst, MAKEINTRESOURCE(IDR_MENU1));
302 menu = GetSubMenu(menu, 0);
303
304 offscreen = CreateCompatibleDC(NULL);
305 desktop = GetDC(GetDesktopWindow());
306 hbitmap = CreateCompatibleBitmap(desktop, 200, 200);
307 ReleaseDC(GetDesktopWindow(), desktop);
308 SelectObject(offscreen, hbitmap);
309
310 // Start the engines
311 decthread_init();
312
313 // We accept drag&drop
314 DragAcceptFiles(hwnd, TRUE);
315 return 0;
316
317 case WM_PAINT:
318 hdc = BeginPaint(hwnd, &ps);
319 GetClientRect(hwnd, &rect);
320 width = rect.right + 1;
321 height = rect.bottom + 1;
322
323 FillRect(offscreen, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH));
324 DrawText(offscreen, "Drop Files Here", -1, &rect, DT_SINGLELINE | DT_CENTER);
325 SetRect(&rect2, 0, height - 110, width, height - 25);
326 DrawText(offscreen, "For Decoding", -1, &rect2, DT_SINGLELINE | DT_CENTER);
327
328 hmem = CreateCompatibleDC(offscreen);
329 SelectObject(hmem, hbm[frame]);
330 GetObject(hbm[frame], sizeof(BITMAP), &bm);
331 BitBlt(offscreen, width / 2 - 33, height / 2 - 31, bm.bmWidth, bm.bmHeight, hmem, 0, 0, SRCCOPY);
332 DeleteDC(hmem);
333
334 percomp = ((double)(totalfiles - numfiles) + 1 - (1 - file_complete)) / (double)totalfiles;
335
336 SetRect(&vbrBR, 0, height - 35, width, height - 19);
337
338 dfltBGMode = SetBkMode(offscreen, TRANSPARENT);
339 dfltFont = SelectObject(offscreen, font2);
340
341 SetRect(&bar1, 0, height - 23, (int)(file_complete * width), height - 13);
342 SetRect(&bar2, 0, height - 12, (int)(percomp * width), height - 2);
343
344 FillRect(offscreen, &bar1, (HBRUSH)GetStockObject(LTGRAY_BRUSH));
345 FillRect(offscreen, &bar2, (HBRUSH)GetStockObject(DKGRAY_BRUSH));
346
347 if (fileName)
348 {
349 char* sep;
350 char fileCaption[80];
351
352 if ((sep = strrchr(fileName, '\\')) != 0)
353 fileName = sep+1;
354
355 (void) strcpy(fileCaption, " ");
356 (void) strcat(fileCaption, fileName);
357
358 DrawText(offscreen, fileCaption, -1, &bar1, DT_SINGLELINE | DT_LEFT);
359 }
360
361 SelectObject(offscreen, dfltFont);
362 SetBkMode(offscreen, dfltBGMode);
363
364 BitBlt(hdc, 0, 0, width, height, offscreen, 0, 0, SRCCOPY);
365
366 EndPaint(hwnd, &ps);
367
368 return DefWindowProc(hwnd, message, wParam, lParam);
369 //return 0;
370
371 case WM_TIMER:
372 if (animate || frame)
373 {
374 frame++;
375 if (frame > 7)
376 frame -= 8;
377 }
378 else
379 {
380 frame = 0;
381 }
382 GetClientRect(hwnd, &rect);
383 InvalidateRect(hwnd, &rect, FALSE);
384 return 0;
385
386 case WM_LBUTTONDOWN:
387 start.x = LOWORD(lParam);
388 start.y = HIWORD(lParam);
389 ClientToScreen(hwnd, &start);
390 GetWindowRect(hwnd, &rect);
391 start.x -= rect.left;
392 start.y -= rect.top;
393 dragging = 1;
394 SetCapture(hwnd);
395 return 0;
396
397 case WM_LBUTTONUP:
398 if (dragging)
399 {
400 dragging = 0;
401 ReleaseCapture();
402 }
403 return 0;
404
405 case WM_MOUSEMOVE:
406 if (dragging)
407 {
408 point.x = LOSHORT(lParam);
409 point.y = HISHORT(lParam);
410
411 /* lParam can contain negative coordinates !
412 * point.x = LOWORD(lParam);
413 * point.y = HIWORD(lParam);
414 */
415
416 ClientToScreen(hwnd, &point);
417 SetWindowPos(hwnd, 0, point.x - start.x, point.y - start.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW);
418 iniSettings.window_x = point.x - start.x;
419 iniSettings.window_y = point.y - start.y;
420 }
421 return 0;
422
423 case WM_CAPTURECHANGED:
424 if (dragging)
425 {
426 dragging = 0;
427 ReleaseCapture();
428 }
429 return 0;
430
431 case WM_RBUTTONUP:
432 point.x = LOWORD(lParam);
433 point.y = HIWORD(lParam);
434 ClientToScreen(hwnd, &point);
435 TrackPopupMenu(menu, TPM_RIGHTBUTTON, point.x, point.y, 0, hwnd, NULL);
436 return 0;
437
438 case WM_COMMAND:
439 switch (LOWORD(wParam))
440 {
441 case IDM_QUIT:
442 WriteIniFile(INI_FILE);
443 decoding_done = 1;
444 PostQuitMessage(0);
445 break;
446 case IDM_ONTOP:
447 set_always_on_top(hwnd, ~GetMenuState(menu, LOWORD(wParam), MF_BYCOMMAND) & MF_CHECKED);
448 break;
449 case IDM_LOGERR:
450 set_logerr(hwnd, ~GetMenuState(menu, LOWORD(wParam), MF_BYCOMMAND) & MF_CHECKED);
451 break;
452 case IDM_STOP_DEC:
453 {
454 int v = ~GetMenuState(menu, LOWORD(wParam), MF_BYCOMMAND) & MF_CHECKED;
455 if(v == 8)
456 stop_decoding = 1;
457 break;
458 }
459 case IDM_VOLUME:
460 {
461 int value =
462 DialogBox(
463 hinst,
464 MAKEINTRESOURCE(IDD_VOLUME),
465 hwnd, QCProc);
466
467 if (value == -2)
468 break;
469 break;
470 }
471 case IDM_ABOUT:
472 {
473 int value = DialogBox(hinst, MAKEINTRESOURCE(IDD_ABOUT), hwnd, QCProc);
474 if (value == -7)
475 break;
476 break;
477 }
478
479 } // LOWORD(wParam)
480 return 0;
481
482 case WM_DROPFILES:
483 hdrop = (HANDLE)wParam;
484 HandleDrag(hwnd, hdrop);
485 return 0;
486
487 case WM_DESTROY:
488 decoding_done = 1;
489 PostQuitMessage(0);
490 return 0;
491 }
492
493 return DefWindowProc(hwnd, message, wParam, lParam);
494 }
495
496 /*
497 * Encode parameters dialog procedures.
498 */
499
500 BOOL CALLBACK QCProc(HWND hwndDlg, UINT message,
501 WPARAM wParam, LPARAM lParam)
502 {
503 switch (message)
504 {
505 case WM_INITDIALOG:
506
507 if(iniSettings.decode_mode == 0)
508 {
509 CheckDlgButton(hwndDlg,IDC_PLAYBACK,TRUE);
510 CheckDlgButton(hwndDlg,IDC_WAV,TRUE);
511 if(iniSettings.outputFormat != 1
512 && iniSettings.outputFormat != 5
513 && iniSettings.outputFormat != 6
514 && iniSettings.outputFormat != 7
515 && iniSettings.outputFormat != 8)
516 CheckDlgButton(hwndDlg,IDC_16BIT,TRUE);
517 else if(iniSettings.outputFormat == 1)
518 CheckDlgButton(hwndDlg,IDC_16BIT,TRUE);
519 else if(iniSettings.outputFormat == 5)
520 CheckDlgButton(hwndDlg,IDC_16BIT_DITHER,TRUE);
521 else if(iniSettings.outputFormat == 6)
522 CheckDlgButton(hwndDlg,IDC_16BIT_L_SHAPE,TRUE);
523 else if(iniSettings.outputFormat == 7)
524 CheckDlgButton(hwndDlg,IDC_16BIT_M_SHAPE,TRUE);
525 else if(iniSettings.outputFormat == 8)
526 CheckDlgButton(hwndDlg,IDC_16BIT_H_SHAPE,TRUE);
527 CheckDlgButton(hwndDlg,IDC_WAV,TRUE);
528 EnableWindow(GetDlgItem(hwndDlg, IDC_AIFF), FALSE);
529 EnableWindow(GetDlgItem(hwndDlg, IDC_SUNAU), FALSE);
530 EnableWindow(GetDlgItem(hwndDlg, IDC_DECAU), FALSE);
531 EnableWindow(GetDlgItem(hwndDlg, IDC_24BIT), FALSE);
532 EnableWindow(GetDlgItem(hwndDlg, IDC_32BIT), FALSE);
533 EnableWindow(GetDlgItem(hwndDlg, IDC_FLOATS), FALSE);
534 EnableWindow(GetDlgItem(hwndDlg, IDC_16BIT), TRUE);
535 EnableWindow(GetDlgItem(hwndDlg, IDC_16BIT_DITHER), TRUE);
536 }
537 else if(iniSettings.decode_mode == 1)
538 {
539 CheckDlgButton(hwndDlg,IDC_PLAYBACK,FALSE);
540 if(iniSettings.outputFormat == 1)
541 CheckDlgButton(hwndDlg,IDC_16BIT,TRUE);
542 else if(iniSettings.outputFormat == 2)
543 CheckDlgButton(hwndDlg,IDC_24BIT,TRUE);
544 else if(iniSettings.outputFormat == 3)
545 CheckDlgButton(hwndDlg,IDC_32BIT,TRUE);
546 else if(iniSettings.outputFormat == 4)
547 CheckDlgButton(hwndDlg,IDC_FLOATS,TRUE);
548 else if(iniSettings.outputFormat == 5)
549 CheckDlgButton(hwndDlg,IDC_16BIT_DITHER,TRUE);
550 else if(iniSettings.outputFormat == 6)
551 CheckDlgButton(hwndDlg,IDC_16BIT_L_SHAPE,TRUE);
552 else if(iniSettings.outputFormat == 7)
553 CheckDlgButton(hwndDlg,IDC_16BIT_M_SHAPE,TRUE);
554 else if(iniSettings.outputFormat == 8)
555 CheckDlgButton(hwndDlg,IDC_16BIT_H_SHAPE,TRUE);
556
557 if(iniSettings.fileType == 1)
558 CheckDlgButton(hwndDlg,IDC_WAV,TRUE);
559 else if(iniSettings.fileType == 2)
560 CheckDlgButton(hwndDlg,IDC_AIFF,TRUE);
561 else if(iniSettings.fileType == 3)
562 CheckDlgButton(hwndDlg,IDC_SUNAU,TRUE);
563 else if(iniSettings.fileType == 4)
564 CheckDlgButton(hwndDlg,IDC_DECAU,TRUE);
565 }
566
567 if(iniSettings.object_type == 0)
568 CheckDlgButton(hwndDlg,IDC_MAIN,TRUE);
569 else if(iniSettings.object_type == 1)
570 CheckDlgButton(hwndDlg,IDC_LC,TRUE);
571 else if(iniSettings.object_type == 3)
572 CheckDlgButton(hwndDlg,IDC_LTP,TRUE);
573 else if(iniSettings.object_type == 23)
574 CheckDlgButton(hwndDlg,IDC_LD,TRUE);
575 break;
576
577 case WM_CLOSE:
578 EndDialog(hwndDlg, -1);
579 break;
580
581 case WM_COMMAND:
582 switch (LOWORD(wParam))
583 {
584 case IDC_BUTTON1:
585 {
586 if (IsDlgButtonChecked(hwndDlg, IDC_PLAYBACK) == BST_CHECKED)
587 set_decode_mode(0); // Playback
588 else if (IsDlgButtonChecked(hwndDlg, IDC_DECODE) == BST_CHECKED)
589 set_decode_mode(1); // Decode to File
590
591 if (IsDlgButtonChecked(hwndDlg, IDC_WAV) == BST_CHECKED)
592 set_fileType(1); // Microsoft WAV
593 else if (IsDlgButtonChecked(hwndDlg, IDC_AIFF) == BST_CHECKED)
594 set_fileType(2); // Apple/SGI AIFF
595 else if (IsDlgButtonChecked(hwndDlg, IDC_SUNAU) == BST_CHECKED)
596 set_fileType(3); // Sun/NeXT AU
597 else if (IsDlgButtonChecked(hwndDlg, IDC_DECAU) == BST_CHECKED)
598 set_fileType(4); // DEC AU
599
600 if (IsDlgButtonChecked(hwndDlg, IDC_16BIT) == BST_CHECKED)
601 set_outputFormat(1); // 16 bit PCM
602 else if (IsDlgButtonChecked(hwndDlg, IDC_24BIT) == BST_CHECKED)
603 set_outputFormat(2); // 24 bit PCM
604 else if (IsDlgButtonChecked(hwndDlg, IDC_32BIT) == BST_CHECKED)
605 set_outputFormat(3); // 32 bit PCM
606 else if (IsDlgButtonChecked(hwndDlg, IDC_FLOATS) == BST_CHECKED)
607 set_outputFormat(4); // 32 bit floats
608 else if (IsDlgButtonChecked(hwndDlg, IDC_16BIT_DITHER) == BST_CHECKED)
609 set_outputFormat(5); // 16 bit PCM dithered
610 else if (IsDlgButtonChecked(hwndDlg, IDC_16BIT_L_SHAPE) == BST_CHECKED)
611 set_outputFormat(6); // dithered LIGHT noise shaping
612 else if (IsDlgButtonChecked(hwndDlg, IDC_16BIT_M_SHAPE) == BST_CHECKED)
613 set_outputFormat(7); // dithered MEDIUM noise shaping
614 else if (IsDlgButtonChecked(hwndDlg, IDC_16BIT_H_SHAPE) == BST_CHECKED)
615 set_outputFormat(8); // dithered HEAVY noise shaping
616
617 if (IsDlgButtonChecked(hwndDlg, IDC_MAIN) == BST_CHECKED)
618 set_object_type(0); // Main
619 else if (IsDlgButtonChecked(hwndDlg, IDC_LC) == BST_CHECKED)
620 set_object_type(1); // Low Complexity
621 else if (IsDlgButtonChecked(hwndDlg, IDC_LTP) == BST_CHECKED)
622 set_object_type(3); // Long Term Prediction
623 else if (IsDlgButtonChecked(hwndDlg, IDC_LD) == BST_CHECKED)
624 set_object_type(23); // Low Delay
625
626 EndDialog(hwndDlg, -2);
627 return TRUE;
628 }
629 case IDC_BUTTON6:
630 EndDialog(hwndDlg, -7);
631 return TRUE;
632
633 case IDC_PLAYBACK:
634 CheckDlgButton(hwndDlg,IDC_WAV,TRUE);
635 EnableWindow(GetDlgItem(hwndDlg, IDC_AIFF), FALSE);
636 EnableWindow(GetDlgItem(hwndDlg, IDC_SUNAU), FALSE);
637 EnableWindow(GetDlgItem(hwndDlg, IDC_DECAU), FALSE);
638 EnableWindow(GetDlgItem(hwndDlg, IDC_24BIT), FALSE);
639 CheckDlgButton(hwndDlg,IDC_24BIT,FALSE);
640 EnableWindow(GetDlgItem(hwndDlg, IDC_32BIT), FALSE);
641 CheckDlgButton(hwndDlg,IDC_32BIT,FALSE);
642 EnableWindow(GetDlgItem(hwndDlg, IDC_FLOATS), FALSE);
643 CheckDlgButton(hwndDlg,IDC_FLOATS,FALSE);
644 EnableWindow(GetDlgItem(hwndDlg, IDC_16BIT), TRUE);
645 EnableWindow(GetDlgItem(hwndDlg, IDC_16BIT_DITHER), TRUE);
646 EnableWindow(GetDlgItem(hwndDlg, IDC_16BIT_L_SHAPE), TRUE);
647 EnableWindow(GetDlgItem(hwndDlg, IDC_16BIT_M_SHAPE), TRUE);
648 EnableWindow(GetDlgItem(hwndDlg, IDC_16BIT_H_SHAPE), TRUE);
649 if (IsDlgButtonChecked(hwndDlg, IDC_16BIT_DITHER) != BST_CHECKED
650 && IsDlgButtonChecked(hwndDlg, IDC_16BIT_L_SHAPE) != BST_CHECKED
651 && IsDlgButtonChecked(hwndDlg, IDC_16BIT_M_SHAPE) != BST_CHECKED
652 && IsDlgButtonChecked(hwndDlg, IDC_16BIT_H_SHAPE) != BST_CHECKED)
653 CheckDlgButton(hwndDlg,IDC_16BIT,TRUE);
654 break;
655 case IDC_DECODE:
656 EnableWindow(GetDlgItem(hwndDlg, IDC_AIFF), FALSE);
657 EnableWindow(GetDlgItem(hwndDlg, IDC_SUNAU), FALSE);
658 EnableWindow(GetDlgItem(hwndDlg, IDC_DECAU), FALSE);
659 EnableWindow(GetDlgItem(hwndDlg, IDC_24BIT), TRUE);
660 EnableWindow(GetDlgItem(hwndDlg, IDC_32BIT), TRUE);
661 EnableWindow(GetDlgItem(hwndDlg, IDC_FLOATS), TRUE);
662 EnableWindow(GetDlgItem(hwndDlg, IDC_16BIT), TRUE);
663 EnableWindow(GetDlgItem(hwndDlg, IDC_16BIT_DITHER), TRUE);
664 EnableWindow(GetDlgItem(hwndDlg, IDC_16BIT_L_SHAPE), TRUE);
665 EnableWindow(GetDlgItem(hwndDlg, IDC_16BIT_M_SHAPE), TRUE);
666 EnableWindow(GetDlgItem(hwndDlg, IDC_16BIT_H_SHAPE), TRUE);
667 break;
668 default:
669 break;
670 }
671 }
672 return FALSE;
673 }
674
675
676 /******************************** end of main.c ********************************/
677
0 /*
1 * function: Miscellaneous functions for aacDECdrop
2 *
3 * This program is distributed under the GNU General Public License, version 2.
4 * A copy of this license is included with this source.
5 *
6 * Copyright (C) 2002 John Edwards
7 */
8
9 #include <stdlib.h>
10 #include <stdio.h>
11 #include <string.h>
12 #include <windows.h>
13 #include "misc.h"
14
15 static char *_filename;
16 void (*error_handler)(const char *fmt, ...) = error_dialog;
17
18 /*
19 * Set the current input file name.
20 */
21
22 void set_filename(char *filename)
23 {
24 _filename = filename;
25 }
26
27 /*
28 * Display an error dialog, possibly adding system error information.
29 */
30
31 void error_dialog(const char *fmt, ...)
32 {
33 va_list ap;
34 char msgbuf[1024];
35 char *bufp = msgbuf;
36
37 /* A really rough sanity check to protect against blatant buffer overrun */
38 if (strlen(fmt) > 750)
39 {
40 sprintf(msgbuf, "%s %s", "<buffer overflow> ", fmt);
41 }
42 else
43 {
44 if (_filename != NULL && strlen(_filename) < 255)
45 {
46 sprintf(msgbuf, "%s: ", _filename);
47 bufp += strlen(msgbuf);
48 }
49
50 va_start(ap, fmt);
51
52 vsprintf(bufp, fmt, ap);
53
54 va_end(ap);
55
56 if (errno != 0)
57 {
58 bufp = msgbuf + strlen(msgbuf);
59 sprintf(bufp, " error is %s (%d)", strerror(errno), errno);
60 errno = 0;
61 }
62 }
63
64 MessageBox(NULL, msgbuf, "Error", 0);
65 }
66
67 void log_error(const char *fmt, ...)
68 {
69 va_list ap;
70 FILE *fp;
71 char msgbuf[1024];
72 char *bufp = msgbuf;
73
74 /* A really rough sanity check to protect against blatant buffer overrun */
75 if (strlen(fmt) > 750)
76 {
77 sprintf(msgbuf, "%s %s", "<buffer overflow> ", fmt);
78 }
79 else
80 {
81 if (_filename != NULL && strlen(_filename) < 255)
82 {
83 sprintf(msgbuf, "%s : ", _filename);
84 bufp += strlen(msgbuf);
85 }
86
87 va_start(ap, fmt);
88
89 vsprintf(bufp, fmt, ap);
90
91 va_end(ap);
92
93 if (errno != 0)
94 {
95 bufp = msgbuf + strlen(msgbuf);
96 sprintf(bufp, " error is: %s (%d)", strerror(errno), errno);
97 errno = 0;
98 }
99 }
100
101 va_start(ap, fmt);
102
103 if ((fp = fopen("oggdrop.log", "a")) == (FILE *)NULL)
104 return;
105
106 fprintf(fp, "%s\n", msgbuf);
107 fflush(fp);
108 fclose(fp);
109
110 va_end(ap);
111 }
112
113 void set_use_dialogs(int use_dialogs)
114 {
115 if (!use_dialogs)
116 error_handler = error_dialog;
117 else
118 error_handler = log_error;
119 }
120
121
122 /******************************** end of misc.c ********************************/
123
0 /*
1 * function: Header file for misc.c
2 *
3 * This program is distributed under the GNU General Public License, version 2.
4 * A copy of this license is included with this source.
5 *
6 * Copyright (C) 2002 John Edwards
7 */
8
9 #ifndef __MISC_H__
10 #define __MISC_H__
11
12 #include "decode.h"
13 #include <stdio.h>
14
15 void set_filename(char *filename);
16
17 extern void error_dialog(const char *fmt, ...);
18 extern void log_error(const char *fmt, ...);
19 extern void set_use_dialogs(int use_dialogs);
20 extern void (*error_handler)(const char *fmt, ...);
21
22
23 #endif /* __MISC_H__ */
24
0 //{{NO_DEPENDENCIES}}
1 // Microsoft Visual C++ generated include file.
2 // Used by Script.rc
3 //
4 #define IDD_VOLUME 101
5 #define IDD_ABOUT 102
6 #define IDB_TF01 112
7 #define IDB_TF02 113
8 #define IDB_TF03 114
9 #define IDB_TF04 115
10 #define IDB_TF05 116
11 #define IDB_TF06 117
12 #define IDB_TF07 118
13 #define IDB_TF08 119
14 #define IDR_MENU1 124
15 #define IDI_ICON1 130
16 #define IDC_BUTTON1 1001
17 #define IDC_PLAYBACK 1005
18 #define IDC_DECODE 1008
19 #define IDC_WAV 1014
20 #define IDC_AIFF 1015
21 #define IDC_SUNAU 1016
22 #define IDC_DECAU 1017
23 #define IDC_16BIT 1018
24 #define IDC_24BIT 1020
25 #define IDC_32BIT 1021
26 #define IDC_FLOATS 1022
27 #define IDC_MAIN 1023
28 #define IDC_LC 1024
29 #define IDC_LTP 1025
30 #define IDC_LD 1026
31 #define IDC_16BIT_DITHER 1027
32 #define IDC_16BIT_L_SHAPE 1028
33 #define IDC_16BIT_M_SHAPE 1029
34 #define IDC_16BIT_H_SHAPE 1030
35 #define IDC_BUTTON6 1033
36 #define IDM_VOLUME 40005
37 #define IDM_STOP_DEC 40006
38 #define IDM_ABOUT 40007
39 #define IDM_LOGERR 40008
40 #define IDM_ONTOP 40015
41 #define IDM_QUIT 40019
42
43 // Next default values for new objects
44 //
45 #ifdef APSTUDIO_INVOKED
46 #ifndef APSTUDIO_READONLY_SYMBOLS
47 #define _APS_NO_MFC 1
48 #define _APS_NEXT_RESOURCE_VALUE 134
49 #define _APS_NEXT_COMMAND_VALUE 40018
50 #define _APS_NEXT_CONTROL_VALUE 1031
51 #define _APS_NEXT_SYMED_VALUE 101
52 #endif
53 #endif
0 /*
1 * function: Support for playing wave files - Win32 - ONLY
2 *
3 * This program is distributed under the GNU General Public License, version 2.
4 * A copy of this license is included with this source.
5 *
6 * Copyright (C) 2002 John Edwards
7 */
8
9 #include <string.h>
10 #include <errno.h>
11 #include "wave_out.h"
12
13 #define MAX_WAVEBLOCKS 32
14
15
16 static CRITICAL_SECTION cs;
17 static HWAVEOUT dev = NULL;
18 static int ScheduledBlocks = 0;
19 static int PlayedWaveHeadersCount = 0; // free index
20 static WAVEHDR* PlayedWaveHeaders [MAX_WAVEBLOCKS];
21
22
23 static int
24 Box ( const char* msg )
25 {
26 MessageBox ( NULL, msg, "Error Message . . .", MB_OK | MB_ICONEXCLAMATION );
27 return -1;
28 }
29
30
31 /*
32 * This function registers already played WAVE chunks. Freeing is done by free_memory(),
33 */
34
35 static void CALLBACK
36 wave_callback ( HWAVE hWave, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 )
37 {
38 if ( uMsg == WOM_DONE )
39 {
40 EnterCriticalSection ( &cs );
41 PlayedWaveHeaders [PlayedWaveHeadersCount++] = (WAVEHDR*) dwParam1;
42 LeaveCriticalSection ( &cs );
43 }
44 }
45
46
47 static void
48 free_memory ( void )
49 {
50 WAVEHDR* wh;
51 HGLOBAL hg;
52
53 EnterCriticalSection ( &cs );
54 wh = PlayedWaveHeaders [--PlayedWaveHeadersCount];
55 ScheduledBlocks--; // decrease the number of USED blocks
56 LeaveCriticalSection ( &cs );
57
58 waveOutUnprepareHeader ( dev, wh, sizeof (WAVEHDR) );
59
60 hg = GlobalHandle ( wh -> lpData ); // Deallocate the buffer memory
61 GlobalUnlock (hg);
62 GlobalFree (hg);
63
64 hg = GlobalHandle ( wh ); // Deallocate the header memory
65 GlobalUnlock (hg);
66 GlobalFree (hg);
67 }
68
69
70 Int
71 Set_WIN_Params ( FILE_T dummyFile ,
72 Ldouble SampleFreq,
73 Uint BitsPerSample,
74 Uint Channels )
75 {
76 WAVEFORMATEX outFormat;
77 UINT deviceID = WAVE_MAPPER;
78
79 (void) dummyFile;
80
81 if ( waveOutGetNumDevs () == 0 )
82 return Box ( "No audio device present." );
83
84 outFormat.wFormatTag = WAVE_FORMAT_PCM;
85 outFormat.wBitsPerSample = BitsPerSample;
86 outFormat.nChannels = Channels;
87 outFormat.nSamplesPerSec = (unsigned long)(SampleFreq);
88 outFormat.nBlockAlign = outFormat.nChannels * outFormat.wBitsPerSample/8;
89 outFormat.nAvgBytesPerSec = outFormat.nSamplesPerSec * outFormat.nChannels * outFormat.wBitsPerSample/8;
90
91 switch ( waveOutOpen ( &dev, deviceID, &outFormat, (DWORD)wave_callback, 0, CALLBACK_FUNCTION ) )
92 {
93 case MMSYSERR_ALLOCATED: return Box ( "Device is already open." );
94 case MMSYSERR_BADDEVICEID: return Box ( "The specified device is out of range." );
95 case MMSYSERR_NODRIVER: return Box ( "There is no audio driver in this system." );
96 case MMSYSERR_NOMEM: return Box ( "Unable to allocate sound memory." );
97 case WAVERR_BADFORMAT: return Box ( "This audio format is not supported." );
98 case WAVERR_SYNC: return Box ( "The device is synchronous." );
99 default: return Box ( "Unknown media error." );
100 case MMSYSERR_NOERROR: break;
101 }
102
103 waveOutReset ( dev );
104 InitializeCriticalSection ( &cs );
105 SetPriorityClass ( GetCurrentProcess (), HIGH_PRIORITY_CLASS );
106 // SetPriorityClass ( GetCurrentProcess (), REALTIME_PRIORITY_CLASS );
107 return 0;
108 }
109
110
111 int
112 WIN_Play_Samples ( const void* data, size_t len )
113 {
114 HGLOBAL hg;
115 HGLOBAL hg2;
116 LPWAVEHDR wh;
117 void* allocptr;
118
119 do
120 {
121 while ( PlayedWaveHeadersCount > 0 ) // free used blocks ...
122 free_memory ();
123
124 if ( ScheduledBlocks < sizeof(PlayedWaveHeaders)/sizeof(*PlayedWaveHeaders) ) // wait for a free block ...
125 break;
126 Sleep (26);
127
128 } while (1);
129
130 if ( (hg2 = GlobalAlloc ( GMEM_MOVEABLE, len )) == NULL ) // allocate some memory for a copy of the buffer
131 return Box ( "GlobalAlloc failed." );
132
133 allocptr = GlobalLock (hg2);
134 CopyMemory ( allocptr, data, len ); // Here we can call any modification output functions we want....
135
136 if ( (hg = GlobalAlloc (GMEM_MOVEABLE | GMEM_ZEROINIT, sizeof (WAVEHDR))) == NULL ) // now make a header and WRITE IT!
137 return -1;
138
139 wh = GlobalLock (hg);
140 wh->dwBufferLength = len;
141 wh->lpData = allocptr;
142
143 if ( waveOutPrepareHeader ( dev, wh, sizeof (WAVEHDR)) != MMSYSERR_NOERROR )
144 {
145 GlobalUnlock (hg);
146 GlobalFree (hg);
147 return -1;
148 }
149
150 if ( waveOutWrite ( dev, wh, sizeof (WAVEHDR)) != MMSYSERR_NOERROR )
151 {
152 GlobalUnlock (hg);
153 GlobalFree (hg);
154 return -1;
155 }
156
157 EnterCriticalSection ( &cs );
158 ScheduledBlocks++;
159 LeaveCriticalSection ( &cs );
160
161 return len;
162 }
163
164
165 int
166 WIN_Audio_close ( void )
167 {
168 if ( dev != NULL )
169 {
170 while ( ScheduledBlocks > 0 )
171 {
172 Sleep (ScheduledBlocks);
173 while ( PlayedWaveHeadersCount > 0 ) // free used blocks ...
174 free_memory ();
175 }
176
177 waveOutReset (dev); // reset the device
178 waveOutClose (dev); // close the device
179 dev = NULL;
180 }
181
182 DeleteCriticalSection ( &cs );
183 ScheduledBlocks = 0;
184 return 0;
185 }
186
187
188 /******************************** end of wave_out.c ********************************/
189
0 /*
1 * function: Header file for wave_out.c
2 *
3 * This program is distributed under the GNU General Public License, version 2.
4 * A copy of this license is included with this source.
5 *
6 * Copyright (C) 2002 John Edwards
7 */
8
9 #ifndef __WAVE_OUT_H__
10 #define __WAVE_OUT_H__
11
12
13 #include <stdio.h>
14 #include <windows.h>
15
16 #define Cdecl __cdecl
17 #define __attribute__(x)
18 #define sleep(__sec) Sleep ((__sec) * 1000)
19 #define inline __inline
20 #define restrict
21
22 /*
23 * constants
24 */
25
26 #define CD_SAMPLE_FREQ 44.1e3
27 #define SAMPLE_SIZE 16
28 #define SAMPLE_SIZE_STRING ""
29 #define WINAUDIO_FD ((FILE_T)-128)
30 #define FILE_T FILE*
31 #define INVALID_FILEDESC NULL
32
33 /*
34 * Simple types
35 */
36
37 typedef signed int Int; // at least -32767...+32767, fast type
38 typedef unsigned int Uint; // at least 0...65535, fast type
39 typedef long double Ldouble; // most exact floating point format
40
41 /*
42 * functions for wave_out.c
43 */
44
45 Int Set_WIN_Params ( FILE_T dummyFile , Ldouble SampleFreq, Uint BitsPerSample, Uint Channels );
46 int WIN_Play_Samples ( const void* buff, size_t len );
47 int WIN_Audio_close ( void );
48
49 #endif /* __WAVE_OUT_H__ */
0 #! /bin/sh
1
2 case $OSTYPE in
3 darwin*)
4 LIBTOOLIZE=glibtoolize
5 ;;
6 *)
7 LIBTOOLIZE=libtoolize
8 ;;
9 esac
10
11 aclocal -I . && \
12 autoheader && \
13 $LIBTOOLIZE --automake --copy && \
14 automake --add-missing --copy && \
15 autoconf && \
16 echo "Ready to run ./configure"
0 SUBDIRS = mp4ff
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: aacinfo.c,v 1.4 2003/07/29 08:20:11 menno Exp $
25 **/
26
27 #ifdef _WIN32
28 #define WIN32_LEAN_AND_MEAN
29 #include <windows.h>
30 #endif
31 #include <malloc.h>
32 #include "filestream.h"
33 #include "aacinfo.h"
34
35 #define ADIF_MAX_SIZE 30 /* Should be enough */
36 #define ADTS_MAX_SIZE 10 /* Should be enough */
37
38 static int sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000};
39
40 static int read_ADIF_header(FILE_STREAM *file, faadAACInfo *info)
41 {
42 int bitstream;
43 unsigned char buffer[ADIF_MAX_SIZE];
44 int skip_size = 0;
45 int sf_idx;
46
47 /* Get ADIF header data */
48 info->headertype = 1;
49
50 if(read_buffer_filestream(file, buffer, ADIF_MAX_SIZE) < 0)
51 return -1;
52
53 /* copyright string */
54 if(buffer[0] & 0x80)
55 skip_size += 9; /* skip 9 bytes */
56
57 bitstream = buffer[0 + skip_size] & 0x10;
58 info->bitrate = ((unsigned int)(buffer[0 + skip_size] & 0x0F)<<19)|
59 ((unsigned int)buffer[1 + skip_size]<<11)|
60 ((unsigned int)buffer[2 + skip_size]<<3)|
61 ((unsigned int)buffer[3 + skip_size] & 0xE0);
62
63 if (bitstream == 0)
64 {
65 info->object_type = ((buffer[6 + skip_size]&0x01)<<1)|((buffer[7 + skip_size]&0x80)>>7);
66 sf_idx = (buffer[7 + skip_size]&0x78)>>3;
67 } else {
68 info->object_type = (buffer[4 + skip_size] & 0x18)>>3;
69 sf_idx = ((buffer[4 + skip_size] & 0x07)<<1)|((buffer[5 + skip_size] & 0x80)>>7);
70 }
71 info->sampling_rate = sample_rates[sf_idx];
72
73 return 0;
74 }
75
76 static int read_ADTS_header(FILE_STREAM *file, faadAACInfo *info,
77 unsigned long **seek_table, int *seek_table_len,
78 int tagsize, int no_seek_table)
79 {
80 /* Get ADTS header data */
81 unsigned char buffer[ADTS_MAX_SIZE];
82 int frames, framesinsec=0, t_framelength = 0, frame_length, sr_idx, ID;
83 int second = 0, pos;
84 int i;
85 float frames_per_sec = 0;
86 unsigned long bytes;
87 unsigned long *tmp_seek_table = NULL;
88
89 info->headertype = 2;
90
91 /* Read all frames to ensure correct time and bitrate */
92 for(frames=0; /* */; frames++, framesinsec++)
93 {
94 /* If streaming, only go until we hit 5 seconds worth */
95 if(file->http)
96 {
97 if(frames >= 43 * 5)
98 {
99 break;
100 }
101 }
102
103 pos = tell_filestream(file);
104
105 /* 12 bit SYNCWORD */
106 bytes = read_buffer_filestream(file, buffer, ADTS_MAX_SIZE);
107
108 if(bytes != ADTS_MAX_SIZE)
109 {
110 /* Bail out if no syncword found */
111 break;
112 }
113
114 /* check syncword */
115 if (!((buffer[0] == 0xFF)&&((buffer[1] & 0xF6) == 0xF0)))
116 break;
117
118 if(!frames)
119 {
120 /* fixed ADTS header is the same for every frame, so we read it only once */
121 /* Syncword found, proceed to read in the fixed ADTS header */
122 ID = buffer[1] & 0x08;
123 info->object_type = (buffer[2]&0xC0)>>6;
124 sr_idx = (buffer[2]&0x3C)>>2;
125 info->channels = ((buffer[2]&0x01)<<2)|((buffer[3]&0xC0)>>6);
126
127 frames_per_sec = sample_rates[sr_idx] / 1024.f;
128 }
129
130 /* ...and the variable ADTS header */
131 if (ID == 0) {
132 info->version = 4;
133 } else { /* MPEG-2 */
134 info->version = 2;
135 }
136 frame_length = ((((unsigned int)buffer[3] & 0x3)) << 11)
137 | (((unsigned int)buffer[4]) << 3) | (buffer[5] >> 5);
138
139 t_framelength += frame_length;
140
141 if(!file->http)
142 {
143 if(framesinsec == 43)
144 framesinsec = 0;
145
146 if(framesinsec == 0 && seek_table_len)
147 {
148 tmp_seek_table = (unsigned long *) realloc(tmp_seek_table, (second + 1) * sizeof(unsigned long));
149 tmp_seek_table[second] = pos;
150 }
151 if(framesinsec == 0)
152 second++;
153 }
154
155 /* NOTE: While simply skipping ahead by reading may seem to be more work than seeking,
156 it is actually much faster, and keeps compatibility with streaming */
157 for(i=0; i < frame_length - ADTS_MAX_SIZE; i++)
158 {
159 if(read_byte_filestream(file) < 0)
160 break;
161 }
162 }
163
164 if(seek_table_len)
165 {
166 *seek_table_len = second;
167 *seek_table = tmp_seek_table;
168 }
169
170 info->sampling_rate = sample_rates[sr_idx];
171 info->bitrate = (int)(((t_framelength / frames) * (info->sampling_rate/1024.0)) +0.5)*8;
172
173 if(file->http)
174 {
175 /* Since we only use 5 seconds of aac data to get a rough bitrate, we must use a different
176 method of calculating the overall length */
177 if(filelength_filestream(file))
178 {
179 info->length = (int)((filelength_filestream(file)/(((info->bitrate*8)/1024)*16))*1000);
180 }
181 else
182 {
183 /* Since the server didnt tell us how long the file is,
184 we have no way of determining length */
185 info->length = 0;
186 }
187 }
188 else
189 {
190 info->length = (int)((float)(frames/frames_per_sec))*1000;
191 }
192
193 return 0;
194 }
195
196 int get_AAC_format(char *filename, faadAACInfo *info,
197 unsigned long **seek_table, int *seek_table_len,
198 int no_seek_table)
199 {
200 unsigned long tagsize;
201 FILE_STREAM *file;
202 char buffer[10];
203 unsigned long file_len;
204 unsigned char adxx_id[5];
205 unsigned long tmp;
206
207 memset(info, 0, sizeof(faadAACInfo));
208
209 file = open_filestream(filename);
210
211 if(file == NULL)
212 return -1;
213
214 file_len = filelength_filestream(file);
215
216 /* Skip the tag, if it's there */
217 tmp = read_buffer_filestream(file, buffer, 10);
218
219 if (StringComp(buffer, "ID3", 3) == 0)
220 {
221 unsigned int i;
222
223 /* high bit is not used */
224 tagsize = (buffer[6] << 21) | (buffer[7] << 14) |
225 (buffer[8] << 7) | (buffer[9] << 0);
226
227 for(i=0; i < tagsize; i++)
228 if(read_byte_filestream(file) < 0)
229 return -1;
230
231 tagsize += 10;
232 }
233 else
234 {
235 tagsize = 0;
236
237 /* Simple hack to reset to the beginning */
238 file->buffer_offset = 0;
239 file->file_offset = 0;
240 }
241
242 if(file_len)
243 file_len -= tagsize;
244
245 tmp = read_buffer_filestream(file, adxx_id, 2);
246 //seek_filestream(file, tagsize, FILE_BEGIN);
247
248 adxx_id[5-1] = 0;
249 info->length = 0;
250
251 /* Determine the header type of the file, check the first two bytes */
252 if(StringComp(adxx_id, "AD", 2) == 0)
253 {
254 /* We think its an ADIF header, but check the rest just to make sure */
255 tmp = read_buffer_filestream(file, adxx_id + 2, 2);
256
257 if(StringComp(adxx_id, "ADIF", 4) == 0)
258 {
259 read_ADIF_header(file, info);
260 }
261 }
262 else
263 {
264 /* No ADIF, check for ADTS header */
265 if ((adxx_id[0] == 0xFF)&&((adxx_id[1] & 0xF6) == 0xF0))
266 {
267 /* ADTS header located */
268 /* Since this routine must work for streams, we can't use the seek function to go backwards, thus
269 we have to use a quick hack as seen below to go back where we need to. */
270
271 if(file->buffer_offset >= 2)
272 {
273 // simple seeking hack, though not really safe, the probability of it causing a problem is low.
274 file->buffer_offset -= 2;
275 file->file_offset -= 2;
276 }
277
278 read_ADTS_header(file, info, seek_table, seek_table_len, tagsize,
279 no_seek_table);
280 }
281 else
282 {
283 /* Unknown/headerless AAC file, assume format: */
284 info->version = 2;
285 info->bitrate = 128000;
286 info->sampling_rate = 44100;
287 info->channels = 2;
288 info->headertype = 0;
289 info->object_type = 1;
290 }
291 }
292
293 close_filestream(file);
294
295 return 0;
296 }
297
298 int StringComp(char const *str1, char const *str2, unsigned long len)
299 {
300 signed int c1 = 0, c2 = 0;
301
302 while (len--) {
303 c1 = *str1++;
304 c2 = *str2++;
305
306 if (c1 == 0 || c1 != c2)
307 break;
308 }
309
310 return c1 - c2;
311 }
312
313 #ifdef TEST
314 /* Program to test aacinfo functionality */
315
316 #include <stdio.h>
317
318 void main(int argc, char *argv[])
319 {
320 faadAACInfo info;
321 unsigned long *seek_table = NULL;
322 int seek_table_len = 0;
323 char *header, *object;
324
325 if (argc < 2)
326 {
327 fprintf(stderr, "USAGE: aacinfo aacfile.aac\n");
328 return;
329 }
330
331 get_AAC_format(argv[1], &info, &seek_table, &seek_table_len, 0);
332
333 fprintf(stdout, "MPEG version: %d\n", info.version);
334 fprintf(stdout, "channels: %d\n", info.channels);
335 fprintf(stdout, "sampling_rate: %d\n", info.sampling_rate);
336 fprintf(stdout, "bitrate: %d\n", info.bitrate);
337 fprintf(stdout, "length: %.3f\n", (float)info.length/1000.0);
338
339 switch (info.object_type)
340 {
341 case 0:
342 object = "MAIN";
343 break;
344 case 1:
345 object = "LC";
346 break;
347 case 2:
348 object = "SSR";
349 break;
350 case 3:
351 object = "LTP";
352 break;
353 }
354 fprintf(stdout, "object_type: %s\n", object);
355
356 switch (info.headertype)
357 {
358 case 0:
359 header = "RAW";
360 break;
361 case 1:
362 header = "ADIF";
363 break;
364 case 2:
365 header = "ADTS";
366 break;
367 }
368 fprintf(stdout, "headertype: %s\n", header);
369 }
370
371 #endif
0 # Microsoft Developer Studio Project File - Name="aacinfo" - Package Owner=<4>
1 # Microsoft Developer Studio Generated Build File, Format Version 6.00
2 # ** DO NOT EDIT **
3
4 # TARGTYPE "Win32 (x86) Console Application" 0x0103
5
6 CFG=aacinfo - Win32 Debug
7 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
8 !MESSAGE use the Export Makefile command and run
9 !MESSAGE
10 !MESSAGE NMAKE /f "aacinfo.mak".
11 !MESSAGE
12 !MESSAGE You can specify a configuration when running NMAKE
13 !MESSAGE by defining the macro CFG on the command line. For example:
14 !MESSAGE
15 !MESSAGE NMAKE /f "aacinfo.mak" CFG="aacinfo - Win32 Debug"
16 !MESSAGE
17 !MESSAGE Possible choices for configuration are:
18 !MESSAGE
19 !MESSAGE "aacinfo - Win32 Release" (based on "Win32 (x86) Console Application")
20 !MESSAGE "aacinfo - Win32 Debug" (based on "Win32 (x86) Console Application")
21 !MESSAGE
22
23 # Begin Project
24 # PROP AllowPerConfigDependencies 0
25 # PROP Scc_ProjName ""
26 # PROP Scc_LocalPath ""
27 CPP=xicl6.exe
28 RSC=rc.exe
29
30 !IF "$(CFG)" == "aacinfo - Win32 Release"
31
32 # PROP BASE Use_MFC 0
33 # PROP BASE Use_Debug_Libraries 0
34 # PROP BASE Output_Dir "Release"
35 # PROP BASE Intermediate_Dir "Release"
36 # PROP BASE Target_Dir ""
37 # PROP Use_MFC 0
38 # PROP Use_Debug_Libraries 0
39 # PROP Output_Dir "Release"
40 # PROP Intermediate_Dir "Release"
41 # PROP Ignore_Export_Lib 0
42 # PROP Target_Dir ""
43 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
44 # ADD CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "TEST" /YX /FD /c
45 # ADD BASE RSC /l 0x413 /d "NDEBUG"
46 # ADD RSC /l 0x413 /d "NDEBUG"
47 BSC32=bscmake.exe
48 # ADD BASE BSC32 /nologo
49 # ADD BSC32 /nologo
50 LINK32=xilink6.exe
51 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
52 # ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
53
54 !ELSEIF "$(CFG)" == "aacinfo - Win32 Debug"
55
56 # PROP BASE Use_MFC 0
57 # PROP BASE Use_Debug_Libraries 1
58 # PROP BASE Output_Dir "Debug"
59 # PROP BASE Intermediate_Dir "Debug"
60 # PROP BASE Target_Dir ""
61 # PROP Use_MFC 0
62 # PROP Use_Debug_Libraries 1
63 # PROP Output_Dir "Debug"
64 # PROP Intermediate_Dir "Debug"
65 # PROP Ignore_Export_Lib 0
66 # PROP Target_Dir ""
67 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
68 # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "TEST" /YX /FD /GZ /c
69 # ADD BASE RSC /l 0x413 /d "_DEBUG"
70 # ADD RSC /l 0x413 /d "_DEBUG"
71 BSC32=bscmake.exe
72 # ADD BASE BSC32 /nologo
73 # ADD BSC32 /nologo
74 LINK32=xilink6.exe
75 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
76 # ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
77
78 !ENDIF
79
80 # Begin Target
81
82 # Name "aacinfo - Win32 Release"
83 # Name "aacinfo - Win32 Debug"
84 # Begin Group "Source Files"
85
86 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
87 # Begin Source File
88
89 SOURCE=.\aacinfo.c
90 # End Source File
91 # Begin Source File
92
93 SOURCE=.\filestream.c
94 # End Source File
95 # End Group
96 # Begin Group "Header Files"
97
98 # PROP Default_Filter "h;hpp;hxx;hm;inl"
99 # Begin Source File
100
101 SOURCE=.\aacinfo.h
102 # End Source File
103 # Begin Source File
104
105 SOURCE=.\filestream.h
106 # End Source File
107 # End Group
108 # End Target
109 # End Project
0 Microsoft Developer Studio Workspace File, Format Version 6.00
1 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
2
3 ###############################################################################
4
5 Project: "aacinfo"=.\aacinfo.dsp - Package Owner=<4>
6
7 Package=<5>
8 {{{
9 }}}
10
11 Package=<4>
12 {{{
13 }}}
14
15 ###############################################################################
16
17 Global:
18
19 Package=<5>
20 {{{
21 }}}
22
23 Package=<3>
24 {{{
25 }}}
26
27 ###############################################################################
28
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: aacinfo.h,v 1.3 2003/07/29 08:20:11 menno Exp $
25 **/
26
27 #ifndef AACINFO_H__
28 #define AACINFO_H__
29
30 #include "filestream.h"
31
32 typedef struct {
33 int version;
34 int channels;
35 int sampling_rate;
36 int bitrate;
37 int length;
38 int object_type;
39 int headertype;
40 } faadAACInfo;
41
42 int get_AAC_format(char *filename, faadAACInfo *info,
43 unsigned long **seek_table, int *seek_table_len,
44 int no_seek_table);
45
46 static int read_ADIF_header(FILE_STREAM *file, faadAACInfo *info);
47 static int read_ADTS_header(FILE_STREAM *file, faadAACInfo *info,
48 unsigned long **seek_table, int *seek_table_len,
49 int tagsize, int no_seek_table);
50 int StringComp(char const *str1, char const *str2, unsigned long len);
51
52 #endif
0 Microsoft Visual Studio Solution File, Format Version 7.00
1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aacinfo", "aacinfo.vcproj", "{FE985E4D-79DB-4DD3-BFED-824B4677A161}"
2 EndProject
3 Global
4 GlobalSection(SolutionConfiguration) = preSolution
5 ConfigName.0 = Debug
6 ConfigName.1 = Release
7 EndGlobalSection
8 GlobalSection(ProjectDependencies) = postSolution
9 EndGlobalSection
10 GlobalSection(ProjectConfiguration) = postSolution
11 {FE985E4D-79DB-4DD3-BFED-824B4677A161}.Debug.ActiveCfg = Debug|Win32
12 {FE985E4D-79DB-4DD3-BFED-824B4677A161}.Debug.Build.0 = Debug|Win32
13 {FE985E4D-79DB-4DD3-BFED-824B4677A161}.Release.ActiveCfg = Release|Win32
14 {FE985E4D-79DB-4DD3-BFED-824B4677A161}.Release.Build.0 = Release|Win32
15 EndGlobalSection
16 GlobalSection(ExtensibilityGlobals) = postSolution
17 EndGlobalSection
18 GlobalSection(ExtensibilityAddIns) = postSolution
19 EndGlobalSection
20 EndGlobal
0 <?xml version="1.0" encoding = "Windows-1252"?>
1 <VisualStudioProject
2 ProjectType="Visual C++"
3 Version="7.00"
4 Name="aacinfo"
5 SccProjectName=""
6 SccLocalPath="">
7 <Platforms>
8 <Platform
9 Name="Win32"/>
10 </Platforms>
11 <Configurations>
12 <Configuration
13 Name="Debug|Win32"
14 OutputDirectory=".\Debug"
15 IntermediateDirectory=".\Debug"
16 ConfigurationType="1"
17 UseOfMFC="0"
18 ATLMinimizesCRunTimeLibraryUsage="FALSE"
19 CharacterSet="2">
20 <Tool
21 Name="VCCLCompilerTool"
22 Optimization="0"
23 PreprocessorDefinitions="_DEBUG,WIN32,_CONSOLE,TEST"
24 BasicRuntimeChecks="3"
25 RuntimeLibrary="5"
26 UsePrecompiledHeader="2"
27 PrecompiledHeaderFile=".\Debug/aacinfo.pch"
28 AssemblerListingLocation=".\Debug/"
29 ObjectFile=".\Debug/"
30 ProgramDataBaseFileName=".\Debug/"
31 WarningLevel="3"
32 SuppressStartupBanner="TRUE"
33 DebugInformationFormat="4"/>
34 <Tool
35 Name="VCCustomBuildTool"/>
36 <Tool
37 Name="VCLinkerTool"
38 AdditionalOptions="/MACHINE:I386"
39 AdditionalDependencies="ws2_32.lib odbc32.lib odbccp32.lib"
40 OutputFile=".\Debug/aacinfo.exe"
41 LinkIncremental="2"
42 SuppressStartupBanner="TRUE"
43 GenerateDebugInformation="TRUE"
44 ProgramDatabaseFile=".\Debug/aacinfo.pdb"
45 SubSystem="1"/>
46 <Tool
47 Name="VCMIDLTool"
48 TypeLibraryName=".\Debug/aacinfo.tlb"/>
49 <Tool
50 Name="VCPostBuildEventTool"/>
51 <Tool
52 Name="VCPreBuildEventTool"/>
53 <Tool
54 Name="VCPreLinkEventTool"/>
55 <Tool
56 Name="VCResourceCompilerTool"
57 PreprocessorDefinitions="_DEBUG"
58 Culture="1043"/>
59 <Tool
60 Name="VCWebServiceProxyGeneratorTool"/>
61 <Tool
62 Name="VCWebDeploymentTool"/>
63 </Configuration>
64 <Configuration
65 Name="Release|Win32"
66 OutputDirectory=".\Release"
67 IntermediateDirectory=".\Release"
68 ConfigurationType="1"
69 UseOfMFC="0"
70 ATLMinimizesCRunTimeLibraryUsage="FALSE"
71 CharacterSet="2">
72 <Tool
73 Name="VCCLCompilerTool"
74 InlineFunctionExpansion="1"
75 PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE,TEST"
76 StringPooling="TRUE"
77 RuntimeLibrary="4"
78 EnableFunctionLevelLinking="TRUE"
79 UsePrecompiledHeader="2"
80 PrecompiledHeaderFile=".\Release/aacinfo.pch"
81 AssemblerListingLocation=".\Release/"
82 ObjectFile=".\Release/"
83 ProgramDataBaseFileName=".\Release/"
84 WarningLevel="3"
85 SuppressStartupBanner="TRUE"/>
86 <Tool
87 Name="VCCustomBuildTool"/>
88 <Tool
89 Name="VCLinkerTool"
90 AdditionalOptions="/MACHINE:I386"
91 AdditionalDependencies="ws2_32.lib odbc32.lib odbccp32.lib"
92 OutputFile=".\Release/aacinfo.exe"
93 LinkIncremental="1"
94 SuppressStartupBanner="TRUE"
95 ProgramDatabaseFile=".\Release/aacinfo.pdb"
96 SubSystem="1"/>
97 <Tool
98 Name="VCMIDLTool"
99 TypeLibraryName=".\Release/aacinfo.tlb"/>
100 <Tool
101 Name="VCPostBuildEventTool"/>
102 <Tool
103 Name="VCPreBuildEventTool"/>
104 <Tool
105 Name="VCPreLinkEventTool"/>
106 <Tool
107 Name="VCResourceCompilerTool"
108 PreprocessorDefinitions="NDEBUG"
109 Culture="1043"/>
110 <Tool
111 Name="VCWebServiceProxyGeneratorTool"/>
112 <Tool
113 Name="VCWebDeploymentTool"/>
114 </Configuration>
115 </Configurations>
116 <Files>
117 <Filter
118 Name="Source Files"
119 Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
120 <File
121 RelativePath=".\aacinfo.c">
122 </File>
123 <File
124 RelativePath=".\filestream.c">
125 </File>
126 </Filter>
127 <Filter
128 Name="Header Files"
129 Filter="h;hpp;hxx;hm;inl">
130 <File
131 RelativePath=".\aacinfo.h">
132 </File>
133 <File
134 RelativePath=".\filestream.h">
135 </File>
136 </Filter>
137 </Files>
138 <Globals>
139 </Globals>
140 </VisualStudioProject>
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: filestream.c,v 1.3 2003/07/29 08:20:11 menno Exp $
25 **/
26
27 /* Not very portable yet */
28
29 #include <winsock2.h> // Note: Must be *before* windows.h
30 #ifdef _WIN32
31 #define WIN32_LEAN_AND_MEAN
32 #include <windows.h>
33 #endif
34 #include "filestream.h"
35 #include "aacinfo.h"
36
37 /* TEMPROARY HACK */
38 #define CommonExit(A) MessageBox(NULL, A, "FAAD Plugin", MB_OK)
39
40 int winsock_init=0; // 0=winsock not initialized, 1=success
41 long m_local_buffer_size = 64;
42 long m_stream_buffer_size = 128;
43
44 FILE_STREAM *open_filestream(char *filename)
45 {
46 FILE_STREAM *fs;
47
48 if(StringComp(filename,"http://", 7) == 0)
49 {
50 fs = (FILE_STREAM *)LocalAlloc(LPTR, sizeof(FILE_STREAM) + m_stream_buffer_size * 1024);
51
52 if(fs == NULL)
53 return NULL;
54
55 fs->data = (unsigned char *)&fs[1];
56
57 if(http_file_open(filename, fs) < 0)
58 {
59 LocalFree(fs);
60 return NULL;
61 }
62
63 fs->http = 1;
64 }
65 else
66 {
67 fs = (FILE_STREAM*)LocalAlloc(LPTR, sizeof(FILE_STREAM) + m_local_buffer_size * 1024);
68
69 if(fs == NULL)
70 return NULL;
71
72 fs->data = (unsigned char *)&fs[1];
73
74 fs->stream = CreateFile(filename, GENERIC_READ,
75 FILE_SHARE_READ | FILE_SHARE_WRITE, 0,
76 OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, 0);
77 if (fs->stream == INVALID_HANDLE_VALUE)
78 {
79 LocalFree(fs);
80 return NULL;
81 }
82
83 fs->http = 0;
84 }
85
86 fs->buffer_length = 0;
87 fs->buffer_offset = 0;
88 fs->file_offset = 0;
89
90 return fs;
91 }
92
93 int read_byte_filestream(FILE_STREAM *fs)
94 {
95 if(fs->buffer_offset == fs->buffer_length)
96 {
97 fs->buffer_offset = 0;
98
99 if(fs->http)
100 fs->buffer_length = recv(fs->inetStream, fs->data, m_stream_buffer_size * 1024, 0);
101 else
102 ReadFile(fs->stream, fs->data, m_local_buffer_size * 1024, &fs->buffer_length, 0);
103
104 if(fs->buffer_length <= 0)
105 {
106 if(fs->http)
107 {
108 int x;
109 x = WSAGetLastError();
110
111 if(x == 0)
112 {
113 /* Equivalent of a successful EOF for HTTP */
114 }
115 }
116
117 fs->buffer_length = 0;
118 return -1;
119 }
120 }
121
122 fs->file_offset++;
123
124 return fs->data[fs->buffer_offset++];
125 }
126
127 int read_buffer_filestream(FILE_STREAM *fs, void *data, int length)
128 {
129 int i, tmp;
130 unsigned char *data2 = (unsigned char *)data;
131
132 for(i=0; i < length; i++)
133 {
134 if((tmp = read_byte_filestream(fs)) < 0)
135 {
136 if(i)
137 {
138 break;
139 }
140 else
141 {
142 return -1;
143 }
144 }
145 data2[i] = tmp;
146 }
147
148 return i;
149 }
150
151 unsigned long filelength_filestream(FILE_STREAM *fs)
152 {
153 unsigned long fsize;
154
155 if (fs->http)
156 {
157 fsize = fs->http_file_length;
158 }
159 else
160 {
161 fsize = GetFileSize(fs->stream, NULL);
162 }
163
164 return fsize;
165 }
166
167 void seek_filestream(FILE_STREAM *fs, unsigned long offset, int mode)
168 {
169 if(fs->http)
170 {
171 return;
172 }
173
174 SetFilePointer(fs->stream, offset, NULL, mode);
175
176 if(mode == FILE_CURRENT)
177 fs->file_offset += offset;
178 else if(mode == FILE_END)
179 fs->file_offset = filelength_filestream(fs) + offset;
180 else
181 fs->file_offset = offset;
182
183 fs->buffer_length = 0;
184 fs->buffer_offset = 0;
185 }
186
187 unsigned long tell_filestream(FILE_STREAM *fs)
188 {
189 return fs->file_offset;
190 }
191
192 void close_filestream(FILE_STREAM *fs)
193 {
194 if(fs)
195 {
196 if (fs->http)
197 {
198 if (fs->inetStream)
199 {
200 /* The 'proper' way to close a TCP connection */
201 if(fs->inetStream)
202 {
203 CloseTCP(fs->inetStream);
204 }
205 }
206 }
207 else
208 {
209 if(fs->stream)
210 CloseHandle(fs->stream);
211 }
212
213 LocalFree(fs);
214 fs = NULL;
215 }
216 }
217
218 int WinsockInit()
219 {
220 /* Before using winsock, you must load the DLL... */
221 WSADATA wsaData;
222
223 /* Load version 2.0 */
224 if (WSAStartup( MAKEWORD( 2, 0 ), &wsaData ))
225 {
226 /* Disable streaming */
227 return -1;
228 }
229
230 winsock_init = 1;
231
232 return 0;
233 }
234
235 void WinsockDeInit()
236 {
237 /* Unload the DLL */
238
239 if(winsock_init)
240 WSACleanup();
241 }
242
243 int FindCRLF(char *str)
244 {
245 int i;
246
247 for(i=0; i != lstrlen(str) && str[i] != '\r'; i++);
248
249 return i;
250 }
251
252 void CloseTCP(int s)
253 {
254 char tempbuf[1024];
255
256 /* Set the socket to ignore any new incoming data */
257 shutdown(s, 1);
258
259 /* Get any old remaining data */
260 while(recv(s, tempbuf, 1024, 0) > 0);
261
262 /* Deallocate the socket */
263 closesocket(s);
264 }
265
266 int resolve_host(char *host, SOCKADDR_IN *sck_addr, unsigned short remote_port)
267 {
268 HOSTENT *hp;
269
270 if (isalpha(host[0]))
271 {
272 /* server address is a name */
273 hp = gethostbyname(host);
274 }
275 else
276 {
277 unsigned long addr;
278 /* Convert nnn.nnn address to a usable one */
279 addr = inet_addr(host);
280 hp = gethostbyaddr((char *)&addr, 4, AF_INET);
281 }
282
283 if (hp == NULL)
284 {
285 char tmp[128];
286 wsprintf(tmp, "Error resolving host address [%s]!\n", host);
287 CommonExit(tmp);
288 return -1;
289 }
290
291 ZeroMemory(sck_addr, sizeof(SOCKADDR_IN));
292 sck_addr->sin_family = AF_INET;
293 sck_addr->sin_port = htons(remote_port);
294 CopyMemory(&sck_addr->sin_addr, hp->h_addr, hp->h_length);
295
296 return 0;
297 }
298
299 int http_file_open(char *url, FILE_STREAM *fs)
300 {
301 SOCKET sck;
302 SOCKADDR_IN host;
303 char server[1024], file[1024], request[1024], *temp = NULL, *tmpfile = NULL;
304 int i, j, port = 80, bytes_recv, http_code;
305
306 /* No winsock, no streaming */
307 if(!winsock_init)
308 {
309 return -1;
310 }
311
312 url += 7; // Skip over http://
313
314 /* Extract data from the URL */
315 for(i=0; url[i] != '/' && url[i] != ':' && url[i] != 0; i++);
316
317 ZeroMemory(server, 1024);
318 CopyMemory(server, url, i);
319
320 if(url[i] == ':')
321 {
322 /* A certain port was specified */
323 port = atol(url + (i + 1));
324 }
325
326 for(; url[i] != '/' && url[i] != 0; i++);
327
328 ZeroMemory(file, 1024);
329
330 CopyMemory(file, url + i, lstrlen(url));
331
332 /* END OF URL PARSING */
333
334 /* Create a TCP/IP socket */
335 sck = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
336
337 if(sck == INVALID_SOCKET)
338 {
339 CommonExit("Error creating TCP/IP new socket");
340 return -1;
341 }
342
343 /* Resolve the host address (turn www.blah.com into an IP) */
344 if(resolve_host(server, &host, (unsigned short)port))
345 {
346 CommonExit("Error resolving host address");
347 CloseTCP(sck);
348 return -1;
349 }
350
351 /* Connect to the server */
352 if(connect(sck, (SOCKADDR *)&host, sizeof(SOCKADDR)) == SOCKET_ERROR)
353 {
354 CommonExit("Error connecting to remote server");
355 CloseTCP(sck);
356 return -1;
357 }
358
359 tmpfile = calloc(1, (strlen(file) * 3) + 1);
360
361 /* Encode URL */
362 for(i=0, j=0; i < (int)strlen(file); i++)
363 {
364 if((unsigned char)file[i] <= 31 || (unsigned char)file[i] >= 127)
365 {
366 /* encode ASCII-control characters */
367 wsprintf(tmpfile + j, "%%%X", (unsigned char)file[i]);
368 j += 3;
369 continue;
370 }
371 else
372 {
373 switch(file[i])
374 {
375 /* encode characters that could confuse some servers */
376 case ' ':
377 case '"':
378 case '>':
379 case '<':
380 case '#':
381 case '%':
382 case '{':
383 case '}':
384 case '|':
385 case '\\':
386 case '^':
387 case '~':
388 case '[':
389 case ']':
390 case '`':
391
392 wsprintf(tmpfile + j, "%%%X", (unsigned char)file[i]);
393 j += 3;
394 continue;
395 }
396 }
397
398 tmpfile[j] = file[i];
399 j++;
400 }
401
402 wsprintf(request, "GET %s\r\n\r\n", tmpfile);
403
404 free(tmpfile);
405
406 /* Send the request */
407 if(send(sck, request, lstrlen(request), 0) <= 0)
408 {
409 /* Error sending data */
410 CloseTCP(sck);
411 return -1;
412 }
413
414 ZeroMemory(request, 1024);
415
416 /* Send the request */
417 if((bytes_recv = recv(sck, request, 1024, 0)) <= 0)
418 {
419 /* Error sending data */
420 CloseTCP(sck);
421 return -1;
422 }
423
424 if(StringComp(request,"HTTP/1.", 7) != 0)
425 {
426 /* Invalid header */
427 CloseTCP(sck);
428 return -1;
429 }
430
431 http_code = atol(request + 9);
432
433 if(http_code < 200 || http_code > 299)
434 {
435 /* HTTP error */
436 CloseTCP(sck);
437 return -1;
438 }
439
440 // Search for a length field
441 fs->http_file_length = 0;
442
443 /* Limit search to only 20 loops */
444 if((temp = strstr(request, "Content-Length: ")) != NULL)
445 {
446 /* Has a content-length field, copy into structure */
447 fs->http_file_length = atol(temp + 16);
448 }
449
450 /* Copy the handle data into the structure */
451 fs->inetStream = sck;
452
453 /* Copy any excess data beyond the header into the filestream buffers */
454 temp = strstr(request, "\r\n\r\n");
455
456 if(temp)
457 {
458 temp += 4;
459 }
460
461 if(temp - request < bytes_recv)
462 {
463 memcpy(fs->data, temp, (temp - request) - bytes_recv);
464 fs->buffer_length = (temp - request) - bytes_recv;
465 fs->buffer_offset = 0;
466 }
467
468 return 0;
469 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: filestream.h,v 1.3 2003/07/29 08:20:11 menno Exp $
25 **/
26
27 #ifndef FILESTREAM_H
28 #define FILESTREAM_H
29
30 typedef struct {
31 HANDLE stream;
32 unsigned short inetStream;
33 unsigned char *data;
34 int http;
35 int buffer_offset;
36 int buffer_length;
37 int file_offset;
38 int http_file_length;
39 } FILE_STREAM;
40
41 extern long m_local_buffer_size;
42 extern long m_stream_buffer_size;
43
44 FILE_STREAM *open_filestream(char *filename);
45 int read_byte_filestream(FILE_STREAM *fs);
46 int read_buffer_filestream(FILE_STREAM *fs, void *data, int length);
47 unsigned long filelength_filestream(FILE_STREAM *fs);
48 void close_filestream(FILE_STREAM *fs);
49 void seek_filestream(FILE_STREAM *fs, unsigned long offset, int mode);
50 unsigned long tell_filestream(FILE_STREAM *fs);
51 int http_file_open(char *url, FILE_STREAM *fs);
52
53 int WinsockInit();
54 void WinsockDeInit();
55 void CloseTCP(int s);
56 #endif
0 /* Getopt for GNU.
1 NOTE: getopt is now part of the C library, so if you don't know what
2 "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
3 before changing it!
4
5 Copyright (C) 1987, 88, 89, 90, 91, 92, 1993
6 Free Software Foundation, Inc.
7
8 This program is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 2, or (at your option) any
11 later version.
12
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
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
21
22
23 #ifdef HAVE_CONFIG_H
24 #include "config.h"
25 #endif
26
27 #ifndef __STDC__
28 # ifndef const
29 # define const
30 # endif
31 #endif
32
33 /* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>. */
34 #ifndef _NO_PROTO
35 #define _NO_PROTO
36 #endif
37
38 #include <stdio.h>
39
40 /* Comment out all this code if we are using the GNU C Library, and are not
41 actually compiling the library itself. This code is part of the GNU C
42 Library, but also included in many other GNU distributions. Compiling
43 and linking in this code is a waste when using the GNU C library
44 (especially if it is a shared library). Rather than having every GNU
45 program understand `configure --with-gnu-libc' and omit the object files,
46 it is simpler to just do this in the source for each such file. */
47
48 #if defined (_LIBC) || !defined (__GNU_LIBRARY__) || !__MacOSX__
49
50
51 /* This needs to come after some library #include
52 to get __GNU_LIBRARY__ defined. */
53 #ifdef __GNU_LIBRARY__
54 /* Don't include stdlib.h for non-GNU C libraries because some of them
55 contain conflicting prototypes for getopt. */
56 #include <stdlib.h>
57 #endif /* GNU C library. */
58
59 /* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a
60 long-named option. Because this is not POSIX.2 compliant, it is
61 being phased out. */
62 /* #define GETOPT_COMPAT */
63
64 /* This version of `getopt' appears to the caller like standard Unix `getopt'
65 but it behaves differently for the user, since it allows the user
66 to intersperse the options with the other arguments.
67
68 As `getopt' works, it permutes the elements of ARGV so that,
69 when it is done, all the options precede everything else. Thus
70 all application programs are extended to handle flexible argument order.
71
72 Setting the environment variable POSIXLY_CORRECT disables permutation.
73 Then the behavior is completely standard.
74
75 GNU application programs can use a third alternative mode in which
76 they can distinguish the relative order of options and other arguments. */
77
78 #include "getopt.h"
79
80 /* For communication from `getopt' to the caller.
81 When `getopt' finds an option that takes an argument,
82 the argument value is returned here.
83 Also, when `ordering' is RETURN_IN_ORDER,
84 each non-option ARGV-element is returned here. */
85
86 char *optarg = 0;
87
88 /* Index in ARGV of the next element to be scanned.
89 This is used for communication to and from the caller
90 and for communication between successive calls to `getopt'.
91
92 On entry to `getopt', zero means this is the first call; initialize.
93
94 When `getopt' returns EOF, this is the index of the first of the
95 non-option elements that the caller should itself scan.
96
97 Otherwise, `optind' communicates from one call to the next
98 how much of ARGV has been scanned so far. */
99
100 /* XXX 1003.2 says this must be 1 before any call. */
101 int optind = 0;
102
103 /* The next char to be scanned in the option-element
104 in which the last option character we returned was found.
105 This allows us to pick up the scan where we left off.
106
107 If this is zero, or a null string, it means resume the scan
108 by advancing to the next ARGV-element. */
109
110 static char *nextchar;
111
112 /* Callers store zero here to inhibit the error message
113 for unrecognized options. */
114
115 int opterr = 1;
116
117 /* Set to an option character which was unrecognized.
118 This must be initialized on some systems to avoid linking in the
119 system's own getopt implementation. */
120
121 #define BAD_OPTION '\0'
122 int optopt = BAD_OPTION;
123
124 /* Describe how to deal with options that follow non-option ARGV-elements.
125
126 If the caller did not specify anything,
127 the default is REQUIRE_ORDER if the environment variable
128 POSIXLY_CORRECT is defined, PERMUTE otherwise.
129
130 REQUIRE_ORDER means don't recognize them as options;
131 stop option processing when the first non-option is seen.
132 This is what Unix does.
133 This mode of operation is selected by either setting the environment
134 variable POSIXLY_CORRECT, or using `+' as the first character
135 of the list of option characters.
136
137 PERMUTE is the default. We permute the contents of ARGV as we scan,
138 so that eventually all the non-options are at the end. This allows options
139 to be given in any order, even with programs that were not written to
140 expect this.
141
142 RETURN_IN_ORDER is an option available to programs that were written
143 to expect options and other ARGV-elements in any order and that care about
144 the ordering of the two. We describe each non-option ARGV-element
145 as if it were the argument of an option with character code 1.
146 Using `-' as the first character of the list of option characters
147 selects this mode of operation.
148
149 The special argument `--' forces an end of option-scanning regardless
150 of the value of `ordering'. In the case of RETURN_IN_ORDER, only
151 `--' can cause `getopt' to return EOF with `optind' != ARGC. */
152
153 static enum
154 {
155 REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
156 } ordering;
157
158 #ifdef __GNU_LIBRARY__
159 /* We want to avoid inclusion of string.h with non-GNU libraries
160 because there are many ways it can cause trouble.
161 On some systems, it contains special magic macros that don't work
162 in GCC. */
163 #include <string.h>
164 #define my_index strchr
165 #define my_strlen strlen
166 #else
167
168 /* Avoid depending on library functions or files
169 whose names are inconsistent. */
170
171 #if __STDC__ || defined(PROTO)
172 extern char *getenv(const char *name);
173 extern int strcmp (const char *s1, const char *s2);
174 extern int strncmp(const char *s1, const char *s2, unsigned int n);
175
176 static int my_strlen(const char *s);
177 static char *my_index (const char *str, int chr);
178 #else
179 extern char *getenv ();
180 #endif
181
182 static int
183 my_strlen (str)
184 const char *str;
185 {
186 int n = 0;
187 while (*str++)
188 n++;
189 return n;
190 }
191
192 static char *
193 my_index (str, chr)
194 const char *str;
195 int chr;
196 {
197 while (*str)
198 {
199 if (*str == chr)
200 return (char *) str;
201 str++;
202 }
203 return 0;
204 }
205
206 #endif /* GNU C library. */
207
208 /* Handle permutation of arguments. */
209
210 /* Describe the part of ARGV that contains non-options that have
211 been skipped. `first_nonopt' is the index in ARGV of the first of them;
212 `last_nonopt' is the index after the last of them. */
213
214 static int first_nonopt;
215 static int last_nonopt;
216
217 /* Exchange two adjacent subsequences of ARGV.
218 One subsequence is elements [first_nonopt,last_nonopt)
219 which contains all the non-options that have been skipped so far.
220 The other is elements [last_nonopt,optind), which contains all
221 the options processed since those non-options were skipped.
222
223 `first_nonopt' and `last_nonopt' are relocated so that they describe
224 the new indices of the non-options in ARGV after they are moved.
225
226 To perform the swap, we first reverse the order of all elements. So
227 all options now come before all non options, but they are in the
228 wrong order. So we put back the options and non options in original
229 order by reversing them again. For example:
230 original input: a b c -x -y
231 reverse all: -y -x c b a
232 reverse options: -x -y c b a
233 reverse non options: -x -y a b c
234 */
235
236 #if __STDC__ || defined(PROTO)
237 static void exchange (char **argv);
238 #endif
239
240 static void
241 exchange (argv)
242 char **argv;
243 {
244 char *temp, **first, **last;
245
246 /* Reverse all the elements [first_nonopt, optind) */
247 first = &argv[first_nonopt];
248 last = &argv[optind-1];
249 while (first < last) {
250 temp = *first; *first = *last; *last = temp; first++; last--;
251 }
252 /* Put back the options in order */
253 first = &argv[first_nonopt];
254 first_nonopt += (optind - last_nonopt);
255 last = &argv[first_nonopt - 1];
256 while (first < last) {
257 temp = *first; *first = *last; *last = temp; first++; last--;
258 }
259
260 /* Put back the non options in order */
261 first = &argv[first_nonopt];
262 last_nonopt = optind;
263 last = &argv[last_nonopt-1];
264 while (first < last) {
265 temp = *first; *first = *last; *last = temp; first++; last--;
266 }
267 }
268
269 /* Scan elements of ARGV (whose length is ARGC) for option characters
270 given in OPTSTRING.
271
272 If an element of ARGV starts with '-', and is not exactly "-" or "--",
273 then it is an option element. The characters of this element
274 (aside from the initial '-') are option characters. If `getopt'
275 is called repeatedly, it returns successively each of the option characters
276 from each of the option elements.
277
278 If `getopt' finds another option character, it returns that character,
279 updating `optind' and `nextchar' so that the next call to `getopt' can
280 resume the scan with the following option character or ARGV-element.
281
282 If there are no more option characters, `getopt' returns `EOF'.
283 Then `optind' is the index in ARGV of the first ARGV-element
284 that is not an option. (The ARGV-elements have been permuted
285 so that those that are not options now come last.)
286
287 OPTSTRING is a string containing the legitimate option characters.
288 If an option character is seen that is not listed in OPTSTRING,
289 return BAD_OPTION after printing an error message. If you set `opterr' to
290 zero, the error message is suppressed but we still return BAD_OPTION.
291
292 If a char in OPTSTRING is followed by a colon, that means it wants an arg,
293 so the following text in the same ARGV-element, or the text of the following
294 ARGV-element, is returned in `optarg'. Two colons mean an option that
295 wants an optional arg; if there is text in the current ARGV-element,
296 it is returned in `optarg', otherwise `optarg' is set to zero.
297
298 If OPTSTRING starts with `-' or `+', it requests different methods of
299 handling the non-option ARGV-elements.
300 See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
301
302 Long-named options begin with `--' instead of `-'.
303 Their names may be abbreviated as long as the abbreviation is unique
304 or is an exact match for some defined option. If they have an
305 argument, it follows the option name in the same ARGV-element, separated
306 from the option name by a `=', or else the in next ARGV-element.
307 When `getopt' finds a long-named option, it returns 0 if that option's
308 `flag' field is nonzero, the value of the option's `val' field
309 if the `flag' field is zero.
310
311 The elements of ARGV aren't really const, because we permute them.
312 But we pretend they're const in the prototype to be compatible
313 with other systems.
314
315 LONGOPTS is a vector of `struct option' terminated by an
316 element containing a name which is zero.
317
318 LONGIND returns the index in LONGOPT of the long-named option found.
319 It is only valid when a long-named option has been found by the most
320 recent call.
321
322 If LONG_ONLY is nonzero, '-' as well as '--' can introduce
323 long-named options. */
324
325 int
326 _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
327 int argc;
328 char *const *argv;
329 const char *optstring;
330 const struct option *longopts;
331 int *longind;
332 int long_only;
333 {
334 int option_index;
335
336 optarg = 0;
337
338 /* Initialize the internal data when the first call is made.
339 Start processing options with ARGV-element 1 (since ARGV-element 0
340 is the program name); the sequence of previously skipped
341 non-option ARGV-elements is empty. */
342
343 if (optind == 0)
344 {
345 first_nonopt = last_nonopt = optind = 1;
346
347 nextchar = NULL;
348
349 /* Determine how to handle the ordering of options and nonoptions. */
350
351 if (optstring[0] == '-')
352 {
353 ordering = RETURN_IN_ORDER;
354 ++optstring;
355 }
356 else if (optstring[0] == '+')
357 {
358 ordering = REQUIRE_ORDER;
359 ++optstring;
360 }
361 else if (getenv ("POSIXLY_CORRECT") != NULL)
362 ordering = REQUIRE_ORDER;
363 else
364 ordering = PERMUTE;
365 }
366
367 if (nextchar == NULL || *nextchar == '\0')
368 {
369 if (ordering == PERMUTE)
370 {
371 /* If we have just processed some options following some non-options,
372 exchange them so that the options come first. */
373
374 if (first_nonopt != last_nonopt && last_nonopt != optind)
375 exchange ((char **) argv);
376 else if (last_nonopt != optind)
377 first_nonopt = optind;
378
379 /* Now skip any additional non-options
380 and extend the range of non-options previously skipped. */
381
382 while (optind < argc
383 && (argv[optind][0] != '-' || argv[optind][1] == '\0')
384 #ifdef GETOPT_COMPAT
385 && (longopts == NULL
386 || argv[optind][0] != '+' || argv[optind][1] == '\0')
387 #endif /* GETOPT_COMPAT */
388 )
389 optind++;
390 last_nonopt = optind;
391 }
392
393 /* Special ARGV-element `--' means premature end of options.
394 Skip it like a null option,
395 then exchange with previous non-options as if it were an option,
396 then skip everything else like a non-option. */
397
398 if (optind != argc && !strcmp (argv[optind], "--"))
399 {
400 optind++;
401
402 if (first_nonopt != last_nonopt && last_nonopt != optind)
403 exchange ((char **) argv);
404 else if (first_nonopt == last_nonopt)
405 first_nonopt = optind;
406 last_nonopt = argc;
407
408 optind = argc;
409 }
410
411 /* If we have done all the ARGV-elements, stop the scan
412 and back over any non-options that we skipped and permuted. */
413
414 if (optind == argc)
415 {
416 /* Set the next-arg-index to point at the non-options
417 that we previously skipped, so the caller will digest them. */
418 if (first_nonopt != last_nonopt)
419 optind = first_nonopt;
420 return EOF;
421 }
422
423 /* If we have come to a non-option and did not permute it,
424 either stop the scan or describe it to the caller and pass it by. */
425
426 if ((argv[optind][0] != '-' || argv[optind][1] == '\0')
427 #ifdef GETOPT_COMPAT
428 && (longopts == NULL
429 || argv[optind][0] != '+' || argv[optind][1] == '\0')
430 #endif /* GETOPT_COMPAT */
431 )
432 {
433 if (ordering == REQUIRE_ORDER)
434 return EOF;
435 optarg = argv[optind++];
436 return 1;
437 }
438
439 /* We have found another option-ARGV-element.
440 Start decoding its characters. */
441
442 nextchar = (argv[optind] + 1
443 + (longopts != NULL && argv[optind][1] == '-'));
444 }
445
446 if (longopts != NULL
447 && ((argv[optind][0] == '-'
448 && (argv[optind][1] == '-' || long_only))
449 #ifdef GETOPT_COMPAT
450 || argv[optind][0] == '+'
451 #endif /* GETOPT_COMPAT */
452 ))
453 {
454 const struct option *p;
455 char *s = nextchar;
456 int exact = 0;
457 int ambig = 0;
458 const struct option *pfound = NULL;
459 int indfound = 0;
460
461 while (*s && *s != '=')
462 s++;
463
464 /* Test all options for either exact match or abbreviated matches. */
465 for (p = longopts, option_index = 0; p->name;
466 p++, option_index++)
467 if (!strncmp (p->name, nextchar, s - nextchar))
468 {
469 if (s - nextchar == my_strlen (p->name))
470 {
471 /* Exact match found. */
472 pfound = p;
473 indfound = option_index;
474 exact = 1;
475 break;
476 }
477 else if (pfound == NULL)
478 {
479 /* First nonexact match found. */
480 pfound = p;
481 indfound = option_index;
482 }
483 else
484 /* Second nonexact match found. */
485 ambig = 1;
486 }
487
488 if (ambig && !exact)
489 {
490 if (opterr)
491 fprintf (stderr, "%s: option `%s' is ambiguous\n",
492 argv[0], argv[optind]);
493 nextchar += my_strlen (nextchar);
494 optind++;
495 return BAD_OPTION;
496 }
497
498 if (pfound != NULL)
499 {
500 option_index = indfound;
501 optind++;
502 if (*s)
503 {
504 /* Don't test has_arg with >, because some C compilers don't
505 allow it to be used on enums. */
506 if (pfound->has_arg)
507 optarg = s + 1;
508 else
509 {
510 if (opterr)
511 {
512 if (argv[optind - 1][1] == '-')
513 /* --option */
514 fprintf (stderr,
515 "%s: option `--%s' doesn't allow an argument\n",
516 argv[0], pfound->name);
517 else
518 /* +option or -option */
519 fprintf (stderr,
520 "%s: option `%c%s' doesn't allow an argument\n",
521 argv[0], argv[optind - 1][0], pfound->name);
522 }
523 nextchar += my_strlen (nextchar);
524 return BAD_OPTION;
525 }
526 }
527 else if (pfound->has_arg == 1)
528 {
529 if (optind < argc)
530 optarg = argv[optind++];
531 else
532 {
533 if (opterr)
534 fprintf (stderr, "%s: option `%s' requires an argument\n",
535 argv[0], argv[optind - 1]);
536 nextchar += my_strlen (nextchar);
537 return optstring[0] == ':' ? ':' : BAD_OPTION;
538 }
539 }
540 nextchar += my_strlen (nextchar);
541 if (longind != NULL)
542 *longind = option_index;
543 if (pfound->flag)
544 {
545 *(pfound->flag) = pfound->val;
546 return 0;
547 }
548 return pfound->val;
549 }
550 /* Can't find it as a long option. If this is not getopt_long_only,
551 or the option starts with '--' or is not a valid short
552 option, then it's an error.
553 Otherwise interpret it as a short option. */
554 if (!long_only || argv[optind][1] == '-'
555 #ifdef GETOPT_COMPAT
556 || argv[optind][0] == '+'
557 #endif /* GETOPT_COMPAT */
558 || my_index (optstring, *nextchar) == NULL)
559 {
560 if (opterr)
561 {
562 if (argv[optind][1] == '-')
563 /* --option */
564 fprintf (stderr, "%s: unrecognized option `--%s'\n",
565 argv[0], nextchar);
566 else
567 /* +option or -option */
568 fprintf (stderr, "%s: unrecognized option `%c%s'\n",
569 argv[0], argv[optind][0], nextchar);
570 }
571 nextchar = (char *) "";
572 optind++;
573 return BAD_OPTION;
574 }
575 }
576
577 /* Look at and handle the next option-character. */
578
579 {
580 char c = *nextchar++;
581 char *temp = my_index (optstring, c);
582
583 /* Increment `optind' when we start to process its last character. */
584 if (*nextchar == '\0')
585 ++optind;
586
587 if (temp == NULL || c == ':')
588 {
589 if (opterr)
590 {
591 #if 0
592 if (c < 040 || c >= 0177)
593 fprintf (stderr, "%s: unrecognized option, character code 0%o\n",
594 argv[0], c);
595 else
596 fprintf (stderr, "%s: unrecognized option `-%c'\n", argv[0], c);
597 #else
598 /* 1003.2 specifies the format of this message. */
599 fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c);
600 #endif
601 }
602 optopt = c;
603 return BAD_OPTION;
604 }
605 if (temp[1] == ':')
606 {
607 if (temp[2] == ':')
608 {
609 /* This is an option that accepts an argument optionally. */
610 if (*nextchar != '\0')
611 {
612 optarg = nextchar;
613 optind++;
614 }
615 else
616 optarg = 0;
617 nextchar = NULL;
618 }
619 else
620 {
621 /* This is an option that requires an argument. */
622 if (*nextchar != '\0')
623 {
624 optarg = nextchar;
625 /* If we end this ARGV-element by taking the rest as an arg,
626 we must advance to the next element now. */
627 optind++;
628 }
629 else if (optind == argc)
630 {
631 if (opterr)
632 {
633 #if 0
634 fprintf (stderr, "%s: option `-%c' requires an argument\n",
635 argv[0], c);
636 #else
637 /* 1003.2 specifies the format of this message. */
638 fprintf (stderr, "%s: option requires an argument -- %c\n",
639 argv[0], c);
640 #endif
641 }
642 optopt = c;
643 if (optstring[0] == ':')
644 c = ':';
645 else
646 c = BAD_OPTION;
647 }
648 else
649 /* We already incremented `optind' once;
650 increment it again when taking next ARGV-elt as argument. */
651 optarg = argv[optind++];
652 nextchar = NULL;
653 }
654 }
655 return c;
656 }
657 }
658
659 int
660 getopt (argc, argv, optstring)
661 int argc;
662 char *const *argv;
663 const char *optstring;
664 {
665 return _getopt_internal (argc, argv, optstring,
666 (const struct option *) 0,
667 (int *) 0,
668 0);
669 }
670
671 int
672 getopt_long (argc, argv, options, long_options, opt_index)
673 int argc;
674 char *const *argv;
675 const char *options;
676 const struct option *long_options;
677 int *opt_index;
678 {
679 return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
680 }
681
682 #endif /* _LIBC or not __GNU_LIBRARY__. */
683
684 #ifdef TEST
685
686 /* Compile with -DTEST to make an executable for use in testing
687 the above definition of `getopt'. */
688
689 int
690 main (argc, argv)
691 int argc;
692 char **argv;
693 {
694 int c;
695 int digit_optind = 0;
696
697 while (1)
698 {
699 int this_option_optind = optind ? optind : 1;
700
701 c = getopt (argc, argv, "abc:d:0123456789");
702 if (c == EOF)
703 break;
704
705 switch (c)
706 {
707 case '0':
708 case '1':
709 case '2':
710 case '3':
711 case '4':
712 case '5':
713 case '6':
714 case '7':
715 case '8':
716 case '9':
717 if (digit_optind != 0 && digit_optind != this_option_optind)
718 printf ("digits occur in two different argv-elements.\n");
719 digit_optind = this_option_optind;
720 printf ("option %c\n", c);
721 break;
722
723 case 'a':
724 printf ("option a\n");
725 break;
726
727 case 'b':
728 printf ("option b\n");
729 break;
730
731 case 'c':
732 printf ("option c with value `%s'\n", optarg);
733 break;
734
735 case BAD_OPTION:
736 break;
737
738 default:
739 printf ("?? getopt returned character code 0%o ??\n", c);
740 }
741 }
742
743 if (optind < argc)
744 {
745 printf ("non-option ARGV-elements: ");
746 while (optind < argc)
747 printf ("%s ", argv[optind++]);
748 printf ("\n");
749 }
750
751 exit (0);
752 }
753
754 #endif /* TEST */
0 /* Declarations for getopt.
1 Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
2
3 This program is free software; you can redistribute it and/or modify it
4 under the terms of the GNU General Public License as published by the
5 Free Software Foundation; either version 2, or (at your option) any
6 later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
16
17 #ifndef _GETOPT_H
18 #define _GETOPT_H 1
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 #ifndef __MacOSX__
25
26 /* For communication from `getopt' to the caller.
27 When `getopt' finds an option that takes an argument,
28 the argument value is returned here.
29 Also, when `ordering' is RETURN_IN_ORDER,
30 each non-option ARGV-element is returned here. */
31
32 extern char *optarg;
33
34 /* Index in ARGV of the next element to be scanned.
35 This is used for communication to and from the caller
36 and for communication between successive calls to `getopt'.
37
38 On entry to `getopt', zero means this is the first call; initialize.
39
40 When `getopt' returns EOF, this is the index of the first of the
41 non-option elements that the caller should itself scan.
42
43 Otherwise, `optind' communicates from one call to the next
44 how much of ARGV has been scanned so far. */
45
46 extern int optind;
47
48 /* Callers store zero here to inhibit the error message `getopt' prints
49 for unrecognized options. */
50
51 extern int opterr;
52
53 /* Set to an option character which was unrecognized. */
54
55 extern int optopt;
56 #endif
57
58 /* Describe the long-named options requested by the application.
59 The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
60 of `struct option' terminated by an element containing a name which is
61 zero.
62
63 The field `has_arg' is:
64 no_argument (or 0) if the option does not take an argument,
65 required_argument (or 1) if the option requires an argument,
66 optional_argument (or 2) if the option takes an optional argument.
67
68 If the field `flag' is not NULL, it points to a variable that is set
69 to the value given in the field `val' when the option is found, but
70 left unchanged if the option is not found.
71
72 To have a long-named option do something other than set an `int' to
73 a compiled-in constant, such as set a value from `optarg', set the
74 option's `flag' field to zero and its `val' field to a nonzero
75 value (the equivalent single-letter option character, if there is
76 one). For long options that have a zero `flag' field, `getopt'
77 returns the contents of the `val' field. */
78
79 struct option
80 {
81 #if __STDC__
82 const char *name;
83 #else
84 char *name;
85 #endif
86 /* has_arg can't be an enum because some compilers complain about
87 type mismatches in all the code that assumes it is an int. */
88 int has_arg;
89 int *flag;
90 int val;
91 };
92
93 /* Names for the values of the `has_arg' field of `struct option'. */
94
95 #define no_argument 0
96 #define required_argument 1
97 #define optional_argument 2
98
99 //#if __STDC__ || defined(PROTO)
100 #if defined(__GNU_LIBRARY__)
101 /* Many other libraries have conflicting prototypes for getopt, with
102 differences in the consts, in stdlib.h. To avoid compilation
103 errors, only prototype getopt for the GNU C library. */
104 extern int getopt (int argc, char *const *argv, const char *shortopts);
105 #endif /* not __GNU_LIBRARY__ */
106 extern int getopt_long (int argc, char *const *argv, const char *shortopts,
107 const struct option *longopts, int *longind);
108 extern int getopt_long_only (int argc, char *const *argv,
109 const char *shortopts,
110 const struct option *longopts, int *longind);
111
112 /* Internal only. Users should not call this directly. */
113 extern int _getopt_internal (int argc, char *const *argv,
114 const char *shortopts,
115 const struct option *longopts, int *longind,
116 int long_only);
117 //#else /* not __STDC__ */
118 extern int getopt (int argc, char *const *argv, const char *shortopts);
119 //extern int getopt_long ();
120 //extern int getopt_long_only ();
121
122 //extern int _getopt_internal ();
123 //#endif /* not __STDC__ */
124
125 #ifdef __cplusplus
126 }
127 #endif
128
129 #endif /* _GETOPT_H */
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: id3v2tag.c,v 1.4 2003/07/29 08:20:11 menno Exp $
25 **/
26
27 #define WIN32_LEAN_AND_MEAN
28 #include <windows.h>
29 #include <commctrl.h>
30 #include <resource.h>
31
32 #include <id3.h>
33
34 #include <id3v2tag.h>
35
36 HWND m_hwndList;
37
38 LPSTR ID3Frames[] =
39 {
40 "No known frame",
41 "Audio encryption",
42 "Attached picture",
43 "Comments",
44 "Commercial frame",
45 "Encryption method registration",
46 "Equalization",
47 "Event timing codes",
48 "General encapsulated object",
49 "Group identification registration",
50 "Involved people list",
51 "Linked information",
52 "Music CD identifier",
53 "MPEG location lookup table",
54 "Ownership frame",
55 "Private frame",
56 "Play counter",
57 "Popularimeter",
58 "Position synchronisation frame",
59 "Recommended buffer size",
60 "Relative volume adjustment",
61 "Reverb",
62 "Synchronized lyric",
63 "Synchronized tempo codes",
64 "Album title",
65 "BPM (beats per minute)",
66 "Composer",
67 "Genre", //"Content type",
68 "Copyright message",
69 "Date",
70 "Playlist delay",
71 "Encoded by",
72 "Lyricist",
73 "File type",
74 "Time",
75 "Content group description",
76 "Title",
77 "Subtitle",
78 "Initial key",
79 "Language(s)",
80 "Length",
81 "Media type",
82 "Original album title",
83 "Original filename",
84 "Original lyricist(s)",
85 "Original artist(s)",
86 "Original release year",
87 "File owner",
88 "Lead performer(s)",
89 "Band/orchestra/accompaniment",
90 "Conductor/performer refinement",
91 "Interpreted, remixed, or otherwise modified by",
92 "Part of a set",
93 "Publisher",
94 "Track number",
95 "Recording dates",
96 "Internet radio station name",
97 "Internet radio station owner",
98 "Size",
99 "ISRC (international standard recording code)",
100 "Software/Hardware and settings used for encoding",
101 "User defined text information",
102 "Year",
103 "Unique file identifier",
104 "Terms of use",
105 "Unsynchronized lyric",
106 "Commercial information",
107 "Copyright/Legal information",
108 "Official audio file webpage",
109 "Official artist webpage",
110 "Official audio source webpage",
111 "Official internet radio station homepage",
112 "Payment",
113 "Official publisher webpage",
114 "User defined URL link",
115 "Encrypted meta frame (id3v2.2.x)",
116 "Compressed meta frame (id3v2.2.1)"
117 };
118
119 ID3GENRES ID3Genres[]=
120 {
121 123, "Acapella",
122 34, "Acid",
123 74, "Acid Jazz",
124 73, "Acid Punk",
125 99, "Acoustic",
126 20, "Alternative",
127 40, "AlternRock",
128 26, "Ambient",
129 90, "Avantgarde",
130 116, "Ballad",
131 41, "Bass",
132 85, "Bebob",
133 96, "Big Band",
134 89, "Bluegrass",
135 0, "Blues",
136 107, "Booty Bass",
137 65, "Cabaret",
138 88, "Celtic",
139 104, "Chamber Music",
140 102, "Chanson",
141 97, "Chorus",
142 61, "Christian Rap",
143 1, "Classic Rock",
144 32, "Classical",
145 112, "Club",
146 57, "Comedy",
147 2, "Country",
148 58, "Cult",
149 3, "Dance",
150 125, "Dance Hall",
151 50, "Darkwave",
152 254, "Data",
153 22, "Death Metal",
154 4, "Disco",
155 55, "Dream",
156 122, "Drum Solo",
157 120, "Duet",
158 98, "Easy Listening",
159 52, "Electronic",
160 48, "Ethnic",
161 124, "Euro-House",
162 25, "Euro-Techno",
163 54, "Eurodance",
164 84, "Fast Fusion",
165 80, "Folk",
166 81, "Folk-Rock",
167 115, "Folklore",
168 119, "Freestyle",
169 5, "Funk",
170 30, "Fusion",
171 36, "Game",
172 59, "Gangsta",
173 38, "Gospel",
174 49, "Gothic",
175 91, "Gothic Rock",
176 6, "Grunge",
177 79, "Hard Rock",
178 7, "Hip-Hop",
179 35, "House",
180 100, "Humour",
181 19, "Industrial",
182 33, "Instrumental",
183 46, "Instrumental Pop",
184 47, "Instrumental Rock",
185 8, "Jazz",
186 29, "Jazz+Funk",
187 63, "Jungle",
188 86, "Latin",
189 71, "Lo-Fi",
190 45, "Meditative",
191 9, "Metal",
192 77, "Musical",
193 82, "National Folk",
194 64, "Native American",
195 10, "New Age",
196 66, "New Wave",
197 39, "Noise",
198 255, "Not Set",
199 11, "Oldies",
200 103, "Opera",
201 12, "Other",
202 75, "Polka",
203 13, "Pop",
204 62, "Pop/Funk",
205 53, "Pop-Folk",
206 109, "Porn Groove",
207 117, "Power Ballad",
208 23, "Pranks",
209 108, "Primus",
210 92, "Progressive Rock",
211 67, "Psychadelic",
212 93, "Psychedelic Rock",
213 43, "Punk",
214 121, "Punk Rock",
215 14, "R&B",
216 15, "Rap",
217 68, "Rave",
218 16, "Reggae",
219 76, "Retro",
220 87, "Revival",
221 118, "Rhythmic Soul",
222 17, "Rock",
223 78, "Rock & Roll",
224 114, "Samba",
225 110, "Satire",
226 69, "Showtunes",
227 21, "Ska",
228 111, "Slow Jam",
229 95, "Slow Rock",
230 105, "Sonata",
231 42, "Soul",
232 37, "Sound Clip",
233 24, "Soundtrack",
234 56, "Southern Rock",
235 44, "Space",
236 101, "Speech",
237 83, "Swing",
238 94, "Symphonic Rock",
239 106, "Symphony",
240 113, "Tango",
241 18, "Techno",
242 51, "Techno-Industrial",
243 60, "Top 40",
244 70, "Trailer",
245 31, "Trance",
246 72, "Tribal",
247 27, "Trip-Hop",
248 28, "Vocal"
249 };
250
251 const int NUMFRAMES = sizeof(ID3Frames)/sizeof(ID3Frames[0]);
252 const int NUMGENRES = sizeof(ID3Genres)/sizeof(ID3Genres[0]);
253
254
255 LPSTR DupString(LPSTR lpsz)
256 {
257 int cb = lstrlen(lpsz) + 1;
258 LPSTR lpszNew = LocalAlloc(LMEM_FIXED, cb);
259 if (lpszNew != NULL)
260 CopyMemory(lpszNew, lpsz, cb);
261 return lpszNew;
262 }
263
264 LPSTR GetFrameDesc(ID3_FrameID id)
265 {
266 return DupString(ID3Frames[id]);
267 }
268
269 LPSTR GetGenre(LPSTR lpsz)
270 {
271 int id = atoi(lpsz + 1);
272 int i;
273
274 if ((*(lpsz + 1) > '0') && (*(lpsz + 1) < '9'))
275 {
276 for (i = 0; i < NUMGENRES; i++)
277 {
278 if (id == ID3Genres[i].id)
279 return DupString(ID3Genres[i].name);
280 }
281 }
282 return DupString(lpsz);
283 }
284
285 void FillID3List(HWND hwndDlg, HWND hwndList, char *filename)
286 {
287 ID3Tag *tag;
288 ID3Frame *frame;
289 ID3Field *field;
290 ID3_FrameID eFrameID;
291 char info[1024];
292 int numFrames;
293 int i;
294 int iItem = 0;
295
296
297 if ((tag = ID3Tag_New()) != NULL)
298 {
299 ID3Tag_Link(tag, filename);
300
301 numFrames = ID3Tag_NumFrames(tag);
302
303 for (i = 0; i < numFrames; i++)
304 {
305 iItem++;
306
307 frame = ID3Tag_GetFrameNum(tag, i);
308 eFrameID = ID3Frame_GetID(frame);
309
310 switch (eFrameID)
311 {
312 case ID3FID_ALBUM: case ID3FID_BPM:
313 case ID3FID_COMPOSER: case ID3FID_CONTENTTYPE:
314 case ID3FID_COPYRIGHT: case ID3FID_DATE:
315 case ID3FID_PLAYLISTDELAY: case ID3FID_ENCODEDBY:
316 case ID3FID_LYRICIST: case ID3FID_FILETYPE:
317 case ID3FID_TIME: case ID3FID_CONTENTGROUP:
318 case ID3FID_TITLE: case ID3FID_SUBTITLE:
319 case ID3FID_INITIALKEY: case ID3FID_LANGUAGE:
320 case ID3FID_SONGLEN: case ID3FID_MEDIATYPE:
321 case ID3FID_ORIGALBUM: case ID3FID_ORIGFILENAME:
322 case ID3FID_ORIGLYRICIST: case ID3FID_ORIGARTIST:
323 case ID3FID_ORIGYEAR: case ID3FID_FILEOWNER:
324 case ID3FID_LEADARTIST: case ID3FID_BAND:
325 case ID3FID_CONDUCTOR: case ID3FID_MIXARTIST:
326 case ID3FID_PARTINSET: case ID3FID_PUBLISHER:
327 case ID3FID_TRACKNUM: case ID3FID_RECORDINGDATES:
328 case ID3FID_NETRADIOSTATION: case ID3FID_NETRADIOOWNER:
329 case ID3FID_SIZE: case ID3FID_ISRC:
330 case ID3FID_ENCODERSETTINGS: case ID3FID_YEAR:
331 {
332 LV_ITEM lvi;
333 ID3ITEM *pItem = LocalAlloc(LPTR, sizeof(ID3ITEM));
334
335 /* Initialize LV_ITEM members that are common to all items. */
336 lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE;
337 lvi.state = 0;
338 lvi.stateMask = 0;
339 lvi.pszText = LPSTR_TEXTCALLBACK; /* app. maintains text */
340 lvi.iImage = 0;
341 lvi.iItem = iItem;
342 lvi.iSubItem = 0;
343
344 pItem->frameId = eFrameID;
345 pItem->aCols[0] = GetFrameDesc(eFrameID);
346
347 field = ID3Frame_GetField(frame, ID3FN_TEXT);
348 ID3Field_GetASCII(field, info, 1024, 1);
349 if (eFrameID == ID3FID_CONTENTTYPE)
350 pItem->aCols[1] = GetGenre(info);
351 else
352 pItem->aCols[1] = DupString(info);
353
354 lvi.lParam = (LPARAM)pItem; /* item data */
355
356 /* Add the item. */
357 ListView_InsertItem(hwndList, &lvi);
358
359 break;
360 }
361 case ID3FID_USERTEXT:
362 case ID3FID_COMMENT: /* Can also contain an extra language field (but not used now) */
363 case ID3FID_UNSYNCEDLYRICS: /* Can also contain an extra language field (but not used now) */
364 {
365 LV_ITEM lvi;
366 ID3ITEM *pItem = LocalAlloc(LPTR, sizeof(ID3ITEM));
367
368 /* Initialize LV_ITEM members that are common to all items. */
369 lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE;
370 lvi.state = 0;
371 lvi.stateMask = 0;
372 lvi.pszText = LPSTR_TEXTCALLBACK; /* app. maintains text */
373 lvi.iImage = 0;
374 lvi.iItem = iItem;
375 lvi.iSubItem = 0;
376
377 pItem->frameId = eFrameID;
378
379 field = ID3Frame_GetField(frame, ID3FN_DESCRIPTION);
380 ID3Field_GetASCII(field, info, 1024, 1);
381 pItem->aCols[0] = DupString(info);
382
383 field = ID3Frame_GetField(frame, ID3FN_TEXT);
384 ID3Field_GetASCII(field, info, 1024, 1);
385 pItem->aCols[1] = DupString(info);
386
387 lvi.lParam = (LPARAM)pItem; /* item data */
388
389 /* Add the item. */
390 ListView_InsertItem(hwndList, &lvi);
391
392 break;
393 }
394 case ID3FID_WWWAUDIOFILE: case ID3FID_WWWARTIST:
395 case ID3FID_WWWAUDIOSOURCE: case ID3FID_WWWCOMMERCIALINFO:
396 case ID3FID_WWWCOPYRIGHT: case ID3FID_WWWPUBLISHER:
397 case ID3FID_WWWPAYMENT: case ID3FID_WWWRADIOPAGE:
398 {
399 LV_ITEM lvi;
400 ID3ITEM *pItem = LocalAlloc(LPTR, sizeof(ID3ITEM));
401
402 /* Initialize LV_ITEM members that are common to all items. */
403 lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE;
404 lvi.state = 0;
405 lvi.stateMask = 0;
406 lvi.pszText = LPSTR_TEXTCALLBACK; /* app. maintains text */
407 lvi.iImage = 0;
408 lvi.iItem = iItem;
409 lvi.iSubItem = 0;
410
411 pItem->frameId = eFrameID;
412
413 pItem->aCols[0] = GetFrameDesc(eFrameID);
414
415 field = ID3Frame_GetField(frame, ID3FN_URL);
416 ID3Field_GetASCII(field, info, 1024, 1);
417 pItem->aCols[1] = DupString(info);
418
419 lvi.lParam = (LPARAM)pItem; /* item data */
420
421 /* Add the item. */
422 ListView_InsertItem(hwndList, &lvi);
423
424 break;
425 }
426 case ID3FID_WWWUSER:
427 {
428 LV_ITEM lvi;
429 ID3ITEM *pItem = LocalAlloc(LPTR, sizeof(ID3ITEM));
430
431 /* Initialize LV_ITEM members that are common to all items. */
432 lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE;
433 lvi.state = 0;
434 lvi.stateMask = 0;
435 lvi.pszText = LPSTR_TEXTCALLBACK; /* app. maintains text */
436 lvi.iImage = 0;
437 lvi.iItem = iItem;
438 lvi.iSubItem = 0;
439
440 pItem->frameId = eFrameID;
441
442 field = ID3Frame_GetField(frame, ID3FN_DESCRIPTION);
443 ID3Field_GetASCII(field, info, 1024, 1);
444 pItem->aCols[0] = DupString(info);
445
446 field = ID3Frame_GetField(frame, ID3FN_URL);
447 ID3Field_GetASCII(field, info, 1024, 1);
448 pItem->aCols[1] = DupString(info);
449
450 lvi.lParam = (LPARAM)pItem; /* item data */
451
452 /* Add the item. */
453 ListView_InsertItem(hwndList, &lvi);
454
455 break;
456 }
457 default:
458 break;
459 }
460 }
461 ID3Tag_Delete(tag);
462 }
463 }
464
465 BOOL CALLBACK AddFrameProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
466 {
467 int i, cursel;
468
469 switch (message) {
470 case WM_INITDIALOG:
471 EnableWindow(GetDlgItem(hwndDlg, IDC_COL0), FALSE);
472 EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE);
473
474 /* Note: FRAMEID is the index in the combo box + 1 */
475 for (i = 1; i < NUMFRAMES; i++)
476 {
477 SendMessage(GetDlgItem(hwndDlg, IDC_FRAMETYPE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)ID3Frames[i]);
478 }
479 return TRUE;
480
481 case WM_COMMAND:
482 switch (LOWORD(wParam)) {
483 case IDC_FRAMETYPE:
484 if (HIWORD(wParam) == CBN_SELCHANGE)
485 {
486 cursel = SendMessage(GetDlgItem(hwndDlg, IDC_FRAMETYPE), CB_GETCURSEL, 0, 0);
487
488 switch (cursel + 1)
489 {
490 case ID3FID_ALBUM: case ID3FID_BPM:
491 case ID3FID_COMPOSER: case ID3FID_COPYRIGHT:
492 case ID3FID_DATE: case ID3FID_PLAYLISTDELAY:
493 case ID3FID_ENCODEDBY: case ID3FID_LYRICIST:
494 case ID3FID_FILETYPE: case ID3FID_TIME:
495 case ID3FID_CONTENTGROUP: case ID3FID_TITLE:
496 case ID3FID_SUBTITLE: case ID3FID_INITIALKEY:
497 case ID3FID_LANGUAGE: case ID3FID_SONGLEN:
498 case ID3FID_MEDIATYPE: case ID3FID_ORIGALBUM:
499 case ID3FID_ORIGFILENAME: case ID3FID_ORIGLYRICIST:
500 case ID3FID_ORIGARTIST: case ID3FID_ORIGYEAR:
501 case ID3FID_FILEOWNER: case ID3FID_LEADARTIST:
502 case ID3FID_BAND: case ID3FID_CONDUCTOR:
503 case ID3FID_MIXARTIST: case ID3FID_PARTINSET:
504 case ID3FID_PUBLISHER: case ID3FID_TRACKNUM:
505 case ID3FID_RECORDINGDATES: case ID3FID_NETRADIOSTATION:
506 case ID3FID_NETRADIOOWNER: case ID3FID_SIZE:
507 case ID3FID_ISRC: case ID3FID_ENCODERSETTINGS:
508 case ID3FID_YEAR: case ID3FID_WWWAUDIOFILE:
509 case ID3FID_WWWARTIST: case ID3FID_WWWAUDIOSOURCE:
510 case ID3FID_WWWCOMMERCIALINFO: case ID3FID_WWWCOPYRIGHT:
511 case ID3FID_WWWPUBLISHER: case ID3FID_WWWPAYMENT:
512 case ID3FID_WWWRADIOPAGE: case ID3FID_CONTENTTYPE:
513 {
514 SetDlgItemText(hwndDlg, IDC_COL0, ID3Frames[cursel+1]);
515 EnableWindow(GetDlgItem(hwndDlg, IDC_COL0), FALSE);
516 EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
517 break;
518 }
519 case ID3FID_USERTEXT: case ID3FID_COMMENT:
520 case ID3FID_UNSYNCEDLYRICS: case ID3FID_WWWUSER:
521 {
522 SetDlgItemText(hwndDlg, IDC_COL0, ID3Frames[cursel+1]);
523 EnableWindow(GetDlgItem(hwndDlg, IDC_COL0), TRUE);
524 EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
525 break;
526 }
527 default:
528 MessageBox(hwndDlg, "Sorry, this frame type cannot be added (yet).", "Sorry", MB_OK);
529 EnableWindow(GetDlgItem(hwndDlg, IDC_COL0), FALSE);
530 EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE);
531 break;
532 }
533 }
534 return TRUE;
535 case IDOK:
536 {
537 LV_ITEM lvi;
538 ID3ITEM *pItem = LocalAlloc(LPTR, sizeof(ID3ITEM));
539 char *col0 = LocalAlloc(LPTR, 1024);
540 char *col1 = LocalAlloc(LPTR, 1024);
541
542 /* Initialize LV_ITEM members that are common to all items. */
543 lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE;
544 lvi.state = 0;
545 lvi.stateMask = 0;
546 lvi.pszText = LPSTR_TEXTCALLBACK; /* app. maintains text */
547 lvi.iImage = 0;
548 lvi.iItem = ListView_GetItemCount(m_hwndList) + 1;
549 lvi.iSubItem = 0;
550
551 cursel = SendMessage(GetDlgItem(hwndDlg, IDC_FRAMETYPE), CB_GETCURSEL, 0, 0);
552 pItem->frameId = cursel + 1;
553 GetDlgItemText(hwndDlg, IDC_COL0, col0, 1024);
554 GetDlgItemText(hwndDlg, IDC_COL1, col1, 1024);
555 pItem->aCols[0] = col0;
556 pItem->aCols[1] = col1;
557
558 lvi.lParam = (LPARAM)pItem; /* item data */
559
560 /* Add the item. */
561 ListView_InsertItem(m_hwndList, &lvi);
562 ListView_Update(m_hwndList, lvi.iItem);
563 }
564 case IDCANCEL:
565 EndDialog(hwndDlg, wParam);
566 return TRUE;
567 }
568 }
569 return FALSE;
570 }
571
572 BOOL List_AddFrame(HWND hwndApp, HWND hwndList)
573 {
574 int result;
575
576 m_hwndList = hwndList;
577
578 result = DialogBox(hInstance_for_id3editor, MAKEINTRESOURCE(IDD_ADDFRAME),
579 hwndApp, AddFrameProc);
580
581 if (LOWORD(result) == IDOK)
582 return TRUE;
583 return FALSE;
584 }
585
586
587 void InsertTextFrame(HWND dlg, HWND list, int control, int item, int frame_id)
588 {
589 LV_ITEM lvi;
590 ID3ITEM *pItem = LocalAlloc(LPTR, sizeof(ID3ITEM));
591
592 /* Initialize LV_ITEM members that are common to all items. */
593 lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE;
594 lvi.state = 0;
595 lvi.stateMask = 0;
596 lvi.pszText = LPSTR_TEXTCALLBACK; /* app. maintains text */
597 lvi.iImage = 0;
598 lvi.iItem = item;
599 lvi.iSubItem = 0;
600
601 pItem->frameId = frame_id;
602 pItem->aCols[0] = GetFrameDesc(frame_id);
603
604 pItem->aCols[1] = LocalAlloc(LPTR, 1024);
605 GetDlgItemText(dlg, control, pItem->aCols[1], 1024);
606
607 lvi.lParam = (LPARAM)pItem; /* item data */
608
609 /* Add the item. */
610 ListView_InsertItem(list, &lvi);
611 }
612
613 void AddFrameFromRAWData(HWND hwndList, int frameId, LPSTR data1, LPSTR data2)
614 {
615 LV_ITEM lvi;
616 ID3ITEM *pItem = LocalAlloc(LPTR, sizeof(ID3ITEM));
617 int nextItem;
618
619 nextItem = ListView_GetItemCount(hwndList);
620
621 /* Initialize LV_ITEM members that are common to all items. */
622 lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE;
623 lvi.state = 0;
624 lvi.stateMask = 0;
625 lvi.pszText = LPSTR_TEXTCALLBACK; /* app. maintains text */
626 lvi.iImage = 0;
627 lvi.iItem = nextItem;
628 lvi.iSubItem = 0;
629
630 pItem->frameId = frameId;
631
632 pItem->aCols[0] = LocalAlloc(LPTR, 1024);
633 pItem->aCols[1] = LocalAlloc(LPTR, 1024);
634
635 lstrcpy(pItem->aCols[0], data1);
636 lstrcpy(pItem->aCols[1], data2);
637
638 lvi.lParam = (LPARAM)pItem; /* item data */
639
640 /* Add the item. */
641 ListView_InsertItem(hwndList, &lvi);
642 }
643
644 HWND m_hwndDlg;
645 int changed;
646
647 BOOL CALLBACK AddStandardProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
648 {
649 int added = 0;
650
651 switch (message) {
652 case WM_INITDIALOG:
653 changed = 0;
654 return TRUE;
655
656 case WM_COMMAND:
657 switch (LOWORD(wParam)) {
658 case IDOK:
659 {
660 if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_TRACK)) > 0) {
661 InsertTextFrame(hwndDlg, m_hwndList, IDC_TRACK, ListView_GetItemCount(m_hwndList)+1, ID3FID_TRACKNUM);
662 added++;
663 }
664
665 if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_TITLE)) > 0) {
666 InsertTextFrame(hwndDlg, m_hwndList, IDC_TITLE, ListView_GetItemCount(m_hwndList)+1, ID3FID_TITLE);
667 added++;
668 }
669
670 if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_ARTIST)) > 0) {
671 InsertTextFrame(hwndDlg, m_hwndList, IDC_ARTIST, ListView_GetItemCount(m_hwndList)+1, ID3FID_LEADARTIST);
672 added++;
673 }
674
675 if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_ALBUM)) > 0) {
676 InsertTextFrame(hwndDlg, m_hwndList, IDC_ALBUM, ListView_GetItemCount(m_hwndList)+1, ID3FID_ALBUM);
677 added++;
678 }
679
680 if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_YEAR)) > 0) {
681 InsertTextFrame(hwndDlg, m_hwndList, IDC_YEAR, ListView_GetItemCount(m_hwndList)+1, ID3FID_YEAR);
682 added++;
683 }
684
685 if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_GENRE)) > 0) {
686 InsertTextFrame(hwndDlg, m_hwndList, IDC_GENRE, ListView_GetItemCount(m_hwndList)+1, ID3FID_CONTENTTYPE);
687 added++;
688 }
689
690 if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_COMMENT)) > 0) {
691 InsertTextFrame(hwndDlg, m_hwndList, IDC_COMMENT, ListView_GetItemCount(m_hwndList)+1, ID3FID_COMMENT);
692 added++;
693 }
694
695 if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_COMPOSER)) > 0) {
696 InsertTextFrame(hwndDlg, m_hwndList, IDC_COMPOSER, ListView_GetItemCount(m_hwndList)+1, ID3FID_COMPOSER);
697 added++;
698 }
699
700 if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_ORIGARTIST)) > 0) {
701 InsertTextFrame(hwndDlg, m_hwndList, IDC_ORIGARTIST, ListView_GetItemCount(m_hwndList)+1, ID3FID_ORIGARTIST);
702 added++;
703 }
704
705 if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_COPYRIGHT)) > 0) {
706 InsertTextFrame(hwndDlg, m_hwndList, IDC_COPYRIGHT, ListView_GetItemCount(m_hwndList)+1, ID3FID_COPYRIGHT);
707 added++;
708 }
709
710 if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_URL)) > 0) {
711 InsertTextFrame(hwndDlg, m_hwndList, IDC_URL, ListView_GetItemCount(m_hwndList)+1, ID3FID_WWWARTIST);
712 added++;
713 }
714
715 if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_ENCBY)) > 0) {
716 InsertTextFrame(hwndDlg, m_hwndList, IDC_ENCBY, ListView_GetItemCount(m_hwndList)+1, ID3FID_ENCODEDBY);
717 added++;
718 }
719
720 if (added > 0)
721 changed = 1;
722 }
723 case IDCANCEL:
724 EndDialog(hwndDlg, changed);
725 return TRUE;
726 }
727 }
728 return FALSE;
729 }
730
731
732 BOOL List_AddStandardFrames(HWND hwndApp, HWND hwndList)
733 {
734 int result;
735
736 m_hwndList = hwndList;
737 m_hwndDlg = hwndApp;
738
739 result = DialogBox(hInstance_for_id3editor, MAKEINTRESOURCE(IDD_ADDSTANDARD),
740 hwndApp, AddStandardProc);
741
742 return result?TRUE:FALSE;
743 }
744
745
746 /* List_OnGetDispInfo - processes the LVN_GETDISPINFO */
747 /* notification message. */
748 /* pnmv - value of lParam (points to an LV_DISPINFO structure) */
749 void List_OnGetDispInfo(LV_DISPINFO *pnmv)
750 {
751 /* Provide the item or subitem's text, if requested. */
752 if (pnmv->item.mask & LVIF_TEXT) {
753 ID3ITEM *pItem = (ID3ITEM *) (pnmv->item.lParam);
754 lstrcpy(pnmv->item.pszText,
755 pItem->aCols[pnmv->item.iSubItem]);
756 }
757 }
758
759 ID3ITEM *pItem;
760 int editItemIndex;
761
762 BOOL CALLBACK EditTextFrameProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
763 {
764 LV_ITEM lvi;
765
766 switch (message) {
767 case WM_INITDIALOG:
768 SetDlgItemText(hwndDlg, IDC_TEXTFRAMENAME, pItem->aCols[0]);
769 SetDlgItemText(hwndDlg, IDC_EDITTEXTFRAME, pItem->aCols[1]);
770
771 switch (pItem->frameId)
772 {
773 case ID3FID_ALBUM: case ID3FID_BPM:
774 case ID3FID_COMPOSER: case ID3FID_COPYRIGHT:
775 case ID3FID_DATE: case ID3FID_PLAYLISTDELAY:
776 case ID3FID_ENCODEDBY: case ID3FID_LYRICIST:
777 case ID3FID_FILETYPE: case ID3FID_TIME:
778 case ID3FID_CONTENTGROUP: case ID3FID_TITLE:
779 case ID3FID_SUBTITLE: case ID3FID_INITIALKEY:
780 case ID3FID_LANGUAGE: case ID3FID_SONGLEN:
781 case ID3FID_MEDIATYPE: case ID3FID_ORIGALBUM:
782 case ID3FID_ORIGFILENAME: case ID3FID_ORIGLYRICIST:
783 case ID3FID_ORIGARTIST: case ID3FID_ORIGYEAR:
784 case ID3FID_FILEOWNER: case ID3FID_LEADARTIST:
785 case ID3FID_BAND: case ID3FID_CONDUCTOR:
786 case ID3FID_MIXARTIST: case ID3FID_PARTINSET:
787 case ID3FID_PUBLISHER: case ID3FID_TRACKNUM:
788 case ID3FID_RECORDINGDATES: case ID3FID_NETRADIOSTATION:
789 case ID3FID_NETRADIOOWNER: case ID3FID_SIZE:
790 case ID3FID_ISRC: case ID3FID_ENCODERSETTINGS:
791 case ID3FID_YEAR: case ID3FID_WWWAUDIOFILE:
792 case ID3FID_WWWARTIST: case ID3FID_WWWAUDIOSOURCE:
793 case ID3FID_WWWCOMMERCIALINFO: case ID3FID_WWWCOPYRIGHT:
794 case ID3FID_WWWPUBLISHER: case ID3FID_WWWPAYMENT:
795 case ID3FID_WWWRADIOPAGE: case ID3FID_CONTENTTYPE:
796 {
797 EnableWindow(GetDlgItem(hwndDlg, IDC_TEXTFRAMENAME), FALSE);
798 EnableWindow(GetDlgItem(hwndDlg, IDC_EDITTEXTFRAME), TRUE);
799 break;
800 }
801 case ID3FID_USERTEXT: case ID3FID_COMMENT:
802 case ID3FID_UNSYNCEDLYRICS: case ID3FID_WWWUSER:
803 {
804 EnableWindow(GetDlgItem(hwndDlg, IDC_TEXTFRAMENAME), TRUE);
805 EnableWindow(GetDlgItem(hwndDlg, IDC_EDITTEXTFRAME), TRUE);
806 break;
807 }
808 default:
809 EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE);
810 EnableWindow(GetDlgItem(hwndDlg, IDC_TEXTFRAMENAME), FALSE);
811 EnableWindow(GetDlgItem(hwndDlg, IDC_EDITTEXTFRAME), FALSE);
812 break;
813 }
814 return TRUE;
815
816 case WM_COMMAND:
817 switch (LOWORD(wParam)) {
818 case IDOK:
819 {
820 GetDlgItemText(hwndDlg, IDC_TEXTFRAMENAME, pItem->aCols[0], 1024);
821 GetDlgItemText(hwndDlg, IDC_EDITTEXTFRAME, pItem->aCols[1], 1024);
822 lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE;
823 lvi.state = 0;
824 lvi.stateMask = 0;
825 lvi.pszText = LPSTR_TEXTCALLBACK; /* app. maintains text */
826 lvi.iImage = 0;
827 lvi.iItem = editItemIndex;
828 lvi.iSubItem = 0;
829 lvi.lParam = (LPARAM)pItem; /* item data */
830
831 /* Add the item. */
832 ListView_SetItem(m_hwndList, &lvi);
833 ListView_Update(m_hwndList, editItemIndex);
834 } /* Fall through */
835 case IDCANCEL:
836 EndDialog(hwndDlg, wParam);
837 return TRUE;
838 }
839 }
840 return FALSE;
841 }
842
843
844 /* Double clicking means editing a frame */
845 BOOL List_EditData(HWND hwndApp, HWND hwndList)
846 {
847 LV_ITEM lvi;
848 BOOL result;
849
850 /* First get the selected item */
851 int index = ListView_GetNextItem(hwndList, -1, LVNI_SELECTED);
852
853 m_hwndList = hwndList;
854
855 if (index != -1)
856 {
857 lvi.mask = LVIF_PARAM;
858 lvi.iItem = index;
859 lvi.iSubItem = 0;
860
861 if (ListView_GetItem(hwndList, &lvi) == TRUE)
862 {
863 pItem = (ID3ITEM*)lvi.lParam;
864 editItemIndex = lvi.iItem;
865
866 result = DialogBox(hInstance_for_id3editor, MAKEINTRESOURCE(IDD_EDITTEXTFRAME),
867 hwndApp, EditTextFrameProc);
868 if (LOWORD(result) == IDOK)
869 return TRUE;
870 }
871 }
872 return FALSE;
873 }
874
875
876 /* Delete the selected frame */
877 BOOL List_DeleteSelected(HWND hwndApp, HWND hwndList)
878 {
879 int items;
880
881 /* First get the selected item */
882 int index = ListView_GetNextItem(hwndList, -1, LVNI_SELECTED);
883
884 if (index != -1)
885 ListView_DeleteItem(hwndList, index);
886
887 items = ListView_GetItemCount(hwndList);
888 if (index != -1) return TRUE;
889 else return FALSE;
890 }
891
892
893 /* Save the ID3 to the file */
894 void List_SaveID3(HWND hwndApp, HWND hwndList, char *filename)
895 {
896 LV_ITEM lvi;
897 ID3ITEM *pItem1;
898 int i, items;
899 ID3Tag *tag;
900 ID3Frame *frame;
901 ID3Field *field;
902
903 /* Strip the tag first, before completely rewriting it */
904 if ((tag = ID3Tag_New()) != NULL)
905 {
906 ID3Tag_Link(tag, filename);
907 ID3Tag_Strip(tag, ID3TT_ALL);
908 ID3Tag_Clear(tag);
909
910 if (SendMessage(GetDlgItem(hwndApp, IDC_ID3V2TAG), BM_GETCHECK, 0, 0) == BST_UNCHECKED)
911 {
912 /* No frames saved */
913 ID3Tag_Delete(tag);
914 EnableWindow(GetDlgItem(hwndApp, IDC_ID3V2TAG), FALSE);
915 ListView_DeleteAllItems(hwndList);
916 return;
917 }
918
919 /* First get the number of items */
920 items = ListView_GetItemCount(hwndList);
921
922 if (items > 0)
923 {
924 for (i = 0; i < items; i++)
925 {
926 lvi.mask = LVIF_PARAM;
927 lvi.iItem = i;
928 lvi.iSubItem = 0;
929
930 if (ListView_GetItem(hwndList, &lvi) == TRUE)
931 {
932 pItem1 = (ID3ITEM*)lvi.lParam;
933
934 frame = ID3Frame_NewID(pItem1->frameId);
935
936 switch (pItem1->frameId)
937 {
938 case ID3FID_ALBUM: case ID3FID_BPM:
939 case ID3FID_COMPOSER: case ID3FID_CONTENTTYPE:
940 case ID3FID_COPYRIGHT: case ID3FID_DATE:
941 case ID3FID_PLAYLISTDELAY: case ID3FID_ENCODEDBY:
942 case ID3FID_LYRICIST: case ID3FID_FILETYPE:
943 case ID3FID_TIME: case ID3FID_CONTENTGROUP:
944 case ID3FID_TITLE: case ID3FID_SUBTITLE:
945 case ID3FID_INITIALKEY: case ID3FID_LANGUAGE:
946 case ID3FID_SONGLEN: case ID3FID_MEDIATYPE:
947 case ID3FID_ORIGALBUM: case ID3FID_ORIGFILENAME:
948 case ID3FID_ORIGLYRICIST: case ID3FID_ORIGARTIST:
949 case ID3FID_ORIGYEAR: case ID3FID_FILEOWNER:
950 case ID3FID_LEADARTIST: case ID3FID_BAND:
951 case ID3FID_CONDUCTOR: case ID3FID_MIXARTIST:
952 case ID3FID_PARTINSET: case ID3FID_PUBLISHER:
953 case ID3FID_TRACKNUM: case ID3FID_RECORDINGDATES:
954 case ID3FID_NETRADIOSTATION: case ID3FID_NETRADIOOWNER:
955 case ID3FID_SIZE: case ID3FID_ISRC:
956 case ID3FID_ENCODERSETTINGS: case ID3FID_YEAR:
957 {
958 field = ID3Frame_GetField(frame, ID3FN_TEXT);
959 ID3Field_SetASCII(field, pItem1->aCols[1]);
960 ID3Tag_AddFrame(tag, frame);
961 break;
962 }
963 case ID3FID_USERTEXT:
964 case ID3FID_COMMENT: /* Can also contain an extra language field (but not used now) */
965 case ID3FID_UNSYNCEDLYRICS: /* Can also contain an extra language field (but not used now) */
966 {
967 field = ID3Frame_GetField(frame, ID3FN_DESCRIPTION);
968 ID3Field_SetASCII(field, pItem1->aCols[0]);
969 field = ID3Frame_GetField(frame, ID3FN_TEXT);
970 ID3Field_SetASCII(field, pItem1->aCols[1]);
971 ID3Tag_AddFrame(tag, frame);
972 break;
973 }
974 case ID3FID_WWWAUDIOFILE: case ID3FID_WWWARTIST:
975 case ID3FID_WWWAUDIOSOURCE: case ID3FID_WWWCOMMERCIALINFO:
976 case ID3FID_WWWCOPYRIGHT: case ID3FID_WWWPUBLISHER:
977 case ID3FID_WWWPAYMENT: case ID3FID_WWWRADIOPAGE:
978 {
979 field = ID3Frame_GetField(frame, ID3FN_URL);
980 ID3Field_SetASCII(field, pItem1->aCols[1]);
981 ID3Tag_AddFrame(tag, frame);
982 break;
983 }
984 case ID3FID_WWWUSER:
985 {
986 field = ID3Frame_GetField(frame, ID3FN_DESCRIPTION);
987 ID3Field_SetASCII(field, pItem1->aCols[0]);
988 field = ID3Frame_GetField(frame, ID3FN_URL);
989 ID3Field_SetASCII(field, pItem1->aCols[1]);
990 ID3Tag_AddFrame(tag, frame);
991 break;
992 }
993 default:
994 break;
995 }
996 }
997 }
998 ID3Tag_UpdateByTagType(tag, ID3TT_ID3V2);
999 }
1000
1001 ID3Tag_Delete(tag);
1002 }
1003 }
1004
1005 /* Get the title from the file */
1006 void GetID3FileTitle(char *filename, char *title, char *format)
1007 {
1008 ID3Tag *tag;
1009 ID3Frame *frame;
1010 ID3Field *field;
1011 char buffer[255];
1012 int some_info = 0;
1013 char *in = format;
1014 char *out = title;
1015 char *bound = out + (MAX_PATH - 10 - 1);
1016
1017
1018 if ((tag = ID3Tag_New()) != NULL)
1019 {
1020 ID3Tag_Link(tag, filename);
1021
1022 while (*in && out < bound)
1023 {
1024 switch (*in) {
1025 case '%':
1026 ++in;
1027 break;
1028
1029 default:
1030 *out++ = *in++;
1031 continue;
1032 }
1033
1034 /* handle % escape sequence */
1035 switch (*in++) {
1036 case '0':
1037 if ((frame = ID3Tag_FindFrameWithID(tag, ID3FID_TRACKNUM)) != NULL) {
1038 int size;
1039 field = ID3Frame_GetField(frame, ID3FN_TEXT);
1040 size = ID3Field_GetASCII(field, buffer, 255, 1);
1041 lstrcpy(out, buffer); out += size;
1042 some_info = 1;
1043 }
1044 break;
1045 case '1':
1046 if ((frame = ID3Tag_FindFrameWithID(tag, ID3FID_LEADARTIST)) != NULL) {
1047 int size;
1048 field = ID3Frame_GetField(frame, ID3FN_TEXT);
1049 size = ID3Field_GetASCII(field, buffer, 255, 1);
1050 lstrcpy(out, buffer); out += size;
1051 some_info = 1;
1052 }
1053 break;
1054 case '2':
1055 if ((frame = ID3Tag_FindFrameWithID(tag, ID3FID_TITLE)) != NULL) {
1056 int size;
1057 field = ID3Frame_GetField(frame, ID3FN_TEXT);
1058 size = ID3Field_GetASCII(field, buffer, 255, 1);
1059 lstrcpy(out, buffer); out += size;
1060 some_info = 1;
1061 }
1062 break;
1063 case '3':
1064 if ((frame = ID3Tag_FindFrameWithID(tag, ID3FID_ALBUM)) != NULL) {
1065 int size;
1066 field = ID3Frame_GetField(frame, ID3FN_TEXT);
1067 size = ID3Field_GetASCII(field, buffer, 255, 1);
1068 lstrcpy(out, buffer); out += size;
1069 some_info = 1;
1070 }
1071 break;
1072 case '4':
1073 if ((frame = ID3Tag_FindFrameWithID(tag, ID3FID_YEAR)) != NULL) {
1074 int size;
1075 field = ID3Frame_GetField(frame, ID3FN_TEXT);
1076 size = ID3Field_GetASCII(field, buffer, 255, 1);
1077 lstrcpy(out, buffer); out += size;
1078 some_info = 1;
1079 }
1080 break;
1081 case '5':
1082 if ((frame = ID3Tag_FindFrameWithID(tag, ID3FID_COMMENT)) != NULL) {
1083 int size;
1084 field = ID3Frame_GetField(frame, ID3FN_TEXT);
1085 size = ID3Field_GetASCII(field, buffer, 255, 1);
1086 lstrcpy(out, buffer); out += size;
1087 some_info = 1;
1088 }
1089 break;
1090 case '6':
1091 if ((frame = ID3Tag_FindFrameWithID(tag, ID3FID_CONTENTTYPE)) != NULL) {
1092 int size; char *tmp;
1093 field = ID3Frame_GetField(frame, ID3FN_TEXT);
1094 size = ID3Field_GetASCII(field, buffer, 255, 1);
1095 tmp = GetGenre(buffer);
1096 lstrcpy(out, tmp); out += size;
1097 some_info = 1;
1098 }
1099 break;
1100 case '7':
1101 {
1102 char *p=filename+lstrlen(filename);
1103 int len = 0;
1104 while (*p != '\\' && p >= filename) { p--; len++; }
1105 lstrcpy(out, ++p); out += len;
1106 some_info = 1;
1107 break;
1108 }
1109 }
1110 }
1111
1112 *out = '\0';
1113 ID3Tag_Delete(tag);
1114 }
1115
1116 if (!some_info)
1117 {
1118 char *p=filename+lstrlen(filename);
1119 while (*p != '\\' && p >= filename) p--;
1120 lstrcpy(title,++p);
1121 }
1122 }
1123
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: id3v2tag.h,v 1.3 2003/07/29 08:20:11 menno Exp $
25 **/
26
27 #ifndef __ID3V2TAG_H__
28 #define __ID3V2TAG_H__
29
30 void GetID3FileTitle(char *filename, char *title, char *format);
31 void FillID3List(HWND hwndDlg, HWND hwndList, char *filename);
32 void List_OnGetDispInfo(LV_DISPINFO *pnmv);
33 BOOL List_EditData(HWND hwndApp, HWND hwndList);
34 void List_SaveID3(HWND hwndApp, HWND hwndList, char *filename);
35 BOOL List_DeleteSelected(HWND hwndApp, HWND hwndList);
36 BOOL List_AddFrame(HWND hwndApp, HWND hwndList);
37 BOOL List_AddStandardFrames(HWND hwndApp, HWND hwndList);
38 void AddFrameFromRAWData(HWND hwndList, int frameId, LPSTR data1, LPSTR data2);
39
40 HINSTANCE hInstance_for_id3editor;
41
42 typedef struct ID3GENRES_TAG
43 {
44 BYTE id;
45 char name[30];
46 } ID3GENRES;
47
48 typedef struct id3item_tag {
49 int frameId;
50 LPSTR aCols[2];
51 } ID3ITEM;
52
53 #endif
0 noinst_LTLIBRARIES = libmp4ff.la
1
2 libmp4ff_la_CFLAGS = -DUSE_TAGGING=1
3
4 libmp4ff_la_SOURCES = mp4ff.c mp4atom.c mp4meta.c mp4sample.c mp4util.c \
5 mp4tagupdate.c mp4ff.h mp4ffint.h mp4ff_int_types.h \
6 drms.h drms.c drmstables.h
7
0 /*****************************************************************************
1 * drms.c: DRMS
2 *****************************************************************************
3 * Copyright (C) 2004 VideoLAN
4 * $Id: drms.c,v 1.7 2005/02/01 13:15:55 menno Exp $
5 *
6 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
7 * Sam Hocevar <sam@zoy.org>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
23
24 #include <stdlib.h> /* malloc(), free() */
25
26 #ifndef _WIN32
27 #include "config.h"
28 #endif
29 #include "mp4ffint.h"
30
31 #ifdef ITUNES_DRM
32
33 #ifdef _WIN32
34 # include <io.h>
35 # include <stdio.h>
36 # include <sys/stat.h>
37 # define PATH_MAX MAX_PATH
38 #else
39 # include <stdio.h>
40 #endif
41
42 #ifdef HAVE_ERRNO_H
43 # include <errno.h>
44 #endif
45
46 #ifdef _WIN32
47 # include <tchar.h>
48 # include <shlobj.h>
49 # include <windows.h>
50 #endif
51
52 #ifdef HAVE_SYS_STAT_H
53 # include <sys/stat.h>
54 #endif
55 #ifdef HAVE_SYS_TYPES_H
56 # include <sys/types.h>
57 #endif
58
59 /* In Solaris (and perhaps others) PATH_MAX is in limits.h. */
60 #ifdef HAVE_LIMITS_H
61 # include <limits.h>
62 #endif
63
64 #ifdef HAVE_IOKIT_IOKITLIB_H
65 # include <mach/mach.h>
66 # include <IOKit/IOKitLib.h>
67 # include <CoreFoundation/CFNumber.h>
68 #endif
69
70 #ifdef HAVE_SYSFS_LIBSYSFS_H
71 # include <sysfs/libsysfs.h>
72 #endif
73
74 #include "drms.h"
75 #include "drmstables.h"
76
77 /*****************************************************************************
78 * aes_s: AES keys structure
79 *****************************************************************************
80 * This structure stores a set of keys usable for encryption and decryption
81 * with the AES/Rijndael algorithm.
82 *****************************************************************************/
83 struct aes_s
84 {
85 uint32_t pp_enc_keys[ AES_KEY_COUNT + 1 ][ 4 ];
86 uint32_t pp_dec_keys[ AES_KEY_COUNT + 1 ][ 4 ];
87 };
88
89 /*****************************************************************************
90 * md5_s: MD5 message structure
91 *****************************************************************************
92 * This structure stores the static information needed to compute an MD5
93 * hash. It has an extra data buffer to allow non-aligned writes.
94 *****************************************************************************/
95 struct md5_s
96 {
97 uint64_t i_bits; /* Total written bits */
98 uint32_t p_digest[4]; /* The MD5 digest */
99 uint32_t p_data[16]; /* Buffer to cache non-aligned writes */
100 };
101
102 /*****************************************************************************
103 * shuffle_s: shuffle structure
104 *****************************************************************************
105 * This structure stores the static information needed to shuffle data using
106 * a custom algorithm.
107 *****************************************************************************/
108 struct shuffle_s
109 {
110 uint32_t p_commands[ 20 ];
111 uint32_t p_bordel[ 16 ];
112 };
113
114 /*****************************************************************************
115 * drms_s: DRMS structure
116 *****************************************************************************
117 * This structure stores the static information needed to decrypt DRMS data.
118 *****************************************************************************/
119 struct drms_s
120 {
121 uint32_t i_user;
122 uint32_t i_key;
123 uint8_t p_iviv[ 16 ];
124 uint8_t *p_name;
125
126 uint32_t p_key[ 4 ];
127 struct aes_s aes;
128
129 char psz_homedir[ PATH_MAX ];
130 };
131
132 /*****************************************************************************
133 * Local prototypes
134 *****************************************************************************/
135 static void InitAES ( struct aes_s *, uint32_t * );
136 static void DecryptAES ( struct aes_s *, uint32_t *, const uint32_t * );
137
138 static void InitMD5 ( struct md5_s * );
139 static void AddMD5 ( struct md5_s *, const uint8_t *, uint32_t );
140 static void EndMD5 ( struct md5_s * );
141 static void Digest ( struct md5_s *, uint32_t * );
142
143 static void InitShuffle ( struct shuffle_s *, uint32_t * );
144 static void DoShuffle ( struct shuffle_s *, uint32_t *, uint32_t );
145
146 static int GetSystemKey ( uint32_t *, uint32_t );
147 static int WriteUserKey ( void *, uint32_t * );
148 static int ReadUserKey ( void *, uint32_t * );
149 static int GetUserKey ( void *, uint32_t * );
150
151 static int GetSCIData ( char *, uint32_t **, uint32_t * );
152 static int HashSystemInfo ( uint32_t * );
153 static int GetiPodID ( int64_t * );
154
155 #ifdef WORDS_BIGENDIAN
156 /*****************************************************************************
157 * Reverse: reverse byte order
158 *****************************************************************************/
159 static __inline void Reverse( uint32_t *p_buffer, int n )
160 {
161 int i;
162
163 for( i = 0; i < n; i++ )
164 {
165 p_buffer[ i ] = GetDWLE(&p_buffer[ i ]);
166 }
167 }
168 # define REVERSE( p, n ) Reverse( p, n )
169 #else
170 # define REVERSE( p, n )
171 #endif
172
173 /*****************************************************************************
174 * BlockXOR: XOR two 128 bit blocks
175 *****************************************************************************/
176 static __inline void BlockXOR( uint32_t *p_dest, uint32_t *p_s1, uint32_t *p_s2 )
177 {
178 int i;
179
180 for( i = 0; i < 4; i++ )
181 {
182 p_dest[ i ] = p_s1[ i ] ^ p_s2[ i ];
183 }
184 }
185
186 /*****************************************************************************
187 * drms_alloc: allocate a DRMS structure
188 *****************************************************************************/
189 void *drms_alloc( char *psz_homedir )
190 {
191 struct drms_s *p_drms;
192
193 p_drms = malloc( sizeof(struct drms_s) );
194
195 if( p_drms == NULL )
196 {
197 return NULL;
198 }
199
200 memset( p_drms, 0, sizeof(struct drms_s) );
201
202 strncpy( p_drms->psz_homedir, psz_homedir, PATH_MAX );
203 p_drms->psz_homedir[ PATH_MAX - 1 ] = '\0';
204
205 return (void *)p_drms;
206 }
207
208 /*****************************************************************************
209 * drms_free: free a previously allocated DRMS structure
210 *****************************************************************************/
211 void drms_free( void *_p_drms )
212 {
213 struct drms_s *p_drms = (struct drms_s *)_p_drms;
214
215 if( p_drms->p_name != NULL )
216 {
217 free( (void *)p_drms->p_name );
218 }
219
220 free( p_drms );
221 }
222
223 /*****************************************************************************
224 * drms_decrypt: unscramble a chunk of data
225 *****************************************************************************/
226 void drms_decrypt( void *_p_drms, uint32_t *p_buffer, uint32_t i_bytes )
227 {
228 struct drms_s *p_drms = (struct drms_s *)_p_drms;
229 uint32_t p_key[ 4 ];
230 unsigned int i_blocks;
231
232 /* AES is a block cypher, round down the byte count */
233 i_blocks = i_bytes / 16;
234 i_bytes = i_blocks * 16;
235
236 /* Initialise the key */
237 memcpy( p_key, p_drms->p_key, 16 );
238
239 /* Unscramble */
240 while( i_blocks-- )
241 {
242 uint32_t p_tmp[ 4 ];
243
244 REVERSE( p_buffer, 4 );
245 DecryptAES( &p_drms->aes, p_tmp, p_buffer );
246 BlockXOR( p_tmp, p_key, p_tmp );
247
248 /* Use the previous scrambled data as the key for next block */
249 memcpy( p_key, p_buffer, 16 );
250
251 /* Copy unscrambled data back to the buffer */
252 memcpy( p_buffer, p_tmp, 16 );
253 REVERSE( p_buffer, 4 );
254
255 p_buffer += 4;
256 }
257 }
258
259 /*****************************************************************************
260 * drms_init: initialise a DRMS structure
261 *****************************************************************************/
262 int drms_init( void *_p_drms, uint32_t i_type,
263 uint8_t *p_info, uint32_t i_len )
264 {
265 struct drms_s *p_drms = (struct drms_s *)_p_drms;
266 int i_ret = 0;
267
268 switch( i_type )
269 {
270 case FOURCC_user:
271 if( i_len < sizeof(p_drms->i_user) )
272 {
273 i_ret = -1;
274 break;
275 }
276
277 p_drms->i_user = U32_AT( p_info );
278 break;
279
280 case FOURCC_key:
281 if( i_len < sizeof(p_drms->i_key) )
282 {
283 i_ret = -1;
284 break;
285 }
286
287 p_drms->i_key = U32_AT( p_info );
288 break;
289
290 case FOURCC_iviv:
291 if( i_len < sizeof(p_drms->p_key) )
292 {
293 i_ret = -1;
294 break;
295 }
296
297 memcpy( p_drms->p_iviv, p_info, 16 );
298 break;
299
300 case FOURCC_name:
301 p_drms->p_name = strdup( p_info );
302
303 if( p_drms->p_name == NULL )
304 {
305 i_ret = -1;
306 }
307 break;
308
309 case FOURCC_priv:
310 {
311 uint32_t p_priv[ 64 ];
312 struct md5_s md5;
313
314 if( i_len < 64 )
315 {
316 i_ret = -1;
317 break;
318 }
319
320 InitMD5( &md5 );
321 AddMD5( &md5, p_drms->p_name, strlen( p_drms->p_name ) );
322 AddMD5( &md5, p_drms->p_iviv, 16 );
323 EndMD5( &md5 );
324
325 if( GetUserKey( p_drms, p_drms->p_key ) )
326 {
327 i_ret = -1;
328 break;
329 }
330
331 InitAES( &p_drms->aes, p_drms->p_key );
332
333 memcpy( p_priv, p_info, 64 );
334 memcpy( p_drms->p_key, md5.p_digest, 16 );
335 drms_decrypt( p_drms, p_priv, 64 );
336 REVERSE( p_priv, 64 );
337
338 if( p_priv[ 0 ] != 0x6e757469 ) /* itun */
339 {
340 i_ret = -1;
341 break;
342 }
343
344 InitAES( &p_drms->aes, p_priv + 6 );
345 memcpy( p_drms->p_key, p_priv + 12, 16 );
346
347 free( (void *)p_drms->p_name );
348 p_drms->p_name = NULL;
349 }
350 break;
351 }
352
353 return i_ret;
354 }
355
356 /* The following functions are local */
357
358 /*****************************************************************************
359 * InitAES: initialise AES/Rijndael encryption/decryption tables
360 *****************************************************************************
361 * The Advanced Encryption Standard (AES) is described in RFC 3268
362 *****************************************************************************/
363 static void InitAES( struct aes_s *p_aes, uint32_t *p_key )
364 {
365 unsigned int i, t;
366 uint32_t i_key, i_seed;
367
368 memset( p_aes->pp_enc_keys[1], 0, 16 );
369 memcpy( p_aes->pp_enc_keys[0], p_key, 16 );
370
371 /* Generate the key tables */
372 i_seed = p_aes->pp_enc_keys[ 0 ][ 3 ];
373
374 for( i_key = 0; i_key < AES_KEY_COUNT; i_key++ )
375 {
376 uint32_t j;
377
378 i_seed = AES_ROR( i_seed, 8 );
379
380 j = p_aes_table[ i_key ];
381
382 j ^= p_aes_encrypt[ (i_seed >> 24) & 0xff ]
383 ^ AES_ROR( p_aes_encrypt[ (i_seed >> 16) & 0xff ], 8 )
384 ^ AES_ROR( p_aes_encrypt[ (i_seed >> 8) & 0xff ], 16 )
385 ^ AES_ROR( p_aes_encrypt[ i_seed & 0xff ], 24 );
386
387 j ^= p_aes->pp_enc_keys[ i_key ][ 0 ];
388 p_aes->pp_enc_keys[ i_key + 1 ][ 0 ] = j;
389 j ^= p_aes->pp_enc_keys[ i_key ][ 1 ];
390 p_aes->pp_enc_keys[ i_key + 1 ][ 1 ] = j;
391 j ^= p_aes->pp_enc_keys[ i_key ][ 2 ];
392 p_aes->pp_enc_keys[ i_key + 1 ][ 2 ] = j;
393 j ^= p_aes->pp_enc_keys[ i_key ][ 3 ];
394 p_aes->pp_enc_keys[ i_key + 1 ][ 3 ] = j;
395
396 i_seed = j;
397 }
398
399 memcpy( p_aes->pp_dec_keys[ 0 ],
400 p_aes->pp_enc_keys[ 0 ], 16 );
401
402 for( i = 1; i < AES_KEY_COUNT; i++ )
403 {
404 for( t = 0; t < 4; t++ )
405 {
406 uint32_t j, k, l, m, n;
407
408 j = p_aes->pp_enc_keys[ i ][ t ];
409
410 k = (((j >> 7) & 0x01010101) * 27) ^ ((j & 0xff7f7f7f) << 1);
411 l = (((k >> 7) & 0x01010101) * 27) ^ ((k & 0xff7f7f7f) << 1);
412 m = (((l >> 7) & 0x01010101) * 27) ^ ((l & 0xff7f7f7f) << 1);
413
414 j ^= m;
415
416 n = AES_ROR( l ^ j, 16 ) ^ AES_ROR( k ^ j, 8 ) ^ AES_ROR( j, 24 );
417
418 p_aes->pp_dec_keys[ i ][ t ] = k ^ l ^ m ^ n;
419 }
420 }
421 }
422
423 /*****************************************************************************
424 * DecryptAES: decrypt an AES/Rijndael 128 bit block
425 *****************************************************************************/
426 static void DecryptAES( struct aes_s *p_aes,
427 uint32_t *p_dest, const uint32_t *p_src )
428 {
429 uint32_t p_wtxt[ 4 ]; /* Working cyphertext */
430 uint32_t p_tmp[ 4 ];
431 unsigned int i_round, t;
432
433 for( t = 0; t < 4; t++ )
434 {
435 /* FIXME: are there any endianness issues here? */
436 p_wtxt[ t ] = p_src[ t ] ^ p_aes->pp_enc_keys[ AES_KEY_COUNT ][ t ];
437 }
438
439 /* Rounds 0 - 8 */
440 for( i_round = 0; i_round < (AES_KEY_COUNT - 1); i_round++ )
441 {
442 for( t = 0; t < 4; t++ )
443 {
444 p_tmp[ t ] = AES_XOR_ROR( p_aes_itable, p_wtxt );
445 }
446
447 for( t = 0; t < 4; t++ )
448 {
449 p_wtxt[ t ] = p_tmp[ t ]
450 ^ p_aes->pp_dec_keys[ (AES_KEY_COUNT - 1) - i_round ][ t ];
451 }
452 }
453
454 /* Final round (9) */
455 for( t = 0; t < 4; t++ )
456 {
457 p_dest[ t ] = AES_XOR_ROR( p_aes_decrypt, p_wtxt );
458 p_dest[ t ] ^= p_aes->pp_dec_keys[ 0 ][ t ];
459 }
460 }
461
462 /*****************************************************************************
463 * InitMD5: initialise an MD5 message
464 *****************************************************************************
465 * The MD5 message-digest algorithm is described in RFC 1321
466 *****************************************************************************/
467 static void InitMD5( struct md5_s *p_md5 )
468 {
469 p_md5->p_digest[ 0 ] = 0x67452301;
470 p_md5->p_digest[ 1 ] = 0xefcdab89;
471 p_md5->p_digest[ 2 ] = 0x98badcfe;
472 p_md5->p_digest[ 3 ] = 0x10325476;
473
474 memset( p_md5->p_data, 0, 64 );
475 p_md5->i_bits = 0;
476 }
477
478 /*****************************************************************************
479 * AddMD5: add i_len bytes to an MD5 message
480 *****************************************************************************/
481 static void AddMD5( struct md5_s *p_md5, const uint8_t *p_src, uint32_t i_len )
482 {
483 unsigned int i_current; /* Current bytes in the spare buffer */
484 unsigned int i_offset = 0;
485
486 i_current = (p_md5->i_bits / 8) & 63;
487
488 p_md5->i_bits += 8 * i_len;
489
490 /* If we can complete our spare buffer to 64 bytes, do it and add the
491 * resulting buffer to the MD5 message */
492 if( i_len >= (64 - i_current) )
493 {
494 memcpy( ((uint8_t *)p_md5->p_data) + i_current, p_src,
495 (64 - i_current) );
496 Digest( p_md5, p_md5->p_data );
497
498 i_offset += (64 - i_current);
499 i_len -= (64 - i_current);
500 i_current = 0;
501 }
502
503 /* Add as many entire 64 bytes blocks as we can to the MD5 message */
504 while( i_len >= 64 )
505 {
506 uint32_t p_tmp[ 16 ];
507 memcpy( p_tmp, p_src + i_offset, 64 );
508 Digest( p_md5, p_tmp );
509 i_offset += 64;
510 i_len -= 64;
511 }
512
513 /* Copy our remaining data to the message's spare buffer */
514 memcpy( ((uint8_t *)p_md5->p_data) + i_current, p_src + i_offset, i_len );
515 }
516
517 /*****************************************************************************
518 * EndMD5: finish an MD5 message
519 *****************************************************************************
520 * This function adds adequate padding to the end of the message, and appends
521 * the bit count so that we end at a block boundary.
522 *****************************************************************************/
523 static void EndMD5( struct md5_s *p_md5 )
524 {
525 unsigned int i_current;
526
527 i_current = (p_md5->i_bits / 8) & 63;
528
529 /* Append 0x80 to our buffer. No boundary check because the temporary
530 * buffer cannot be full, otherwise AddMD5 would have emptied it. */
531 ((uint8_t *)p_md5->p_data)[ i_current++ ] = 0x80;
532
533 /* If less than 8 bytes are available at the end of the block, complete
534 * this 64 bytes block with zeros and add it to the message. We'll add
535 * our length at the end of the next block. */
536 if( i_current > 56 )
537 {
538 memset( ((uint8_t *)p_md5->p_data) + i_current, 0, (64 - i_current) );
539 Digest( p_md5, p_md5->p_data );
540 i_current = 0;
541 }
542
543 /* Fill the unused space in our last block with zeroes and put the
544 * message length at the end. */
545 memset( ((uint8_t *)p_md5->p_data) + i_current, 0, (56 - i_current) );
546 p_md5->p_data[ 14 ] = p_md5->i_bits & 0xffffffff;
547 p_md5->p_data[ 15 ] = (p_md5->i_bits >> 32);
548 REVERSE( &p_md5->p_data[ 14 ], 2 );
549
550 Digest( p_md5, p_md5->p_data );
551 }
552
553 #define F1( x, y, z ) ((z) ^ ((x) & ((y) ^ (z))))
554 #define F2( x, y, z ) F1((z), (x), (y))
555 #define F3( x, y, z ) ((x) ^ (y) ^ (z))
556 #define F4( x, y, z ) ((y) ^ ((x) | ~(z)))
557
558 #define MD5_DO( f, w, x, y, z, data, s ) \
559 ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
560
561 /*****************************************************************************
562 * Digest: update the MD5 digest with 64 bytes of data
563 *****************************************************************************/
564 static void Digest( struct md5_s *p_md5, uint32_t *p_input )
565 {
566 uint32_t a, b, c, d;
567
568 REVERSE( p_input, 16 );
569
570 a = p_md5->p_digest[ 0 ];
571 b = p_md5->p_digest[ 1 ];
572 c = p_md5->p_digest[ 2 ];
573 d = p_md5->p_digest[ 3 ];
574
575 MD5_DO( F1, a, b, c, d, p_input[ 0 ] + 0xd76aa478, 7 );
576 MD5_DO( F1, d, a, b, c, p_input[ 1 ] + 0xe8c7b756, 12 );
577 MD5_DO( F1, c, d, a, b, p_input[ 2 ] + 0x242070db, 17 );
578 MD5_DO( F1, b, c, d, a, p_input[ 3 ] + 0xc1bdceee, 22 );
579 MD5_DO( F1, a, b, c, d, p_input[ 4 ] + 0xf57c0faf, 7 );
580 MD5_DO( F1, d, a, b, c, p_input[ 5 ] + 0x4787c62a, 12 );
581 MD5_DO( F1, c, d, a, b, p_input[ 6 ] + 0xa8304613, 17 );
582 MD5_DO( F1, b, c, d, a, p_input[ 7 ] + 0xfd469501, 22 );
583 MD5_DO( F1, a, b, c, d, p_input[ 8 ] + 0x698098d8, 7 );
584 MD5_DO( F1, d, a, b, c, p_input[ 9 ] + 0x8b44f7af, 12 );
585 MD5_DO( F1, c, d, a, b, p_input[ 10 ] + 0xffff5bb1, 17 );
586 MD5_DO( F1, b, c, d, a, p_input[ 11 ] + 0x895cd7be, 22 );
587 MD5_DO( F1, a, b, c, d, p_input[ 12 ] + 0x6b901122, 7 );
588 MD5_DO( F1, d, a, b, c, p_input[ 13 ] + 0xfd987193, 12 );
589 MD5_DO( F1, c, d, a, b, p_input[ 14 ] + 0xa679438e, 17 );
590 MD5_DO( F1, b, c, d, a, p_input[ 15 ] + 0x49b40821, 22 );
591
592 MD5_DO( F2, a, b, c, d, p_input[ 1 ] + 0xf61e2562, 5 );
593 MD5_DO( F2, d, a, b, c, p_input[ 6 ] + 0xc040b340, 9 );
594 MD5_DO( F2, c, d, a, b, p_input[ 11 ] + 0x265e5a51, 14 );
595 MD5_DO( F2, b, c, d, a, p_input[ 0 ] + 0xe9b6c7aa, 20 );
596 MD5_DO( F2, a, b, c, d, p_input[ 5 ] + 0xd62f105d, 5 );
597 MD5_DO( F2, d, a, b, c, p_input[ 10 ] + 0x02441453, 9 );
598 MD5_DO( F2, c, d, a, b, p_input[ 15 ] + 0xd8a1e681, 14 );
599 MD5_DO( F2, b, c, d, a, p_input[ 4 ] + 0xe7d3fbc8, 20 );
600 MD5_DO( F2, a, b, c, d, p_input[ 9 ] + 0x21e1cde6, 5 );
601 MD5_DO( F2, d, a, b, c, p_input[ 14 ] + 0xc33707d6, 9 );
602 MD5_DO( F2, c, d, a, b, p_input[ 3 ] + 0xf4d50d87, 14 );
603 MD5_DO( F2, b, c, d, a, p_input[ 8 ] + 0x455a14ed, 20 );
604 MD5_DO( F2, a, b, c, d, p_input[ 13 ] + 0xa9e3e905, 5 );
605 MD5_DO( F2, d, a, b, c, p_input[ 2 ] + 0xfcefa3f8, 9 );
606 MD5_DO( F2, c, d, a, b, p_input[ 7 ] + 0x676f02d9, 14 );
607 MD5_DO( F2, b, c, d, a, p_input[ 12 ] + 0x8d2a4c8a, 20 );
608
609 MD5_DO( F3, a, b, c, d, p_input[ 5 ] + 0xfffa3942, 4 );
610 MD5_DO( F3, d, a, b, c, p_input[ 8 ] + 0x8771f681, 11 );
611 MD5_DO( F3, c, d, a, b, p_input[ 11 ] + 0x6d9d6122, 16 );
612 MD5_DO( F3, b, c, d, a, p_input[ 14 ] + 0xfde5380c, 23 );
613 MD5_DO( F3, a, b, c, d, p_input[ 1 ] + 0xa4beea44, 4 );
614 MD5_DO( F3, d, a, b, c, p_input[ 4 ] + 0x4bdecfa9, 11 );
615 MD5_DO( F3, c, d, a, b, p_input[ 7 ] + 0xf6bb4b60, 16 );
616 MD5_DO( F3, b, c, d, a, p_input[ 10 ] + 0xbebfbc70, 23 );
617 MD5_DO( F3, a, b, c, d, p_input[ 13 ] + 0x289b7ec6, 4 );
618 MD5_DO( F3, d, a, b, c, p_input[ 0 ] + 0xeaa127fa, 11 );
619 MD5_DO( F3, c, d, a, b, p_input[ 3 ] + 0xd4ef3085, 16 );
620 MD5_DO( F3, b, c, d, a, p_input[ 6 ] + 0x04881d05, 23 );
621 MD5_DO( F3, a, b, c, d, p_input[ 9 ] + 0xd9d4d039, 4 );
622 MD5_DO( F3, d, a, b, c, p_input[ 12 ] + 0xe6db99e5, 11 );
623 MD5_DO( F3, c, d, a, b, p_input[ 15 ] + 0x1fa27cf8, 16 );
624 MD5_DO( F3, b, c, d, a, p_input[ 2 ] + 0xc4ac5665, 23 );
625
626 MD5_DO( F4, a, b, c, d, p_input[ 0 ] + 0xf4292244, 6 );
627 MD5_DO( F4, d, a, b, c, p_input[ 7 ] + 0x432aff97, 10 );
628 MD5_DO( F4, c, d, a, b, p_input[ 14 ] + 0xab9423a7, 15 );
629 MD5_DO( F4, b, c, d, a, p_input[ 5 ] + 0xfc93a039, 21 );
630 MD5_DO( F4, a, b, c, d, p_input[ 12 ] + 0x655b59c3, 6 );
631 MD5_DO( F4, d, a, b, c, p_input[ 3 ] + 0x8f0ccc92, 10 );
632 MD5_DO( F4, c, d, a, b, p_input[ 10 ] + 0xffeff47d, 15 );
633 MD5_DO( F4, b, c, d, a, p_input[ 1 ] + 0x85845dd1, 21 );
634 MD5_DO( F4, a, b, c, d, p_input[ 8 ] + 0x6fa87e4f, 6 );
635 MD5_DO( F4, d, a, b, c, p_input[ 15 ] + 0xfe2ce6e0, 10 );
636 MD5_DO( F4, c, d, a, b, p_input[ 6 ] + 0xa3014314, 15 );
637 MD5_DO( F4, b, c, d, a, p_input[ 13 ] + 0x4e0811a1, 21 );
638 MD5_DO( F4, a, b, c, d, p_input[ 4 ] + 0xf7537e82, 6 );
639 MD5_DO( F4, d, a, b, c, p_input[ 11 ] + 0xbd3af235, 10 );
640 MD5_DO( F4, c, d, a, b, p_input[ 2 ] + 0x2ad7d2bb, 15 );
641 MD5_DO( F4, b, c, d, a, p_input[ 9 ] + 0xeb86d391, 21 );
642
643 p_md5->p_digest[ 0 ] += a;
644 p_md5->p_digest[ 1 ] += b;
645 p_md5->p_digest[ 2 ] += c;
646 p_md5->p_digest[ 3 ] += d;
647 }
648
649 /*****************************************************************************
650 * InitShuffle: initialise a shuffle structure
651 *****************************************************************************
652 * This function initialises tables in the p_shuffle structure that will be
653 * used later by DoShuffle. The only external parameter is p_sys_key.
654 *****************************************************************************/
655 static void InitShuffle( struct shuffle_s *p_shuffle, uint32_t *p_sys_key )
656 {
657 char p_secret1[] = "Tv!*";
658 static char const p_secret2[] = "v8rhvsaAvOKMFfUH%798=[;."
659 "f8677680a634ba87fnOIf)(*";
660 unsigned int i;
661
662 /* Fill p_commands using the key and a secret seed */
663 for( i = 0; i < 20; i++ )
664 {
665 struct md5_s md5;
666 int32_t i_hash;
667
668 InitMD5( &md5 );
669 AddMD5( &md5, (uint8_t *)p_sys_key, 16 );
670 AddMD5( &md5, (uint8_t *)p_secret1, 4 );
671 EndMD5( &md5 );
672
673 p_secret1[ 3 ]++;
674
675 REVERSE( md5.p_digest, 1 );
676 i_hash = ((int32_t)U32_AT(md5.p_digest)) % 1024;
677
678 p_shuffle->p_commands[ i ] = i_hash < 0 ? i_hash * -1 : i_hash;
679 }
680
681 /* Fill p_bordel with completely meaningless initial values. */
682 for( i = 0; i < 4; i++ )
683 {
684 p_shuffle->p_bordel[ 4 * i ] = U32_AT(p_sys_key + i);
685 memcpy( p_shuffle->p_bordel + 4 * i + 1, p_secret2 + 12 * i, 12 );
686 REVERSE( p_shuffle->p_bordel + 4 * i + 1, 3 );
687 }
688 }
689
690 /*****************************************************************************
691 * DoShuffle: shuffle buffer
692 *****************************************************************************
693 * This is so ugly and uses so many MD5 checksums that it is most certainly
694 * one-way, though why it needs to be so complicated is beyond me.
695 *****************************************************************************/
696 static void DoShuffle( struct shuffle_s *p_shuffle,
697 uint32_t *p_buffer, uint32_t i_size )
698 {
699 struct md5_s md5;
700 uint32_t p_big_bordel[ 16 ];
701 uint32_t *p_bordel = p_shuffle->p_bordel;
702 unsigned int i;
703
704 /* Using the MD5 hash of a memory block is probably not one-way enough
705 * for the iTunes people. This function randomises p_bordel depending on
706 * the values in p_commands to make things even more messy in p_bordel. */
707 for( i = 0; i < 20; i++ )
708 {
709 uint8_t i_command, i_index;
710
711 if( !p_shuffle->p_commands[ i ] )
712 {
713 continue;
714 }
715
716 i_command = (p_shuffle->p_commands[ i ] & 0x300) >> 8;
717 i_index = p_shuffle->p_commands[ i ] & 0xff;
718
719 switch( i_command )
720 {
721 case 0x3:
722 p_bordel[ i_index & 0xf ] = p_bordel[ i_index >> 4 ]
723 + p_bordel[ ((i_index + 0x10) >> 4) & 0xf ];
724 break;
725 case 0x2:
726 p_bordel[ i_index >> 4 ] ^= p_shuffle_xor[ 0xff - i_index ];
727 break;
728 case 0x1:
729 p_bordel[ i_index >> 4 ] -= p_shuffle_sub[ 0xff - i_index ];
730 break;
731 default:
732 p_bordel[ i_index >> 4 ] += p_shuffle_add[ 0xff - i_index ];
733 break;
734 }
735 }
736
737 /* Convert our newly randomised p_bordel to big endianness and take
738 * its MD5 hash. */
739 InitMD5( &md5 );
740 for( i = 0; i < 16; i++ )
741 {
742 p_big_bordel[ i ] = U32_AT(p_bordel + i);
743 }
744 AddMD5( &md5, (uint8_t *)p_big_bordel, 64 );
745 EndMD5( &md5 );
746
747 /* XOR our buffer with the computed checksum */
748 for( i = 0; i < i_size; i++ )
749 {
750 p_buffer[ i ] ^= md5.p_digest[ i ];
751 }
752 }
753
754 /*****************************************************************************
755 * GetSystemKey: get the system key
756 *****************************************************************************
757 * Compute the system key from various system information, see HashSystemInfo.
758 *****************************************************************************/
759 static int GetSystemKey( uint32_t *p_sys_key, uint32_t b_ipod )
760 {
761 static char const p_secret1[ 8 ] = "YuaFlafu";
762 static char const p_secret2[ 8 ] = "zPif98ga";
763 struct md5_s md5;
764 int64_t i_ipod_id;
765 uint32_t p_system_hash[ 4 ];
766
767 /* Compute the MD5 hash of our system info */
768 if( ( !b_ipod && HashSystemInfo( p_system_hash ) ) ||
769 ( b_ipod && GetiPodID( &i_ipod_id ) ) )
770 {
771 return -1;
772 }
773
774 /* Combine our system info hash with additional secret data. The resulting
775 * MD5 hash will be our system key. */
776 InitMD5( &md5 );
777 AddMD5( &md5, p_secret1, 8 );
778
779 if( !b_ipod )
780 {
781 AddMD5( &md5, (uint8_t *)p_system_hash, 6 );
782 AddMD5( &md5, (uint8_t *)p_system_hash, 6 );
783 AddMD5( &md5, (uint8_t *)p_system_hash, 6 );
784 AddMD5( &md5, p_secret2, 8 );
785 }
786 else
787 {
788 i_ipod_id = U64_AT(&i_ipod_id);
789 AddMD5( &md5, (uint8_t *)&i_ipod_id, sizeof(i_ipod_id) );
790 AddMD5( &md5, (uint8_t *)&i_ipod_id, sizeof(i_ipod_id) );
791 AddMD5( &md5, (uint8_t *)&i_ipod_id, sizeof(i_ipod_id) );
792 }
793
794 EndMD5( &md5 );
795
796 memcpy( p_sys_key, md5.p_digest, 16 );
797
798 return 0;
799 }
800
801 #ifdef _WIN32
802 # define DRMS_DIRNAME "drms"
803 #else
804 # define DRMS_DIRNAME ".drms"
805 #endif
806
807 /*****************************************************************************
808 * WriteUserKey: write the user key to hard disk
809 *****************************************************************************
810 * Write the user key to the hard disk so that it can be reused later or used
811 * on operating systems other than Win32.
812 *****************************************************************************/
813 static int WriteUserKey( void *_p_drms, uint32_t *p_user_key )
814 {
815 struct drms_s *p_drms = (struct drms_s *)_p_drms;
816 FILE *file;
817 int i_ret = -1;
818 char psz_path[ PATH_MAX ];
819
820 sprintf( psz_path, /* PATH_MAX - 1, */
821 "%s/" DRMS_DIRNAME, p_drms->psz_homedir );
822
823 #if defined( HAVE_ERRNO_H )
824 # if defined( _WIN32 )
825 if( !mkdir( psz_path ) || errno == EEXIST )
826 # else
827 if( !mkdir( psz_path, 0755 ) || errno == EEXIST )
828 # endif
829 #else
830 if( !mkdir( psz_path ) )
831 #endif
832 {
833 sprintf( psz_path, /*PATH_MAX - 1,*/ "%s/" DRMS_DIRNAME "/%08X.%03d",
834 p_drms->psz_homedir, p_drms->i_user, p_drms->i_key );
835
836 file = fopen( psz_path, "w" );
837 if( file != NULL )
838 {
839 i_ret = fwrite( p_user_key, sizeof(uint32_t),
840 4, file ) == 4 ? 0 : -1;
841 fclose( file );
842 }
843 }
844
845 return i_ret;
846 }
847
848 /*****************************************************************************
849 * ReadUserKey: read the user key from hard disk
850 *****************************************************************************
851 * Retrieve the user key from the hard disk if available.
852 *****************************************************************************/
853 static int ReadUserKey( void *_p_drms, uint32_t *p_user_key )
854 {
855 struct drms_s *p_drms = (struct drms_s *)_p_drms;
856 FILE *file;
857 int i_ret = -1;
858 char psz_path[ PATH_MAX ];
859
860 sprintf( psz_path, /*PATH_MAX - 1,*/
861 "%s/" DRMS_DIRNAME "/%08X.%03d", p_drms->psz_homedir,
862 p_drms->i_user, p_drms->i_key );
863
864 file = fopen( psz_path, "r" );
865 if( file != NULL )
866 {
867 i_ret = fread( p_user_key, sizeof(uint32_t),
868 4, file ) == 4 ? 0 : -1;
869 fclose( file );
870 }
871
872 return i_ret;
873 }
874
875 /*****************************************************************************
876 * GetUserKey: get the user key
877 *****************************************************************************
878 * Retrieve the user key from the hard disk if available, otherwise generate
879 * it from the system key. If the key could be successfully generated, write
880 * it to the hard disk for future use.
881 *****************************************************************************/
882 static int GetUserKey( void *_p_drms, uint32_t *p_user_key )
883 {
884 static char const p_secret[] = "mUfnpognadfgf873";
885 struct drms_s *p_drms = (struct drms_s *)_p_drms;
886 struct aes_s aes;
887 struct shuffle_s shuffle;
888 uint32_t i, y;
889 uint32_t *p_sci_data;
890 uint32_t i_user, i_key;
891 uint32_t p_sys_key[ 4 ];
892 uint32_t i_sci_size, i_blocks, i_remaining;
893 uint32_t *p_sci0, *p_sci1, *p_buffer;
894 uint32_t p_sci_key[ 4 ];
895 char *psz_ipod;
896 int i_ret = -1;
897
898 if( !ReadUserKey( p_drms, p_user_key ) )
899 {
900 REVERSE( p_user_key, 4 );
901 return 0;
902 }
903
904 psz_ipod = getenv( "IPOD" );
905
906 if( GetSystemKey( p_sys_key, psz_ipod ? 1 : 0 ) )
907 {
908 return -1;
909 }
910
911 if( GetSCIData( psz_ipod, &p_sci_data, &i_sci_size ) )
912 {
913 return -1;
914 }
915
916 /* Phase 1: unscramble the SCI data using the system key and shuffle
917 * it using DoShuffle(). */
918
919 /* Skip the first 4 bytes (some sort of header). Decrypt the rest. */
920 i_blocks = (i_sci_size - 4) / 16;
921 i_remaining = (i_sci_size - 4) - (i_blocks * 16);
922 p_buffer = p_sci_data + 1;
923
924 /* Decrypt and shuffle our data at the same time */
925 InitAES( &aes, p_sys_key );
926 REVERSE( p_sys_key, 4 );
927 InitShuffle( &shuffle, p_sys_key );
928
929 memcpy( p_sci_key, p_secret, 16 );
930 REVERSE( p_sci_key, 4 );
931
932 while( i_blocks-- )
933 {
934 uint32_t p_tmp[ 4 ];
935
936 REVERSE( p_buffer, 4 );
937 DecryptAES( &aes, p_tmp, p_buffer );
938 BlockXOR( p_tmp, p_sci_key, p_tmp );
939
940 /* Use the previous scrambled data as the key for next block */
941 memcpy( p_sci_key, p_buffer, 16 );
942
943 /* Shuffle the decrypted data using a custom routine */
944 DoShuffle( &shuffle, p_tmp, 4 );
945
946 /* Copy this block back to p_buffer */
947 memcpy( p_buffer, p_tmp, 16 );
948
949 p_buffer += 4;
950 }
951
952 if( i_remaining >= 4 )
953 {
954 i_remaining /= 4;
955 REVERSE( p_buffer, i_remaining );
956 DoShuffle( &shuffle, p_buffer, i_remaining );
957 }
958
959 /* Phase 2: look for the user key in the generated data. I must admit I
960 * do not understand what is going on here, because it almost
961 * looks like we are browsing data that makes sense, even though
962 * the DoShuffle() part made it completely meaningless. */
963
964 y = 0;
965 REVERSE( p_sci_data + 5, 1 );
966 i = U32_AT( p_sci_data + 5 );
967 i_sci_size -= 22 * sizeof(uint32_t);
968 p_sci1 = p_sci_data + 22;
969 p_sci0 = NULL;
970
971 while( i_sci_size >= 20 && i > 0 )
972 {
973 if( p_sci0 == NULL )
974 {
975 i_sci_size -= 18 * sizeof(uint32_t);
976 if( i_sci_size < 20 )
977 {
978 break;
979 }
980
981 p_sci0 = p_sci1;
982 REVERSE( p_sci1 + 17, 1 );
983 y = U32_AT( p_sci1 + 17 );
984 p_sci1 += 18;
985 }
986
987 if( !y )
988 {
989 i--;
990 p_sci0 = NULL;
991 continue;
992 }
993
994 i_user = U32_AT( p_sci0 );
995 i_key = U32_AT( p_sci1 );
996 REVERSE( &i_user, 1 );
997 REVERSE( &i_key, 1 );
998 if( i_user == p_drms->i_user && ( ( i_key == p_drms->i_key ) ||
999 ( !p_drms->i_key && ( p_sci1 == (p_sci0 + 18) ) ) ) )
1000 {
1001 memcpy( p_user_key, p_sci1 + 1, 16 );
1002 REVERSE( p_sci1 + 1, 4 );
1003 WriteUserKey( p_drms, p_sci1 + 1 );
1004 i_ret = 0;
1005 break;
1006 }
1007
1008 y--;
1009 p_sci1 += 5;
1010 i_sci_size -= 5 * sizeof(uint32_t);
1011 }
1012
1013 free( p_sci_data );
1014
1015 return i_ret;
1016 }
1017
1018 /*****************************************************************************
1019 * GetSCIData: get SCI data from "SC Info.sidb"
1020 *****************************************************************************
1021 * Read SCI data from "\Apple Computer\iTunes\SC Info\SC Info.sidb"
1022 *****************************************************************************/
1023 static int GetSCIData( char *psz_ipod, uint32_t **pp_sci,
1024 uint32_t *pi_sci_size )
1025 {
1026 FILE *file;
1027 char *psz_path = NULL;
1028 char p_tmp[ PATH_MAX ];
1029 int i_ret = -1;
1030
1031 if( psz_ipod == NULL )
1032 {
1033 #ifdef _WIN32
1034 char *p_filename = "\\Apple Computer\\iTunes\\SC Info\\SC Info.sidb";
1035 typedef HRESULT (WINAPI *SHGETFOLDERPATH)( HWND, int, HANDLE, DWORD,
1036 LPSTR );
1037 HINSTANCE shfolder_dll = NULL;
1038 SHGETFOLDERPATH dSHGetFolderPath = NULL;
1039
1040 if( ( shfolder_dll = LoadLibrary( _T("SHFolder.dll") ) ) != NULL )
1041 {
1042 dSHGetFolderPath =
1043 (SHGETFOLDERPATH)GetProcAddress( shfolder_dll,
1044 _T("SHGetFolderPathA") );
1045 }
1046
1047 if( dSHGetFolderPath != NULL &&
1048 SUCCEEDED( dSHGetFolderPath( NULL, /*CSIDL_COMMON_APPDATA*/ 0x0023,
1049 NULL, 0, p_tmp ) ) )
1050 {
1051 strncat( p_tmp, p_filename, min( strlen( p_filename ),
1052 (sizeof(p_tmp)/sizeof(p_tmp[0]) - 1) -
1053 strlen( p_tmp ) ) );
1054 psz_path = p_tmp;
1055 }
1056
1057 if( shfolder_dll != NULL )
1058 {
1059 FreeLibrary( shfolder_dll );
1060 }
1061 #endif
1062 }
1063 else
1064 {
1065 #define ISCINFO "iSCInfo"
1066 if( strstr( psz_ipod, ISCINFO ) == NULL )
1067 {
1068 sprintf( p_tmp, /*sizeof(p_tmp)/sizeof(p_tmp[0]) - 1,*/
1069 "%s/iPod_Control/iTunes/" ISCINFO, psz_ipod );
1070 psz_path = p_tmp;
1071 }
1072 else
1073 {
1074 psz_path = psz_ipod;
1075 }
1076 }
1077
1078 if( psz_path == NULL )
1079 {
1080 return -1;
1081 }
1082
1083 file = fopen( psz_path, "r" );
1084 if( file != NULL )
1085 {
1086 struct stat st;
1087
1088 if( !fstat( fileno( file ), &st ) )
1089 {
1090 *pp_sci = malloc( st.st_size );
1091 if( *pp_sci != NULL )
1092 {
1093 if( fread( *pp_sci, 1, st.st_size,
1094 file ) == (size_t)st.st_size )
1095 {
1096 *pi_sci_size = st.st_size;
1097 i_ret = 0;
1098 }
1099 else
1100 {
1101 free( (void *)*pp_sci );
1102 *pp_sci = NULL;
1103 }
1104 }
1105 }
1106
1107 fclose( file );
1108 }
1109
1110 return i_ret;
1111 }
1112
1113 /*****************************************************************************
1114 * HashSystemInfo: hash system information
1115 *****************************************************************************
1116 * This function computes the MD5 hash of the C: hard drive serial number,
1117 * BIOS version, CPU type and Windows version.
1118 *****************************************************************************/
1119 static int HashSystemInfo( uint32_t *p_system_hash )
1120 {
1121 struct md5_s md5;
1122 int i_ret = 0;
1123
1124 #ifdef _WIN32
1125 HKEY i_key;
1126 unsigned int i;
1127 DWORD i_size;
1128 DWORD i_serial;
1129 LPBYTE p_reg_buf;
1130
1131 static LPCTSTR p_reg_keys[ 3 ][ 2 ] =
1132 {
1133 {
1134 _T("HARDWARE\\DESCRIPTION\\System"),
1135 _T("SystemBiosVersion")
1136 },
1137
1138 {
1139 _T("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0"),
1140 _T("ProcessorNameString")
1141 },
1142
1143 {
1144 _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion"),
1145 _T("ProductId")
1146 }
1147 };
1148
1149 InitMD5( &md5 );
1150
1151 AddMD5( &md5, "cache-control", 13 );
1152 AddMD5( &md5, "Ethernet", 8 );
1153
1154 GetVolumeInformation( _T("C:\\"), NULL, 0, &i_serial,
1155 NULL, NULL, NULL, 0 );
1156 AddMD5( &md5, (uint8_t *)&i_serial, 4 );
1157
1158 for( i = 0; i < sizeof(p_reg_keys) / sizeof(p_reg_keys[ 0 ]); i++ )
1159 {
1160 if( RegOpenKeyEx( HKEY_LOCAL_MACHINE, p_reg_keys[ i ][ 0 ],
1161 0, KEY_READ, &i_key ) != ERROR_SUCCESS )
1162 {
1163 continue;
1164 }
1165
1166 if( RegQueryValueEx( i_key, p_reg_keys[ i ][ 1 ],
1167 NULL, NULL, NULL, &i_size ) != ERROR_SUCCESS )
1168 {
1169 RegCloseKey( i_key );
1170 continue;
1171 }
1172
1173 p_reg_buf = malloc( i_size );
1174
1175 if( p_reg_buf != NULL )
1176 {
1177 if( RegQueryValueEx( i_key, p_reg_keys[ i ][ 1 ],
1178 NULL, NULL, p_reg_buf,
1179 &i_size ) == ERROR_SUCCESS )
1180 {
1181 AddMD5( &md5, (uint8_t *)p_reg_buf, i_size );
1182 }
1183
1184 free( p_reg_buf );
1185 }
1186
1187 RegCloseKey( i_key );
1188 }
1189
1190 #else
1191 InitMD5( &md5 );
1192 i_ret = -1;
1193 #endif
1194
1195 EndMD5( &md5 );
1196 memcpy( p_system_hash, md5.p_digest, 16 );
1197
1198 return i_ret;
1199 }
1200
1201 /*****************************************************************************
1202 * GetiPodID: Get iPod ID
1203 *****************************************************************************
1204 * This function gets the iPod ID.
1205 *****************************************************************************/
1206 static int GetiPodID( int64_t *p_ipod_id )
1207 {
1208 int i_ret = -1;
1209
1210 #define PROD_NAME "iPod"
1211 #define VENDOR_NAME "Apple Computer, Inc."
1212
1213 char *psz_ipod_id = getenv( "IPODID" );
1214 if( psz_ipod_id != NULL )
1215 {
1216 #ifndef _WIN32
1217 *p_ipod_id = strtoll( psz_ipod_id, NULL, 16 );
1218 #else
1219 *p_ipod_id = strtol( psz_ipod_id, NULL, 16 );
1220 #endif
1221 return 0;
1222 }
1223
1224 #ifdef HAVE_IOKIT_IOKITLIB_H
1225 CFTypeRef value;
1226 mach_port_t port;
1227 io_object_t device;
1228 io_iterator_t iterator;
1229 CFMutableDictionaryRef matching_dic;
1230
1231 if( IOMasterPort( MACH_PORT_NULL, &port ) == KERN_SUCCESS )
1232 {
1233 if( ( matching_dic = IOServiceMatching( "IOFireWireUnit" ) ) != NULL )
1234 {
1235 CFDictionarySetValue( matching_dic,
1236 CFSTR("FireWire Vendor Name"),
1237 CFSTR(VENDOR_NAME) );
1238 CFDictionarySetValue( matching_dic,
1239 CFSTR("FireWire Product Name"),
1240 CFSTR(PROD_NAME) );
1241
1242 if( IOServiceGetMatchingServices( port, matching_dic,
1243 &iterator ) == KERN_SUCCESS )
1244 {
1245 while( ( device = IOIteratorNext( iterator ) ) != NULL )
1246 {
1247 value = IORegistryEntryCreateCFProperty( device,
1248 CFSTR("GUID"), kCFAllocatorDefault, kNilOptions );
1249
1250 if( value != NULL )
1251 {
1252 if( CFGetTypeID( value ) == CFNumberGetTypeID() )
1253 {
1254 int64_t i_ipod_id;
1255 CFNumberGetValue( (CFNumberRef)value,
1256 kCFNumberLongLongType,
1257 &i_ipod_id );
1258 *p_ipod_id = i_ipod_id;
1259 i_ret = 0;
1260 }
1261
1262 CFRelease( value );
1263 }
1264
1265 IOObjectRelease( device );
1266
1267 if( !i_ret ) break;
1268 }
1269
1270 IOObjectRelease( iterator );
1271 }
1272 }
1273
1274 mach_port_deallocate( mach_task_self(), port );
1275 }
1276
1277 #elif HAVE_SYSFS_LIBSYSFS_H
1278 struct sysfs_bus *bus = NULL;
1279 struct dlist *devlist = NULL;
1280 struct dlist *attributes = NULL;
1281 struct sysfs_device *curdev = NULL;
1282 struct sysfs_attribute *curattr = NULL;
1283
1284 bus = sysfs_open_bus( "ieee1394" );
1285 if( bus != NULL )
1286 {
1287 devlist = sysfs_get_bus_devices( bus );
1288 if( devlist != NULL )
1289 {
1290 dlist_for_each_data( devlist, curdev, struct sysfs_device )
1291 {
1292 attributes = sysfs_get_device_attributes( curdev );
1293 if( attributes != NULL )
1294 {
1295 dlist_for_each_data( attributes, curattr,
1296 struct sysfs_attribute )
1297 {
1298 if( ( strcmp( curattr->name, "model_name" ) == 0 ) &&
1299 ( strncmp( curattr->value, PROD_NAME,
1300 sizeof(PROD_NAME) ) == 0 ) )
1301 {
1302 *p_ipod_id = strtoll( curdev->name, NULL, 16 );
1303 i_ret = 0;
1304 break;
1305 }
1306 }
1307 }
1308
1309 if( !i_ret ) break;
1310 }
1311 }
1312
1313 sysfs_close_bus( bus );
1314 }
1315 #endif
1316
1317 return i_ret;
1318 }
1319
1320 #endif
0 /*****************************************************************************
1 * drms.h : DRMS
2 *****************************************************************************
3 * Copyright (C) 2004 VideoLAN
4 * $Id: drms.h,v 1.7 2005/02/01 13:15:55 menno Exp $
5 *
6 * Author: Jon Lech Johansen <jon-vl@nanocrew.net>
7 *
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.
12 *
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
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
21 *****************************************************************************/
22
23 extern void *drms_alloc( char *psz_homedir );
24 extern void drms_free( void *p_drms );
25 extern int drms_init( void *p_drms, uint32_t i_type,
26 uint8_t *p_info, uint32_t i_len );
27 extern void drms_decrypt( void *p_drms, uint32_t *p_buffer,
28 uint32_t i_len );
29
0 /*****************************************************************************
1 * drmstables.h : AES/Rijndael block cipher and miscellaneous tables
2 *****************************************************************************
3 * Copyright (C) 2004 VideoLAN
4 * $Id: drmstables.h,v 1.6 2005/02/01 13:15:55 menno Exp $
5 *
6 * Author: Jon Lech Johansen <jon-vl@nanocrew.net>
7 *
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.
12 *
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
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
21 *****************************************************************************/
22
23 #define AES_ROR( x, n ) (((x) << (32-(n))) | ((x) >> (n)))
24
25 #define AES_XOR_ROR( p_table, p_tmp ) \
26 ( p_table[ (p_tmp[ t > 2 ? t - 3 : t + 1 ] >> 24) & 0xFF ] \
27 ^ AES_ROR( p_table[ (p_tmp[ t > 1 ? t - 2 : t + 2 ] >> 16) & 0xFF ], 8 ) \
28 ^ AES_ROR( p_table[ (p_tmp[ t > 0 ? t - 1 : t + 3 ] >> 8) & 0xFF ], 16 ) \
29 ^ AES_ROR( p_table[ p_tmp[ t ] & 0xFF ], 24 ) )
30
31 #define AES_KEY_COUNT 10
32
33 static uint32_t const p_aes_table[ AES_KEY_COUNT ] =
34 {
35 0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010, 0x00000020,
36 0x00000040, 0x00000080, 0x0000001b, 0x00000036
37 };
38
39 static uint32_t const p_aes_encrypt[ 256 ] =
40 {
41 0x63000000, 0x7c000000, 0x77000000, 0x7b000000, 0xf2000000, 0x6b000000,
42 0x6f000000, 0xc5000000, 0x30000000, 0x01000000, 0x67000000, 0x2b000000,
43 0xfe000000, 0xd7000000, 0xab000000, 0x76000000, 0xca000000, 0x82000000,
44 0xc9000000, 0x7d000000, 0xfa000000, 0x59000000, 0x47000000, 0xf0000000,
45 0xad000000, 0xd4000000, 0xa2000000, 0xaf000000, 0x9c000000, 0xa4000000,
46 0x72000000, 0xc0000000, 0xb7000000, 0xfd000000, 0x93000000, 0x26000000,
47 0x36000000, 0x3f000000, 0xf7000000, 0xcc000000, 0x34000000, 0xa5000000,
48 0xe5000000, 0xf1000000, 0x71000000, 0xd8000000, 0x31000000, 0x15000000,
49 0x04000000, 0xc7000000, 0x23000000, 0xc3000000, 0x18000000, 0x96000000,
50 0x05000000, 0x9a000000, 0x07000000, 0x12000000, 0x80000000, 0xe2000000,
51 0xeb000000, 0x27000000, 0xb2000000, 0x75000000, 0x09000000, 0x83000000,
52 0x2c000000, 0x1a000000, 0x1b000000, 0x6e000000, 0x5a000000, 0xa0000000,
53 0x52000000, 0x3b000000, 0xd6000000, 0xb3000000, 0x29000000, 0xe3000000,
54 0x2f000000, 0x84000000, 0x53000000, 0xd1000000, 0x00000000, 0xed000000,
55 0x20000000, 0xfc000000, 0xb1000000, 0x5b000000, 0x6a000000, 0xcb000000,
56 0xbe000000, 0x39000000, 0x4a000000, 0x4c000000, 0x58000000, 0xcf000000,
57 0xd0000000, 0xef000000, 0xaa000000, 0xfb000000, 0x43000000, 0x4d000000,
58 0x33000000, 0x85000000, 0x45000000, 0xf9000000, 0x02000000, 0x7f000000,
59 0x50000000, 0x3c000000, 0x9f000000, 0xa8000000, 0x51000000, 0xa3000000,
60 0x40000000, 0x8f000000, 0x92000000, 0x9d000000, 0x38000000, 0xf5000000,
61 0xbc000000, 0xb6000000, 0xda000000, 0x21000000, 0x10000000, 0xff000000,
62 0xf3000000, 0xd2000000, 0xcd000000, 0x0c000000, 0x13000000, 0xec000000,
63 0x5f000000, 0x97000000, 0x44000000, 0x17000000, 0xc4000000, 0xa7000000,
64 0x7e000000, 0x3d000000, 0x64000000, 0x5d000000, 0x19000000, 0x73000000,
65 0x60000000, 0x81000000, 0x4f000000, 0xdc000000, 0x22000000, 0x2a000000,
66 0x90000000, 0x88000000, 0x46000000, 0xee000000, 0xb8000000, 0x14000000,
67 0xde000000, 0x5e000000, 0x0b000000, 0xdb000000, 0xe0000000, 0x32000000,
68 0x3a000000, 0x0a000000, 0x49000000, 0x06000000, 0x24000000, 0x5c000000,
69 0xc2000000, 0xd3000000, 0xac000000, 0x62000000, 0x91000000, 0x95000000,
70 0xe4000000, 0x79000000, 0xe7000000, 0xc8000000, 0x37000000, 0x6d000000,
71 0x8d000000, 0xd5000000, 0x4e000000, 0xa9000000, 0x6c000000, 0x56000000,
72 0xf4000000, 0xea000000, 0x65000000, 0x7a000000, 0xae000000, 0x08000000,
73 0xba000000, 0x78000000, 0x25000000, 0x2e000000, 0x1c000000, 0xa6000000,
74 0xb4000000, 0xc6000000, 0xe8000000, 0xdd000000, 0x74000000, 0x1f000000,
75 0x4b000000, 0xbd000000, 0x8b000000, 0x8a000000, 0x70000000, 0x3e000000,
76 0xb5000000, 0x66000000, 0x48000000, 0x03000000, 0xf6000000, 0x0e000000,
77 0x61000000, 0x35000000, 0x57000000, 0xb9000000, 0x86000000, 0xc1000000,
78 0x1d000000, 0x9e000000, 0xe1000000, 0xf8000000, 0x98000000, 0x11000000,
79 0x69000000, 0xd9000000, 0x8e000000, 0x94000000, 0x9b000000, 0x1e000000,
80 0x87000000, 0xe9000000, 0xce000000, 0x55000000, 0x28000000, 0xdf000000,
81 0x8c000000, 0xa1000000, 0x89000000, 0x0d000000, 0xbf000000, 0xe6000000,
82 0x42000000, 0x68000000, 0x41000000, 0x99000000, 0x2d000000, 0x0f000000,
83 0xb0000000, 0x54000000, 0xbb000000, 0x16000000
84 };
85
86 static uint32_t const p_aes_itable[ 256 ] =
87 {
88 0x5150a7f4, 0x7e536541, 0x1ac3a417, 0x3a965e27, 0x3bcb6bab, 0x1ff1459d,
89 0xacab58fa, 0x4b9303e3, 0x2055fa30, 0xadf66d76, 0x889176cc, 0xf5254c02,
90 0x4ffcd7e5, 0xc5d7cb2a, 0x26804435, 0xb58fa362, 0xde495ab1, 0x25671bba,
91 0x45980eea, 0x5de1c0fe, 0xc302752f, 0x8112f04c, 0x8da39746, 0x6bc6f9d3,
92 0x03e75f8f, 0x15959c92, 0xbfeb7a6d, 0x95da5952, 0xd42d83be, 0x58d32174,
93 0x492969e0, 0x8e44c8c9, 0x756a89c2, 0xf478798e, 0x996b3e58, 0x27dd71b9,
94 0xbeb64fe1, 0xf017ad88, 0xc966ac20, 0x7db43ace, 0x63184adf, 0xe582311a,
95 0x97603351, 0x62457f53, 0xb1e07764, 0xbb84ae6b, 0xfe1ca081, 0xf9942b08,
96 0x70586848, 0x8f19fd45, 0x94876cde, 0x52b7f87b, 0xab23d373, 0x72e2024b,
97 0xe3578f1f, 0x662aab55, 0xb20728eb, 0x2f03c2b5, 0x869a7bc5, 0xd3a50837,
98 0x30f28728, 0x23b2a5bf, 0x02ba6a03, 0xed5c8216, 0x8a2b1ccf, 0xa792b479,
99 0xf3f0f207, 0x4ea1e269, 0x65cdf4da, 0x06d5be05, 0xd11f6234, 0xc48afea6,
100 0x349d532e, 0xa2a055f3, 0x0532e18a, 0xa475ebf6, 0x0b39ec83, 0x40aaef60,
101 0x5e069f71, 0xbd51106e, 0x3ef98a21, 0x963d06dd, 0xddae053e, 0x4d46bde6,
102 0x91b58d54, 0x71055dc4, 0x046fd406, 0x60ff1550, 0x1924fb98, 0xd697e9bd,
103 0x89cc4340, 0x67779ed9, 0xb0bd42e8, 0x07888b89, 0xe7385b19, 0x79dbeec8,
104 0xa1470a7c, 0x7ce90f42, 0xf8c91e84, 0x00000000, 0x09838680, 0x3248ed2b,
105 0x1eac7011, 0x6c4e725a, 0xfdfbff0e, 0x0f563885, 0x3d1ed5ae, 0x3627392d,
106 0x0a64d90f, 0x6821a65c, 0x9bd1545b, 0x243a2e36, 0x0cb1670a, 0x930fe757,
107 0xb4d296ee, 0x1b9e919b, 0x804fc5c0, 0x61a220dc, 0x5a694b77, 0x1c161a12,
108 0xe20aba93, 0xc0e52aa0, 0x3c43e022, 0x121d171b, 0x0e0b0d09, 0xf2adc78b,
109 0x2db9a8b6, 0x14c8a91e, 0x578519f1, 0xaf4c0775, 0xeebbdd99, 0xa3fd607f,
110 0xf79f2601, 0x5cbcf572, 0x44c53b66, 0x5b347efb, 0x8b762943, 0xcbdcc623,
111 0xb668fced, 0xb863f1e4, 0xd7cadc31, 0x42108563, 0x13402297, 0x842011c6,
112 0x857d244a, 0xd2f83dbb, 0xae1132f9, 0xc76da129, 0x1d4b2f9e, 0xdcf330b2,
113 0x0dec5286, 0x77d0e3c1, 0x2b6c16b3, 0xa999b970, 0x11fa4894, 0x472264e9,
114 0xa8c48cfc, 0xa01a3ff0, 0x56d82c7d, 0x22ef9033, 0x87c74e49, 0xd9c1d138,
115 0x8cfea2ca, 0x98360bd4, 0xa6cf81f5, 0xa528de7a, 0xda268eb7, 0x3fa4bfad,
116 0x2ce49d3a, 0x500d9278, 0x6a9bcc5f, 0x5462467e, 0xf6c2138d, 0x90e8b8d8,
117 0x2e5ef739, 0x82f5afc3, 0x9fbe805d, 0x697c93d0, 0x6fa92dd5, 0xcfb31225,
118 0xc83b99ac, 0x10a77d18, 0xe86e639c, 0xdb7bbb3b, 0xcd097826, 0x6ef41859,
119 0xec01b79a, 0x83a89a4f, 0xe6656e95, 0xaa7ee6ff, 0x2108cfbc, 0xefe6e815,
120 0xbad99be7, 0x4ace366f, 0xead4099f, 0x29d67cb0, 0x31afb2a4, 0x2a31233f,
121 0xc63094a5, 0x35c066a2, 0x7437bc4e, 0xfca6ca82, 0xe0b0d090, 0x3315d8a7,
122 0xf14a9804, 0x41f7daec, 0x7f0e50cd, 0x172ff691, 0x768dd64d, 0x434db0ef,
123 0xcc544daa, 0xe4df0496, 0x9ee3b5d1, 0x4c1b886a, 0xc1b81f2c, 0x467f5165,
124 0x9d04ea5e, 0x015d358c, 0xfa737487, 0xfb2e410b, 0xb35a1d67, 0x9252d2db,
125 0xe9335610, 0x6d1347d6, 0x9a8c61d7, 0x377a0ca1, 0x598e14f8, 0xeb893c13,
126 0xceee27a9, 0xb735c961, 0xe1ede51c, 0x7a3cb147, 0x9c59dfd2, 0x553f73f2,
127 0x1879ce14, 0x73bf37c7, 0x53eacdf7, 0x5f5baafd, 0xdf146f3d, 0x7886db44,
128 0xca81f3af, 0xb93ec468, 0x382c3424, 0xc25f40a3, 0x1672c31d, 0xbc0c25e2,
129 0x288b493c, 0xff41950d, 0x397101a8, 0x08deb30c, 0xd89ce4b4, 0x6490c156,
130 0x7b6184cb, 0xd570b632, 0x48745c6c, 0xd04257b8
131 };
132
133 static uint32_t const p_aes_decrypt[ 256 ] =
134 {
135 0x52000000, 0x09000000, 0x6a000000, 0xd5000000, 0x30000000, 0x36000000,
136 0xa5000000, 0x38000000, 0xbf000000, 0x40000000, 0xa3000000, 0x9e000000,
137 0x81000000, 0xf3000000, 0xd7000000, 0xfb000000, 0x7c000000, 0xe3000000,
138 0x39000000, 0x82000000, 0x9b000000, 0x2f000000, 0xff000000, 0x87000000,
139 0x34000000, 0x8e000000, 0x43000000, 0x44000000, 0xc4000000, 0xde000000,
140 0xe9000000, 0xcb000000, 0x54000000, 0x7b000000, 0x94000000, 0x32000000,
141 0xa6000000, 0xc2000000, 0x23000000, 0x3d000000, 0xee000000, 0x4c000000,
142 0x95000000, 0x0b000000, 0x42000000, 0xfa000000, 0xc3000000, 0x4e000000,
143 0x08000000, 0x2e000000, 0xa1000000, 0x66000000, 0x28000000, 0xd9000000,
144 0x24000000, 0xb2000000, 0x76000000, 0x5b000000, 0xa2000000, 0x49000000,
145 0x6d000000, 0x8b000000, 0xd1000000, 0x25000000, 0x72000000, 0xf8000000,
146 0xf6000000, 0x64000000, 0x86000000, 0x68000000, 0x98000000, 0x16000000,
147 0xd4000000, 0xa4000000, 0x5c000000, 0xcc000000, 0x5d000000, 0x65000000,
148 0xb6000000, 0x92000000, 0x6c000000, 0x70000000, 0x48000000, 0x50000000,
149 0xfd000000, 0xed000000, 0xb9000000, 0xda000000, 0x5e000000, 0x15000000,
150 0x46000000, 0x57000000, 0xa7000000, 0x8d000000, 0x9d000000, 0x84000000,
151 0x90000000, 0xd8000000, 0xab000000, 0x00000000, 0x8c000000, 0xbc000000,
152 0xd3000000, 0x0a000000, 0xf7000000, 0xe4000000, 0x58000000, 0x05000000,
153 0xb8000000, 0xb3000000, 0x45000000, 0x06000000, 0xd0000000, 0x2c000000,
154 0x1e000000, 0x8f000000, 0xca000000, 0x3f000000, 0x0f000000, 0x02000000,
155 0xc1000000, 0xaf000000, 0xbd000000, 0x03000000, 0x01000000, 0x13000000,
156 0x8a000000, 0x6b000000, 0x3a000000, 0x91000000, 0x11000000, 0x41000000,
157 0x4f000000, 0x67000000, 0xdc000000, 0xea000000, 0x97000000, 0xf2000000,
158 0xcf000000, 0xce000000, 0xf0000000, 0xb4000000, 0xe6000000, 0x73000000,
159 0x96000000, 0xac000000, 0x74000000, 0x22000000, 0xe7000000, 0xad000000,
160 0x35000000, 0x85000000, 0xe2000000, 0xf9000000, 0x37000000, 0xe8000000,
161 0x1c000000, 0x75000000, 0xdf000000, 0x6e000000, 0x47000000, 0xf1000000,
162 0x1a000000, 0x71000000, 0x1d000000, 0x29000000, 0xc5000000, 0x89000000,
163 0x6f000000, 0xb7000000, 0x62000000, 0x0e000000, 0xaa000000, 0x18000000,
164 0xbe000000, 0x1b000000, 0xfc000000, 0x56000000, 0x3e000000, 0x4b000000,
165 0xc6000000, 0xd2000000, 0x79000000, 0x20000000, 0x9a000000, 0xdb000000,
166 0xc0000000, 0xfe000000, 0x78000000, 0xcd000000, 0x5a000000, 0xf4000000,
167 0x1f000000, 0xdd000000, 0xa8000000, 0x33000000, 0x88000000, 0x07000000,
168 0xc7000000, 0x31000000, 0xb1000000, 0x12000000, 0x10000000, 0x59000000,
169 0x27000000, 0x80000000, 0xec000000, 0x5f000000, 0x60000000, 0x51000000,
170 0x7f000000, 0xa9000000, 0x19000000, 0xb5000000, 0x4a000000, 0x0d000000,
171 0x2d000000, 0xe5000000, 0x7a000000, 0x9f000000, 0x93000000, 0xc9000000,
172 0x9c000000, 0xef000000, 0xa0000000, 0xe0000000, 0x3b000000, 0x4d000000,
173 0xae000000, 0x2a000000, 0xf5000000, 0xb0000000, 0xc8000000, 0xeb000000,
174 0xbb000000, 0x3c000000, 0x83000000, 0x53000000, 0x99000000, 0x61000000,
175 0x17000000, 0x2b000000, 0x04000000, 0x7e000000, 0xba000000, 0x77000000,
176 0xd6000000, 0x26000000, 0xe1000000, 0x69000000, 0x14000000, 0x63000000,
177 0x55000000, 0x21000000, 0x0c000000, 0x7d000000
178 };
179
180 static uint16_t const p_shuffle_xor[ 256 ] =
181 {
182 0x00d1, 0x0315, 0x1a32, 0x19ec, 0x1bbb, 0x1d6f, 0x14fe, 0x0e9e,
183 0x029e, 0x1b8f, 0x0b70, 0x033a, 0x188e, 0x1d18, 0x0bd8, 0x0edb,
184 0x0c64, 0x1c2b, 0x149c, 0x047b, 0x1064, 0x1c7c, 0x118d, 0x1355,
185 0x0ae5, 0x0f18, 0x016f, 0x17d6, 0x1595, 0x0084, 0x0616, 0x1ccd,
186 0x1d94, 0x0618, 0x182c, 0x195b, 0x196d, 0x0394, 0x07db, 0x0287,
187 0x1636, 0x0b81, 0x1519, 0x0df9, 0x1ba3, 0x1cc3, 0x0ee2, 0x1434,
188 0x1457, 0x0ced, 0x0f7d, 0x0d7b, 0x0b9e, 0x0d13, 0x13d7, 0x18d0,
189 0x1259, 0x1977, 0x0606, 0x1e80, 0x05f2, 0x06b8, 0x1f07, 0x1365,
190 0x0334, 0x0e30, 0x195f, 0x15f1, 0x058e, 0x0aa8, 0x045a, 0x0465,
191 0x0b3e, 0x071e, 0x0a36, 0x105c, 0x01ac, 0x1a1e, 0x04e4, 0x056b,
192 0x12bf, 0x0da2, 0x0b41, 0x0eaf, 0x034f, 0x0181, 0x04e2, 0x002b,
193 0x12e6, 0x01be, 0x10e8, 0x128f, 0x0eb2, 0x1369, 0x05be, 0x1a59,
194 0x117e, 0x047c, 0x1e86, 0x056a, 0x0da7, 0x0d61, 0x03fc, 0x1e6e,
195 0x1d0c, 0x1e6d, 0x14bf, 0x0c50, 0x063a, 0x1b47, 0x17ae, 0x1321,
196 0x041b, 0x0a24, 0x0d4d, 0x1f2b, 0x1cb6, 0x1bed, 0x1549, 0x03a7,
197 0x0254, 0x006c, 0x0c9e, 0x0f73, 0x006c, 0x0008, 0x11f9, 0x0dd5,
198 0x0bcf, 0x0af9, 0x1dfe, 0x0341, 0x0e49, 0x0d38, 0x17cb, 0x1513,
199 0x0e96, 0x00ed, 0x0556, 0x1b28, 0x100c, 0x19d8, 0x14fa, 0x028c,
200 0x1c60, 0x1232, 0x13d3, 0x0d00, 0x1534, 0x192c, 0x14b5, 0x1cf2,
201 0x0504, 0x0b5b, 0x1ecf, 0x0423, 0x183b, 0x06b0, 0x169e, 0x1066,
202 0x04cb, 0x08a2, 0x1b4a, 0x1254, 0x198d, 0x1044, 0x0236, 0x1bd8,
203 0x18a1, 0x03ff, 0x1a0d, 0x0277, 0x0c2d, 0x17c9, 0x007c, 0x116e,
204 0x048a, 0x1eaf, 0x0922, 0x0c45, 0x0766, 0x1e5f, 0x1a28, 0x0120,
205 0x1c15, 0x034c, 0x0508, 0x0e73, 0x0879, 0x0441, 0x09ae, 0x132f,
206 0x14fe, 0x0413, 0x0a9d, 0x1727, 0x01d7, 0x1a2b, 0x0474, 0x18f0,
207 0x1f3b, 0x14f5, 0x1071, 0x0895, 0x1071, 0x18ff, 0x18e3, 0x0eb9,
208 0x0ba9, 0x0961, 0x1599, 0x019e, 0x1d12, 0x1baa, 0x1e94, 0x1921,
209 0x14dc, 0x124e, 0x0a25, 0x03ab, 0x1cc0, 0x1ebb, 0x0b4b, 0x16e5,
210 0x11ea, 0x0d78, 0x1bb3, 0x1ba7, 0x1510, 0x1b7b, 0x0c64, 0x1995,
211 0x1a58, 0x1651, 0x1964, 0x147a, 0x15f2, 0x11bb, 0x1654, 0x166e,
212 0x0ea9, 0x1de1, 0x1443, 0x13c5, 0x00e1, 0x0b2f, 0x0b6f, 0x0a37,
213 0x18ac, 0x08e6, 0x06f0, 0x136e, 0x0853, 0x0b2e, 0x0813, 0x10d6
214 };
215
216 static uint16_t const p_shuffle_sub[ 256 ] =
217 {
218 0x067a, 0x0c7d, 0x0b4f, 0x127d, 0x0bd6, 0x04ac, 0x16e0, 0x1730,
219 0x0587, 0x0afb, 0x1ac3, 0x0120, 0x14b5, 0x0f67, 0x11de, 0x0961,
220 0x1127, 0x1a68, 0x07f0, 0x17d0, 0x1a6f, 0x1f3b, 0x01ef, 0x0919,
221 0x131e, 0x0f90, 0x19e9, 0x18a8, 0x0cb2, 0x1ad0, 0x0c66, 0x0378,
222 0x03b0, 0x01be, 0x1866, 0x1159, 0x197c, 0x1105, 0x010b, 0x0353,
223 0x1abb, 0x09a6, 0x028a, 0x1bad, 0x1b20, 0x0455, 0x0f57, 0x0588,
224 0x1491, 0x0a1d, 0x0f04, 0x0650, 0x191e, 0x1e0e, 0x174b, 0x016b,
225 0x051f, 0x0532, 0x00df, 0x1aea, 0x0005, 0x0e1b, 0x0ff6, 0x08d8,
226 0x14b4, 0x086a, 0x0c20, 0x0149, 0x1971, 0x0f26, 0x1852, 0x017d,
227 0x1228, 0x0352, 0x0a44, 0x1330, 0x18df, 0x1e38, 0x01bc, 0x0bac,
228 0x1a48, 0x021f, 0x02f7, 0x0c31, 0x0bc4, 0x1e75, 0x105c, 0x13e3,
229 0x0b20, 0x03a1, 0x1af3, 0x1a36, 0x0e34, 0x181f, 0x09bd, 0x122b,
230 0x0ee0, 0x163b, 0x0be7, 0x103d, 0x1075, 0x1e9d, 0x02af, 0x0ba2,
231 0x1daa, 0x0cf1, 0x04b6, 0x0598, 0x06a1, 0x0d33, 0x1cfe, 0x04ee,
232 0x1bad, 0x07c8, 0x1a48, 0x05e6, 0x031f, 0x0e0a, 0x0326, 0x1650,
233 0x0526, 0x0b4e, 0x08fc, 0x0e4d, 0x0832, 0x06ea, 0x09bf, 0x0993,
234 0x09eb, 0x0f31, 0x071b, 0x14d5, 0x11ca, 0x0722, 0x120d, 0x014c,
235 0x1993, 0x0ae4, 0x1ccb, 0x04e9, 0x0aee, 0x1708, 0x0c3d, 0x12f2,
236 0x1a19, 0x07c1, 0x05a7, 0x0744, 0x1606, 0x1a9b, 0x042d, 0x1bfc,
237 0x1841, 0x0c3c, 0x0ffe, 0x1ab1, 0x1416, 0x18a9, 0x0320, 0x1ec2,
238 0x0ae7, 0x11c6, 0x124a, 0x11df, 0x0f81, 0x06cf, 0x0ed9, 0x0253,
239 0x1d2b, 0x0349, 0x0805, 0x08b3, 0x1052, 0x12cf, 0x0a44, 0x0ea6,
240 0x03bf, 0x1d90, 0x0ef8, 0x0657, 0x156d, 0x0405, 0x10be, 0x091f,
241 0x1c82, 0x1725, 0x19ef, 0x0b8c, 0x04d9, 0x02c7, 0x025a, 0x1b89,
242 0x0f5c, 0x013d, 0x02f7, 0x12e3, 0x0bc5, 0x1b56, 0x0848, 0x0239,
243 0x0fcf, 0x03a4, 0x092d, 0x1354, 0x1d83, 0x01bd, 0x071a, 0x0af1,
244 0x0875, 0x0793, 0x1b41, 0x1782, 0x0def, 0x1d20, 0x13be, 0x0095,
245 0x1650, 0x19d4, 0x0de3, 0x0980, 0x18f2, 0x0ca3, 0x0098, 0x149a,
246 0x0b81, 0x0ad2, 0x1bba, 0x1a02, 0x027b, 0x1906, 0x07f5, 0x1cae,
247 0x0c3f, 0x02f6, 0x1298, 0x175e, 0x15b2, 0x13d8, 0x14cc, 0x161a,
248 0x0a42, 0x15f3, 0x0870, 0x1c1d, 0x1203, 0x18b1, 0x1738, 0x1954,
249 0x1143, 0x1ae8, 0x1d9d, 0x155b, 0x11e8, 0x0ed9, 0x06f7, 0x04ca
250 };
251
252 static uint16_t const p_shuffle_add[ 256 ] =
253 {
254 0x0706, 0x175a, 0x0def, 0x1e72, 0x0297, 0x1b0e, 0x1d5a, 0x15b8,
255 0x13e2, 0x1347, 0x10c6, 0x0b4f, 0x0629, 0x0a75, 0x0a9b, 0x0f55,
256 0x1a69, 0x09bf, 0x0ba6, 0x1582, 0x1086, 0x1921, 0x01cb, 0x1c6a,
257 0x0ff5, 0x00f7, 0x0a67, 0x0a1e, 0x1838, 0x0196, 0x10d6, 0x0c7a,
258 0x180e, 0x038d, 0x1add, 0x0684, 0x154a, 0x0ab0, 0x18a4, 0x0d73,
259 0x1641, 0x0ec6, 0x09f1, 0x1a62, 0x0414, 0x162a, 0x194e, 0x1ec9,
260 0x022f, 0x0296, 0x1104, 0x14fc, 0x096c, 0x1d02, 0x09bd, 0x027c,
261 0x080e, 0x1324, 0x128c, 0x0dc1, 0x00b9, 0x17f2, 0x0cbc, 0x0f97,
262 0x1b93, 0x1c3c, 0x0415, 0x0395, 0x0c7a, 0x06cc, 0x0d4b, 0x16e2,
263 0x04a2, 0x0dab, 0x1228, 0x012b, 0x0896, 0x0012, 0x1cd6, 0x1dac,
264 0x080d, 0x0446, 0x047a, 0x00ad, 0x029e, 0x0686, 0x17c3, 0x1466,
265 0x0d16, 0x1896, 0x076e, 0x00cd, 0x17dc, 0x1e9f, 0x1a7c, 0x02bb,
266 0x0d06, 0x112b, 0x14cb, 0x0a03, 0x1541, 0x1290, 0x0f6d, 0x1503,
267 0x084b, 0x0382, 0x1a3f, 0x0371, 0x1977, 0x0b67, 0x0cad, 0x1df8,
268 0x1ce3, 0x1306, 0x13f8, 0x1163, 0x1b0b, 0x00bd, 0x0bf0, 0x1a4f,
269 0x16f7, 0x0b4f, 0x0cf8, 0x1254, 0x0541, 0x100d, 0x0296, 0x0410,
270 0x1a2b, 0x1169, 0x17d9, 0x0819, 0x03d6, 0x0d03, 0x194d, 0x184a,
271 0x07ca, 0x1989, 0x0fad, 0x011c, 0x1c71, 0x0ef6, 0x0dc8, 0x0f2f,
272 0x0fa5, 0x11be, 0x0f3b, 0x1d52, 0x0de2, 0x016e, 0x1ad1, 0x0c4a,
273 0x1bc2, 0x0ac9, 0x1485, 0x1bee, 0x0949, 0x1a79, 0x1894, 0x12bb,
274 0x17b6, 0x14f5, 0x16b1, 0x142c, 0x1301, 0x03ef, 0x16ff, 0x0d37,
275 0x0d78, 0x01ff, 0x00d6, 0x1053, 0x1a2a, 0x0f61, 0x1352, 0x0c7f,
276 0x137f, 0x09c4, 0x1d96, 0x021d, 0x1037, 0x1b19, 0x10ef, 0x14e4,
277 0x02a0, 0x0236, 0x0a5d, 0x1519, 0x141c, 0x1399, 0x007e, 0x1e74,
278 0x0941, 0x1b3c, 0x0062, 0x0371, 0x09ad, 0x08e8, 0x0a24, 0x0b97,
279 0x1ed2, 0x0889, 0x136b, 0x0006, 0x1c4c, 0x0444, 0x06f8, 0x0dfb,
280 0x1d0f, 0x198d, 0x0700, 0x0afc, 0x1781, 0x12f3, 0x10da, 0x1f19,
281 0x1055, 0x0dc9, 0x1860, 0x012b, 0x05bf, 0x082d, 0x0c17, 0x1941,
282 0x0359, 0x1232, 0x104c, 0x0762, 0x0897, 0x1d6c, 0x030f, 0x1a36,
283 0x16b0, 0x094d, 0x1782, 0x036f, 0x0eea, 0x06e6, 0x0d00, 0x0187,
284 0x17e2, 0x05e5, 0x19fa, 0x1950, 0x146a, 0x0b2a, 0x0512, 0x0ee0,
285 0x1e27, 0x112d, 0x1df0, 0x0b13, 0x0378, 0x1dd0, 0x00c1, 0x01e6
286 };
287
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: mp4atom.c,v 1.25 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 #include <stdlib.h>
31 #ifndef _WIN32
32 #include "config.h"
33 #else
34 #include <tchar.h>
35 #ifdef ITUNES_DRM
36 #include <shlobj.h>
37 #endif
38 #include <windows.h>
39 #endif
40 #ifdef HAVE_GETPWUID
41 # include <pwd.h>
42 #endif
43 #ifdef HAVE_STRING_H
44 # include <string.h>
45 #endif
46 #include "mp4ffint.h"
47
48 #include "drms.h"
49
50 /* parse atom header size */
51 static int32_t mp4ff_atom_get_size(const int8_t *data)
52 {
53 uint32_t result;
54 uint32_t a, b, c, d;
55
56 a = (uint8_t)data[0];
57 b = (uint8_t)data[1];
58 c = (uint8_t)data[2];
59 d = (uint8_t)data[3];
60
61 result = (a<<24) | (b<<16) | (c<<8) | d;
62 //if (result > 0 && result < 8) result = 8;
63
64 return (int32_t)result;
65 }
66
67 /* comnapre 2 atom names, returns 1 for equal, 0 for unequal */
68 static int32_t mp4ff_atom_compare(const int8_t a1, const int8_t b1, const int8_t c1, const int8_t d1,
69 const int8_t a2, const int8_t b2, const int8_t c2, const int8_t d2)
70 {
71 if (a1 == a2 && b1 == b2 && c1 == c2 && d1 == d2)
72 return 1;
73 else
74 return 0;
75 }
76
77 static uint8_t mp4ff_atom_name_to_type(const int8_t a, const int8_t b,
78 const int8_t c, const int8_t d)
79 {
80 if (a == 'm')
81 {
82 if (mp4ff_atom_compare(a,b,c,d, 'm','o','o','v'))
83 return ATOM_MOOV;
84 else if (mp4ff_atom_compare(a,b,c,d, 'm','i','n','f'))
85 return ATOM_MINF;
86 else if (mp4ff_atom_compare(a,b,c,d, 'm','d','i','a'))
87 return ATOM_MDIA;
88 else if (mp4ff_atom_compare(a,b,c,d, 'm','d','a','t'))
89 return ATOM_MDAT;
90 else if (mp4ff_atom_compare(a,b,c,d, 'm','d','h','d'))
91 return ATOM_MDHD;
92 else if (mp4ff_atom_compare(a,b,c,d, 'm','v','h','d'))
93 return ATOM_MVHD;
94 else if (mp4ff_atom_compare(a,b,c,d, 'm','p','4','a'))
95 return ATOM_MP4A;
96 else if (mp4ff_atom_compare(a,b,c,d, 'm','p','4','v'))
97 return ATOM_MP4V;
98 else if (mp4ff_atom_compare(a,b,c,d, 'm','p','4','s'))
99 return ATOM_MP4S;
100 else if (mp4ff_atom_compare(a,b,c,d, 'm','e','t','a'))
101 return ATOM_META;
102 } else if (a == 't') {
103 if (mp4ff_atom_compare(a,b,c,d, 't','r','a','k'))
104 return ATOM_TRAK;
105 else if (mp4ff_atom_compare(a,b,c,d, 't','k','h','d'))
106 return ATOM_TKHD;
107 else if (mp4ff_atom_compare(a,b,c,d, 't','r','e','f'))
108 return ATOM_TREF;
109 else if (mp4ff_atom_compare(a,b,c,d, 't','r','k','n'))
110 return ATOM_TRACK;
111 else if (mp4ff_atom_compare(a,b,c,d, 't','m','p','o'))
112 return ATOM_TEMPO;
113 } else if (a == 's') {
114 if (mp4ff_atom_compare(a,b,c,d, 's','t','b','l'))
115 return ATOM_STBL;
116 else if (mp4ff_atom_compare(a,b,c,d, 's','m','h','d'))
117 return ATOM_SMHD;
118 else if (mp4ff_atom_compare(a,b,c,d, 's','t','s','d'))
119 return ATOM_STSD;
120 else if (mp4ff_atom_compare(a,b,c,d, 's','t','t','s'))
121 return ATOM_STTS;
122 else if (mp4ff_atom_compare(a,b,c,d, 's','t','c','o'))
123 return ATOM_STCO;
124 else if (mp4ff_atom_compare(a,b,c,d, 's','t','s','c'))
125 return ATOM_STSC;
126 else if (mp4ff_atom_compare(a,b,c,d, 's','t','s','z'))
127 return ATOM_STSZ;
128 else if (mp4ff_atom_compare(a,b,c,d, 's','t','z','2'))
129 return ATOM_STZ2;
130 else if (mp4ff_atom_compare(a,b,c,d, 's','k','i','p'))
131 return ATOM_SKIP;
132 else if (mp4ff_atom_compare(a,b,c,d, 's','i','n','f'))
133 return ATOM_SINF;
134 else if (mp4ff_atom_compare(a,b,c,d, 's','c','h','i'))
135 return ATOM_SCHI;
136 } else if (a == '©') {
137 if (mp4ff_atom_compare(a,b,c,d, '©','n','a','m'))
138 return ATOM_TITLE;
139 else if (mp4ff_atom_compare(a,b,c,d, '©','A','R','T'))
140 return ATOM_ARTIST;
141 else if (mp4ff_atom_compare(a,b,c,d, '©','w','r','t'))
142 return ATOM_WRITER;
143 else if (mp4ff_atom_compare(a,b,c,d, '©','a','l','b'))
144 return ATOM_ALBUM;
145 else if (mp4ff_atom_compare(a,b,c,d, '©','d','a','y'))
146 return ATOM_DATE;
147 else if (mp4ff_atom_compare(a,b,c,d, '©','t','o','o'))
148 return ATOM_TOOL;
149 else if (mp4ff_atom_compare(a,b,c,d, '©','c','m','t'))
150 return ATOM_COMMENT;
151 else if (mp4ff_atom_compare(a,b,c,d, '©','g','e','n'))
152 return ATOM_GENRE1;
153 }
154
155 if (mp4ff_atom_compare(a,b,c,d, 'e','d','t','s'))
156 return ATOM_EDTS;
157 else if (mp4ff_atom_compare(a,b,c,d, 'e','s','d','s'))
158 return ATOM_ESDS;
159 else if (mp4ff_atom_compare(a,b,c,d, 'f','t','y','p'))
160 return ATOM_FTYP;
161 else if (mp4ff_atom_compare(a,b,c,d, 'f','r','e','e'))
162 return ATOM_FREE;
163 else if (mp4ff_atom_compare(a,b,c,d, 'h','m','h','d'))
164 return ATOM_HMHD;
165 else if (mp4ff_atom_compare(a,b,c,d, 'v','m','h','d'))
166 return ATOM_VMHD;
167 else if (mp4ff_atom_compare(a,b,c,d, 'u','d','t','a'))
168 return ATOM_UDTA;
169 else if (mp4ff_atom_compare(a,b,c,d, 'i','l','s','t'))
170 return ATOM_ILST;
171 else if (mp4ff_atom_compare(a,b,c,d, 'n','a','m','e'))
172 return ATOM_NAME;
173 else if (mp4ff_atom_compare(a,b,c,d, 'd','a','t','a'))
174 return ATOM_DATA;
175 else if (mp4ff_atom_compare(a,b,c,d, 'd','i','s','k'))
176 return ATOM_DISC;
177 else if (mp4ff_atom_compare(a,b,c,d, 'g','n','r','e'))
178 return ATOM_GENRE2;
179 else if (mp4ff_atom_compare(a,b,c,d, 'c','o','v','r'))
180 return ATOM_COVER;
181 else if (mp4ff_atom_compare(a,b,c,d, 'c','p','i','l'))
182 return ATOM_COMPILATION;
183 else if (mp4ff_atom_compare(a,b,c,d, 'c','t','t','s'))
184 return ATOM_CTTS;
185 else if (mp4ff_atom_compare(a,b,c,d, 'd','r','m','s'))
186 return ATOM_DRMS;
187 else if (mp4ff_atom_compare(a,b,c,d, 'f','r','m','a'))
188 return ATOM_FRMA;
189 else if (mp4ff_atom_compare(a,b,c,d, 'p','r','i','v'))
190 return ATOM_PRIV;
191 else if (mp4ff_atom_compare(a,b,c,d, 'i','v','i','v'))
192 return ATOM_IVIV;
193 else if (mp4ff_atom_compare(a,b,c,d, 'u','s','e','r'))
194 return ATOM_USER;
195 else if (mp4ff_atom_compare(a,b,c,d, 'k','e','y',' '))
196 return ATOM_KEY;
197 else
198 return ATOM_UNKNOWN;
199 }
200
201 /* read atom header, return atom size, atom size is with header included */
202 uint64_t mp4ff_atom_read_header(mp4ff_t *f, uint8_t *atom_type, uint8_t *header_size)
203 {
204 uint64_t size;
205 int32_t ret;
206 int8_t atom_header[8];
207
208 ret = mp4ff_read_data(f, atom_header, 8);
209 if (ret != 8)
210 return 0;
211
212 size = mp4ff_atom_get_size(atom_header);
213 *header_size = 8;
214
215 /* check for 64 bit atom size */
216 if (size == 1)
217 {
218 *header_size = 16;
219 size = mp4ff_read_int64(f);
220 }
221
222 //printf("%c%c%c%c\n", atom_header[4], atom_header[5], atom_header[6], atom_header[7]);
223
224 *atom_type = mp4ff_atom_name_to_type(atom_header[4], atom_header[5], atom_header[6], atom_header[7]);
225
226 return size;
227 }
228
229 static int32_t mp4ff_read_stsz(mp4ff_t *f)
230 {
231 mp4ff_read_char(f); /* version */
232 mp4ff_read_int24(f); /* flags */
233 f->track[f->total_tracks - 1]->stsz_sample_size = mp4ff_read_int32(f);
234 f->track[f->total_tracks - 1]->stsz_sample_count = mp4ff_read_int32(f);
235
236 if (f->track[f->total_tracks - 1]->stsz_sample_size == 0)
237 {
238 int32_t i;
239 f->track[f->total_tracks - 1]->stsz_table =
240 (int32_t*)malloc(f->track[f->total_tracks - 1]->stsz_sample_count*sizeof(int32_t));
241
242 for (i = 0; i < f->track[f->total_tracks - 1]->stsz_sample_count; i++)
243 {
244 f->track[f->total_tracks - 1]->stsz_table[i] = mp4ff_read_int32(f);
245 }
246 }
247
248 return 0;
249 }
250
251 static int32_t mp4ff_read_esds(mp4ff_t *f)
252 {
253 uint8_t tag;
254 uint32_t temp;
255
256 mp4ff_read_char(f); /* version */
257 mp4ff_read_int24(f); /* flags */
258
259 /* get and verify ES_DescrTag */
260 tag = mp4ff_read_char(f);
261 if (tag == 0x03)
262 {
263 /* read length */
264 if (mp4ff_read_mp4_descr_length(f) < 5 + 15)
265 {
266 return 1;
267 }
268 /* skip 3 bytes */
269 mp4ff_read_int24(f);
270 } else {
271 /* skip 2 bytes */
272 mp4ff_read_int16(f);
273 }
274
275 /* get and verify DecoderConfigDescrTab */
276 if (mp4ff_read_char(f) != 0x04)
277 {
278 return 1;
279 }
280
281 /* read length */
282 temp = mp4ff_read_mp4_descr_length(f);
283 if (temp < 13) return 1;
284
285 f->track[f->total_tracks - 1]->audioType = mp4ff_read_char(f);
286 mp4ff_read_int32(f);//0x15000414 ????
287 f->track[f->total_tracks - 1]->maxBitrate = mp4ff_read_int32(f);
288 f->track[f->total_tracks - 1]->avgBitrate = mp4ff_read_int32(f);
289
290 /* get and verify DecSpecificInfoTag */
291 if (mp4ff_read_char(f) != 0x05)
292 {
293 return 1;
294 }
295
296 /* read length */
297 f->track[f->total_tracks - 1]->decoderConfigLen = mp4ff_read_mp4_descr_length(f);
298
299 if (f->track[f->total_tracks - 1]->decoderConfig)
300 free(f->track[f->total_tracks - 1]->decoderConfig);
301 f->track[f->total_tracks - 1]->decoderConfig = malloc(f->track[f->total_tracks - 1]->decoderConfigLen);
302 if (f->track[f->total_tracks - 1]->decoderConfig)
303 {
304 mp4ff_read_data(f, f->track[f->total_tracks - 1]->decoderConfig, f->track[f->total_tracks - 1]->decoderConfigLen);
305 } else {
306 f->track[f->total_tracks - 1]->decoderConfigLen = 0;
307 }
308
309 /* will skip the remainder of the atom */
310 return 0;
311 }
312
313 static int32_t mp4ff_read_mp4a(mp4ff_t *f)
314 {
315 uint64_t size;
316 int32_t i;
317 uint8_t atom_type = 0;
318 uint8_t header_size = 0;
319
320 for (i = 0; i < 6; i++)
321 {
322 mp4ff_read_char(f); /* reserved */
323 }
324 /* data_reference_index */ mp4ff_read_int16(f);
325
326 mp4ff_read_int32(f); /* reserved */
327 mp4ff_read_int32(f); /* reserved */
328
329 f->track[f->total_tracks - 1]->channelCount = mp4ff_read_int16(f);
330 f->track[f->total_tracks - 1]->sampleSize = mp4ff_read_int16(f);
331
332 mp4ff_read_int16(f);
333 mp4ff_read_int16(f);
334
335 f->track[f->total_tracks - 1]->sampleRate = mp4ff_read_int16(f);
336
337 mp4ff_read_int16(f);
338
339 size = mp4ff_atom_read_header(f, &atom_type, &header_size);
340 if (atom_type == ATOM_ESDS)
341 {
342 mp4ff_read_esds(f);
343 }
344
345 return 0;
346 }
347
348 #ifdef ITUNES_DRM
349 char *GetHomeDir( void )
350 {
351 char *p_tmp, *p_homedir = NULL;
352
353 #if defined(HAVE_GETPWUID)
354 struct passwd *p_pw = NULL;
355 #endif
356
357 #if defined(_WIN32) || defined(UNDER_CE)
358 typedef HRESULT (WINAPI *SHGETFOLDERPATH)( HWND, int, HANDLE, DWORD,
359 LPSTR );
360 # define CSIDL_FLAG_CREATE 0x8000
361 # define CSIDL_APPDATA 0x1A
362 # define SHGFP_TYPE_CURRENT 0
363
364 HINSTANCE shfolder_dll;
365 SHGETFOLDERPATH SHGetFolderPath ;
366 /* load the shfolder dll to retrieve SHGetFolderPath */
367 if( ( shfolder_dll = LoadLibrary( _T("SHFolder.dll") ) ) != NULL )
368 {
369 SHGetFolderPath = (void *)GetProcAddress( shfolder_dll,
370 _T("SHGetFolderPathA") );
371 if ( SHGetFolderPath != NULL )
372 {
373 p_homedir = (char *)malloc( MAX_PATH );
374 if( !p_homedir )
375 {
376 return NULL;
377 }
378
379 /* get the "Application Data" folder for the current user */
380 if( S_OK == SHGetFolderPath( NULL,
381 CSIDL_APPDATA | CSIDL_FLAG_CREATE,
382 NULL, SHGFP_TYPE_CURRENT,
383 p_homedir ) )
384 {
385 FreeLibrary( shfolder_dll );
386 return p_homedir;
387 }
388 free( p_homedir );
389 }
390 FreeLibrary( shfolder_dll );
391 }
392 #endif
393
394 #if defined(HAVE_GETPWUID)
395 if( ( p_pw = getpwuid( getuid() ) ) == NULL )
396 #endif
397 {
398 if( ( p_tmp = getenv( "HOME" ) ) == NULL )
399 {
400 if( ( p_tmp = getenv( "TMP" ) ) == NULL )
401 {
402 p_tmp = "/tmp";
403 }
404 }
405
406 p_homedir = strdup( p_tmp );
407 }
408 #if defined(HAVE_GETPWUID)
409 else
410 {
411 p_homedir = strdup( p_pw->pw_dir );
412 }
413 #endif
414
415 return p_homedir;
416 }
417
418 static int32_t mp4ff_read_drms(mp4ff_t *f, uint64_t skip)
419 {
420 uint64_t size;
421 int32_t i;
422 uint8_t atom_type = 0;
423 uint8_t header_size = 0;
424
425 f->track[f->total_tracks - 1]->p_drms = drms_alloc( GetHomeDir() );
426
427 for (i = 0; i < 6; i++)
428 {
429 mp4ff_read_char(f); /* reserved */
430 }
431 /* data_reference_index */ mp4ff_read_int16(f);
432
433 mp4ff_read_int32(f); /* reserved */
434 mp4ff_read_int32(f); /* reserved */
435
436 f->track[f->total_tracks - 1]->channelCount = mp4ff_read_int16(f);
437 f->track[f->total_tracks - 1]->sampleSize = mp4ff_read_int16(f);
438
439 mp4ff_read_int16(f);
440 mp4ff_read_int16(f);
441
442 f->track[f->total_tracks - 1]->sampleRate = mp4ff_read_int16(f);
443
444 mp4ff_read_int16(f);
445
446 size = mp4ff_atom_read_header(f, &atom_type, &header_size);
447 if (atom_type == ATOM_ESDS)
448 {
449 mp4ff_read_esds(f);
450 }
451 mp4ff_set_position(f, skip+size+28);
452
453 size = mp4ff_atom_read_header(f, &atom_type, &header_size);
454 if (atom_type == ATOM_SINF)
455 {
456 parse_sub_atoms(f, size-header_size,0);
457 }
458
459 return 0;
460 }
461
462 static int32_t mp4ff_read_frma(mp4ff_t *f)
463 {
464 uint8_t atom_type;
465 int8_t type[4];
466
467 mp4ff_read_data(f, type, 4);
468
469 atom_type = mp4ff_atom_name_to_type(type[0], type[1], type[2], type[3]);
470
471 if (atom_type == ATOM_MP4A)
472 {
473 f->track[f->total_tracks - 1]->type = TRACK_AUDIO;
474 } else if (atom_type == ATOM_MP4V) {
475 f->track[f->total_tracks - 1]->type = TRACK_VIDEO;
476 } else if (atom_type == ATOM_MP4S) {
477 f->track[f->total_tracks - 1]->type = TRACK_SYSTEM;
478 } else {
479 f->track[f->total_tracks - 1]->type = TRACK_UNKNOWN;
480 }
481
482 return 0;
483 }
484
485 static int32_t mp4ff_read_name(mp4ff_t *f, uint64_t size)
486 {
487 uint8_t *data = malloc(size);
488 mp4ff_read_data(f, data, size);
489
490 if (f->track[f->total_tracks - 1]->p_drms != NULL)
491 {
492 drms_init(f->track[f->total_tracks - 1]->p_drms,
493 FOURCC_name, data, strlen(data) );
494 }
495
496 if (data)
497 free(data);
498
499 return 0;
500 }
501
502 static int32_t mp4ff_read_priv(mp4ff_t *f, uint64_t size)
503 {
504 uint8_t *data = malloc(size);
505 mp4ff_read_data(f, data, size);
506
507 if (f->track[f->total_tracks - 1]->p_drms != 0)
508 {
509 drms_init(f->track[f->total_tracks - 1]->p_drms,
510 FOURCC_priv, data, size );
511 }
512
513 if (data)
514 free(data);
515
516 return 0;
517 }
518
519 static int32_t mp4ff_read_iviv(mp4ff_t *f, uint64_t size)
520 {
521 uint8_t *data = malloc(size);
522 mp4ff_read_data(f, data, size);
523
524 if (f->track[f->total_tracks - 1]->p_drms != 0)
525 {
526 drms_init(f->track[f->total_tracks - 1]->p_drms,
527 FOURCC_iviv, data, sizeof(uint32_t) * 4 );
528 }
529
530 if (data)
531 free(data);
532
533 return 0;
534 }
535
536 static int32_t mp4ff_read_user(mp4ff_t *f, uint64_t size)
537 {
538 uint8_t *data = malloc(size);
539 mp4ff_read_data(f, data, size);
540
541 if (f->track[f->total_tracks - 1]->p_drms != 0)
542 {
543 drms_init(f->track[f->total_tracks - 1]->p_drms,
544 FOURCC_user, data, size );
545 }
546
547 if (data)
548 free(data);
549
550 return 0;
551 }
552
553 static int32_t mp4ff_read_key(mp4ff_t *f, uint64_t size)
554 {
555 uint8_t *data = malloc(size);
556 mp4ff_read_data(f, data, size);
557
558 if (f->track[f->total_tracks - 1]->p_drms != 0)
559 {
560 drms_init(f->track[f->total_tracks - 1]->p_drms,
561 FOURCC_key, data, size );
562 }
563
564 if (data)
565 free(data);
566
567 return 0;
568 }
569 #endif
570
571 static int32_t mp4ff_read_stsd(mp4ff_t *f)
572 {
573 int32_t i;
574 uint8_t header_size = 0;
575
576 mp4ff_read_char(f); /* version */
577 mp4ff_read_int24(f); /* flags */
578
579 f->track[f->total_tracks - 1]->stsd_entry_count = mp4ff_read_int32(f);
580
581 for (i = 0; i < f->track[f->total_tracks - 1]->stsd_entry_count; i++)
582 {
583 uint64_t skip = mp4ff_position(f);
584 uint64_t size;
585 uint8_t atom_type = 0;
586 size = mp4ff_atom_read_header(f, &atom_type, &header_size);
587 skip += size;
588
589 if (atom_type == ATOM_MP4A)
590 {
591 f->track[f->total_tracks - 1]->type = TRACK_AUDIO;
592 mp4ff_read_mp4a(f);
593 } else if (atom_type == ATOM_MP4V) {
594 f->track[f->total_tracks - 1]->type = TRACK_VIDEO;
595 } else if (atom_type == ATOM_MP4S) {
596 f->track[f->total_tracks - 1]->type = TRACK_SYSTEM;
597 #ifdef ITUNES_DRM
598 } else if (atom_type == ATOM_DRMS) {
599 // track type is read from the "frma" atom
600 f->track[f->total_tracks - 1]->type = TRACK_UNKNOWN;
601 mp4ff_read_drms(f, skip-size+header_size);
602 #endif
603 } else {
604 f->track[f->total_tracks - 1]->type = TRACK_UNKNOWN;
605 }
606
607 mp4ff_set_position(f, skip);
608 }
609
610 return 0;
611 }
612
613 static int32_t mp4ff_read_stsc(mp4ff_t *f)
614 {
615 int32_t i;
616
617 mp4ff_read_char(f); /* version */
618 mp4ff_read_int24(f); /* flags */
619 f->track[f->total_tracks - 1]->stsc_entry_count = mp4ff_read_int32(f);
620
621 f->track[f->total_tracks - 1]->stsc_first_chunk =
622 (int32_t*)malloc(f->track[f->total_tracks - 1]->stsc_entry_count*sizeof(int32_t));
623 f->track[f->total_tracks - 1]->stsc_samples_per_chunk =
624 (int32_t*)malloc(f->track[f->total_tracks - 1]->stsc_entry_count*sizeof(int32_t));
625 f->track[f->total_tracks - 1]->stsc_sample_desc_index =
626 (int32_t*)malloc(f->track[f->total_tracks - 1]->stsc_entry_count*sizeof(int32_t));
627
628 for (i = 0; i < f->track[f->total_tracks - 1]->stsc_entry_count; i++)
629 {
630 f->track[f->total_tracks - 1]->stsc_first_chunk[i] = mp4ff_read_int32(f);
631 f->track[f->total_tracks - 1]->stsc_samples_per_chunk[i] = mp4ff_read_int32(f);
632 f->track[f->total_tracks - 1]->stsc_sample_desc_index[i] = mp4ff_read_int32(f);
633 }
634
635 return 0;
636 }
637
638 static int32_t mp4ff_read_stco(mp4ff_t *f)
639 {
640 int32_t i;
641
642 mp4ff_read_char(f); /* version */
643 mp4ff_read_int24(f); /* flags */
644 f->track[f->total_tracks - 1]->stco_entry_count = mp4ff_read_int32(f);
645
646 f->track[f->total_tracks - 1]->stco_chunk_offset =
647 (int32_t*)malloc(f->track[f->total_tracks - 1]->stco_entry_count*sizeof(int32_t));
648
649 for (i = 0; i < f->track[f->total_tracks - 1]->stco_entry_count; i++)
650 {
651 f->track[f->total_tracks - 1]->stco_chunk_offset[i] = mp4ff_read_int32(f);
652 }
653
654 return 0;
655 }
656
657 static int32_t mp4ff_read_ctts(mp4ff_t *f)
658 {
659 int32_t i;
660 mp4ff_track_t * p_track = f->track[f->total_tracks - 1];
661
662 if (p_track->ctts_entry_count) return 0;
663
664 mp4ff_read_char(f); /* version */
665 mp4ff_read_int24(f); /* flags */
666 p_track->ctts_entry_count = mp4ff_read_int32(f);
667
668 p_track->ctts_sample_count = (int32_t*)malloc(p_track->ctts_entry_count * sizeof(int32_t));
669 p_track->ctts_sample_offset = (int32_t*)malloc(p_track->ctts_entry_count * sizeof(int32_t));
670
671 if (p_track->ctts_sample_count == 0 || p_track->ctts_sample_offset == 0)
672 {
673 if (p_track->ctts_sample_count) {free(p_track->ctts_sample_count);p_track->ctts_sample_count=0;}
674 if (p_track->ctts_sample_offset) {free(p_track->ctts_sample_offset);p_track->ctts_sample_offset=0;}
675 p_track->ctts_entry_count = 0;
676 return 0;
677 }
678 else
679 {
680 for (i = 0; i < f->track[f->total_tracks - 1]->ctts_entry_count; i++)
681 {
682 p_track->ctts_sample_count[i] = mp4ff_read_int32(f);
683 p_track->ctts_sample_offset[i] = mp4ff_read_int32(f);
684 }
685 return 1;
686 }
687 }
688
689 static int32_t mp4ff_read_stts(mp4ff_t *f)
690 {
691 int32_t i;
692 mp4ff_track_t * p_track = f->track[f->total_tracks - 1];
693
694 if (p_track->stts_entry_count) return 0;
695
696 mp4ff_read_char(f); /* version */
697 mp4ff_read_int24(f); /* flags */
698 p_track->stts_entry_count = mp4ff_read_int32(f);
699
700 p_track->stts_sample_count = (int32_t*)malloc(p_track->stts_entry_count * sizeof(int32_t));
701 p_track->stts_sample_delta = (int32_t*)malloc(p_track->stts_entry_count * sizeof(int32_t));
702
703 if (p_track->stts_sample_count == 0 || p_track->stts_sample_delta == 0)
704 {
705 if (p_track->stts_sample_count) {free(p_track->stts_sample_count);p_track->stts_sample_count=0;}
706 if (p_track->stts_sample_delta) {free(p_track->stts_sample_delta);p_track->stts_sample_delta=0;}
707 p_track->stts_entry_count = 0;
708 return 0;
709 }
710 else
711 {
712 for (i = 0; i < f->track[f->total_tracks - 1]->stts_entry_count; i++)
713 {
714 p_track->stts_sample_count[i] = mp4ff_read_int32(f);
715 p_track->stts_sample_delta[i] = mp4ff_read_int32(f);
716 }
717 return 1;
718 }
719 }
720
721 static int32_t mp4ff_read_mvhd(mp4ff_t *f)
722 {
723 int32_t i;
724
725 mp4ff_read_char(f); /* version */
726 mp4ff_read_int24(f); /* flags */
727 /* creation_time */ mp4ff_read_int32(f);
728 /* modification_time */ mp4ff_read_int32(f);
729 f->time_scale = mp4ff_read_int32(f);
730 f->duration = mp4ff_read_int32(f);
731 /* preferred_rate */ mp4ff_read_int32(f); /*mp4ff_read_fixed32(f);*/
732 /* preferred_volume */ mp4ff_read_int16(f); /*mp4ff_read_fixed16(f);*/
733 for (i = 0; i < 10; i++)
734 {
735 /* reserved */ mp4ff_read_char(f);
736 }
737 for (i = 0; i < 9; i++)
738 {
739 mp4ff_read_int32(f); /* matrix */
740 }
741 /* preview_time */ mp4ff_read_int32(f);
742 /* preview_duration */ mp4ff_read_int32(f);
743 /* poster_time */ mp4ff_read_int32(f);
744 /* selection_time */ mp4ff_read_int32(f);
745 /* selection_duration */ mp4ff_read_int32(f);
746 /* current_time */ mp4ff_read_int32(f);
747 /* next_track_id */ mp4ff_read_int32(f);
748
749 return 0;
750 }
751
752 #if 0
753 static int32_t mp4ff_read_tkhd(mp4ff_t *f)
754 {
755 uint8_t version;
756 uint32_t flags;
757 version = mp4ff_read_char(f); /* version */
758 flags = mp4ff_read_int24(f); /* flags */
759 if (version==1)
760 {
761 mp4ff_read_int64(f);//creation-time
762 mp4ff_read_int64(f);//modification-time
763 mp4ff_read_int32(f);//track-id
764 mp4ff_read_int32(f);//reserved
765 f->track[f->total_tracks - 1]->duration = mp4ff_read_int64(f);//duration
766 }
767 else //version == 0
768 {
769 mp4ff_read_int32(f);//creation-time
770 mp4ff_read_int32(f);//modification-time
771 mp4ff_read_int32(f);//track-id
772 mp4ff_read_int32(f);//reserved
773 f->track[f->total_tracks - 1]->duration = mp4ff_read_int32(f);//duration
774 if (f->track[f->total_tracks - 1]->duration == 0xFFFFFFFF)
775 f->track[f->total_tracks - 1]->duration = 0xFFFFFFFFFFFFFFFF;
776
777 }
778 mp4ff_read_int32(f);//reserved
779 mp4ff_read_int32(f);//reserved
780 mp4ff_read_int16(f);//layer
781 mp4ff_read_int16(f);//pre-defined
782 mp4ff_read_int16(f);//volume
783 mp4ff_read_int16(f);//reserved
784
785 //matrix
786 mp4ff_read_int32(f); mp4ff_read_int32(f); mp4ff_read_int32(f);
787 mp4ff_read_int32(f); mp4ff_read_int32(f); mp4ff_read_int32(f);
788 mp4ff_read_int32(f); mp4ff_read_int32(f); mp4ff_read_int32(f);
789 mp4ff_read_int32(f);//width
790 mp4ff_read_int32(f);//height
791 return 1;
792 }
793 #endif
794
795 static int32_t mp4ff_read_mdhd(mp4ff_t *f)
796 {
797 uint32_t version;
798
799 version = mp4ff_read_int32(f);
800 if (version==1)
801 {
802 mp4ff_read_int64(f);//creation-time
803 mp4ff_read_int64(f);//modification-time
804 f->track[f->total_tracks - 1]->timeScale = mp4ff_read_int32(f);//timescale
805 f->track[f->total_tracks - 1]->duration = mp4ff_read_int64(f);//duration
806 }
807 else //version == 0
808 {
809 uint32_t temp;
810
811 mp4ff_read_int32(f);//creation-time
812 mp4ff_read_int32(f);//modification-time
813 f->track[f->total_tracks - 1]->timeScale = mp4ff_read_int32(f);//timescale
814 temp = mp4ff_read_int32(f);
815 f->track[f->total_tracks - 1]->duration = (temp == (uint32_t)(-1)) ? (uint64_t)(-1) : (uint64_t)(temp);
816 }
817 mp4ff_read_int16(f);
818 mp4ff_read_int16(f);
819 return 1;
820 }
821 #ifdef USE_TAGGING
822 static int32_t mp4ff_read_meta(mp4ff_t *f, const uint64_t size)
823 {
824 uint64_t subsize, sumsize = 0;
825 uint8_t atom_type;
826 uint8_t header_size = 0;
827
828 mp4ff_read_char(f); /* version */
829 mp4ff_read_int24(f); /* flags */
830
831 while (sumsize < (size-(header_size+4)))
832 {
833 subsize = mp4ff_atom_read_header(f, &atom_type, &header_size);
834 if (subsize <= header_size+4)
835 return 1;
836 if (atom_type == ATOM_ILST)
837 {
838 mp4ff_parse_metadata(f, (uint32_t)(subsize-(header_size+4)));
839 } else {
840 mp4ff_set_position(f, mp4ff_position(f)+subsize-header_size);
841 }
842 sumsize += subsize;
843 }
844
845 return 0;
846 }
847 #endif
848
849 int32_t mp4ff_atom_read(mp4ff_t *f, const int32_t size, const uint8_t atom_type)
850 {
851 uint64_t dest_position = mp4ff_position(f)+size-8;
852 if (atom_type == ATOM_STSZ)
853 {
854 /* sample size box */
855 mp4ff_read_stsz(f);
856 } else if (atom_type == ATOM_STTS) {
857 /* time to sample box */
858 mp4ff_read_stts(f);
859 } else if (atom_type == ATOM_CTTS) {
860 /* composition offset box */
861 mp4ff_read_ctts(f);
862 } else if (atom_type == ATOM_STSC) {
863 /* sample to chunk box */
864 mp4ff_read_stsc(f);
865 } else if (atom_type == ATOM_STCO) {
866 /* chunk offset box */
867 mp4ff_read_stco(f);
868 } else if (atom_type == ATOM_STSD) {
869 /* sample description box */
870 mp4ff_read_stsd(f);
871 } else if (atom_type == ATOM_MVHD) {
872 /* movie header box */
873 mp4ff_read_mvhd(f);
874 } else if (atom_type == ATOM_MDHD) {
875 /* track header */
876 mp4ff_read_mdhd(f);
877 #ifdef ITUNES_DRM
878 } else if (atom_type == ATOM_FRMA) {
879 /* DRM track format */
880 mp4ff_read_frma(f);
881 } else if (atom_type == ATOM_IVIV) {
882 mp4ff_read_iviv(f, size-8);
883 } else if (atom_type == ATOM_NAME) {
884 mp4ff_read_name(f, size-8);
885 } else if (atom_type == ATOM_PRIV) {
886 mp4ff_read_priv(f, size-8);
887 } else if (atom_type == ATOM_USER) {
888 mp4ff_read_user(f, size-8);
889 } else if (atom_type == ATOM_KEY) {
890 mp4ff_read_key(f, size-8);
891 #endif
892 #ifdef USE_TAGGING
893 } else if (atom_type == ATOM_META) {
894 /* iTunes Metadata box */
895 mp4ff_read_meta(f, size);
896 #endif
897 }
898
899 mp4ff_set_position(f, dest_position);
900
901
902 return 0;
903 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: mp4ff.c,v 1.20 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 #include <stdlib.h>
31 #include <string.h>
32 #include "mp4ffint.h"
33
34 #include "drms.h"
35
36 mp4ff_t *mp4ff_open_read(mp4ff_callback_t *f)
37 {
38 mp4ff_t *ff = malloc(sizeof(mp4ff_t));
39
40 memset(ff, 0, sizeof(mp4ff_t));
41
42 ff->stream = f;
43
44 parse_atoms(ff,0);
45
46 return ff;
47 }
48
49 mp4ff_t *mp4ff_open_read_metaonly(mp4ff_callback_t *f)
50 {
51 mp4ff_t *ff = malloc(sizeof(mp4ff_t));
52
53 memset(ff, 0, sizeof(mp4ff_t));
54
55 ff->stream = f;
56
57 parse_atoms(ff,1);
58
59 return ff;
60 }
61
62 void mp4ff_close(mp4ff_t *ff)
63 {
64 int32_t i;
65
66 for (i = 0; i < ff->total_tracks; i++)
67 {
68 if (ff->track[i])
69 {
70 if (ff->track[i]->stsz_table)
71 free(ff->track[i]->stsz_table);
72 if (ff->track[i]->stts_sample_count)
73 free(ff->track[i]->stts_sample_count);
74 if (ff->track[i]->stts_sample_delta)
75 free(ff->track[i]->stts_sample_delta);
76 if (ff->track[i]->stsc_first_chunk)
77 free(ff->track[i]->stsc_first_chunk);
78 if (ff->track[i]->stsc_samples_per_chunk)
79 free(ff->track[i]->stsc_samples_per_chunk);
80 if (ff->track[i]->stsc_sample_desc_index)
81 free(ff->track[i]->stsc_sample_desc_index);
82 if (ff->track[i]->stco_chunk_offset)
83 free(ff->track[i]->stco_chunk_offset);
84 if (ff->track[i]->decoderConfig)
85 free(ff->track[i]->decoderConfig);
86 if (ff->track[i]->ctts_sample_count)
87 free(ff->track[i]->ctts_sample_count);
88 if (ff->track[i]->ctts_sample_offset)
89 free(ff->track[i]->ctts_sample_offset);
90 #ifdef ITUNES_DRM
91 if (ff->track[i]->p_drms)
92 drms_free(ff->track[i]->p_drms);
93 #endif
94 free(ff->track[i]);
95 }
96 }
97
98 #ifdef USE_TAGGING
99 mp4ff_tag_delete(&(ff->tags));
100 #endif
101
102 if (ff) free(ff);
103 }
104
105 static void mp4ff_track_add(mp4ff_t *f)
106 {
107 f->total_tracks++;
108
109 f->track[f->total_tracks - 1] = malloc(sizeof(mp4ff_track_t));
110
111 memset(f->track[f->total_tracks - 1], 0, sizeof(mp4ff_track_t));
112 }
113
114 static int need_parse_when_meta_only(uint8_t atom_type)
115 {
116 switch(atom_type)
117 {
118 case ATOM_EDTS:
119 // case ATOM_MDIA:
120 // case ATOM_MINF:
121 case ATOM_DRMS:
122 case ATOM_SINF:
123 case ATOM_SCHI:
124 // case ATOM_STBL:
125 // case ATOM_STSD:
126 case ATOM_STTS:
127 case ATOM_STSZ:
128 case ATOM_STZ2:
129 case ATOM_STCO:
130 case ATOM_STSC:
131 // case ATOM_CTTS:
132 case ATOM_FRMA:
133 case ATOM_IVIV:
134 case ATOM_PRIV:
135 return 0;
136 default:
137 return 1;
138 }
139 }
140
141 /* parse atoms that are sub atoms of other atoms */
142 int32_t parse_sub_atoms(mp4ff_t *f, const uint64_t total_size,int meta_only)
143 {
144 uint64_t size;
145 uint8_t atom_type = 0;
146 uint64_t counted_size = 0;
147 uint8_t header_size = 0;
148
149 while (counted_size < total_size)
150 {
151 size = mp4ff_atom_read_header(f, &atom_type, &header_size);
152 counted_size += size;
153
154 /* check for end of file */
155 if (size == 0)
156 break;
157
158 /* we're starting to read a new track, update index,
159 * so that all data and tables get written in the right place
160 */
161 if (atom_type == ATOM_TRAK)
162 {
163 mp4ff_track_add(f);
164 }
165
166 /* parse subatoms */
167 if (meta_only && !need_parse_when_meta_only(atom_type))
168 {
169 mp4ff_set_position(f, mp4ff_position(f)+size-header_size);
170 } else if (atom_type < SUBATOMIC)
171 {
172 parse_sub_atoms(f, size-header_size,meta_only);
173 } else {
174 mp4ff_atom_read(f, (uint32_t)size, atom_type);
175 }
176 }
177
178 return 0;
179 }
180
181 /* parse root atoms */
182 int32_t parse_atoms(mp4ff_t *f,int meta_only)
183 {
184 uint64_t size;
185 uint8_t atom_type = 0;
186 uint8_t header_size = 0;
187
188 f->file_size = 0;
189
190 while ((size = mp4ff_atom_read_header(f, &atom_type, &header_size)) != 0)
191 {
192 f->file_size += size;
193 f->last_atom = atom_type;
194
195 if (atom_type == ATOM_MDAT && f->moov_read)
196 {
197 /* moov atom is before mdat, we can stop reading when mdat is encountered */
198 /* file position will stay at beginning of mdat data */
199 // break;
200 }
201
202 if (atom_type == ATOM_MOOV && size > header_size)
203 {
204 f->moov_read = 1;
205 f->moov_offset = mp4ff_position(f)-header_size;
206 f->moov_size = size;
207 }
208
209 /* parse subatoms */
210 if (meta_only && !need_parse_when_meta_only(atom_type))
211 {
212 mp4ff_set_position(f, mp4ff_position(f)+size-header_size);
213 } else if (atom_type < SUBATOMIC)
214 {
215 parse_sub_atoms(f, size-header_size,meta_only);
216 } else {
217 /* skip this atom */
218 mp4ff_set_position(f, mp4ff_position(f)+size-header_size);
219 }
220 }
221
222 return 0;
223 }
224
225 int32_t mp4ff_get_decoder_config(const mp4ff_t *f, const int32_t track,
226 uint8_t** ppBuf, uint32_t* pBufSize)
227 {
228 if (track >= f->total_tracks)
229 {
230 *ppBuf = NULL;
231 *pBufSize = 0;
232 return 1;
233 }
234
235 if (f->track[track]->decoderConfig == NULL || f->track[track]->decoderConfigLen == 0)
236 {
237 *ppBuf = NULL;
238 *pBufSize = 0;
239 } else {
240 *ppBuf = malloc(f->track[track]->decoderConfigLen);
241 if (*ppBuf == NULL)
242 {
243 *pBufSize = 0;
244 return 1;
245 }
246 memcpy(*ppBuf, f->track[track]->decoderConfig, f->track[track]->decoderConfigLen);
247 *pBufSize = f->track[track]->decoderConfigLen;
248 }
249
250 return 0;
251 }
252
253 int32_t mp4ff_get_track_type(const mp4ff_t *f, const int track)
254 {
255 return f->track[track]->type;
256 }
257
258 int32_t mp4ff_total_tracks(const mp4ff_t *f)
259 {
260 return f->total_tracks;
261 }
262
263 int32_t mp4ff_time_scale(const mp4ff_t *f, const int32_t track)
264 {
265 return f->track[track]->timeScale;
266 }
267
268 uint32_t mp4ff_get_avg_bitrate(const mp4ff_t *f, const int32_t track)
269 {
270 return f->track[track]->avgBitrate;
271 }
272
273 uint32_t mp4ff_get_max_bitrate(const mp4ff_t *f, const int32_t track)
274 {
275 return f->track[track]->maxBitrate;
276 }
277
278 int64_t mp4ff_get_track_duration(const mp4ff_t *f, const int32_t track)
279 {
280 return f->track[track]->duration;
281 }
282
283 int64_t mp4ff_get_track_duration_use_offsets(const mp4ff_t *f, const int32_t track)
284 {
285 int64_t duration = mp4ff_get_track_duration(f,track);
286 if (duration!=-1)
287 {
288 int64_t offset = mp4ff_get_sample_offset(f,track,0);
289 if (offset > duration) duration = 0;
290 else duration -= offset;
291 }
292 return duration;
293 }
294
295
296 int32_t mp4ff_num_samples(const mp4ff_t *f, const int32_t track)
297 {
298 int32_t i;
299 int32_t total = 0;
300
301 for (i = 0; i < f->track[track]->stts_entry_count; i++)
302 {
303 total += f->track[track]->stts_sample_count[i];
304 }
305 return total;
306 }
307
308
309
310
311 uint32_t mp4ff_get_sample_rate(const mp4ff_t *f, const int32_t track)
312 {
313 return f->track[track]->sampleRate;
314 }
315
316 uint32_t mp4ff_get_channel_count(const mp4ff_t * f,const int32_t track)
317 {
318 return f->track[track]->channelCount;
319 }
320
321 uint32_t mp4ff_get_audio_type(const mp4ff_t * f,const int32_t track)
322 {
323 return f->track[track]->audioType;
324 }
325
326 int32_t mp4ff_get_sample_duration_use_offsets(const mp4ff_t *f, const int32_t track, const int32_t sample)
327 {
328 int32_t d,o;
329 d = mp4ff_get_sample_duration(f,track,sample);
330 if (d!=-1)
331 {
332 o = mp4ff_get_sample_offset(f,track,sample);
333 if (o>d) d = 0;
334 else d -= o;
335 }
336 return d;
337 }
338
339 int32_t mp4ff_get_sample_duration(const mp4ff_t *f, const int32_t track, const int32_t sample)
340 {
341 int32_t i, co = 0;
342
343 for (i = 0; i < f->track[track]->stts_entry_count; i++)
344 {
345 int32_t delta = f->track[track]->stts_sample_count[i];
346 if (sample < co + delta)
347 return f->track[track]->stts_sample_delta[i];
348 co += delta;
349 }
350 return (int32_t)(-1);
351 }
352
353 int64_t mp4ff_get_sample_position(const mp4ff_t *f, const int32_t track, const int32_t sample)
354 {
355 int32_t i, co = 0;
356 int64_t acc = 0;
357
358 for (i = 0; i < f->track[track]->stts_entry_count; i++)
359 {
360 int32_t delta = f->track[track]->stts_sample_count[i];
361 if (sample < co + delta)
362 {
363 acc += f->track[track]->stts_sample_delta[i] * (sample - co);
364 return acc;
365 }
366 else
367 {
368 acc += f->track[track]->stts_sample_delta[i] * delta;
369 }
370 co += delta;
371 }
372 return (int64_t)(-1);
373 }
374
375 int32_t mp4ff_get_sample_offset(const mp4ff_t *f, const int32_t track, const int32_t sample)
376 {
377 int32_t i, co = 0;
378
379 for (i = 0; i < f->track[track]->ctts_entry_count; i++)
380 {
381 int32_t delta = f->track[track]->ctts_sample_count[i];
382 if (sample < co + delta)
383 return f->track[track]->ctts_sample_offset[i];
384 co += delta;
385 }
386 return 0;
387 }
388
389 int32_t mp4ff_find_sample(const mp4ff_t *f, const int32_t track, const int64_t offset,int32_t * toskip)
390 {
391 int32_t i, co = 0;
392 int64_t offset_total = 0;
393 mp4ff_track_t * p_track = f->track[track];
394
395 for (i = 0; i < p_track->stts_entry_count; i++)
396 {
397 int32_t sample_count = p_track->stts_sample_count[i];
398 int32_t sample_delta = p_track->stts_sample_delta[i];
399 int64_t offset_delta = (int64_t)sample_delta * (int64_t)sample_count;
400 if (offset < offset_total + offset_delta)
401 {
402 int64_t offset_fromstts = offset - offset_total;
403 if (toskip) *toskip = (int32_t)(offset_fromstts % sample_delta);
404 return co + (int32_t)(offset_fromstts / sample_delta);
405 }
406 else
407 {
408 offset_total += offset_delta;
409 }
410 co += sample_count;
411 }
412 return (int32_t)(-1);
413 }
414
415 int32_t mp4ff_find_sample_use_offsets(const mp4ff_t *f, const int32_t track, const int64_t offset,int32_t * toskip)
416 {
417 return mp4ff_find_sample(f,track,offset + mp4ff_get_sample_offset(f,track,0),toskip);
418 }
419
420 int32_t mp4ff_read_sample(mp4ff_t *f, const int32_t track, const int32_t sample,
421 uint8_t **audio_buffer, uint32_t *bytes)
422 {
423 int32_t result = 0;
424
425 *bytes = mp4ff_audio_frame_size(f, track, sample);
426
427 if (*bytes==0) return 0;
428
429 *audio_buffer = (uint8_t*)malloc(*bytes);
430
431 mp4ff_set_sample_position(f, track, sample);
432
433 result = mp4ff_read_data(f, *audio_buffer, *bytes);
434
435 if (!result)
436 {
437 free(*audio_buffer);
438 *audio_buffer = 0;
439 return 0;
440 }
441
442 #ifdef ITUNES_DRM
443 if (f->track[track]->p_drms != NULL)
444 {
445 drms_decrypt(f->track[track]->p_drms, (uint32_t*)*audio_buffer, *bytes);
446 }
447 #endif
448
449 return *bytes;
450 }
451
452
453 int32_t mp4ff_read_sample_v2(mp4ff_t *f, const int track, const int sample,unsigned char *buffer)
454 {
455 int32_t result = 0;
456 int32_t size = mp4ff_audio_frame_size(f,track,sample);
457 if (size<=0) return 0;
458 mp4ff_set_sample_position(f, track, sample);
459 result = mp4ff_read_data(f,buffer,size);
460
461 #ifdef ITUNES_DRM
462 if (f->track[track]->p_drms != NULL)
463 {
464 drms_decrypt(f->track[track]->p_drms, (uint32_t*)buffer, size);
465 }
466 #endif
467
468 return result;
469 }
470
471 int32_t mp4ff_read_sample_getsize(mp4ff_t *f, const int track, const int sample)
472 {
473 int32_t temp = mp4ff_audio_frame_size(f, track, sample);
474 if (temp<0) temp = 0;
475 return temp;
476 }
0 # Microsoft Developer Studio Project File - Name="mp4ff" - Package Owner=<4>
1 # Microsoft Developer Studio Generated Build File, Format Version 6.00
2 # ** DO NOT EDIT **
3
4 # TARGTYPE "Win32 (x86) Static Library" 0x0104
5
6 CFG=mp4ff - Win32 Debug
7 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
8 !MESSAGE use the Export Makefile command and run
9 !MESSAGE
10 !MESSAGE NMAKE /f "mp4ff.mak".
11 !MESSAGE
12 !MESSAGE You can specify a configuration when running NMAKE
13 !MESSAGE by defining the macro CFG on the command line. For example:
14 !MESSAGE
15 !MESSAGE NMAKE /f "mp4ff.mak" CFG="mp4ff - Win32 Debug"
16 !MESSAGE
17 !MESSAGE Possible choices for configuration are:
18 !MESSAGE
19 !MESSAGE "mp4ff - Win32 Release" (based on "Win32 (x86) Static Library")
20 !MESSAGE "mp4ff - Win32 Debug" (based on "Win32 (x86) Static Library")
21 !MESSAGE
22
23 # Begin Project
24 # PROP AllowPerConfigDependencies 0
25 # PROP Scc_ProjName ""
26 # PROP Scc_LocalPath ""
27 CPP=xicl6.exe
28 RSC=rc.exe
29
30 !IF "$(CFG)" == "mp4ff - Win32 Release"
31
32 # PROP BASE Use_MFC 0
33 # PROP BASE Use_Debug_Libraries 0
34 # PROP BASE Output_Dir "Release"
35 # PROP BASE Intermediate_Dir "Release"
36 # PROP BASE Target_Dir ""
37 # PROP Use_MFC 0
38 # PROP Use_Debug_Libraries 0
39 # PROP Output_Dir "Release"
40 # PROP Intermediate_Dir "Release"
41 # PROP Target_Dir ""
42 F90=df.exe
43 MTL=midl.exe
44 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
45 # ADD CPP /nologo /MD /W3 /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_TAGGING" /YX /FD /c
46 # ADD BASE RSC /l 0x413 /d "NDEBUG"
47 # ADD RSC /l 0x413 /d "NDEBUG"
48 BSC32=bscmake.exe
49 # ADD BASE BSC32 /nologo
50 # ADD BSC32 /nologo
51 LIB32=xilink6.exe -lib
52 # ADD BASE LIB32 /nologo
53 # ADD LIB32 /nologo
54
55 !ELSEIF "$(CFG)" == "mp4ff - Win32 Debug"
56
57 # PROP BASE Use_MFC 0
58 # PROP BASE Use_Debug_Libraries 1
59 # PROP BASE Output_Dir "Debug"
60 # PROP BASE Intermediate_Dir "Debug"
61 # PROP BASE Target_Dir ""
62 # PROP Use_MFC 0
63 # PROP Use_Debug_Libraries 1
64 # PROP Output_Dir "Debug"
65 # PROP Intermediate_Dir "Debug"
66 # PROP Target_Dir ""
67 F90=df.exe
68 MTL=midl.exe
69 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
70 # ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_TAGGING" /YX /FD /GZ /c
71 # ADD BASE RSC /l 0x413 /d "_DEBUG"
72 # ADD RSC /l 0x413 /d "_DEBUG"
73 BSC32=bscmake.exe
74 # ADD BASE BSC32 /nologo
75 # ADD BSC32 /nologo
76 LIB32=xilink6.exe -lib
77 # ADD BASE LIB32 /nologo
78 # ADD LIB32 /nologo
79
80 !ENDIF
81
82 # Begin Target
83
84 # Name "mp4ff - Win32 Release"
85 # Name "mp4ff - Win32 Debug"
86 # Begin Group "Source Files"
87
88 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
89 # Begin Source File
90
91 SOURCE=.\drms.c
92 # End Source File
93 # Begin Source File
94
95 SOURCE=.\mp4atom.c
96 # End Source File
97 # Begin Source File
98
99 SOURCE=.\mp4ff.c
100 # End Source File
101 # Begin Source File
102
103 SOURCE=.\mp4meta.c
104 # End Source File
105 # Begin Source File
106
107 SOURCE=.\mp4sample.c
108 # End Source File
109 # Begin Source File
110
111 SOURCE=.\mp4tagupdate.c
112 # End Source File
113 # Begin Source File
114
115 SOURCE=.\mp4util.c
116 # End Source File
117 # End Group
118 # Begin Group "Header Files"
119
120 # PROP Default_Filter "h;hpp;hxx;hm;inl"
121 # Begin Source File
122
123 SOURCE=.\drms.h
124 # End Source File
125 # Begin Source File
126
127 SOURCE=.\drmstables.h
128 # End Source File
129 # Begin Source File
130
131 SOURCE=.\mp4ff.h
132 # End Source File
133 # Begin Source File
134
135 SOURCE=.\mp4ff_int_types.h
136 # End Source File
137 # Begin Source File
138
139 SOURCE=.\mp4ffint.h
140 # End Source File
141 # End Group
142 # End Target
143 # End Project
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: mp4ff.h,v 1.26 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 #ifndef MP4FF_H
31 #define MP4FF_H
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif /* __cplusplus */
36
37 #include "mp4ff_int_types.h"
38
39 /* file callback structure */
40 typedef struct
41 {
42 uint32_t (*read)(void *user_data, void *buffer, uint32_t length);
43 uint32_t (*write)(void *udata, void *buffer, uint32_t length);
44 uint32_t (*seek)(void *user_data, uint64_t position);
45 uint32_t (*truncate)(void *user_data);
46 void *user_data;
47 } mp4ff_callback_t;
48
49 /* mp4 main file structure */
50 typedef void* mp4ff_t;
51
52
53 /* API */
54
55 mp4ff_t *mp4ff_open_read(mp4ff_callback_t *f);
56 mp4ff_t *mp4ff_open_read_metaonly(mp4ff_callback_t *f);
57 void mp4ff_close(mp4ff_t *f);
58 int32_t mp4ff_get_sample_duration(const mp4ff_t *f, const int32_t track, const int32_t sample);
59 int32_t mp4ff_get_sample_duration_use_offsets(const mp4ff_t *f, const int32_t track, const int32_t sample);
60 int64_t mp4ff_get_sample_position(const mp4ff_t *f, const int32_t track, const int32_t sample);
61 int32_t mp4ff_get_sample_offset(const mp4ff_t *f, const int32_t track, const int32_t sample);
62 int32_t mp4ff_find_sample(const mp4ff_t *f, const int32_t track, const int64_t offset,int32_t * toskip);
63 int32_t mp4ff_find_sample_use_offsets(const mp4ff_t *f, const int32_t track, const int64_t offset,int32_t * toskip);
64
65 int32_t mp4ff_read_sample(mp4ff_t *f, const int track, const int sample,
66 unsigned char **audio_buffer, unsigned int *bytes);
67
68 int32_t mp4ff_read_sample_v2(mp4ff_t *f, const int track, const int sample,unsigned char *buffer);//returns 0 on error, number of bytes read on success, use mp4ff_read_sample_getsize() to check buffer size needed
69 int32_t mp4ff_read_sample_getsize(mp4ff_t *f, const int track, const int sample);//returns 0 on error, buffer size needed for mp4ff_read_sample_v2() on success
70
71
72
73 int32_t mp4ff_get_decoder_config(const mp4ff_t *f, const int track,
74 unsigned char** ppBuf, unsigned int* pBufSize);
75 int32_t mp4ff_get_track_type(const mp4ff_t *f, const int track);
76 int32_t mp4ff_total_tracks(const mp4ff_t *f);
77 int32_t mp4ff_num_samples(const mp4ff_t *f, const int track);
78 int32_t mp4ff_time_scale(const mp4ff_t *f, const int track);
79
80 uint32_t mp4ff_get_avg_bitrate(const mp4ff_t *f, const int32_t track);
81 uint32_t mp4ff_get_max_bitrate(const mp4ff_t *f, const int32_t track);
82 int64_t mp4ff_get_track_duration(const mp4ff_t *f, const int32_t track); //returns (-1) if unknown
83 int64_t mp4ff_get_track_duration_use_offsets(const mp4ff_t *f, const int32_t track); //returns (-1) if unknown
84 uint32_t mp4ff_get_sample_rate(const mp4ff_t *f, const int32_t track);
85 uint32_t mp4ff_get_channel_count(const mp4ff_t * f,const int32_t track);
86 uint32_t mp4ff_get_audio_type(const mp4ff_t * f,const int32_t track);
87
88
89 /* metadata */
90 int mp4ff_meta_get_num_items(const mp4ff_t *f);
91 int mp4ff_meta_get_by_index(const mp4ff_t *f, unsigned int index,
92 char **item, char **value);
93 int mp4ff_meta_get_title(const mp4ff_t *f, char **value);
94 int mp4ff_meta_get_artist(const mp4ff_t *f, char **value);
95 int mp4ff_meta_get_writer(const mp4ff_t *f, char **value);
96 int mp4ff_meta_get_album(const mp4ff_t *f, char **value);
97 int mp4ff_meta_get_date(const mp4ff_t *f, char **value);
98 int mp4ff_meta_get_tool(const mp4ff_t *f, char **value);
99 int mp4ff_meta_get_comment(const mp4ff_t *f, char **value);
100 int mp4ff_meta_get_genre(const mp4ff_t *f, char **value);
101 int mp4ff_meta_get_track(const mp4ff_t *f, char **value);
102 int mp4ff_meta_get_disc(const mp4ff_t *f, char **value);
103 int mp4ff_meta_get_totaltracks(const mp4ff_t *f, char **value);
104 int mp4ff_meta_get_totaldiscs(const mp4ff_t *f, char **value);
105 int mp4ff_meta_get_compilation(const mp4ff_t *f, char **value);
106 int mp4ff_meta_get_tempo(const mp4ff_t *f, char **value);
107 int32_t mp4ff_meta_get_coverart(const mp4ff_t *f, char **value);
108 #ifdef USE_TAGGING
109
110 /* metadata tag structure */
111 typedef struct
112 {
113 char *item;
114 char *value;
115 } mp4ff_tag_t;
116
117 /* metadata list structure */
118 typedef struct
119 {
120 mp4ff_tag_t *tags;
121 uint32_t count;
122 } mp4ff_metadata_t;
123
124 int32_t mp4ff_meta_update(mp4ff_callback_t *f,const mp4ff_metadata_t * data);
125
126 #endif
127
128
129 #ifdef __cplusplus
130 }
131 #endif /* __cplusplus */
132
133 #endif
0 <?xml version="1.0" encoding="Windows-1252"?>
1 <VisualStudioProject
2 ProjectType="Visual C++"
3 Version="8,00"
4 Name="mp4ff"
5 ProjectGUID="{F470BB4A-7675-4D6A-B310-41F33AC6F987}"
6 >
7 <Platforms>
8 <Platform
9 Name="Win32"
10 />
11 </Platforms>
12 <ToolFiles>
13 </ToolFiles>
14 <Configurations>
15 <Configuration
16 Name="Release|Win32"
17 OutputDirectory=".\Release"
18 IntermediateDirectory=".\Release"
19 ConfigurationType="4"
20 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
21 UseOfMFC="0"
22 ATLMinimizesCRunTimeLibraryUsage="false"
23 >
24 <Tool
25 Name="VCPreBuildEventTool"
26 />
27 <Tool
28 Name="VCCustomBuildTool"
29 />
30 <Tool
31 Name="VCXMLDataGeneratorTool"
32 />
33 <Tool
34 Name="VCWebServiceProxyGeneratorTool"
35 />
36 <Tool
37 Name="VCMIDLTool"
38 />
39 <Tool
40 Name="VCCLCompilerTool"
41 AdditionalOptions=""
42 Optimization="1"
43 InlineFunctionExpansion="1"
44 PreprocessorDefinitions="USE_TAGGING"
45 StringPooling="true"
46 RuntimeLibrary="2"
47 EnableFunctionLevelLinking="true"
48 UsePrecompiledHeader="0"
49 PrecompiledHeaderFile=".\Release/mp4ff.pch"
50 AssemblerListingLocation=".\Release/"
51 ObjectFile=".\Release/"
52 ProgramDataBaseFileName=".\Release/"
53 WarningLevel="3"
54 SuppressStartupBanner="true"
55 Detect64BitPortabilityProblems="true"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 PreprocessorDefinitions="NDEBUG"
63 Culture="1043"
64 />
65 <Tool
66 Name="VCPreLinkEventTool"
67 />
68 <Tool
69 Name="VCLibrarianTool"
70 AdditionalOptions=""
71 OutputFile=".\Release\mp4ff.lib"
72 SuppressStartupBanner="true"
73 />
74 <Tool
75 Name="VCALinkTool"
76 />
77 <Tool
78 Name="VCXDCMakeTool"
79 />
80 <Tool
81 Name="VCBscMakeTool"
82 />
83 <Tool
84 Name="VCFxCopTool"
85 />
86 <Tool
87 Name="VCPostBuildEventTool"
88 />
89 </Configuration>
90 <Configuration
91 Name="Debug|Win32"
92 OutputDirectory=".\Debug"
93 IntermediateDirectory=".\Debug"
94 ConfigurationType="4"
95 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
96 UseOfMFC="0"
97 ATLMinimizesCRunTimeLibraryUsage="false"
98 >
99 <Tool
100 Name="VCPreBuildEventTool"
101 />
102 <Tool
103 Name="VCCustomBuildTool"
104 />
105 <Tool
106 Name="VCXMLDataGeneratorTool"
107 />
108 <Tool
109 Name="VCWebServiceProxyGeneratorTool"
110 />
111 <Tool
112 Name="VCMIDLTool"
113 />
114 <Tool
115 Name="VCCLCompilerTool"
116 AdditionalOptions=""
117 Optimization="0"
118 PreprocessorDefinitions="USE_TAGGING"
119 BasicRuntimeChecks="3"
120 RuntimeLibrary="3"
121 UsePrecompiledHeader="0"
122 PrecompiledHeaderFile=".\Debug/mp4ff.pch"
123 AssemblerListingLocation=".\Debug/"
124 ObjectFile=".\Debug/"
125 ProgramDataBaseFileName=".\Debug/"
126 WarningLevel="3"
127 SuppressStartupBanner="true"
128 DebugInformationFormat="4"
129 />
130 <Tool
131 Name="VCManagedResourceCompilerTool"
132 />
133 <Tool
134 Name="VCResourceCompilerTool"
135 PreprocessorDefinitions="_DEBUG"
136 Culture="1043"
137 />
138 <Tool
139 Name="VCPreLinkEventTool"
140 />
141 <Tool
142 Name="VCLibrarianTool"
143 AdditionalOptions=""
144 OutputFile=".\Debug\mp4ff.lib"
145 SuppressStartupBanner="true"
146 />
147 <Tool
148 Name="VCALinkTool"
149 />
150 <Tool
151 Name="VCXDCMakeTool"
152 />
153 <Tool
154 Name="VCBscMakeTool"
155 />
156 <Tool
157 Name="VCFxCopTool"
158 />
159 <Tool
160 Name="VCPostBuildEventTool"
161 />
162 </Configuration>
163 </Configurations>
164 <References>
165 </References>
166 <Files>
167 <Filter
168 Name="Source Files"
169 Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
170 >
171 <File
172 RelativePath=".\drms.c"
173 >
174 </File>
175 <File
176 RelativePath="mp4atom.c"
177 >
178 <FileConfiguration
179 Name="Release|Win32"
180 >
181 <Tool
182 Name="VCCLCompilerTool"
183 AdditionalOptions=""
184 Optimization="1"
185 PreprocessorDefinitions=""
186 />
187 </FileConfiguration>
188 <FileConfiguration
189 Name="Debug|Win32"
190 >
191 <Tool
192 Name="VCCLCompilerTool"
193 AdditionalOptions=""
194 Optimization="0"
195 PreprocessorDefinitions=""
196 BasicRuntimeChecks="3"
197 />
198 </FileConfiguration>
199 </File>
200 <File
201 RelativePath="mp4ff.c"
202 >
203 <FileConfiguration
204 Name="Release|Win32"
205 >
206 <Tool
207 Name="VCCLCompilerTool"
208 AdditionalOptions=""
209 Optimization="1"
210 PreprocessorDefinitions=""
211 />
212 </FileConfiguration>
213 <FileConfiguration
214 Name="Debug|Win32"
215 >
216 <Tool
217 Name="VCCLCompilerTool"
218 AdditionalOptions=""
219 Optimization="0"
220 PreprocessorDefinitions=""
221 BasicRuntimeChecks="3"
222 />
223 </FileConfiguration>
224 </File>
225 <File
226 RelativePath="mp4meta.c"
227 >
228 <FileConfiguration
229 Name="Release|Win32"
230 >
231 <Tool
232 Name="VCCLCompilerTool"
233 AdditionalOptions=""
234 Optimization="1"
235 PreprocessorDefinitions=""
236 />
237 </FileConfiguration>
238 <FileConfiguration
239 Name="Debug|Win32"
240 >
241 <Tool
242 Name="VCCLCompilerTool"
243 AdditionalOptions=""
244 Optimization="0"
245 PreprocessorDefinitions=""
246 BasicRuntimeChecks="3"
247 />
248 </FileConfiguration>
249 </File>
250 <File
251 RelativePath="mp4sample.c"
252 >
253 <FileConfiguration
254 Name="Release|Win32"
255 >
256 <Tool
257 Name="VCCLCompilerTool"
258 AdditionalOptions=""
259 Optimization="1"
260 PreprocessorDefinitions=""
261 />
262 </FileConfiguration>
263 <FileConfiguration
264 Name="Debug|Win32"
265 >
266 <Tool
267 Name="VCCLCompilerTool"
268 AdditionalOptions=""
269 Optimization="0"
270 PreprocessorDefinitions=""
271 BasicRuntimeChecks="3"
272 />
273 </FileConfiguration>
274 </File>
275 <File
276 RelativePath=".\mp4tagupdate.c"
277 >
278 </File>
279 <File
280 RelativePath="mp4util.c"
281 >
282 <FileConfiguration
283 Name="Release|Win32"
284 >
285 <Tool
286 Name="VCCLCompilerTool"
287 AdditionalOptions=""
288 Optimization="1"
289 PreprocessorDefinitions=""
290 />
291 </FileConfiguration>
292 <FileConfiguration
293 Name="Debug|Win32"
294 >
295 <Tool
296 Name="VCCLCompilerTool"
297 AdditionalOptions=""
298 Optimization="0"
299 PreprocessorDefinitions=""
300 BasicRuntimeChecks="3"
301 />
302 </FileConfiguration>
303 </File>
304 </Filter>
305 <Filter
306 Name="Header Files"
307 Filter="h;hpp;hxx;hm;inl"
308 >
309 <File
310 RelativePath=".\drms.h"
311 >
312 </File>
313 <File
314 RelativePath=".\drmstables.h"
315 >
316 </File>
317 <File
318 RelativePath=".\mp4ff.h"
319 >
320 </File>
321 <File
322 RelativePath=".\mp4ff_int_types.h"
323 >
324 </File>
325 <File
326 RelativePath="mp4ffint.h"
327 >
328 </File>
329 </Filter>
330 </Files>
331 <Globals>
332 </Globals>
333 </VisualStudioProject>
0 #ifndef _MP4FF_INT_TYPES_H_
1 #define _MP4FF_INT_TYPES_H_
2
3 #if defined (_WIN32)
4
5 typedef char int8_t;
6 typedef unsigned char uint8_t;
7 typedef short int16_t;
8 typedef unsigned short uint16_t;
9 typedef long int32_t;
10 typedef unsigned long uint32_t;
11
12 typedef __int64 int64_t;
13 typedef unsigned __int64 uint64_t;
14
15 #else
16
17 #include <stdint.h>
18
19 #endif
20
21
22 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: mp4ffint.h,v 1.22 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 #ifndef MP4FF_INTERNAL_H
31 #define MP4FF_INTERNAL_H
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif /* __cplusplus */
36
37 #include "mp4ff_int_types.h"
38 #include <stdlib.h>
39
40 #if defined(_WIN32) && !defined(_WIN32_WCE)
41 #define ITUNES_DRM
42
43 static __inline uint32_t GetDWLE( void const * _p )
44 {
45 uint8_t * p = (uint8_t *)_p;
46 return ( ((uint32_t)p[3] << 24) | ((uint32_t)p[2] << 16)
47 | ((uint32_t)p[1] << 8) | p[0] );
48 }
49 static __inline uint32_t U32_AT( void const * _p )
50 {
51 uint8_t * p = (uint8_t *)_p;
52 return ( ((uint32_t)p[0] << 24) | ((uint32_t)p[1] << 16)
53 | ((uint32_t)p[2] << 8) | p[3] );
54 }
55 static __inline uint64_t U64_AT( void const * _p )
56 {
57 uint8_t * p = (uint8_t *)_p;
58 return ( ((uint64_t)p[0] << 56) | ((uint64_t)p[1] << 48)
59 | ((uint64_t)p[2] << 40) | ((uint64_t)p[3] << 32)
60 | ((uint64_t)p[4] << 24) | ((uint64_t)p[5] << 16)
61 | ((uint64_t)p[6] << 8) | p[7] );
62 }
63
64 #ifdef WORDS_BIGENDIAN
65 # define VLC_FOURCC( a, b, c, d ) \
66 ( ((uint32_t)d) | ( ((uint32_t)c) << 8 ) \
67 | ( ((uint32_t)b) << 16 ) | ( ((uint32_t)a) << 24 ) )
68 # define VLC_TWOCC( a, b ) \
69 ( (uint16_t)(b) | ( (uint16_t)(a) << 8 ) )
70
71 #else
72 # define VLC_FOURCC( a, b, c, d ) \
73 ( ((uint32_t)a) | ( ((uint32_t)b) << 8 ) \
74 | ( ((uint32_t)c) << 16 ) | ( ((uint32_t)d) << 24 ) )
75 # define VLC_TWOCC( a, b ) \
76 ( (uint16_t)(a) | ( (uint16_t)(b) << 8 ) )
77 #endif
78
79 #define FOURCC_user VLC_FOURCC( 'u', 's', 'e', 'r' )
80 #define FOURCC_key VLC_FOURCC( 'k', 'e', 'y', ' ' )
81 #define FOURCC_iviv VLC_FOURCC( 'i', 'v', 'i', 'v' )
82 #define FOURCC_name VLC_FOURCC( 'n', 'a', 'm', 'e' )
83 #define FOURCC_priv VLC_FOURCC( 'p', 'r', 'i', 'v' )
84
85 #endif
86 #define MAX_TRACKS 1024
87 #define TRACK_UNKNOWN 0
88 #define TRACK_AUDIO 1
89 #define TRACK_VIDEO 2
90 #define TRACK_SYSTEM 3
91
92
93 #define SUBATOMIC 128
94
95 /* atoms without subatoms */
96 #define ATOM_FTYP 129
97 #define ATOM_MDAT 130
98 #define ATOM_MVHD 131
99 #define ATOM_TKHD 132
100 #define ATOM_TREF 133
101 #define ATOM_MDHD 134
102 #define ATOM_VMHD 135
103 #define ATOM_SMHD 136
104 #define ATOM_HMHD 137
105 #define ATOM_STSD 138
106 #define ATOM_STTS 139
107 #define ATOM_STSZ 140
108 #define ATOM_STZ2 141
109 #define ATOM_STCO 142
110 #define ATOM_STSC 143
111 #define ATOM_MP4A 144
112 #define ATOM_MP4V 145
113 #define ATOM_MP4S 146
114 #define ATOM_ESDS 147
115 #define ATOM_META 148 /* iTunes Metadata box */
116 #define ATOM_NAME 149 /* iTunes Metadata name box */
117 #define ATOM_DATA 150 /* iTunes Metadata data box */
118 #define ATOM_CTTS 151
119 #define ATOM_FRMA 152
120 #define ATOM_IVIV 153
121 #define ATOM_PRIV 154
122 #define ATOM_USER 155
123 #define ATOM_KEY 156
124
125 #define ATOM_UNKNOWN 255
126 #define ATOM_FREE ATOM_UNKNOWN
127 #define ATOM_SKIP ATOM_UNKNOWN
128
129 /* atoms with subatoms */
130 #define ATOM_MOOV 1
131 #define ATOM_TRAK 2
132 #define ATOM_EDTS 3
133 #define ATOM_MDIA 4
134 #define ATOM_MINF 5
135 #define ATOM_STBL 6
136 #define ATOM_UDTA 7
137 #define ATOM_ILST 8 /* iTunes Metadata list */
138 #define ATOM_TITLE 9
139 #define ATOM_ARTIST 10
140 #define ATOM_WRITER 11
141 #define ATOM_ALBUM 12
142 #define ATOM_DATE 13
143 #define ATOM_TOOL 14
144 #define ATOM_COMMENT 15
145 #define ATOM_GENRE1 16
146 #define ATOM_TRACK 17
147 #define ATOM_DISC 18
148 #define ATOM_COMPILATION 19
149 #define ATOM_GENRE2 20
150 #define ATOM_TEMPO 21
151 #define ATOM_COVER 22
152 #define ATOM_DRMS 23
153 #define ATOM_SINF 24
154 #define ATOM_SCHI 25
155
156 #ifdef HAVE_CONFIG_H
157 #include "../../config.h"
158 #endif
159
160 #if !(defined(_WIN32) || defined(_WIN32_WCE))
161 #define stricmp strcasecmp
162 #else
163 #define stricmp _stricmp
164 #define strdup _strdup
165 #endif
166
167 /* file callback structure */
168 typedef struct
169 {
170 uint32_t (*read)(void *user_data, void *buffer, uint32_t length);
171 uint32_t (*write)(void *udata, void *buffer, uint32_t length);
172 uint32_t (*seek)(void *user_data, uint64_t position);
173 uint32_t (*truncate)(void *user_data);
174 void *user_data;
175 } mp4ff_callback_t;
176
177
178 /* metadata tag structure */
179 typedef struct
180 {
181 char *item;
182 char *value;
183 } mp4ff_tag_t;
184
185 /* metadata list structure */
186 typedef struct
187 {
188 mp4ff_tag_t *tags;
189 uint32_t count;
190 } mp4ff_metadata_t;
191
192
193 typedef struct
194 {
195 int32_t type;
196 int32_t channelCount;
197 int32_t sampleSize;
198 uint16_t sampleRate;
199 int32_t audioType;
200
201 /* stsd */
202 int32_t stsd_entry_count;
203
204 /* stsz */
205 int32_t stsz_sample_size;
206 int32_t stsz_sample_count;
207 int32_t *stsz_table;
208
209 /* stts */
210 int32_t stts_entry_count;
211 int32_t *stts_sample_count;
212 int32_t *stts_sample_delta;
213
214 /* stsc */
215 int32_t stsc_entry_count;
216 int32_t *stsc_first_chunk;
217 int32_t *stsc_samples_per_chunk;
218 int32_t *stsc_sample_desc_index;
219
220 /* stsc */
221 int32_t stco_entry_count;
222 int32_t *stco_chunk_offset;
223
224 /* ctts */
225 int32_t ctts_entry_count;
226 int32_t *ctts_sample_count;
227 int32_t *ctts_sample_offset;
228
229 /* esde */
230 uint8_t *decoderConfig;
231 int32_t decoderConfigLen;
232
233 uint32_t maxBitrate;
234 uint32_t avgBitrate;
235
236 uint32_t timeScale;
237 uint64_t duration;
238
239 #ifdef ITUNES_DRM
240 /* drms */
241 void *p_drms;
242 #endif
243
244 } mp4ff_track_t;
245
246 /* mp4 main file structure */
247 typedef struct
248 {
249 /* stream to read from */
250 mp4ff_callback_t *stream;
251 int64_t current_position;
252
253 int32_t moov_read;
254 uint64_t moov_offset;
255 uint64_t moov_size;
256 uint8_t last_atom;
257 uint64_t file_size;
258
259 /* mvhd */
260 int32_t time_scale;
261 int32_t duration;
262
263 /* incremental track index while reading the file */
264 int32_t total_tracks;
265
266 /* track data */
267 mp4ff_track_t *track[MAX_TRACKS];
268
269 /* metadata */
270 mp4ff_metadata_t tags;
271 } mp4ff_t;
272
273
274
275
276 /* mp4util.c */
277 int32_t mp4ff_read_data(mp4ff_t *f, int8_t *data, uint32_t size);
278 int32_t mp4ff_write_data(mp4ff_t *f, int8_t *data, uint32_t size);
279 uint64_t mp4ff_read_int64(mp4ff_t *f);
280 uint32_t mp4ff_read_int32(mp4ff_t *f);
281 uint32_t mp4ff_read_int24(mp4ff_t *f);
282 uint16_t mp4ff_read_int16(mp4ff_t *f);
283 uint8_t mp4ff_read_char(mp4ff_t *f);
284 int32_t mp4ff_write_int32(mp4ff_t *f,const uint32_t data);
285 uint32_t mp4ff_read_mp4_descr_length(mp4ff_t *f);
286 int64_t mp4ff_position(const mp4ff_t *f);
287 int32_t mp4ff_set_position(mp4ff_t *f, const int64_t position);
288 int32_t mp4ff_truncate(mp4ff_t * f);
289 char * mp4ff_read_string(mp4ff_t * f,uint32_t length);
290
291 /* mp4atom.c */
292 static int32_t mp4ff_atom_get_size(const int8_t *data);
293 static int32_t mp4ff_atom_compare(const int8_t a1, const int8_t b1, const int8_t c1, const int8_t d1,
294 const int8_t a2, const int8_t b2, const int8_t c2, const int8_t d2);
295 static uint8_t mp4ff_atom_name_to_type(const int8_t a, const int8_t b, const int8_t c, const int8_t d);
296 uint64_t mp4ff_atom_read_header(mp4ff_t *f, uint8_t *atom_type, uint8_t *header_size);
297 static int32_t mp4ff_read_stsz(mp4ff_t *f);
298 static int32_t mp4ff_read_esds(mp4ff_t *f);
299 static int32_t mp4ff_read_mp4a(mp4ff_t *f);
300 static int32_t mp4ff_read_stsd(mp4ff_t *f);
301 static int32_t mp4ff_read_stsc(mp4ff_t *f);
302 static int32_t mp4ff_read_stco(mp4ff_t *f);
303 static int32_t mp4ff_read_stts(mp4ff_t *f);
304 #ifdef USE_TAGGING
305 static int32_t mp4ff_read_meta(mp4ff_t *f, const uint64_t size);
306 #endif
307 int32_t mp4ff_atom_read(mp4ff_t *f, const int32_t size, const uint8_t atom_type);
308
309 /* mp4sample.c */
310 static int32_t mp4ff_chunk_of_sample(const mp4ff_t *f, const int32_t track, const int32_t sample,
311 int32_t *chunk_sample, int32_t *chunk);
312 static int32_t mp4ff_chunk_to_offset(const mp4ff_t *f, const int32_t track, const int32_t chunk);
313 static int32_t mp4ff_sample_range_size(const mp4ff_t *f, const int32_t track,
314 const int32_t chunk_sample, const int32_t sample);
315 static int32_t mp4ff_sample_to_offset(const mp4ff_t *f, const int32_t track, const int32_t sample);
316 int32_t mp4ff_audio_frame_size(const mp4ff_t *f, const int32_t track, const int32_t sample);
317 int32_t mp4ff_set_sample_position(mp4ff_t *f, const int32_t track, const int32_t sample);
318
319 #ifdef USE_TAGGING
320 /* mp4meta.c */
321 static int32_t mp4ff_tag_add_field(mp4ff_metadata_t *tags, const char *item, const char *value);
322 static int32_t mp4ff_tag_set_field(mp4ff_metadata_t *tags, const char *item, const char *value);
323 static int32_t mp4ff_set_metadata_name(mp4ff_t *f, const uint8_t atom_type, char **name);
324 static int32_t mp4ff_parse_tag(mp4ff_t *f, const uint8_t parent_atom_type, const int32_t size);
325 static int32_t mp4ff_meta_find_by_name(const mp4ff_t *f, const char *item, char **value);
326 int32_t mp4ff_parse_metadata(mp4ff_t *f, const int32_t size);
327 int32_t mp4ff_tag_delete(mp4ff_metadata_t *tags);
328 int32_t mp4ff_meta_get_num_items(const mp4ff_t *f);
329 int32_t mp4ff_meta_get_by_index(const mp4ff_t *f, uint32_t index,
330 char **item, char **value);
331 int32_t mp4ff_meta_get_title(const mp4ff_t *f, char **value);
332 int32_t mp4ff_meta_get_artist(const mp4ff_t *f, char **value);
333 int32_t mp4ff_meta_get_writer(const mp4ff_t *f, char **value);
334 int32_t mp4ff_meta_get_album(const mp4ff_t *f, char **value);
335 int32_t mp4ff_meta_get_date(const mp4ff_t *f, char **value);
336 int32_t mp4ff_meta_get_tool(const mp4ff_t *f, char **value);
337 int32_t mp4ff_meta_get_comment(const mp4ff_t *f, char **value);
338 int32_t mp4ff_meta_get_genre(const mp4ff_t *f, char **value);
339 int32_t mp4ff_meta_get_track(const mp4ff_t *f, char **value);
340 int32_t mp4ff_meta_get_disc(const mp4ff_t *f, char **value);
341 int32_t mp4ff_meta_get_compilation(const mp4ff_t *f, char **value);
342 int32_t mp4ff_meta_get_tempo(const mp4ff_t *f, char **value);
343 int32_t mp4ff_meta_get_coverart(const mp4ff_t *f, char **value);
344 #endif
345
346 /* mp4ff.c */
347 mp4ff_t *mp4ff_open_read(mp4ff_callback_t *f);
348 #ifdef USE_TAGGING
349 mp4ff_t *mp4ff_open_edit(mp4ff_callback_t *f);
350 #endif
351 void mp4ff_close(mp4ff_t *ff);
352 //void mp4ff_track_add(mp4ff_t *f);
353 int32_t parse_sub_atoms(mp4ff_t *f, const uint64_t total_size,int meta_only);
354 int32_t parse_atoms(mp4ff_t *f,int meta_only);
355
356 int32_t mp4ff_get_sample_duration(const mp4ff_t *f, const int32_t track, const int32_t sample);
357 int64_t mp4ff_get_sample_position(const mp4ff_t *f, const int32_t track, const int32_t sample);
358 int32_t mp4ff_get_sample_offset(const mp4ff_t *f, const int32_t track, const int32_t sample);
359 int32_t mp4ff_find_sample(const mp4ff_t *f, const int32_t track, const int64_t offset,int32_t * toskip);
360
361 int32_t mp4ff_read_sample(mp4ff_t *f, const int32_t track, const int32_t sample,
362 uint8_t **audio_buffer, uint32_t *bytes);
363 int32_t mp4ff_get_decoder_config(const mp4ff_t *f, const int32_t track,
364 uint8_t** ppBuf, uint32_t* pBufSize);
365 int32_t mp4ff_total_tracks(const mp4ff_t *f);
366 int32_t mp4ff_time_scale(const mp4ff_t *f, const int32_t track);
367 int32_t mp4ff_num_samples(const mp4ff_t *f, const int32_t track);
368
369 uint32_t mp4ff_meta_genre_to_index(const char * genrestr);//returns 1-based index, 0 if not found
370 const char * mp4ff_meta_index_to_genre(uint32_t idx);//returns pointer to static string
371
372
373 #ifdef __cplusplus
374 }
375 #endif /* __cplusplus */
376
377 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: mp4meta.c,v 1.19 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 #ifdef USE_TAGGING
31
32 #include <stdlib.h>
33 #include <stdio.h>
34 #include <string.h>
35 #include "mp4ffint.h"
36
37
38
39 static int32_t mp4ff_tag_add_field(mp4ff_metadata_t *tags, const char *item, const char *value)
40 {
41 void *backup = (void *)tags->tags;
42
43 if (!item || (item && !*item) || !value) return 0;
44
45 tags->tags = (mp4ff_tag_t*)realloc(tags->tags, (tags->count+1) * sizeof(mp4ff_tag_t));
46 if (!tags->tags)
47 {
48 if (backup) free(backup);
49 return 0;
50 } else {
51 tags->tags[tags->count].item = strdup(item);
52 tags->tags[tags->count].value = strdup(value);
53
54 if (!tags->tags[tags->count].item || !tags->tags[tags->count].value)
55 {
56 if (!tags->tags[tags->count].item) free (tags->tags[tags->count].item);
57 if (!tags->tags[tags->count].value) free (tags->tags[tags->count].value);
58 tags->tags[tags->count].item = NULL;
59 tags->tags[tags->count].value = NULL;
60 return 0;
61 }
62
63 tags->count++;
64 return 1;
65 }
66 }
67
68 static int32_t mp4ff_tag_set_field(mp4ff_metadata_t *tags, const char *item, const char *value)
69 {
70 unsigned int i;
71
72 if (!item || (item && !*item) || !value) return 0;
73
74 for (i = 0; i < tags->count; i++)
75 {
76 if (!stricmp(tags->tags[i].item, item))
77 {
78 free(tags->tags[i].value);
79 tags->tags[i].value = strdup(value);
80 return 1;
81 }
82 }
83
84 return mp4ff_tag_add_field(tags, item, value);
85 }
86
87 int32_t mp4ff_tag_delete(mp4ff_metadata_t *tags)
88 {
89 uint32_t i;
90
91 for (i = 0; i < tags->count; i++)
92 {
93 if (tags->tags[i].item) free(tags->tags[i].item);
94 if (tags->tags[i].value) free(tags->tags[i].value);
95 }
96
97 if (tags->tags) free(tags->tags);
98
99 tags->tags = NULL;
100 tags->count = 0;
101
102 return 0;
103 }
104
105 static const char* ID3v1GenreList[] = {
106 "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk",
107 "Grunge", "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies",
108 "Other", "Pop", "R&B", "Rap", "Reggae", "Rock",
109 "Techno", "Industrial", "Alternative", "Ska", "Death Metal", "Pranks",
110 "Soundtrack", "Euro-Techno", "Ambient", "Trip-Hop", "Vocal", "Jazz+Funk",
111 "Fusion", "Trance", "Classical", "Instrumental", "Acid", "House",
112 "Game", "Sound Clip", "Gospel", "Noise", "AlternRock", "Bass",
113 "Soul", "Punk", "Space", "Meditative", "Instrumental Pop", "Instrumental Rock",
114 "Ethnic", "Gothic", "Darkwave", "Techno-Industrial", "Electronic", "Pop-Folk",
115 "Eurodance", "Dream", "Southern Rock", "Comedy", "Cult", "Gangsta",
116 "Top 40", "Christian Rap", "Pop/Funk", "Jungle", "Native American", "Cabaret",
117 "New Wave", "Psychadelic", "Rave", "Showtunes", "Trailer", "Lo-Fi",
118 "Tribal", "Acid Punk", "Acid Jazz", "Polka", "Retro", "Musical",
119 "Rock & Roll", "Hard Rock", "Folk", "Folk/Rock", "National Folk", "Swing",
120 "Fast-Fusion", "Bebob", "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde",
121 "Gothic Rock", "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock", "Big Band",
122 "Chorus", "Easy Listening", "Acoustic", "Humour", "Speech", "Chanson",
123 "Opera", "Chamber Music", "Sonata", "Symphony", "Booty Bass", "Primus",
124 "Porn Groove", "Satire", "Slow Jam", "Club", "Tango", "Samba",
125 "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle", "Duet",
126 "Punk Rock", "Drum Solo", "A capella", "Euro-House", "Dance Hall",
127 "Goa", "Drum & Bass", "Club House", "Hardcore", "Terror",
128 "Indie", "BritPop", "NegerPunk", "Polsk Punk", "Beat",
129 "Christian Gangsta", "Heavy Metal", "Black Metal", "Crossover", "Contemporary C",
130 "Christian Rock", "Merengue", "Salsa", "Thrash Metal", "Anime", "JPop",
131 "SynthPop",
132 };
133
134 uint32_t mp4ff_meta_genre_to_index(const char * genrestr)
135 {
136 unsigned n;
137 for(n=0;n<sizeof(ID3v1GenreList)/sizeof(ID3v1GenreList[0]);n++)
138 {
139 if (!stricmp(genrestr,ID3v1GenreList[n])) return n+1;
140 }
141 return 0;
142 }
143
144 const char * mp4ff_meta_index_to_genre(uint32_t idx)
145 {
146 if (idx>0 && idx<=sizeof(ID3v1GenreList)/sizeof(ID3v1GenreList[0]))
147 {
148 return ID3v1GenreList[idx-1];
149 }
150 else
151 {
152 return 0;
153 }
154 }
155
156
157 static int32_t TrackToString(char** str, const uint16_t track, const uint16_t totalTracks)
158 {
159 char temp[32];
160 sprintf(temp, "%.5u of %.5u", track, totalTracks);
161 *str = strdup(temp);
162 return 0;
163 }
164
165 static int32_t mp4ff_set_metadata_name(mp4ff_t *f, const uint8_t atom_type, char **name)
166 {
167 static char *tag_names[] = {
168 "unknown", "title", "artist", "writer", "album",
169 "date", "tool", "comment", "genre", "track",
170 "disc", "compilation", "genre", "tempo", "cover"
171 };
172 uint8_t tag_idx = 0;
173
174 switch (atom_type)
175 {
176 case ATOM_TITLE: tag_idx = 1; break;
177 case ATOM_ARTIST: tag_idx = 2; break;
178 case ATOM_WRITER: tag_idx = 3; break;
179 case ATOM_ALBUM: tag_idx = 4; break;
180 case ATOM_DATE: tag_idx = 5; break;
181 case ATOM_TOOL: tag_idx = 6; break;
182 case ATOM_COMMENT: tag_idx = 7; break;
183 case ATOM_GENRE1: tag_idx = 8; break;
184 case ATOM_TRACK: tag_idx = 9; break;
185 case ATOM_DISC: tag_idx = 10; break;
186 case ATOM_COMPILATION: tag_idx = 11; break;
187 case ATOM_GENRE2: tag_idx = 12; break;
188 case ATOM_TEMPO: tag_idx = 13; break;
189 case ATOM_COVER: tag_idx = 14; break;
190 default: tag_idx = 0; break;
191 }
192
193 *name = strdup(tag_names[tag_idx]);
194
195 return 0;
196 }
197
198 static int32_t mp4ff_parse_tag(mp4ff_t *f, const uint8_t parent_atom_type, const int32_t size)
199 {
200 uint8_t atom_type;
201 uint8_t header_size = 0;
202 uint64_t subsize, sumsize = 0;
203 char * name = NULL;
204 char * data = NULL;
205 uint32_t done = 0;
206
207
208 while (sumsize < size)
209 {
210 uint64_t destpos;
211 subsize = mp4ff_atom_read_header(f, &atom_type, &header_size);
212 destpos = mp4ff_position(f)+subsize-header_size;
213 if (!done)
214 {
215 if (atom_type == ATOM_DATA)
216 {
217 mp4ff_read_char(f); /* version */
218 mp4ff_read_int24(f); /* flags */
219 mp4ff_read_int32(f); /* reserved */
220
221 /* some need special attention */
222 if (parent_atom_type == ATOM_GENRE2 || parent_atom_type == ATOM_TEMPO)
223 {
224 if (subsize - header_size >= 8 + 2)
225 {
226 uint16_t val = mp4ff_read_int16(f);
227
228 if (parent_atom_type == ATOM_TEMPO)
229 {
230 char temp[16];
231 sprintf(temp, "%.5u BPM", val);
232 mp4ff_tag_add_field(&(f->tags), "tempo", temp);
233 }
234 else
235 {
236 const char * temp = mp4ff_meta_index_to_genre(val);
237 if (temp)
238 {
239 mp4ff_tag_add_field(&(f->tags), "genre", temp);
240 }
241 }
242 done = 1;
243 }
244 } else if (parent_atom_type == ATOM_TRACK || parent_atom_type == ATOM_DISC) {
245 if (!done && subsize - header_size >= 8 + 8)
246 {
247 uint16_t index,total;
248 char temp[32];
249 mp4ff_read_int16(f);
250 index = mp4ff_read_int16(f);
251 total = mp4ff_read_int16(f);
252 mp4ff_read_int16(f);
253
254 sprintf(temp,"%d",index);
255 mp4ff_tag_add_field(&(f->tags), parent_atom_type == ATOM_TRACK ? "track" : "disc", temp);
256 if (total>0)
257 {
258 sprintf(temp,"%d",total);
259 mp4ff_tag_add_field(&(f->tags), parent_atom_type == ATOM_TRACK ? "totaltracks" : "totaldiscs", temp);
260 }
261 done = 1;
262 }
263 } else
264 {
265 if (data) {free(data);data = NULL;}
266 data = mp4ff_read_string(f,(uint32_t)(subsize-(header_size+8)));
267 }
268 } else if (atom_type == ATOM_NAME) {
269 if (!done)
270 {
271 mp4ff_read_char(f); /* version */
272 mp4ff_read_int24(f); /* flags */
273 if (name) free(name);
274 name = mp4ff_read_string(f,(uint32_t)(subsize-(header_size+4)));
275 }
276 }
277 mp4ff_set_position(f, destpos);
278 sumsize += subsize;
279 }
280 }
281
282 if (data)
283 {
284 if (!done)
285 {
286 if (name == NULL) mp4ff_set_metadata_name(f, parent_atom_type, &name);
287 if (name) mp4ff_tag_add_field(&(f->tags), name, data);
288 }
289
290 free(data);
291 }
292 if (name) free(name);
293 return 1;
294 }
295
296 int32_t mp4ff_parse_metadata(mp4ff_t *f, const int32_t size)
297 {
298 uint64_t subsize, sumsize = 0;
299 uint8_t atom_type;
300 uint8_t header_size = 0;
301
302 while (sumsize < size)
303 {
304 subsize = mp4ff_atom_read_header(f, &atom_type, &header_size);
305 if (subsize == 0)
306 break;
307 mp4ff_parse_tag(f, atom_type, (uint32_t)(subsize-header_size));
308 sumsize += subsize;
309 }
310
311 return 0;
312 }
313
314 /* find a metadata item by name */
315 /* returns 0 if item found, 1 if no such item */
316 static int32_t mp4ff_meta_find_by_name(const mp4ff_t *f, const char *item, char **value)
317 {
318 uint32_t i;
319
320 for (i = 0; i < f->tags.count; i++)
321 {
322 if (!stricmp(f->tags.tags[i].item, item))
323 {
324 *value = strdup(f->tags.tags[i].value);
325 return 1;
326 }
327 }
328
329 *value = NULL;
330
331 /* not found */
332 return 0;
333 }
334
335 int32_t mp4ff_meta_get_num_items(const mp4ff_t *f)
336 {
337 return f->tags.count;
338 }
339
340 int32_t mp4ff_meta_get_by_index(const mp4ff_t *f, uint32_t index,
341 char **item, char **value)
342 {
343 if (index >= f->tags.count)
344 {
345 *item = NULL;
346 *value = NULL;
347 return 0;
348 } else {
349 *item = strdup(f->tags.tags[index].item);
350 *value = strdup(f->tags.tags[index].value);
351 return 1;
352 }
353 }
354
355 int32_t mp4ff_meta_get_title(const mp4ff_t *f, char **value)
356 {
357 return mp4ff_meta_find_by_name(f, "title", value);
358 }
359
360 int32_t mp4ff_meta_get_artist(const mp4ff_t *f, char **value)
361 {
362 return mp4ff_meta_find_by_name(f, "artist", value);
363 }
364
365 int32_t mp4ff_meta_get_writer(const mp4ff_t *f, char **value)
366 {
367 return mp4ff_meta_find_by_name(f, "writer", value);
368 }
369
370 int32_t mp4ff_meta_get_album(const mp4ff_t *f, char **value)
371 {
372 return mp4ff_meta_find_by_name(f, "album", value);
373 }
374
375 int32_t mp4ff_meta_get_date(const mp4ff_t *f, char **value)
376 {
377 return mp4ff_meta_find_by_name(f, "date", value);
378 }
379
380 int32_t mp4ff_meta_get_tool(const mp4ff_t *f, char **value)
381 {
382 return mp4ff_meta_find_by_name(f, "tool", value);
383 }
384
385 int32_t mp4ff_meta_get_comment(const mp4ff_t *f, char **value)
386 {
387 return mp4ff_meta_find_by_name(f, "comment", value);
388 }
389
390 int32_t mp4ff_meta_get_genre(const mp4ff_t *f, char **value)
391 {
392 return mp4ff_meta_find_by_name(f, "genre", value);
393 }
394
395 int32_t mp4ff_meta_get_track(const mp4ff_t *f, char **value)
396 {
397 return mp4ff_meta_find_by_name(f, "track", value);
398 }
399
400 int32_t mp4ff_meta_get_totaltracks(const mp4ff_t *f, char **value)
401 {
402 return mp4ff_meta_find_by_name(f, "totaltracks", value);
403 }
404
405 int32_t mp4ff_meta_get_disc(const mp4ff_t *f, char **value)
406 {
407 return mp4ff_meta_find_by_name(f, "disc", value);
408 }
409
410 int32_t mp4ff_meta_get_totaldiscs(const mp4ff_t *f, char **value)
411 {
412 return mp4ff_meta_find_by_name(f, "totaldiscs", value);
413 }
414
415 int32_t mp4ff_meta_get_compilation(const mp4ff_t *f, char **value)
416 {
417 return mp4ff_meta_find_by_name(f, "compilation", value);
418 }
419
420 int32_t mp4ff_meta_get_tempo(const mp4ff_t *f, char **value)
421 {
422 return mp4ff_meta_find_by_name(f, "tempo", value);
423 }
424
425 int32_t mp4ff_meta_get_coverart(const mp4ff_t *f, char **value)
426 {
427 return mp4ff_meta_find_by_name(f, "cover", value);
428 }
429
430 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: mp4sample.c,v 1.20 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 #include <stdlib.h>
31 #include "mp4ffint.h"
32
33
34 static int32_t mp4ff_chunk_of_sample(const mp4ff_t *f, const int32_t track, const int32_t sample,
35 int32_t *chunk_sample, int32_t *chunk)
36 {
37 int32_t total_entries = 0;
38 int32_t chunk2entry;
39 int32_t chunk1, chunk2, chunk1samples, range_samples, total = 0;
40
41 if (f->track[track] == NULL)
42 {
43 return -1;
44 }
45
46 total_entries = f->track[track]->stsc_entry_count;
47
48 chunk1 = 1;
49 chunk1samples = 0;
50 chunk2entry = 0;
51
52 do
53 {
54 chunk2 = f->track[track]->stsc_first_chunk[chunk2entry];
55 *chunk = chunk2 - chunk1;
56 range_samples = *chunk * chunk1samples;
57
58 if (sample < total + range_samples) break;
59
60 chunk1samples = f->track[track]->stsc_samples_per_chunk[chunk2entry];
61 chunk1 = chunk2;
62
63 if(chunk2entry < total_entries)
64 {
65 chunk2entry++;
66 total += range_samples;
67 }
68 } while (chunk2entry < total_entries);
69
70 if (chunk1samples)
71 *chunk = (sample - total) / chunk1samples + chunk1;
72 else
73 *chunk = 1;
74
75 *chunk_sample = total + (*chunk - chunk1) * chunk1samples;
76
77 return 0;
78 }
79
80 static int32_t mp4ff_chunk_to_offset(const mp4ff_t *f, const int32_t track, const int32_t chunk)
81 {
82 const mp4ff_track_t * p_track = f->track[track];
83
84 if (p_track->stco_entry_count && (chunk > p_track->stco_entry_count))
85 {
86 return p_track->stco_chunk_offset[p_track->stco_entry_count - 1];
87 } else if (p_track->stco_entry_count) {
88 return p_track->stco_chunk_offset[chunk - 1];
89 } else {
90 return 8;
91 }
92
93 return 0;
94 }
95
96 static int32_t mp4ff_sample_range_size(const mp4ff_t *f, const int32_t track,
97 const int32_t chunk_sample, const int32_t sample)
98 {
99 int32_t i, total;
100 const mp4ff_track_t * p_track = f->track[track];
101
102 if (p_track->stsz_sample_size)
103 {
104 return (sample - chunk_sample) * p_track->stsz_sample_size;
105 }
106 else
107 {
108 if (sample>=p_track->stsz_sample_count) return 0;//error
109
110 for(i = chunk_sample, total = 0; i < sample; i++)
111 {
112 total += p_track->stsz_table[i];
113 }
114 }
115
116 return total;
117 }
118
119 static int32_t mp4ff_sample_to_offset(const mp4ff_t *f, const int32_t track, const int32_t sample)
120 {
121 int32_t chunk, chunk_sample, chunk_offset1, chunk_offset2;
122
123 mp4ff_chunk_of_sample(f, track, sample, &chunk_sample, &chunk);
124
125 chunk_offset1 = mp4ff_chunk_to_offset(f, track, chunk);
126 chunk_offset2 = chunk_offset1 + mp4ff_sample_range_size(f, track, chunk_sample, sample);
127
128 return chunk_offset2;
129 }
130
131 int32_t mp4ff_audio_frame_size(const mp4ff_t *f, const int32_t track, const int32_t sample)
132 {
133 int32_t bytes;
134 const mp4ff_track_t * p_track = f->track[track];
135
136 if (p_track->stsz_sample_size)
137 {
138 bytes = p_track->stsz_sample_size;
139 } else {
140 bytes = p_track->stsz_table[sample];
141 }
142
143 return bytes;
144 }
145
146 int32_t mp4ff_set_sample_position(mp4ff_t *f, const int32_t track, const int32_t sample)
147 {
148 int32_t offset;
149
150 offset = mp4ff_sample_to_offset(f, track, sample);
151 mp4ff_set_position(f, offset);
152
153 return 0;
154 }
0 #include <stdlib.h>
1 #include <string.h>
2 #include "mp4ffint.h"
3
4 #ifdef USE_TAGGING
5
6 static uint32_t fix_byte_order_32(uint32_t src)
7 {
8 uint32_t result;
9 uint32_t a, b, c, d;
10 int8_t data[4];
11
12 memcpy(data,&src,sizeof(src));
13 a = (uint8_t)data[0];
14 b = (uint8_t)data[1];
15 c = (uint8_t)data[2];
16 d = (uint8_t)data[3];
17
18 result = (a<<24) | (b<<16) | (c<<8) | d;
19 return (uint32_t)result;
20 }
21
22 static uint16_t fix_byte_order_16(uint16_t src)
23 {
24 uint16_t result;
25 uint16_t a, b;
26 int8_t data[2];
27
28 memcpy(data,&src,sizeof(src));
29 a = (uint8_t)data[0];
30 b = (uint8_t)data[1];
31
32 result = (a<<8) | b;
33 return (uint16_t)result;
34 }
35
36
37 typedef struct
38 {
39 void * data;
40 unsigned written;
41 unsigned allocated;
42 unsigned error;
43 } membuffer;
44
45 unsigned membuffer_write(membuffer * buf,const void * ptr,unsigned bytes)
46 {
47 unsigned dest_size = buf->written + bytes;
48
49 if (buf->error) return 0;
50 if (dest_size > buf->allocated)
51 {
52 do
53 {
54 buf->allocated <<= 1;
55 } while(dest_size > buf->allocated);
56
57 {
58 void * newptr = realloc(buf->data,buf->allocated);
59 if (newptr==0)
60 {
61 free(buf->data);
62 buf->data = 0;
63 buf->error = 1;
64 return 0;
65 }
66 buf->data = newptr;
67 }
68 }
69
70 if (ptr) memcpy((char*)buf->data + buf->written,ptr,bytes);
71 buf->written += bytes;
72 return bytes;
73 }
74
75 #define membuffer_write_data membuffer_write
76
77 unsigned membuffer_write_int32(membuffer * buf,uint32_t data)
78 {
79 uint8_t temp[4] = {(uint8_t)(data>>24),(uint8_t)(data>>16),(uint8_t)(data>>8),(uint8_t)data};
80 return membuffer_write_data(buf,temp,4);
81 }
82
83 unsigned membuffer_write_int24(membuffer * buf,uint32_t data)
84 {
85 uint8_t temp[3] = {(uint8_t)(data>>16),(uint8_t)(data>>8),(uint8_t)data};
86 return membuffer_write_data(buf,temp,3);
87 }
88
89 unsigned membuffer_write_int16(membuffer * buf,uint16_t data)
90 {
91 uint8_t temp[2] = {(uint8_t)(data>>8),(uint8_t)data};
92 return membuffer_write_data(buf,temp,2);
93 }
94
95 unsigned membuffer_write_atom_name(membuffer * buf,const char * data)
96 {
97 return membuffer_write_data(buf,data,4)==4 ? 1 : 0;
98 }
99
100 void membuffer_write_atom(membuffer * buf,const char * name,unsigned size,const void * data)
101 {
102 membuffer_write_int32(buf,size + 8);
103 membuffer_write_atom_name(buf,name);
104 membuffer_write_data(buf,data,size);
105 }
106
107 unsigned membuffer_write_string(membuffer * buf,const char * data)
108 {
109 return membuffer_write_data(buf,data,strlen(data));
110 }
111
112 unsigned membuffer_write_int8(membuffer * buf,uint8_t data)
113 {
114 return membuffer_write_data(buf,&data,1);
115 }
116
117 void * membuffer_get_ptr(const membuffer * buf)
118 {
119 return buf->data;
120 }
121
122 unsigned membuffer_get_size(const membuffer * buf)
123 {
124 return buf->written;
125 }
126
127 unsigned membuffer_error(const membuffer * buf)
128 {
129 return buf->error;
130 }
131
132 void membuffer_set_error(membuffer * buf) {buf->error = 1;}
133
134 unsigned membuffer_transfer_from_file(membuffer * buf,mp4ff_t * src,unsigned bytes)
135 {
136 unsigned oldsize;
137 void * bufptr;
138
139 oldsize = membuffer_get_size(buf);
140 if (membuffer_write_data(buf,0,bytes) != bytes) return 0;
141
142 bufptr = membuffer_get_ptr(buf);
143 if (bufptr==0) return 0;
144
145 if ((unsigned)mp4ff_read_data(src,(char*)bufptr + oldsize,bytes)!=bytes)
146 {
147 membuffer_set_error(buf);
148 return 0;
149 }
150
151 return bytes;
152 }
153
154
155 membuffer * membuffer_create()
156 {
157 const unsigned initial_size = 256;
158
159 membuffer * buf = (membuffer *) malloc(sizeof(membuffer));
160 buf->data = malloc(initial_size);
161 buf->written = 0;
162 buf->allocated = initial_size;
163 buf->error = buf->data == 0 ? 1 : 0;
164
165 return buf;
166 }
167
168 void membuffer_free(membuffer * buf)
169 {
170 if (buf->data) free(buf->data);
171 free(buf);
172 }
173
174 void * membuffer_detach(membuffer * buf)
175 {
176 void * ret;
177
178 if (buf->error) return 0;
179
180 ret = realloc(buf->data,buf->written);
181
182 if (ret == 0) free(buf->data);
183
184 buf->data = 0;
185 buf->error = 1;
186
187 return ret;
188 }
189
190 #if 0
191 /* metadata tag structure */
192 typedef struct
193 {
194 char *item;
195 char *value;
196 } mp4ff_tag_t;
197
198 /* metadata list structure */
199 typedef struct
200 {
201 mp4ff_tag_t *tags;
202 uint32_t count;
203 } mp4ff_metadata_t;
204 #endif
205
206 typedef struct
207 {
208 const char * atom;
209 const char * name;
210 } stdmeta_entry;
211
212 static stdmeta_entry stdmetas[] =
213 {
214 {"©nam","title"},
215 {"©ART","artist"},
216 {"©wrt","writer"},
217 {"©alb","album"},
218 {"©day","date"},
219 {"©too","tool"},
220 {"©cmt","comment"},
221 // {"©gen","genre"},
222 {"cpil","compilation"},
223 // {"trkn","track"},
224 // {"disk","disc"},
225 // {"gnre","genre"},
226 {"covr","cover"},
227 };
228
229
230 static const char* find_standard_meta(const char * name) //returns atom name if found, 0 if not
231 {
232 unsigned n;
233 for(n=0;n<sizeof(stdmetas)/sizeof(stdmetas[0]);n++)
234 {
235 if (!stricmp(name,stdmetas[n].name)) return stdmetas[n].atom;
236 }
237 return 0;
238 }
239
240 static void membuffer_write_track_tag(membuffer * buf,const char * name,uint32_t index,uint32_t total)
241 {
242 membuffer_write_int32(buf,8 /*atom header*/ + 8 /*data atom header*/ + 8 /*flags + reserved*/ + 8 /*actual data*/ );
243 membuffer_write_atom_name(buf,name);
244 membuffer_write_int32(buf,8 /*data atom header*/ + 8 /*flags + reserved*/ + 8 /*actual data*/ );
245 membuffer_write_atom_name(buf,"data");
246 membuffer_write_int32(buf,0);//flags
247 membuffer_write_int32(buf,0);//reserved
248 membuffer_write_int16(buf,0);
249 membuffer_write_int16(buf,(uint16_t)index);//track number
250 membuffer_write_int16(buf,(uint16_t)total);//total tracks
251 membuffer_write_int16(buf,0);
252 }
253
254 static void membuffer_write_int16_tag(membuffer * buf,const char * name,uint16_t value)
255 {
256 membuffer_write_int32(buf,8 /*atom header*/ + 8 /*data atom header*/ + 8 /*flags + reserved*/ + 2 /*actual data*/ );
257 membuffer_write_atom_name(buf,name);
258 membuffer_write_int32(buf,8 /*data atom header*/ + 8 /*flags + reserved*/ + 2 /*actual data*/ );
259 membuffer_write_atom_name(buf,"data");
260 membuffer_write_int32(buf,0);//flags
261 membuffer_write_int32(buf,0);//reserved
262 membuffer_write_int16(buf,value);//value
263 }
264
265 static void membuffer_write_std_tag(membuffer * buf,const char * name,const char * value)
266 {
267 membuffer_write_int32(buf,8 /*atom header*/ + 8 /*data atom header*/ + 8 /*flags + reserved*/ + strlen(value) );
268 membuffer_write_atom_name(buf,name);
269 membuffer_write_int32(buf,8 /*data atom header*/ + 8 /*flags + reserved*/ + strlen(value));
270 membuffer_write_atom_name(buf,"data");
271 membuffer_write_int32(buf,1);//flags
272 membuffer_write_int32(buf,0);//reserved
273 membuffer_write_data(buf,value,strlen(value));
274 }
275
276 static void membuffer_write_custom_tag(membuffer * buf,const char * name,const char * value)
277 {
278 membuffer_write_int32(buf,8 /*atom header*/ + 0x1C /*weirdo itunes atom*/ + 12 /*name atom header*/ + strlen(name) + 16 /*data atom header + flags*/ + strlen(value) );
279 membuffer_write_atom_name(buf,"----");
280 membuffer_write_int32(buf,0x1C);//weirdo itunes atom
281 membuffer_write_atom_name(buf,"mean");
282 membuffer_write_int32(buf,0);
283 membuffer_write_data(buf,"com.apple.iTunes",16);
284 membuffer_write_int32(buf,12 + strlen(name));
285 membuffer_write_atom_name(buf,"name");
286 membuffer_write_int32(buf,0);
287 membuffer_write_data(buf,name,strlen(name));
288 membuffer_write_int32(buf,8 /*data atom header*/ + 8 /*flags + reserved*/ + strlen(value));
289 membuffer_write_atom_name(buf,"data");
290 membuffer_write_int32(buf,1);//flags
291 membuffer_write_int32(buf,0);//reserved
292 membuffer_write_data(buf,value,strlen(value));
293
294 }
295
296 static uint32_t myatoi(const char * param)
297 {
298 return param ? atoi(param) : 0;
299 }
300
301 static uint32_t create_ilst(const mp4ff_metadata_t * data,void ** out_buffer,uint32_t * out_size)
302 {
303 membuffer * buf = membuffer_create();
304 unsigned metaptr;
305 char * mask = (char*)malloc(data->count);
306 memset(mask,0,data->count);
307
308 {
309 const char * tracknumber_ptr = 0, * totaltracks_ptr = 0;
310 const char * discnumber_ptr = 0, * totaldiscs_ptr = 0;
311 const char * genre_ptr = 0, * tempo_ptr = 0;
312 for(metaptr = 0; metaptr < data->count; metaptr++)
313 {
314 mp4ff_tag_t * tag = &data->tags[metaptr];
315 if (!stricmp(tag->item,"tracknumber") || !stricmp(tag->item,"track"))
316 {
317 if (tracknumber_ptr==0) tracknumber_ptr = tag->value;
318 mask[metaptr] = 1;
319 }
320 else if (!stricmp(tag->item,"totaltracks"))
321 {
322 if (totaltracks_ptr==0) totaltracks_ptr = tag->value;
323 mask[metaptr] = 1;
324 }
325 else if (!stricmp(tag->item,"discnumber") || !stricmp(tag->item,"disc"))
326 {
327 if (discnumber_ptr==0) discnumber_ptr = tag->value;
328 mask[metaptr] = 1;
329 }
330 else if (!stricmp(tag->item,"totaldiscs"))
331 {
332 if (totaldiscs_ptr==0) totaldiscs_ptr = tag->value;
333 mask[metaptr] = 1;
334 }
335 else if (!stricmp(tag->item,"genre"))
336 {
337 if (genre_ptr==0) genre_ptr = tag->value;
338 mask[metaptr] = 1;
339 }
340 else if (!stricmp(tag->item,"tempo"))
341 {
342 if (tempo_ptr==0) tempo_ptr = tag->value;
343 mask[metaptr] = 1;
344 }
345
346 }
347
348 if (tracknumber_ptr) membuffer_write_track_tag(buf,"trkn",myatoi(tracknumber_ptr),myatoi(totaltracks_ptr));
349 if (discnumber_ptr) membuffer_write_track_tag(buf,"disk",myatoi(discnumber_ptr),myatoi(totaldiscs_ptr));
350 if (tempo_ptr) membuffer_write_int16_tag(buf,"tmpo",(uint16_t)myatoi(tempo_ptr));
351
352 if (genre_ptr)
353 {
354 uint32_t index = mp4ff_meta_genre_to_index(genre_ptr);
355 if (index==0)
356 membuffer_write_std_tag(buf,"©gen",genre_ptr);
357 else
358 membuffer_write_int16_tag(buf,"gnre",(uint16_t)index);
359 }
360 }
361
362 for(metaptr = 0; metaptr < data->count; metaptr++)
363 {
364 if (!mask[metaptr])
365 {
366 mp4ff_tag_t * tag = &data->tags[metaptr];
367 const char * std_meta_atom = find_standard_meta(tag->item);
368 if (std_meta_atom)
369 {
370 membuffer_write_std_tag(buf,std_meta_atom,tag->value);
371 }
372 else
373 {
374 membuffer_write_custom_tag(buf,tag->item,tag->value);
375 }
376 }
377 }
378
379 free(mask);
380
381 if (membuffer_error(buf))
382 {
383 membuffer_free(buf);
384 return 0;
385 }
386
387 *out_size = membuffer_get_size(buf);
388 *out_buffer = membuffer_detach(buf);
389 membuffer_free(buf);
390
391 return 1;
392 }
393
394 static uint32_t find_atom(mp4ff_t * f,uint64_t base,uint32_t size,const char * name)
395 {
396 uint32_t remaining = size;
397 uint64_t atom_offset = base;
398 for(;;)
399 {
400 char atom_name[4];
401 uint32_t atom_size;
402
403 mp4ff_set_position(f,atom_offset);
404
405 if (remaining < 8) break;
406 atom_size = mp4ff_read_int32(f);
407 if (atom_size > remaining || atom_size < 8) break;
408 mp4ff_read_data(f,atom_name,4);
409
410 if (!memcmp(atom_name,name,4))
411 {
412 mp4ff_set_position(f,atom_offset);
413 return 1;
414 }
415
416 remaining -= atom_size;
417 atom_offset += atom_size;
418 }
419 return 0;
420 }
421
422 static uint32_t find_atom_v2(mp4ff_t * f,uint64_t base,uint32_t size,const char * name,uint32_t extraheaders,const char * name_inside)
423 {
424 uint64_t first_base = (uint64_t)(-1);
425 while(find_atom(f,base,size,name))//try to find atom <name> with atom <name_inside> in it
426 {
427 uint64_t mybase = mp4ff_position(f);
428 uint32_t mysize = mp4ff_read_int32(f);
429
430 if (first_base == (uint64_t)(-1)) first_base = mybase;
431
432 if (mysize < 8 + extraheaders) break;
433
434 if (find_atom(f,mybase+(8+extraheaders),mysize-(8+extraheaders),name_inside))
435 {
436 mp4ff_set_position(f,mybase);
437 return 2;
438 }
439 base += mysize;
440 if (size<=mysize) {size=0;break;}
441 size -= mysize;
442 }
443
444 if (first_base != (uint64_t)(-1))//wanted atom inside not found
445 {
446 mp4ff_set_position(f,first_base);
447 return 1;
448 }
449 else return 0;
450 }
451
452 static uint32_t create_meta(const mp4ff_metadata_t * data,void ** out_buffer,uint32_t * out_size)
453 {
454 membuffer * buf;
455 uint32_t ilst_size;
456 void * ilst_buffer;
457
458 if (!create_ilst(data,&ilst_buffer,&ilst_size)) return 0;
459
460 buf = membuffer_create();
461
462 membuffer_write_int32(buf,0);
463 membuffer_write_atom(buf,"ilst",ilst_size,ilst_buffer);
464 free(ilst_buffer);
465
466 *out_size = membuffer_get_size(buf);
467 *out_buffer = membuffer_detach(buf);
468 membuffer_free(buf);
469 return 1;
470 }
471
472 static uint32_t create_udta(const mp4ff_metadata_t * data,void ** out_buffer,uint32_t * out_size)
473 {
474 membuffer * buf;
475 uint32_t meta_size;
476 void * meta_buffer;
477
478 if (!create_meta(data,&meta_buffer,&meta_size)) return 0;
479
480 buf = membuffer_create();
481
482 membuffer_write_atom(buf,"meta",meta_size,meta_buffer);
483
484 free(meta_buffer);
485
486 *out_size = membuffer_get_size(buf);
487 *out_buffer = membuffer_detach(buf);
488 membuffer_free(buf);
489 return 1;
490 }
491
492 static uint32_t modify_moov(mp4ff_t * f,const mp4ff_metadata_t * data,void ** out_buffer,uint32_t * out_size)
493 {
494 uint64_t total_base = f->moov_offset + 8;
495 uint32_t total_size = (uint32_t)(f->moov_size - 8);
496
497 uint64_t udta_offset,meta_offset,ilst_offset;
498 uint32_t udta_size, meta_size, ilst_size;
499
500 uint32_t new_ilst_size;
501 void * new_ilst_buffer;
502
503 uint8_t * p_out;
504 int32_t size_delta;
505
506
507 if (!find_atom_v2(f,total_base,total_size,"udta",0,"meta"))
508 {
509 membuffer * buf;
510 void * new_udta_buffer;
511 uint32_t new_udta_size;
512 if (!create_udta(data,&new_udta_buffer,&new_udta_size)) return 0;
513
514 buf = membuffer_create();
515 mp4ff_set_position(f,total_base);
516 membuffer_transfer_from_file(buf,f,total_size);
517
518 membuffer_write_atom(buf,"udta",new_udta_size,new_udta_buffer);
519
520 free(new_udta_buffer);
521
522 *out_size = membuffer_get_size(buf);
523 *out_buffer = membuffer_detach(buf);
524 membuffer_free(buf);
525 return 1;
526 }
527 else
528 {
529 udta_offset = mp4ff_position(f);
530 udta_size = mp4ff_read_int32(f);
531 if (!find_atom_v2(f,udta_offset+8,udta_size-8,"meta",4,"ilst"))
532 {
533 membuffer * buf;
534 void * new_meta_buffer;
535 uint32_t new_meta_size;
536 if (!create_meta(data,&new_meta_buffer,&new_meta_size)) return 0;
537
538 buf = membuffer_create();
539 mp4ff_set_position(f,total_base);
540 membuffer_transfer_from_file(buf,f,(uint32_t)(udta_offset - total_base));
541
542 membuffer_write_int32(buf,udta_size + 8 + new_meta_size);
543 membuffer_write_atom_name(buf,"udta");
544 membuffer_transfer_from_file(buf,f,udta_size);
545
546 membuffer_write_atom(buf,"meta",new_meta_size,new_meta_buffer);
547 free(new_meta_buffer);
548
549 *out_size = membuffer_get_size(buf);
550 *out_buffer = membuffer_detach(buf);
551 membuffer_free(buf);
552 return 1;
553 }
554 meta_offset = mp4ff_position(f);
555 meta_size = mp4ff_read_int32(f);
556 if (!find_atom(f,meta_offset+12,meta_size-12,"ilst")) return 0;//shouldn't happen, find_atom_v2 above takes care of it
557 ilst_offset = mp4ff_position(f);
558 ilst_size = mp4ff_read_int32(f);
559
560 if (!create_ilst(data,&new_ilst_buffer,&new_ilst_size)) return 0;
561
562 size_delta = new_ilst_size - (ilst_size - 8);
563
564 *out_size = total_size + size_delta;
565 *out_buffer = malloc(*out_size);
566 if (*out_buffer == 0)
567 {
568 free(new_ilst_buffer);
569 return 0;
570 }
571
572 p_out = (uint8_t*)*out_buffer;
573
574 mp4ff_set_position(f,total_base);
575 mp4ff_read_data(f,p_out,(uint32_t)(udta_offset - total_base )); p_out += (uint32_t)(udta_offset - total_base );
576 *(uint32_t*)p_out = fix_byte_order_32(mp4ff_read_int32(f) + size_delta); p_out += 4;
577 mp4ff_read_data(f,p_out,4); p_out += 4;
578 mp4ff_read_data(f,p_out,(uint32_t)(meta_offset - udta_offset - 8)); p_out += (uint32_t)(meta_offset - udta_offset - 8);
579 *(uint32_t*)p_out = fix_byte_order_32(mp4ff_read_int32(f) + size_delta); p_out += 4;
580 mp4ff_read_data(f,p_out,4); p_out += 4;
581 mp4ff_read_data(f,p_out,(uint32_t)(ilst_offset - meta_offset - 8)); p_out += (uint32_t)(ilst_offset - meta_offset - 8);
582 *(uint32_t*)p_out = fix_byte_order_32(mp4ff_read_int32(f) + size_delta); p_out += 4;
583 mp4ff_read_data(f,p_out,4); p_out += 4;
584
585 memcpy(p_out,new_ilst_buffer,new_ilst_size);
586 p_out += new_ilst_size;
587
588 mp4ff_set_position(f,ilst_offset + ilst_size);
589 mp4ff_read_data(f,p_out,(uint32_t)(total_size - (ilst_offset - total_base) - ilst_size));
590
591 free(new_ilst_buffer);
592 }
593 return 1;
594
595 }
596
597 int32_t mp4ff_meta_update(mp4ff_callback_t *f,const mp4ff_metadata_t * data)
598 {
599 void * new_moov_data;
600 uint32_t new_moov_size;
601
602 mp4ff_t *ff = malloc(sizeof(mp4ff_t));
603
604 memset(ff, 0, sizeof(mp4ff_t));
605 ff->stream = f;
606 mp4ff_set_position(ff,0);
607
608 parse_atoms(ff,1);
609
610
611 if (!modify_moov(ff,data,&new_moov_data,&new_moov_size))
612 {
613 mp4ff_close(ff);
614 return 0;
615 }
616
617 /* copy moov atom to end of the file */
618 if (ff->last_atom != ATOM_MOOV)
619 {
620 char *free_data = "free";
621
622 /* rename old moov to free */
623 mp4ff_set_position(ff, ff->moov_offset + 4);
624 mp4ff_write_data(ff, free_data, 4);
625
626 mp4ff_set_position(ff, ff->file_size);
627 mp4ff_write_int32(ff,new_moov_size + 8);
628 mp4ff_write_data(ff,"moov",4);
629 mp4ff_write_data(ff, new_moov_data, new_moov_size);
630 }
631 else
632 {
633 mp4ff_set_position(ff, ff->moov_offset);
634 mp4ff_write_int32(ff,new_moov_size + 8);
635 mp4ff_write_data(ff,"moov",4);
636 mp4ff_write_data(ff, new_moov_data, new_moov_size);
637 }
638
639 mp4ff_truncate(ff);
640
641 mp4ff_close(ff);
642 return 1;
643 }
644 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: mp4util.c,v 1.20 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 #include "mp4ffint.h"
31 #include <stdlib.h>
32
33 int32_t mp4ff_read_data(mp4ff_t *f, int8_t *data, uint32_t size)
34 {
35 int32_t result = 1;
36
37 result = f->stream->read(f->stream->user_data, data, size);
38
39 f->current_position += size;
40
41 return result;
42 }
43
44 int32_t mp4ff_truncate(mp4ff_t * f)
45 {
46 return f->stream->truncate(f->stream->user_data);
47 }
48
49 int32_t mp4ff_write_data(mp4ff_t *f, int8_t *data, uint32_t size)
50 {
51 int32_t result = 1;
52
53 result = f->stream->write(f->stream->user_data, data, size);
54
55 f->current_position += size;
56
57 return result;
58 }
59
60 int32_t mp4ff_write_int32(mp4ff_t *f,const uint32_t data)
61 {
62 uint32_t result;
63 uint32_t a, b, c, d;
64 int8_t temp[4];
65
66 *(uint32_t*)temp = data;
67 a = (uint8_t)temp[0];
68 b = (uint8_t)temp[1];
69 c = (uint8_t)temp[2];
70 d = (uint8_t)temp[3];
71
72 result = (a<<24) | (b<<16) | (c<<8) | d;
73
74 return mp4ff_write_data(f,(uint8_t*)&result,sizeof(result));
75 }
76
77 int32_t mp4ff_set_position(mp4ff_t *f, const int64_t position)
78 {
79 f->stream->seek(f->stream->user_data, position);
80 f->current_position = position;
81
82 return 0;
83 }
84
85 int64_t mp4ff_position(const mp4ff_t *f)
86 {
87 return f->current_position;
88 }
89
90 uint64_t mp4ff_read_int64(mp4ff_t *f)
91 {
92 uint8_t data[8];
93 uint64_t result = 0;
94 int8_t i;
95
96 mp4ff_read_data(f, data, 8);
97
98 for (i = 0; i < 8; i++)
99 {
100 result |= ((uint64_t)data[i]) << ((7 - i) * 8);
101 }
102
103 return result;
104 }
105
106 uint32_t mp4ff_read_int32(mp4ff_t *f)
107 {
108 uint32_t result;
109 uint32_t a, b, c, d;
110 int8_t data[4];
111
112 mp4ff_read_data(f, data, 4);
113 a = (uint8_t)data[0];
114 b = (uint8_t)data[1];
115 c = (uint8_t)data[2];
116 d = (uint8_t)data[3];
117
118 result = (a<<24) | (b<<16) | (c<<8) | d;
119 return (uint32_t)result;
120 }
121
122 uint32_t mp4ff_read_int24(mp4ff_t *f)
123 {
124 uint32_t result;
125 uint32_t a, b, c;
126 int8_t data[4];
127
128 mp4ff_read_data(f, data, 3);
129 a = (uint8_t)data[0];
130 b = (uint8_t)data[1];
131 c = (uint8_t)data[2];
132
133 result = (a<<16) | (b<<8) | c;
134 return (uint32_t)result;
135 }
136
137 uint16_t mp4ff_read_int16(mp4ff_t *f)
138 {
139 uint32_t result;
140 uint32_t a, b;
141 int8_t data[2];
142
143 mp4ff_read_data(f, data, 2);
144 a = (uint8_t)data[0];
145 b = (uint8_t)data[1];
146
147 result = (a<<8) | b;
148 return (uint16_t)result;
149 }
150
151 char * mp4ff_read_string(mp4ff_t * f,uint32_t length)
152 {
153 char * str = (char*)malloc(length + 1);
154 if (str!=0)
155 {
156 if ((uint32_t)mp4ff_read_data(f,str,length)!=length)
157 {
158 free(str);
159 str = 0;
160 }
161 else
162 {
163 str[length] = 0;
164 }
165 }
166 return str;
167 }
168
169 uint8_t mp4ff_read_char(mp4ff_t *f)
170 {
171 uint8_t output;
172 mp4ff_read_data(f, &output, 1);
173 return output;
174 }
175
176 uint32_t mp4ff_read_mp4_descr_length(mp4ff_t *f)
177 {
178 uint8_t b;
179 uint8_t numBytes = 0;
180 uint32_t length = 0;
181
182 do
183 {
184 b = mp4ff_read_char(f);
185 numBytes++;
186 length = (length << 7) | (b & 0x7F);
187 } while ((b & 0x80) && numBytes < 4);
188
189 return length;
190 }
0 dnl
1 dnl This is the configure.in for faad2 related to unix creation
2
3 dnl - libfaad.so
4 dnl - libmp4ff.a (only static for moment)
5 dnl - faad
6 dnl - xmms input mp4/aac plugin
7 dnl - mpeg4ip plugin (requires mpeg4ip's libmp4v2 to be installed)
8
9 AC_INIT
10 AC_CONFIG_AUX_DIR(.)
11 AM_INIT_AUTOMAKE(faad2, 2.6.0cvs)
12
13 AC_PROG_LIBTOOL
14 AC_SUBST(LIBTOOL_DEPS)
15
16 dnl Checks for programs.
17 AC_PROG_CC
18 AC_PROG_CPP
19 dnl disable for mpeg4ip plugin
20 dnl AC_PROG_CXX
21 AC_PROG_INSTALL
22 AC_PROG_LN_S
23 AC_PROG_MAKE_SET
24 AC_CHECK_PROGS(RPMBUILD, rpmbuild, rpm)
25
26 AM_CONFIG_HEADER(config.h)
27
28 AC_ARG_WITH(xmms,[ --with-xmms compile XMMS-1 plugin],
29 WITHXMMS=$withval, WITHXMMS=no)
30
31 AC_ARG_WITH(drm,[ --with-drm compile libfaad with DRM support],
32 WITHDRM=$withval, WITHDRM=no)
33
34 AC_ARG_WITH(mpeg4ip, [ --with-mpeg4ip compile mpeg4ip plugin],
35 WITHMPEG4IP=$withval, WITHMPEG4IP=no)
36
37 dnl Checks for header files required for mp4.h
38 AC_HEADER_STDC
39 AC_CHECK_HEADERS(stdint.h inttypes.h)
40 AC_CHECK_HEADERS(mathf.h)
41 AC_CHECK_HEADERS(float.h)
42 AC_CHECK_FUNCS(strchr memcpy)
43 AC_CHECK_HEADERS(sys/time.h)
44 AC_HEADER_TIME
45
46 dnl DRMS
47 AC_CHECK_HEADERS(errno.h sys/stat.h sys/types.h limits.h)
48 AC_CHECK_HEADERS(sysfs/libsysfs.h)
49 AC_CHECK_HEADERS(IOKit/IOKitLib.h,
50 [AC_CHECK_LIB(IOKit, main,
51 [AC_DEFINE(HAVE_IOKIT_IOKITLIB_H, 1, [Define if you have the IOKit API])
52 MP4FF_LIBS="-lIOKit"
53 AC_SUBST(MP4FF_LIBS)])])
54 AC_CHECK_FUNCS(getpwuid)
55
56 AC_C_INLINE
57 AC_C_BIGENDIAN
58
59 AC_TYPE_OFF_T
60
61 AC_DEFUN([MY_CHECK_TYPEDEF_FROM_INCLUDE],
62 [
63 AC_MSG_CHECKING([for $1])
64 AC_TRY_COMPILE([$2],
65 [$1;],
66 libfaad_ok=yes, libfaad_ok=no)
67 if test $libfaad_ok = yes; then
68 AC_DEFINE($3, 1, [Define if needed])
69 AC_MSG_RESULT([yes])
70 else
71 AC_MSG_RESULT([no])
72 fi
73 ])
74
75 dnl @synopsis AC_C99_FUNC_LRINTF
76 dnl
77 dnl Check whether C99's lrintf function is available.
78 dnl @version 1.3 Feb 12 2002
79 dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
80 dnl
81 dnl Permission to use, copy, modify, distribute, and sell this file for any
82 dnl purpose is hereby granted without fee, provided that the above copyright
83 dnl and this permission notice appear in all copies. No representations are
84 dnl made about the suitability of this software for any purpose. It is
85 dnl provided "as is" without express or implied warranty.
86 dnl
87 AC_DEFUN([AC_C99_FUNC_LRINTF],
88 [AC_CACHE_CHECK(for lrintf,
89 ac_cv_c99_lrintf,
90 [
91 lrintf_save_CFLAGS=$CFLAGS
92 CFLAGS="-O -lm"
93 AC_TRY_LINK([
94 #define _ISOC9X_SOURCE 1
95 #define _ISOC99_SOURCE 1
96 #define __USE_ISOC99 1
97 #define __USE_ISOC9X 1
98
99 #include <math.h>
100 ], if (!lrintf(3.14159)) lrintf(2.7183);, ac_cv_c99_lrintf=yes, ac_cv_c99_lrintf=no)
101
102 CFLAGS=$lrintf_save_CFLAGS
103
104 ])
105
106 if test "$ac_cv_c99_lrintf" = yes; then
107 AC_DEFINE(HAVE_LRINTF, 1,
108 [Define if you have C99's lrintf function.])
109 fi
110 ])# AC_C99_FUNC_LRINTF
111 AC_C99_FUNC_LRINTF
112
113 MY_CHECK_TYPEDEF_FROM_INCLUDE([float32_t temp],
114 [#include <sys/types.h>,
115 #include <sys/float.h>], [HAVE_FLOAT32_T])
116
117 AC_CHECK_FUNCS(strsep)
118
119 AC_CHECK_PROG(external_mp4v2, mpeg4ip-config, yes, no)
120 AM_CONDITIONAL(HAVE_MPEG4IP_PLUG, false)
121 if test x$WITHMPEG4IP = xyes; then
122 if test x$external_mp4v2 = xyes; then
123 AM_CONDITIONAL(HAVE_MPEG4IP_PLUG, true)
124 AC_MSG_NOTICE("Building MPEG4IP plugin")
125 else
126 AC_MSG_NOTICE("MPEG4IP libmp4v2 is required for MPEG4IP plugin")
127 fi
128 fi
129
130 if test x$WITHXMMS = xyes; then
131 AC_CHECK_PROGS(XMMS_CONFIG, xmms-config,"not_found")
132 if test "$XMMS_CONFIG" = "not_found"; then
133 AC_MSG_ERROR("*** xmms-config not found - xmms plugin can't be build")
134 fi
135 AC_CHECK_HEADER(pthread.h,,
136 AC_MSG_ERROR(*** pthread headers support not installed or not found))
137 AC_CHECK_HEADER(id3.h,,
138 AC_MSG_ERROR(*** id3lib headers support not installed or not found))
139 AC_CHECK_PROGS(GTK_CONFIG, gtk-config, "not_found")
140 if test "$XGTK_CONFIG" = "not_found"; then
141 AC_MSG_ERROR("*** gtk-config not found - xmms plugin can't be build without")
142 fi
143
144 AM_CONDITIONAL(HAVE_XMMS, true)
145 else
146 AC_MSG_NOTICE(no xmms build configured)
147 AM_CONDITIONAL(HAVE_XMMS, false)
148 fi
149
150 if test x$WITHDRM = xyes; then
151 AC_DEFINE(DRM, 1, [Define if you want to use libfaad together with Digital Radio Mondiale (DRM)])
152 AC_DEFINE(DRM_PS, 1, [Define if you want support for Digital Radio Mondiale (DRM) parametric stereo])
153 fi
154
155 AC_CONFIG_FILES(libfaad/Makefile)
156 AC_CONFIG_FILES(common/Makefile)
157 AC_CONFIG_FILES(common/mp4ff/Makefile)
158 AC_CONFIG_FILES(plugins/Makefile)
159 AC_CONFIG_FILES(plugins/xmms/Makefile)
160 AC_CONFIG_FILES(plugins/xmms/src/Makefile)
161 AC_CONFIG_FILES(plugins/mpeg4ip/Makefile)
162 AC_CONFIG_FILES(faad2.spec)
163 AC_CONFIG_FILES(frontend/Makefile)
164 AC_CONFIG_FILES(Makefile)
165
166 AC_OUTPUT
0 # option to compile without XMMS plugin
1 %if %{?without_xmms:1}%{!?without_xmms:0}
2 %define _without_xmms --without-xmms
3 %else
4 %define _with_xmms --with-xmms
5 %endif
6 # this has been taken from http://www.hyperborea.org/software/dillo/dillo.spec
7 #################################################################################
8 # Identify which distribution we're building on.
9 # This will determine any changes in menu structure or release number (i.e. .mdk)
10 # Eventually, need to make this configurable from the rpmbuild command line.
11
12 %define freedesktop %(if [ -e /usr/share/applications ]; then echo 1; else echo 0; fi;)
13 %define conectiva %(if [ -e /etc/conectiva-release ]; then echo 1; else echo 0; fi;)
14 %define mdk %(if [ -e /etc/mandrake-release ]; then echo 1; else echo 0; fi;)
15 %define suse %(if [ -e /etc/SuSE-release ]; then echo 1; else echo 0; fi;)
16 %define oldsuse 0
17 %if %{suse}
18 %define oldsuse %(if [ `grep VERSION /etc/SuSE-release | sed -e "s/VERSION = //"` \\< 8.0 ]; then echo 1; else echo 0; fi;)
19 %endif
20
21 %define oldredhat %(if [ -e /etc/redhat-release ]; then echo 1; else echo 0; fi;) && !%{mdk} && !%{suse} && !%{conectiva} && !%{freedesktop}
22 %define plain !%{mdk} && !%{suse} && !%{conectiva} && !%{oldredhat} && !%{freedesktop}
23
24 Summary: C library and frontend for decoding MPEG2/4 AAC
25 Name: faad2
26 Version: @VERSION@
27 Release: 1
28 License: GPL
29 Group: Applications/Multimedia
30 Source0: http://download.sourceforge.net/faad/%{name}-%{version}.tar.gz
31 #Patch: faad2-%{version}.patch
32 BuildRequires: autoconf, automake, libtool, gcc-c++
33
34 %if %{?_with_xmms:1}%{!?_with_xmms:0}
35 BuildRequires: xmms-devel
36 %endif
37
38 URL: http://www.audiocoding.com/
39 #################################################################################
40 %if %{?_with_xmms:1}%{!?_with_xmms:0}
41 # GTK Dependencies
42 %if %{mdk}
43 BuildRequires: libgtk+-devel >= 1.2.0
44 %endif
45 %if %{suse}
46 BuildRequires: gtk-devel >= 1.2.0
47 %endif
48 %if !%{suse} && !%{mdk}
49 BuildRequires: gtk+-devel >= 1.2.0
50 %endif
51 %endif
52
53 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
54 Packager: a.kurpiers@nt.tu-darmstadt.de
55
56 %description
57 FAAD 2 is a LC, MAIN and LTP profile, MPEG2 and MPEG-4 AAC decoder, completely
58 written from scratch. FAAD 2 is licensed under the GPL.
59
60 Includes libmp4ff, a Quicktime library for UNIX in a freely redistributable,
61 statically linkable library.
62
63 %package devel
64 Summary: Development libraries the FAAD 2 AAC decoder.
65 Group: Development/Libraries
66 Requires: %{name}
67
68 %description devel
69 Header files and development documentation for libfaad.
70
71 %if %{?_with_xmms:1}%{!?_with_xmms:0}
72 %package xmms
73 Group: Applications/Multimedia
74 Summary: AAC and MP4 input plugin for xmms
75 Requires: %{name}, xmms
76
77
78 %description xmms
79 The AAC xmms input plugin for xmms recognizes AAC files by an
80 .aac extension.
81 This MP4 xmms plugin reads AAC files with and without ID3 tags (version 2.x).
82 AAC files are MPEG2 or MPEG4 files that can be found in MPEG4 audio files
83 (.mp4). MPEG4 files with AAC inside can be read by RealPlayer or Quicktime.
84 %endif
85
86 %prep
87 #%setup -n %{name}
88 %setup -n %{name}-%{version}
89 #%patch -p0
90
91 %build
92 #sh bootstrap
93 ./configure --with-drm %{?_with_xmms} %{?_without_xmms} --prefix=/usr
94 make
95
96 %install
97 rm -rf %{buildroot}
98 # Hack to work around a problem with DESTDIR in libtool 1.4.x
99 LIBRARY_PATH="%{buildroot}/usr/lib:${LIBRARY_PATH}" make install DESTDIR=%{buildroot}
100 # install libmp4ff
101 install -m 755 common/mp4ff/libmp4ff.a %{buildroot}%{_libdir}
102 install common/mp4ff/mp4ff.h %{buildroot}%{_includedir}
103
104 %post -p /sbin/ldconfig
105
106 %postun -p /sbin/ldconfig
107
108 %clean
109 rm -rf %{buildroot}
110
111 %files
112 %defattr(-, root, root)
113 %doc AUTHORS COPYING ChangeLog NEWS README TODO
114 %{_bindir}/*
115 %{_libdir}/libfaad.so*
116
117 %files devel
118 %defattr(-, root, root)
119 %{_libdir}/libfaad.a
120 %{_libdir}/libfaad.la
121 %{_includedir}/faad.h
122 %{_includedir}/neaacdec.h
123 %{_includedir}/mp4ff.h
124 %{_libdir}/libmp4ff.a
125
126 %if %{?_with_xmms:1}%{!?_with_xmms:0}
127 %files xmms
128 %defattr(-,root,root)
129 %doc plugins/xmms/README
130 %_libdir/xmms/Input/*
131 %endif
132
133 %changelog
134 * Tue Jan 24 2006 Alexander Kurpiers <a.kurpiers@nt.tu-darmstadt.de>
135 - fix wrong function declaration in mp4ffint.h
136
137 * Wed Nov 15 2005 Alexander Kurpiers <a.kurpiers@nt.tu-darmstadt.de>
138 - fix requirements for xmms plugin
139 - add libmp4ff to devel package (only static library)
140
141 * Sat Aug 13 2005 Alexander Kurpiers <a.kurpiers@nt.tu-darmstadt.de>
142 - fix dependencies for xmms plugin. libmp4v2/id3lib no longer needed
143
144 * Sun Apr 24 2005 Alexander Kurpiers <a.kurpiers@nt.tu-darmstadt.de>
145 - make xmms plugin generation optional. Build with '--define "without_xmms 1"'
146
147 * Tue Nov 02 2004 Alexander Kurpiers <a.kurpiers@nt.tu-darmstadt.de>
148 - remove libmp4ff and libmp4v2 from RPM
149 - changes for new version of faad2
150
151 * Sat Apr 17 2004 Alexander Kurpiers <a.kurpiers@nt.tu-darmstadt.de>
152 - apply fix to make DRM support work
153 - use "platform-independant" dependencies (taken from dillo.spec)
154
155 * Fri Feb 06 2004 Alexander Kurpiers <a.kurpiers@nt.tu-darmstadt.de>
156 - remove seperate libmp4ff target
157
158 * Wed Nov 05 2003 Alexander Kurpiers <a.kurpiers@nt.tu-darmstadt.de>
159 - include xmms plugins/libmp4v2/libmp4ff into RPM
160
161 * Tue Aug 12 2003 Matthias Saou <matthias.saou@est.une.marmotte.net>
162 - Update to 2.0rc1.
163 - Introduced LD_LIBRARY_PATH workaround.
164 - Removed optional xmms plugin build, it seems mandatory now.
165 - Added gtk+ build dep for the xmms plugin.
166
167 * Wed May 14 2003 Matthias Saou <matthias.saou@est.une.marmotte.net>
168 - Added xmms plugin build.
169
170 * Wed Apr 9 2003 Matthias Saou <matthias.saou@est.une.marmotte.net>
171 - Spec file cleanup.
172 - Now exclude .la file.
173 - Update to latest CVS checkout to fix compile problem.
174
175
176 * Fri Aug 10 2002 Alexander Kurpiers <a.kurpiers@nt.tu-darmstadt.de>
177 - changes to compile v1.1 release
178
179 * Tue Jun 18 2002 Alexander Kurpiers <a.kurpiers@nt.tu-darmstadt.de>
180 - First RPM.
181
0 bin_PROGRAMS = faad
1
2 INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/common/faad \
3 -I$(top_srcdir)/common/mp4ff
4
5 faad_LDADD = $(top_builddir)/libfaad/libfaad.la \
6 $(top_builddir)/common/mp4ff/libmp4ff.la
7
8 faad_SOURCES = main.c \
9 audio.c audio.h \
10 $(top_srcdir)/common/faad/getopt.c
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: audio.c,v 1.28 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 #ifdef _WIN32
31 #include <io.h>
32 #endif
33 #include <stdlib.h>
34 #include <stdio.h>
35 #include <fcntl.h>
36 #include <math.h>
37 #include <neaacdec.h>
38 #include "audio.h"
39
40
41 audio_file *open_audio_file(char *infile, int samplerate, int channels,
42 int outputFormat, int fileType, long channelMask)
43 {
44 audio_file *aufile = malloc(sizeof(audio_file));
45
46 aufile->outputFormat = outputFormat;
47
48 aufile->samplerate = samplerate;
49 aufile->channels = channels;
50 aufile->total_samples = 0;
51 aufile->fileType = fileType;
52 aufile->channelMask = channelMask;
53
54 switch (outputFormat)
55 {
56 case FAAD_FMT_16BIT:
57 aufile->bits_per_sample = 16;
58 break;
59 case FAAD_FMT_24BIT:
60 aufile->bits_per_sample = 24;
61 break;
62 case FAAD_FMT_32BIT:
63 case FAAD_FMT_FLOAT:
64 aufile->bits_per_sample = 32;
65 break;
66 default:
67 if (aufile) free(aufile);
68 return NULL;
69 }
70
71 if(infile[0] == '-')
72 {
73 #ifdef _WIN32
74 setmode(fileno(stdout), O_BINARY);
75 #endif
76 aufile->sndfile = stdout;
77 aufile->toStdio = 1;
78 } else {
79 aufile->toStdio = 0;
80 aufile->sndfile = fopen(infile, "wb");
81 }
82
83 if (aufile->sndfile == NULL)
84 {
85 if (aufile) free(aufile);
86 return NULL;
87 }
88
89 if (aufile->fileType == OUTPUT_WAV)
90 {
91 if (aufile->channelMask)
92 write_wav_extensible_header(aufile, aufile->channelMask);
93 else
94 write_wav_header(aufile);
95 }
96
97 return aufile;
98 }
99
100 int write_audio_file(audio_file *aufile, void *sample_buffer, int samples, int offset)
101 {
102 char *buf = (char *)sample_buffer;
103 switch (aufile->outputFormat)
104 {
105 case FAAD_FMT_16BIT:
106 return write_audio_16bit(aufile, buf + offset*2, samples);
107 case FAAD_FMT_24BIT:
108 return write_audio_24bit(aufile, buf + offset*4, samples);
109 case FAAD_FMT_32BIT:
110 return write_audio_32bit(aufile, buf + offset*4, samples);
111 case FAAD_FMT_FLOAT:
112 return write_audio_float(aufile, buf + offset*4, samples);
113 default:
114 return 0;
115 }
116
117 return 0;
118 }
119
120 void close_audio_file(audio_file *aufile)
121 {
122 if (aufile->fileType == OUTPUT_WAV)
123 {
124 fseek(aufile->sndfile, 0, SEEK_SET);
125
126 if (aufile->channelMask)
127 write_wav_extensible_header(aufile, aufile->channelMask);
128 else
129 write_wav_header(aufile);
130 }
131
132 if (aufile->toStdio == 0)
133 fclose(aufile->sndfile);
134
135 if (aufile) free(aufile);
136 }
137
138 static int write_wav_header(audio_file *aufile)
139 {
140 unsigned char header[44];
141 unsigned char* p = header;
142 unsigned int bytes = (aufile->bits_per_sample + 7) / 8;
143 float data_size = (float)bytes * aufile->total_samples;
144 unsigned long word32;
145
146 *p++ = 'R'; *p++ = 'I'; *p++ = 'F'; *p++ = 'F';
147
148 word32 = (data_size + (44 - 8) < (float)MAXWAVESIZE) ?
149 (unsigned long)data_size + (44 - 8) : (unsigned long)MAXWAVESIZE;
150 *p++ = (unsigned char)(word32 >> 0);
151 *p++ = (unsigned char)(word32 >> 8);
152 *p++ = (unsigned char)(word32 >> 16);
153 *p++ = (unsigned char)(word32 >> 24);
154
155 *p++ = 'W'; *p++ = 'A'; *p++ = 'V'; *p++ = 'E';
156
157 *p++ = 'f'; *p++ = 'm'; *p++ = 't'; *p++ = ' ';
158
159 *p++ = 0x10; *p++ = 0x00; *p++ = 0x00; *p++ = 0x00;
160
161 if (aufile->outputFormat == FAAD_FMT_FLOAT)
162 {
163 *p++ = 0x03; *p++ = 0x00;
164 } else {
165 *p++ = 0x01; *p++ = 0x00;
166 }
167
168 *p++ = (unsigned char)(aufile->channels >> 0);
169 *p++ = (unsigned char)(aufile->channels >> 8);
170
171 word32 = (unsigned long)(aufile->samplerate + 0.5);
172 *p++ = (unsigned char)(word32 >> 0);
173 *p++ = (unsigned char)(word32 >> 8);
174 *p++ = (unsigned char)(word32 >> 16);
175 *p++ = (unsigned char)(word32 >> 24);
176
177 word32 = aufile->samplerate * bytes * aufile->channels;
178 *p++ = (unsigned char)(word32 >> 0);
179 *p++ = (unsigned char)(word32 >> 8);
180 *p++ = (unsigned char)(word32 >> 16);
181 *p++ = (unsigned char)(word32 >> 24);
182
183 word32 = bytes * aufile->channels;
184 *p++ = (unsigned char)(word32 >> 0);
185 *p++ = (unsigned char)(word32 >> 8);
186
187 *p++ = (unsigned char)(aufile->bits_per_sample >> 0);
188 *p++ = (unsigned char)(aufile->bits_per_sample >> 8);
189
190 *p++ = 'd'; *p++ = 'a'; *p++ = 't'; *p++ = 'a';
191
192 word32 = data_size < MAXWAVESIZE ?
193 (unsigned long)data_size : (unsigned long)MAXWAVESIZE;
194 *p++ = (unsigned char)(word32 >> 0);
195 *p++ = (unsigned char)(word32 >> 8);
196 *p++ = (unsigned char)(word32 >> 16);
197 *p++ = (unsigned char)(word32 >> 24);
198
199 return fwrite(header, sizeof(header), 1, aufile->sndfile);
200 }
201
202 static int write_wav_extensible_header(audio_file *aufile, long channelMask)
203 {
204 unsigned char header[68];
205 unsigned char* p = header;
206 unsigned int bytes = (aufile->bits_per_sample + 7) / 8;
207 float data_size = (float)bytes * aufile->total_samples;
208 unsigned long word32;
209
210 *p++ = 'R'; *p++ = 'I'; *p++ = 'F'; *p++ = 'F';
211
212 word32 = (data_size + (68 - 8) < (float)MAXWAVESIZE) ?
213 (unsigned long)data_size + (68 - 8) : (unsigned long)MAXWAVESIZE;
214 *p++ = (unsigned char)(word32 >> 0);
215 *p++ = (unsigned char)(word32 >> 8);
216 *p++ = (unsigned char)(word32 >> 16);
217 *p++ = (unsigned char)(word32 >> 24);
218
219 *p++ = 'W'; *p++ = 'A'; *p++ = 'V'; *p++ = 'E';
220
221 *p++ = 'f'; *p++ = 'm'; *p++ = 't'; *p++ = ' ';
222
223 *p++ = /*0x10*/0x28; *p++ = 0x00; *p++ = 0x00; *p++ = 0x00;
224
225 /* WAVE_FORMAT_EXTENSIBLE */
226 *p++ = 0xFE; *p++ = 0xFF;
227
228 *p++ = (unsigned char)(aufile->channels >> 0);
229 *p++ = (unsigned char)(aufile->channels >> 8);
230
231 word32 = (unsigned long)(aufile->samplerate + 0.5);
232 *p++ = (unsigned char)(word32 >> 0);
233 *p++ = (unsigned char)(word32 >> 8);
234 *p++ = (unsigned char)(word32 >> 16);
235 *p++ = (unsigned char)(word32 >> 24);
236
237 word32 = aufile->samplerate * bytes * aufile->channels;
238 *p++ = (unsigned char)(word32 >> 0);
239 *p++ = (unsigned char)(word32 >> 8);
240 *p++ = (unsigned char)(word32 >> 16);
241 *p++ = (unsigned char)(word32 >> 24);
242
243 word32 = bytes * aufile->channels;
244 *p++ = (unsigned char)(word32 >> 0);
245 *p++ = (unsigned char)(word32 >> 8);
246
247 *p++ = (unsigned char)(aufile->bits_per_sample >> 0);
248 *p++ = (unsigned char)(aufile->bits_per_sample >> 8);
249
250 /* cbSize */
251 *p++ = (unsigned char)(22);
252 *p++ = (unsigned char)(0);
253
254 /* WAVEFORMATEXTENSIBLE */
255
256 /* wValidBitsPerSample */
257 *p++ = (unsigned char)(aufile->bits_per_sample >> 0);
258 *p++ = (unsigned char)(aufile->bits_per_sample >> 8);
259
260 /* dwChannelMask */
261 word32 = channelMask;
262 *p++ = (unsigned char)(word32 >> 0);
263 *p++ = (unsigned char)(word32 >> 8);
264 *p++ = (unsigned char)(word32 >> 16);
265 *p++ = (unsigned char)(word32 >> 24);
266
267 /* SubFormat */
268 if (aufile->outputFormat == FAAD_FMT_FLOAT)
269 {
270 /* KSDATAFORMAT_SUBTYPE_IEEE_FLOAT: 00000003-0000-0010-8000-00aa00389b71 */
271 *p++ = 0x03;
272 *p++ = 0x00;
273 *p++ = 0x00;
274 *p++ = 0x00;
275 *p++ = 0x00; *p++ = 0x00; *p++ = 0x10; *p++ = 0x00; *p++ = 0x80; *p++ = 0x00;
276 *p++ = 0x00; *p++ = 0xaa; *p++ = 0x00; *p++ = 0x38; *p++ = 0x9b; *p++ = 0x71;
277 } else {
278 /* KSDATAFORMAT_SUBTYPE_PCM: 00000001-0000-0010-8000-00aa00389b71 */
279 *p++ = 0x01;
280 *p++ = 0x00;
281 *p++ = 0x00;
282 *p++ = 0x00;
283 *p++ = 0x00; *p++ = 0x00; *p++ = 0x10; *p++ = 0x00; *p++ = 0x80; *p++ = 0x00;
284 *p++ = 0x00; *p++ = 0xaa; *p++ = 0x00; *p++ = 0x38; *p++ = 0x9b; *p++ = 0x71;
285 }
286
287 /* end WAVEFORMATEXTENSIBLE */
288
289 *p++ = 'd'; *p++ = 'a'; *p++ = 't'; *p++ = 'a';
290
291 word32 = data_size < MAXWAVESIZE ?
292 (unsigned long)data_size : (unsigned long)MAXWAVESIZE;
293 *p++ = (unsigned char)(word32 >> 0);
294 *p++ = (unsigned char)(word32 >> 8);
295 *p++ = (unsigned char)(word32 >> 16);
296 *p++ = (unsigned char)(word32 >> 24);
297
298 return fwrite(header, sizeof(header), 1, aufile->sndfile);
299 }
300
301 static int write_audio_16bit(audio_file *aufile, void *sample_buffer,
302 unsigned int samples)
303 {
304 int ret;
305 unsigned int i;
306 short *sample_buffer16 = (short*)sample_buffer;
307 char *data = malloc(samples*aufile->bits_per_sample*sizeof(char)/8);
308
309 aufile->total_samples += samples;
310
311 if (aufile->channels == 6 && aufile->channelMask)
312 {
313 for (i = 0; i < samples; i += aufile->channels)
314 {
315 short r1, r2, r3, r4, r5, r6;
316 r1 = sample_buffer16[i];
317 r2 = sample_buffer16[i+1];
318 r3 = sample_buffer16[i+2];
319 r4 = sample_buffer16[i+3];
320 r5 = sample_buffer16[i+4];
321 r6 = sample_buffer16[i+5];
322 sample_buffer16[i] = r2;
323 sample_buffer16[i+1] = r3;
324 sample_buffer16[i+2] = r1;
325 sample_buffer16[i+3] = r6;
326 sample_buffer16[i+4] = r4;
327 sample_buffer16[i+5] = r5;
328 }
329 }
330
331 for (i = 0; i < samples; i++)
332 {
333 data[i*2] = (char)(sample_buffer16[i] & 0xFF);
334 data[i*2+1] = (char)((sample_buffer16[i] >> 8) & 0xFF);
335 }
336
337 ret = fwrite(data, samples, aufile->bits_per_sample/8, aufile->sndfile);
338
339 if (data) free(data);
340
341 return ret;
342 }
343
344 static int write_audio_24bit(audio_file *aufile, void *sample_buffer,
345 unsigned int samples)
346 {
347 int ret;
348 unsigned int i;
349 long *sample_buffer24 = (long*)sample_buffer;
350 char *data = malloc(samples*aufile->bits_per_sample*sizeof(char)/8);
351
352 aufile->total_samples += samples;
353
354 if (aufile->channels == 6 && aufile->channelMask)
355 {
356 for (i = 0; i < samples; i += aufile->channels)
357 {
358 long r1, r2, r3, r4, r5, r6;
359 r1 = sample_buffer24[i];
360 r2 = sample_buffer24[i+1];
361 r3 = sample_buffer24[i+2];
362 r4 = sample_buffer24[i+3];
363 r5 = sample_buffer24[i+4];
364 r6 = sample_buffer24[i+5];
365 sample_buffer24[i] = r2;
366 sample_buffer24[i+1] = r3;
367 sample_buffer24[i+2] = r1;
368 sample_buffer24[i+3] = r6;
369 sample_buffer24[i+4] = r4;
370 sample_buffer24[i+5] = r5;
371 }
372 }
373
374 for (i = 0; i < samples; i++)
375 {
376 data[i*3] = (char)(sample_buffer24[i] & 0xFF);
377 data[i*3+1] = (char)((sample_buffer24[i] >> 8) & 0xFF);
378 data[i*3+2] = (char)((sample_buffer24[i] >> 16) & 0xFF);
379 }
380
381 ret = fwrite(data, samples, aufile->bits_per_sample/8, aufile->sndfile);
382
383 if (data) free(data);
384
385 return ret;
386 }
387
388 static int write_audio_32bit(audio_file *aufile, void *sample_buffer,
389 unsigned int samples)
390 {
391 int ret;
392 unsigned int i;
393 long *sample_buffer32 = (long*)sample_buffer;
394 char *data = malloc(samples*aufile->bits_per_sample*sizeof(char)/8);
395
396 aufile->total_samples += samples;
397
398 if (aufile->channels == 6 && aufile->channelMask)
399 {
400 for (i = 0; i < samples; i += aufile->channels)
401 {
402 long r1, r2, r3, r4, r5, r6;
403 r1 = sample_buffer32[i];
404 r2 = sample_buffer32[i+1];
405 r3 = sample_buffer32[i+2];
406 r4 = sample_buffer32[i+3];
407 r5 = sample_buffer32[i+4];
408 r6 = sample_buffer32[i+5];
409 sample_buffer32[i] = r2;
410 sample_buffer32[i+1] = r3;
411 sample_buffer32[i+2] = r1;
412 sample_buffer32[i+3] = r6;
413 sample_buffer32[i+4] = r4;
414 sample_buffer32[i+5] = r5;
415 }
416 }
417
418 for (i = 0; i < samples; i++)
419 {
420 data[i*4] = (char)(sample_buffer32[i] & 0xFF);
421 data[i*4+1] = (char)((sample_buffer32[i] >> 8) & 0xFF);
422 data[i*4+2] = (char)((sample_buffer32[i] >> 16) & 0xFF);
423 data[i*4+3] = (char)((sample_buffer32[i] >> 24) & 0xFF);
424 }
425
426 ret = fwrite(data, samples, aufile->bits_per_sample/8, aufile->sndfile);
427
428 if (data) free(data);
429
430 return ret;
431 }
432
433 static int write_audio_float(audio_file *aufile, void *sample_buffer,
434 unsigned int samples)
435 {
436 int ret;
437 unsigned int i;
438 float *sample_buffer_f = (float*)sample_buffer;
439 unsigned char *data = malloc(samples*aufile->bits_per_sample*sizeof(char)/8);
440
441 aufile->total_samples += samples;
442
443 if (aufile->channels == 6 && aufile->channelMask)
444 {
445 for (i = 0; i < samples; i += aufile->channels)
446 {
447 float r1, r2, r3, r4, r5, r6;
448 r1 = sample_buffer_f[i];
449 r2 = sample_buffer_f[i+1];
450 r3 = sample_buffer_f[i+2];
451 r4 = sample_buffer_f[i+3];
452 r5 = sample_buffer_f[i+4];
453 r6 = sample_buffer_f[i+5];
454 sample_buffer_f[i] = r2;
455 sample_buffer_f[i+1] = r3;
456 sample_buffer_f[i+2] = r1;
457 sample_buffer_f[i+3] = r6;
458 sample_buffer_f[i+4] = r4;
459 sample_buffer_f[i+5] = r5;
460 }
461 }
462
463 for (i = 0; i < samples; i++)
464 {
465 int exponent, mantissa, negative = 0 ;
466 float in = sample_buffer_f[i];
467
468 data[i*4] = 0; data[i*4+1] = 0; data[i*4+2] = 0; data[i*4+3] = 0;
469 if (in == 0.0)
470 continue;
471
472 if (in < 0.0)
473 {
474 in *= -1.0;
475 negative = 1;
476 }
477 in = (float)frexp(in, &exponent);
478 exponent += 126;
479 in *= (float)0x1000000;
480 mantissa = (((int)in) & 0x7FFFFF);
481
482 if (negative)
483 data[i*4+3] |= 0x80;
484
485 if (exponent & 0x01)
486 data[i*4+2] |= 0x80;
487
488 data[i*4] = mantissa & 0xFF;
489 data[i*4+1] = (mantissa >> 8) & 0xFF;
490 data[i*4+2] |= (mantissa >> 16) & 0x7F;
491 data[i*4+3] |= (exponent >> 1) & 0x7F;
492 }
493
494 ret = fwrite(data, samples, aufile->bits_per_sample/8, aufile->sndfile);
495
496 if (data) free(data);
497
498 return ret;
499 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: audio.h,v 1.19 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 #ifndef AUDIO_H_INCLUDED
31 #define AUDIO_H_INCLUDED
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #define MAXWAVESIZE 4294967040LU
38
39 #define OUTPUT_WAV 1
40 #define OUTPUT_RAW 2
41
42 typedef struct
43 {
44 int toStdio;
45 int outputFormat;
46 FILE *sndfile;
47 unsigned int fileType;
48 unsigned long samplerate;
49 unsigned int bits_per_sample;
50 unsigned int channels;
51 unsigned long total_samples;
52 long channelMask;
53 } audio_file;
54
55 audio_file *open_audio_file(char *infile, int samplerate, int channels,
56 int outputFormat, int fileType, long channelMask);
57 int write_audio_file(audio_file *aufile, void *sample_buffer, int samples, int offset);
58 void close_audio_file(audio_file *aufile);
59 static int write_wav_header(audio_file *aufile);
60 static int write_wav_extensible_header(audio_file *aufile, long channelMask);
61 static int write_audio_16bit(audio_file *aufile, void *sample_buffer,
62 unsigned int samples);
63 static int write_audio_24bit(audio_file *aufile, void *sample_buffer,
64 unsigned int samples);
65 static int write_audio_32bit(audio_file *aufile, void *sample_buffer,
66 unsigned int samples);
67 static int write_audio_float(audio_file *aufile, void *sample_buffer,
68 unsigned int samples);
69
70
71 #ifdef __cplusplus
72 }
73 #endif
74 #endif
0 # Microsoft Developer Studio Project File - Name="faad" - Package Owner=<4>
1 # Microsoft Developer Studio Generated Build File, Format Version 6.00
2 # ** DO NOT EDIT **
3
4 # TARGTYPE "Win32 (x86) Console Application" 0x0103
5
6 CFG=faad - Win32 Debug
7 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
8 !MESSAGE use the Export Makefile command and run
9 !MESSAGE
10 !MESSAGE NMAKE /f "faad.mak".
11 !MESSAGE
12 !MESSAGE You can specify a configuration when running NMAKE
13 !MESSAGE by defining the macro CFG on the command line. For example:
14 !MESSAGE
15 !MESSAGE NMAKE /f "faad.mak" CFG="faad - Win32 Debug"
16 !MESSAGE
17 !MESSAGE Possible choices for configuration are:
18 !MESSAGE
19 !MESSAGE "faad - Win32 Release" (based on "Win32 (x86) Console Application")
20 !MESSAGE "faad - Win32 Debug" (based on "Win32 (x86) Console Application")
21 !MESSAGE
22
23 # Begin Project
24 # PROP AllowPerConfigDependencies 0
25 # PROP Scc_ProjName ""
26 # PROP Scc_LocalPath ""
27 CPP=xicl6.exe
28 RSC=rc.exe
29
30 !IF "$(CFG)" == "faad - Win32 Release"
31
32 # PROP BASE Use_MFC 0
33 # PROP BASE Use_Debug_Libraries 0
34 # PROP BASE Output_Dir "Release"
35 # PROP BASE Intermediate_Dir "Release"
36 # PROP BASE Target_Dir ""
37 # PROP Use_MFC 0
38 # PROP Use_Debug_Libraries 0
39 # PROP Output_Dir "Release"
40 # PROP Intermediate_Dir "Release"
41 # PROP Ignore_Export_Lib 0
42 # PROP Target_Dir ""
43 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
44 # ADD CPP /nologo /MD /W3 /I "../include" /I "../common/mp4ff" /I "../common/faad" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
45 # ADD BASE RSC /l 0x413 /d "NDEBUG"
46 # ADD RSC /l 0x413 /d "NDEBUG"
47 BSC32=bscmake.exe
48 # ADD BASE BSC32 /nologo
49 # ADD BSC32 /nologo
50 LINK32=xilink6.exe
51 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
52 # ADD LINK32 Advapi32.lib /nologo /subsystem:console /machine:I386
53 # SUBTRACT LINK32 /profile
54
55 !ELSEIF "$(CFG)" == "faad - Win32 Debug"
56
57 # PROP BASE Use_MFC 0
58 # PROP BASE Use_Debug_Libraries 1
59 # PROP BASE Output_Dir "Debug"
60 # PROP BASE Intermediate_Dir "Debug"
61 # PROP BASE Target_Dir ""
62 # PROP Use_MFC 0
63 # PROP Use_Debug_Libraries 1
64 # PROP Output_Dir "Debug"
65 # PROP Intermediate_Dir "Debug"
66 # PROP Ignore_Export_Lib 0
67 # PROP Target_Dir ""
68 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
69 # ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "../include" /I "../common/mp4ff" /I "../common/faad" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
70 # ADD BASE RSC /l 0x413 /d "_DEBUG"
71 # ADD RSC /l 0x413 /d "_DEBUG"
72 BSC32=bscmake.exe
73 # ADD BASE BSC32 /nologo
74 # ADD BSC32 /nologo
75 LINK32=xilink6.exe
76 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
77 # ADD LINK32 Advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
78
79 !ENDIF
80
81 # Begin Target
82
83 # Name "faad - Win32 Release"
84 # Name "faad - Win32 Debug"
85 # Begin Group "Source Files"
86
87 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
88 # Begin Source File
89
90 SOURCE=.\audio.c
91 # End Source File
92 # Begin Source File
93
94 SOURCE=..\common\faad\getopt.c
95 # End Source File
96 # Begin Source File
97
98 SOURCE=.\main.c
99 # End Source File
100 # End Group
101 # Begin Group "Header Files"
102
103 # PROP Default_Filter "h;hpp;hxx;hm;inl"
104 # Begin Source File
105
106 SOURCE=.\audio.h
107 # End Source File
108 # Begin Source File
109
110 SOURCE=..\common\faad\getopt.h
111 # End Source File
112 # Begin Source File
113
114 SOURCE=..\common\mp4ff\mp4ff.h
115 # End Source File
116 # Begin Source File
117
118 SOURCE=..\common\mp4ff\mp4ff_int_types.h
119 # End Source File
120 # Begin Source File
121
122 SOURCE=..\include\neaacdec.h
123 # End Source File
124 # End Group
125 # End Target
126 # End Project
0 Microsoft Developer Studio Workspace File, Format Version 6.00
1 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
2
3 ###############################################################################
4
5 Project: "faad"=.\faad.dsp - Package Owner=<4>
6
7 Package=<5>
8 {{{
9 }}}
10
11 Package=<4>
12 {{{
13 Begin Project Dependency
14 Project_Dep_Name libfaad
15 End Project Dependency
16 Begin Project Dependency
17 Project_Dep_Name mp4ff
18 End Project Dependency
19 }}}
20
21 ###############################################################################
22
23 Project: "libfaad"=..\libfaad\libfaad.dsp - Package Owner=<4>
24
25 Package=<5>
26 {{{
27 }}}
28
29 Package=<4>
30 {{{
31 }}}
32
33 ###############################################################################
34
35 Project: "mp4ff"=..\common\mp4ff\mp4ff.dsp - Package Owner=<4>
36
37 Package=<5>
38 {{{
39 }}}
40
41 Package=<4>
42 {{{
43 }}}
44
45 ###############################################################################
46
47 Global:
48
49 Package=<5>
50 {{{
51 }}}
52
53 Package=<3>
54 {{{
55 }}}
56
57 ###############################################################################
58
0 Microsoft Visual Studio Solution File, Format Version 9.00
1 # Visual C++ Express 2005
2 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "faad", "faad.vcproj", "{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}"
3 ProjectSection(ProjectDependencies) = postProject
4 {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114} = {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}
5 {F470BB4A-7675-4D6A-B310-41F33AC6F987} = {F470BB4A-7675-4D6A-B310-41F33AC6F987}
6 EndProjectSection
7 EndProject
8 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "..\libfaad\libfaad.vcproj", "{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}"
9 EndProject
10 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mp4ff", "..\common\mp4ff\mp4ff.vcproj", "{F470BB4A-7675-4D6A-B310-41F33AC6F987}"
11 EndProject
12 Global
13 GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 Debug|Win32 = Debug|Win32
15 Release|Win32 = Release|Win32
16 EndGlobalSection
17 GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|Win32.ActiveCfg = Debug|Win32
19 {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|Win32.Build.0 = Debug|Win32
20 {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|Win32.ActiveCfg = Release|Win32
21 {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|Win32.Build.0 = Release|Win32
22 {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|Win32.ActiveCfg = Debug|Win32
23 {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|Win32.Build.0 = Debug|Win32
24 {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|Win32.ActiveCfg = Release|Win32
25 {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|Win32.Build.0 = Release|Win32
26 {F470BB4A-7675-4D6A-B310-41F33AC6F987}.Debug|Win32.ActiveCfg = Debug|Win32
27 {F470BB4A-7675-4D6A-B310-41F33AC6F987}.Debug|Win32.Build.0 = Debug|Win32
28 {F470BB4A-7675-4D6A-B310-41F33AC6F987}.Release|Win32.ActiveCfg = Release|Win32
29 {F470BB4A-7675-4D6A-B310-41F33AC6F987}.Release|Win32.Build.0 = Release|Win32
30 EndGlobalSection
31 GlobalSection(SolutionProperties) = preSolution
32 HideSolutionNode = FALSE
33 EndGlobalSection
34 EndGlobal
0 <?xml version="1.0" encoding="Windows-1252"?>
1 <VisualStudioProject
2 ProjectType="Visual C++"
3 Version="8,00"
4 Name="faad"
5 ProjectGUID="{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}"
6 >
7 <Platforms>
8 <Platform
9 Name="Win32"
10 />
11 </Platforms>
12 <ToolFiles>
13 </ToolFiles>
14 <Configurations>
15 <Configuration
16 Name="Debug|Win32"
17 OutputDirectory=".\Debug"
18 IntermediateDirectory=".\Debug"
19 ConfigurationType="1"
20 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
21 UseOfMFC="0"
22 ATLMinimizesCRunTimeLibraryUsage="false"
23 CharacterSet="2"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 TypeLibraryName=".\Debug/faad.tlb"
40 />
41 <Tool
42 Name="VCCLCompilerTool"
43 AdditionalOptions=""
44 Optimization="0"
45 AdditionalIncludeDirectories="../include,../common/mp4ff,../common/faad"
46 PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE"
47 BasicRuntimeChecks="3"
48 RuntimeLibrary="3"
49 UsePrecompiledHeader="0"
50 PrecompiledHeaderFile=".\Debug/faad.pch"
51 AssemblerListingLocation=".\Debug/"
52 ObjectFile=".\Debug/"
53 ProgramDataBaseFileName=".\Debug/"
54 WarningLevel="3"
55 SuppressStartupBanner="true"
56 DebugInformationFormat="4"
57 CompileAs="0"
58 />
59 <Tool
60 Name="VCManagedResourceCompilerTool"
61 />
62 <Tool
63 Name="VCResourceCompilerTool"
64 PreprocessorDefinitions="_DEBUG"
65 Culture="1043"
66 />
67 <Tool
68 Name="VCPreLinkEventTool"
69 />
70 <Tool
71 Name="VCLinkerTool"
72 AdditionalOptions="/MACHINE:I386"
73 AdditionalDependencies="ws2_32.lib odbc32.lib odbccp32.lib Advapi32.lib"
74 OutputFile=".\Debug/faad.exe"
75 LinkIncremental="2"
76 SuppressStartupBanner="true"
77 GenerateDebugInformation="true"
78 ProgramDatabaseFile=".\Debug/faad.pdb"
79 SubSystem="1"
80 />
81 <Tool
82 Name="VCALinkTool"
83 />
84 <Tool
85 Name="VCManifestTool"
86 />
87 <Tool
88 Name="VCXDCMakeTool"
89 />
90 <Tool
91 Name="VCBscMakeTool"
92 />
93 <Tool
94 Name="VCFxCopTool"
95 />
96 <Tool
97 Name="VCAppVerifierTool"
98 />
99 <Tool
100 Name="VCWebDeploymentTool"
101 />
102 <Tool
103 Name="VCPostBuildEventTool"
104 />
105 </Configuration>
106 <Configuration
107 Name="Release|Win32"
108 OutputDirectory=".\Release"
109 IntermediateDirectory=".\Release"
110 ConfigurationType="1"
111 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
112 UseOfMFC="0"
113 ATLMinimizesCRunTimeLibraryUsage="false"
114 CharacterSet="2"
115 >
116 <Tool
117 Name="VCPreBuildEventTool"
118 />
119 <Tool
120 Name="VCCustomBuildTool"
121 />
122 <Tool
123 Name="VCXMLDataGeneratorTool"
124 />
125 <Tool
126 Name="VCWebServiceProxyGeneratorTool"
127 />
128 <Tool
129 Name="VCMIDLTool"
130 TypeLibraryName=".\Release/faad.tlb"
131 />
132 <Tool
133 Name="VCCLCompilerTool"
134 AdditionalOptions=""
135 Optimization="1"
136 InlineFunctionExpansion="1"
137 EnableIntrinsicFunctions="true"
138 FavorSizeOrSpeed="1"
139 AdditionalIncludeDirectories="../include,../common/mp4ff,../common/faad"
140 PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
141 StringPooling="true"
142 RuntimeLibrary="2"
143 EnableFunctionLevelLinking="true"
144 UsePrecompiledHeader="0"
145 PrecompiledHeaderFile=".\Release/faad.pch"
146 AssemblerListingLocation=".\Release/"
147 ObjectFile=".\Release/"
148 ProgramDataBaseFileName=".\Release/"
149 WarningLevel="3"
150 SuppressStartupBanner="true"
151 CompileAs="0"
152 />
153 <Tool
154 Name="VCManagedResourceCompilerTool"
155 />
156 <Tool
157 Name="VCResourceCompilerTool"
158 PreprocessorDefinitions="NDEBUG"
159 Culture="1043"
160 />
161 <Tool
162 Name="VCPreLinkEventTool"
163 />
164 <Tool
165 Name="VCLinkerTool"
166 AdditionalOptions="/MACHINE:I386"
167 AdditionalDependencies="ws2_32.lib Advapi32.lib"
168 OutputFile=".\Release/faad.exe"
169 LinkIncremental="1"
170 SuppressStartupBanner="true"
171 SubSystem="1"
172 />
173 <Tool
174 Name="VCALinkTool"
175 />
176 <Tool
177 Name="VCManifestTool"
178 />
179 <Tool
180 Name="VCXDCMakeTool"
181 />
182 <Tool
183 Name="VCBscMakeTool"
184 />
185 <Tool
186 Name="VCFxCopTool"
187 />
188 <Tool
189 Name="VCAppVerifierTool"
190 />
191 <Tool
192 Name="VCWebDeploymentTool"
193 />
194 <Tool
195 Name="VCPostBuildEventTool"
196 />
197 </Configuration>
198 </Configurations>
199 <References>
200 </References>
201 <Files>
202 <Filter
203 Name="Source Files"
204 Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
205 >
206 <File
207 RelativePath=".\audio.c"
208 >
209 </File>
210 <File
211 RelativePath="..\common\faad\getopt.c"
212 >
213 </File>
214 <File
215 RelativePath=".\main.c"
216 >
217 </File>
218 </Filter>
219 <Filter
220 Name="Header Files"
221 Filter="h;hpp;hxx;hm;inl"
222 >
223 <File
224 RelativePath=".\audio.h"
225 >
226 </File>
227 <File
228 RelativePath="..\include\faad.h"
229 >
230 </File>
231 <File
232 RelativePath="..\common\faad\getopt.h"
233 >
234 </File>
235 <File
236 RelativePath="..\common\mp4v2\mp4.h"
237 >
238 </File>
239 <File
240 RelativePath="..\common\mp4v2\mpeg4ip.h"
241 >
242 </File>
243 <File
244 RelativePath="..\common\mp4v2\systems.h"
245 >
246 </File>
247 <File
248 RelativePath="..\common\mp4v2\win32_ver.h"
249 >
250 </File>
251 </Filter>
252 </Files>
253 <Globals>
254 </Globals>
255 </VisualStudioProject>
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: main.c,v 1.81 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 #ifdef _WIN32
31 #define WIN32_LEAN_AND_MEAN
32 #include <windows.h>
33 #define off_t __int64
34 #else
35 #include <time.h>
36 #endif
37
38 #include <fcntl.h>
39 #include <stdio.h>
40 #include <stdarg.h>
41 #include <stdlib.h>
42 #include <getopt.h>
43
44 #include <neaacdec.h>
45 #include <mp4ff.h>
46
47 #include "audio.h"
48
49 #ifndef min
50 #define min(a,b) ( (a) < (b) ? (a) : (b) )
51 #endif
52
53 #define MAX_CHANNELS 6 /* make this higher to support files with
54 more channels */
55
56
57 static int quiet = 0;
58
59 void faad_fprintf(FILE *stream, const char *fmt, ...)
60 {
61 va_list ap;
62
63 if (!quiet)
64 {
65 va_start(ap, fmt);
66
67 vfprintf(stream, fmt, ap);
68
69 va_end(ap);
70 }
71 }
72
73 /* FAAD file buffering routines */
74 typedef struct {
75 long bytes_into_buffer;
76 long bytes_consumed;
77 long file_offset;
78 unsigned char *buffer;
79 int at_eof;
80 FILE *infile;
81 } aac_buffer;
82
83
84 int fill_buffer(aac_buffer *b)
85 {
86 int bread;
87
88 if (b->bytes_consumed > 0)
89 {
90 if (b->bytes_into_buffer)
91 {
92 memmove((void*)b->buffer, (void*)(b->buffer + b->bytes_consumed),
93 b->bytes_into_buffer*sizeof(unsigned char));
94 }
95
96 if (!b->at_eof)
97 {
98 bread = fread((void*)(b->buffer + b->bytes_into_buffer), 1,
99 b->bytes_consumed, b->infile);
100
101 if (bread != b->bytes_consumed)
102 b->at_eof = 1;
103
104 b->bytes_into_buffer += bread;
105 }
106
107 b->bytes_consumed = 0;
108
109 if (b->bytes_into_buffer > 3)
110 {
111 if (memcmp(b->buffer, "TAG", 3) == 0)
112 b->bytes_into_buffer = 0;
113 }
114 if (b->bytes_into_buffer > 11)
115 {
116 if (memcmp(b->buffer, "LYRICSBEGIN", 11) == 0)
117 b->bytes_into_buffer = 0;
118 }
119 if (b->bytes_into_buffer > 8)
120 {
121 if (memcmp(b->buffer, "APETAGEX", 8) == 0)
122 b->bytes_into_buffer = 0;
123 }
124 }
125
126 return 1;
127 }
128
129 void advance_buffer(aac_buffer *b, int bytes)
130 {
131 b->file_offset += bytes;
132 b->bytes_consumed = bytes;
133 b->bytes_into_buffer -= bytes;
134 }
135
136 static int adts_sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000,7350,0,0,0};
137
138 int adts_parse(aac_buffer *b, int *bitrate, float *length)
139 {
140 int frames, frame_length;
141 int t_framelength = 0;
142 int samplerate;
143 float frames_per_sec, bytes_per_frame;
144
145 /* Read all frames to ensure correct time and bitrate */
146 for (frames = 0; /* */; frames++)
147 {
148 fill_buffer(b);
149
150 if (b->bytes_into_buffer > 7)
151 {
152 /* check syncword */
153 if (!((b->buffer[0] == 0xFF)&&((b->buffer[1] & 0xF6) == 0xF0)))
154 break;
155
156 if (frames == 0)
157 samplerate = adts_sample_rates[(b->buffer[2]&0x3c)>>2];
158
159 frame_length = ((((unsigned int)b->buffer[3] & 0x3)) << 11)
160 | (((unsigned int)b->buffer[4]) << 3) | (b->buffer[5] >> 5);
161
162 t_framelength += frame_length;
163
164 if (frame_length > b->bytes_into_buffer)
165 break;
166
167 advance_buffer(b, frame_length);
168 } else {
169 break;
170 }
171 }
172
173 frames_per_sec = (float)samplerate/1024.0f;
174 if (frames != 0)
175 bytes_per_frame = (float)t_framelength/(float)(frames*1000);
176 else
177 bytes_per_frame = 0;
178 *bitrate = (int)(8. * bytes_per_frame * frames_per_sec + 0.5);
179 if (frames_per_sec != 0)
180 *length = (float)frames/frames_per_sec;
181 else
182 *length = 1;
183
184 return 1;
185 }
186
187
188
189 uint32_t read_callback(void *user_data, void *buffer, uint32_t length)
190 {
191 return fread(buffer, 1, length, (FILE*)user_data);
192 }
193
194 uint32_t seek_callback(void *user_data, uint64_t position)
195 {
196 return fseek((FILE*)user_data, position, SEEK_SET);
197 }
198
199 /* MicroSoft channel definitions */
200 #define SPEAKER_FRONT_LEFT 0x1
201 #define SPEAKER_FRONT_RIGHT 0x2
202 #define SPEAKER_FRONT_CENTER 0x4
203 #define SPEAKER_LOW_FREQUENCY 0x8
204 #define SPEAKER_BACK_LEFT 0x10
205 #define SPEAKER_BACK_RIGHT 0x20
206 #define SPEAKER_FRONT_LEFT_OF_CENTER 0x40
207 #define SPEAKER_FRONT_RIGHT_OF_CENTER 0x80
208 #define SPEAKER_BACK_CENTER 0x100
209 #define SPEAKER_SIDE_LEFT 0x200
210 #define SPEAKER_SIDE_RIGHT 0x400
211 #define SPEAKER_TOP_CENTER 0x800
212 #define SPEAKER_TOP_FRONT_LEFT 0x1000
213 #define SPEAKER_TOP_FRONT_CENTER 0x2000
214 #define SPEAKER_TOP_FRONT_RIGHT 0x4000
215 #define SPEAKER_TOP_BACK_LEFT 0x8000
216 #define SPEAKER_TOP_BACK_CENTER 0x10000
217 #define SPEAKER_TOP_BACK_RIGHT 0x20000
218 #define SPEAKER_RESERVED 0x80000000
219
220 long aacChannelConfig2wavexChannelMask(NeAACDecFrameInfo *hInfo)
221 {
222 if (hInfo->channels == 6 && hInfo->num_lfe_channels)
223 {
224 return SPEAKER_FRONT_LEFT + SPEAKER_FRONT_RIGHT +
225 SPEAKER_FRONT_CENTER + SPEAKER_LOW_FREQUENCY +
226 SPEAKER_BACK_LEFT + SPEAKER_BACK_RIGHT;
227 } else {
228 return 0;
229 }
230 }
231
232 char *position2string(int position)
233 {
234 switch (position)
235 {
236 case FRONT_CHANNEL_CENTER: return "Center front";
237 case FRONT_CHANNEL_LEFT: return "Left front";
238 case FRONT_CHANNEL_RIGHT: return "Right front";
239 case SIDE_CHANNEL_LEFT: return "Left side";
240 case SIDE_CHANNEL_RIGHT: return "Right side";
241 case BACK_CHANNEL_LEFT: return "Left back";
242 case BACK_CHANNEL_RIGHT: return "Right back";
243 case BACK_CHANNEL_CENTER: return "Center back";
244 case LFE_CHANNEL: return "LFE";
245 case UNKNOWN_CHANNEL: return "Unknown";
246 default: return "";
247 }
248
249 return "";
250 }
251
252 void print_channel_info(NeAACDecFrameInfo *frameInfo)
253 {
254 /* print some channel info */
255 int i;
256 long channelMask = aacChannelConfig2wavexChannelMask(frameInfo);
257
258 faad_fprintf(stderr, " ---------------------\n");
259 if (frameInfo->num_lfe_channels > 0)
260 {
261 faad_fprintf(stderr, " | Config: %2d.%d Ch |", frameInfo->channels-frameInfo->num_lfe_channels, frameInfo->num_lfe_channels);
262 } else {
263 faad_fprintf(stderr, " | Config: %2d Ch |", frameInfo->channels);
264 }
265 if (channelMask)
266 faad_fprintf(stderr, " WARNING: channels are reordered according to\n");
267 else
268 faad_fprintf(stderr, "\n");
269 faad_fprintf(stderr, " ---------------------");
270 if (channelMask)
271 faad_fprintf(stderr, " MS defaults defined in WAVE_FORMAT_EXTENSIBLE\n");
272 else
273 faad_fprintf(stderr, "\n");
274 faad_fprintf(stderr, " | Ch | Position |\n");
275 faad_fprintf(stderr, " ---------------------\n");
276 for (i = 0; i < frameInfo->channels; i++)
277 {
278 faad_fprintf(stderr, " | %.2d | %-14s |\n", i, position2string((int)frameInfo->channel_position[i]));
279 }
280 faad_fprintf(stderr, " ---------------------\n");
281 faad_fprintf(stderr, "\n");
282 }
283
284 int FindAdtsSRIndex(int sr)
285 {
286 int i;
287
288 for (i = 0; i < 16; i++)
289 {
290 if (sr == adts_sample_rates[i])
291 return i;
292 }
293 return 16 - 1;
294 }
295
296 unsigned char *MakeAdtsHeader(int *dataSize, NeAACDecFrameInfo *hInfo, int old_format)
297 {
298 unsigned char *data;
299 int profile = (hInfo->object_type - 1) & 0x3;
300 int sr_index = ((hInfo->sbr == SBR_UPSAMPLED) || (hInfo->sbr == NO_SBR_UPSAMPLED)) ?
301 FindAdtsSRIndex(hInfo->samplerate / 2) : FindAdtsSRIndex(hInfo->samplerate);
302 int skip = (old_format) ? 8 : 7;
303 int framesize = skip + hInfo->bytesconsumed;
304
305 if (hInfo->header_type == ADTS)
306 framesize -= skip;
307
308 *dataSize = 7;
309
310 data = malloc(*dataSize * sizeof(unsigned char));
311 memset(data, 0, *dataSize * sizeof(unsigned char));
312
313 data[0] += 0xFF; /* 8b: syncword */
314
315 data[1] += 0xF0; /* 4b: syncword */
316 /* 1b: mpeg id = 0 */
317 /* 2b: layer = 0 */
318 data[1] += 1; /* 1b: protection absent */
319
320 data[2] += ((profile << 6) & 0xC0); /* 2b: profile */
321 data[2] += ((sr_index << 2) & 0x3C); /* 4b: sampling_frequency_index */
322 /* 1b: private = 0 */
323 data[2] += ((hInfo->channels >> 2) & 0x1); /* 1b: channel_configuration */
324
325 data[3] += ((hInfo->channels << 6) & 0xC0); /* 2b: channel_configuration */
326 /* 1b: original */
327 /* 1b: home */
328 /* 1b: copyright_id */
329 /* 1b: copyright_id_start */
330 data[3] += ((framesize >> 11) & 0x3); /* 2b: aac_frame_length */
331
332 data[4] += ((framesize >> 3) & 0xFF); /* 8b: aac_frame_length */
333
334 data[5] += ((framesize << 5) & 0xE0); /* 3b: aac_frame_length */
335 data[5] += ((0x7FF >> 6) & 0x1F); /* 5b: adts_buffer_fullness */
336
337 data[6] += ((0x7FF << 2) & 0x3F); /* 6b: adts_buffer_fullness */
338 /* 2b: num_raw_data_blocks */
339
340 return data;
341 }
342
343 /* globals */
344 char *progName;
345
346 char *file_ext[] =
347 {
348 NULL,
349 ".wav",
350 ".aif",
351 ".au",
352 ".au",
353 ".pcm",
354 NULL
355 };
356
357 void usage(void)
358 {
359 faad_fprintf(stdout, "\nUsage:\n");
360 faad_fprintf(stdout, "%s [options] infile.aac\n", progName);
361 faad_fprintf(stdout, "Options:\n");
362 faad_fprintf(stdout, " -h Shows this help screen.\n");
363 faad_fprintf(stdout, " -i Shows info about the input file.\n");
364 faad_fprintf(stdout, " -a X Write MPEG-4 AAC ADTS output file.\n");
365 faad_fprintf(stdout, " -t Assume old ADTS format.\n");
366 faad_fprintf(stdout, " -o X Set output filename.\n");
367 faad_fprintf(stdout, " -f X Set output format. Valid values for X are:\n");
368 faad_fprintf(stdout, " 1: Microsoft WAV format (default).\n");
369 faad_fprintf(stdout, " 2: RAW PCM data.\n");
370 faad_fprintf(stdout, " -b X Set output sample format. Valid values for X are:\n");
371 faad_fprintf(stdout, " 1: 16 bit PCM data (default).\n");
372 faad_fprintf(stdout, " 2: 24 bit PCM data.\n");
373 faad_fprintf(stdout, " 3: 32 bit PCM data.\n");
374 faad_fprintf(stdout, " 4: 32 bit floating point data.\n");
375 faad_fprintf(stdout, " 5: 64 bit floating point data.\n");
376 faad_fprintf(stdout, " -s X Force the samplerate to X (for RAW files).\n");
377 faad_fprintf(stdout, " -l X Set object type. Supported object types:\n");
378 faad_fprintf(stdout, " 1: Main object type.\n");
379 faad_fprintf(stdout, " 2: LC (Low Complexity) object type.\n");
380 faad_fprintf(stdout, " 4: LTP (Long Term Prediction) object type.\n");
381 faad_fprintf(stdout, " 23: LD (Low Delay) object type.\n");
382 faad_fprintf(stdout, " -d Down matrix 5.1 to 2 channels\n");
383 faad_fprintf(stdout, " -w Write output to stdio instead of a file.\n");
384 faad_fprintf(stdout, " -g Disable gapless decoding.\n");
385 faad_fprintf(stdout, " -q Quiet - suppresses status messages.\n");
386 faad_fprintf(stdout, "Example:\n");
387 faad_fprintf(stdout, " %s infile.aac\n", progName);
388 faad_fprintf(stdout, " %s infile.mp4\n", progName);
389 faad_fprintf(stdout, " %s -o outfile.wav infile.aac\n", progName);
390 faad_fprintf(stdout, " %s -w infile.aac > outfile.wav\n", progName);
391 faad_fprintf(stdout, " %s -a outfile.aac infile.aac\n", progName);
392 return;
393 }
394
395 int decodeAACfile(char *aacfile, char *sndfile, char *adts_fn, int to_stdout,
396 int def_srate, int object_type, int outputFormat, int fileType,
397 int downMatrix, int infoOnly, int adts_out, int old_format,
398 float *song_length)
399 {
400 int tagsize;
401 unsigned long samplerate;
402 unsigned char channels;
403 void *sample_buffer;
404
405 audio_file *aufile;
406
407 FILE *adtsFile;
408 unsigned char *adtsData;
409 int adtsDataSize;
410
411 NeAACDecHandle hDecoder;
412 NeAACDecFrameInfo frameInfo;
413 NeAACDecConfigurationPtr config;
414
415 char percents[200];
416 int percent, old_percent = -1;
417 int bread, fileread;
418 int header_type = 0;
419 int bitrate = 0;
420 float length = 0;
421
422 int first_time = 1;
423
424 aac_buffer b;
425
426 memset(&b, 0, sizeof(aac_buffer));
427
428 if (adts_out)
429 {
430 adtsFile = fopen(adts_fn, "wb");
431 if (adtsFile == NULL)
432 {
433 faad_fprintf(stderr, "Error opening file: %s\n", adts_fn);
434 return 1;
435 }
436 }
437
438 b.infile = fopen(aacfile, "rb");
439 if (b.infile == NULL)
440 {
441 /* unable to open file */
442 faad_fprintf(stderr, "Error opening file: %s\n", aacfile);
443 return 1;
444 }
445
446 fseek(b.infile, 0, SEEK_END);
447 fileread = ftell(b.infile);
448 fseek(b.infile, 0, SEEK_SET);
449
450 if (!(b.buffer = (unsigned char*)malloc(FAAD_MIN_STREAMSIZE*MAX_CHANNELS)))
451 {
452 faad_fprintf(stderr, "Memory allocation error\n");
453 return 0;
454 }
455 memset(b.buffer, 0, FAAD_MIN_STREAMSIZE*MAX_CHANNELS);
456
457 bread = fread(b.buffer, 1, FAAD_MIN_STREAMSIZE*MAX_CHANNELS, b.infile);
458 b.bytes_into_buffer = bread;
459 b.bytes_consumed = 0;
460 b.file_offset = 0;
461
462 if (bread != FAAD_MIN_STREAMSIZE*MAX_CHANNELS)
463 b.at_eof = 1;
464
465 tagsize = 0;
466 if (!memcmp(b.buffer, "ID3", 3))
467 {
468 /* high bit is not used */
469 tagsize = (b.buffer[6] << 21) | (b.buffer[7] << 14) |
470 (b.buffer[8] << 7) | (b.buffer[9] << 0);
471
472 tagsize += 10;
473 advance_buffer(&b, tagsize);
474 fill_buffer(&b);
475 }
476
477 hDecoder = NeAACDecOpen();
478
479 /* Set the default object type and samplerate */
480 /* This is useful for RAW AAC files */
481 config = NeAACDecGetCurrentConfiguration(hDecoder);
482 if (def_srate)
483 config->defSampleRate = def_srate;
484 config->defObjectType = object_type;
485 config->outputFormat = outputFormat;
486 config->downMatrix = downMatrix;
487 config->useOldADTSFormat = old_format;
488 //config->dontUpSampleImplicitSBR = 1;
489 NeAACDecSetConfiguration(hDecoder, config);
490
491 /* get AAC infos for printing */
492 header_type = 0;
493 if ((b.buffer[0] == 0xFF) && ((b.buffer[1] & 0xF6) == 0xF0))
494 {
495 adts_parse(&b, &bitrate, &length);
496 fseek(b.infile, tagsize, SEEK_SET);
497
498 bread = fread(b.buffer, 1, FAAD_MIN_STREAMSIZE*MAX_CHANNELS, b.infile);
499 if (bread != FAAD_MIN_STREAMSIZE*MAX_CHANNELS)
500 b.at_eof = 1;
501 else
502 b.at_eof = 0;
503 b.bytes_into_buffer = bread;
504 b.bytes_consumed = 0;
505 b.file_offset = tagsize;
506
507 header_type = 1;
508 } else if (memcmp(b.buffer, "ADIF", 4) == 0) {
509 int skip_size = (b.buffer[4] & 0x80) ? 9 : 0;
510 bitrate = ((unsigned int)(b.buffer[4 + skip_size] & 0x0F)<<19) |
511 ((unsigned int)b.buffer[5 + skip_size]<<11) |
512 ((unsigned int)b.buffer[6 + skip_size]<<3) |
513 ((unsigned int)b.buffer[7 + skip_size] & 0xE0);
514
515 length = (float)fileread;
516 if (length != 0)
517 {
518 length = ((float)length*8.f)/((float)bitrate) + 0.5f;
519 }
520
521 bitrate = (int)((float)bitrate/1000.0f + 0.5f);
522
523 header_type = 2;
524 }
525
526 *song_length = length;
527
528 fill_buffer(&b);
529 if ((bread = NeAACDecInit(hDecoder, b.buffer,
530 b.bytes_into_buffer, &samplerate, &channels)) < 0)
531 {
532 /* If some error initializing occured, skip the file */
533 faad_fprintf(stderr, "Error initializing decoder library.\n");
534 if (b.buffer)
535 free(b.buffer);
536 NeAACDecClose(hDecoder);
537 fclose(b.infile);
538 return 1;
539 }
540 advance_buffer(&b, bread);
541 fill_buffer(&b);
542
543 /* print AAC file info */
544 faad_fprintf(stderr, "%s file info:\n", aacfile);
545 switch (header_type)
546 {
547 case 0:
548 faad_fprintf(stderr, "RAW\n\n");
549 break;
550 case 1:
551 faad_fprintf(stderr, "ADTS, %.3f sec, %d kbps, %d Hz\n\n",
552 length, bitrate, samplerate);
553 break;
554 case 2:
555 faad_fprintf(stderr, "ADIF, %.3f sec, %d kbps, %d Hz\n\n",
556 length, bitrate, samplerate);
557 break;
558 }
559
560 if (infoOnly)
561 {
562 NeAACDecClose(hDecoder);
563 fclose(b.infile);
564 if (b.buffer)
565 free(b.buffer);
566 return 0;
567 }
568
569 do
570 {
571 sample_buffer = NeAACDecDecode(hDecoder, &frameInfo,
572 b.buffer, b.bytes_into_buffer);
573
574 if (adts_out == 1)
575 {
576 int skip = (old_format) ? 8 : 7;
577 adtsData = MakeAdtsHeader(&adtsDataSize, &frameInfo, old_format);
578
579 /* write the adts header */
580 fwrite(adtsData, 1, adtsDataSize, adtsFile);
581
582 /* write the frame data */
583 if (frameInfo.header_type == ADTS)
584 fwrite(b.buffer + skip, 1, frameInfo.bytesconsumed - skip, adtsFile);
585 else
586 fwrite(b.buffer, 1, frameInfo.bytesconsumed, adtsFile);
587 }
588
589 /* update buffer indices */
590 advance_buffer(&b, frameInfo.bytesconsumed);
591
592 if (frameInfo.error > 0)
593 {
594 faad_fprintf(stderr, "Error: %s\n",
595 NeAACDecGetErrorMessage(frameInfo.error));
596 }
597
598 /* open the sound file now that the number of channels are known */
599 if (first_time && !frameInfo.error)
600 {
601 /* print some channel info */
602 print_channel_info(&frameInfo);
603
604 if (!adts_out)
605 {
606 /* open output file */
607 if (!to_stdout)
608 {
609 aufile = open_audio_file(sndfile, frameInfo.samplerate, frameInfo.channels,
610 outputFormat, fileType, aacChannelConfig2wavexChannelMask(&frameInfo));
611 } else {
612 aufile = open_audio_file("-", frameInfo.samplerate, frameInfo.channels,
613 outputFormat, fileType, aacChannelConfig2wavexChannelMask(&frameInfo));
614 }
615 if (aufile == NULL)
616 {
617 if (b.buffer)
618 free(b.buffer);
619 NeAACDecClose(hDecoder);
620 fclose(b.infile);
621 return 0;
622 }
623 } else {
624 faad_fprintf(stderr, "Writing output MPEG-4 AAC ADTS file.\n\n");
625 }
626 first_time = 0;
627 }
628
629 percent = min((int)(b.file_offset*100)/fileread, 100);
630 if (percent > old_percent)
631 {
632 old_percent = percent;
633 sprintf(percents, "%d%% decoding %s.", percent, aacfile);
634 faad_fprintf(stderr, "%s\r", percents);
635 #ifdef _WIN32
636 SetConsoleTitle(percents);
637 #endif
638 }
639
640 if ((frameInfo.error == 0) && (frameInfo.samples > 0) && (!adts_out))
641 {
642 write_audio_file(aufile, sample_buffer, frameInfo.samples, 0);
643 }
644
645 /* fill buffer */
646 fill_buffer(&b);
647
648 if (b.bytes_into_buffer == 0)
649 sample_buffer = NULL; /* to make sure it stops now */
650
651 } while (sample_buffer != NULL);
652
653 NeAACDecClose(hDecoder);
654
655 if (adts_out == 1)
656 {
657 fclose(adtsFile);
658 }
659
660 fclose(b.infile);
661
662 if (!first_time && !adts_out)
663 close_audio_file(aufile);
664
665 if (b.buffer)
666 free(b.buffer);
667
668 return frameInfo.error;
669 }
670
671 int GetAACTrack(mp4ff_t *infile)
672 {
673 /* find AAC track */
674 int i, rc;
675 int numTracks = mp4ff_total_tracks(infile);
676
677 for (i = 0; i < numTracks; i++)
678 {
679 unsigned char *buff = NULL;
680 int buff_size = 0;
681 mp4AudioSpecificConfig mp4ASC;
682
683 mp4ff_get_decoder_config(infile, i, &buff, &buff_size);
684
685 if (buff)
686 {
687 rc = NeAACDecAudioSpecificConfig(buff, buff_size, &mp4ASC);
688 free(buff);
689
690 if (rc < 0)
691 continue;
692 return i;
693 }
694 }
695
696 /* can't decode this */
697 return -1;
698 }
699
700 unsigned long srates[] =
701 {
702 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000,
703 12000, 11025, 8000
704 };
705
706 int decodeMP4file(char *mp4file, char *sndfile, char *adts_fn, int to_stdout,
707 int outputFormat, int fileType, int downMatrix, int noGapless,
708 int infoOnly, int adts_out, float *song_length)
709 {
710 int track;
711 unsigned long samplerate;
712 unsigned char channels;
713 void *sample_buffer;
714
715 mp4ff_t *infile;
716 long sampleId, numSamples;
717
718 audio_file *aufile;
719
720 FILE *mp4File;
721 FILE *adtsFile;
722 unsigned char *adtsData;
723 int adtsDataSize;
724
725 NeAACDecHandle hDecoder;
726 NeAACDecConfigurationPtr config;
727 NeAACDecFrameInfo frameInfo;
728 mp4AudioSpecificConfig mp4ASC;
729
730 unsigned char *buffer;
731 int buffer_size;
732
733 char percents[200];
734 int percent, old_percent = -1;
735
736 int first_time = 1;
737
738 /* for gapless decoding */
739 unsigned int useAacLength = 1;
740 unsigned int initial = 1;
741 unsigned int framesize;
742 unsigned long timescale;
743
744
745 /* initialise the callback structure */
746 mp4ff_callback_t *mp4cb = malloc(sizeof(mp4ff_callback_t));
747
748 mp4File = fopen(mp4file, "rb");
749 mp4cb->read = read_callback;
750 mp4cb->seek = seek_callback;
751 mp4cb->user_data = mp4File;
752
753
754 hDecoder = NeAACDecOpen();
755
756 /* Set configuration */
757 config = NeAACDecGetCurrentConfiguration(hDecoder);
758 config->outputFormat = outputFormat;
759 config->downMatrix = downMatrix;
760 //config->dontUpSampleImplicitSBR = 1;
761 NeAACDecSetConfiguration(hDecoder, config);
762
763 if (adts_out)
764 {
765 adtsFile = fopen(adts_fn, "wb");
766 if (adtsFile == NULL)
767 {
768 faad_fprintf(stderr, "Error opening file: %s\n", adts_fn);
769 return 1;
770 }
771 }
772
773 infile = mp4ff_open_read(mp4cb);
774 if (!infile)
775 {
776 /* unable to open file */
777 faad_fprintf(stderr, "Error opening file: %s\n", mp4file);
778 return 1;
779 }
780
781 if ((track = GetAACTrack(infile)) < 0)
782 {
783 faad_fprintf(stderr, "Unable to find correct AAC sound track in the MP4 file.\n");
784 NeAACDecClose(hDecoder);
785 mp4ff_close(infile);
786 free(mp4cb);
787 fclose(mp4File);
788 return 1;
789 }
790
791 buffer = NULL;
792 buffer_size = 0;
793 mp4ff_get_decoder_config(infile, track, &buffer, &buffer_size);
794
795 if(NeAACDecInit2(hDecoder, buffer, buffer_size,
796 &samplerate, &channels) < 0)
797 {
798 /* If some error initializing occured, skip the file */
799 faad_fprintf(stderr, "Error initializing decoder library.\n");
800 NeAACDecClose(hDecoder);
801 mp4ff_close(infile);
802 free(mp4cb);
803 fclose(mp4File);
804 return 1;
805 }
806
807 timescale = mp4ff_time_scale(infile, track);
808 framesize = 1024;
809 useAacLength = 0;
810
811 if (buffer)
812 {
813 if (NeAACDecAudioSpecificConfig(buffer, buffer_size, &mp4ASC) >= 0)
814 {
815 if (mp4ASC.frameLengthFlag == 1) framesize = 960;
816 if (mp4ASC.sbr_present_flag == 1) framesize *= 2;
817 }
818 free(buffer);
819 }
820
821 /* print some mp4 file info */
822 faad_fprintf(stderr, "%s file info:\n\n", mp4file);
823 {
824 char *tag = NULL, *item = NULL;
825 int k, j;
826 char *ot[6] = { "NULL", "MAIN AAC", "LC AAC", "SSR AAC", "LTP AAC", "HE AAC" };
827 long samples = mp4ff_num_samples(infile, track);
828 float f = 1024.0;
829 float seconds;
830 if (mp4ASC.sbr_present_flag == 1)
831 {
832 f = f * 2.0;
833 }
834 seconds = (float)samples*(float)(f-1.0)/(float)mp4ASC.samplingFrequency;
835
836 *song_length = seconds;
837
838 faad_fprintf(stderr, "%s\t%.3f secs, %d ch, %d Hz\n\n", ot[(mp4ASC.objectTypeIndex > 5)?0:mp4ASC.objectTypeIndex],
839 seconds, mp4ASC.channelsConfiguration, mp4ASC.samplingFrequency);
840
841 #define PRINT_MP4_METADATA
842 #ifdef PRINT_MP4_METADATA
843 j = mp4ff_meta_get_num_items(infile);
844 for (k = 0; k < j; k++)
845 {
846 if (mp4ff_meta_get_by_index(infile, k, &item, &tag))
847 {
848 if (item != NULL && tag != NULL)
849 {
850 faad_fprintf(stderr, "%s: %s\n", item, tag);
851 free(item); item = NULL;
852 free(tag); tag = NULL;
853 }
854 }
855 }
856 if (j > 0) faad_fprintf(stderr, "\n");
857 #endif
858 }
859
860 if (infoOnly)
861 {
862 NeAACDecClose(hDecoder);
863 mp4ff_close(infile);
864 free(mp4cb);
865 fclose(mp4File);
866 return 0;
867 }
868
869 numSamples = mp4ff_num_samples(infile, track);
870
871 for (sampleId = 0; sampleId < numSamples; sampleId++)
872 {
873 int rc;
874 long dur;
875 unsigned int sample_count;
876 unsigned int delay = 0;
877
878 /* get acces unit from MP4 file */
879 buffer = NULL;
880 buffer_size = 0;
881
882 dur = mp4ff_get_sample_duration(infile, track, sampleId);
883 rc = mp4ff_read_sample(infile, track, sampleId, &buffer, &buffer_size);
884 if (rc == 0)
885 {
886 faad_fprintf(stderr, "Reading from MP4 file failed.\n");
887 NeAACDecClose(hDecoder);
888 mp4ff_close(infile);
889 free(mp4cb);
890 fclose(mp4File);
891 return 1;
892 }
893
894 sample_buffer = NeAACDecDecode(hDecoder, &frameInfo, buffer, buffer_size);
895
896 if (adts_out == 1)
897 {
898 adtsData = MakeAdtsHeader(&adtsDataSize, &frameInfo, 0);
899
900 /* write the adts header */
901 fwrite(adtsData, 1, adtsDataSize, adtsFile);
902
903 fwrite(buffer, 1, frameInfo.bytesconsumed, adtsFile);
904 }
905
906 if (buffer) free(buffer);
907
908 if (!noGapless)
909 {
910 if (sampleId == 0) dur = 0;
911
912 if (useAacLength || (timescale != samplerate)) {
913 sample_count = frameInfo.samples;
914 } else {
915 sample_count = (unsigned int)(dur * frameInfo.channels);
916
917 if (!useAacLength && !initial && (sampleId < numSamples/2) && (sample_count != frameInfo.samples))
918 {
919 faad_fprintf(stderr, "MP4 seems to have incorrect frame duration, using values from AAC data.\n");
920 useAacLength = 1;
921 sample_count = frameInfo.samples;
922 }
923 }
924
925 if (initial && (sample_count < framesize*frameInfo.channels) && (frameInfo.samples > sample_count))
926 delay = frameInfo.samples - sample_count;
927 } else {
928 sample_count = frameInfo.samples;
929 }
930
931 /* open the sound file now that the number of channels are known */
932 if (first_time && !frameInfo.error)
933 {
934 /* print some channel info */
935 print_channel_info(&frameInfo);
936
937 if (!adts_out)
938 {
939 /* open output file */
940 if(!to_stdout)
941 {
942 aufile = open_audio_file(sndfile, frameInfo.samplerate, frameInfo.channels,
943 outputFormat, fileType, aacChannelConfig2wavexChannelMask(&frameInfo));
944 } else {
945 #ifdef _WIN32
946 setmode(fileno(stdout), O_BINARY);
947 #endif
948 aufile = open_audio_file("-", frameInfo.samplerate, frameInfo.channels,
949 outputFormat, fileType, aacChannelConfig2wavexChannelMask(&frameInfo));
950 }
951 if (aufile == NULL)
952 {
953 NeAACDecClose(hDecoder);
954 mp4ff_close(infile);
955 free(mp4cb);
956 fclose(mp4File);
957 return 0;
958 }
959 }
960 first_time = 0;
961 }
962
963 if (sample_count > 0) initial = 0;
964
965 percent = min((int)(sampleId*100)/numSamples, 100);
966 if (percent > old_percent)
967 {
968 old_percent = percent;
969 sprintf(percents, "%d%% decoding %s.", percent, mp4file);
970 faad_fprintf(stderr, "%s\r", percents);
971 #ifdef _WIN32
972 SetConsoleTitle(percents);
973 #endif
974 }
975
976 if ((frameInfo.error == 0) && (sample_count > 0) && (!adts_out))
977 {
978 write_audio_file(aufile, sample_buffer, sample_count, delay);
979 }
980
981 if (frameInfo.error > 0)
982 {
983 faad_fprintf(stderr, "Warning: %s\n",
984 NeAACDecGetErrorMessage(frameInfo.error));
985 }
986 }
987
988 NeAACDecClose(hDecoder);
989
990 if (adts_out == 1)
991 {
992 fclose(adtsFile);
993 }
994
995 mp4ff_close(infile);
996
997 if (!first_time && !adts_out)
998 close_audio_file(aufile);
999
1000 free(mp4cb);
1001 fclose(mp4File);
1002
1003 return frameInfo.error;
1004 }
1005
1006 int main(int argc, char *argv[])
1007 {
1008 int result;
1009 int infoOnly = 0;
1010 int writeToStdio = 0;
1011 int object_type = LC;
1012 int def_srate = 0;
1013 int downMatrix = 0;
1014 int format = 1;
1015 int outputFormat = FAAD_FMT_16BIT;
1016 int outfile_set = 0;
1017 int adts_out = 0;
1018 int old_format = 0;
1019 int showHelp = 0;
1020 int mp4file = 0;
1021 int noGapless = 0;
1022 char *fnp;
1023 char aacFileName[255];
1024 char audioFileName[255];
1025 char adtsFileName[255];
1026 unsigned char header[8];
1027 float length = 0;
1028 FILE *hMP4File;
1029
1030 /* System dependant types */
1031 #ifdef _WIN32
1032 long begin;
1033 #else
1034 clock_t begin;
1035 #endif
1036
1037 unsigned long cap = NeAACDecGetCapabilities();
1038
1039
1040 /* begin process command line */
1041 progName = argv[0];
1042 while (1) {
1043 int c = -1;
1044 int option_index = 0;
1045 static struct option long_options[] = {
1046 { "quiet", 0, 0, 'q' },
1047 { "outfile", 0, 0, 'o' },
1048 { "adtsout", 0, 0, 'a' },
1049 { "oldformat", 0, 0, 't' },
1050 { "format", 0, 0, 'f' },
1051 { "bits", 0, 0, 'b' },
1052 { "samplerate", 0, 0, 's' },
1053 { "objecttype", 0, 0, 'l' },
1054 { "downmix", 0, 0, 'd' },
1055 { "info", 0, 0, 'i' },
1056 { "stdio", 0, 0, 'w' },
1057 { "stdio", 0, 0, 'g' },
1058 { "help", 0, 0, 'h' },
1059 { 0, 0, 0, 0 }
1060 };
1061
1062 c = getopt_long(argc, argv, "o:a:s:f:b:l:wgdhitq",
1063 long_options, &option_index);
1064
1065 if (c == -1)
1066 break;
1067
1068 switch (c) {
1069 case 'o':
1070 if (optarg)
1071 {
1072 outfile_set = 1;
1073 strcpy(audioFileName, optarg);
1074 }
1075 break;
1076 case 'a':
1077 if (optarg)
1078 {
1079 adts_out = 1;
1080 strcpy(adtsFileName, optarg);
1081 }
1082 break;
1083 case 's':
1084 if (optarg)
1085 {
1086 char dr[10];
1087 if (sscanf(optarg, "%s", dr) < 1) {
1088 def_srate = 0;
1089 } else {
1090 def_srate = atoi(dr);
1091 }
1092 }
1093 break;
1094 case 'f':
1095 if (optarg)
1096 {
1097 char dr[10];
1098 if (sscanf(optarg, "%s", dr) < 1)
1099 {
1100 format = 1;
1101 } else {
1102 format = atoi(dr);
1103 if ((format < 1) || (format > 2))
1104 showHelp = 1;
1105 }
1106 }
1107 break;
1108 case 'b':
1109 if (optarg)
1110 {
1111 char dr[10];
1112 if (sscanf(optarg, "%s", dr) < 1)
1113 {
1114 outputFormat = FAAD_FMT_16BIT; /* just use default */
1115 } else {
1116 outputFormat = atoi(dr);
1117 if ((outputFormat < 1) || (outputFormat > 5))
1118 showHelp = 1;
1119 }
1120 }
1121 break;
1122 case 'l':
1123 if (optarg)
1124 {
1125 char dr[10];
1126 if (sscanf(optarg, "%s", dr) < 1)
1127 {
1128 object_type = LC; /* default */
1129 } else {
1130 object_type = atoi(dr);
1131 if ((object_type != LC) &&
1132 (object_type != MAIN) &&
1133 (object_type != LTP) &&
1134 (object_type != LD))
1135 {
1136 showHelp = 1;
1137 }
1138 }
1139 }
1140 break;
1141 case 't':
1142 old_format = 1;
1143 break;
1144 case 'd':
1145 downMatrix = 1;
1146 break;
1147 case 'w':
1148 writeToStdio = 1;
1149 break;
1150 case 'g':
1151 noGapless = 1;
1152 break;
1153 case 'i':
1154 infoOnly = 1;
1155 break;
1156 case 'h':
1157 showHelp = 1;
1158 break;
1159 case 'q':
1160 quiet = 1;
1161 break;
1162 default:
1163 break;
1164 }
1165 }
1166
1167
1168 faad_fprintf(stderr, " *********** Ahead Software MPEG-4 AAC Decoder V%s ******************\n\n", FAAD2_VERSION);
1169 faad_fprintf(stderr, " Build: %s\n", __DATE__);
1170 faad_fprintf(stderr, " Copyright 2002-2004: Ahead Software AG\n");
1171 faad_fprintf(stderr, " http://www.audiocoding.com\n");
1172 if (cap & FIXED_POINT_CAP)
1173 faad_fprintf(stderr, " Fixed point version\n");
1174 else
1175 faad_fprintf(stderr, " Floating point version\n");
1176 faad_fprintf(stderr, "\n");
1177 faad_fprintf(stderr, " This program is free software; you can redistribute it and/or modify\n");
1178 faad_fprintf(stderr, " it under the terms of the GNU General Public License.\n");
1179 faad_fprintf(stderr, "\n");
1180 faad_fprintf(stderr, " **************************************************************************\n\n");
1181
1182
1183 /* check that we have at least two non-option arguments */
1184 /* Print help if requested */
1185 if (((argc - optind) < 1) || showHelp)
1186 {
1187 usage();
1188 return 1;
1189 }
1190
1191 /* only allow raw data on stdio */
1192 if (writeToStdio == 1)
1193 {
1194 format = 2;
1195 }
1196
1197 /* point to the specified file name */
1198 strcpy(aacFileName, argv[optind]);
1199
1200 #ifdef _WIN32
1201 begin = GetTickCount();
1202 #else
1203 begin = clock();
1204 #endif
1205
1206 /* Only calculate the path and open the file for writing if
1207 we are not writing to stdout.
1208 */
1209 if(!writeToStdio && !outfile_set)
1210 {
1211 strcpy(audioFileName, aacFileName);
1212
1213 fnp = (char *)strrchr(audioFileName,'.');
1214
1215 if (fnp)
1216 fnp[0] = '\0';
1217
1218 strcat(audioFileName, file_ext[format]);
1219 }
1220
1221 /* check for mp4 file */
1222 mp4file = 0;
1223 hMP4File = fopen(aacFileName, "rb");
1224 if (!hMP4File)
1225 {
1226 faad_fprintf(stderr, "Error opening file: %s\n", aacFileName);
1227 return 1;
1228 }
1229 fread(header, 1, 8, hMP4File);
1230 fclose(hMP4File);
1231 if (header[4] == 'f' && header[5] == 't' && header[6] == 'y' && header[7] == 'p')
1232 mp4file = 1;
1233
1234 if (mp4file)
1235 {
1236 result = decodeMP4file(aacFileName, audioFileName, adtsFileName, writeToStdio,
1237 outputFormat, format, downMatrix, noGapless, infoOnly, adts_out, &length);
1238 } else {
1239 result = decodeAACfile(aacFileName, audioFileName, adtsFileName, writeToStdio,
1240 def_srate, object_type, outputFormat, format, downMatrix, infoOnly, adts_out,
1241 old_format, &length);
1242 }
1243
1244 if (!result && !infoOnly)
1245 {
1246 #ifdef _WIN32
1247 float dec_length = (float)(GetTickCount()-begin)/1000.0;
1248 SetConsoleTitle("FAAD");
1249 #else
1250 /* clock() grabs time since the start of the app but when we decode
1251 multiple files, each file has its own starttime (begin).
1252 */
1253 float dec_length = (float)(clock() - begin)/(float)CLOCKS_PER_SEC;
1254 #endif
1255 faad_fprintf(stderr, "Decoding %s took: %5.2f sec. %5.2fx real-time.\n", aacFileName,
1256 dec_length, length/dec_length);
1257 }
1258
1259 return 0;
1260 }
0 Name "AudioCoding.com MP4 Winamp plugin"
1 OutFile in_mp4.exe
2 CRCCheck on
3 LicenseText "You must read the following license before installing."
4 LicenseData COPYING
5 ComponentText "This will install the AudioCoding.com MP4 Winamp plugin on your computer."
6 InstType Normal
7 AutoCloseWindow true
8 SetOverwrite on
9 SetDateSave on
10
11 InstallDir $PROGRAMFILES\Winamp
12 InstallDirRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" "UninstallString"
13 ;DirShow
14 DirText "The installer has detected the path to Winamp. If it is not correct, please change."
15
16 Section "AudioCoding.com MP4 Winamp plugin"
17 SectionIn 1
18 SetOutPath $INSTDIR\Plugins
19 File plugins\in_mp4\Release\in_mp4.dll
20 SectionEnd
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: faad.h,v 1.51 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 /* warn people for update */
31 #pragma message("please update faad2 include filename and function names!")
32
33 /* Backwards compatible link */
34 #include "neaacdec.h"
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: neaacdec.h,v 1.11 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 #ifndef __NEAACDEC_H__
31 #define __NEAACDEC_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif /* __cplusplus */
36
37
38 #if 1
39 /* MACROS FOR BACKWARDS COMPATIBILITY */
40 /* structs */
41 #define faacDecHandle NeAACDecHandle
42 #define faacDecConfiguration NeAACDecConfiguration
43 #define faacDecConfigurationPtr NeAACDecConfigurationPtr
44 #define faacDecFrameInfo NeAACDecFrameInfo
45 /* functions */
46 #define faacDecGetErrorMessage NeAACDecGetErrorMessage
47 #define faacDecSetConfiguration NeAACDecSetConfiguration
48 #define faacDecGetCurrentConfiguration NeAACDecGetCurrentConfiguration
49 #define faacDecInit NeAACDecInit
50 #define faacDecInit2 NeAACDecInit2
51 #define faacDecInitDRM NeAACDecInitDRM
52 #define faacDecPostSeekReset NeAACDecPostSeekReset
53 #define faacDecOpen NeAACDecOpen
54 #define faacDecClose NeAACDecClose
55 #define faacDecDecode NeAACDecDecode
56 #define AudioSpecificConfig NeAACDecAudioSpecificConfig
57 #endif
58
59
60 #ifdef _WIN32
61 #pragma pack(push, 8)
62 #ifndef NEAACDECAPI
63 #define NEAACDECAPI __cdecl
64 #endif
65 #else
66 #ifndef NEAACDECAPI
67 #define NEAACDECAPI
68 #endif
69 #endif
70
71 #define FAAD2_VERSION "2.6"
72
73 /* object types for AAC */
74 #define MAIN 1
75 #define LC 2
76 #define SSR 3
77 #define LTP 4
78 #define HE_AAC 5
79 #define ER_LC 17
80 #define ER_LTP 19
81 #define LD 23
82 #define DRM_ER_LC 27 /* special object type for DRM */
83
84 /* header types */
85 #define RAW 0
86 #define ADIF 1
87 #define ADTS 2
88
89 /* SBR signalling */
90 #define NO_SBR 0
91 #define SBR_UPSAMPLED 1
92 #define SBR_DOWNSAMPLED 2
93 #define NO_SBR_UPSAMPLED 3
94
95 /* library output formats */
96 #define FAAD_FMT_16BIT 1
97 #define FAAD_FMT_24BIT 2
98 #define FAAD_FMT_32BIT 3
99 #define FAAD_FMT_FLOAT 4
100 #define FAAD_FMT_FIXED FAAD_FMT_FLOAT
101 #define FAAD_FMT_DOUBLE 5
102
103 /* Capabilities */
104 #define LC_DEC_CAP (1<<0) /* Can decode LC */
105 #define MAIN_DEC_CAP (1<<1) /* Can decode MAIN */
106 #define LTP_DEC_CAP (1<<2) /* Can decode LTP */
107 #define LD_DEC_CAP (1<<3) /* Can decode LD */
108 #define ERROR_RESILIENCE_CAP (1<<4) /* Can decode ER */
109 #define FIXED_POINT_CAP (1<<5) /* Fixed point */
110
111 /* Channel definitions */
112 #define FRONT_CHANNEL_CENTER (1)
113 #define FRONT_CHANNEL_LEFT (2)
114 #define FRONT_CHANNEL_RIGHT (3)
115 #define SIDE_CHANNEL_LEFT (4)
116 #define SIDE_CHANNEL_RIGHT (5)
117 #define BACK_CHANNEL_LEFT (6)
118 #define BACK_CHANNEL_RIGHT (7)
119 #define BACK_CHANNEL_CENTER (8)
120 #define LFE_CHANNEL (9)
121 #define UNKNOWN_CHANNEL (0)
122
123 /* DRM channel definitions */
124 #define DRMCH_MONO 1
125 #define DRMCH_STEREO 2
126 #define DRMCH_SBR_MONO 3
127 #define DRMCH_SBR_STEREO 4
128 #define DRMCH_SBR_PS_STEREO 5
129
130
131 /* A decode call can eat up to FAAD_MIN_STREAMSIZE bytes per decoded channel,
132 so at least so much bytes per channel should be available in this stream */
133 #define FAAD_MIN_STREAMSIZE 768 /* 6144 bits/channel */
134
135
136 typedef void *NeAACDecHandle;
137
138 typedef struct mp4AudioSpecificConfig
139 {
140 /* Audio Specific Info */
141 unsigned char objectTypeIndex;
142 unsigned char samplingFrequencyIndex;
143 unsigned long samplingFrequency;
144 unsigned char channelsConfiguration;
145
146 /* GA Specific Info */
147 unsigned char frameLengthFlag;
148 unsigned char dependsOnCoreCoder;
149 unsigned short coreCoderDelay;
150 unsigned char extensionFlag;
151 unsigned char aacSectionDataResilienceFlag;
152 unsigned char aacScalefactorDataResilienceFlag;
153 unsigned char aacSpectralDataResilienceFlag;
154 unsigned char epConfig;
155
156 char sbr_present_flag;
157 char forceUpSampling;
158 char downSampledSBR;
159 } mp4AudioSpecificConfig;
160
161 typedef struct NeAACDecConfiguration
162 {
163 unsigned char defObjectType;
164 unsigned long defSampleRate;
165 unsigned char outputFormat;
166 unsigned char downMatrix;
167 unsigned char useOldADTSFormat;
168 unsigned char dontUpSampleImplicitSBR;
169 } NeAACDecConfiguration, *NeAACDecConfigurationPtr;
170
171 typedef struct NeAACDecFrameInfo
172 {
173 unsigned long bytesconsumed;
174 unsigned long samples;
175 unsigned char channels;
176 unsigned char error;
177 unsigned long samplerate;
178
179 /* SBR: 0: off, 1: on; upsample, 2: on; downsampled, 3: off; upsampled */
180 unsigned char sbr;
181
182 /* MPEG-4 ObjectType */
183 unsigned char object_type;
184
185 /* AAC header type; MP4 will be signalled as RAW also */
186 unsigned char header_type;
187
188 /* multichannel configuration */
189 unsigned char num_front_channels;
190 unsigned char num_side_channels;
191 unsigned char num_back_channels;
192 unsigned char num_lfe_channels;
193 unsigned char channel_position[64];
194
195 /* PS: 0: off, 1: on */
196 unsigned char ps;
197 } NeAACDecFrameInfo;
198
199 char* NEAACDECAPI NeAACDecGetErrorMessage(unsigned char errcode);
200
201 unsigned long NEAACDECAPI NeAACDecGetCapabilities(void);
202
203 NeAACDecHandle NEAACDECAPI NeAACDecOpen(void);
204
205 NeAACDecConfigurationPtr NEAACDECAPI NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder);
206
207 unsigned char NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hDecoder,
208 NeAACDecConfigurationPtr config);
209
210 /* Init the library based on info from the AAC file (ADTS/ADIF) */
211 long NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder,
212 unsigned char *buffer,
213 unsigned long buffer_size,
214 unsigned long *samplerate,
215 unsigned char *channels);
216
217 /* Init the library using a DecoderSpecificInfo */
218 char NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, unsigned char *pBuffer,
219 unsigned long SizeOfDecoderSpecificInfo,
220 unsigned long *samplerate, unsigned char *channels);
221
222 /* Init the library for DRM */
223 char NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hDecoder, unsigned long samplerate,
224 unsigned char channels);
225
226 void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, long frame);
227
228 void NEAACDECAPI NeAACDecClose(NeAACDecHandle hDecoder);
229
230 void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hDecoder,
231 NeAACDecFrameInfo *hInfo,
232 unsigned char *buffer,
233 unsigned long buffer_size);
234
235 void* NEAACDECAPI NeAACDecDecode2(NeAACDecHandle hDecoder,
236 NeAACDecFrameInfo *hInfo,
237 unsigned char *buffer,
238 unsigned long buffer_size,
239 void **sample_buffer,
240 unsigned long sample_buffer_size);
241
242 char NEAACDECAPI NeAACDecAudioSpecificConfig(unsigned char *pBuffer,
243 unsigned long buffer_size,
244 mp4AudioSpecificConfig *mp4ASC);
245
246 #ifdef _WIN32
247 #pragma pack(pop)
248 #endif
249
250 #ifdef __cplusplus
251 }
252 #endif /* __cplusplus */
253
254 #endif
0 lib_LTLIBRARIES = libfaad.la
1
2 include_HEADERS = $(top_srcdir)/include/faad.h \
3 $(top_srcdir)/include/neaacdec.h
4
5 libfaad_la_LDFLAGS = -lm
6
7 libfaad_la_SOURCES = bits.c cfft.c decoder.c drc.c \
8 drm_dec.c error.c filtbank.c \
9 ic_predict.c is.c lt_predict.c mdct.c mp4.c ms.c output.c pns.c \
10 ps_dec.c ps_syntax.c \
11 pulse.c specrec.c syntax.c tns.c hcr.c huffman.c \
12 rvlc.c ssr.c ssr_fb.c ssr_ipqf.c common.c \
13 sbr_dct.c sbr_e_nf.c sbr_fbt.c sbr_hfadj.c sbr_hfgen.c \
14 sbr_huff.c sbr_qmf.c sbr_syntax.c sbr_tf_grid.c sbr_dec.c \
15 analysis.h bits.h cfft.h cfft_tab.h common.h \
16 decoder.h drc.h drm_dec.h error.h fixed.h filtbank.h \
17 huffman.h ic_predict.h iq_table.h is.h kbd_win.h lt_predict.h \
18 mdct.h mdct_tab.h mp4.h ms.h output.h pns.h ps_dec.h ps_tables.h \
19 pulse.h rvlc.h \
20 sbr_dct.h sbr_dec.h sbr_e_nf.h sbr_fbt.h sbr_hfadj.h sbr_hfgen.h \
21 sbr_huff.h sbr_noise.h sbr_qmf.h sbr_syntax.h sbr_tf_grid.h \
22 sine_win.h specrec.h ssr.h ssr_fb.h ssr_ipqf.h \
23 ssr_win.h syntax.h structs.h tns.h \
24 sbr_qmf_c.h codebook/hcb.h \
25 codebook/hcb_1.h codebook/hcb_2.h codebook/hcb_3.h codebook/hcb_4.h \
26 codebook/hcb_5.h codebook/hcb_6.h codebook/hcb_7.h codebook/hcb_8.h \
27 codebook/hcb_9.h codebook/hcb_10.h codebook/hcb_11.h codebook/hcb_sf.h
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: analysis.h,v 1.18 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 #ifndef __ANALYSIS_H__
31 #define __ANALYSIS_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37
38 #ifdef ANALYSIS
39 #define DEBUGDEC ,uint8_t print,uint16_t var,uint8_t *dbg
40 #define DEBUGVAR(A,B,C) ,A,B,C
41 extern uint16_t dbg_count;
42 #else
43 #define DEBUGDEC
44 #define DEBUGVAR(A,B,C)
45 #endif
46
47
48 #ifdef __cplusplus
49 }
50 #endif
51 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: bits.c,v 1.44 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #include <stdlib.h>
34 #include "bits.h"
35
36 /* initialize buffer, call once before first getbits or showbits */
37 void faad_initbits(bitfile *ld, const void *_buffer, const uint32_t buffer_size)
38 {
39 uint32_t tmp;
40
41 if (ld == NULL)
42 return;
43
44 // useless
45 //memset(ld, 0, sizeof(bitfile));
46
47 if (buffer_size == 0 || _buffer == NULL)
48 {
49 ld->error = 1;
50 return;
51 }
52
53 ld->buffer = _buffer;
54
55 ld->buffer_size = buffer_size;
56 ld->bytes_left = buffer_size;
57
58 if (ld->bytes_left >= 4)
59 {
60 tmp = getdword((uint32_t*)ld->buffer);
61 ld->bytes_left -= 4;
62 } else {
63 tmp = getdword_n((uint32_t*)ld->buffer, ld->bytes_left);
64 ld->bytes_left = 0;
65 }
66 ld->bufa = tmp;
67
68 if (ld->bytes_left >= 4)
69 {
70 tmp = getdword((uint32_t*)ld->buffer + 1);
71 ld->bytes_left -= 4;
72 } else {
73 tmp = getdword_n((uint32_t*)ld->buffer + 1, ld->bytes_left);
74 ld->bytes_left = 0;
75 }
76 ld->bufb = tmp;
77
78 ld->start = (uint32_t*)ld->buffer;
79 ld->tail = ((uint32_t*)ld->buffer + 2);
80
81 ld->bits_left = 32;
82
83 ld->error = 0;
84 }
85
86 void faad_endbits(bitfile *ld)
87 {
88 // void
89 }
90
91 uint32_t faad_get_processed_bits(bitfile *ld)
92 {
93 return (uint32_t)(8 * (4*(ld->tail - ld->start) - 4) - (ld->bits_left));
94 }
95
96 uint8_t faad_byte_align(bitfile *ld)
97 {
98 int remainder = (32 - ld->bits_left) & 0x7;
99
100 if (remainder)
101 {
102 faad_flushbits(ld, 8 - remainder);
103 return (uint8_t)(8 - remainder);
104 }
105 return 0;
106 }
107
108 void faad_flushbits_ex(bitfile *ld, uint32_t bits)
109 {
110 uint32_t tmp;
111
112 ld->bufa = ld->bufb;
113 if (ld->bytes_left >= 4)
114 {
115 tmp = getdword(ld->tail);
116 ld->bytes_left -= 4;
117 } else {
118 tmp = getdword_n(ld->tail, ld->bytes_left);
119 ld->bytes_left = 0;
120 }
121 ld->bufb = tmp;
122 ld->tail++;
123 ld->bits_left += (32 - bits);
124 //ld->bytes_left -= 4;
125 // if (ld->bytes_left == 0)
126 // ld->no_more_reading = 1;
127 // if (ld->bytes_left < 0)
128 // ld->error = 1;
129 }
130
131 /* rewind to beginning */
132 void faad_rewindbits(bitfile *ld)
133 {
134 uint32_t tmp;
135
136 ld->bytes_left = ld->buffer_size;
137
138 if (ld->bytes_left >= 4)
139 {
140 tmp = getdword((uint32_t*)&ld->start[0]);
141 ld->bytes_left -= 4;
142 } else {
143 tmp = getdword_n((uint32_t*)&ld->start[0], ld->bytes_left);
144 ld->bytes_left = 0;
145 }
146 ld->bufa = tmp;
147
148 if (ld->bytes_left >= 4)
149 {
150 tmp = getdword((uint32_t*)&ld->start[1]);
151 ld->bytes_left -= 4;
152 } else {
153 tmp = getdword_n((uint32_t*)&ld->start[1], ld->bytes_left);
154 ld->bytes_left = 0;
155 }
156 ld->bufb = tmp;
157
158 ld->bits_left = 32;
159 ld->tail = &ld->start[2];
160 }
161
162 /* reset to a certain point */
163 void faad_resetbits(bitfile *ld, int bits)
164 {
165 uint32_t tmp;
166 int words = bits >> 5;
167 int remainder = bits & 0x1F;
168
169 ld->bytes_left = ld->buffer_size - words*4;
170
171 if (ld->bytes_left >= 4)
172 {
173 tmp = getdword(&ld->start[words]);
174 ld->bytes_left -= 4;
175 } else {
176 tmp = getdword_n(&ld->start[words], ld->bytes_left);
177 ld->bytes_left = 0;
178 }
179 ld->bufa = tmp;
180
181 if (ld->bytes_left >= 4)
182 {
183 tmp = getdword(&ld->start[words+1]);
184 ld->bytes_left -= 4;
185 } else {
186 tmp = getdword_n(&ld->start[words+1], ld->bytes_left);
187 ld->bytes_left = 0;
188 }
189 ld->bufb = tmp;
190
191 ld->bits_left = 32 - remainder;
192 ld->tail = &ld->start[words+2];
193
194 /* recheck for reading too many bytes */
195 ld->error = 0;
196 // if (ld->bytes_left == 0)
197 // ld->no_more_reading = 1;
198 // if (ld->bytes_left < 0)
199 // ld->error = 1;
200 }
201
202 uint8_t *faad_getbitbuffer(bitfile *ld, uint32_t bits
203 DEBUGDEC)
204 {
205 int i;
206 unsigned int temp;
207 int bytes = bits >> 3;
208 int remainder = bits & 0x7;
209
210 uint8_t *buffer = (uint8_t*)faad_malloc((bytes+1)*sizeof(uint8_t));
211
212 for (i = 0; i < bytes; i++)
213 {
214 buffer[i] = (uint8_t)faad_getbits(ld, 8 DEBUGVAR(print,var,dbg));
215 }
216
217 if (remainder)
218 {
219 temp = faad_getbits(ld, remainder DEBUGVAR(print,var,dbg)) << (8-remainder);
220
221 buffer[bytes] = (uint8_t)temp;
222 }
223
224 return buffer;
225 }
226
227 #ifdef DRM
228 /* return the original data buffer */
229 void *faad_origbitbuffer(bitfile *ld)
230 {
231 return (void*)ld->start;
232 }
233
234 /* return the original data buffer size */
235 uint32_t faad_origbitbuffer_size(bitfile *ld)
236 {
237 return ld->buffer_size;
238 }
239 #endif
240
241 /* reversed bit reading routines, used for RVLC and HCR */
242 void faad_initbits_rev(bitfile *ld, void *buffer,
243 uint32_t bits_in_buffer)
244 {
245 uint32_t tmp;
246 int32_t index;
247
248 ld->buffer_size = bit2byte(bits_in_buffer);
249
250 index = (bits_in_buffer+31)/32 - 1;
251
252 ld->start = (uint32_t*)buffer + index - 2;
253
254 tmp = getdword((uint32_t*)buffer + index);
255 ld->bufa = tmp;
256
257 tmp = getdword((uint32_t*)buffer + index - 1);
258 ld->bufb = tmp;
259
260 ld->tail = (uint32_t*)buffer + index;
261
262 ld->bits_left = bits_in_buffer % 32;
263 if (ld->bits_left == 0)
264 ld->bits_left = 32;
265
266 ld->bytes_left = ld->buffer_size;
267 ld->error = 0;
268 }
269
270 /* EOF */
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: bits.h,v 1.45 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 #ifndef __BITS_H__
31 #define __BITS_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #include "analysis.h"
38 #ifdef ANALYSIS
39 #include <stdio.h>
40 #endif
41
42 #define BYTE_NUMBIT 8
43 #define BYTE_NUMBIT_LD 3
44 //#define bit2byte(a) ((a+7)/BYTE_NUMBIT)
45 #define bit2byte(a) ((a+7)>>BYTE_NUMBIT_LD)
46
47 typedef struct _bitfile
48 {
49 /* bit input */
50 uint32_t bufa;
51 uint32_t bufb;
52 uint32_t bits_left;
53 uint32_t buffer_size; /* size of the buffer in bytes */
54 uint32_t bytes_left;
55 uint8_t error;
56 uint32_t *tail;
57 uint32_t *start;
58 const void *buffer;
59 } bitfile;
60
61
62 #if 0
63 static uint32_t const bitmask[] = {
64 0x0, 0x1, 0x3, 0x7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, 0x1FF,
65 0x3FF, 0x7FF, 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF,
66 0x1FFFF, 0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF,
67 0x7FFFFF, 0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF, 0x7FFFFFF,
68 0xFFFFFFF, 0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF
69 /* added bitmask 32, correct?!?!?! */
70 , 0xFFFFFFFF
71 };
72 #endif
73
74 void faad_initbits(bitfile *ld, const void *buffer, const uint32_t buffer_size);
75 void faad_endbits(bitfile *ld);
76 void faad_initbits_rev(bitfile *ld, void *buffer,
77 uint32_t bits_in_buffer);
78 uint8_t faad_byte_align(bitfile *ld);
79 uint32_t faad_get_processed_bits(bitfile *ld);
80 void faad_flushbits_ex(bitfile *ld, uint32_t bits);
81 void faad_rewindbits(bitfile *ld);
82 void faad_resetbits(bitfile *ld, int bits);
83 uint8_t *faad_getbitbuffer(bitfile *ld, uint32_t bits
84 DEBUGDEC);
85 #ifdef DRM
86 void *faad_origbitbuffer(bitfile *ld);
87 uint32_t faad_origbitbuffer_size(bitfile *ld);
88 #endif
89
90 /* circumvent memory alignment errors on ARM */
91 static INLINE uint32_t getdword(void *mem)
92 {
93 uint32_t tmp;
94 #ifndef ARCH_IS_BIG_ENDIAN
95 ((uint8_t*)&tmp)[0] = ((uint8_t*)mem)[3];
96 ((uint8_t*)&tmp)[1] = ((uint8_t*)mem)[2];
97 ((uint8_t*)&tmp)[2] = ((uint8_t*)mem)[1];
98 ((uint8_t*)&tmp)[3] = ((uint8_t*)mem)[0];
99 #else
100 ((uint8_t*)&tmp)[0] = ((uint8_t*)mem)[0];
101 ((uint8_t*)&tmp)[1] = ((uint8_t*)mem)[1];
102 ((uint8_t*)&tmp)[2] = ((uint8_t*)mem)[2];
103 ((uint8_t*)&tmp)[3] = ((uint8_t*)mem)[3];
104 #endif
105
106 return tmp;
107 }
108
109 /* reads only n bytes from the stream instead of the standard 4 */
110 static /*INLINE*/ uint32_t getdword_n(void *mem, int n)
111 {
112 uint32_t tmp = 0;
113 #ifndef ARCH_IS_BIG_ENDIAN
114 switch (n)
115 {
116 case 3:
117 ((uint8_t*)&tmp)[1] = ((uint8_t*)mem)[2];
118 case 2:
119 ((uint8_t*)&tmp)[2] = ((uint8_t*)mem)[1];
120 case 1:
121 ((uint8_t*)&tmp)[3] = ((uint8_t*)mem)[0];
122 default:
123 break;
124 }
125 #else
126 switch (n)
127 {
128 case 3:
129 ((uint8_t*)&tmp)[2] = ((uint8_t*)mem)[2];
130 case 2:
131 ((uint8_t*)&tmp)[1] = ((uint8_t*)mem)[1];
132 case 1:
133 ((uint8_t*)&tmp)[0] = ((uint8_t*)mem)[0];
134 default:
135 break;
136 }
137 #endif
138
139 return tmp;
140 }
141
142 static INLINE uint32_t faad_showbits(bitfile *ld, uint32_t bits)
143 {
144 if (bits <= ld->bits_left)
145 {
146 //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
147 return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
148 }
149
150 bits -= ld->bits_left;
151 //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
152 return ((ld->bufa & ((1<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
153 }
154
155 static INLINE void faad_flushbits(bitfile *ld, uint32_t bits)
156 {
157 /* do nothing if error */
158 if (ld->error != 0)
159 return;
160
161 if (bits < ld->bits_left)
162 {
163 ld->bits_left -= bits;
164 } else {
165 faad_flushbits_ex(ld, bits);
166 }
167 }
168
169 /* return next n bits (right adjusted) */
170 static /*INLINE*/ uint32_t faad_getbits(bitfile *ld, uint32_t n DEBUGDEC)
171 {
172 uint32_t ret;
173
174 if (n == 0)
175 return 0;
176
177 ret = faad_showbits(ld, n);
178 faad_flushbits(ld, n);
179
180 #ifdef ANALYSIS
181 if (print)
182 fprintf(stdout, "%4d %2d bits, val: %4d, variable: %d %s\n", dbg_count++, n, ret, var, dbg);
183 #endif
184
185 return ret;
186 }
187
188 static INLINE uint8_t faad_get1bit(bitfile *ld DEBUGDEC)
189 {
190 uint8_t r;
191
192 if (ld->bits_left > 0)
193 {
194 ld->bits_left--;
195 r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
196 return r;
197 }
198
199 /* bits_left == 0 */
200 #if 0
201 r = (uint8_t)(ld->bufb >> 31);
202 faad_flushbits_ex(ld, 1);
203 #else
204 r = (uint8_t)faad_getbits(ld, 1);
205 #endif
206 return r;
207 }
208
209 /* reversed bitreading routines */
210 static INLINE uint32_t faad_showbits_rev(bitfile *ld, uint32_t bits)
211 {
212 uint8_t i;
213 uint32_t B = 0;
214
215 if (bits <= ld->bits_left)
216 {
217 for (i = 0; i < bits; i++)
218 {
219 if (ld->bufa & (1 << (i + (32 - ld->bits_left))))
220 B |= (1 << (bits - i - 1));
221 }
222 return B;
223 } else {
224 for (i = 0; i < ld->bits_left; i++)
225 {
226 if (ld->bufa & (1 << (i + (32 - ld->bits_left))))
227 B |= (1 << (bits - i - 1));
228 }
229 for (i = 0; i < bits - ld->bits_left; i++)
230 {
231 if (ld->bufb & (1 << (i + (32-ld->bits_left))))
232 B |= (1 << (bits - ld->bits_left - i - 1));
233 }
234 return B;
235 }
236 }
237
238 static INLINE void faad_flushbits_rev(bitfile *ld, uint32_t bits)
239 {
240 /* do nothing if error */
241 if (ld->error != 0)
242 return;
243
244 if (bits < ld->bits_left)
245 {
246 ld->bits_left -= bits;
247 } else {
248 uint32_t tmp;
249
250 ld->bufa = ld->bufb;
251 tmp = getdword(ld->start);
252 ld->bufb = tmp;
253 ld->start--;
254 ld->bits_left += (32 - bits);
255
256 if (ld->bytes_left < 4)
257 {
258 ld->error = 1;
259 ld->bytes_left = 0;
260 } else {
261 ld->bytes_left -= 4;
262 }
263 // if (ld->bytes_left == 0)
264 // ld->no_more_reading = 1;
265 }
266 }
267
268 static /*INLINE*/ uint32_t faad_getbits_rev(bitfile *ld, uint32_t n
269 DEBUGDEC)
270 {
271 uint32_t ret;
272
273 if (n == 0)
274 return 0;
275
276 ret = faad_showbits_rev(ld, n);
277 faad_flushbits_rev(ld, n);
278
279 #ifdef ANALYSIS
280 if (print)
281 fprintf(stdout, "%4d %2d bits, val: %4d, variable: %d %s\n", dbg_count++, n, ret, var, dbg);
282 #endif
283
284 return ret;
285 }
286
287 #ifdef DRM
288 /* CRC lookup table for G8 polynome in DRM standard */
289 static const uint8_t crc_table_G8[256] = {
290 0x0, 0x1d, 0x3a, 0x27, 0x74, 0x69, 0x4e, 0x53,
291 0xe8, 0xf5, 0xd2, 0xcf, 0x9c, 0x81, 0xa6, 0xbb,
292 0xcd, 0xd0, 0xf7, 0xea, 0xb9, 0xa4, 0x83, 0x9e,
293 0x25, 0x38, 0x1f, 0x2, 0x51, 0x4c, 0x6b, 0x76,
294 0x87, 0x9a, 0xbd, 0xa0, 0xf3, 0xee, 0xc9, 0xd4,
295 0x6f, 0x72, 0x55, 0x48, 0x1b, 0x6, 0x21, 0x3c,
296 0x4a, 0x57, 0x70, 0x6d, 0x3e, 0x23, 0x4, 0x19,
297 0xa2, 0xbf, 0x98, 0x85, 0xd6, 0xcb, 0xec, 0xf1,
298 0x13, 0xe, 0x29, 0x34, 0x67, 0x7a, 0x5d, 0x40,
299 0xfb, 0xe6, 0xc1, 0xdc, 0x8f, 0x92, 0xb5, 0xa8,
300 0xde, 0xc3, 0xe4, 0xf9, 0xaa, 0xb7, 0x90, 0x8d,
301 0x36, 0x2b, 0xc, 0x11, 0x42, 0x5f, 0x78, 0x65,
302 0x94, 0x89, 0xae, 0xb3, 0xe0, 0xfd, 0xda, 0xc7,
303 0x7c, 0x61, 0x46, 0x5b, 0x8, 0x15, 0x32, 0x2f,
304 0x59, 0x44, 0x63, 0x7e, 0x2d, 0x30, 0x17, 0xa,
305 0xb1, 0xac, 0x8b, 0x96, 0xc5, 0xd8, 0xff, 0xe2,
306 0x26, 0x3b, 0x1c, 0x1, 0x52, 0x4f, 0x68, 0x75,
307 0xce, 0xd3, 0xf4, 0xe9, 0xba, 0xa7, 0x80, 0x9d,
308 0xeb, 0xf6, 0xd1, 0xcc, 0x9f, 0x82, 0xa5, 0xb8,
309 0x3, 0x1e, 0x39, 0x24, 0x77, 0x6a, 0x4d, 0x50,
310 0xa1, 0xbc, 0x9b, 0x86, 0xd5, 0xc8, 0xef, 0xf2,
311 0x49, 0x54, 0x73, 0x6e, 0x3d, 0x20, 0x7, 0x1a,
312 0x6c, 0x71, 0x56, 0x4b, 0x18, 0x5, 0x22, 0x3f,
313 0x84, 0x99, 0xbe, 0xa3, 0xf0, 0xed, 0xca, 0xd7,
314 0x35, 0x28, 0xf, 0x12, 0x41, 0x5c, 0x7b, 0x66,
315 0xdd, 0xc0, 0xe7, 0xfa, 0xa9, 0xb4, 0x93, 0x8e,
316 0xf8, 0xe5, 0xc2, 0xdf, 0x8c, 0x91, 0xb6, 0xab,
317 0x10, 0xd, 0x2a, 0x37, 0x64, 0x79, 0x5e, 0x43,
318 0xb2, 0xaf, 0x88, 0x95, 0xc6, 0xdb, 0xfc, 0xe1,
319 0x5a, 0x47, 0x60, 0x7d, 0x2e, 0x33, 0x14, 0x9,
320 0x7f, 0x62, 0x45, 0x58, 0xb, 0x16, 0x31, 0x2c,
321 0x97, 0x8a, 0xad, 0xb0, 0xe3, 0xfe, 0xd9, 0xc4,
322 };
323
324 static uint8_t faad_check_CRC(bitfile *ld, uint16_t len)
325 {
326 int bytes, rem;
327 unsigned int CRC;
328 unsigned int r=255; /* Initialize to all ones */
329
330 /* CRC polynome used x^8 + x^4 + x^3 + x^2 +1 */
331 #define GPOLY 0435
332
333 faad_rewindbits(ld);
334
335 CRC = (unsigned int) ~faad_getbits(ld, 8
336 DEBUGVAR(1,999,"faad_check_CRC(): CRC")) & 0xFF; /* CRC is stored inverted */
337
338 bytes = len >> 3;
339 rem = len & 0x7;
340
341 for (; bytes > 0; bytes--)
342 {
343 r = crc_table_G8[( r ^ faad_getbits(ld, 8 DEBUGVAR(1,998,"")) ) & 0xFF];
344 }
345 for (; rem > 0; rem--)
346 {
347 r = ( (r << 1) ^ (( ( faad_get1bit(ld
348 DEBUGVAR(1,998,"")) & 1) ^ ((r >> 7) & 1)) * GPOLY )) & 0xFF;
349 }
350
351 if (r != CRC)
352 // if (0)
353 {
354 return 28;
355 } else {
356 return 0;
357 }
358 }
359
360 static uint8_t tabFlipbits[256] = {
361 0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,
362 8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,
363 4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,
364 12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,
365 2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,
366 10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,
367 6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,
368 14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,
369 1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,
370 9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,
371 5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,
372 13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,
373 3,131,67,195,35,163,99,227,19,147,83,211,51,179,115,243,
374 11,139,75,203,43,171,107,235,27,155,91,219,59,187,123,251,
375 7,135,71,199,39,167,103,231,23,151,87,215,55,183,119,247,
376 15,143,79,207,47,175,111,239,31,159,95,223,63,191,127,255
377 };
378 #endif
379
380 #ifdef ERROR_RESILIENCE
381
382 /* Modified bit reading functions for HCR */
383
384 typedef struct
385 {
386 /* bit input */
387 uint32_t bufa;
388 uint32_t bufb;
389 int8_t len;
390 } bits_t;
391
392
393 static INLINE uint32_t showbits_hcr(bits_t *ld, uint8_t bits)
394 {
395 if (bits == 0) return 0;
396 if (ld->len <= 32)
397 {
398 /* huffman_spectral_data_2 needs to read more than may be available, bits maybe
399 > ld->len, deliver 0 than */
400 if (ld->len >= bits)
401 return ((ld->bufa >> (ld->len - bits)) & (0xFFFFFFFF >> (32 - bits)));
402 else
403 return ((ld->bufa << (bits - ld->len)) & (0xFFFFFFFF >> (32 - bits)));
404 } else {
405 if ((ld->len - bits) < 32)
406 {
407 return ( (ld->bufb & (0xFFFFFFFF >> (64 - ld->len))) << (bits - ld->len + 32)) |
408 (ld->bufa >> (ld->len - bits));
409 } else {
410 return ((ld->bufb >> (ld->len - bits - 32)) & (0xFFFFFFFF >> (32 - bits)));
411 }
412 }
413 }
414
415 /* return 1 if position is outside of buffer, 0 otherwise */
416 static INLINE int8_t flushbits_hcr( bits_t *ld, uint8_t bits)
417 {
418 ld->len -= bits;
419
420 if (ld->len <0)
421 {
422 ld->len = 0;
423 return 1;
424 } else {
425 return 0;
426 }
427 }
428
429 static INLINE int8_t getbits_hcr(bits_t *ld, uint8_t n, uint32_t *result)
430 {
431 *result = showbits_hcr(ld, n);
432 return flushbits_hcr(ld, n);
433 }
434
435 static INLINE int8_t get1bit_hcr(bits_t *ld, uint8_t *result)
436 {
437 uint32_t res;
438 int8_t ret;
439
440 ret = getbits_hcr(ld, 1, &res);
441 *result = (int8_t)(res & 1);
442 return ret;
443 }
444
445 #endif
446
447
448 #ifdef __cplusplus
449 }
450 #endif
451 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: cfft.c,v 1.35 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 /*
31 * Algorithmically based on Fortran-77 FFTPACK
32 * by Paul N. Swarztrauber(Version 4, 1985).
33 *
34 * Does even sized fft only
35 */
36
37 /* isign is +1 for backward and -1 for forward transforms */
38
39 #include "common.h"
40 #include "structs.h"
41
42 #include <stdlib.h>
43
44 #include "cfft.h"
45 #include "cfft_tab.h"
46
47
48 /* static function declarations */
49 static void passf2pos(const uint16_t ido, const uint16_t l1, const complex_t *cc,
50 complex_t *ch, const complex_t *wa);
51 static void passf2neg(const uint16_t ido, const uint16_t l1, const complex_t *cc,
52 complex_t *ch, const complex_t *wa);
53 static void passf3(const uint16_t ido, const uint16_t l1, const complex_t *cc,
54 complex_t *ch, const complex_t *wa1, const complex_t *wa2, const int8_t isign);
55 static void passf4pos(const uint16_t ido, const uint16_t l1, const complex_t *cc, complex_t *ch,
56 const complex_t *wa1, const complex_t *wa2, const complex_t *wa3);
57 static void passf4neg(const uint16_t ido, const uint16_t l1, const complex_t *cc, complex_t *ch,
58 const complex_t *wa1, const complex_t *wa2, const complex_t *wa3);
59 static void passf5(const uint16_t ido, const uint16_t l1, const complex_t *cc, complex_t *ch,
60 const complex_t *wa1, const complex_t *wa2, const complex_t *wa3,
61 const complex_t *wa4, const int8_t isign);
62 INLINE void cfftf1(uint16_t n, complex_t *c, complex_t *ch,
63 const uint16_t *ifac, const complex_t *wa, const int8_t isign);
64 static void cffti1(uint16_t n, complex_t *wa, uint16_t *ifac);
65
66
67 /*----------------------------------------------------------------------
68 passf2, passf3, passf4, passf5. Complex FFT passes fwd and bwd.
69 ----------------------------------------------------------------------*/
70
71 static void passf2pos(const uint16_t ido, const uint16_t l1, const complex_t *cc,
72 complex_t *ch, const complex_t *wa)
73 {
74 uint16_t i, k, ah, ac;
75
76 if (ido == 1)
77 {
78 for (k = 0; k < l1; k++)
79 {
80 ah = 2*k;
81 ac = 4*k;
82
83 RE(ch[ah]) = RE(cc[ac]) + RE(cc[ac+1]);
84 RE(ch[ah+l1]) = RE(cc[ac]) - RE(cc[ac+1]);
85 IM(ch[ah]) = IM(cc[ac]) + IM(cc[ac+1]);
86 IM(ch[ah+l1]) = IM(cc[ac]) - IM(cc[ac+1]);
87 }
88 } else {
89 for (k = 0; k < l1; k++)
90 {
91 ah = k*ido;
92 ac = 2*k*ido;
93
94 for (i = 0; i < ido; i++)
95 {
96 complex_t t2;
97
98 RE(ch[ah+i]) = RE(cc[ac+i]) + RE(cc[ac+i+ido]);
99 RE(t2) = RE(cc[ac+i]) - RE(cc[ac+i+ido]);
100
101 IM(ch[ah+i]) = IM(cc[ac+i]) + IM(cc[ac+i+ido]);
102 IM(t2) = IM(cc[ac+i]) - IM(cc[ac+i+ido]);
103
104 #if 1
105 ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
106 IM(t2), RE(t2), RE(wa[i]), IM(wa[i]));
107 #else
108 ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]),
109 RE(t2), IM(t2), RE(wa[i]), IM(wa[i]));
110 #endif
111 }
112 }
113 }
114 }
115
116 static void passf2neg(const uint16_t ido, const uint16_t l1, const complex_t *cc,
117 complex_t *ch, const complex_t *wa)
118 {
119 uint16_t i, k, ah, ac;
120
121 if (ido == 1)
122 {
123 for (k = 0; k < l1; k++)
124 {
125 ah = 2*k;
126 ac = 4*k;
127
128 RE(ch[ah]) = RE(cc[ac]) + RE(cc[ac+1]);
129 RE(ch[ah+l1]) = RE(cc[ac]) - RE(cc[ac+1]);
130 IM(ch[ah]) = IM(cc[ac]) + IM(cc[ac+1]);
131 IM(ch[ah+l1]) = IM(cc[ac]) - IM(cc[ac+1]);
132 }
133 } else {
134 for (k = 0; k < l1; k++)
135 {
136 ah = k*ido;
137 ac = 2*k*ido;
138
139 for (i = 0; i < ido; i++)
140 {
141 complex_t t2;
142
143 RE(ch[ah+i]) = RE(cc[ac+i]) + RE(cc[ac+i+ido]);
144 RE(t2) = RE(cc[ac+i]) - RE(cc[ac+i+ido]);
145
146 IM(ch[ah+i]) = IM(cc[ac+i]) + IM(cc[ac+i+ido]);
147 IM(t2) = IM(cc[ac+i]) - IM(cc[ac+i+ido]);
148
149 #if 1
150 ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]),
151 RE(t2), IM(t2), RE(wa[i]), IM(wa[i]));
152 #else
153 ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
154 IM(t2), RE(t2), RE(wa[i]), IM(wa[i]));
155 #endif
156 }
157 }
158 }
159 }
160
161
162 static void passf3(const uint16_t ido, const uint16_t l1, const complex_t *cc,
163 complex_t *ch, const complex_t *wa1, const complex_t *wa2,
164 const int8_t isign)
165 {
166 static real_t taur = FRAC_CONST(-0.5);
167 static real_t taui = FRAC_CONST(0.866025403784439);
168 uint16_t i, k, ac, ah;
169 complex_t c2, c3, d2, d3, t2;
170
171 if (ido == 1)
172 {
173 if (isign == 1)
174 {
175 for (k = 0; k < l1; k++)
176 {
177 ac = 3*k+1;
178 ah = k;
179
180 RE(t2) = RE(cc[ac]) + RE(cc[ac+1]);
181 IM(t2) = IM(cc[ac]) + IM(cc[ac+1]);
182 RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),taur);
183 IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),taur);
184
185 RE(ch[ah]) = RE(cc[ac-1]) + RE(t2);
186 IM(ch[ah]) = IM(cc[ac-1]) + IM(t2);
187
188 RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+1])), taui);
189 IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+1])), taui);
190
191 RE(ch[ah+l1]) = RE(c2) - IM(c3);
192 IM(ch[ah+l1]) = IM(c2) + RE(c3);
193 RE(ch[ah+2*l1]) = RE(c2) + IM(c3);
194 IM(ch[ah+2*l1]) = IM(c2) - RE(c3);
195 }
196 } else {
197 for (k = 0; k < l1; k++)
198 {
199 ac = 3*k+1;
200 ah = k;
201
202 RE(t2) = RE(cc[ac]) + RE(cc[ac+1]);
203 IM(t2) = IM(cc[ac]) + IM(cc[ac+1]);
204 RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),taur);
205 IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),taur);
206
207 RE(ch[ah]) = RE(cc[ac-1]) + RE(t2);
208 IM(ch[ah]) = IM(cc[ac-1]) + IM(t2);
209
210 RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+1])), taui);
211 IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+1])), taui);
212
213 RE(ch[ah+l1]) = RE(c2) + IM(c3);
214 IM(ch[ah+l1]) = IM(c2) - RE(c3);
215 RE(ch[ah+2*l1]) = RE(c2) - IM(c3);
216 IM(ch[ah+2*l1]) = IM(c2) + RE(c3);
217 }
218 }
219 } else {
220 if (isign == 1)
221 {
222 for (k = 0; k < l1; k++)
223 {
224 for (i = 0; i < ido; i++)
225 {
226 ac = i + (3*k+1)*ido;
227 ah = i + k * ido;
228
229 RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
230 RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur);
231 IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
232 IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur);
233
234 RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
235 IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
236
237 RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+ido])), taui);
238 IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+ido])), taui);
239
240 RE(d2) = RE(c2) - IM(c3);
241 IM(d3) = IM(c2) - RE(c3);
242 RE(d3) = RE(c2) + IM(c3);
243 IM(d2) = IM(c2) + RE(c3);
244
245 #if 1
246 ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
247 IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
248 ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
249 IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
250 #else
251 ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
252 RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
253 ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
254 RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
255 #endif
256 }
257 }
258 } else {
259 for (k = 0; k < l1; k++)
260 {
261 for (i = 0; i < ido; i++)
262 {
263 ac = i + (3*k+1)*ido;
264 ah = i + k * ido;
265
266 RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
267 RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur);
268 IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
269 IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur);
270
271 RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
272 IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
273
274 RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+ido])), taui);
275 IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+ido])), taui);
276
277 RE(d2) = RE(c2) + IM(c3);
278 IM(d3) = IM(c2) + RE(c3);
279 RE(d3) = RE(c2) - IM(c3);
280 IM(d2) = IM(c2) - RE(c3);
281
282 #if 1
283 ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
284 RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
285 ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
286 RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
287 #else
288 ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
289 IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
290 ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
291 IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
292 #endif
293 }
294 }
295 }
296 }
297 }
298
299
300 static void passf4pos(const uint16_t ido, const uint16_t l1, const complex_t *cc,
301 complex_t *ch, const complex_t *wa1, const complex_t *wa2,
302 const complex_t *wa3)
303 {
304 uint16_t i, k, ac, ah;
305
306 if (ido == 1)
307 {
308 for (k = 0; k < l1; k++)
309 {
310 complex_t t1, t2, t3, t4;
311
312 ac = 4*k;
313 ah = k;
314
315 RE(t2) = RE(cc[ac]) + RE(cc[ac+2]);
316 RE(t1) = RE(cc[ac]) - RE(cc[ac+2]);
317 IM(t2) = IM(cc[ac]) + IM(cc[ac+2]);
318 IM(t1) = IM(cc[ac]) - IM(cc[ac+2]);
319 RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]);
320 IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]);
321 IM(t3) = IM(cc[ac+3]) + IM(cc[ac+1]);
322 RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]);
323
324 RE(ch[ah]) = RE(t2) + RE(t3);
325 RE(ch[ah+2*l1]) = RE(t2) - RE(t3);
326
327 IM(ch[ah]) = IM(t2) + IM(t3);
328 IM(ch[ah+2*l1]) = IM(t2) - IM(t3);
329
330 RE(ch[ah+l1]) = RE(t1) + RE(t4);
331 RE(ch[ah+3*l1]) = RE(t1) - RE(t4);
332
333 IM(ch[ah+l1]) = IM(t1) + IM(t4);
334 IM(ch[ah+3*l1]) = IM(t1) - IM(t4);
335 }
336 } else {
337 for (k = 0; k < l1; k++)
338 {
339 ac = 4*k*ido;
340 ah = k*ido;
341
342 for (i = 0; i < ido; i++)
343 {
344 complex_t c2, c3, c4, t1, t2, t3, t4;
345
346 RE(t2) = RE(cc[ac+i]) + RE(cc[ac+i+2*ido]);
347 RE(t1) = RE(cc[ac+i]) - RE(cc[ac+i+2*ido]);
348 IM(t2) = IM(cc[ac+i]) + IM(cc[ac+i+2*ido]);
349 IM(t1) = IM(cc[ac+i]) - IM(cc[ac+i+2*ido]);
350 RE(t3) = RE(cc[ac+i+ido]) + RE(cc[ac+i+3*ido]);
351 IM(t4) = RE(cc[ac+i+ido]) - RE(cc[ac+i+3*ido]);
352 IM(t3) = IM(cc[ac+i+3*ido]) + IM(cc[ac+i+ido]);
353 RE(t4) = IM(cc[ac+i+3*ido]) - IM(cc[ac+i+ido]);
354
355 RE(c2) = RE(t1) + RE(t4);
356 RE(c4) = RE(t1) - RE(t4);
357
358 IM(c2) = IM(t1) + IM(t4);
359 IM(c4) = IM(t1) - IM(t4);
360
361 RE(ch[ah+i]) = RE(t2) + RE(t3);
362 RE(c3) = RE(t2) - RE(t3);
363
364 IM(ch[ah+i]) = IM(t2) + IM(t3);
365 IM(c3) = IM(t2) - IM(t3);
366
367 #if 1
368 ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
369 IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i]));
370 ComplexMult(&IM(ch[ah+i+2*l1*ido]), &RE(ch[ah+i+2*l1*ido]),
371 IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i]));
372 ComplexMult(&IM(ch[ah+i+3*l1*ido]), &RE(ch[ah+i+3*l1*ido]),
373 IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i]));
374 #else
375 ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]),
376 RE(c2), IM(c2), RE(wa1[i]), IM(wa1[i]));
377 ComplexMult(&RE(ch[ah+i+2*l1*ido]), &IM(ch[ah+i+2*l1*ido]),
378 RE(c3), IM(c3), RE(wa2[i]), IM(wa2[i]));
379 ComplexMult(&RE(ch[ah+i+3*l1*ido]), &IM(ch[ah+i+3*l1*ido]),
380 RE(c4), IM(c4), RE(wa3[i]), IM(wa3[i]));
381 #endif
382 }
383 }
384 }
385 }
386
387 static void passf4neg(const uint16_t ido, const uint16_t l1, const complex_t *cc,
388 complex_t *ch, const complex_t *wa1, const complex_t *wa2,
389 const complex_t *wa3)
390 {
391 uint16_t i, k, ac, ah;
392
393 if (ido == 1)
394 {
395 for (k = 0; k < l1; k++)
396 {
397 complex_t t1, t2, t3, t4;
398
399 ac = 4*k;
400 ah = k;
401
402 RE(t2) = RE(cc[ac]) + RE(cc[ac+2]);
403 RE(t1) = RE(cc[ac]) - RE(cc[ac+2]);
404 IM(t2) = IM(cc[ac]) + IM(cc[ac+2]);
405 IM(t1) = IM(cc[ac]) - IM(cc[ac+2]);
406 RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]);
407 IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]);
408 IM(t3) = IM(cc[ac+3]) + IM(cc[ac+1]);
409 RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]);
410
411 RE(ch[ah]) = RE(t2) + RE(t3);
412 RE(ch[ah+2*l1]) = RE(t2) - RE(t3);
413
414 IM(ch[ah]) = IM(t2) + IM(t3);
415 IM(ch[ah+2*l1]) = IM(t2) - IM(t3);
416
417 RE(ch[ah+l1]) = RE(t1) - RE(t4);
418 RE(ch[ah+3*l1]) = RE(t1) + RE(t4);
419
420 IM(ch[ah+l1]) = IM(t1) - IM(t4);
421 IM(ch[ah+3*l1]) = IM(t1) + IM(t4);
422 }
423 } else {
424 for (k = 0; k < l1; k++)
425 {
426 ac = 4*k*ido;
427 ah = k*ido;
428
429 for (i = 0; i < ido; i++)
430 {
431 complex_t c2, c3, c4, t1, t2, t3, t4;
432
433 RE(t2) = RE(cc[ac+i]) + RE(cc[ac+i+2*ido]);
434 RE(t1) = RE(cc[ac+i]) - RE(cc[ac+i+2*ido]);
435 IM(t2) = IM(cc[ac+i]) + IM(cc[ac+i+2*ido]);
436 IM(t1) = IM(cc[ac+i]) - IM(cc[ac+i+2*ido]);
437 RE(t3) = RE(cc[ac+i+ido]) + RE(cc[ac+i+3*ido]);
438 IM(t4) = RE(cc[ac+i+ido]) - RE(cc[ac+i+3*ido]);
439 IM(t3) = IM(cc[ac+i+3*ido]) + IM(cc[ac+i+ido]);
440 RE(t4) = IM(cc[ac+i+3*ido]) - IM(cc[ac+i+ido]);
441
442 RE(c2) = RE(t1) - RE(t4);
443 RE(c4) = RE(t1) + RE(t4);
444
445 IM(c2) = IM(t1) - IM(t4);
446 IM(c4) = IM(t1) + IM(t4);
447
448 RE(ch[ah+i]) = RE(t2) + RE(t3);
449 RE(c3) = RE(t2) - RE(t3);
450
451 IM(ch[ah+i]) = IM(t2) + IM(t3);
452 IM(c3) = IM(t2) - IM(t3);
453
454 #if 1
455 ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]),
456 RE(c2), IM(c2), RE(wa1[i]), IM(wa1[i]));
457 ComplexMult(&RE(ch[ah+i+2*l1*ido]), &IM(ch[ah+i+2*l1*ido]),
458 RE(c3), IM(c3), RE(wa2[i]), IM(wa2[i]));
459 ComplexMult(&RE(ch[ah+i+3*l1*ido]), &IM(ch[ah+i+3*l1*ido]),
460 RE(c4), IM(c4), RE(wa3[i]), IM(wa3[i]));
461 #else
462 ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
463 IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i]));
464 ComplexMult(&IM(ch[ah+i+2*l1*ido]), &RE(ch[ah+i+2*l1*ido]),
465 IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i]));
466 ComplexMult(&IM(ch[ah+i+3*l1*ido]), &RE(ch[ah+i+3*l1*ido]),
467 IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i]));
468 #endif
469 }
470 }
471 }
472 }
473
474 static void passf5(const uint16_t ido, const uint16_t l1, const complex_t *cc,
475 complex_t *ch, const complex_t *wa1, const complex_t *wa2, const complex_t *wa3,
476 const complex_t *wa4, const int8_t isign)
477 {
478 static real_t tr11 = FRAC_CONST(0.309016994374947);
479 static real_t ti11 = FRAC_CONST(0.951056516295154);
480 static real_t tr12 = FRAC_CONST(-0.809016994374947);
481 static real_t ti12 = FRAC_CONST(0.587785252292473);
482 uint16_t i, k, ac, ah;
483 complex_t c2, c3, c4, c5, d3, d4, d5, d2, t2, t3, t4, t5;
484
485 if (ido == 1)
486 {
487 if (isign == 1)
488 {
489 for (k = 0; k < l1; k++)
490 {
491 ac = 5*k + 1;
492 ah = k;
493
494 RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
495 IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
496 RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
497 IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
498 RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
499 IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
500 RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
501 IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
502
503 RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
504 IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
505
506 RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
507 IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
508 RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
509 IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
510
511 ComplexMult(&RE(c5), &RE(c4),
512 ti11, ti12, RE(t5), RE(t4));
513 ComplexMult(&IM(c5), &IM(c4),
514 ti11, ti12, IM(t5), IM(t4));
515
516 RE(ch[ah+l1]) = RE(c2) - IM(c5);
517 IM(ch[ah+l1]) = IM(c2) + RE(c5);
518 RE(ch[ah+2*l1]) = RE(c3) - IM(c4);
519 IM(ch[ah+2*l1]) = IM(c3) + RE(c4);
520 RE(ch[ah+3*l1]) = RE(c3) + IM(c4);
521 IM(ch[ah+3*l1]) = IM(c3) - RE(c4);
522 RE(ch[ah+4*l1]) = RE(c2) + IM(c5);
523 IM(ch[ah+4*l1]) = IM(c2) - RE(c5);
524 }
525 } else {
526 for (k = 0; k < l1; k++)
527 {
528 ac = 5*k + 1;
529 ah = k;
530
531 RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
532 IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
533 RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
534 IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
535 RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
536 IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
537 RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
538 IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
539
540 RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
541 IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
542
543 RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
544 IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
545 RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
546 IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
547
548 ComplexMult(&RE(c4), &RE(c5),
549 ti12, ti11, RE(t5), RE(t4));
550 ComplexMult(&IM(c4), &IM(c5),
551 ti12, ti11, IM(t5), IM(t4));
552
553 RE(ch[ah+l1]) = RE(c2) + IM(c5);
554 IM(ch[ah+l1]) = IM(c2) - RE(c5);
555 RE(ch[ah+2*l1]) = RE(c3) + IM(c4);
556 IM(ch[ah+2*l1]) = IM(c3) - RE(c4);
557 RE(ch[ah+3*l1]) = RE(c3) - IM(c4);
558 IM(ch[ah+3*l1]) = IM(c3) + RE(c4);
559 RE(ch[ah+4*l1]) = RE(c2) - IM(c5);
560 IM(ch[ah+4*l1]) = IM(c2) + RE(c5);
561 }
562 }
563 } else {
564 if (isign == 1)
565 {
566 for (k = 0; k < l1; k++)
567 {
568 for (i = 0; i < ido; i++)
569 {
570 ac = i + (k*5 + 1) * ido;
571 ah = i + k * ido;
572
573 RE(t2) = RE(cc[ac]) + RE(cc[ac+3*ido]);
574 IM(t2) = IM(cc[ac]) + IM(cc[ac+3*ido]);
575 RE(t3) = RE(cc[ac+ido]) + RE(cc[ac+2*ido]);
576 IM(t3) = IM(cc[ac+ido]) + IM(cc[ac+2*ido]);
577 RE(t4) = RE(cc[ac+ido]) - RE(cc[ac+2*ido]);
578 IM(t4) = IM(cc[ac+ido]) - IM(cc[ac+2*ido]);
579 RE(t5) = RE(cc[ac]) - RE(cc[ac+3*ido]);
580 IM(t5) = IM(cc[ac]) - IM(cc[ac+3*ido]);
581
582 RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2) + RE(t3);
583 IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2) + IM(t3);
584
585 RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
586 IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
587 RE(c3) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
588 IM(c3) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
589
590 ComplexMult(&RE(c5), &RE(c4),
591 ti11, ti12, RE(t5), RE(t4));
592 ComplexMult(&IM(c5), &IM(c4),
593 ti11, ti12, IM(t5), IM(t4));
594
595 IM(d2) = IM(c2) + RE(c5);
596 IM(d3) = IM(c3) + RE(c4);
597 RE(d4) = RE(c3) + IM(c4);
598 RE(d5) = RE(c2) + IM(c5);
599 RE(d2) = RE(c2) - IM(c5);
600 IM(d5) = IM(c2) - RE(c5);
601 RE(d3) = RE(c3) - IM(c4);
602 IM(d4) = IM(c3) - RE(c4);
603
604 #if 1
605 ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
606 IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
607 ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
608 IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
609 ComplexMult(&IM(ch[ah+3*l1*ido]), &RE(ch[ah+3*l1*ido]),
610 IM(d4), RE(d4), RE(wa3[i]), IM(wa3[i]));
611 ComplexMult(&IM(ch[ah+4*l1*ido]), &RE(ch[ah+4*l1*ido]),
612 IM(d5), RE(d5), RE(wa4[i]), IM(wa4[i]));
613 #else
614 ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
615 RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
616 ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
617 RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
618 ComplexMult(&RE(ch[ah+3*l1*ido]), &IM(ch[ah+3*l1*ido]),
619 RE(d4), IM(d4), RE(wa3[i]), IM(wa3[i]));
620 ComplexMult(&RE(ch[ah+4*l1*ido]), &IM(ch[ah+4*l1*ido]),
621 RE(d5), IM(d5), RE(wa4[i]), IM(wa4[i]));
622 #endif
623 }
624 }
625 } else {
626 for (k = 0; k < l1; k++)
627 {
628 for (i = 0; i < ido; i++)
629 {
630 ac = i + (k*5 + 1) * ido;
631 ah = i + k * ido;
632
633 RE(t2) = RE(cc[ac]) + RE(cc[ac+3*ido]);
634 IM(t2) = IM(cc[ac]) + IM(cc[ac+3*ido]);
635 RE(t3) = RE(cc[ac+ido]) + RE(cc[ac+2*ido]);
636 IM(t3) = IM(cc[ac+ido]) + IM(cc[ac+2*ido]);
637 RE(t4) = RE(cc[ac+ido]) - RE(cc[ac+2*ido]);
638 IM(t4) = IM(cc[ac+ido]) - IM(cc[ac+2*ido]);
639 RE(t5) = RE(cc[ac]) - RE(cc[ac+3*ido]);
640 IM(t5) = IM(cc[ac]) - IM(cc[ac+3*ido]);
641
642 RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2) + RE(t3);
643 IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2) + IM(t3);
644
645 RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
646 IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
647 RE(c3) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
648 IM(c3) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
649
650 ComplexMult(&RE(c4), &RE(c5),
651 ti12, ti11, RE(t5), RE(t4));
652 ComplexMult(&IM(c4), &IM(c5),
653 ti12, ti11, IM(t5), IM(t4));
654
655 IM(d2) = IM(c2) - RE(c5);
656 IM(d3) = IM(c3) - RE(c4);
657 RE(d4) = RE(c3) - IM(c4);
658 RE(d5) = RE(c2) - IM(c5);
659 RE(d2) = RE(c2) + IM(c5);
660 IM(d5) = IM(c2) + RE(c5);
661 RE(d3) = RE(c3) + IM(c4);
662 IM(d4) = IM(c3) + RE(c4);
663
664 #if 1
665 ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
666 RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
667 ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
668 RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
669 ComplexMult(&RE(ch[ah+3*l1*ido]), &IM(ch[ah+3*l1*ido]),
670 RE(d4), IM(d4), RE(wa3[i]), IM(wa3[i]));
671 ComplexMult(&RE(ch[ah+4*l1*ido]), &IM(ch[ah+4*l1*ido]),
672 RE(d5), IM(d5), RE(wa4[i]), IM(wa4[i]));
673 #else
674 ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
675 IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
676 ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
677 IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
678 ComplexMult(&IM(ch[ah+3*l1*ido]), &RE(ch[ah+3*l1*ido]),
679 IM(d4), RE(d4), RE(wa3[i]), IM(wa3[i]));
680 ComplexMult(&IM(ch[ah+4*l1*ido]), &RE(ch[ah+4*l1*ido]),
681 IM(d5), RE(d5), RE(wa4[i]), IM(wa4[i]));
682 #endif
683 }
684 }
685 }
686 }
687 }
688
689
690 /*----------------------------------------------------------------------
691 cfftf1, cfftf, cfftb, cffti1, cffti. Complex FFTs.
692 ----------------------------------------------------------------------*/
693
694 static INLINE void cfftf1pos(uint16_t n, complex_t *c, complex_t *ch,
695 const uint16_t *ifac, const complex_t *wa,
696 const int8_t isign)
697 {
698 uint16_t i;
699 uint16_t k1, l1, l2;
700 uint16_t na, nf, ip, iw, ix2, ix3, ix4, ido, idl1;
701
702 nf = ifac[1];
703 na = 0;
704 l1 = 1;
705 iw = 0;
706
707 for (k1 = 2; k1 <= nf+1; k1++)
708 {
709 ip = ifac[k1];
710 l2 = ip*l1;
711 ido = n / l2;
712 idl1 = ido*l1;
713
714 switch (ip)
715 {
716 case 4:
717 ix2 = iw + ido;
718 ix3 = ix2 + ido;
719
720 if (na == 0)
721 passf4pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]);
722 else
723 passf4pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]);
724
725 na = 1 - na;
726 break;
727 case 2:
728 if (na == 0)
729 passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]);
730 else
731 passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]);
732
733 na = 1 - na;
734 break;
735 case 3:
736 ix2 = iw + ido;
737
738 if (na == 0)
739 passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], isign);
740 else
741 passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], isign);
742
743 na = 1 - na;
744 break;
745 case 5:
746 ix2 = iw + ido;
747 ix3 = ix2 + ido;
748 ix4 = ix3 + ido;
749
750 if (na == 0)
751 passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
752 else
753 passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
754
755 na = 1 - na;
756 break;
757 }
758
759 l1 = l2;
760 iw += (ip-1) * ido;
761 }
762
763 if (na == 0)
764 return;
765
766 for (i = 0; i < n; i++)
767 {
768 RE(c[i]) = RE(ch[i]);
769 IM(c[i]) = IM(ch[i]);
770 }
771 }
772
773 static INLINE void cfftf1neg(uint16_t n, complex_t *c, complex_t *ch,
774 const uint16_t *ifac, const complex_t *wa,
775 const int8_t isign)
776 {
777 uint16_t i;
778 uint16_t k1, l1, l2;
779 uint16_t na, nf, ip, iw, ix2, ix3, ix4, ido, idl1;
780
781 nf = ifac[1];
782 na = 0;
783 l1 = 1;
784 iw = 0;
785
786 for (k1 = 2; k1 <= nf+1; k1++)
787 {
788 ip = ifac[k1];
789 l2 = ip*l1;
790 ido = n / l2;
791 idl1 = ido*l1;
792
793 switch (ip)
794 {
795 case 4:
796 ix2 = iw + ido;
797 ix3 = ix2 + ido;
798
799 if (na == 0)
800 passf4neg((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]);
801 else
802 passf4neg((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]);
803
804 na = 1 - na;
805 break;
806 case 2:
807 if (na == 0)
808 passf2neg((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]);
809 else
810 passf2neg((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]);
811
812 na = 1 - na;
813 break;
814 case 3:
815 ix2 = iw + ido;
816
817 if (na == 0)
818 passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], isign);
819 else
820 passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], isign);
821
822 na = 1 - na;
823 break;
824 case 5:
825 ix2 = iw + ido;
826 ix3 = ix2 + ido;
827 ix4 = ix3 + ido;
828
829 if (na == 0)
830 passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
831 else
832 passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
833
834 na = 1 - na;
835 break;
836 }
837
838 l1 = l2;
839 iw += (ip-1) * ido;
840 }
841
842 if (na == 0)
843 return;
844
845 for (i = 0; i < n; i++)
846 {
847 RE(c[i]) = RE(ch[i]);
848 IM(c[i]) = IM(ch[i]);
849 }
850 }
851
852 void cfftf(cfft_info *cfft, complex_t *c)
853 {
854 cfftf1neg(cfft->n, c, cfft->work, (const uint16_t*)cfft->ifac, (const complex_t*)cfft->tab, -1);
855 }
856
857 void cfftb(cfft_info *cfft, complex_t *c)
858 {
859 cfftf1pos(cfft->n, c, cfft->work, (const uint16_t*)cfft->ifac, (const complex_t*)cfft->tab, +1);
860 }
861
862 static void cffti1(uint16_t n, complex_t *wa, uint16_t *ifac)
863 {
864 static uint16_t ntryh[4] = {3, 4, 2, 5};
865 #ifndef FIXED_POINT
866 real_t arg, argh, argld, fi;
867 uint16_t ido, ipm;
868 uint16_t i1, k1, l1, l2;
869 uint16_t ld, ii, ip;
870 #endif
871 uint16_t ntry = 0, i, j;
872 uint16_t ib;
873 uint16_t nf, nl, nq, nr;
874
875 nl = n;
876 nf = 0;
877 j = 0;
878
879 startloop:
880 j++;
881
882 if (j <= 4)
883 ntry = ntryh[j-1];
884 else
885 ntry += 2;
886
887 do
888 {
889 nq = nl / ntry;
890 nr = nl - ntry*nq;
891
892 if (nr != 0)
893 goto startloop;
894
895 nf++;
896 ifac[nf+1] = ntry;
897 nl = nq;
898
899 if (ntry == 2 && nf != 1)
900 {
901 for (i = 2; i <= nf; i++)
902 {
903 ib = nf - i + 2;
904 ifac[ib+1] = ifac[ib];
905 }
906 ifac[2] = 2;
907 }
908 } while (nl != 1);
909
910 ifac[0] = n;
911 ifac[1] = nf;
912
913 #ifndef FIXED_POINT
914 argh = (real_t)2.0*(real_t)M_PI / (real_t)n;
915 i = 0;
916 l1 = 1;
917
918 for (k1 = 1; k1 <= nf; k1++)
919 {
920 ip = ifac[k1+1];
921 ld = 0;
922 l2 = l1*ip;
923 ido = n / l2;
924 ipm = ip - 1;
925
926 for (j = 0; j < ipm; j++)
927 {
928 i1 = i;
929 RE(wa[i]) = 1.0;
930 IM(wa[i]) = 0.0;
931 ld += l1;
932 fi = 0;
933 argld = ld*argh;
934
935 for (ii = 0; ii < ido; ii++)
936 {
937 i++;
938 fi++;
939 arg = fi * argld;
940 RE(wa[i]) = (real_t)cos(arg);
941 #if 1
942 IM(wa[i]) = (real_t)sin(arg);
943 #else
944 IM(wa[i]) = (real_t)-sin(arg);
945 #endif
946 }
947
948 if (ip > 5)
949 {
950 RE(wa[i1]) = RE(wa[i]);
951 IM(wa[i1]) = IM(wa[i]);
952 }
953 }
954 l1 = l2;
955 }
956 #endif
957 }
958
959 cfft_info *cffti(uint16_t n)
960 {
961 cfft_info *cfft = (cfft_info*)faad_malloc(sizeof(cfft_info));
962
963 cfft->n = n;
964 cfft->work = (complex_t*)faad_malloc(n*sizeof(complex_t));
965
966 #ifndef FIXED_POINT
967 cfft->tab = (complex_t*)faad_malloc(n*sizeof(complex_t));
968
969 cffti1(n, cfft->tab, cfft->ifac);
970 #else
971 cffti1(n, NULL, cfft->ifac);
972
973 switch (n)
974 {
975 case 64: cfft->tab = (complex_t*)cfft_tab_64; break;
976 case 512: cfft->tab = (complex_t*)cfft_tab_512; break;
977 #ifdef LD_DEC
978 case 256: cfft->tab = (complex_t*)cfft_tab_256; break;
979 #endif
980
981 #ifdef ALLOW_SMALL_FRAMELENGTH
982 case 60: cfft->tab = (complex_t*)cfft_tab_60; break;
983 case 480: cfft->tab = (complex_t*)cfft_tab_480; break;
984 #ifdef LD_DEC
985 case 240: cfft->tab = (complex_t*)cfft_tab_240; break;
986 #endif
987 #endif
988 case 128: cfft->tab = (complex_t*)cfft_tab_128; break;
989 }
990 #endif
991
992 return cfft;
993 }
994
995 void cfftu(cfft_info *cfft)
996 {
997 if (cfft->work) faad_free(cfft->work);
998 #ifndef FIXED_POINT
999 if (cfft->tab) faad_free(cfft->tab);
1000 #endif
1001
1002 if (cfft) faad_free(cfft);
1003 }
1004
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: cfft.h,v 1.24 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 #ifndef __CFFT_H__
31 #define __CFFT_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 typedef struct
38 {
39 uint16_t n;
40 uint16_t ifac[15];
41 complex_t *work;
42 complex_t *tab;
43 } cfft_info;
44
45
46 void cfftf(cfft_info *cfft, complex_t *c);
47 void cfftb(cfft_info *cfft, complex_t *c);
48 cfft_info *cffti(uint16_t n);
49 void cfftu(cfft_info *cfft);
50
51
52 #ifdef __cplusplus
53 }
54 #endif
55 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: cfft_tab.h,v 1.21 2007/11/01 12:33:29 menno Exp $
28 **/
29
30 #ifndef __CFFT_TAB_H__
31 #define __CFFT_TAB_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #ifdef FIXED_POINT
38
39 ALIGN static const complex_t cfft_tab_512[] =
40 {
41 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
42 { FRAC_CONST(0.999924719333649), FRAC_CONST(0.012271538376808) },
43 { FRAC_CONST(0.999698817729950), FRAC_CONST(0.024541229009628) },
44 { FRAC_CONST(0.999322354793549), FRAC_CONST(0.036807224154472) },
45 { FRAC_CONST(0.998795449733734), FRAC_CONST(0.049067676067352) },
46 { FRAC_CONST(0.998118102550507), FRAC_CONST(0.061320740729570) },
47 { FRAC_CONST(0.997290432453156), FRAC_CONST(0.073564566671848) },
48 { FRAC_CONST(0.996312618255615), FRAC_CONST(0.085797317326069) },
49 { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
50 { FRAC_CONST(0.993906974792480), FRAC_CONST(0.110222205519676) },
51 { FRAC_CONST(0.992479562759399), FRAC_CONST(0.122410677373409) },
52 { FRAC_CONST(0.990902662277222), FRAC_CONST(0.134580716490746) },
53 { FRAC_CONST(0.989176511764526), FRAC_CONST(0.146730467677116) },
54 { FRAC_CONST(0.987301409244537), FRAC_CONST(0.158858150243759) },
55 { FRAC_CONST(0.985277652740479), FRAC_CONST(0.170961901545525) },
56 { FRAC_CONST(0.983105480670929), FRAC_CONST(0.183039888739586) },
57 { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
58 { FRAC_CONST(0.978317379951477), FRAC_CONST(0.207111388444901) },
59 { FRAC_CONST(0.975702106952667), FRAC_CONST(0.219101235270500) },
60 { FRAC_CONST(0.972939968109131), FRAC_CONST(0.231058120727539) },
61 { FRAC_CONST(0.970031261444092), FRAC_CONST(0.242980197072029) },
62 { FRAC_CONST(0.966976463794708), FRAC_CONST(0.254865676164627) },
63 { FRAC_CONST(0.963776051998138), FRAC_CONST(0.266712784767151) },
64 { FRAC_CONST(0.960430502891541), FRAC_CONST(0.278519690036774) },
65 { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
66 { FRAC_CONST(0.953306019306183), FRAC_CONST(0.302005946636200) },
67 { FRAC_CONST(0.949528157711029), FRAC_CONST(0.313681751489639) },
68 { FRAC_CONST(0.945607304573059), FRAC_CONST(0.325310319662094) },
69 { FRAC_CONST(0.941544055938721), FRAC_CONST(0.336889863014221) },
70 { FRAC_CONST(0.937339007854462), FRAC_CONST(0.348418682813644) },
71 { FRAC_CONST(0.932992815971375), FRAC_CONST(0.359895050525665) },
72 { FRAC_CONST(0.928506076335907), FRAC_CONST(0.371317207813263) },
73 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
74 { FRAC_CONST(0.919113874435425), FRAC_CONST(0.393992066383362) },
75 { FRAC_CONST(0.914209723472595), FRAC_CONST(0.405241340398788) },
76 { FRAC_CONST(0.909167945384979), FRAC_CONST(0.416429579257965) },
77 { FRAC_CONST(0.903989315032959), FRAC_CONST(0.427555084228516) },
78 { FRAC_CONST(0.898674488067627), FRAC_CONST(0.438616245985031) },
79 { FRAC_CONST(0.893224298954010), FRAC_CONST(0.449611335992813) },
80 { FRAC_CONST(0.887639641761780), FRAC_CONST(0.460538715124130) },
81 { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
82 { FRAC_CONST(0.876070082187653), FRAC_CONST(0.482183754444122) },
83 { FRAC_CONST(0.870086967945099), FRAC_CONST(0.492898225784302) },
84 { FRAC_CONST(0.863972842693329), FRAC_CONST(0.503538370132446) },
85 { FRAC_CONST(0.857728600502014), FRAC_CONST(0.514102756977081) },
86 { FRAC_CONST(0.851355195045471), FRAC_CONST(0.524589717388153) },
87 { FRAC_CONST(0.844853579998016), FRAC_CONST(0.534997642040253) },
88 { FRAC_CONST(0.838224709033966), FRAC_CONST(0.545324981212616) },
89 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
90 { FRAC_CONST(0.824589252471924), FRAC_CONST(0.565731823444366) },
91 { FRAC_CONST(0.817584812641144), FRAC_CONST(0.575808227062225) },
92 { FRAC_CONST(0.810457170009613), FRAC_CONST(0.585797905921936) },
93 { FRAC_CONST(0.803207516670227), FRAC_CONST(0.595699310302734) },
94 { FRAC_CONST(0.795836925506592), FRAC_CONST(0.605511009693146) },
95 { FRAC_CONST(0.788346409797668), FRAC_CONST(0.615231633186340) },
96 { FRAC_CONST(0.780737221240997), FRAC_CONST(0.624859511852264) },
97 { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
98 { FRAC_CONST(0.765167236328125), FRAC_CONST(0.643831551074982) },
99 { FRAC_CONST(0.757208824157715), FRAC_CONST(0.653172850608826) },
100 { FRAC_CONST(0.749136388301849), FRAC_CONST(0.662415802478790) },
101 { FRAC_CONST(0.740951120853424), FRAC_CONST(0.671558976173401) },
102 { FRAC_CONST(0.732654273509979), FRAC_CONST(0.680601000785828) },
103 { FRAC_CONST(0.724247097969055), FRAC_CONST(0.689540565013886) },
104 { FRAC_CONST(0.715730786323547), FRAC_CONST(0.698376297950745) },
105 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
106 { FRAC_CONST(0.698376238346100), FRAC_CONST(0.715730845928192) },
107 { FRAC_CONST(0.689540505409241), FRAC_CONST(0.724247097969055) },
108 { FRAC_CONST(0.680601000785828), FRAC_CONST(0.732654273509979) },
109 { FRAC_CONST(0.671558916568756), FRAC_CONST(0.740951180458069) },
110 { FRAC_CONST(0.662415742874146), FRAC_CONST(0.749136388301849) },
111 { FRAC_CONST(0.653172791004181), FRAC_CONST(0.757208883762360) },
112 { FRAC_CONST(0.643831551074982), FRAC_CONST(0.765167295932770) },
113 { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
114 { FRAC_CONST(0.624859452247620), FRAC_CONST(0.780737280845642) },
115 { FRAC_CONST(0.615231573581696), FRAC_CONST(0.788346409797668) },
116 { FRAC_CONST(0.605511009693146), FRAC_CONST(0.795836925506592) },
117 { FRAC_CONST(0.595699310302734), FRAC_CONST(0.803207516670227) },
118 { FRAC_CONST(0.585797846317291), FRAC_CONST(0.810457170009613) },
119 { FRAC_CONST(0.575808167457581), FRAC_CONST(0.817584812641144) },
120 { FRAC_CONST(0.565731823444366), FRAC_CONST(0.824589312076569) },
121 { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
122 { FRAC_CONST(0.545324981212616), FRAC_CONST(0.838224709033966) },
123 { FRAC_CONST(0.534997642040253), FRAC_CONST(0.844853579998016) },
124 { FRAC_CONST(0.524589657783508), FRAC_CONST(0.851355195045471) },
125 { FRAC_CONST(0.514102697372437), FRAC_CONST(0.857728660106659) },
126 { FRAC_CONST(0.503538429737091), FRAC_CONST(0.863972842693329) },
127 { FRAC_CONST(0.492898195981979), FRAC_CONST(0.870086967945099) },
128 { FRAC_CONST(0.482183724641800), FRAC_CONST(0.876070141792297) },
129 { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
130 { FRAC_CONST(0.460538715124130), FRAC_CONST(0.887639641761780) },
131 { FRAC_CONST(0.449611306190491), FRAC_CONST(0.893224298954010) },
132 { FRAC_CONST(0.438616186380386), FRAC_CONST(0.898674488067627) },
133 { FRAC_CONST(0.427555114030838), FRAC_CONST(0.903989315032959) },
134 { FRAC_CONST(0.416429549455643), FRAC_CONST(0.909168004989624) },
135 { FRAC_CONST(0.405241280794144), FRAC_CONST(0.914209783077240) },
136 { FRAC_CONST(0.393991947174072), FRAC_CONST(0.919113874435425) },
137 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
138 { FRAC_CONST(0.371317148208618), FRAC_CONST(0.928506076335907) },
139 { FRAC_CONST(0.359894961118698), FRAC_CONST(0.932992815971375) },
140 { FRAC_CONST(0.348418682813644), FRAC_CONST(0.937339007854462) },
141 { FRAC_CONST(0.336889833211899), FRAC_CONST(0.941544055938721) },
142 { FRAC_CONST(0.325310230255127), FRAC_CONST(0.945607364177704) },
143 { FRAC_CONST(0.313681662082672), FRAC_CONST(0.949528217315674) },
144 { FRAC_CONST(0.302005946636200), FRAC_CONST(0.953306019306183) },
145 { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
146 { FRAC_CONST(0.278519600629807), FRAC_CONST(0.960430562496185) },
147 { FRAC_CONST(0.266712754964828), FRAC_CONST(0.963776051998138) },
148 { FRAC_CONST(0.254865646362305), FRAC_CONST(0.966976463794708) },
149 { FRAC_CONST(0.242980122566223), FRAC_CONST(0.970031261444092) },
150 { FRAC_CONST(0.231058135628700), FRAC_CONST(0.972939968109131) },
151 { FRAC_CONST(0.219101220369339), FRAC_CONST(0.975702106952667) },
152 { FRAC_CONST(0.207111328840256), FRAC_CONST(0.978317379951477) },
153 { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
154 { FRAC_CONST(0.183039888739586), FRAC_CONST(0.983105480670929) },
155 { FRAC_CONST(0.170961856842041), FRAC_CONST(0.985277652740479) },
156 { FRAC_CONST(0.158858075737953), FRAC_CONST(0.987301409244537) },
157 { FRAC_CONST(0.146730497479439), FRAC_CONST(0.989176511764526) },
158 { FRAC_CONST(0.134580686688423), FRAC_CONST(0.990902662277222) },
159 { FRAC_CONST(0.122410625219345), FRAC_CONST(0.992479562759399) },
160 { FRAC_CONST(0.110222116112709), FRAC_CONST(0.993906974792480) },
161 { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
162 { FRAC_CONST(0.085797272622585), FRAC_CONST(0.996312618255615) },
163 { FRAC_CONST(0.073564492166042), FRAC_CONST(0.997290432453156) },
164 { FRAC_CONST(0.061320748180151), FRAC_CONST(0.998118102550507) },
165 { FRAC_CONST(0.049067649990320), FRAC_CONST(0.998795449733734) },
166 { FRAC_CONST(0.036807164549828), FRAC_CONST(0.999322414398193) },
167 { FRAC_CONST(0.024541135877371), FRAC_CONST(0.999698817729950) },
168 { FRAC_CONST(0.012271529063582), FRAC_CONST(0.999924719333649) },
169 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
170 { FRAC_CONST(-0.012271616607904), FRAC_CONST(0.999924719333649) },
171 { FRAC_CONST(-0.024541223421693), FRAC_CONST(0.999698817729950) },
172 { FRAC_CONST(-0.036807250231504), FRAC_CONST(0.999322354793549) },
173 { FRAC_CONST(-0.049067739397287), FRAC_CONST(0.998795449733734) },
174 { FRAC_CONST(-0.061320833861828), FRAC_CONST(0.998118102550507) },
175 { FRAC_CONST(-0.073564574122429), FRAC_CONST(0.997290432453156) },
176 { FRAC_CONST(-0.085797362029552), FRAC_CONST(0.996312618255615) },
177 { FRAC_CONST(-0.098017223179340), FRAC_CONST(0.995184719562531) },
178 { FRAC_CONST(-0.110222205519676), FRAC_CONST(0.993906974792480) },
179 { FRAC_CONST(-0.122410707175732), FRAC_CONST(0.992479503154755) },
180 { FRAC_CONST(-0.134580776095390), FRAC_CONST(0.990902602672577) },
181 { FRAC_CONST(-0.146730571985245), FRAC_CONST(0.989176511764526) },
182 { FRAC_CONST(-0.158858165144920), FRAC_CONST(0.987301409244537) },
183 { FRAC_CONST(-0.170961946249008), FRAC_CONST(0.985277652740479) },
184 { FRAC_CONST(-0.183039978146553), FRAC_CONST(0.983105480670929) },
185 { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
186 { FRAC_CONST(-0.207111418247223), FRAC_CONST(0.978317379951477) },
187 { FRAC_CONST(-0.219101309776306), FRAC_CONST(0.975702106952667) },
188 { FRAC_CONST(-0.231058210134506), FRAC_CONST(0.972939908504486) },
189 { FRAC_CONST(-0.242980197072029), FRAC_CONST(0.970031261444092) },
190 { FRAC_CONST(-0.254865705966949), FRAC_CONST(0.966976463794708) },
191 { FRAC_CONST(-0.266712844371796), FRAC_CONST(0.963776051998138) },
192 { FRAC_CONST(-0.278519690036774), FRAC_CONST(0.960430502891541) },
193 { FRAC_CONST(-0.290284723043442), FRAC_CONST(0.956940293312073) },
194 { FRAC_CONST(-0.302006036043167), FRAC_CONST(0.953306019306183) },
195 { FRAC_CONST(-0.313681721687317), FRAC_CONST(0.949528157711029) },
196 { FRAC_CONST(-0.325310319662094), FRAC_CONST(0.945607304573059) },
197 { FRAC_CONST(-0.336889922618866), FRAC_CONST(0.941544055938721) },
198 { FRAC_CONST(-0.348418772220612), FRAC_CONST(0.937338948249817) },
199 { FRAC_CONST(-0.359895050525665), FRAC_CONST(0.932992815971375) },
200 { FRAC_CONST(-0.371317237615585), FRAC_CONST(0.928506076335907) },
201 { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
202 { FRAC_CONST(-0.393992036581039), FRAC_CONST(0.919113874435425) },
203 { FRAC_CONST(-0.405241340398788), FRAC_CONST(0.914209723472595) },
204 { FRAC_CONST(-0.416429519653320), FRAC_CONST(0.909168004989624) },
205 { FRAC_CONST(-0.427555084228516), FRAC_CONST(0.903989315032959) },
206 { FRAC_CONST(-0.438616245985031), FRAC_CONST(0.898674428462982) },
207 { FRAC_CONST(-0.449611365795136), FRAC_CONST(0.893224298954010) },
208 { FRAC_CONST(-0.460538804531097), FRAC_CONST(0.887639582157135) },
209 { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
210 { FRAC_CONST(-0.482183903455734), FRAC_CONST(0.876070022583008) },
211 { FRAC_CONST(-0.492898166179657), FRAC_CONST(0.870087027549744) },
212 { FRAC_CONST(-0.503538370132446), FRAC_CONST(0.863972842693329) },
213 { FRAC_CONST(-0.514102756977081), FRAC_CONST(0.857728600502014) },
214 { FRAC_CONST(-0.524589717388153), FRAC_CONST(0.851355135440826) },
215 { FRAC_CONST(-0.534997701644897), FRAC_CONST(0.844853520393372) },
216 { FRAC_CONST(-0.545325100421906), FRAC_CONST(0.838224649429321) },
217 { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
218 { FRAC_CONST(-0.565731763839722), FRAC_CONST(0.824589312076569) },
219 { FRAC_CONST(-0.575808167457581), FRAC_CONST(0.817584812641144) },
220 { FRAC_CONST(-0.585797905921936), FRAC_CONST(0.810457170009613) },
221 { FRAC_CONST(-0.595699369907379), FRAC_CONST(0.803207516670227) },
222 { FRAC_CONST(-0.605511128902435), FRAC_CONST(0.795836865901947) },
223 { FRAC_CONST(-0.615231692790985), FRAC_CONST(0.788346350193024) },
224 { FRAC_CONST(-0.624859631061554), FRAC_CONST(0.780737102031708) },
225 { FRAC_CONST(-0.634393274784088), FRAC_CONST(0.773010492324829) },
226 { FRAC_CONST(-0.643831551074982), FRAC_CONST(0.765167236328125) },
227 { FRAC_CONST(-0.653172850608826), FRAC_CONST(0.757208824157715) },
228 { FRAC_CONST(-0.662415802478790), FRAC_CONST(0.749136328697205) },
229 { FRAC_CONST(-0.671559035778046), FRAC_CONST(0.740951061248779) },
230 { FRAC_CONST(-0.680601119995117), FRAC_CONST(0.732654154300690) },
231 { FRAC_CONST(-0.689540684223175), FRAC_CONST(0.724246978759766) },
232 { FRAC_CONST(-0.698376238346100), FRAC_CONST(0.715730845928192) },
233 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
234 { FRAC_CONST(-0.715730845928192), FRAC_CONST(0.698376238346100) },
235 { FRAC_CONST(-0.724247157573700), FRAC_CONST(0.689540505409241) },
236 { FRAC_CONST(-0.732654333114624), FRAC_CONST(0.680600941181183) },
237 { FRAC_CONST(-0.740951240062714), FRAC_CONST(0.671558856964111) },
238 { FRAC_CONST(-0.749136507511139), FRAC_CONST(0.662415623664856) },
239 { FRAC_CONST(-0.757208824157715), FRAC_CONST(0.653172850608826) },
240 { FRAC_CONST(-0.765167295932770), FRAC_CONST(0.643831551074982) },
241 { FRAC_CONST(-0.773010492324829), FRAC_CONST(0.634393274784088) },
242 { FRAC_CONST(-0.780737280845642), FRAC_CONST(0.624859452247620) },
243 { FRAC_CONST(-0.788346469402313), FRAC_CONST(0.615231513977051) },
244 { FRAC_CONST(-0.795836985111237), FRAC_CONST(0.605510950088501) },
245 { FRAC_CONST(-0.803207635879517), FRAC_CONST(0.595699131488800) },
246 { FRAC_CONST(-0.810457170009613), FRAC_CONST(0.585797846317291) },
247 { FRAC_CONST(-0.817584812641144), FRAC_CONST(0.575808167457581) },
248 { FRAC_CONST(-0.824589312076569), FRAC_CONST(0.565731763839722) },
249 { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
250 { FRAC_CONST(-0.838224768638611), FRAC_CONST(0.545324862003326) },
251 { FRAC_CONST(-0.844853639602661), FRAC_CONST(0.534997463226318) },
252 { FRAC_CONST(-0.851355314254761), FRAC_CONST(0.524589538574219) },
253 { FRAC_CONST(-0.857728600502014), FRAC_CONST(0.514102756977081) },
254 { FRAC_CONST(-0.863972842693329), FRAC_CONST(0.503538370132446) },
255 { FRAC_CONST(-0.870087027549744), FRAC_CONST(0.492898136377335) },
256 { FRAC_CONST(-0.876070141792297), FRAC_CONST(0.482183694839478) },
257 { FRAC_CONST(-0.881921350955963), FRAC_CONST(0.471396625041962) },
258 { FRAC_CONST(-0.887639701366425), FRAC_CONST(0.460538566112518) },
259 { FRAC_CONST(-0.893224298954010), FRAC_CONST(0.449611365795136) },
260 { FRAC_CONST(-0.898674488067627), FRAC_CONST(0.438616245985031) },
261 { FRAC_CONST(-0.903989315032959), FRAC_CONST(0.427555054426193) },
262 { FRAC_CONST(-0.909168004989624), FRAC_CONST(0.416429489850998) },
263 { FRAC_CONST(-0.914209783077240), FRAC_CONST(0.405241221189499) },
264 { FRAC_CONST(-0.919113874435425), FRAC_CONST(0.393991917371750) },
265 { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
266 { FRAC_CONST(-0.928506076335907), FRAC_CONST(0.371317237615585) },
267 { FRAC_CONST(-0.932992815971375), FRAC_CONST(0.359895050525665) },
268 { FRAC_CONST(-0.937339007854462), FRAC_CONST(0.348418653011322) },
269 { FRAC_CONST(-0.941544115543365), FRAC_CONST(0.336889803409576) },
270 { FRAC_CONST(-0.945607364177704), FRAC_CONST(0.325310200452805) },
271 { FRAC_CONST(-0.949528217315674), FRAC_CONST(0.313681602478027) },
272 { FRAC_CONST(-0.953306078910828), FRAC_CONST(0.302005797624588) },
273 { FRAC_CONST(-0.956940352916718), FRAC_CONST(0.290284723043442) },
274 { FRAC_CONST(-0.960430502891541), FRAC_CONST(0.278519690036774) },
275 { FRAC_CONST(-0.963776051998138), FRAC_CONST(0.266712725162506) },
276 { FRAC_CONST(-0.966976463794708), FRAC_CONST(0.254865586757660) },
277 { FRAC_CONST(-0.970031261444092), FRAC_CONST(0.242980077862740) },
278 { FRAC_CONST(-0.972939968109131), FRAC_CONST(0.231057971715927) },
279 { FRAC_CONST(-0.975702166557312), FRAC_CONST(0.219101071357727) },
280 { FRAC_CONST(-0.978317379951477), FRAC_CONST(0.207111403346062) },
281 { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
282 { FRAC_CONST(-0.983105480670929), FRAC_CONST(0.183039844036102) },
283 { FRAC_CONST(-0.985277652740479), FRAC_CONST(0.170961812138557) },
284 { FRAC_CONST(-0.987301409244537), FRAC_CONST(0.158858031034470) },
285 { FRAC_CONST(-0.989176511764526), FRAC_CONST(0.146730333566666) },
286 { FRAC_CONST(-0.990902662277222), FRAC_CONST(0.134580522775650) },
287 { FRAC_CONST(-0.992479503154755), FRAC_CONST(0.122410699725151) },
288 { FRAC_CONST(-0.993906974792480), FRAC_CONST(0.110222198069096) },
289 { FRAC_CONST(-0.995184719562531), FRAC_CONST(0.098017096519470) },
290 { FRAC_CONST(-0.996312618255615), FRAC_CONST(0.085797227919102) },
291 { FRAC_CONST(-0.997290492057800), FRAC_CONST(0.073564447462559) },
292 { FRAC_CONST(-0.998118102550507), FRAC_CONST(0.061320584267378) },
293 { FRAC_CONST(-0.998795449733734), FRAC_CONST(0.049067486077547) },
294 { FRAC_CONST(-0.999322354793549), FRAC_CONST(0.036807239055634) },
295 { FRAC_CONST(-0.999698817729950), FRAC_CONST(0.024541210383177) },
296 { FRAC_CONST(-0.999924719333649), FRAC_CONST(0.012271485291421) },
297 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
298 { FRAC_CONST(0.999698817729950), FRAC_CONST(0.024541229009628) },
299 { FRAC_CONST(0.998795449733734), FRAC_CONST(0.049067676067352) },
300 { FRAC_CONST(0.997290432453156), FRAC_CONST(0.073564566671848) },
301 { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
302 { FRAC_CONST(0.992479562759399), FRAC_CONST(0.122410677373409) },
303 { FRAC_CONST(0.989176511764526), FRAC_CONST(0.146730467677116) },
304 { FRAC_CONST(0.985277652740479), FRAC_CONST(0.170961901545525) },
305 { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
306 { FRAC_CONST(0.975702106952667), FRAC_CONST(0.219101235270500) },
307 { FRAC_CONST(0.970031261444092), FRAC_CONST(0.242980197072029) },
308 { FRAC_CONST(0.963776051998138), FRAC_CONST(0.266712784767151) },
309 { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
310 { FRAC_CONST(0.949528157711029), FRAC_CONST(0.313681751489639) },
311 { FRAC_CONST(0.941544055938721), FRAC_CONST(0.336889863014221) },
312 { FRAC_CONST(0.932992815971375), FRAC_CONST(0.359895050525665) },
313 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
314 { FRAC_CONST(0.914209723472595), FRAC_CONST(0.405241340398788) },
315 { FRAC_CONST(0.903989315032959), FRAC_CONST(0.427555084228516) },
316 { FRAC_CONST(0.893224298954010), FRAC_CONST(0.449611335992813) },
317 { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
318 { FRAC_CONST(0.870086967945099), FRAC_CONST(0.492898225784302) },
319 { FRAC_CONST(0.857728600502014), FRAC_CONST(0.514102756977081) },
320 { FRAC_CONST(0.844853579998016), FRAC_CONST(0.534997642040253) },
321 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
322 { FRAC_CONST(0.817584812641144), FRAC_CONST(0.575808227062225) },
323 { FRAC_CONST(0.803207516670227), FRAC_CONST(0.595699310302734) },
324 { FRAC_CONST(0.788346409797668), FRAC_CONST(0.615231633186340) },
325 { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
326 { FRAC_CONST(0.757208824157715), FRAC_CONST(0.653172850608826) },
327 { FRAC_CONST(0.740951120853424), FRAC_CONST(0.671558976173401) },
328 { FRAC_CONST(0.724247097969055), FRAC_CONST(0.689540565013886) },
329 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
330 { FRAC_CONST(0.689540505409241), FRAC_CONST(0.724247097969055) },
331 { FRAC_CONST(0.671558916568756), FRAC_CONST(0.740951180458069) },
332 { FRAC_CONST(0.653172791004181), FRAC_CONST(0.757208883762360) },
333 { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
334 { FRAC_CONST(0.615231573581696), FRAC_CONST(0.788346409797668) },
335 { FRAC_CONST(0.595699310302734), FRAC_CONST(0.803207516670227) },
336 { FRAC_CONST(0.575808167457581), FRAC_CONST(0.817584812641144) },
337 { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
338 { FRAC_CONST(0.534997642040253), FRAC_CONST(0.844853579998016) },
339 { FRAC_CONST(0.514102697372437), FRAC_CONST(0.857728660106659) },
340 { FRAC_CONST(0.492898195981979), FRAC_CONST(0.870086967945099) },
341 { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
342 { FRAC_CONST(0.449611306190491), FRAC_CONST(0.893224298954010) },
343 { FRAC_CONST(0.427555114030838), FRAC_CONST(0.903989315032959) },
344 { FRAC_CONST(0.405241280794144), FRAC_CONST(0.914209783077240) },
345 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
346 { FRAC_CONST(0.359894961118698), FRAC_CONST(0.932992815971375) },
347 { FRAC_CONST(0.336889833211899), FRAC_CONST(0.941544055938721) },
348 { FRAC_CONST(0.313681662082672), FRAC_CONST(0.949528217315674) },
349 { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
350 { FRAC_CONST(0.266712754964828), FRAC_CONST(0.963776051998138) },
351 { FRAC_CONST(0.242980122566223), FRAC_CONST(0.970031261444092) },
352 { FRAC_CONST(0.219101220369339), FRAC_CONST(0.975702106952667) },
353 { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
354 { FRAC_CONST(0.170961856842041), FRAC_CONST(0.985277652740479) },
355 { FRAC_CONST(0.146730497479439), FRAC_CONST(0.989176511764526) },
356 { FRAC_CONST(0.122410625219345), FRAC_CONST(0.992479562759399) },
357 { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
358 { FRAC_CONST(0.073564492166042), FRAC_CONST(0.997290432453156) },
359 { FRAC_CONST(0.049067649990320), FRAC_CONST(0.998795449733734) },
360 { FRAC_CONST(0.024541135877371), FRAC_CONST(0.999698817729950) },
361 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
362 { FRAC_CONST(0.998795449733734), FRAC_CONST(0.049067676067352) },
363 { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
364 { FRAC_CONST(0.989176511764526), FRAC_CONST(0.146730467677116) },
365 { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
366 { FRAC_CONST(0.970031261444092), FRAC_CONST(0.242980197072029) },
367 { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
368 { FRAC_CONST(0.941544055938721), FRAC_CONST(0.336889863014221) },
369 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
370 { FRAC_CONST(0.903989315032959), FRAC_CONST(0.427555084228516) },
371 { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
372 { FRAC_CONST(0.857728600502014), FRAC_CONST(0.514102756977081) },
373 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
374 { FRAC_CONST(0.803207516670227), FRAC_CONST(0.595699310302734) },
375 { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
376 { FRAC_CONST(0.740951120853424), FRAC_CONST(0.671558976173401) },
377 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
378 { FRAC_CONST(0.671558916568756), FRAC_CONST(0.740951180458069) },
379 { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
380 { FRAC_CONST(0.595699310302734), FRAC_CONST(0.803207516670227) },
381 { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
382 { FRAC_CONST(0.514102697372437), FRAC_CONST(0.857728660106659) },
383 { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
384 { FRAC_CONST(0.427555114030838), FRAC_CONST(0.903989315032959) },
385 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
386 { FRAC_CONST(0.336889833211899), FRAC_CONST(0.941544055938721) },
387 { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
388 { FRAC_CONST(0.242980122566223), FRAC_CONST(0.970031261444092) },
389 { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
390 { FRAC_CONST(0.146730497479439), FRAC_CONST(0.989176511764526) },
391 { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
392 { FRAC_CONST(0.049067649990320), FRAC_CONST(0.998795449733734) },
393 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
394 { FRAC_CONST(-0.049067739397287), FRAC_CONST(0.998795449733734) },
395 { FRAC_CONST(-0.098017223179340), FRAC_CONST(0.995184719562531) },
396 { FRAC_CONST(-0.146730571985245), FRAC_CONST(0.989176511764526) },
397 { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
398 { FRAC_CONST(-0.242980197072029), FRAC_CONST(0.970031261444092) },
399 { FRAC_CONST(-0.290284723043442), FRAC_CONST(0.956940293312073) },
400 { FRAC_CONST(-0.336889922618866), FRAC_CONST(0.941544055938721) },
401 { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
402 { FRAC_CONST(-0.427555084228516), FRAC_CONST(0.903989315032959) },
403 { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
404 { FRAC_CONST(-0.514102756977081), FRAC_CONST(0.857728600502014) },
405 { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
406 { FRAC_CONST(-0.595699369907379), FRAC_CONST(0.803207516670227) },
407 { FRAC_CONST(-0.634393274784088), FRAC_CONST(0.773010492324829) },
408 { FRAC_CONST(-0.671559035778046), FRAC_CONST(0.740951061248779) },
409 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
410 { FRAC_CONST(-0.740951240062714), FRAC_CONST(0.671558856964111) },
411 { FRAC_CONST(-0.773010492324829), FRAC_CONST(0.634393274784088) },
412 { FRAC_CONST(-0.803207635879517), FRAC_CONST(0.595699131488800) },
413 { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
414 { FRAC_CONST(-0.857728600502014), FRAC_CONST(0.514102756977081) },
415 { FRAC_CONST(-0.881921350955963), FRAC_CONST(0.471396625041962) },
416 { FRAC_CONST(-0.903989315032959), FRAC_CONST(0.427555054426193) },
417 { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
418 { FRAC_CONST(-0.941544115543365), FRAC_CONST(0.336889803409576) },
419 { FRAC_CONST(-0.956940352916718), FRAC_CONST(0.290284723043442) },
420 { FRAC_CONST(-0.970031261444092), FRAC_CONST(0.242980077862740) },
421 { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
422 { FRAC_CONST(-0.989176511764526), FRAC_CONST(0.146730333566666) },
423 { FRAC_CONST(-0.995184719562531), FRAC_CONST(0.098017096519470) },
424 { FRAC_CONST(-0.998795449733734), FRAC_CONST(0.049067486077547) },
425 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
426 { FRAC_CONST(0.997290432453156), FRAC_CONST(0.073564566671848) },
427 { FRAC_CONST(0.989176511764526), FRAC_CONST(0.146730467677116) },
428 { FRAC_CONST(0.975702106952667), FRAC_CONST(0.219101235270500) },
429 { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
430 { FRAC_CONST(0.932992815971375), FRAC_CONST(0.359895050525665) },
431 { FRAC_CONST(0.903989315032959), FRAC_CONST(0.427555084228516) },
432 { FRAC_CONST(0.870086967945099), FRAC_CONST(0.492898225784302) },
433 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
434 { FRAC_CONST(0.788346469402313), FRAC_CONST(0.615231573581696) },
435 { FRAC_CONST(0.740951120853424), FRAC_CONST(0.671558976173401) },
436 { FRAC_CONST(0.689540505409241), FRAC_CONST(0.724247097969055) },
437 { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
438 { FRAC_CONST(0.575808227062225), FRAC_CONST(0.817584812641144) },
439 { FRAC_CONST(0.514102697372437), FRAC_CONST(0.857728660106659) },
440 { FRAC_CONST(0.449611306190491), FRAC_CONST(0.893224298954010) },
441 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
442 { FRAC_CONST(0.313681751489639), FRAC_CONST(0.949528157711029) },
443 { FRAC_CONST(0.242980241775513), FRAC_CONST(0.970031261444092) },
444 { FRAC_CONST(0.170961856842041), FRAC_CONST(0.985277652740479) },
445 { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
446 { FRAC_CONST(0.024541255086660), FRAC_CONST(0.999698817729950) },
447 { FRAC_CONST(-0.049067739397287), FRAC_CONST(0.998795449733734) },
448 { FRAC_CONST(-0.122410707175732), FRAC_CONST(0.992479503154755) },
449 { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
450 { FRAC_CONST(-0.266712725162506), FRAC_CONST(0.963776051998138) },
451 { FRAC_CONST(-0.336889803409576), FRAC_CONST(0.941544055938721) },
452 { FRAC_CONST(-0.405241340398788), FRAC_CONST(0.914209723472595) },
453 { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
454 { FRAC_CONST(-0.534997701644897), FRAC_CONST(0.844853520393372) },
455 { FRAC_CONST(-0.595699369907379), FRAC_CONST(0.803207516670227) },
456 { FRAC_CONST(-0.653172850608826), FRAC_CONST(0.757208824157715) },
457 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
458 { FRAC_CONST(-0.757208824157715), FRAC_CONST(0.653172850608826) },
459 { FRAC_CONST(-0.803207516670227), FRAC_CONST(0.595699369907379) },
460 { FRAC_CONST(-0.844853520393372), FRAC_CONST(0.534997701644897) },
461 { FRAC_CONST(-0.881921231746674), FRAC_CONST(0.471396833658218) },
462 { FRAC_CONST(-0.914209783077240), FRAC_CONST(0.405241221189499) },
463 { FRAC_CONST(-0.941544115543365), FRAC_CONST(0.336889803409576) },
464 { FRAC_CONST(-0.963776051998138), FRAC_CONST(0.266712725162506) },
465 { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
466 { FRAC_CONST(-0.992479503154755), FRAC_CONST(0.122410699725151) },
467 { FRAC_CONST(-0.998795449733734), FRAC_CONST(0.049067724496126) },
468 { FRAC_CONST(-0.999698817729950), FRAC_CONST(-0.024541147053242) },
469 { FRAC_CONST(-0.995184719562531), FRAC_CONST(-0.098017267882824) },
470 { FRAC_CONST(-0.985277652740479), FRAC_CONST(-0.170961990952492) },
471 { FRAC_CONST(-0.970031261444092), FRAC_CONST(-0.242980241775513) },
472 { FRAC_CONST(-0.949528157711029), FRAC_CONST(-0.313681781291962) },
473 { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
474 { FRAC_CONST(-0.893224298954010), FRAC_CONST(-0.449611306190491) },
475 { FRAC_CONST(-0.857728660106659), FRAC_CONST(-0.514102697372437) },
476 { FRAC_CONST(-0.817584872245789), FRAC_CONST(-0.575808107852936) },
477 { FRAC_CONST(-0.773010551929474), FRAC_CONST(-0.634393215179443) },
478 { FRAC_CONST(-0.724247038364410), FRAC_CONST(-0.689540624618530) },
479 { FRAC_CONST(-0.671558916568756), FRAC_CONST(-0.740951180458069) },
480 { FRAC_CONST(-0.615231573581696), FRAC_CONST(-0.788346469402313) },
481 { FRAC_CONST(-0.555570006370544), FRAC_CONST(-0.831469774246216) },
482 { FRAC_CONST(-0.492898195981979), FRAC_CONST(-0.870086967945099) },
483 { FRAC_CONST(-0.427554935216904), FRAC_CONST(-0.903989374637604) },
484 { FRAC_CONST(-0.359895110130310), FRAC_CONST(-0.932992756366730) },
485 { FRAC_CONST(-0.290284544229507), FRAC_CONST(-0.956940352916718) },
486 { FRAC_CONST(-0.219101369380951), FRAC_CONST(-0.975702106952667) },
487 { FRAC_CONST(-0.146730408072472), FRAC_CONST(-0.989176511764526) },
488 { FRAC_CONST(-0.073564760386944), FRAC_CONST(-0.997290432453156) },
489 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
490 { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
491 { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
492 { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
493 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
494 { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
495 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
496 { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
497 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
498 { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
499 { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
500 { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
501 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
502 { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
503 { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
504 { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
505 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
506 { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
507 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
508 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
509 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
510 { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
511 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
512 { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
513 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
514 { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
515 { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
516 { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
517 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
518 { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
519 { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
520 { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
521 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
522 { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
523 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
524 { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
525 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
526 { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
527 { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
528 { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
529 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
530 { FRAC_CONST(-0.881921231746674), FRAC_CONST(0.471396833658218) },
531 { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
532 { FRAC_CONST(-0.995184719562531), FRAC_CONST(-0.098017267882824) },
533 { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
534 { FRAC_CONST(-0.773010551929474), FRAC_CONST(-0.634393215179443) },
535 { FRAC_CONST(-0.555570006370544), FRAC_CONST(-0.831469774246216) },
536 { FRAC_CONST(-0.290284544229507), FRAC_CONST(-0.956940352916718) },
537 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
538 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
539 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
540 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
541 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
542 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
543 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
544 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
545 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
546 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
547 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
548 { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
549 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
550 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
551 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
552 { FRAC_CONST(0.000000011924881), FRAC_CONST(-1.000000000000000) }
553 };
554
555 #ifdef ALLOW_SMALL_FRAMELENGTH
556 ALIGN static const complex_t cfft_tab_480[] =
557 {
558 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
559 { FRAC_CONST(0.999914348125458), FRAC_CONST(0.013089596293867) },
560 { FRAC_CONST(0.999657332897186), FRAC_CONST(0.026176949962974) },
561 { FRAC_CONST(0.999229013919830), FRAC_CONST(0.039259817451239) },
562 { FRAC_CONST(0.998629510402679), FRAC_CONST(0.052335958927870) },
563 { FRAC_CONST(0.997858941555023), FRAC_CONST(0.065403133630753) },
564 { FRAC_CONST(0.996917307376862), FRAC_CONST(0.078459098935127) },
565 { FRAC_CONST(0.995804905891418), FRAC_CONST(0.091501623392105) },
566 { FRAC_CONST(0.994521915912628), FRAC_CONST(0.104528464376926) },
567 { FRAC_CONST(0.993068456649780), FRAC_CONST(0.117537401616573) },
568 { FRAC_CONST(0.991444885730743), FRAC_CONST(0.130526199936867) },
569 { FRAC_CONST(0.989651381969452), FRAC_CONST(0.143492624163628) },
570 { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
571 { FRAC_CONST(0.985556066036224), FRAC_CONST(0.169349506497383) },
572 { FRAC_CONST(0.983254909515381), FRAC_CONST(0.182235524058342) },
573 { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
574 { FRAC_CONST(0.978147625923157), FRAC_CONST(0.207911700010300) },
575 { FRAC_CONST(0.975342333316803), FRAC_CONST(0.220697447657585) },
576 { FRAC_CONST(0.972369909286499), FRAC_CONST(0.233445376157761) },
577 { FRAC_CONST(0.969230890274048), FRAC_CONST(0.246153295040131) },
578 { FRAC_CONST(0.965925812721252), FRAC_CONST(0.258819043636322) },
579 { FRAC_CONST(0.962455213069916), FRAC_CONST(0.271440446376801) },
580 { FRAC_CONST(0.958819746971130), FRAC_CONST(0.284015357494354) },
581 { FRAC_CONST(0.955019950866699), FRAC_CONST(0.296541601419449) },
582 { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
583 { FRAC_CONST(0.946930110454559), FRAC_CONST(0.321439445018768) },
584 { FRAC_CONST(0.942641496658325), FRAC_CONST(0.333806872367859) },
585 { FRAC_CONST(0.938191354274750), FRAC_CONST(0.346117079257965) },
586 { FRAC_CONST(0.933580398559570), FRAC_CONST(0.358367949724197) },
587 { FRAC_CONST(0.928809583187103), FRAC_CONST(0.370557427406311) },
588 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
589 { FRAC_CONST(0.918791174888611), FRAC_CONST(0.394743889570236) },
590 { FRAC_CONST(0.913545429706573), FRAC_CONST(0.406736642122269) },
591 { FRAC_CONST(0.908143162727356), FRAC_CONST(0.418659746646881) },
592 { FRAC_CONST(0.902585268020630), FRAC_CONST(0.430511116981506) },
593 { FRAC_CONST(0.896872758865356), FRAC_CONST(0.442288726568222) },
594 { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
595 { FRAC_CONST(0.884987652301788), FRAC_CONST(0.465614527463913) },
596 { FRAC_CONST(0.878817081451416), FRAC_CONST(0.477158784866333) },
597 { FRAC_CONST(0.872496008872986), FRAC_CONST(0.488621264696121) },
598 { FRAC_CONST(0.866025388240814), FRAC_CONST(0.500000000000000) },
599 { FRAC_CONST(0.859406411647797), FRAC_CONST(0.511293113231659) },
600 { FRAC_CONST(0.852640151977539), FRAC_CONST(0.522498548030853) },
601 { FRAC_CONST(0.845727801322937), FRAC_CONST(0.533614516258240) },
602 { FRAC_CONST(0.838670551776886), FRAC_CONST(0.544639050960541) },
603 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
604 { FRAC_CONST(0.824126183986664), FRAC_CONST(0.566406250000000) },
605 { FRAC_CONST(0.816641509532928), FRAC_CONST(0.577145218849182) },
606 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
607 { FRAC_CONST(0.801253795623779), FRAC_CONST(0.598324596881866) },
608 { FRAC_CONST(0.793353319168091), FRAC_CONST(0.608761429786682) },
609 { FRAC_CONST(0.785316884517670), FRAC_CONST(0.619093954563141) },
610 { FRAC_CONST(0.777145922183990), FRAC_CONST(0.629320383071899) },
611 { FRAC_CONST(0.768841803073883), FRAC_CONST(0.639438986778259) },
612 { FRAC_CONST(0.760405957698822), FRAC_CONST(0.649448096752167) },
613 { FRAC_CONST(0.751839756965637), FRAC_CONST(0.659345865249634) },
614 { FRAC_CONST(0.743144810199738), FRAC_CONST(0.669130623340607) },
615 { FRAC_CONST(0.734322488307953), FRAC_CONST(0.678800761699677) },
616 { FRAC_CONST(0.725374400615692), FRAC_CONST(0.688354551792145) },
617 { FRAC_CONST(0.716301918029785), FRAC_CONST(0.697790503501892) },
618 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
619 { FRAC_CONST(0.697790443897247), FRAC_CONST(0.716301977634430) },
620 { FRAC_CONST(0.688354551792145), FRAC_CONST(0.725374400615692) },
621 { FRAC_CONST(0.678800702095032), FRAC_CONST(0.734322547912598) },
622 { FRAC_CONST(0.669130563735962), FRAC_CONST(0.743144869804382) },
623 { FRAC_CONST(0.659345805644989), FRAC_CONST(0.751839816570282) },
624 { FRAC_CONST(0.649448037147522), FRAC_CONST(0.760405957698822) },
625 { FRAC_CONST(0.639438986778259), FRAC_CONST(0.768841862678528) },
626 { FRAC_CONST(0.629320383071899), FRAC_CONST(0.777145981788635) },
627 { FRAC_CONST(0.619093954563141), FRAC_CONST(0.785316944122314) },
628 { FRAC_CONST(0.608761370182037), FRAC_CONST(0.793353378772736) },
629 { FRAC_CONST(0.598324596881866), FRAC_CONST(0.801253855228424) },
630 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
631 { FRAC_CONST(0.577145159244537), FRAC_CONST(0.816641569137573) },
632 { FRAC_CONST(0.566406250000000), FRAC_CONST(0.824126183986664) },
633 { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
634 { FRAC_CONST(0.544638991355896), FRAC_CONST(0.838670611381531) },
635 { FRAC_CONST(0.533614516258240), FRAC_CONST(0.845727801322937) },
636 { FRAC_CONST(0.522498488426209), FRAC_CONST(0.852640211582184) },
637 { FRAC_CONST(0.511293113231659), FRAC_CONST(0.859406411647797) },
638 { FRAC_CONST(0.499999970197678), FRAC_CONST(0.866025447845459) },
639 { FRAC_CONST(0.488621175289154), FRAC_CONST(0.872496068477631) },
640 { FRAC_CONST(0.477158755064011), FRAC_CONST(0.878817141056061) },
641 { FRAC_CONST(0.465614467859268), FRAC_CONST(0.884987652301788) },
642 { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
643 { FRAC_CONST(0.442288666963577), FRAC_CONST(0.896872758865356) },
644 { FRAC_CONST(0.430511027574539), FRAC_CONST(0.902585327625275) },
645 { FRAC_CONST(0.418659746646881), FRAC_CONST(0.908143162727356) },
646 { FRAC_CONST(0.406736612319946), FRAC_CONST(0.913545489311218) },
647 { FRAC_CONST(0.394743800163269), FRAC_CONST(0.918791234493256) },
648 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
649 { FRAC_CONST(0.370557397603989), FRAC_CONST(0.928809583187103) },
650 { FRAC_CONST(0.358367860317230), FRAC_CONST(0.933580458164215) },
651 { FRAC_CONST(0.346117049455643), FRAC_CONST(0.938191354274750) },
652 { FRAC_CONST(0.333806812763214), FRAC_CONST(0.942641496658325) },
653 { FRAC_CONST(0.321439474821091), FRAC_CONST(0.946930110454559) },
654 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
655 { FRAC_CONST(0.296541512012482), FRAC_CONST(0.955019950866699) },
656 { FRAC_CONST(0.284015327692032), FRAC_CONST(0.958819746971130) },
657 { FRAC_CONST(0.271440386772156), FRAC_CONST(0.962455272674561) },
658 { FRAC_CONST(0.258819073438644), FRAC_CONST(0.965925812721252) },
659 { FRAC_CONST(0.246153265237808), FRAC_CONST(0.969230890274048) },
660 { FRAC_CONST(0.233445301651955), FRAC_CONST(0.972369909286499) },
661 { FRAC_CONST(0.220697447657585), FRAC_CONST(0.975342333316803) },
662 { FRAC_CONST(0.207911655306816), FRAC_CONST(0.978147625923157) },
663 { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
664 { FRAC_CONST(0.182235524058342), FRAC_CONST(0.983254909515381) },
665 { FRAC_CONST(0.169349446892738), FRAC_CONST(0.985556066036224) },
666 { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
667 { FRAC_CONST(0.143492594361305), FRAC_CONST(0.989651381969452) },
668 { FRAC_CONST(0.130526125431061), FRAC_CONST(0.991444885730743) },
669 { FRAC_CONST(0.117537401616573), FRAC_CONST(0.993068456649780) },
670 { FRAC_CONST(0.104528419673443), FRAC_CONST(0.994521915912628) },
671 { FRAC_CONST(0.091501533985138), FRAC_CONST(0.995804905891418) },
672 { FRAC_CONST(0.078459084033966), FRAC_CONST(0.996917307376862) },
673 { FRAC_CONST(0.065403074026108), FRAC_CONST(0.997858941555023) },
674 { FRAC_CONST(0.052335973829031), FRAC_CONST(0.998629510402679) },
675 { FRAC_CONST(0.039259787648916), FRAC_CONST(0.999229013919830) },
676 { FRAC_CONST(0.026176875457168), FRAC_CONST(0.999657332897186) },
677 { FRAC_CONST(0.013089597225189), FRAC_CONST(0.999914348125458) },
678 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
679 { FRAC_CONST(-0.013089684769511), FRAC_CONST(0.999914348125458) },
680 { FRAC_CONST(-0.026176963001490), FRAC_CONST(0.999657332897186) },
681 { FRAC_CONST(-0.039259877055883), FRAC_CONST(0.999229013919830) },
682 { FRAC_CONST(-0.052336059510708), FRAC_CONST(0.998629510402679) },
683 { FRAC_CONST(-0.065403163433075), FRAC_CONST(0.997858941555023) },
684 { FRAC_CONST(-0.078459173440933), FRAC_CONST(0.996917307376862) },
685 { FRAC_CONST(-0.091501623392105), FRAC_CONST(0.995804905891418) },
686 { FRAC_CONST(-0.104528509080410), FRAC_CONST(0.994521915912628) },
687 { FRAC_CONST(-0.117537491023541), FRAC_CONST(0.993068456649780) },
688 { FRAC_CONST(-0.130526214838028), FRAC_CONST(0.991444885730743) },
689 { FRAC_CONST(-0.143492683768272), FRAC_CONST(0.989651381969452) },
690 { FRAC_CONST(-0.156434446573257), FRAC_CONST(0.987688362598419) },
691 { FRAC_CONST(-0.169349536299706), FRAC_CONST(0.985556066036224) },
692 { FRAC_CONST(-0.182235598564148), FRAC_CONST(0.983254909515381) },
693 { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
694 { FRAC_CONST(-0.207911744713783), FRAC_CONST(0.978147566318512) },
695 { FRAC_CONST(-0.220697522163391), FRAC_CONST(0.975342273712158) },
696 { FRAC_CONST(-0.233445391058922), FRAC_CONST(0.972369909286499) },
697 { FRAC_CONST(-0.246153354644775), FRAC_CONST(0.969230890274048) },
698 { FRAC_CONST(-0.258819162845612), FRAC_CONST(0.965925812721252) },
699 { FRAC_CONST(-0.271440476179123), FRAC_CONST(0.962455213069916) },
700 { FRAC_CONST(-0.284015417098999), FRAC_CONST(0.958819687366486) },
701 { FRAC_CONST(-0.296541571617126), FRAC_CONST(0.955019950866699) },
702 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
703 { FRAC_CONST(-0.321439564228058), FRAC_CONST(0.946930110454559) },
704 { FRAC_CONST(-0.333806872367859), FRAC_CONST(0.942641496658325) },
705 { FRAC_CONST(-0.346117109060287), FRAC_CONST(0.938191294670105) },
706 { FRAC_CONST(-0.358367949724197), FRAC_CONST(0.933580458164215) },
707 { FRAC_CONST(-0.370557487010956), FRAC_CONST(0.928809523582459) },
708 { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
709 { FRAC_CONST(-0.394743859767914), FRAC_CONST(0.918791234493256) },
710 { FRAC_CONST(-0.406736701726913), FRAC_CONST(0.913545429706573) },
711 { FRAC_CONST(-0.418659836053848), FRAC_CONST(0.908143103122711) },
712 { FRAC_CONST(-0.430511116981506), FRAC_CONST(0.902585268020630) },
713 { FRAC_CONST(-0.442288637161255), FRAC_CONST(0.896872758865356) },
714 { FRAC_CONST(-0.453990608453751), FRAC_CONST(0.891006469726563) },
715 { FRAC_CONST(-0.465614557266235), FRAC_CONST(0.884987592697144) },
716 { FRAC_CONST(-0.477158725261688), FRAC_CONST(0.878817141056061) },
717 { FRAC_CONST(-0.488621354103088), FRAC_CONST(0.872495949268341) },
718 { FRAC_CONST(-0.500000059604645), FRAC_CONST(0.866025388240814) },
719 { FRAC_CONST(-0.511293053627014), FRAC_CONST(0.859406411647797) },
720 { FRAC_CONST(-0.522498667240143), FRAC_CONST(0.852640092372894) },
721 { FRAC_CONST(-0.533614575862885), FRAC_CONST(0.845727801322937) },
722 { FRAC_CONST(-0.544639050960541), FRAC_CONST(0.838670551776886) },
723 { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
724 { FRAC_CONST(-0.566406309604645), FRAC_CONST(0.824126124382019) },
725 { FRAC_CONST(-0.577145218849182), FRAC_CONST(0.816641569137573) },
726 { FRAC_CONST(-0.587785184383392), FRAC_CONST(0.809017002582550) },
727 { FRAC_CONST(-0.598324656486511), FRAC_CONST(0.801253736019135) },
728 { FRAC_CONST(-0.608761429786682), FRAC_CONST(0.793353319168091) },
729 { FRAC_CONST(-0.619093894958496), FRAC_CONST(0.785316944122314) },
730 { FRAC_CONST(-0.629320502281189), FRAC_CONST(0.777145862579346) },
731 { FRAC_CONST(-0.639439046382904), FRAC_CONST(0.768841803073883) },
732 { FRAC_CONST(-0.649448037147522), FRAC_CONST(0.760405957698822) },
733 { FRAC_CONST(-0.659345924854279), FRAC_CONST(0.751839697360992) },
734 { FRAC_CONST(-0.669130682945251), FRAC_CONST(0.743144810199738) },
735 { FRAC_CONST(-0.678800761699677), FRAC_CONST(0.734322488307953) },
736 { FRAC_CONST(-0.688354671001434), FRAC_CONST(0.725374281406403) },
737 { FRAC_CONST(-0.697790503501892), FRAC_CONST(0.716301858425140) },
738 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
739 { FRAC_CONST(-0.716302037239075), FRAC_CONST(0.697790324687958) },
740 { FRAC_CONST(-0.725374460220337), FRAC_CONST(0.688354492187500) },
741 { FRAC_CONST(-0.734322547912598), FRAC_CONST(0.678800702095032) },
742 { FRAC_CONST(-0.743144929409027), FRAC_CONST(0.669130444526672) },
743 { FRAC_CONST(-0.751839876174927), FRAC_CONST(0.659345746040344) },
744 { FRAC_CONST(-0.760406017303467), FRAC_CONST(0.649448037147522) },
745 { FRAC_CONST(-0.768841803073883), FRAC_CONST(0.639439046382904) },
746 { FRAC_CONST(-0.777146041393280), FRAC_CONST(0.629320263862610) },
747 { FRAC_CONST(-0.785316944122314), FRAC_CONST(0.619093894958496) },
748 { FRAC_CONST(-0.793353319168091), FRAC_CONST(0.608761429786682) },
749 { FRAC_CONST(-0.801253914833069), FRAC_CONST(0.598324477672577) },
750 { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
751 { FRAC_CONST(-0.816641569137573), FRAC_CONST(0.577145218849182) },
752 { FRAC_CONST(-0.824126303195953), FRAC_CONST(0.566406130790710) },
753 { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
754 { FRAC_CONST(-0.838670551776886), FRAC_CONST(0.544639050960541) },
755 { FRAC_CONST(-0.845727920532227), FRAC_CONST(0.533614337444305) },
756 { FRAC_CONST(-0.852640211582184), FRAC_CONST(0.522498488426209) },
757 { FRAC_CONST(-0.859406411647797), FRAC_CONST(0.511293053627014) },
758 { FRAC_CONST(-0.866025388240814), FRAC_CONST(0.500000059604645) },
759 { FRAC_CONST(-0.872496068477631), FRAC_CONST(0.488621145486832) },
760 { FRAC_CONST(-0.878817141056061), FRAC_CONST(0.477158725261688) },
761 { FRAC_CONST(-0.884987652301788), FRAC_CONST(0.465614557266235) },
762 { FRAC_CONST(-0.891006588935852), FRAC_CONST(0.453990370035172) },
763 { FRAC_CONST(-0.896872758865356), FRAC_CONST(0.442288637161255) },
764 { FRAC_CONST(-0.902585268020630), FRAC_CONST(0.430511116981506) },
765 { FRAC_CONST(-0.908143222332001), FRAC_CONST(0.418659597635269) },
766 { FRAC_CONST(-0.913545489311218), FRAC_CONST(0.406736582517624) },
767 { FRAC_CONST(-0.918791234493256), FRAC_CONST(0.394743859767914) },
768 { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
769 { FRAC_CONST(-0.928809583187103), FRAC_CONST(0.370557337999344) },
770 { FRAC_CONST(-0.933580458164215), FRAC_CONST(0.358367919921875) },
771 { FRAC_CONST(-0.938191413879395), FRAC_CONST(0.346116900444031) },
772 { FRAC_CONST(-0.942641556262970), FRAC_CONST(0.333806753158569) },
773 { FRAC_CONST(-0.946930170059204), FRAC_CONST(0.321439445018768) },
774 { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
775 { FRAC_CONST(-0.955020010471344), FRAC_CONST(0.296541452407837) },
776 { FRAC_CONST(-0.958819746971130), FRAC_CONST(0.284015297889709) },
777 { FRAC_CONST(-0.962455213069916), FRAC_CONST(0.271440476179123) },
778 { FRAC_CONST(-0.965925872325897), FRAC_CONST(0.258818924427032) },
779 { FRAC_CONST(-0.969230949878693), FRAC_CONST(0.246153235435486) },
780 { FRAC_CONST(-0.972369909286499), FRAC_CONST(0.233445376157761) },
781 { FRAC_CONST(-0.975342333316803), FRAC_CONST(0.220697283744812) },
782 { FRAC_CONST(-0.978147625923157), FRAC_CONST(0.207911610603333) },
783 { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
784 { FRAC_CONST(-0.983254909515381), FRAC_CONST(0.182235360145569) },
785 { FRAC_CONST(-0.985556066036224), FRAC_CONST(0.169349402189255) },
786 { FRAC_CONST(-0.987688362598419), FRAC_CONST(0.156434446573257) },
787 { FRAC_CONST(-0.989651441574097), FRAC_CONST(0.143492430448532) },
788 { FRAC_CONST(-0.991444885730743), FRAC_CONST(0.130526080727577) },
789 { FRAC_CONST(-0.993068456649780), FRAC_CONST(0.117537356913090) },
790 { FRAC_CONST(-0.994521915912628), FRAC_CONST(0.104528494179249) },
791 { FRAC_CONST(-0.995804965496063), FRAC_CONST(0.091501489281654) },
792 { FRAC_CONST(-0.996917366981506), FRAC_CONST(0.078459039330482) },
793 { FRAC_CONST(-0.997858941555023), FRAC_CONST(0.065403148531914) },
794 { FRAC_CONST(-0.998629570007324), FRAC_CONST(0.052335809916258) },
795 { FRAC_CONST(-0.999229013919830), FRAC_CONST(0.039259742945433) },
796 { FRAC_CONST(-0.999657332897186), FRAC_CONST(0.026176951825619) },
797 { FRAC_CONST(-0.999914348125458), FRAC_CONST(0.013089434243739) },
798 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
799 { FRAC_CONST(0.999657332897186), FRAC_CONST(0.026176949962974) },
800 { FRAC_CONST(0.998629510402679), FRAC_CONST(0.052335958927870) },
801 { FRAC_CONST(0.996917307376862), FRAC_CONST(0.078459098935127) },
802 { FRAC_CONST(0.994521915912628), FRAC_CONST(0.104528464376926) },
803 { FRAC_CONST(0.991444885730743), FRAC_CONST(0.130526199936867) },
804 { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
805 { FRAC_CONST(0.983254909515381), FRAC_CONST(0.182235524058342) },
806 { FRAC_CONST(0.978147625923157), FRAC_CONST(0.207911700010300) },
807 { FRAC_CONST(0.972369909286499), FRAC_CONST(0.233445376157761) },
808 { FRAC_CONST(0.965925812721252), FRAC_CONST(0.258819043636322) },
809 { FRAC_CONST(0.958819746971130), FRAC_CONST(0.284015357494354) },
810 { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
811 { FRAC_CONST(0.942641496658325), FRAC_CONST(0.333806872367859) },
812 { FRAC_CONST(0.933580398559570), FRAC_CONST(0.358367949724197) },
813 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
814 { FRAC_CONST(0.913545429706573), FRAC_CONST(0.406736642122269) },
815 { FRAC_CONST(0.902585268020630), FRAC_CONST(0.430511116981506) },
816 { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
817 { FRAC_CONST(0.878817081451416), FRAC_CONST(0.477158784866333) },
818 { FRAC_CONST(0.866025388240814), FRAC_CONST(0.500000000000000) },
819 { FRAC_CONST(0.852640151977539), FRAC_CONST(0.522498548030853) },
820 { FRAC_CONST(0.838670551776886), FRAC_CONST(0.544639050960541) },
821 { FRAC_CONST(0.824126183986664), FRAC_CONST(0.566406250000000) },
822 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
823 { FRAC_CONST(0.793353319168091), FRAC_CONST(0.608761429786682) },
824 { FRAC_CONST(0.777145922183990), FRAC_CONST(0.629320383071899) },
825 { FRAC_CONST(0.760405957698822), FRAC_CONST(0.649448096752167) },
826 { FRAC_CONST(0.743144810199738), FRAC_CONST(0.669130623340607) },
827 { FRAC_CONST(0.725374400615692), FRAC_CONST(0.688354551792145) },
828 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
829 { FRAC_CONST(0.688354551792145), FRAC_CONST(0.725374400615692) },
830 { FRAC_CONST(0.669130563735962), FRAC_CONST(0.743144869804382) },
831 { FRAC_CONST(0.649448037147522), FRAC_CONST(0.760405957698822) },
832 { FRAC_CONST(0.629320383071899), FRAC_CONST(0.777145981788635) },
833 { FRAC_CONST(0.608761370182037), FRAC_CONST(0.793353378772736) },
834 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
835 { FRAC_CONST(0.566406250000000), FRAC_CONST(0.824126183986664) },
836 { FRAC_CONST(0.544638991355896), FRAC_CONST(0.838670611381531) },
837 { FRAC_CONST(0.522498488426209), FRAC_CONST(0.852640211582184) },
838 { FRAC_CONST(0.499999970197678), FRAC_CONST(0.866025447845459) },
839 { FRAC_CONST(0.477158755064011), FRAC_CONST(0.878817141056061) },
840 { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
841 { FRAC_CONST(0.430511027574539), FRAC_CONST(0.902585327625275) },
842 { FRAC_CONST(0.406736612319946), FRAC_CONST(0.913545489311218) },
843 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
844 { FRAC_CONST(0.358367860317230), FRAC_CONST(0.933580458164215) },
845 { FRAC_CONST(0.333806812763214), FRAC_CONST(0.942641496658325) },
846 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
847 { FRAC_CONST(0.284015327692032), FRAC_CONST(0.958819746971130) },
848 { FRAC_CONST(0.258819073438644), FRAC_CONST(0.965925812721252) },
849 { FRAC_CONST(0.233445301651955), FRAC_CONST(0.972369909286499) },
850 { FRAC_CONST(0.207911655306816), FRAC_CONST(0.978147625923157) },
851 { FRAC_CONST(0.182235524058342), FRAC_CONST(0.983254909515381) },
852 { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
853 { FRAC_CONST(0.130526125431061), FRAC_CONST(0.991444885730743) },
854 { FRAC_CONST(0.104528419673443), FRAC_CONST(0.994521915912628) },
855 { FRAC_CONST(0.078459084033966), FRAC_CONST(0.996917307376862) },
856 { FRAC_CONST(0.052335973829031), FRAC_CONST(0.998629510402679) },
857 { FRAC_CONST(0.026176875457168), FRAC_CONST(0.999657332897186) },
858 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
859 { FRAC_CONST(-0.026176963001490), FRAC_CONST(0.999657332897186) },
860 { FRAC_CONST(-0.052336059510708), FRAC_CONST(0.998629510402679) },
861 { FRAC_CONST(-0.078459173440933), FRAC_CONST(0.996917307376862) },
862 { FRAC_CONST(-0.104528509080410), FRAC_CONST(0.994521915912628) },
863 { FRAC_CONST(-0.130526214838028), FRAC_CONST(0.991444885730743) },
864 { FRAC_CONST(-0.156434446573257), FRAC_CONST(0.987688362598419) },
865 { FRAC_CONST(-0.182235598564148), FRAC_CONST(0.983254909515381) },
866 { FRAC_CONST(-0.207911744713783), FRAC_CONST(0.978147566318512) },
867 { FRAC_CONST(-0.233445391058922), FRAC_CONST(0.972369909286499) },
868 { FRAC_CONST(-0.258819162845612), FRAC_CONST(0.965925812721252) },
869 { FRAC_CONST(-0.284015417098999), FRAC_CONST(0.958819687366486) },
870 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
871 { FRAC_CONST(-0.333806872367859), FRAC_CONST(0.942641496658325) },
872 { FRAC_CONST(-0.358367949724197), FRAC_CONST(0.933580458164215) },
873 { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
874 { FRAC_CONST(-0.406736701726913), FRAC_CONST(0.913545429706573) },
875 { FRAC_CONST(-0.430511116981506), FRAC_CONST(0.902585268020630) },
876 { FRAC_CONST(-0.453990608453751), FRAC_CONST(0.891006469726563) },
877 { FRAC_CONST(-0.477158725261688), FRAC_CONST(0.878817141056061) },
878 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
879 { FRAC_CONST(0.998629510402679), FRAC_CONST(0.052335958927870) },
880 { FRAC_CONST(0.994521915912628), FRAC_CONST(0.104528464376926) },
881 { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
882 { FRAC_CONST(0.978147625923157), FRAC_CONST(0.207911700010300) },
883 { FRAC_CONST(0.965925812721252), FRAC_CONST(0.258819043636322) },
884 { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
885 { FRAC_CONST(0.933580398559570), FRAC_CONST(0.358367949724197) },
886 { FRAC_CONST(0.913545429706573), FRAC_CONST(0.406736642122269) },
887 { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
888 { FRAC_CONST(0.866025388240814), FRAC_CONST(0.500000000000000) },
889 { FRAC_CONST(0.838670551776886), FRAC_CONST(0.544639050960541) },
890 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
891 { FRAC_CONST(0.777145922183990), FRAC_CONST(0.629320383071899) },
892 { FRAC_CONST(0.743144810199738), FRAC_CONST(0.669130623340607) },
893 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
894 { FRAC_CONST(0.669130563735962), FRAC_CONST(0.743144869804382) },
895 { FRAC_CONST(0.629320383071899), FRAC_CONST(0.777145981788635) },
896 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
897 { FRAC_CONST(0.544638991355896), FRAC_CONST(0.838670611381531) },
898 { FRAC_CONST(0.499999970197678), FRAC_CONST(0.866025447845459) },
899 { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
900 { FRAC_CONST(0.406736612319946), FRAC_CONST(0.913545489311218) },
901 { FRAC_CONST(0.358367860317230), FRAC_CONST(0.933580458164215) },
902 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
903 { FRAC_CONST(0.258819073438644), FRAC_CONST(0.965925812721252) },
904 { FRAC_CONST(0.207911655306816), FRAC_CONST(0.978147625923157) },
905 { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
906 { FRAC_CONST(0.104528419673443), FRAC_CONST(0.994521915912628) },
907 { FRAC_CONST(0.052335973829031), FRAC_CONST(0.998629510402679) },
908 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
909 { FRAC_CONST(-0.052336059510708), FRAC_CONST(0.998629510402679) },
910 { FRAC_CONST(-0.104528509080410), FRAC_CONST(0.994521915912628) },
911 { FRAC_CONST(-0.156434446573257), FRAC_CONST(0.987688362598419) },
912 { FRAC_CONST(-0.207911744713783), FRAC_CONST(0.978147566318512) },
913 { FRAC_CONST(-0.258819162845612), FRAC_CONST(0.965925812721252) },
914 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
915 { FRAC_CONST(-0.358367949724197), FRAC_CONST(0.933580458164215) },
916 { FRAC_CONST(-0.406736701726913), FRAC_CONST(0.913545429706573) },
917 { FRAC_CONST(-0.453990608453751), FRAC_CONST(0.891006469726563) },
918 { FRAC_CONST(-0.500000059604645), FRAC_CONST(0.866025388240814) },
919 { FRAC_CONST(-0.544639050960541), FRAC_CONST(0.838670551776886) },
920 { FRAC_CONST(-0.587785184383392), FRAC_CONST(0.809017002582550) },
921 { FRAC_CONST(-0.629320502281189), FRAC_CONST(0.777145862579346) },
922 { FRAC_CONST(-0.669130682945251), FRAC_CONST(0.743144810199738) },
923 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
924 { FRAC_CONST(-0.743144929409027), FRAC_CONST(0.669130444526672) },
925 { FRAC_CONST(-0.777146041393280), FRAC_CONST(0.629320263862610) },
926 { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
927 { FRAC_CONST(-0.838670551776886), FRAC_CONST(0.544639050960541) },
928 { FRAC_CONST(-0.866025388240814), FRAC_CONST(0.500000059604645) },
929 { FRAC_CONST(-0.891006588935852), FRAC_CONST(0.453990370035172) },
930 { FRAC_CONST(-0.913545489311218), FRAC_CONST(0.406736582517624) },
931 { FRAC_CONST(-0.933580458164215), FRAC_CONST(0.358367919921875) },
932 { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
933 { FRAC_CONST(-0.965925872325897), FRAC_CONST(0.258818924427032) },
934 { FRAC_CONST(-0.978147625923157), FRAC_CONST(0.207911610603333) },
935 { FRAC_CONST(-0.987688362598419), FRAC_CONST(0.156434446573257) },
936 { FRAC_CONST(-0.994521915912628), FRAC_CONST(0.104528494179249) },
937 { FRAC_CONST(-0.998629570007324), FRAC_CONST(0.052335809916258) },
938 { FRAC_CONST(-1.000000000000000), FRAC_CONST(-0.000000087422777) },
939 { FRAC_CONST(-0.998629510402679), FRAC_CONST(-0.052335985004902) },
940 { FRAC_CONST(-0.994521856307983), FRAC_CONST(-0.104528672993183) },
941 { FRAC_CONST(-0.987688302993774), FRAC_CONST(-0.156434610486031) },
942 { FRAC_CONST(-0.978147566318512), FRAC_CONST(-0.207911789417267) },
943 { FRAC_CONST(-0.965925812721252), FRAC_CONST(-0.258819073438644) },
944 { FRAC_CONST(-0.951056540012360), FRAC_CONST(-0.309016972780228) },
945 { FRAC_CONST(-0.933580398559570), FRAC_CONST(-0.358368098735809) },
946 { FRAC_CONST(-0.913545429706573), FRAC_CONST(-0.406736731529236) },
947 { FRAC_CONST(-0.891006529331207), FRAC_CONST(-0.453990548849106) },
948 { FRAC_CONST(-0.866025269031525), FRAC_CONST(-0.500000178813934) },
949 { FRAC_CONST(-0.838670492172241), FRAC_CONST(-0.544639170169830) },
950 { FRAC_CONST(-0.809016942977905), FRAC_CONST(-0.587785363197327) },
951 { FRAC_CONST(-0.777145922183990), FRAC_CONST(-0.629320442676544) },
952 { FRAC_CONST(-0.743144810199738), FRAC_CONST(-0.669130623340607) },
953 { FRAC_CONST(-0.707106649875641), FRAC_CONST(-0.707106888294220) },
954 { FRAC_CONST(-0.669130504131317), FRAC_CONST(-0.743144869804382) },
955 { FRAC_CONST(-0.629320323467255), FRAC_CONST(-0.777145981788635) },
956 { FRAC_CONST(-0.587785065174103), FRAC_CONST(-0.809017121791840) },
957 { FRAC_CONST(-0.544639110565186), FRAC_CONST(-0.838670551776886) },
958 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
959 { FRAC_CONST(0.996917307376862), FRAC_CONST(0.078459098935127) },
960 { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
961 { FRAC_CONST(0.972369909286499), FRAC_CONST(0.233445376157761) },
962 { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
963 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
964 { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
965 { FRAC_CONST(0.852640151977539), FRAC_CONST(0.522498548030853) },
966 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
967 { FRAC_CONST(0.760405957698822), FRAC_CONST(0.649448096752167) },
968 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
969 { FRAC_CONST(0.649448037147522), FRAC_CONST(0.760405957698822) },
970 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
971 { FRAC_CONST(0.522498488426209), FRAC_CONST(0.852640211582184) },
972 { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
973 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
974 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
975 { FRAC_CONST(0.233445301651955), FRAC_CONST(0.972369909286499) },
976 { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
977 { FRAC_CONST(0.078459084033966), FRAC_CONST(0.996917307376862) },
978 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
979 { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
980 { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
981 { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
982 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
983 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
984 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
985 { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
986 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
987 { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
988 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
989 { FRAC_CONST(-0.156434446573257), FRAC_CONST(0.987688362598419) },
990 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
991 { FRAC_CONST(-0.453990608453751), FRAC_CONST(0.891006469726563) },
992 { FRAC_CONST(-0.587785184383392), FRAC_CONST(0.809017002582550) },
993 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
994 { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
995 { FRAC_CONST(-0.891006588935852), FRAC_CONST(0.453990370035172) },
996 { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
997 { FRAC_CONST(-0.987688362598419), FRAC_CONST(0.156434446573257) },
998 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
999 { FRAC_CONST(0.972369909286499), FRAC_CONST(0.233445376157761) },
1000 { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
1001 { FRAC_CONST(0.760405957698822), FRAC_CONST(0.649448096752167) },
1002 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
1003 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1004 { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
1005 { FRAC_CONST(-0.078459173440933), FRAC_CONST(0.996917307376862) },
1006 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
1007 { FRAC_CONST(-0.522498667240143), FRAC_CONST(0.852640092372894) },
1008 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1009 { FRAC_CONST(-0.852640211582184), FRAC_CONST(0.522498488426209) },
1010 { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
1011 { FRAC_CONST(-0.996917366981506), FRAC_CONST(0.078459039330482) },
1012 { FRAC_CONST(-0.987688302993774), FRAC_CONST(-0.156434610486031) },
1013 { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
1014 { FRAC_CONST(-0.809016942977905), FRAC_CONST(-0.587785363197327) },
1015 { FRAC_CONST(-0.649447917938232), FRAC_CONST(-0.760406076908112) },
1016 { FRAC_CONST(-0.453990221023560), FRAC_CONST(-0.891006648540497) },
1017 { FRAC_CONST(-0.233445450663567), FRAC_CONST(-0.972369909286499) },
1018 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1019 { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
1020 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
1021 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
1022 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
1023 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1024 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
1025 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
1026 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
1027 { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
1028 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1029 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
1030 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
1031 { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
1032 { FRAC_CONST(-0.809016942977905), FRAC_CONST(-0.587785363197327) },
1033 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1034 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1035 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1036 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1037 { FRAC_CONST(0.309017121791840), FRAC_CONST(-0.951056480407715) }
1038 };
1039 #endif
1040
1041 ALIGN static const complex_t cfft_tab_64[] =
1042 {
1043 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1044 { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
1045 { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
1046 { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
1047 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
1048 { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
1049 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
1050 { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
1051 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1052 { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
1053 { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
1054 { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
1055 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1056 { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
1057 { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
1058 { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
1059 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1060 { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
1061 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
1062 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
1063 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1064 { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
1065 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1066 { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
1067 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
1068 { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
1069 { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
1070 { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
1071 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1072 { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
1073 { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
1074 { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
1075 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1076 { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
1077 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
1078 { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
1079 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1080 { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
1081 { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
1082 { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
1083 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1084 { FRAC_CONST(-0.881921231746674), FRAC_CONST(0.471396833658218) },
1085 { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
1086 { FRAC_CONST(-0.995184719562531), FRAC_CONST(-0.098017267882824) },
1087 { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
1088 { FRAC_CONST(-0.773010551929474), FRAC_CONST(-0.634393215179443) },
1089 { FRAC_CONST(-0.555570006370544), FRAC_CONST(-0.831469774246216) },
1090 { FRAC_CONST(-0.290284544229507), FRAC_CONST(-0.956940352916718) },
1091 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1092 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
1093 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1094 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1095 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1096 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1097 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
1098 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1099 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1100 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1101 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1102 { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
1103 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1104 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1105 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1106 { FRAC_CONST(0.000000011924881), FRAC_CONST(-1.000000000000000) }
1107 };
1108
1109 #ifdef ALLOW_SMALL_FRAMELENGTH
1110 ALIGN static const complex_t cfft_tab_60[] =
1111 {
1112 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1113 { FRAC_CONST(0.994521915912628), FRAC_CONST(0.104528464376926) },
1114 { FRAC_CONST(0.978147625923157), FRAC_CONST(0.207911700010300) },
1115 { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
1116 { FRAC_CONST(0.913545429706573), FRAC_CONST(0.406736642122269) },
1117 { FRAC_CONST(0.866025388240814), FRAC_CONST(0.500000000000000) },
1118 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
1119 { FRAC_CONST(0.743144810199738), FRAC_CONST(0.669130623340607) },
1120 { FRAC_CONST(0.669130563735962), FRAC_CONST(0.743144869804382) },
1121 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
1122 { FRAC_CONST(0.499999970197678), FRAC_CONST(0.866025447845459) },
1123 { FRAC_CONST(0.406736612319946), FRAC_CONST(0.913545489311218) },
1124 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
1125 { FRAC_CONST(0.207911655306816), FRAC_CONST(0.978147625923157) },
1126 { FRAC_CONST(0.104528419673443), FRAC_CONST(0.994521915912628) },
1127 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
1128 { FRAC_CONST(-0.104528509080410), FRAC_CONST(0.994521915912628) },
1129 { FRAC_CONST(-0.207911744713783), FRAC_CONST(0.978147566318512) },
1130 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
1131 { FRAC_CONST(-0.406736701726913), FRAC_CONST(0.913545429706573) },
1132 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1133 { FRAC_CONST(0.978147625923157), FRAC_CONST(0.207911700010300) },
1134 { FRAC_CONST(0.913545429706573), FRAC_CONST(0.406736642122269) },
1135 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
1136 { FRAC_CONST(0.669130563735962), FRAC_CONST(0.743144869804382) },
1137 { FRAC_CONST(0.499999970197678), FRAC_CONST(0.866025447845459) },
1138 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
1139 { FRAC_CONST(0.104528419673443), FRAC_CONST(0.994521915912628) },
1140 { FRAC_CONST(-0.104528509080410), FRAC_CONST(0.994521915912628) },
1141 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
1142 { FRAC_CONST(-0.500000059604645), FRAC_CONST(0.866025388240814) },
1143 { FRAC_CONST(-0.669130682945251), FRAC_CONST(0.743144810199738) },
1144 { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
1145 { FRAC_CONST(-0.913545489311218), FRAC_CONST(0.406736582517624) },
1146 { FRAC_CONST(-0.978147625923157), FRAC_CONST(0.207911610603333) },
1147 { FRAC_CONST(-1.000000000000000), FRAC_CONST(-0.000000087422777) },
1148 { FRAC_CONST(-0.978147566318512), FRAC_CONST(-0.207911789417267) },
1149 { FRAC_CONST(-0.913545429706573), FRAC_CONST(-0.406736731529236) },
1150 { FRAC_CONST(-0.809016942977905), FRAC_CONST(-0.587785363197327) },
1151 { FRAC_CONST(-0.669130504131317), FRAC_CONST(-0.743144869804382) },
1152 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1153 { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
1154 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
1155 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
1156 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
1157 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1158 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
1159 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
1160 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
1161 { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
1162 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1163 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
1164 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
1165 { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
1166 { FRAC_CONST(-0.809016942977905), FRAC_CONST(-0.587785363197327) },
1167 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1168 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1169 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1170 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1171 { FRAC_CONST(0.309017121791840), FRAC_CONST(-0.951056480407715) }
1172 };
1173 #endif
1174
1175 #ifdef LD_DEC
1176
1177 ALIGN static const complex_t cfft_tab_256[] =
1178 {
1179 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1180 { FRAC_CONST(0.999698817729950), FRAC_CONST(0.024541229009628) },
1181 { FRAC_CONST(0.998795449733734), FRAC_CONST(0.049067676067352) },
1182 { FRAC_CONST(0.997290432453156), FRAC_CONST(0.073564566671848) },
1183 { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
1184 { FRAC_CONST(0.992479562759399), FRAC_CONST(0.122410677373409) },
1185 { FRAC_CONST(0.989176511764526), FRAC_CONST(0.146730467677116) },
1186 { FRAC_CONST(0.985277652740479), FRAC_CONST(0.170961901545525) },
1187 { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
1188 { FRAC_CONST(0.975702106952667), FRAC_CONST(0.219101235270500) },
1189 { FRAC_CONST(0.970031261444092), FRAC_CONST(0.242980197072029) },
1190 { FRAC_CONST(0.963776051998138), FRAC_CONST(0.266712784767151) },
1191 { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
1192 { FRAC_CONST(0.949528157711029), FRAC_CONST(0.313681751489639) },
1193 { FRAC_CONST(0.941544055938721), FRAC_CONST(0.336889863014221) },
1194 { FRAC_CONST(0.932992815971375), FRAC_CONST(0.359895050525665) },
1195 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
1196 { FRAC_CONST(0.914209723472595), FRAC_CONST(0.405241340398788) },
1197 { FRAC_CONST(0.903989315032959), FRAC_CONST(0.427555084228516) },
1198 { FRAC_CONST(0.893224298954010), FRAC_CONST(0.449611335992813) },
1199 { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
1200 { FRAC_CONST(0.870086967945099), FRAC_CONST(0.492898225784302) },
1201 { FRAC_CONST(0.857728600502014), FRAC_CONST(0.514102756977081) },
1202 { FRAC_CONST(0.844853579998016), FRAC_CONST(0.534997642040253) },
1203 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
1204 { FRAC_CONST(0.817584812641144), FRAC_CONST(0.575808227062225) },
1205 { FRAC_CONST(0.803207516670227), FRAC_CONST(0.595699310302734) },
1206 { FRAC_CONST(0.788346409797668), FRAC_CONST(0.615231633186340) },
1207 { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
1208 { FRAC_CONST(0.757208824157715), FRAC_CONST(0.653172850608826) },
1209 { FRAC_CONST(0.740951120853424), FRAC_CONST(0.671558976173401) },
1210 { FRAC_CONST(0.724247097969055), FRAC_CONST(0.689540565013886) },
1211 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1212 { FRAC_CONST(0.689540505409241), FRAC_CONST(0.724247097969055) },
1213 { FRAC_CONST(0.671558916568756), FRAC_CONST(0.740951180458069) },
1214 { FRAC_CONST(0.653172791004181), FRAC_CONST(0.757208883762360) },
1215 { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
1216 { FRAC_CONST(0.615231573581696), FRAC_CONST(0.788346409797668) },
1217 { FRAC_CONST(0.595699310302734), FRAC_CONST(0.803207516670227) },
1218 { FRAC_CONST(0.575808167457581), FRAC_CONST(0.817584812641144) },
1219 { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
1220 { FRAC_CONST(0.534997642040253), FRAC_CONST(0.844853579998016) },
1221 { FRAC_CONST(0.514102697372437), FRAC_CONST(0.857728660106659) },
1222 { FRAC_CONST(0.492898195981979), FRAC_CONST(0.870086967945099) },
1223 { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
1224 { FRAC_CONST(0.449611306190491), FRAC_CONST(0.893224298954010) },
1225 { FRAC_CONST(0.427555114030838), FRAC_CONST(0.903989315032959) },
1226 { FRAC_CONST(0.405241280794144), FRAC_CONST(0.914209783077240) },
1227 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1228 { FRAC_CONST(0.359894961118698), FRAC_CONST(0.932992815971375) },
1229 { FRAC_CONST(0.336889833211899), FRAC_CONST(0.941544055938721) },
1230 { FRAC_CONST(0.313681662082672), FRAC_CONST(0.949528217315674) },
1231 { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
1232 { FRAC_CONST(0.266712754964828), FRAC_CONST(0.963776051998138) },
1233 { FRAC_CONST(0.242980122566223), FRAC_CONST(0.970031261444092) },
1234 { FRAC_CONST(0.219101220369339), FRAC_CONST(0.975702106952667) },
1235 { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
1236 { FRAC_CONST(0.170961856842041), FRAC_CONST(0.985277652740479) },
1237 { FRAC_CONST(0.146730497479439), FRAC_CONST(0.989176511764526) },
1238 { FRAC_CONST(0.122410625219345), FRAC_CONST(0.992479562759399) },
1239 { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
1240 { FRAC_CONST(0.073564492166042), FRAC_CONST(0.997290432453156) },
1241 { FRAC_CONST(0.049067649990320), FRAC_CONST(0.998795449733734) },
1242 { FRAC_CONST(0.024541135877371), FRAC_CONST(0.999698817729950) },
1243 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1244 { FRAC_CONST(0.998795449733734), FRAC_CONST(0.049067676067352) },
1245 { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
1246 { FRAC_CONST(0.989176511764526), FRAC_CONST(0.146730467677116) },
1247 { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
1248 { FRAC_CONST(0.970031261444092), FRAC_CONST(0.242980197072029) },
1249 { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
1250 { FRAC_CONST(0.941544055938721), FRAC_CONST(0.336889863014221) },
1251 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
1252 { FRAC_CONST(0.903989315032959), FRAC_CONST(0.427555084228516) },
1253 { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
1254 { FRAC_CONST(0.857728600502014), FRAC_CONST(0.514102756977081) },
1255 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
1256 { FRAC_CONST(0.803207516670227), FRAC_CONST(0.595699310302734) },
1257 { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
1258 { FRAC_CONST(0.740951120853424), FRAC_CONST(0.671558976173401) },
1259 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1260 { FRAC_CONST(0.671558916568756), FRAC_CONST(0.740951180458069) },
1261 { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
1262 { FRAC_CONST(0.595699310302734), FRAC_CONST(0.803207516670227) },
1263 { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
1264 { FRAC_CONST(0.514102697372437), FRAC_CONST(0.857728660106659) },
1265 { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
1266 { FRAC_CONST(0.427555114030838), FRAC_CONST(0.903989315032959) },
1267 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1268 { FRAC_CONST(0.336889833211899), FRAC_CONST(0.941544055938721) },
1269 { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
1270 { FRAC_CONST(0.242980122566223), FRAC_CONST(0.970031261444092) },
1271 { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
1272 { FRAC_CONST(0.146730497479439), FRAC_CONST(0.989176511764526) },
1273 { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
1274 { FRAC_CONST(0.049067649990320), FRAC_CONST(0.998795449733734) },
1275 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
1276 { FRAC_CONST(-0.049067739397287), FRAC_CONST(0.998795449733734) },
1277 { FRAC_CONST(-0.098017223179340), FRAC_CONST(0.995184719562531) },
1278 { FRAC_CONST(-0.146730571985245), FRAC_CONST(0.989176511764526) },
1279 { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
1280 { FRAC_CONST(-0.242980197072029), FRAC_CONST(0.970031261444092) },
1281 { FRAC_CONST(-0.290284723043442), FRAC_CONST(0.956940293312073) },
1282 { FRAC_CONST(-0.336889922618866), FRAC_CONST(0.941544055938721) },
1283 { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
1284 { FRAC_CONST(-0.427555084228516), FRAC_CONST(0.903989315032959) },
1285 { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
1286 { FRAC_CONST(-0.514102756977081), FRAC_CONST(0.857728600502014) },
1287 { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
1288 { FRAC_CONST(-0.595699369907379), FRAC_CONST(0.803207516670227) },
1289 { FRAC_CONST(-0.634393274784088), FRAC_CONST(0.773010492324829) },
1290 { FRAC_CONST(-0.671559035778046), FRAC_CONST(0.740951061248779) },
1291 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1292 { FRAC_CONST(-0.740951240062714), FRAC_CONST(0.671558856964111) },
1293 { FRAC_CONST(-0.773010492324829), FRAC_CONST(0.634393274784088) },
1294 { FRAC_CONST(-0.803207635879517), FRAC_CONST(0.595699131488800) },
1295 { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
1296 { FRAC_CONST(-0.857728600502014), FRAC_CONST(0.514102756977081) },
1297 { FRAC_CONST(-0.881921350955963), FRAC_CONST(0.471396625041962) },
1298 { FRAC_CONST(-0.903989315032959), FRAC_CONST(0.427555054426193) },
1299 { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
1300 { FRAC_CONST(-0.941544115543365), FRAC_CONST(0.336889803409576) },
1301 { FRAC_CONST(-0.956940352916718), FRAC_CONST(0.290284723043442) },
1302 { FRAC_CONST(-0.970031261444092), FRAC_CONST(0.242980077862740) },
1303 { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
1304 { FRAC_CONST(-0.989176511764526), FRAC_CONST(0.146730333566666) },
1305 { FRAC_CONST(-0.995184719562531), FRAC_CONST(0.098017096519470) },
1306 { FRAC_CONST(-0.998795449733734), FRAC_CONST(0.049067486077547) },
1307 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1308 { FRAC_CONST(0.997290432453156), FRAC_CONST(0.073564566671848) },
1309 { FRAC_CONST(0.989176511764526), FRAC_CONST(0.146730467677116) },
1310 { FRAC_CONST(0.975702106952667), FRAC_CONST(0.219101235270500) },
1311 { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
1312 { FRAC_CONST(0.932992815971375), FRAC_CONST(0.359895050525665) },
1313 { FRAC_CONST(0.903989315032959), FRAC_CONST(0.427555084228516) },
1314 { FRAC_CONST(0.870086967945099), FRAC_CONST(0.492898225784302) },
1315 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
1316 { FRAC_CONST(0.788346469402313), FRAC_CONST(0.615231573581696) },
1317 { FRAC_CONST(0.740951120853424), FRAC_CONST(0.671558976173401) },
1318 { FRAC_CONST(0.689540505409241), FRAC_CONST(0.724247097969055) },
1319 { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
1320 { FRAC_CONST(0.575808227062225), FRAC_CONST(0.817584812641144) },
1321 { FRAC_CONST(0.514102697372437), FRAC_CONST(0.857728660106659) },
1322 { FRAC_CONST(0.449611306190491), FRAC_CONST(0.893224298954010) },
1323 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1324 { FRAC_CONST(0.313681751489639), FRAC_CONST(0.949528157711029) },
1325 { FRAC_CONST(0.242980241775513), FRAC_CONST(0.970031261444092) },
1326 { FRAC_CONST(0.170961856842041), FRAC_CONST(0.985277652740479) },
1327 { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
1328 { FRAC_CONST(0.024541255086660), FRAC_CONST(0.999698817729950) },
1329 { FRAC_CONST(-0.049067739397287), FRAC_CONST(0.998795449733734) },
1330 { FRAC_CONST(-0.122410707175732), FRAC_CONST(0.992479503154755) },
1331 { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
1332 { FRAC_CONST(-0.266712725162506), FRAC_CONST(0.963776051998138) },
1333 { FRAC_CONST(-0.336889803409576), FRAC_CONST(0.941544055938721) },
1334 { FRAC_CONST(-0.405241340398788), FRAC_CONST(0.914209723472595) },
1335 { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
1336 { FRAC_CONST(-0.534997701644897), FRAC_CONST(0.844853520393372) },
1337 { FRAC_CONST(-0.595699369907379), FRAC_CONST(0.803207516670227) },
1338 { FRAC_CONST(-0.653172850608826), FRAC_CONST(0.757208824157715) },
1339 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1340 { FRAC_CONST(-0.757208824157715), FRAC_CONST(0.653172850608826) },
1341 { FRAC_CONST(-0.803207516670227), FRAC_CONST(0.595699369907379) },
1342 { FRAC_CONST(-0.844853520393372), FRAC_CONST(0.534997701644897) },
1343 { FRAC_CONST(-0.881921231746674), FRAC_CONST(0.471396833658218) },
1344 { FRAC_CONST(-0.914209783077240), FRAC_CONST(0.405241221189499) },
1345 { FRAC_CONST(-0.941544115543365), FRAC_CONST(0.336889803409576) },
1346 { FRAC_CONST(-0.963776051998138), FRAC_CONST(0.266712725162506) },
1347 { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
1348 { FRAC_CONST(-0.992479503154755), FRAC_CONST(0.122410699725151) },
1349 { FRAC_CONST(-0.998795449733734), FRAC_CONST(0.049067724496126) },
1350 { FRAC_CONST(-0.999698817729950), FRAC_CONST(-0.024541147053242) },
1351 { FRAC_CONST(-0.995184719562531), FRAC_CONST(-0.098017267882824) },
1352 { FRAC_CONST(-0.985277652740479), FRAC_CONST(-0.170961990952492) },
1353 { FRAC_CONST(-0.970031261444092), FRAC_CONST(-0.242980241775513) },
1354 { FRAC_CONST(-0.949528157711029), FRAC_CONST(-0.313681781291962) },
1355 { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
1356 { FRAC_CONST(-0.893224298954010), FRAC_CONST(-0.449611306190491) },
1357 { FRAC_CONST(-0.857728660106659), FRAC_CONST(-0.514102697372437) },
1358 { FRAC_CONST(-0.817584872245789), FRAC_CONST(-0.575808107852936) },
1359 { FRAC_CONST(-0.773010551929474), FRAC_CONST(-0.634393215179443) },
1360 { FRAC_CONST(-0.724247038364410), FRAC_CONST(-0.689540624618530) },
1361 { FRAC_CONST(-0.671558916568756), FRAC_CONST(-0.740951180458069) },
1362 { FRAC_CONST(-0.615231573581696), FRAC_CONST(-0.788346469402313) },
1363 { FRAC_CONST(-0.555570006370544), FRAC_CONST(-0.831469774246216) },
1364 { FRAC_CONST(-0.492898195981979), FRAC_CONST(-0.870086967945099) },
1365 { FRAC_CONST(-0.427554935216904), FRAC_CONST(-0.903989374637604) },
1366 { FRAC_CONST(-0.359895110130310), FRAC_CONST(-0.932992756366730) },
1367 { FRAC_CONST(-0.290284544229507), FRAC_CONST(-0.956940352916718) },
1368 { FRAC_CONST(-0.219101369380951), FRAC_CONST(-0.975702106952667) },
1369 { FRAC_CONST(-0.146730408072472), FRAC_CONST(-0.989176511764526) },
1370 { FRAC_CONST(-0.073564760386944), FRAC_CONST(-0.997290432453156) },
1371 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1372 { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
1373 { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
1374 { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
1375 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
1376 { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
1377 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
1378 { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
1379 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1380 { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
1381 { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
1382 { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
1383 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1384 { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
1385 { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
1386 { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
1387 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1388 { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
1389 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
1390 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
1391 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1392 { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
1393 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1394 { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
1395 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
1396 { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
1397 { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
1398 { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
1399 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1400 { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
1401 { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
1402 { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
1403 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1404 { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
1405 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
1406 { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
1407 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1408 { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
1409 { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
1410 { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
1411 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1412 { FRAC_CONST(-0.881921231746674), FRAC_CONST(0.471396833658218) },
1413 { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
1414 { FRAC_CONST(-0.995184719562531), FRAC_CONST(-0.098017267882824) },
1415 { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
1416 { FRAC_CONST(-0.773010551929474), FRAC_CONST(-0.634393215179443) },
1417 { FRAC_CONST(-0.555570006370544), FRAC_CONST(-0.831469774246216) },
1418 { FRAC_CONST(-0.290284544229507), FRAC_CONST(-0.956940352916718) },
1419 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1420 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
1421 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1422 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1423 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1424 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1425 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
1426 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1427 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1428 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1429 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1430 { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
1431 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1432 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1433 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1434 { FRAC_CONST(0.000000011924881), FRAC_CONST(-1.000000000000000) }
1435 };
1436
1437 #ifdef ALLOW_SMALL_FRAMELENGTH
1438 ALIGN static const complex_t cfft_tab_240[] =
1439 {
1440 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1441 { FRAC_CONST(0.999657332897186), FRAC_CONST(0.026176949962974) },
1442 { FRAC_CONST(0.998629510402679), FRAC_CONST(0.052335958927870) },
1443 { FRAC_CONST(0.996917307376862), FRAC_CONST(0.078459098935127) },
1444 { FRAC_CONST(0.994521915912628), FRAC_CONST(0.104528464376926) },
1445 { FRAC_CONST(0.991444885730743), FRAC_CONST(0.130526199936867) },
1446 { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
1447 { FRAC_CONST(0.983254909515381), FRAC_CONST(0.182235524058342) },
1448 { FRAC_CONST(0.978147625923157), FRAC_CONST(0.207911700010300) },
1449 { FRAC_CONST(0.972369909286499), FRAC_CONST(0.233445376157761) },
1450 { FRAC_CONST(0.965925812721252), FRAC_CONST(0.258819043636322) },
1451 { FRAC_CONST(0.958819746971130), FRAC_CONST(0.284015357494354) },
1452 { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
1453 { FRAC_CONST(0.942641496658325), FRAC_CONST(0.333806872367859) },
1454 { FRAC_CONST(0.933580398559570), FRAC_CONST(0.358367949724197) },
1455 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
1456 { FRAC_CONST(0.913545429706573), FRAC_CONST(0.406736642122269) },
1457 { FRAC_CONST(0.902585268020630), FRAC_CONST(0.430511116981506) },
1458 { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
1459 { FRAC_CONST(0.878817081451416), FRAC_CONST(0.477158784866333) },
1460 { FRAC_CONST(0.866025388240814), FRAC_CONST(0.500000000000000) },
1461 { FRAC_CONST(0.852640151977539), FRAC_CONST(0.522498548030853) },
1462 { FRAC_CONST(0.838670551776886), FRAC_CONST(0.544639050960541) },
1463 { FRAC_CONST(0.824126183986664), FRAC_CONST(0.566406250000000) },
1464 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
1465 { FRAC_CONST(0.793353319168091), FRAC_CONST(0.608761429786682) },
1466 { FRAC_CONST(0.777145922183990), FRAC_CONST(0.629320383071899) },
1467 { FRAC_CONST(0.760405957698822), FRAC_CONST(0.649448096752167) },
1468 { FRAC_CONST(0.743144810199738), FRAC_CONST(0.669130623340607) },
1469 { FRAC_CONST(0.725374400615692), FRAC_CONST(0.688354551792145) },
1470 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1471 { FRAC_CONST(0.688354551792145), FRAC_CONST(0.725374400615692) },
1472 { FRAC_CONST(0.669130563735962), FRAC_CONST(0.743144869804382) },
1473 { FRAC_CONST(0.649448037147522), FRAC_CONST(0.760405957698822) },
1474 { FRAC_CONST(0.629320383071899), FRAC_CONST(0.777145981788635) },
1475 { FRAC_CONST(0.608761370182037), FRAC_CONST(0.793353378772736) },
1476 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
1477 { FRAC_CONST(0.566406250000000), FRAC_CONST(0.824126183986664) },
1478 { FRAC_CONST(0.544638991355896), FRAC_CONST(0.838670611381531) },
1479 { FRAC_CONST(0.522498488426209), FRAC_CONST(0.852640211582184) },
1480 { FRAC_CONST(0.499999970197678), FRAC_CONST(0.866025447845459) },
1481 { FRAC_CONST(0.477158755064011), FRAC_CONST(0.878817141056061) },
1482 { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
1483 { FRAC_CONST(0.430511027574539), FRAC_CONST(0.902585327625275) },
1484 { FRAC_CONST(0.406736612319946), FRAC_CONST(0.913545489311218) },
1485 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1486 { FRAC_CONST(0.358367860317230), FRAC_CONST(0.933580458164215) },
1487 { FRAC_CONST(0.333806812763214), FRAC_CONST(0.942641496658325) },
1488 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
1489 { FRAC_CONST(0.284015327692032), FRAC_CONST(0.958819746971130) },
1490 { FRAC_CONST(0.258819073438644), FRAC_CONST(0.965925812721252) },
1491 { FRAC_CONST(0.233445301651955), FRAC_CONST(0.972369909286499) },
1492 { FRAC_CONST(0.207911655306816), FRAC_CONST(0.978147625923157) },
1493 { FRAC_CONST(0.182235524058342), FRAC_CONST(0.983254909515381) },
1494 { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
1495 { FRAC_CONST(0.130526125431061), FRAC_CONST(0.991444885730743) },
1496 { FRAC_CONST(0.104528419673443), FRAC_CONST(0.994521915912628) },
1497 { FRAC_CONST(0.078459084033966), FRAC_CONST(0.996917307376862) },
1498 { FRAC_CONST(0.052335973829031), FRAC_CONST(0.998629510402679) },
1499 { FRAC_CONST(0.026176875457168), FRAC_CONST(0.999657332897186) },
1500 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
1501 { FRAC_CONST(-0.026176963001490), FRAC_CONST(0.999657332897186) },
1502 { FRAC_CONST(-0.052336059510708), FRAC_CONST(0.998629510402679) },
1503 { FRAC_CONST(-0.078459173440933), FRAC_CONST(0.996917307376862) },
1504 { FRAC_CONST(-0.104528509080410), FRAC_CONST(0.994521915912628) },
1505 { FRAC_CONST(-0.130526214838028), FRAC_CONST(0.991444885730743) },
1506 { FRAC_CONST(-0.156434446573257), FRAC_CONST(0.987688362598419) },
1507 { FRAC_CONST(-0.182235598564148), FRAC_CONST(0.983254909515381) },
1508 { FRAC_CONST(-0.207911744713783), FRAC_CONST(0.978147566318512) },
1509 { FRAC_CONST(-0.233445391058922), FRAC_CONST(0.972369909286499) },
1510 { FRAC_CONST(-0.258819162845612), FRAC_CONST(0.965925812721252) },
1511 { FRAC_CONST(-0.284015417098999), FRAC_CONST(0.958819687366486) },
1512 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
1513 { FRAC_CONST(-0.333806872367859), FRAC_CONST(0.942641496658325) },
1514 { FRAC_CONST(-0.358367949724197), FRAC_CONST(0.933580458164215) },
1515 { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
1516 { FRAC_CONST(-0.406736701726913), FRAC_CONST(0.913545429706573) },
1517 { FRAC_CONST(-0.430511116981506), FRAC_CONST(0.902585268020630) },
1518 { FRAC_CONST(-0.453990608453751), FRAC_CONST(0.891006469726563) },
1519 { FRAC_CONST(-0.477158725261688), FRAC_CONST(0.878817141056061) },
1520 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1521 { FRAC_CONST(0.998629510402679), FRAC_CONST(0.052335958927870) },
1522 { FRAC_CONST(0.994521915912628), FRAC_CONST(0.104528464376926) },
1523 { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
1524 { FRAC_CONST(0.978147625923157), FRAC_CONST(0.207911700010300) },
1525 { FRAC_CONST(0.965925812721252), FRAC_CONST(0.258819043636322) },
1526 { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
1527 { FRAC_CONST(0.933580398559570), FRAC_CONST(0.358367949724197) },
1528 { FRAC_CONST(0.913545429706573), FRAC_CONST(0.406736642122269) },
1529 { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
1530 { FRAC_CONST(0.866025388240814), FRAC_CONST(0.500000000000000) },
1531 { FRAC_CONST(0.838670551776886), FRAC_CONST(0.544639050960541) },
1532 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
1533 { FRAC_CONST(0.777145922183990), FRAC_CONST(0.629320383071899) },
1534 { FRAC_CONST(0.743144810199738), FRAC_CONST(0.669130623340607) },
1535 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1536 { FRAC_CONST(0.669130563735962), FRAC_CONST(0.743144869804382) },
1537 { FRAC_CONST(0.629320383071899), FRAC_CONST(0.777145981788635) },
1538 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
1539 { FRAC_CONST(0.544638991355896), FRAC_CONST(0.838670611381531) },
1540 { FRAC_CONST(0.499999970197678), FRAC_CONST(0.866025447845459) },
1541 { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
1542 { FRAC_CONST(0.406736612319946), FRAC_CONST(0.913545489311218) },
1543 { FRAC_CONST(0.358367860317230), FRAC_CONST(0.933580458164215) },
1544 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
1545 { FRAC_CONST(0.258819073438644), FRAC_CONST(0.965925812721252) },
1546 { FRAC_CONST(0.207911655306816), FRAC_CONST(0.978147625923157) },
1547 { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
1548 { FRAC_CONST(0.104528419673443), FRAC_CONST(0.994521915912628) },
1549 { FRAC_CONST(0.052335973829031), FRAC_CONST(0.998629510402679) },
1550 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
1551 { FRAC_CONST(-0.052336059510708), FRAC_CONST(0.998629510402679) },
1552 { FRAC_CONST(-0.104528509080410), FRAC_CONST(0.994521915912628) },
1553 { FRAC_CONST(-0.156434446573257), FRAC_CONST(0.987688362598419) },
1554 { FRAC_CONST(-0.207911744713783), FRAC_CONST(0.978147566318512) },
1555 { FRAC_CONST(-0.258819162845612), FRAC_CONST(0.965925812721252) },
1556 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
1557 { FRAC_CONST(-0.358367949724197), FRAC_CONST(0.933580458164215) },
1558 { FRAC_CONST(-0.406736701726913), FRAC_CONST(0.913545429706573) },
1559 { FRAC_CONST(-0.453990608453751), FRAC_CONST(0.891006469726563) },
1560 { FRAC_CONST(-0.500000059604645), FRAC_CONST(0.866025388240814) },
1561 { FRAC_CONST(-0.544639050960541), FRAC_CONST(0.838670551776886) },
1562 { FRAC_CONST(-0.587785184383392), FRAC_CONST(0.809017002582550) },
1563 { FRAC_CONST(-0.629320502281189), FRAC_CONST(0.777145862579346) },
1564 { FRAC_CONST(-0.669130682945251), FRAC_CONST(0.743144810199738) },
1565 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1566 { FRAC_CONST(-0.743144929409027), FRAC_CONST(0.669130444526672) },
1567 { FRAC_CONST(-0.777146041393280), FRAC_CONST(0.629320263862610) },
1568 { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
1569 { FRAC_CONST(-0.838670551776886), FRAC_CONST(0.544639050960541) },
1570 { FRAC_CONST(-0.866025388240814), FRAC_CONST(0.500000059604645) },
1571 { FRAC_CONST(-0.891006588935852), FRAC_CONST(0.453990370035172) },
1572 { FRAC_CONST(-0.913545489311218), FRAC_CONST(0.406736582517624) },
1573 { FRAC_CONST(-0.933580458164215), FRAC_CONST(0.358367919921875) },
1574 { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
1575 { FRAC_CONST(-0.965925872325897), FRAC_CONST(0.258818924427032) },
1576 { FRAC_CONST(-0.978147625923157), FRAC_CONST(0.207911610603333) },
1577 { FRAC_CONST(-0.987688362598419), FRAC_CONST(0.156434446573257) },
1578 { FRAC_CONST(-0.994521915912628), FRAC_CONST(0.104528494179249) },
1579 { FRAC_CONST(-0.998629570007324), FRAC_CONST(0.052335809916258) },
1580 { FRAC_CONST(-1.000000000000000), FRAC_CONST(-0.000000087422777) },
1581 { FRAC_CONST(-0.998629510402679), FRAC_CONST(-0.052335985004902) },
1582 { FRAC_CONST(-0.994521856307983), FRAC_CONST(-0.104528672993183) },
1583 { FRAC_CONST(-0.987688302993774), FRAC_CONST(-0.156434610486031) },
1584 { FRAC_CONST(-0.978147566318512), FRAC_CONST(-0.207911789417267) },
1585 { FRAC_CONST(-0.965925812721252), FRAC_CONST(-0.258819073438644) },
1586 { FRAC_CONST(-0.951056540012360), FRAC_CONST(-0.309016972780228) },
1587 { FRAC_CONST(-0.933580398559570), FRAC_CONST(-0.358368098735809) },
1588 { FRAC_CONST(-0.913545429706573), FRAC_CONST(-0.406736731529236) },
1589 { FRAC_CONST(-0.891006529331207), FRAC_CONST(-0.453990548849106) },
1590 { FRAC_CONST(-0.866025269031525), FRAC_CONST(-0.500000178813934) },
1591 { FRAC_CONST(-0.838670492172241), FRAC_CONST(-0.544639170169830) },
1592 { FRAC_CONST(-0.809016942977905), FRAC_CONST(-0.587785363197327) },
1593 { FRAC_CONST(-0.777145922183990), FRAC_CONST(-0.629320442676544) },
1594 { FRAC_CONST(-0.743144810199738), FRAC_CONST(-0.669130623340607) },
1595 { FRAC_CONST(-0.707106649875641), FRAC_CONST(-0.707106888294220) },
1596 { FRAC_CONST(-0.669130504131317), FRAC_CONST(-0.743144869804382) },
1597 { FRAC_CONST(-0.629320323467255), FRAC_CONST(-0.777145981788635) },
1598 { FRAC_CONST(-0.587785065174103), FRAC_CONST(-0.809017121791840) },
1599 { FRAC_CONST(-0.544639110565186), FRAC_CONST(-0.838670551776886) },
1600 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1601 { FRAC_CONST(0.996917307376862), FRAC_CONST(0.078459098935127) },
1602 { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
1603 { FRAC_CONST(0.972369909286499), FRAC_CONST(0.233445376157761) },
1604 { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
1605 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
1606 { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
1607 { FRAC_CONST(0.852640151977539), FRAC_CONST(0.522498548030853) },
1608 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
1609 { FRAC_CONST(0.760405957698822), FRAC_CONST(0.649448096752167) },
1610 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1611 { FRAC_CONST(0.649448037147522), FRAC_CONST(0.760405957698822) },
1612 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
1613 { FRAC_CONST(0.522498488426209), FRAC_CONST(0.852640211582184) },
1614 { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
1615 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1616 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
1617 { FRAC_CONST(0.233445301651955), FRAC_CONST(0.972369909286499) },
1618 { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
1619 { FRAC_CONST(0.078459084033966), FRAC_CONST(0.996917307376862) },
1620 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1621 { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
1622 { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
1623 { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
1624 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
1625 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1626 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
1627 { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
1628 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
1629 { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
1630 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
1631 { FRAC_CONST(-0.156434446573257), FRAC_CONST(0.987688362598419) },
1632 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
1633 { FRAC_CONST(-0.453990608453751), FRAC_CONST(0.891006469726563) },
1634 { FRAC_CONST(-0.587785184383392), FRAC_CONST(0.809017002582550) },
1635 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1636 { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
1637 { FRAC_CONST(-0.891006588935852), FRAC_CONST(0.453990370035172) },
1638 { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
1639 { FRAC_CONST(-0.987688362598419), FRAC_CONST(0.156434446573257) },
1640 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1641 { FRAC_CONST(0.972369909286499), FRAC_CONST(0.233445376157761) },
1642 { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
1643 { FRAC_CONST(0.760405957698822), FRAC_CONST(0.649448096752167) },
1644 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
1645 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1646 { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
1647 { FRAC_CONST(-0.078459173440933), FRAC_CONST(0.996917307376862) },
1648 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
1649 { FRAC_CONST(-0.522498667240143), FRAC_CONST(0.852640092372894) },
1650 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1651 { FRAC_CONST(-0.852640211582184), FRAC_CONST(0.522498488426209) },
1652 { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
1653 { FRAC_CONST(-0.996917366981506), FRAC_CONST(0.078459039330482) },
1654 { FRAC_CONST(-0.987688302993774), FRAC_CONST(-0.156434610486031) },
1655 { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
1656 { FRAC_CONST(-0.809016942977905), FRAC_CONST(-0.587785363197327) },
1657 { FRAC_CONST(-0.649447917938232), FRAC_CONST(-0.760406076908112) },
1658 { FRAC_CONST(-0.453990221023560), FRAC_CONST(-0.891006648540497) },
1659 { FRAC_CONST(-0.233445450663567), FRAC_CONST(-0.972369909286499) },
1660 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1661 { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
1662 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
1663 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
1664 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
1665 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1666 { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
1667 { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
1668 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
1669 { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
1670 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1671 { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
1672 { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
1673 { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
1674 { FRAC_CONST(-0.809016942977905), FRAC_CONST(-0.587785363197327) },
1675 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1676 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1677 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1678 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1679 { FRAC_CONST(0.309017121791840), FRAC_CONST(-0.951056480407715) }
1680 };
1681 #endif
1682
1683 #endif
1684
1685 ALIGN static const complex_t cfft_tab_128[] =
1686 {
1687 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1688 { FRAC_CONST(0.998795449733734), FRAC_CONST(0.049067676067352) },
1689 { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
1690 { FRAC_CONST(0.989176511764526), FRAC_CONST(0.146730467677116) },
1691 { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
1692 { FRAC_CONST(0.970031261444092), FRAC_CONST(0.242980197072029) },
1693 { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
1694 { FRAC_CONST(0.941544055938721), FRAC_CONST(0.336889863014221) },
1695 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
1696 { FRAC_CONST(0.903989315032959), FRAC_CONST(0.427555084228516) },
1697 { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
1698 { FRAC_CONST(0.857728600502014), FRAC_CONST(0.514102756977081) },
1699 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
1700 { FRAC_CONST(0.803207516670227), FRAC_CONST(0.595699310302734) },
1701 { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
1702 { FRAC_CONST(0.740951120853424), FRAC_CONST(0.671558976173401) },
1703 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1704 { FRAC_CONST(0.671558916568756), FRAC_CONST(0.740951180458069) },
1705 { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
1706 { FRAC_CONST(0.595699310302734), FRAC_CONST(0.803207516670227) },
1707 { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
1708 { FRAC_CONST(0.514102697372437), FRAC_CONST(0.857728660106659) },
1709 { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
1710 { FRAC_CONST(0.427555114030838), FRAC_CONST(0.903989315032959) },
1711 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1712 { FRAC_CONST(0.336889833211899), FRAC_CONST(0.941544055938721) },
1713 { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
1714 { FRAC_CONST(0.242980122566223), FRAC_CONST(0.970031261444092) },
1715 { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
1716 { FRAC_CONST(0.146730497479439), FRAC_CONST(0.989176511764526) },
1717 { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
1718 { FRAC_CONST(0.049067649990320), FRAC_CONST(0.998795449733734) },
1719 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
1720 { FRAC_CONST(-0.049067739397287), FRAC_CONST(0.998795449733734) },
1721 { FRAC_CONST(-0.098017223179340), FRAC_CONST(0.995184719562531) },
1722 { FRAC_CONST(-0.146730571985245), FRAC_CONST(0.989176511764526) },
1723 { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
1724 { FRAC_CONST(-0.242980197072029), FRAC_CONST(0.970031261444092) },
1725 { FRAC_CONST(-0.290284723043442), FRAC_CONST(0.956940293312073) },
1726 { FRAC_CONST(-0.336889922618866), FRAC_CONST(0.941544055938721) },
1727 { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
1728 { FRAC_CONST(-0.427555084228516), FRAC_CONST(0.903989315032959) },
1729 { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
1730 { FRAC_CONST(-0.514102756977081), FRAC_CONST(0.857728600502014) },
1731 { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
1732 { FRAC_CONST(-0.595699369907379), FRAC_CONST(0.803207516670227) },
1733 { FRAC_CONST(-0.634393274784088), FRAC_CONST(0.773010492324829) },
1734 { FRAC_CONST(-0.671559035778046), FRAC_CONST(0.740951061248779) },
1735 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1736 { FRAC_CONST(-0.740951240062714), FRAC_CONST(0.671558856964111) },
1737 { FRAC_CONST(-0.773010492324829), FRAC_CONST(0.634393274784088) },
1738 { FRAC_CONST(-0.803207635879517), FRAC_CONST(0.595699131488800) },
1739 { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
1740 { FRAC_CONST(-0.857728600502014), FRAC_CONST(0.514102756977081) },
1741 { FRAC_CONST(-0.881921350955963), FRAC_CONST(0.471396625041962) },
1742 { FRAC_CONST(-0.903989315032959), FRAC_CONST(0.427555054426193) },
1743 { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
1744 { FRAC_CONST(-0.941544115543365), FRAC_CONST(0.336889803409576) },
1745 { FRAC_CONST(-0.956940352916718), FRAC_CONST(0.290284723043442) },
1746 { FRAC_CONST(-0.970031261444092), FRAC_CONST(0.242980077862740) },
1747 { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
1748 { FRAC_CONST(-0.989176511764526), FRAC_CONST(0.146730333566666) },
1749 { FRAC_CONST(-0.995184719562531), FRAC_CONST(0.098017096519470) },
1750 { FRAC_CONST(-0.998795449733734), FRAC_CONST(0.049067486077547) },
1751 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1752 { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
1753 { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
1754 { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
1755 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
1756 { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
1757 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
1758 { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
1759 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1760 { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
1761 { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
1762 { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
1763 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1764 { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
1765 { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
1766 { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
1767 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1768 { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
1769 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
1770 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
1771 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1772 { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
1773 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1774 { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
1775 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
1776 { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
1777 { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
1778 { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
1779 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1780 { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
1781 { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
1782 { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
1783 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1784 { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
1785 { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
1786 { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
1787 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1788 { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
1789 { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
1790 { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
1791 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1792 { FRAC_CONST(-0.881921231746674), FRAC_CONST(0.471396833658218) },
1793 { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
1794 { FRAC_CONST(-0.995184719562531), FRAC_CONST(-0.098017267882824) },
1795 { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
1796 { FRAC_CONST(-0.773010551929474), FRAC_CONST(-0.634393215179443) },
1797 { FRAC_CONST(-0.555570006370544), FRAC_CONST(-0.831469774246216) },
1798 { FRAC_CONST(-0.290284544229507), FRAC_CONST(-0.956940352916718) },
1799 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1800 { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
1801 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1802 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1803 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1804 { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
1805 { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
1806 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1807 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1808 { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
1809 { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
1810 { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
1811 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1812 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1813 { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
1814 { FRAC_CONST(0.000000011924881), FRAC_CONST(-1.000000000000000) }
1815 };
1816
1817 #endif
1818
1819 #ifdef __cplusplus
1820 }
1821 #endif
1822 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: hcb.h,v 1.8 2007/11/01 12:34:10 menno Exp $
28 **/
29
30 #ifndef __HCB_H__
31 #define __HCB_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 /*
38 * Optimal huffman decoding for AAC taken from:
39 * "SELECTING AN OPTIMAL HUFFMAN DECODER FOR AAC" by
40 * VLADIMIR Z. MESAROVIC , RAGHUNATH RAO, MIROSLAV V. DOKIC, and SACHIN DEO
41 * AES paper 5436
42 *
43 * 2 methods are used for huffman decoding:
44 * - binary search
45 * - 2-step table lookup
46 *
47 * The choice of the "optimal" method is based on the fact that if the
48 * memory size for the Two-step is exorbitantly high then the decision
49 * is Binary search for that codebook. However, for marginally more memory
50 * size, if Twostep outperforms even the best case of Binary then the
51 * decision is Two-step for that codebook.
52 *
53 * The following methods are used for the different tables.
54 * codebook "optimal" method
55 * HCB_1 2-Step
56 * HCB_2 2-Step
57 * HCB_3 Binary
58 * HCB_4 2-Step
59 * HCB_5 Binary
60 * HCB_6 2-Step
61 * HCB_7 Binary
62 * HCB_8 2-Step
63 * HCB_9 Binary
64 * HCB_10 2-Step
65 * HCB_11 2-Step
66 * HCB_SF Binary
67 *
68 */
69
70
71 #define ZERO_HCB 0
72 #define FIRST_PAIR_HCB 5
73 #define ESC_HCB 11
74 #define QUAD_LEN 4
75 #define PAIR_LEN 2
76 #define NOISE_HCB 13
77 #define INTENSITY_HCB2 14
78 #define INTENSITY_HCB 15
79
80 /* 1st step table */
81 typedef struct
82 {
83 uint8_t offset;
84 uint8_t extra_bits;
85 } hcb;
86
87 /* 2nd step table with quadruple data */
88 typedef struct
89 {
90 uint8_t bits;
91 int8_t x;
92 int8_t y;
93 } hcb_2_pair;
94
95 typedef struct
96 {
97 uint8_t bits;
98 int8_t x;
99 int8_t y;
100 int8_t v;
101 int8_t w;
102 } hcb_2_quad;
103
104 /* binary search table */
105 typedef struct
106 {
107 uint8_t is_leaf;
108 int8_t data[4];
109 } hcb_bin_quad;
110
111 typedef struct
112 {
113 uint8_t is_leaf;
114 int8_t data[2];
115 } hcb_bin_pair;
116
117 hcb *hcb_table[];
118 hcb_2_quad *hcb_2_quad_table[];
119 hcb_2_pair *hcb_2_pair_table[];
120 hcb_bin_pair *hcb_bin_table[];
121 uint8_t hcbN[];
122 uint8_t unsigned_cb[];
123 int hcb_2_quad_table_size[];
124 int hcb_2_pair_table_size[];
125 int hcb_bin_table_size[];
126
127 #include "codebook/hcb_1.h"
128 #include "codebook/hcb_2.h"
129 #include "codebook/hcb_3.h"
130 #include "codebook/hcb_4.h"
131 #include "codebook/hcb_5.h"
132 #include "codebook/hcb_6.h"
133 #include "codebook/hcb_7.h"
134 #include "codebook/hcb_8.h"
135 #include "codebook/hcb_9.h"
136 #include "codebook/hcb_10.h"
137 #include "codebook/hcb_11.h"
138 #include "codebook/hcb_sf.h"
139
140
141 #ifdef __cplusplus
142 }
143 #endif
144 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: hcb_1.h,v 1.5 2007/11/01 12:34:11 menno Exp $
28 **/
29
30 /* 2-step huffman table HCB_1 */
31
32
33 /* 1st step: 5 bits
34 * 2^5 = 32 entries
35 *
36 * Used to find offset into 2nd step table and number of extra bits to get
37 */
38 static hcb hcb1_1[] = {
39 { /* 00000 */ 0, 0 },
40 { /* */ 0, 0 },
41 { /* */ 0, 0 },
42 { /* */ 0, 0 },
43 { /* */ 0, 0 },
44 { /* */ 0, 0 },
45 { /* */ 0, 0 },
46 { /* */ 0, 0 },
47 { /* */ 0, 0 },
48 { /* */ 0, 0 },
49 { /* */ 0, 0 },
50 { /* */ 0, 0 },
51 { /* */ 0, 0 },
52 { /* */ 0, 0 },
53 { /* */ 0, 0 },
54 { /* */ 0, 0 },
55 { /* 10000 */ 1, 0 },
56 { /* 10001 */ 2, 0 },
57 { /* 10010 */ 3, 0 },
58 { /* 10011 */ 4, 0 },
59 { /* 10100 */ 5, 0 },
60 { /* 10101 */ 6, 0 },
61 { /* 10110 */ 7, 0 },
62 { /* 10111 */ 8, 0 },
63
64 /* 7 bit codewords */
65 { /* 11000 */ 9, 2 },
66 { /* 11001 */ 13, 2 },
67 { /* 11010 */ 17, 2 },
68 { /* 11011 */ 21, 2 },
69 { /* 11100 */ 25, 2 },
70 { /* 11101 */ 29, 2 },
71
72 /* 9 bit codewords */
73 { /* 11110 */ 33, 4 },
74
75 /* 9/10/11 bit codewords */
76 { /* 11111 */ 49, 6 }
77 };
78
79 /* 2nd step table
80 *
81 * Gives size of codeword and actual data (x,y,v,w)
82 */
83 static hcb_2_quad hcb1_2[] = {
84 /* 1 bit codeword */
85 { 1, 0, 0, 0, 0 },
86
87 /* 5 bit codewords */
88 { 5, 1, 0, 0, 0 },
89 { 5, -1, 0, 0, 0 },
90 { 5, 0, 0, 0, -1 },
91 { 5, 0, 1, 0, 0 },
92 { 5, 0, 0, 0, 1 },
93 { 5, 0, 0, -1, 0 },
94 { 5, 0, 0, 1, 0 },
95 { 5, 0, -1, 0, 0 },
96
97 /* 7 bit codewords */
98 /* first 5 bits: 11000 */
99 { 7, 1, -1, 0, 0 },
100 { 7, -1, 1, 0, 0 },
101 { 7, 0, 0, -1, 1 },
102 { 7, 0, 1, -1, 0 },
103 /* first 5 bits: 11001 */
104 { 7, 0, -1, 1, 0 },
105 { 7, 0, 0, 1, -1 },
106 { 7, 1, 1, 0, 0 },
107 { 7, 0, 0, -1, -1 },
108 /* first 5 bits: 11010 */
109 { 7, -1, -1, 0, 0 },
110 { 7, 0, -1, -1, 0 },
111 { 7, 1, 0, -1, 0 },
112 { 7, 0, 1, 0, -1 },
113 /* first 5 bits: 11011 */
114 { 7, -1, 0, 1, 0 },
115 { 7, 0, 0, 1, 1 },
116 { 7, 1, 0, 1, 0 },
117 { 7, 0, -1, 0, 1 },
118 /* first 5 bits: 11100 */
119 { 7, 0, 1, 1, 0 },
120 { 7, 0, 1, 0, 1 },
121 { 7, -1, 0, -1, 0 },
122 { 7, 1, 0, 0, 1 },
123 /* first 5 bits: 11101 */
124 { 7, -1, 0, 0, -1 },
125 { 7, 1, 0, 0, -1 },
126 { 7, -1, 0, 0, 1 },
127 { 7, 0, -1, 0, -1 },
128
129 /* 9 bit codeword */
130 /* first 5 bits: 11110 */
131 { 9, 1, 1, -1, 0 },
132 { 9, -1, 1, -1, 0 },
133 { 9, 1, -1, 1, 0 },
134 { 9, 0, 1, 1, -1 },
135 { 9, 0, 1, -1, 1 },
136 { 9, 0, -1, 1, 1 },
137 { 9, 0, -1, 1, -1 },
138 { 9, 1, -1, -1, 0 },
139 { 9, 1, 0, -1, 1 },
140 { 9, 0, 1, -1, -1 },
141 { 9, -1, 1, 1, 0 },
142 { 9, -1, 0, 1, -1 },
143 { 9, -1, -1, 1, 0 },
144 { 9, 0, -1, -1, 1 },
145 { 9, 1, -1, 0, 1 },
146 { 9, 1, -1, 0, -1 },
147
148 /* 9/10/11 bit codewords */
149 /* first 5 bits: 11111 */
150 /* 9 bit: reading 11 bits -> 2 too much so 4 entries for each codeword */
151 { 9, -1, 1, 0, -1 }, { 9, -1, 1, 0, -1 }, { 9, -1, 1, 0, -1 }, { 9, -1, 1, 0, -1 },
152 { 9, -1, -1, -1, 0 }, { 9, -1, -1, -1, 0 }, { 9, -1, -1, -1, 0 }, { 9, -1, -1, -1, 0 },
153 { 9, 0, -1, -1, -1 }, { 9, 0, -1, -1, -1 }, { 9, 0, -1, -1, -1 }, { 9, 0, -1, -1, -1 },
154 { 9, 0, 1, 1, 1 }, { 9, 0, 1, 1, 1 }, { 9, 0, 1, 1, 1 }, { 9, 0, 1, 1, 1 },
155 { 9, 1, 0, 1, -1 }, { 9, 1, 0, 1, -1 }, { 9, 1, 0, 1, -1 }, { 9, 1, 0, 1, -1 },
156 { 9, 1, 1, 0, 1 }, { 9, 1, 1, 0, 1 }, { 9, 1, 1, 0, 1 }, { 9, 1, 1, 0, 1 },
157 { 9, -1, 1, 0, 1 }, { 9, -1, 1, 0, 1 }, { 9, -1, 1, 0, 1 }, { 9, -1, 1, 0, 1 },
158 { 9, 1, 1, 1, 0 }, { 9, 1, 1, 1, 0 }, { 9, 1, 1, 1, 0 }, { 9, 1, 1, 1, 0 },
159 /* 10 bit: reading 11 bits -> 1 too much so 2 entries for each codeword */
160 { 10, -1, -1, 0, 1 }, { 10, -1, -1, 0, 1 },
161 { 10, -1, 0, -1, -1 }, { 10, -1, 0, -1, -1 },
162 { 10, 1, 1, 0, -1 }, { 10, 1, 1, 0, -1 },
163 { 10, 1, 0, -1, -1 }, { 10, 1, 0, -1, -1 },
164 { 10, -1, 0, -1, 1 }, { 10, -1, 0, -1, 1 },
165 { 10, -1, -1, 0, -1 }, { 10, -1, -1, 0, -1 },
166 { 10, -1, 0, 1, 1 }, { 10, -1, 0, 1, 1 },
167 { 10, 1, 0, 1, 1 }, { 10, 1, 0, 1, 1 },
168 /* 11 bit */
169 { 11, 1, -1, 1, -1 },
170 { 11, -1, 1, -1, 1 },
171 { 11, -1, 1, 1, -1 },
172 { 11, 1, -1, -1, 1 },
173 { 11, 1, 1, 1, 1 },
174 { 11, -1, -1, 1, 1 },
175 { 11, 1, 1, -1, -1 },
176 { 11, -1, -1, 1, -1 },
177 { 11, -1, -1, -1, -1 },
178 { 11, 1, 1, -1, 1 },
179 { 11, 1, -1, 1, 1 },
180 { 11, -1, 1, 1, 1 },
181 { 11, -1, 1, -1, -1 },
182 { 11, -1, -1, -1, 1 },
183 { 11, 1, -1, -1, -1 },
184 { 11, 1, 1, 1, -1 }
185 };
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: hcb_10.h,v 1.5 2007/11/01 12:34:11 menno Exp $
28 **/
29
30 /* 2-step huffman table HCB_10 */
31
32
33 /* 1st step: 6 bits
34 * 2^6 = 64 entries
35 *
36 * Used to find offset into 2nd step table and number of extra bits to get
37 */
38 static hcb hcb10_1[] = {
39 /* 4 bit codewords */
40 { /* 000000 */ 0, 0 },
41 { /* */ 0, 0 },
42 { /* */ 0, 0 },
43 { /* */ 0, 0 },
44 { /* 000100 */ 1, 0 },
45 { /* */ 1, 0 },
46 { /* */ 1, 0 },
47 { /* */ 1, 0 },
48 { /* 001000 */ 2, 0 },
49 { /* */ 2, 0 },
50 { /* */ 2, 0 },
51 { /* */ 2, 0 },
52 /* 5 bit codewords */
53 { /* 001100 */ 3, 0 },
54 { /* */ 3, 0 },
55 { /* 001110 */ 4, 0 },
56 { /* */ 4, 0 },
57 { /* 010000 */ 5, 0 },
58 { /* */ 5, 0 },
59 { /* 010010 */ 6, 0 },
60 { /* */ 6, 0 },
61 { /* 010100 */ 7, 0 },
62 { /* */ 7, 0 },
63 { /* 010110 */ 8, 0 },
64 { /* */ 8, 0 },
65 { /* 011000 */ 9, 0 },
66 { /* */ 9, 0 },
67 { /* 011010 */ 10, 0 },
68 { /* */ 10, 0 },
69 /* 6 bit codewords */
70 { /* 011100 */ 11, 0 },
71 { /* 011101 */ 12, 0 },
72 { /* 011110 */ 13, 0 },
73 { /* 011111 */ 14, 0 },
74 { /* 100000 */ 15, 0 },
75 { /* 100001 */ 16, 0 },
76 { /* 100010 */ 17, 0 },
77 { /* 100011 */ 18, 0 },
78 { /* 100100 */ 19, 0 },
79 { /* 100101 */ 20, 0 },
80 { /* 100110 */ 21, 0 },
81 { /* 100111 */ 22, 0 },
82 { /* 101000 */ 23, 0 },
83 { /* 101001 */ 24, 0 },
84 /* 7 bit codewords */
85 { /* 101010 */ 25, 1 },
86 { /* 101011 */ 27, 1 },
87 { /* 101100 */ 29, 1 },
88 { /* 101101 */ 31, 1 },
89 { /* 101110 */ 33, 1 },
90 { /* 101111 */ 35, 1 },
91 { /* 110000 */ 37, 1 },
92 { /* 110001 */ 39, 1 },
93 /* 7/8 bit codewords */
94 { /* 110010 */ 41, 2 },
95 /* 8 bit codewords */
96 { /* 110011 */ 45, 2 },
97 { /* 110100 */ 49, 2 },
98 { /* 110101 */ 53, 2 },
99 { /* 110110 */ 57, 2 },
100 { /* 110111 */ 61, 2 },
101 /* 8/9 bit codewords */
102 { /* 111000 */ 65, 3 },
103 /* 9 bit codewords */
104 { /* 111001 */ 73, 3 },
105 { /* 111010 */ 81, 3 },
106 { /* 111011 */ 89, 3 },
107 /* 9/10 bit codewords */
108 { /* 111100 */ 97, 4 },
109 /* 10 bit codewords */
110 { /* 111101 */ 113, 4 },
111 { /* 111110 */ 129, 4 },
112 /* 10/11/12 bit codewords */
113 { /* 111111 */ 145, 6 }
114 };
115
116 /* 2nd step table
117 *
118 * Gives size of codeword and actual data (x,y,v,w)
119 */
120 static hcb_2_pair hcb10_2[] = {
121 /* 4 bit codewords */
122 { 4, 1, 1 },
123 { 4, 1, 2 },
124 { 4, 2, 1 },
125
126 /* 5 bit codewords */
127 { 5, 2, 2 },
128 { 5, 1, 0 },
129 { 5, 0, 1 },
130 { 5, 1, 3 },
131 { 5, 3, 2 },
132 { 5, 3, 1 },
133 { 5, 2, 3 },
134 { 5, 3, 3 },
135
136 /* 6 bit codewords */
137 { 6, 2, 0 },
138 { 6, 0, 2 },
139 { 6, 2, 4 },
140 { 6, 4, 2 },
141 { 6, 1, 4 },
142 { 6, 4, 1 },
143 { 6, 0, 0 },
144 { 6, 4, 3 },
145 { 6, 3, 4 },
146 { 6, 3, 0 },
147 { 6, 0, 3 },
148 { 6, 4, 4 },
149 { 6, 2, 5 },
150 { 6, 5, 2 },
151
152 /* 7 bit codewords */
153 { 7, 1, 5 },
154 { 7, 5, 1 },
155 { 7, 5, 3 },
156 { 7, 3, 5 },
157 { 7, 5, 4 },
158 { 7, 4, 5 },
159 { 7, 6, 2 },
160 { 7, 2, 6 },
161 { 7, 6, 3 },
162 { 7, 4, 0 },
163 { 7, 6, 1 },
164 { 7, 0, 4 },
165 { 7, 1, 6 },
166 { 7, 3, 6 },
167 { 7, 5, 5 },
168 { 7, 6, 4 },
169
170 /* 7/8 bit codewords */
171 { 7, 4, 6 }, { 7, 4, 6 },
172 { 8, 6, 5 },
173 { 8, 7, 2 },
174
175 /* 8 bit codewords */
176 { 8, 3, 7 },
177 { 8, 2, 7 },
178 { 8, 5, 6 },
179 { 8, 8, 2 },
180 { 8, 7, 3 },
181 { 8, 5, 0 },
182 { 8, 7, 1 },
183 { 8, 0, 5 },
184 { 8, 8, 1 },
185 { 8, 1, 7 },
186 { 8, 8, 3 },
187 { 8, 7, 4 },
188 { 8, 4, 7 },
189 { 8, 2, 8 },
190 { 8, 6, 6 },
191 { 8, 7, 5 },
192 { 8, 1, 8 },
193 { 8, 3, 8 },
194 { 8, 8, 4 },
195 { 8, 4, 8 },
196
197 /* 8/9 bit codewords */
198 { 8, 5, 7 }, { 8, 5, 7 },
199 { 8, 8, 5 }, { 8, 8, 5 },
200 { 8, 5, 8 }, { 8, 5, 8 },
201 { 9, 7, 6 },
202 { 9, 6, 7 },
203
204 /* 9 bit codewords */
205 { 9, 9, 2 },
206 { 9, 6, 0 },
207 { 9, 6, 8 },
208 { 9, 9, 3 },
209 { 9, 3, 9 },
210 { 9, 9, 1 },
211 { 9, 2, 9 },
212 { 9, 0, 6 },
213 { 9, 8, 6 },
214 { 9, 9, 4 },
215 { 9, 4, 9 },
216 { 9, 10, 2 },
217 { 9, 1, 9 },
218 { 9, 7, 7 },
219 { 9, 8, 7 },
220 { 9, 9, 5 },
221 { 9, 7, 8 },
222 { 9, 10, 3 },
223 { 9, 5, 9 },
224 { 9, 10, 4 },
225 { 9, 2, 10 },
226 { 9, 10, 1 },
227 { 9, 3, 10 },
228 { 9, 9, 6 },
229
230 /* 9/10 bit codewords */
231 { 9, 6, 9 }, { 9, 6, 9 },
232 { 9, 8, 0 }, { 9, 8, 0 },
233 { 9, 4, 10 }, { 9, 4, 10 },
234 { 9, 7, 0 }, { 9, 7, 0 },
235 { 9, 11, 2 }, { 9, 11, 2 },
236 { 10, 7, 9 },
237 { 10, 11, 3 },
238 { 10, 10, 6 },
239 { 10, 1, 10 },
240 { 10, 11, 1 },
241 { 10, 9, 7 },
242
243 /* 10 bit codewords */
244 { 10, 0, 7 },
245 { 10, 8, 8 },
246 { 10, 10, 5 },
247 { 10, 3, 11 },
248 { 10, 5, 10 },
249 { 10, 8, 9 },
250 { 10, 11, 5 },
251 { 10, 0, 8 },
252 { 10, 11, 4 },
253 { 10, 2, 11 },
254 { 10, 7, 10 },
255 { 10, 6, 10 },
256 { 10, 10, 7 },
257 { 10, 4, 11 },
258 { 10, 1, 11 },
259 { 10, 12, 2 },
260 { 10, 9, 8 },
261 { 10, 12, 3 },
262 { 10, 11, 6 },
263 { 10, 5, 11 },
264 { 10, 12, 4 },
265 { 10, 11, 7 },
266 { 10, 12, 5 },
267 { 10, 3, 12 },
268 { 10, 6, 11 },
269 { 10, 9, 0 },
270 { 10, 10, 8 },
271 { 10, 10, 0 },
272 { 10, 12, 1 },
273 { 10, 0, 9 },
274 { 10, 4, 12 },
275 { 10, 9, 9 },
276
277 /* 10/11/12 bit codewords */
278 { 10, 12, 6 }, { 10, 12, 6 }, { 10, 12, 6 }, { 10, 12, 6 },
279 { 10, 2, 12 }, { 10, 2, 12 }, { 10, 2, 12 }, { 10, 2, 12 },
280 { 10, 8, 10 }, { 10, 8, 10 }, { 10, 8, 10 }, { 10, 8, 10 },
281 { 11, 9, 10 }, { 11, 9, 10 },
282 { 11, 1, 12 }, { 11, 1, 12 },
283 { 11, 11, 8 }, { 11, 11, 8 },
284 { 11, 12, 7 }, { 11, 12, 7 },
285 { 11, 7, 11 }, { 11, 7, 11 },
286 { 11, 5, 12 }, { 11, 5, 12 },
287 { 11, 6, 12 }, { 11, 6, 12 },
288 { 11, 10, 9 }, { 11, 10, 9 },
289 { 11, 8, 11 }, { 11, 8, 11 },
290 { 11, 12, 8 }, { 11, 12, 8 },
291 { 11, 0, 10 }, { 11, 0, 10 },
292 { 11, 7, 12 }, { 11, 7, 12 },
293 { 11, 11, 0 }, { 11, 11, 0 },
294 { 11, 10, 10 }, { 11, 10, 10 },
295 { 11, 11, 9 }, { 11, 11, 9 },
296 { 11, 11, 10 }, { 11, 11, 10 },
297 { 11, 0, 11 }, { 11, 0, 11 },
298 { 11, 11, 11 }, { 11, 11, 11 },
299 { 11, 9, 11 }, { 11, 9, 11 },
300 { 11, 10, 11 }, { 11, 10, 11 },
301 { 11, 12, 0 }, { 11, 12, 0 },
302 { 11, 8, 12 }, { 11, 8, 12 },
303 { 12, 12, 9 },
304 { 12, 10, 12 },
305 { 12, 9, 12 },
306 { 12, 11, 12 },
307 { 12, 12, 11 },
308 { 12, 0, 12 },
309 { 12, 12, 10 },
310 { 12, 12, 12 }
311 };
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: hcb_11.h,v 1.5 2007/11/01 12:34:11 menno Exp $
28 **/
29
30 /* 2-step huffman table HCB_11 */
31
32
33 /* 1st step: 5 bits
34 * 2^5 = 32 entries
35 *
36 * Used to find offset into 2nd step table and number of extra bits to get
37 */
38 static hcb hcb11_1[] = {
39 /* 4 bits */
40 { /* 00000 */ 0, 0 },
41 { /* */ 0, 0 },
42 { /* 00010 */ 1, 0 },
43 { /* */ 1, 0 },
44
45 /* 5 bits */
46 { /* 00100 */ 2, 0 },
47 { /* 00101 */ 3, 0 },
48 { /* 00110 */ 4, 0 },
49 { /* 00111 */ 5, 0 },
50 { /* 01000 */ 6, 0 },
51 { /* 01001 */ 7, 0 },
52
53 /* 6 bits */
54 { /* 01010 */ 8, 1 },
55 { /* 01011 */ 10, 1 },
56 { /* 01100 */ 12, 1 },
57
58 /* 6/7 bits */
59 { /* 01101 */ 14, 2 },
60
61 /* 7 bits */
62 { /* 01110 */ 18, 2 },
63 { /* 01111 */ 22, 2 },
64 { /* 10000 */ 26, 2 },
65
66 /* 7/8 bits */
67 { /* 10001 */ 30, 3 },
68
69 /* 8 bits */
70 { /* 10010 */ 38, 3 },
71 { /* 10011 */ 46, 3 },
72 { /* 10100 */ 54, 3 },
73 { /* 10101 */ 62, 3 },
74 { /* 10110 */ 70, 3 },
75 { /* 10111 */ 78, 3 },
76
77 /* 8/9 bits */
78 { /* 11000 */ 86, 4 },
79
80 /* 9 bits */
81 { /* 11001 */ 102, 4 },
82 { /* 11010 */ 118, 4 },
83 { /* 11011 */ 134, 4 },
84
85 /* 9/10 bits */
86 { /* 11100 */ 150, 5 },
87
88 /* 10 bits */
89 { /* 11101 */ 182, 5 },
90 { /* 11110 */ 214, 5 },
91
92 /* 10/11/12 bits */
93 { /* 11111 */ 246, 7 }
94 };
95
96 /* 2nd step table
97 *
98 * Gives size of codeword and actual data (x,y,v,w)
99 */
100 static hcb_2_pair hcb11_2[] = {
101 /* 4 */
102 { 4, 0, 0 },
103 { 4, 1, 1 },
104
105 /* 5 */
106 { 5, 16, 16 },
107 { 5, 1, 0 },
108 { 5, 0, 1 },
109 { 5, 2, 1 },
110 { 5, 1, 2 },
111 { 5, 2, 2 },
112
113 /* 6 */
114 { 6, 1, 3 },
115 { 6, 3, 1 },
116 { 6, 3, 2 },
117 { 6, 2, 0 },
118 { 6, 2, 3 },
119 { 6, 0, 2 },
120
121 /* 6/7 */
122 { 6, 3, 3 }, { 6, 3, 3 },
123 { 7, 4, 1 },
124 { 7, 1, 4 },
125
126 /* 7 */
127 { 7, 4, 2 },
128 { 7, 2, 4 },
129 { 7, 4, 3 },
130 { 7, 3, 4 },
131 { 7, 3, 0 },
132 { 7, 0, 3 },
133 { 7, 5, 1 },
134 { 7, 5, 2 },
135 { 7, 2, 5 },
136 { 7, 4, 4 },
137 { 7, 1, 5 },
138 { 7, 5, 3 },
139
140 /* 7/8 */
141 { 7, 3, 5 }, { 7, 3, 5 },
142 { 7, 5, 4 }, { 7, 5, 4 },
143 { 8, 4, 5 },
144 { 8, 6, 2 },
145 { 8, 2, 6 },
146 { 8, 6, 1 },
147
148 /* 8 */
149 { 8, 6, 3 },
150 { 8, 3, 6 },
151 { 8, 1, 6 },
152 { 8, 4, 16 },
153 { 8, 3, 16 },
154 { 8, 16, 5 },
155 { 8, 16, 3 },
156 { 8, 16, 4 },
157 { 8, 6, 4 },
158 { 8, 16, 6 },
159 { 8, 4, 0 },
160 { 8, 4, 6 },
161 { 8, 0, 4 },
162 { 8, 2, 16 },
163 { 8, 5, 5 },
164 { 8, 5, 16 },
165 { 8, 16, 7 },
166 { 8, 16, 2 },
167 { 8, 16, 8 },
168 { 8, 2, 7 },
169 { 8, 7, 2 },
170 { 8, 3, 7 },
171 { 8, 6, 5 },
172 { 8, 5, 6 },
173 { 8, 6, 16 },
174 { 8, 16, 10 },
175 { 8, 7, 3 },
176 { 8, 7, 1 },
177 { 8, 16, 9 },
178 { 8, 7, 16 },
179 { 8, 1, 16 },
180 { 8, 1, 7 },
181 { 8, 4, 7 },
182 { 8, 16, 11 },
183 { 8, 7, 4 },
184 { 8, 16, 12 },
185 { 8, 8, 16 },
186 { 8, 16, 1 },
187 { 8, 6, 6 },
188 { 8, 9, 16 },
189 { 8, 2, 8 },
190 { 8, 5, 7 },
191 { 8, 10, 16 },
192 { 8, 16, 13 },
193 { 8, 8, 3 },
194 { 8, 8, 2 },
195 { 8, 3, 8 },
196 { 8, 5, 0 },
197
198 /* 8/9 */
199 { 8, 16, 14 }, { 8, 16, 14 },
200 { 8, 11, 16 }, { 8, 11, 16 },
201 { 8, 7, 5 }, { 8, 7, 5 },
202 { 8, 4, 8 }, { 8, 4, 8 },
203 { 8, 6, 7 }, { 8, 6, 7 },
204 { 8, 7, 6 }, { 8, 7, 6 },
205 { 8, 0, 5 }, { 8, 0, 5 },
206 { 9, 8, 4 },
207 { 9, 16, 15 },
208
209 /* 9 */
210 { 9, 12, 16 },
211 { 9, 1, 8 },
212 { 9, 8, 1 },
213 { 9, 14, 16 },
214 { 9, 5, 8 },
215 { 9, 13, 16 },
216 { 9, 3, 9 },
217 { 9, 8, 5 },
218 { 9, 7, 7 },
219 { 9, 2, 9 },
220 { 9, 8, 6 },
221 { 9, 9, 2 },
222 { 9, 9, 3 },
223 { 9, 15, 16 },
224 { 9, 4, 9 },
225 { 9, 6, 8 },
226 { 9, 6, 0 },
227 { 9, 9, 4 },
228 { 9, 5, 9 },
229 { 9, 8, 7 },
230 { 9, 7, 8 },
231 { 9, 1, 9 },
232 { 9, 10, 3 },
233 { 9, 0, 6 },
234 { 9, 10, 2 },
235 { 9, 9, 1 },
236 { 9, 9, 5 },
237 { 9, 4, 10 },
238 { 9, 2, 10 },
239 { 9, 9, 6 },
240 { 9, 3, 10 },
241 { 9, 6, 9 },
242 { 9, 10, 4 },
243 { 9, 8, 8 },
244 { 9, 10, 5 },
245 { 9, 9, 7 },
246 { 9, 11, 3 },
247 { 9, 1, 10 },
248 { 9, 7, 0 },
249 { 9, 10, 6 },
250 { 9, 7, 9 },
251 { 9, 3, 11 },
252 { 9, 5, 10 },
253 { 9, 10, 1 },
254 { 9, 4, 11 },
255 { 9, 11, 2 },
256 { 9, 13, 2 },
257 { 9, 6, 10 },
258
259 /* 9/10 */
260 { 9, 13, 3 }, { 9, 13, 3 },
261 { 9, 2, 11 }, { 9, 2, 11 },
262 { 9, 16, 0 }, { 9, 16, 0 },
263 { 9, 5, 11 }, { 9, 5, 11 },
264 { 9, 11, 5 }, { 9, 11, 5 },
265 { 10, 11, 4 },
266 { 10, 9, 8 },
267 { 10, 7, 10 },
268 { 10, 8, 9 },
269 { 10, 0, 16 },
270 { 10, 4, 13 },
271 { 10, 0, 7 },
272 { 10, 3, 13 },
273 { 10, 11, 6 },
274 { 10, 13, 1 },
275 { 10, 13, 4 },
276 { 10, 12, 3 },
277 { 10, 2, 13 },
278 { 10, 13, 5 },
279 { 10, 8, 10 },
280 { 10, 6, 11 },
281 { 10, 10, 8 },
282 { 10, 10, 7 },
283 { 10, 14, 2 },
284 { 10, 12, 4 },
285 { 10, 1, 11 },
286 { 10, 4, 12 },
287
288 /* 10 */
289 { 10, 11, 1 },
290 { 10, 3, 12 },
291 { 10, 1, 13 },
292 { 10, 12, 2 },
293 { 10, 7, 11 },
294 { 10, 3, 14 },
295 { 10, 5, 12 },
296 { 10, 5, 13 },
297 { 10, 14, 4 },
298 { 10, 4, 14 },
299 { 10, 11, 7 },
300 { 10, 14, 3 },
301 { 10, 12, 5 },
302 { 10, 13, 6 },
303 { 10, 12, 6 },
304 { 10, 8, 0 },
305 { 10, 11, 8 },
306 { 10, 2, 12 },
307 { 10, 9, 9 },
308 { 10, 14, 5 },
309 { 10, 6, 13 },
310 { 10, 10, 10 },
311 { 10, 15, 2 },
312 { 10, 8, 11 },
313 { 10, 9, 10 },
314 { 10, 14, 6 },
315 { 10, 10, 9 },
316 { 10, 5, 14 },
317 { 10, 11, 9 },
318 { 10, 14, 1 },
319 { 10, 2, 14 },
320 { 10, 6, 12 },
321 { 10, 1, 12 },
322 { 10, 13, 8 },
323 { 10, 0, 8 },
324 { 10, 13, 7 },
325 { 10, 7, 12 },
326 { 10, 12, 7 },
327 { 10, 7, 13 },
328 { 10, 15, 3 },
329 { 10, 12, 1 },
330 { 10, 6, 14 },
331 { 10, 2, 15 },
332 { 10, 15, 5 },
333 { 10, 15, 4 },
334 { 10, 1, 14 },
335 { 10, 9, 11 },
336 { 10, 4, 15 },
337 { 10, 14, 7 },
338 { 10, 8, 13 },
339 { 10, 13, 9 },
340 { 10, 8, 12 },
341 { 10, 5, 15 },
342 { 10, 3, 15 },
343 { 10, 10, 11 },
344 { 10, 11, 10 },
345 { 10, 12, 8 },
346 { 10, 15, 6 },
347 { 10, 15, 7 },
348 { 10, 8, 14 },
349 { 10, 15, 1 },
350 { 10, 7, 14 },
351 { 10, 9, 0 },
352 { 10, 0, 9 },
353
354 /* 10/11/12 */
355 { 10, 9, 13 }, { 10, 9, 13 }, { 10, 9, 13 }, { 10, 9, 13 },
356 { 10, 9, 12 }, { 10, 9, 12 }, { 10, 9, 12 }, { 10, 9, 12 },
357 { 10, 12, 9 }, { 10, 12, 9 }, { 10, 12, 9 }, { 10, 12, 9 },
358 { 10, 14, 8 }, { 10, 14, 8 }, { 10, 14, 8 }, { 10, 14, 8 },
359 { 10, 10, 13 }, { 10, 10, 13 }, { 10, 10, 13 }, { 10, 10, 13 },
360 { 10, 14, 9 }, { 10, 14, 9 }, { 10, 14, 9 }, { 10, 14, 9 },
361 { 10, 12, 10 }, { 10, 12, 10 }, { 10, 12, 10 }, { 10, 12, 10 },
362 { 10, 6, 15 }, { 10, 6, 15 }, { 10, 6, 15 }, { 10, 6, 15 },
363 { 10, 7, 15 }, { 10, 7, 15 }, { 10, 7, 15 }, { 10, 7, 15 },
364
365 { 11, 9, 14 }, { 11, 9, 14 },
366 { 11, 15, 8 }, { 11, 15, 8 },
367 { 11, 11, 11 }, { 11, 11, 11 },
368 { 11, 11, 14 }, { 11, 11, 14 },
369 { 11, 1, 15 }, { 11, 1, 15 },
370 { 11, 10, 12 }, { 11, 10, 12 },
371 { 11, 10, 14 }, { 11, 10, 14 },
372 { 11, 13, 11 }, { 11, 13, 11 },
373 { 11, 13, 10 }, { 11, 13, 10 },
374 { 11, 11, 13 }, { 11, 11, 13 },
375 { 11, 11, 12 }, { 11, 11, 12 },
376 { 11, 8, 15 }, { 11, 8, 15 },
377 { 11, 14, 11 }, { 11, 14, 11 },
378 { 11, 13, 12 }, { 11, 13, 12 },
379 { 11, 12, 13 }, { 11, 12, 13 },
380 { 11, 15, 9 }, { 11, 15, 9 },
381 { 11, 14, 10 }, { 11, 14, 10 },
382 { 11, 10, 0 }, { 11, 10, 0 },
383 { 11, 12, 11 }, { 11, 12, 11 },
384 { 11, 9, 15 }, { 11, 9, 15 },
385 { 11, 0, 10 }, { 11, 0, 10 },
386 { 11, 12, 12 }, { 11, 12, 12 },
387 { 11, 11, 0 }, { 11, 11, 0 },
388 { 11, 12, 14 }, { 11, 12, 14 },
389 { 11, 10, 15 }, { 11, 10, 15 },
390 { 11, 13, 13 }, { 11, 13, 13 },
391 { 11, 0, 13 }, { 11, 0, 13 },
392 { 11, 14, 12 }, { 11, 14, 12 },
393 { 11, 15, 10 }, { 11, 15, 10 },
394 { 11, 15, 11 }, { 11, 15, 11 },
395 { 11, 11, 15 }, { 11, 11, 15 },
396 { 11, 14, 13 }, { 11, 14, 13 },
397 { 11, 13, 0 }, { 11, 13, 0 },
398 { 11, 0, 11 }, { 11, 0, 11 },
399 { 11, 13, 14 }, { 11, 13, 14 },
400 { 11, 15, 12 }, { 11, 15, 12 },
401 { 11, 15, 13 }, { 11, 15, 13 },
402 { 11, 12, 15 }, { 11, 12, 15 },
403 { 11, 14, 0 }, { 11, 14, 0 },
404 { 11, 14, 14 }, { 11, 14, 14 },
405 { 11, 13, 15 }, { 11, 13, 15 },
406 { 11, 12, 0 }, { 11, 12, 0 },
407 { 11, 14, 15 }, { 11, 14, 15 },
408 { 12, 0, 14 },
409 { 12, 0, 12 },
410 { 12, 15, 14 },
411 { 12, 15, 0 },
412 { 12, 0, 15 },
413 { 12, 15, 15 }
414 };
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: hcb_2.h,v 1.5 2007/11/01 12:34:11 menno Exp $
28 **/
29
30 /* 2-step huffman table HCB_2 */
31
32
33 /* 1st step: 5 bits
34 * 2^5 = 32 entries
35 *
36 * Used to find offset into 2nd step table and number of extra bits to get
37 */
38 static hcb hcb2_1[] = {
39 { /* 00000 */ 0, 0 },
40 { /* */ 0, 0 },
41 { /* */ 0, 0 },
42 { /* */ 0, 0 },
43 { /* 00100 */ 1, 0 },
44 { /* */ 1, 0 },
45 { /* 00110 */ 2, 0 },
46 { /* 00111 */ 3, 0 },
47 { /* 01000 */ 4, 0 },
48 { /* 01001 */ 5, 0 },
49 { /* 01010 */ 6, 0 },
50 { /* 01011 */ 7, 0 },
51 { /* 01100 */ 8, 0 },
52
53 /* 6 bit codewords */
54 { /* 01101 */ 9, 1 },
55 { /* 01110 */ 11, 1 },
56 { /* 01111 */ 13, 1 },
57 { /* 10000 */ 15, 1 },
58 { /* 10001 */ 17, 1 },
59 { /* 10010 */ 19, 1 },
60 { /* 10011 */ 21, 1 },
61 { /* 10100 */ 23, 1 },
62 { /* 10101 */ 25, 1 },
63 { /* 10110 */ 27, 1 },
64 { /* 10111 */ 29, 1 },
65 { /* 11000 */ 31, 1 },
66
67 /* 7 bit codewords */
68 { /* 11001 */ 33, 2 },
69 { /* 11010 */ 37, 2 },
70 { /* 11011 */ 41, 2 },
71
72 /* 7/8 bit codewords */
73 { /* 11100 */ 45, 3 },
74
75 /* 8 bit codewords */
76 { /* 11101 */ 53, 3 },
77 { /* 11110 */ 61, 3 },
78
79 /* 8/9 bit codewords */
80 { /* 11111 */ 69, 4 }
81 };
82
83 /* 2nd step table
84 *
85 * Gives size of codeword and actual data (x,y,v,w)
86 */
87 static hcb_2_quad hcb2_2[] = {
88 /* 3 bit codeword */
89 { 3, 0, 0, 0, 0 },
90
91 /* 4 bit codeword */
92 { 4, 1, 0, 0, 0 },
93
94 /* 5 bit codewords */
95 { 5, -1, 0, 0, 0 },
96 { 5, 0, 0, 0, 1 },
97 { 5, 0, 0, -1, 0 },
98 { 5, 0, 0, 0, -1 },
99 { 5, 0, -1, 0, 0 },
100 { 5, 0, 0, 1, 0 },
101 { 5, 0, 1, 0, 0 },
102
103 /* 6 bit codewords */
104 { 6, 0, -1, 1, 0 },
105 { 6, -1, 1, 0, 0 },
106 { 6, 0, 1, -1, 0 },
107 { 6, 0, 0, 1, -1 },
108 { 6, 0, 1, 0, -1 },
109 { 6, 0, 0, -1, 1 },
110 { 6, -1, 0, 0, -1 },
111 { 6, 1, -1, 0, 0 },
112 { 6, 1, 0, -1, 0 },
113 { 6, -1, -1, 0, 0 },
114 { 6, 0, 0, -1, -1 },
115 { 6, 1, 0, 1, 0 },
116 { 6, 1, 0, 0, 1 },
117 { 6, 0, -1, 0, 1 },
118 { 6, -1, 0, 1, 0 },
119 { 6, 0, 1, 0, 1 },
120 { 6, 0, -1, -1, 0 },
121 { 6, -1, 0, 0, 1 },
122 { 6, 0, -1, 0, -1 },
123 { 6, -1, 0, -1, 0 },
124 { 6, 1, 1, 0, 0 },
125 { 6, 0, 1, 1, 0 },
126 { 6, 0, 0, 1, 1 },
127 { 6, 1, 0, 0, -1 },
128
129 /* 7 bit codewords */
130 { 7, 0, 1, -1, 1 },
131 { 7, 1, 0, -1, 1 },
132 { 7, -1, 1, -1, 0 },
133 { 7, 0, -1, 1, -1 },
134 { 7, 1, -1, 1, 0 },
135 { 7, 1, 1, 0, -1 },
136 { 7, 1, 0, 1, 1 },
137 { 7, -1, 1, 1, 0 },
138 { 7, 0, -1, -1, 1 },
139 { 7, 1, 1, 1, 0 },
140 { 7, -1, 0, 1, -1 },
141 { 7, -1, -1, -1, 0 },
142
143 /* 7/8 bit codewords */
144 { 7, -1, 0, -1, 1 }, { 7, -1, 0, -1, 1 },
145 { 7, 1, -1, -1, 0 }, { 7, 1, -1, -1, 0 },
146 { 7, 1, 1, -1, 0 }, { 7, 1, 1, -1, 0 },
147 { 8, 1, -1, 0, 1 },
148 { 8, -1, 1, 0, -1 },
149
150 /* 8 bit codewords */
151 { 8, -1, -1, 1, 0 },
152 { 8, -1, 0, 1, 1 },
153 { 8, -1, -1, 0, 1 },
154 { 8, -1, -1, 0, -1 },
155 { 8, 0, -1, -1, -1 },
156 { 8, 1, 0, 1, -1 },
157 { 8, 1, 0, -1, -1 },
158 { 8, 0, 1, -1, -1 },
159 { 8, 0, 1, 1, 1 },
160 { 8, -1, 1, 0, 1 },
161 { 8, -1, 0, -1, -1 },
162 { 8, 0, 1, 1, -1 },
163 { 8, 1, -1, 0, -1 },
164 { 8, 0, -1, 1, 1 },
165 { 8, 1, 1, 0, 1 },
166 { 8, 1, -1, 1, -1 },
167
168 /* 8/9 bit codewords */
169 { 8, -1, 1, -1, 1 }, { 8, -1, 1, -1, 1 },
170 { 9, 1, -1, -1, 1 },
171 { 9, -1, -1, -1, -1 },
172 { 9, -1, 1, 1, -1 },
173 { 9, -1, 1, 1, 1 },
174 { 9, 1, 1, 1, 1 },
175 { 9, -1, -1, 1, -1 },
176 { 9, 1, -1, 1, 1 },
177 { 9, -1, 1, -1, -1 },
178 { 9, -1, -1, 1, 1 },
179 { 9, 1, 1, -1, -1 },
180 { 9, 1, -1, -1, -1 },
181 { 9, -1, -1, -1, 1 },
182 { 9, 1, 1, -1, 1 },
183 { 9, 1, 1, 1, -1 }
184 };
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: hcb_3.h,v 1.5 2007/11/01 12:34:11 menno Exp $
28 **/
29
30 /* Binary search huffman table HCB_3 */
31
32
33 static hcb_bin_quad hcb3[] = {
34 { /* 0 */ 0, { 1, 2, 0, 0 } },
35 { /* 1 */ 1, { 0, 0, 0, 0 } }, /* 0 */
36 { /* 2 */ 0, { 1, 2, 0, 0 } },
37 { /* 3 */ 0, { 2, 3, 0, 0 } },
38 { /* 4 */ 0, { 3, 4, 0, 0 } },
39 { /* 5 */ 0, { 4, 5, 0, 0 } },
40 { /* 6 */ 0, { 5, 6, 0, 0 } },
41 { /* 7 */ 0, { 6, 7, 0, 0 } },
42 { /* 8 */ 0, { 7, 8, 0, 0 } },
43 { /* 9 */ 1, { 1, 0, 0, 0 } }, /* 1000 */
44 { /* 10 */ 1, { 0, 0, 0, 1 } }, /* 1001 */
45 { /* 11 */ 1, { 0, 1, 0, 0 } }, /* 1010 */
46 { /* 12 */ 1, { 0, 0, 1, 0 } }, /* 1011 */
47 { /* 13 */ 0, { 4, 5, 0, 0 } },
48 { /* 14 */ 0, { 5, 6, 0, 0 } },
49 { /* 15 */ 0, { 6, 7, 0, 0 } },
50 { /* 16 */ 0, { 7, 8, 0, 0 } },
51 { /* 17 */ 1, { 1, 1, 0, 0 } },
52 { /* 18 */ 1, { 0, 0, 1, 1 } },
53 { /* 19 */ 0, { 6, 7, 0, 0 } },
54 { /* 20 */ 0, { 7, 8, 0, 0 } },
55 { /* 21 */ 0, { 8, 9, 0, 0 } },
56 { /* 22 */ 0, { 9, 10, 0, 0 } },
57 { /* 23 */ 0, { 10, 11, 0, 0 } },
58 { /* 24 */ 0, { 11, 12, 0, 0 } },
59 { /* 25 */ 1, { 0, 1, 1, 0 } }, /* 110100 */
60 { /* 26 */ 1, { 0, 1, 0, 1 } }, /* 110101 */
61 { /* 27 */ 1, { 1, 0, 1, 0 } }, /* 110110 */
62 { /* 28 */ 1, { 0, 1, 1, 1 } }, /* 110111 */
63 { /* 29 */ 1, { 1, 0, 0, 1 } }, /* 111000 */
64 { /* 30 */ 1, { 1, 1, 1, 0 } }, /* 111001 */
65 { /* 31 */ 0, { 6, 7, 0, 0 } },
66 { /* 32 */ 0, { 7, 8, 0, 0 } },
67 { /* 33 */ 0, { 8, 9, 0, 0 } },
68 { /* 34 */ 0, { 9, 10, 0, 0 } },
69 { /* 35 */ 0, { 10, 11, 0, 0 } },
70 { /* 36 */ 0, { 11, 12, 0, 0 } },
71 { /* 37 */ 1, { 1, 1, 1, 1 } }, /* 1110100 */
72 { /* 38 */ 1, { 1, 0, 1, 1 } }, /* 1110101 */
73 { /* 39 */ 1, { 1, 1, 0, 1 } }, /* 1110110 */
74 { /* 40 */ 0, { 9, 10, 0, 0 } },
75 { /* 41 */ 0, { 10, 11, 0, 0 } },
76 { /* 42 */ 0, { 11, 12, 0, 0 } },
77 { /* 43 */ 0, { 12, 13, 0, 0 } },
78 { /* 44 */ 0, { 13, 14, 0, 0 } },
79 { /* 45 */ 0, { 14, 15, 0, 0 } },
80 { /* 46 */ 0, { 15, 16, 0, 0 } },
81 { /* 47 */ 0, { 16, 17, 0, 0 } },
82 { /* 48 */ 0, { 17, 18, 0, 0 } },
83 { /* 49 */ 1, { 2, 0, 0, 0 } }, /* 11101110 */
84 { /* 50 */ 1, { 0, 0, 0, 2 } }, /* 11101111 */
85 { /* 51 */ 1, { 0, 0, 1, 2 } }, /* 11110000 */
86 { /* 52 */ 1, { 2, 1, 0, 0 } }, /* 11110001 */
87 { /* 53 */ 1, { 1, 2, 1, 0 } }, /* 11110010 */
88 { /* 54 */ 0, { 13, 14, 0, 0 } },
89 { /* 55 */ 0, { 14, 15, 0, 0 } },
90 { /* 56 */ 0, { 15, 16, 0, 0 } },
91 { /* 57 */ 0, { 16, 17, 0, 0 } },
92 { /* 58 */ 0, { 17, 18, 0, 0 } },
93 { /* 59 */ 0, { 18, 19, 0, 0 } },
94 { /* 60 */ 0, { 19, 20, 0, 0 } },
95 { /* 61 */ 0, { 20, 21, 0, 0 } },
96 { /* 62 */ 0, { 21, 22, 0, 0 } },
97 { /* 63 */ 0, { 22, 23, 0, 0 } },
98 { /* 64 */ 0, { 23, 24, 0, 0 } },
99 { /* 65 */ 0, { 24, 25, 0, 0 } },
100 { /* 66 */ 0, { 25, 26, 0, 0 } },
101 { /* 67 */ 1, { 0, 0, 2, 1 } },
102 { /* 68 */ 1, { 0, 1, 2, 1 } },
103 { /* 69 */ 1, { 1, 2, 0, 0 } },
104 { /* 70 */ 1, { 0, 1, 1, 2 } },
105 { /* 71 */ 1, { 2, 1, 1, 0 } },
106 { /* 72 */ 1, { 0, 0, 2, 0 } },
107 { /* 73 */ 1, { 0, 2, 1, 0 } },
108 { /* 74 */ 1, { 0, 1, 2, 0 } },
109 { /* 75 */ 1, { 0, 2, 0, 0 } },
110 { /* 76 */ 1, { 0, 1, 0, 2 } },
111 { /* 77 */ 1, { 2, 0, 1, 0 } },
112 { /* 78 */ 1, { 1, 2, 1, 1 } },
113 { /* 79 */ 1, { 0, 2, 1, 1 } },
114 { /* 80 */ 1, { 1, 1, 2, 0 } },
115 { /* 81 */ 1, { 1, 1, 2, 1 } },
116 { /* 82 */ 0, { 11, 12, 0, 0 } },
117 { /* 83 */ 0, { 12, 13, 0, 0 } },
118 { /* 84 */ 0, { 13, 14, 0, 0 } },
119 { /* 85 */ 0, { 14, 15, 0, 0 } },
120 { /* 86 */ 0, { 15, 16, 0, 0 } },
121 { /* 87 */ 0, { 16, 17, 0, 0 } },
122 { /* 88 */ 0, { 17, 18, 0, 0 } },
123 { /* 89 */ 0, { 18, 19, 0, 0 } },
124 { /* 90 */ 0, { 19, 20, 0, 0 } },
125 { /* 91 */ 0, { 20, 21, 0, 0 } },
126 { /* 92 */ 0, { 21, 22, 0, 0 } },
127 { /* 93 */ 1, { 1, 2, 0, 1 } }, /* 1111101010 */
128 { /* 94 */ 1, { 1, 0, 2, 0 } }, /* 1111101011 */
129 { /* 95 */ 1, { 1, 0, 2, 1 } }, /* 1111101100 */
130 { /* 96 */ 1, { 0, 2, 0, 1 } }, /* 1111101101 */
131 { /* 97 */ 1, { 2, 1, 1, 1 } }, /* 1111101110 */
132 { /* 98 */ 1, { 1, 1, 1, 2 } }, /* 1111101111 */
133 { /* 99 */ 1, { 2, 1, 0, 1 } }, /* 1111110000 */
134 { /* 00 */ 1, { 1, 0, 1, 2 } }, /* 1111110001 */
135 { /* 01 */ 1, { 0, 0, 2, 2 } }, /* 1111110010 */
136 { /* 02 */ 1, { 0, 1, 2, 2 } }, /* 1111110011 */
137 { /* 03 */ 1, { 2, 2, 1, 0 } }, /* 1111110100 */
138 { /* 04 */ 1, { 1, 2, 2, 0 } }, /* 1111110101 */
139 { /* 05 */ 1, { 1, 0, 0, 2 } }, /* 1111110110 */
140 { /* 06 */ 1, { 2, 0, 0, 1 } }, /* 1111110111 */
141 { /* 07 */ 1, { 0, 2, 2, 1 } }, /* 1111111000 */
142 { /* 08 */ 0, { 7, 8, 0, 0 } },
143 { /* 09 */ 0, { 8, 9, 0, 0 } },
144 { /* 10 */ 0, { 9, 10, 0, 0 } },
145 { /* 11 */ 0, { 10, 11, 0, 0 } },
146 { /* 12 */ 0, { 11, 12, 0, 0 } },
147 { /* 13 */ 0, { 12, 13, 0, 0 } },
148 { /* 14 */ 0, { 13, 14, 0, 0 } },
149 { /* 15 */ 1, { 2, 2, 0, 0 } }, /* 11111110010 */
150 { /* 16 */ 1, { 1, 2, 2, 1 } }, /* 11111110011 */
151 { /* 17 */ 1, { 1, 1, 0, 2 } }, /* 11111110100 */
152 { /* 18 */ 1, { 2, 0, 1, 1 } }, /* 11111110101 */
153 { /* 19 */ 1, { 1, 1, 2, 2 } }, /* 11111110110 */
154 { /* 20 */ 1, { 2, 2, 1, 1 } }, /* 11111110111 */
155 { /* 21 */ 1, { 0, 2, 2, 0 } }, /* 11111111000 */
156 { /* 22 */ 1, { 0, 2, 1, 2 } }, /* 11111111001 */
157 { /* 23 */ 0, { 6, 7, 0, 0 } },
158 { /* 24 */ 0, { 7, 8, 0, 0 } },
159 { /* 25 */ 0, { 8, 9, 0, 0 } },
160 { /* 26 */ 0, { 9, 10, 0, 0 } },
161 { /* 27 */ 0, { 10, 11, 0, 0 } },
162 { /* 28 */ 0, { 11, 12, 0, 0 } },
163 { /* 29 */ 1, { 1, 0, 2, 2 } }, /* 111111110100 */
164 { /* 30 */ 1, { 2, 2, 0, 1 } }, /* 111111110101 */
165 { /* 31 */ 1, { 2, 1, 2, 0 } }, /* 111111110110 */
166 { /* 32 */ 1, { 2, 2, 2, 0 } }, /* 111111110111 */
167 { /* 33 */ 1, { 0, 2, 2, 2 } }, /* 111111111000 */
168 { /* 34 */ 1, { 2, 2, 2, 1 } }, /* 111111111001 */
169 { /* 35 */ 1, { 2, 1, 2, 1 } }, /* 111111111010 */
170 { /* 36 */ 1, { 1, 2, 1, 2 } }, /* 111111111011 */
171 { /* 37 */ 1, { 1, 2, 2, 2 } }, /* 111111111100 */
172 { /* 38 */ 0, { 3, 4, 0, 0 } },
173 { /* 39 */ 0, { 4, 5, 0, 0 } },
174 { /* 40 */ 0, { 5, 6, 0, 0 } },
175 { /* 41 */ 1, { 0, 2, 0, 2 } }, /* 1111111111010 */
176 { /* 42 */ 1, { 2, 0, 2, 0 } }, /* 1111111111011 */
177 { /* 43 */ 1, { 1, 2, 0, 2 } }, /* 1111111111100 */
178 { /* 44 */ 0, { 3, 4, 0, 0 } },
179 { /* 45 */ 0, { 4, 5, 0, 0 } },
180 { /* 46 */ 0, { 5, 6, 0, 0 } },
181 { /* 47 */ 1, { 2, 0, 2, 1 } }, /* 11111111111010 */
182 { /* 48 */ 1, { 2, 1, 1, 2 } }, /* 11111111111011 */
183 { /* 49 */ 1, { 2, 1, 0, 2 } }, /* 11111111111100 */
184 { /* 50 */ 0, { 3, 4, 0, 0 } },
185 { /* 51 */ 0, { 4, 5, 0, 0 } },
186 { /* 52 */ 0, { 5, 6, 0, 0 } },
187 { /* 53 */ 1, { 2, 2, 2, 2 } }, /* 111111111111010 */
188 { /* 54 */ 1, { 2, 2, 1, 2 } }, /* 111111111111011 */
189 { /* 55 */ 1, { 2, 1, 2, 2 } }, /* 111111111111100 */
190 { /* 56 */ 1, { 2, 0, 1, 2 } }, /* 111111111111101 */
191 { /* 57 */ 1, { 2, 0, 0, 2 } }, /* 111111111111110 */
192 { /* 58 */ 0, { 1, 2, 0, 0 } },
193 { /* 59 */ 1, { 2, 2, 0, 2 } }, /* 1111111111111110 */
194 { /* 60 */ 1, { 2, 0, 2, 2 } } /* 1111111111111111 */
195 };
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: hcb_4.h,v 1.5 2007/11/01 12:34:11 menno Exp $
28 **/
29
30 /* 2-step huffman table HCB_4 */
31
32
33 /* 1st step: 5 bits
34 * 2^5 = 32 entries
35 *
36 * Used to find offset into 2nd step table and number of extra bits to get
37 */
38 static hcb hcb4_1[] = {
39 /* 4 bit codewords */
40 { /* 00000 */ 0, 0 },
41 { /* */ 0, 0 },
42 { /* 00010 */ 1, 0 },
43 { /* */ 1, 0 },
44 { /* 00100 */ 2, 0 },
45 { /* */ 2, 0 },
46 { /* 00110 */ 3, 0 },
47 { /* */ 3, 0 },
48 { /* 01000 */ 4, 0 },
49 { /* */ 4, 0 },
50 { /* 01010 */ 5, 0 },
51 { /* */ 5, 0 },
52 { /* 01100 */ 6, 0 },
53 { /* */ 6, 0 },
54 { /* 01110 */ 7, 0 },
55 { /* */ 7, 0 },
56 { /* 10000 */ 8, 0 },
57 { /* */ 8, 0 },
58 { /* 10010 */ 9, 0 },
59 { /* */ 9, 0 },
60
61 /* 5 bit codewords */
62 { /* 10100 */ 10, 0 },
63 { /* 10101 */ 11, 0 },
64 { /* 10110 */ 12, 0 },
65 { /* 10111 */ 13, 0 },
66 { /* 11000 */ 14, 0 },
67 { /* 11001 */ 15, 0 },
68
69 /* 7 bit codewords */
70 { /* 11010 */ 16, 2 },
71 { /* 11011 */ 20, 2 },
72
73 /* 7/8 bit codewords */
74 { /* 11100 */ 24, 3 },
75
76 /* 8 bit codewords */
77 { /* 11101 */ 32, 3 },
78
79 /* 8/9 bit codewords */
80 { /* 11110 */ 40, 4 },
81
82 /* 9/10/11/12 bit codewords */
83 { /* 11111 */ 56, 7 }
84 };
85
86 /* 2nd step table
87 *
88 * Gives size of codeword and actual data (x,y,v,w)
89 */
90 static hcb_2_quad hcb4_2[] = {
91 /* 4 bit codewords */
92 { 4, 1, 1, 1, 1 },
93 { 4, 0, 1, 1, 1 },
94 { 4, 1, 1, 0, 1 },
95 { 4, 1, 1, 1, 0 },
96 { 4, 1, 0, 1, 1 },
97 { 4, 1, 0, 0, 0 },
98 { 4, 1, 1, 0, 0 },
99 { 4, 0, 0, 0, 0 },
100 { 4, 0, 0, 1, 1 },
101 { 4, 1, 0, 1, 0 },
102
103 /* 5 bit codewords */
104 { 5, 1, 0, 0, 1 },
105 { 5, 0, 1, 1, 0 },
106 { 5, 0, 0, 0, 1 },
107 { 5, 0, 1, 0, 1 },
108 { 5, 0, 0, 1, 0 },
109 { 5, 0, 1, 0, 0 },
110
111 /* 7 bit codewords */
112 /* first 5 bits: 11010 */
113 { 7, 2, 1, 1, 1 },
114 { 7, 1, 1, 2, 1 },
115 { 7, 1, 2, 1, 1 },
116 { 7, 1, 1, 1, 2 },
117 /* first 5 bits: 11011 */
118 { 7, 2, 1, 1, 0 },
119 { 7, 2, 1, 0, 1 },
120 { 7, 1, 2, 1, 0 },
121 { 7, 2, 0, 1, 1 },
122
123 /* 7/8 bit codewords */
124 /* first 5 bits: 11100 */
125 { 7, 0, 1, 2, 1 }, { 7, 0, 1, 2, 1 },
126 { 8, 0, 1, 1, 2 },
127 { 8, 1, 1, 2, 0 },
128 { 8, 0, 2, 1, 1 },
129 { 8, 1, 0, 1, 2 },
130 { 8, 1, 2, 0, 1 },
131 { 8, 1, 1, 0, 2 },
132
133 /* 8 bit codewords */
134 { 8, 1, 0, 2, 1 },
135 { 8, 2, 1, 0, 0 },
136 { 8, 2, 0, 1, 0 },
137 { 8, 1, 2, 0, 0 },
138 { 8, 2, 0, 0, 1 },
139 { 8, 0, 1, 0, 2 },
140 { 8, 0, 2, 1, 0 },
141 { 8, 0, 0, 1, 2 },
142
143 /* 8/9 bit codewords */
144 { 8, 0, 1, 2, 0 }, { 8, 0, 1, 2, 0 },
145 { 8, 0, 2, 0, 1 }, { 8, 0, 2, 0, 1 },
146 { 8, 1, 0, 0, 2 }, { 8, 1, 0, 0, 2 },
147 { 8, 0, 0, 2, 1 }, { 8, 0, 0, 2, 1 },
148 { 8, 1, 0, 2, 0 }, { 8, 1, 0, 2, 0 },
149 { 8, 2, 0, 0, 0 }, { 8, 2, 0, 0, 0 },
150 { 8, 0, 0, 0, 2 }, { 8, 0, 0, 0, 2 },
151 { 9, 0, 2, 0, 0 },
152 { 9, 0, 0, 2, 0 },
153
154 /* 9/10/11 bit codewords */
155 /* 9 bit codewords repeated 2^3 = 8 times */
156 { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 },
157 { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 },
158 { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 },
159 { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 },
160 { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 },
161 { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 },
162 { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 },
163 { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 },
164 { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 },
165 { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 },
166 { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 },
167 { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 },
168 /* 10 bit codewords repeated 2^2 = 4 times */
169 { 10, 1, 2, 2, 0 }, { 10, 1, 2, 2, 0 }, { 10, 1, 2, 2, 0 }, { 10, 1, 2, 2, 0 },
170 { 10, 2, 2, 1, 0 }, { 10, 2, 2, 1, 0 }, { 10, 2, 2, 1, 0 }, { 10, 2, 2, 1, 0 },
171 { 10, 2, 1, 2, 0 }, { 10, 2, 1, 2, 0 }, { 10, 2, 1, 2, 0 }, { 10, 2, 1, 2, 0 },
172 { 10, 0, 2, 2, 1 }, { 10, 0, 2, 2, 1 }, { 10, 0, 2, 2, 1 }, { 10, 0, 2, 2, 1 },
173 { 10, 0, 1, 2, 2 }, { 10, 0, 1, 2, 2 }, { 10, 0, 1, 2, 2 }, { 10, 0, 1, 2, 2 },
174 { 10, 2, 2, 0, 1 }, { 10, 2, 2, 0, 1 }, { 10, 2, 2, 0, 1 }, { 10, 2, 2, 0, 1 },
175 { 10, 0, 2, 1, 2 }, { 10, 0, 2, 1, 2 }, { 10, 0, 2, 1, 2 }, { 10, 0, 2, 1, 2 },
176 { 10, 2, 0, 2, 1 }, { 10, 2, 0, 2, 1 }, { 10, 2, 0, 2, 1 }, { 10, 2, 0, 2, 1 },
177 { 10, 1, 0, 2, 2 }, { 10, 1, 0, 2, 2 }, { 10, 1, 0, 2, 2 }, { 10, 1, 0, 2, 2 },
178 { 10, 2, 2, 2, 1 }, { 10, 2, 2, 2, 1 }, { 10, 2, 2, 2, 1 }, { 10, 2, 2, 2, 1 },
179 { 10, 1, 2, 0, 2 }, { 10, 1, 2, 0, 2 }, { 10, 1, 2, 0, 2 }, { 10, 1, 2, 0, 2 },
180 { 10, 2, 0, 1, 2 }, { 10, 2, 0, 1, 2 }, { 10, 2, 0, 1, 2 }, { 10, 2, 0, 1, 2 },
181 { 10, 2, 1, 0, 2 }, { 10, 2, 1, 0, 2 }, { 10, 2, 1, 0, 2 }, { 10, 2, 1, 0, 2 },
182 { 10, 1, 2, 2, 2 }, { 10, 1, 2, 2, 2 }, { 10, 1, 2, 2, 2 }, { 10, 1, 2, 2, 2 },
183 /* 11 bit codewords repeated 2^1 = 2 times */
184 { 11, 2, 1, 2, 2 }, { 11, 2, 1, 2, 2 },
185 { 11, 2, 2, 1, 2 }, { 11, 2, 2, 1, 2 },
186 { 11, 0, 2, 2, 0 }, { 11, 0, 2, 2, 0 },
187 { 11, 2, 2, 0, 0 }, { 11, 2, 2, 0, 0 },
188 { 11, 0, 0, 2, 2 }, { 11, 0, 0, 2, 2 },
189 { 11, 2, 0, 2, 0 }, { 11, 2, 0, 2, 0 },
190 { 11, 0, 2, 0, 2 }, { 11, 0, 2, 0, 2 },
191 { 11, 2, 0, 0, 2 }, { 11, 2, 0, 0, 2 },
192 { 11, 2, 2, 2, 2 }, { 11, 2, 2, 2, 2 },
193 { 11, 0, 2, 2, 2 }, { 11, 0, 2, 2, 2 },
194 { 11, 2, 2, 2, 0 }, { 11, 2, 2, 2, 0 },
195 /* 12 bit codewords */
196 { 12, 2, 2, 0, 2 },
197 { 12, 2, 0, 2, 2 },
198 };
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: hcb_5.h,v 1.5 2007/11/01 12:34:11 menno Exp $
28 **/
29
30 /* Binary search huffman table HCB_5 */
31
32
33 static hcb_bin_pair hcb5[] = {
34 { /* 0 */ 0, { 1, 2 } },
35 { /* 1 */ 1, { 0, 0 } }, /* 0 */
36 { /* 2 */ 0, { 1, 2 } },
37 { /* 3 */ 0, { 2, 3 } },
38 { /* 4 */ 0, { 3, 4 } },
39 { /* 5 */ 0, { 4, 5 } },
40 { /* 6 */ 0, { 5, 6 } },
41 { /* 7 */ 0, { 6, 7 } },
42 { /* 8 */ 0, { 7, 8 } },
43 { /* 9 */ 1, { -1, 0 } }, /* 1000 */
44 { /* 10 */ 1, { 1, 0 } }, /* 1001 */
45 { /* 11 */ 1, { 0, 1 } }, /* 1010 */
46 { /* 12 */ 1, { 0, -1 } }, /* 1011 */
47 { /* 13 */ 0, { 4, 5 } },
48 { /* 14 */ 0, { 5, 6 } },
49 { /* 15 */ 0, { 6, 7 } },
50 { /* 16 */ 0, { 7, 8 } },
51 { /* 17 */ 1, { 1, -1 } },
52 { /* 18 */ 1, { -1, 1 } },
53 { /* 19 */ 1, { -1, -1 } },
54 { /* 20 */ 1, { 1, 1 } },
55 { /* 21 */ 0, { 4, 5 } },
56 { /* 22 */ 0, { 5, 6 } },
57 { /* 23 */ 0, { 6, 7 } },
58 { /* 24 */ 0, { 7, 8 } },
59 { /* 25 */ 0, { 8, 9 } },
60 { /* 26 */ 0, { 9, 10 } },
61 { /* 27 */ 0, { 10, 11 } },
62 { /* 28 */ 0, { 11, 12 } },
63 { /* 29 */ 0, { 12, 13 } },
64 { /* 30 */ 0, { 13, 14 } },
65 { /* 31 */ 0, { 14, 15 } },
66 { /* 32 */ 0, { 15, 16 } },
67 { /* 33 */ 1, { -2, 0 } },
68 { /* 34 */ 1, { 0, 2 } },
69 { /* 35 */ 1, { 2, 0 } },
70 { /* 36 */ 1, { 0, -2 } },
71 { /* 37 */ 0, { 12, 13 } },
72 { /* 38 */ 0, { 13, 14 } },
73 { /* 39 */ 0, { 14, 15 } },
74 { /* 40 */ 0, { 15, 16 } },
75 { /* 41 */ 0, { 16, 17 } },
76 { /* 42 */ 0, { 17, 18 } },
77 { /* 43 */ 0, { 18, 19 } },
78 { /* 44 */ 0, { 19, 20 } },
79 { /* 45 */ 0, { 20, 21 } },
80 { /* 46 */ 0, { 21, 22 } },
81 { /* 47 */ 0, { 22, 23 } },
82 { /* 48 */ 0, { 23, 24 } },
83 { /* 49 */ 1, { -2, -1 } },
84 { /* 50 */ 1, { 2, 1 } },
85 { /* 51 */ 1, { -1, -2 } },
86 { /* 52 */ 1, { 1, 2 } },
87 { /* 53 */ 1, { -2, 1 } },
88 { /* 54 */ 1, { 2, -1 } },
89 { /* 55 */ 1, { -1, 2 } },
90 { /* 56 */ 1, { 1, -2 } },
91 { /* 57 */ 1, { -3, 0 } },
92 { /* 58 */ 1, { 3, 0 } },
93 { /* 59 */ 1, { 0, -3 } },
94 { /* 60 */ 1, { 0, 3 } },
95 { /* 61 */ 0, { 12, 13 } },
96 { /* 62 */ 0, { 13, 14 } },
97 { /* 63 */ 0, { 14, 15 } },
98 { /* 64 */ 0, { 15, 16 } },
99 { /* 65 */ 0, { 16, 17 } },
100 { /* 66 */ 0, { 17, 18 } },
101 { /* 67 */ 0, { 18, 19 } },
102 { /* 68 */ 0, { 19, 20 } },
103 { /* 69 */ 0, { 20, 21 } },
104 { /* 70 */ 0, { 21, 22 } },
105 { /* 71 */ 0, { 22, 23 } },
106 { /* 72 */ 0, { 23, 24 } },
107 { /* 73 */ 1, { -3, -1 } },
108 { /* 74 */ 1, { 1, 3 } },
109 { /* 75 */ 1, { 3, 1 } },
110 { /* 76 */ 1, { -1, -3 } },
111 { /* 77 */ 1, { -3, 1 } },
112 { /* 78 */ 1, { 3, -1 } },
113 { /* 79 */ 1, { 1, -3 } },
114 { /* 80 */ 1, { -1, 3 } },
115 { /* 81 */ 1, { -2, 2 } },
116 { /* 82 */ 1, { 2, 2 } },
117 { /* 83 */ 1, { -2, -2 } },
118 { /* 84 */ 1, { 2, -2 } },
119 { /* 85 */ 0, { 12, 13 } },
120 { /* 86 */ 0, { 13, 14 } },
121 { /* 87 */ 0, { 14, 15 } },
122 { /* 88 */ 0, { 15, 16 } },
123 { /* 89 */ 0, { 16, 17 } },
124 { /* 90 */ 0, { 17, 18 } },
125 { /* 91 */ 0, { 18, 19 } },
126 { /* 92 */ 0, { 19, 20 } },
127 { /* 93 */ 0, { 20, 21 } },
128 { /* 94 */ 0, { 21, 22 } },
129 { /* 95 */ 0, { 22, 23 } },
130 { /* 96 */ 0, { 23, 24 } },
131 { /* 97 */ 1, { -3, -2 } },
132 { /* 98 */ 1, { 3, -2 } },
133 { /* 99 */ 1, { -2, 3 } },
134 { /* 00 */ 1, { 2, -3 } },
135 { /* 01 */ 1, { 3, 2 } },
136 { /* 02 */ 1, { 2, 3 } },
137 { /* 03 */ 1, { -3, 2 } },
138 { /* 04 */ 1, { -2, -3 } },
139 { /* 05 */ 1, { 0, -4 } },
140 { /* 06 */ 1, { -4, 0 } },
141 { /* 07 */ 1, { 4, 1 } },
142 { /* 08 */ 1, { 4, 0 } },
143 { /* 09 */ 0, { 12, 13 } },
144 { /* 10 */ 0, { 13, 14 } },
145 { /* 11 */ 0, { 14, 15 } },
146 { /* 12 */ 0, { 15, 16 } },
147 { /* 13 */ 0, { 16, 17 } },
148 { /* 14 */ 0, { 17, 18 } },
149 { /* 15 */ 0, { 18, 19 } },
150 { /* 16 */ 0, { 19, 20 } },
151 { /* 17 */ 0, { 20, 21 } },
152 { /* 18 */ 0, { 21, 22 } },
153 { /* 19 */ 0, { 22, 23 } },
154 { /* 20 */ 0, { 23, 24 } },
155 { /* 21 */ 1, { -4, -1 } },
156 { /* 22 */ 1, { 0, 4 } },
157 { /* 23 */ 1, { 4, -1 } },
158 { /* 24 */ 1, { -1, -4 } },
159 { /* 25 */ 1, { 1, 4 } },
160 { /* 26 */ 1, { -1, 4 } },
161 { /* 27 */ 1, { -4, 1 } },
162 { /* 28 */ 1, { 1, -4 } },
163 { /* 29 */ 1, { 3, -3 } },
164 { /* 30 */ 1, { -3, -3 } },
165 { /* 31 */ 1, { -3, 3 } },
166 { /* 32 */ 1, { -2, 4 } },
167 { /* 33 */ 1, { -4, -2 } },
168 { /* 34 */ 1, { 4, 2 } },
169 { /* 35 */ 1, { 2, -4 } },
170 { /* 36 */ 1, { 2, 4 } },
171 { /* 37 */ 1, { 3, 3 } },
172 { /* 38 */ 1, { -4, 2 } },
173 { /* 39 */ 0, { 6, 7 } },
174 { /* 40 */ 0, { 7, 8 } },
175 { /* 41 */ 0, { 8, 9 } },
176 { /* 42 */ 0, { 9, 10 } },
177 { /* 43 */ 0, { 10, 11 } },
178 { /* 44 */ 0, { 11, 12 } },
179 { /* 45 */ 1, { -2, -4 } },
180 { /* 46 */ 1, { 4, -2 } },
181 { /* 47 */ 1, { 3, -4 } },
182 { /* 48 */ 1, { -4, -3 } },
183 { /* 49 */ 1, { -4, 3 } },
184 { /* 50 */ 1, { 3, 4 } },
185 { /* 51 */ 1, { -3, 4 } },
186 { /* 52 */ 1, { 4, 3 } },
187 { /* 53 */ 1, { 4, -3 } },
188 { /* 54 */ 1, { -3, -4 } },
189 { /* 55 */ 0, { 2, 3 } },
190 { /* 56 */ 0, { 3, 4 } },
191 { /* 57 */ 1, { 4, -4 } },
192 { /* 58 */ 1, { -4, 4 } },
193 { /* 59 */ 1, { 4, 4 } },
194 { /* 60 */ 1, { -4, -4 } }
195 };
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: hcb_6.h,v 1.5 2007/11/01 12:34:11 menno Exp $
28 **/
29
30 /* 2-step huffman table HCB_6 */
31
32
33 /* 1st step: 5 bits
34 * 2^5 = 32 entries
35 *
36 * Used to find offset into 2nd step table and number of extra bits to get
37 */
38 static hcb hcb6_1[] = {
39 /* 4 bit codewords */
40 { /* 00000 */ 0, 0 },
41 { /* */ 0, 0 },
42 { /* 00010 */ 1, 0 },
43 { /* */ 1, 0 },
44 { /* 00100 */ 2, 0 },
45 { /* */ 2, 0 },
46 { /* 00110 */ 3, 0 },
47 { /* */ 3, 0 },
48 { /* 01000 */ 4, 0 },
49 { /* */ 4, 0 },
50 { /* 01010 */ 5, 0 },
51 { /* */ 5, 0 },
52 { /* 01100 */ 6, 0 },
53 { /* */ 6, 0 },
54 { /* 01110 */ 7, 0 },
55 { /* */ 7, 0 },
56 { /* 10000 */ 8, 0 },
57 { /* */ 8, 0 },
58
59 /* 6 bit codewords */
60 { /* 10010 */ 9, 1 },
61 { /* 10011 */ 11, 1 },
62 { /* 10100 */ 13, 1 },
63 { /* 10101 */ 15, 1 },
64 { /* 10110 */ 17, 1 },
65 { /* 10111 */ 19, 1 },
66 { /* 11000 */ 21, 1 },
67 { /* 11001 */ 23, 1 },
68
69 /* 7 bit codewords */
70 { /* 11010 */ 25, 2 },
71 { /* 11011 */ 29, 2 },
72 { /* 11100 */ 33, 2 },
73
74 /* 7/8 bit codewords */
75 { /* 11101 */ 37, 3 },
76
77 /* 8/9 bit codewords */
78 { /* 11110 */ 45, 4 },
79
80 /* 9/10/11 bit codewords */
81 { /* 11111 */ 61, 6 }
82 };
83
84 /* 2nd step table
85 *
86 * Gives size of codeword and actual data (x,y,v,w)
87 */
88 static hcb_2_pair hcb6_2[] = {
89 /* 4 bit codewords */
90 { 4, 0, 0 },
91 { 4, 1, 0 },
92 { 4, 0, -1 },
93 { 4, 0, 1 },
94 { 4, -1, 0 },
95 { 4, 1, 1 },
96 { 4, -1, 1 },
97 { 4, 1, -1 },
98 { 4, -1, -1 },
99
100 /* 6 bit codewords */
101 { 6, 2, -1 },
102 { 6, 2, 1 },
103 { 6, -2, 1 },
104 { 6, -2, -1 },
105 { 6, -2, 0 },
106 { 6, -1, 2 },
107 { 6, 2, 0 },
108 { 6, 1, -2 },
109 { 6, 1, 2 },
110 { 6, 0, -2 },
111 { 6, -1, -2 },
112 { 6, 0, 2 },
113 { 6, 2, -2 },
114 { 6, -2, 2 },
115 { 6, -2, -2 },
116 { 6, 2, 2 },
117
118 /* 7 bit codewords */
119 { 7, -3, 1 },
120 { 7, 3, 1 },
121 { 7, 3, -1 },
122 { 7, -1, 3 },
123 { 7, -3, -1 },
124 { 7, 1, 3 },
125 { 7, 1, -3 },
126 { 7, -1, -3 },
127 { 7, 3, 0 },
128 { 7, -3, 0 },
129 { 7, 0, -3 },
130 { 7, 0, 3 },
131
132 /* 7/8 bit codewords */
133 { 7, 3, 2 }, { 7, 3, 2 },
134 { 8, -3, -2 },
135 { 8, -2, 3 },
136 { 8, 2, 3 },
137 { 8, 3, -2 },
138 { 8, 2, -3 },
139 { 8, -2, -3 },
140
141 /* 8 bit codewords */
142 { 8, -3, 2 }, { 8, -3, 2 },
143 { 8, 3, 3 }, { 8, 3, 3 },
144 { 9, 3, -3 },
145 { 9, -3, -3 },
146 { 9, -3, 3 },
147 { 9, 1, -4 },
148 { 9, -1, -4 },
149 { 9, 4, 1 },
150 { 9, -4, 1 },
151 { 9, -4, -1 },
152 { 9, 1, 4 },
153 { 9, 4, -1 },
154 { 9, -1, 4 },
155 { 9, 0, -4 },
156
157 /* 9/10/11 bit codewords */
158 { 9, -4, 2 }, { 9, -4, 2 }, { 9, -4, 2 }, { 9, -4, 2 },
159 { 9, -4, -2 }, { 9, -4, -2 }, { 9, -4, -2 }, { 9, -4, -2 },
160 { 9, 2, 4 }, { 9, 2, 4 }, { 9, 2, 4 }, { 9, 2, 4 },
161 { 9, -2, -4 }, { 9, -2, -4 }, { 9, -2, -4 }, { 9, -2, -4 },
162 { 9, -4, 0 }, { 9, -4, 0 }, { 9, -4, 0 }, { 9, -4, 0 },
163 { 9, 4, 2 }, { 9, 4, 2 }, { 9, 4, 2 }, { 9, 4, 2 },
164 { 9, 4, -2 }, { 9, 4, -2 }, { 9, 4, -2 }, { 9, 4, -2 },
165 { 9, -2, 4 }, { 9, -2, 4 }, { 9, -2, 4 }, { 9, -2, 4 },
166 { 9, 4, 0 }, { 9, 4, 0 }, { 9, 4, 0 }, { 9, 4, 0 },
167 { 9, 2, -4 }, { 9, 2, -4 }, { 9, 2, -4 }, { 9, 2, -4 },
168 { 9, 0, 4 }, { 9, 0, 4 }, { 9, 0, 4 }, { 9, 0, 4 },
169 { 10, -3, -4 }, { 10, -3, -4 },
170 { 10, -3, 4 }, { 10, -3, 4 },
171 { 10, 3, -4 }, { 10, 3, -4 },
172 { 10, 4, -3 }, { 10, 4, -3 },
173 { 10, 3, 4 }, { 10, 3, 4 },
174 { 10, 4, 3 }, { 10, 4, 3 },
175 { 10, -4, 3 }, { 10, -4, 3 },
176 { 10, -4, -3 }, { 10, -4, -3 },
177 { 11, 4, 4 },
178 { 11, -4, 4 },
179 { 11, -4, -4 },
180 { 11, 4, -4 }
181 };
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: hcb_7.h,v 1.5 2007/11/01 12:34:11 menno Exp $
28 **/
29
30 /* Binary search huffman table HCB_7 */
31
32
33 static hcb_bin_pair hcb7[] = {
34 { /* 0 */ 0, { 1, 2 } },
35 { /* 1 */ 1, { 0, 0 } },
36 { /* 2 */ 0, { 1, 2 } },
37 { /* 3 */ 0, { 2, 3 } },
38 { /* 4 */ 0, { 3, 4 } },
39 { /* 5 */ 1, { 1, 0 } },
40 { /* 6 */ 1, { 0, 1 } },
41 { /* 7 */ 0, { 2, 3 } },
42 { /* 8 */ 0, { 3, 4 } },
43 { /* 9 */ 1, { 1, 1 } },
44 { /* 10 */ 0, { 3, 4 } },
45 { /* 11 */ 0, { 4, 5 } },
46 { /* 12 */ 0, { 5, 6 } },
47 { /* 13 */ 0, { 6, 7 } },
48 { /* 14 */ 0, { 7, 8 } },
49 { /* 15 */ 0, { 8, 9 } },
50 { /* 16 */ 0, { 9, 10 } },
51 { /* 17 */ 0, { 10, 11 } },
52 { /* 18 */ 0, { 11, 12 } },
53 { /* 19 */ 1, { 2, 1 } },
54 { /* 20 */ 1, { 1, 2 } },
55 { /* 21 */ 1, { 2, 0 } },
56 { /* 22 */ 1, { 0, 2 } },
57 { /* 23 */ 0, { 8, 9 } },
58 { /* 24 */ 0, { 9, 10 } },
59 { /* 25 */ 0, { 10, 11 } },
60 { /* 26 */ 0, { 11, 12 } },
61 { /* 27 */ 0, { 12, 13 } },
62 { /* 28 */ 0, { 13, 14 } },
63 { /* 29 */ 0, { 14, 15 } },
64 { /* 30 */ 0, { 15, 16 } },
65 { /* 31 */ 1, { 3, 1 } },
66 { /* 32 */ 1, { 1, 3 } },
67 { /* 33 */ 1, { 2, 2 } },
68 { /* 34 */ 1, { 3, 0 } },
69 { /* 35 */ 1, { 0, 3 } },
70 { /* 36 */ 0, { 11, 12 } },
71 { /* 37 */ 0, { 12, 13 } },
72 { /* 38 */ 0, { 13, 14 } },
73 { /* 39 */ 0, { 14, 15 } },
74 { /* 40 */ 0, { 15, 16 } },
75 { /* 41 */ 0, { 16, 17 } },
76 { /* 42 */ 0, { 17, 18 } },
77 { /* 43 */ 0, { 18, 19 } },
78 { /* 44 */ 0, { 19, 20 } },
79 { /* 45 */ 0, { 20, 21 } },
80 { /* 46 */ 0, { 21, 22 } },
81 { /* 47 */ 1, { 2, 3 } },
82 { /* 48 */ 1, { 3, 2 } },
83 { /* 49 */ 1, { 1, 4 } },
84 { /* 50 */ 1, { 4, 1 } },
85 { /* 51 */ 1, { 1, 5 } },
86 { /* 52 */ 1, { 5, 1 } },
87 { /* 53 */ 1, { 3, 3 } },
88 { /* 54 */ 1, { 2, 4 } },
89 { /* 55 */ 1, { 0, 4 } },
90 { /* 56 */ 1, { 4, 0 } },
91 { /* 57 */ 0, { 12, 13 } },
92 { /* 58 */ 0, { 13, 14 } },
93 { /* 59 */ 0, { 14, 15 } },
94 { /* 60 */ 0, { 15, 16 } },
95 { /* 61 */ 0, { 16, 17 } },
96 { /* 62 */ 0, { 17, 18 } },
97 { /* 63 */ 0, { 18, 19 } },
98 { /* 64 */ 0, { 19, 20 } },
99 { /* 65 */ 0, { 20, 21 } },
100 { /* 66 */ 0, { 21, 22 } },
101 { /* 67 */ 0, { 22, 23 } },
102 { /* 68 */ 0, { 23, 24 } },
103 { /* 69 */ 1, { 4, 2 } },
104 { /* 70 */ 1, { 2, 5 } },
105 { /* 71 */ 1, { 5, 2 } },
106 { /* 72 */ 1, { 0, 5 } },
107 { /* 73 */ 1, { 6, 1 } },
108 { /* 74 */ 1, { 5, 0 } },
109 { /* 75 */ 1, { 1, 6 } },
110 { /* 76 */ 1, { 4, 3 } },
111 { /* 77 */ 1, { 3, 5 } },
112 { /* 78 */ 1, { 3, 4 } },
113 { /* 79 */ 1, { 5, 3 } },
114 { /* 80 */ 1, { 2, 6 } },
115 { /* 81 */ 1, { 6, 2 } },
116 { /* 82 */ 1, { 1, 7 } },
117 { /* 83 */ 0, { 10, 11 } },
118 { /* 84 */ 0, { 11, 12 } },
119 { /* 85 */ 0, { 12, 13 } },
120 { /* 86 */ 0, { 13, 14 } },
121 { /* 87 */ 0, { 14, 15 } },
122 { /* 88 */ 0, { 15, 16 } },
123 { /* 89 */ 0, { 16, 17 } },
124 { /* 90 */ 0, { 17, 18 } },
125 { /* 91 */ 0, { 18, 19 } },
126 { /* 92 */ 0, { 19, 20 } },
127 { /* 93 */ 1, { 3, 6 } },
128 { /* 94 */ 1, { 0, 6 } },
129 { /* 95 */ 1, { 6, 0 } },
130 { /* 96 */ 1, { 4, 4 } },
131 { /* 97 */ 1, { 7, 1 } },
132 { /* 98 */ 1, { 4, 5 } },
133 { /* 99 */ 1, { 7, 2 } },
134 { /* 00 */ 1, { 5, 4 } },
135 { /* 01 */ 1, { 6, 3 } },
136 { /* 02 */ 1, { 2, 7 } },
137 { /* 03 */ 1, { 7, 3 } },
138 { /* 04 */ 1, { 6, 4 } },
139 { /* 05 */ 1, { 5, 5 } },
140 { /* 06 */ 1, { 4, 6 } },
141 { /* 07 */ 1, { 3, 7 } },
142 { /* 08 */ 0, { 5, 6 } },
143 { /* 09 */ 0, { 6, 7 } },
144 { /* 10 */ 0, { 7, 8 } },
145 { /* 11 */ 0, { 8, 9 } },
146 { /* 12 */ 0, { 9, 10 } },
147 { /* 13 */ 1, { 7, 0 } },
148 { /* 14 */ 1, { 0, 7 } },
149 { /* 15 */ 1, { 6, 5 } },
150 { /* 16 */ 1, { 5, 6 } },
151 { /* 17 */ 1, { 7, 4 } },
152 { /* 18 */ 1, { 4, 7 } },
153 { /* 19 */ 1, { 5, 7 } },
154 { /* 20 */ 1, { 7, 5 } },
155 { /* 21 */ 0, { 2, 3 } },
156 { /* 22 */ 0, { 3, 4 } },
157 { /* 23 */ 1, { 7, 6 } },
158 { /* 24 */ 1, { 6, 6 } },
159 { /* 25 */ 1, { 6, 7 } },
160 { /* 26 */ 1, { 7, 7 } }
161 };
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: hcb_8.h,v 1.5 2007/11/01 12:34:11 menno Exp $
28 **/
29
30 /* 2-step huffman table HCB_8 */
31
32
33 /* 1st step: 5 bits
34 * 2^5 = 32 entries
35 *
36 * Used to find offset into 2nd step table and number of extra bits to get
37 */
38 static hcb hcb8_1[] = {
39 /* 3 bit codeword */
40 { /* 00000 */ 0, 0 },
41 { /* */ 0, 0 },
42 { /* */ 0, 0 },
43 { /* */ 0, 0 },
44
45 /* 4 bit codewords */
46 { /* 00100 */ 1, 0 },
47 { /* */ 1, 0 },
48 { /* 00110 */ 2, 0 },
49 { /* */ 2, 0 },
50 { /* 01000 */ 3, 0 },
51 { /* */ 3, 0 },
52 { /* 01010 */ 4, 0 },
53 { /* */ 4, 0 },
54 { /* 01100 */ 5, 0 },
55 { /* */ 5, 0 },
56
57 /* 5 bit codewords */
58 { /* 01110 */ 6, 0 },
59 { /* 01111 */ 7, 0 },
60 { /* 10000 */ 8, 0 },
61 { /* 10001 */ 9, 0 },
62 { /* 10010 */ 10, 0 },
63 { /* 10011 */ 11, 0 },
64 { /* 10100 */ 12, 0 },
65
66 /* 6 bit codewords */
67 { /* 10101 */ 13, 1 },
68 { /* 10110 */ 15, 1 },
69 { /* 10111 */ 17, 1 },
70 { /* 11000 */ 19, 1 },
71 { /* 11001 */ 21, 1 },
72
73 /* 7 bit codewords */
74 { /* 11010 */ 23, 2 },
75 { /* 11011 */ 27, 2 },
76 { /* 11100 */ 31, 2 },
77
78 /* 7/8 bit codewords */
79 { /* 11101 */ 35, 3 },
80
81 /* 8 bit codewords */
82 { /* 11110 */ 43, 3 },
83
84 /* 8/9/10 bit codewords */
85 { /* 11111 */ 51, 5 }
86 };
87
88 /* 2nd step table
89 *
90 * Gives size of codeword and actual data (x,y,v,w)
91 */
92 static hcb_2_pair hcb8_2[] = {
93 /* 3 bit codeword */
94 { 3, 1, 1 },
95
96 /* 4 bit codewords */
97 { 4, 2, 1 },
98 { 4, 1, 0 },
99 { 4, 1, 2 },
100 { 4, 0, 1 },
101 { 4, 2, 2 },
102
103 /* 5 bit codewords */
104 { 5, 0, 0 },
105 { 5, 2, 0 },
106 { 5, 0, 2 },
107 { 5, 3, 1 },
108 { 5, 1, 3 },
109 { 5, 3, 2 },
110 { 5, 2, 3 },
111
112 /* 6 bit codewords */
113 { 6, 3, 3 },
114 { 6, 4, 1 },
115 { 6, 1, 4 },
116 { 6, 4, 2 },
117 { 6, 2, 4 },
118 { 6, 3, 0 },
119 { 6, 0, 3 },
120 { 6, 4, 3 },
121 { 6, 3, 4 },
122 { 6, 5, 2 },
123
124 /* 7 bit codewords */
125 { 7, 5, 1 },
126 { 7, 2, 5 },
127 { 7, 1, 5 },
128 { 7, 5, 3 },
129 { 7, 3, 5 },
130 { 7, 4, 4 },
131 { 7, 5, 4 },
132 { 7, 0, 4 },
133 { 7, 4, 5 },
134 { 7, 4, 0 },
135 { 7, 2, 6 },
136 { 7, 6, 2 },
137
138 /* 7/8 bit codewords */
139 { 7, 6, 1 }, { 7, 6, 1 },
140 { 7, 1, 6 }, { 7, 1, 6 },
141 { 8, 3, 6 },
142 { 8, 6, 3 },
143 { 8, 5, 5 },
144 { 8, 5, 0 },
145
146 /* 8 bit codewords */
147 { 8, 6, 4 },
148 { 8, 0, 5 },
149 { 8, 4, 6 },
150 { 8, 7, 1 },
151 { 8, 7, 2 },
152 { 8, 2, 7 },
153 { 8, 6, 5 },
154 { 8, 7, 3 },
155
156 /* 8/9/10 bit codewords */
157 { 8, 1, 7 }, { 8, 1, 7 }, { 8, 1, 7 }, { 8, 1, 7 },
158 { 8, 5, 6 }, { 8, 5, 6 }, { 8, 5, 6 }, { 8, 5, 6 },
159 { 8, 3, 7 }, { 8, 3, 7 }, { 8, 3, 7 }, { 8, 3, 7 },
160 { 9, 6, 6 }, { 9, 6, 6 },
161 { 9, 7, 4 }, { 9, 7, 4 },
162 { 9, 6, 0 }, { 9, 6, 0 },
163 { 9, 4, 7 }, { 9, 4, 7 },
164 { 9, 0, 6 }, { 9, 0, 6 },
165 { 9, 7, 5 }, { 9, 7, 5 },
166 { 9, 7, 6 }, { 9, 7, 6 },
167 { 9, 6, 7 }, { 9, 6, 7 },
168 { 10, 5, 7 },
169 { 10, 7, 0 },
170 { 10, 0, 7 },
171 { 10, 7, 7 }
172 };
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: hcb_9.h,v 1.5 2007/11/01 12:34:11 menno Exp $
28 **/
29
30 /* Binary search huffman table HCB_9 */
31
32
33 static hcb_bin_pair hcb9[] = {
34 { /* 0 */ 0, { 1, 2 } },
35 { /* 1 */ 1, { 0, 0 } },
36 { /* 2 */ 0, { 1, 2 } },
37 { /* 3 */ 0, { 2, 3 } },
38 { /* 4 */ 0, { 3, 4 } },
39 { /* 5 */ 1, { 1, 0 } },
40 { /* 6 */ 1, { 0, 1 } },
41 { /* 7 */ 0, { 2, 3 } },
42 { /* 8 */ 0, { 3, 4 } },
43 { /* 9 */ 1, { 1, 1 } },
44 { /* 10 */ 0, { 3, 4 } },
45 { /* 11 */ 0, { 4, 5 } },
46 { /* 12 */ 0, { 5, 6 } },
47 { /* 13 */ 0, { 6, 7 } },
48 { /* 14 */ 0, { 7, 8 } },
49 { /* 15 */ 0, { 8, 9 } },
50 { /* 16 */ 0, { 9, 10 } },
51 { /* 17 */ 0, { 10, 11 } },
52 { /* 18 */ 0, { 11, 12 } },
53 { /* 19 */ 1, { 2, 1 } },
54 { /* 20 */ 1, { 1, 2 } },
55 { /* 21 */ 1, { 2, 0 } },
56 { /* 22 */ 1, { 0, 2 } },
57 { /* 23 */ 0, { 8, 9 } },
58 { /* 24 */ 0, { 9, 10 } },
59 { /* 25 */ 0, { 10, 11 } },
60 { /* 26 */ 0, { 11, 12 } },
61 { /* 27 */ 0, { 12, 13 } },
62 { /* 28 */ 0, { 13, 14 } },
63 { /* 29 */ 0, { 14, 15 } },
64 { /* 30 */ 0, { 15, 16 } },
65 { /* 31 */ 1, { 3, 1 } },
66 { /* 32 */ 1, { 2, 2 } },
67 { /* 33 */ 1, { 1, 3 } },
68 { /* 34 */ 0, { 13, 14 } },
69 { /* 35 */ 0, { 14, 15 } },
70 { /* 36 */ 0, { 15, 16 } },
71 { /* 37 */ 0, { 16, 17 } },
72 { /* 38 */ 0, { 17, 18 } },
73 { /* 39 */ 0, { 18, 19 } },
74 { /* 40 */ 0, { 19, 20 } },
75 { /* 41 */ 0, { 20, 21 } },
76 { /* 42 */ 0, { 21, 22 } },
77 { /* 43 */ 0, { 22, 23 } },
78 { /* 44 */ 0, { 23, 24 } },
79 { /* 45 */ 0, { 24, 25 } },
80 { /* 46 */ 0, { 25, 26 } },
81 { /* 47 */ 1, { 3, 0 } },
82 { /* 48 */ 1, { 0, 3 } },
83 { /* 49 */ 1, { 2, 3 } },
84 { /* 50 */ 1, { 3, 2 } },
85 { /* 51 */ 1, { 1, 4 } },
86 { /* 52 */ 1, { 4, 1 } },
87 { /* 53 */ 1, { 2, 4 } },
88 { /* 54 */ 1, { 1, 5 } },
89 { /* 55 */ 0, { 18, 19 } },
90 { /* 56 */ 0, { 19, 20 } },
91 { /* 57 */ 0, { 20, 21 } },
92 { /* 58 */ 0, { 21, 22 } },
93 { /* 59 */ 0, { 22, 23 } },
94 { /* 60 */ 0, { 23, 24 } },
95 { /* 61 */ 0, { 24, 25 } },
96 { /* 62 */ 0, { 25, 26 } },
97 { /* 63 */ 0, { 26, 27 } },
98 { /* 64 */ 0, { 27, 28 } },
99 { /* 65 */ 0, { 28, 29 } },
100 { /* 66 */ 0, { 29, 30 } },
101 { /* 67 */ 0, { 30, 31 } },
102 { /* 68 */ 0, { 31, 32 } },
103 { /* 69 */ 0, { 32, 33 } },
104 { /* 70 */ 0, { 33, 34 } },
105 { /* 71 */ 0, { 34, 35 } },
106 { /* 72 */ 0, { 35, 36 } },
107 { /* 73 */ 1, { 4, 2 } },
108 { /* 74 */ 1, { 3, 3 } },
109 { /* 75 */ 1, { 0, 4 } },
110 { /* 76 */ 1, { 4, 0 } },
111 { /* 77 */ 1, { 5, 1 } },
112 { /* 78 */ 1, { 2, 5 } },
113 { /* 79 */ 1, { 1, 6 } },
114 { /* 80 */ 1, { 3, 4 } },
115 { /* 81 */ 1, { 5, 2 } },
116 { /* 82 */ 1, { 6, 1 } },
117 { /* 83 */ 1, { 4, 3 } },
118 { /* 84 */ 0, { 25, 26 } },
119 { /* 85 */ 0, { 26, 27 } },
120 { /* 86 */ 0, { 27, 28 } },
121 { /* 87 */ 0, { 28, 29 } },
122 { /* 88 */ 0, { 29, 30 } },
123 { /* 89 */ 0, { 30, 31 } },
124 { /* 90 */ 0, { 31, 32 } },
125 { /* 91 */ 0, { 32, 33 } },
126 { /* 92 */ 0, { 33, 34 } },
127 { /* 93 */ 0, { 34, 35 } },
128 { /* 94 */ 0, { 35, 36 } },
129 { /* 95 */ 0, { 36, 37 } },
130 { /* 96 */ 0, { 37, 38 } },
131 { /* 97 */ 0, { 38, 39 } },
132 { /* 98 */ 0, { 39, 40 } },
133 { /* 99 */ 0, { 40, 41 } },
134 { /* 00 */ 0, { 41, 42 } },
135 { /* 01 */ 0, { 42, 43 } },
136 { /* 02 */ 0, { 43, 44 } },
137 { /* 03 */ 0, { 44, 45 } },
138 { /* 04 */ 0, { 45, 46 } },
139 { /* 05 */ 0, { 46, 47 } },
140 { /* 06 */ 0, { 47, 48 } },
141 { /* 07 */ 0, { 48, 49 } },
142 { /* 08 */ 0, { 49, 50 } },
143 { /* 09 */ 1, { 0, 5 } },
144 { /* 10 */ 1, { 2, 6 } },
145 { /* 11 */ 1, { 5, 0 } },
146 { /* 12 */ 1, { 1, 7 } },
147 { /* 13 */ 1, { 3, 5 } },
148 { /* 14 */ 1, { 1, 8 } },
149 { /* 15 */ 1, { 8, 1 } },
150 { /* 16 */ 1, { 4, 4 } },
151 { /* 17 */ 1, { 5, 3 } },
152 { /* 18 */ 1, { 6, 2 } },
153 { /* 19 */ 1, { 7, 1 } },
154 { /* 20 */ 1, { 0, 6 } },
155 { /* 21 */ 1, { 8, 2 } },
156 { /* 22 */ 1, { 2, 8 } },
157 { /* 23 */ 1, { 3, 6 } },
158 { /* 24 */ 1, { 2, 7 } },
159 { /* 25 */ 1, { 4, 5 } },
160 { /* 26 */ 1, { 9, 1 } },
161 { /* 27 */ 1, { 1, 9 } },
162 { /* 28 */ 1, { 7, 2 } },
163 { /* 29 */ 0, { 30, 31 } },
164 { /* 30 */ 0, { 31, 32 } },
165 { /* 31 */ 0, { 32, 33 } },
166 { /* 32 */ 0, { 33, 34 } },
167 { /* 33 */ 0, { 34, 35 } },
168 { /* 34 */ 0, { 35, 36 } },
169 { /* 35 */ 0, { 36, 37 } },
170 { /* 36 */ 0, { 37, 38 } },
171 { /* 37 */ 0, { 38, 39 } },
172 { /* 38 */ 0, { 39, 40 } },
173 { /* 39 */ 0, { 40, 41 } },
174 { /* 40 */ 0, { 41, 42 } },
175 { /* 41 */ 0, { 42, 43 } },
176 { /* 42 */ 0, { 43, 44 } },
177 { /* 43 */ 0, { 44, 45 } },
178 { /* 44 */ 0, { 45, 46 } },
179 { /* 45 */ 0, { 46, 47 } },
180 { /* 46 */ 0, { 47, 48 } },
181 { /* 47 */ 0, { 48, 49 } },
182 { /* 48 */ 0, { 49, 50 } },
183 { /* 49 */ 0, { 50, 51 } },
184 { /* 50 */ 0, { 51, 52 } },
185 { /* 51 */ 0, { 52, 53 } },
186 { /* 52 */ 0, { 53, 54 } },
187 { /* 53 */ 0, { 54, 55 } },
188 { /* 54 */ 0, { 55, 56 } },
189 { /* 55 */ 0, { 56, 57 } },
190 { /* 56 */ 0, { 57, 58 } },
191 { /* 57 */ 0, { 58, 59 } },
192 { /* 58 */ 0, { 59, 60 } },
193 { /* 59 */ 1, { 6, 0 } },
194 { /* 60 */ 1, { 5, 4 } },
195 { /* 61 */ 1, { 6, 3 } },
196 { /* 62 */ 1, { 8, 3 } },
197 { /* 63 */ 1, { 0, 7 } },
198 { /* 64 */ 1, { 9, 2 } },
199 { /* 65 */ 1, { 3, 8 } },
200 { /* 66 */ 1, { 4, 6 } },
201 { /* 67 */ 1, { 3, 7 } },
202 { /* 68 */ 1, { 0, 8 } },
203 { /* 69 */ 1, { 10, 1 } },
204 { /* 70 */ 1, { 6, 4 } },
205 { /* 71 */ 1, { 2, 9 } },
206 { /* 72 */ 1, { 5, 5 } },
207 { /* 73 */ 1, { 8, 0 } },
208 { /* 74 */ 1, { 7, 0 } },
209 { /* 75 */ 1, { 7, 3 } },
210 { /* 76 */ 1, { 10, 2 } },
211 { /* 77 */ 1, { 9, 3 } },
212 { /* 78 */ 1, { 8, 4 } },
213 { /* 79 */ 1, { 1, 10 } },
214 { /* 80 */ 1, { 7, 4 } },
215 { /* 81 */ 1, { 6, 5 } },
216 { /* 82 */ 1, { 5, 6 } },
217 { /* 83 */ 1, { 4, 8 } },
218 { /* 84 */ 1, { 4, 7 } },
219 { /* 85 */ 1, { 3, 9 } },
220 { /* 86 */ 1, { 11, 1 } },
221 { /* 87 */ 1, { 5, 8 } },
222 { /* 88 */ 1, { 9, 0 } },
223 { /* 89 */ 1, { 8, 5 } },
224 { /* 90 */ 0, { 29, 30 } },
225 { /* 91 */ 0, { 30, 31 } },
226 { /* 92 */ 0, { 31, 32 } },
227 { /* 93 */ 0, { 32, 33 } },
228 { /* 94 */ 0, { 33, 34 } },
229 { /* 95 */ 0, { 34, 35 } },
230 { /* 96 */ 0, { 35, 36 } },
231 { /* 97 */ 0, { 36, 37 } },
232 { /* 98 */ 0, { 37, 38 } },
233 { /* 99 */ 0, { 38, 39 } },
234 { /* 00 */ 0, { 39, 40 } },
235 { /* 01 */ 0, { 40, 41 } },
236 { /* 02 */ 0, { 41, 42 } },
237 { /* 03 */ 0, { 42, 43 } },
238 { /* 04 */ 0, { 43, 44 } },
239 { /* 05 */ 0, { 44, 45 } },
240 { /* 06 */ 0, { 45, 46 } },
241 { /* 07 */ 0, { 46, 47 } },
242 { /* 08 */ 0, { 47, 48 } },
243 { /* 09 */ 0, { 48, 49 } },
244 { /* 10 */ 0, { 49, 50 } },
245 { /* 11 */ 0, { 50, 51 } },
246 { /* 12 */ 0, { 51, 52 } },
247 { /* 13 */ 0, { 52, 53 } },
248 { /* 14 */ 0, { 53, 54 } },
249 { /* 15 */ 0, { 54, 55 } },
250 { /* 16 */ 0, { 55, 56 } },
251 { /* 17 */ 0, { 56, 57 } },
252 { /* 18 */ 0, { 57, 58 } },
253 { /* 19 */ 1, { 10, 3 } },
254 { /* 20 */ 1, { 2, 10 } },
255 { /* 21 */ 1, { 0, 9 } },
256 { /* 22 */ 1, { 11, 2 } },
257 { /* 23 */ 1, { 9, 4 } },
258 { /* 24 */ 1, { 6, 6 } },
259 { /* 25 */ 1, { 12, 1 } },
260 { /* 26 */ 1, { 4, 9 } },
261 { /* 27 */ 1, { 8, 6 } },
262 { /* 28 */ 1, { 1, 11 } },
263 { /* 29 */ 1, { 9, 5 } },
264 { /* 30 */ 1, { 10, 4 } },
265 { /* 31 */ 1, { 5, 7 } },
266 { /* 32 */ 1, { 7, 5 } },
267 { /* 33 */ 1, { 2, 11 } },
268 { /* 34 */ 1, { 1, 12 } },
269 { /* 35 */ 1, { 12, 2 } },
270 { /* 36 */ 1, { 11, 3 } },
271 { /* 37 */ 1, { 3, 10 } },
272 { /* 38 */ 1, { 5, 9 } },
273 { /* 39 */ 1, { 6, 7 } },
274 { /* 40 */ 1, { 8, 7 } },
275 { /* 41 */ 1, { 11, 4 } },
276 { /* 42 */ 1, { 0, 10 } },
277 { /* 43 */ 1, { 7, 6 } },
278 { /* 44 */ 1, { 12, 3 } },
279 { /* 45 */ 1, { 10, 0 } },
280 { /* 46 */ 1, { 10, 5 } },
281 { /* 47 */ 1, { 4, 10 } },
282 { /* 48 */ 1, { 6, 8 } },
283 { /* 49 */ 1, { 2, 12 } },
284 { /* 50 */ 1, { 9, 6 } },
285 { /* 51 */ 1, { 9, 7 } },
286 { /* 52 */ 1, { 4, 11 } },
287 { /* 53 */ 1, { 11, 0 } },
288 { /* 54 */ 1, { 6, 9 } },
289 { /* 55 */ 1, { 3, 11 } },
290 { /* 56 */ 1, { 5, 10 } },
291 { /* 57 */ 0, { 20, 21 } },
292 { /* 58 */ 0, { 21, 22 } },
293 { /* 59 */ 0, { 22, 23 } },
294 { /* 60 */ 0, { 23, 24 } },
295 { /* 61 */ 0, { 24, 25 } },
296 { /* 62 */ 0, { 25, 26 } },
297 { /* 63 */ 0, { 26, 27 } },
298 { /* 64 */ 0, { 27, 28 } },
299 { /* 65 */ 0, { 28, 29 } },
300 { /* 66 */ 0, { 29, 30 } },
301 { /* 67 */ 0, { 30, 31 } },
302 { /* 68 */ 0, { 31, 32 } },
303 { /* 69 */ 0, { 32, 33 } },
304 { /* 70 */ 0, { 33, 34 } },
305 { /* 71 */ 0, { 34, 35 } },
306 { /* 72 */ 0, { 35, 36 } },
307 { /* 73 */ 0, { 36, 37 } },
308 { /* 74 */ 0, { 37, 38 } },
309 { /* 75 */ 0, { 38, 39 } },
310 { /* 76 */ 0, { 39, 40 } },
311 { /* 77 */ 1, { 8, 8 } },
312 { /* 78 */ 1, { 7, 8 } },
313 { /* 79 */ 1, { 12, 5 } },
314 { /* 80 */ 1, { 3, 12 } },
315 { /* 81 */ 1, { 11, 5 } },
316 { /* 82 */ 1, { 7, 7 } },
317 { /* 83 */ 1, { 12, 4 } },
318 { /* 84 */ 1, { 11, 6 } },
319 { /* 85 */ 1, { 10, 6 } },
320 { /* 86 */ 1, { 4, 12 } },
321 { /* 87 */ 1, { 7, 9 } },
322 { /* 88 */ 1, { 5, 11 } },
323 { /* 89 */ 1, { 0, 11 } },
324 { /* 90 */ 1, { 12, 6 } },
325 { /* 91 */ 1, { 6, 10 } },
326 { /* 92 */ 1, { 12, 0 } },
327 { /* 93 */ 1, { 10, 7 } },
328 { /* 94 */ 1, { 5, 12 } },
329 { /* 95 */ 1, { 7, 10 } },
330 { /* 96 */ 1, { 9, 8 } },
331 { /* 97 */ 1, { 0, 12 } },
332 { /* 98 */ 1, { 11, 7 } },
333 { /* 99 */ 1, { 8, 9 } },
334 { /* 00 */ 1, { 9, 9 } },
335 { /* 01 */ 1, { 10, 8 } },
336 { /* 02 */ 1, { 7, 11 } },
337 { /* 03 */ 1, { 12, 7 } },
338 { /* 04 */ 1, { 6, 11 } },
339 { /* 05 */ 1, { 8, 11 } },
340 { /* 06 */ 1, { 11, 8 } },
341 { /* 07 */ 1, { 7, 12 } },
342 { /* 08 */ 1, { 6, 12 } },
343 { /* 09 */ 0, { 8, 9 } },
344 { /* 10 */ 0, { 9, 10 } },
345 { /* 11 */ 0, { 10, 11 } },
346 { /* 12 */ 0, { 11, 12 } },
347 { /* 13 */ 0, { 12, 13 } },
348 { /* 14 */ 0, { 13, 14 } },
349 { /* 15 */ 0, { 14, 15 } },
350 { /* 16 */ 0, { 15, 16 } },
351 { /* 17 */ 1, { 8, 10 } },
352 { /* 18 */ 1, { 10, 9 } },
353 { /* 19 */ 1, { 8, 12 } },
354 { /* 20 */ 1, { 9, 10 } },
355 { /* 21 */ 1, { 9, 11 } },
356 { /* 22 */ 1, { 9, 12 } },
357 { /* 23 */ 1, { 10, 11 } },
358 { /* 24 */ 1, { 12, 9 } },
359 { /* 25 */ 1, { 10, 10 } },
360 { /* 26 */ 1, { 11, 9 } },
361 { /* 27 */ 1, { 12, 8 } },
362 { /* 28 */ 1, { 11, 10 } },
363 { /* 29 */ 1, { 12, 10 } },
364 { /* 30 */ 1, { 12, 11 } },
365 { /* 31 */ 0, { 2, 3 } },
366 { /* 32 */ 0, { 3, 4 } },
367 { /* 33 */ 1, { 10, 12 } },
368 { /* 34 */ 1, { 11, 11 } },
369 { /* 35 */ 1, { 11, 12 } },
370 { /* 36 */ 1, { 12, 12 } }
371 };
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: hcb_sf.h,v 1.7 2007/11/01 12:34:11 menno Exp $
28 **/
29
30 /* Binary search huffman table HCB_SF */
31
32
33 static uint8_t hcb_sf[][2] = {
34 { /* 0 */ 1, 2 },
35 { /* 1 */ 60, 0 },
36 { /* 2 */ 1, 2 },
37 { /* 3 */ 2, 3 },
38 { /* 4 */ 3, 4 },
39 { /* 5 */ 59, 0 },
40 { /* 6 */ 3, 4 },
41 { /* 7 */ 4, 5 },
42 { /* 8 */ 5, 6 },
43 { /* 9 */ 61, 0 },
44 { /* 10 */ 58, 0 },
45 { /* 11 */ 62, 0 },
46 { /* 12 */ 3, 4 },
47 { /* 13 */ 4, 5 },
48 { /* 14 */ 5, 6 },
49 { /* 15 */ 57, 0 },
50 { /* 16 */ 63, 0 },
51 { /* 17 */ 4, 5 },
52 { /* 18 */ 5, 6 },
53 { /* 19 */ 6, 7 },
54 { /* 20 */ 7, 8 },
55 { /* 21 */ 56, 0 },
56 { /* 22 */ 64, 0 },
57 { /* 23 */ 55, 0 },
58 { /* 24 */ 65, 0 },
59 { /* 25 */ 4, 5 },
60 { /* 26 */ 5, 6 },
61 { /* 27 */ 6, 7 },
62 { /* 28 */ 7, 8 },
63 { /* 29 */ 66, 0 },
64 { /* 30 */ 54, 0 },
65 { /* 31 */ 67, 0 },
66 { /* 32 */ 5, 6 },
67 { /* 33 */ 6, 7 },
68 { /* 34 */ 7, 8 },
69 { /* 35 */ 8, 9 },
70 { /* 36 */ 9, 10 },
71 { /* 37 */ 53, 0 },
72 { /* 38 */ 68, 0 },
73 { /* 39 */ 52, 0 },
74 { /* 40 */ 69, 0 },
75 { /* 41 */ 51, 0 },
76 { /* 42 */ 5, 6 },
77 { /* 43 */ 6, 7 },
78 { /* 44 */ 7, 8 },
79 { /* 45 */ 8, 9 },
80 { /* 46 */ 9, 10 },
81 { /* 47 */ 70, 0 },
82 { /* 48 */ 50, 0 },
83 { /* 49 */ 49, 0 },
84 { /* 50 */ 71, 0 },
85 { /* 51 */ 6, 7 },
86 { /* 52 */ 7, 8 },
87 { /* 53 */ 8, 9 },
88 { /* 54 */ 9, 10 },
89 { /* 55 */ 10, 11 },
90 { /* 56 */ 11, 12 },
91 { /* 57 */ 72, 0 },
92 { /* 58 */ 48, 0 },
93 { /* 59 */ 73, 0 },
94 { /* 60 */ 47, 0 },
95 { /* 61 */ 74, 0 },
96 { /* 62 */ 46, 0 },
97 { /* 63 */ 6, 7 },
98 { /* 64 */ 7, 8 },
99 { /* 65 */ 8, 9 },
100 { /* 66 */ 9, 10 },
101 { /* 67 */ 10, 11 },
102 { /* 68 */ 11, 12 },
103 { /* 69 */ 76, 0 },
104 { /* 70 */ 75, 0 },
105 { /* 71 */ 77, 0 },
106 { /* 72 */ 78, 0 },
107 { /* 73 */ 45, 0 },
108 { /* 74 */ 43, 0 },
109 { /* 75 */ 6, 7 },
110 { /* 76 */ 7, 8 },
111 { /* 77 */ 8, 9 },
112 { /* 78 */ 9, 10 },
113 { /* 79 */ 10, 11 },
114 { /* 80 */ 11, 12 },
115 { /* 81 */ 44, 0 },
116 { /* 82 */ 79, 0 },
117 { /* 83 */ 42, 0 },
118 { /* 84 */ 41, 0 },
119 { /* 85 */ 80, 0 },
120 { /* 86 */ 40, 0 },
121 { /* 87 */ 6, 7 },
122 { /* 88 */ 7, 8 },
123 { /* 89 */ 8, 9 },
124 { /* 90 */ 9, 10 },
125 { /* 91 */ 10, 11 },
126 { /* 92 */ 11, 12 },
127 { /* 93 */ 81, 0 },
128 { /* 94 */ 39, 0 },
129 { /* 95 */ 82, 0 },
130 { /* 96 */ 38, 0 },
131 { /* 97 */ 83, 0 },
132 { /* 98 */ 7, 8 },
133 { /* 99 */ 8, 9 },
134 { /* 00 */ 9, 10 },
135 { /* 01 */ 10, 11 },
136 { /* 02 */ 11, 12 },
137 { /* 03 */ 12, 13 },
138 { /* 04 */ 13, 14 },
139 { /* 05 */ 37, 0 },
140 { /* 06 */ 35, 0 },
141 { /* 07 */ 85, 0 },
142 { /* 08 */ 33, 0 },
143 { /* 09 */ 36, 0 },
144 { /* 10 */ 34, 0 },
145 { /* 11 */ 84, 0 },
146 { /* 12 */ 32, 0 },
147 { /* 13 */ 6, 7 },
148 { /* 14 */ 7, 8 },
149 { /* 15 */ 8, 9 },
150 { /* 16 */ 9, 10 },
151 { /* 17 */ 10, 11 },
152 { /* 18 */ 11, 12 },
153 { /* 19 */ 87, 0 },
154 { /* 20 */ 89, 0 },
155 { /* 21 */ 30, 0 },
156 { /* 22 */ 31, 0 },
157 { /* 23 */ 8, 9 },
158 { /* 24 */ 9, 10 },
159 { /* 25 */ 10, 11 },
160 { /* 26 */ 11, 12 },
161 { /* 27 */ 12, 13 },
162 { /* 28 */ 13, 14 },
163 { /* 29 */ 14, 15 },
164 { /* 30 */ 15, 16 },
165 { /* 31 */ 86, 0 },
166 { /* 32 */ 29, 0 },
167 { /* 33 */ 26, 0 },
168 { /* 34 */ 27, 0 },
169 { /* 35 */ 28, 0 },
170 { /* 36 */ 24, 0 },
171 { /* 37 */ 88, 0 },
172 { /* 38 */ 9, 10 },
173 { /* 39 */ 10, 11 },
174 { /* 40 */ 11, 12 },
175 { /* 41 */ 12, 13 },
176 { /* 42 */ 13, 14 },
177 { /* 43 */ 14, 15 },
178 { /* 44 */ 15, 16 },
179 { /* 45 */ 16, 17 },
180 { /* 46 */ 17, 18 },
181 { /* 47 */ 25, 0 },
182 { /* 48 */ 22, 0 },
183 { /* 49 */ 23, 0 },
184 { /* 50 */ 15, 16 },
185 { /* 51 */ 16, 17 },
186 { /* 52 */ 17, 18 },
187 { /* 53 */ 18, 19 },
188 { /* 54 */ 19, 20 },
189 { /* 55 */ 20, 21 },
190 { /* 56 */ 21, 22 },
191 { /* 57 */ 22, 23 },
192 { /* 58 */ 23, 24 },
193 { /* 59 */ 24, 25 },
194 { /* 60 */ 25, 26 },
195 { /* 61 */ 26, 27 },
196 { /* 62 */ 27, 28 },
197 { /* 63 */ 28, 29 },
198 { /* 64 */ 29, 30 },
199 { /* 65 */ 90, 0 },
200 { /* 66 */ 21, 0 },
201 { /* 67 */ 19, 0 },
202 { /* 68 */ 3, 0 },
203 { /* 69 */ 1, 0 },
204 { /* 70 */ 2, 0 },
205 { /* 71 */ 0, 0 },
206 { /* 72 */ 23, 24 },
207 { /* 73 */ 24, 25 },
208 { /* 74 */ 25, 26 },
209 { /* 75 */ 26, 27 },
210 { /* 76 */ 27, 28 },
211 { /* 77 */ 28, 29 },
212 { /* 78 */ 29, 30 },
213 { /* 79 */ 30, 31 },
214 { /* 80 */ 31, 32 },
215 { /* 81 */ 32, 33 },
216 { /* 82 */ 33, 34 },
217 { /* 83 */ 34, 35 },
218 { /* 84 */ 35, 36 },
219 { /* 85 */ 36, 37 },
220 { /* 86 */ 37, 38 },
221 { /* 87 */ 38, 39 },
222 { /* 88 */ 39, 40 },
223 { /* 89 */ 40, 41 },
224 { /* 90 */ 41, 42 },
225 { /* 91 */ 42, 43 },
226 { /* 92 */ 43, 44 },
227 { /* 93 */ 44, 45 },
228 { /* 94 */ 45, 46 },
229 { /* 95 */ 98, 0 },
230 { /* 96 */ 99, 0 },
231 { /* 97 */ 100, 0 },
232 { /* 98 */ 101, 0 },
233 { /* 99 */ 102, 0 },
234 { /* 00 */ 117, 0 },
235 { /* 01 */ 97, 0 },
236 { /* 02 */ 91, 0 },
237 { /* 03 */ 92, 0 },
238 { /* 04 */ 93, 0 },
239 { /* 05 */ 94, 0 },
240 { /* 06 */ 95, 0 },
241 { /* 07 */ 96, 0 },
242 { /* 08 */ 104, 0 },
243 { /* 09 */ 111, 0 },
244 { /* 10 */ 112, 0 },
245 { /* 11 */ 113, 0 },
246 { /* 12 */ 114, 0 },
247 { /* 13 */ 115, 0 },
248 { /* 14 */ 116, 0 },
249 { /* 15 */ 110, 0 },
250 { /* 16 */ 105, 0 },
251 { /* 17 */ 106, 0 },
252 { /* 18 */ 107, 0 },
253 { /* 19 */ 108, 0 },
254 { /* 20 */ 109, 0 },
255 { /* 21 */ 118, 0 },
256 { /* 22 */ 6, 0 },
257 { /* 23 */ 8, 0 },
258 { /* 24 */ 9, 0 },
259 { /* 25 */ 10, 0 },
260 { /* 26 */ 5, 0 },
261 { /* 27 */ 103, 0 },
262 { /* 28 */ 120, 0 },
263 { /* 29 */ 119, 0 },
264 { /* 30 */ 4, 0 },
265 { /* 31 */ 7, 0 },
266 { /* 32 */ 15, 0 },
267 { /* 33 */ 16, 0 },
268 { /* 34 */ 18, 0 },
269 { /* 35 */ 20, 0 },
270 { /* 36 */ 17, 0 },
271 { /* 37 */ 11, 0 },
272 { /* 38 */ 12, 0 },
273 { /* 39 */ 14, 0 },
274 { /* 40 */ 13, 0 }
275 };
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: common.c,v 1.26 2007/11/01 12:33:30 menno Exp $
28 **/
29
30 /* just some common functions that could be used anywhere */
31
32 #include "common.h"
33 #include "structs.h"
34
35 #include <stdlib.h>
36 #include "syntax.h"
37
38
39 /* Returns the sample rate index based on the samplerate */
40 uint8_t get_sr_index(const uint32_t samplerate)
41 {
42 if (92017 <= samplerate) return 0;
43 if (75132 <= samplerate) return 1;
44 if (55426 <= samplerate) return 2;
45 if (46009 <= samplerate) return 3;
46 if (37566 <= samplerate) return 4;
47 if (27713 <= samplerate) return 5;
48 if (23004 <= samplerate) return 6;
49 if (18783 <= samplerate) return 7;
50 if (13856 <= samplerate) return 8;
51 if (11502 <= samplerate) return 9;
52 if (9391 <= samplerate) return 10;
53 if (16428320 <= samplerate) return 11;
54
55 return 11;
56 }
57
58 /* Returns the sample rate based on the sample rate index */
59 uint32_t get_sample_rate(const uint8_t sr_index)
60 {
61 static const uint32_t sample_rates[] =
62 {
63 96000, 88200, 64000, 48000, 44100, 32000,
64 24000, 22050, 16000, 12000, 11025, 8000
65 };
66
67 if (sr_index < 12)
68 return sample_rates[sr_index];
69
70 return 0;
71 }
72
73 uint8_t max_pred_sfb(const uint8_t sr_index)
74 {
75 static const uint8_t pred_sfb_max[] =
76 {
77 33, 33, 38, 40, 40, 40, 41, 41, 37, 37, 37, 34
78 };
79
80
81 if (sr_index < 12)
82 return pred_sfb_max[sr_index];
83
84 return 0;
85 }
86
87 uint8_t max_tns_sfb(const uint8_t sr_index, const uint8_t object_type,
88 const uint8_t is_short)
89 {
90 /* entry for each sampling rate
91 * 1 Main/LC long window
92 * 2 Main/LC short window
93 * 3 SSR long window
94 * 4 SSR short window
95 */
96 static const uint8_t tns_sbf_max[][4] =
97 {
98 {31, 9, 28, 7}, /* 96000 */
99 {31, 9, 28, 7}, /* 88200 */
100 {34, 10, 27, 7}, /* 64000 */
101 {40, 14, 26, 6}, /* 48000 */
102 {42, 14, 26, 6}, /* 44100 */
103 {51, 14, 26, 6}, /* 32000 */
104 {46, 14, 29, 7}, /* 24000 */
105 {46, 14, 29, 7}, /* 22050 */
106 {42, 14, 23, 8}, /* 16000 */
107 {42, 14, 23, 8}, /* 12000 */
108 {42, 14, 23, 8}, /* 11025 */
109 {39, 14, 19, 7}, /* 8000 */
110 {39, 14, 19, 7}, /* 7350 */
111 {0,0,0,0},
112 {0,0,0,0},
113 {0,0,0,0}
114 };
115 uint8_t i = 0;
116
117 if (is_short) i++;
118 if (object_type == SSR) i += 2;
119
120 return tns_sbf_max[sr_index][i];
121 }
122
123 /* Returns 0 if an object type is decodable, otherwise returns -1 */
124 int8_t can_decode_ot(const uint8_t object_type)
125 {
126 switch (object_type)
127 {
128 case LC:
129 return 0;
130 case MAIN:
131 #ifdef MAIN_DEC
132 return 0;
133 #else
134 return -1;
135 #endif
136 case SSR:
137 #ifdef SSR_DEC
138 return 0;
139 #else
140 return -1;
141 #endif
142 case LTP:
143 #ifdef LTP_DEC
144 return 0;
145 #else
146 return -1;
147 #endif
148
149 /* ER object types */
150 #ifdef ERROR_RESILIENCE
151 case ER_LC:
152 #ifdef DRM
153 case DRM_ER_LC:
154 #endif
155 return 0;
156 case ER_LTP:
157 #ifdef LTP_DEC
158 return 0;
159 #else
160 return -1;
161 #endif
162 case LD:
163 #ifdef LD_DEC
164 return 0;
165 #else
166 return -1;
167 #endif
168 #endif
169 }
170
171 return -1;
172 }
173
174 void *faad_malloc(size_t size)
175 {
176 #if 0 // defined(_WIN32) && !defined(_WIN32_WCE)
177 return _aligned_malloc(size, 16);
178 #else // #ifdef 0
179 return malloc(size);
180 #endif // #ifdef 0
181 }
182
183 /* common free function */
184 void faad_free(void *b)
185 {
186 #if 0 // defined(_WIN32) && !defined(_WIN32_WCE)
187 _aligned_free(b);
188 #else
189 free(b);
190 }
191 #endif
192
193 static const uint8_t Parity [256] = { // parity
194 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
195 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
196 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
197 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
198 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
199 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
200 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
201 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0
202 };
203
204 static uint32_t __r1 = 1;
205 static uint32_t __r2 = 1;
206
207
208 /*
209 * This is a simple random number generator with good quality for audio purposes.
210 * It consists of two polycounters with opposite rotation direction and different
211 * periods. The periods are coprime, so the total period is the product of both.
212 *
213 * -------------------------------------------------------------------------------------------------
214 * +-> |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0|
215 * | -------------------------------------------------------------------------------------------------
216 * | | | | | | |
217 * | +--+--+--+-XOR-+--------+
218 * | |
219 * +--------------------------------------------------------------------------------------+
220 *
221 * -------------------------------------------------------------------------------------------------
222 * |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0| <-+
223 * ------------------------------------------------------------------------------------------------- |
224 * | | | | |
225 * +--+----XOR----+--+ |
226 * | |
227 * +----------------------------------------------------------------------------------------+
228 *
229 *
230 * The first has an period of 3*5*17*257*65537, the second of 7*47*73*178481,
231 * which gives a period of 18.410.713.077.675.721.215. The result is the
232 * XORed values of both generators.
233 */
234 uint32_t ne_rng(uint32_t *__r1, uint32_t *__r2)
235 {
236 uint32_t t1, t2, t3, t4;
237
238 t3 = t1 = *__r1; t4 = t2 = *__r2; // Parity calculation is done via table lookup, this is also available
239 t1 &= 0xF5; t2 >>= 25; // on CPUs without parity, can be implemented in C and avoid unpredictable
240 t1 = Parity [t1]; t2 &= 0x63; // jumps and slow rotate through the carry flag operations.
241 t1 <<= 31; t2 = Parity [t2];
242
243 return (*__r1 = (t3 >> 1) | t1 ) ^ (*__r2 = (t4 + t4) | t2 );
244 }
245
246 uint32_t ones32(uint32_t x)
247 {
248 x -= ((x >> 1) & 0x55555555);
249 x = (((x >> 2) & 0x33333333) + (x & 0x33333333));
250 x = (((x >> 4) + x) & 0x0f0f0f0f);
251 x += (x >> 8);
252 x += (x >> 16);
253
254 return (x & 0x0000003f);
255 }
256
257 uint32_t floor_log2(uint32_t x)
258 {
259 #if 1
260 x |= (x >> 1);
261 x |= (x >> 2);
262 x |= (x >> 4);
263 x |= (x >> 8);
264 x |= (x >> 16);
265
266 return (ones32(x) - 1);
267 #else
268 uint32_t count = 0;
269
270 while (x >>= 1)
271 count++;
272
273 return count;
274 #endif
275 }
276
277 /* returns position of first bit that is not 0 from msb,
278 * starting count at lsb */
279 uint32_t wl_min_lzc(uint32_t x)
280 {
281 #if 1
282 x |= (x >> 1);
283 x |= (x >> 2);
284 x |= (x >> 4);
285 x |= (x >> 8);
286 x |= (x >> 16);
287
288 return (ones32(x));
289 #else
290 uint32_t count = 0;
291
292 while (x >>= 1)
293 count++;
294
295 return (count + 1);
296 #endif
297 }
298
299 #ifdef FIXED_POINT
300
301 #define TABLE_BITS 6
302 /* just take the maximum number of bits for interpolation */
303 #define INTERP_BITS (REAL_BITS-TABLE_BITS)
304
305 static const real_t pow2_tab[] = {
306 REAL_CONST(1.000000000000000), REAL_CONST(1.010889286051701), REAL_CONST(1.021897148654117),
307 REAL_CONST(1.033024879021228), REAL_CONST(1.044273782427414), REAL_CONST(1.055645178360557),
308 REAL_CONST(1.067140400676824), REAL_CONST(1.078760797757120), REAL_CONST(1.090507732665258),
309 REAL_CONST(1.102382583307841), REAL_CONST(1.114386742595892), REAL_CONST(1.126521618608242),
310 REAL_CONST(1.138788634756692), REAL_CONST(1.151189229952983), REAL_CONST(1.163724858777578),
311 REAL_CONST(1.176396991650281), REAL_CONST(1.189207115002721), REAL_CONST(1.202156731452703),
312 REAL_CONST(1.215247359980469), REAL_CONST(1.228480536106870), REAL_CONST(1.241857812073484),
313 REAL_CONST(1.255380757024691), REAL_CONST(1.269050957191733), REAL_CONST(1.282870016078778),
314 REAL_CONST(1.296839554651010), REAL_CONST(1.310961211524764), REAL_CONST(1.325236643159741),
315 REAL_CONST(1.339667524053303), REAL_CONST(1.354255546936893), REAL_CONST(1.369002422974591),
316 REAL_CONST(1.383909881963832), REAL_CONST(1.398979672538311), REAL_CONST(1.414213562373095),
317 REAL_CONST(1.429613338391970), REAL_CONST(1.445180806977047), REAL_CONST(1.460917794180647),
318 REAL_CONST(1.476826145939499), REAL_CONST(1.492907728291265), REAL_CONST(1.509164427593423),
319 REAL_CONST(1.525598150744538), REAL_CONST(1.542210825407941), REAL_CONST(1.559004400237837),
320 REAL_CONST(1.575980845107887), REAL_CONST(1.593142151342267), REAL_CONST(1.610490331949254),
321 REAL_CONST(1.628027421857348), REAL_CONST(1.645755478153965), REAL_CONST(1.663676580326736),
322 REAL_CONST(1.681792830507429), REAL_CONST(1.700106353718524), REAL_CONST(1.718619298122478),
323 REAL_CONST(1.737333835273706), REAL_CONST(1.756252160373300), REAL_CONST(1.775376492526521),
324 REAL_CONST(1.794709075003107), REAL_CONST(1.814252175500399), REAL_CONST(1.834008086409342),
325 REAL_CONST(1.853979125083386), REAL_CONST(1.874167634110300), REAL_CONST(1.894575981586966),
326 REAL_CONST(1.915206561397147), REAL_CONST(1.936061793492294), REAL_CONST(1.957144124175400),
327 REAL_CONST(1.978456026387951), REAL_CONST(2.000000000000000)
328 };
329
330 static const real_t log2_tab[] = {
331 REAL_CONST(0.000000000000000), REAL_CONST(0.022367813028455), REAL_CONST(0.044394119358453),
332 REAL_CONST(0.066089190457772), REAL_CONST(0.087462841250339), REAL_CONST(0.108524456778169),
333 REAL_CONST(0.129283016944966), REAL_CONST(0.149747119504682), REAL_CONST(0.169925001442312),
334 REAL_CONST(0.189824558880017), REAL_CONST(0.209453365628950), REAL_CONST(0.228818690495881),
335 REAL_CONST(0.247927513443585), REAL_CONST(0.266786540694901), REAL_CONST(0.285402218862248),
336 REAL_CONST(0.303780748177103), REAL_CONST(0.321928094887362), REAL_CONST(0.339850002884625),
337 REAL_CONST(0.357552004618084), REAL_CONST(0.375039431346925), REAL_CONST(0.392317422778760),
338 REAL_CONST(0.409390936137702), REAL_CONST(0.426264754702098), REAL_CONST(0.442943495848728),
339 REAL_CONST(0.459431618637297), REAL_CONST(0.475733430966398), REAL_CONST(0.491853096329675),
340 REAL_CONST(0.507794640198696), REAL_CONST(0.523561956057013), REAL_CONST(0.539158811108031),
341 REAL_CONST(0.554588851677637), REAL_CONST(0.569855608330948), REAL_CONST(0.584962500721156),
342 REAL_CONST(0.599912842187128), REAL_CONST(0.614709844115208), REAL_CONST(0.629356620079610),
343 REAL_CONST(0.643856189774725), REAL_CONST(0.658211482751795), REAL_CONST(0.672425341971496),
344 REAL_CONST(0.686500527183218), REAL_CONST(0.700439718141092), REAL_CONST(0.714245517666123),
345 REAL_CONST(0.727920454563199), REAL_CONST(0.741466986401147), REAL_CONST(0.754887502163469),
346 REAL_CONST(0.768184324776926), REAL_CONST(0.781359713524660), REAL_CONST(0.794415866350106),
347 REAL_CONST(0.807354922057604), REAL_CONST(0.820178962415188), REAL_CONST(0.832890014164742),
348 REAL_CONST(0.845490050944375), REAL_CONST(0.857980995127572), REAL_CONST(0.870364719583405),
349 REAL_CONST(0.882643049361841), REAL_CONST(0.894817763307943), REAL_CONST(0.906890595608519),
350 REAL_CONST(0.918863237274595), REAL_CONST(0.930737337562886), REAL_CONST(0.942514505339240),
351 REAL_CONST(0.954196310386875), REAL_CONST(0.965784284662087), REAL_CONST(0.977279923499917),
352 REAL_CONST(0.988684686772166), REAL_CONST(1.000000000000000)
353 };
354
355 real_t pow2_fix(real_t val)
356 {
357 uint32_t x1, x2;
358 uint32_t errcorr;
359 uint32_t index_frac;
360 real_t retval;
361 int32_t whole = (val >> REAL_BITS);
362
363 /* rest = [0..1] */
364 int32_t rest = val - (whole << REAL_BITS);
365
366 /* index into pow2_tab */
367 int32_t index = rest >> (REAL_BITS-TABLE_BITS);
368
369
370 if (val == 0)
371 return (1<<REAL_BITS);
372
373 /* leave INTERP_BITS bits */
374 index_frac = rest >> (REAL_BITS-TABLE_BITS-INTERP_BITS);
375 index_frac = index_frac & ((1<<INTERP_BITS)-1);
376
377 if (whole > 0)
378 {
379 retval = 1 << whole;
380 } else {
381 retval = REAL_CONST(1) >> -whole;
382 }
383
384 x1 = pow2_tab[index & ((1<<TABLE_BITS)-1)];
385 x2 = pow2_tab[(index & ((1<<TABLE_BITS)-1)) + 1];
386 errcorr = ( (index_frac*(x2-x1))) >> INTERP_BITS;
387
388 if (whole > 0)
389 {
390 retval = retval * (errcorr + x1);
391 } else {
392 retval = MUL_R(retval, (errcorr + x1));
393 }
394
395 return retval;
396 }
397
398 int32_t pow2_int(real_t val)
399 {
400 uint32_t x1, x2;
401 uint32_t errcorr;
402 uint32_t index_frac;
403 real_t retval;
404 int32_t whole = (val >> REAL_BITS);
405
406 /* rest = [0..1] */
407 int32_t rest = val - (whole << REAL_BITS);
408
409 /* index into pow2_tab */
410 int32_t index = rest >> (REAL_BITS-TABLE_BITS);
411
412
413 if (val == 0)
414 return 1;
415
416 /* leave INTERP_BITS bits */
417 index_frac = rest >> (REAL_BITS-TABLE_BITS-INTERP_BITS);
418 index_frac = index_frac & ((1<<INTERP_BITS)-1);
419
420 if (whole > 0)
421 retval = 1 << whole;
422 else
423 retval = 0;
424
425 x1 = pow2_tab[index & ((1<<TABLE_BITS)-1)];
426 x2 = pow2_tab[(index & ((1<<TABLE_BITS)-1)) + 1];
427 errcorr = ( (index_frac*(x2-x1))) >> INTERP_BITS;
428
429 retval = MUL_R(retval, (errcorr + x1));
430
431 return retval;
432 }
433
434 /* ld(x) = ld(x*y/y) = ld(x/y) + ld(y), with y=2^N and [1 <= (x/y) < 2] */
435 int32_t log2_int(uint32_t val)
436 {
437 uint32_t frac;
438 uint32_t whole = (val);
439 int32_t exp = 0;
440 uint32_t index;
441 uint32_t index_frac;
442 uint32_t x1, x2;
443 uint32_t errcorr;
444
445 /* error */
446 if (val == 0)
447 return -10000;
448
449 exp = floor_log2(val);
450 exp -= REAL_BITS;
451
452 /* frac = [1..2] */
453 if (exp >= 0)
454 frac = val >> exp;
455 else
456 frac = val << -exp;
457
458 /* index in the log2 table */
459 index = frac >> (REAL_BITS-TABLE_BITS);
460
461 /* leftover part for linear interpolation */
462 index_frac = frac & ((1<<(REAL_BITS-TABLE_BITS))-1);
463
464 /* leave INTERP_BITS bits */
465 index_frac = index_frac >> (REAL_BITS-TABLE_BITS-INTERP_BITS);
466
467 x1 = log2_tab[index & ((1<<TABLE_BITS)-1)];
468 x2 = log2_tab[(index & ((1<<TABLE_BITS)-1)) + 1];
469
470 /* linear interpolation */
471 /* retval = exp + ((index_frac)*x2 + (1-index_frac)*x1) */
472
473 errcorr = (index_frac * (x2-x1)) >> INTERP_BITS;
474
475 return ((exp+REAL_BITS) << REAL_BITS) + errcorr + x1;
476 }
477
478 /* ld(x) = ld(x*y/y) = ld(x/y) + ld(y), with y=2^N and [1 <= (x/y) < 2] */
479 real_t log2_fix(uint32_t val)
480 {
481 uint32_t frac;
482 uint32_t whole = (val >> REAL_BITS);
483 int8_t exp = 0;
484 uint32_t index;
485 uint32_t index_frac;
486 uint32_t x1, x2;
487 uint32_t errcorr;
488
489 /* error */
490 if (val == 0)
491 return -100000;
492
493 exp = floor_log2(val);
494 exp -= REAL_BITS;
495
496 /* frac = [1..2] */
497 if (exp >= 0)
498 frac = val >> exp;
499 else
500 frac = val << -exp;
501
502 /* index in the log2 table */
503 index = frac >> (REAL_BITS-TABLE_BITS);
504
505 /* leftover part for linear interpolation */
506 index_frac = frac & ((1<<(REAL_BITS-TABLE_BITS))-1);
507
508 /* leave INTERP_BITS bits */
509 index_frac = index_frac >> (REAL_BITS-TABLE_BITS-INTERP_BITS);
510
511 x1 = log2_tab[index & ((1<<TABLE_BITS)-1)];
512 x2 = log2_tab[(index & ((1<<TABLE_BITS)-1)) + 1];
513
514 /* linear interpolation */
515 /* retval = exp + ((index_frac)*x2 + (1-index_frac)*x1) */
516
517 errcorr = (index_frac * (x2-x1)) >> INTERP_BITS;
518
519 return (exp << REAL_BITS) + errcorr + x1;
520 }
521 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: common.h,v 1.72 2007/11/01 12:33:30 menno Exp $
28 **/
29
30 #ifndef __COMMON_H__
31 #define __COMMON_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #ifdef HAVE_CONFIG_H
38 # include "../config.h"
39 #endif
40
41 #if 1
42 #define INLINE __inline
43 #else
44 #define INLINE inline
45 #endif
46
47 #if 0 //defined(_WIN32) && !defined(_WIN32_WCE)
48 #define ALIGN __declspec(align(16))
49 #else
50 #define ALIGN
51 #endif
52
53 #ifndef max
54 #define max(a, b) (((a) > (b)) ? (a) : (b))
55 #endif
56 #ifndef min
57 #define min(a, b) (((a) < (b)) ? (a) : (b))
58 #endif
59
60 /* COMPILE TIME DEFINITIONS */
61
62 /* use double precision */
63 /* #define USE_DOUBLE_PRECISION */
64 /* use fixed point reals */
65 //#define FIXED_POINT
66 //#define BIG_IQ_TABLE
67
68 /* Use if target platform has address generators with autoincrement */
69 //#define PREFER_POINTERS
70
71 #ifdef _WIN32_WCE
72 #define FIXED_POINT
73 #endif
74
75 #ifdef __BFIN__
76 #define FIXED_POINT
77 #endif
78
79 #define ERROR_RESILIENCE
80
81
82 /* Allow decoding of MAIN profile AAC */
83 #define MAIN_DEC
84 /* Allow decoding of SSR profile AAC */
85 //#define SSR_DEC
86 /* Allow decoding of LTP profile AAC */
87 #define LTP_DEC
88 /* Allow decoding of LD profile AAC */
89 #define LD_DEC
90 /* Allow decoding of Digital Radio Mondiale (DRM) */
91 //#define DRM
92 //#define DRM_PS
93
94 /* LD can't do without LTP */
95 #ifdef LD_DEC
96 #ifndef ERROR_RESILIENCE
97 #define ERROR_RESILIENCE
98 #endif
99 #ifndef LTP_DEC
100 #define LTP_DEC
101 #endif
102 #endif
103
104 #define ALLOW_SMALL_FRAMELENGTH
105
106
107 // Define LC_ONLY_DECODER if you want a pure AAC LC decoder (independant of SBR_DEC and PS_DEC)
108 //#define LC_ONLY_DECODER
109 #ifdef LC_ONLY_DECODER
110 #undef LD_DEC
111 #undef LTP_DEC
112 #undef MAIN_DEC
113 #undef SSR_DEC
114 #undef DRM
115 #undef ALLOW_SMALL_FRAMELENGTH
116 #undef ERROR_RESILIENCE
117 #endif
118
119 #define SBR_DEC
120 //#define SBR_LOW_POWER
121 #define PS_DEC
122
123 #ifdef SBR_LOW_POWER
124 #undef PS_DEC
125 #endif
126
127 /* FIXED POINT: No MAIN decoding */
128 #ifdef FIXED_POINT
129 # ifdef MAIN_DEC
130 # undef MAIN_DEC
131 # endif
132 #endif // FIXED_POINT
133
134 #ifdef DRM
135 # ifndef ALLOW_SMALL_FRAMELENGTH
136 # define ALLOW_SMALL_FRAMELENGTH
137 # endif
138 # undef LD_DEC
139 # undef LTP_DEC
140 # undef MAIN_DEC
141 # undef SSR_DEC
142 #endif
143
144
145 #ifdef FIXED_POINT
146 #define DIV_R(A, B) (((int64_t)A << REAL_BITS)/B)
147 #define DIV_C(A, B) (((int64_t)A << COEF_BITS)/B)
148 #else
149 #define DIV_R(A, B) ((A)/(B))
150 #define DIV_C(A, B) ((A)/(B))
151 #endif
152
153 #ifndef SBR_LOW_POWER
154 #define qmf_t complex_t
155 #define QMF_RE(A) RE(A)
156 #define QMF_IM(A) IM(A)
157 #else
158 #define qmf_t real_t
159 #define QMF_RE(A) (A)
160 #define QMF_IM(A)
161 #endif
162
163
164 /* END COMPILE TIME DEFINITIONS */
165
166 #if defined(_WIN32) && !defined(__MINGW32__)
167
168 #include <stdlib.h>
169
170 typedef unsigned __int64 uint64_t;
171 typedef unsigned __int32 uint32_t;
172 typedef unsigned __int16 uint16_t;
173 typedef unsigned __int8 uint8_t;
174 typedef __int64 int64_t;
175 typedef __int32 int32_t;
176 typedef __int16 int16_t;
177 typedef __int8 int8_t;
178 typedef float float32_t;
179
180
181 #else
182
183 #include <stdio.h>
184 #if HAVE_SYS_TYPES_H
185 # include <sys/types.h>
186 #endif
187 #if HAVE_SYS_STAT_H
188 # include <sys/stat.h>
189 #endif
190 #if STDC_HEADERS
191 # include <stdlib.h>
192 # include <stddef.h>
193 #else
194 # if HAVE_STDLIB_H
195 # include <stdlib.h>
196 # endif
197 #endif
198 #if HAVE_STRING_H
199 # if !STDC_HEADERS && HAVE_MEMORY_H
200 # include <memory.h>
201 # endif
202 # include <string.h>
203 #endif
204 #if HAVE_STRINGS_H
205 # include <strings.h>
206 #endif
207 #if HAVE_INTTYPES_H
208 # include <inttypes.h>
209 #else
210 # if HAVE_STDINT_H
211 # include <stdint.h>
212 # else
213 /* we need these... */
214 #ifndef __TCS__
215 typedef unsigned long long uint64_t;
216 typedef long long int64_t;
217 #else
218 typedef unsigned long uint64_t;
219 typedef long int64_t;
220 #endif
221 typedef unsigned long uint32_t;
222 typedef unsigned short uint16_t;
223 typedef unsigned char uint8_t;
224 typedef long int32_t;
225 typedef short int16_t;
226 typedef char int8_t;
227 # endif
228 #endif
229 #if HAVE_UNISTD_H
230 //# include <unistd.h>
231 #endif
232
233 #ifndef HAVE_FLOAT32_T
234 typedef float float32_t;
235 #endif
236
237 #if STDC_HEADERS
238 # include <string.h>
239 #else
240 # if !HAVE_STRCHR
241 # define strchr index
242 # define strrchr rindex
243 # endif
244 char *strchr(), *strrchr();
245 # if !HAVE_MEMCPY
246 # define memcpy(d, s, n) bcopy((s), (d), (n))
247 # define memmove(d, s, n) bcopy((s), (d), (n))
248 # endif
249 #endif
250
251 #endif
252
253 #ifdef WORDS_BIGENDIAN
254 #define ARCH_IS_BIG_ENDIAN
255 #endif
256
257 /* FIXED_POINT doesn't work with MAIN and SSR yet */
258 #ifdef FIXED_POINT
259 #undef MAIN_DEC
260 #undef SSR_DEC
261 #endif
262
263
264 #if defined(FIXED_POINT)
265
266 #include "fixed.h"
267
268 #elif defined(USE_DOUBLE_PRECISION)
269
270 typedef double real_t;
271
272 #include <math.h>
273
274 #define MUL_R(A,B) ((A)*(B))
275 #define MUL_C(A,B) ((A)*(B))
276 #define MUL_F(A,B) ((A)*(B))
277
278 /* Complex multiplication */
279 static INLINE void ComplexMult(real_t *y1, real_t *y2,
280 real_t x1, real_t x2, real_t c1, real_t c2)
281 {
282 *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
283 *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
284 }
285
286 #define REAL_CONST(A) ((real_t)(A))
287 #define COEF_CONST(A) ((real_t)(A))
288 #define Q2_CONST(A) ((real_t)(A))
289 #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
290
291 #else /* Normal floating point operation */
292
293 typedef float real_t;
294
295 #define MUL_R(A,B) ((A)*(B))
296 #define MUL_C(A,B) ((A)*(B))
297 #define MUL_F(A,B) ((A)*(B))
298
299 #define REAL_CONST(A) ((real_t)(A))
300 #define COEF_CONST(A) ((real_t)(A))
301 #define Q2_CONST(A) ((real_t)(A))
302 #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
303
304 /* Complex multiplication */
305 static INLINE void ComplexMult(real_t *y1, real_t *y2,
306 real_t x1, real_t x2, real_t c1, real_t c2)
307 {
308 *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
309 *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
310 }
311
312
313 #if defined(_WIN32) && !defined(__MINGW32__)
314 #define HAS_LRINTF
315 static INLINE int lrintf(float f)
316 {
317 int i;
318 __asm
319 {
320 fld f
321 fistp i
322 }
323 return i;
324 }
325 #elif (defined(__i386__) && defined(__GNUC__) && \
326 !defined(__CYGWIN__) && !defined(__MINGW32__))
327 #ifndef HAVE_LRINTF
328 #define HAS_LRINTF
329 // from http://www.stereopsis.com/FPU.html
330 static INLINE int lrintf(float f)
331 {
332 int i;
333 __asm__ __volatile__ (
334 "flds %1 \n\t"
335 "fistpl %0 \n\t"
336 : "=m" (i)
337 : "m" (f));
338 return i;
339 }
340 #endif /* HAVE_LRINTF */
341 #endif
342
343
344 #ifdef __ICL /* only Intel C compiler has fmath ??? */
345
346 #include <mathf.h>
347
348 #define sin sinf
349 #define cos cosf
350 #define log logf
351 #define floor floorf
352 #define ceil ceilf
353 #define sqrt sqrtf
354
355 #else
356
357 #ifdef HAVE_LRINTF
358 # define HAS_LRINTF
359 # define _ISOC9X_SOURCE 1
360 # define _ISOC99_SOURCE 1
361 # define __USE_ISOC9X 1
362 # define __USE_ISOC99 1
363 #endif
364
365 #include <math.h>
366
367 #ifdef HAVE_SINF
368 # define sin sinf
369 #error
370 #endif
371 #ifdef HAVE_COSF
372 # define cos cosf
373 #endif
374 #ifdef HAVE_LOGF
375 # define log logf
376 #endif
377 #ifdef HAVE_EXPF
378 # define exp expf
379 #endif
380 #ifdef HAVE_FLOORF
381 # define floor floorf
382 #endif
383 #ifdef HAVE_CEILF
384 # define ceil ceilf
385 #endif
386 #ifdef HAVE_SQRTF
387 # define sqrt sqrtf
388 #endif
389
390 #endif
391
392 #endif
393
394 #ifndef HAS_LRINTF
395 /* standard cast */
396 #define lrintf(f) ((int32_t)(f))
397 #endif
398
399 typedef real_t complex_t[2];
400 #define RE(A) A[0]
401 #define IM(A) A[1]
402
403
404 /* common functions */
405 uint8_t cpu_has_sse(void);
406 uint32_t ne_rng(uint32_t *__r1, uint32_t *__r2);
407 uint32_t ones32(uint32_t x);
408 uint32_t floor_log2(uint32_t x);
409 uint32_t wl_min_lzc(uint32_t x);
410 #ifdef FIXED_POINT
411 #define LOG2_MIN_INF REAL_CONST(-10000)
412 int32_t log2_int(uint32_t val);
413 int32_t log2_fix(uint32_t val);
414 int32_t pow2_int(real_t val);
415 real_t pow2_fix(real_t val);
416 #endif
417 uint8_t get_sr_index(const uint32_t samplerate);
418 uint8_t max_pred_sfb(const uint8_t sr_index);
419 uint8_t max_tns_sfb(const uint8_t sr_index, const uint8_t object_type,
420 const uint8_t is_short);
421 uint32_t get_sample_rate(const uint8_t sr_index);
422 int8_t can_decode_ot(const uint8_t object_type);
423
424 void *faad_malloc(size_t size);
425 void faad_free(void *b);
426
427 //#define PROFILE
428 #ifdef PROFILE
429 static int64_t faad_get_ts()
430 {
431 __asm
432 {
433 rdtsc
434 }
435 }
436 #endif
437
438 #ifndef M_PI
439 #define M_PI 3.14159265358979323846
440 #endif
441 #ifndef M_PI_2 /* PI/2 */
442 #define M_PI_2 1.57079632679489661923
443 #endif
444
445
446 #ifdef __cplusplus
447 }
448 #endif
449 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: decoder.c,v 1.111 2007/11/01 12:33:30 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #include <stdlib.h>
34 #include <string.h>
35
36 #include "decoder.h"
37 #include "mp4.h"
38 #include "syntax.h"
39 #include "error.h"
40 #include "output.h"
41 #include "filtbank.h"
42 #include "drc.h"
43 #ifdef SBR_DEC
44 #include "sbr_dec.h"
45 #include "sbr_syntax.h"
46 #endif
47 #ifdef SSR_DEC
48 #include "ssr.h"
49 #endif
50
51 #ifdef ANALYSIS
52 uint16_t dbg_count;
53 #endif
54
55 /* static function declarations */
56 static void* aac_frame_decode(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
57 uint8_t *buffer, uint32_t buffer_size,
58 void **sample_buffer, uint32_t sample_buffer_size);
59 static void create_channel_config(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo);
60
61
62 char* NEAACDECAPI NeAACDecGetErrorMessage(uint8_t errcode)
63 {
64 if (errcode >= NUM_ERROR_MESSAGES)
65 return NULL;
66 return err_msg[errcode];
67 }
68
69 uint32_t NEAACDECAPI NeAACDecGetCapabilities(void)
70 {
71 uint32_t cap = 0;
72
73 /* can't do without it */
74 cap += LC_DEC_CAP;
75
76 #ifdef MAIN_DEC
77 cap += MAIN_DEC_CAP;
78 #endif
79 #ifdef LTP_DEC
80 cap += LTP_DEC_CAP;
81 #endif
82 #ifdef LD_DEC
83 cap += LD_DEC_CAP;
84 #endif
85 #ifdef ERROR_RESILIENCE
86 cap += ERROR_RESILIENCE_CAP;
87 #endif
88 #ifdef FIXED_POINT
89 cap += FIXED_POINT_CAP;
90 #endif
91
92 return cap;
93 }
94
95 const unsigned char mes[] = { 0x67,0x20,0x61,0x20,0x20,0x20,0x6f,0x20,0x72,0x20,0x65,0x20,0x6e,0x20,0x20,0x20,0x74,0x20,0x68,0x20,0x67,0x20,0x69,0x20,0x72,0x20,0x79,0x20,0x70,0x20,0x6f,0x20,0x63 };
96 NeAACDecHandle NEAACDECAPI NeAACDecOpen(void)
97 {
98 uint8_t i;
99 NeAACDecHandle hDecoder = NULL;
100
101 if ((hDecoder = (NeAACDecHandle)faad_malloc(sizeof(NeAACDecStruct))) == NULL)
102 return NULL;
103
104 memset(hDecoder, 0, sizeof(NeAACDecStruct));
105
106 hDecoder->cmes = mes;
107 hDecoder->config.outputFormat = FAAD_FMT_16BIT;
108 hDecoder->config.defObjectType = MAIN;
109 hDecoder->config.defSampleRate = 44100; /* Default: 44.1kHz */
110 hDecoder->config.downMatrix = 0;
111 hDecoder->adts_header_present = 0;
112 hDecoder->adif_header_present = 0;
113 #ifdef ERROR_RESILIENCE
114 hDecoder->aacSectionDataResilienceFlag = 0;
115 hDecoder->aacScalefactorDataResilienceFlag = 0;
116 hDecoder->aacSpectralDataResilienceFlag = 0;
117 #endif
118 hDecoder->frameLength = 1024;
119
120 hDecoder->frame = 0;
121 hDecoder->sample_buffer = NULL;
122
123 hDecoder->__r1 = 1;
124 hDecoder->__r2 = 1;
125
126 for (i = 0; i < MAX_CHANNELS; i++)
127 {
128 hDecoder->window_shape_prev[i] = 0;
129 hDecoder->time_out[i] = NULL;
130 hDecoder->fb_intermed[i] = NULL;
131 #ifdef SSR_DEC
132 hDecoder->ssr_overlap[i] = NULL;
133 hDecoder->prev_fmd[i] = NULL;
134 #endif
135 #ifdef MAIN_DEC
136 hDecoder->pred_stat[i] = NULL;
137 #endif
138 #ifdef LTP_DEC
139 hDecoder->ltp_lag[i] = 0;
140 hDecoder->lt_pred_stat[i] = NULL;
141 #endif
142 }
143
144 #ifdef SBR_DEC
145 for (i = 0; i < MAX_SYNTAX_ELEMENTS; i++)
146 {
147 hDecoder->sbr[i] = NULL;
148 }
149 #endif
150
151 hDecoder->drc = drc_init(REAL_CONST(1.0), REAL_CONST(1.0));
152
153 return hDecoder;
154 }
155
156 NeAACDecConfigurationPtr NEAACDECAPI NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder)
157 {
158 if (hDecoder)
159 {
160 NeAACDecConfigurationPtr config = &(hDecoder->config);
161
162 return config;
163 }
164
165 return NULL;
166 }
167
168 uint8_t NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hDecoder,
169 NeAACDecConfigurationPtr config)
170 {
171 if (hDecoder && config)
172 {
173 /* check if we can decode this object type */
174 if (can_decode_ot(config->defObjectType) < 0)
175 return 0;
176 hDecoder->config.defObjectType = config->defObjectType;
177
178 /* samplerate: anything but 0 should be possible */
179 if (config->defSampleRate == 0)
180 return 0;
181 hDecoder->config.defSampleRate = config->defSampleRate;
182
183 /* check output format */
184 #ifdef FIXED_POINT
185 if ((config->outputFormat < 1) || (config->outputFormat > 4))
186 return 0;
187 #else
188 if ((config->outputFormat < 1) || (config->outputFormat > 5))
189 return 0;
190 #endif
191 hDecoder->config.outputFormat = config->outputFormat;
192
193 if (config->downMatrix > 1)
194 return 0;
195 hDecoder->config.downMatrix = config->downMatrix;
196
197 /* OK */
198 return 1;
199 }
200
201 return 0;
202 }
203
204
205 int32_t NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder, uint8_t *buffer,
206 uint32_t buffer_size,
207 uint32_t *samplerate, uint8_t *channels)
208 {
209 uint32_t bits = 0;
210 bitfile ld;
211 adif_header adif;
212 adts_header adts;
213
214
215 if ((hDecoder == NULL) || (samplerate == NULL) || (channels == NULL))
216 return -1;
217
218 hDecoder->sf_index = get_sr_index(hDecoder->config.defSampleRate);
219 hDecoder->object_type = hDecoder->config.defObjectType;
220 *samplerate = get_sample_rate(hDecoder->sf_index);
221 *channels = 1;
222
223 if (buffer != NULL)
224 {
225 faad_initbits(&ld, buffer, buffer_size);
226
227 /* Check if an ADIF header is present */
228 if ((buffer[0] == 'A') && (buffer[1] == 'D') &&
229 (buffer[2] == 'I') && (buffer[3] == 'F'))
230 {
231 hDecoder->adif_header_present = 1;
232
233 get_adif_header(&adif, &ld);
234 faad_byte_align(&ld);
235
236 hDecoder->sf_index = adif.pce[0].sf_index;
237 hDecoder->object_type = adif.pce[0].object_type + 1;
238
239 *samplerate = get_sample_rate(hDecoder->sf_index);
240 *channels = adif.pce[0].channels;
241
242 memcpy(&(hDecoder->pce), &(adif.pce[0]), sizeof(program_config));
243 hDecoder->pce_set = 1;
244
245 bits = bit2byte(faad_get_processed_bits(&ld));
246
247 /* Check if an ADTS header is present */
248 } else if (faad_showbits(&ld, 12) == 0xfff) {
249 hDecoder->adts_header_present = 1;
250
251 adts.old_format = hDecoder->config.useOldADTSFormat;
252 adts_frame(&adts, &ld);
253
254 hDecoder->sf_index = adts.sf_index;
255 hDecoder->object_type = adts.profile + 1;
256
257 *samplerate = get_sample_rate(hDecoder->sf_index);
258 *channels = (adts.channel_configuration > 6) ?
259 2 : adts.channel_configuration;
260 }
261
262 if (ld.error)
263 {
264 faad_endbits(&ld);
265 return -1;
266 }
267 faad_endbits(&ld);
268 }
269
270 #if (defined(PS_DEC) || defined(DRM_PS))
271 /* check if we have a mono file */
272 if (*channels == 1)
273 {
274 /* upMatrix to 2 channels for implicit signalling of PS */
275 *channels = 2;
276 }
277 #endif
278
279 hDecoder->channelConfiguration = *channels;
280
281 #ifdef SBR_DEC
282 /* implicit signalling */
283 if (*samplerate <= 24000 && !(hDecoder->config.dontUpSampleImplicitSBR))
284 {
285 *samplerate *= 2;
286 hDecoder->forceUpSampling = 1;
287 } else if (*samplerate > 24000 && !(hDecoder->config.dontUpSampleImplicitSBR)) {
288 hDecoder->downSampledSBR = 1;
289 }
290 #endif
291
292 /* must be done before frameLength is divided by 2 for LD */
293 #ifdef SSR_DEC
294 if (hDecoder->object_type == SSR)
295 hDecoder->fb = ssr_filter_bank_init(hDecoder->frameLength/SSR_BANDS);
296 else
297 #endif
298 hDecoder->fb = filter_bank_init(hDecoder->frameLength);
299
300 #ifdef LD_DEC
301 if (hDecoder->object_type == LD)
302 hDecoder->frameLength >>= 1;
303 #endif
304
305 if (can_decode_ot(hDecoder->object_type) < 0)
306 return -1;
307
308 return bits;
309 }
310
311 /* Init the library using a DecoderSpecificInfo */
312 int8_t NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, uint8_t *pBuffer,
313 uint32_t SizeOfDecoderSpecificInfo,
314 uint32_t *samplerate, uint8_t *channels)
315 {
316 int8_t rc;
317 mp4AudioSpecificConfig mp4ASC;
318
319 if((hDecoder == NULL)
320 || (pBuffer == NULL)
321 || (SizeOfDecoderSpecificInfo < 2)
322 || (samplerate == NULL)
323 || (channels == NULL))
324 {
325 return -1;
326 }
327
328 hDecoder->adif_header_present = 0;
329 hDecoder->adts_header_present = 0;
330
331 /* decode the audio specific config */
332 rc = AudioSpecificConfig2(pBuffer, SizeOfDecoderSpecificInfo, &mp4ASC,
333 &(hDecoder->pce));
334
335 /* copy the relevant info to the decoder handle */
336 *samplerate = mp4ASC.samplingFrequency;
337 if (mp4ASC.channelsConfiguration)
338 {
339 *channels = mp4ASC.channelsConfiguration;
340 } else {
341 *channels = hDecoder->pce.channels;
342 hDecoder->pce_set = 1;
343 }
344 #if (defined(PS_DEC) || defined(DRM_PS))
345 /* check if we have a mono file */
346 if (*channels == 1)
347 {
348 /* upMatrix to 2 channels for implicit signalling of PS */
349 *channels = 2;
350 }
351 #endif
352 hDecoder->sf_index = mp4ASC.samplingFrequencyIndex;
353 hDecoder->object_type = mp4ASC.objectTypeIndex;
354 #ifdef ERROR_RESILIENCE
355 hDecoder->aacSectionDataResilienceFlag = mp4ASC.aacSectionDataResilienceFlag;
356 hDecoder->aacScalefactorDataResilienceFlag = mp4ASC.aacScalefactorDataResilienceFlag;
357 hDecoder->aacSpectralDataResilienceFlag = mp4ASC.aacSpectralDataResilienceFlag;
358 #endif
359 #ifdef SBR_DEC
360 hDecoder->sbr_present_flag = mp4ASC.sbr_present_flag;
361 hDecoder->downSampledSBR = mp4ASC.downSampledSBR;
362 if (hDecoder->config.dontUpSampleImplicitSBR == 0)
363 hDecoder->forceUpSampling = mp4ASC.forceUpSampling;
364 else
365 hDecoder->forceUpSampling = 0;
366
367 /* AAC core decoder samplerate is 2 times as low */
368 if (((hDecoder->sbr_present_flag == 1)&&(!hDecoder->downSampledSBR)) || hDecoder->forceUpSampling == 1)
369 {
370 hDecoder->sf_index = get_sr_index(mp4ASC.samplingFrequency / 2);
371 }
372 #endif
373
374 if (rc != 0)
375 {
376 return rc;
377 }
378 hDecoder->channelConfiguration = mp4ASC.channelsConfiguration;
379 if (mp4ASC.frameLengthFlag)
380 #ifdef ALLOW_SMALL_FRAMELENGTH
381 hDecoder->frameLength = 960;
382 #else
383 return -1;
384 #endif
385
386 /* must be done before frameLength is divided by 2 for LD */
387 #ifdef SSR_DEC
388 if (hDecoder->object_type == SSR)
389 hDecoder->fb = ssr_filter_bank_init(hDecoder->frameLength/SSR_BANDS);
390 else
391 #endif
392 hDecoder->fb = filter_bank_init(hDecoder->frameLength);
393
394 #ifdef LD_DEC
395 if (hDecoder->object_type == LD)
396 hDecoder->frameLength >>= 1;
397 #endif
398
399 return 0;
400 }
401
402 #ifdef DRM
403 int8_t NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hDecoder, uint32_t samplerate,
404 uint8_t channels)
405 {
406 if (hDecoder == NULL)
407 return 1; /* error */
408
409 NeAACDecClose(*hDecoder);
410
411 *hDecoder = NeAACDecOpen();
412
413 /* Special object type defined for DRM */
414 (*hDecoder)->config.defObjectType = DRM_ER_LC;
415
416 (*hDecoder)->config.defSampleRate = samplerate;
417 #ifdef ERROR_RESILIENCE // This shoudl always be defined for DRM
418 (*hDecoder)->aacSectionDataResilienceFlag = 1; /* VCB11 */
419 (*hDecoder)->aacScalefactorDataResilienceFlag = 0; /* no RVLC */
420 (*hDecoder)->aacSpectralDataResilienceFlag = 1; /* HCR */
421 #endif
422 (*hDecoder)->frameLength = 960;
423 (*hDecoder)->sf_index = get_sr_index((*hDecoder)->config.defSampleRate);
424 (*hDecoder)->object_type = (*hDecoder)->config.defObjectType;
425
426 if ((channels == DRMCH_STEREO) || (channels == DRMCH_SBR_STEREO))
427 (*hDecoder)->channelConfiguration = 2;
428 else
429 (*hDecoder)->channelConfiguration = 1;
430
431 #ifdef SBR_DEC
432 if ((channels == DRMCH_MONO) || (channels == DRMCH_STEREO))
433 (*hDecoder)->sbr_present_flag = 0;
434 else
435 (*hDecoder)->sbr_present_flag = 1;
436 #endif
437
438 (*hDecoder)->fb = filter_bank_init((*hDecoder)->frameLength);
439
440 return 0;
441 }
442 #endif
443
444 void NEAACDECAPI NeAACDecClose(NeAACDecHandle hDecoder)
445 {
446 uint8_t i;
447
448 if (hDecoder == NULL)
449 return;
450
451 #ifdef PROFILE
452 printf("AAC decoder total: %I64d cycles\n", hDecoder->cycles);
453 printf("requant: %I64d cycles\n", hDecoder->requant_cycles);
454 printf("spectral_data: %I64d cycles\n", hDecoder->spectral_cycles);
455 printf("scalefactors: %I64d cycles\n", hDecoder->scalefac_cycles);
456 printf("output: %I64d cycles\n", hDecoder->output_cycles);
457 #endif
458
459 for (i = 0; i < MAX_CHANNELS; i++)
460 {
461 if (hDecoder->time_out[i]) faad_free(hDecoder->time_out[i]);
462 if (hDecoder->fb_intermed[i]) faad_free(hDecoder->fb_intermed[i]);
463 #ifdef SSR_DEC
464 if (hDecoder->ssr_overlap[i]) faad_free(hDecoder->ssr_overlap[i]);
465 if (hDecoder->prev_fmd[i]) faad_free(hDecoder->prev_fmd[i]);
466 #endif
467 #ifdef MAIN_DEC
468 if (hDecoder->pred_stat[i]) faad_free(hDecoder->pred_stat[i]);
469 #endif
470 #ifdef LTP_DEC
471 if (hDecoder->lt_pred_stat[i]) faad_free(hDecoder->lt_pred_stat[i]);
472 #endif
473 }
474
475 #ifdef SSR_DEC
476 if (hDecoder->object_type == SSR)
477 ssr_filter_bank_end(hDecoder->fb);
478 else
479 #endif
480 filter_bank_end(hDecoder->fb);
481
482 drc_end(hDecoder->drc);
483
484 if (hDecoder->sample_buffer) faad_free(hDecoder->sample_buffer);
485
486 #ifdef SBR_DEC
487 for (i = 0; i < MAX_SYNTAX_ELEMENTS; i++)
488 {
489 if (hDecoder->sbr[i])
490 sbrDecodeEnd(hDecoder->sbr[i]);
491 }
492 #endif
493
494 if (hDecoder) faad_free(hDecoder);
495 }
496
497 void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, int32_t frame)
498 {
499 if (hDecoder)
500 {
501 hDecoder->postSeekResetFlag = 1;
502
503 if (frame != -1)
504 hDecoder->frame = frame;
505 }
506 }
507
508 static void create_channel_config(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo)
509 {
510 hInfo->num_front_channels = 0;
511 hInfo->num_side_channels = 0;
512 hInfo->num_back_channels = 0;
513 hInfo->num_lfe_channels = 0;
514 memset(hInfo->channel_position, 0, MAX_CHANNELS*sizeof(uint8_t));
515
516 if (hDecoder->downMatrix)
517 {
518 hInfo->num_front_channels = 2;
519 hInfo->channel_position[0] = FRONT_CHANNEL_LEFT;
520 hInfo->channel_position[1] = FRONT_CHANNEL_RIGHT;
521 return;
522 }
523
524 /* check if there is a PCE */
525 if (hDecoder->pce_set)
526 {
527 uint8_t i, chpos = 0;
528 uint8_t chdir, back_center = 0;
529
530 hInfo->num_front_channels = hDecoder->pce.num_front_channels;
531 hInfo->num_side_channels = hDecoder->pce.num_side_channels;
532 hInfo->num_back_channels = hDecoder->pce.num_back_channels;
533 hInfo->num_lfe_channels = hDecoder->pce.num_lfe_channels;
534
535 chdir = hInfo->num_front_channels;
536 if (chdir & 1)
537 {
538 #if (defined(PS_DEC) || defined(DRM_PS))
539 /* When PS is enabled output is always stereo */
540 hInfo->channel_position[chpos++] = FRONT_CHANNEL_LEFT;
541 hInfo->channel_position[chpos++] = FRONT_CHANNEL_RIGHT;
542 #else
543 hInfo->channel_position[chpos++] = FRONT_CHANNEL_CENTER;
544 chdir--;
545 #endif
546 }
547 for (i = 0; i < chdir; i += 2)
548 {
549 hInfo->channel_position[chpos++] = FRONT_CHANNEL_LEFT;
550 hInfo->channel_position[chpos++] = FRONT_CHANNEL_RIGHT;
551 }
552
553 for (i = 0; i < hInfo->num_side_channels; i += 2)
554 {
555 hInfo->channel_position[chpos++] = SIDE_CHANNEL_LEFT;
556 hInfo->channel_position[chpos++] = SIDE_CHANNEL_RIGHT;
557 }
558
559 chdir = hInfo->num_back_channels;
560 if (chdir & 1)
561 {
562 back_center = 1;
563 chdir--;
564 }
565 for (i = 0; i < chdir; i += 2)
566 {
567 hInfo->channel_position[chpos++] = BACK_CHANNEL_LEFT;
568 hInfo->channel_position[chpos++] = BACK_CHANNEL_RIGHT;
569 }
570 if (back_center)
571 {
572 hInfo->channel_position[chpos++] = BACK_CHANNEL_CENTER;
573 }
574
575 for (i = 0; i < hInfo->num_lfe_channels; i++)
576 {
577 hInfo->channel_position[chpos++] = LFE_CHANNEL;
578 }
579
580 } else {
581 switch (hDecoder->channelConfiguration)
582 {
583 case 1:
584 #if (defined(PS_DEC) || defined(DRM_PS))
585 /* When PS is enabled output is always stereo */
586 hInfo->num_front_channels = 2;
587 hInfo->channel_position[0] = FRONT_CHANNEL_LEFT;
588 hInfo->channel_position[1] = FRONT_CHANNEL_RIGHT;
589 #else
590 hInfo->num_front_channels = 1;
591 hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
592 #endif
593 break;
594 case 2:
595 hInfo->num_front_channels = 2;
596 hInfo->channel_position[0] = FRONT_CHANNEL_LEFT;
597 hInfo->channel_position[1] = FRONT_CHANNEL_RIGHT;
598 break;
599 case 3:
600 hInfo->num_front_channels = 3;
601 hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
602 hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
603 hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
604 break;
605 case 4:
606 hInfo->num_front_channels = 3;
607 hInfo->num_back_channels = 1;
608 hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
609 hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
610 hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
611 hInfo->channel_position[3] = BACK_CHANNEL_CENTER;
612 break;
613 case 5:
614 hInfo->num_front_channels = 3;
615 hInfo->num_back_channels = 2;
616 hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
617 hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
618 hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
619 hInfo->channel_position[3] = BACK_CHANNEL_LEFT;
620 hInfo->channel_position[4] = BACK_CHANNEL_RIGHT;
621 break;
622 case 6:
623 hInfo->num_front_channels = 3;
624 hInfo->num_back_channels = 2;
625 hInfo->num_lfe_channels = 1;
626 hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
627 hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
628 hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
629 hInfo->channel_position[3] = BACK_CHANNEL_LEFT;
630 hInfo->channel_position[4] = BACK_CHANNEL_RIGHT;
631 hInfo->channel_position[5] = LFE_CHANNEL;
632 break;
633 case 7:
634 hInfo->num_front_channels = 3;
635 hInfo->num_side_channels = 2;
636 hInfo->num_back_channels = 2;
637 hInfo->num_lfe_channels = 1;
638 hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
639 hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
640 hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
641 hInfo->channel_position[3] = SIDE_CHANNEL_LEFT;
642 hInfo->channel_position[4] = SIDE_CHANNEL_RIGHT;
643 hInfo->channel_position[5] = BACK_CHANNEL_LEFT;
644 hInfo->channel_position[6] = BACK_CHANNEL_RIGHT;
645 hInfo->channel_position[7] = LFE_CHANNEL;
646 break;
647 default: /* channelConfiguration == 0 || channelConfiguration > 7 */
648 {
649 uint8_t i;
650 uint8_t ch = hDecoder->fr_channels - hDecoder->has_lfe;
651 if (ch & 1) /* there's either a center front or a center back channel */
652 {
653 uint8_t ch1 = (ch-1)/2;
654 if (hDecoder->first_syn_ele == ID_SCE)
655 {
656 hInfo->num_front_channels = ch1 + 1;
657 hInfo->num_back_channels = ch1;
658 hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
659 for (i = 1; i <= ch1; i+=2)
660 {
661 hInfo->channel_position[i] = FRONT_CHANNEL_LEFT;
662 hInfo->channel_position[i+1] = FRONT_CHANNEL_RIGHT;
663 }
664 for (i = ch1+1; i < ch; i+=2)
665 {
666 hInfo->channel_position[i] = BACK_CHANNEL_LEFT;
667 hInfo->channel_position[i+1] = BACK_CHANNEL_RIGHT;
668 }
669 } else {
670 hInfo->num_front_channels = ch1;
671 hInfo->num_back_channels = ch1 + 1;
672 for (i = 0; i < ch1; i+=2)
673 {
674 hInfo->channel_position[i] = FRONT_CHANNEL_LEFT;
675 hInfo->channel_position[i+1] = FRONT_CHANNEL_RIGHT;
676 }
677 for (i = ch1; i < ch-1; i+=2)
678 {
679 hInfo->channel_position[i] = BACK_CHANNEL_LEFT;
680 hInfo->channel_position[i+1] = BACK_CHANNEL_RIGHT;
681 }
682 hInfo->channel_position[ch-1] = BACK_CHANNEL_CENTER;
683 }
684 } else {
685 uint8_t ch1 = (ch)/2;
686 hInfo->num_front_channels = ch1;
687 hInfo->num_back_channels = ch1;
688 if (ch1 & 1)
689 {
690 hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
691 for (i = 1; i <= ch1; i+=2)
692 {
693 hInfo->channel_position[i] = FRONT_CHANNEL_LEFT;
694 hInfo->channel_position[i+1] = FRONT_CHANNEL_RIGHT;
695 }
696 for (i = ch1+1; i < ch-1; i+=2)
697 {
698 hInfo->channel_position[i] = BACK_CHANNEL_LEFT;
699 hInfo->channel_position[i+1] = BACK_CHANNEL_RIGHT;
700 }
701 hInfo->channel_position[ch-1] = BACK_CHANNEL_CENTER;
702 } else {
703 for (i = 0; i < ch1; i+=2)
704 {
705 hInfo->channel_position[i] = FRONT_CHANNEL_LEFT;
706 hInfo->channel_position[i+1] = FRONT_CHANNEL_RIGHT;
707 }
708 for (i = ch1; i < ch; i+=2)
709 {
710 hInfo->channel_position[i] = BACK_CHANNEL_LEFT;
711 hInfo->channel_position[i+1] = BACK_CHANNEL_RIGHT;
712 }
713 }
714 }
715 hInfo->num_lfe_channels = hDecoder->has_lfe;
716 for (i = ch; i < hDecoder->fr_channels; i++)
717 {
718 hInfo->channel_position[i] = LFE_CHANNEL;
719 }
720 }
721 break;
722 }
723 }
724 }
725
726 void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hDecoder,
727 NeAACDecFrameInfo *hInfo,
728 uint8_t *buffer, uint32_t buffer_size)
729 {
730 return aac_frame_decode(hDecoder, hInfo, buffer, buffer_size, NULL, 0);
731 }
732
733 void* NEAACDECAPI NeAACDecDecode2(NeAACDecHandle hDecoder,
734 NeAACDecFrameInfo *hInfo,
735 uint8_t *buffer, uint32_t buffer_size,
736 void **sample_buffer, uint32_t sample_buffer_size)
737 {
738 if ((sample_buffer == NULL) || (sample_buffer_size == 0))
739 {
740 hInfo->error = 27;
741 return NULL;
742 }
743
744 return aac_frame_decode(hDecoder, hInfo, buffer, buffer_size,
745 sample_buffer, sample_buffer_size);
746 }
747
748 #ifdef DRM
749
750 #define ERROR_STATE_INIT 6
751
752 static void conceal_output(NeAACDecHandle hDecoder, uint16_t frame_len,
753 uint8_t out_ch, void *sample_buffer)
754 {
755 return;
756 }
757 #endif
758
759 static void* aac_frame_decode(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
760 uint8_t *buffer, uint32_t buffer_size,
761 void **sample_buffer2, uint32_t sample_buffer_size)
762 {
763 uint16_t i;
764 uint8_t channels = 0;
765 uint8_t output_channels = 0;
766 bitfile ld = {0};
767 uint32_t bitsconsumed;
768 uint16_t frame_len;
769 void *sample_buffer;
770
771 #ifdef PROFILE
772 int64_t count = faad_get_ts();
773 #endif
774
775 /* safety checks */
776 if ((hDecoder == NULL) || (hInfo == NULL) || (buffer == NULL))
777 {
778 return NULL;
779 }
780
781 #if 0
782 printf("%d\n", buffer_size*8);
783 #endif
784
785 frame_len = hDecoder->frameLength;
786
787
788 memset(hInfo, 0, sizeof(NeAACDecFrameInfo));
789 memset(hDecoder->internal_channel, 0, MAX_CHANNELS*sizeof(hDecoder->internal_channel[0]));
790
791 #ifdef USE_TIME_LIMIT
792 if ((TIME_LIMIT * get_sample_rate(hDecoder->sf_index)) > hDecoder->TL_count)
793 {
794 hDecoder->TL_count += 1024;
795 } else {
796 hInfo->error = (NUM_ERROR_MESSAGES-1);
797 goto error;
798 }
799 #endif
800
801
802 /* check for some common metadata tag types in the bitstream
803 * No need to return an error
804 */
805 /* ID3 */
806 if (buffer_size >= 128)
807 {
808 if (memcmp(buffer, "TAG", 3) == 0)
809 {
810 /* found it */
811 hInfo->bytesconsumed = 128; /* 128 bytes fixed size */
812 /* no error, but no output either */
813 return NULL;
814 }
815 }
816
817
818 /* initialize the bitstream */
819 faad_initbits(&ld, buffer, buffer_size);
820
821 #if 0
822 {
823 int i;
824 for (i = 0; i < ((buffer_size+3)>>2); i++)
825 {
826 uint8_t *buf;
827 uint32_t temp = 0;
828 buf = faad_getbitbuffer(&ld, 32);
829 //temp = getdword((void*)buf);
830 temp = *((uint32_t*)buf);
831 printf("0x%.8X\n", temp);
832 free(buf);
833 }
834 faad_endbits(&ld);
835 faad_initbits(&ld, buffer, buffer_size);
836 }
837 #endif
838
839 #ifdef DRM
840 if (hDecoder->object_type == DRM_ER_LC)
841 {
842 /* We do not support stereo right now */
843 if (0) //(hDecoder->channelConfiguration == 2)
844 {
845 hInfo->error = 28; // Throw CRC error
846 goto error;
847 }
848
849 faad_getbits(&ld, 8
850 DEBUGVAR(1,1,"NeAACDecDecode(): skip CRC"));
851 }
852 #endif
853
854 if (hDecoder->adts_header_present)
855 {
856 adts_header adts;
857
858 adts.old_format = hDecoder->config.useOldADTSFormat;
859 if ((hInfo->error = adts_frame(&adts, &ld)) > 0)
860 goto error;
861
862 /* MPEG2 does byte_alignment() here,
863 * but ADTS header is always multiple of 8 bits in MPEG2
864 * so not needed to actually do it.
865 */
866 }
867
868 #ifdef ANALYSIS
869 dbg_count = 0;
870 #endif
871
872 /* decode the complete bitstream */
873 #ifdef DRM
874 if (/*(hDecoder->object_type == 6) ||*/ (hDecoder->object_type == DRM_ER_LC))
875 {
876 DRM_aac_scalable_main_element(hDecoder, hInfo, &ld, &hDecoder->pce, hDecoder->drc);
877 } else {
878 #endif
879 raw_data_block(hDecoder, hInfo, &ld, &hDecoder->pce, hDecoder->drc);
880 #ifdef DRM
881 }
882 #endif
883
884 channels = hDecoder->fr_channels;
885
886 if (hInfo->error > 0)
887 goto error;
888
889 /* safety check */
890 if (channels == 0 || channels > MAX_CHANNELS)
891 {
892 /* invalid number of channels */
893 hInfo->error = 12;
894 goto error;
895 }
896
897 /* no more bit reading after this */
898 bitsconsumed = faad_get_processed_bits(&ld);
899 hInfo->bytesconsumed = bit2byte(bitsconsumed);
900 if (ld.error)
901 {
902 hInfo->error = 14;
903 goto error;
904 }
905 faad_endbits(&ld);
906
907
908 if (!hDecoder->adts_header_present && !hDecoder->adif_header_present)
909 {
910 if (hDecoder->channelConfiguration == 0)
911 hDecoder->channelConfiguration = channels;
912
913 if (channels == 8) /* 7.1 */
914 hDecoder->channelConfiguration = 7;
915 if (channels == 7) /* not a standard channelConfiguration */
916 hDecoder->channelConfiguration = 0;
917 }
918
919 if ((channels == 5 || channels == 6) && hDecoder->config.downMatrix)
920 {
921 hDecoder->downMatrix = 1;
922 output_channels = 2;
923 } else {
924 output_channels = channels;
925 }
926
927 #if (defined(PS_DEC) || defined(DRM_PS))
928 hDecoder->upMatrix = 0;
929 /* check if we have a mono file */
930 if (output_channels == 1)
931 {
932 /* upMatrix to 2 channels for implicit signalling of PS */
933 hDecoder->upMatrix = 1;
934 output_channels = 2;
935 }
936 #endif
937
938 /* Make a channel configuration based on either a PCE or a channelConfiguration */
939 create_channel_config(hDecoder, hInfo);
940
941 /* number of samples in this frame */
942 hInfo->samples = frame_len*output_channels;
943 /* number of channels in this frame */
944 hInfo->channels = output_channels;
945 /* samplerate */
946 hInfo->samplerate = get_sample_rate(hDecoder->sf_index);
947 /* object type */
948 hInfo->object_type = hDecoder->object_type;
949 /* sbr */
950 hInfo->sbr = NO_SBR;
951 /* header type */
952 hInfo->header_type = RAW;
953 if (hDecoder->adif_header_present)
954 hInfo->header_type = ADIF;
955 if (hDecoder->adts_header_present)
956 hInfo->header_type = ADTS;
957 #if (defined(PS_DEC) || defined(DRM_PS))
958 hInfo->ps = hDecoder->ps_used_global;
959 #endif
960
961 /* check if frame has channel elements */
962 if (channels == 0)
963 {
964 hDecoder->frame++;
965 return NULL;
966 }
967
968 /* allocate the buffer for the final samples */
969 if ((hDecoder->sample_buffer == NULL) ||
970 (hDecoder->alloced_channels != output_channels))
971 {
972 static const uint8_t str[] = { sizeof(int16_t), sizeof(int32_t), sizeof(int32_t),
973 sizeof(float32_t), sizeof(double), sizeof(int16_t), sizeof(int16_t),
974 sizeof(int16_t), sizeof(int16_t), 0, 0, 0
975 };
976 uint8_t stride = str[hDecoder->config.outputFormat-1];
977 #ifdef SBR_DEC
978 if (((hDecoder->sbr_present_flag == 1)&&(!hDecoder->downSampledSBR)) || (hDecoder->forceUpSampling == 1))
979 {
980 stride = 2 * stride;
981 }
982 #endif
983 /* check if we want to use internal sample_buffer */
984 if (sample_buffer_size == 0)
985 {
986 if (hDecoder->sample_buffer)
987 faad_free(hDecoder->sample_buffer);
988 hDecoder->sample_buffer = NULL;
989 hDecoder->sample_buffer = faad_malloc(frame_len*output_channels*stride);
990 } else if (sample_buffer_size < frame_len*output_channels*stride) {
991 /* provided sample buffer is not big enough */
992 hInfo->error = 27;
993 return NULL;
994 }
995 hDecoder->alloced_channels = output_channels;
996 }
997
998 if (sample_buffer_size == 0)
999 {
1000 sample_buffer = hDecoder->sample_buffer;
1001 } else {
1002 sample_buffer = *sample_buffer2;
1003 }
1004
1005 #ifdef SBR_DEC
1006 if ((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
1007 {
1008 uint8_t ele;
1009
1010 /* this data is different when SBR is used or when the data is upsampled */
1011 if (!hDecoder->downSampledSBR)
1012 {
1013 frame_len *= 2;
1014 hInfo->samples *= 2;
1015 hInfo->samplerate *= 2;
1016 }
1017
1018 /* check if every element was provided with SBR data */
1019 for (ele = 0; ele < hDecoder->fr_ch_ele; ele++)
1020 {
1021 if (hDecoder->sbr[ele] == NULL)
1022 {
1023 hInfo->error = 25;
1024 goto error;
1025 }
1026 }
1027
1028 /* sbr */
1029 if (hDecoder->sbr_present_flag == 1)
1030 {
1031 hInfo->object_type = HE_AAC;
1032 hInfo->sbr = SBR_UPSAMPLED;
1033 } else {
1034 hInfo->sbr = NO_SBR_UPSAMPLED;
1035 }
1036 if (hDecoder->downSampledSBR)
1037 {
1038 hInfo->sbr = SBR_DOWNSAMPLED;
1039 }
1040 }
1041 #endif
1042
1043
1044 sample_buffer = output_to_PCM(hDecoder, hDecoder->time_out, sample_buffer,
1045 output_channels, frame_len, hDecoder->config.outputFormat);
1046
1047
1048 #ifdef DRM
1049 //conceal_output(hDecoder, frame_len, output_channels, sample_buffer);
1050 #endif
1051
1052
1053 hDecoder->postSeekResetFlag = 0;
1054
1055 hDecoder->frame++;
1056 #ifdef LD_DEC
1057 if (hDecoder->object_type != LD)
1058 {
1059 #endif
1060 if (hDecoder->frame <= 1)
1061 hInfo->samples = 0;
1062 #ifdef LD_DEC
1063 } else {
1064 /* LD encoders will give lower delay */
1065 if (hDecoder->frame <= 0)
1066 hInfo->samples = 0;
1067 }
1068 #endif
1069
1070 /* cleanup */
1071 #ifdef ANALYSIS
1072 fflush(stdout);
1073 #endif
1074
1075 #ifdef PROFILE
1076 count = faad_get_ts() - count;
1077 hDecoder->cycles += count;
1078 #endif
1079
1080 return sample_buffer;
1081
1082 error:
1083
1084
1085 #ifdef DRM
1086 hDecoder->error_state = ERROR_STATE_INIT;
1087 #endif
1088
1089 /* reset filterbank state */
1090 for (i = 0; i < MAX_CHANNELS; i++)
1091 {
1092 if (hDecoder->fb_intermed[i] != NULL)
1093 {
1094 memset(hDecoder->fb_intermed[i], 0, hDecoder->frameLength*sizeof(real_t));
1095 }
1096 }
1097 #ifdef SBR_DEC
1098 for (i = 0; i < MAX_SYNTAX_ELEMENTS; i++)
1099 {
1100 if (hDecoder->sbr[i] != NULL)
1101 {
1102 sbrReset(hDecoder->sbr[i]);
1103 }
1104 }
1105 #endif
1106
1107
1108 faad_endbits(&ld);
1109
1110 /* cleanup */
1111 #ifdef ANALYSIS
1112 fflush(stdout);
1113 #endif
1114
1115 return NULL;
1116 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: decoder.h,v 1.48 2007/11/01 12:33:30 menno Exp $
28 **/
29
30 #ifndef __DECODER_H__
31 #define __DECODER_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #ifdef _WIN32
38 #pragma pack(push, 8)
39 #ifndef NEAACDECAPI
40 #define NEAACDECAPI __cdecl
41 #endif
42 #else
43 #ifndef NEAACDECAPI
44 #define NEAACDECAPI
45 #endif
46 #endif
47
48
49 /* library output formats */
50 #define FAAD_FMT_16BIT 1
51 #define FAAD_FMT_24BIT 2
52 #define FAAD_FMT_32BIT 3
53 #define FAAD_FMT_FLOAT 4
54 #define FAAD_FMT_FIXED FAAD_FMT_FLOAT
55 #define FAAD_FMT_DOUBLE 5
56
57 #define LC_DEC_CAP (1<<0)
58 #define MAIN_DEC_CAP (1<<1)
59 #define LTP_DEC_CAP (1<<2)
60 #define LD_DEC_CAP (1<<3)
61 #define ERROR_RESILIENCE_CAP (1<<4)
62 #define FIXED_POINT_CAP (1<<5)
63
64 #define FRONT_CHANNEL_CENTER (1)
65 #define FRONT_CHANNEL_LEFT (2)
66 #define FRONT_CHANNEL_RIGHT (3)
67 #define SIDE_CHANNEL_LEFT (4)
68 #define SIDE_CHANNEL_RIGHT (5)
69 #define BACK_CHANNEL_LEFT (6)
70 #define BACK_CHANNEL_RIGHT (7)
71 #define BACK_CHANNEL_CENTER (8)
72 #define LFE_CHANNEL (9)
73 #define UNKNOWN_CHANNEL (0)
74
75 char* NEAACDECAPI NeAACDecGetErrorMessage(uint8_t errcode);
76
77 uint32_t NEAACDECAPI NeAACDecGetCapabilities(void);
78
79 NeAACDecHandle NEAACDECAPI NeAACDecOpen(void);
80
81 NeAACDecConfigurationPtr NEAACDECAPI NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder);
82
83 uint8_t NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hDecoder,
84 NeAACDecConfigurationPtr config);
85
86 /* Init the library based on info from the AAC file (ADTS/ADIF) */
87 int32_t NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder,
88 uint8_t *buffer,
89 uint32_t buffer_size,
90 uint32_t *samplerate,
91 uint8_t *channels);
92
93 /* Init the library using a DecoderSpecificInfo */
94 int8_t NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, uint8_t *pBuffer,
95 uint32_t SizeOfDecoderSpecificInfo,
96 uint32_t *samplerate, uint8_t *channels);
97
98 /* Init the library for DRM */
99 int8_t NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hDecoder, uint32_t samplerate,
100 uint8_t channels);
101
102 void NEAACDECAPI NeAACDecClose(NeAACDecHandle hDecoder);
103
104 void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, int32_t frame);
105
106 void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hDecoder,
107 NeAACDecFrameInfo *hInfo,
108 uint8_t *buffer,
109 uint32_t buffer_size);
110
111 void* NEAACDECAPI NeAACDecDecode2(NeAACDecHandle hDecoder,
112 NeAACDecFrameInfo *hInfo,
113 uint8_t *buffer, uint32_t buffer_size,
114 void **sample_buffer, uint32_t sample_buffer_size);
115
116 #ifdef _WIN32
117 #pragma pack(pop)
118 #endif
119
120 #ifdef __cplusplus
121 }
122 #endif
123 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: drc.c,v 1.28 2007/11/01 12:33:30 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #include <stdlib.h>
34 #include <string.h>
35 #include "syntax.h"
36 #include "drc.h"
37
38 drc_info *drc_init(real_t cut, real_t boost)
39 {
40 drc_info *drc = (drc_info*)faad_malloc(sizeof(drc_info));
41 memset(drc, 0, sizeof(drc_info));
42
43 drc->ctrl1 = cut;
44 drc->ctrl2 = boost;
45
46 drc->num_bands = 1;
47 drc->band_top[0] = 1024/4 - 1;
48 drc->dyn_rng_sgn[0] = 1;
49 drc->dyn_rng_ctl[0] = 0;
50
51 return drc;
52 }
53
54 void drc_end(drc_info *drc)
55 {
56 if (drc) faad_free(drc);
57 }
58
59 #ifdef FIXED_POINT
60 static real_t drc_pow2_table[] =
61 {
62 COEF_CONST(0.5146511183),
63 COEF_CONST(0.5297315472),
64 COEF_CONST(0.5452538663),
65 COEF_CONST(0.5612310242),
66 COEF_CONST(0.5776763484),
67 COEF_CONST(0.5946035575),
68 COEF_CONST(0.6120267717),
69 COEF_CONST(0.6299605249),
70 COEF_CONST(0.6484197773),
71 COEF_CONST(0.6674199271),
72 COEF_CONST(0.6869768237),
73 COEF_CONST(0.7071067812),
74 COEF_CONST(0.7278265914),
75 COEF_CONST(0.7491535384),
76 COEF_CONST(0.7711054127),
77 COEF_CONST(0.7937005260),
78 COEF_CONST(0.8169577266),
79 COEF_CONST(0.8408964153),
80 COEF_CONST(0.8655365610),
81 COEF_CONST(0.8908987181),
82 COEF_CONST(0.9170040432),
83 COEF_CONST(0.9438743127),
84 COEF_CONST(0.9715319412),
85 COEF_CONST(1.0000000000),
86 COEF_CONST(1.0293022366),
87 COEF_CONST(1.0594630944),
88 COEF_CONST(1.0905077327),
89 COEF_CONST(1.1224620483),
90 COEF_CONST(1.1553526969),
91 COEF_CONST(1.1892071150),
92 COEF_CONST(1.2240535433),
93 COEF_CONST(1.2599210499),
94 COEF_CONST(1.2968395547),
95 COEF_CONST(1.3348398542),
96 COEF_CONST(1.3739536475),
97 COEF_CONST(1.4142135624),
98 COEF_CONST(1.4556531828),
99 COEF_CONST(1.4983070769),
100 COEF_CONST(1.5422108254),
101 COEF_CONST(1.5874010520),
102 COEF_CONST(1.6339154532),
103 COEF_CONST(1.6817928305),
104 COEF_CONST(1.7310731220),
105 COEF_CONST(1.7817974363),
106 COEF_CONST(1.8340080864),
107 COEF_CONST(1.8877486254),
108 COEF_CONST(1.9430638823)
109 };
110 #endif
111
112 void drc_decode(drc_info *drc, real_t *spec)
113 {
114 uint16_t i, bd, top;
115 #ifdef FIXED_POINT
116 int32_t exp, frac;
117 #else
118 real_t factor, exp;
119 #endif
120 uint16_t bottom = 0;
121
122 if (drc->num_bands == 1)
123 drc->band_top[0] = 1024/4 - 1;
124
125 for (bd = 0; bd < drc->num_bands; bd++)
126 {
127 top = 4 * (drc->band_top[bd] + 1);
128
129 #ifndef FIXED_POINT
130 /* Decode DRC gain factor */
131 if (drc->dyn_rng_sgn[bd]) /* compress */
132 exp = -drc->ctrl1 * (drc->dyn_rng_ctl[bd] - (DRC_REF_LEVEL - drc->prog_ref_level))/REAL_CONST(24.0);
133 else /* boost */
134 exp = drc->ctrl2 * (drc->dyn_rng_ctl[bd] - (DRC_REF_LEVEL - drc->prog_ref_level))/REAL_CONST(24.0);
135 factor = (real_t)pow(2.0, exp);
136
137 /* Apply gain factor */
138 for (i = bottom; i < top; i++)
139 spec[i] *= factor;
140 #else
141 /* Decode DRC gain factor */
142 if (drc->dyn_rng_sgn[bd]) /* compress */
143 {
144 exp = -1 * (drc->dyn_rng_ctl[bd] - (DRC_REF_LEVEL - drc->prog_ref_level))/ 24;
145 frac = -1 * (drc->dyn_rng_ctl[bd] - (DRC_REF_LEVEL - drc->prog_ref_level)) % 24;
146 } else { /* boost */
147 exp = (drc->dyn_rng_ctl[bd] - (DRC_REF_LEVEL - drc->prog_ref_level))/ 24;
148 frac = (drc->dyn_rng_ctl[bd] - (DRC_REF_LEVEL - drc->prog_ref_level)) % 24;
149 }
150
151 /* Apply gain factor */
152 if (exp < 0)
153 {
154 for (i = bottom; i < top; i++)
155 {
156 spec[i] >>= -exp;
157 if (frac)
158 spec[i] = MUL_R(spec[i],drc_pow2_table[frac+23]);
159 }
160 } else {
161 for (i = bottom; i < top; i++)
162 {
163 spec[i] <<= exp;
164 if (frac)
165 spec[i] = MUL_R(spec[i],drc_pow2_table[frac+23]);
166 }
167 }
168 #endif
169
170 bottom = top;
171 }
172 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: drc.h,v 1.22 2007/11/01 12:33:30 menno Exp $
28 **/
29
30 #ifndef __DRC_H__
31 #define __DRC_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #define DRC_REF_LEVEL 20*4 /* -20 dB */
38
39
40 drc_info *drc_init(real_t cut, real_t boost);
41 void drc_end(drc_info *drc);
42 void drc_decode(drc_info *drc, real_t *spec);
43
44
45 #ifdef __cplusplus
46 }
47 #endif
48 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: drm_dec.c,v 1.9 2007/11/01 12:33:30 menno Exp $
28 **/
29
30 #include <stdlib.h>
31 #include <stdio.h>
32 #include <string.h>
33 #include <math.h>
34 #include "common.h"
35
36 #ifdef DRM
37
38 #include "sbr_dec.h"
39 #include "drm_dec.h"
40 #include "bits.h"
41
42 /* constants */
43 #define DECAY_CUTOFF 3
44 #define DECAY_SLOPE 0.05f
45
46 /* type definitaions */
47 typedef const int8_t (*drm_ps_huff_tab)[2];
48
49
50 /* binary search huffman tables */
51 static const int8_t f_huffman_sa[][2] =
52 {
53 { /*0*/ -15, 1 }, /* index 0: 1 bits: x */
54 { 2, 3 }, /* index 1: 2 bits: 1x */
55 { /*7*/ -8, 4 }, /* index 2: 3 bits: 10x */
56 { 5, 6 }, /* index 3: 3 bits: 11x */
57 { /*1*/ -14, /*-1*/ -16 }, /* index 4: 4 bits: 101x */
58 { /*-2*/ -17, 7 }, /* index 5: 4 bits: 110x */
59 { 8, 9 }, /* index 6: 4 bits: 111x */
60 { /*2*/ -13, /*-3*/ -18 }, /* index 7: 5 bits: 1101x */
61 { /*3*/ -12, 10 }, /* index 8: 5 bits: 1110x */
62 { 11, 12 }, /* index 9: 5 bits: 1111x */
63 { /*4*/ -11, /*5*/ -10 }, /* index 10: 6 bits: 11101x */
64 { /*-4*/ -19, /*-5*/ -20 }, /* index 11: 6 bits: 11110x */
65 { /*6*/ -9, 13 }, /* index 12: 6 bits: 11111x */
66 { /*-7*/ -22, /*-6*/ -21 } /* index 13: 7 bits: 111111x */
67 };
68
69 static const int8_t t_huffman_sa[][2] =
70 {
71 { /*0*/ -15, 1 }, /* index 0: 1 bits: x */
72 { 2, 3 }, /* index 1: 2 bits: 1x */
73 { /*-1*/ -16, /*1*/ -14 }, /* index 2: 3 bits: 10x */
74 { 4, 5 }, /* index 3: 3 bits: 11x */
75 { /*-2*/ -17, /*2*/ -13 }, /* index 4: 4 bits: 110x */
76 { 6, 7 }, /* index 5: 4 bits: 111x */
77 { /*-3*/ -18, /*3*/ -12 }, /* index 6: 5 bits: 1110x */
78 { 8, 9 }, /* index 7: 5 bits: 1111x */
79 { /*-4*/ -19, /*4*/ -11 }, /* index 8: 6 bits: 11110x */
80 { 10, 11 }, /* index 9: 6 bits: 11111x */
81 { /*-5*/ -20, /*5*/ -10 }, /* index 10: 7 bits: 111110x */
82 { /*-6*/ -21, 12 }, /* index 11: 7 bits: 111111x */
83 { /*-7*/ -22, 13 }, /* index 12: 8 bits: 1111111x */
84 { /*6*/ -9, /*7*/ -8 } /* index 13: 9 bits: 11111111x */
85 };
86
87 static const int8_t f_huffman_pan[][2] =
88 {
89 { /*0*/ -15, 1 }, /* index 0: 1 bits: x */
90 { /*-1*/ -16, 2 }, /* index 1: 2 bits: 1x */
91 { /*1*/ -14, 3 }, /* index 2: 3 bits: 11x */
92 { 4, 5 }, /* index 3: 4 bits: 111x */
93 { /*-2*/ -17, /*2*/ -13 }, /* index 4: 5 bits: 1110x */
94 { 6, 7 }, /* index 5: 5 bits: 1111x */
95 { /*-3*/ -18, /*3*/ -12 }, /* index 6: 6 bits: 11110x */
96 { 8, 9 }, /* index 7: 6 bits: 11111x */
97 { /*-4*/ -19, /*4*/ -11 }, /* index 8: 7 bits: 111110x */
98 { 10, 11 }, /* index 9: 7 bits: 111111x */
99 { /*-5*/ -20, /*5*/ -10 }, /* index 10: 8 bits: 1111110x */
100 { 12, 13 }, /* index 11: 8 bits: 1111111x */
101 { /*-6*/ -21, /*6*/ -9 }, /* index 12: 9 bits: 11111110x */
102 { /*-7*/ -22, 14 }, /* index 13: 9 bits: 11111111x */
103 { /*7*/ -8, 15 }, /* index 14: 10 bits: 111111111x */
104 { 16, 17 }, /* index 15: 11 bits: 1111111111x */
105 { /*-8*/ -23, /*8*/ -7 }, /* index 16: 12 bits: 11111111110x */
106 { 18, 19 }, /* index 17: 12 bits: 11111111111x */
107 { /*-10*/ -25, 20 }, /* index 18: 13 bits: 111111111110x */
108 { 21, 22 }, /* index 19: 13 bits: 111111111111x */
109 { /*-9*/ -24, /*9*/ -6 }, /* index 20: 14 bits: 1111111111101x */
110 { /*10*/ -5, 23 }, /* index 21: 14 bits: 1111111111110x */
111 { 24, 25 }, /* index 22: 14 bits: 1111111111111x */
112 { /*-13*/ -28, /*-11*/ -26 }, /* index 23: 15 bits: 11111111111101x */
113 { /*11*/ -4, /*13*/ -2 }, /* index 24: 15 bits: 11111111111110x */
114 { 26, 27 }, /* index 25: 15 bits: 11111111111111x */
115 { /*-14*/ -29, /*-12*/ -27 }, /* index 26: 16 bits: 111111111111110x */
116 { /*12*/ -3, /*14*/ -1 } /* index 27: 16 bits: 111111111111111x */
117 };
118
119 static const int8_t t_huffman_pan[][2] =
120 {
121 { /*0*/ -15, 1 }, /* index 0: 1 bits: x */
122 { /*-1*/ -16, 2 }, /* index 1: 2 bits: 1x */
123 { /*1*/ -14, 3 }, /* index 2: 3 bits: 11x */
124 { /*-2*/ -17, 4 }, /* index 3: 4 bits: 111x */
125 { /*2*/ -13, 5 }, /* index 4: 5 bits: 1111x */
126 { /*-3*/ -18, 6 }, /* index 5: 6 bits: 11111x */
127 { /*3*/ -12, 7 }, /* index 6: 7 bits: 111111x */
128 { /*-4*/ -19, 8 }, /* index 7: 8 bits: 1111111x */
129 { /*4*/ -11, 9 }, /* index 8: 9 bits: 11111111x */
130 { 10, 11 }, /* index 9: 10 bits: 111111111x */
131 { /*-5*/ -20, /*5*/ -10 }, /* index 10: 11 bits: 1111111110x */
132 { 12, 13 }, /* index 11: 11 bits: 1111111111x */
133 { /*-6*/ -21, /*6*/ -9 }, /* index 12: 12 bits: 11111111110x */
134 { 14, 15 }, /* index 13: 12 bits: 11111111111x */
135 { /*-7*/ -22, /*7*/ -8 }, /* index 14: 13 bits: 111111111110x */
136 { 16, 17 }, /* index 15: 13 bits: 111111111111x */
137 { /*-8*/ -23, /*8*/ -7 }, /* index 16: 14 bits: 1111111111110x */
138 { 18, 19 }, /* index 17: 14 bits: 1111111111111x */
139 { /*-10*/ -25, /*10*/ -5 }, /* index 18: 15 bits: 11111111111110x */
140 { 20, 21 }, /* index 19: 15 bits: 11111111111111x */
141 { /*-9*/ -24, /*9*/ -6 }, /* index 20: 16 bits: 111111111111110x */
142 { 22, 23 }, /* index 21: 16 bits: 111111111111111x */
143 { 24, 25 }, /* index 22: 17 bits: 1111111111111110x */
144 { 26, 27 }, /* index 23: 17 bits: 1111111111111111x */
145 { /*-14*/ -29, /*-13*/ -28 }, /* index 24: 18 bits: 11111111111111100x */
146 { /*-12*/ -27, /*-11*/ -26 }, /* index 25: 18 bits: 11111111111111101x */
147 { /*11*/ -4, /*12*/ -3 }, /* index 26: 18 bits: 11111111111111110x */
148 { /*13*/ -2, /*14*/ -1 } /* index 27: 18 bits: 11111111111111111x */
149 };
150
151 /* There are 3 classes in the standard but the last 2 are identical */
152 static const real_t sa_quant[8][2] =
153 {
154 { FRAC_CONST(0.0000), FRAC_CONST(0.0000) },
155 { FRAC_CONST(0.0501), FRAC_CONST(0.1778) },
156 { FRAC_CONST(0.0706), FRAC_CONST(0.2818) },
157 { FRAC_CONST(0.0995), FRAC_CONST(0.4467) },
158 { FRAC_CONST(0.1399), FRAC_CONST(0.5623) },
159 { FRAC_CONST(0.1957), FRAC_CONST(0.7079) },
160 { FRAC_CONST(0.2713), FRAC_CONST(0.8913) },
161 { FRAC_CONST(0.3699), FRAC_CONST(1.0000) },
162 };
163
164 /* We don't need the actual quantizer values */
165 #if 0
166 static const real_t pan_quant[8][5] =
167 {
168 { COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000) },
169 { COEF_CONST(0.1661), COEF_CONST(0.1661), COEF_CONST(0.3322), COEF_CONST(0.3322), COEF_CONST(0.3322) },
170 { COEF_CONST(0.3322), COEF_CONST(0.3322), COEF_CONST(0.6644), COEF_CONST(0.8305), COEF_CONST(0.8305) },
171 { COEF_CONST(0.4983), COEF_CONST(0.6644), COEF_CONST(0.9966), COEF_CONST(1.4949), COEF_CONST(1.6610) },
172 { COEF_CONST(0.6644), COEF_CONST(0.9966), COEF_CONST(1.4949), COEF_CONST(2.1593), COEF_CONST(2.4914) },
173 { COEF_CONST(0.8305), COEF_CONST(1.3288), COEF_CONST(2.1593), COEF_CONST(2.9897), COEF_CONST(3.4880) },
174 { COEF_CONST(0.9966), COEF_CONST(1.8271), COEF_CONST(2.8236), COEF_CONST(3.8202), COEF_CONST(4.6507) },
175 { COEF_CONST(1.3288), COEF_CONST(2.3253), COEF_CONST(3.4880), COEF_CONST(4.6507), COEF_CONST(5.8134) },
176 };
177 #endif
178
179 /* 2^(pan_quant[x][y] */
180 static const real_t pan_pow_2_pos[8][5] = {
181 { REAL_CONST(1.0000000), REAL_CONST(1.0000000), REAL_CONST(1.0000000), REAL_CONST(1.0000000), REAL_CONST(1.0000000) },
182 { REAL_CONST(1.1220021), REAL_CONST(1.1220021), REAL_CONST(1.2589312), REAL_CONST(1.2589312), REAL_CONST(1.2589312) },
183 { REAL_CONST(1.2589312), REAL_CONST(1.2589312), REAL_CONST(1.5849090), REAL_CONST(1.7783016), REAL_CONST(1.7783016) },
184 { REAL_CONST(1.4125481), REAL_CONST(1.5849090), REAL_CONST(1.9952921), REAL_CONST(2.8184461), REAL_CONST(3.1623565) },
185 { REAL_CONST(1.5849090), REAL_CONST(1.9952922), REAL_CONST(2.8184461), REAL_CONST(4.4669806), REAL_CONST(5.6232337) },
186 { REAL_CONST(1.7783016), REAL_CONST(2.5119365), REAL_CONST(4.4669806), REAL_CONST(7.9430881), REAL_CONST(11.219994) },
187 { REAL_CONST(1.9952921), REAL_CONST(3.5482312), REAL_CONST(7.0792671), REAL_CONST(14.125206), REAL_CONST(25.118876) },
188 { REAL_CONST(2.5119365), REAL_CONST(5.0116998), REAL_CONST(11.219994), REAL_CONST(25.118876), REAL_CONST(56.235140) }
189 };
190
191 /* 2^(-pan_quant[x][y] */
192 static const real_t pan_pow_2_neg[8][5] = {
193 { REAL_CONST(1), REAL_CONST(1), REAL_CONST(1), REAL_CONST(1), REAL_CONST(1) },
194 { REAL_CONST(0.8912487), REAL_CONST(0.8912487), REAL_CONST(0.7943242), REAL_CONST(0.7943242), REAL_CONST(0.7943242) },
195 { REAL_CONST(0.7943242), REAL_CONST(0.7943242), REAL_CONST(0.6309511), REAL_CONST(0.5623344), REAL_CONST(0.5623344) },
196 { REAL_CONST(0.7079405), REAL_CONST(0.6309511), REAL_CONST(0.5011797), REAL_CONST(0.3548054), REAL_CONST(0.3162199) },
197 { REAL_CONST(0.6309511), REAL_CONST(0.5011797), REAL_CONST(0.3548054), REAL_CONST(0.2238649), REAL_CONST(0.1778336) },
198 { REAL_CONST(0.5623343), REAL_CONST(0.3980992), REAL_CONST(0.2238649), REAL_CONST(0.1258956), REAL_CONST(0.0891266) },
199 { REAL_CONST(0.5011797), REAL_CONST(0.2818306), REAL_CONST(0.1412576), REAL_CONST(0.0707954), REAL_CONST(0.0398107) },
200 { REAL_CONST(0.3980992), REAL_CONST(0.1995331), REAL_CONST(0.0891267), REAL_CONST(0.0398107), REAL_CONST(0.0177825) }
201 };
202
203 /* 2^(pan_quant[x][y]/30) */
204 static const real_t pan_pow_2_30_pos[8][5] = {
205 { COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1) },
206 { COEF_CONST(1.003845098), COEF_CONST(1.003845098), COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.007704982) },
207 { COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.01546933), COEF_CONST(1.019373909), COEF_CONST(1.019373909) },
208 { COEF_CONST(1.011579706), COEF_CONST(1.01546933), COEF_CONST(1.023293502), COEF_CONST(1.035142941), COEF_CONST(1.039123167) },
209 { COEF_CONST(1.01546933), COEF_CONST(1.023293502), COEF_CONST(1.035142941), COEF_CONST(1.051155908), COEF_CONST(1.059252598) },
210 { COEF_CONST(1.019373909), COEF_CONST(1.03117796), COEF_CONST(1.051155908), COEF_CONST(1.071518432), COEF_CONST(1.0839263) },
211 { COEF_CONST(1.023293502), COEF_CONST(1.043118698), COEF_CONST(1.067414119), COEF_CONST(1.092277933), COEF_CONST(1.113439626) },
212 { COEF_CONST(1.03117796), COEF_CONST(1.055195268), COEF_CONST(1.0839263), COEF_CONST(1.113439626), COEF_CONST(1.143756546) }
213 };
214
215 /* 2^(-pan_quant[x][y]/30) */
216 static const real_t pan_pow_2_30_neg[8][5] = {
217 { COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1) },
218 { COEF_CONST(0.99616963), COEF_CONST(0.99616963), COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.99235393) },
219 { COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.984766325), COEF_CONST(0.980994305), COEF_CONST(0.980994305) },
220 { COEF_CONST(0.988552848), COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.962349827) },
221 { COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.951333663), COEF_CONST(0.944061881) },
222 { COEF_CONST(0.980994305), COEF_CONST(0.969764715), COEF_CONST(0.951333663), COEF_CONST(0.933255062), COEF_CONST(0.922571949) },
223 { COEF_CONST(0.977236734), COEF_CONST(0.958663671), COEF_CONST(0.936843519), COEF_CONST(0.915517901), COEF_CONST(0.898117847) },
224 { COEF_CONST(0.969764715), COEF_CONST(0.947691892), COEF_CONST(0.922571949), COEF_CONST(0.898117847), COEF_CONST(0.874311936) }
225 };
226
227 static const real_t g_decayslope[MAX_SA_BAND] = {
228 FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.95),FRAC_CONST(0.9), FRAC_CONST(0.85), FRAC_CONST(0.8),
229 FRAC_CONST(0.75),FRAC_CONST(0.7), FRAC_CONST(0.65),FRAC_CONST(0.6), FRAC_CONST(0.55),FRAC_CONST(0.5), FRAC_CONST(0.45),
230 FRAC_CONST(0.4), FRAC_CONST(0.35),FRAC_CONST(0.3), FRAC_CONST(0.25),FRAC_CONST(0.2), FRAC_CONST(0.15), FRAC_CONST(0.1),
231 FRAC_CONST(0.05),FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0),
232 FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0),
233 FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0),
234 FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0)
235 };
236
237 static const real_t sa_sqrt_1_minus[8][2] = {
238 { FRAC_CONST(1), FRAC_CONST(1) },
239 { FRAC_CONST(0.998744206), FRAC_CONST(0.984066644) },
240 { FRAC_CONST(0.997504707), FRAC_CONST(0.959473168) },
241 { FRAC_CONST(0.995037562), FRAC_CONST(0.894683804) },
242 { FRAC_CONST(0.990165638), FRAC_CONST(0.826933317) },
243 { FRAC_CONST(0.980663811), FRAC_CONST(0.706312672) },
244 { FRAC_CONST(0.962494836), FRAC_CONST(0.45341406) },
245 { FRAC_CONST(0.929071574), FRAC_CONST(0) }
246 };
247
248 static const uint8_t sa_freq_scale[9] =
249 {
250 0, 1, 2, 3, 5, 7, 10, 13, 23
251 };
252
253 static const uint8_t pan_freq_scale[21] =
254 {
255 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
256 11, 12, 13, 14, 15, 18, 22, 26, 32, 64
257 };
258
259 static const uint8_t pan_quant_class[20] =
260 {
261 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
262 2, 2, 2, 2, 3, 3, 3, 4, 4, 4
263 };
264
265 /* Inverse mapping lookup */
266 static const uint8_t pan_inv_freq[64] = {
267 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
268 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18,
269 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
270 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19
271 };
272
273 static const uint8_t sa_inv_freq[MAX_SA_BAND] = {
274 0, 1, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6,
275 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
276 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
277 7, 7, 7, 7, 7, 7, 7
278 };
279
280 static const real_t filter_coeff[] =
281 {
282 FRAC_CONST(0.65143905754106),
283 FRAC_CONST(0.56471812200776),
284 FRAC_CONST(0.48954165955695)
285 };
286
287 static const uint8_t delay_length[3] =
288 {
289 3, 4, 5
290 };
291
292 static const real_t delay_fraction[] =
293 {
294 FRAC_CONST(0.43), FRAC_CONST(0.75), FRAC_CONST(0.347)
295 };
296
297 static const real_t peak_decay = FRAC_CONST(0.76592833836465);
298
299 static const real_t smooth_coeff = FRAC_CONST(0.25);
300
301 /* Please note that these are the same tables as in plain PS */
302 static const complex_t Q_Fract_allpass_Qmf[][3] = {
303 { { FRAC_CONST(0.7804303765), FRAC_CONST(0.6252426505) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.8550928831), FRAC_CONST(0.5184748173) } },
304 { { FRAC_CONST(-0.4399392009), FRAC_CONST(0.8980275393) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.0643581524), FRAC_CONST(0.9979268909) } },
305 { { FRAC_CONST(-0.9723699093), FRAC_CONST(-0.2334454209) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.9146071672), FRAC_CONST(0.4043435752) } },
306 { { FRAC_CONST(0.0157073960), FRAC_CONST(-0.9998766184) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.7814115286), FRAC_CONST(-0.6240159869) } },
307 { { FRAC_CONST(0.9792228341), FRAC_CONST(-0.2027871907) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.1920081824), FRAC_CONST(-0.9813933372) } },
308 { { FRAC_CONST(0.4115142524), FRAC_CONST(0.9114032984) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.9589683414), FRAC_CONST(-0.2835132182) } },
309 { { FRAC_CONST(-0.7996847630), FRAC_CONST(0.6004201174) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.6947838664), FRAC_CONST(0.7192186117) } },
310 { { FRAC_CONST(-0.7604058385), FRAC_CONST(-0.6494481564) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.3164770305), FRAC_CONST(0.9486001730) } },
311 { { FRAC_CONST(0.4679299891), FRAC_CONST(-0.8837655187) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.9874414206), FRAC_CONST(0.1579856575) } },
312 { { FRAC_CONST(0.9645573497), FRAC_CONST(0.2638732493) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.5966450572), FRAC_CONST(-0.8025052547) } },
313 { { FRAC_CONST(-0.0471066870), FRAC_CONST(0.9988898635) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.4357025325), FRAC_CONST(-0.9000906944) } },
314 { { FRAC_CONST(-0.9851093888), FRAC_CONST(0.1719288528) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.9995546937), FRAC_CONST(-0.0298405960) } },
315 { { FRAC_CONST(-0.3826831877), FRAC_CONST(-0.9238796234) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.4886211455), FRAC_CONST(0.8724960685) } },
316 { { FRAC_CONST(0.8181498647), FRAC_CONST(-0.5750049949) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.5477093458), FRAC_CONST(0.8366686702) } },
317 { { FRAC_CONST(0.7396308780), FRAC_CONST(0.6730127335) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.9951074123), FRAC_CONST(-0.0987988561) } },
318 { { FRAC_CONST(-0.4954589605), FRAC_CONST(0.8686313629) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.3725017905), FRAC_CONST(-0.9280315042) } },
319 { { FRAC_CONST(-0.9557929039), FRAC_CONST(-0.2940406799) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.6506417990), FRAC_CONST(-0.7593847513) } },
320 { { FRAC_CONST(0.0784594864), FRAC_CONST(-0.9969173074) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.9741733670), FRAC_CONST(0.2258014232) } },
321 { { FRAC_CONST(0.9900237322), FRAC_CONST(-0.1409008205) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.2502108514), FRAC_CONST(0.9681913853) } },
322 { { FRAC_CONST(0.3534744382), FRAC_CONST(0.9354441762) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.7427945137), FRAC_CONST(0.6695194840) } },
323 { { FRAC_CONST(-0.8358076215), FRAC_CONST(0.5490224361) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.9370992780), FRAC_CONST(-0.3490629196) } },
324 { { FRAC_CONST(-0.7181259394), FRAC_CONST(-0.6959131360) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.1237744763), FRAC_CONST(-0.9923103452) } },
325 { { FRAC_CONST(0.5224990249), FRAC_CONST(-0.8526399136) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.8226406574), FRAC_CONST(-0.5685616732) } },
326 { { FRAC_CONST(0.9460852146), FRAC_CONST(0.3239179254) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.8844994903), FRAC_CONST(0.4665412009) } },
327 { { FRAC_CONST(-0.1097348556), FRAC_CONST(0.9939609170) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.0047125919), FRAC_CONST(0.9999889135) } },
328 { { FRAC_CONST(-0.9939610362), FRAC_CONST(0.1097337380) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.8888573647), FRAC_CONST(0.4581840038) } },
329 { { FRAC_CONST(-0.3239168525), FRAC_CONST(-0.9460855722) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.8172453642), FRAC_CONST(-0.5762898922) } },
330 { { FRAC_CONST(0.8526405096), FRAC_CONST(-0.5224980116) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.1331215799), FRAC_CONST(-0.9910997152) } },
331 { { FRAC_CONST(0.6959123611), FRAC_CONST(0.7181267142) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.9403476119), FRAC_CONST(-0.3402152061) } },
332 { { FRAC_CONST(-0.5490233898), FRAC_CONST(0.8358070254) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.7364512086), FRAC_CONST(0.6764906645) } },
333 { { FRAC_CONST(-0.9354437590), FRAC_CONST(-0.3534754813) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.2593250275), FRAC_CONST(0.9657900929) } },
334 { { FRAC_CONST(0.1409019381), FRAC_CONST(-0.9900235534) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.9762582779), FRAC_CONST(0.2166097313) } },
335 { { FRAC_CONST(0.9969173670), FRAC_CONST(-0.0784583688) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.6434556246), FRAC_CONST(-0.7654833794) } },
336 { { FRAC_CONST(0.2940396070), FRAC_CONST(0.9557932615) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.3812320232), FRAC_CONST(-0.9244794250) } },
337 { { FRAC_CONST(-0.8686318994), FRAC_CONST(0.4954580069) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.9959943891), FRAC_CONST(-0.0894154981) } },
338 { { FRAC_CONST(-0.6730118990), FRAC_CONST(-0.7396316528) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.5397993922), FRAC_CONST(0.8417937160) } },
339 { { FRAC_CONST(0.5750059485), FRAC_CONST(-0.8181492686) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.4968227744), FRAC_CONST(0.8678520322) } },
340 { { FRAC_CONST(0.9238792062), FRAC_CONST(0.3826842010) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.9992290139), FRAC_CONST(-0.0392601527) } },
341 { { FRAC_CONST(-0.1719299555), FRAC_CONST(0.9851091504) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.4271997511), FRAC_CONST(-0.9041572809) } },
342 { { FRAC_CONST(-0.9988899231), FRAC_CONST(0.0471055657) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.6041822433), FRAC_CONST(-0.7968461514) } },
343 { { FRAC_CONST(-0.2638721764), FRAC_CONST(-0.9645576477) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.9859085083), FRAC_CONST(0.1672853529) } },
344 { { FRAC_CONST(0.8837660551), FRAC_CONST(-0.4679289758) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.3075223565), FRAC_CONST(0.9515408874) } },
345 { { FRAC_CONST(0.6494473219), FRAC_CONST(0.7604066133) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.7015317082), FRAC_CONST(0.7126382589) } },
346 { { FRAC_CONST(-0.6004210114), FRAC_CONST(0.7996840477) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.9562535882), FRAC_CONST(-0.2925389707) } },
347 { { FRAC_CONST(-0.9114028811), FRAC_CONST(-0.4115152657) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.1827499419), FRAC_CONST(-0.9831594229) } },
348 { { FRAC_CONST(0.2027882934), FRAC_CONST(-0.9792225957) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.7872582674), FRAC_CONST(-0.6166234016) } },
349 { { FRAC_CONST(0.9998766780), FRAC_CONST(-0.0157062728) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.9107555747), FRAC_CONST(0.4129458666) } },
350 { { FRAC_CONST(0.2334443331), FRAC_CONST(0.9723701477) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.0549497530), FRAC_CONST(0.9984891415) } },
351 { { FRAC_CONST(-0.8980280757), FRAC_CONST(0.4399381876) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.8599416018), FRAC_CONST(0.5103924870) } },
352 { { FRAC_CONST(-0.6252418160), FRAC_CONST(-0.7804310918) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.8501682281), FRAC_CONST(-0.5265110731) } },
353 { { FRAC_CONST(0.6252435446), FRAC_CONST(-0.7804297209) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.0737608299), FRAC_CONST(-0.9972759485) } },
354 { { FRAC_CONST(0.8980270624), FRAC_CONST(0.4399402142) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.9183775187), FRAC_CONST(-0.3957053721) } },
355 { { FRAC_CONST(-0.2334465086), FRAC_CONST(0.9723696709) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.7754954696), FRAC_CONST(0.6313531399) } },
356 { { FRAC_CONST(-0.9998766184), FRAC_CONST(-0.0157085191) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.2012493610), FRAC_CONST(0.9795400500) } },
357 { { FRAC_CONST(-0.2027861029), FRAC_CONST(-0.9792230725) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.9615978599), FRAC_CONST(0.2744622827) } },
358 { { FRAC_CONST(0.9114037752), FRAC_CONST(-0.4115132093) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.6879743338), FRAC_CONST(-0.7257350087) } },
359 { { FRAC_CONST(0.6004192233), FRAC_CONST(0.7996854186) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.3254036009), FRAC_CONST(-0.9455752373) } },
360 { { FRAC_CONST(-0.6494490504), FRAC_CONST(0.7604051232) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.9888865948), FRAC_CONST(-0.1486719251) } },
361 { { FRAC_CONST(-0.8837650418), FRAC_CONST(-0.4679309726) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.5890548825), FRAC_CONST(0.8080930114) } },
362 { { FRAC_CONST(0.2638743520), FRAC_CONST(-0.9645570517) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.4441666007), FRAC_CONST(0.8959442377) } },
363 { { FRAC_CONST(0.9988898039), FRAC_CONST(0.0471078083) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.9997915030), FRAC_CONST(0.0204183888) } },
364 { { FRAC_CONST(0.1719277352), FRAC_CONST(0.9851095676) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.4803760946), FRAC_CONST(-0.8770626187) } },
365 { { FRAC_CONST(-0.9238800406), FRAC_CONST(0.3826821446) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.5555707216), FRAC_CONST(-0.8314692974) } },
366 { { FRAC_CONST(-0.5750041008), FRAC_CONST(-0.8181505203) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.9941320419), FRAC_CONST(0.1081734300) } }
367 };
368
369 static const complex_t Phi_Fract_Qmf[] = {
370 { FRAC_CONST(0.8181497455), FRAC_CONST(0.5750052333) },
371 { FRAC_CONST(-0.2638730407), FRAC_CONST(0.9645574093) },
372 { FRAC_CONST(-0.9969173074), FRAC_CONST(0.0784590989) },
373 { FRAC_CONST(-0.4115143716), FRAC_CONST(-0.9114032984) },
374 { FRAC_CONST(0.7181262970), FRAC_CONST(-0.6959127784) },
375 { FRAC_CONST(0.8980275989), FRAC_CONST(0.4399391711) },
376 { FRAC_CONST(-0.1097343117), FRAC_CONST(0.9939609766) },
377 { FRAC_CONST(-0.9723699093), FRAC_CONST(0.2334453613) },
378 { FRAC_CONST(-0.5490227938), FRAC_CONST(-0.8358073831) },
379 { FRAC_CONST(0.6004202366), FRAC_CONST(-0.7996846437) },
380 { FRAC_CONST(0.9557930231), FRAC_CONST(0.2940403223) },
381 { FRAC_CONST(0.0471064523), FRAC_CONST(0.9988898635) },
382 { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) },
383 { FRAC_CONST(-0.6730124950), FRAC_CONST(-0.7396311164) },
384 { FRAC_CONST(0.4679298103), FRAC_CONST(-0.8837656379) },
385 { FRAC_CONST(0.9900236726), FRAC_CONST(0.1409012377) },
386 { FRAC_CONST(0.2027872950), FRAC_CONST(0.9792228341) },
387 { FRAC_CONST(-0.8526401520), FRAC_CONST(0.5224985480) },
388 { FRAC_CONST(-0.7804304361), FRAC_CONST(-0.6252426505) },
389 { FRAC_CONST(0.3239174187), FRAC_CONST(-0.9460853338) },
390 { FRAC_CONST(0.9998766184), FRAC_CONST(-0.0157073177) },
391 { FRAC_CONST(0.3534748554), FRAC_CONST(0.9354440570) },
392 { FRAC_CONST(-0.7604059577), FRAC_CONST(0.6494480371) },
393 { FRAC_CONST(-0.8686315417), FRAC_CONST(-0.4954586625) },
394 { FRAC_CONST(0.1719291061), FRAC_CONST(-0.9851093292) },
395 { FRAC_CONST(0.9851093292), FRAC_CONST(-0.1719291061) },
396 { FRAC_CONST(0.4954586625), FRAC_CONST(0.8686315417) },
397 { FRAC_CONST(-0.6494480371), FRAC_CONST(0.7604059577) },
398 { FRAC_CONST(-0.9354440570), FRAC_CONST(-0.3534748554) },
399 { FRAC_CONST(0.0157073177), FRAC_CONST(-0.9998766184) },
400 { FRAC_CONST(0.9460853338), FRAC_CONST(-0.3239174187) },
401 { FRAC_CONST(0.6252426505), FRAC_CONST(0.7804304361) },
402 { FRAC_CONST(-0.5224985480), FRAC_CONST(0.8526401520) },
403 { FRAC_CONST(-0.9792228341), FRAC_CONST(-0.2027872950) },
404 { FRAC_CONST(-0.1409012377), FRAC_CONST(-0.9900236726) },
405 { FRAC_CONST(0.8837656379), FRAC_CONST(-0.4679298103) },
406 { FRAC_CONST(0.7396311164), FRAC_CONST(0.6730124950) },
407 { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) },
408 { FRAC_CONST(-0.9988898635), FRAC_CONST(-0.0471064523) },
409 { FRAC_CONST(-0.2940403223), FRAC_CONST(-0.9557930231) },
410 { FRAC_CONST(0.7996846437), FRAC_CONST(-0.6004202366) },
411 { FRAC_CONST(0.8358073831), FRAC_CONST(0.5490227938) },
412 { FRAC_CONST(-0.2334453613), FRAC_CONST(0.9723699093) },
413 { FRAC_CONST(-0.9939609766), FRAC_CONST(0.1097343117) },
414 { FRAC_CONST(-0.4399391711), FRAC_CONST(-0.8980275989) },
415 { FRAC_CONST(0.6959127784), FRAC_CONST(-0.7181262970) },
416 { FRAC_CONST(0.9114032984), FRAC_CONST(0.4115143716) },
417 { FRAC_CONST(-0.0784590989), FRAC_CONST(0.9969173074) },
418 { FRAC_CONST(-0.9645574093), FRAC_CONST(0.2638730407) },
419 { FRAC_CONST(-0.5750052333), FRAC_CONST(-0.8181497455) },
420 { FRAC_CONST(0.5750052333), FRAC_CONST(-0.8181497455) },
421 { FRAC_CONST(0.9645574093), FRAC_CONST(0.2638730407) },
422 { FRAC_CONST(0.0784590989), FRAC_CONST(0.9969173074) },
423 { FRAC_CONST(-0.9114032984), FRAC_CONST(0.4115143716) },
424 { FRAC_CONST(-0.6959127784), FRAC_CONST(-0.7181262970) },
425 { FRAC_CONST(0.4399391711), FRAC_CONST(-0.8980275989) },
426 { FRAC_CONST(0.9939609766), FRAC_CONST(0.1097343117) },
427 { FRAC_CONST(0.2334453613), FRAC_CONST(0.9723699093) },
428 { FRAC_CONST(-0.8358073831), FRAC_CONST(0.5490227938) },
429 { FRAC_CONST(-0.7996846437), FRAC_CONST(-0.6004202366) },
430 { FRAC_CONST(0.2940403223), FRAC_CONST(-0.9557930231) },
431 { FRAC_CONST(0.9988898635), FRAC_CONST(-0.0471064523) },
432 { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) },
433 { FRAC_CONST(-0.7396311164), FRAC_CONST(0.6730124950) }
434 };
435
436
437 /* static function declarations */
438 static void drm_ps_sa_element(drm_ps_info *ps, bitfile *ld);
439 static void drm_ps_pan_element(drm_ps_info *ps, bitfile *ld);
440 static int8_t huff_dec(bitfile *ld, drm_ps_huff_tab huff);
441
442
443 uint16_t drm_ps_data(drm_ps_info *ps, bitfile *ld)
444 {
445 uint16_t bits = (uint16_t)faad_get_processed_bits(ld);
446
447 ps->drm_ps_data_available = 1;
448
449 ps->bs_enable_sa = faad_get1bit(ld);
450 ps->bs_enable_pan = faad_get1bit(ld);
451
452 if (ps->bs_enable_sa)
453 {
454 drm_ps_sa_element(ps, ld);
455 }
456
457 if (ps->bs_enable_pan)
458 {
459 drm_ps_pan_element(ps, ld);
460 }
461
462 bits = (uint16_t)faad_get_processed_bits(ld) - bits;
463
464 return bits;
465 }
466
467 static void drm_ps_sa_element(drm_ps_info *ps, bitfile *ld)
468 {
469 drm_ps_huff_tab huff;
470 uint8_t band;
471
472 ps->bs_sa_dt_flag = faad_get1bit(ld);
473 if (ps->bs_sa_dt_flag)
474 {
475 huff = t_huffman_sa;
476 } else {
477 huff = f_huffman_sa;
478 }
479
480 for (band = 0; band < DRM_NUM_SA_BANDS; band++)
481 {
482 ps->bs_sa_data[band] = huff_dec(ld, huff);
483 }
484 }
485
486 static void drm_ps_pan_element(drm_ps_info *ps, bitfile *ld)
487 {
488 drm_ps_huff_tab huff;
489 uint8_t band;
490
491 ps->bs_pan_dt_flag = faad_get1bit(ld);
492 if (ps->bs_pan_dt_flag)
493 {
494 huff = t_huffman_pan;
495 } else {
496 huff = f_huffman_pan;
497 }
498
499 for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
500 {
501 ps->bs_pan_data[band] = huff_dec(ld, huff);
502 }
503 }
504
505 /* binary search huffman decoding */
506 static int8_t huff_dec(bitfile *ld, drm_ps_huff_tab huff)
507 {
508 uint8_t bit;
509 int16_t index = 0;
510
511 while (index >= 0)
512 {
513 bit = (uint8_t)faad_get1bit(ld);
514 index = huff[index][bit];
515 }
516
517 return index + 15;
518 }
519
520
521 static int8_t sa_delta_clip(drm_ps_info *ps, int8_t i)
522 {
523 if (i < 0) {
524 /* printf(" SAminclip %d", i); */
525 ps->sa_decode_error = 1;
526 return 0;
527 } else if (i > 7) {
528 /* printf(" SAmaxclip %d", i); */
529 ps->sa_decode_error = 1;
530 return 7;
531 } else
532 return i;
533 }
534
535 static int8_t pan_delta_clip(drm_ps_info *ps, int8_t i)
536 {
537 if (i < -7) {
538 /* printf(" PANminclip %d", i); */
539 ps->pan_decode_error = 1;
540 return -7;
541 } else if (i > 7) {
542 /* printf(" PANmaxclip %d", i); */
543 ps->pan_decode_error = 1;
544 return 7;
545 } else
546 return i;
547 }
548
549 static void drm_ps_delta_decode(drm_ps_info *ps)
550 {
551 uint8_t band;
552
553 if (ps->bs_enable_sa)
554 {
555 if (ps->bs_sa_dt_flag && !ps->g_last_had_sa)
556 {
557 /* wait until we get a DT frame */
558 ps->bs_enable_sa = 0;
559 } else if (ps->bs_sa_dt_flag) {
560 /* DT frame, we have a last frame, so we can decode */
561 ps->g_sa_index[0] = sa_delta_clip(ps, ps->g_prev_sa_index[0]+ps->bs_sa_data[0]);
562 } else {
563 /* DF always decodable */
564 ps->g_sa_index[0] = sa_delta_clip(ps,ps->bs_sa_data[0]);
565 }
566
567 for (band = 1; band < DRM_NUM_SA_BANDS; band++)
568 {
569 if (ps->bs_sa_dt_flag && ps->g_last_had_sa)
570 {
571 ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_prev_sa_index[band] + ps->bs_sa_data[band]);
572 } else if (!ps->bs_sa_dt_flag) {
573 ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_sa_index[band-1] + ps->bs_sa_data[band]);
574 }
575 }
576 }
577
578 /* An error during SA decoding implies PAN data will be undecodable, too */
579 /* Also, we don't like on/off switching in PS, so we force to last settings */
580 if (ps->sa_decode_error) {
581 ps->pan_decode_error = 1;
582 ps->bs_enable_pan = ps->g_last_had_pan;
583 ps->bs_enable_sa = ps->g_last_had_sa;
584 }
585
586
587 if (ps->bs_enable_sa)
588 {
589 if (ps->sa_decode_error) {
590 for (band = 0; band < DRM_NUM_SA_BANDS; band++)
591 {
592 ps->g_sa_index[band] = ps->g_last_good_sa_index[band];
593 }
594 } else {
595 for (band = 0; band < DRM_NUM_SA_BANDS; band++)
596 {
597 ps->g_last_good_sa_index[band] = ps->g_sa_index[band];
598 }
599 }
600 }
601
602 if (ps->bs_enable_pan)
603 {
604 if (ps->bs_pan_dt_flag && !ps->g_last_had_pan)
605 {
606 ps->bs_enable_pan = 0;
607 } else if (ps->bs_pan_dt_flag) {
608 ps->g_pan_index[0] = pan_delta_clip(ps, ps->g_prev_pan_index[0]+ps->bs_pan_data[0]);
609 } else {
610 ps->g_pan_index[0] = pan_delta_clip(ps, ps->bs_pan_data[0]);
611 }
612
613 for (band = 1; band < DRM_NUM_PAN_BANDS; band++)
614 {
615 if (ps->bs_pan_dt_flag && ps->g_last_had_pan)
616 {
617 ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_prev_pan_index[band] + ps->bs_pan_data[band]);
618 } else if (!ps->bs_pan_dt_flag) {
619 ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_pan_index[band-1] + ps->bs_pan_data[band]);
620 }
621 }
622
623 if (ps->pan_decode_error) {
624 for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
625 {
626 ps->g_pan_index[band] = ps->g_last_good_pan_index[band];
627 }
628 } else {
629 for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
630 {
631 ps->g_last_good_pan_index[band] = ps->g_pan_index[band];
632 }
633 }
634 }
635 }
636
637 static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64])
638 {
639 uint8_t s, b, k;
640 complex_t qfrac, tmp0, tmp, in, R0;
641 real_t peakdiff;
642 real_t nrg;
643 real_t power;
644 real_t transratio;
645 real_t new_delay_slopes[NUM_OF_LINKS];
646 uint8_t temp_delay_ser[NUM_OF_LINKS];
647 complex_t Phi_Fract;
648 #ifdef FIXED_POINT
649 uint32_t in_re, in_im;
650 #endif
651
652 for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++)
653 {
654 /* set delay indices */
655 for (k = 0; k < NUM_OF_LINKS; k++)
656 temp_delay_ser[k] = ps->delay_buf_index_ser[k];
657
658 RE(Phi_Fract) = RE(Phi_Fract_Qmf[b]);
659 IM(Phi_Fract) = IM(Phi_Fract_Qmf[b]);
660
661 for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
662 {
663 const real_t gamma = REAL_CONST(1.5);
664 const real_t sigma = REAL_CONST(1.5625);
665
666 RE(in) = QMF_RE(X[s][b]);
667 IM(in) = QMF_IM(X[s][b]);
668
669 #ifdef FIXED_POINT
670 /* NOTE: all input is scaled by 2^(-5) because of fixed point QMF
671 * meaning that P will be scaled by 2^(-10) compared to floating point version
672 */
673 in_re = ((abs(RE(in))+(1<<(REAL_BITS-1)))>>REAL_BITS);
674 in_im = ((abs(IM(in))+(1<<(REAL_BITS-1)))>>REAL_BITS);
675 power = in_re*in_re + in_im*in_im;
676 #else
677 power = MUL_R(RE(in),RE(in)) + MUL_R(IM(in),IM(in));
678 #endif
679
680 ps->peakdecay_fast[b] = MUL_F(ps->peakdecay_fast[b], peak_decay);
681 if (ps->peakdecay_fast[b] < power)
682 ps->peakdecay_fast[b] = power;
683
684 peakdiff = ps->prev_peakdiff[b];
685 peakdiff += MUL_F((ps->peakdecay_fast[b] - power - ps->prev_peakdiff[b]), smooth_coeff);
686 ps->prev_peakdiff[b] = peakdiff;
687
688 nrg = ps->prev_nrg[b];
689 nrg += MUL_F((power - ps->prev_nrg[b]), smooth_coeff);
690 ps->prev_nrg[b] = nrg;
691
692 if (MUL_R(peakdiff, gamma) <= nrg) {
693 transratio = sigma;
694 } else {
695 transratio = MUL_R(DIV_R(nrg, MUL_R(peakdiff, gamma)), sigma);
696 }
697
698 for (k = 0; k < NUM_OF_LINKS; k++)
699 {
700 new_delay_slopes[k] = MUL_F(g_decayslope[b], filter_coeff[k]);
701 }
702
703 RE(tmp0) = RE(ps->d_buff[0][b]);
704 IM(tmp0) = IM(ps->d_buff[0][b]);
705
706 RE(ps->d_buff[0][b]) = RE(ps->d_buff[1][b]);
707 IM(ps->d_buff[0][b]) = IM(ps->d_buff[1][b]);
708
709 RE(ps->d_buff[1][b]) = RE(in);
710 IM(ps->d_buff[1][b]) = IM(in);
711
712 ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
713
714 RE(R0) = RE(tmp);
715 IM(R0) = IM(tmp);
716
717 for (k = 0; k < NUM_OF_LINKS; k++)
718 {
719 RE(qfrac) = RE(Q_Fract_allpass_Qmf[b][k]);
720 IM(qfrac) = IM(Q_Fract_allpass_Qmf[b][k]);
721
722 RE(tmp0) = RE(ps->d2_buff[k][temp_delay_ser[k]][b]);
723 IM(tmp0) = IM(ps->d2_buff[k][temp_delay_ser[k]][b]);
724
725 ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(qfrac), IM(qfrac));
726
727 RE(tmp) += -MUL_F(new_delay_slopes[k], RE(R0));
728 IM(tmp) += -MUL_F(new_delay_slopes[k], IM(R0));
729
730 RE(ps->d2_buff[k][temp_delay_ser[k]][b]) = RE(R0) + MUL_F(new_delay_slopes[k], RE(tmp));
731 IM(ps->d2_buff[k][temp_delay_ser[k]][b]) = IM(R0) + MUL_F(new_delay_slopes[k], IM(tmp));
732
733 RE(R0) = RE(tmp);
734 IM(R0) = IM(tmp);
735 }
736
737 QMF_RE(ps->SA[s][b]) = MUL_R(RE(R0), transratio);
738 QMF_IM(ps->SA[s][b]) = MUL_R(IM(R0), transratio);
739
740 for (k = 0; k < NUM_OF_LINKS; k++)
741 {
742 if (++temp_delay_ser[k] >= delay_length[k])
743 temp_delay_ser[k] = 0;
744 }
745 }
746 }
747
748 for (k = 0; k < NUM_OF_LINKS; k++)
749 ps->delay_buf_index_ser[k] = temp_delay_ser[k];
750 }
751
752 static void drm_add_ambiance(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64])
753 {
754 uint8_t s, b, ifreq, qclass;
755 real_t sa_map[MAX_SA_BAND], sa_dir_map[MAX_SA_BAND], k_sa_map[MAX_SA_BAND], k_sa_dir_map[MAX_SA_BAND];
756 real_t new_dir_map, new_sa_map;
757
758 if (ps->bs_enable_sa)
759 {
760 /* Instead of dequantization and mapping, we use an inverse mapping
761 to look up all the values we need */
762 for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++)
763 {
764 const real_t inv_f_num_of_subsamples = FRAC_CONST(0.03333333333);
765
766 ifreq = sa_inv_freq[b];
767 qclass = (b != 0);
768
769 sa_map[b] = sa_quant[ps->g_prev_sa_index[ifreq]][qclass];
770 new_sa_map = sa_quant[ps->g_sa_index[ifreq]][qclass];
771
772 k_sa_map[b] = MUL_F(inv_f_num_of_subsamples, (new_sa_map - sa_map[b]));
773
774 sa_dir_map[b] = sa_sqrt_1_minus[ps->g_prev_sa_index[ifreq]][qclass];
775 new_dir_map = sa_sqrt_1_minus[ps->g_sa_index[ifreq]][qclass];
776
777 k_sa_dir_map[b] = MUL_F(inv_f_num_of_subsamples, (new_dir_map - sa_dir_map[b]));
778
779 }
780
781 for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
782 {
783 for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++)
784 {
785 QMF_RE(X_right[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]);
786 QMF_IM(X_right[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]);
787 QMF_RE(X_left[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) + MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]);
788 QMF_IM(X_left[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) + MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]);
789
790 sa_map[b] += k_sa_map[b];
791 sa_dir_map[b] += k_sa_dir_map[b];
792 }
793 for (b = sa_freq_scale[DRM_NUM_SA_BANDS]; b < NUM_OF_QMF_CHANNELS; b++)
794 {
795 QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]);
796 QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]);
797 }
798 }
799 }
800 else {
801 for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
802 {
803 for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
804 {
805 QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]);
806 QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]);
807 }
808 }
809 }
810 }
811
812 static void drm_add_pan(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64])
813 {
814 uint8_t s, b, qclass, ifreq;
815 real_t tmp, coeff1, coeff2;
816 real_t pan_base[MAX_PAN_BAND];
817 real_t pan_delta[MAX_PAN_BAND];
818 qmf_t temp_l, temp_r;
819
820 if (ps->bs_enable_pan)
821 {
822 for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
823 {
824 /* Instead of dequantization, 20->64 mapping and 2^G(x,y) we do an
825 inverse mapping 64->20 and look up the 2^G(x,y) values directly */
826 ifreq = pan_inv_freq[b];
827 qclass = pan_quant_class[ifreq];
828
829 if (ps->g_prev_pan_index[ifreq] >= 0)
830 {
831 pan_base[b] = pan_pow_2_pos[ps->g_prev_pan_index[ifreq]][qclass];
832 } else {
833 pan_base[b] = pan_pow_2_neg[-ps->g_prev_pan_index[ifreq]][qclass];
834 }
835
836 /* 2^((a-b)/30) = 2^(a/30) * 1/(2^(b/30)) */
837 /* a en b can be negative so we may need to inverse parts */
838 if (ps->g_pan_index[ifreq] >= 0)
839 {
840 if (ps->g_prev_pan_index[ifreq] >= 0)
841 {
842 pan_delta[b] = MUL_C(pan_pow_2_30_pos[ps->g_pan_index[ifreq]][qclass],
843 pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]);
844 } else {
845 pan_delta[b] = MUL_C(pan_pow_2_30_pos[ps->g_pan_index[ifreq]][qclass],
846 pan_pow_2_30_pos[-ps->g_prev_pan_index[ifreq]][qclass]);
847 }
848 } else {
849 if (ps->g_prev_pan_index[ifreq] >= 0)
850 {
851 pan_delta[b] = MUL_C(pan_pow_2_30_neg[-ps->g_pan_index[ifreq]][qclass],
852 pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]);
853 } else {
854 pan_delta[b] = MUL_C(pan_pow_2_30_neg[-ps->g_pan_index[ifreq]][qclass],
855 pan_pow_2_30_pos[-ps->g_prev_pan_index[ifreq]][qclass]);
856 }
857 }
858 }
859
860 for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
861 {
862 /* PAN always uses all 64 channels */
863 for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
864 {
865 tmp = pan_base[b];
866
867 coeff2 = DIV_R(REAL_CONST(2.0), (REAL_CONST(1.0) + tmp));
868 coeff1 = MUL_R(coeff2, tmp);
869
870 QMF_RE(temp_l) = QMF_RE(X_left[s][b]);
871 QMF_IM(temp_l) = QMF_IM(X_left[s][b]);
872 QMF_RE(temp_r) = QMF_RE(X_right[s][b]);
873 QMF_IM(temp_r) = QMF_IM(X_right[s][b]);
874
875 QMF_RE(X_left[s][b]) = MUL_R(QMF_RE(temp_l), coeff1);
876 QMF_IM(X_left[s][b]) = MUL_R(QMF_IM(temp_l), coeff1);
877 QMF_RE(X_right[s][b]) = MUL_R(QMF_RE(temp_r), coeff2);
878 QMF_IM(X_right[s][b]) = MUL_R(QMF_IM(temp_r), coeff2);
879
880 /* 2^(a+k*b) = 2^a * 2^b * ... * 2^b */
881 /* ^^^^^^^^^^^^^^^ k times */
882 pan_base[b] = MUL_C(pan_base[b], pan_delta[b]);
883 }
884 }
885 }
886 }
887
888 drm_ps_info *drm_ps_init(void)
889 {
890 drm_ps_info *ps = (drm_ps_info*)faad_malloc(sizeof(drm_ps_info));
891
892 memset(ps, 0, sizeof(drm_ps_info));
893
894 return ps;
895 }
896
897 void drm_ps_free(drm_ps_info *ps)
898 {
899 faad_free(ps);
900 }
901
902 /* main DRM PS decoding function */
903 uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, qmf_t X_left[38][64], qmf_t X_right[38][64])
904 {
905 if (ps == NULL)
906 {
907 memcpy(X_right, X_left, sizeof(qmf_t)*30*64);
908 return 0;
909 }
910
911 if (!ps->drm_ps_data_available && !guess)
912 {
913 memcpy(X_right, X_left, sizeof(qmf_t)*30*64);
914 memset(ps->g_prev_sa_index, 0, sizeof(ps->g_prev_sa_index));
915 memset(ps->g_prev_pan_index, 0, sizeof(ps->g_prev_pan_index));
916 return 0;
917 }
918
919 /* if SBR CRC doesn't match out, we can assume decode errors to start with,
920 and we'll guess what the parameters should be */
921 if (!guess)
922 {
923 ps->sa_decode_error = 0;
924 ps->pan_decode_error = 0;
925 drm_ps_delta_decode(ps);
926 } else
927 {
928 ps->sa_decode_error = 1;
929 ps->pan_decode_error = 1;
930 /* don't even bother decoding */
931 }
932
933 ps->drm_ps_data_available = 0;
934
935 drm_calc_sa_side_signal(ps, X_left);
936 drm_add_ambiance(ps, X_left, X_right);
937
938 if (ps->bs_enable_sa)
939 {
940 ps->g_last_had_sa = 1;
941
942 memcpy(ps->g_prev_sa_index, ps->g_sa_index, sizeof(int8_t) * DRM_NUM_SA_BANDS);
943
944 } else {
945 ps->g_last_had_sa = 0;
946 }
947
948 if (ps->bs_enable_pan)
949 {
950 drm_add_pan(ps, X_left, X_right);
951
952 ps->g_last_had_pan = 1;
953
954 memcpy(ps->g_prev_pan_index, ps->g_pan_index, sizeof(int8_t) * DRM_NUM_PAN_BANDS);
955
956 } else {
957 ps->g_last_had_pan = 0;
958 }
959
960
961 return 0;
962 }
963
964 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: drm_dec.h,v 1.8 2007/11/01 12:33:30 menno Exp $
28 **/
29
30 #ifndef __DRM_DEC_H__
31 #define __DRM_DEC_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #include "bits.h"
38
39 #define DRM_PARAMETRIC_STEREO 0
40 #define DRM_NUM_SA_BANDS 8
41 #define DRM_NUM_PAN_BANDS 20
42 #define NUM_OF_LINKS 3
43 #define NUM_OF_QMF_CHANNELS 64
44 #define NUM_OF_SUBSAMPLES 30
45 #define MAX_SA_BAND 46
46 #define MAX_PAN_BAND 64
47 #define MAX_DELAY 5
48
49 typedef struct
50 {
51 uint8_t drm_ps_data_available;
52 uint8_t bs_enable_sa;
53 uint8_t bs_enable_pan;
54
55 uint8_t bs_sa_dt_flag;
56 uint8_t bs_pan_dt_flag;
57
58 uint8_t g_last_had_sa;
59 uint8_t g_last_had_pan;
60
61 int8_t bs_sa_data[DRM_NUM_SA_BANDS];
62 int8_t bs_pan_data[DRM_NUM_PAN_BANDS];
63
64 int8_t g_sa_index[DRM_NUM_SA_BANDS];
65 int8_t g_pan_index[DRM_NUM_PAN_BANDS];
66 int8_t g_prev_sa_index[DRM_NUM_SA_BANDS];
67 int8_t g_prev_pan_index[DRM_NUM_PAN_BANDS];
68
69 int8_t sa_decode_error;
70 int8_t pan_decode_error;
71
72 int8_t g_last_good_sa_index[DRM_NUM_SA_BANDS];
73 int8_t g_last_good_pan_index[DRM_NUM_PAN_BANDS];
74
75 qmf_t SA[NUM_OF_SUBSAMPLES][MAX_SA_BAND];
76
77 complex_t d_buff[2][MAX_SA_BAND];
78 complex_t d2_buff[NUM_OF_LINKS][MAX_DELAY][MAX_SA_BAND];
79
80 uint8_t delay_buf_index_ser[NUM_OF_LINKS];
81
82 real_t prev_nrg[MAX_SA_BAND];
83 real_t prev_peakdiff[MAX_SA_BAND];
84 real_t peakdecay_fast[MAX_SA_BAND];
85 } drm_ps_info;
86
87
88 uint16_t drm_ps_data(drm_ps_info *ps, bitfile *ld);
89
90 drm_ps_info *drm_ps_init(void);
91 void drm_ps_free(drm_ps_info *ps);
92
93 uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, qmf_t X_left[38][64], qmf_t X_right[38][64]);
94
95 #ifdef __cplusplus
96 }
97 #endif
98 #endif
99
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: error.c,v 1.32 2007/11/01 12:33:30 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "error.h"
32
33 char *err_msg[] = {
34 "No error",
35 "Gain control not yet implemented",
36 "Pulse coding not allowed in short blocks",
37 "Invalid huffman codebook",
38 "Scalefactor out of range",
39 "Unable to find ADTS syncword",
40 "Channel coupling not yet implemented",
41 "Channel configuration not allowed in error resilient frame",
42 "Bit error in error resilient scalefactor decoding",
43 "Error decoding huffman scalefactor (bitstream error)",
44 "Error decoding huffman codeword (bitstream error)",
45 "Non existent huffman codebook number found",
46 "Invalid number of channels",
47 "Maximum number of bitstream elements exceeded",
48 "Input data buffer too small",
49 "Array index out of range",
50 "Maximum number of scalefactor bands exceeded",
51 "Quantised value out of range",
52 "LTP lag out of range",
53 "Invalid SBR parameter decoded",
54 "SBR called without being initialised",
55 "Unexpected channel configuration change",
56 "Error in program_config_element",
57 "First SBR frame is not the same as first AAC frame",
58 "Unexpected fill element with SBR data",
59 "Not all elements were provided with SBR data",
60 "LTP decoding not available",
61 "Output data buffer too small",
62 "CRC error in DRM data",
63 "PNS not allowed in DRM data stream",
64 "No standard extension payload allowed in DRM",
65 "PCE shall be the first element in a frame",
66 "Bitstream value not allowed by specification"
67 };
68
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: error.h,v 1.26 2007/11/01 12:33:30 menno Exp $
28 **/
29
30 #ifndef __ERROR_H__
31 #define __ERROR_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #define NUM_ERROR_MESSAGES 33
38 extern char *err_msg[];
39
40 #ifdef __cplusplus
41 }
42 #endif
43 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: filtbank.c,v 1.45 2007/11/01 12:33:30 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #include <stdlib.h>
34 #include <string.h>
35 #ifdef _WIN32_WCE
36 #define assert(x)
37 #else
38 #include <assert.h>
39 #endif
40
41 #include "filtbank.h"
42 #include "decoder.h"
43 #include "syntax.h"
44 #include "kbd_win.h"
45 #include "sine_win.h"
46 #include "mdct.h"
47
48
49 fb_info *filter_bank_init(uint16_t frame_len)
50 {
51 uint16_t nshort = frame_len/8;
52 #ifdef LD_DEC
53 uint16_t frame_len_ld = frame_len/2;
54 #endif
55
56 fb_info *fb = (fb_info*)faad_malloc(sizeof(fb_info));
57 memset(fb, 0, sizeof(fb_info));
58
59 /* normal */
60 fb->mdct256 = faad_mdct_init(2*nshort);
61 fb->mdct2048 = faad_mdct_init(2*frame_len);
62 #ifdef LD_DEC
63 /* LD */
64 fb->mdct1024 = faad_mdct_init(2*frame_len_ld);
65 #endif
66
67 #ifdef ALLOW_SMALL_FRAMELENGTH
68 if (frame_len == 1024)
69 {
70 #endif
71 fb->long_window[0] = sine_long_1024;
72 fb->short_window[0] = sine_short_128;
73 fb->long_window[1] = kbd_long_1024;
74 fb->short_window[1] = kbd_short_128;
75 #ifdef LD_DEC
76 fb->ld_window[0] = sine_mid_512;
77 fb->ld_window[1] = ld_mid_512;
78 #endif
79 #ifdef ALLOW_SMALL_FRAMELENGTH
80 } else /* (frame_len == 960) */ {
81 fb->long_window[0] = sine_long_960;
82 fb->short_window[0] = sine_short_120;
83 fb->long_window[1] = kbd_long_960;
84 fb->short_window[1] = kbd_short_120;
85 #ifdef LD_DEC
86 fb->ld_window[0] = sine_mid_480;
87 fb->ld_window[1] = ld_mid_480;
88 #endif
89 }
90 #endif
91
92 return fb;
93 }
94
95 void filter_bank_end(fb_info *fb)
96 {
97 if (fb != NULL)
98 {
99 #ifdef PROFILE
100 printf("FB: %I64d cycles\n", fb->cycles);
101 #endif
102
103 faad_mdct_end(fb->mdct256);
104 faad_mdct_end(fb->mdct2048);
105 #ifdef LD_DEC
106 faad_mdct_end(fb->mdct1024);
107 #endif
108
109 faad_free(fb);
110 }
111 }
112
113 static INLINE void imdct_long(fb_info *fb, real_t *in_data, real_t *out_data, uint16_t len)
114 {
115 #ifdef LD_DEC
116 mdct_info *mdct = NULL;
117
118 switch (len)
119 {
120 case 2048:
121 case 1920:
122 mdct = fb->mdct2048;
123 break;
124 case 1024:
125 case 960:
126 mdct = fb->mdct1024;
127 break;
128 }
129
130 faad_imdct(mdct, in_data, out_data);
131 #else
132 faad_imdct(fb->mdct2048, in_data, out_data);
133 #endif
134 }
135
136
137 #ifdef LTP_DEC
138 static INLINE void mdct(fb_info *fb, real_t *in_data, real_t *out_data, uint16_t len)
139 {
140 mdct_info *mdct = NULL;
141
142 switch (len)
143 {
144 case 2048:
145 case 1920:
146 mdct = fb->mdct2048;
147 break;
148 case 256:
149 case 240:
150 mdct = fb->mdct256;
151 break;
152 #ifdef LD_DEC
153 case 1024:
154 case 960:
155 mdct = fb->mdct1024;
156 break;
157 #endif
158 }
159
160 faad_mdct(mdct, in_data, out_data);
161 }
162 #endif
163
164 void ifilter_bank(fb_info *fb, uint8_t window_sequence, uint8_t window_shape,
165 uint8_t window_shape_prev, real_t *freq_in,
166 real_t *time_out, real_t *overlap,
167 uint8_t object_type, uint16_t frame_len)
168 {
169 int16_t i;
170 ALIGN real_t transf_buf[2*1024] = {0};
171
172 const real_t *window_long = NULL;
173 const real_t *window_long_prev = NULL;
174 const real_t *window_short = NULL;
175 const real_t *window_short_prev = NULL;
176
177 uint16_t nlong = frame_len;
178 uint16_t nshort = frame_len/8;
179 uint16_t trans = nshort/2;
180
181 uint16_t nflat_ls = (nlong-nshort)/2;
182
183 #ifdef PROFILE
184 int64_t count = faad_get_ts();
185 #endif
186
187 /* select windows of current frame and previous frame (Sine or KBD) */
188 #ifdef LD_DEC
189 if (object_type == LD)
190 {
191 window_long = fb->ld_window[window_shape];
192 window_long_prev = fb->ld_window[window_shape_prev];
193 } else {
194 #endif
195 window_long = fb->long_window[window_shape];
196 window_long_prev = fb->long_window[window_shape_prev];
197 window_short = fb->short_window[window_shape];
198 window_short_prev = fb->short_window[window_shape_prev];
199 #ifdef LD_DEC
200 }
201 #endif
202
203 #if 0
204 for (i = 0; i < 1024; i++)
205 {
206 printf("%d\n", freq_in[i]);
207 }
208 #endif
209
210 #if 0
211 printf("%d %d\n", window_sequence, window_shape);
212 #endif
213
214 switch (window_sequence)
215 {
216 case ONLY_LONG_SEQUENCE:
217 /* perform iMDCT */
218 imdct_long(fb, freq_in, transf_buf, 2*nlong);
219
220 /* add second half output of previous frame to windowed output of current frame */
221 for (i = 0; i < nlong; i+=4)
222 {
223 time_out[i] = overlap[i] + MUL_F(transf_buf[i],window_long_prev[i]);
224 time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]);
225 time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]);
226 time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]);
227 }
228
229 /* window the second half and save as overlap for next frame */
230 for (i = 0; i < nlong; i+=4)
231 {
232 overlap[i] = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]);
233 overlap[i+1] = MUL_F(transf_buf[nlong+i+1],window_long[nlong-2-i]);
234 overlap[i+2] = MUL_F(transf_buf[nlong+i+2],window_long[nlong-3-i]);
235 overlap[i+3] = MUL_F(transf_buf[nlong+i+3],window_long[nlong-4-i]);
236 }
237 break;
238
239 case LONG_START_SEQUENCE:
240 /* perform iMDCT */
241 imdct_long(fb, freq_in, transf_buf, 2*nlong);
242
243 /* add second half output of previous frame to windowed output of current frame */
244 for (i = 0; i < nlong; i+=4)
245 {
246 time_out[i] = overlap[i] + MUL_F(transf_buf[i],window_long_prev[i]);
247 time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]);
248 time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]);
249 time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]);
250 }
251
252 /* window the second half and save as overlap for next frame */
253 /* construct second half window using padding with 1's and 0's */
254 for (i = 0; i < nflat_ls; i++)
255 overlap[i] = transf_buf[nlong+i];
256 for (i = 0; i < nshort; i++)
257 overlap[nflat_ls+i] = MUL_F(transf_buf[nlong+nflat_ls+i],window_short[nshort-i-1]);
258 for (i = 0; i < nflat_ls; i++)
259 overlap[nflat_ls+nshort+i] = 0;
260 break;
261
262 case EIGHT_SHORT_SEQUENCE:
263 /* perform iMDCT for each short block */
264 faad_imdct(fb->mdct256, freq_in+0*nshort, transf_buf+2*nshort*0);
265 faad_imdct(fb->mdct256, freq_in+1*nshort, transf_buf+2*nshort*1);
266 faad_imdct(fb->mdct256, freq_in+2*nshort, transf_buf+2*nshort*2);
267 faad_imdct(fb->mdct256, freq_in+3*nshort, transf_buf+2*nshort*3);
268 faad_imdct(fb->mdct256, freq_in+4*nshort, transf_buf+2*nshort*4);
269 faad_imdct(fb->mdct256, freq_in+5*nshort, transf_buf+2*nshort*5);
270 faad_imdct(fb->mdct256, freq_in+6*nshort, transf_buf+2*nshort*6);
271 faad_imdct(fb->mdct256, freq_in+7*nshort, transf_buf+2*nshort*7);
272
273 /* add second half output of previous frame to windowed output of current frame */
274 for (i = 0; i < nflat_ls; i++)
275 time_out[i] = overlap[i];
276 for(i = 0; i < nshort; i++)
277 {
278 time_out[nflat_ls+ i] = overlap[nflat_ls+ i] + MUL_F(transf_buf[nshort*0+i],window_short_prev[i]);
279 time_out[nflat_ls+1*nshort+i] = overlap[nflat_ls+nshort*1+i] + MUL_F(transf_buf[nshort*1+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*2+i],window_short[i]);
280 time_out[nflat_ls+2*nshort+i] = overlap[nflat_ls+nshort*2+i] + MUL_F(transf_buf[nshort*3+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*4+i],window_short[i]);
281 time_out[nflat_ls+3*nshort+i] = overlap[nflat_ls+nshort*3+i] + MUL_F(transf_buf[nshort*5+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*6+i],window_short[i]);
282 if (i < trans)
283 time_out[nflat_ls+4*nshort+i] = overlap[nflat_ls+nshort*4+i] + MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]);
284 }
285
286 /* window the second half and save as overlap for next frame */
287 for(i = 0; i < nshort; i++)
288 {
289 if (i >= trans)
290 overlap[nflat_ls+4*nshort+i-nlong] = MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]);
291 overlap[nflat_ls+5*nshort+i-nlong] = MUL_F(transf_buf[nshort*9+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*10+i],window_short[i]);
292 overlap[nflat_ls+6*nshort+i-nlong] = MUL_F(transf_buf[nshort*11+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*12+i],window_short[i]);
293 overlap[nflat_ls+7*nshort+i-nlong] = MUL_F(transf_buf[nshort*13+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*14+i],window_short[i]);
294 overlap[nflat_ls+8*nshort+i-nlong] = MUL_F(transf_buf[nshort*15+i],window_short[nshort-1-i]);
295 }
296 for (i = 0; i < nflat_ls; i++)
297 overlap[nflat_ls+nshort+i] = 0;
298 break;
299
300 case LONG_STOP_SEQUENCE:
301 /* perform iMDCT */
302 imdct_long(fb, freq_in, transf_buf, 2*nlong);
303
304 /* add second half output of previous frame to windowed output of current frame */
305 /* construct first half window using padding with 1's and 0's */
306 for (i = 0; i < nflat_ls; i++)
307 time_out[i] = overlap[i];
308 for (i = 0; i < nshort; i++)
309 time_out[nflat_ls+i] = overlap[nflat_ls+i] + MUL_F(transf_buf[nflat_ls+i],window_short_prev[i]);
310 for (i = 0; i < nflat_ls; i++)
311 time_out[nflat_ls+nshort+i] = overlap[nflat_ls+nshort+i] + transf_buf[nflat_ls+nshort+i];
312
313 /* window the second half and save as overlap for next frame */
314 for (i = 0; i < nlong; i++)
315 overlap[i] = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]);
316 break;
317 }
318
319 #if 0
320 for (i = 0; i < 1024; i++)
321 {
322 printf("%d\n", time_out[i]);
323 //printf("0x%.8X\n", time_out[i]);
324 }
325 #endif
326
327
328 #ifdef PROFILE
329 count = faad_get_ts() - count;
330 fb->cycles += count;
331 #endif
332 }
333
334
335 #ifdef LTP_DEC
336 /* only works for LTP -> no overlapping, no short blocks */
337 void filter_bank_ltp(fb_info *fb, uint8_t window_sequence, uint8_t window_shape,
338 uint8_t window_shape_prev, real_t *in_data, real_t *out_mdct,
339 uint8_t object_type, uint16_t frame_len)
340 {
341 int16_t i;
342 ALIGN real_t windowed_buf[2*1024] = {0};
343
344 const real_t *window_long = NULL;
345 const real_t *window_long_prev = NULL;
346 const real_t *window_short = NULL;
347 const real_t *window_short_prev = NULL;
348
349 uint16_t nlong = frame_len;
350 uint16_t nshort = frame_len/8;
351 uint16_t nflat_ls = (nlong-nshort)/2;
352
353 assert(window_sequence != EIGHT_SHORT_SEQUENCE);
354
355 #ifdef LD_DEC
356 if (object_type == LD)
357 {
358 window_long = fb->ld_window[window_shape];
359 window_long_prev = fb->ld_window[window_shape_prev];
360 } else {
361 #endif
362 window_long = fb->long_window[window_shape];
363 window_long_prev = fb->long_window[window_shape_prev];
364 window_short = fb->short_window[window_shape];
365 window_short_prev = fb->short_window[window_shape_prev];
366 #ifdef LD_DEC
367 }
368 #endif
369
370 switch(window_sequence)
371 {
372 case ONLY_LONG_SEQUENCE:
373 for (i = nlong-1; i >= 0; i--)
374 {
375 windowed_buf[i] = MUL_F(in_data[i], window_long_prev[i]);
376 windowed_buf[i+nlong] = MUL_F(in_data[i+nlong], window_long[nlong-1-i]);
377 }
378 mdct(fb, windowed_buf, out_mdct, 2*nlong);
379 break;
380
381 case LONG_START_SEQUENCE:
382 for (i = 0; i < nlong; i++)
383 windowed_buf[i] = MUL_F(in_data[i], window_long_prev[i]);
384 for (i = 0; i < nflat_ls; i++)
385 windowed_buf[i+nlong] = in_data[i+nlong];
386 for (i = 0; i < nshort; i++)
387 windowed_buf[i+nlong+nflat_ls] = MUL_F(in_data[i+nlong+nflat_ls], window_short[nshort-1-i]);
388 for (i = 0; i < nflat_ls; i++)
389 windowed_buf[i+nlong+nflat_ls+nshort] = 0;
390 mdct(fb, windowed_buf, out_mdct, 2*nlong);
391 break;
392
393 case LONG_STOP_SEQUENCE:
394 for (i = 0; i < nflat_ls; i++)
395 windowed_buf[i] = 0;
396 for (i = 0; i < nshort; i++)
397 windowed_buf[i+nflat_ls] = MUL_F(in_data[i+nflat_ls], window_short_prev[i]);
398 for (i = 0; i < nflat_ls; i++)
399 windowed_buf[i+nflat_ls+nshort] = in_data[i+nflat_ls+nshort];
400 for (i = 0; i < nlong; i++)
401 windowed_buf[i+nlong] = MUL_F(in_data[i+nlong], window_long[nlong-1-i]);
402 mdct(fb, windowed_buf, out_mdct, 2*nlong);
403 break;
404 }
405 }
406 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: filtbank.h,v 1.27 2007/11/01 12:33:30 menno Exp $
28 **/
29
30 #ifndef __FILTBANK_H__
31 #define __FILTBANK_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37
38 fb_info *filter_bank_init(uint16_t frame_len);
39 void filter_bank_end(fb_info *fb);
40
41 #ifdef LTP_DEC
42 void filter_bank_ltp(fb_info *fb,
43 uint8_t window_sequence,
44 uint8_t window_shape,
45 uint8_t window_shape_prev,
46 real_t *in_data,
47 real_t *out_mdct,
48 uint8_t object_type,
49 uint16_t frame_len);
50 #endif
51
52 void ifilter_bank(fb_info *fb, uint8_t window_sequence, uint8_t window_shape,
53 uint8_t window_shape_prev, real_t *freq_in,
54 real_t *time_out, real_t *overlap,
55 uint8_t object_type, uint16_t frame_len);
56
57 #ifdef __cplusplus
58 }
59 #endif
60 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: fixed.h,v 1.32 2007/11/01 12:33:30 menno Exp $
28 **/
29
30 #ifndef __FIXED_H__
31 #define __FIXED_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #if defined(_WIN32_WCE) && defined(_ARM_)
38 #include <cmnintrin.h>
39 #endif
40
41
42 #define COEF_BITS 28
43 #define COEF_PRECISION (1 << COEF_BITS)
44 #define REAL_BITS 14 // MAXIMUM OF 14 FOR FIXED POINT SBR
45 #define REAL_PRECISION (1 << REAL_BITS)
46
47 /* FRAC is the fractional only part of the fixed point number [0.0..1.0) */
48 #define FRAC_SIZE 32 /* frac is a 32 bit integer */
49 #define FRAC_BITS 31
50 #define FRAC_PRECISION ((uint32_t)(1 << FRAC_BITS))
51 #define FRAC_MAX 0x7FFFFFFF
52
53 typedef int32_t real_t;
54
55
56 #define REAL_CONST(A) (((A) >= 0) ? ((real_t)((A)*(REAL_PRECISION)+0.5)) : ((real_t)((A)*(REAL_PRECISION)-0.5)))
57 #define COEF_CONST(A) (((A) >= 0) ? ((real_t)((A)*(COEF_PRECISION)+0.5)) : ((real_t)((A)*(COEF_PRECISION)-0.5)))
58 #define FRAC_CONST(A) (((A) == 1.00) ? ((real_t)FRAC_MAX) : (((A) >= 0) ? ((real_t)((A)*(FRAC_PRECISION)+0.5)) : ((real_t)((A)*(FRAC_PRECISION)-0.5))))
59 //#define FRAC_CONST(A) (((A) >= 0) ? ((real_t)((A)*(FRAC_PRECISION)+0.5)) : ((real_t)((A)*(FRAC_PRECISION)-0.5)))
60
61 #define Q2_BITS 22
62 #define Q2_PRECISION (1 << Q2_BITS)
63 #define Q2_CONST(A) (((A) >= 0) ? ((real_t)((A)*(Q2_PRECISION)+0.5)) : ((real_t)((A)*(Q2_PRECISION)-0.5)))
64
65 #if defined(_WIN32) && !defined(_WIN32_WCE)
66
67 /* multiply with real shift */
68 static INLINE real_t MUL_R(real_t A, real_t B)
69 {
70 _asm {
71 mov eax,A
72 imul B
73 shrd eax,edx,REAL_BITS
74 }
75 }
76
77 /* multiply with coef shift */
78 static INLINE real_t MUL_C(real_t A, real_t B)
79 {
80 _asm {
81 mov eax,A
82 imul B
83 shrd eax,edx,COEF_BITS
84 }
85 }
86
87 static INLINE real_t MUL_Q2(real_t A, real_t B)
88 {
89 _asm {
90 mov eax,A
91 imul B
92 shrd eax,edx,Q2_BITS
93 }
94 }
95
96 static INLINE real_t MUL_SHIFT6(real_t A, real_t B)
97 {
98 _asm {
99 mov eax,A
100 imul B
101 shrd eax,edx,6
102 }
103 }
104
105 static INLINE real_t MUL_SHIFT23(real_t A, real_t B)
106 {
107 _asm {
108 mov eax,A
109 imul B
110 shrd eax,edx,23
111 }
112 }
113
114 #if 1
115 static INLINE real_t _MulHigh(real_t A, real_t B)
116 {
117 _asm {
118 mov eax,A
119 imul B
120 mov eax,edx
121 }
122 }
123
124 /* multiply with fractional shift */
125 static INLINE real_t MUL_F(real_t A, real_t B)
126 {
127 return _MulHigh(A,B) << (FRAC_SIZE-FRAC_BITS);
128 }
129
130 /* Complex multiplication */
131 static INLINE void ComplexMult(real_t *y1, real_t *y2,
132 real_t x1, real_t x2, real_t c1, real_t c2)
133 {
134 *y1 = (_MulHigh(x1, c1) + _MulHigh(x2, c2))<<(FRAC_SIZE-FRAC_BITS);
135 *y2 = (_MulHigh(x2, c1) - _MulHigh(x1, c2))<<(FRAC_SIZE-FRAC_BITS);
136 }
137 #else
138 static INLINE real_t MUL_F(real_t A, real_t B)
139 {
140 _asm {
141 mov eax,A
142 imul B
143 shrd eax,edx,FRAC_BITS
144 }
145 }
146
147 /* Complex multiplication */
148 static INLINE void ComplexMult(real_t *y1, real_t *y2,
149 real_t x1, real_t x2, real_t c1, real_t c2)
150 {
151 *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
152 *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
153 }
154 #endif
155
156 #elif defined(__GNUC__) && defined (__arm__)
157
158 /* taken from MAD */
159 #define arm_mul(x, y, SCALEBITS) \
160 ({ \
161 uint32_t __hi; \
162 uint32_t __lo; \
163 uint32_t __result; \
164 asm("smull %0, %1, %3, %4\n\t" \
165 "movs %0, %0, lsr %5\n\t" \
166 "adc %2, %0, %1, lsl %6" \
167 : "=&r" (__lo), "=&r" (__hi), "=r" (__result) \
168 : "%r" (x), "r" (y), \
169 "M" (SCALEBITS), "M" (32 - (SCALEBITS)) \
170 : "cc"); \
171 __result; \
172 })
173
174 static INLINE real_t MUL_R(real_t A, real_t B)
175 {
176 return arm_mul(A, B, REAL_BITS);
177 }
178
179 static INLINE real_t MUL_C(real_t A, real_t B)
180 {
181 return arm_mul(A, B, COEF_BITS);
182 }
183
184 static INLINE real_t MUL_Q2(real_t A, real_t B)
185 {
186 return arm_mul(A, B, Q2_BITS);
187 }
188
189 static INLINE real_t MUL_SHIFT6(real_t A, real_t B)
190 {
191 return arm_mul(A, B, 6);
192 }
193
194 static INLINE real_t MUL_SHIFT23(real_t A, real_t B)
195 {
196 return arm_mul(A, B, 23);
197 }
198
199 static INLINE real_t _MulHigh(real_t x, real_t y)
200 {
201 uint32_t __lo;
202 uint32_t __hi;
203 asm("smull\t%0, %1, %2, %3"
204 : "=&r"(__lo),"=&r"(__hi)
205 : "%r"(x),"r"(y)
206 : "cc");
207 return __hi;
208 }
209
210 static INLINE real_t MUL_F(real_t A, real_t B)
211 {
212 return _MulHigh(A, B) << (FRAC_SIZE-FRAC_BITS);
213 }
214
215 /* Complex multiplication */
216 static INLINE void ComplexMult(real_t *y1, real_t *y2,
217 real_t x1, real_t x2, real_t c1, real_t c2)
218 {
219 int32_t tmp, yt1, yt2;
220 asm("smull %0, %1, %4, %6\n\t"
221 "smlal %0, %1, %5, %7\n\t"
222 "rsb %3, %4, #0\n\t"
223 "smull %0, %2, %5, %6\n\t"
224 "smlal %0, %2, %3, %7"
225 : "=&r" (tmp), "=&r" (yt1), "=&r" (yt2), "=r" (x1)
226 : "3" (x1), "r" (x2), "r" (c1), "r" (c2)
227 : "cc" );
228 *y1 = yt1 << (FRAC_SIZE-FRAC_BITS);
229 *y2 = yt2 << (FRAC_SIZE-FRAC_BITS);
230 }
231
232 #else
233
234 /* multiply with real shift */
235 #define MUL_R(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (REAL_BITS-1))) >> REAL_BITS)
236 /* multiply with coef shift */
237 #define MUL_C(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (COEF_BITS-1))) >> COEF_BITS)
238 /* multiply with fractional shift */
239 #if defined(_WIN32_WCE) && defined(_ARM_)
240 /* eVC for PocketPC has an intrinsic function that returns only the high 32 bits of a 32x32 bit multiply */
241 static INLINE real_t MUL_F(real_t A, real_t B)
242 {
243 return _MulHigh(A,B) << (32-FRAC_BITS);
244 }
245 #else
246 #ifdef __BFIN__
247 #define _MulHigh(X,Y) ({ int __xxo; \
248 asm ( \
249 "a1 = %2.H * %1.L (IS,M);\n\t" \
250 "a0 = %1.H * %2.H, a1+= %1.H * %2.L (IS,M);\n\t"\
251 "a1 = a1 >>> 16;\n\t" \
252 "%0 = (a0 += a1);\n\t" \
253 : "=d" (__xxo) : "d" (X), "d" (Y) : "A0","A1"); __xxo; })
254
255 #define MUL_F(X,Y) ({ int __xxo; \
256 asm ( \
257 "a1 = %2.H * %1.L (M);\n\t" \
258 "a0 = %1.H * %2.H, a1+= %1.H * %2.L (M);\n\t" \
259 "a1 = a1 >>> 16;\n\t" \
260 "%0 = (a0 += a1);\n\t" \
261 : "=d" (__xxo) : "d" (X), "d" (Y) : "A0","A1"); __xxo; })
262 #else
263 #define _MulHigh(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (FRAC_SIZE-1))) >> FRAC_SIZE)
264 #define MUL_F(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (FRAC_BITS-1))) >> FRAC_BITS)
265 #endif
266 #endif
267 #define MUL_Q2(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (Q2_BITS-1))) >> Q2_BITS)
268 #define MUL_SHIFT6(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (6-1))) >> 6)
269 #define MUL_SHIFT23(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (23-1))) >> 23)
270
271 /* Complex multiplication */
272 static INLINE void ComplexMult(real_t *y1, real_t *y2,
273 real_t x1, real_t x2, real_t c1, real_t c2)
274 {
275 *y1 = (_MulHigh(x1, c1) + _MulHigh(x2, c2))<<(FRAC_SIZE-FRAC_BITS);
276 *y2 = (_MulHigh(x2, c1) - _MulHigh(x1, c2))<<(FRAC_SIZE-FRAC_BITS);
277 }
278
279 #endif
280
281
282
283 #ifdef __cplusplus
284 }
285 #endif
286 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: hcr.c,v 1.24 2007/11/01 12:33:30 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #include <stdlib.h>
34 #include <string.h>
35
36 #include "specrec.h"
37 #include "huffman.h"
38
39 /* ISO/IEC 14496-3/Amd.1
40 * 8.5.3.3: Huffman Codeword Reordering for AAC spectral data (HCR)
41 *
42 * HCR devides the spectral data in known fixed size segments, and
43 * sorts it by the importance of the data. The importance is firstly
44 * the (lower) position in the spectrum, and secondly the largest
45 * value in the used codebook.
46 * The most important data is written at the start of each segment
47 * (at known positions), the remaining data is interleaved inbetween,
48 * with the writing direction alternating.
49 * Data length is not increased.
50 */
51
52 #ifdef ERROR_RESILIENCE
53
54 /* 8.5.3.3.1 Pre-sorting */
55
56 #define NUM_CB 6
57 #define NUM_CB_ER 22
58 #define MAX_CB 32
59 #define VCB11_FIRST 16
60 #define VCB11_LAST 31
61
62 static const uint8_t PreSortCB_STD[NUM_CB] =
63 { 11, 9, 7, 5, 3, 1};
64
65 static const uint8_t PreSortCB_ER[NUM_CB_ER] =
66 { 11, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 9, 7, 5, 3, 1};
67
68 /* 8.5.3.3.2 Derivation of segment width */
69
70 static const uint8_t maxCwLen[MAX_CB] = {0, 11, 9, 20, 16, 13, 11, 14, 12, 17, 14, 49,
71 0, 0, 0, 0, 14, 17, 21, 21, 25, 25, 29, 29, 29, 29, 33, 33, 33, 37, 37, 41};
72
73 #define segmentWidth(cb) min(maxCwLen[cb], ics->length_of_longest_codeword)
74
75 /* bit-twiddling helpers */
76 static const uint8_t S[] = {1, 2, 4, 8, 16};
77 static const uint32_t B[] = {0x55555555, 0x33333333, 0x0F0F0F0F, 0x00FF00FF, 0x0000FFFF};
78
79 typedef struct
80 {
81 uint8_t cb;
82 uint8_t decoded;
83 uint16_t sp_offset;
84 bits_t bits;
85 } codeword_t;
86
87 /* rewind and reverse */
88 /* 32 bit version */
89 static uint32_t rewrev_word(uint32_t v, const uint8_t len)
90 {
91 /* 32 bit reverse */
92 v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]);
93 v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]);
94 v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]);
95 v = ((v >> S[3]) & B[3]) | ((v << S[3]) & ~B[3]);
96 v = ((v >> S[4]) & B[4]) | ((v << S[4]) & ~B[4]);
97
98 /* shift off low bits */
99 v >>= (32 - len);
100
101 return v;
102 }
103
104 /* 64 bit version */
105 static void rewrev_lword(uint32_t *hi, uint32_t *lo, const uint8_t len)
106 {
107 if (len <= 32) {
108 *hi = 0;
109 *lo = rewrev_word(*lo, len);
110 } else
111 {
112 uint32_t t = *hi, v = *lo;
113
114 /* double 32 bit reverse */
115 v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]);
116 t = ((t >> S[0]) & B[0]) | ((t << S[0]) & ~B[0]);
117 v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]);
118 t = ((t >> S[1]) & B[1]) | ((t << S[1]) & ~B[1]);
119 v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]);
120 t = ((t >> S[2]) & B[2]) | ((t << S[2]) & ~B[2]);
121 v = ((v >> S[3]) & B[3]) | ((v << S[3]) & ~B[3]);
122 t = ((t >> S[3]) & B[3]) | ((t << S[3]) & ~B[3]);
123 v = ((v >> S[4]) & B[4]) | ((v << S[4]) & ~B[4]);
124 t = ((t >> S[4]) & B[4]) | ((t << S[4]) & ~B[4]);
125
126 /* last 32<>32 bit swap is implicit below */
127
128 /* shift off low bits (this is really only one 64 bit shift) */
129 *lo = (t >> (64 - len)) | (v << (len - 32));
130 *hi = v >> (64 - len);
131 }
132 }
133
134
135 /* bits_t version */
136 static void rewrev_bits(bits_t *bits)
137 {
138 if (bits->len == 0) return;
139 rewrev_lword(&bits->bufb, &bits->bufa, bits->len);
140 }
141
142
143 /* merge bits of a to b */
144 static void concat_bits(bits_t *b, bits_t *a)
145 {
146 uint32_t bl, bh, al, ah;
147
148 if (a->len == 0) return;
149
150 al = a->bufa;
151 ah = a->bufb;
152
153 if (b->len > 32)
154 {
155 /* maskoff superfluous high b bits */
156 bl = b->bufa;
157 bh = b->bufb & ((1 << (b->len-32)) - 1);
158 /* left shift a b->len bits */
159 ah = al << (b->len - 32);
160 al = 0;
161 } else {
162 bl = b->bufa & ((1 << (b->len)) - 1);
163 bh = 0;
164 ah = (ah << (b->len)) | (al >> (32 - b->len));
165 al = al << b->len;
166 }
167
168 /* merge */
169 b->bufa = bl | al;
170 b->bufb = bh | ah;
171
172 b->len += a->len;
173 }
174
175 uint8_t is_good_cb(uint8_t this_CB, uint8_t this_sec_CB)
176 {
177 /* only want spectral data CB's */
178 if ((this_sec_CB > ZERO_HCB && this_sec_CB <= ESC_HCB) || (this_sec_CB >= VCB11_FIRST && this_sec_CB <= VCB11_LAST))
179 {
180 if (this_CB < ESC_HCB)
181 {
182 /* normal codebook pairs */
183 return ((this_sec_CB == this_CB) || (this_sec_CB == this_CB + 1));
184 } else
185 {
186 /* escape codebook */
187 return (this_sec_CB == this_CB);
188 }
189 }
190 return 0;
191 }
192
193 void read_segment(bits_t *segment, uint8_t segwidth, bitfile *ld)
194 {
195 segment->len = segwidth;
196
197 if (segwidth > 32)
198 {
199 segment->bufb = faad_getbits(ld, segwidth - 32);
200 segment->bufa = faad_getbits(ld, 32);
201
202 } else {
203 segment->bufa = faad_getbits(ld, segwidth);
204 segment->bufb = 0;
205 }
206 }
207
208 void fill_in_codeword(codeword_t *codeword, uint16_t index, uint16_t sp, uint8_t cb)
209 {
210 codeword[index].sp_offset = sp;
211 codeword[index].cb = cb;
212 codeword[index].decoded = 0;
213 codeword[index].bits.len = 0;
214 }
215
216 uint8_t reordered_spectral_data(NeAACDecHandle hDecoder, ic_stream *ics,
217 bitfile *ld, int16_t *spectral_data)
218 {
219 uint16_t PCWs_done;
220 uint16_t numberOfSegments, numberOfSets, numberOfCodewords;
221
222 codeword_t codeword[512];
223 bits_t segment[512];
224
225 uint16_t sp_offset[8];
226 uint16_t g, i, sortloop, set, bitsread;
227 uint16_t bitsleft, codewordsleft;
228 uint8_t w_idx, sfb, this_CB, last_CB, this_sec_CB;
229
230 const uint16_t nshort = hDecoder->frameLength/8;
231 const uint16_t sp_data_len = ics->length_of_reordered_spectral_data;
232
233 const uint8_t *PreSortCb;
234
235 /* no data (e.g. silence) */
236 if (sp_data_len == 0)
237 return 0;
238
239 /* since there is spectral data, at least one codeword has nonzero length */
240 if (ics->length_of_longest_codeword == 0)
241 return 10;
242
243 if (sp_data_len < ics->length_of_longest_codeword)
244 return 10;
245
246 sp_offset[0] = 0;
247 for (g = 1; g < ics->num_window_groups; g++)
248 {
249 sp_offset[g] = sp_offset[g-1] + nshort*ics->window_group_length[g-1];
250 }
251
252 PCWs_done = 0;
253 numberOfSegments = 0;
254 numberOfCodewords = 0;
255 bitsread = 0;
256
257 /* VCB11 code books in use */
258 if (hDecoder->aacSectionDataResilienceFlag)
259 {
260 PreSortCb = PreSortCB_ER;
261 last_CB = NUM_CB_ER;
262 } else
263 {
264 PreSortCb = PreSortCB_STD;
265 last_CB = NUM_CB;
266 }
267
268 /* step 1: decode PCW's (set 0), and stuff data in easier-to-use format */
269 for (sortloop = 0; sortloop < last_CB; sortloop++)
270 {
271 /* select codebook to process this pass */
272 this_CB = PreSortCb[sortloop];
273
274 /* loop over sfbs */
275 for (sfb = 0; sfb < ics->max_sfb; sfb++)
276 {
277 /* loop over all in this sfb, 4 lines per loop */
278 for (w_idx = 0; 4*w_idx < (min(ics->swb_offset[sfb+1], ics->swb_offset_max) - ics->swb_offset[sfb]); w_idx++)
279 {
280 for(g = 0; g < ics->num_window_groups; g++)
281 {
282 for (i = 0; i < ics->num_sec[g]; i++)
283 {
284 /* check whether sfb used here is the one we want to process */
285 if ((ics->sect_start[g][i] <= sfb) && (ics->sect_end[g][i] > sfb))
286 {
287 /* check whether codebook used here is the one we want to process */
288 this_sec_CB = ics->sect_cb[g][i];
289
290 if (is_good_cb(this_CB, this_sec_CB))
291 {
292 /* precalculate some stuff */
293 uint16_t sect_sfb_size = ics->sect_sfb_offset[g][sfb+1] - ics->sect_sfb_offset[g][sfb];
294 uint8_t inc = (this_sec_CB < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN;
295 uint16_t group_cws_count = (4*ics->window_group_length[g])/inc;
296 uint8_t segwidth = segmentWidth(this_sec_CB);
297 uint16_t cws;
298
299 /* read codewords until end of sfb or end of window group (shouldn't only 1 trigger?) */
300 for (cws = 0; (cws < group_cws_count) && ((cws + w_idx*group_cws_count) < sect_sfb_size); cws++)
301 {
302 uint16_t sp = sp_offset[g] + ics->sect_sfb_offset[g][sfb] + inc * (cws + w_idx*group_cws_count);
303
304 /* read and decode PCW */
305 if (!PCWs_done)
306 {
307 /* read in normal segments */
308 if (bitsread + segwidth <= sp_data_len)
309 {
310 read_segment(&segment[numberOfSegments], segwidth, ld);
311 bitsread += segwidth;
312
313 huffman_spectral_data_2(this_sec_CB, &segment[numberOfSegments], &spectral_data[sp]);
314
315 /* keep leftover bits */
316 rewrev_bits(&segment[numberOfSegments]);
317
318 numberOfSegments++;
319 } else {
320 /* remaining stuff after last segment, we unfortunately couldn't read
321 this in earlier because it might not fit in 64 bits. since we already
322 decoded (and removed) the PCW it is now guaranteed to fit */
323 if (bitsread < sp_data_len)
324 {
325 const uint8_t additional_bits = sp_data_len - bitsread;
326
327 read_segment(&segment[numberOfSegments], additional_bits, ld);
328 segment[numberOfSegments].len += segment[numberOfSegments-1].len;
329 rewrev_bits(&segment[numberOfSegments]);
330
331 if (segment[numberOfSegments-1].len > 32)
332 {
333 segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb +
334 showbits_hcr(&segment[numberOfSegments-1], segment[numberOfSegments-1].len - 32);
335 segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa +
336 showbits_hcr(&segment[numberOfSegments-1], 32);
337 } else {
338 segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa +
339 showbits_hcr(&segment[numberOfSegments-1], segment[numberOfSegments-1].len);
340 segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb;
341 }
342 segment[numberOfSegments-1].len += additional_bits;
343 }
344 bitsread = sp_data_len;
345 PCWs_done = 1;
346
347 fill_in_codeword(codeword, 0, sp, this_sec_CB);
348 }
349 } else {
350 fill_in_codeword(codeword, numberOfCodewords - numberOfSegments, sp, this_sec_CB);
351 }
352 numberOfCodewords++;
353 }
354 }
355 }
356 }
357 }
358 }
359 }
360 }
361
362 if (numberOfSegments == 0)
363 return 10;
364
365 numberOfSets = numberOfCodewords / numberOfSegments;
366
367 /* step 2: decode nonPCWs */
368 for (set = 1; set <= numberOfSets; set++)
369 {
370 uint16_t trial;
371
372 for (trial = 0; trial < numberOfSegments; trial++)
373 {
374 uint16_t codewordBase;
375
376 for (codewordBase = 0; codewordBase < numberOfSegments; codewordBase++)
377 {
378 const uint16_t segment_idx = (trial + codewordBase) % numberOfSegments;
379 const uint16_t codeword_idx = codewordBase + set*numberOfSegments - numberOfSegments;
380
381 /* data up */
382 if (codeword_idx >= numberOfCodewords - numberOfSegments) break;
383
384 if (!codeword[codeword_idx].decoded && segment[segment_idx].len > 0)
385 {
386 uint8_t tmplen;
387
388 if (codeword[codeword_idx].bits.len != 0)
389 concat_bits(&segment[segment_idx], &codeword[codeword_idx].bits);
390
391 tmplen = segment[segment_idx].len;
392
393 if (huffman_spectral_data_2(codeword[codeword_idx].cb, &segment[segment_idx],
394 &spectral_data[codeword[codeword_idx].sp_offset]) >= 0)
395 {
396 codeword[codeword_idx].decoded = 1;
397 } else
398 {
399 codeword[codeword_idx].bits = segment[segment_idx];
400 codeword[codeword_idx].bits.len = tmplen;
401 }
402
403 }
404 }
405 }
406 for (i = 0; i < numberOfSegments; i++)
407 rewrev_bits(&segment[i]);
408 }
409
410 #if 0 // Seems to give false errors
411 bitsleft = 0;
412
413 for (i = 0; i < numberOfSegments && !bitsleft; i++)
414 bitsleft += segment[i].len;
415
416 if (bitsleft) return 10;
417
418 codewordsleft = 0;
419
420 for (i = 0; (i < numberOfCodewords - numberOfSegments) && (!codewordsleft); i++)
421 if (!codeword[i].decoded)
422 codewordsleft++;
423
424 if (codewordsleft) return 10;
425 #endif
426
427
428 return 0;
429
430 }
431 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: huffman.c,v 1.26 2007/11/01 12:33:30 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #include <stdlib.h>
34 #ifdef ANALYSIS
35 #include <stdio.h>
36 #endif
37
38 #include "bits.h"
39 #include "huffman.h"
40 #include "codebook/hcb.h"
41
42
43 /* static function declarations */
44 static INLINE void huffman_sign_bits(bitfile *ld, int16_t *sp, uint8_t len);
45 static INLINE int16_t huffman_getescape(bitfile *ld, int16_t sp);
46 static uint8_t huffman_2step_quad(uint8_t cb, bitfile *ld, int16_t *sp);
47 static uint8_t huffman_2step_quad_sign(uint8_t cb, bitfile *ld, int16_t *sp);
48 static uint8_t huffman_2step_pair(uint8_t cb, bitfile *ld, int16_t *sp);
49 static uint8_t huffman_2step_pair_sign(uint8_t cb, bitfile *ld, int16_t *sp);
50 static uint8_t huffman_binary_quad(uint8_t cb, bitfile *ld, int16_t *sp);
51 static uint8_t huffman_binary_quad_sign(uint8_t cb, bitfile *ld, int16_t *sp);
52 static uint8_t huffman_binary_pair(uint8_t cb, bitfile *ld, int16_t *sp);
53 static uint8_t huffman_binary_pair_sign(uint8_t cb, bitfile *ld, int16_t *sp);
54 static int16_t huffman_codebook(uint8_t i);
55 static void vcb11_check_LAV(uint8_t cb, int16_t *sp);
56
57 int8_t huffman_scale_factor(bitfile *ld)
58 {
59 uint16_t offset = 0;
60
61 while (hcb_sf[offset][1])
62 {
63 uint8_t b = faad_get1bit(ld
64 DEBUGVAR(1,255,"huffman_scale_factor()"));
65 offset += hcb_sf[offset][b];
66
67 if (offset > 240)
68 {
69 /* printf("ERROR: offset into hcb_sf = %d >240!\n", offset); */
70 return -1;
71 }
72 }
73
74 return hcb_sf[offset][0];
75 }
76
77
78 hcb *hcb_table[] = {
79 0, hcb1_1, hcb2_1, 0, hcb4_1, 0, hcb6_1, 0, hcb8_1, 0, hcb10_1, hcb11_1
80 };
81
82 hcb_2_quad *hcb_2_quad_table[] = {
83 0, hcb1_2, hcb2_2, 0, hcb4_2, 0, 0, 0, 0, 0, 0, 0
84 };
85
86 hcb_2_pair *hcb_2_pair_table[] = {
87 0, 0, 0, 0, 0, 0, hcb6_2, 0, hcb8_2, 0, hcb10_2, hcb11_2
88 };
89
90 hcb_bin_pair *hcb_bin_table[] = {
91 0, 0, 0, 0, 0, hcb5, 0, hcb7, 0, hcb9, 0, 0
92 };
93
94 uint8_t hcbN[] = { 0, 5, 5, 0, 5, 0, 5, 0, 5, 0, 6, 5 };
95
96 /* defines whether a huffman codebook is unsigned or not */
97 /* Table 4.6.2 */
98 uint8_t unsigned_cb[] = { 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0,
99 /* codebook 16 to 31 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
100 };
101
102 int hcb_2_quad_table_size[] = { 0, 114, 86, 0, 185, 0, 0, 0, 0, 0, 0, 0 };
103 int hcb_2_pair_table_size[] = { 0, 0, 0, 0, 0, 0, 126, 0, 83, 0, 210, 373 };
104 int hcb_bin_table_size[] = { 0, 0, 0, 161, 0, 161, 0, 127, 0, 337, 0, 0 };
105
106 static INLINE void huffman_sign_bits(bitfile *ld, int16_t *sp, uint8_t len)
107 {
108 uint8_t i;
109
110 for (i = 0; i < len; i++)
111 {
112 if(sp[i])
113 {
114 if(faad_get1bit(ld
115 DEBUGVAR(1,5,"huffman_sign_bits(): sign bit")) & 1)
116 {
117 sp[i] = -sp[i];
118 }
119 }
120 }
121 }
122
123 static INLINE int16_t huffman_getescape(bitfile *ld, int16_t sp)
124 {
125 uint8_t neg, i;
126 int16_t j;
127 int16_t off;
128
129 if (sp < 0)
130 {
131 if (sp != -16)
132 return sp;
133 neg = 1;
134 } else {
135 if (sp != 16)
136 return sp;
137 neg = 0;
138 }
139
140 for (i = 4; ; i++)
141 {
142 if (faad_get1bit(ld
143 DEBUGVAR(1,6,"huffman_getescape(): escape size")) == 0)
144 {
145 break;
146 }
147 }
148
149 off = (int16_t)faad_getbits(ld, i
150 DEBUGVAR(1,9,"huffman_getescape(): escape"));
151
152 j = off | (1<<i);
153 if (neg)
154 j = -j;
155
156 return j;
157 }
158
159 static uint8_t huffman_2step_quad(uint8_t cb, bitfile *ld, int16_t *sp)
160 {
161 uint32_t cw;
162 uint16_t offset = 0;
163 uint8_t extra_bits;
164
165 cw = faad_showbits(ld, hcbN[cb]);
166 offset = hcb_table[cb][cw].offset;
167 extra_bits = hcb_table[cb][cw].extra_bits;
168
169 if (extra_bits)
170 {
171 /* we know for sure it's more than hcbN[cb] bits long */
172 faad_flushbits(ld, hcbN[cb]);
173 offset += (uint16_t)faad_showbits(ld, extra_bits);
174 faad_flushbits(ld, hcb_2_quad_table[cb][offset].bits - hcbN[cb]);
175 } else {
176 faad_flushbits(ld, hcb_2_quad_table[cb][offset].bits);
177 }
178
179 if (offset > hcb_2_quad_table_size[cb])
180 {
181 /* printf("ERROR: offset into hcb_2_quad_table = %d >%d!\n", offset,
182 hcb_2_quad_table_size[cb]); */
183 return 10;
184 }
185
186 sp[0] = hcb_2_quad_table[cb][offset].x;
187 sp[1] = hcb_2_quad_table[cb][offset].y;
188 sp[2] = hcb_2_quad_table[cb][offset].v;
189 sp[3] = hcb_2_quad_table[cb][offset].w;
190
191 return 0;
192 }
193
194 static uint8_t huffman_2step_quad_sign(uint8_t cb, bitfile *ld, int16_t *sp)
195 {
196 uint8_t err = huffman_2step_quad(cb, ld, sp);
197 huffman_sign_bits(ld, sp, QUAD_LEN);
198
199 return err;
200 }
201
202 static uint8_t huffman_2step_pair(uint8_t cb, bitfile *ld, int16_t *sp)
203 {
204 uint32_t cw;
205 uint16_t offset = 0;
206 uint8_t extra_bits;
207
208 cw = faad_showbits(ld, hcbN[cb]);
209 offset = hcb_table[cb][cw].offset;
210 extra_bits = hcb_table[cb][cw].extra_bits;
211
212 if (extra_bits)
213 {
214 /* we know for sure it's more than hcbN[cb] bits long */
215 faad_flushbits(ld, hcbN[cb]);
216 offset += (uint16_t)faad_showbits(ld, extra_bits);
217 faad_flushbits(ld, hcb_2_pair_table[cb][offset].bits - hcbN[cb]);
218 } else {
219 faad_flushbits(ld, hcb_2_pair_table[cb][offset].bits);
220 }
221
222 if (offset > hcb_2_pair_table_size[cb])
223 {
224 /* printf("ERROR: offset into hcb_2_pair_table = %d >%d!\n", offset,
225 hcb_2_pair_table_size[cb]); */
226 return 10;
227 }
228
229 sp[0] = hcb_2_pair_table[cb][offset].x;
230 sp[1] = hcb_2_pair_table[cb][offset].y;
231
232 return 0;
233 }
234
235 static uint8_t huffman_2step_pair_sign(uint8_t cb, bitfile *ld, int16_t *sp)
236 {
237 uint8_t err = huffman_2step_pair(cb, ld, sp);
238 huffman_sign_bits(ld, sp, PAIR_LEN);
239
240 return err;
241 }
242
243 static uint8_t huffman_binary_quad(uint8_t cb, bitfile *ld, int16_t *sp)
244 {
245 uint16_t offset = 0;
246
247 while (!hcb3[offset].is_leaf)
248 {
249 uint8_t b = faad_get1bit(ld
250 DEBUGVAR(1,255,"huffman_spectral_data():3"));
251 offset += hcb3[offset].data[b];
252 }
253
254 if (offset > hcb_bin_table_size[cb])
255 {
256 /* printf("ERROR: offset into hcb_bin_table = %d >%d!\n", offset,
257 hcb_bin_table_size[cb]); */
258 return 10;
259 }
260
261 sp[0] = hcb3[offset].data[0];
262 sp[1] = hcb3[offset].data[1];
263 sp[2] = hcb3[offset].data[2];
264 sp[3] = hcb3[offset].data[3];
265
266 return 0;
267 }
268
269 static uint8_t huffman_binary_quad_sign(uint8_t cb, bitfile *ld, int16_t *sp)
270 {
271 uint8_t err = huffman_binary_quad(cb, ld, sp);
272 huffman_sign_bits(ld, sp, QUAD_LEN);
273
274 return err;
275 }
276
277 static uint8_t huffman_binary_pair(uint8_t cb, bitfile *ld, int16_t *sp)
278 {
279 uint16_t offset = 0;
280
281 while (!hcb_bin_table[cb][offset].is_leaf)
282 {
283 uint8_t b = faad_get1bit(ld
284 DEBUGVAR(1,255,"huffman_spectral_data():9"));
285 offset += hcb_bin_table[cb][offset].data[b];
286 }
287
288 if (offset > hcb_bin_table_size[cb])
289 {
290 /* printf("ERROR: offset into hcb_bin_table = %d >%d!\n", offset,
291 hcb_bin_table_size[cb]); */
292 return 10;
293 }
294
295 sp[0] = hcb_bin_table[cb][offset].data[0];
296 sp[1] = hcb_bin_table[cb][offset].data[1];
297
298 return 0;
299 }
300
301 static uint8_t huffman_binary_pair_sign(uint8_t cb, bitfile *ld, int16_t *sp)
302 {
303 uint8_t err = huffman_binary_pair(cb, ld, sp);
304 huffman_sign_bits(ld, sp, PAIR_LEN);
305
306 return err;
307 }
308
309 static int16_t huffman_codebook(uint8_t i)
310 {
311 static const uint32_t data = 16428320;
312 if (i == 0) return (int16_t)(data >> 16) & 0xFFFF;
313 else return (int16_t)data & 0xFFFF;
314 }
315
316 static void vcb11_check_LAV(uint8_t cb, int16_t *sp)
317 {
318 static const uint16_t vcb11_LAV_tab[] = {
319 16, 31, 47, 63, 95, 127, 159, 191, 223,
320 255, 319, 383, 511, 767, 1023, 2047
321 };
322 uint16_t max = 0;
323
324 if (cb < 16 || cb > 31)
325 return;
326
327 max = vcb11_LAV_tab[cb - 16];
328
329 if ((abs(sp[0]) > max) || (abs(sp[1]) > max))
330 {
331 sp[0] = 0;
332 sp[1] = 0;
333 }
334 }
335
336 uint8_t huffman_spectral_data(uint8_t cb, bitfile *ld, int16_t *sp)
337 {
338 switch (cb)
339 {
340 case 1: /* 2-step method for data quadruples */
341 case 2:
342 return huffman_2step_quad(cb, ld, sp);
343 case 3: /* binary search for data quadruples */
344 return huffman_binary_quad_sign(cb, ld, sp);
345 case 4: /* 2-step method for data quadruples */
346 return huffman_2step_quad_sign(cb, ld, sp);
347 case 5: /* binary search for data pairs */
348 return huffman_binary_pair(cb, ld, sp);
349 case 6: /* 2-step method for data pairs */
350 return huffman_2step_pair(cb, ld, sp);
351 case 7: /* binary search for data pairs */
352 case 9:
353 return huffman_binary_pair_sign(cb, ld, sp);
354 case 8: /* 2-step method for data pairs */
355 case 10:
356 return huffman_2step_pair_sign(cb, ld, sp);
357 case 12: {
358 uint8_t err = huffman_2step_pair(11, ld, sp);
359 sp[0] = huffman_codebook(0); sp[1] = huffman_codebook(1);
360 return err; }
361 case 11:
362 {
363 uint8_t err = huffman_2step_pair_sign(11, ld, sp);
364 sp[0] = huffman_getescape(ld, sp[0]);
365 sp[1] = huffman_getescape(ld, sp[1]);
366 return err;
367 }
368 #ifdef ERROR_RESILIENCE
369 /* VCB11 uses codebook 11 */
370 case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23:
371 case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31:
372 {
373 uint8_t err = huffman_2step_pair_sign(11, ld, sp);
374 sp[0] = huffman_getescape(ld, sp[0]);
375 sp[1] = huffman_getescape(ld, sp[1]);
376
377 /* check LAV (Largest Absolute Value) */
378 /* this finds errors in the ESCAPE signal */
379 vcb11_check_LAV(cb, sp);
380
381 return err;
382 }
383 #endif
384 default:
385 /* Non existent codebook number, something went wrong */
386 return 11;
387 }
388
389 return 0;
390 }
391
392
393 #ifdef ERROR_RESILIENCE
394
395 /* Special version of huffman_spectral_data
396 Will not read from a bitfile but a bits_t structure.
397 Will keep track of the bits decoded and return the number of bits remaining.
398 Do not read more than ld->len, return -1 if codeword would be longer */
399
400 int8_t huffman_spectral_data_2(uint8_t cb, bits_t *ld, int16_t *sp)
401 {
402 uint32_t cw;
403 uint16_t offset = 0;
404 uint8_t extra_bits;
405 uint8_t i, vcb11 = 0;
406
407
408 switch (cb)
409 {
410 case 1: /* 2-step method for data quadruples */
411 case 2:
412 case 4:
413
414 cw = showbits_hcr(ld, hcbN[cb]);
415 offset = hcb_table[cb][cw].offset;
416 extra_bits = hcb_table[cb][cw].extra_bits;
417
418 if (extra_bits)
419 {
420 /* we know for sure it's more than hcbN[cb] bits long */
421 if ( flushbits_hcr(ld, hcbN[cb]) ) return -1;
422 offset += (uint16_t)showbits_hcr(ld, extra_bits);
423 if ( flushbits_hcr(ld, hcb_2_quad_table[cb][offset].bits - hcbN[cb]) ) return -1;
424 } else {
425 if ( flushbits_hcr(ld, hcb_2_quad_table[cb][offset].bits) ) return -1;
426 }
427
428 sp[0] = hcb_2_quad_table[cb][offset].x;
429 sp[1] = hcb_2_quad_table[cb][offset].y;
430 sp[2] = hcb_2_quad_table[cb][offset].v;
431 sp[3] = hcb_2_quad_table[cb][offset].w;
432 break;
433
434 case 6: /* 2-step method for data pairs */
435 case 8:
436 case 10:
437 case 11:
438 /* VCB11 uses codebook 11 */
439 case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23:
440 case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31:
441
442 if (cb >= 16)
443 {
444 /* store the virtual codebook */
445 vcb11 = cb;
446 cb = 11;
447 }
448
449 cw = showbits_hcr(ld, hcbN[cb]);
450 offset = hcb_table[cb][cw].offset;
451 extra_bits = hcb_table[cb][cw].extra_bits;
452
453 if (extra_bits)
454 {
455 /* we know for sure it's more than hcbN[cb] bits long */
456 if ( flushbits_hcr(ld, hcbN[cb]) ) return -1;
457 offset += (uint16_t)showbits_hcr(ld, extra_bits);
458 if ( flushbits_hcr(ld, hcb_2_pair_table[cb][offset].bits - hcbN[cb]) ) return -1;
459 } else {
460 if ( flushbits_hcr(ld, hcb_2_pair_table[cb][offset].bits) ) return -1;
461 }
462 sp[0] = hcb_2_pair_table[cb][offset].x;
463 sp[1] = hcb_2_pair_table[cb][offset].y;
464 break;
465
466 case 3: /* binary search for data quadruples */
467
468 while (!hcb3[offset].is_leaf)
469 {
470 uint8_t b;
471
472 if ( get1bit_hcr(ld, &b) ) return -1;
473 offset += hcb3[offset].data[b];
474 }
475
476 sp[0] = hcb3[offset].data[0];
477 sp[1] = hcb3[offset].data[1];
478 sp[2] = hcb3[offset].data[2];
479 sp[3] = hcb3[offset].data[3];
480
481 break;
482
483 case 5: /* binary search for data pairs */
484 case 7:
485 case 9:
486
487 while (!hcb_bin_table[cb][offset].is_leaf)
488 {
489 uint8_t b;
490
491 if (get1bit_hcr(ld, &b) ) return -1;
492 offset += hcb_bin_table[cb][offset].data[b];
493 }
494
495 sp[0] = hcb_bin_table[cb][offset].data[0];
496 sp[1] = hcb_bin_table[cb][offset].data[1];
497
498 break;
499 }
500
501 /* decode sign bits */
502 if (unsigned_cb[cb])
503 {
504 for(i = 0; i < ((cb < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN); i++)
505 {
506 if(sp[i])
507 {
508 uint8_t b;
509 if ( get1bit_hcr(ld, &b) ) return -1;
510 if (b != 0) {
511 sp[i] = -sp[i];
512 }
513 }
514 }
515 }
516
517 /* decode huffman escape bits */
518 if ((cb == ESC_HCB) || (cb >= 16))
519 {
520 uint8_t k;
521 for (k = 0; k < 2; k++)
522 {
523 if ((sp[k] == 16) || (sp[k] == -16))
524 {
525 uint8_t neg, i;
526 int32_t j;
527 uint32_t off;
528
529 neg = (sp[k] < 0) ? 1 : 0;
530
531 for (i = 4; ; i++)
532 {
533 uint8_t b;
534 if (get1bit_hcr(ld, &b))
535 return -1;
536 if (b == 0)
537 break;
538 }
539
540 if (getbits_hcr(ld, i, &off))
541 return -1;
542 j = off + (1<<i);
543 sp[k] = (int16_t)((neg) ? -j : j);
544 }
545 }
546
547 if (vcb11 != 0)
548 {
549 /* check LAV (Largest Absolute Value) */
550 /* this finds errors in the ESCAPE signal */
551 vcb11_check_LAV(vcb11, sp);
552 }
553 }
554 return ld->len;
555 }
556
557 #endif
558
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: huffman.h,v 1.28 2007/11/01 12:33:30 menno Exp $
28 **/
29
30 #ifndef __HUFFMAN_H__
31 #define __HUFFMAN_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 int8_t huffman_scale_factor(bitfile *ld);
38 uint8_t huffman_spectral_data(uint8_t cb, bitfile *ld, int16_t *sp);
39 #ifdef ERROR_RESILIENCE
40 int8_t huffman_spectral_data_2(uint8_t cb, bits_t *ld, int16_t *sp);
41 #endif
42
43 #ifdef __cplusplus
44 }
45 #endif
46 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: ic_predict.c,v 1.28 2007/11/01 12:33:31 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #ifdef MAIN_DEC
34
35 #include "syntax.h"
36 #include "ic_predict.h"
37 #include "pns.h"
38
39
40 static void flt_round(float32_t *pf)
41 {
42 int32_t flg;
43 uint32_t tmp, tmp1, tmp2;
44
45 tmp = *(uint32_t*)pf;
46 flg = tmp & (uint32_t)0x00008000;
47 tmp &= (uint32_t)0xffff0000;
48 tmp1 = tmp;
49 /* round 1/2 lsb toward infinity */
50 if (flg)
51 {
52 tmp &= (uint32_t)0xff800000; /* extract exponent and sign */
53 tmp |= (uint32_t)0x00010000; /* insert 1 lsb */
54 tmp2 = tmp; /* add 1 lsb and elided one */
55 tmp &= (uint32_t)0xff800000; /* extract exponent and sign */
56
57 *pf = *(float32_t*)&tmp1 + *(float32_t*)&tmp2 - *(float32_t*)&tmp;
58 } else {
59 *pf = *(float32_t*)&tmp;
60 }
61 }
62
63 static int16_t quant_pred(float32_t x)
64 {
65 int16_t q;
66 uint32_t *tmp = (uint32_t*)&x;
67
68 q = (int16_t)(*tmp>>16);
69
70 return q;
71 }
72
73 static float32_t inv_quant_pred(int16_t q)
74 {
75 float32_t x;
76 uint32_t *tmp = (uint32_t*)&x;
77 *tmp = ((uint32_t)q)<<16;
78
79 return x;
80 }
81
82 static void ic_predict(pred_state *state, real_t input, real_t *output, uint8_t pred)
83 {
84 uint16_t tmp;
85 int16_t i, j;
86 real_t dr1;
87 float32_t predictedvalue;
88 real_t e0, e1;
89 real_t k1, k2;
90
91 real_t r[2];
92 real_t COR[2];
93 real_t VAR[2];
94
95 r[0] = inv_quant_pred(state->r[0]);
96 r[1] = inv_quant_pred(state->r[1]);
97 COR[0] = inv_quant_pred(state->COR[0]);
98 COR[1] = inv_quant_pred(state->COR[1]);
99 VAR[0] = inv_quant_pred(state->VAR[0]);
100 VAR[1] = inv_quant_pred(state->VAR[1]);
101
102
103 #if 1
104 tmp = state->VAR[0];
105 j = (tmp >> 7);
106 i = tmp & 0x7f;
107 if (j >= 128)
108 {
109 j -= 128;
110 k1 = COR[0] * exp_table[j] * mnt_table[i];
111 } else {
112 k1 = REAL_CONST(0);
113 }
114 #else
115
116 {
117 #define B 0.953125
118 real_t c = COR[0];
119 real_t v = VAR[0];
120 float32_t tmp;
121 if (c == 0 || v <= 1)
122 {
123 k1 = 0;
124 } else {
125 tmp = B / v;
126 flt_round(&tmp);
127 k1 = c * tmp;
128 }
129 }
130 #endif
131
132 if (pred)
133 {
134 #if 1
135 tmp = state->VAR[1];
136 j = (tmp >> 7);
137 i = tmp & 0x7f;
138 if (j >= 128)
139 {
140 j -= 128;
141 k2 = COR[1] * exp_table[j] * mnt_table[i];
142 } else {
143 k2 = REAL_CONST(0);
144 }
145 #else
146
147 #define B 0.953125
148 real_t c = COR[1];
149 real_t v = VAR[1];
150 float32_t tmp;
151 if (c == 0 || v <= 1)
152 {
153 k2 = 0;
154 } else {
155 tmp = B / v;
156 flt_round(&tmp);
157 k2 = c * tmp;
158 }
159 #endif
160
161 predictedvalue = k1*r[0] + k2*r[1];
162 flt_round(&predictedvalue);
163 *output = input + predictedvalue;
164 }
165
166 /* calculate new state data */
167 e0 = *output;
168 e1 = e0 - k1*r[0];
169 dr1 = k1*e0;
170
171 VAR[0] = ALPHA*VAR[0] + 0.5f * (r[0]*r[0] + e0*e0);
172 COR[0] = ALPHA*COR[0] + r[0]*e0;
173 VAR[1] = ALPHA*VAR[1] + 0.5f * (r[1]*r[1] + e1*e1);
174 COR[1] = ALPHA*COR[1] + r[1]*e1;
175
176 r[1] = A * (r[0]-dr1);
177 r[0] = A * e0;
178
179 state->r[0] = quant_pred(r[0]);
180 state->r[1] = quant_pred(r[1]);
181 state->COR[0] = quant_pred(COR[0]);
182 state->COR[1] = quant_pred(COR[1]);
183 state->VAR[0] = quant_pred(VAR[0]);
184 state->VAR[1] = quant_pred(VAR[1]);
185 }
186
187 static void reset_pred_state(pred_state *state)
188 {
189 state->r[0] = 0;
190 state->r[1] = 0;
191 state->COR[0] = 0;
192 state->COR[1] = 0;
193 state->VAR[0] = 0x3F80;
194 state->VAR[1] = 0x3F80;
195 }
196
197 void pns_reset_pred_state(ic_stream *ics, pred_state *state)
198 {
199 uint8_t sfb, g, b;
200 uint16_t i, offs, offs2;
201
202 /* prediction only for long blocks */
203 if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
204 return;
205
206 for (g = 0; g < ics->num_window_groups; g++)
207 {
208 for (b = 0; b < ics->window_group_length[g]; b++)
209 {
210 for (sfb = 0; sfb < ics->max_sfb; sfb++)
211 {
212 if (is_noise(ics, g, sfb))
213 {
214 offs = ics->swb_offset[sfb];
215 offs2 = min(ics->swb_offset[sfb+1], ics->swb_offset_max);
216
217 for (i = offs; i < offs2; i++)
218 reset_pred_state(&state[i]);
219 }
220 }
221 }
222 }
223 }
224
225 void reset_all_predictors(pred_state *state, uint16_t frame_len)
226 {
227 uint16_t i;
228
229 for (i = 0; i < frame_len; i++)
230 reset_pred_state(&state[i]);
231 }
232
233 /* intra channel prediction */
234 void ic_prediction(ic_stream *ics, real_t *spec, pred_state *state,
235 uint16_t frame_len, uint8_t sf_index)
236 {
237 uint8_t sfb;
238 uint16_t bin;
239
240 if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
241 {
242 reset_all_predictors(state, frame_len);
243 } else {
244 for (sfb = 0; sfb < max_pred_sfb(sf_index); sfb++)
245 {
246 uint16_t low = ics->swb_offset[sfb];
247 uint16_t high = min(ics->swb_offset[sfb+1], ics->swb_offset_max);
248
249 for (bin = low; bin < high; bin++)
250 {
251 ic_predict(&state[bin], spec[bin], &spec[bin],
252 (ics->predictor_data_present && ics->pred.prediction_used[sfb]));
253 }
254 }
255
256 if (ics->predictor_data_present)
257 {
258 if (ics->pred.predictor_reset)
259 {
260 for (bin = ics->pred.predictor_reset_group_number - 1;
261 bin < frame_len; bin += 30)
262 {
263 reset_pred_state(&state[bin]);
264 }
265 }
266 }
267 }
268 }
269
270 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: ic_predict.h,v 1.23 2007/11/01 12:33:31 menno Exp $
28 **/
29
30 #ifdef MAIN_DEC
31
32 #ifndef __IC_PREDICT_H__
33 #define __IC_PREDICT_H__
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 #define ALPHA REAL_CONST(0.90625)
40 #define A REAL_CONST(0.953125)
41
42
43 void pns_reset_pred_state(ic_stream *ics, pred_state *state);
44 void reset_all_predictors(pred_state *state, uint16_t frame_len);
45 void ic_prediction(ic_stream *ics, real_t *spec, pred_state *state,
46 uint16_t frame_len, uint8_t sf_index);
47
48 ALIGN static const real_t mnt_table[128] = {
49 COEF_CONST(0.9531250000), COEF_CONST(0.9453125000),
50 COEF_CONST(0.9375000000), COEF_CONST(0.9296875000),
51 COEF_CONST(0.9257812500), COEF_CONST(0.9179687500),
52 COEF_CONST(0.9101562500), COEF_CONST(0.9023437500),
53 COEF_CONST(0.8984375000), COEF_CONST(0.8906250000),
54 COEF_CONST(0.8828125000), COEF_CONST(0.8789062500),
55 COEF_CONST(0.8710937500), COEF_CONST(0.8671875000),
56 COEF_CONST(0.8593750000), COEF_CONST(0.8515625000),
57 COEF_CONST(0.8476562500), COEF_CONST(0.8398437500),
58 COEF_CONST(0.8359375000), COEF_CONST(0.8281250000),
59 COEF_CONST(0.8242187500), COEF_CONST(0.8203125000),
60 COEF_CONST(0.8125000000), COEF_CONST(0.8085937500),
61 COEF_CONST(0.8007812500), COEF_CONST(0.7968750000),
62 COEF_CONST(0.7929687500), COEF_CONST(0.7851562500),
63 COEF_CONST(0.7812500000), COEF_CONST(0.7773437500),
64 COEF_CONST(0.7734375000), COEF_CONST(0.7656250000),
65 COEF_CONST(0.7617187500), COEF_CONST(0.7578125000),
66 COEF_CONST(0.7539062500), COEF_CONST(0.7500000000),
67 COEF_CONST(0.7421875000), COEF_CONST(0.7382812500),
68 COEF_CONST(0.7343750000), COEF_CONST(0.7304687500),
69 COEF_CONST(0.7265625000), COEF_CONST(0.7226562500),
70 COEF_CONST(0.7187500000), COEF_CONST(0.7148437500),
71 COEF_CONST(0.7109375000), COEF_CONST(0.7070312500),
72 COEF_CONST(0.6992187500), COEF_CONST(0.6953125000),
73 COEF_CONST(0.6914062500), COEF_CONST(0.6875000000),
74 COEF_CONST(0.6835937500), COEF_CONST(0.6796875000),
75 COEF_CONST(0.6796875000), COEF_CONST(0.6757812500),
76 COEF_CONST(0.6718750000), COEF_CONST(0.6679687500),
77 COEF_CONST(0.6640625000), COEF_CONST(0.6601562500),
78 COEF_CONST(0.6562500000), COEF_CONST(0.6523437500),
79 COEF_CONST(0.6484375000), COEF_CONST(0.6445312500),
80 COEF_CONST(0.6406250000), COEF_CONST(0.6406250000),
81 COEF_CONST(0.6367187500), COEF_CONST(0.6328125000),
82 COEF_CONST(0.6289062500), COEF_CONST(0.6250000000),
83 COEF_CONST(0.6210937500), COEF_CONST(0.6210937500),
84 COEF_CONST(0.6171875000), COEF_CONST(0.6132812500),
85 COEF_CONST(0.6093750000), COEF_CONST(0.6054687500),
86 COEF_CONST(0.6054687500), COEF_CONST(0.6015625000),
87 COEF_CONST(0.5976562500), COEF_CONST(0.5937500000),
88 COEF_CONST(0.5937500000), COEF_CONST(0.5898437500),
89 COEF_CONST(0.5859375000), COEF_CONST(0.5820312500),
90 COEF_CONST(0.5820312500), COEF_CONST(0.5781250000),
91 COEF_CONST(0.5742187500), COEF_CONST(0.5742187500),
92 COEF_CONST(0.5703125000), COEF_CONST(0.5664062500),
93 COEF_CONST(0.5664062500), COEF_CONST(0.5625000000),
94 COEF_CONST(0.5585937500), COEF_CONST(0.5585937500),
95 COEF_CONST(0.5546875000), COEF_CONST(0.5507812500),
96 COEF_CONST(0.5507812500), COEF_CONST(0.5468750000),
97 COEF_CONST(0.5429687500), COEF_CONST(0.5429687500),
98 COEF_CONST(0.5390625000), COEF_CONST(0.5390625000),
99 COEF_CONST(0.5351562500), COEF_CONST(0.5312500000),
100 COEF_CONST(0.5312500000), COEF_CONST(0.5273437500),
101 COEF_CONST(0.5273437500), COEF_CONST(0.5234375000),
102 COEF_CONST(0.5195312500), COEF_CONST(0.5195312500),
103 COEF_CONST(0.5156250000), COEF_CONST(0.5156250000),
104 COEF_CONST(0.5117187500), COEF_CONST(0.5117187500),
105 COEF_CONST(0.5078125000), COEF_CONST(0.5078125000),
106 COEF_CONST(0.5039062500), COEF_CONST(0.5039062500),
107 COEF_CONST(0.5000000000), COEF_CONST(0.4980468750),
108 COEF_CONST(0.4960937500), COEF_CONST(0.4941406250),
109 COEF_CONST(0.4921875000), COEF_CONST(0.4902343750),
110 COEF_CONST(0.4882812500), COEF_CONST(0.4863281250),
111 COEF_CONST(0.4843750000), COEF_CONST(0.4824218750),
112 COEF_CONST(0.4804687500), COEF_CONST(0.4785156250)
113 };
114
115 ALIGN static const real_t exp_table[128] = {
116 COEF_CONST(0.50000000000000000000000000000000000000000000000000),
117 COEF_CONST(0.25000000000000000000000000000000000000000000000000),
118 COEF_CONST(0.12500000000000000000000000000000000000000000000000),
119 COEF_CONST(0.06250000000000000000000000000000000000000000000000),
120 COEF_CONST(0.03125000000000000000000000000000000000000000000000),
121 COEF_CONST(0.01562500000000000000000000000000000000000000000000),
122 COEF_CONST(0.00781250000000000000000000000000000000000000000000),
123 COEF_CONST(0.00390625000000000000000000000000000000000000000000),
124 COEF_CONST(0.00195312500000000000000000000000000000000000000000),
125 COEF_CONST(0.00097656250000000000000000000000000000000000000000),
126 COEF_CONST(0.00048828125000000000000000000000000000000000000000),
127 COEF_CONST(0.00024414062500000000000000000000000000000000000000),
128 COEF_CONST(0.00012207031250000000000000000000000000000000000000),
129 COEF_CONST(0.00006103515625000000000000000000000000000000000000),
130 COEF_CONST(0.00003051757812500000000000000000000000000000000000),
131 COEF_CONST(0.00001525878906250000000000000000000000000000000000),
132 COEF_CONST(0.00000762939453125000000000000000000000000000000000),
133 COEF_CONST(0.00000381469726562500000000000000000000000000000000),
134 COEF_CONST(0.00000190734863281250000000000000000000000000000000),
135 COEF_CONST(0.00000095367431640625000000000000000000000000000000),
136 COEF_CONST(0.00000047683715820312500000000000000000000000000000),
137 COEF_CONST(0.00000023841857910156250000000000000000000000000000),
138 COEF_CONST(0.00000011920928955078125000000000000000000000000000),
139 COEF_CONST(0.00000005960464477539062500000000000000000000000000),
140 COEF_CONST(0.00000002980232238769531300000000000000000000000000),
141 COEF_CONST(0.00000001490116119384765600000000000000000000000000),
142 COEF_CONST(0.00000000745058059692382810000000000000000000000000),
143 COEF_CONST(0.00000000372529029846191410000000000000000000000000),
144 COEF_CONST(0.00000000186264514923095700000000000000000000000000),
145 COEF_CONST(0.00000000093132257461547852000000000000000000000000),
146 COEF_CONST(0.00000000046566128730773926000000000000000000000000),
147 COEF_CONST(0.00000000023283064365386963000000000000000000000000),
148 COEF_CONST(0.00000000011641532182693481000000000000000000000000),
149 COEF_CONST(0.00000000005820766091346740700000000000000000000000),
150 COEF_CONST(0.00000000002910383045673370400000000000000000000000),
151 COEF_CONST(0.00000000001455191522836685200000000000000000000000),
152 COEF_CONST(0.00000000000727595761418342590000000000000000000000),
153 COEF_CONST(0.00000000000363797880709171300000000000000000000000),
154 COEF_CONST(0.00000000000181898940354585650000000000000000000000),
155 COEF_CONST(0.00000000000090949470177292824000000000000000000000),
156 COEF_CONST(0.00000000000045474735088646412000000000000000000000),
157 COEF_CONST(0.00000000000022737367544323206000000000000000000000),
158 COEF_CONST(0.00000000000011368683772161603000000000000000000000),
159 COEF_CONST(0.00000000000005684341886080801500000000000000000000),
160 COEF_CONST(0.00000000000002842170943040400700000000000000000000),
161 COEF_CONST(0.00000000000001421085471520200400000000000000000000),
162 COEF_CONST(0.00000000000000710542735760100190000000000000000000),
163 COEF_CONST(0.00000000000000355271367880050090000000000000000000),
164 COEF_CONST(0.00000000000000177635683940025050000000000000000000),
165 COEF_CONST(0.00000000000000088817841970012523000000000000000000),
166 COEF_CONST(0.00000000000000044408920985006262000000000000000000),
167 COEF_CONST(0.00000000000000022204460492503131000000000000000000),
168 COEF_CONST(0.00000000000000011102230246251565000000000000000000),
169 COEF_CONST(0.00000000000000005551115123125782700000000000000000),
170 COEF_CONST(0.00000000000000002775557561562891400000000000000000),
171 COEF_CONST(0.00000000000000001387778780781445700000000000000000),
172 COEF_CONST(0.00000000000000000693889390390722840000000000000000),
173 COEF_CONST(0.00000000000000000346944695195361420000000000000000),
174 COEF_CONST(0.00000000000000000173472347597680710000000000000000),
175 COEF_CONST(0.00000000000000000086736173798840355000000000000000),
176 COEF_CONST(0.00000000000000000043368086899420177000000000000000),
177 COEF_CONST(0.00000000000000000021684043449710089000000000000000),
178 COEF_CONST(0.00000000000000000010842021724855044000000000000000),
179 COEF_CONST(0.00000000000000000005421010862427522200000000000000),
180 COEF_CONST(0.00000000000000000002710505431213761100000000000000),
181 COEF_CONST(0.00000000000000000001355252715606880500000000000000),
182 COEF_CONST(0.00000000000000000000677626357803440270000000000000),
183 COEF_CONST(0.00000000000000000000338813178901720140000000000000),
184 COEF_CONST(0.00000000000000000000169406589450860070000000000000),
185 COEF_CONST(0.00000000000000000000084703294725430034000000000000),
186 COEF_CONST(0.00000000000000000000042351647362715017000000000000),
187 COEF_CONST(0.00000000000000000000021175823681357508000000000000),
188 COEF_CONST(0.00000000000000000000010587911840678754000000000000),
189 COEF_CONST(0.00000000000000000000005293955920339377100000000000),
190 COEF_CONST(0.00000000000000000000002646977960169688600000000000),
191 COEF_CONST(0.00000000000000000000001323488980084844300000000000),
192 COEF_CONST(0.00000000000000000000000661744490042422140000000000),
193 COEF_CONST(0.00000000000000000000000330872245021211070000000000),
194 COEF_CONST(0.00000000000000000000000165436122510605530000000000),
195 COEF_CONST(0.00000000000000000000000082718061255302767000000000),
196 COEF_CONST(0.00000000000000000000000041359030627651384000000000),
197 COEF_CONST(0.00000000000000000000000020679515313825692000000000),
198 COEF_CONST(0.00000000000000000000000010339757656912846000000000),
199 COEF_CONST(0.00000000000000000000000005169878828456423000000000),
200 COEF_CONST(0.00000000000000000000000002584939414228211500000000),
201 COEF_CONST(0.00000000000000000000000001292469707114105700000000),
202 COEF_CONST(0.00000000000000000000000000646234853557052870000000),
203 COEF_CONST(0.00000000000000000000000000323117426778526440000000),
204 COEF_CONST(0.00000000000000000000000000161558713389263220000000),
205 COEF_CONST(0.00000000000000000000000000080779356694631609000000),
206 COEF_CONST(0.00000000000000000000000000040389678347315804000000),
207 COEF_CONST(0.00000000000000000000000000020194839173657902000000),
208 COEF_CONST(0.00000000000000000000000000010097419586828951000000),
209 COEF_CONST(0.00000000000000000000000000005048709793414475600000),
210 COEF_CONST(0.00000000000000000000000000002524354896707237800000),
211 COEF_CONST(0.00000000000000000000000000001262177448353618900000),
212 COEF_CONST(0.00000000000000000000000000000631088724176809440000),
213 COEF_CONST(0.00000000000000000000000000000315544362088404720000),
214 COEF_CONST(0.00000000000000000000000000000157772181044202360000),
215 COEF_CONST(0.00000000000000000000000000000078886090522101181000),
216 COEF_CONST(0.00000000000000000000000000000039443045261050590000),
217 COEF_CONST(0.00000000000000000000000000000019721522630525295000),
218 COEF_CONST(0.00000000000000000000000000000009860761315262647600),
219 COEF_CONST(0.00000000000000000000000000000004930380657631323800),
220 COEF_CONST(0.00000000000000000000000000000002465190328815661900),
221 COEF_CONST(0.00000000000000000000000000000001232595164407830900),
222 COEF_CONST(0.00000000000000000000000000000000616297582203915470),
223 COEF_CONST(0.00000000000000000000000000000000308148791101957740),
224 COEF_CONST(0.00000000000000000000000000000000154074395550978870),
225 COEF_CONST(0.00000000000000000000000000000000077037197775489434),
226 COEF_CONST(0.00000000000000000000000000000000038518598887744717),
227 COEF_CONST(0.00000000000000000000000000000000019259299443872359),
228 COEF_CONST(0.00000000000000000000000000000000009629649721936179),
229 COEF_CONST(0.00000000000000000000000000000000004814824860968090),
230 COEF_CONST(0.00000000000000000000000000000000002407412430484045),
231 COEF_CONST(0.00000000000000000000000000000000001203706215242022),
232 COEF_CONST(0.00000000000000000000000000000000000601853107621011),
233 COEF_CONST(0.00000000000000000000000000000000000300926553810506),
234 COEF_CONST(0.00000000000000000000000000000000000150463276905253),
235 COEF_CONST(0.00000000000000000000000000000000000075231638452626),
236 COEF_CONST(0.00000000000000000000000000000000000037615819226313),
237 COEF_CONST(0.00000000000000000000000000000000000018807909613157),
238 COEF_CONST(0.00000000000000000000000000000000000009403954806578),
239 COEF_CONST(0.00000000000000000000000000000000000004701977403289),
240 COEF_CONST(0.00000000000000000000000000000000000002350988701645),
241 COEF_CONST(0.00000000000000000000000000000000000001175494350822),
242 COEF_CONST(0.0 /* 0000000000000000000000000000000000000587747175411 "floating point underflow" */),
243 COEF_CONST(0.0)
244 };
245
246 #ifdef __cplusplus
247 }
248 #endif
249 #endif
250
251 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: iq_table.h,v 1.20 2007/11/01 12:33:31 menno Exp $
28 **/
29
30 #ifndef IQ_TABLE_H__
31 #define IQ_TABLE_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37
38 /* !!!DON'T CHANGE IQ_TABLE_SIZE!!! */
39
40
41 #ifndef FIXED_POINT
42
43 #define IQ_TABLE_SIZE 8192
44
45 #ifdef _MSC_VER
46 #pragma warning(disable:4305)
47 #pragma warning(disable:4244)
48 #endif
49
50 ALIGN static const real_t iq_table[IQ_TABLE_SIZE] =
51 {
52 0,
53 1,
54 2.5198420997897464,
55 4.3267487109222245,
56 6.3496042078727974,
57 8.5498797333834844,
58 10.902723556992836,
59 13.390518279406722,
60 15.999999999999998,
61 18.720754407467133,
62 21.544346900318832,
63 24.463780996262464,
64 27.47314182127996,
65 30.567350940369842,
66 33.741991698453212,
67 36.993181114957046,
68 40.317473596635935,
69 43.711787041189993,
70 47.173345095760126,
71 50.699631325716943,
72 54.288352331898118,
73 57.937407704003519,
74 61.6448652744185,
75 65.408940536585988,
76 69.227979374755591,
77 73.100443455321638,
78 77.024897778591622,
79 80.999999999999986,
80 85.024491212518527,
81 89.097187944889555,
82 93.216975178615741,
83 97.382800224133163,
84 101.59366732596474,
85 105.84863288986224,
86 110.14680124343441,
87 114.4873208566006,
88 118.86938096020653,
89 123.29220851090024,
90 127.75506545836058,
91 132.25724627755247,
92 136.79807573413572,
93 141.37690685569191,
94 145.99311908523086,
95 150.6461165966291,
96 155.33532675434674,
97 160.06019870205279,
98 164.82020206673349,
99 169.61482576651861,
100 174.44357691188537,
101 179.30597979112557,
102 184.20157493201927,
103 189.12991823257562,
104 194.09058015449685,
105 199.08314497371677,
106 204.1072100829694,
107 209.16238534187647,
108 214.24829247050752,
109 219.36456448277784,
110 224.51084515641216,
111 229.6867885365223,
112 234.89205847013176,
113 240.12632816923249,
114 245.38927980018505,
115 250.68060409747261,
116 255.99999999999991,
117 261.34717430828869,
118 266.72184136106449,
119 272.12372272986045,
120 277.55254693037961,
121 283.0080491494619,
122 288.48997098659891,
123 293.99806020902247,
124 299.53207051947408,
125 305.0917613358298,
126 310.67689758182206,
127 316.28724948815585,
128 321.92259240337177,
129 327.58270661385535,
130 333.26737717243742,
131 338.97639373507025,
132 344.70955040510125,
133 350.46664558470013,
134 356.24748183302603,
135 362.05186573075139,
136 367.87960775058258,
137 373.73052213344511,
138 379.60442677002078,
139 385.50114308734607,
140 391.42049594019937,
141 397.36231350702371,
142 403.32642719014467,
143 409.31267152006262,
144 415.32088406360799,
145 421.35090533576471,
146 427.40257871497619,
147 433.4757503617617,
148 439.5702691404793,
149 445.68598654408271,
150 451.82275662172759,
151 457.98043590909128,
152 464.15888336127773,
153 470.35796028818726,
154 476.5775302922363,
155 482.81745920832043,
156 489.07761504591741,
157 495.35786793323581,
158 501.65809006331688,
159 507.97815564200368,
160 514.31794083769648,
161 520.67732373281672,
162 527.05618427690604,
163 533.45440424129174,
164 539.87186717525128,
165 546.30845836361505,
166 552.76406478574609,
167 559.23857507584194,
168 565.73187948450413,
169 572.24386984152341,
170 578.77443951983378,
171 585.32348340058843,
172 591.89089783931263,
173 598.47658063309257,
174 605.08043098876044,
175 611.70234949203643,
176 618.3422380775919,
177 624.99999999999977,
178 631.67553980553748,
179 638.36876330481164,
180 645.07957754617485,
181 651.80789078990415,
182 658.55361248311499,
183 665.31665323538357,
184 672.09692479505225,
185 678.8943400261943,
186 685.70881288621433,
187 692.540258404062,
188 699.38859265903977,
189 706.25373276018058,
190 713.13559682617972,
191 720.03410396586037,
192 726.94917425915435,
193 733.88072873858209,
194 740.82868937121543,
195 747.79297904110535,
196 754.77352153216191,
197 761.77024151147043,
198 768.78306451302956,
199 775.81191692189896,
200 782.85672595874246,
201 789.91741966475445,
202 796.99392688695798,
203 804.08617726386274,
204 811.19410121147098,
205 818.31762990962227,
206 825.45669528866563,
207 832.61123001644864,
208 839.78116748561604,
209 846.96644180120552,
210 854.16698776853514,
211 861.38274088137143,
212 868.61363731036977,
213 875.85961389178203,
214 883.12060811641959,
215 890.39655811886757,
216 897.68740266694181,
217 904.99308115138172,
218 912.31353357577188,
219 919.64870054668756,
220 926.99852326405619,
221 934.36294351172899,
222 941.74190364825859,
223 949.13534659787422,
224 956.54321584165211,
225 963.96545540887348,
226 971.40200986856541,
227 978.85282432122176,
228 986.31784439069588,
229 993.7970162162635,
230 1001.29028644485,
231 1008.797602223418,
232 1016.3189111915103,
233 1023.8541614739464,
234 1031.4033016736653,
235 1038.9662808647138,
236 1046.5430485853758,
237 1054.1335548314366,
238 1061.7377500495838,
239 1069.3555851309357,
240 1076.9870114046978,
241 1084.6319806319441,
242 1092.2904449995174,
243 1099.9623571140482,
244 1107.6476699960892,
245 1115.3463370743607,
246 1123.058312180106,
247 1130.7835495415541,
248 1138.5220037784854,
249 1146.273629896901,
250 1154.0383832837879,
251 1161.816219701986,
252 1169.607095285146,
253 1177.4109665327808,
254 1185.2277903054078,
255 1193.0575238197798,
256 1200.9001246442001,
257 1208.7555506939248,
258 1216.6237602266442,
259 1224.5047118380478,
260 1232.3983644574657,
261 1240.3046773435874,
262 1248.2236100802568,
263 1256.1551225723395,
264 1264.099175041662,
265 1272.0557280230228,
266 1280.0247423602691,
267 1288.0061792024444,
268 1295.9999999999995,
269 1304.006166501068,
270 1312.0246407478062,
271 1320.0553850727929,
272 1328.0983620954903,
273 1336.1535347187651,
274 1344.2208661254647,
275 1352.3003197750522,
276 1360.3918594002962,
277 1368.4954490040145,
278 1376.6110528558709,
279 1384.7386354892244,
280 1392.8781616980295,
281 1401.0295965337855,
282 1409.1929053025353,
283 1417.3680535619119,
284 1425.5550071182327,
285 1433.7537320236374,
286 1441.9641945732744,
287 1450.1863613025282,
288 1458.4201989842913,
289 1466.6656746262797,
290 1474.9227554683875,
291 1483.1914089800841,
292 1491.4716028578516,
293 1499.7633050226596,
294 1508.0664836174794,
295 1516.3811070048375,
296 1524.7071437644029,
297 1533.0445626906128,
298 1541.3933327903342,
299 1549.7534232805581,
300 1558.1248035861302,
301 1566.507443337515,
302 1574.9013123685909,
303 1583.3063807144795,
304 1591.7226186094069,
305 1600.1499964845941,
306 1608.58848496618,
307 1617.0380548731737,
308 1625.4986772154357,
309 1633.9703231916887,
310 1642.4529641875577,
311 1650.9465717736346,
312 1659.4511177035752,
313 1667.9665739122186,
314 1676.4929125137353,
315 1685.030105799801,
316 1693.5781262377957,
317 1702.136946469027,
318 1710.7065393069795,
319 1719.2868777355877,
320 1727.8779349075323,
321 1736.4796841425596,
322 1745.092098925825,
323 1753.7151529062583,
324 1762.3488198949503,
325 1770.9930738635628,
326 1779.6478889427597,
327 1788.3132394206564,
328 1796.9890997412947,
329 1805.6754445031333,
330 1814.3722484575621,
331 1823.0794865074322,
332 1831.7971337056094,
333 1840.5251652535437,
334 1849.2635564998579,
335 1858.0122829389563,
336 1866.7713202096493,
337 1875.5406440937966,
338 1884.3202305149687,
339 1893.110055537124,
340 1901.9100953633042,
341 1910.7203263343454,
342 1919.5407249276057,
343 1928.3712677557098,
344 1937.2119315653083,
345 1946.0626932358525,
346 1954.923529778386,
347 1963.79441833435,
348 1972.6753361744036,
349 1981.5662606972594,
350 1990.467169428533,
351 1999.3780400196069,
352 2008.2988502465078,
353 2017.2295780087982,
354 2026.1702013284819,
355 2035.1206983489212,
356 2044.0810473337688,
357 2053.0512266659125,
358 2062.0312148464309,
359 2071.0209904935646,
360 2080.0205323416958,
361 2089.0298192403443,
362 2098.0488301531714,
363 2107.0775441569995,
364 2116.115940440839,
365 2125.1639983049317,
366 2134.2216971597995,
367 2143.2890165253098,
368 2152.3659360297484,
369 2161.4524354089031,
370 2170.5484945051617,
371 2179.6540932666144,
372 2188.7692117461711,
373 2197.8938301006888,
374 2207.0279285901042,
375 2216.1714875765838,
376 2225.324487523676,
377 2234.4869089954782,
378 2243.6587326558101,
379 2252.8399392673982,
380 2262.0305096910702,
381 2271.2304248849537,
382 2280.4396659036897,
383 2289.6582138976523,
384 2298.8860501121762,
385 2308.1231558867926,
386 2317.3695126544767,
387 2326.6251019409005,
388 2335.8899053636933,
389 2345.1639046317132,
390 2354.4470815443233,
391 2363.7394179906792,
392 2373.0408959490205,
393 2382.3514974859731,
394 2391.6712047558558,
395 2400.9999999999991,
396 2410.3378655460651,
397 2419.6847838073813,
398 2429.0407372822747,
399 2438.4057085534191,
400 2447.7796802871858,
401 2457.1626352330004,
402 2466.5545562227112,
403 2475.9554261699564,
404 2485.3652280695474,
405 2494.7839449968492,
406 2504.2115601071737,
407 2513.6480566351788,
408 2523.0934178942675,
409 2532.5476272760025,
410 2542.0106682495189,
411 2551.482524360948,
412 2560.9631792328441,
413 2570.4526165636184,
414 2579.9508201269791,
415 2589.4577737713744,
416 2598.9734614194458,
417 2608.4978670674823,
418 2618.0309747848837,
419 2627.5727687136259,
420 2637.1232330677353,
421 2646.6823521327647,
422 2656.2501102652768,
423 2665.8264918923328,
424 2675.4114815109842,
425 2685.0050636877722,
426 2694.6072230582295,
427 2704.2179443263894,
428 2713.8372122642972,
429 2723.4650117115279,
430 2733.1013275747096,
431 2742.7461448270483,
432 2752.3994485078601,
433 2762.0612237221085,
434 2771.7314556399419,
435 2781.4101294962406,
436 2791.0972305901655,
437 2800.7927442847094,
438 2810.4966560062589,
439 2820.2089512441521,
440 2829.9296155502466,
441 2839.6586345384894,
442 2849.3959938844923,
443 2859.1416793251065,
444 2868.8956766580086,
445 2878.6579717412847,
446 2888.4285504930212,
447 2898.2073988908974,
448 2907.9945029717837,
449 2917.789848831344,
450 2927.5934226236377,
451 2937.4052105607311,
452 2947.2251989123079,
453 2957.0533740052865,
454 2966.8897222234368,
455 2976.734230007005,
456 2986.5868838523397,
457 2996.4476703115197,
458 3006.3165759919889,
459 3016.1935875561908,
460 3026.0786917212095,
461 3035.9718752584108,
462 3045.8731249930906,
463 3055.7824278041207,
464 3065.6997706236039,
465 3075.625140436528,
466 3085.5585242804245,
467 3095.4999092450298,
468 3105.4492824719491,
469 3115.4066311543256,
470 3125.3719425365089,
471 3135.3452039137287,
472 3145.3264026317715,
473 3155.3155260866592,
474 3165.3125617243295,
475 3175.3174970403229,
476 3185.3303195794679,
477 3195.35101693557,
478 3205.3795767511078,
479 3215.4159867169251,
480 3225.460234571929,
481 3235.5123081027928,
482 3245.5721951436558,
483 3255.63988357583,
484 3265.7153613275095,
485 3275.7986163734795,
486 3285.8896367348289,
487 3295.9884104786665,
488 3306.0949257178395,
489 3316.2091706106517,
490 3326.331133360588,
491 3336.4608022160378,
492 3346.5981654700231,
493 3356.7432114599264,
494 3366.8959285672249,
495 3377.0563052172211,
496 3387.2243298787821,
497 3397.3999910640764,
498 3407.5832773283128,
499 3417.7741772694862,
500 3427.9726795281199,
501 3438.1787727870123,
502 3448.3924457709873,
503 3458.6136872466445,
504 3468.8424860221107,
505 3479.0788309467976,
506 3489.3227109111554,
507 3499.5741148464344,
508 3509.8330317244445,
509 3520.0994505573185,
510 3530.3733603972751,
511 3540.6547503363886,
512 3550.9436095063534,
513 3561.239927078258,
514 3571.5436922623535,
515 3581.8548943078308,
516 3592.1735225025936,
517 3602.4995661730372,
518 3612.8330146838275,
519 3623.1738574376814,
520 3633.5220838751502,
521 3643.8776834744031,
522 3654.2406457510142,
523 3664.6109602577494,
524 3674.9886165843564,
525 3685.3736043573545,
526 3695.7659132398294,
527 3706.1655329312248,
528 3716.5724531671399,
529 3726.9866637191262,
530 3737.4081543944876,
531 3747.8369150360782,
532 3758.2729355221072,
533 3768.7162057659411,
534 3779.1667157159077,
535 3789.6244553551055,
536 3800.0894147012082,
537 3810.5615838062768,
538 3821.0409527565694,
539 3831.5275116723533,
540 3842.0212507077194,
541 3852.522160050396,
542 3863.0302299215673,
543 3873.5454505756893,
544 3884.0678123003108,
545 3894.5973054158922,
546 3905.1339202756285,
547 3915.6776472652732,
548 3926.2284768029604,
549 3936.7863993390338,
550 3947.3514053558706,
551 3957.9234853677135,
552 3968.5026299204969,
553 3979.0888295916798,
554 3989.6820749900776,
555 4000.2823567556948,
556 4010.8896655595613,
557 4021.5039921035655,
558 4032.1253271202945,
559 4042.7536613728694,
560 4053.3889856547858,
561 4064.0312907897551,
562 4074.6805676315448,
563 4085.3368070638221,
564 4095.9999999999982,
565 4106.6701373830711,
566 4117.347210185475,
567 4128.0312094089259,
568 4138.722126084268,
569 4149.4199512713267,
570 4160.1246760587583,
571 4170.8362915638982,
572 4181.5547889326181,
573 4192.2801593391769,
574 4203.0123939860741,
575 4213.7514841039101,
576 4224.4974209512384,
577 4235.2501958144258,
578 4246.0098000075095,
579 4256.7762248720574,
580 4267.549461777031,
581 4278.3295021186423,
582 4289.1163373202198,
583 4299.9099588320714,
584 4310.7103581313495,
585 4321.5175267219138,
586 4332.3314561342004,
587 4343.152137925088,
588 4353.9795636777671,
589 4364.8137250016052,
590 4375.6546135320223,
591 4386.5022209303588,
592 4397.3565388837469,
593 4408.2175591049827,
594 4419.0852733324018,
595 4429.9596733297531,
596 4440.8407508860728,
597 4451.7284978155603,
598 4462.6229059574571,
599 4473.5239671759227,
600 4484.4316733599126,
601 4495.3460164230582,
602 4506.2669883035496,
603 4517.1945809640119,
604 4528.1287863913894,
605 4539.069596596828,
606 4550.0170036155587,
607 4560.9709995067806,
608 4571.931576353546,
609 4582.898726262647,
610 4593.8724413645004,
611 4604.8527138130348,
612 4615.8395357855816,
613 4626.8328994827571,
614 4637.8327971283588,
615 4648.8392209692511,
616 4659.8521632752563,
617 4670.8716163390473,
618 4681.8975724760394,
619 4692.9300240242837,
620 4703.9689633443595,
621 4715.0143828192668,
622 4726.0662748543255,
623 4737.1246318770682,
624 4748.1894463371373,
625 4759.2607107061804,
626 4770.3384174777493,
627 4781.4225591671993,
628 4792.5131283115852,
629 4803.6101174695614,
630 4814.7135192212854,
631 4825.8233261683154,
632 4836.9395309335096,
633 4848.0621261609349,
634 4859.1911045157631,
635 4870.3264586841779,
636 4881.4681813732768,
637 4892.6162653109768,
638 4903.7707032459193,
639 4914.931487947375,
640 4926.0986122051509,
641 4937.2720688294967,
642 4948.4518506510112,
643 4959.637950520555,
644 4970.8303613091521,
645 4982.0290759079044,
646 4993.2340872278974,
647 5004.4453882001153,
648 5015.6629717753467,
649 5026.8868309241007,
650 5038.1169586365131,
651 5049.353347922266,
652 5060.5959918104927,
653 5071.8448833496996,
654 5083.1000156076734,
655 5094.3613816713996,
656 5105.6289746469747,
657 5116.9027876595246,
658 5128.18281385312,
659 5139.4690463906918,
660 5150.7614784539473,
661 5162.0601032432933,
662 5173.3649139777472,
663 5184.6759038948594,
664 5195.9930662506322,
665 5207.3163943194386,
666 5218.6458813939435,
667 5229.9815207850224,
668 5241.3233058216847,
669 5252.6712298509919,
670 5264.025286237983,
671 5275.3854683655954,
672 5286.7517696345885,
673 5298.1241834634639,
674 5309.5027032883945,
675 5320.887322563146,
676 5332.2780347589978,
677 5343.6748333646756,
678 5355.0777118862716,
679 5366.4866638471722,
680 5377.901682787985,
681 5389.3227622664635,
682 5400.749895857437,
683 5412.1830771527357,
684 5423.622299761123,
685 5435.067557308219,
686 5446.5188434364318,
687 5457.9761518048872,
688 5469.4394760893592,
689 5480.9088099821975,
690 5492.3841471922606,
691 5503.8654814448455,
692 5515.3528064816201,
693 5526.846116060552,
694 5538.3454039558474,
695 5549.8506639578736,
696 5561.3618898731029,
697 5572.8790755240361,
698 5584.4022147491451,
699 5595.9313014027975,
700 5607.4663293552012,
701 5619.0072924923297,
702 5630.5541847158656,
703 5642.1069999431284,
704 5653.665732107017,
705 5665.230375155943,
706 5676.8009230537655,
707 5688.3773697797333,
708 5699.9597093284156,
709 5711.5479357096474,
710 5723.1420429484588,
711 5734.7420250850209,
712 5746.347876174581,
713 5757.9595902874016,
714 5769.5771615087006,
715 5781.2005839385911,
716 5792.8298516920213,
717 5804.4649588987149,
718 5816.1058997031105,
719 5827.7526682643065,
720 5839.4052587559972,
721 5851.0636653664196,
722 5862.7278822982908,
723 5874.3979037687541,
724 5886.0737240093204,
725 5897.7553372658094,
726 5909.4427377982956,
727 5921.1359198810505,
728 5932.8348778024874,
729 5944.5396058651031,
730 5956.2500983854261,
731 5967.9663496939575,
732 5979.6883541351208,
733 5991.4161060672022,
734 6003.1495998623004,
735 6014.8888299062692,
736 6026.6337905986684,
737 6038.3844763527022,
738 6050.1408815951781,
739 6061.9030007664414,
740 6073.6708283203316,
741 6085.4443587241267,
742 6097.2235864584891,
743 6109.0085060174197,
744 6120.7991119081998,
745 6132.595398651345,
746 6144.3973607805519,
747 6156.2049928426459,
748 6168.0182893975361,
749 6179.8372450181578,
750 6191.6618542904307,
751 6203.4921118132024,
752 6215.3280121982016,
753 6227.1695500699925,
754 6239.0167200659189,
755 6250.8695168360628,
756 6262.7279350431891,
757 6274.5919693627056,
758 6286.4616144826068,
759 6298.3368651034316,
760 6310.2177159382172,
761 6322.1041617124456,
762 6333.9961971640032,
763 6345.8938170431311,
764 6357.7970161123785,
765 6369.7057891465583,
766 6381.6201309327007,
767 6393.5400362700075,
768 6405.4654999698032,
769 6417.3965168554978,
770 6429.3330817625329,
771 6441.2751895383453,
772 6453.2228350423138,
773 6465.176013145724,
774 6477.134718731716,
775 6489.0989466952469,
776 6501.0686919430445,
777 6513.0439493935628,
778 6525.0247139769417,
779 6537.010980634961,
780 6549.002744321001,
781 6560.9999999999973,
782 6573.0027426483985,
783 6585.0109672541284,
784 6597.0246688165371,
785 6609.0438423463656,
786 6621.0684828657004,
787 6633.0985854079354,
788 6645.134145017727,
789 6657.1751567509573,
790 6669.2216156746908,
791 6681.2735168671343,
792 6693.3308554176001,
793 6705.3936264264594,
794 6717.461825005108,
795 6729.535446275926,
796 6741.6144853722335,
797 6753.6989374382601,
798 6765.7887976290967,
799 6777.8840611106634,
800 6789.9847230596661,
801 6802.0907786635626,
802 6814.2022231205201,
803 6826.3190516393797,
804 6838.4412594396181,
805 6850.5688417513074,
806 6862.701793815083,
807 6874.840110882099,
808 6886.9837882139991,
809 6899.1328210828724,
810 6911.2872047712199,
811 6923.4469345719199,
812 6935.6120057881863,
813 6947.7824137335365,
814 6959.9581537317536,
815 6972.1392211168532,
816 6984.3256112330409,
817 6996.5173194346862,
818 7008.7143410862773,
819 7020.9166715623942,
820 7033.1243062476678,
821 7045.3372405367481,
822 7057.5554698342685,
823 7069.7789895548103,
824 7082.0077951228714,
825 7094.2418819728273,
826 7106.4812455489018,
827 7118.7258813051285,
828 7130.9757847053224,
829 7143.2309512230404,
830 7155.4913763415516,
831 7167.7570555538041,
832 7180.0279843623894,
833 7192.3041582795131,
834 7204.5855728269571,
835 7216.8722235360519,
836 7229.1641059476406,
837 7241.4612156120484,
838 7253.7635480890503,
839 7266.0710989478375,
840 7278.3838637669869,
841 7290.7018381344296,
842 7303.0250176474174,
843 7315.3533979124932,
844 7327.6869745454596,
845 7340.0257431713462,
846 7352.3696994243801,
847 7364.7188389479543,
848 7377.0731573945968,
849 7389.4326504259407,
850 7401.7973137126937,
851 7414.1671429346061,
852 7426.5421337804428,
853 7438.922281947951,
854 7451.3075831438346,
855 7463.6980330837177,
856 7476.0936274921214,
857 7488.4943621024304,
858 7500.9002326568652,
859 7513.3112349064522,
860 7525.7273646109943,
861 7538.1486175390446,
862 7550.5749894678729,
863 7563.0064761834419,
864 7575.4430734803736,
865 7587.8847771619248,
866 7600.3315830399597,
867 7612.7834869349153,
868 7625.24048467578,
869 7637.7025721000637,
870 7650.1697450537677,
871 7662.6419993913596,
872 7675.1193309757446,
873 7687.6017356782404,
874 7700.0892093785433,
875 7712.5817479647112,
876 7725.079347333125,
877 7737.5820033884729,
878 7750.0897120437139,
879 7762.6024692200581,
880 7775.1202708469355,
881 7787.6431128619733,
882 7800.1709912109645,
883 7812.7039018478481,
884 7825.2418407346768,
885 7837.7848038415968,
886 7850.3327871468155,
887 7862.8857866365806,
888 7875.4437983051539,
889 7888.006818154784,
890 7900.5748421956796,
891 7913.1478664459901,
892 7925.725886931772,
893 7938.3088996869719,
894 7950.8969007533951,
895 7963.4898861806851,
896 7976.0878520262959,
897 7988.6907943554688,
898 8001.2987092412086,
899 8013.911592764257,
900 8026.5294410130691,
901 8039.1522500837891,
902 8051.7800160802271,
903 8064.412735113835,
904 8077.0504033036796,
905 8089.6930167764222,
906 8102.3405716662946,
907 8114.9930641150731,
908 8127.6504902720571,
909 8140.3128462940449,
910 8152.9801283453098,
911 8165.6523325975786,
912 8178.3294552300049,
913 8191.0114924291529,
914 8203.6984403889655,
915 8216.3902953107463,
916 8229.0870534031419,
917 8241.7887108821069,
918 8254.4952639708936,
919 8267.2067089000211,
920 8279.9230419072574,
921 8292.6442592375952,
922 8305.3703571432306,
923 8318.101331883543,
924 8330.8371797250657,
925 8343.577896941475,
926 8356.3234798135582,
927 8369.0739246291978,
928 8381.8292276833508,
929 8394.5893852780209,
930 8407.3543937222421,
931 8420.1242493320569,
932 8432.8989484304948,
933 8445.6784873475499,
934 8458.4628624201578,
935 8471.2520699921806,
936 8484.0461064143838,
937 8496.8449680444082,
938 8509.6486512467636,
939 8522.4571523927953,
940 8535.270467860666,
941 8548.0885940353437,
942 8560.9115273085663,
943 8573.7392640788403,
944 8586.5718007514006,
945 8599.4091337382069,
946 8612.2512594579148,
947 8625.0981743358552,
948 8637.9498748040205,
949 8650.8063573010386,
950 8663.6676182721567,
951 8676.533654169225,
952 8689.4044614506638,
953 8702.2800365814601,
954 8715.1603760331418,
955 8728.0454762837508,
956 8740.9353338178389,
957 8753.8299451264356,
958 8766.7293067070332,
959 8779.6334150635721,
960 8792.5422667064158,
961 8805.4558581523324,
962 8818.3741859244819,
963 8831.2972465523908,
964 8844.2250365719356,
965 8857.1575525253265,
966 8870.0947909610859,
967 8883.0367484340295,
968 8895.9834215052524,
969 8908.934806742107,
970 8921.8909007181846,
971 8934.8517000132997,
972 8947.817201213471,
973 8960.7874009109,
974 8973.7622957039603,
975 8986.7418821971733,
976 8999.7261570011924,
977 9012.7151167327884,
978 9025.7087580148236,
979 9038.7070774762469,
980 9051.7100717520643,
981 9064.7177374833282,
982 9077.7300713171153,
983 9090.7470699065179,
984 9103.7687299106146,
985 9116.7950479944648,
986 9129.8260208290812,
987 9142.8616450914233,
988 9155.9019174643727,
989 9168.9468346367157,
990 9181.9963933031358,
991 9195.0505901641845,
992 9208.1094219262741,
993 9221.1728853016557,
994 9234.240977008405,
995 9247.3136937704076,
996 9260.3910323173386,
997 9273.472989384647,
998 9286.5595617135423,
999 9299.6507460509747,
1000 9312.7465391496207,
1001 9325.8469377678684,
1002 9338.9519386698012,
1003 9352.0615386251757,
1004 9365.1757344094131,
1005 9378.2945228035842,
1006 9391.4179005943843,
1007 9404.5458645741273,
1008 9417.6784115407263,
1009 9430.8155382976747,
1010 9443.9572416540359,
1011 9457.1035184244265,
1012 9470.2543654290002,
1013 9483.4097794934296,
1014 9496.5697574488931,
1015 9509.7342961320664,
1016 9522.9033923850911,
1017 9536.0770430555804,
1018 9549.2552449965824,
1019 9562.4379950665825,
1020 9575.6252901294793,
1021 9588.8171270545736,
1022 9602.0135027165488,
1023 9615.2144139954635,
1024 9628.4198577767274,
1025 9641.629830951093,
1026 9654.844330414644,
1027 9668.0633530687719,
1028 9681.286895820167,
1029 9694.5149555808002,
1030 9707.7475292679192,
1031 9720.9846138040157,
1032 9734.2262061168276,
1033 9747.4723031393187,
1034 9760.7229018096641,
1035 9773.9779990712323,
1036 9787.2375918725811,
1037 9800.5016771674327,
1038 9813.7702519146696,
1039 9827.0433130783094,
1040 9840.3208576275028,
1041 9853.602882536512,
1042 9866.8893847846994,
1043 9880.1803613565116,
1044 9893.4758092414686,
1045 9906.7757254341523,
1046 9920.0801069341851,
1047 9933.3889507462245,
1048 9946.7022538799429,
1049 9960.0200133500221,
1050 9973.3422261761298,
1051 9986.6688893829159,
1052 9999.9999999999945,
1053 10013.335555061929,
1054 10026.675551608221,
1055 10040.019986683301,
1056 10053.368857336509,
1057 10066.722160622081,
1058 10080.079893599144,
1059 10093.442053331697,
1060 10106.808636888598,
1061 10120.179641343551,
1062 10133.555063775095,
1063 10146.934901266595,
1064 10160.31915090622,
1065 10173.707809786936,
1066 10187.100875006496,
1067 10200.498343667417,
1068 10213.900212876984,
1069 10227.306479747222,
1070 10240.717141394889,
1071 10254.132194941467,
1072 10267.551637513146,
1073 10280.975466240814,
1074 10294.40367826004,
1075 10307.836270711066,
1076 10321.273240738796,
1077 10334.71458549278,
1078 10348.160302127204,
1079 10361.610387800878,
1080 10375.064839677221,
1081 10388.523654924258,
1082 10401.986830714593,
1083 10415.454364225412,
1084 10428.926252638465,
1085 10442.402493140049,
1086 10455.883082921007,
1087 10469.368019176709,
1088 10482.85729910704,
1089 10496.350919916393,
1090 10509.848878813653,
1091 10523.351173012188,
1092 10536.857799729838,
1093 10550.3687561889,
1094 10563.884039616123,
1095 10577.403647242685,
1096 10590.927576304197,
1097 10604.455824040679,
1098 10617.988387696556,
1099 10631.525264520642,
1100 10645.066451766135,
1101 10658.611946690598,
1102 10672.161746555956,
1103 10685.715848628475,
1104 10699.274250178762,
1105 10712.836948481747,
1106 10726.403940816675,
1107 10739.975224467091,
1108 10753.550796720834,
1109 10767.130654870027,
1110 10780.714796211059,
1111 10794.303218044579,
1112 10807.895917675487,
1113 10821.492892412922,
1114 10835.094139570248,
1115 10848.699656465047,
1116 10862.309440419107,
1117 10875.923488758415,
1118 10889.541798813138,
1119 10903.16436791762,
1120 10916.791193410372,
1121 10930.422272634056,
1122 10944.05760293548,
1123 10957.697181665582,
1124 10971.341006179427,
1125 10984.98907383619,
1126 10998.641381999149,
1127 11012.297928035676,
1128 11025.958709317223,
1129 11039.623723219316,
1130 11053.292967121541,
1131 11066.966438407539,
1132 11080.64413446499,
1133 11094.326052685608,
1134 11108.012190465128,
1135 11121.702545203296,
1136 11135.397114303863,
1137 11149.095895174571,
1138 11162.798885227143,
1139 11176.506081877278,
1140 11190.217482544635,
1141 11203.933084652828,
1142 11217.652885629415,
1143 11231.376882905886,
1144 11245.105073917659,
1145 11258.837456104062,
1146 11272.574026908333,
1147 11286.314783777601,
1148 11300.059724162888,
1149 11313.808845519083,
1150 11327.562145304952,
1151 11341.319620983111,
1152 11355.081270020033,
1153 11368.847089886023,
1154 11382.617078055218,
1155 11396.391232005579,
1156 11410.169549218874,
1157 11423.952027180676,
1158 11437.738663380349,
1159 11451.529455311042,
1160 11465.324400469679,
1161 11479.123496356951,
1162 11492.926740477304,
1163 11506.734130338931,
1164 11520.545663453764,
1165 11534.361337337466,
1166 11548.181149509423,
1167 11562.005097492724,
1168 11575.83317881417,
1169 11589.665391004253,
1170 11603.501731597149,
1171 11617.342198130715,
1172 11631.186788146468,
1173 11645.035499189589,
1174 11658.888328808911,
1175 11672.745274556904,
1176 11686.606333989675,
1177 11700.471504666955,
1178 11714.340784152086,
1179 11728.214170012021,
1180 11742.091659817312,
1181 11755.973251142101,
1182 11769.858941564111,
1183 11783.748728664636,
1184 11797.642610028539,
1185 11811.540583244237,
1186 11825.442645903697,
1187 11839.34879560242,
1188 11853.259029939445,
1189 11867.173346517333,
1190 11881.091742942155,
1191 11895.014216823492,
1192 11908.940765774427,
1193 11922.871387411526,
1194 11936.806079354839,
1195 11950.744839227897,
1196 11964.687664657684,
1197 11978.634553274653,
1198 11992.585502712702,
1199 12006.540510609168,
1200 12020.499574604828,
1201 12034.462692343877,
1202 12048.429861473938,
1203 12062.401079646032,
1204 12076.376344514589,
1205 12090.355653737433,
1206 12104.339004975769,
1207 12118.326395894188,
1208 12132.317824160644,
1209 12146.313287446457,
1210 12160.312783426305,
1211 12174.316309778205,
1212 12188.323864183525,
1213 12202.335444326955,
1214 12216.351047896511,
1215 12230.370672583531,
1216 12244.394316082657,
1217 12258.421976091831,
1218 12272.453650312296,
1219 12286.489336448574,
1220 12300.529032208471,
1221 12314.572735303058,
1222 12328.620443446678,
1223 12342.672154356922,
1224 12356.727865754638,
1225 12370.787575363909,
1226 12384.851280912055,
1227 12398.918980129623,
1228 12412.990670750381,
1229 12427.066350511306,
1230 12441.146017152583,
1231 12455.229668417589,
1232 12469.317302052901,
1233 12483.40891580827,
1234 12497.50450743663,
1235 12511.604074694078,
1236 12525.707615339878,
1237 12539.815127136444,
1238 12553.926607849342,
1239 12568.042055247275,
1240 12582.161467102082,
1241 12596.284841188726,
1242 12610.41217528529,
1243 12624.543467172971,
1244 12638.678714636069,
1245 12652.817915461985,
1246 12666.961067441209,
1247 12681.108168367316,
1248 12695.259216036962,
1249 12709.414208249869,
1250 12723.573142808827,
1251 12737.736017519681,
1252 12751.902830191326,
1253 12766.073578635704,
1254 12780.248260667788,
1255 12794.426874105588,
1256 12808.609416770132,
1257 12822.795886485468,
1258 12836.986281078653,
1259 12851.180598379744,
1260 12865.378836221802,
1261 12879.580992440871,
1262 12893.787064875984,
1263 12907.997051369144,
1264 12922.210949765335,
1265 12936.428757912496,
1266 12950.650473661524,
1267 12964.876094866273,
1268 12979.105619383534,
1269 12993.339045073039,
1270 13007.576369797454,
1271 13021.817591422368,
1272 13036.062707816285,
1273 13050.311716850629,
1274 13064.564616399723,
1275 13078.821404340792,
1276 13093.082078553954,
1277 13107.346636922217,
1278 13121.615077331464,
1279 13135.887397670458,
1280 13150.163595830827,
1281 13164.44366970706,
1282 13178.727617196502,
1283 13193.015436199352,
1284 13207.307124618648,
1285 13221.602680360265,
1286 13235.902101332911,
1287 13250.205385448118,
1288 13264.512530620239,
1289 13278.823534766434,
1290 13293.138395806676,
1291 13307.457111663734,
1292 13321.779680263176,
1293 13336.106099533356,
1294 13350.436367405409,
1295 13364.77048181325,
1296 13379.108440693562,
1297 13393.450241985796,
1298 13407.795883632158,
1299 13422.145363577607,
1300 13436.498679769853,
1301 13450.855830159346,
1302 13465.216812699266,
1303 13479.581625345529,
1304 13493.950266056772,
1305 13508.32273279435,
1306 13522.699023522329,
1307 13537.079136207483,
1308 13551.463068819286,
1309 13565.850819329906,
1310 13580.2423857142,
1311 13594.63776594971,
1312 13609.036958016657,
1313 13623.439959897927,
1314 13637.846769579081,
1315 13652.257385048335,
1316 13666.67180429656,
1317 13681.090025317284,
1318 13695.512046106669,
1319 13709.937864663521,
1320 13724.367478989278,
1321 13738.800887088004,
1322 13753.238086966385,
1323 13767.679076633727,
1324 13782.123854101939,
1325 13796.572417385545,
1326 13811.024764501659,
1327 13825.480893469998,
1328 13839.94080231286,
1329 13854.404489055134,
1330 13868.871951724283,
1331 13883.34318835034,
1332 13897.818196965914,
1333 13912.296975606168,
1334 13926.779522308825,
1335 13941.26583511416,
1336 13955.755912064991,
1337 13970.249751206682,
1338 13984.747350587126,
1339 13999.248708256751,
1340 14013.753822268511,
1341 14028.262690677873,
1342 14042.775311542828,
1343 14057.291682923867,
1344 14071.811802883994,
1345 14086.335669488704,
1346 14100.863280805994,
1347 14115.394634906341,
1348 14129.92972986271,
1349 14144.468563750548,
1350 14159.01113464777,
1351 14173.55744063476,
1352 14188.107479794369,
1353 14202.661250211901,
1354 14217.218749975118,
1355 14231.779977174227,
1356 14246.344929901879,
1357 14260.913606253163,
1358 14275.486004325601,
1359 14290.062122219146,
1360 14304.641958036171,
1361 14319.225509881464,
1362 14333.812775862236,
1363 14348.403754088098,
1364 14362.998442671067,
1365 14377.59683972556,
1366 14392.198943368388,
1367 14406.804751718748,
1368 14421.414262898223,
1369 14436.027475030774,
1370 14450.64438624274,
1371 14465.264994662828,
1372 14479.889298422106,
1373 14494.517295654005,
1374 14509.148984494313,
1375 14523.784363081166,
1376 14538.423429555049,
1377 14553.066182058781,
1378 14567.712618737527,
1379 14582.362737738777,
1380 14597.016537212348,
1381 14611.674015310382,
1382 14626.33517018734,
1383 14640.999999999993,
1384 14655.668502907418,
1385 14670.340677071003,
1386 14685.016520654426,
1387 14699.696031823671,
1388 14714.379208746999,
1389 14729.066049594967,
1390 14743.756552540408,
1391 14758.45071575843,
1392 14773.148537426418,
1393 14787.850015724018,
1394 14802.555148833142,
1395 14817.263934937961,
1396 14831.976372224897,
1397 14846.692458882624,
1398 14861.41219310206,
1399 14876.135573076363,
1400 14890.862597000923,
1401 14905.593263073371,
1402 14920.327569493558,
1403 14935.065514463557,
1404 14949.807096187662,
1405 14964.552312872382,
1406 14979.301162726431,
1407 14994.053643960735,
1408 15008.809754788414,
1409 15023.569493424788,
1410 15038.332858087369,
1411 15053.099846995858,
1412 15067.870458372134,
1413 15082.644690440264,
1414 15097.422541426484,
1415 15112.204009559202,
1416 15126.989093068994,
1417 15141.777790188597,
1418 15156.570099152905,
1419 15171.366018198967,
1420 15186.165545565986,
1421 15200.968679495301,
1422 15215.775418230402,
1423 15230.585760016909,
1424 15245.399703102579,
1425 15260.217245737298,
1426 15275.038386173073,
1427 15289.863122664035,
1428 15304.691453466432,
1429 15319.523376838621,
1430 15334.358891041069,
1431 15349.197994336346,
1432 15364.040684989128,
1433 15378.886961266177,
1434 15393.736821436356,
1435 15408.590263770609,
1436 15423.447286541972,
1437 15438.307888025554,
1438 15453.172066498542,
1439 15468.039820240196,
1440 15482.91114753184,
1441 15497.786046656869,
1442 15512.664515900733,
1443 15527.546553550939,
1444 15542.432157897045,
1445 15557.32132723066,
1446 15572.214059845435,
1447 15587.110354037064,
1448 15602.010208103273,
1449 15616.913620343823,
1450 15631.820589060506,
1451 15646.731112557136,
1452 15661.645189139546,
1453 15676.562817115593,
1454 15691.483994795139,
1455 15706.408720490062,
1456 15721.336992514242,
1457 15736.268809183561,
1458 15751.204168815901,
1459 15766.143069731135,
1460 15781.085510251132,
1461 15796.03148869974,
1462 15810.981003402798,
1463 15825.934052688119,
1464 15840.890634885489,
1465 15855.850748326673,
1466 15870.814391345401,
1467 15885.781562277361,
1468 15900.752259460214,
1469 15915.726481233565,
1470 15930.704225938984,
1471 15945.685491919978,
1472 15960.670277522009,
1473 15975.658581092481,
1474 15990.65040098073,
1475 16005.645735538035,
1476 16020.644583117599,
1477 16035.646942074556,
1478 16050.652810765967,
1479 16065.662187550806,
1480 16080.675070789974,
1481 16095.691458846273,
1482 16110.711350084424,
1483 16125.734742871053,
1484 16140.761635574685,
1485 16155.792026565747,
1486 16170.825914216561,
1487 16185.863296901338,
1488 16200.904172996183,
1489 16215.948540879079,
1490 16230.996398929899,
1491 16246.047745530386,
1492 16261.102579064163,
1493 16276.160897916721,
1494 16291.22270047542,
1495 16306.287985129484,
1496 16321.356750269995,
1497 16336.428994289896,
1498 16351.504715583982,
1499 16366.5839125489,
1500 16381.666583583141,
1501 16396.752727087041,
1502 16411.842341462776,
1503 16426.935425114363,
1504 16442.031976447644,
1505 16457.131993870298,
1506 16472.235475791829,
1507 16487.342420623561,
1508 16502.452826778641,
1509 16517.566692672033,
1510 16532.684016720516,
1511 16547.804797342676,
1512 16562.929032958902,
1513 16578.056721991394,
1514 16593.18786286415,
1515 16608.322454002962,
1516 16623.460493835417,
1517 16638.601980790896,
1518 16653.746913300558,
1519 16668.895289797354,
1520 16684.047108716015,
1521 16699.202368493046,
1522 16714.361067566726,
1523 16729.523204377107,
1524 16744.688777366009,
1525 16759.857784977012,
1526 16775.030225655464,
1527 16790.206097848466,
1528 16805.385400004874,
1529 16820.568130575302,
1530 16835.754288012104,
1531 16850.943870769381,
1532 16866.136877302983,
1533 16881.333306070494,
1534 16896.53315553123,
1535 16911.736424146249,
1536 16926.943110378332,
1537 16942.153212691992,
1538 16957.366729553454,
1539 16972.583659430682,
1540 16987.804000793338,
1541 17003.027752112816,
1542 17018.254911862205,
1543 17033.485478516312,
1544 17048.719450551645,
1545 17063.956826446421,
1546 17079.197604680547,
1547 17094.44178373563,
1548 17109.689362094967,
1549 17124.940338243552,
1550 17140.194710668064,
1551 17155.452477856852,
1552 17170.713638299967,
1553 17185.978190489128,
1554 17201.246132917724,
1555 17216.517464080825,
1556 17231.792182475165,
1557 17247.070286599141,
1558 17262.351774952826,
1559 17277.636646037936,
1560 17292.924898357855,
1561 17308.216530417623,
1562 17323.511540723921,
1563 17338.809927785089,
1564 17354.111690111105,
1565 17369.416826213594,
1566 17384.725334605821,
1567 17400.037213802683,
1568 17415.352462320716,
1569 17430.67107867809,
1570 17445.993061394587,
1571 17461.318408991636,
1572 17476.647119992274,
1573 17491.979192921168,
1574 17507.314626304586,
1575 17522.653418670423,
1576 17537.995568548187,
1577 17553.341074468986,
1578 17568.689934965536,
1579 17584.042148572156,
1580 17599.397713824768,
1581 17614.75662926089,
1582 17630.118893419625,
1583 17645.484504841683,
1584 17660.853462069354,
1585 17676.225763646511,
1586 17691.601408118619,
1587 17706.980394032718,
1588 17722.362719937424,
1589 17737.748384382936,
1590 17753.137385921014,
1591 17768.529723104999,
1592 17783.92539448979,
1593 17799.324398631856,
1594 17814.726734089225,
1595 17830.13239942148,
1596 17845.541393189767,
1597 17860.95371395678,
1598 17876.369360286772,
1599 17891.788330745527,
1600 17907.210623900395,
1601 17922.636238320254,
1602 17938.065172575527,
1603 17953.497425238176,
1604 17968.932994881692,
1605 17984.371880081104,
1606 17999.814079412972,
1607 18015.259591455371,
1608 18030.708414787914,
1609 18046.160547991731,
1610 18061.615989649465,
1611 18077.074738345284,
1612 18092.536792664861,
1613 18108.002151195393,
1614 18123.470812525571,
1615 18138.942775245599,
1616 18154.418037947191,
1617 18169.896599223546,
1618 18185.37845766938,
1619 18200.863611880886,
1620 18216.352060455767,
1621 18231.843801993204,
1622 18247.338835093873,
1623 18262.837158359936,
1624 18278.338770395032,
1625 18293.84366980429,
1626 18309.351855194309,
1627 18324.863325173166,
1628 18340.378078350412,
1629 18355.896113337069,
1630 18371.417428745623,
1631 18386.942023190033,
1632 18402.469895285718,
1633 18418.00104364955,
1634 18433.53546689987,
1635 18449.073163656474,
1636 18464.614132540602,
1637 18480.158372174956,
1638 18495.705881183676,
1639 18511.256658192357,
1640 18526.810701828035,
1641 18542.368010719183,
1642 18557.928583495715,
1643 18573.492418788985,
1644 18589.059515231773,
1645 18604.629871458303,
1646 18620.203486104212,
1647 18635.78035780658,
1648 18651.360485203899,
1649 18666.943866936086,
1650 18682.53050164448,
1651 18698.120387971841,
1652 18713.713524562332,
1653 18729.30991006154,
1654 18744.909543116457,
1655 18760.512422375479,
1656 18776.118546488418,
1657 18791.727914106479,
1658 18807.340523882274,
1659 18822.95637446981,
1660 18838.575464524489,
1661 18854.197792703111,
1662 18869.823357663863,
1663 18885.452158066328,
1664 18901.08419257147,
1665 18916.719459841639,
1666 18932.357958540564,
1667 18947.999687333362,
1668 18963.644644886521,
1669 18979.292829867907,
1670 18994.944240946759,
1671 19010.598876793687,
1672 19026.256736080668,
1673 19041.917817481048,
1674 19057.582119669532,
1675 19073.2496413222,
1676 19088.920381116473,
1677 19104.594337731145,
1678 19120.271509846356,
1679 19135.951896143604,
1680 19151.635495305738,
1681 19167.322306016948,
1682 19183.012326962784,
1683 19198.705556830122,
1684 19214.401994307198,
1685 19230.101638083579,
1686 19245.804486850167,
1687 19261.510539299208,
1688 19277.219794124274,
1689 19292.932250020265,
1690 19308.647905683421,
1691 19324.366759811302,
1692 19340.088811102793,
1693 19355.8140582581,
1694 19371.542499978754,
1695 19387.2741349676,
1696 19403.008961928797,
1697 19418.746979567823,
1698 19434.488186591469,
1699 19450.232581707827,
1700 19465.980163626304,
1701 19481.730931057613,
1702 19497.484882713761,
1703 19513.242017308068,
1704 19529.002333555141,
1705 19544.765830170898,
1706 19560.532505872539,
1707 19576.302359378566,
1708 19592.075389408761,
1709 19607.851594684209,
1710 19623.630973927269,
1711 19639.41352586159,
1712 19655.199249212103,
1713 19670.988142705017,
1714 19686.780205067826,
1715 19702.575435029288,
1716 19718.373831319448,
1717 19734.175392669615,
1718 19749.980117812371,
1719 19765.788005481569,
1720 19781.599054412323,
1721 19797.413263341008,
1722 19813.230631005274,
1723 19829.051156144014,
1724 19844.874837497395,
1725 19860.701673806827,
1726 19876.531663814985,
1727 19892.364806265789,
1728 19908.201099904403,
1729 19924.040543477258,
1730 19939.883135732012,
1731 19955.728875417579,
1732 19971.577761284105,
1733 19987.429792082985,
1734 20003.284966566847,
1735 20019.14328348956,
1736 20035.004741606219,
1737 20050.869339673161,
1738 20066.737076447946,
1739 20082.607950689362,
1740 20098.481961157428,
1741 20114.359106613385,
1742 20130.239385819699,
1743 20146.122797540058,
1744 20162.009340539353,
1745 20177.899013583716,
1746 20193.791815440476,
1747 20209.687744878182,
1748 20225.586800666591,
1749 20241.488981576669,
1750 20257.394286380597,
1751 20273.302713851754,
1752 20289.214262764715,
1753 20305.128931895277,
1754 20321.046720020415,
1755 20336.967625918318,
1756 20352.891648368361,
1757 20368.818786151114,
1758 20384.749038048347,
1759 20400.682402843009,
1760 20416.618879319249,
1761 20432.558466262391,
1762 20448.501162458953,
1763 20464.446966696629,
1764 20480.395877764302,
1765 20496.347894452025,
1766 20512.303015551031,
1767 20528.261239853735,
1768 20544.22256615372,
1769 20560.186993245738,
1770 20576.15451992572,
1771 20592.125144990758,
1772 20608.098867239107,
1773 20624.075685470198,
1774 20640.055598484618,
1775 20656.038605084115,
1776 20672.024704071595,
1777 20688.013894251126,
1778 20704.006174427926,
1779 20720.001543408373,
1780 20735.999999999989,
1781 20752.001543011454,
1782 20768.006171252597,
1783 20784.013883534382,
1784 20800.024678668931,
1785 20816.038555469506,
1786 20832.055512750507,
1787 20848.075549327474,
1788 20864.098664017085,
1789 20880.124855637161,
1790 20896.154123006647,
1791 20912.186464945626,
1792 20928.221880275312,
1793 20944.260367818049,
1794 20960.301926397311,
1795 20976.346554837684,
1796 20992.394251964895,
1797 21008.445016605787,
1798 21024.498847588318,
1799 21040.555743741574,
1800 21056.615703895754,
1801 21072.678726882168,
1802 21088.744811533252,
1803 21104.813956682538,
1804 21120.886161164683,
1805 21136.961423815443,
1806 21153.039743471683,
1807 21169.121118971379,
1808 21185.205549153605,
1809 21201.293032858535,
1810 21217.383568927453,
1811 21233.477156202731,
1812 21249.573793527841,
1813 21265.673479747358,
1814 21281.776213706937,
1815 21297.881994253334,
1816 21313.990820234398,
1817 21330.102690499054,
1818 21346.21760389733,
1819 21362.335559280327,
1820 21378.456555500241,
1821 21394.580591410333,
1822 21410.707665864964,
1823 21426.83777771956,
1824 21442.970925830628,
1825 21459.107109055756,
1826 21475.246326253604,
1827 21491.388576283895,
1828 21507.533858007431,
1829 21523.682170286087,
1830 21539.833511982797,
1831 21555.987881961566,
1832 21572.145279087465,
1833 21588.305702226615,
1834 21604.469150246216,
1835 21620.635622014521,
1836 21636.805116400832,
1837 21652.977632275521,
1838 21669.153168510009,
1839 21685.331723976764,
1840 21701.513297549318,
1841 21717.697888102244,
1842 21733.885494511167,
1843 21750.076115652759,
1844 21766.269750404736,
1845 21782.466397645861,
1846 21798.666056255934,
1847 21814.868725115801,
1848 21831.074403107345,
1849 21847.283089113484,
1850 21863.494782018177,
1851 21879.709480706417,
1852 21895.927184064229,
1853 21912.147890978667,
1854 21928.371600337818,
1855 21944.598311030797,
1856 21960.828021947746,
1857 21977.060731979829,
1858 21993.296440019243,
1859 22009.535144959198,
1860 22025.77684569393,
1861 22042.021541118691,
1862 22058.269230129757,
1863 22074.519911624411,
1864 22090.773584500959,
1865 22107.030247658717,
1866 22123.289899998013,
1867 22139.552540420187,
1868 22155.818167827587,
1869 22172.086781123569,
1870 22188.358379212495,
1871 22204.632960999726,
1872 22220.910525391639,
1873 22237.191071295601,
1874 22253.474597619981,
1875 22269.761103274148,
1876 22286.050587168469,
1877 22302.343048214312,
1878 22318.638485324027,
1879 22334.936897410968,
1880 22351.23828338947,
1881 22367.542642174871,
1882 22383.849972683485,
1883 22400.160273832618,
1884 22416.473544540564,
1885 22432.789783726603,
1886 22449.108990310986,
1887 22465.431163214958,
1888 22481.75630136074,
1889 22498.084403671528,
1890 22514.415469071497,
1891 22530.749496485802,
1892 22547.086484840562,
1893 22563.426433062879,
1894 22579.769340080824,
1895 22596.115204823436,
1896 22612.464026220721,
1897 22628.815803203655,
1898 22645.170534704179,
1899 22661.5282196552,
1900 22677.888856990587,
1901 22694.252445645168,
1902 22710.618984554734,
1903 22726.988472656034,
1904 22743.360908886778,
1905 22759.736292185622,
1906 22776.114621492186,
1907 22792.495895747044,
1908 22808.880113891719,
1909 22825.267274868678,
1910 22841.657377621348,
1911 22858.050421094096,
1912 22874.446404232243,
1913 22890.845325982053,
1914 22907.247185290722,
1915 22923.651981106406,
1916 22940.059712378195,
1917 22956.470378056114,
1918 22972.883977091129,
1919 22989.300508435153,
1920 23005.719971041017,
1921 23022.142363862498,
1922 23038.567685854305,
1923 23054.995935972078,
1924 23071.427113172387,
1925 23087.86121641273,
1926 23104.298244651531,
1927 23120.738196848146,
1928 23137.181071962848,
1929 23153.626868956846,
1930 23170.075586792263,
1931 23186.527224432142,
1932 23202.981780840448,
1933 23219.439254982066,
1934 23235.899645822796,
1935 23252.362952329357,
1936 23268.829173469378,
1937 23285.298308211408,
1938 23301.770355524899,
1939 23318.245314380223,
1940 23334.723183748658,
1941 23351.203962602387,
1942 23367.687649914504,
1943 23384.174244659007,
1944 23400.663745810798,
1945 23417.15615234568,
1946 23433.651463240367,
1947 23450.149677472462,
1948 23466.650794020472,
1949 23483.154811863806,
1950 23499.661729982763,
1951 23516.171547358543,
1952 23532.684262973235,
1953 23549.199875809823,
1954 23565.718384852185,
1955 23582.239789085092,
1956 23598.764087494197,
1957 23615.291279066041,
1958 23631.821362788058,
1959 23648.354337648565,
1960 23664.890202636761,
1961 23681.428956742733,
1962 23697.970598957443,
1963 23714.515128272738,
1964 23731.062543681343,
1965 23747.612844176863,
1966 23764.166028753778,
1967 23780.72209640744,
1968 23797.281046134085,
1969 23813.842876930816,
1970 23830.407587795606,
1971 23846.975177727301,
1972 23863.545645725622,
1973 23880.11899079115,
1974 23896.695211925336,
1975 23913.274308130498,
1976 23929.856278409821,
1977 23946.441121767348,
1978 23963.028837207989,
1979 23979.619423737513,
1980 23996.212880362549,
1981 24012.809206090584,
1982 24029.408399929966,
1983 24046.010460889898,
1984 24062.615387980433,
1985 24079.223180212492,
1986 24095.833836597827,
1987 24112.447356149063,
1988 24129.063737879667,
1989 24145.682980803951,
1990 24162.305083937081,
1991 24178.930046295067,
1992 24195.557866894767,
1993 24212.188544753884,
1994 24228.822078890964,
1995 24245.458468325389,
1996 24262.097712077397,
1997 24278.739809168052,
1998 24295.384758619261,
1999 24312.032559453768,
2000 24328.683210695162,
2001 24345.336711367858,
2002 24361.993060497109,
2003 24378.652257108995,
2004 24395.314300230442,
2005 24411.979188889192,
2006 24428.646922113825,
2007 24445.317498933746,
2008 24461.990918379193,
2009 24478.667179481225,
2010 24495.346281271726,
2011 24512.028222783407,
2012 24528.713003049801,
2013 24545.400621105266,
2014 24562.091075984976,
2015 24578.784366724925,
2016 24595.480492361927,
2017 24612.179451933614,
2018 24628.881244478438,
2019 24645.585869035654,
2020 24662.293324645343,
2021 24679.003610348394,
2022 24695.716725186514,
2023 24712.432668202211,
2024 24729.151438438807,
2025 24745.873034940436,
2026 24762.597456752032,
2027 24779.324702919344,
2028 24796.054772488926,
2029 24812.787664508123,
2030 24829.5233780251,
2031 24846.261912088819,
2032 24863.003265749034,
2033 24879.747438056307,
2034 24896.494428062004,
2035 24913.244234818278,
2036 24929.996857378079,
2037 24946.752294795166,
2038 24963.510546124078,
2039 24980.271610420157,
2040 24997.035486739525,
2041 25013.802174139113,
2042 25030.571671676629,
2043 25047.343978410572,
2044 25064.119093400237,
2045 25080.897015705697,
2046 25097.677744387816,
2047 25114.461278508239,
2048 25131.2476171294,
2049 25148.036759314517,
2050 25164.828704127583,
2051 25181.623450633375,
2052 25198.42099789745,
2053 25215.221344986145,
2054 25232.024490966574,
2055 25248.830434906627,
2056 25265.639175874974,
2057 25282.450712941049,
2058 25299.265045175071,
2059 25316.082171648024,
2060 25332.902091431668,
2061 25349.724803598532,
2062 25366.550307221914,
2063 25383.378601375884,
2064 25400.209685135269,
2065 25417.043557575678,
2066 25433.880217773472,
2067 25450.719664805783,
2068 25467.561897750507,
2069 25484.406915686297,
2070 25501.254717692573,
2071 25518.105302849512,
2072 25534.958670238051,
2073 25551.814818939893,
2074 25568.67374803748,
2075 25585.535456614027,
2076 25602.399943753502,
2077 25619.267208540619,
2078 25636.137250060852,
2079 25653.010067400432,
2080 25669.885659646327,
2081 25686.76402588627,
2082 25703.645165208734,
2083 25720.529076702944,
2084 25737.415759458876,
2085 25754.305212567244,
2086 25771.197435119517,
2087 25788.092426207899,
2088 25804.990184925344,
2089 25821.890710365547,
2090 25838.794001622944,
2091 25855.700057792714,
2092 25872.608877970775,
2093 25889.520461253778,
2094 25906.434806739118,
2095 25923.351913524923,
2096 25940.271780710063,
2097 25957.194407394138,
2098 25974.11979267748,
2099 25991.047935661154,
2100 26007.978835446964,
2101 26024.912491137442,
2102 26041.848901835841,
2103 26058.788066646157,
2104 26075.729984673108,
2105 26092.674655022136,
2106 26109.622076799409,
2107 26126.572249111829,
2108 26143.525171067016,
2109 26160.480841773315,
2110 26177.43926033979,
2111 26194.400425876229,
2112 26211.364337493149,
2113 26228.330994301767,
2114 26245.30039541404,
2115 26262.272539942627,
2116 26279.247427000919,
2117 26296.225055703002,
2118 26313.205425163702,
2119 26330.188534498539,
2120 26347.174382823756,
2121 26364.162969256304,
2122 26381.154292913852,
2123 26398.148352914774,
2124 26415.145148378149,
2125 26432.144678423778,
2126 26449.146942172156,
2127 26466.151938744493,
2128 26483.159667262702,
2129 26500.170126849403,
2130 26517.183316627921,
2131 26534.199235722277,
2132 26551.217883257199,
2133 26568.239258358124,
2134 26585.263360151173,
2135 26602.290187763181,
2136 26619.319740321676,
2137 26636.352016954883,
2138 26653.387016791727,
2139 26670.424738961825,
2140 26687.465182595493,
2141 26704.508346823739,
2142 26721.554230778267,
2143 26738.602833591467,
2144 26755.65415439643,
2145 26772.708192326929,
2146 26789.764946517433,
2147 26806.824416103096,
2148 26823.886600219761,
2149 26840.95149800396,
2150 26858.019108592915,
2151 26875.089431124517,
2152 26892.162464737365,
2153 26909.238208570721,
2154 26926.316661764544,
2155 26943.397823459472,
2156 26960.481692796813,
2157 26977.568268918571,
2158 26994.657550967422,
2159 27011.749538086722,
2160 27028.844229420498,
2161 27045.941624113464,
2162 27063.041721311005,
2163 27080.144520159181,
2164 27097.250019804727,
2165 27114.35821939505,
2166 27131.469118078236,
2167 27148.582715003027,
2168 27165.699009318858,
2169 27182.818000175819,
2170 27199.939686724665,
2171 27217.064068116837,
2172 27234.191143504428,
2173 27251.320912040203,
2174 27268.453372877593,
2175 27285.588525170693,
2176 27302.726368074269,
2177 27319.866900743735,
2178 27337.010122335181,
2179 27354.156032005358,
2180 27371.304628911668,
2181 27388.455912212183,
2182 27405.609881065626,
2183 27422.766534631384,
2184 27439.925872069507,
2185 27457.087892540683,
2186 27474.252595206275,
2187 27491.419979228293,
2188 27508.5900437694,
2189 27525.762787992917,
2190 27542.93821106281,
2191 27560.116312143706,
2192 27577.297090400876,
2193 27594.480545000242,
2194 27611.666675108383,
2195 27628.855479892518,
2196 27646.046958520514,
2197 27663.241110160889,
2198 27680.437933982801,
2199 27697.637429156068,
2200 27714.839594851132,
2201 27732.04443023909,
2202 27749.251934491687,
2203 27766.462106781299,
2204 27783.674946280949,
2205 27800.890452164302,
2206 27818.108623605654,
2207 27835.329459779954,
2208 27852.55295986278,
2209 27869.779123030345,
2210 27887.007948459504,
2211 27904.239435327745,
2212 27921.473582813196,
2213 27938.710390094613,
2214 27955.949856351392,
2215 27973.19198076355,
2216 27990.436762511745,
2217 28007.684200777272,
2218 28024.934294742041,
2219 28042.187043588601,
2220 28059.442446500128,
2221 28076.700502660427,
2222 28093.961211253929,
2223 28111.224571465693,
2224 28128.490582481401,
2225 28145.759243487362,
2226 28163.030553670509,
2227 28180.304512218394,
2228 28197.581118319198,
2229 28214.860371161725,
2230 28232.14226993539,
2231 28249.42681383024,
2232 28266.71400203693,
2233 28284.003833746745,
2234 28301.296308151585,
2235 28318.591424443959,
2236 28335.889181817001,
2237 28353.189579464462,
2238 28370.492616580705,
2239 28387.798292360701,
2240 28405.106606000048,
2241 28422.417556694945,
2242 28439.731143642206,
2243 28457.047366039264,
2244 28474.366223084147,
2245 28491.687713975512,
2246 28509.011837912611,
2247 28526.338594095305,
2248 28543.667981724069,
2249 28560.999999999982,
2250 28578.334648124732,
2251 28595.671925300605,
2252 28613.011830730498,
2253 28630.354363617909,
2254 28647.699523166943,
2255 28665.0473085823,
2256 28682.397719069289,
2257 28699.750753833818,
2258 28717.10641208239,
2259 28734.464693022121,
2260 28751.825595860708,
2261 28769.189119806462,
2262 28786.55526406828,
2263 28803.924027855664,
2264 28821.295410378701,
2265 28838.669410848088,
2266 28856.046028475103,
2267 28873.425262471628,
2268 28890.80711205013,
2269 28908.191576423673,
2270 28925.578654805915,
2271 28942.968346411097,
2272 28960.360650454055,
2273 28977.755566150216,
2274 28995.153092715591,
2275 29012.553229366786,
2276 29029.955975320987,
2277 29047.361329795975,
2278 29064.769292010107,
2279 29082.179861182336,
2280 29099.593036532187,
2281 29117.00881727978,
2282 29134.427202645813,
2283 29151.848191851568,
2284 29169.271784118911,
2285 29186.697978670283,
2286 29204.126774728706,
2287 29221.55817151779,
2288 29238.992168261717,
2289 29256.42876418525,
2290 29273.867958513725,
2291 29291.309750473058,
2292 29308.754139289747,
2293 29326.201124190855,
2294 29343.65070440403,
2295 29361.102879157483,
2296 29378.557647680012,
2297 29396.015009200975,
2298 29413.474962950309,
2299 29430.937508158524,
2300 29448.402644056692,
2301 29465.870369876469,
2302 29483.340684850071,
2303 29500.81358821028,
2304 29518.289079190454,
2305 29535.767157024511,
2306 29553.247820946945,
2307 29570.731070192807,
2308 29588.216903997723,
2309 29605.70532159787,
2310 29623.19632223,
2311 29640.689905131429,
2312 29658.186069540028,
2313 29675.684814694236,
2314 29693.186139833047,
2315 29710.690044196028,
2316 29728.196527023298,
2317 29745.705587555527,
2318 29763.217225033964,
2319 29780.731438700397,
2320 29798.248227797183,
2321 29815.76759156723,
2322 29833.289529254005,
2323 29850.81404010153,
2324 29868.341123354381,
2325 29885.870778257693,
2326 29903.403004057145,
2327 29920.937799998974,
2328 29938.475165329975,
2329 29956.015099297485,
2330 29973.557601149394,
2331 29991.102670134147,
2332 30008.650305500738,
2333 30026.200506498706,
2334 30043.753272378144,
2335 30061.308602389683,
2336 30078.866495784507,
2337 30096.426951814352,
2338 30113.989969731494,
2339 30131.55554878875,
2340 30149.123688239491,
2341 30166.694387337629,
2342 30184.267645337608,
2343 30201.843461494434,
2344 30219.42183506364,
2345 30237.002765301309,
2346 30254.586251464058,
2347 30272.172292809046,
2348 30289.760888593977,
2349 30307.35203807709,
2350 30324.94574051716,
2351 30342.541995173502,
2352 30360.140801305966,
2353 30377.742158174944,
2354 30395.346065041358,
2355 30412.952521166666,
2356 30430.561525812864,
2357 30448.173078242475,
2358 30465.787177718561,
2359 30483.403823504719,
2360 30501.02301486507,
2361 30518.644751064272,
2362 30536.269031367516,
2363 30553.895855040515,
2364 30571.525221349519,
2365 30589.157129561307,
2366 30606.791578943175,
2367 30624.428568762964,
2368 30642.06809828903,
2369 30659.710166790261,
2370 30677.35477353607,
2371 30695.001917796391,
2372 30712.651598841687,
2373 30730.303815942945,
2374 30747.958568371676,
2375 30765.615855399912,
2376 30783.275676300211,
2377 30800.938030345646,
2378 30818.602916809814,
2379 30836.270334966837,
2380 30853.940284091354,
2381 30871.612763458521,
2382 30889.287772344011,
2383 30906.965310024025,
2384 30924.645375775272,
2385 30942.327968874983,
2386 30960.013088600903,
2387 30977.700734231294,
2388 30995.390905044929,
2389 31013.083600321101,
2390 31030.778819339619,
2391 31048.476561380798,
2392 31066.17682572547,
2393 31083.879611654978,
2394 31101.584918451179,
2395 31119.29274539644,
2396 31137.003091773637,
2397 31154.715956866155,
2398 31172.431339957893,
2399 31190.14924033326,
2400 31207.869657277162,
2401 31225.592590075023,
2402 31243.318038012771,
2403 31261.046000376838,
2404 31278.776476454172,
2405 31296.50946553221,
2406 31314.24496689891,
2407 31331.98297984272,
2408 31349.7235036526,
2409 31367.466537618013,
2410 31385.212081028923,
2411 31402.960133175795,
2412 31420.710693349596,
2413 31438.463760841791,
2414 31456.219334944351,
2415 31473.977414949743,
2416 31491.738000150934,
2417 31509.501089841389,
2418 31527.266683315069,
2419 31545.034779866437,
2420 31562.80537879045,
2421 31580.578479382562,
2422 31598.35408093872,
2423 31616.132182755369,
2424 31633.91278412945,
2425 31651.695884358396,
2426 31669.481482740131,
2427 31687.269578573076,
2428 31705.060171156143,
2429 31722.853259788735,
2430 31740.648843770748,
2431 31758.446922402567,
2432 31776.247494985066,
2433 31794.050560819614,
2434 31811.85611920806,
2435 31829.664169452753,
2436 31847.474710856521,
2437 31865.287742722685,
2438 31883.103264355046,
2439 31900.921275057899,
2440 31918.741774136019,
2441 31936.564760894671,
2442 31954.390234639599,
2443 31972.21819467704,
2444 31990.048640313704,
2445 32007.881570856793,
2446 32025.716985613984,
2447 32043.554883893445,
2448 32061.395265003815,
2449 32079.238128254223,
2450 32097.083472954269,
2451 32114.931298414049,
2452 32132.781603944117,
2453 32150.634388855524,
2454 32168.48965245979,
2455 32186.347394068915,
2456 32204.207612995371,
2457 32222.07030855212,
2458 32239.935480052583,
2459 32257.803126810672,
2460 32275.673248140767,
2461 32293.545843357719,
2462 32311.420911776862,
2463 32329.298452713996,
2464 32347.178465485395,
2465 32365.060949407813,
2466 32382.945903798463,
2467 32400.83332797504,
2468 32418.723221255706,
2469 32436.615582959093,
2470 32454.510412404306,
2471 32472.407708910916,
2472 32490.307471798966,
2473 32508.209700388961,
2474 32526.114394001877,
2475 32544.021551959166,
2476 32561.931173582732,
2477 32579.843258194956,
2478 32597.757805118679,
2479 32615.674813677211,
2480 32633.594283194328,
2481 32651.516212994258,
2482 32669.440602401712,
2483 32687.367450741847,
2484 32705.296757340297,
2485 32723.228521523146,
2486 32741.162742616943,
2487 32759.099419948703,
2488 32777.038552845901,
2489 32794.980140636464,
2490 32812.924182648792,
2491 32830.87067821173,
2492 32848.819626654593,
2493 32866.77102730715,
2494 32884.724879499619,
2495 32902.681182562686,
2496 32920.639935827494,
2497 32938.601138625643,
2498 32956.56479028918,
2499 32974.530890150607,
2500 32992.499437542894,
2501 33010.470431799447,
2502 33028.443872254145,
2503 33046.419758241311,
2504 33064.39808909571,
2505 33082.378864152583,
2506 33100.36208274759,
2507 33118.347744216881,
2508 33136.335847897026,
2509 33154.326393125062,
2510 33172.31937923847,
2511 33190.314805575174,
2512 33208.312671473555,
2513 33226.312976272442,
2514 33244.315719311111,
2515 33262.320899929284,
2516 33280.328517467125,
2517 33298.33857126526,
2518 33316.351060664747,
2519 33334.365985007091,
2520 33352.383343634239,
2521 33370.403135888591,
2522 33388.42536111299,
2523 33406.450018650721,
2524 33424.477107845501,
2525 33442.506628041512,
2526 33460.53857858335,
2527 33478.572958816083,
2528 33496.609768085189,
2529 33514.649005736617,
2530 33532.690671116739,
2531 33550.734763572356,
2532 33568.781282450735,
2533 33586.830227099563,
2534 33604.881596866973,
2535 33622.935391101528,
2536 33640.991609152239,
2537 33659.050250368542,
2538 33677.111314100322,
2539 33695.174799697881,
2540 33713.240706511984,
2541 33731.309033893805,
2542 33749.37978119497,
2543 33767.452947767531,
2544 33785.528532963974,
2545 33803.606536137209,
2546 33821.686956640602,
2547 33839.769793827938,
2548 33857.855047053425,
2549 33875.942715671707,
2550 33894.032799037872,
2551 33912.125296507431,
2552 33930.220207436316,
2553 33948.317531180888,
2554 33966.417267097961,
2555 33984.519414544746,
2556 34002.623972878901,
2557 34020.730941458511,
2558 34038.840319642077,
2559 34056.952106788536,
2560 34075.066302257255,
2561 34093.182905408015,
2562 34111.301915601027,
2563 34129.42333219693,
2564 34147.547154556785,
2565 34165.673382042078,
2566 34183.80201401472,
2567 34201.933049837033,
2568 34220.06648887178,
2569 34238.202330482141,
2570 34256.340574031703,
2571 34274.481218884495,
2572 34292.624264404949,
2573 34310.769709957938,
2574 34328.91755490873,
2575 34347.067798623029,
2576 34365.220440466954,
2577 34383.375479807051,
2578 34401.532916010263,
2579 34419.692748443973,
2580 34437.854976475966,
2581 34456.01959947445,
2582 34474.18661680806,
2583 34492.356027845817,
2584 34510.527831957188,
2585 34528.702028512052,
2586 34546.878616880676,
2587 34565.05759643377,
2588 34583.238966542449,
2589 34601.422726578232,
2590 34619.608875913065,
2591 34637.797413919296,
2592 34655.988339969692,
2593 34674.181653437423,
2594 34692.37735369608,
2595 34710.575440119668,
2596 34728.775912082579,
2597 34746.978768959649,
2598 34765.184010126082,
2599 34783.391634957537,
2600 34801.60164283005,
2601 34819.814033120063,
2602 34838.028805204456,
2603 34856.24595846048,
2604 34874.465492265823,
2605 34892.687405998557,
2606 34910.911699037177,
2607 34929.138370760564,
2608 34947.367420548027,
2609 34965.598847779271,
2610 34983.832651834389,
2611 35002.068832093908,
2612 35020.307387938738,
2613 35038.548318750189,
2614 35056.79162390998,
2615 35075.03730280025,
2616 35093.285354803513,
2617 35111.535779302685,
2618 35129.788575681116,
2619 35148.043743322516,
2620 35166.301281611013,
2621 35184.561189931141,
2622 35202.823467667826,
2623 35221.088114206388,
2624 35239.355128932555,
2625 35257.624511232447,
2626 35275.896260492584,
2627 35294.170376099886,
2628 35312.446857441668,
2629 35330.725703905628,
2630 35349.006914879887,
2631 35367.290489752944,
2632 35385.576427913686,
2633 35403.864728751418,
2634 35422.155391655811,
2635 35440.448416016967,
2636 35458.743801225341,
2637 35477.041546671804,
2638 35495.341651747622,
2639 35513.644115844436,
2640 35531.948938354304,
2641 35550.256118669655,
2642 35568.565656183309,
2643 35586.877550288496,
2644 35605.191800378816,
2645 35623.508405848268,
2646 35641.827366091238,
2647 35660.148680502505,
2648 35678.472348477233,
2649 35696.798369410979,
2650 35715.126742699678,
2651 35733.457467739659,
2652 35751.790543927644,
2653 35770.125970660738,
2654 35788.46374733642,
2655 35806.803873352568,
2656 35825.146348107453,
2657 35843.49117099971,
2658 35861.838341428367,
2659 35880.187858792851,
2660 35898.539722492955,
2661 35916.893931928862,
2662 35935.250486501129,
2663 35953.609385610718,
2664 35971.970628658957,
2665 35990.334215047558,
2666 36008.700144178612,
2667 36027.068415454596,
2668 36045.439028278372,
2669 36063.811982053165,
2670 36082.187276182609,
2671 36100.564910070694,
2672 36118.944883121789,
2673 36137.327194740654,
2674 36155.711844332429,
2675 36174.098831302617,
2676 36192.488155057115,
2677 36210.87981500219,
2678 36229.273810544473,
2679 36247.670141091003,
2680 36266.068806049167,
2681 36284.469804826738,
2682 36302.873136831862,
2683 36321.278801473069,
2684 36339.686798159251,
2685 36358.097126299683,
2686 36376.509785304013,
2687 36394.924774582258,
2688 36413.342093544816,
2689 36431.761741602444,
2690 36450.183718166292,
2691 36468.608022647859,
2692 36487.034654459028,
2693 36505.463613012063,
2694 36523.894897719583,
2695 36542.328507994578,
2696 36560.764443250409,
2697 36579.202702900831,
2698 36597.643286359926,
2699 36616.086193042182,
2700 36634.531422362437,
2701 36652.978973735895,
2702 36671.428846578143,
2703 36689.881040305125,
2704 36708.335554333149,
2705 36726.792388078902,
2706 36745.251540959427,
2707 36763.713012392138,
2708 36782.176801794812,
2709 36800.642908585593,
2710 36819.111332182983,
2711 36837.582072005869,
2712 36856.055127473483,
2713 36874.530498005421,
2714 36893.008183021651,
2715 36911.488181942506,
2716 36929.970494188674,
2717 36948.455119181206,
2718 36966.942056341519,
2719 36985.431305091392,
2720 37003.922864852961,
2721 37022.416735048733,
2722 37040.912915101559,
2723 37059.411404434657,
2724 37077.91220247162,
2725 37096.415308636388,
2726 37114.920722353243,
2727 37133.428443046862,
2728 37151.938470142253,
2729 37170.450803064785,
2730 37188.965441240209,
2731 37207.482384094597,
2732 37226.001631054402,
2733 37244.523181546429,
2734 37263.047034997842,
2735 37281.573190836149,
2736 37300.101648489224,
2737 37318.632407385296,
2738 37337.165466952945,
2739 37355.700826621112,
2740 37374.238485819085,
2741 37392.778443976509,
2742 37411.320700523385,
2743 37429.865254890057,
2744 37448.412106507232,
2745 37466.961254805974,
2746 37485.512699217681,
2747 37504.066439174116,
2748 37522.622474107404,
2749 37541.180803449992,
2750 37559.741426634704,
2751 37578.304343094693,
2752 37596.869552263488,
2753 37615.43705357494,
2754 37634.006846463279,
2755 37652.578930363044,
2756 37671.153304709165,
2757 37689.729968936896,
2758 37708.308922481847,
2759 37726.890164779965,
2760 37745.473695267559,
2761 37764.059513381275,
2762 37782.647618558112,
2763 37801.238010235415,
2764 37819.830687850859,
2765 37838.425650842495,
2766 37857.022898648691,
2767 37875.622430708172,
2768 37894.224246460013,
2769 37912.828345343616,
2770 37931.434726798747,
2771 37950.043390265506,
2772 37968.654335184328,
2773 37987.267560995999,
2774 38005.883067141665,
2775 38024.500853062775,
2776 38043.120918201159,
2777 38061.743261998963,
2778 38080.367883898682,
2779 38098.994783343158,
2780 38117.623959775563,
2781 38136.255412639417,
2782 38154.889141378575,
2783 38173.525145437234,
2784 38192.163424259939,
2785 38210.803977291551,
2786 38229.446803977284,
2787 38248.091903762703,
2788 38266.739276093685,
2789 38285.388920416466,
2790 38304.040836177606,
2791 38322.695022824002,
2792 38341.351479802899,
2793 38360.010206561863,
2794 38378.671202548816,
2795 38397.334467211993,
2796 38415.999999999978,
2797 38434.667800361683,
2798 38453.33786774637,
2799 38472.010201603611,
2800 38490.684801383337,
2801 38509.361666535784,
2802 38528.040796511552,
2803 38546.722190761553,
2804 38565.405848737035,
2805 38584.091769889594,
2806 38602.779953671132,
2807 38621.470399533908,
2808 38640.163106930493,
2809 38658.858075313794,
2810 38677.555304137059,
2811 38696.254792853862,
2812 38714.956540918094,
2813 38733.660547783991,
2814 38752.366812906112,
2815 38771.075335739348,
2816 38789.78611573892,
2817 38808.499152360368,
2818 38827.214445059573,
2819 38845.931993292739,
2820 38864.651796516388,
2821 38883.373854187383,
2822 38902.098165762916,
2823 38920.824730700486,
2824 38939.553548457938,
2825 38958.284618493431,
2826 38977.017940265461,
2827 38995.753513232834,
2828 39014.491336854699,
2829 39033.231410590517,
2830 39051.973733900079,
2831 39070.718306243485,
2832 39089.465127081188,
2833 39108.214195873945,
2834 39126.965512082832,
2835 39145.719075169261,
2836 39164.474884594965,
2837 39183.232939821988,
2838 39201.99324031271,
2839 39220.755785529815,
2840 39239.52057493633,
2841 39258.287607995589,
2842 39277.056884171245,
2843 39295.828402927284,
2844 39314.602163728006,
2845 39333.378166038019,
2846 39352.15640932227,
2847 39370.936893046004,
2848 39389.719616674811,
2849 39408.504579674584,
2850 39427.291781511522,
2851 39446.081221652174,
2852 39464.872899563372,
2853 39483.666814712291,
2854 39502.462966566411,
2855 39521.261354593538,
2856 39540.06197826178,
2857 39558.864837039568,
2858 39577.669930395656,
2859 39596.47725779911,
2860 39615.286818719302,
2861 39634.098612625923,
2862 39652.912638988993,
2863 39671.728897278823,
2864 39690.547386966064,
2865 39709.368107521652,
2866 39728.191058416858,
2867 39747.016239123259,
2868 39765.84364911275,
2869 39784.673287857528,
2870 39803.505154830105,
2871 39822.339249503319,
2872 39841.175571350293,
2873 39860.014119844491,
2874 39878.854894459677,
2875 39897.697894669909,
2876 39916.54311994958,
2877 39935.390569773372,
2878 39954.240243616303,
2879 39973.092140953675,
2880 39991.946261261117,
2881 40010.802604014549,
2882 40029.661168690225,
2883 40048.521954764678,
2884 40067.384961714779,
2885 40086.250189017679,
2886 40105.117636150855,
2887 40123.98730259209,
2888 40142.859187819471,
2889 40161.733291311379,
2890 40180.609612546526,
2891 40199.488151003912,
2892 40218.368906162854,
2893 40237.25187750296,
2894 40256.137064504153,
2895 40275.024466646668,
2896 40293.914083411029,
2897 40312.805914278084,
2898 40331.699958728961,
2899 40350.596216245103,
2900 40369.494686308273,
2901 40388.39536840051,
2902 40407.298262004173,
2903 40426.20336660192,
2904 40445.110681676706,
2905 40464.020206711793,
2906 40482.931941190756,
2907 40501.845884597446,
2908 40520.762036416032,
2909 40539.680396130985,
2910 40558.600963227072,
2911 40577.523737189367,
2912 40596.448717503234,
2913 40615.375903654342,
2914 40634.305295128659,
2915 40653.236891412453,
2916 40672.170691992294,
2917 40691.106696355047,
2918 40710.044903987873,
2919 40728.985314378238,
2920 40747.927927013901,
2921 40766.872741382918,
2922 40785.819756973651,
2923 40804.768973274746,
2924 40823.720389775161,
2925 40842.674005964131,
2926 40861.629821331211,
2927 40880.587835366234,
2928 40899.548047559321,
2929 40918.510457400931,
2930 40937.475064381761,
2931 40956.441867992849,
2932 40975.410867725499,
2933 40994.382063071331,
2934 41013.355453522236,
2935 41032.331038570417,
2936 41051.308817708363,
2937 41070.288790428858,
2938 41089.270956224987,
2939 41108.255314590111,
2940 41127.241865017888,
2941 41146.23060700229,
2942 41165.221540037543,
2943 41184.214663618193,
2944 41203.209977239079,
2945 41222.207480395307,
2946 41241.207172582297,
2947 41260.209053295752,
2948 41279.213122031659,
2949 41298.219378286303,
2950 41317.227821556255,
2951 41336.23845133838,
2952 41355.251267129832,
2953 41374.266268428037,
2954 41393.283454730743,
2955 41412.302825535953,
2956 41431.324380341983,
2957 41450.348118647416,
2958 41469.374039951144,
2959 41488.402143752326,
2960 41507.432429550427,
2961 41526.464896845187,
2962 41545.499545136627,
2963 41564.536373925075,
2964 41583.575382711126,
2965 41602.616570995662,
2966 41621.659938279874,
2967 41640.705484065205,
2968 41659.753207853406,
2969 41678.803109146495,
2970 41697.855187446803,
2971 41716.909442256911,
2972 41735.965873079709,
2973 41755.02447941836,
2974 41774.085260776315,
2975 41793.148216657297,
2976 41812.213346565331,
2977 41831.280650004708,
2978 41850.350126480014,
2979 41869.421775496106,
2980 41888.495596558132,
2981 41907.571589171515,
2982 41926.649752841957,
2983 41945.730087075463,
2984 41964.812591378286,
2985 41983.897265256979,
2986 42002.984108218378,
2987 42022.073119769593,
2988 42041.164299418015,
2989 42060.257646671307,
2990 42079.353161037419,
2991 42098.450842024591,
2992 42117.550689141324,
2993 42136.652701896404,
2994 42155.756879798893,
2995 42174.863222358137,
2996 42193.971729083758,
2997 42213.082399485655,
2998 42232.195233074002,
2999 42251.310229359246,
3000 42270.427387852127,
3001 42289.546708063644,
3002 42308.668189505079,
3003 42327.791831687995,
3004 42346.917634124227,
3005 42366.045596325886,
3006 42385.175717805352,
3007 42404.307998075295,
3008 42423.442436648642,
3009 42442.579033038608,
3010 42461.717786758672,
3011 42480.858697322597,
3012 42500.001764244422,
3013 42519.146987038446,
3014 42538.294365219248,
3015 42557.443898301688,
3016 42576.595585800882,
3017 42595.749427232236,
3018 42614.90542211142,
3019 42634.063569954378,
3020 42653.223870277317,
3021 42672.386322596729,
3022 42691.55092642938,
3023 42710.717681292292,
3024 42729.886586702756,
3025 42749.057642178363,
3026 42768.23084723694,
3027 42787.406201396603,
3028 42806.58370417574,
3029 42825.76335509299,
3030 42844.945153667286,
3031 42864.129099417805,
3032 42883.315191864014,
3033 42902.503430525649,
3034 42921.693814922692,
3035 42940.88634457541,
3036 42960.081019004348,
3037 42979.277837730297,
3038 42998.476800274322,
3039 43017.677906157769,
3040 43036.881154902228,
3041 43056.086546029583,
3042 43075.294079061961,
3043 43094.503753521763,
3044 43113.715568931671,
3045 43132.929524814601,
3046 43152.145620693766,
3047 43171.363856092619,
3048 43190.584230534907,
3049 43209.806743544621,
3050 43229.031394646016,
3051 43248.258183363621,
3052 43267.487109222224,
3053 43286.718171746885,
3054 43305.951370462906,
3055 43325.186704895881,
3056 43344.42417457165,
3057 43363.663779016322,
3058 43382.905517756262,
3059 43402.149390318104,
3060 43421.395396228749,
3061 43440.643535015348,
3062 43459.89380620532,
3063 43479.146209326354,
3064 43498.400743906379,
3065 43517.657409473606,
3066 43536.916205556496,
3067 43556.177131683784,
3068 43575.44018738444,
3069 43594.705372187724,
3070 43613.972685623135,
3071 43633.242127220445,
3072 43652.513696509668,
3073 43671.787393021099,
3074 43691.063216285271,
3075 43710.341165833001,
3076 43729.621241195346,
3077 43748.903441903625,
3078 43768.187767489413,
3079 43787.474217484552,
3080 43806.762791421126,
3081 43826.053488831501,
3082 43845.346309248278,
3083 43864.641252204325,
3084 43883.938317232765,
3085 43903.237503866971,
3086 43922.538811640596,
3087 43941.842240087513,
3088 43961.147788741881,
3089 43980.455457138101,
3090 43999.765244810835,
3091 44019.077151295001,
3092 44038.391176125755,
3093 44057.70731883854,
3094 44077.02557896902,
3095 44096.345956053141,
3096 44115.668449627083,
3097 44134.993059227287,
3098 44154.319784390456,
3099 44173.648624653535,
3100 44192.979579553728,
3101 44212.312648628489,
3102 44231.647831415532,
3103 44250.985127452805,
3104 44270.324536278538,
3105 44289.666057431183,
3106 44309.009690449464,
3107 44328.355434872348,
3108 44347.703290239064,
3109 44367.053256089079,
3110 44386.405331962109,
3111 44405.759517398139,
3112 44425.115811937387,
3113 44444.474215120332,
3114 44463.834726487694,
3115 44483.197345580462,
3116 44502.562071939843,
3117 44521.928905107328,
3118 44541.297844624634,
3119 44560.668890033732,
3120 44580.042040876848,
3121 44599.417296696454,
3122 44618.794657035272,
3123 44638.174121436256,
3124 44657.555689442641,
3125 44676.939360597877,
3126 44696.325134445673,
3127 44715.713010530002,
3128 44735.102988395054,
3129 44754.495067585296,
3130 44773.88924764542,
3131 44793.285528120374,
3132 44812.683908555344,
3133 44832.084388495779,
3134 44851.486967487363,
3135 44870.891645076015,
3136 44890.298420807922,
3137 44909.707294229491,
3138 44929.118264887409,
3139 44948.531332328566,
3140 44967.946496100136,
3141 44987.363755749502,
3142 45006.783110824319,
3143 45026.204560872473,
3144 45045.628105442098,
3145 45065.053744081561,
3146 45084.48147633949,
3147 45103.911301764747,
3148 45123.343219906426,
3149 45142.777230313885,
3150 45162.21333253671,
3151 45181.651526124733,
3152 45201.091810628037,
3153 45220.534185596924,
3154 45239.978650581965,
3155 45259.425205133957,
3156 45278.873848803938,
3157 45298.324581143192,
3158 45317.777401703235,
3159 45337.232310035848,
3160 45356.68930569302,
3161 45376.148388226997,
3162 45395.60955719027,
3163 45415.072812135557,
3164 45434.538152615823,
3165 45454.005578184282,
3166 45473.475088394356,
3167 45492.946682799746,
3168 45512.420360954362,
3169 45531.896122412363,
3170 45551.373966728155,
3171 45570.853893456362,
3172 45590.33590215187,
3173 45609.819992369776,
3174 45629.306163665438,
3175 45648.794415594442,
3176 45668.284747712612,
3177 45687.777159576006,
3178 45707.27165074092,
3179 45726.768220763894,
3180 45746.266869201696,
3181 45765.767595611323,
3182 45785.270399550034,
3183 45804.775280575297,
3184 45824.282238244828,
3185 45843.79127211657,
3186 45863.302381748719,
3187 45882.815566699683,
3188 45902.33082652813,
3189 45921.848160792935,
3190 45941.367569053225,
3191 45960.889050868354,
3192 45980.41260579793,
3193 45999.938233401757,
3194 46019.465933239902,
3195 46038.995704872657,
3196 46058.527547860547,
3197 46078.06146176433,
3198 46097.597446144995,
3199 46117.135500563774,
3200 46136.675624582109,
3201 46156.217817761702,
3202 46175.762079664462,
3203 46195.308409852543,
3204 46214.856807888333,
3205 46234.407273334444,
3206 46253.959805753715,
3207 46273.51440470924,
3208 46293.071069764315,
3209 46312.629800482478,
3210 46332.190596427499,
3211 46351.753457163381,
3212 46371.318382254351,
3213 46390.885371264863,
3214 46410.45442375962,
3215 46430.025539303526,
3216 46449.598717461733,
3217 46469.17395779962,
3218 46488.751259882782,
3219 46508.33062327707,
3220 46527.912047548532,
3221 46547.495532263471,
3222 46567.081076988397,
3223 46586.668681290059,
3224 46606.258344735434,
3225 46625.850066891719,
3226 46645.443847326351,
3227 46665.039685606986,
3228 46684.637581301497,
3229 46704.237533978005,
3230 46723.839543204842,
3231 46743.443608550573,
3232 46763.049729583989,
3233 46782.657905874104,
3234 46802.268136990162,
3235 46821.880422501628,
3236 46841.494761978196,
3237 46861.111154989776,
3238 46880.729601106526,
3239 46900.350099898795,
3240 46919.97265093719,
3241 46939.597253792526,
3242 46959.223908035841,
3243 46978.852613238392,
3244 46998.483368971691,
3245 47018.11617480743,
3246 47037.751030317551,
3247 47057.387935074221,
3248 47077.026888649809,
3249 47096.66789061694,
3250 47116.310940548428,
3251 47135.956038017328,
3252 47155.603182596918,
3253 47175.252373860698,
3254 47194.903611382375,
3255 47214.556894735892,
3256 47234.212223495422,
3257 47253.869597235338,
3258 47273.52901553025,
3259 47293.19047795498,
3260 47312.853984084577,
3261 47332.519533494306,
3262 47352.187125759658,
3263 47371.856760456343,
3264 47391.528437160297,
3265 47411.202155447652,
3266 47430.877914894787,
3267 47450.555715078299,
3268 47470.235555574982,
3269 47489.917435961863,
3270 47509.601355816201,
3271 47529.287314715453,
3272 47548.975312237308,
3273 47568.665347959672,
3274 47588.357421460656,
3275 47608.051532318605,
3276 47627.747680112072,
3277 47647.445864419846,
3278 47667.14608482091,
3279 47686.848340894474,
3280 47706.552632219973,
3281 47726.258958377046,
3282 47745.967318945557,
3283 47765.677713505589,
3284 47785.390141637428,
3285 47805.104602921601,
3286 47824.821096938824,
3287 47844.539623270044,
3288 47864.260181496429,
3289 47883.982771199349,
3290 47903.707391960394,
3291 47923.434043361369,
3292 47943.162724984308,
3293 47962.893436411439,
3294 47982.626177225218,
3295 48002.36094700831,
3296 48022.097745343599,
3297 48041.836571814172,
3298 48061.57742600335,
3299 48081.32030749465,
3300 48101.065215871815,
3301 48120.81215071879,
3302 48140.56111161974,
3303 48160.312098159047,
3304 48180.065109921306,
3305 48199.820146491307,
3306 48219.577207454073,
3307 48239.336292394844,
3308 48259.097400899045,
3309 48278.860532552339,
3310 48298.625686940592,
3311 48318.392863649875,
3312 48338.162062266485,
3313 48357.933282376915,
3314 48377.706523567889,
3315 48397.481785426316,
3316 48417.259067539344,
3317 48437.038369494308,
3318 48456.819690878765,
3319 48476.603031280487,
3320 48496.388390287451,
3321 48516.175767487839,
3322 48535.965162470042,
3323 48555.756574822684,
3324 48575.550004134566,
3325 48595.345449994718,
3326 48615.142911992378,
3327 48634.942389716991,
3328 48654.743882758201,
3329 48674.547390705877,
3330 48694.352913150084,
3331 48714.160449681112,
3332 48733.969999889443,
3333 48753.781563365759,
3334 48773.595139700978,
3335 48793.410728486211,
3336 48813.228329312769,
3337 48833.047941772187,
3338 48852.869565456189,
3339 48872.693199956717,
3340 48892.518844865925,
3341 48912.346499776155,
3342 48932.176164279976,
3343 48952.007837970152,
3344 48971.841520439666,
3345 48991.677211281676,
3346 49011.514910089587,
3347 49031.354616456978,
3348 49051.196329977654,
3349 49071.04005024561,
3350 49090.885776855059,
3351 49110.733509400408,
3352 49130.583247476279,
3353 49150.434990677488,
3354 49170.288738599062,
3355 49190.144490836232,
3356 49210.002246984441,
3357 49229.86200663932,
3358 49249.723769396718,
3359 49269.587534852675,
3360 49289.453302603448,
3361 49309.32107224549,
3362 49329.190843375451,
3363 49349.062615590192,
3364 49368.936388486785,
3365 49388.812161662492,
3366 49408.689934714785,
3367 49428.569707241324,
3368 49448.45147883999,
3369 49468.335249108866,
3370 49488.22101764621,
3371 49508.108784050521,
3372 49527.99854792047,
3373 49547.890308854934,
3374 49567.784066453009,
3375 49587.679820313977,
3376 49607.57757003732,
3377 49627.477315222721,
3378 49647.379055470075,
3379 49667.28279037946,
3380 49687.188519551179,
3381 49707.096242585707,
3382 49727.005959083741,
3383 49746.917668646165,
3384 49766.831370874068,
3385 49786.747065368734,
3386 49806.66475173166,
3387 49826.584429564515,
3388 49846.506098469203,
3389 49866.429758047794,
3390 49886.355407902578,
3391 49906.283047636032,
3392 49926.212676850846,
3393 49946.144295149883,
3394 49966.077902136225,
3395 49986.013497413151,
3396 50005.951080584135,
3397 50025.890651252834,
3398 50045.832209023123,
3399 50065.775753499074,
3400 50085.721284284933,
3401 50105.668800985164,
3402 50125.618303204428,
3403 50145.569790547575,
3404 50165.523262619652,
3405 50185.478719025901,
3406 50205.436159371769,
3407 50225.395583262893,
3408 50245.356990305103,
3409 50265.320380104429,
3410 50285.285752267104,
3411 50305.253106399534,
3412 50325.222442108337,
3413 50345.193759000336,
3414 50365.16705668252,
3415 50385.142334762102,
3416 50405.119592846473,
3417 50425.098830543218,
3418 50445.080047460127,
3419 50465.063243205179,
3420 50485.048417386541,
3421 50505.035569612577,
3422 50525.024699491856,
3423 50545.015806633128,
3424 50565.008890645338,
3425 50585.003951137631,
3426 50605.00098771933,
3427 50624.999999999971,
3428 50645.000987589265,
3429 50665.003950097132,
3430 50685.008887133677,
3431 50705.015798309192,
3432 50725.024683234165,
3433 50745.035541519283,
3434 50765.048372775411,
3435 50785.063176613621,
3436 50805.079952645159,
3437 50825.098700481489,
3438 50845.119419734241,
3439 50865.142110015244,
3440 50885.166770936521,
3441 50905.193402110279,
3442 50925.222003148934,
3443 50945.252573665071,
3444 50965.285113271471,
3445 50985.319621581119,
3446 51005.356098207172,
3447 51025.394542762981,
3448 51045.434954862096,
3449 51065.477334118244,
3450 51085.521680145357,
3451 51105.567992557546,
3452 51125.616270969113,
3453 51145.66651499454,
3454 51165.718724248516,
3455 51185.772898345916,
3456 51205.829036901778,
3457 51225.887139531362,
3458 51245.947205850105,
3459 51266.009235473619,
3460 51286.073228017718,
3461 51306.139183098399,
3462 51326.207100331856,
3463 51346.276979334456,
3464 51366.348819722756,
3465 51386.42262111351,
3466 51406.498383123653,
3467 51426.57610537031,
3468 51446.655787470787,
3469 51466.737429042587,
3470 51486.82102970338,
3471 51506.906589071048,
3472 51526.994106763632,
3473 51547.083582399391,
3474 51567.175015596738,
3475 51587.268405974297,
3476 51607.363753150858,
3477 51627.461056745415,
3478 51647.56031637713,
3479 51667.661531665362,
3480 51687.764702229651,
3481 51707.869827689727,
3482 51727.976907665499,
3483 51748.085941777055,
3484 51768.196929644677,
3485 51788.309870888836,
3486 51808.42476513017,
3487 51828.541611989524,
3488 51848.660411087905,
3489 51868.781162046515,
3490 51888.90386448674,
3491 51909.028518030143,
3492 51929.155122298485,
3493 51949.283676913685,
3494 51969.414181497872,
3495 51989.546635673345,
3496 52009.681039062583,
3497 52029.817391288263,
3498 52049.955691973213,
3499 52070.095940740481,
3500 52090.238137213273,
3501 52110.382281014987,
3502 52130.5283717692,
3503 52150.676409099666,
3504 52170.826392630333,
3505 52190.97832198532,
3506 52211.132196788931,
3507 52231.288016665654,
3508 52251.445781240145,
3509 52271.60549013727,
3510 52291.76714298204,
3511 52311.930739399664,
3512 52332.096279015546,
3513 52352.263761455244,
3514 52372.433186344519,
3515 52392.604553309284,
3516 52412.777861975665,
3517 52432.953111969946,
3518 52453.130302918595,
3519 52473.309434448267,
3520 52493.490506185793,
3521 52513.67351775818,
3522 52533.858468792605,
3523 52554.045358916446,
3524 52574.234187757254,
3525 52594.42495494274,
3526 52614.617660100812,
3527 52634.812302859558,
3528 52655.008882847229,
3529 52675.20739969227,
3530 52695.407853023295,
3531 52715.610242469098,
3532 52735.814567658657,
3533 52756.02082822111,
3534 52776.229023785803,
3535 52796.439153982225,
3536 52816.651218440056,
3537 52836.865216789171,
3538 52857.081148659599,
3539 52877.29901368155,
3540 52897.518811485425,
3541 52917.740541701773,
3542 52937.964203961354,
3543 52958.18979789508,
3544 52978.417323134046,
3545 52998.646779309529,
3546 53018.878166052978,
3547 53039.111482996006,
3548 53059.346729770419,
3549 53079.583906008193,
3550 53099.823011341483,
3551 53120.0640454026,
3552 53140.307007824063,
3553 53160.551898238533,
3554 53180.79871627887,
3555 53201.047461578091,
3556 53221.2981337694,
3557 53241.550732486176,
3558 53261.805257361964,
3559 53282.061708030487,
3560 53302.32008412564,
3561 53322.580385281493,
3562 53342.842611132299,
3563 53363.106761312469,
3564 53383.372835456597,
3565 53403.640833199453,
3566 53423.910754175973,
3567 53444.18259802126,
3568 53464.456364370613,
3569 53484.732052859479,
3570 53505.009663123499,
3571 53525.289194798468,
3572 53545.570647520362,
3573 53565.854020925333,
3574 53586.139314649699,
3575 53606.426528329954,
3576 53626.715661602764,
3577 53647.006714104959,
3578 53667.299685473547,
3579 53687.59457534572,
3580 53707.891383358816,
3581 53728.190109150361,
3582 53748.490752358055,
3583 53768.793312619753,
3584 53789.09778957349,
3585 53809.404182857485,
3586 53829.712492110106,
3587 53850.022716969899,
3588 53870.334857075584,
3589 53890.648912066055,
3590 53910.964881580367,
3591 53931.28276525774,
3592 53951.602562737586,
3593 53971.924273659461,
3594 53992.24789766311,
3595 54012.57343438844,
3596 54032.90088347553,
3597 54053.23024456462,
3598 54073.561517296133,
3599 54093.894701310644,
3600 54114.22979624891,
3601 54134.566801751855,
3602 54154.90571746057,
3603 54175.246543016314,
3604 54195.589278060506,
3605 54215.933922234755,
3606 54236.280475180814,
3607 54256.628936540626,
3608 54276.97930595628,
3609 54297.331583070045,
3610 54317.685767524359,
3611 54338.041858961828,
3612 54358.399857025215,
3613 54378.759761357462,
3614 54399.121571601667,
3615 54419.485287401105,
3616 54439.850908399218,
3617 54460.218434239614,
3618 54480.587864566056,
3619 54500.95919902248,
3620 54521.332437252997,
3621 54541.707578901878,
3622 54562.084623613555,
3623 54582.46357103264,
3624 54602.844420803893,
3625 54623.227172572246,
3626 54643.611825982807,
3627 54663.998380680838,
3628 54684.386836311773,
3629 54704.777192521207,
3630 54725.169448954897,
3631 54745.563605258772,
3632 54765.959661078923,
3633 54786.357616061614,
3634 54806.757469853255,
3635 54827.159222100439,
3636 54847.562872449904,
3637 54867.968420548583,
3638 54888.375866043534,
3639 54908.785208582012,
3640 54929.196447811417,
3641 54949.609583379322,
3642 54970.024614933463,
3643 54990.441542121727,
3644 55010.86036459219,
3645 55031.28108199306,
3646 55051.703693972733,
3647 55072.128200179759,
3648 55092.554600262847,
3649 55112.982893870874,
3650 55133.413080652877,
3651 55153.845160258061,
3652 55174.279132335789,
3653 55194.714996535586,
3654 55215.152752507143,
3655 55235.592399900306,
3656 55256.033938365079,
3657 55276.477367551655,
3658 55296.92268711036,
3659 55317.369896691685,
3660 55337.818995946305,
3661 55358.269984525024,
3662 55378.72286207883,
3663 55399.177628258869,
3664 55419.634282716441,
3665 55440.092825103013,
3666 55460.553255070205,
3667 55481.015572269804,
3668 55501.479776353764,
3669 55521.945866974187,
3670 55542.413843783339,
3671 55562.883706433655,
3672 55583.355454577715,
3673 55603.82908786826,
3674 55624.304605958219,
3675 55644.782008500639,
3676 55665.261295148754,
3677 55685.742465555952,
3678 55706.225519375774,
3679 55726.710456261928,
3680 55747.197275868275,
3681 55767.685977848843,
3682 55788.176561857814,
3683 55808.669027549528,
3684 55829.163374578478,
3685 55849.659602599328,
3686 55870.157711266889,
3687 55890.657700236145,
3688 55911.159569162221,
3689 55931.663317700411,
3690 55952.168945506164,
3691 55972.676452235086,
3692 55993.185837542944,
3693 56013.697101085651,
3694 56034.210242519301,
3695 56054.72526150012,
3696 56075.242157684508,
3697 56095.760930729011,
3698 56116.281580290342,
3699 56136.804106025367,
3700 56157.328507591104,
3701 56177.85478464474,
3702 56198.382936843598,
3703 56218.912963845185,
3704 56239.444865307138,
3705 56259.978640887268,
3706 56280.514290243525,
3707 56301.051813034042,
3708 56321.591208917082,
3709 56342.13247755108,
3710 56362.675618594607,
3711 56383.220631706419,
3712 56403.767516545398,
3713 56424.316272770608,
3714 56444.866900041241,
3715 56465.419398016667,
3716 56485.973766356394,
3717 56506.530004720102,
3718 56527.088112767611,
3719 56547.648090158902,
3720 56568.209936554107,
3721 56588.773651613519,
3722 56609.339234997584,
3723 56629.9066863669,
3724 56650.47600538221,
3725 56671.04719170442,
3726 56691.620244994599,
3727 56712.195164913959,
3728 56732.771951123868,
3729 56753.350603285835,
3730 56773.931121061541,
3731 56794.513504112823,
3732 56815.097752101647,
3733 56835.683864690152,
3734 56856.271841540627,
3735 56876.86168231551,
3736 56897.453386677393,
3737 56918.046954289028,
3738 56938.642384813298,
3739 56959.239677913261,
3740 56979.838833252121,
3741 57000.439850493225,
3742 57021.04272930009,
3743 57041.647469336371,
3744 57062.254070265873,
3745 57082.862531752558,
3746 57103.472853460553,
3747 57124.085035054108,
3748 57144.699076197649,
3749 57165.314976555739,
3750 57185.932735793103,
3751 57206.552353574611,
3752 57227.173829565276,
3753 57247.797163430281,
3754 57268.42235483494,
3755 57289.049403444733,
3756 57309.678308925286,
3757 57330.30907094237,
3758 57350.941689161911,
3759 57371.576163249985,
3760 57392.212492872815,
3761 57412.850677696784,
3762 57433.490717388406,
3763 57454.132611614368,
3764 57474.776360041491,
3765 57495.421962336746,
3766 57516.069418167266,
3767 57536.718727200314,
3768 57557.36988910332,
3769 57578.022903543861,
3770 57598.677770189643,
3771 57619.334488708548,
3772 57639.993058768589,
3773 57660.653480037938,
3774 57681.315752184906,
3775 57701.979874877965,
3776 57722.64584778573,
3777 57743.31367057695,
3778 57763.983342920546,
3779 57784.654864485572,
3780 57805.328234941233,
3781 57826.003453956881,
3782 57846.680521202026,
3783 57867.359436346305,
3784 57888.040199059527,
3785 57908.722809011633,
3786 57929.407265872709,
3787 57950.093569313001,
3788 57970.781719002895,
3789 57991.471714612911,
3790 58012.16355581375,
3791 58032.857242276223,
3792 58053.552773671312,
3793 58074.25014967013,
3794 58094.949369943948,
3795 58115.650434164185,
3796 58136.353342002389,
3797 58157.058093130276,
3798 58177.764687219693,
3799 58198.47312394264,
3800 58219.183402971255,
3801 58239.895523977837,
3802 58260.609486634821,
3803 58281.325290614775,
3804 58302.042935590434,
3805 58322.762421234678,
3806 58343.483747220511,
3807 58364.206913221096,
3808 58384.931918909751,
3809 58405.658763959924,
3810 58426.3874480452,
3811 58447.117970839339,
3812 58467.85033201622,
3813 58488.584531249864,
3814 58509.320568214462,
3815 58530.058442584334,
3816 58550.798154033931,
3817 58571.539702237875,
3818 58592.283086870906,
3819 58613.028307607929,
3820 58633.775364123983,
3821 58654.52425609425,
3822 58675.274983194053,
3823 58696.027545098877,
3824 58716.781941484325,
3825 58737.538172026158,
3826 58758.296236400274,
3827 58779.056134282728,
3828 58799.817865349694,
3829 58820.581429277503,
3830 58841.346825742643,
3831 58862.114054421712,
3832 58882.883114991484,
3833 58903.654007128847,
3834 58924.426730510851,
3835 58945.201284814684,
3836 58965.977669717664,
3837 58986.755884897269,
3838 59007.535930031117,
3839 59028.317804796949,
3840 59049.101508872664,
3841 59069.887041936301,
3842 59090.674403666046,
3843 59111.463593740213,
3844 59132.254611837263,
3845 59153.047457635803,
3846 59173.84213081457,
3847 59194.638631052461,
3848 59215.436958028506,
3849 59236.237111421855,
3850 59257.039090911829,
3851 59277.842896177877,
3852 59298.648526899589,
3853 59319.455982756685,
3854 59340.26526342905,
3855 59361.076368596696,
3856 59381.889297939757,
3857 59402.704051138542,
3858 59423.520627873484,
3859 59444.339027825139,
3860 59465.159250674224,
3861 59485.9812961016,
3862 59506.805163788253,
3863 59527.630853415307,
3864 59548.458364664046,
3865 59569.287697215863,
3866 59590.118850752311,
3867 59610.951824955089,
3868 59631.786619506012,
3869 59652.623234087048,
3870 59673.461668380311,
3871 59694.301922068029,
3872 59715.143994832593,
3873 59735.987886356525,
3874 59756.833596322482,
3875 59777.681124413255,
3876 59798.530470311794,
3877 59819.381633701159,
3878 59840.234614264569,
3879 59861.089411685381,
3880 59881.94602564707,
3881 59902.804455833269,
3882 59923.664701927737,
3883 59944.526763614384,
3884 59965.390640577243,
3885 59986.256332500488,
3886 60007.123839068438,
3887 60027.993159965539,
3888 60048.864294876381,
3889 60069.737243485688,
3890 60090.612005478324,
3891 60111.488580539284,
3892 60132.366968353708,
3893 60153.247168606867,
3894 60174.129180984164,
3895 60195.013005171153,
3896 60215.898640853513,
3897 60236.786087717061,
3898 60257.675345447751,
3899 60278.566413731671,
3900 60299.459292255044,
3901 60320.353980704247,
3902 60341.25047876576,
3903 60362.148786126229,
3904 60383.048902472423,
3905 60403.950827491237,
3906 60424.854560869717,
3907 60445.76010229504,
3908 60466.667451454516,
3909 60487.57660803559,
3910 60508.487571725847,
3911 60529.400342212997,
3912 60550.314919184893,
3913 60571.231302329521,
3914 60592.149491335003,
3915 60613.069485889588,
3916 60633.991285681674,
3917 60654.914890399785,
3918 60675.840299732568,
3919 60696.767513368832,
3920 60717.696530997484,
3921 60738.627352307602,
3922 60759.55997698837,
3923 60780.494404729128,
3924 60801.430635219323,
3925 60822.368668148556,
3926 60843.308503206565,
3927 60864.250140083204,
3928 60885.193578468468,
3929 60906.138818052495,
3930 60927.085858525541,
3931 60948.034699578006,
3932 60968.985340900421,
3933 60989.937782183442,
3934 61010.892023117864,
3935 61031.848063394616,
3936 61052.805902704764,
3937 61073.765540739492,
3938 61094.726977190134,
3939 61115.690211748137,
3940 61136.655244105103,
3941 61157.622073952742,
3942 61178.590700982917,
3943 61199.561124887616,
3944 61220.533345358948,
3945 61241.507362089171,
3946 61262.483174770663,
3947 61283.460783095943,
3948 61304.440186757645,
3949 61325.421385448557,
3950 61346.404378861582,
3951 61367.389166689762,
3952 61388.375748626262,
3953 61409.364124364387,
3954 61430.354293597571,
3955 61451.346256019373,
3956 61472.340011323497,
3957 61493.335559203762,
3958 61514.332899354122,
3959 61535.332031468672,
3960 61556.332955241618,
3961 61577.335670367313,
3962 61598.340176540238,
3963 61619.346473454993,
3964 61640.354560806329,
3965 61661.3644382891,
3966 61682.376105598312,
3967 61703.389562429089,
3968 61724.404808476691,
3969 61745.42184343651,
3970 61766.440667004063,
3971 61787.461278874987,
3972 61808.483678745069,
3973 61829.507866310203,
3974 61850.533841266435,
3975 61871.561603309929,
3976 61892.591152136971,
3977 61913.622487443987,
3978 61934.655608927525,
3979 61955.690516284267,
3980 61976.727209211022,
3981 61997.765687404724,
3982 62018.805950562448,
3983 62039.847998381381,
3984 62060.891830558845,
3985 62081.93744679229,
3986 62102.984846779298,
3987 62124.034030217575,
3988 62145.084996804966,
3989 62166.137746239416,
3990 62187.19227821903,
3991 62208.248592442025,
3992 62229.306688606739,
3993 62250.366566411656,
3994 62271.428225555377,
3995 62292.491665736627,
3996 62313.556886654267,
3997 62334.623888007271,
3998 62355.692669494762,
3999 62376.763230815974,
4000 62397.835571670272,
4001 62418.909691757144,
4002 62439.98559077621,
4003 62461.063268427228,
4004 62482.142724410049,
4005 62503.223958424685,
4006 62524.306970171267,
4007 62545.39175935003,
4008 62566.478325661366,
4009 62587.566668805768,
4010 62608.656788483881,
4011 62629.748684396451,
4012 62650.842356244357,
4013 62671.937803728622,
4014 62693.035026550366,
4015 62714.134024410858,
4016 62735.234797011479,
4017 62756.337344053733,
4018 62777.441665239276,
4019 62798.547760269852,
4020 62819.655628847358,
4021 62840.765270673801,
4022 62861.876685451323,
4023 62882.989872882186,
4024 62904.104832668774,
4025 62925.221564513602,
4026 62946.340068119309,
4027 62967.460343188657,
4028 62988.582389424526,
4029 63009.70620652994,
4030 63030.831794208025,
4031 63051.959152162039,
4032 63073.08828009537,
4033 63094.219177711529,
4034 63115.351844714154,
4035 63136.486280806988,
4036 63157.622485693922,
4037 63178.760459078956,
4038 63199.900200666219,
4039 63221.041710159967,
4040 63242.184987264569,
4041 63263.330031684534,
4042 63284.476843124474,
4043 63305.625421289144,
4044 63326.775765883409,
4045 63347.927876612259,
4046 63369.081753180813,
4047 63390.237395294316,
4048 63411.39480265812,
4049 63432.553974977716,
4050 63453.714911958712,
4051 63474.877613306839,
4052 63496.042078727944,
4053 63517.208307927998,
4054 63538.376300613119,
4055 63559.546056489504,
4056 63580.717575263516,
4057 63601.890856641607,
4058 63623.065900330374,
4059 63644.242706036515,
4060 63665.421273466869,
4061 63686.601602328381,
4062 63707.783692328136,
4063 63728.967543173334,
4064 63750.153154571279,
4065 63771.340526229418,
4066 63792.529657855317,
4067 63813.720549156649,
4068 63834.913199841227,
4069 63856.107609616978,
4070 63877.303778191941,
4071 63898.501705274284,
4072 63919.7013905723,
4073 63940.902833794404,
4074 63962.106034649114,
4075 63983.310992845094,
4076 64004.517708091109,
4077 64025.726180096048,
4078 64046.936408568938,
4079 64068.1483932189,
4080 64089.362133755196,
4081 64110.577629887193,
4082 64131.794881324393,
4083 64153.013887776404,
4084 64174.234648952966,
4085 64195.457164563937,
4086 64216.681434319289,
4087 64237.907457929112,
4088 64259.135235103626,
4089 64280.36476555316,
4090 64301.596048988169,
4091 64322.829085119236,
4092 64344.06387365704,
4093 64365.300414312398,
4094 64386.538706796251,
4095 64407.778750819634,
4096 64429.020546093721,
4097 64450.26409232981,
4098 64471.509389239291,
4099 64492.756436533709,
4100 64514.005233924705,
4101 64535.255781124033,
4102 64556.50807784358,
4103 64577.762123795357,
4104 64599.017918691468,
4105 64620.275462244172,
4106 64641.534754165805,
4107 64662.795794168844,
4108 64684.058581965895,
4109 64705.323117269661,
4110 64726.589399792974,
4111 64747.857429248776,
4112 64769.127205350138,
4113 64790.398727810236,
4114 64811.671996342375,
4115 64832.947010659969,
4116 64854.223770476558,
4117 64875.502275505794,
4118 64896.782525461451,
4119 64918.064520057414,
4120 64939.348259007682,
4121 64960.633742026388,
4122 64981.920968827762,
4123 65003.209939126165,
4124 65024.500652636067,
4125 65045.793109072067,
4126 65067.087308148861,
4127 65088.383249581282,
4128 65109.680933084259,
4129 65130.980358372864,
4130 65152.28152516226,
4131 65173.584433167736,
4132 65194.889082104703,
4133 65216.195471688683,
4134 65237.503601635319,
4135 65258.813471660353,
4136 65280.125081479666,
4137 65301.438430809241,
4138 65322.753519365178,
4139 65344.070346863708,
4140 65365.388913021146,
4141 65386.709217553958,
4142 65408.031260178701,
4143 65429.355040612056,
4144 65450.680558570821,
4145 65472.00781377191,
4146 65493.336805932355,
4147 65514.66753476928,
4148 65535.999999999956,
4149 65557.334201341757,
4150 65578.670138512171,
4151 65600.007811228788,
4152 65621.347219209332,
4153 65642.688362171626,
4154 65664.031239833639,
4155 65685.375851913413,
4156 65706.722198129137,
4157 65728.070278199084,
4158 65749.420091841661,
4159 65770.771638775404,
4160 65792.124918718939,
4161 65813.479931391004,
4162 65834.836676510458,
4163 65856.195153796303,
4164 65877.5553629676,
4165 65898.917303743554,
4166 65920.280975843489,
4167 65941.646378986843,
4168 65963.013512893158,
4169 65984.382377282076,
4170 66005.752971873386,
4171 66027.125296386963,
4172 66048.499350542799,
4173 66069.875134061018,
4174 66091.252646661844,
4175 66112.631888065618,
4176 66134.01285799277,
4177 66155.395556163887,
4178 66176.779982299631,
4179 66198.166136120795,
4180 66219.554017348273,
4181 66240.943625703105,
4182 66262.334960906388,
4183 66283.728022679396,
4184 66305.122810743444,
4185 66326.519324820023,
4186 66347.917564630698,
4187 66369.317529897162,
4188 66390.719220341227,
4189 66412.122635684791,
4190 66433.527775649884,
4191 66454.934639958636,
4192 66476.343228333324,
4193 66497.753540496284,
4194 66519.165576169995,
4195 66540.57933507704,
4196 66561.994816940118,
4197 66583.412021482043,
4198 66604.830948425733,
4199 66626.251597494222,
4200 66647.673968410629,
4201 66669.098060898235,
4202 66690.523874680381,
4203 66711.951409480564,
4204 66733.380665022371,
4205 66754.811641029475,
4206 66776.244337225711,
4207 66797.678753334985,
4208 66819.11488908132,
4209 66840.552744188884,
4210 66861.992318381905,
4211 66883.433611384738,
4212 66904.876622921889,
4213 66926.321352717903,
4214 66947.767800497502,
4215 66969.215965985466,
4216 66990.665848906734,
4217 67012.117448986304,
4218 67033.570765949335,
4219 67055.025799521056,
4220 67076.482549426815,
4221 67097.941015392076,
4222 67119.401197142433,
4223 67140.863094403554,
4224 67162.326706901222,
4225 67183.792034361351,
4226 67205.259076509959,
4227 67226.72783307315,
4228 67248.198303777172,
4229 67269.670488348347,
4230 67291.144386513144,
4231 67312.619997998088,
4232 67334.09732252988,
4233 67355.576359835293,
4234 67377.057109641188,
4235 67398.53957167457,
4236 67420.023745662547,
4237 67441.50963133233,
4238 67462.99722841123,
4239 67484.486536626689,
4240 67505.977555706224,
4241 67527.470285377494,
4242 67548.964725368263,
4243 67570.460875406367,
4244 67591.9587352198,
4245 67613.458304536631,
4246 67634.95958308503,
4247 67656.462570593329,
4248 67677.967266789899,
4249 67699.473671403248,
4250 67720.981784162024,
4251 67742.491604794923,
4252 67764.003133030797,
4253 67785.516368598575,
4254 67807.031311227314,
4255 67828.547960646174,
4256 67850.066316584402,
4257 67871.58637877139,
4258 67893.108146936589,
4259 67914.63162080961,
4260 67936.156800120138,
4261 67957.683684597971,
4262 67979.212273973011,
4263 68000.742567975263,
4264 68022.274566334876,
4265 68043.808268782057,
4266 68065.343675047145,
4267 68086.880784860579,
4268 68108.419597952918,
4269 68129.960114054789,
4270 68151.502332896969,
4271 68173.04625421032,
4272 68194.591877725834,
4273 68216.139203174564,
4274 68237.688230287706,
4275 68259.238958796544,
4276 68280.791388432481,
4277 68302.345518927032,
4278 68323.901350011787,
4279 68345.458881418483,
4280 68367.018112878912,
4281 68388.579044125028,
4282 68410.141674888844,
4283 68431.706004902502,
4284 68453.272033898262,
4285 68474.839761608455,
4286 68496.409187765545,
4287 68517.980312102081,
4288 68539.553134350732,
4289 68561.127654244279,
4290 68582.70387151558,
4291 68604.281785897634,
4292 68625.861397123503,
4293 68647.44270492639,
4294 68669.025709039604,
4295 68690.610409196524,
4296 68712.196805130661,
4297 68733.784896575627,
4298 68755.374683265123,
4299 68776.966164932994,
4300 68798.559341313128,
4301 68820.154212139591,
4302 68841.750777146473,
4303 68863.349036068044,
4304 68884.948988638629,
4305 68906.550634592684,
4306 68928.153973664739,
4307 68949.75900558944,
4308 68971.365730101577,
4309 68992.974146935987,
4310 69014.584255827634,
4311 69036.196056511588,
4312 69057.809548723017,
4313 69079.424732197207,
4314 69101.041606669532,
4315 69122.660171875468,
4316 69144.280427550606,
4317 69165.902373430625,
4318 69187.526009251334,
4319 69209.151334748618,
4320 69230.778349658474,
4321 69252.40705371699,
4322 69274.037446660412,
4323 69295.669528225,
4324 69317.303298147192,
4325 69338.938756163494,
4326 69360.575902010532,
4327 69382.214735425005,
4328 69403.855256143754,
4329 69425.497463903681,
4330 69447.141358441833,
4331 69468.78693949533,
4332 69490.434206801394,
4333 69512.083160097391,
4334 69533.733799120717,
4335 69555.386123608929,
4336 69577.04013329967,
4337 69598.695827930685,
4338 69620.353207239794,
4339 69642.012270964973,
4340 69663.67301884426,
4341 69685.335450615792,
4342 69706.999566017839,
4343 69728.665364788743,
4344 69750.332846666963,
4345 69772.002011391058,
4346 69793.672858699691,
4347 69815.345388331611,
4348 69837.019600025669,
4349 69858.695493520849,
4350 69880.373068556204,
4351 69902.052324870907,
4352 69923.733262204216,
4353 69945.415880295492,
4354 69967.100178884211,
4355 69988.786157709939,
4356 70010.473816512356,
4357 70032.163155031216,
4358 70053.854173006403,
4359 70075.546870177874,
4360 70097.241246285717,
4361 70118.937301070109,
4362 70140.635034271298,
4363 70162.334445629691,
4364 70184.035534885741,
4365 70205.738301780017,
4366 70227.442746053217,
4367 70249.1488674461,
4368 70270.856665699539,
4369 70292.566140554511,
4370 70314.277291752107,
4371 70335.990119033493,
4372 70357.704622139936,
4373 70379.420800812819,
4374 70401.138654793613,
4375 70422.85818382389,
4376 70444.579387645339,
4377 70466.302265999722,
4378 70488.026818628918,
4379 70509.753045274876,
4380 70531.480945679708,
4381 70553.210519585555,
4382 70574.941766734701,
4383 70596.674686869505,
4384 70618.409279732456,
4385 70640.145545066101,
4386 70661.883482613106,
4387 70683.623092116264,
4388 70705.364373318414,
4389 70727.107325962526,
4390 70748.851949791671,
4391 70770.598244549008,
4392 70792.346209977783,
4393 70814.095845821372,
4394 70835.847151823225,
4395 70857.600127726895,
4396 70879.354773276034,
4397 70901.111088214413,
4398 70922.869072285859,
4399 70944.628725234332,
4400 70966.390046803877,
4401 70988.153036738629,
4402 71009.917694782853,
4403 71031.684020680885,
4404 71053.45201417715,
4405 71075.221675016204,
4406 71096.993002942661,
4407 71118.765997701266,
4408 71140.540659036851,
4409 71162.316986694335,
4410 71184.09498041874,
4411 71205.874639955218,
4412 71227.655965048951,
4413 71249.438955445294,
4414 71271.223610889632,
4415 71293.009931127483,
4416 71314.797915904477,
4417 71336.587564966307,
4418 71358.378878058764,
4419 71380.171854927772,
4420 71401.966495319313,
4421 71423.762798979486,
4422 71445.560765654489,
4423 71467.360395090596,
4424 71489.161687034211,
4425 71510.964641231811,
4426 71532.769257429973,
4427 71554.575535375348,
4428 71576.383474814749,
4429 71598.19307549503,
4430 71620.004337163133,
4431 71641.817259566145,
4432 71663.631842451214,
4433 71685.4480855656,
4434 71707.26598865664,
4435 71729.085551471784,
4436 71750.906773758586,
4437 71772.729655264673,
4438 71794.554195737772,
4439 71816.380394925713,
4440 71838.208252576442,
4441 71860.037768437964,
4442 71881.868942258385,
4443 71903.701773785942,
4444 71925.536262768932,
4445 71947.372408955751,
4446 71969.210212094898,
4447 71991.049671934976,
4448 72012.890788224686,
4449 72034.73356071279,
4450 72056.577989148165,
4451 72078.424073279821,
4452 72100.271812856794,
4453 72122.121207628254,
4454 72143.97225734347,
4455 72165.824961751801,
4456 72187.679320602692,
4457 72209.53533364569,
4458 72231.393000630429,
4459 72253.252321306645,
4460 72275.113295424177,
4461 72296.975922732949,
4462 72318.840202982959,
4463 72340.706135924338,
4464 72362.573721307272,
4465 72384.442958882093,
4466 72406.313848399179,
4467 72428.186389609036,
4468 72450.060582262216,
4469 72471.936426109431,
4470 72493.813920901433,
4471 72515.693066389096,
4472 72537.573862323392,
4473 72559.456308455352,
4474 72581.340404536139,
4475 72603.226150316987,
4476 72625.113545549248,
4477 72647.002589984331,
4478 72668.893283373764,
4479 72690.785625469172,
4480 72712.679616022273,
4481 72734.575254784853,
4482 72756.472541508803,
4483 72778.371475946144,
4484 72800.272057848939,
4485 72822.174286969355,
4486 72844.07816305969,
4487 72865.983685872285,
4488 72887.890855159596,
4489 72909.799670674183,
4490 72931.710132168693,
4491 72953.622239395845,
4492 72975.535992108475,
4493 72997.451390059519,
4494 73019.368433001961,
4495 73041.287120688925,
4496 73063.207452873612,
4497 73085.129429309294,
4498 73107.053049749389,
4499 73128.978313947344,
4500 73150.905221656736,
4501 73172.833772631217,
4502 73194.763966624567,
4503 73216.695803390612,
4504 73238.62928268328,
4505 73260.564404256627,
4506 73282.501167864757,
4507 73304.439573261901,
4508 73326.379620202337,
4509 73348.321308440485,
4510 73370.264637730841,
4511 73392.209607827957,
4512 73414.156218486532,
4513 73436.104469461323,
4514 73458.054360507173,
4515 73480.005891379056,
4516 73501.959061831993,
4517 73523.913871621116,
4518 73545.870320501665,
4519 73567.828408228932,
4520 73589.78813455833,
4521 73611.749499245358,
4522 73633.712502045615,
4523 73655.677142714747,
4524 73677.643421008557,
4525 73699.611336682879,
4526 73721.580889493693,
4527 73743.552079197019,
4528 73765.524905548999,
4529 73787.499368305856,
4530 73809.475467223907,
4531 73831.453202059551,
4532 73853.432572569291,
4533 73875.413578509717,
4534 73897.396219637507,
4535 73919.380495709411,
4536 73941.36640648231,
4537 73963.353951713143,
4538 73985.343131158952,
4539 74007.333944576865,
4540 74029.326391724098,
4541 74051.320472357969,
4542 74073.316186235883,
4543 74095.313533115303,
4544 74117.312512753837,
4545 74139.313124909138,
4546 74161.315369338976,
4547 74183.319245801191,
4548 74205.324754053727,
4549 74227.331893854629,
4550 74249.340664961986,
4551 74271.351067134034,
4552 74293.363100129049,
4553 74315.376763705441,
4554 74337.392057621662,
4555 74359.408981636298,
4556 74381.427535508003,
4557 74403.447718995507,
4558 74425.469531857671,
4559 74447.492973853383,
4560 74469.518044741693,
4561 74491.54474428168,
4562 74513.573072232539,
4563 74535.603028353551,
4564 74557.634612404087,
4565 74579.667824143602,
4566 74601.702663331642,
4567 74623.739129727837,
4568 74645.777223091936,
4569 74667.816943183716,
4570 74689.858289763113,
4571 74711.901262590094,
4572 74733.945861424741,
4573 74755.992086027225,
4574 74778.039936157802,
4575 74800.089411576817,
4576 74822.140512044702,
4577 74844.193237321961,
4578 74866.24758716923,
4579 74888.303561347187,
4580 74910.36115961663,
4581 74932.420381738411,
4582 74954.481227473516,
4583 74976.543696582972,
4584 74998.607788827925,
4585 75020.673503969607,
4586 75042.740841769322,
4587 75064.809801988464,
4588 75086.88038438854,
4589 75108.952588731103,
4590 75131.026414777836,
4591 75153.101862290467,
4592 75175.178931030852,
4593 75197.257620760924,
4594 75219.33793124267,
4595 75241.419862238225,
4596 75263.503413509738,
4597 75285.588584819503,
4598 75307.675375929874,
4599 75329.763786603318,
4600 75351.853816602365,
4601 75373.945465689612,
4602 75396.038733627807,
4603 75418.133620179724,
4604 75440.230125108254,
4605 75462.32824817636,
4606 75484.427989147109,
4607 75506.529347783653,
4608 75528.63232384919,
4609 75550.736917107075,
4610 75572.843127320695,
4611 75594.950954253538,
4612 75617.060397669193,
4613 75639.171457331307,
4614 75661.284133003646,
4615 75683.398424450032,
4616 75705.514331434402,
4617 75727.631853720741,
4618 75749.750991073175,
4619 75771.871743255862,
4620 75793.994110033076,
4621 75816.118091169177,
4622 75838.243686428585,
4623 75860.370895575848,
4624 75882.499718375562,
4625 75904.630154592422,
4626 75926.762203991224,
4627 75948.895866336825,
4628 75971.031141394182,
4629 75993.168028928325,
4630 76015.306528704401,
4631 76037.4466404876,
4632 76059.588364043215,
4633 76081.731699136653,
4634 76103.876645533353,
4635 76126.023202998884,
4636 76148.171371298871,
4637 76170.321150199044,
4638 76192.472539465205,
4639 76214.625538863256,
4640 76236.780148159174,
4641 76258.936367119008,
4642 76281.094195508922,
4643 76303.253633095141,
4644 76325.414679643975,
4645 76347.577334921851,
4646 76369.741598695226,
4647 76391.907470730686,
4648 76414.074950794879,
4649 76436.244038654564,
4650 76458.414734076548,
4651 76480.587036827754,
4652 76502.760946675175,
4653 76524.936463385893,
4654 76547.11358672705,
4655 76569.292316465915,
4656 76591.472652369819,
4657 76613.654594206164,
4658 76635.838141742468,
4659 76658.023294746308,
4660 76680.210052985349,
4661 76702.398416227341,
4662 76724.588384240138,
4663 76746.779956791637,
4664 76768.973133649866,
4665 76791.167914582897,
4666 76813.364299358902,
4667 76835.562287746157,
4668 76857.761879512967,
4669 76879.963074427797,
4670 76902.165872259109,
4671 76924.37027277553,
4672 76946.576275745727,
4673 76968.783880938441,
4674 76990.993088122515,
4675 77013.203897066895,
4676 77035.416307540567,
4677 77057.630319312622,
4678 77079.845932152239,
4679 77102.063145828695,
4680 77124.281960111301,
4681 77146.50237476948,
4682 77168.724389572759,
4683 77190.948004290723,
4684 77213.173218693031,
4685 77235.400032549442,
4686 77257.628445629802,
4687 77279.858457704031,
4688 77302.090068542122,
4689 77324.323277914169,
4690 77346.558085590339,
4691 77368.794491340886,
4692 77391.032494936138,
4693 77413.272096146524,
4694 77435.51329474253,
4695 77457.756090494731,
4696 77480.000483173804,
4697 77502.246472550498,
4698 77524.494058395634,
4699 77546.743240480107,
4700 77568.994018574944,
4701 77591.246392451198,
4702 77613.500361880026,
4703 77635.755926632657,
4704 77658.013086480438,
4705 77680.271841194757,
4706 77702.532190547092,
4707 77724.794134309021,
4708 77747.057672252195,
4709 77769.322804148323,
4710 77791.589529769248,
4711 77813.857848886837,
4712 77836.127761273063,
4713 77858.399266699998,
4714 77880.67236493979,
4715 77902.947055764627,
4716 77925.223338946831,
4717 77947.50121425878,
4718 77969.780681472927,
4719 77992.061740361838,
4720 78014.344390698127,
4721 78036.628632254491,
4722 78058.914464803747,
4723 78081.201888118725,
4724 78103.490901972415,
4725 78125.781506137821,
4726 78148.073700388064,
4727 78170.367484496339,
4728 78192.662858235926,
4729 78214.959821380166,
4730 78237.258373702498,
4731 78259.558514976452,
4732 78281.860244975614,
4733 78304.163563473659,
4734 78326.468470244363,
4735 78348.77496506153,
4736 78371.083047699125,
4737 78393.392717931114,
4738 78415.703975531578,
4739 78438.016820274701,
4740 78460.331251934695,
4741 78482.647270285903,
4742 78504.964875102727,
4743 78527.284066159627,
4744 78549.604843231195,
4745 78571.927206092048,
4746 78594.251154516911,
4747 78616.576688280606,
4748 78638.903807157985,
4749 78661.232510924034,
4750 78683.562799353778,
4751 78705.894672222363,
4752 78728.228129304945,
4753 78750.563170376859,
4754 78772.899795213423,
4755 78795.238003590101,
4756 78817.577795282399,
4757 78839.919170065928,
4758 78862.262127716356,
4759 78884.606668009452,
4760 78906.952790721043,
4761 78929.300495627045,
4762 78951.64978250346,
4763 78974.000651126378,
4764 78996.353101271932,
4765 79018.707132716358,
4766 79041.062745235977,
4767 79063.41993860717,
4768 79085.778712606436,
4769 79108.139067010285,
4770 79130.501001595389,
4771 79152.864516138419,
4772 79175.22961041618,
4773 79197.596284205531,
4774 79219.96453728342,
4775 79242.33436942687,
4776 79264.705780412987,
4777 79287.078770018954,
4778 79309.453338022009,
4779 79331.829484199508,
4780 79354.207208328866,
4781 79376.586510187582,
4782 79398.967389553218,
4783 79421.349846203433,
4784 79443.733879915948,
4785 79466.119490468584,
4786 79488.50667763922,
4787 79510.895441205823,
4788 79533.285780946433,
4789 79555.677696639163,
4790 79578.071188062226,
4791 79600.466254993895,
4792 79622.862897212515,
4793 79645.261114496549,
4794 79667.660906624471,
4795 79690.062273374875,
4796 79712.465214526455,
4797 79734.869729857935,
4798 79757.275819148126,
4799 79779.683482175955,
4800 79802.092718720378,
4801 79824.503528560454,
4802 79846.915911475327,
4803 79869.329867244203,
4804 79891.745395646343,
4805 79914.162496461155,
4806 79936.581169468045,
4807 79959.001414446553,
4808 79981.423231176261,
4809 80003.846619436852,
4810 80026.271579008084,
4811 80048.698109669771,
4812 80071.12621120183,
4813 80093.555883384237,
4814 80115.987125997053,
4815 80138.419938820414,
4816 80160.854321634528,
4817 80183.290274219689,
4818 80205.727796356281,
4819 80228.166887824715,
4820 80250.607548405547,
4821 80273.049777879336,
4822 80295.493576026798,
4823 80317.938942628651,
4824 80340.385877465727,
4825 80362.834380318949,
4826 80385.28445096928,
4827 80407.736089197788,
4828 80430.189294785596,
4829 80452.644067513917,
4830 80475.100407164035,
4831 80497.558313517322,
4832 80520.017786355209,
4833 80542.478825459213,
4834 80564.941430610925,
4835 80587.405601592007,
4836 80609.871338184195,
4837 80632.338640169342,
4838 80654.8075073293,
4839 80677.277939446067,
4840 80699.749936301683,
4841 80722.223497678278,
4842 80744.698623358039,
4843 80767.17531312324,
4844 80789.653566756242,
4845 80812.133384039465,
4846 80834.614764755403,
4847 80857.097708686648,
4848 80879.582215615854,
4849 80902.068285325731,
4850 80924.555917599093,
4851 80947.045112218824,
4852 80969.535868967869,
4853 80992.028187629272,
4854 81014.522067986123,
4855 81037.017509821613,
4856 81059.514512919006,
4857 81082.013077061609,
4858 81104.513202032831,
4859 81127.014887616184,
4860 81149.518133595193,
4861 81172.022939753486,
4862 81194.529305874807,
4863 81217.037231742899,
4864 81239.546717141639,
4865 81262.057761854958,
4866 81284.570365666848,
4867 81307.084528361403,
4868 81329.600249722775,
4869 81352.117529535186,
4870 81374.636367582949,
4871 81397.156763650448,
4872 81419.678717522125,
4873 81442.202228982511,
4874 81464.727297816222,
4875 81487.253923807933,
4876 81509.782106742379,
4877 81532.311846404409,
4878 81554.843142578902,
4879 81577.375995050839,
4880 81599.910403605274,
4881 81622.446368027333,
4882 81644.983888102215,
4883 81667.522963615178,
4884 81690.063594351581,
4885 81712.605780096841,
4886 81735.149520636449,
4887 81757.694815755967,
4888 81780.241665241047,
4889 81802.79006887741,
4890 81825.340026450824,
4891 81847.891537747171,
4892 81870.444602552379,
4893 81892.999220652477,
4894 81915.555391833506,
4895 81938.113115881672,
4896 81960.672392583176,
4897 81983.233221724338,
4898 82005.795603091537,
4899 82028.359536471224,
4900 82050.925021649906,
4901 82073.492058414209,
4902 82096.060646550788,
4903 82118.630785846399,
4904 82141.202476087841,
4905 82163.775717062032,
4906 82186.35050855593,
4907 82208.926850356569,
4908 82231.504742251054,
4909 82254.084184026578,
4910 82276.665175470393,
4911 82299.24771636985,
4912 82321.831806512317,
4913 82344.417445685307,
4914 82367.004633676348,
4915 82389.593370273054,
4916 82412.183655263143,
4917 82434.775488434374,
4918 82457.368869574595,
4919 82479.963798471697,
4920 82502.560274913689,
4921 82525.158298688606,
4922 82547.757869584602,
4923 82570.35898738986,
4924 82592.961651892678,
4925 82615.565862881398,
4926 82638.171620144421,
4927 82660.778923470265,
4928 82683.387772647475,
4929 82705.998167464713,
4930 82728.610107710658,
4931 82751.223593174116,
4932 82773.83862364394,
4933 82796.45519890904,
4934 82819.073318758441,
4935 82841.692982981185,
4936 82864.314191366429,
4937 82886.936943703375,
4938 82909.561239781324,
4939 82932.187079389638,
4940 82954.814462317736,
4941 82977.443388355125,
4942 83000.073857291369,
4943 83022.70586891612,
4944 83045.339423019104,
4945 83067.974519390089,
4946 83090.611157818959,
4947 83113.249338095629,
4948 83135.8890600101,
4949 83158.530323352461,
4950 83181.173127912858,
4951 83203.817473481497,
4952 83226.463359848669,
4953 83249.11078680474,
4954 83271.759754140134,
4955 83294.410261645375,
4956 83317.062309111003,
4957 83339.715896327703,
4958 83362.371023086147,
4959 83385.027689177165,
4960 83407.685894391587,
4961 83430.345638520361,
4962 83453.006921354478,
4963 83475.669742685001,
4964 83498.334102303095,
4965 83520.999999999942,
4966 83543.667435566866,
4967 83566.336408795192,
4968 83589.006919476349,
4969 83611.678967401851,
4970 83634.352552363242,
4971 83657.027674152167,
4972 83679.704332560359,
4973 83702.382527379552,
4974 83725.062258401638,
4975 83747.743525418511,
4976 83770.42632822218,
4977 83793.110666604684,
4978 83815.796540358162,
4979 83838.483949274829,
4980 83861.172893146941,
4981 83883.863371766842,
4982 83906.555384926964,
4983 83929.248932419752,
4984 83951.944014037799,
4985 83974.640629573696,
4986 83997.338778820151,
4987 84020.038461569929,
4988 84042.739677615857,
4989 84065.442426750829,
4990 84088.146708767847,
4991 84110.852523459922,
4992 84133.559870620171,
4993 84156.268750041796,
4994 84178.979161518029,
4995 84201.691104842204,
4996 84224.404579807713,
4997 84247.119586208006,
4998 84269.83612383662,
4999 84292.55419248715,
5000 84315.273791953281,
5001 84337.994922028738,
5002 84360.717582507335,
5003 84383.441773182945,
5004 84406.167493849513,
5005 84428.894744301069,
5006 84451.623524331691,
5007 84474.353833735542,
5008 84497.085672306828,
5009 84519.819039839858,
5010 84542.553936128999,
5011 84565.290360968676,
5012 84588.028314153402,
5013 84610.767795477717,
5014 84633.508804736295,
5015 84656.251341723822,
5016 84678.995406235073,
5017 84701.740998064924,
5018 84724.488117008252,
5019 84747.236762860062,
5020 84769.986935415407,
5021 84792.73863446941,
5022 84815.491859817252,
5023 84838.246611254188,
5024 84861.002888575575,
5025 84883.760691576768,
5026 84906.520020053256,
5027 84929.28087380057,
5028 84952.043252614312,
5029 84974.807156290146,
5030 84997.572584623806,
5031 85020.339537411113,
5032 85043.108014447949,
5033 85065.878015530237,
5034 85088.649540453989,
5035 85111.422589015303,
5036 85134.197161010321,
5037 85156.973256235244,
5038 85179.750874486374,
5039 85202.530015560071,
5040 85225.310679252725,
5041 85248.092865360857,
5042 85270.876573681016,
5043 85293.661804009811,
5044 85316.448556143951,
5045 85339.236829880188,
5046 85362.026625015351,
5047 85384.817941346351,
5048 85407.610778670132,
5049 85430.405136783724,
5050 85453.201015484257,
5051 85475.998414568865,
5052 85498.797333834795,
5053 85521.597773079353,
5054 85544.399732099904,
5055 85567.203210693886,
5056 85590.008208658808,
5057 85612.814725792239,
5058 85635.62276189182,
5059 85658.432316755265,
5060 85681.243390180331,
5061 85704.055981964877,
5062 85726.870091906807,
5063 85749.685719804082,
5064 85772.502865454764,
5065 85795.321528656961,
5066 85818.141709208852,
5067 85840.963406908675,
5068 85863.78662155474,
5069 85886.611352945445,
5070 85909.437600879217,
5071 85932.26536515457,
5072 85955.094645570091,
5073 85977.92544192441,
5074 86000.757754016275,
5075 86023.591581644432,
5076 86046.426924607746,
5077 86069.263782705122,
5078 86092.102155735556,
5079 86114.942043498071,
5080 86137.783445791807,
5081 86160.626362415918,
5082 86183.470793169676,
5083 86206.316737852379,
5084 86229.164196263402,
5085 86252.013168202204,
5086 86274.863653468303,
5087 86297.715651861261,
5088 86320.569163180728,
5089 86343.424187226425,
5090 86366.280723798132,
5091 86389.138772695675,
5092 86411.998333718977,
5093 86434.859406668009,
5094 86457.721991342827,
5095 86480.586087543532,
5096 86503.451695070296,
5097 86526.318813723352,
5098 86549.187443303032,
5099 86572.057583609683,
5100 86594.929234443756,
5101 86617.802395605773,
5102 86640.677066896271,
5103 86663.553248115903,
5104 86686.43093906538,
5105 86709.310139545443,
5106 86732.190849356964,
5107 86755.073068300815,
5108 86777.956796177954,
5109 86800.842032789442,
5110 86823.728777936354,
5111 86846.617031419853,
5112 86869.506793041175,
5113 86892.398062601613,
5114 86915.290839902518,
5115 86938.185124745316,
5116 86961.080916931489,
5117 86983.978216262592,
5118 87006.87702254027,
5119 87029.777335566177,
5120 87052.67915514209,
5121 87075.582481069796,
5122 87098.487313151185,
5123 87121.39365118822,
5124 87144.301494982894,
5125 87167.210844337285,
5126 87190.121699053532,
5127 87213.034058933845,
5128 87235.947923780506,
5129 87258.863293395829,
5130 87281.780167582241,
5131 87304.698546142172,
5132 87327.618428878181,
5133 87350.539815592856,
5134 87373.462706088845,
5135 87396.387100168897,
5136 87419.312997635774,
5137 87442.240398292357,
5138 87465.16930194154,
5139 87488.099708386319,
5140 87511.031617429733,
5141 87533.965028874911,
5142 87556.899942525008,
5143 87579.836358183282,
5144 87602.774275653021,
5145 87625.713694737613,
5146 87648.654615240492,
5147 87671.597036965148,
5148 87694.540959715145,
5149 87717.486383294105,
5150 87740.433307505737,
5151 87763.381732153779,
5152 87786.331657042057,
5153 87809.283081974456,
5154 87832.236006754916,
5155 87855.190431187453,
5156 87878.146355076155,
5157 87901.103778225151,
5158 87924.062700438633,
5159 87947.023121520891,
5160 87969.985041276246,
5161 87992.948459509105,
5162 88015.913376023906,
5163 88038.879790625171,
5164 88061.847703117513,
5165 88084.817113305573,
5166 88107.788020994049,
5167 88130.760425987726,
5168 88153.734328091465,
5169 88176.709727110137,
5170 88199.686622848749,
5171 88222.665015112303,
5172 88245.644903705906,
5173 88268.626288434709,
5174 88291.609169103947,
5175 88314.593545518903,
5176 88337.579417484914,
5177 88360.566784807408,
5178 88383.555647291854,
5179 88406.546004743795,
5180 88429.537856968818,
5181 88452.531203772611,
5182 88475.52604496089,
5183 88498.522380339447,
5184 88521.52020971413,
5185 88544.519532890874,
5186 88567.520349675644,
5187 88590.522659874507,
5188 88613.526463293543,
5189 88636.531759738922,
5190 88659.538549016899,
5191 88682.546830933745,
5192 88705.556605295846,
5193 88728.567871909589,
5194 88751.580630581491,
5195 88774.594881118086,
5196 88797.610623325963,
5197 88820.62785701183,
5198 88843.646581982393,
5199 88866.666798044462,
5200 88889.688505004888,
5201 88912.711702670611,
5202 88935.7363908486,
5203 88958.762569345898,
5204 88981.790237969632,
5205 89004.81939652696,
5206 89027.850044825114,
5207 89050.882182671412,
5208 89073.9158098732,
5209 89096.950926237885,
5210 89119.987531572973,
5211 89143.025625686001,
5212 89166.065208384563,
5213 89189.106279476357,
5214 89212.148838769106,
5215 89235.192886070581,
5216 89258.238421188667,
5217 89281.285443931265,
5218 89304.333954106376,
5219 89327.383951522017,
5220 89350.435435986306,
5221 89373.488407307406,
5222 89396.542865293537,
5223 89419.598809753006,
5224 89442.656240494165,
5225 89465.715157325409,
5226 89488.775560055219,
5227 89511.837448492137,
5228 89534.900822444746,
5229 89557.965681721733,
5230 89581.032026131812,
5231 89604.099855483742,
5232 89627.169169586399,
5233 89650.239968248672,
5234 89673.312251279538,
5235 89696.386018488018,
5236 89719.461269683205,
5237 89742.53800467425,
5238 89765.616223270365,
5239 89788.69592528083,
5240 89811.777110514988,
5241 89834.859778782207,
5242 89857.943929891975,
5243 89881.029563653807,
5244 89904.116679877261,
5245 89927.205278372014,
5246 89950.29535894774,
5247 89973.386921414218,
5248 89996.479965581268,
5249 90019.574491258769,
5250 90042.670498256688,
5251 90065.767986385021,
5252 90088.866955453836,
5253 90111.967405273259,
5254 90135.069335653476,
5255 90158.172746404758,
5256 90181.277637337407,
5257 90204.384008261797,
5258 90227.49185898836,
5259 90250.601189327586,
5260 90273.711999090039,
5261 90296.824288086325,
5262 90319.938056127125,
5263 90343.053303023189,
5264 90366.170028585286,
5265 90389.288232624298,
5266 90412.407914951138,
5267 90435.529075376777,
5268 90458.651713712257,
5269 90481.775829768681,
5270 90504.901423357209,
5271 90528.028494289058,
5272 90551.157042375504,
5273 90574.287067427911,
5274 90597.418569257643,
5275 90620.551547676194,
5276 90643.686002495073,
5277 90666.821933525847,
5278 90689.959340580186,
5279 90713.098223469773,
5280 90736.238582006365,
5281 90759.380416001804,
5282 90782.523725267951,
5283 90805.668509616764,
5284 90828.814768860233,
5285 90851.962502810435,
5286 90875.11171127946,
5287 90898.262394079517,
5288 90921.414551022855,
5289 90944.568181921743,
5290 90967.72328658856,
5291 90990.879864835719,
5292 91014.037916475718,
5293 91037.19744132107,
5294 91060.358439184391,
5295 91083.520909878338,
5296 91106.684853215629,
5297 91129.850269009039,
5298 91153.017157071401,
5299 91176.185517215621,
5300 91199.355349254649,
5301 91222.526653001492,
5302 91245.699428269247,
5303 91268.873674871036,
5304 91292.049392620058,
5305 91315.226581329553,
5306 91338.405240812834,
5307 91361.585370883287,
5308 91384.766971354344,
5309 91407.950042039476,
5310 91431.134582752245,
5311 91454.320593306256,
5312 91477.508073515171,
5313 91500.697023192712,
5314 91523.887442152685,
5315 91547.07933020893,
5316 91570.272687175326,
5317 91593.467512865856,
5318 91616.663807094534,
5319 91639.861569675442,
5320 91663.060800422725,
5321 91686.261499150554,
5322 91709.463665673218,
5323 91732.66729980502,
5324 91755.872401360321,
5325 91779.078970153569,
5326 91802.287005999257,
5327 91825.49650871192,
5328 91848.707478106167,
5329 91871.91991399668,
5330 91895.133816198169,
5331 91918.349184525418,
5332 91941.566018793281,
5333 91964.784318816659,
5334 91988.004084410495,
5335 92011.22531538982,
5336 92034.448011569708,
5337 92057.672172765277,
5338 92080.897798791746,
5339 92104.124889464365,
5340 92127.353444598411,
5341 92150.58346400928,
5342 92173.814947512379,
5343 92197.04789492322,
5344 92220.282306057314,
5345 92243.518180730272,
5346 92266.755518757753,
5347 92289.994319955469,
5348 92313.234584139194,
5349 92336.476311124774,
5350 92359.719500728082,
5351 92382.964152765067,
5352 92406.210267051734,
5353 92429.457843404161,
5354 92452.706881638471,
5355 92475.957381570814,
5356 92499.209343017443,
5357 92522.462765794655,
5358 92545.717649718805,
5359 92568.973994606305,
5360 92592.231800273614,
5361 92615.491066537259,
5362 92638.751793213814,
5363 92662.01398011994,
5364 92685.277627072326,
5365 92708.54273388772,
5366 92731.809300382942,
5367 92755.077326374871,
5368 92778.346811680414,
5369 92801.617756116568,
5370 92824.890159500384,
5371 92848.164021648947,
5372 92871.439342379424,
5373 92894.716121509016,
5374 92917.994358855023,
5375 92941.274054234746,
5376 92964.555207465572,
5377 92987.837818364962,
5378 93011.121886750407,
5379 93034.407412439468,
5380 93057.694395249753,
5381 93080.982834998955,
5382 93104.272731504767,
5383 93127.564084584999,
5384 93150.856894057491,
5385 93174.15115974014,
5386 93197.446881450916,
5387 93220.744059007804,
5388 93244.04269222889,
5389 93267.342780932304,
5390 93290.644324936235,
5391 93313.947324058914,
5392 93337.251778118633,
5393 93360.557686933767,
5394 93383.865050322696,
5395 93407.173868103928,
5396 93430.484140095941,
5397 93453.795866117362,
5398 93477.109045986799,
5399 93500.423679522952,
5400 93523.739766544561,
5401 93547.057306870454,
5402 93570.376300319491,
5403 93593.696746710571,
5404 93617.018645862699,
5405 93640.341997594893,
5406 93663.666801726242,
5407 93686.993058075881,
5408 93710.320766463032,
5409 93733.64992670693,
5410 93756.980538626914,
5411 93780.312602042337,
5412 93803.646116772637,
5413 93826.981082637285,
5414 93850.317499455836,
5415 93873.655367047861,
5416 93896.994685233032,
5417 93920.335453831038,
5418 93943.677672661666,
5419 93967.021341544707,
5420 93990.366460300051,
5421 94013.713028747632,
5422 94037.061046707429,
5423 94060.410513999494,
5424 94083.761430443905,
5425 94107.113795860845,
5426 94130.467610070496,
5427 94153.822872893157,
5428 94177.179584149111,
5429 94200.537743658759,
5430 94223.897351242529,
5431 94247.25840672091,
5432 94270.620909914433,
5433 94293.98486064373,
5434 94317.350258729421,
5435 94340.71710399224,
5436 94364.085396252936,
5437 94387.455135332348,
5438 94410.82632105134,
5439 94434.198953230851,
5440 94457.573031691878,
5441 94480.948556255447,
5442 94504.325526742658,
5443 94527.70394297468,
5444 94551.083804772716,
5445 94574.465111958023,
5446 94597.847864351934,
5447 94621.232061775823,
5448 94644.617704051096,
5449 94668.004790999272,
5450 94691.393322441872,
5451 94714.783298200506,
5452 94738.174718096794,
5453 94761.567581952477,
5454 94784.961889589307,
5455 94808.357640829097,
5456 94831.754835493703,
5457 94855.153473405066,
5458 94878.553554385173,
5459 94901.955078256055,
5460 94925.358044839784,
5461 94948.762453958523,
5462 94972.168305434476,
5463 94995.575599089891,
5464 95018.984334747074,
5465 95042.394512228391,
5466 95065.806131356265,
5467 95089.219191953176,
5468 95112.633693841635,
5469 95136.04963684424,
5470 95159.467020783617,
5471 95182.885845482466,
5472 95206.306110763529,
5473 95229.727816449609,
5474 95253.150962363579,
5475 95276.575548328314,
5476 95300.001574166803,
5477 95323.429039702052,
5478 95346.857944757154,
5479 95370.288289155214,
5480 95393.720072719429,
5481 95417.153295273019,
5482 95440.587956639298,
5483 95464.024056641589,
5484 95487.461595103305,
5485 95510.900571847902,
5486 95534.340986698866,
5487 95557.782839479783,
5488 95581.226130014256,
5489 95604.670858125959,
5490 95628.117023638595,
5491 95651.564626375985,
5492 95675.013666161918,
5493 95698.464142820303,
5494 95721.916056175076,
5495 95745.369406050231,
5496 95768.824192269807,
5497 95792.280414657915,
5498 95815.738073038709,
5499 95839.197167236387,
5500 95862.657697075221,
5501 95886.11966237954,
5502 95909.583062973688,
5503 95933.047898682111,
5504 95956.514169329268,
5505 95979.981874739708,
5506 96003.451014738006,
5507 96026.921589148798,
5508 96050.393597796792,
5509 96073.867040506724,
5510 96097.341917103375,
5511 96120.818227411626,
5512 96144.295971256375,
5513 96167.775148462577,
5514 96191.255758855244,
5515 96214.737802259449,
5516 96238.221278500292,
5517 96261.70618740299,
5518 96285.192528792715,
5519 96308.680302494788,
5520 96332.169508334526,
5521 96355.660146137321,
5522 96379.152215728609,
5523 96402.645716933868,
5524 96426.14064957868,
5525 96449.637013488609,
5526 96473.134808489311,
5527 96496.63403440651,
5528 96520.134691065963,
5529 96543.636778293469,
5530 96567.140295914898,
5531 96590.645243756153,
5532 96614.151621643221,
5533 96637.659429402134,
5534 96661.168666858954,
5535 96684.679333839798,
5536 96708.191430170875,
5537 96731.70495567839,
5538 96755.219910188665,
5539 96778.736293528011,
5540 96802.254105522836,
5541 96825.77334599958,
5542 96849.29401478474,
5543 96872.816111704873,
5544 96896.339636586577,
5545 96919.864589256511,
5546 96943.390969541389,
5547 96966.918777267958,
5548 96990.448012263048,
5549 97013.978674353522,
5550 97037.510763366285,
5551 97061.044279128328,
5552 97084.579221466673,
5553 97108.115590208385,
5554 97131.653385180587,
5555 97155.19260621049,
5556 97178.733253125291,
5557 97202.2753257523,
5558 97225.81882391886,
5559 97249.363747452342,
5560 97272.910096180189,
5561 97296.457869929916,
5562 97320.007068529041,
5563 97343.557691805196,
5564 97367.109739586012,
5565 97390.663211699197,
5566 97414.218107972498,
5567 97437.774428233737,
5568 97461.332172310766,
5569 97484.891340031507,
5570 97508.451931223899,
5571 97532.013945715982,
5572 97555.577383335811,
5573 97579.142243911512,
5574 97602.708527271257,
5575 97626.276233243261,
5576 97649.845361655811,
5577 97673.415912337223,
5578 97696.987885115886,
5579 97720.561279820206,
5580 97744.1360962787,
5581 97767.712334319876,
5582 97791.289993772341,
5583 97814.869074464703,
5584 97838.449576225685,
5585 97862.031498883996,
5586 97885.614842268449,
5587 97909.199606207883,
5588 97932.785790531183,
5589 97956.37339506732,
5590 97979.962419645264,
5591 98003.552864094076,
5592 98027.144728242856,
5593 98050.738011920766,
5594 98074.332714956996,
5595 98097.928837180807,
5596 98121.526378421506,
5597 98145.125338508456,
5598 98168.725717271067,
5599 98192.327514538789,
5600 98215.930730141132,
5601 98239.535363907664,
5602 98263.141415668011,
5603 98286.748885251814,
5604 98310.357772488816,
5605 98333.968077208759,
5606 98357.579799241488,
5607 98381.192938416847,
5608 98404.807494564782,
5609 98428.42346751524,
5610 98452.040857098269,
5611 98475.659663143917,
5612 98499.27988548232,
5613 98522.901523943656,
5614 98546.524578358163,
5615 98570.149048556093,
5616 98593.774934367786,
5617 98617.402235623624,
5618 98641.030952154048,
5619 98664.661083789513,
5620 98688.292630360564,
5621 98711.925591697771,
5622 98735.559967631794,
5623 98759.195757993293,
5624 98782.832962613014,
5625 98806.471581321734,
5626 98830.111613950285,
5627 98853.753060329575,
5628 98877.39592029051,
5629 98901.040193664099,
5630 98924.68588028138,
5631 98948.33297997342,
5632 98971.981492571387,
5633 98995.63141790645,
5634 99019.282755809851,
5635 99042.935506112874,
5636 99066.589668646877,
5637 99090.245243243233,
5638 99113.902229733401,
5639 99137.560627948857,
5640 99161.220437721131,
5641 99184.881658881859,
5642 99208.544291262631,
5643 99232.208334695169,
5644 99255.87378901121,
5645 99279.540654042547,
5646 99303.208929621018,
5647 99326.878615578535,
5648 99350.549711746993,
5649 99374.222217958435,
5650 99397.896134044888,
5651 99421.571459838422,
5652 99445.248195171211,
5653 99468.926339875441,
5654 99492.605893783344,
5655 99516.286856727209,
5656 99539.969228539398,
5657 99563.653009052287,
5658 99587.338198098325,
5659 99611.024795510006,
5660 99634.712801119866,
5661 99658.402214760499,
5662 99682.093036264545,
5663 99705.785265464699,
5664 99729.478902193689,
5665 99753.173946284325,
5666 99776.870397569437,
5667 99800.56825588191,
5668 99824.267521054688,
5669 99847.968192920773,
5670 99871.670271313182,
5671 99895.373756065004,
5672 99919.078647009388,
5673 99942.78494397951,
5674 99966.492646808634,
5675 99990.20175533001,
5676 100013.91226937699,
5677 100037.62418878295,
5678 100061.33751338134,
5679 100085.05224300563,
5680 100108.76837748935,
5681 100132.4859166661,
5682 100156.2048603695,
5683 100179.92520843323,
5684 100203.64696069101,
5685 100227.37011697664,
5686 100251.09467712394,
5687 100274.82064096678,
5688 100298.54800833909,
5689 100322.27677907483,
5690 100346.00695300807,
5691 100369.73852997283,
5692 100393.47150980328,
5693 100417.20589233354,
5694 100440.94167739789,
5695 100464.67886483055,
5696 100488.41745446586,
5697 100512.1574461382,
5698 100535.89883968196,
5699 100559.64163493161,
5700 100583.38583172169,
5701 100607.13142988674,
5702 100630.87842926137,
5703 100654.62682968024,
5704 100678.37663097809,
5705 100702.12783298964,
5706 100725.88043554971,
5707 100749.63443849317,
5708 100773.38984165489,
5709 100797.14664486986,
5710 100820.90484797307,
5711 100844.66445079957,
5712 100868.42545318443,
5713 100892.18785496285,
5714 100915.95165596998,
5715 100939.71685604109,
5716 100963.48345501146,
5717 100987.25145271645,
5718 101011.02084899142,
5719 101034.79164367182,
5720 101058.56383659317,
5721 101082.33742759094,
5722 101106.11241650078,
5723 101129.88880315828,
5724 101153.66658739912,
5725 101177.44576905905,
5726 101201.22634797383,
5727 101225.00832397929,
5728 101248.7916969113,
5729 101272.57646660579,
5730 101296.36263289873,
5731 101320.15019562612,
5732 101343.93915462404,
5733 101367.7295097286,
5734 101391.52126077596,
5735 101415.31440760233,
5736 101439.10895004397,
5737 101462.9048879372,
5738 101486.70222111834,
5739 101510.50094942382,
5740 101534.30107269008,
5741 101558.10259075361,
5742 101581.90550345098,
5743 101605.70981061876,
5744 101629.5155120936,
5745 101653.32260771218,
5746 101677.13109731126,
5747 101700.9409807276,
5748 101724.75225779804,
5749 101748.56492835947,
5750 101772.37899224881,
5751 101796.19444930303,
5752 101820.01129935916,
5753 101843.82954225427,
5754 101867.64917782549,
5755 101891.47020590997,
5756 101915.29262634492,
5757 101939.11643896763,
5758 101962.94164361537,
5759 101986.76824012553,
5760 102010.59622833549,
5761 102034.42560808272,
5762 102058.25637920471,
5763 102082.08854153901,
5764 102105.9220949232,
5765 102129.75703919494,
5766 102153.59337419191,
5767 102177.43109975185,
5768 102201.27021571253,
5769 102225.1107219118,
5770 102248.95261818753,
5771 102272.79590437764,
5772 102296.64058032009,
5773 102320.48664585294,
5774 102344.33410081422,
5775 102368.18294504205,
5776 102392.03317837461,
5777 102415.88480065008,
5778 102439.73781170673,
5779 102463.59221138287,
5780 102487.44799951684,
5781 102511.30517594704,
5782 102535.1637405119,
5783 102559.02369304992,
5784 102582.88503339965,
5785 102606.74776139967,
5786 102630.61187688859,
5787 102654.4773797051,
5788 102678.34426968795,
5789 102702.21254667587,
5790 102726.08221050771,
5791 102749.95326102231,
5792 102773.8256980586,
5793 102797.69952145554,
5794 102821.57473105213,
5795 102845.45132668741,
5796 102869.32930820051,
5797 102893.20867543056,
5798 102917.08942821674,
5799 102940.97156639832,
5800 102964.85508981455,
5801 102988.73999830478,
5802 103012.6262917084,
5803 103036.51396986481,
5804 103060.40303261351,
5805 103084.293479794,
5806 103108.18531124585,
5807 103132.07852680866,
5808 103155.97312632212,
5809 103179.8691096259,
5810 103203.76647655977,
5811 103227.66522696352,
5812 103251.56536067701,
5813 103275.46687754011,
5814 103299.36977739276,
5815 103323.27406007495,
5816 103347.1797254267,
5817 103371.0867732881,
5818 103394.99520349925,
5819 103418.90501590034,
5820 103442.81621033157,
5821 103466.72878663319,
5822 103490.64274464553,
5823 103514.55808420894,
5824 103538.4748051638,
5825 103562.39290735057,
5826 103586.31239060973,
5827 103610.23325478184,
5828 103634.15549970744,
5829 103658.07912522719,
5830 103682.00413118176,
5831 103705.93051741188,
5832 103729.85828375829,
5833 103753.78743006183,
5834 103777.71795616332,
5835 103801.64986190372,
5836 103825.58314712394,
5837 103849.51781166498,
5838 103873.4538553679,
5839 103897.39127807376,
5840 103921.33007962372,
5841 103945.27025985894,
5842 103969.21181862066,
5843 103993.15475575015,
5844 104017.0990710887,
5845 104041.0447644777,
5846 104064.99183575854,
5847 104088.94028477269,
5848 104112.89011136163,
5849 104136.84131536692,
5850 104160.79389663014,
5851 104184.74785499295,
5852 104208.70319029699,
5853 104232.65990238401,
5854 104256.61799109577,
5855 104280.57745627411,
5856 104304.53829776087,
5857 104328.50051539797,
5858 104352.46410902737,
5859 104376.42907849104,
5860 104400.39542363105,
5861 104424.36314428948,
5862 104448.33224030846,
5863 104472.3027115302,
5864 104496.27455779689,
5865 104520.24777895081,
5866 104544.22237483428,
5867 104568.19834528965,
5868 104592.17569015936,
5869 104616.15440928582,
5870 104640.13450251156,
5871 104664.1159696791,
5872 104688.09881063103,
5873 104712.08302520998,
5874 104736.06861325864,
5875 104760.05557461972,
5876 104784.043909136,
5877 104808.03361665027,
5878 104832.0246970054,
5879 104856.01715004431,
5880 104880.01097560991,
5881 104904.00617354522,
5882 104928.00274369326,
5883 104952.00068589712,
5884 104975.99999999993,
5885 105000.00068584486,
5886 105024.00274327511,
5887 105048.00617213396,
5888 105072.0109722647,
5889 105096.0171435107,
5890 105120.02468571534,
5891 105144.03359872208,
5892 105168.04388237436,
5893 105192.05553651576,
5894 105216.06856098982,
5895 105240.08295564017,
5896 105264.09872031047,
5897 105288.11585484444,
5898 105312.13435908582,
5899 105336.1542328784,
5900 105360.17547606604,
5901 105384.19808849262,
5902 105408.22207000206,
5903 105432.24742043833,
5904 105456.27413964548,
5905 105480.30222746753,
5906 105504.33168374863,
5907 105528.36250833291,
5908 105552.39470106458,
5909 105576.42826178786,
5910 105600.46319034706,
5911 105624.49948658649,
5912 105648.53715035053,
5913 105672.5761814836,
5914 105696.61657983017,
5915 105720.65834523473,
5916 105744.70147754184,
5917 105768.7459765961,
5918 105792.79184224214,
5919 105816.83907432464,
5920 105840.88767268835,
5921 105864.93763717801,
5922 105888.98896763846,
5923 105913.04166391456,
5924 105937.09572585119,
5925 105961.15115329332,
5926 105985.20794608595,
5927 106009.26610407409,
5928 106033.32562710284,
5929 106057.38651501729,
5930 106081.44876766266,
5931 106105.51238488412,
5932 106129.57736652695,
5933 106153.64371243643,
5934 106177.71142245791,
5935 106201.78049643678,
5936 106225.85093421848,
5937 106249.92273564848,
5938 106273.99590057228,
5939 106298.07042883546,
5940 106322.14632028362,
5941 106346.22357476239,
5942 106370.30219211751,
5943 106394.38217219469,
5944 106418.46351483969,
5945 106442.54621989837,
5946 106466.63028721658,
5947 106490.71571664025,
5948 106514.80250801529,
5949 106538.89066118775,
5950 106562.98017600364,
5951 106587.07105230905,
5952 106611.16328995011,
5953 106635.25688877302,
5954 106659.35184862395,
5955 106683.44816934918,
5956 106707.54585079502,
5957 106731.64489280782,
5958 106755.74529523395,
5959 106779.84705791986,
5960 106803.95018071201,
5961 106828.05466345693,
5962 106852.16050600118,
5963 106876.26770819137,
5964 106900.37626987413,
5965 106924.48619089619,
5966 106948.59747110425,
5967 106972.71011034511,
5968 106996.82410846559,
5969 107020.93946531253,
5970 107045.05618073288,
5971 107069.17425457356,
5972 107093.29368668159,
5973 107117.41447690397,
5974 107141.53662508781,
5975 107165.66013108024,
5976 107189.7849947284,
5977 107213.91121587952,
5978 107238.03879438085,
5979 107262.16773007967,
5980 107286.29802282334,
5981 107310.42967245923,
5982 107334.56267883476,
5983 107358.69704179741,
5984 107382.83276119467,
5985 107406.96983687414,
5986 107431.10826868335,
5987 107455.24805646999,
5988 107479.38920008171,
5989 107503.53169936626,
5990 107527.67555417139,
5991 107551.82076434491,
5992 107575.96732973469,
5993 107600.11525018861,
5994 107624.26452555459,
5995 107648.41515568066,
5996 107672.56714041479,
5997 107696.72047960508,
5998 107720.87517309963,
5999 107745.03122074658,
6000 107769.18862239413,
6001 107793.34737789053,
6002 107817.50748708403,
6003 107841.66894982298,
6004 107865.83176595572,
6005 107889.99593533068,
6006 107914.16145779629,
6007 107938.32833320105,
6008 107962.49656139348,
6009 107986.66614222217,
6010 108010.83707553572,
6011 108035.00936118282,
6012 108059.18299901215,
6013 108083.35798887245,
6014 108107.53433061253,
6015 108131.71202408121,
6016 108155.89106912735,
6017 108180.07146559987,
6018 108204.25321334775,
6019 108228.43631221994,
6020 108252.62076206553,
6021 108276.80656273357,
6022 108300.99371407321,
6023 108325.18221593359,
6024 108349.37206816394,
6025 108373.56327061349,
6026 108397.75582313156,
6027 108421.94972556747,
6028 108446.1449777706,
6029 108470.34157959036,
6030 108494.53953087622,
6031 108518.73883147769,
6032 108542.93948124432,
6033 108567.14148002568,
6034 108591.34482767139,
6035 108615.54952403114,
6036 108639.75556895464,
6037 108663.96296229165,
6038 108688.17170389196,
6039 108712.38179360541,
6040 108736.59323128188,
6041 108760.80601677128,
6042 108785.02014992358,
6043 108809.23563058881,
6044 108833.45245861699,
6045 108857.67063385822,
6046 108881.89015616261,
6047 108906.11102538036,
6048 108930.33324136167,
6049 108954.55680395682,
6050 108978.78171301607,
6051 109003.00796838976,
6052 109027.23556992831,
6053 109051.46451748211,
6054 109075.69481090162,
6055 109099.92645003737,
6056 109124.15943473989,
6057 109148.39376485976,
6058 109172.62944024763,
6059 109196.86646075416,
6060 109221.10482623006,
6061 109245.34453652608,
6062 109269.58559149304,
6063 109293.82799098175,
6064 109318.07173484311,
6065 109342.31682292801,
6066 109366.56325508743,
6067 109390.81103117237,
6068 109415.06015103387,
6069 109439.31061452301,
6070 109463.56242149093,
6071 109487.8155717888,
6072 109512.07006526781,
6073 109536.3259017792,
6074 109560.58308117429,
6075 109584.8416033044,
6076 109609.1014680209,
6077 109633.36267517522,
6078 109657.62522461878,
6079 109681.88911620311,
6080 109706.15434977971,
6081 109730.4209252002,
6082 109754.68884231619,
6083 109778.95810097932,
6084 109803.22870104131,
6085 109827.50064235389,
6086 109851.77392476884,
6087 109876.04854813802,
6088 109900.32451231324,
6089 109924.60181714644,
6090 109948.88046248957,
6091 109973.1604481946,
6092 109997.44177411357,
6093 110021.72444009855,
6094 110046.00844600165,
6095 110070.29379167501,
6096 110094.58047697082,
6097 110118.86850174134,
6098 110143.15786583882,
6099 110167.44856911557,
6100 110191.74061142397,
6101 110216.03399261639,
6102 110240.32871254528,
6103 110264.62477106311,
6104 110288.9221680224,
6105 110313.22090327571,
6106 110337.52097667565,
6107 110361.82238807483,
6108 110386.12513732594,
6109 110410.42922428172,
6110 110434.73464879491,
6111 110459.04141071832,
6112 110483.34950990479,
6113 110507.6589462072,
6114 110531.96971947847,
6115 110556.28182957157,
6116 110580.5952763395,
6117 110604.91005963532,
6118 110629.22617931209,
6119 110653.54363522294,
6120 110677.86242722106,
6121 110702.18255515963,
6122 110726.50401889188,
6123 110750.82681827113,
6124 110775.1509531507,
6125 110799.47642338395,
6126 110823.80322882428,
6127 110848.13136932514,
6128 110872.46084474004,
6129 110896.79165492248,
6130 110921.12379972603,
6131 110945.4572790043,
6132 110969.79209261097,
6133 110994.12824039967,
6134 111018.46572222417,
6135 111042.80453793822,
6136 111067.14468739564,
6137 111091.48617045028,
6138 111115.82898695602,
6139 111140.1731367668,
6140 111164.51861973655,
6141 111188.86543571933,
6142 111213.21358456917,
6143 111237.56306614014,
6144 111261.91388028639,
6145 111286.26602686207,
6146 111310.61950572141,
6147 111334.97431671864,
6148 111359.33045970804,
6149 111383.68793454397,
6150 111408.04674108078,
6151 111432.40687917286,
6152 111456.76834867468,
6153 111481.13114944073,
6154 111505.49528132551,
6155 111529.86074418361,
6156 111554.22753786964,
6157 111578.59566223821,
6158 111602.96511714405,
6159 111627.33590244185,
6160 111651.7080179864,
6161 111676.08146363248,
6162 111700.45623923496,
6163 111724.8323446487,
6164 111749.20977972864,
6165 111773.58854432974,
6166 111797.96863830699,
6167 111822.35006151545,
6168 111846.73281381019,
6169 111871.11689504632,
6170 111895.50230507903,
6171 111919.8890437635,
6172 111944.27711095495,
6173 111968.6665065087,
6174 111993.05723028004,
6175 112017.44928212435,
6176 112041.842661897,
6177 112066.23736945343,
6178 112090.63340464912,
6179 112115.03076733962,
6180 112139.42945738042,
6181 112163.82947462716,
6182 112188.23081893545,
6183 112212.63349016097,
6184 112237.03748815943,
6185 112261.44281278658,
6186 112285.84946389822,
6187 112310.25744135017,
6188 112334.66674499828,
6189 112359.07737469849,
6190 112383.48933030672,
6191 112407.90261167898,
6192 112432.31721867126,
6193 112456.73315113965,
6194 112481.15040894024,
6195 112505.56899192919,
6196 112529.98889996267,
6197 112554.41013289688,
6198 112578.8326905881,
6199 112603.25657289263,
6200 112627.68177966679,
6201 112652.10831076698,
6202 112676.53616604958,
6203 112700.96534537108,
6204 112725.39584858794,
6205 112749.82767555672,
6206 112774.26082613398,
6207 112798.6953001763,
6208 112823.13109754038,
6209 112847.56821808286,
6210 112872.00666166049,
6211 112896.44642813003,
6212 112920.88751734827,
6213 112945.32992917208,
6214 112969.77366345831,
6215 112994.21872006389,
6216 113018.66509884578,
6217 113043.11279966099,
6218 113067.56182236652,
6219 113092.01216681948,
6220 113116.46383287695,
6221 113140.9168203961,
6222 113165.37112923413,
6223 113189.82675924824,
6224 113214.28371029573,
6225 113238.74198223387,
6226 113263.20157492002,
6227 113287.66248821157,
6228 113312.12472196593,
6229 113336.58827604055,
6230 113361.05315029295,
6231 113385.51934458067,
6232 113409.98685876124,
6233 113434.45569269233,
6234 113458.92584623155,
6235 113483.39731923661,
6236 113507.87011156522,
6237 113532.34422307517,
6238 113556.81965362425,
6239 113581.2964030703,
6240 113605.77447127122,
6241 113630.25385808491,
6242 113654.73456336933,
6243 113679.2165869825,
6244 113703.69992878241,
6245 113728.18458862718,
6246 113752.67056637487,
6247 113777.15786188368,
6248 113801.64647501177,
6249 113826.13640561736,
6250 113850.62765355874,
6251 113875.12021869418,
6252 113899.61410088204,
6253 113924.1092999807,
6254 113948.60581584855,
6255 113973.10364834407,
6256 113997.60279732574,
6257 114022.1032626521,
6258 114046.60504418171,
6259 114071.10814177318,
6260 114095.61255528514,
6261 114120.11828457628,
6262 114144.62532950533,
6263 114169.13368993104,
6264 114193.6433657122,
6265 114218.15435670764,
6266 114242.66666277625,
6267 114267.18028377694,
6268 114291.69521956862,
6269 114316.21147001031,
6270 114340.72903496103,
6271 114365.24791427983,
6272 114389.7681078258,
6273 114414.2896154581,
6274 114438.81243703589,
6275 114463.33657241837,
6276 114487.8620214648,
6277 114512.38878403447,
6278 114536.91685998671,
6279 114561.44624918087,
6280 114585.97695147636,
6281 114610.5089667326,
6282 114635.04229480909,
6283 114659.57693556532,
6284 114684.11288886084,
6285 114708.65015455526,
6286 114733.18873250818,
6287 114757.72862257928,
6288 114782.26982462825,
6289 114806.81233851484,
6290 114831.35616409882,
6291 114855.90130123998,
6292 114880.44774979822,
6293 114904.99550963337,
6294 114929.5445806054,
6295 114954.09496257425,
6296 114978.64665539992,
6297 115003.19965894247,
6298 115027.75397306195,
6299 115052.30959761847,
6300 115076.86653247218,
6301 115101.42477748329,
6302 115125.984332512,
6303 115150.54519741859,
6304 115175.10737206334,
6305 115199.67085630659,
6306 115224.23565000873,
6307 115248.80175303014,
6308 115273.3691652313,
6309 115297.93788647266,
6310 115322.50791661476,
6311 115347.07925551817,
6312 115371.65190304347,
6313 115396.22585905129,
6314 115420.80112340231,
6315 115445.37769595724,
6316 115469.95557657682,
6317 115494.53476512182,
6318 115519.11526145306,
6319 115543.69706543141,
6320 115568.28017691776,
6321 115592.86459577303,
6322 115617.4503218582,
6323 115642.03735503425,
6324 115666.62569516223,
6325 115691.21534210323,
6326 115715.80629571836,
6327 115740.39855586876,
6328 115764.99212241563,
6329 115789.58699522018,
6330 115814.18317414368,
6331 115838.78065904744,
6332 115863.37944979276,
6333 115887.97954624105,
6334 115912.5809482537,
6335 115937.18365569216,
6336 115961.78766841792,
6337 115986.39298629249,
6338 116010.99960917742,
6339 116035.60753693432,
6340 116060.21676942479,
6341 116084.82730651053,
6342 116109.43914805322,
6343 116134.0522939146,
6344 116158.66674395646,
6345 116183.2824980406,
6346 116207.89955602887,
6347 116232.51791778316,
6348 116257.13758316539,
6349 116281.75855203751,
6350 116306.38082426153,
6351 116331.00439969949,
6352 116355.62927821343,
6353 116380.25545966547,
6354 116404.88294391775,
6355 116429.51173083246,
6356 116454.14182027178,
6357 116478.77321209799,
6358 116503.40590617337,
6359 116528.03990236025,
6360 116552.67520052097,
6361 116577.31180051794,
6362 116601.94970221359,
6363 116626.5889054704,
6364 116651.22941015086,
6365 116675.87121611751,
6366 116700.51432323294,
6367 116725.15873135976,
6368 116749.8044403606,
6369 116774.45145009817,
6370 116799.0997604352,
6371 116823.74937123443,
6372 116848.40028235866,
6373 116873.05249367072,
6374 116897.70600503348,
6375 116922.36081630984,
6376 116947.01692736275,
6377 116971.67433805518,
6378 116996.33304825013,
6379 117020.99305781067,
6380 117045.65436659988,
6381 117070.31697448085,
6382 117094.98088131678,
6383 117119.64608697082,
6384 117144.31259130624,
6385 117168.98039418629,
6386 117193.64949547425,
6387 117218.31989503348,
6388 117242.99159272734,
6389 117267.66458841923,
6390 117292.33888197262,
6391 117317.01447325097,
6392 117341.6913621178,
6393 117366.36954843666,
6394 117391.04903207115,
6395 117415.72981288488,
6396 117440.41189074152,
6397 117465.09526550474,
6398 117489.77993703831,
6399 117514.46590520597,
6400 117539.15316987153,
6401 117563.84173089883,
6402 117588.53158815173,
6403 117613.22274149416,
6404 117637.91519079007,
6405 117662.60893590341,
6406 117687.30397669821,
6407 117712.00031303853,
6408 117736.69794478847,
6409 117761.39687181212,
6410 117786.09709397367,
6411 117810.7986111373,
6412 117835.50142316725,
6413 117860.20552992777,
6414 117884.91093128319,
6415 117909.6176270978,
6416 117934.32561723603,
6417 117959.03490156225,
6418 117983.74547994092,
6419 118008.45735223651,
6420 118033.17051831353,
6421 118057.88497803656,
6422 118082.60073127014,
6423 118107.31777787894,
6424 118132.03611772758,
6425 118156.75575068076,
6426 118181.47667660323,
6427 118206.19889535972,
6428 118230.92240681504,
6429 118255.64721083404,
6430 118280.37330728157,
6431 118305.10069602253,
6432 118329.82937692189,
6433 118354.55934984458,
6434 118379.29061465565,
6435 118404.02317122012,
6436 118428.75701940308,
6437 118453.49215906965,
6438 118478.22859008498,
6439 118502.96631231424,
6440 118527.70532562268,
6441 118552.44562987552,
6442 118577.18722493808,
6443 118601.93011067568,
6444 118626.67428695368,
6445 118651.41975363747,
6446 118676.16651059251,
6447 118700.91455768423,
6448 118725.66389477813,
6449 118750.41452173979,
6450 118775.16643843475,
6451 118799.91964472862,
6452 118824.67414048707,
6453 118849.42992557574,
6454 118874.18699986035,
6455 118898.94536320666,
6456 118923.70501548045,
6457 118948.46595654752,
6458 118973.22818627374,
6459 118997.99170452499,
6460 119022.7565111672,
6461 119047.52260606633,
6462 119072.28998908834,
6463 119097.0586600993,
6464 119121.82861896523,
6465 119146.59986555226,
6466 119171.3723997265,
6467 119196.14622135412,
6468 119220.92133030134,
6469 119245.69772643436,
6470 119270.47540961947,
6471 119295.25437972297,
6472 119320.03463661121,
6473 119344.81618015055,
6474 119369.5990102074,
6475 119394.38312664822,
6476 119419.16852933947,
6477 119443.95521814766,
6478 119468.74319293935,
6479 119493.53245358112,
6480 119518.32299993958,
6481 119543.11483188139,
6482 119567.90794927324,
6483 119592.70235198183,
6484 119617.49803987393,
6485 119642.29501281632,
6486 119667.09327067583,
6487 119691.89281331931,
6488 119716.69364061367,
6489 119741.49575242582,
6490 119766.29914862274,
6491 119791.10382907141,
6492 119815.90979363887,
6493 119840.71704219218,
6494 119865.52557459843,
6495 119890.33539072477,
6496 119915.14649043836,
6497 119939.95887360642,
6498 119964.77254009615,
6499 119989.58748977486,
6500 120014.40372250983,
6501 120039.22123816841,
6502 120064.04003661797,
6503 120088.86011772591,
6504 120113.6814813597,
6505 120138.5041273868,
6506 120163.3280556747,
6507 120188.15326609099,
6508 120212.97975850321,
6509 120237.807532779,
6510 120262.63658878599,
6511 120287.46692639188,
6512 120312.29854546436,
6513 120337.13144587121,
6514 120361.9656274802,
6515 120386.80109015915,
6516 120411.63783377589,
6517 120436.47585819835,
6518 120461.31516329442,
6519 120486.15574893207,
6520 120510.99761497928,
6521 120535.84076130406,
6522 120560.68518777451,
6523 120585.53089425867,
6524 120610.3778806247,
6525 120635.22614674074,
6526 120660.07569247499,
6527 120684.92651769568,
6528 120709.77862227106,
6529 120734.63200606944,
6530 120759.48666895913,
6531 120784.3426108085,
6532 120809.19983148595,
6533 120834.05833085992,
6534 120858.91810879884,
6535 120883.77916517125,
6536 120908.64149984565,
6537 120933.5051126906,
6538 120958.37000357473,
6539 120983.23617236665,
6540 121008.10361893504,
6541 121032.97234314861,
6542 121057.84234487606,
6543 121082.71362398617,
6544 121107.58618034775,
6545 121132.46001382964,
6546 121157.33512430069,
6547 121182.21151162982,
6548 121207.08917568595,
6549 121231.96811633807,
6550 121256.84833345517,
6551 121281.72982690629,
6552 121306.61259656049,
6553 121331.49664228689,
6554 121356.38196395461,
6555 121381.26856143285,
6556 121406.15643459078,
6557 121431.04558329767,
6558 121455.93600742276,
6559 121480.82770683538,
6560 121505.72068140487,
6561 121530.61493100057,
6562 121555.51045549192,
6563 121580.40725474835,
6564 121605.30532863933,
6565 121630.20467703436,
6566 121655.10529980299,
6567 121680.00719681478,
6568 121704.91036793934,
6569 121729.81481304632,
6570 121754.72053200539,
6571 121779.62752468624,
6572 121804.53579095862,
6573 121829.44533069231,
6574 121854.3561437571,
6575 121879.26823002285,
6576 121904.1815893594,
6577 121929.09622163669,
6578 121954.01212672464,
6579 121978.92930449323,
6580 122003.84775481246,
6581 122028.76747755238,
6582 122053.68847258303,
6583 122078.61073977455,
6584 122103.53427899707,
6585 122128.45909012076,
6586 122153.38517301581,
6587 122178.31252755247,
6588 122203.24115360099,
6589 122228.17105103172,
6590 122253.10221971494,
6591 122278.03465952107,
6592 122302.96837032049,
6593 122327.90335198362,
6594 122352.83960438096,
6595 122377.777127383,
6596 122402.71592086025,
6597 122427.65598468333,
6598 122452.59731872278,
6599 122477.53992284928,
6600 122502.48379693348,
6601 122527.42894084606,
6602 122552.37535445779,
6603 122577.32303763942,
6604 122602.27199026172,
6605 122627.22221219557,
6606 122652.17370331181,
6607 122677.12646348133,
6608 122702.08049257506,
6609 122727.03579046397,
6610 122751.99235701906,
6611 122776.95019211136,
6612 122801.9092956119,
6613 122826.8696673918,
6614 122851.83130732219,
6615 122876.79421527422,
6616 122901.75839111909,
6617 122926.72383472799,
6618 122951.69054597223,
6619 122976.65852472307,
6620 123001.62777085182,
6621 123026.59828422987,
6622 123051.57006472857,
6623 123076.54311221937,
6624 123101.5174265737,
6625 123126.49300766307,
6626 123151.46985535898,
6627 123176.44796953299,
6628 123201.42735005668,
6629 123226.40799680166,
6630 123251.38990963959,
6631 123276.37308844214,
6632 123301.35753308103,
6633 123326.343243428,
6634 123351.33021935483,
6635 123376.31846073334,
6636 123401.30796743535,
6637 123426.29873933276,
6638 123451.29077629748,
6639 123476.28407820144,
6640 123501.2786449166,
6641 123526.27447631498,
6642 123551.27157226863,
6643 123576.26993264959,
6644 123601.26955732999,
6645 123626.27044618195,
6646 123651.27259907764,
6647 123676.27601588926,
6648 123701.28069648903,
6649 123726.28664074924,
6650 123751.29384854218,
6651 123776.30231974016,
6652 123801.31205421555,
6653 123826.32305184075,
6654 123851.33531248817,
6655 123876.34883603029,
6656 123901.36362233957,
6657 123926.37967128855,
6658 123951.39698274979,
6659 123976.41555659588,
6660 124001.43539269941,
6661 124026.45649093305,
6662 124051.47885116948,
6663 124076.50247328142,
6664 124101.5273571416,
6665 124126.55350262282,
6666 124151.58090959788,
6667 124176.60957793961,
6668 124201.63950752091,
6669 124226.67069821467,
6670 124251.70314989384,
6671 124276.73686243138,
6672 124301.7718357003,
6673 124326.80806957364,
6674 124351.84556392446,
6675 124376.88431862585,
6676 124401.92433355095,
6677 124426.96560857294,
6678 124452.00814356498,
6679 124477.05193840031,
6680 124502.0969929522,
6681 124527.14330709392,
6682 124552.19088069882,
6683 124577.23971364023,
6684 124602.28980579154,
6685 124627.34115702618,
6686 124652.3937672176,
6687 124677.44763623926,
6688 124702.50276396469,
6689 124727.55915026742,
6690 124752.61679502104,
6691 124777.67569809916,
6692 124802.73585937542,
6693 124827.79727872348,
6694 124852.85995601704,
6695 124877.92389112986,
6696 124902.98908393568,
6697 124928.05553430831,
6698 124953.1232421216,
6699 124978.19220724938,
6700 125003.26242956554,
6701 125028.33390894404,
6702 125053.40664525882,
6703 125078.48063838384,
6704 125103.55588819318,
6705 125128.63239456083,
6706 125153.71015736091,
6707 125178.78917646752,
6708 125203.86945175481,
6709 125228.95098309696,
6710 125254.03377036817,
6711 125279.1178134427,
6712 125304.20311219479,
6713 125329.28966649878,
6714 125354.37747622898,
6715 125379.46654125977,
6716 125404.55686146552,
6717 125429.6484367207,
6718 125454.74126689974,
6719 125479.83535187715,
6720 125504.93069152744,
6721 125530.02728572517,
6722 125555.12513434493,
6723 125580.22423726133,
6724 125605.32459434902,
6725 125630.4262054827,
6726 125655.52907053704,
6727 125680.63318938682,
6728 125705.73856190679,
6729 125730.84518797178,
6730 125755.9530674566,
6731 125781.06220023613,
6732 125806.17258618528,
6733 125831.28422517896,
6734 125856.39711709213,
6735 125881.51126179981,
6736 125906.62665917698,
6737 125931.74330909875,
6738 125956.86121144016,
6739 125981.98036607634,
6740 126007.10077288245,
6741 126032.22243173365,
6742 126057.34534250517,
6743 126082.46950507225,
6744 126107.59491931014,
6745 126132.72158509417,
6746 126157.84950229966,
6747 126182.97867080198,
6748 126208.10909047653,
6749 126233.24076119871,
6750 126258.37368284403,
6751 126283.50785528794,
6752 126308.64327840599,
6753 126333.77995207369,
6754 126358.91787616667,
6755 126384.0570505605,
6756 126409.19747513086,
6757 126434.3391497534,
6758 126459.48207430386,
6759 126484.62624865794,
6760 126509.77167269142,
6761 126534.9183462801,
6762 126560.06626929982,
6763 126585.21544162642,
6764 126610.36586313581,
6765 126635.51753370393,
6766 126660.67045320668,
6767 126685.82462152008,
6768 126710.98003852014,
6769 126736.13670408291,
6770 126761.29461808444,
6771 126786.45378040087,
6772 126811.61419090834,
6773 126836.77584948298,
6774 126861.93875600102,
6775 126887.10291033868,
6776 126912.26831237224,
6777 126937.43496197795,
6778 126962.60285903217,
6779 126987.77200341123,
6780 127012.94239499152,
6781 127038.11403364947,
6782 127063.2869192615,
6783 127088.46105170409,
6784 127113.63643085376,
6785 127138.81305658702,
6786 127163.99092878048,
6787 127189.17004731069,
6788 127214.35041205429,
6789 127239.53202288797,
6790 127264.71487968838,
6791 127289.89898233226,
6792 127315.08433069635,
6793 127340.27092465744,
6794 127365.45876409234,
6795 127390.64784887788,
6796 127415.83817889093,
6797 127441.02975400841,
6798 127466.22257410725,
6799 127491.41663906439,
6800 127516.61194875685,
6801 127541.80850306165,
6802 127567.00630185583,
6803 127592.20534501647,
6804 127617.4056324207,
6805 127642.60716394568,
6806 127667.80993946856,
6807 127693.01395886653,
6808 127718.21922201688,
6809 127743.42572879682,
6810 127768.63347908368,
6811 127793.84247275478,
6812 127819.05270968749,
6813 127844.26418975917,
6814 127869.47691284724,
6815 127894.69087882918,
6816 127919.90608758242,
6817 127945.12253898452,
6818 127970.34023291297,
6819 127995.55916924537,
6820 128020.77934785932,
6821 128046.00076863244,
6822 128071.22343144237,
6823 128096.44733616684,
6824 128121.67248268353,
6825 128146.89887087021,
6826 128172.12650060465,
6827 128197.35537176467,
6828 128222.5854842281,
6829 128247.81683787282,
6830 128273.04943257671,
6831 128298.28326821771,
6832 128323.51834467379,
6833 128348.75466182294,
6834 128373.99221954317,
6835 128399.23101771252,
6836 128424.47105620909,
6837 128449.71233491098,
6838 128474.95485369631,
6839 128500.19861244329,
6840 128525.44361103009,
6841 128550.68984933494,
6842 128575.93732723613,
6843 128601.18604461191,
6844 128626.43600134061,
6845 128651.68719730059,
6846 128676.93963237021,
6847 128702.1933064279,
6848 128727.44821935208,
6849 128752.70437102125,
6850 128777.96176131385,
6851 128803.22039010846,
6852 128828.48025728362,
6853 128853.74136271792,
6854 128879.00370628996,
6855 128904.26728787841,
6856 128929.53210736193,
6857 128954.79816461923,
6858 128980.06545952905,
6859 129005.33399197015,
6860 129030.60376182134,
6861 129055.87476896142,
6862 129081.14701326926,
6863 129106.42049462376,
6864 129131.6952129038,
6865 129156.97116798835,
6866 129182.24835975636,
6867 129207.52678808685,
6868 129232.80645285884,
6869 129258.08735395141,
6870 129283.36949124365,
6871 129308.65286461466,
6872 129333.9374739436,
6873 129359.22331910966,
6874 129384.51039999202,
6875 129409.79871646997,
6876 129435.08826842274,
6877 129460.37905572963,
6878 129485.67107826998,
6879 129510.96433592314,
6880 129536.25882856851,
6881 129561.55455608548,
6882 129586.85151835352,
6883 129612.14971525209,
6884 129637.4491466607,
6885 129662.74981245887,
6886 129688.0517125262,
6887 129713.35484674224,
6888 129738.65921498663,
6889 129763.96481713903,
6890 129789.27165307909,
6891 129814.57972268655,
6892 129839.88902584116,
6893 129865.19956242264,
6894 129890.51133231082,
6895 129915.82433538554,
6896 129941.13857152662,
6897 129966.45404061397,
6898 129991.7707425275,
6899 130017.08867714716,
6900 130042.4078443529,
6901 130067.72824402474,
6902 130093.04987604271,
6903 130118.37274028687,
6904 130143.69683663732,
6905 130169.02216497416,
6906 130194.34872517755,
6907 130219.67651712766,
6908 130245.0055407047,
6909 130270.33579578891,
6910 130295.66728226055,
6911 130320.99999999991,
6912 130346.33394888733,
6913 130371.66912880314,
6914 130397.00553962773,
6915 130422.34318124152,
6916 130447.68205352494,
6917 130473.02215635845,
6918 130498.36348962256,
6919 130523.70605319779,
6920 130549.0498469647,
6921 130574.39487080388,
6922 130599.74112459592,
6923 130625.08860822149,
6924 130650.43732156123,
6925 130675.78726449587,
6926 130701.13843690613,
6927 130726.49083867275,
6928 130751.84446967654,
6929 130777.19932979831,
6930 130802.5554189189,
6931 130827.91273691918,
6932 130853.27128368006,
6933 130878.63105908247,
6934 130903.99206300738,
6935 130929.35429533575,
6936 130954.71775594862,
6937 130980.08244472703,
6938 131005.44836155206,
6939 131030.81550630482,
6940 131056.18387886642,
6941 131081.55347911804,
6942 131106.92430694087,
6943 131132.29636221612,
6944 131157.66964482504,
6945 131183.0441546489,
6946 131208.41989156904,
6947 131233.79685546676,
6948 131259.17504622342,
6949 131284.55446372041,
6950 131309.93510783918,
6951 131335.31697846117,
6952 131360.70007546784,
6953 131386.0843987407,
6954 131411.46994816128,
6955 131436.85672361116,
6956 131462.24472497194,
6957 131487.63395212521,
6958 131513.02440495262,
6959 131538.41608333588,
6960 131563.80898715663,
6961 131589.2031162967,
6962 131614.59847063778,
6963 131639.9950500617,
6964 131665.39285445024,
6965 131690.79188368531,
6966 131716.19213764873,
6967 131741.59361622241,
6968 131766.99631928833,
6969 131792.40024672839,
6970 131817.80539842462,
6971 131843.21177425905,
6972 131868.61937411371,
6973 131894.02819787065,
6974 131919.43824541202,
6975 131944.84951661993,
6976 131970.26201137656,
6977 131995.67572956407,
6978 132021.09067106468,
6979 132046.50683576067,
6980 132071.9242235343,
6981 132097.34283426782,
6982 132122.76266784366,
6983 132148.1837241441,
6984 132173.60600305157,
6985 132199.02950444847,
6986 132224.45422821722,
6987 132249.88017424036,
6988 132275.30734240031,
6989 132300.73573257966,
6990 132326.16534466096,
6991 132351.59617852676,
6992 132377.02823405969,
6993 132402.46151114244,
6994 132427.89600965759,
6995 132453.33172948789,
6996 132478.76867051609,
6997 132504.20683262491,
6998 132529.64621569714,
6999 132555.08681961559,
7000 132580.5286442631,
7001 132605.97168952253,
7002 132631.41595527678,
7003 132656.86144140881,
7004 132682.30814780149,
7005 132707.75607433787,
7006 132733.20522090094,
7007 132758.65558737374,
7008 132784.10717363929,
7009 132809.55997958075,
7010 132835.01400508118,
7011 132860.46925002377,
7012 132885.92571429166,
7013 132911.38339776811,
7014 132936.84230033628,
7015 132962.30242187946,
7016 132987.76376228096,
7017 133013.22632142407,
7018 133038.69009919214,
7019 133064.15509546854,
7020 133089.62131013666,
7021 133115.08874307995,
7022 133140.55739418184,
7023 133166.02726332581,
7024 133191.49835039541,
7025 133216.97065527414,
7026 133242.44417784561,
7027 133267.91891799335,
7028 133293.39487560102,
7029 133318.87205055228,
7030 133344.35044273079,
7031 133369.83005202023,
7032 133395.31087830439,
7033 133420.79292146701,
7034 133446.27618139185,
7035 133471.76065796276,
7036 133497.24635106357,
7037 133522.73326057816,
7038 133548.22138639039,
7039 133573.71072838426,
7040 133599.20128644365,
7041 133624.69306045261,
7042 133650.1860502951,
7043 133675.68025585517,
7044 133701.1756770169,
7045 133726.67231366437,
7046 133752.17016568172,
7047 133777.66923295305,
7048 133803.16951536259,
7049 133828.67101279454,
7050 133854.17372513309,
7051 133879.67765226253,
7052 133905.18279406714,
7053 133930.68915043125,
7054 133956.19672123916,
7055 133981.70550637526,
7056 134007.21550572399,
7057 134032.7267191697,
7058 134058.23914659687,
7059 134083.75278789,
7060 134109.26764293358,
7061 134134.78371161217,
7062 134160.30099381026,
7063 134185.8194894125,
7064 134211.33919830353,
7065 134236.8601203679,
7066 134262.38225549037,
7067 134287.90560355558,
7068 134313.43016444831,
7069 134338.95593805326,
7070 134364.48292425525,
7071 134390.01112293909,
7072 134415.54053398955,
7073 134441.07115729159,
7074 134466.60299273001,
7075 134492.1360401898,
7076 134517.67029955584,
7077 134543.20577071316,
7078 134568.74245354676,
7079 134594.28034794159,
7080 134619.81945378278,
7081 134645.35977095537,
7082 134670.90129934452,
7083 134696.4440388353,
7084 134721.98798931291,
7085 134747.53315066252,
7086 134773.07952276937,
7087 134798.62710551871,
7088 134824.17589879577,
7089 134849.72590248589,
7090 134875.27711647438,
7091 134900.82954064661,
7092 134926.38317488792,
7093 134951.93801908373,
7094 134977.49407311951,
7095 135003.05133688069,
7096 135028.60981025276,
7097 135054.16949312127,
7098 135079.73038537172,
7099 135105.29248688967,
7100 135130.85579756077,
7101 135156.42031727062,
7102 135181.98604590484,
7103 135207.55298334916,
7104 135233.12112948924,
7105 135258.69048421088,
7106 135284.26104739975,
7107 135309.83281894168,
7108 135335.4057987225,
7109 135360.97998662802,
7110 135386.55538254412,
7111 135412.13198635669,
7112 135437.70979795168,
7113 135463.28881721498,
7114 135488.86904403262,
7115 135514.45047829056,
7116 135540.03311987486,
7117 135565.61696867159,
7118 135591.20202456677,
7119 135616.78828744654,
7120 135642.37575719706,
7121 135667.96443370447,
7122 135693.55431685498,
7123 135719.14540653475,
7124 135744.73770263011,
7125 135770.33120502727,
7126 135795.92591361253,
7127 135821.52182827223,
7128 135847.11894889272,
7129 135872.7172753604,
7130 135898.31680756161,
7131 135923.91754538284,
7132 135949.51948871053,
7133 135975.12263743114,
7134 136000.72699143123,
7135 136026.33255059729,
7136 136051.93931481591,
7137 136077.54728397369,
7138 136103.15645795723,
7139 136128.76683665317,
7140 136154.37841994822,
7141 136179.99120772901,
7142 136205.60519988232,
7143 136231.2203962949,
7144 136256.83679685349,
7145 136282.45440144493,
7146 136308.07320995603,
7147 136333.69322227367,
7148 136359.31443828469,
7149 136384.93685787608,
7150 136410.56048093468,
7151 136436.18530734754,
7152 136461.81133700156,
7153 136487.43856978384,
7154 136513.06700558143,
7155 136538.6966442813,
7156 136564.32748577066,
7157 136589.95952993655,
7158 136615.59277666616,
7159 136641.22722584667,
7160 136666.86287736523,
7161 136692.49973110916,
7162 136718.13778696564,
7163 136743.77704482197,
7164 136769.41750456547,
7165 136795.05916608346,
7166 136820.70202926331,
7167 136846.34609399244,
7168 136871.99136015819,
7169 136897.63782764805,
7170 136923.28549634948,
7171 136948.93436614997,
7172 136974.58443693706,
7173 137000.23570859825,
7174 137025.88818102115,
7175 137051.54185409332,
7176 137077.19672770242,
7177 137102.85280173609,
7178 137128.51007608202,
7179 137154.16855062786,
7180 137179.82822526142,
7181 137205.48909987041,
7182 137231.15117434258,
7183 137256.8144485658,
7184 137282.47892242789,
7185 137308.14459581667,
7186 137333.81146862009,
7187 137359.47954072602,
7188 137385.14881202241,
7189 137410.81928239719,
7190 137436.49095173844,
7191 137462.16381993407,
7192 137487.83788687221,
7193 137513.51315244089,
7194 137539.18961652822,
7195 137564.86727902229,
7196 137590.54613981131,
7197 137616.22619878338,
7198 137641.90745582676,
7199 137667.58991082967,
7200 137693.27356368033,
7201 137718.95841426702,
7202 137744.64446247809,
7203 137770.33170820182,
7204 137796.02015132661,
7205 137821.70979174081,
7206 137847.40062933284,
7207 137873.09266399115,
7208 137898.78589560417,
7209 137924.48032406042,
7210 137950.17594924837,
7211 137975.8727710566,
7212 138001.57078937365,
7213 138027.27000408815,
7214 138052.97041508864,
7215 138078.67202226384,
7216 138104.3748255024,
7217 138130.07882469296,
7218 138155.78401972432,
7219 138181.49041048516,
7220 138207.1979968643,
7221 138232.9067787505,
7222 138258.61675603263,
7223 138284.32792859949,
7224 138310.04029633995,
7225 138335.75385914298,
7226 138361.46861689744,
7227 138387.18456949232,
7228 138412.90171681659,
7229 138438.62005875923,
7230 138464.33959520931,
7231 138490.06032605586,
7232 138515.78225118798,
7233 138541.50537049473,
7234 138567.2296838653,
7235 138592.95519118884,
7236 138618.68189235451,
7237 138644.40978725153,
7238 138670.13887576913,
7239 138695.86915779658,
7240 138721.60063322316,
7241 138747.33330193823,
7242 138773.06716383106,
7243 138798.80221879104,
7244 138824.53846670757,
7245 138850.27590747006,
7246 138876.01454096794,
7247 138901.7543670907,
7248 138927.49538572782,
7249 138953.2375967688,
7250 138978.9810001032,
7251 139004.72559562061,
7252 139030.47138321059,
7253 139056.2183627628,
7254 139081.96653416683,
7255 139107.71589731239,
7256 139133.46645208917,
7257 139159.21819838689,
7258 139184.97113609532,
7259 139210.72526510421,
7260 139236.48058530336,
7261 139262.23709658257,
7262 139287.99479883176,
7263 139313.75369194071,
7264 139339.51377579942,
7265 139365.27505029776,
7266 139391.03751532568,
7267 139416.80117077316,
7268 139442.56601653024,
7269 139468.33205248689,
7270 139494.09927853322,
7271 139519.86769455927,
7272 139545.63730045516,
7273 139571.408096111,
7274 139597.18008141697,
7275 139622.95325626322,
7276 139648.72762054001,
7277 139674.5031741375,
7278 139700.27991694602,
7279 139726.05784885579,
7280 139751.83696975713,
7281 139777.61727954043,
7282 139803.39877809596,
7283 139829.18146531415,
7284 139854.96534108539,
7285 139880.75040530015,
7286 139906.53665784886,
7287 139932.32409862199,
7288 139958.11272751007,
7289 139983.90254440365,
7290 140009.69354919327,
7291 140035.48574176949,
7292 140061.27912202294,
7293 140087.07368984428,
7294 140112.86944512415,
7295 140138.66638775321,
7296 140164.4645176222,
7297 140190.26383462184,
7298 140216.06433864293,
7299 140241.86602957622,
7300 140267.66890731253,
7301 140293.47297174268,
7302 140319.27822275754,
7303 140345.08466024802,
7304 140370.89228410498,
7305 140396.70109421943,
7306 140422.51109048226,
7307 140448.32227278448,
7308 140474.13464101712,
7309 140499.94819507122,
7310 140525.76293483781,
7311 140551.57886020801,
7312 140577.3959710729,
7313 140603.21426732364,
7314 140629.03374885136,
7315 140654.85441554731,
7316 140680.67626730262,
7317 140706.49930400858,
7318 140732.32352555645,
7319 140758.1489318375,
7320 140783.97552274304,
7321 140809.80329816442,
7322 140835.63225799298,
7323 140861.46240212015,
7324 140887.29373043729,
7325 140913.12624283586,
7326 140938.95993920733,
7327 140964.79481944317,
7328 140990.63088343487,
7329 141016.46813107401,
7330 141042.30656225214,
7331 141068.14617686081,
7332 141093.98697479168,
7333 141119.82895593636,
7334 141145.6721201865,
7335 141171.51646743377,
7336 141197.36199756994,
7337 141223.20871048668,
7338 141249.05660607578,
7339 141274.90568422904,
7340 141300.75594483822,
7341 141326.6073877952,
7342 141352.4600129918,
7343 141378.31382031992,
7344 141404.16880967148,
7345 141430.02498093838,
7346 141455.8823340126,
7347 141481.74086878612,
7348 141507.60058515094,
7349 141533.46148299909,
7350 141559.32356222265,
7351 141585.18682271364,
7352 141611.05126436421,
7353 141636.9168870665,
7354 141662.78369071262,
7355 141688.65167519479,
7356 141714.5208404052,
7357 141740.39118623605,
7358 141766.26271257963,
7359 141792.1354193282,
7360 141818.00930637406,
7361 141843.88437360956,
7362 141869.760620927,
7363 141895.6380482188,
7364 141921.51665537735,
7365 141947.39644229505,
7366 141973.27740886438,
7367 141999.15955497778,
7368 142025.04288052776,
7369 142050.92738540689,
7370 142076.81306950765,
7371 142102.69993272264,
7372 142128.58797494444,
7373 142154.47719606571,
7374 142180.36759597904,
7375 142206.25917457714,
7376 142232.15193175265,
7377 142258.04586739838,
7378 142283.94098140698,
7379 142309.83727367126,
7380 142335.73474408401,
7381 142361.63339253806,
7382 142387.5332189262,
7383 142413.43422314132,
7384 142439.33640507635,
7385 142465.23976462413,
7386 142491.14430167765,
7387 142517.05001612983,
7388 142542.95690787368,
7389 142568.86497680223,
7390 142594.77422280848,
7391 142620.68464578551,
7392 142646.5962456264,
7393 142672.50902222423,
7394 142698.42297547215,
7395 142724.33810526333,
7396 142750.25441149093,
7397 142776.17189404817,
7398 142802.09055282827,
7399 142828.01038772447,
7400 142853.93139863008,
7401 142879.85358543837,
7402 142905.77694804268,
7403 142931.70148633636,
7404 142957.62720021277,
7405 142983.55408956532,
7406 143009.48215428743,
7407 143035.41139427255,
7408 143061.34180941415,
7409 143087.27339960571,
7410 143113.20616474075,
7411 143139.14010471283,
7412 143165.07521941551,
7413 143191.01150874238,
7414 143216.94897258704,
7415 143242.88761084314,
7416 143268.82742340435,
7417 143294.76841016437,
7418 143320.71057101688,
7419 143346.65390585564,
7420 143372.59841457437,
7421 143398.54409706692,
7422 143424.49095322701,
7423 143450.43898294857,
7424 143476.38818612538,
7425 143502.33856265133,
7426 143528.29011242036,
7427 143554.24283532638,
7428 143580.19673126334,
7429 143606.1518001252,
7430 143632.10804180597,
7431 143658.06545619969,
7432 143684.02404320039,
7433 143709.98380270213,
7434 143735.944734599,
7435 143761.90683878519,
7436 143787.87011515474,
7437 143813.83456360188,
7438 143839.8001840208,
7439 143865.76697630569,
7440 143891.73494035081,
7441 143917.7040760504,
7442 143943.67438329876,
7443 143969.6458619902,
7444 143995.61851201905,
7445 144021.59233327967,
7446 144047.56732566646,
7447 144073.54348907378,
7448 144099.52082339607,
7449 144125.49932852783,
7450 144151.4790043635,
7451 144177.45985079758,
7452 144203.44186772458,
7453 144229.42505503909,
7454 144255.40941263564,
7455 144281.39494040885,
7456 144307.38163825331,
7457 144333.36950606373,
7458 144359.35854373468,
7459 144385.34875116093,
7460 144411.34012823718,
7461 144437.33267485813,
7462 144463.32639091855,
7463 144489.32127631325,
7464 144515.31733093705,
7465 144541.31455468474,
7466 144567.3129474512,
7467 144593.3125091313,
7468 144619.31323961995,
7469 144645.31513881206,
7470 144671.31820660262,
7471 144697.32244288657,
7472 144723.32784755889,
7473 144749.33442051467,
7474 144775.34216164888,
7475 144801.35107085665,
7476 144827.36114803303,
7477 144853.37239307314,
7478 144879.38480587213,
7479 144905.39838632516,
7480 144931.41313432742,
7481 144957.4290497741,
7482 144983.44613256046,
7483 145009.46438258173,
7484 145035.48379973322,
7485 145061.50438391021,
7486 145087.52613500805,
7487 145113.54905292206,
7488 145139.57313754765,
7489 145165.59838878017,
7490 145191.62480651509,
7491 145217.65239064783,
7492 145243.68114107384,
7493 145269.71105768863,
7494 145295.74214038774,
7495 145321.77438906668,
7496 145347.80780362099,
7497 145373.84238394629,
7498 145399.87812993818,
7499 145425.91504149229,
7500 145451.95311850426,
7501 145477.9923608698,
7502 145504.03276848458,
7503 145530.07434124436,
7504 145556.11707904484,
7505 145582.16098178181,
7506 145608.20604935108,
7507 145634.25228164849,
7508 145660.29967856981,
7509 145686.34824001096,
7510 145712.39796586783,
7511 145738.4488560363,
7512 145764.50091041232,
7513 145790.55412889185,
7514 145816.60851137087,
7515 145842.66405774537,
7516 145868.72076791141,
7517 145894.77864176501,
7518 145920.83767920226,
7519 145946.89788011924,
7520 145972.95924441208,
7521 145999.02177197693,
7522 146025.08546270995,
7523 146051.15031650732,
7524 146077.21633326527,
7525 146103.28351288004,
7526 146129.35185524789,
7527 146155.42136026506,
7528 146181.49202782792,
7529 146207.56385783272,
7530 146233.63685017588,
7531 146259.71100475377,
7532 146285.78632146274,
7533 146311.86280019928,
7534 146337.94044085976,
7535 146364.01924334071,
7536 146390.09920753856,
7537 146416.18033334985,
7538 146442.26262067116,
7539 146468.34606939898,
7540 146494.43067942993,
7541 146520.51645066062,
7542 146546.60338298764,
7543 146572.69147630769,
7544 146598.78073051744,
7545 146624.87114551352,
7546 146650.96272119274,
7547 146677.05545745179,
7548 146703.14935418745,
7549 146729.2444112965,
7550 146755.34062867577,
7551 146781.43800622207,
7552 146807.53654383228,
7553 146833.63624140329,
7554 146859.73709883197,
7555 146885.83911601527,
7556 146911.94229285014,
7557 146938.04662923355,
7558 146964.15212506248,
7559 146990.25878023397,
7560 147016.36659464505,
7561 147042.47556819281,
7562 147068.58570077427,
7563 147094.6969922866,
7564 147120.80944262692,
7565 147146.92305169237,
7566 147173.03781938017,
7567 147199.15374558745,
7568 147225.27083021149,
7569 147251.38907314953,
7570 147277.50847429881,
7571 147303.62903355664,
7572 147329.75075082036,
7573 147355.87362598727,
7574 147381.99765895473,
7575 147408.12284962015,
7576 147434.24919788091,
7577 147460.37670363448,
7578 147486.50536677826,
7579 147512.63518720976,
7580 147538.76616482646,
7581 147564.89829952587,
7582 147591.03159120557,
7583 147617.16603976308,
7584 147643.30164509601,
7585 147669.43840710199,
7586 147695.57632567859,
7587 147721.71540072354,
7588 147747.85563213445,
7589 147773.99701980909,
7590 147800.13956364512,
7591 147826.28326354033,
7592 147852.42811939248,
7593 147878.57413109933,
7594 147904.72129855872,
7595 147930.86962166851,
7596 147957.01910032652,
7597 147983.16973443062,
7598 148009.32152387875,
7599 148035.47446856883,
7600 148061.62856839882,
7601 148087.78382326665,
7602 148113.94023307035,
7603 148140.09779770792,
7604 148166.25651707739,
7605 148192.41639107687,
7606 148218.57741960438,
7607 148244.73960255808,
7608 148270.90293983606,
7609 148297.0674313365,
7610 148323.23307695755,
7611 148349.39987659742,
7612 148375.56783015432,
7613 148401.73693752653,
7614 148427.90719861226,
7615 148454.07861330983,
7616 148480.25118151752,
7617 148506.42490313368,
7618 148532.59977805667,
7619 148558.77580618486,
7620 148584.95298741665,
7621 148611.13132165043,
7622 148637.31080878471,
7623 148663.49144871789,
7624 148689.6732413485,
7625 148715.85618657502,
7626 148742.040284296,
7627 148768.22553440998,
7628 148794.41193681557,
7629 148820.59949141133,
7630 148846.78819809589,
7631 148872.97805676793,
7632 148899.16906732606,
7633 148925.36122966901,
7634 148951.55454369547,
7635 148977.74900930419,
7636 149003.9446263939,
7637 149030.1413948634,
7638 149056.33931461151,
7639 149082.53838553699,
7640 149108.73860753875,
7641 149134.9399805156,
7642 149161.14250436646,
7643 149187.34617899026,
7644 149213.5510042859,
7645 149239.75698015234,
7646 149265.96410648854,
7647 149292.17238319354,
7648 149318.38181016635,
7649 149344.59238730598,
7650 149370.80411451156,
7651 149397.01699168212,
7652 149423.23101871679,
7653 149449.44619551473,
7654 149475.66252197503,
7655 149501.87999799693,
7656 149528.0986234796,
7657 149554.31839832227,
7658 149580.53932242419,
7659 149606.76139568459,
7660 149632.98461800278,
7661 149659.20898927809,
7662 149685.43450940982,
7663 149711.66117829733,
7664 149737.88899584001,
7665 149764.11796193724,
7666 149790.34807648844,
7667 149816.57933939309,
7668 149842.81175055061,
7669 149869.04530986046,
7670 149895.28001722222,
7671 149921.51587253538,
7672 149947.75287569952,
7673 149973.99102661415,
7674 150000.23032517891,
7675 150026.47077129342,
7676 150052.71236485732,
7677 150078.95510577026,
7678 150105.1989939319,
7679 150131.444029242,
7680 150157.69021160025,
7681 150183.93754090639,
7682 150210.18601706024,
7683 150236.43563996154,
7684 150262.68640951012,
7685 150288.93832560582,
7686 150315.19138814852,
7687 150341.44559703805,
7688 150367.70095217437,
7689 150393.95745345735,
7690 150420.21510078697,
7691 150446.47389406321,
7692 150472.73383318601,
7693 150498.99491805542,
7694 150525.25714857146,
7695 150551.52052463419,
7696 150577.78504614369,
7697 150604.05071300003,
7698 150630.31752510337,
7699 150656.58548235384,
7700 150682.85458465159,
7701 150709.1248318968,
7702 150735.39622398972,
7703 150761.66876083051,
7704 150787.9424423195,
7705 150814.21726835691,
7706 150840.49323884305,
7707 150866.77035367821,
7708 150893.04861276277,
7709 150919.32801599705,
7710 150945.60856328148,
7711 150971.89025451642,
7712 150998.17308960229,
7713 151024.45706843957,
7714 151050.74219092872,
7715 151077.02845697021,
7716 151103.31586646455,
7717 151129.60441931229,
7718 151155.894115414,
7719 151182.1849546702,
7720 151208.47693698155,
7721 151234.77006224863,
7722 151261.06433037209,
7723 151287.35974125259,
7724 151313.65629479082,
7725 151339.95399088747,
7726 151366.25282944329,
7727 151392.55281035902,
7728 151418.85393353543,
7729 151445.1561988733,
7730 151471.45960627345,
7731 151497.76415563675,
7732 151524.06984686397,
7733 151550.37667985607,
7734 151576.68465451393,
7735 151602.99377073845,
7736 151629.30402843058,
7737 151655.61542749128,
7738 151681.92796782157,
7739 151708.24164932242,
7740 151734.55647189484,
7741 151760.87243543993,
7742 151787.18953985872,
7743 151813.50778505235,
7744 151839.82717092187,
7745 151866.14769736846,
7746 151892.46936429327,
7747 151918.79217159748,
7748 151945.11611918229,
7749 151971.44120694889,
7750 151997.76743479856,
7751 152024.09480263255,
7752 152050.42331035214,
7753 152076.75295785864,
7754 152103.08374505339,
7755 152129.41567183775,
7756 152155.74873811303,
7757 152182.08294378067,
7758 152208.41828874208,
7759 152234.75477289871,
7760 152261.09239615197,
7761 152287.43115840337,
7762 152313.77105955439,
7763 152340.11209950657,
7764 152366.45427816146,
7765 152392.79759542056,
7766 152419.14205118554,
7767 152445.48764535793,
7768 152471.8343778394,
7769 152498.18224853161,
7770 152524.53125733617,
7771 152550.88140415482,
7772 152577.23268888926,
7773 152603.58511144121,
7774 152629.93867171241,
7775 152656.29336960468,
7776 152682.64920501978,
7777 152709.00617785956,
7778 152735.36428802583,
7779 152761.72353542043,
7780 152788.08391994529,
7781 152814.44544150229,
7782 152840.80809999333,
7783 152867.17189532038,
7784 152893.53682738543,
7785 152919.90289609041,
7786 152946.27010133737,
7787 152972.63844302832,
7788 152999.00792106529,
7789 153025.37853535041,
7790 153051.7502857857,
7791 153078.12317227334,
7792 153104.4971947154,
7793 153130.8723530141,
7794 153157.24864707157,
7795 153183.62607679001,
7796 153210.00464207167,
7797 153236.38434281875,
7798 153262.76517893354,
7799 153289.14715031831,
7800 153315.53025687535,
7801 153341.91449850702,
7802 153368.2998751156,
7803 153394.68638660354,
7804 153421.07403287315,
7805 153447.46281382689,
7806 153473.85272936718,
7807 153500.24377939643,
7808 153526.63596381716,
7809 153553.02928253182,
7810 153579.42373544298,
7811 153605.81932245308,
7812 153632.21604346478,
7813 153658.61389838057,
7814 153685.0128871031,
7815 153711.41300953497,
7816 153737.81426557881,
7817 153764.21665513728,
7818 153790.62017811305,
7819 153817.02483440886,
7820 153843.43062392739,
7821 153869.83754657139,
7822 153896.24560224367,
7823 153922.65479084692,
7824 153949.06511228404,
7825 153975.4765664578,
7826 154001.88915327107,
7827 154028.30287262669,
7828 154054.71772442761,
7829 154081.13370857667,
7830 154107.55082497682,
7831 154133.96907353101,
7832 154160.38845414223,
7833 154186.80896671346,
7834 154213.23061114774,
7835 154239.65338734805,
7836 154266.07729521746,
7837 154292.50233465908,
7838 154318.92850557598,
7839 154345.35580787127,
7840 154371.7842414481,
7841 154398.21380620965,
7842 154424.64450205903,
7843 154451.07632889951,
7844 154477.50928663427,
7845 154503.94337516659,
7846 154530.37859439969,
7847 154556.81494423689,
7848 154583.25242458144,
7849 154609.69103533673,
7850 154636.13077640603,
7851 154662.57164769279,
7852 154689.01364910032,
7853 154715.45678053208,
7854 154741.90104189145,
7855 154768.34643308193,
7856 154794.79295400696,
7857 154821.24060457002,
7858 154847.68938467462,
7859 154874.13929422433,
7860 154900.59033312264,
7861 154927.04250127316,
7862 154953.49579857948,
7863 154979.95022494521,
7864 155006.40578027396,
7865 155032.86246446942,
7866 155059.32027743524,
7867 155085.77921907514,
7868 155112.2392892928,
7869 155138.70048799197,
7870 155165.16281507642,
7871 155191.62627044989,
7872 155218.09085401625,
7873 155244.55656567923,
7874 155271.02340534274,
7875 155297.49137291059,
7876 155323.96046828668,
7877 155350.4306913749,
7878 155376.90204207919,
7879 155403.37452030348,
7880 155429.84812595171,
7881 155456.32285892789,
7882 155482.79871913602,
7883 155509.27570648011,
7884 155535.75382086422,
7885 155562.23306219239,
7886 155588.71343036872,
7887 155615.19492529731,
7888 155641.67754688227,
7889 155668.16129502779,
7890 155694.64616963797,
7891 155721.13217061706,
7892 155747.61929786921,
7893 155774.10755129869,
7894 155800.59693080973,
7895 155827.08743630661,
7896 155853.57906769359,
7897 155880.07182487496,
7898 155906.56570775513,
7899 155933.06071623837,
7900 155959.55685022907,
7901 155986.05410963166,
7902 156012.5524943505,
7903 156039.05200429002,
7904 156065.55263935472,
7905 156092.054399449,
7906 156118.5572844774,
7907 156145.06129434443,
7908 156171.5664289546,
7909 156198.07268821247,
7910 156224.5800720226,
7911 156251.08858028959,
7912 156277.59821291809,
7913 156304.10896981266,
7914 156330.62085087801,
7915 156357.1338560188,
7916 156383.64798513969,
7917 156410.16323814544,
7918 156436.67961494075,
7919 156463.1971154304,
7920 156489.71573951913,
7921 156516.23548711176,
7922 156542.75635811311,
7923 156569.27835242799,
7924 156595.80146996127,
7925 156622.32571061782,
7926 156648.85107430254,
7927 156675.37756092031,
7928 156701.90517037612,
7929 156728.43390257491,
7930 156754.96375742162,
7931 156781.49473482129,
7932 156808.02683467892,
7933 156834.5600568995,
7934 156861.09440138817,
7935 156887.62986804993,
7936 156914.16645678994,
7937 156940.70416751326,
7938 156967.24300012505,
7939 156993.78295453047,
7940 157020.32403063469,
7941 157046.8662283429,
7942 157073.40954756032,
7943 157099.9539881922,
7944 157126.49955014378,
7945 157153.04623332032,
7946 157179.59403762716,
7947 157206.14296296958,
7948 157232.69300925292,
7949 157259.24417638258,
7950 157285.79646426387,
7951 157312.34987280221,
7952 157338.90440190304,
7953 157365.46005147175,
7954 157392.01682141385,
7955 157418.57471163478,
7956 157445.13372204005,
7957 157471.69385253513,
7958 157498.25510302564,
7959 157524.81747341706,
7960 157551.38096361503,
7961 157577.9455735251,
7962 157604.51130305286,
7963 157631.07815210402,
7964 157657.64612058419,
7965 157684.21520839902,
7966 157710.78541545427,
7967 157737.35674165559,
7968 157763.92918690876,
7969 157790.50275111952,
7970 157817.07743419363,
7971 157843.65323603692,
7972 157870.23015655516,
7973 157896.80819565422,
7974 157923.3873532399,
7975 157949.96762921812,
7976 157976.54902349479,
7977 158003.13153597576,
7978 158029.71516656701,
7979 158056.29991517449,
7980 158082.88578170416,
7981 158109.47276606198,
7982 158136.06086815402,
7983 158162.65008788629,
7984 158189.24042516484,
7985 158215.83187989573,
7986 158242.42445198505,
7987 158269.01814133892,
7988 158295.61294786347,
7989 158322.20887146486,
7990 158348.80591204923,
7991 158375.4040695228,
7992 158402.00334379176,
7993 158428.60373476235,
7994 158455.2052423408,
7995 158481.80786643337,
7996 158508.41160694641,
7997 158535.01646378616,
7998 158561.62243685898,
7999 158588.2295260712,
8000 158614.8377313292,
8001 158641.44705253936,
8002 158668.05748960807,
8003 158694.66904244179,
8004 158721.28171094693,
8005 158747.89549502998,
8006 158774.5103945974,
8007 158801.12640955573,
8008 158827.74353981143,
8009 158854.36178527112,
8010 158880.9811458413,
8011 158907.60162142856,
8012 158934.22321193956,
8013 158960.84591728085,
8014 158987.46973735912,
8015 159014.09467208097,
8016 159040.72072135314,
8017 159067.3478850823,
8018 159093.97616317519,
8019 159120.60555553852,
8020 159147.23606207906,
8021 159173.8676827036,
8022 159200.50041731889,
8023 159227.13426583182,
8024 159253.76922814918,
8025 159280.40530417781,
8026 159307.04249382461,
8027 159333.68079699649,
8028 159360.32021360032,
8029 159386.96074354305,
8030 159413.60238673165,
8031 159440.24514307309,
8032 159466.88901247433,
8033 159493.53399484244,
8034 159520.18009008438,
8035 159546.82729810724,
8036 159573.47561881805,
8037 159600.12505212394,
8038 159626.77559793202,
8039 159653.42725614941,
8040 159680.08002668325,
8041 159706.73390944069,
8042 159733.38890432892,
8043 159760.04501125516,
8044 159786.70223012666,
8045 159813.36056085059,
8046 159840.02000333427,
8047 159866.68055748497,
8048 159893.34222320997,
8049 159920.00500041663,
8050 159946.66888901225,
8051 159973.33388890422,
8052 159999.99999999988,
8053 160026.66722220668,
8054 160053.33555543202,
8055 160080.0049995833,
8056 160106.67555456801,
8057 160133.3472202936,
8058 160160.0199966676,
8059 160186.6938835975,
8060 160213.36888099083,
8061 160240.04498875517,
8062 160266.72220679806,
8063 160293.40053502709,
8064 160320.07997334987,
8065 160346.76052167406,
8066 160373.44217990729,
8067 160400.1249479572,
8068 160426.80882573154,
8069 160453.49381313793,
8070 160480.17991008417,
8071 160506.86711647795,
8072 160533.55543222709,
8073 160560.24485723933,
8074 160586.93539142248,
8075 160613.62703468435,
8076 160640.31978693281,
8077 160667.01364807569,
8078 160693.70861802087,
8079 160720.40469667627,
8080 160747.1018839498,
8081 160773.80017974938,
8082 160800.49958398298,
8083 160827.20009655855,
8084 160853.90171738411,
8085 160880.60444636765,
8086 160907.30828341722,
8087 160934.01322844089,
8088 160960.71928134665,
8089 160987.42644204266,
8090 161014.13471043704,
8091 161040.84408643784,
8092 161067.55456995327,
8093 161094.26616089148,
8094 161120.97885916062,
8095 161147.69266466892,
8096 161174.40757732463,
8097 161201.12359703594,
8098 161227.84072371112,
8099 161254.55895725847,
8100 161281.27829758628,
8101 161307.99874460287,
8102 161334.72029821656,
8103 161361.44295833571,
8104 161388.1667248687,
8105 161414.89159772391,
8106 161441.61757680977,
8107 161468.34466203468,
8108 161495.07285330712,
8109 161521.80215053557,
8110 161548.53255362847,
8111 161575.26406249436,
8112 161601.99667704175,
8113 161628.7303971792,
8114 161655.46522281526,
8115 161682.20115385848,
8116 161708.93819021754,
8117 161735.67633180099,
8118 161762.41557851751,
8119 161789.15593027571,
8120 161815.89738698432,
8121 161842.63994855201,
8122 161869.38361488748,
8123 161896.1283858995,
8124 161922.87426149679,
8125 161949.62124158812,
8126 161976.36932608229,
8127 162003.1185148881,
8128 162029.8688079144,
8129 162056.62020507001,
8130 162083.37270626382,
8131 162110.12631140469,
8132 162136.88102040152,
8133 162163.63683316324,
8134 162190.39374959879,
8135 162217.15176961714,
8136 162243.91089312723,
8137 162270.67112003808,
8138 162297.43245025873,
8139 162324.19488369819,
8140 162350.9584202655,
8141 162377.72305986975,
8142 162404.48880242003,
8143 162431.25564782543,
8144 162458.02359599507,
8145 162484.79264683815,
8146 162511.56280026378,
8147 162538.33405618116,
8148 162565.10641449949,
8149 162591.87987512801,
8150 162618.65443797593,
8151 162645.43010295252,
8152 162672.20686996708,
8153 162698.98473892888,
8154 162725.76370974723,
8155 162752.54378233149,
8156 162779.32495659095,
8157 162806.10723243505,
8158 162832.89060977317,
8159 162859.67508851466,
8160 162886.46066856899,
8161 162913.24734984562,
8162 162940.03513225398,
8163 162966.82401570358,
8164 162993.6140001039,
8165 163020.40508536444,
8166 163047.19727139481,
8167 163073.99055810447,
8168 163100.78494540305,
8169 163127.58043320014,
8170 163154.37702140535,
8171 163181.17470992831,
8172 163207.97349867865,
8173 163234.77338756606,
8174 163261.57437650024,
8175 163288.37646539087,
8176 163315.17965414765,
8177 163341.98394268038,
8178 163368.78933089875,
8179 163395.59581871261,
8180 163422.40340603172,
8181 163449.2120927659,
8182 163476.02187882498,
8183 163502.83276411882,
8184 163529.6447485573,
8185 163556.45783205028,
8186 163583.2720145077,
8187 163610.08729583945,
8188 163636.90367595552,
8189 163663.72115476584,
8190 163690.53973218042,
8191 163717.35940810922,
8192 163744.18018246227,
8193 163771.00205514964,
8194 163797.82502608138,
8195 163824.64909516752,
8196 163851.4742623182,
8197 163878.3005274435,
8198 163905.12789045356,
8199 163931.95635125853,
8200 163958.78590976857,
8201 163985.61656589387,
8202 164012.44831954464,
8203 164039.28117063109,
8204 164066.11511906344,
8205 164092.95016475199,
8206 164119.78630760699,
8207 164146.62354753874,
8208 164173.46188445756,
8209 164200.30131827376,
8210 164227.14184889771,
8211 164253.98347623978,
8212 164280.82620021031,
8213 164307.67002071979,
8214 164334.51493767856,
8215 164361.3609509971,
8216 164388.20806058586,
8217 164415.05626635533,
8218 164441.905568216,
8219 164468.75596607837,
8220 164495.607459853,
8221 164522.4600494504,
8222 164549.31373478117,
8223 164576.16851575591,
8224 164603.02439228518,
8225 164629.88136427966,
8226 164656.73943164994,
8227 164683.59859430668,
8228 164710.45885216061,
8229 164737.32020512238,
8230 164764.1826531027,
8231 164791.04619601235,
8232 164817.91083376206,
8233 164844.77656626256,
8234 164871.64339342469,
8235 164898.51131515924,
8236 164925.38033137703,
8237 164952.25044198887,
8238 164979.1216469057,
8239 165005.9939460383,
8240 165032.86733929763,
8241 165059.7418265946,
8242 165086.61740784015,
8243 165113.4940829452
8244 };
8245
8246 #else
8247
8248 #ifdef BIG_IQ_TABLE
8249 #define IQ_TABLE_SIZE 8192
8250 #else
8251 #define IQ_TABLE_SIZE 1026
8252 #endif
8253
8254 ALIGN static const real_t iq_table[IQ_TABLE_SIZE] =
8255 {
8256 REAL_CONST(0.0),
8257 REAL_CONST(1.0/8.0),
8258 REAL_CONST(2.5198420997897464/8.0),
8259 REAL_CONST(4.3267487109222245/8.0),
8260 REAL_CONST(6.3496042078727974/8.0),
8261 REAL_CONST(8.5498797333834844/8.0),
8262 REAL_CONST(10.902723556992836/8.0),
8263 REAL_CONST(13.390518279406722/8.0),
8264 REAL_CONST(15.999999999999998/8.0),
8265 REAL_CONST(18.720754407467133/8.0),
8266 REAL_CONST(21.544346900318832/8.0),
8267 REAL_CONST(24.463780996262464/8.0),
8268 REAL_CONST(27.47314182127996/8.0),
8269 REAL_CONST(30.567350940369842/8.0),
8270 REAL_CONST(33.741991698453212/8.0),
8271 REAL_CONST(36.993181114957046/8.0),
8272 REAL_CONST(40.317473596635935/8.0),
8273 REAL_CONST(43.711787041189993/8.0),
8274 REAL_CONST(47.173345095760126/8.0),
8275 REAL_CONST(50.699631325716943/8.0),
8276 REAL_CONST(54.288352331898118/8.0),
8277 REAL_CONST(57.937407704003519/8.0),
8278 REAL_CONST(61.6448652744185/8.0),
8279 REAL_CONST(65.408940536585988/8.0),
8280 REAL_CONST(69.227979374755591/8.0),
8281 REAL_CONST(73.100443455321638/8.0),
8282 REAL_CONST(77.024897778591622/8.0),
8283 REAL_CONST(80.999999999999986/8.0),
8284 REAL_CONST(85.024491212518527/8.0),
8285 REAL_CONST(89.097187944889555/8.0),
8286 REAL_CONST(93.216975178615741/8.0),
8287 REAL_CONST(97.382800224133163/8.0),
8288 REAL_CONST(101.59366732596474/8.0),
8289 REAL_CONST(105.84863288986224/8.0),
8290 REAL_CONST(110.14680124343441/8.0),
8291 REAL_CONST(114.4873208566006/8.0),
8292 REAL_CONST(118.86938096020653/8.0),
8293 REAL_CONST(123.29220851090024/8.0),
8294 REAL_CONST(127.75506545836058/8.0),
8295 REAL_CONST(132.25724627755247/8.0),
8296 REAL_CONST(136.79807573413572/8.0),
8297 REAL_CONST(141.37690685569191/8.0),
8298 REAL_CONST(145.99311908523086/8.0),
8299 REAL_CONST(150.6461165966291/8.0),
8300 REAL_CONST(155.33532675434674/8.0),
8301 REAL_CONST(160.06019870205279/8.0),
8302 REAL_CONST(164.82020206673349/8.0),
8303 REAL_CONST(169.61482576651861/8.0),
8304 REAL_CONST(174.44357691188537/8.0),
8305 REAL_CONST(179.30597979112557/8.0),
8306 REAL_CONST(184.20157493201927/8.0),
8307 REAL_CONST(189.12991823257562/8.0),
8308 REAL_CONST(194.09058015449685/8.0),
8309 REAL_CONST(199.08314497371677/8.0),
8310 REAL_CONST(204.1072100829694/8.0),
8311 REAL_CONST(209.16238534187647/8.0),
8312 REAL_CONST(214.24829247050752/8.0),
8313 REAL_CONST(219.36456448277784/8.0),
8314 REAL_CONST(224.51084515641216/8.0),
8315 REAL_CONST(229.6867885365223/8.0),
8316 REAL_CONST(234.89205847013176/8.0),
8317 REAL_CONST(240.12632816923249/8.0),
8318 REAL_CONST(245.38927980018505/8.0),
8319 REAL_CONST(250.68060409747261/8.0),
8320 REAL_CONST(255.99999999999991/8.0),
8321 REAL_CONST(261.34717430828869/8.0),
8322 REAL_CONST(266.72184136106449/8.0),
8323 REAL_CONST(272.12372272986045/8.0),
8324 REAL_CONST(277.55254693037961/8.0),
8325 REAL_CONST(283.0080491494619/8.0),
8326 REAL_CONST(288.48997098659891/8.0),
8327 REAL_CONST(293.99806020902247/8.0),
8328 REAL_CONST(299.53207051947408/8.0),
8329 REAL_CONST(305.0917613358298/8.0),
8330 REAL_CONST(310.67689758182206/8.0),
8331 REAL_CONST(316.28724948815585/8.0),
8332 REAL_CONST(321.92259240337177/8.0),
8333 REAL_CONST(327.58270661385535/8.0),
8334 REAL_CONST(333.26737717243742/8.0),
8335 REAL_CONST(338.97639373507025/8.0),
8336 REAL_CONST(344.70955040510125/8.0),
8337 REAL_CONST(350.46664558470013/8.0),
8338 REAL_CONST(356.24748183302603/8.0),
8339 REAL_CONST(362.05186573075139/8.0),
8340 REAL_CONST(367.87960775058258/8.0),
8341 REAL_CONST(373.73052213344511/8.0),
8342 REAL_CONST(379.60442677002078/8.0),
8343 REAL_CONST(385.50114308734607/8.0),
8344 REAL_CONST(391.42049594019937/8.0),
8345 REAL_CONST(397.36231350702371/8.0),
8346 REAL_CONST(403.32642719014467/8.0),
8347 REAL_CONST(409.31267152006262/8.0),
8348 REAL_CONST(415.32088406360799/8.0),
8349 REAL_CONST(421.35090533576471/8.0),
8350 REAL_CONST(427.40257871497619/8.0),
8351 REAL_CONST(433.4757503617617/8.0),
8352 REAL_CONST(439.5702691404793/8.0),
8353 REAL_CONST(445.68598654408271/8.0),
8354 REAL_CONST(451.82275662172759/8.0),
8355 REAL_CONST(457.98043590909128/8.0),
8356 REAL_CONST(464.15888336127773/8.0),
8357 REAL_CONST(470.35796028818726/8.0),
8358 REAL_CONST(476.5775302922363/8.0),
8359 REAL_CONST(482.81745920832043/8.0),
8360 REAL_CONST(489.07761504591741/8.0),
8361 REAL_CONST(495.35786793323581/8.0),
8362 REAL_CONST(501.65809006331688/8.0),
8363 REAL_CONST(507.97815564200368/8.0),
8364 REAL_CONST(514.31794083769648/8.0),
8365 REAL_CONST(520.67732373281672/8.0),
8366 REAL_CONST(527.05618427690604/8.0),
8367 REAL_CONST(533.45440424129174/8.0),
8368 REAL_CONST(539.87186717525128/8.0),
8369 REAL_CONST(546.30845836361505/8.0),
8370 REAL_CONST(552.76406478574609/8.0),
8371 REAL_CONST(559.23857507584194/8.0),
8372 REAL_CONST(565.73187948450413/8.0),
8373 REAL_CONST(572.24386984152341/8.0),
8374 REAL_CONST(578.77443951983378/8.0),
8375 REAL_CONST(585.32348340058843/8.0),
8376 REAL_CONST(591.89089783931263/8.0),
8377 REAL_CONST(598.47658063309257/8.0),
8378 REAL_CONST(605.08043098876044/8.0),
8379 REAL_CONST(611.70234949203643/8.0),
8380 REAL_CONST(618.3422380775919/8.0),
8381 REAL_CONST(624.99999999999977/8.0),
8382 REAL_CONST(631.67553980553748/8.0),
8383 REAL_CONST(638.36876330481164/8.0),
8384 REAL_CONST(645.07957754617485/8.0),
8385 REAL_CONST(651.80789078990415/8.0),
8386 REAL_CONST(658.55361248311499/8.0),
8387 REAL_CONST(665.31665323538357/8.0),
8388 REAL_CONST(672.09692479505225/8.0),
8389 REAL_CONST(678.8943400261943/8.0),
8390 REAL_CONST(685.70881288621433/8.0),
8391 REAL_CONST(692.540258404062/8.0),
8392 REAL_CONST(699.38859265903977/8.0),
8393 REAL_CONST(706.25373276018058/8.0),
8394 REAL_CONST(713.13559682617972/8.0),
8395 REAL_CONST(720.03410396586037/8.0),
8396 REAL_CONST(726.94917425915435/8.0),
8397 REAL_CONST(733.88072873858209/8.0),
8398 REAL_CONST(740.82868937121543/8.0),
8399 REAL_CONST(747.79297904110535/8.0),
8400 REAL_CONST(754.77352153216191/8.0),
8401 REAL_CONST(761.77024151147043/8.0),
8402 REAL_CONST(768.78306451302956/8.0),
8403 REAL_CONST(775.81191692189896/8.0),
8404 REAL_CONST(782.85672595874246/8.0),
8405 REAL_CONST(789.91741966475445/8.0),
8406 REAL_CONST(796.99392688695798/8.0),
8407 REAL_CONST(804.08617726386274/8.0),
8408 REAL_CONST(811.19410121147098/8.0),
8409 REAL_CONST(818.31762990962227/8.0),
8410 REAL_CONST(825.45669528866563/8.0),
8411 REAL_CONST(832.61123001644864/8.0),
8412 REAL_CONST(839.78116748561604/8.0),
8413 REAL_CONST(846.96644180120552/8.0),
8414 REAL_CONST(854.16698776853514/8.0),
8415 REAL_CONST(861.38274088137143/8.0),
8416 REAL_CONST(868.61363731036977/8.0),
8417 REAL_CONST(875.85961389178203/8.0),
8418 REAL_CONST(883.12060811641959/8.0),
8419 REAL_CONST(890.39655811886757/8.0),
8420 REAL_CONST(897.68740266694181/8.0),
8421 REAL_CONST(904.99308115138172/8.0),
8422 REAL_CONST(912.31353357577188/8.0),
8423 REAL_CONST(919.64870054668756/8.0),
8424 REAL_CONST(926.99852326405619/8.0),
8425 REAL_CONST(934.36294351172899/8.0),
8426 REAL_CONST(941.74190364825859/8.0),
8427 REAL_CONST(949.13534659787422/8.0),
8428 REAL_CONST(956.54321584165211/8.0),
8429 REAL_CONST(963.96545540887348/8.0),
8430 REAL_CONST(971.40200986856541/8.0),
8431 REAL_CONST(978.85282432122176/8.0),
8432 REAL_CONST(986.31784439069588/8.0),
8433 REAL_CONST(993.7970162162635/8.0),
8434 REAL_CONST(1001.29028644485/8.0),
8435 REAL_CONST(1008.797602223418/8.0),
8436 REAL_CONST(1016.3189111915103/8.0),
8437 REAL_CONST(1023.8541614739464/8.0),
8438 REAL_CONST(1031.4033016736653/8.0),
8439 REAL_CONST(1038.9662808647138/8.0),
8440 REAL_CONST(1046.5430485853758/8.0),
8441 REAL_CONST(1054.1335548314366/8.0),
8442 REAL_CONST(1061.7377500495838/8.0),
8443 REAL_CONST(1069.3555851309357/8.0),
8444 REAL_CONST(1076.9870114046978/8.0),
8445 REAL_CONST(1084.6319806319441/8.0),
8446 REAL_CONST(1092.2904449995174/8.0),
8447 REAL_CONST(1099.9623571140482/8.0),
8448 REAL_CONST(1107.6476699960892/8.0),
8449 REAL_CONST(1115.3463370743607/8.0),
8450 REAL_CONST(1123.058312180106/8.0),
8451 REAL_CONST(1130.7835495415541/8.0),
8452 REAL_CONST(1138.5220037784854/8.0),
8453 REAL_CONST(1146.273629896901/8.0),
8454 REAL_CONST(1154.0383832837879/8.0),
8455 REAL_CONST(1161.816219701986/8.0),
8456 REAL_CONST(1169.607095285146/8.0),
8457 REAL_CONST(1177.4109665327808/8.0),
8458 REAL_CONST(1185.2277903054078/8.0),
8459 REAL_CONST(1193.0575238197798/8.0),
8460 REAL_CONST(1200.9001246442001/8.0),
8461 REAL_CONST(1208.7555506939248/8.0),
8462 REAL_CONST(1216.6237602266442/8.0),
8463 REAL_CONST(1224.5047118380478/8.0),
8464 REAL_CONST(1232.3983644574657/8.0),
8465 REAL_CONST(1240.3046773435874/8.0),
8466 REAL_CONST(1248.2236100802568/8.0),
8467 REAL_CONST(1256.1551225723395/8.0),
8468 REAL_CONST(1264.099175041662/8.0),
8469 REAL_CONST(1272.0557280230228/8.0),
8470 REAL_CONST(1280.0247423602691/8.0),
8471 REAL_CONST(1288.0061792024444/8.0),
8472 REAL_CONST(1295.9999999999995/8.0),
8473 REAL_CONST(1304.006166501068/8.0),
8474 REAL_CONST(1312.0246407478062/8.0),
8475 REAL_CONST(1320.0553850727929/8.0),
8476 REAL_CONST(1328.0983620954903/8.0),
8477 REAL_CONST(1336.1535347187651/8.0),
8478 REAL_CONST(1344.2208661254647/8.0),
8479 REAL_CONST(1352.3003197750522/8.0),
8480 REAL_CONST(1360.3918594002962/8.0),
8481 REAL_CONST(1368.4954490040145/8.0),
8482 REAL_CONST(1376.6110528558709/8.0),
8483 REAL_CONST(1384.7386354892244/8.0),
8484 REAL_CONST(1392.8781616980295/8.0),
8485 REAL_CONST(1401.0295965337855/8.0),
8486 REAL_CONST(1409.1929053025353/8.0),
8487 REAL_CONST(1417.3680535619119/8.0),
8488 REAL_CONST(1425.5550071182327/8.0),
8489 REAL_CONST(1433.7537320236374/8.0),
8490 REAL_CONST(1441.9641945732744/8.0),
8491 REAL_CONST(1450.1863613025282/8.0),
8492 REAL_CONST(1458.4201989842913/8.0),
8493 REAL_CONST(1466.6656746262797/8.0),
8494 REAL_CONST(1474.9227554683875/8.0),
8495 REAL_CONST(1483.1914089800841/8.0),
8496 REAL_CONST(1491.4716028578516/8.0),
8497 REAL_CONST(1499.7633050226596/8.0),
8498 REAL_CONST(1508.0664836174794/8.0),
8499 REAL_CONST(1516.3811070048375/8.0),
8500 REAL_CONST(1524.7071437644029/8.0),
8501 REAL_CONST(1533.0445626906128/8.0),
8502 REAL_CONST(1541.3933327903342/8.0),
8503 REAL_CONST(1549.7534232805581/8.0),
8504 REAL_CONST(1558.1248035861302/8.0),
8505 REAL_CONST(1566.507443337515/8.0),
8506 REAL_CONST(1574.9013123685909/8.0),
8507 REAL_CONST(1583.3063807144795/8.0),
8508 REAL_CONST(1591.7226186094069/8.0),
8509 REAL_CONST(1600.1499964845941/8.0),
8510 REAL_CONST(1608.58848496618/8.0),
8511 REAL_CONST(1617.0380548731737/8.0),
8512 REAL_CONST(1625.4986772154357/8.0),
8513 REAL_CONST(1633.9703231916887/8.0),
8514 REAL_CONST(1642.4529641875577/8.0),
8515 REAL_CONST(1650.9465717736346/8.0),
8516 REAL_CONST(1659.4511177035752/8.0),
8517 REAL_CONST(1667.9665739122186/8.0),
8518 REAL_CONST(1676.4929125137353/8.0),
8519 REAL_CONST(1685.030105799801/8.0),
8520 REAL_CONST(1693.5781262377957/8.0),
8521 REAL_CONST(1702.136946469027/8.0),
8522 REAL_CONST(1710.7065393069795/8.0),
8523 REAL_CONST(1719.2868777355877/8.0),
8524 REAL_CONST(1727.8779349075323/8.0),
8525 REAL_CONST(1736.4796841425596/8.0),
8526 REAL_CONST(1745.092098925825/8.0),
8527 REAL_CONST(1753.7151529062583/8.0),
8528 REAL_CONST(1762.3488198949503/8.0),
8529 REAL_CONST(1770.9930738635628/8.0),
8530 REAL_CONST(1779.6478889427597/8.0),
8531 REAL_CONST(1788.3132394206564/8.0),
8532 REAL_CONST(1796.9890997412947/8.0),
8533 REAL_CONST(1805.6754445031333/8.0),
8534 REAL_CONST(1814.3722484575621/8.0),
8535 REAL_CONST(1823.0794865074322/8.0),
8536 REAL_CONST(1831.7971337056094/8.0),
8537 REAL_CONST(1840.5251652535437/8.0),
8538 REAL_CONST(1849.2635564998579/8.0),
8539 REAL_CONST(1858.0122829389563/8.0),
8540 REAL_CONST(1866.7713202096493/8.0),
8541 REAL_CONST(1875.5406440937966/8.0),
8542 REAL_CONST(1884.3202305149687/8.0),
8543 REAL_CONST(1893.110055537124/8.0),
8544 REAL_CONST(1901.9100953633042/8.0),
8545 REAL_CONST(1910.7203263343454/8.0),
8546 REAL_CONST(1919.5407249276057/8.0),
8547 REAL_CONST(1928.3712677557098/8.0),
8548 REAL_CONST(1937.2119315653083/8.0),
8549 REAL_CONST(1946.0626932358525/8.0),
8550 REAL_CONST(1954.923529778386/8.0),
8551 REAL_CONST(1963.79441833435/8.0),
8552 REAL_CONST(1972.6753361744036/8.0),
8553 REAL_CONST(1981.5662606972594/8.0),
8554 REAL_CONST(1990.467169428533/8.0),
8555 REAL_CONST(1999.3780400196069/8.0),
8556 REAL_CONST(2008.2988502465078/8.0),
8557 REAL_CONST(2017.2295780087982/8.0),
8558 REAL_CONST(2026.1702013284819/8.0),
8559 REAL_CONST(2035.1206983489212/8.0),
8560 REAL_CONST(2044.0810473337688/8.0),
8561 REAL_CONST(2053.0512266659125/8.0),
8562 REAL_CONST(2062.0312148464309/8.0),
8563 REAL_CONST(2071.0209904935646/8.0),
8564 REAL_CONST(2080.0205323416958/8.0),
8565 REAL_CONST(2089.0298192403443/8.0),
8566 REAL_CONST(2098.0488301531714/8.0),
8567 REAL_CONST(2107.0775441569995/8.0),
8568 REAL_CONST(2116.115940440839/8.0),
8569 REAL_CONST(2125.1639983049317/8.0),
8570 REAL_CONST(2134.2216971597995/8.0),
8571 REAL_CONST(2143.2890165253098/8.0),
8572 REAL_CONST(2152.3659360297484/8.0),
8573 REAL_CONST(2161.4524354089031/8.0),
8574 REAL_CONST(2170.5484945051617/8.0),
8575 REAL_CONST(2179.6540932666144/8.0),
8576 REAL_CONST(2188.7692117461711/8.0),
8577 REAL_CONST(2197.8938301006888/8.0),
8578 REAL_CONST(2207.0279285901042/8.0),
8579 REAL_CONST(2216.1714875765838/8.0),
8580 REAL_CONST(2225.324487523676/8.0),
8581 REAL_CONST(2234.4869089954782/8.0),
8582 REAL_CONST(2243.6587326558101/8.0),
8583 REAL_CONST(2252.8399392673982/8.0),
8584 REAL_CONST(2262.0305096910702/8.0),
8585 REAL_CONST(2271.2304248849537/8.0),
8586 REAL_CONST(2280.4396659036897/8.0),
8587 REAL_CONST(2289.6582138976523/8.0),
8588 REAL_CONST(2298.8860501121762/8.0),
8589 REAL_CONST(2308.1231558867926/8.0),
8590 REAL_CONST(2317.3695126544767/8.0),
8591 REAL_CONST(2326.6251019409005/8.0),
8592 REAL_CONST(2335.8899053636933/8.0),
8593 REAL_CONST(2345.1639046317132/8.0),
8594 REAL_CONST(2354.4470815443233/8.0),
8595 REAL_CONST(2363.7394179906792/8.0),
8596 REAL_CONST(2373.0408959490205/8.0),
8597 REAL_CONST(2382.3514974859731/8.0),
8598 REAL_CONST(2391.6712047558558/8.0),
8599 REAL_CONST(2400.9999999999991/8.0),
8600 REAL_CONST(2410.3378655460651/8.0),
8601 REAL_CONST(2419.6847838073813/8.0),
8602 REAL_CONST(2429.0407372822747/8.0),
8603 REAL_CONST(2438.4057085534191/8.0),
8604 REAL_CONST(2447.7796802871858/8.0),
8605 REAL_CONST(2457.1626352330004/8.0),
8606 REAL_CONST(2466.5545562227112/8.0),
8607 REAL_CONST(2475.9554261699564/8.0),
8608 REAL_CONST(2485.3652280695474/8.0),
8609 REAL_CONST(2494.7839449968492/8.0),
8610 REAL_CONST(2504.2115601071737/8.0),
8611 REAL_CONST(2513.6480566351788/8.0),
8612 REAL_CONST(2523.0934178942675/8.0),
8613 REAL_CONST(2532.5476272760025/8.0),
8614 REAL_CONST(2542.0106682495189/8.0),
8615 REAL_CONST(2551.482524360948/8.0),
8616 REAL_CONST(2560.9631792328441/8.0),
8617 REAL_CONST(2570.4526165636184/8.0),
8618 REAL_CONST(2579.9508201269791/8.0),
8619 REAL_CONST(2589.4577737713744/8.0),
8620 REAL_CONST(2598.9734614194458/8.0),
8621 REAL_CONST(2608.4978670674823/8.0),
8622 REAL_CONST(2618.0309747848837/8.0),
8623 REAL_CONST(2627.5727687136259/8.0),
8624 REAL_CONST(2637.1232330677353/8.0),
8625 REAL_CONST(2646.6823521327647/8.0),
8626 REAL_CONST(2656.2501102652768/8.0),
8627 REAL_CONST(2665.8264918923328/8.0),
8628 REAL_CONST(2675.4114815109842/8.0),
8629 REAL_CONST(2685.0050636877722/8.0),
8630 REAL_CONST(2694.6072230582295/8.0),
8631 REAL_CONST(2704.2179443263894/8.0),
8632 REAL_CONST(2713.8372122642972/8.0),
8633 REAL_CONST(2723.4650117115279/8.0),
8634 REAL_CONST(2733.1013275747096/8.0),
8635 REAL_CONST(2742.7461448270483/8.0),
8636 REAL_CONST(2752.3994485078601/8.0),
8637 REAL_CONST(2762.0612237221085/8.0),
8638 REAL_CONST(2771.7314556399419/8.0),
8639 REAL_CONST(2781.4101294962406/8.0),
8640 REAL_CONST(2791.0972305901655/8.0),
8641 REAL_CONST(2800.7927442847094/8.0),
8642 REAL_CONST(2810.4966560062589/8.0),
8643 REAL_CONST(2820.2089512441521/8.0),
8644 REAL_CONST(2829.9296155502466/8.0),
8645 REAL_CONST(2839.6586345384894/8.0),
8646 REAL_CONST(2849.3959938844923/8.0),
8647 REAL_CONST(2859.1416793251065/8.0),
8648 REAL_CONST(2868.8956766580086/8.0),
8649 REAL_CONST(2878.6579717412847/8.0),
8650 REAL_CONST(2888.4285504930212/8.0),
8651 REAL_CONST(2898.2073988908974/8.0),
8652 REAL_CONST(2907.9945029717837/8.0),
8653 REAL_CONST(2917.789848831344/8.0),
8654 REAL_CONST(2927.5934226236377/8.0),
8655 REAL_CONST(2937.4052105607311/8.0),
8656 REAL_CONST(2947.2251989123079/8.0),
8657 REAL_CONST(2957.0533740052865/8.0),
8658 REAL_CONST(2966.8897222234368/8.0),
8659 REAL_CONST(2976.734230007005/8.0),
8660 REAL_CONST(2986.5868838523397/8.0),
8661 REAL_CONST(2996.4476703115197/8.0),
8662 REAL_CONST(3006.3165759919889/8.0),
8663 REAL_CONST(3016.1935875561908/8.0),
8664 REAL_CONST(3026.0786917212095/8.0),
8665 REAL_CONST(3035.9718752584108/8.0),
8666 REAL_CONST(3045.8731249930906/8.0),
8667 REAL_CONST(3055.7824278041207/8.0),
8668 REAL_CONST(3065.6997706236039/8.0),
8669 REAL_CONST(3075.625140436528/8.0),
8670 REAL_CONST(3085.5585242804245/8.0),
8671 REAL_CONST(3095.4999092450298/8.0),
8672 REAL_CONST(3105.4492824719491/8.0),
8673 REAL_CONST(3115.4066311543256/8.0),
8674 REAL_CONST(3125.3719425365089/8.0),
8675 REAL_CONST(3135.3452039137287/8.0),
8676 REAL_CONST(3145.3264026317715/8.0),
8677 REAL_CONST(3155.3155260866592/8.0),
8678 REAL_CONST(3165.3125617243295/8.0),
8679 REAL_CONST(3175.3174970403229/8.0),
8680 REAL_CONST(3185.3303195794679/8.0),
8681 REAL_CONST(3195.35101693557/8.0),
8682 REAL_CONST(3205.3795767511078/8.0),
8683 REAL_CONST(3215.4159867169251/8.0),
8684 REAL_CONST(3225.460234571929/8.0),
8685 REAL_CONST(3235.5123081027928/8.0),
8686 REAL_CONST(3245.5721951436558/8.0),
8687 REAL_CONST(3255.63988357583/8.0),
8688 REAL_CONST(3265.7153613275095/8.0),
8689 REAL_CONST(3275.7986163734795/8.0),
8690 REAL_CONST(3285.8896367348289/8.0),
8691 REAL_CONST(3295.9884104786665/8.0),
8692 REAL_CONST(3306.0949257178395/8.0),
8693 REAL_CONST(3316.2091706106517/8.0),
8694 REAL_CONST(3326.331133360588/8.0),
8695 REAL_CONST(3336.4608022160378/8.0),
8696 REAL_CONST(3346.5981654700231/8.0),
8697 REAL_CONST(3356.7432114599264/8.0),
8698 REAL_CONST(3366.8959285672249/8.0),
8699 REAL_CONST(3377.0563052172211/8.0),
8700 REAL_CONST(3387.2243298787821/8.0),
8701 REAL_CONST(3397.3999910640764/8.0),
8702 REAL_CONST(3407.5832773283128/8.0),
8703 REAL_CONST(3417.7741772694862/8.0),
8704 REAL_CONST(3427.9726795281199/8.0),
8705 REAL_CONST(3438.1787727870123/8.0),
8706 REAL_CONST(3448.3924457709873/8.0),
8707 REAL_CONST(3458.6136872466445/8.0),
8708 REAL_CONST(3468.8424860221107/8.0),
8709 REAL_CONST(3479.0788309467976/8.0),
8710 REAL_CONST(3489.3227109111554/8.0),
8711 REAL_CONST(3499.5741148464344/8.0),
8712 REAL_CONST(3509.8330317244445/8.0),
8713 REAL_CONST(3520.0994505573185/8.0),
8714 REAL_CONST(3530.3733603972751/8.0),
8715 REAL_CONST(3540.6547503363886/8.0),
8716 REAL_CONST(3550.9436095063534/8.0),
8717 REAL_CONST(3561.239927078258/8.0),
8718 REAL_CONST(3571.5436922623535/8.0),
8719 REAL_CONST(3581.8548943078308/8.0),
8720 REAL_CONST(3592.1735225025936/8.0),
8721 REAL_CONST(3602.4995661730372/8.0),
8722 REAL_CONST(3612.8330146838275/8.0),
8723 REAL_CONST(3623.1738574376814/8.0),
8724 REAL_CONST(3633.5220838751502/8.0),
8725 REAL_CONST(3643.8776834744031/8.0),
8726 REAL_CONST(3654.2406457510142/8.0),
8727 REAL_CONST(3664.6109602577494/8.0),
8728 REAL_CONST(3674.9886165843564/8.0),
8729 REAL_CONST(3685.3736043573545/8.0),
8730 REAL_CONST(3695.7659132398294/8.0),
8731 REAL_CONST(3706.1655329312248/8.0),
8732 REAL_CONST(3716.5724531671399/8.0),
8733 REAL_CONST(3726.9866637191262/8.0),
8734 REAL_CONST(3737.4081543944876/8.0),
8735 REAL_CONST(3747.8369150360782/8.0),
8736 REAL_CONST(3758.2729355221072/8.0),
8737 REAL_CONST(3768.7162057659411/8.0),
8738 REAL_CONST(3779.1667157159077/8.0),
8739 REAL_CONST(3789.6244553551055/8.0),
8740 REAL_CONST(3800.0894147012082/8.0),
8741 REAL_CONST(3810.5615838062768/8.0),
8742 REAL_CONST(3821.0409527565694/8.0),
8743 REAL_CONST(3831.5275116723533/8.0),
8744 REAL_CONST(3842.0212507077194/8.0),
8745 REAL_CONST(3852.522160050396/8.0),
8746 REAL_CONST(3863.0302299215673/8.0),
8747 REAL_CONST(3873.5454505756893/8.0),
8748 REAL_CONST(3884.0678123003108/8.0),
8749 REAL_CONST(3894.5973054158922/8.0),
8750 REAL_CONST(3905.1339202756285/8.0),
8751 REAL_CONST(3915.6776472652732/8.0),
8752 REAL_CONST(3926.2284768029604/8.0),
8753 REAL_CONST(3936.7863993390338/8.0),
8754 REAL_CONST(3947.3514053558706/8.0),
8755 REAL_CONST(3957.9234853677135/8.0),
8756 REAL_CONST(3968.5026299204969/8.0),
8757 REAL_CONST(3979.0888295916798/8.0),
8758 REAL_CONST(3989.6820749900776/8.0),
8759 REAL_CONST(4000.2823567556948/8.0),
8760 REAL_CONST(4010.8896655595613/8.0),
8761 REAL_CONST(4021.5039921035655/8.0),
8762 REAL_CONST(4032.1253271202945/8.0),
8763 REAL_CONST(4042.7536613728694/8.0),
8764 REAL_CONST(4053.3889856547858/8.0),
8765 REAL_CONST(4064.0312907897551/8.0),
8766 REAL_CONST(4074.6805676315448/8.0),
8767 REAL_CONST(4085.3368070638221/8.0),
8768 REAL_CONST(4095.9999999999982/8.0),
8769 REAL_CONST(4106.6701373830711/8.0),
8770 REAL_CONST(4117.347210185475/8.0),
8771 REAL_CONST(4128.0312094089259/8.0),
8772 REAL_CONST(4138.722126084268/8.0),
8773 REAL_CONST(4149.4199512713267/8.0),
8774 REAL_CONST(4160.1246760587583/8.0),
8775 REAL_CONST(4170.8362915638982/8.0),
8776 REAL_CONST(4181.5547889326181/8.0),
8777 REAL_CONST(4192.2801593391769/8.0),
8778 REAL_CONST(4203.0123939860741/8.0),
8779 REAL_CONST(4213.7514841039101/8.0),
8780 REAL_CONST(4224.4974209512384/8.0),
8781 REAL_CONST(4235.2501958144258/8.0),
8782 REAL_CONST(4246.0098000075095/8.0),
8783 REAL_CONST(4256.7762248720574/8.0),
8784 REAL_CONST(4267.549461777031/8.0),
8785 REAL_CONST(4278.3295021186423/8.0),
8786 REAL_CONST(4289.1163373202198/8.0),
8787 REAL_CONST(4299.9099588320714/8.0),
8788 REAL_CONST(4310.7103581313495/8.0),
8789 REAL_CONST(4321.5175267219138/8.0),
8790 REAL_CONST(4332.3314561342004/8.0),
8791 REAL_CONST(4343.152137925088/8.0),
8792 REAL_CONST(4353.9795636777671/8.0),
8793 REAL_CONST(4364.8137250016052/8.0),
8794 REAL_CONST(4375.6546135320223/8.0),
8795 REAL_CONST(4386.5022209303588/8.0),
8796 REAL_CONST(4397.3565388837469/8.0),
8797 REAL_CONST(4408.2175591049827/8.0),
8798 REAL_CONST(4419.0852733324018/8.0),
8799 REAL_CONST(4429.9596733297531/8.0),
8800 REAL_CONST(4440.8407508860728/8.0),
8801 REAL_CONST(4451.7284978155603/8.0),
8802 REAL_CONST(4462.6229059574571/8.0),
8803 REAL_CONST(4473.5239671759227/8.0),
8804 REAL_CONST(4484.4316733599126/8.0),
8805 REAL_CONST(4495.3460164230582/8.0),
8806 REAL_CONST(4506.2669883035496/8.0),
8807 REAL_CONST(4517.1945809640119/8.0),
8808 REAL_CONST(4528.1287863913894/8.0),
8809 REAL_CONST(4539.069596596828/8.0),
8810 REAL_CONST(4550.0170036155587/8.0),
8811 REAL_CONST(4560.9709995067806/8.0),
8812 REAL_CONST(4571.931576353546/8.0),
8813 REAL_CONST(4582.898726262647/8.0),
8814 REAL_CONST(4593.8724413645004/8.0),
8815 REAL_CONST(4604.8527138130348/8.0),
8816 REAL_CONST(4615.8395357855816/8.0),
8817 REAL_CONST(4626.8328994827571/8.0),
8818 REAL_CONST(4637.8327971283588/8.0),
8819 REAL_CONST(4648.8392209692511/8.0),
8820 REAL_CONST(4659.8521632752563/8.0),
8821 REAL_CONST(4670.8716163390473/8.0),
8822 REAL_CONST(4681.8975724760394/8.0),
8823 REAL_CONST(4692.9300240242837/8.0),
8824 REAL_CONST(4703.9689633443595/8.0),
8825 REAL_CONST(4715.0143828192668/8.0),
8826 REAL_CONST(4726.0662748543255/8.0),
8827 REAL_CONST(4737.1246318770682/8.0),
8828 REAL_CONST(4748.1894463371373/8.0),
8829 REAL_CONST(4759.2607107061804/8.0),
8830 REAL_CONST(4770.3384174777493/8.0),
8831 REAL_CONST(4781.4225591671993/8.0),
8832 REAL_CONST(4792.5131283115852/8.0),
8833 REAL_CONST(4803.6101174695614/8.0),
8834 REAL_CONST(4814.7135192212854/8.0),
8835 REAL_CONST(4825.8233261683154/8.0),
8836 REAL_CONST(4836.9395309335096/8.0),
8837 REAL_CONST(4848.0621261609349/8.0),
8838 REAL_CONST(4859.1911045157631/8.0),
8839 REAL_CONST(4870.3264586841779/8.0),
8840 REAL_CONST(4881.4681813732768/8.0),
8841 REAL_CONST(4892.6162653109768/8.0),
8842 REAL_CONST(4903.7707032459193/8.0),
8843 REAL_CONST(4914.931487947375/8.0),
8844 REAL_CONST(4926.0986122051509/8.0),
8845 REAL_CONST(4937.2720688294967/8.0),
8846 REAL_CONST(4948.4518506510112/8.0),
8847 REAL_CONST(4959.637950520555/8.0),
8848 REAL_CONST(4970.8303613091521/8.0),
8849 REAL_CONST(4982.0290759079044/8.0),
8850 REAL_CONST(4993.2340872278974/8.0),
8851 REAL_CONST(5004.4453882001153/8.0),
8852 REAL_CONST(5015.6629717753467/8.0),
8853 REAL_CONST(5026.8868309241007/8.0),
8854 REAL_CONST(5038.1169586365131/8.0),
8855 REAL_CONST(5049.353347922266/8.0),
8856 REAL_CONST(5060.5959918104927/8.0),
8857 REAL_CONST(5071.8448833496996/8.0),
8858 REAL_CONST(5083.1000156076734/8.0),
8859 REAL_CONST(5094.3613816713996/8.0),
8860 REAL_CONST(5105.6289746469747/8.0),
8861 REAL_CONST(5116.9027876595246/8.0),
8862 REAL_CONST(5128.18281385312/8.0),
8863 REAL_CONST(5139.4690463906918/8.0),
8864 REAL_CONST(5150.7614784539473/8.0),
8865 REAL_CONST(5162.0601032432933/8.0),
8866 REAL_CONST(5173.3649139777472/8.0),
8867 REAL_CONST(5184.6759038948594/8.0),
8868 REAL_CONST(5195.9930662506322/8.0),
8869 REAL_CONST(5207.3163943194386/8.0),
8870 REAL_CONST(5218.6458813939435/8.0),
8871 REAL_CONST(5229.9815207850224/8.0),
8872 REAL_CONST(5241.3233058216847/8.0),
8873 REAL_CONST(5252.6712298509919/8.0),
8874 REAL_CONST(5264.025286237983/8.0),
8875 REAL_CONST(5275.3854683655954/8.0),
8876 REAL_CONST(5286.7517696345885/8.0),
8877 REAL_CONST(5298.1241834634639/8.0),
8878 REAL_CONST(5309.5027032883945/8.0),
8879 REAL_CONST(5320.887322563146/8.0),
8880 REAL_CONST(5332.2780347589978/8.0),
8881 REAL_CONST(5343.6748333646756/8.0),
8882 REAL_CONST(5355.0777118862716/8.0),
8883 REAL_CONST(5366.4866638471722/8.0),
8884 REAL_CONST(5377.901682787985/8.0),
8885 REAL_CONST(5389.3227622664635/8.0),
8886 REAL_CONST(5400.749895857437/8.0),
8887 REAL_CONST(5412.1830771527357/8.0),
8888 REAL_CONST(5423.622299761123/8.0),
8889 REAL_CONST(5435.067557308219/8.0),
8890 REAL_CONST(5446.5188434364318/8.0),
8891 REAL_CONST(5457.9761518048872/8.0),
8892 REAL_CONST(5469.4394760893592/8.0),
8893 REAL_CONST(5480.9088099821975/8.0),
8894 REAL_CONST(5492.3841471922606/8.0),
8895 REAL_CONST(5503.8654814448455/8.0),
8896 REAL_CONST(5515.3528064816201/8.0),
8897 REAL_CONST(5526.846116060552/8.0),
8898 REAL_CONST(5538.3454039558474/8.0),
8899 REAL_CONST(5549.8506639578736/8.0),
8900 REAL_CONST(5561.3618898731029/8.0),
8901 REAL_CONST(5572.8790755240361/8.0),
8902 REAL_CONST(5584.4022147491451/8.0),
8903 REAL_CONST(5595.9313014027975/8.0),
8904 REAL_CONST(5607.4663293552012/8.0),
8905 REAL_CONST(5619.0072924923297/8.0),
8906 REAL_CONST(5630.5541847158656/8.0),
8907 REAL_CONST(5642.1069999431284/8.0),
8908 REAL_CONST(5653.665732107017/8.0),
8909 REAL_CONST(5665.230375155943/8.0),
8910 REAL_CONST(5676.8009230537655/8.0),
8911 REAL_CONST(5688.3773697797333/8.0),
8912 REAL_CONST(5699.9597093284156/8.0),
8913 REAL_CONST(5711.5479357096474/8.0),
8914 REAL_CONST(5723.1420429484588/8.0),
8915 REAL_CONST(5734.7420250850209/8.0),
8916 REAL_CONST(5746.347876174581/8.0),
8917 REAL_CONST(5757.9595902874016/8.0),
8918 REAL_CONST(5769.5771615087006/8.0),
8919 REAL_CONST(5781.2005839385911/8.0),
8920 REAL_CONST(5792.8298516920213/8.0),
8921 REAL_CONST(5804.4649588987149/8.0),
8922 REAL_CONST(5816.1058997031105/8.0),
8923 REAL_CONST(5827.7526682643065/8.0),
8924 REAL_CONST(5839.4052587559972/8.0),
8925 REAL_CONST(5851.0636653664196/8.0),
8926 REAL_CONST(5862.7278822982908/8.0),
8927 REAL_CONST(5874.3979037687541/8.0),
8928 REAL_CONST(5886.0737240093204/8.0),
8929 REAL_CONST(5897.7553372658094/8.0),
8930 REAL_CONST(5909.4427377982956/8.0),
8931 REAL_CONST(5921.1359198810505/8.0),
8932 REAL_CONST(5932.8348778024874/8.0),
8933 REAL_CONST(5944.5396058651031/8.0),
8934 REAL_CONST(5956.2500983854261/8.0),
8935 REAL_CONST(5967.9663496939575/8.0),
8936 REAL_CONST(5979.6883541351208/8.0),
8937 REAL_CONST(5991.4161060672022/8.0),
8938 REAL_CONST(6003.1495998623004/8.0),
8939 REAL_CONST(6014.8888299062692/8.0),
8940 REAL_CONST(6026.6337905986684/8.0),
8941 REAL_CONST(6038.3844763527022/8.0),
8942 REAL_CONST(6050.1408815951781/8.0),
8943 REAL_CONST(6061.9030007664414/8.0),
8944 REAL_CONST(6073.6708283203316/8.0),
8945 REAL_CONST(6085.4443587241267/8.0),
8946 REAL_CONST(6097.2235864584891/8.0),
8947 REAL_CONST(6109.0085060174197/8.0),
8948 REAL_CONST(6120.7991119081998/8.0),
8949 REAL_CONST(6132.595398651345/8.0),
8950 REAL_CONST(6144.3973607805519/8.0),
8951 REAL_CONST(6156.2049928426459/8.0),
8952 REAL_CONST(6168.0182893975361/8.0),
8953 REAL_CONST(6179.8372450181578/8.0),
8954 REAL_CONST(6191.6618542904307/8.0),
8955 REAL_CONST(6203.4921118132024/8.0),
8956 REAL_CONST(6215.3280121982016/8.0),
8957 REAL_CONST(6227.1695500699925/8.0),
8958 REAL_CONST(6239.0167200659189/8.0),
8959 REAL_CONST(6250.8695168360628/8.0),
8960 REAL_CONST(6262.7279350431891/8.0),
8961 REAL_CONST(6274.5919693627056/8.0),
8962 REAL_CONST(6286.4616144826068/8.0),
8963 REAL_CONST(6298.3368651034316/8.0),
8964 REAL_CONST(6310.2177159382172/8.0),
8965 REAL_CONST(6322.1041617124456/8.0),
8966 REAL_CONST(6333.9961971640032/8.0),
8967 REAL_CONST(6345.8938170431311/8.0),
8968 REAL_CONST(6357.7970161123785/8.0),
8969 REAL_CONST(6369.7057891465583/8.0),
8970 REAL_CONST(6381.6201309327007/8.0),
8971 REAL_CONST(6393.5400362700075/8.0),
8972 REAL_CONST(6405.4654999698032/8.0),
8973 REAL_CONST(6417.3965168554978/8.0),
8974 REAL_CONST(6429.3330817625329/8.0),
8975 REAL_CONST(6441.2751895383453/8.0),
8976 REAL_CONST(6453.2228350423138/8.0),
8977 REAL_CONST(6465.176013145724/8.0),
8978 REAL_CONST(6477.134718731716/8.0),
8979 REAL_CONST(6489.0989466952469/8.0),
8980 REAL_CONST(6501.0686919430445/8.0),
8981 REAL_CONST(6513.0439493935628/8.0),
8982 REAL_CONST(6525.0247139769417/8.0),
8983 REAL_CONST(6537.010980634961/8.0),
8984 REAL_CONST(6549.002744321001/8.0),
8985 REAL_CONST(6560.9999999999973/8.0),
8986 REAL_CONST(6573.0027426483985/8.0),
8987 REAL_CONST(6585.0109672541284/8.0),
8988 REAL_CONST(6597.0246688165371/8.0),
8989 REAL_CONST(6609.0438423463656/8.0),
8990 REAL_CONST(6621.0684828657004/8.0),
8991 REAL_CONST(6633.0985854079354/8.0),
8992 REAL_CONST(6645.134145017727/8.0),
8993 REAL_CONST(6657.1751567509573/8.0),
8994 REAL_CONST(6669.2216156746908/8.0),
8995 REAL_CONST(6681.2735168671343/8.0),
8996 REAL_CONST(6693.3308554176001/8.0),
8997 REAL_CONST(6705.3936264264594/8.0),
8998 REAL_CONST(6717.461825005108/8.0),
8999 REAL_CONST(6729.535446275926/8.0),
9000 REAL_CONST(6741.6144853722335/8.0),
9001 REAL_CONST(6753.6989374382601/8.0),
9002 REAL_CONST(6765.7887976290967/8.0),
9003 REAL_CONST(6777.8840611106634/8.0),
9004 REAL_CONST(6789.9847230596661/8.0),
9005 REAL_CONST(6802.0907786635626/8.0),
9006 REAL_CONST(6814.2022231205201/8.0),
9007 REAL_CONST(6826.3190516393797/8.0),
9008 REAL_CONST(6838.4412594396181/8.0),
9009 REAL_CONST(6850.5688417513074/8.0),
9010 REAL_CONST(6862.701793815083/8.0),
9011 REAL_CONST(6874.840110882099/8.0),
9012 REAL_CONST(6886.9837882139991/8.0),
9013 REAL_CONST(6899.1328210828724/8.0),
9014 REAL_CONST(6911.2872047712199/8.0),
9015 REAL_CONST(6923.4469345719199/8.0),
9016 REAL_CONST(6935.6120057881863/8.0),
9017 REAL_CONST(6947.7824137335365/8.0),
9018 REAL_CONST(6959.9581537317536/8.0),
9019 REAL_CONST(6972.1392211168532/8.0),
9020 REAL_CONST(6984.3256112330409/8.0),
9021 REAL_CONST(6996.5173194346862/8.0),
9022 REAL_CONST(7008.7143410862773/8.0),
9023 REAL_CONST(7020.9166715623942/8.0),
9024 REAL_CONST(7033.1243062476678/8.0),
9025 REAL_CONST(7045.3372405367481/8.0),
9026 REAL_CONST(7057.5554698342685/8.0),
9027 REAL_CONST(7069.7789895548103/8.0),
9028 REAL_CONST(7082.0077951228714/8.0),
9029 REAL_CONST(7094.2418819728273/8.0),
9030 REAL_CONST(7106.4812455489018/8.0),
9031 REAL_CONST(7118.7258813051285/8.0),
9032 REAL_CONST(7130.9757847053224/8.0),
9033 REAL_CONST(7143.2309512230404/8.0),
9034 REAL_CONST(7155.4913763415516/8.0),
9035 REAL_CONST(7167.7570555538041/8.0),
9036 REAL_CONST(7180.0279843623894/8.0),
9037 REAL_CONST(7192.3041582795131/8.0),
9038 REAL_CONST(7204.5855728269571/8.0),
9039 REAL_CONST(7216.8722235360519/8.0),
9040 REAL_CONST(7229.1641059476406/8.0),
9041 REAL_CONST(7241.4612156120484/8.0),
9042 REAL_CONST(7253.7635480890503/8.0),
9043 REAL_CONST(7266.0710989478375/8.0),
9044 REAL_CONST(7278.3838637669869/8.0),
9045 REAL_CONST(7290.7018381344296/8.0),
9046 REAL_CONST(7303.0250176474174/8.0),
9047 REAL_CONST(7315.3533979124932/8.0),
9048 REAL_CONST(7327.6869745454596/8.0),
9049 REAL_CONST(7340.0257431713462/8.0),
9050 REAL_CONST(7352.3696994243801/8.0),
9051 REAL_CONST(7364.7188389479543/8.0),
9052 REAL_CONST(7377.0731573945968/8.0),
9053 REAL_CONST(7389.4326504259407/8.0),
9054 REAL_CONST(7401.7973137126937/8.0),
9055 REAL_CONST(7414.1671429346061/8.0),
9056 REAL_CONST(7426.5421337804428/8.0),
9057 REAL_CONST(7438.922281947951/8.0),
9058 REAL_CONST(7451.3075831438346/8.0),
9059 REAL_CONST(7463.6980330837177/8.0),
9060 REAL_CONST(7476.0936274921214/8.0),
9061 REAL_CONST(7488.4943621024304/8.0),
9062 REAL_CONST(7500.9002326568652/8.0),
9063 REAL_CONST(7513.3112349064522/8.0),
9064 REAL_CONST(7525.7273646109943/8.0),
9065 REAL_CONST(7538.1486175390446/8.0),
9066 REAL_CONST(7550.5749894678729/8.0),
9067 REAL_CONST(7563.0064761834419/8.0),
9068 REAL_CONST(7575.4430734803736/8.0),
9069 REAL_CONST(7587.8847771619248/8.0),
9070 REAL_CONST(7600.3315830399597/8.0),
9071 REAL_CONST(7612.7834869349153/8.0),
9072 REAL_CONST(7625.24048467578/8.0),
9073 REAL_CONST(7637.7025721000637/8.0),
9074 REAL_CONST(7650.1697450537677/8.0),
9075 REAL_CONST(7662.6419993913596/8.0),
9076 REAL_CONST(7675.1193309757446/8.0),
9077 REAL_CONST(7687.6017356782404/8.0),
9078 REAL_CONST(7700.0892093785433/8.0),
9079 REAL_CONST(7712.5817479647112/8.0),
9080 REAL_CONST(7725.079347333125/8.0),
9081 REAL_CONST(7737.5820033884729/8.0),
9082 REAL_CONST(7750.0897120437139/8.0),
9083 REAL_CONST(7762.6024692200581/8.0),
9084 REAL_CONST(7775.1202708469355/8.0),
9085 REAL_CONST(7787.6431128619733/8.0),
9086 REAL_CONST(7800.1709912109645/8.0),
9087 REAL_CONST(7812.7039018478481/8.0),
9088 REAL_CONST(7825.2418407346768/8.0),
9089 REAL_CONST(7837.7848038415968/8.0),
9090 REAL_CONST(7850.3327871468155/8.0),
9091 REAL_CONST(7862.8857866365806/8.0),
9092 REAL_CONST(7875.4437983051539/8.0),
9093 REAL_CONST(7888.006818154784/8.0),
9094 REAL_CONST(7900.5748421956796/8.0),
9095 REAL_CONST(7913.1478664459901/8.0),
9096 REAL_CONST(7925.725886931772/8.0),
9097 REAL_CONST(7938.3088996869719/8.0),
9098 REAL_CONST(7950.8969007533951/8.0),
9099 REAL_CONST(7963.4898861806851/8.0),
9100 REAL_CONST(7976.0878520262959/8.0),
9101 REAL_CONST(7988.6907943554688/8.0),
9102 REAL_CONST(8001.2987092412086/8.0),
9103 REAL_CONST(8013.911592764257/8.0),
9104 REAL_CONST(8026.5294410130691/8.0),
9105 REAL_CONST(8039.1522500837891/8.0),
9106 REAL_CONST(8051.7800160802271/8.0),
9107 REAL_CONST(8064.412735113835/8.0),
9108 REAL_CONST(8077.0504033036796/8.0),
9109 REAL_CONST(8089.6930167764222/8.0),
9110 REAL_CONST(8102.3405716662946/8.0),
9111 REAL_CONST(8114.9930641150731/8.0),
9112 REAL_CONST(8127.6504902720571/8.0),
9113 REAL_CONST(8140.3128462940449/8.0),
9114 REAL_CONST(8152.9801283453098/8.0),
9115 REAL_CONST(8165.6523325975786/8.0),
9116 REAL_CONST(8178.3294552300049/8.0),
9117 REAL_CONST(8191.0114924291529/8.0),
9118 REAL_CONST(8203.6984403889655/8.0),
9119 REAL_CONST(8216.3902953107463/8.0),
9120 REAL_CONST(8229.0870534031419/8.0),
9121 REAL_CONST(8241.7887108821069/8.0),
9122 REAL_CONST(8254.4952639708936/8.0),
9123 REAL_CONST(8267.2067089000211/8.0),
9124 REAL_CONST(8279.9230419072574/8.0),
9125 REAL_CONST(8292.6442592375952/8.0),
9126 REAL_CONST(8305.3703571432306/8.0),
9127 REAL_CONST(8318.101331883543/8.0),
9128 REAL_CONST(8330.8371797250657/8.0),
9129 REAL_CONST(8343.577896941475/8.0),
9130 REAL_CONST(8356.3234798135582/8.0),
9131 REAL_CONST(8369.0739246291978/8.0),
9132 REAL_CONST(8381.8292276833508/8.0),
9133 REAL_CONST(8394.5893852780209/8.0),
9134 REAL_CONST(8407.3543937222421/8.0),
9135 REAL_CONST(8420.1242493320569/8.0),
9136 REAL_CONST(8432.8989484304948/8.0),
9137 REAL_CONST(8445.6784873475499/8.0),
9138 REAL_CONST(8458.4628624201578/8.0),
9139 REAL_CONST(8471.2520699921806/8.0),
9140 REAL_CONST(8484.0461064143838/8.0),
9141 REAL_CONST(8496.8449680444082/8.0),
9142 REAL_CONST(8509.6486512467636/8.0),
9143 REAL_CONST(8522.4571523927953/8.0),
9144 REAL_CONST(8535.270467860666/8.0),
9145 REAL_CONST(8548.0885940353437/8.0),
9146 REAL_CONST(8560.9115273085663/8.0),
9147 REAL_CONST(8573.7392640788403/8.0),
9148 REAL_CONST(8586.5718007514006/8.0),
9149 REAL_CONST(8599.4091337382069/8.0),
9150 REAL_CONST(8612.2512594579148/8.0),
9151 REAL_CONST(8625.0981743358552/8.0),
9152 REAL_CONST(8637.9498748040205/8.0),
9153 REAL_CONST(8650.8063573010386/8.0),
9154 REAL_CONST(8663.6676182721567/8.0),
9155 REAL_CONST(8676.533654169225/8.0),
9156 REAL_CONST(8689.4044614506638/8.0),
9157 REAL_CONST(8702.2800365814601/8.0),
9158 REAL_CONST(8715.1603760331418/8.0),
9159 REAL_CONST(8728.0454762837508/8.0),
9160 REAL_CONST(8740.9353338178389/8.0),
9161 REAL_CONST(8753.8299451264356/8.0),
9162 REAL_CONST(8766.7293067070332/8.0),
9163 REAL_CONST(8779.6334150635721/8.0),
9164 REAL_CONST(8792.5422667064158/8.0),
9165 REAL_CONST(8805.4558581523324/8.0),
9166 REAL_CONST(8818.3741859244819/8.0),
9167 REAL_CONST(8831.2972465523908/8.0),
9168 REAL_CONST(8844.2250365719356/8.0),
9169 REAL_CONST(8857.1575525253265/8.0),
9170 REAL_CONST(8870.0947909610859/8.0),
9171 REAL_CONST(8883.0367484340295/8.0),
9172 REAL_CONST(8895.9834215052524/8.0),
9173 REAL_CONST(8908.934806742107/8.0),
9174 REAL_CONST(8921.8909007181846/8.0),
9175 REAL_CONST(8934.8517000132997/8.0),
9176 REAL_CONST(8947.817201213471/8.0),
9177 REAL_CONST(8960.7874009109/8.0),
9178 REAL_CONST(8973.7622957039603/8.0),
9179 REAL_CONST(8986.7418821971733/8.0),
9180 REAL_CONST(8999.7261570011924/8.0),
9181 REAL_CONST(9012.7151167327884/8.0),
9182 REAL_CONST(9025.7087580148236/8.0),
9183 REAL_CONST(9038.7070774762469/8.0),
9184 REAL_CONST(9051.7100717520643/8.0),
9185 REAL_CONST(9064.7177374833282/8.0),
9186 REAL_CONST(9077.7300713171153/8.0),
9187 REAL_CONST(9090.7470699065179/8.0),
9188 REAL_CONST(9103.7687299106146/8.0),
9189 REAL_CONST(9116.7950479944648/8.0),
9190 REAL_CONST(9129.8260208290812/8.0),
9191 REAL_CONST(9142.8616450914233/8.0),
9192 REAL_CONST(9155.9019174643727/8.0),
9193 REAL_CONST(9168.9468346367157/8.0),
9194 REAL_CONST(9181.9963933031358/8.0),
9195 REAL_CONST(9195.0505901641845/8.0),
9196 REAL_CONST(9208.1094219262741/8.0),
9197 REAL_CONST(9221.1728853016557/8.0),
9198 REAL_CONST(9234.240977008405/8.0),
9199 REAL_CONST(9247.3136937704076/8.0),
9200 REAL_CONST(9260.3910323173386/8.0),
9201 REAL_CONST(9273.472989384647/8.0),
9202 REAL_CONST(9286.5595617135423/8.0),
9203 REAL_CONST(9299.6507460509747/8.0),
9204 REAL_CONST(9312.7465391496207/8.0),
9205 REAL_CONST(9325.8469377678684/8.0),
9206 REAL_CONST(9338.9519386698012/8.0),
9207 REAL_CONST(9352.0615386251757/8.0),
9208 REAL_CONST(9365.1757344094131/8.0),
9209 REAL_CONST(9378.2945228035842/8.0),
9210 REAL_CONST(9391.4179005943843/8.0),
9211 REAL_CONST(9404.5458645741273/8.0),
9212 REAL_CONST(9417.6784115407263/8.0),
9213 REAL_CONST(9430.8155382976747/8.0),
9214 REAL_CONST(9443.9572416540359/8.0),
9215 REAL_CONST(9457.1035184244265/8.0),
9216 REAL_CONST(9470.2543654290002/8.0),
9217 REAL_CONST(9483.4097794934296/8.0),
9218 REAL_CONST(9496.5697574488931/8.0),
9219 REAL_CONST(9509.7342961320664/8.0),
9220 REAL_CONST(9522.9033923850911/8.0),
9221 REAL_CONST(9536.0770430555804/8.0),
9222 REAL_CONST(9549.2552449965824/8.0),
9223 REAL_CONST(9562.4379950665825/8.0),
9224 REAL_CONST(9575.6252901294793/8.0),
9225 REAL_CONST(9588.8171270545736/8.0),
9226 REAL_CONST(9602.0135027165488/8.0),
9227 REAL_CONST(9615.2144139954635/8.0),
9228 REAL_CONST(9628.4198577767274/8.0),
9229 REAL_CONST(9641.629830951093/8.0),
9230 REAL_CONST(9654.844330414644/8.0),
9231 REAL_CONST(9668.0633530687719/8.0),
9232 REAL_CONST(9681.286895820167/8.0),
9233 REAL_CONST(9694.5149555808002/8.0),
9234 REAL_CONST(9707.7475292679192/8.0),
9235 REAL_CONST(9720.9846138040157/8.0),
9236 REAL_CONST(9734.2262061168276/8.0),
9237 REAL_CONST(9747.4723031393187/8.0),
9238 REAL_CONST(9760.7229018096641/8.0),
9239 REAL_CONST(9773.9779990712323/8.0),
9240 REAL_CONST(9787.2375918725811/8.0),
9241 REAL_CONST(9800.5016771674327/8.0),
9242 REAL_CONST(9813.7702519146696/8.0),
9243 REAL_CONST(9827.0433130783094/8.0),
9244 REAL_CONST(9840.3208576275028/8.0),
9245 REAL_CONST(9853.602882536512/8.0),
9246 REAL_CONST(9866.8893847846994/8.0),
9247 REAL_CONST(9880.1803613565116/8.0),
9248 REAL_CONST(9893.4758092414686/8.0),
9249 REAL_CONST(9906.7757254341523/8.0),
9250 REAL_CONST(9920.0801069341851/8.0),
9251 REAL_CONST(9933.3889507462245/8.0),
9252 REAL_CONST(9946.7022538799429/8.0),
9253 REAL_CONST(9960.0200133500221/8.0),
9254 REAL_CONST(9973.3422261761298/8.0),
9255 REAL_CONST(9986.6688893829159/8.0),
9256 REAL_CONST(9999.9999999999945/8.0),
9257 REAL_CONST(10013.335555061929/8.0),
9258 REAL_CONST(10026.675551608221/8.0),
9259 REAL_CONST(10040.019986683301/8.0),
9260 REAL_CONST(10053.368857336509/8.0),
9261 REAL_CONST(10066.722160622081/8.0),
9262 REAL_CONST(10080.079893599144/8.0),
9263 REAL_CONST(10093.442053331697/8.0),
9264 REAL_CONST(10106.808636888598/8.0),
9265 REAL_CONST(10120.179641343551/8.0),
9266 REAL_CONST(10133.555063775095/8.0),
9267 REAL_CONST(10146.934901266595/8.0),
9268 REAL_CONST(10160.31915090622/8.0),
9269 REAL_CONST(10173.707809786936/8.0),
9270 REAL_CONST(10187.100875006496/8.0),
9271 REAL_CONST(10200.498343667417/8.0),
9272 REAL_CONST(10213.900212876984/8.0),
9273 REAL_CONST(10227.306479747222/8.0),
9274 REAL_CONST(10240.717141394889/8.0),
9275 REAL_CONST(10254.132194941467/8.0),
9276 REAL_CONST(10267.551637513146/8.0),
9277 REAL_CONST(10280.975466240814/8.0),
9278 REAL_CONST(10294.40367826004/8.0),
9279 REAL_CONST(10307.836270711066/8.0),
9280 REAL_CONST(10321.273240738796/8.0),
9281 REAL_CONST(10334.71458549278/8.0)
9282 #ifdef BIG_IQ_TABLE
9283 ,REAL_CONST(10348.160302127204/8.0),
9284 REAL_CONST(10361.610387800878/8.0),
9285 REAL_CONST(10375.064839677221/8.0),
9286 REAL_CONST(10388.523654924258/8.0),
9287 REAL_CONST(10401.986830714593/8.0),
9288 REAL_CONST(10415.454364225412/8.0),
9289 REAL_CONST(10428.926252638465/8.0),
9290 REAL_CONST(10442.402493140049/8.0),
9291 REAL_CONST(10455.883082921007/8.0),
9292 REAL_CONST(10469.368019176709/8.0),
9293 REAL_CONST(10482.85729910704/8.0),
9294 REAL_CONST(10496.350919916393/8.0),
9295 REAL_CONST(10509.848878813653/8.0),
9296 REAL_CONST(10523.351173012188/8.0),
9297 REAL_CONST(10536.857799729838/8.0),
9298 REAL_CONST(10550.3687561889/8.0),
9299 REAL_CONST(10563.884039616123/8.0),
9300 REAL_CONST(10577.403647242685/8.0),
9301 REAL_CONST(10590.927576304197/8.0),
9302 REAL_CONST(10604.455824040679/8.0),
9303 REAL_CONST(10617.988387696556/8.0),
9304 REAL_CONST(10631.525264520642/8.0),
9305 REAL_CONST(10645.066451766135/8.0),
9306 REAL_CONST(10658.611946690598/8.0),
9307 REAL_CONST(10672.161746555956/8.0),
9308 REAL_CONST(10685.715848628475/8.0),
9309 REAL_CONST(10699.274250178762/8.0),
9310 REAL_CONST(10712.836948481747/8.0),
9311 REAL_CONST(10726.403940816675/8.0),
9312 REAL_CONST(10739.975224467091/8.0),
9313 REAL_CONST(10753.550796720834/8.0),
9314 REAL_CONST(10767.130654870027/8.0),
9315 REAL_CONST(10780.714796211059/8.0),
9316 REAL_CONST(10794.303218044579/8.0),
9317 REAL_CONST(10807.895917675487/8.0),
9318 REAL_CONST(10821.492892412922/8.0),
9319 REAL_CONST(10835.094139570248/8.0),
9320 REAL_CONST(10848.699656465047/8.0),
9321 REAL_CONST(10862.309440419107/8.0),
9322 REAL_CONST(10875.923488758415/8.0),
9323 REAL_CONST(10889.541798813138/8.0),
9324 REAL_CONST(10903.16436791762/8.0),
9325 REAL_CONST(10916.791193410372/8.0),
9326 REAL_CONST(10930.422272634056/8.0),
9327 REAL_CONST(10944.05760293548/8.0),
9328 REAL_CONST(10957.697181665582/8.0),
9329 REAL_CONST(10971.341006179427/8.0),
9330 REAL_CONST(10984.98907383619/8.0),
9331 REAL_CONST(10998.641381999149/8.0),
9332 REAL_CONST(11012.297928035676/8.0),
9333 REAL_CONST(11025.958709317223/8.0),
9334 REAL_CONST(11039.623723219316/8.0),
9335 REAL_CONST(11053.292967121541/8.0),
9336 REAL_CONST(11066.966438407539/8.0),
9337 REAL_CONST(11080.64413446499/8.0),
9338 REAL_CONST(11094.326052685608/8.0),
9339 REAL_CONST(11108.012190465128/8.0),
9340 REAL_CONST(11121.702545203296/8.0),
9341 REAL_CONST(11135.397114303863/8.0),
9342 REAL_CONST(11149.095895174571/8.0),
9343 REAL_CONST(11162.798885227143/8.0),
9344 REAL_CONST(11176.506081877278/8.0),
9345 REAL_CONST(11190.217482544635/8.0),
9346 REAL_CONST(11203.933084652828/8.0),
9347 REAL_CONST(11217.652885629415/8.0),
9348 REAL_CONST(11231.376882905886/8.0),
9349 REAL_CONST(11245.105073917659/8.0),
9350 REAL_CONST(11258.837456104062/8.0),
9351 REAL_CONST(11272.574026908333/8.0),
9352 REAL_CONST(11286.314783777601/8.0),
9353 REAL_CONST(11300.059724162888/8.0),
9354 REAL_CONST(11313.808845519083/8.0),
9355 REAL_CONST(11327.562145304952/8.0),
9356 REAL_CONST(11341.319620983111/8.0),
9357 REAL_CONST(11355.081270020033/8.0),
9358 REAL_CONST(11368.847089886023/8.0),
9359 REAL_CONST(11382.617078055218/8.0),
9360 REAL_CONST(11396.391232005579/8.0),
9361 REAL_CONST(11410.169549218874/8.0),
9362 REAL_CONST(11423.952027180676/8.0),
9363 REAL_CONST(11437.738663380349/8.0),
9364 REAL_CONST(11451.529455311042/8.0),
9365 REAL_CONST(11465.324400469679/8.0),
9366 REAL_CONST(11479.123496356951/8.0),
9367 REAL_CONST(11492.926740477304/8.0),
9368 REAL_CONST(11506.734130338931/8.0),
9369 REAL_CONST(11520.545663453764/8.0),
9370 REAL_CONST(11534.361337337466/8.0),
9371 REAL_CONST(11548.181149509423/8.0),
9372 REAL_CONST(11562.005097492724/8.0),
9373 REAL_CONST(11575.83317881417/8.0),
9374 REAL_CONST(11589.665391004253/8.0),
9375 REAL_CONST(11603.501731597149/8.0),
9376 REAL_CONST(11617.342198130715/8.0),
9377 REAL_CONST(11631.186788146468/8.0),
9378 REAL_CONST(11645.035499189589/8.0),
9379 REAL_CONST(11658.888328808911/8.0),
9380 REAL_CONST(11672.745274556904/8.0),
9381 REAL_CONST(11686.606333989675/8.0),
9382 REAL_CONST(11700.471504666955/8.0),
9383 REAL_CONST(11714.340784152086/8.0),
9384 REAL_CONST(11728.214170012021/8.0),
9385 REAL_CONST(11742.091659817312/8.0),
9386 REAL_CONST(11755.973251142101/8.0),
9387 REAL_CONST(11769.858941564111/8.0),
9388 REAL_CONST(11783.748728664636/8.0),
9389 REAL_CONST(11797.642610028539/8.0),
9390 REAL_CONST(11811.540583244237/8.0),
9391 REAL_CONST(11825.442645903697/8.0),
9392 REAL_CONST(11839.34879560242/8.0),
9393 REAL_CONST(11853.259029939445/8.0),
9394 REAL_CONST(11867.173346517333/8.0),
9395 REAL_CONST(11881.091742942155/8.0),
9396 REAL_CONST(11895.014216823492/8.0),
9397 REAL_CONST(11908.940765774427/8.0),
9398 REAL_CONST(11922.871387411526/8.0),
9399 REAL_CONST(11936.806079354839/8.0),
9400 REAL_CONST(11950.744839227897/8.0),
9401 REAL_CONST(11964.687664657684/8.0),
9402 REAL_CONST(11978.634553274653/8.0),
9403 REAL_CONST(11992.585502712702/8.0),
9404 REAL_CONST(12006.540510609168/8.0),
9405 REAL_CONST(12020.499574604828/8.0),
9406 REAL_CONST(12034.462692343877/8.0),
9407 REAL_CONST(12048.429861473938/8.0),
9408 REAL_CONST(12062.401079646032/8.0),
9409 REAL_CONST(12076.376344514589/8.0),
9410 REAL_CONST(12090.355653737433/8.0),
9411 REAL_CONST(12104.339004975769/8.0),
9412 REAL_CONST(12118.326395894188/8.0),
9413 REAL_CONST(12132.317824160644/8.0),
9414 REAL_CONST(12146.313287446457/8.0),
9415 REAL_CONST(12160.312783426305/8.0),
9416 REAL_CONST(12174.316309778205/8.0),
9417 REAL_CONST(12188.323864183525/8.0),
9418 REAL_CONST(12202.335444326955/8.0),
9419 REAL_CONST(12216.351047896511/8.0),
9420 REAL_CONST(12230.370672583531/8.0),
9421 REAL_CONST(12244.394316082657/8.0),
9422 REAL_CONST(12258.421976091831/8.0),
9423 REAL_CONST(12272.453650312296/8.0),
9424 REAL_CONST(12286.489336448574/8.0),
9425 REAL_CONST(12300.529032208471/8.0),
9426 REAL_CONST(12314.572735303058/8.0),
9427 REAL_CONST(12328.620443446678/8.0),
9428 REAL_CONST(12342.672154356922/8.0),
9429 REAL_CONST(12356.727865754638/8.0),
9430 REAL_CONST(12370.787575363909/8.0),
9431 REAL_CONST(12384.851280912055/8.0),
9432 REAL_CONST(12398.918980129623/8.0),
9433 REAL_CONST(12412.990670750381/8.0),
9434 REAL_CONST(12427.066350511306/8.0),
9435 REAL_CONST(12441.146017152583/8.0),
9436 REAL_CONST(12455.229668417589/8.0),
9437 REAL_CONST(12469.317302052901/8.0),
9438 REAL_CONST(12483.40891580827/8.0),
9439 REAL_CONST(12497.50450743663/8.0),
9440 REAL_CONST(12511.604074694078/8.0),
9441 REAL_CONST(12525.707615339878/8.0),
9442 REAL_CONST(12539.815127136444/8.0),
9443 REAL_CONST(12553.926607849342/8.0),
9444 REAL_CONST(12568.042055247275/8.0),
9445 REAL_CONST(12582.161467102082/8.0),
9446 REAL_CONST(12596.284841188726/8.0),
9447 REAL_CONST(12610.41217528529/8.0),
9448 REAL_CONST(12624.543467172971/8.0),
9449 REAL_CONST(12638.678714636069/8.0),
9450 REAL_CONST(12652.817915461985/8.0),
9451 REAL_CONST(12666.961067441209/8.0),
9452 REAL_CONST(12681.108168367316/8.0),
9453 REAL_CONST(12695.259216036962/8.0),
9454 REAL_CONST(12709.414208249869/8.0),
9455 REAL_CONST(12723.573142808827/8.0),
9456 REAL_CONST(12737.736017519681/8.0),
9457 REAL_CONST(12751.902830191326/8.0),
9458 REAL_CONST(12766.073578635704/8.0),
9459 REAL_CONST(12780.248260667788/8.0),
9460 REAL_CONST(12794.426874105588/8.0),
9461 REAL_CONST(12808.609416770132/8.0),
9462 REAL_CONST(12822.795886485468/8.0),
9463 REAL_CONST(12836.986281078653/8.0),
9464 REAL_CONST(12851.180598379744/8.0),
9465 REAL_CONST(12865.378836221802/8.0),
9466 REAL_CONST(12879.580992440871/8.0),
9467 REAL_CONST(12893.787064875984/8.0),
9468 REAL_CONST(12907.997051369144/8.0),
9469 REAL_CONST(12922.210949765335/8.0),
9470 REAL_CONST(12936.428757912496/8.0),
9471 REAL_CONST(12950.650473661524/8.0),
9472 REAL_CONST(12964.876094866273/8.0),
9473 REAL_CONST(12979.105619383534/8.0),
9474 REAL_CONST(12993.339045073039/8.0),
9475 REAL_CONST(13007.576369797454/8.0),
9476 REAL_CONST(13021.817591422368/8.0),
9477 REAL_CONST(13036.062707816285/8.0),
9478 REAL_CONST(13050.311716850629/8.0),
9479 REAL_CONST(13064.564616399723/8.0),
9480 REAL_CONST(13078.821404340792/8.0),
9481 REAL_CONST(13093.082078553954/8.0),
9482 REAL_CONST(13107.346636922217/8.0),
9483 REAL_CONST(13121.615077331464/8.0),
9484 REAL_CONST(13135.887397670458/8.0),
9485 REAL_CONST(13150.163595830827/8.0),
9486 REAL_CONST(13164.44366970706/8.0),
9487 REAL_CONST(13178.727617196502/8.0),
9488 REAL_CONST(13193.015436199352/8.0),
9489 REAL_CONST(13207.307124618648/8.0),
9490 REAL_CONST(13221.602680360265/8.0),
9491 REAL_CONST(13235.902101332911/8.0),
9492 REAL_CONST(13250.205385448118/8.0),
9493 REAL_CONST(13264.512530620239/8.0),
9494 REAL_CONST(13278.823534766434/8.0),
9495 REAL_CONST(13293.138395806676/8.0),
9496 REAL_CONST(13307.457111663734/8.0),
9497 REAL_CONST(13321.779680263176/8.0),
9498 REAL_CONST(13336.106099533356/8.0),
9499 REAL_CONST(13350.436367405409/8.0),
9500 REAL_CONST(13364.77048181325/8.0),
9501 REAL_CONST(13379.108440693562/8.0),
9502 REAL_CONST(13393.450241985796/8.0),
9503 REAL_CONST(13407.795883632158/8.0),
9504 REAL_CONST(13422.145363577607/8.0),
9505 REAL_CONST(13436.498679769853/8.0),
9506 REAL_CONST(13450.855830159346/8.0),
9507 REAL_CONST(13465.216812699266/8.0),
9508 REAL_CONST(13479.581625345529/8.0),
9509 REAL_CONST(13493.950266056772/8.0),
9510 REAL_CONST(13508.32273279435/8.0),
9511 REAL_CONST(13522.699023522329/8.0),
9512 REAL_CONST(13537.079136207483/8.0),
9513 REAL_CONST(13551.463068819286/8.0),
9514 REAL_CONST(13565.850819329906/8.0),
9515 REAL_CONST(13580.2423857142/8.0),
9516 REAL_CONST(13594.63776594971/8.0),
9517 REAL_CONST(13609.036958016657/8.0),
9518 REAL_CONST(13623.439959897927/8.0),
9519 REAL_CONST(13637.846769579081/8.0),
9520 REAL_CONST(13652.257385048335/8.0),
9521 REAL_CONST(13666.67180429656/8.0),
9522 REAL_CONST(13681.090025317284/8.0),
9523 REAL_CONST(13695.512046106669/8.0),
9524 REAL_CONST(13709.937864663521/8.0),
9525 REAL_CONST(13724.367478989278/8.0),
9526 REAL_CONST(13738.800887088004/8.0),
9527 REAL_CONST(13753.238086966385/8.0),
9528 REAL_CONST(13767.679076633727/8.0),
9529 REAL_CONST(13782.123854101939/8.0),
9530 REAL_CONST(13796.572417385545/8.0),
9531 REAL_CONST(13811.024764501659/8.0),
9532 REAL_CONST(13825.480893469998/8.0),
9533 REAL_CONST(13839.94080231286/8.0),
9534 REAL_CONST(13854.404489055134/8.0),
9535 REAL_CONST(13868.871951724283/8.0),
9536 REAL_CONST(13883.34318835034/8.0),
9537 REAL_CONST(13897.818196965914/8.0),
9538 REAL_CONST(13912.296975606168/8.0),
9539 REAL_CONST(13926.779522308825/8.0),
9540 REAL_CONST(13941.26583511416/8.0),
9541 REAL_CONST(13955.755912064991/8.0),
9542 REAL_CONST(13970.249751206682/8.0),
9543 REAL_CONST(13984.747350587126/8.0),
9544 REAL_CONST(13999.248708256751/8.0),
9545 REAL_CONST(14013.753822268511/8.0),
9546 REAL_CONST(14028.262690677873/8.0),
9547 REAL_CONST(14042.775311542828/8.0),
9548 REAL_CONST(14057.291682923867/8.0),
9549 REAL_CONST(14071.811802883994/8.0),
9550 REAL_CONST(14086.335669488704/8.0),
9551 REAL_CONST(14100.863280805994/8.0),
9552 REAL_CONST(14115.394634906341/8.0),
9553 REAL_CONST(14129.92972986271/8.0),
9554 REAL_CONST(14144.468563750548/8.0),
9555 REAL_CONST(14159.01113464777/8.0),
9556 REAL_CONST(14173.55744063476/8.0),
9557 REAL_CONST(14188.107479794369/8.0),
9558 REAL_CONST(14202.661250211901/8.0),
9559 REAL_CONST(14217.218749975118/8.0),
9560 REAL_CONST(14231.779977174227/8.0),
9561 REAL_CONST(14246.344929901879/8.0),
9562 REAL_CONST(14260.913606253163/8.0),
9563 REAL_CONST(14275.486004325601/8.0),
9564 REAL_CONST(14290.062122219146/8.0),
9565 REAL_CONST(14304.641958036171/8.0),
9566 REAL_CONST(14319.225509881464/8.0),
9567 REAL_CONST(14333.812775862236/8.0),
9568 REAL_CONST(14348.403754088098/8.0),
9569 REAL_CONST(14362.998442671067/8.0),
9570 REAL_CONST(14377.59683972556/8.0),
9571 REAL_CONST(14392.198943368388/8.0),
9572 REAL_CONST(14406.804751718748/8.0),
9573 REAL_CONST(14421.414262898223/8.0),
9574 REAL_CONST(14436.027475030774/8.0),
9575 REAL_CONST(14450.64438624274/8.0),
9576 REAL_CONST(14465.264994662828/8.0),
9577 REAL_CONST(14479.889298422106/8.0),
9578 REAL_CONST(14494.517295654005/8.0),
9579 REAL_CONST(14509.148984494313/8.0),
9580 REAL_CONST(14523.784363081166/8.0),
9581 REAL_CONST(14538.423429555049/8.0),
9582 REAL_CONST(14553.066182058781/8.0),
9583 REAL_CONST(14567.712618737527/8.0),
9584 REAL_CONST(14582.362737738777/8.0),
9585 REAL_CONST(14597.016537212348/8.0),
9586 REAL_CONST(14611.674015310382/8.0),
9587 REAL_CONST(14626.33517018734/8.0),
9588 REAL_CONST(14640.999999999993/8.0),
9589 REAL_CONST(14655.668502907418/8.0),
9590 REAL_CONST(14670.340677071003/8.0),
9591 REAL_CONST(14685.016520654426/8.0),
9592 REAL_CONST(14699.696031823671/8.0),
9593 REAL_CONST(14714.379208746999/8.0),
9594 REAL_CONST(14729.066049594967/8.0),
9595 REAL_CONST(14743.756552540408/8.0),
9596 REAL_CONST(14758.45071575843/8.0),
9597 REAL_CONST(14773.148537426418/8.0),
9598 REAL_CONST(14787.850015724018/8.0),
9599 REAL_CONST(14802.555148833142/8.0),
9600 REAL_CONST(14817.263934937961/8.0),
9601 REAL_CONST(14831.976372224897/8.0),
9602 REAL_CONST(14846.692458882624/8.0),
9603 REAL_CONST(14861.41219310206/8.0),
9604 REAL_CONST(14876.135573076363/8.0),
9605 REAL_CONST(14890.862597000923/8.0),
9606 REAL_CONST(14905.593263073371/8.0),
9607 REAL_CONST(14920.327569493558/8.0),
9608 REAL_CONST(14935.065514463557/8.0),
9609 REAL_CONST(14949.807096187662/8.0),
9610 REAL_CONST(14964.552312872382/8.0),
9611 REAL_CONST(14979.301162726431/8.0),
9612 REAL_CONST(14994.053643960735/8.0),
9613 REAL_CONST(15008.809754788414/8.0),
9614 REAL_CONST(15023.569493424788/8.0),
9615 REAL_CONST(15038.332858087369/8.0),
9616 REAL_CONST(15053.099846995858/8.0),
9617 REAL_CONST(15067.870458372134/8.0),
9618 REAL_CONST(15082.644690440264/8.0),
9619 REAL_CONST(15097.422541426484/8.0),
9620 REAL_CONST(15112.204009559202/8.0),
9621 REAL_CONST(15126.989093068994/8.0),
9622 REAL_CONST(15141.777790188597/8.0),
9623 REAL_CONST(15156.570099152905/8.0),
9624 REAL_CONST(15171.366018198967/8.0),
9625 REAL_CONST(15186.165545565986/8.0),
9626 REAL_CONST(15200.968679495301/8.0),
9627 REAL_CONST(15215.775418230402/8.0),
9628 REAL_CONST(15230.585760016909/8.0),
9629 REAL_CONST(15245.399703102579/8.0),
9630 REAL_CONST(15260.217245737298/8.0),
9631 REAL_CONST(15275.038386173073/8.0),
9632 REAL_CONST(15289.863122664035/8.0),
9633 REAL_CONST(15304.691453466432/8.0),
9634 REAL_CONST(15319.523376838621/8.0),
9635 REAL_CONST(15334.358891041069/8.0),
9636 REAL_CONST(15349.197994336346/8.0),
9637 REAL_CONST(15364.040684989128/8.0),
9638 REAL_CONST(15378.886961266177/8.0),
9639 REAL_CONST(15393.736821436356/8.0),
9640 REAL_CONST(15408.590263770609/8.0),
9641 REAL_CONST(15423.447286541972/8.0),
9642 REAL_CONST(15438.307888025554/8.0),
9643 REAL_CONST(15453.172066498542/8.0),
9644 REAL_CONST(15468.039820240196/8.0),
9645 REAL_CONST(15482.91114753184/8.0),
9646 REAL_CONST(15497.786046656869/8.0),
9647 REAL_CONST(15512.664515900733/8.0),
9648 REAL_CONST(15527.546553550939/8.0),
9649 REAL_CONST(15542.432157897045/8.0),
9650 REAL_CONST(15557.32132723066/8.0),
9651 REAL_CONST(15572.214059845435/8.0),
9652 REAL_CONST(15587.110354037064/8.0),
9653 REAL_CONST(15602.010208103273/8.0),
9654 REAL_CONST(15616.913620343823/8.0),
9655 REAL_CONST(15631.820589060506/8.0),
9656 REAL_CONST(15646.731112557136/8.0),
9657 REAL_CONST(15661.645189139546/8.0),
9658 REAL_CONST(15676.562817115593/8.0),
9659 REAL_CONST(15691.483994795139/8.0),
9660 REAL_CONST(15706.408720490062/8.0),
9661 REAL_CONST(15721.336992514242/8.0),
9662 REAL_CONST(15736.268809183561/8.0),
9663 REAL_CONST(15751.204168815901/8.0),
9664 REAL_CONST(15766.143069731135/8.0),
9665 REAL_CONST(15781.085510251132/8.0),
9666 REAL_CONST(15796.03148869974/8.0),
9667 REAL_CONST(15810.981003402798/8.0),
9668 REAL_CONST(15825.934052688119/8.0),
9669 REAL_CONST(15840.890634885489/8.0),
9670 REAL_CONST(15855.850748326673/8.0),
9671 REAL_CONST(15870.814391345401/8.0),
9672 REAL_CONST(15885.781562277361/8.0),
9673 REAL_CONST(15900.752259460214/8.0),
9674 REAL_CONST(15915.726481233565/8.0),
9675 REAL_CONST(15930.704225938984/8.0),
9676 REAL_CONST(15945.685491919978/8.0),
9677 REAL_CONST(15960.670277522009/8.0),
9678 REAL_CONST(15975.658581092481/8.0),
9679 REAL_CONST(15990.65040098073/8.0),
9680 REAL_CONST(16005.645735538035/8.0),
9681 REAL_CONST(16020.644583117599/8.0),
9682 REAL_CONST(16035.646942074556/8.0),
9683 REAL_CONST(16050.652810765967/8.0),
9684 REAL_CONST(16065.662187550806/8.0),
9685 REAL_CONST(16080.675070789974/8.0),
9686 REAL_CONST(16095.691458846273/8.0),
9687 REAL_CONST(16110.711350084424/8.0),
9688 REAL_CONST(16125.734742871053/8.0),
9689 REAL_CONST(16140.761635574685/8.0),
9690 REAL_CONST(16155.792026565747/8.0),
9691 REAL_CONST(16170.825914216561/8.0),
9692 REAL_CONST(16185.863296901338/8.0),
9693 REAL_CONST(16200.904172996183/8.0),
9694 REAL_CONST(16215.948540879079/8.0),
9695 REAL_CONST(16230.996398929899/8.0),
9696 REAL_CONST(16246.047745530386/8.0),
9697 REAL_CONST(16261.102579064163/8.0),
9698 REAL_CONST(16276.160897916721/8.0),
9699 REAL_CONST(16291.22270047542/8.0),
9700 REAL_CONST(16306.287985129484/8.0),
9701 REAL_CONST(16321.356750269995/8.0),
9702 REAL_CONST(16336.428994289896/8.0),
9703 REAL_CONST(16351.504715583982/8.0),
9704 REAL_CONST(16366.5839125489/8.0),
9705 REAL_CONST(16381.666583583141/8.0),
9706 REAL_CONST(16396.752727087041/8.0),
9707 REAL_CONST(16411.842341462776/8.0),
9708 REAL_CONST(16426.935425114363/8.0),
9709 REAL_CONST(16442.031976447644/8.0),
9710 REAL_CONST(16457.131993870298/8.0),
9711 REAL_CONST(16472.235475791829/8.0),
9712 REAL_CONST(16487.342420623561/8.0),
9713 REAL_CONST(16502.452826778641/8.0),
9714 REAL_CONST(16517.566692672033/8.0),
9715 REAL_CONST(16532.684016720516/8.0),
9716 REAL_CONST(16547.804797342676/8.0),
9717 REAL_CONST(16562.929032958902/8.0),
9718 REAL_CONST(16578.056721991394/8.0),
9719 REAL_CONST(16593.18786286415/8.0),
9720 REAL_CONST(16608.322454002962/8.0),
9721 REAL_CONST(16623.460493835417/8.0),
9722 REAL_CONST(16638.601980790896/8.0),
9723 REAL_CONST(16653.746913300558/8.0),
9724 REAL_CONST(16668.895289797354/8.0),
9725 REAL_CONST(16684.047108716015/8.0),
9726 REAL_CONST(16699.202368493046/8.0),
9727 REAL_CONST(16714.361067566726/8.0),
9728 REAL_CONST(16729.523204377107/8.0),
9729 REAL_CONST(16744.688777366009/8.0),
9730 REAL_CONST(16759.857784977012/8.0),
9731 REAL_CONST(16775.030225655464/8.0),
9732 REAL_CONST(16790.206097848466/8.0),
9733 REAL_CONST(16805.385400004874/8.0),
9734 REAL_CONST(16820.568130575302/8.0),
9735 REAL_CONST(16835.754288012104/8.0),
9736 REAL_CONST(16850.943870769381/8.0),
9737 REAL_CONST(16866.136877302983/8.0),
9738 REAL_CONST(16881.333306070494/8.0),
9739 REAL_CONST(16896.53315553123/8.0),
9740 REAL_CONST(16911.736424146249/8.0),
9741 REAL_CONST(16926.943110378332/8.0),
9742 REAL_CONST(16942.153212691992/8.0),
9743 REAL_CONST(16957.366729553454/8.0),
9744 REAL_CONST(16972.583659430682/8.0),
9745 REAL_CONST(16987.804000793338/8.0),
9746 REAL_CONST(17003.027752112816/8.0),
9747 REAL_CONST(17018.254911862205/8.0),
9748 REAL_CONST(17033.485478516312/8.0),
9749 REAL_CONST(17048.719450551645/8.0),
9750 REAL_CONST(17063.956826446421/8.0),
9751 REAL_CONST(17079.197604680547/8.0),
9752 REAL_CONST(17094.44178373563/8.0),
9753 REAL_CONST(17109.689362094967/8.0),
9754 REAL_CONST(17124.940338243552/8.0),
9755 REAL_CONST(17140.194710668064/8.0),
9756 REAL_CONST(17155.452477856852/8.0),
9757 REAL_CONST(17170.713638299967/8.0),
9758 REAL_CONST(17185.978190489128/8.0),
9759 REAL_CONST(17201.246132917724/8.0),
9760 REAL_CONST(17216.517464080825/8.0),
9761 REAL_CONST(17231.792182475165/8.0),
9762 REAL_CONST(17247.070286599141/8.0),
9763 REAL_CONST(17262.351774952826/8.0),
9764 REAL_CONST(17277.636646037936/8.0),
9765 REAL_CONST(17292.924898357855/8.0),
9766 REAL_CONST(17308.216530417623/8.0),
9767 REAL_CONST(17323.511540723921/8.0),
9768 REAL_CONST(17338.809927785089/8.0),
9769 REAL_CONST(17354.111690111105/8.0),
9770 REAL_CONST(17369.416826213594/8.0),
9771 REAL_CONST(17384.725334605821/8.0),
9772 REAL_CONST(17400.037213802683/8.0),
9773 REAL_CONST(17415.352462320716/8.0),
9774 REAL_CONST(17430.67107867809/8.0),
9775 REAL_CONST(17445.993061394587/8.0),
9776 REAL_CONST(17461.318408991636/8.0),
9777 REAL_CONST(17476.647119992274/8.0),
9778 REAL_CONST(17491.979192921168/8.0),
9779 REAL_CONST(17507.314626304586/8.0),
9780 REAL_CONST(17522.653418670423/8.0),
9781 REAL_CONST(17537.995568548187/8.0),
9782 REAL_CONST(17553.341074468986/8.0),
9783 REAL_CONST(17568.689934965536/8.0),
9784 REAL_CONST(17584.042148572156/8.0),
9785 REAL_CONST(17599.397713824768/8.0),
9786 REAL_CONST(17614.75662926089/8.0),
9787 REAL_CONST(17630.118893419625/8.0),
9788 REAL_CONST(17645.484504841683/8.0),
9789 REAL_CONST(17660.853462069354/8.0),
9790 REAL_CONST(17676.225763646511/8.0),
9791 REAL_CONST(17691.601408118619/8.0),
9792 REAL_CONST(17706.980394032718/8.0),
9793 REAL_CONST(17722.362719937424/8.0),
9794 REAL_CONST(17737.748384382936/8.0),
9795 REAL_CONST(17753.137385921014/8.0),
9796 REAL_CONST(17768.529723104999/8.0),
9797 REAL_CONST(17783.92539448979/8.0),
9798 REAL_CONST(17799.324398631856/8.0),
9799 REAL_CONST(17814.726734089225/8.0),
9800 REAL_CONST(17830.13239942148/8.0),
9801 REAL_CONST(17845.541393189767/8.0),
9802 REAL_CONST(17860.95371395678/8.0),
9803 REAL_CONST(17876.369360286772/8.0),
9804 REAL_CONST(17891.788330745527/8.0),
9805 REAL_CONST(17907.210623900395/8.0),
9806 REAL_CONST(17922.636238320254/8.0),
9807 REAL_CONST(17938.065172575527/8.0),
9808 REAL_CONST(17953.497425238176/8.0),
9809 REAL_CONST(17968.932994881692/8.0),
9810 REAL_CONST(17984.371880081104/8.0),
9811 REAL_CONST(17999.814079412972/8.0),
9812 REAL_CONST(18015.259591455371/8.0),
9813 REAL_CONST(18030.708414787914/8.0),
9814 REAL_CONST(18046.160547991731/8.0),
9815 REAL_CONST(18061.615989649465/8.0),
9816 REAL_CONST(18077.074738345284/8.0),
9817 REAL_CONST(18092.536792664861/8.0),
9818 REAL_CONST(18108.002151195393/8.0),
9819 REAL_CONST(18123.470812525571/8.0),
9820 REAL_CONST(18138.942775245599/8.0),
9821 REAL_CONST(18154.418037947191/8.0),
9822 REAL_CONST(18169.896599223546/8.0),
9823 REAL_CONST(18185.37845766938/8.0),
9824 REAL_CONST(18200.863611880886/8.0),
9825 REAL_CONST(18216.352060455767/8.0),
9826 REAL_CONST(18231.843801993204/8.0),
9827 REAL_CONST(18247.338835093873/8.0),
9828 REAL_CONST(18262.837158359936/8.0),
9829 REAL_CONST(18278.338770395032/8.0),
9830 REAL_CONST(18293.84366980429/8.0),
9831 REAL_CONST(18309.351855194309/8.0),
9832 REAL_CONST(18324.863325173166/8.0),
9833 REAL_CONST(18340.378078350412/8.0),
9834 REAL_CONST(18355.896113337069/8.0),
9835 REAL_CONST(18371.417428745623/8.0),
9836 REAL_CONST(18386.942023190033/8.0),
9837 REAL_CONST(18402.469895285718/8.0),
9838 REAL_CONST(18418.00104364955/8.0),
9839 REAL_CONST(18433.53546689987/8.0),
9840 REAL_CONST(18449.073163656474/8.0),
9841 REAL_CONST(18464.614132540602/8.0),
9842 REAL_CONST(18480.158372174956/8.0),
9843 REAL_CONST(18495.705881183676/8.0),
9844 REAL_CONST(18511.256658192357/8.0),
9845 REAL_CONST(18526.810701828035/8.0),
9846 REAL_CONST(18542.368010719183/8.0),
9847 REAL_CONST(18557.928583495715/8.0),
9848 REAL_CONST(18573.492418788985/8.0),
9849 REAL_CONST(18589.059515231773/8.0),
9850 REAL_CONST(18604.629871458303/8.0),
9851 REAL_CONST(18620.203486104212/8.0),
9852 REAL_CONST(18635.78035780658/8.0),
9853 REAL_CONST(18651.360485203899/8.0),
9854 REAL_CONST(18666.943866936086/8.0),
9855 REAL_CONST(18682.53050164448/8.0),
9856 REAL_CONST(18698.120387971841/8.0),
9857 REAL_CONST(18713.713524562332/8.0),
9858 REAL_CONST(18729.30991006154/8.0),
9859 REAL_CONST(18744.909543116457/8.0),
9860 REAL_CONST(18760.512422375479/8.0),
9861 REAL_CONST(18776.118546488418/8.0),
9862 REAL_CONST(18791.727914106479/8.0),
9863 REAL_CONST(18807.340523882274/8.0),
9864 REAL_CONST(18822.95637446981/8.0),
9865 REAL_CONST(18838.575464524489/8.0),
9866 REAL_CONST(18854.197792703111/8.0),
9867 REAL_CONST(18869.823357663863/8.0),
9868 REAL_CONST(18885.452158066328/8.0),
9869 REAL_CONST(18901.08419257147/8.0),
9870 REAL_CONST(18916.719459841639/8.0),
9871 REAL_CONST(18932.357958540564/8.0),
9872 REAL_CONST(18947.999687333362/8.0),
9873 REAL_CONST(18963.644644886521/8.0),
9874 REAL_CONST(18979.292829867907/8.0),
9875 REAL_CONST(18994.944240946759/8.0),
9876 REAL_CONST(19010.598876793687/8.0),
9877 REAL_CONST(19026.256736080668/8.0),
9878 REAL_CONST(19041.917817481048/8.0),
9879 REAL_CONST(19057.582119669532/8.0),
9880 REAL_CONST(19073.2496413222/8.0),
9881 REAL_CONST(19088.920381116473/8.0),
9882 REAL_CONST(19104.594337731145/8.0),
9883 REAL_CONST(19120.271509846356/8.0),
9884 REAL_CONST(19135.951896143604/8.0),
9885 REAL_CONST(19151.635495305738/8.0),
9886 REAL_CONST(19167.322306016948/8.0),
9887 REAL_CONST(19183.012326962784/8.0),
9888 REAL_CONST(19198.705556830122/8.0),
9889 REAL_CONST(19214.401994307198/8.0),
9890 REAL_CONST(19230.101638083579/8.0),
9891 REAL_CONST(19245.804486850167/8.0),
9892 REAL_CONST(19261.510539299208/8.0),
9893 REAL_CONST(19277.219794124274/8.0),
9894 REAL_CONST(19292.932250020265/8.0),
9895 REAL_CONST(19308.647905683421/8.0),
9896 REAL_CONST(19324.366759811302/8.0),
9897 REAL_CONST(19340.088811102793/8.0),
9898 REAL_CONST(19355.8140582581/8.0),
9899 REAL_CONST(19371.542499978754/8.0),
9900 REAL_CONST(19387.2741349676/8.0),
9901 REAL_CONST(19403.008961928797/8.0),
9902 REAL_CONST(19418.746979567823/8.0),
9903 REAL_CONST(19434.488186591469/8.0),
9904 REAL_CONST(19450.232581707827/8.0),
9905 REAL_CONST(19465.980163626304/8.0),
9906 REAL_CONST(19481.730931057613/8.0),
9907 REAL_CONST(19497.484882713761/8.0),
9908 REAL_CONST(19513.242017308068/8.0),
9909 REAL_CONST(19529.002333555141/8.0),
9910 REAL_CONST(19544.765830170898/8.0),
9911 REAL_CONST(19560.532505872539/8.0),
9912 REAL_CONST(19576.302359378566/8.0),
9913 REAL_CONST(19592.075389408761/8.0),
9914 REAL_CONST(19607.851594684209/8.0),
9915 REAL_CONST(19623.630973927269/8.0),
9916 REAL_CONST(19639.41352586159/8.0),
9917 REAL_CONST(19655.199249212103/8.0),
9918 REAL_CONST(19670.988142705017/8.0),
9919 REAL_CONST(19686.780205067826/8.0),
9920 REAL_CONST(19702.575435029288/8.0),
9921 REAL_CONST(19718.373831319448/8.0),
9922 REAL_CONST(19734.175392669615/8.0),
9923 REAL_CONST(19749.980117812371/8.0),
9924 REAL_CONST(19765.788005481569/8.0),
9925 REAL_CONST(19781.599054412323/8.0),
9926 REAL_CONST(19797.413263341008/8.0),
9927 REAL_CONST(19813.230631005274/8.0),
9928 REAL_CONST(19829.051156144014/8.0),
9929 REAL_CONST(19844.874837497395/8.0),
9930 REAL_CONST(19860.701673806827/8.0),
9931 REAL_CONST(19876.531663814985/8.0),
9932 REAL_CONST(19892.364806265789/8.0),
9933 REAL_CONST(19908.201099904403/8.0),
9934 REAL_CONST(19924.040543477258/8.0),
9935 REAL_CONST(19939.883135732012/8.0),
9936 REAL_CONST(19955.728875417579/8.0),
9937 REAL_CONST(19971.577761284105/8.0),
9938 REAL_CONST(19987.429792082985/8.0),
9939 REAL_CONST(20003.284966566847/8.0),
9940 REAL_CONST(20019.14328348956/8.0),
9941 REAL_CONST(20035.004741606219/8.0),
9942 REAL_CONST(20050.869339673161/8.0),
9943 REAL_CONST(20066.737076447946/8.0),
9944 REAL_CONST(20082.607950689362/8.0),
9945 REAL_CONST(20098.481961157428/8.0),
9946 REAL_CONST(20114.359106613385/8.0),
9947 REAL_CONST(20130.239385819699/8.0),
9948 REAL_CONST(20146.122797540058/8.0),
9949 REAL_CONST(20162.009340539353/8.0),
9950 REAL_CONST(20177.899013583716/8.0),
9951 REAL_CONST(20193.791815440476/8.0),
9952 REAL_CONST(20209.687744878182/8.0),
9953 REAL_CONST(20225.586800666591/8.0),
9954 REAL_CONST(20241.488981576669/8.0),
9955 REAL_CONST(20257.394286380597/8.0),
9956 REAL_CONST(20273.302713851754/8.0),
9957 REAL_CONST(20289.214262764715/8.0),
9958 REAL_CONST(20305.128931895277/8.0),
9959 REAL_CONST(20321.046720020415/8.0),
9960 REAL_CONST(20336.967625918318/8.0),
9961 REAL_CONST(20352.891648368361/8.0),
9962 REAL_CONST(20368.818786151114/8.0),
9963 REAL_CONST(20384.749038048347/8.0),
9964 REAL_CONST(20400.682402843009/8.0),
9965 REAL_CONST(20416.618879319249/8.0),
9966 REAL_CONST(20432.558466262391/8.0),
9967 REAL_CONST(20448.501162458953/8.0),
9968 REAL_CONST(20464.446966696629/8.0),
9969 REAL_CONST(20480.395877764302/8.0),
9970 REAL_CONST(20496.347894452025/8.0),
9971 REAL_CONST(20512.303015551031/8.0),
9972 REAL_CONST(20528.261239853735/8.0),
9973 REAL_CONST(20544.22256615372/8.0),
9974 REAL_CONST(20560.186993245738/8.0),
9975 REAL_CONST(20576.15451992572/8.0),
9976 REAL_CONST(20592.125144990758/8.0),
9977 REAL_CONST(20608.098867239107/8.0),
9978 REAL_CONST(20624.075685470198/8.0),
9979 REAL_CONST(20640.055598484618/8.0),
9980 REAL_CONST(20656.038605084115/8.0),
9981 REAL_CONST(20672.024704071595/8.0),
9982 REAL_CONST(20688.013894251126/8.0),
9983 REAL_CONST(20704.006174427926/8.0),
9984 REAL_CONST(20720.001543408373/8.0),
9985 REAL_CONST(20735.999999999989/8.0),
9986 REAL_CONST(20752.001543011454/8.0),
9987 REAL_CONST(20768.006171252597/8.0),
9988 REAL_CONST(20784.013883534382/8.0),
9989 REAL_CONST(20800.024678668931/8.0),
9990 REAL_CONST(20816.038555469506/8.0),
9991 REAL_CONST(20832.055512750507/8.0),
9992 REAL_CONST(20848.075549327474/8.0),
9993 REAL_CONST(20864.098664017085/8.0),
9994 REAL_CONST(20880.124855637161/8.0),
9995 REAL_CONST(20896.154123006647/8.0),
9996 REAL_CONST(20912.186464945626/8.0),
9997 REAL_CONST(20928.221880275312/8.0),
9998 REAL_CONST(20944.260367818049/8.0),
9999 REAL_CONST(20960.301926397311/8.0),
10000 REAL_CONST(20976.346554837684/8.0),
10001 REAL_CONST(20992.394251964895/8.0),
10002 REAL_CONST(21008.445016605787/8.0),
10003 REAL_CONST(21024.498847588318/8.0),
10004 REAL_CONST(21040.555743741574/8.0),
10005 REAL_CONST(21056.615703895754/8.0),
10006 REAL_CONST(21072.678726882168/8.0),
10007 REAL_CONST(21088.744811533252/8.0),
10008 REAL_CONST(21104.813956682538/8.0),
10009 REAL_CONST(21120.886161164683/8.0),
10010 REAL_CONST(21136.961423815443/8.0),
10011 REAL_CONST(21153.039743471683/8.0),
10012 REAL_CONST(21169.121118971379/8.0),
10013 REAL_CONST(21185.205549153605/8.0),
10014 REAL_CONST(21201.293032858535/8.0),
10015 REAL_CONST(21217.383568927453/8.0),
10016 REAL_CONST(21233.477156202731/8.0),
10017 REAL_CONST(21249.573793527841/8.0),
10018 REAL_CONST(21265.673479747358/8.0),
10019 REAL_CONST(21281.776213706937/8.0),
10020 REAL_CONST(21297.881994253334/8.0),
10021 REAL_CONST(21313.990820234398/8.0),
10022 REAL_CONST(21330.102690499054/8.0),
10023 REAL_CONST(21346.21760389733/8.0),
10024 REAL_CONST(21362.335559280327/8.0),
10025 REAL_CONST(21378.456555500241/8.0),
10026 REAL_CONST(21394.580591410333/8.0),
10027 REAL_CONST(21410.707665864964/8.0),
10028 REAL_CONST(21426.83777771956/8.0),
10029 REAL_CONST(21442.970925830628/8.0),
10030 REAL_CONST(21459.107109055756/8.0),
10031 REAL_CONST(21475.246326253604/8.0),
10032 REAL_CONST(21491.388576283895/8.0),
10033 REAL_CONST(21507.533858007431/8.0),
10034 REAL_CONST(21523.682170286087/8.0),
10035 REAL_CONST(21539.833511982797/8.0),
10036 REAL_CONST(21555.987881961566/8.0),
10037 REAL_CONST(21572.145279087465/8.0),
10038 REAL_CONST(21588.305702226615/8.0),
10039 REAL_CONST(21604.469150246216/8.0),
10040 REAL_CONST(21620.635622014521/8.0),
10041 REAL_CONST(21636.805116400832/8.0),
10042 REAL_CONST(21652.977632275521/8.0),
10043 REAL_CONST(21669.153168510009/8.0),
10044 REAL_CONST(21685.331723976764/8.0),
10045 REAL_CONST(21701.513297549318/8.0),
10046 REAL_CONST(21717.697888102244/8.0),
10047 REAL_CONST(21733.885494511167/8.0),
10048 REAL_CONST(21750.076115652759/8.0),
10049 REAL_CONST(21766.269750404736/8.0),
10050 REAL_CONST(21782.466397645861/8.0),
10051 REAL_CONST(21798.666056255934/8.0),
10052 REAL_CONST(21814.868725115801/8.0),
10053 REAL_CONST(21831.074403107345/8.0),
10054 REAL_CONST(21847.283089113484/8.0),
10055 REAL_CONST(21863.494782018177/8.0),
10056 REAL_CONST(21879.709480706417/8.0),
10057 REAL_CONST(21895.927184064229/8.0),
10058 REAL_CONST(21912.147890978667/8.0),
10059 REAL_CONST(21928.371600337818/8.0),
10060 REAL_CONST(21944.598311030797/8.0),
10061 REAL_CONST(21960.828021947746/8.0),
10062 REAL_CONST(21977.060731979829/8.0),
10063 REAL_CONST(21993.296440019243/8.0),
10064 REAL_CONST(22009.535144959198/8.0),
10065 REAL_CONST(22025.77684569393/8.0),
10066 REAL_CONST(22042.021541118691/8.0),
10067 REAL_CONST(22058.269230129757/8.0),
10068 REAL_CONST(22074.519911624411/8.0),
10069 REAL_CONST(22090.773584500959/8.0),
10070 REAL_CONST(22107.030247658717/8.0),
10071 REAL_CONST(22123.289899998013/8.0),
10072 REAL_CONST(22139.552540420187/8.0),
10073 REAL_CONST(22155.818167827587/8.0),
10074 REAL_CONST(22172.086781123569/8.0),
10075 REAL_CONST(22188.358379212495/8.0),
10076 REAL_CONST(22204.632960999726/8.0),
10077 REAL_CONST(22220.910525391639/8.0),
10078 REAL_CONST(22237.191071295601/8.0),
10079 REAL_CONST(22253.474597619981/8.0),
10080 REAL_CONST(22269.761103274148/8.0),
10081 REAL_CONST(22286.050587168469/8.0),
10082 REAL_CONST(22302.343048214312/8.0),
10083 REAL_CONST(22318.638485324027/8.0),
10084 REAL_CONST(22334.936897410968/8.0),
10085 REAL_CONST(22351.23828338947/8.0),
10086 REAL_CONST(22367.542642174871/8.0),
10087 REAL_CONST(22383.849972683485/8.0),
10088 REAL_CONST(22400.160273832618/8.0),
10089 REAL_CONST(22416.473544540564/8.0),
10090 REAL_CONST(22432.789783726603/8.0),
10091 REAL_CONST(22449.108990310986/8.0),
10092 REAL_CONST(22465.431163214958/8.0),
10093 REAL_CONST(22481.75630136074/8.0),
10094 REAL_CONST(22498.084403671528/8.0),
10095 REAL_CONST(22514.415469071497/8.0),
10096 REAL_CONST(22530.749496485802/8.0),
10097 REAL_CONST(22547.086484840562/8.0),
10098 REAL_CONST(22563.426433062879/8.0),
10099 REAL_CONST(22579.769340080824/8.0),
10100 REAL_CONST(22596.115204823436/8.0),
10101 REAL_CONST(22612.464026220721/8.0),
10102 REAL_CONST(22628.815803203655/8.0),
10103 REAL_CONST(22645.170534704179/8.0),
10104 REAL_CONST(22661.5282196552/8.0),
10105 REAL_CONST(22677.888856990587/8.0),
10106 REAL_CONST(22694.252445645168/8.0),
10107 REAL_CONST(22710.618984554734/8.0),
10108 REAL_CONST(22726.988472656034/8.0),
10109 REAL_CONST(22743.360908886778/8.0),
10110 REAL_CONST(22759.736292185622/8.0),
10111 REAL_CONST(22776.114621492186/8.0),
10112 REAL_CONST(22792.495895747044/8.0),
10113 REAL_CONST(22808.880113891719/8.0),
10114 REAL_CONST(22825.267274868678/8.0),
10115 REAL_CONST(22841.657377621348/8.0),
10116 REAL_CONST(22858.050421094096/8.0),
10117 REAL_CONST(22874.446404232243/8.0),
10118 REAL_CONST(22890.845325982053/8.0),
10119 REAL_CONST(22907.247185290722/8.0),
10120 REAL_CONST(22923.651981106406/8.0),
10121 REAL_CONST(22940.059712378195/8.0),
10122 REAL_CONST(22956.470378056114/8.0),
10123 REAL_CONST(22972.883977091129/8.0),
10124 REAL_CONST(22989.300508435153/8.0),
10125 REAL_CONST(23005.719971041017/8.0),
10126 REAL_CONST(23022.142363862498/8.0),
10127 REAL_CONST(23038.567685854305/8.0),
10128 REAL_CONST(23054.995935972078/8.0),
10129 REAL_CONST(23071.427113172387/8.0),
10130 REAL_CONST(23087.86121641273/8.0),
10131 REAL_CONST(23104.298244651531/8.0),
10132 REAL_CONST(23120.738196848146/8.0),
10133 REAL_CONST(23137.181071962848/8.0),
10134 REAL_CONST(23153.626868956846/8.0),
10135 REAL_CONST(23170.075586792263/8.0),
10136 REAL_CONST(23186.527224432142/8.0),
10137 REAL_CONST(23202.981780840448/8.0),
10138 REAL_CONST(23219.439254982066/8.0),
10139 REAL_CONST(23235.899645822796/8.0),
10140 REAL_CONST(23252.362952329357/8.0),
10141 REAL_CONST(23268.829173469378/8.0),
10142 REAL_CONST(23285.298308211408/8.0),
10143 REAL_CONST(23301.770355524899/8.0),
10144 REAL_CONST(23318.245314380223/8.0),
10145 REAL_CONST(23334.723183748658/8.0),
10146 REAL_CONST(23351.203962602387/8.0),
10147 REAL_CONST(23367.687649914504/8.0),
10148 REAL_CONST(23384.174244659007/8.0),
10149 REAL_CONST(23400.663745810798/8.0),
10150 REAL_CONST(23417.15615234568/8.0),
10151 REAL_CONST(23433.651463240367/8.0),
10152 REAL_CONST(23450.149677472462/8.0),
10153 REAL_CONST(23466.650794020472/8.0),
10154 REAL_CONST(23483.154811863806/8.0),
10155 REAL_CONST(23499.661729982763/8.0),
10156 REAL_CONST(23516.171547358543/8.0),
10157 REAL_CONST(23532.684262973235/8.0),
10158 REAL_CONST(23549.199875809823/8.0),
10159 REAL_CONST(23565.718384852185/8.0),
10160 REAL_CONST(23582.239789085092/8.0),
10161 REAL_CONST(23598.764087494197/8.0),
10162 REAL_CONST(23615.291279066041/8.0),
10163 REAL_CONST(23631.821362788058/8.0),
10164 REAL_CONST(23648.354337648565/8.0),
10165 REAL_CONST(23664.890202636761/8.0),
10166 REAL_CONST(23681.428956742733/8.0),
10167 REAL_CONST(23697.970598957443/8.0),
10168 REAL_CONST(23714.515128272738/8.0),
10169 REAL_CONST(23731.062543681343/8.0),
10170 REAL_CONST(23747.612844176863/8.0),
10171 REAL_CONST(23764.166028753778/8.0),
10172 REAL_CONST(23780.72209640744/8.0),
10173 REAL_CONST(23797.281046134085/8.0),
10174 REAL_CONST(23813.842876930816/8.0),
10175 REAL_CONST(23830.407587795606/8.0),
10176 REAL_CONST(23846.975177727301/8.0),
10177 REAL_CONST(23863.545645725622/8.0),
10178 REAL_CONST(23880.11899079115/8.0),
10179 REAL_CONST(23896.695211925336/8.0),
10180 REAL_CONST(23913.274308130498/8.0),
10181 REAL_CONST(23929.856278409821/8.0),
10182 REAL_CONST(23946.441121767348/8.0),
10183 REAL_CONST(23963.028837207989/8.0),
10184 REAL_CONST(23979.619423737513/8.0),
10185 REAL_CONST(23996.212880362549/8.0),
10186 REAL_CONST(24012.809206090584/8.0),
10187 REAL_CONST(24029.408399929966/8.0),
10188 REAL_CONST(24046.010460889898/8.0),
10189 REAL_CONST(24062.615387980433/8.0),
10190 REAL_CONST(24079.223180212492/8.0),
10191 REAL_CONST(24095.833836597827/8.0),
10192 REAL_CONST(24112.447356149063/8.0),
10193 REAL_CONST(24129.063737879667/8.0),
10194 REAL_CONST(24145.682980803951/8.0),
10195 REAL_CONST(24162.305083937081/8.0),
10196 REAL_CONST(24178.930046295067/8.0),
10197 REAL_CONST(24195.557866894767/8.0),
10198 REAL_CONST(24212.188544753884/8.0),
10199 REAL_CONST(24228.822078890964/8.0),
10200 REAL_CONST(24245.458468325389/8.0),
10201 REAL_CONST(24262.097712077397/8.0),
10202 REAL_CONST(24278.739809168052/8.0),
10203 REAL_CONST(24295.384758619261/8.0),
10204 REAL_CONST(24312.032559453768/8.0),
10205 REAL_CONST(24328.683210695162/8.0),
10206 REAL_CONST(24345.336711367858/8.0),
10207 REAL_CONST(24361.993060497109/8.0),
10208 REAL_CONST(24378.652257108995/8.0),
10209 REAL_CONST(24395.314300230442/8.0),
10210 REAL_CONST(24411.979188889192/8.0),
10211 REAL_CONST(24428.646922113825/8.0),
10212 REAL_CONST(24445.317498933746/8.0),
10213 REAL_CONST(24461.990918379193/8.0),
10214 REAL_CONST(24478.667179481225/8.0),
10215 REAL_CONST(24495.346281271726/8.0),
10216 REAL_CONST(24512.028222783407/8.0),
10217 REAL_CONST(24528.713003049801/8.0),
10218 REAL_CONST(24545.400621105266/8.0),
10219 REAL_CONST(24562.091075984976/8.0),
10220 REAL_CONST(24578.784366724925/8.0),
10221 REAL_CONST(24595.480492361927/8.0),
10222 REAL_CONST(24612.179451933614/8.0),
10223 REAL_CONST(24628.881244478438/8.0),
10224 REAL_CONST(24645.585869035654/8.0),
10225 REAL_CONST(24662.293324645343/8.0),
10226 REAL_CONST(24679.003610348394/8.0),
10227 REAL_CONST(24695.716725186514/8.0),
10228 REAL_CONST(24712.432668202211/8.0),
10229 REAL_CONST(24729.151438438807/8.0),
10230 REAL_CONST(24745.873034940436/8.0),
10231 REAL_CONST(24762.597456752032/8.0),
10232 REAL_CONST(24779.324702919344/8.0),
10233 REAL_CONST(24796.054772488926/8.0),
10234 REAL_CONST(24812.787664508123/8.0),
10235 REAL_CONST(24829.5233780251/8.0),
10236 REAL_CONST(24846.261912088819/8.0),
10237 REAL_CONST(24863.003265749034/8.0),
10238 REAL_CONST(24879.747438056307/8.0),
10239 REAL_CONST(24896.494428062004/8.0),
10240 REAL_CONST(24913.244234818278/8.0),
10241 REAL_CONST(24929.996857378079/8.0),
10242 REAL_CONST(24946.752294795166/8.0),
10243 REAL_CONST(24963.510546124078/8.0),
10244 REAL_CONST(24980.271610420157/8.0),
10245 REAL_CONST(24997.035486739525/8.0),
10246 REAL_CONST(25013.802174139113/8.0),
10247 REAL_CONST(25030.571671676629/8.0),
10248 REAL_CONST(25047.343978410572/8.0),
10249 REAL_CONST(25064.119093400237/8.0),
10250 REAL_CONST(25080.897015705697/8.0),
10251 REAL_CONST(25097.677744387816/8.0),
10252 REAL_CONST(25114.461278508239/8.0),
10253 REAL_CONST(25131.2476171294/8.0),
10254 REAL_CONST(25148.036759314517/8.0),
10255 REAL_CONST(25164.828704127583/8.0),
10256 REAL_CONST(25181.623450633375/8.0),
10257 REAL_CONST(25198.42099789745/8.0),
10258 REAL_CONST(25215.221344986145/8.0),
10259 REAL_CONST(25232.024490966574/8.0),
10260 REAL_CONST(25248.830434906627/8.0),
10261 REAL_CONST(25265.639175874974/8.0),
10262 REAL_CONST(25282.450712941049/8.0),
10263 REAL_CONST(25299.265045175071/8.0),
10264 REAL_CONST(25316.082171648024/8.0),
10265 REAL_CONST(25332.902091431668/8.0),
10266 REAL_CONST(25349.724803598532/8.0),
10267 REAL_CONST(25366.550307221914/8.0),
10268 REAL_CONST(25383.378601375884/8.0),
10269 REAL_CONST(25400.209685135269/8.0),
10270 REAL_CONST(25417.043557575678/8.0),
10271 REAL_CONST(25433.880217773472/8.0),
10272 REAL_CONST(25450.719664805783/8.0),
10273 REAL_CONST(25467.561897750507/8.0),
10274 REAL_CONST(25484.406915686297/8.0),
10275 REAL_CONST(25501.254717692573/8.0),
10276 REAL_CONST(25518.105302849512/8.0),
10277 REAL_CONST(25534.958670238051/8.0),
10278 REAL_CONST(25551.814818939893/8.0),
10279 REAL_CONST(25568.67374803748/8.0),
10280 REAL_CONST(25585.535456614027/8.0),
10281 REAL_CONST(25602.399943753502/8.0),
10282 REAL_CONST(25619.267208540619/8.0),
10283 REAL_CONST(25636.137250060852/8.0),
10284 REAL_CONST(25653.010067400432/8.0),
10285 REAL_CONST(25669.885659646327/8.0),
10286 REAL_CONST(25686.76402588627/8.0),
10287 REAL_CONST(25703.645165208734/8.0),
10288 REAL_CONST(25720.529076702944/8.0),
10289 REAL_CONST(25737.415759458876/8.0),
10290 REAL_CONST(25754.305212567244/8.0),
10291 REAL_CONST(25771.197435119517/8.0),
10292 REAL_CONST(25788.092426207899/8.0),
10293 REAL_CONST(25804.990184925344/8.0),
10294 REAL_CONST(25821.890710365547/8.0),
10295 REAL_CONST(25838.794001622944/8.0),
10296 REAL_CONST(25855.700057792714/8.0),
10297 REAL_CONST(25872.608877970775/8.0),
10298 REAL_CONST(25889.520461253778/8.0),
10299 REAL_CONST(25906.434806739118/8.0),
10300 REAL_CONST(25923.351913524923/8.0),
10301 REAL_CONST(25940.271780710063/8.0),
10302 REAL_CONST(25957.194407394138/8.0),
10303 REAL_CONST(25974.11979267748/8.0),
10304 REAL_CONST(25991.047935661154/8.0),
10305 REAL_CONST(26007.978835446964/8.0),
10306 REAL_CONST(26024.912491137442/8.0),
10307 REAL_CONST(26041.848901835841/8.0),
10308 REAL_CONST(26058.788066646157/8.0),
10309 REAL_CONST(26075.729984673108/8.0),
10310 REAL_CONST(26092.674655022136/8.0),
10311 REAL_CONST(26109.622076799409/8.0),
10312 REAL_CONST(26126.572249111829/8.0),
10313 REAL_CONST(26143.525171067016/8.0),
10314 REAL_CONST(26160.480841773315/8.0),
10315 REAL_CONST(26177.43926033979/8.0),
10316 REAL_CONST(26194.400425876229/8.0),
10317 REAL_CONST(26211.364337493149/8.0),
10318 REAL_CONST(26228.330994301767/8.0),
10319 REAL_CONST(26245.30039541404/8.0),
10320 REAL_CONST(26262.272539942627/8.0),
10321 REAL_CONST(26279.247427000919/8.0),
10322 REAL_CONST(26296.225055703002/8.0),
10323 REAL_CONST(26313.205425163702/8.0),
10324 REAL_CONST(26330.188534498539/8.0),
10325 REAL_CONST(26347.174382823756/8.0),
10326 REAL_CONST(26364.162969256304/8.0),
10327 REAL_CONST(26381.154292913852/8.0),
10328 REAL_CONST(26398.148352914774/8.0),
10329 REAL_CONST(26415.145148378149/8.0),
10330 REAL_CONST(26432.144678423778/8.0),
10331 REAL_CONST(26449.146942172156/8.0),
10332 REAL_CONST(26466.151938744493/8.0),
10333 REAL_CONST(26483.159667262702/8.0),
10334 REAL_CONST(26500.170126849403/8.0),
10335 REAL_CONST(26517.183316627921/8.0),
10336 REAL_CONST(26534.199235722277/8.0),
10337 REAL_CONST(26551.217883257199/8.0),
10338 REAL_CONST(26568.239258358124/8.0),
10339 REAL_CONST(26585.263360151173/8.0),
10340 REAL_CONST(26602.290187763181/8.0),
10341 REAL_CONST(26619.319740321676/8.0),
10342 REAL_CONST(26636.352016954883/8.0),
10343 REAL_CONST(26653.387016791727/8.0),
10344 REAL_CONST(26670.424738961825/8.0),
10345 REAL_CONST(26687.465182595493/8.0),
10346 REAL_CONST(26704.508346823739/8.0),
10347 REAL_CONST(26721.554230778267/8.0),
10348 REAL_CONST(26738.602833591467/8.0),
10349 REAL_CONST(26755.65415439643/8.0),
10350 REAL_CONST(26772.708192326929/8.0),
10351 REAL_CONST(26789.764946517433/8.0),
10352 REAL_CONST(26806.824416103096/8.0),
10353 REAL_CONST(26823.886600219761/8.0),
10354 REAL_CONST(26840.95149800396/8.0),
10355 REAL_CONST(26858.019108592915/8.0),
10356 REAL_CONST(26875.089431124517/8.0),
10357 REAL_CONST(26892.162464737365/8.0),
10358 REAL_CONST(26909.238208570721/8.0),
10359 REAL_CONST(26926.316661764544/8.0),
10360 REAL_CONST(26943.397823459472/8.0),
10361 REAL_CONST(26960.481692796813/8.0),
10362 REAL_CONST(26977.568268918571/8.0),
10363 REAL_CONST(26994.657550967422/8.0),
10364 REAL_CONST(27011.749538086722/8.0),
10365 REAL_CONST(27028.844229420498/8.0),
10366 REAL_CONST(27045.941624113464/8.0),
10367 REAL_CONST(27063.041721311005/8.0),
10368 REAL_CONST(27080.144520159181/8.0),
10369 REAL_CONST(27097.250019804727/8.0),
10370 REAL_CONST(27114.35821939505/8.0),
10371 REAL_CONST(27131.469118078236/8.0),
10372 REAL_CONST(27148.582715003027/8.0),
10373 REAL_CONST(27165.699009318858/8.0),
10374 REAL_CONST(27182.818000175819/8.0),
10375 REAL_CONST(27199.939686724665/8.0),
10376 REAL_CONST(27217.064068116837/8.0),
10377 REAL_CONST(27234.191143504428/8.0),
10378 REAL_CONST(27251.320912040203/8.0),
10379 REAL_CONST(27268.453372877593/8.0),
10380 REAL_CONST(27285.588525170693/8.0),
10381 REAL_CONST(27302.726368074269/8.0),
10382 REAL_CONST(27319.866900743735/8.0),
10383 REAL_CONST(27337.010122335181/8.0),
10384 REAL_CONST(27354.156032005358/8.0),
10385 REAL_CONST(27371.304628911668/8.0),
10386 REAL_CONST(27388.455912212183/8.0),
10387 REAL_CONST(27405.609881065626/8.0),
10388 REAL_CONST(27422.766534631384/8.0),
10389 REAL_CONST(27439.925872069507/8.0),
10390 REAL_CONST(27457.087892540683/8.0),
10391 REAL_CONST(27474.252595206275/8.0),
10392 REAL_CONST(27491.419979228293/8.0),
10393 REAL_CONST(27508.5900437694/8.0),
10394 REAL_CONST(27525.762787992917/8.0),
10395 REAL_CONST(27542.93821106281/8.0),
10396 REAL_CONST(27560.116312143706/8.0),
10397 REAL_CONST(27577.297090400876/8.0),
10398 REAL_CONST(27594.480545000242/8.0),
10399 REAL_CONST(27611.666675108383/8.0),
10400 REAL_CONST(27628.855479892518/8.0),
10401 REAL_CONST(27646.046958520514/8.0),
10402 REAL_CONST(27663.241110160889/8.0),
10403 REAL_CONST(27680.437933982801/8.0),
10404 REAL_CONST(27697.637429156068/8.0),
10405 REAL_CONST(27714.839594851132/8.0),
10406 REAL_CONST(27732.04443023909/8.0),
10407 REAL_CONST(27749.251934491687/8.0),
10408 REAL_CONST(27766.462106781299/8.0),
10409 REAL_CONST(27783.674946280949/8.0),
10410 REAL_CONST(27800.890452164302/8.0),
10411 REAL_CONST(27818.108623605654/8.0),
10412 REAL_CONST(27835.329459779954/8.0),
10413 REAL_CONST(27852.55295986278/8.0),
10414 REAL_CONST(27869.779123030345/8.0),
10415 REAL_CONST(27887.007948459504/8.0),
10416 REAL_CONST(27904.239435327745/8.0),
10417 REAL_CONST(27921.473582813196/8.0),
10418 REAL_CONST(27938.710390094613/8.0),
10419 REAL_CONST(27955.949856351392/8.0),
10420 REAL_CONST(27973.19198076355/8.0),
10421 REAL_CONST(27990.436762511745/8.0),
10422 REAL_CONST(28007.684200777272/8.0),
10423 REAL_CONST(28024.934294742041/8.0),
10424 REAL_CONST(28042.187043588601/8.0),
10425 REAL_CONST(28059.442446500128/8.0),
10426 REAL_CONST(28076.700502660427/8.0),
10427 REAL_CONST(28093.961211253929/8.0),
10428 REAL_CONST(28111.224571465693/8.0),
10429 REAL_CONST(28128.490582481401/8.0),
10430 REAL_CONST(28145.759243487362/8.0),
10431 REAL_CONST(28163.030553670509/8.0),
10432 REAL_CONST(28180.304512218394/8.0),
10433 REAL_CONST(28197.581118319198/8.0),
10434 REAL_CONST(28214.860371161725/8.0),
10435 REAL_CONST(28232.14226993539/8.0),
10436 REAL_CONST(28249.42681383024/8.0),
10437 REAL_CONST(28266.71400203693/8.0),
10438 REAL_CONST(28284.003833746745/8.0),
10439 REAL_CONST(28301.296308151585/8.0),
10440 REAL_CONST(28318.591424443959/8.0),
10441 REAL_CONST(28335.889181817001/8.0),
10442 REAL_CONST(28353.189579464462/8.0),
10443 REAL_CONST(28370.492616580705/8.0),
10444 REAL_CONST(28387.798292360701/8.0),
10445 REAL_CONST(28405.106606000048/8.0),
10446 REAL_CONST(28422.417556694945/8.0),
10447 REAL_CONST(28439.731143642206/8.0),
10448 REAL_CONST(28457.047366039264/8.0),
10449 REAL_CONST(28474.366223084147/8.0),
10450 REAL_CONST(28491.687713975512/8.0),
10451 REAL_CONST(28509.011837912611/8.0),
10452 REAL_CONST(28526.338594095305/8.0),
10453 REAL_CONST(28543.667981724069/8.0),
10454 REAL_CONST(28560.999999999982/8.0),
10455 REAL_CONST(28578.334648124732/8.0),
10456 REAL_CONST(28595.671925300605/8.0),
10457 REAL_CONST(28613.011830730498/8.0),
10458 REAL_CONST(28630.354363617909/8.0),
10459 REAL_CONST(28647.699523166943/8.0),
10460 REAL_CONST(28665.0473085823/8.0),
10461 REAL_CONST(28682.397719069289/8.0),
10462 REAL_CONST(28699.750753833818/8.0),
10463 REAL_CONST(28717.10641208239/8.0),
10464 REAL_CONST(28734.464693022121/8.0),
10465 REAL_CONST(28751.825595860708/8.0),
10466 REAL_CONST(28769.189119806462/8.0),
10467 REAL_CONST(28786.55526406828/8.0),
10468 REAL_CONST(28803.924027855664/8.0),
10469 REAL_CONST(28821.295410378701/8.0),
10470 REAL_CONST(28838.669410848088/8.0),
10471 REAL_CONST(28856.046028475103/8.0),
10472 REAL_CONST(28873.425262471628/8.0),
10473 REAL_CONST(28890.80711205013/8.0),
10474 REAL_CONST(28908.191576423673/8.0),
10475 REAL_CONST(28925.578654805915/8.0),
10476 REAL_CONST(28942.968346411097/8.0),
10477 REAL_CONST(28960.360650454055/8.0),
10478 REAL_CONST(28977.755566150216/8.0),
10479 REAL_CONST(28995.153092715591/8.0),
10480 REAL_CONST(29012.553229366786/8.0),
10481 REAL_CONST(29029.955975320987/8.0),
10482 REAL_CONST(29047.361329795975/8.0),
10483 REAL_CONST(29064.769292010107/8.0),
10484 REAL_CONST(29082.179861182336/8.0),
10485 REAL_CONST(29099.593036532187/8.0),
10486 REAL_CONST(29117.00881727978/8.0),
10487 REAL_CONST(29134.427202645813/8.0),
10488 REAL_CONST(29151.848191851568/8.0),
10489 REAL_CONST(29169.271784118911/8.0),
10490 REAL_CONST(29186.697978670283/8.0),
10491 REAL_CONST(29204.126774728706/8.0),
10492 REAL_CONST(29221.55817151779/8.0),
10493 REAL_CONST(29238.992168261717/8.0),
10494 REAL_CONST(29256.42876418525/8.0),
10495 REAL_CONST(29273.867958513725/8.0),
10496 REAL_CONST(29291.309750473058/8.0),
10497 REAL_CONST(29308.754139289747/8.0),
10498 REAL_CONST(29326.201124190855/8.0),
10499 REAL_CONST(29343.65070440403/8.0),
10500 REAL_CONST(29361.102879157483/8.0),
10501 REAL_CONST(29378.557647680012/8.0),
10502 REAL_CONST(29396.015009200975/8.0),
10503 REAL_CONST(29413.474962950309/8.0),
10504 REAL_CONST(29430.937508158524/8.0),
10505 REAL_CONST(29448.402644056692/8.0),
10506 REAL_CONST(29465.870369876469/8.0),
10507 REAL_CONST(29483.340684850071/8.0),
10508 REAL_CONST(29500.81358821028/8.0),
10509 REAL_CONST(29518.289079190454/8.0),
10510 REAL_CONST(29535.767157024511/8.0),
10511 REAL_CONST(29553.247820946945/8.0),
10512 REAL_CONST(29570.731070192807/8.0),
10513 REAL_CONST(29588.216903997723/8.0),
10514 REAL_CONST(29605.70532159787/8.0),
10515 REAL_CONST(29623.19632223/8.0),
10516 REAL_CONST(29640.689905131429/8.0),
10517 REAL_CONST(29658.186069540028/8.0),
10518 REAL_CONST(29675.684814694236/8.0),
10519 REAL_CONST(29693.186139833047/8.0),
10520 REAL_CONST(29710.690044196028/8.0),
10521 REAL_CONST(29728.196527023298/8.0),
10522 REAL_CONST(29745.705587555527/8.0),
10523 REAL_CONST(29763.217225033964/8.0),
10524 REAL_CONST(29780.731438700397/8.0),
10525 REAL_CONST(29798.248227797183/8.0),
10526 REAL_CONST(29815.76759156723/8.0),
10527 REAL_CONST(29833.289529254005/8.0),
10528 REAL_CONST(29850.81404010153/8.0),
10529 REAL_CONST(29868.341123354381/8.0),
10530 REAL_CONST(29885.870778257693/8.0),
10531 REAL_CONST(29903.403004057145/8.0),
10532 REAL_CONST(29920.937799998974/8.0),
10533 REAL_CONST(29938.475165329975/8.0),
10534 REAL_CONST(29956.015099297485/8.0),
10535 REAL_CONST(29973.557601149394/8.0),
10536 REAL_CONST(29991.102670134147/8.0),
10537 REAL_CONST(30008.650305500738/8.0),
10538 REAL_CONST(30026.200506498706/8.0),
10539 REAL_CONST(30043.753272378144/8.0),
10540 REAL_CONST(30061.308602389683/8.0),
10541 REAL_CONST(30078.866495784507/8.0),
10542 REAL_CONST(30096.426951814352/8.0),
10543 REAL_CONST(30113.989969731494/8.0),
10544 REAL_CONST(30131.55554878875/8.0),
10545 REAL_CONST(30149.123688239491/8.0),
10546 REAL_CONST(30166.694387337629/8.0),
10547 REAL_CONST(30184.267645337608/8.0),
10548 REAL_CONST(30201.843461494434/8.0),
10549 REAL_CONST(30219.42183506364/8.0),
10550 REAL_CONST(30237.002765301309/8.0),
10551 REAL_CONST(30254.586251464058/8.0),
10552 REAL_CONST(30272.172292809046/8.0),
10553 REAL_CONST(30289.760888593977/8.0),
10554 REAL_CONST(30307.35203807709/8.0),
10555 REAL_CONST(30324.94574051716/8.0),
10556 REAL_CONST(30342.541995173502/8.0),
10557 REAL_CONST(30360.140801305966/8.0),
10558 REAL_CONST(30377.742158174944/8.0),
10559 REAL_CONST(30395.346065041358/8.0),
10560 REAL_CONST(30412.952521166666/8.0),
10561 REAL_CONST(30430.561525812864/8.0),
10562 REAL_CONST(30448.173078242475/8.0),
10563 REAL_CONST(30465.787177718561/8.0),
10564 REAL_CONST(30483.403823504719/8.0),
10565 REAL_CONST(30501.02301486507/8.0),
10566 REAL_CONST(30518.644751064272/8.0),
10567 REAL_CONST(30536.269031367516/8.0),
10568 REAL_CONST(30553.895855040515/8.0),
10569 REAL_CONST(30571.525221349519/8.0),
10570 REAL_CONST(30589.157129561307/8.0),
10571 REAL_CONST(30606.791578943175/8.0),
10572 REAL_CONST(30624.428568762964/8.0),
10573 REAL_CONST(30642.06809828903/8.0),
10574 REAL_CONST(30659.710166790261/8.0),
10575 REAL_CONST(30677.35477353607/8.0),
10576 REAL_CONST(30695.001917796391/8.0),
10577 REAL_CONST(30712.651598841687/8.0),
10578 REAL_CONST(30730.303815942945/8.0),
10579 REAL_CONST(30747.958568371676/8.0),
10580 REAL_CONST(30765.615855399912/8.0),
10581 REAL_CONST(30783.275676300211/8.0),
10582 REAL_CONST(30800.938030345646/8.0),
10583 REAL_CONST(30818.602916809814/8.0),
10584 REAL_CONST(30836.270334966837/8.0),
10585 REAL_CONST(30853.940284091354/8.0),
10586 REAL_CONST(30871.612763458521/8.0),
10587 REAL_CONST(30889.287772344011/8.0),
10588 REAL_CONST(30906.965310024025/8.0),
10589 REAL_CONST(30924.645375775272/8.0),
10590 REAL_CONST(30942.327968874983/8.0),
10591 REAL_CONST(30960.013088600903/8.0),
10592 REAL_CONST(30977.700734231294/8.0),
10593 REAL_CONST(30995.390905044929/8.0),
10594 REAL_CONST(31013.083600321101/8.0),
10595 REAL_CONST(31030.778819339619/8.0),
10596 REAL_CONST(31048.476561380798/8.0),
10597 REAL_CONST(31066.17682572547/8.0),
10598 REAL_CONST(31083.879611654978/8.0),
10599 REAL_CONST(31101.584918451179/8.0),
10600 REAL_CONST(31119.29274539644/8.0),
10601 REAL_CONST(31137.003091773637/8.0),
10602 REAL_CONST(31154.715956866155/8.0),
10603 REAL_CONST(31172.431339957893/8.0),
10604 REAL_CONST(31190.14924033326/8.0),
10605 REAL_CONST(31207.869657277162/8.0),
10606 REAL_CONST(31225.592590075023/8.0),
10607 REAL_CONST(31243.318038012771/8.0),
10608 REAL_CONST(31261.046000376838/8.0),
10609 REAL_CONST(31278.776476454172/8.0),
10610 REAL_CONST(31296.50946553221/8.0),
10611 REAL_CONST(31314.24496689891/8.0),
10612 REAL_CONST(31331.98297984272/8.0),
10613 REAL_CONST(31349.7235036526/8.0),
10614 REAL_CONST(31367.466537618013/8.0),
10615 REAL_CONST(31385.212081028923/8.0),
10616 REAL_CONST(31402.960133175795/8.0),
10617 REAL_CONST(31420.710693349596/8.0),
10618 REAL_CONST(31438.463760841791/8.0),
10619 REAL_CONST(31456.219334944351/8.0),
10620 REAL_CONST(31473.977414949743/8.0),
10621 REAL_CONST(31491.738000150934/8.0),
10622 REAL_CONST(31509.501089841389/8.0),
10623 REAL_CONST(31527.266683315069/8.0),
10624 REAL_CONST(31545.034779866437/8.0),
10625 REAL_CONST(31562.80537879045/8.0),
10626 REAL_CONST(31580.578479382562/8.0),
10627 REAL_CONST(31598.35408093872/8.0),
10628 REAL_CONST(31616.132182755369/8.0),
10629 REAL_CONST(31633.91278412945/8.0),
10630 REAL_CONST(31651.695884358396/8.0),
10631 REAL_CONST(31669.481482740131/8.0),
10632 REAL_CONST(31687.269578573076/8.0),
10633 REAL_CONST(31705.060171156143/8.0),
10634 REAL_CONST(31722.853259788735/8.0),
10635 REAL_CONST(31740.648843770748/8.0),
10636 REAL_CONST(31758.446922402567/8.0),
10637 REAL_CONST(31776.247494985066/8.0),
10638 REAL_CONST(31794.050560819614/8.0),
10639 REAL_CONST(31811.85611920806/8.0),
10640 REAL_CONST(31829.664169452753/8.0),
10641 REAL_CONST(31847.474710856521/8.0),
10642 REAL_CONST(31865.287742722685/8.0),
10643 REAL_CONST(31883.103264355046/8.0),
10644 REAL_CONST(31900.921275057899/8.0),
10645 REAL_CONST(31918.741774136019/8.0),
10646 REAL_CONST(31936.564760894671/8.0),
10647 REAL_CONST(31954.390234639599/8.0),
10648 REAL_CONST(31972.21819467704/8.0),
10649 REAL_CONST(31990.048640313704/8.0),
10650 REAL_CONST(32007.881570856793/8.0),
10651 REAL_CONST(32025.716985613984/8.0),
10652 REAL_CONST(32043.554883893445/8.0),
10653 REAL_CONST(32061.395265003815/8.0),
10654 REAL_CONST(32079.238128254223/8.0),
10655 REAL_CONST(32097.083472954269/8.0),
10656 REAL_CONST(32114.931298414049/8.0),
10657 REAL_CONST(32132.781603944117/8.0),
10658 REAL_CONST(32150.634388855524/8.0),
10659 REAL_CONST(32168.48965245979/8.0),
10660 REAL_CONST(32186.347394068915/8.0),
10661 REAL_CONST(32204.207612995371/8.0),
10662 REAL_CONST(32222.07030855212/8.0),
10663 REAL_CONST(32239.935480052583/8.0),
10664 REAL_CONST(32257.803126810672/8.0),
10665 REAL_CONST(32275.673248140767/8.0),
10666 REAL_CONST(32293.545843357719/8.0),
10667 REAL_CONST(32311.420911776862/8.0),
10668 REAL_CONST(32329.298452713996/8.0),
10669 REAL_CONST(32347.178465485395/8.0),
10670 REAL_CONST(32365.060949407813/8.0),
10671 REAL_CONST(32382.945903798463/8.0),
10672 REAL_CONST(32400.83332797504/8.0),
10673 REAL_CONST(32418.723221255706/8.0),
10674 REAL_CONST(32436.615582959093/8.0),
10675 REAL_CONST(32454.510412404306/8.0),
10676 REAL_CONST(32472.407708910916/8.0),
10677 REAL_CONST(32490.307471798966/8.0),
10678 REAL_CONST(32508.209700388961/8.0),
10679 REAL_CONST(32526.114394001877/8.0),
10680 REAL_CONST(32544.021551959166/8.0),
10681 REAL_CONST(32561.931173582732/8.0),
10682 REAL_CONST(32579.843258194956/8.0),
10683 REAL_CONST(32597.757805118679/8.0),
10684 REAL_CONST(32615.674813677211/8.0),
10685 REAL_CONST(32633.594283194328/8.0),
10686 REAL_CONST(32651.516212994258/8.0),
10687 REAL_CONST(32669.440602401712/8.0),
10688 REAL_CONST(32687.367450741847/8.0),
10689 REAL_CONST(32705.296757340297/8.0),
10690 REAL_CONST(32723.228521523146/8.0),
10691 REAL_CONST(32741.162742616943/8.0),
10692 REAL_CONST(32759.099419948703/8.0),
10693 REAL_CONST(32777.038552845901/8.0),
10694 REAL_CONST(32794.980140636464/8.0),
10695 REAL_CONST(32812.924182648792/8.0),
10696 REAL_CONST(32830.87067821173/8.0),
10697 REAL_CONST(32848.819626654593/8.0),
10698 REAL_CONST(32866.77102730715/8.0),
10699 REAL_CONST(32884.724879499619/8.0),
10700 REAL_CONST(32902.681182562686/8.0),
10701 REAL_CONST(32920.639935827494/8.0),
10702 REAL_CONST(32938.601138625643/8.0),
10703 REAL_CONST(32956.56479028918/8.0),
10704 REAL_CONST(32974.530890150607/8.0),
10705 REAL_CONST(32992.499437542894/8.0),
10706 REAL_CONST(33010.470431799447/8.0),
10707 REAL_CONST(33028.443872254145/8.0),
10708 REAL_CONST(33046.419758241311/8.0),
10709 REAL_CONST(33064.39808909571/8.0),
10710 REAL_CONST(33082.378864152583/8.0),
10711 REAL_CONST(33100.36208274759/8.0),
10712 REAL_CONST(33118.347744216881/8.0),
10713 REAL_CONST(33136.335847897026/8.0),
10714 REAL_CONST(33154.326393125062/8.0),
10715 REAL_CONST(33172.31937923847/8.0),
10716 REAL_CONST(33190.314805575174/8.0),
10717 REAL_CONST(33208.312671473555/8.0),
10718 REAL_CONST(33226.312976272442/8.0),
10719 REAL_CONST(33244.315719311111/8.0),
10720 REAL_CONST(33262.320899929284/8.0),
10721 REAL_CONST(33280.328517467125/8.0),
10722 REAL_CONST(33298.33857126526/8.0),
10723 REAL_CONST(33316.351060664747/8.0),
10724 REAL_CONST(33334.365985007091/8.0),
10725 REAL_CONST(33352.383343634239/8.0),
10726 REAL_CONST(33370.403135888591/8.0),
10727 REAL_CONST(33388.42536111299/8.0),
10728 REAL_CONST(33406.450018650721/8.0),
10729 REAL_CONST(33424.477107845501/8.0),
10730 REAL_CONST(33442.506628041512/8.0),
10731 REAL_CONST(33460.53857858335/8.0),
10732 REAL_CONST(33478.572958816083/8.0),
10733 REAL_CONST(33496.609768085189/8.0),
10734 REAL_CONST(33514.649005736617/8.0),
10735 REAL_CONST(33532.690671116739/8.0),
10736 REAL_CONST(33550.734763572356/8.0),
10737 REAL_CONST(33568.781282450735/8.0),
10738 REAL_CONST(33586.830227099563/8.0),
10739 REAL_CONST(33604.881596866973/8.0),
10740 REAL_CONST(33622.935391101528/8.0),
10741 REAL_CONST(33640.991609152239/8.0),
10742 REAL_CONST(33659.050250368542/8.0),
10743 REAL_CONST(33677.111314100322/8.0),
10744 REAL_CONST(33695.174799697881/8.0),
10745 REAL_CONST(33713.240706511984/8.0),
10746 REAL_CONST(33731.309033893805/8.0),
10747 REAL_CONST(33749.37978119497/8.0),
10748 REAL_CONST(33767.452947767531/8.0),
10749 REAL_CONST(33785.528532963974/8.0),
10750 REAL_CONST(33803.606536137209/8.0),
10751 REAL_CONST(33821.686956640602/8.0),
10752 REAL_CONST(33839.769793827938/8.0),
10753 REAL_CONST(33857.855047053425/8.0),
10754 REAL_CONST(33875.942715671707/8.0),
10755 REAL_CONST(33894.032799037872/8.0),
10756 REAL_CONST(33912.125296507431/8.0),
10757 REAL_CONST(33930.220207436316/8.0),
10758 REAL_CONST(33948.317531180888/8.0),
10759 REAL_CONST(33966.417267097961/8.0),
10760 REAL_CONST(33984.519414544746/8.0),
10761 REAL_CONST(34002.623972878901/8.0),
10762 REAL_CONST(34020.730941458511/8.0),
10763 REAL_CONST(34038.840319642077/8.0),
10764 REAL_CONST(34056.952106788536/8.0),
10765 REAL_CONST(34075.066302257255/8.0),
10766 REAL_CONST(34093.182905408015/8.0),
10767 REAL_CONST(34111.301915601027/8.0),
10768 REAL_CONST(34129.42333219693/8.0),
10769 REAL_CONST(34147.547154556785/8.0),
10770 REAL_CONST(34165.673382042078/8.0),
10771 REAL_CONST(34183.80201401472/8.0),
10772 REAL_CONST(34201.933049837033/8.0),
10773 REAL_CONST(34220.06648887178/8.0),
10774 REAL_CONST(34238.202330482141/8.0),
10775 REAL_CONST(34256.340574031703/8.0),
10776 REAL_CONST(34274.481218884495/8.0),
10777 REAL_CONST(34292.624264404949/8.0),
10778 REAL_CONST(34310.769709957938/8.0),
10779 REAL_CONST(34328.91755490873/8.0),
10780 REAL_CONST(34347.067798623029/8.0),
10781 REAL_CONST(34365.220440466954/8.0),
10782 REAL_CONST(34383.375479807051/8.0),
10783 REAL_CONST(34401.532916010263/8.0),
10784 REAL_CONST(34419.692748443973/8.0),
10785 REAL_CONST(34437.854976475966/8.0),
10786 REAL_CONST(34456.01959947445/8.0),
10787 REAL_CONST(34474.18661680806/8.0),
10788 REAL_CONST(34492.356027845817/8.0),
10789 REAL_CONST(34510.527831957188/8.0),
10790 REAL_CONST(34528.702028512052/8.0),
10791 REAL_CONST(34546.878616880676/8.0),
10792 REAL_CONST(34565.05759643377/8.0),
10793 REAL_CONST(34583.238966542449/8.0),
10794 REAL_CONST(34601.422726578232/8.0),
10795 REAL_CONST(34619.608875913065/8.0),
10796 REAL_CONST(34637.797413919296/8.0),
10797 REAL_CONST(34655.988339969692/8.0),
10798 REAL_CONST(34674.181653437423/8.0),
10799 REAL_CONST(34692.37735369608/8.0),
10800 REAL_CONST(34710.575440119668/8.0),
10801 REAL_CONST(34728.775912082579/8.0),
10802 REAL_CONST(34746.978768959649/8.0),
10803 REAL_CONST(34765.184010126082/8.0),
10804 REAL_CONST(34783.391634957537/8.0),
10805 REAL_CONST(34801.60164283005/8.0),
10806 REAL_CONST(34819.814033120063/8.0),
10807 REAL_CONST(34838.028805204456/8.0),
10808 REAL_CONST(34856.24595846048/8.0),
10809 REAL_CONST(34874.465492265823/8.0),
10810 REAL_CONST(34892.687405998557/8.0),
10811 REAL_CONST(34910.911699037177/8.0),
10812 REAL_CONST(34929.138370760564/8.0),
10813 REAL_CONST(34947.367420548027/8.0),
10814 REAL_CONST(34965.598847779271/8.0),
10815 REAL_CONST(34983.832651834389/8.0),
10816 REAL_CONST(35002.068832093908/8.0),
10817 REAL_CONST(35020.307387938738/8.0),
10818 REAL_CONST(35038.548318750189/8.0),
10819 REAL_CONST(35056.79162390998/8.0),
10820 REAL_CONST(35075.03730280025/8.0),
10821 REAL_CONST(35093.285354803513/8.0),
10822 REAL_CONST(35111.535779302685/8.0),
10823 REAL_CONST(35129.788575681116/8.0),
10824 REAL_CONST(35148.043743322516/8.0),
10825 REAL_CONST(35166.301281611013/8.0),
10826 REAL_CONST(35184.561189931141/8.0),
10827 REAL_CONST(35202.823467667826/8.0),
10828 REAL_CONST(35221.088114206388/8.0),
10829 REAL_CONST(35239.355128932555/8.0),
10830 REAL_CONST(35257.624511232447/8.0),
10831 REAL_CONST(35275.896260492584/8.0),
10832 REAL_CONST(35294.170376099886/8.0),
10833 REAL_CONST(35312.446857441668/8.0),
10834 REAL_CONST(35330.725703905628/8.0),
10835 REAL_CONST(35349.006914879887/8.0),
10836 REAL_CONST(35367.290489752944/8.0),
10837 REAL_CONST(35385.576427913686/8.0),
10838 REAL_CONST(35403.864728751418/8.0),
10839 REAL_CONST(35422.155391655811/8.0),
10840 REAL_CONST(35440.448416016967/8.0),
10841 REAL_CONST(35458.743801225341/8.0),
10842 REAL_CONST(35477.041546671804/8.0),
10843 REAL_CONST(35495.341651747622/8.0),
10844 REAL_CONST(35513.644115844436/8.0),
10845 REAL_CONST(35531.948938354304/8.0),
10846 REAL_CONST(35550.256118669655/8.0),
10847 REAL_CONST(35568.565656183309/8.0),
10848 REAL_CONST(35586.877550288496/8.0),
10849 REAL_CONST(35605.191800378816/8.0),
10850 REAL_CONST(35623.508405848268/8.0),
10851 REAL_CONST(35641.827366091238/8.0),
10852 REAL_CONST(35660.148680502505/8.0),
10853 REAL_CONST(35678.472348477233/8.0),
10854 REAL_CONST(35696.798369410979/8.0),
10855 REAL_CONST(35715.126742699678/8.0),
10856 REAL_CONST(35733.457467739659/8.0),
10857 REAL_CONST(35751.790543927644/8.0),
10858 REAL_CONST(35770.125970660738/8.0),
10859 REAL_CONST(35788.46374733642/8.0),
10860 REAL_CONST(35806.803873352568/8.0),
10861 REAL_CONST(35825.146348107453/8.0),
10862 REAL_CONST(35843.49117099971/8.0),
10863 REAL_CONST(35861.838341428367/8.0),
10864 REAL_CONST(35880.187858792851/8.0),
10865 REAL_CONST(35898.539722492955/8.0),
10866 REAL_CONST(35916.893931928862/8.0),
10867 REAL_CONST(35935.250486501129/8.0),
10868 REAL_CONST(35953.609385610718/8.0),
10869 REAL_CONST(35971.970628658957/8.0),
10870 REAL_CONST(35990.334215047558/8.0),
10871 REAL_CONST(36008.700144178612/8.0),
10872 REAL_CONST(36027.068415454596/8.0),
10873 REAL_CONST(36045.439028278372/8.0),
10874 REAL_CONST(36063.811982053165/8.0),
10875 REAL_CONST(36082.187276182609/8.0),
10876 REAL_CONST(36100.564910070694/8.0),
10877 REAL_CONST(36118.944883121789/8.0),
10878 REAL_CONST(36137.327194740654/8.0),
10879 REAL_CONST(36155.711844332429/8.0),
10880 REAL_CONST(36174.098831302617/8.0),
10881 REAL_CONST(36192.488155057115/8.0),
10882 REAL_CONST(36210.87981500219/8.0),
10883 REAL_CONST(36229.273810544473/8.0),
10884 REAL_CONST(36247.670141091003/8.0),
10885 REAL_CONST(36266.068806049167/8.0),
10886 REAL_CONST(36284.469804826738/8.0),
10887 REAL_CONST(36302.873136831862/8.0),
10888 REAL_CONST(36321.278801473069/8.0),
10889 REAL_CONST(36339.686798159251/8.0),
10890 REAL_CONST(36358.097126299683/8.0),
10891 REAL_CONST(36376.509785304013/8.0),
10892 REAL_CONST(36394.924774582258/8.0),
10893 REAL_CONST(36413.342093544816/8.0),
10894 REAL_CONST(36431.761741602444/8.0),
10895 REAL_CONST(36450.183718166292/8.0),
10896 REAL_CONST(36468.608022647859/8.0),
10897 REAL_CONST(36487.034654459028/8.0),
10898 REAL_CONST(36505.463613012063/8.0),
10899 REAL_CONST(36523.894897719583/8.0),
10900 REAL_CONST(36542.328507994578/8.0),
10901 REAL_CONST(36560.764443250409/8.0),
10902 REAL_CONST(36579.202702900831/8.0),
10903 REAL_CONST(36597.643286359926/8.0),
10904 REAL_CONST(36616.086193042182/8.0),
10905 REAL_CONST(36634.531422362437/8.0),
10906 REAL_CONST(36652.978973735895/8.0),
10907 REAL_CONST(36671.428846578143/8.0),
10908 REAL_CONST(36689.881040305125/8.0),
10909 REAL_CONST(36708.335554333149/8.0),
10910 REAL_CONST(36726.792388078902/8.0),
10911 REAL_CONST(36745.251540959427/8.0),
10912 REAL_CONST(36763.713012392138/8.0),
10913 REAL_CONST(36782.176801794812/8.0),
10914 REAL_CONST(36800.642908585593/8.0),
10915 REAL_CONST(36819.111332182983/8.0),
10916 REAL_CONST(36837.582072005869/8.0),
10917 REAL_CONST(36856.055127473483/8.0),
10918 REAL_CONST(36874.530498005421/8.0),
10919 REAL_CONST(36893.008183021651/8.0),
10920 REAL_CONST(36911.488181942506/8.0),
10921 REAL_CONST(36929.970494188674/8.0),
10922 REAL_CONST(36948.455119181206/8.0),
10923 REAL_CONST(36966.942056341519/8.0),
10924 REAL_CONST(36985.431305091392/8.0),
10925 REAL_CONST(37003.922864852961/8.0),
10926 REAL_CONST(37022.416735048733/8.0),
10927 REAL_CONST(37040.912915101559/8.0),
10928 REAL_CONST(37059.411404434657/8.0),
10929 REAL_CONST(37077.91220247162/8.0),
10930 REAL_CONST(37096.415308636388/8.0),
10931 REAL_CONST(37114.920722353243/8.0),
10932 REAL_CONST(37133.428443046862/8.0),
10933 REAL_CONST(37151.938470142253/8.0),
10934 REAL_CONST(37170.450803064785/8.0),
10935 REAL_CONST(37188.965441240209/8.0),
10936 REAL_CONST(37207.482384094597/8.0),
10937 REAL_CONST(37226.001631054402/8.0),
10938 REAL_CONST(37244.523181546429/8.0),
10939 REAL_CONST(37263.047034997842/8.0),
10940 REAL_CONST(37281.573190836149/8.0),
10941 REAL_CONST(37300.101648489224/8.0),
10942 REAL_CONST(37318.632407385296/8.0),
10943 REAL_CONST(37337.165466952945/8.0),
10944 REAL_CONST(37355.700826621112/8.0),
10945 REAL_CONST(37374.238485819085/8.0),
10946 REAL_CONST(37392.778443976509/8.0),
10947 REAL_CONST(37411.320700523385/8.0),
10948 REAL_CONST(37429.865254890057/8.0),
10949 REAL_CONST(37448.412106507232/8.0),
10950 REAL_CONST(37466.961254805974/8.0),
10951 REAL_CONST(37485.512699217681/8.0),
10952 REAL_CONST(37504.066439174116/8.0),
10953 REAL_CONST(37522.622474107404/8.0),
10954 REAL_CONST(37541.180803449992/8.0),
10955 REAL_CONST(37559.741426634704/8.0),
10956 REAL_CONST(37578.304343094693/8.0),
10957 REAL_CONST(37596.869552263488/8.0),
10958 REAL_CONST(37615.43705357494/8.0),
10959 REAL_CONST(37634.006846463279/8.0),
10960 REAL_CONST(37652.578930363044/8.0),
10961 REAL_CONST(37671.153304709165/8.0),
10962 REAL_CONST(37689.729968936896/8.0),
10963 REAL_CONST(37708.308922481847/8.0),
10964 REAL_CONST(37726.890164779965/8.0),
10965 REAL_CONST(37745.473695267559/8.0),
10966 REAL_CONST(37764.059513381275/8.0),
10967 REAL_CONST(37782.647618558112/8.0),
10968 REAL_CONST(37801.238010235415/8.0),
10969 REAL_CONST(37819.830687850859/8.0),
10970 REAL_CONST(37838.425650842495/8.0),
10971 REAL_CONST(37857.022898648691/8.0),
10972 REAL_CONST(37875.622430708172/8.0),
10973 REAL_CONST(37894.224246460013/8.0),
10974 REAL_CONST(37912.828345343616/8.0),
10975 REAL_CONST(37931.434726798747/8.0),
10976 REAL_CONST(37950.043390265506/8.0),
10977 REAL_CONST(37968.654335184328/8.0),
10978 REAL_CONST(37987.267560995999/8.0),
10979 REAL_CONST(38005.883067141665/8.0),
10980 REAL_CONST(38024.500853062775/8.0),
10981 REAL_CONST(38043.120918201159/8.0),
10982 REAL_CONST(38061.743261998963/8.0),
10983 REAL_CONST(38080.367883898682/8.0),
10984 REAL_CONST(38098.994783343158/8.0),
10985 REAL_CONST(38117.623959775563/8.0),
10986 REAL_CONST(38136.255412639417/8.0),
10987 REAL_CONST(38154.889141378575/8.0),
10988 REAL_CONST(38173.525145437234/8.0),
10989 REAL_CONST(38192.163424259939/8.0),
10990 REAL_CONST(38210.803977291551/8.0),
10991 REAL_CONST(38229.446803977284/8.0),
10992 REAL_CONST(38248.091903762703/8.0),
10993 REAL_CONST(38266.739276093685/8.0),
10994 REAL_CONST(38285.388920416466/8.0),
10995 REAL_CONST(38304.040836177606/8.0),
10996 REAL_CONST(38322.695022824002/8.0),
10997 REAL_CONST(38341.351479802899/8.0),
10998 REAL_CONST(38360.010206561863/8.0),
10999 REAL_CONST(38378.671202548816/8.0),
11000 REAL_CONST(38397.334467211993/8.0),
11001 REAL_CONST(38415.999999999978/8.0),
11002 REAL_CONST(38434.667800361683/8.0),
11003 REAL_CONST(38453.33786774637/8.0),
11004 REAL_CONST(38472.010201603611/8.0),
11005 REAL_CONST(38490.684801383337/8.0),
11006 REAL_CONST(38509.361666535784/8.0),
11007 REAL_CONST(38528.040796511552/8.0),
11008 REAL_CONST(38546.722190761553/8.0),
11009 REAL_CONST(38565.405848737035/8.0),
11010 REAL_CONST(38584.091769889594/8.0),
11011 REAL_CONST(38602.779953671132/8.0),
11012 REAL_CONST(38621.470399533908/8.0),
11013 REAL_CONST(38640.163106930493/8.0),
11014 REAL_CONST(38658.858075313794/8.0),
11015 REAL_CONST(38677.555304137059/8.0),
11016 REAL_CONST(38696.254792853862/8.0),
11017 REAL_CONST(38714.956540918094/8.0),
11018 REAL_CONST(38733.660547783991/8.0),
11019 REAL_CONST(38752.366812906112/8.0),
11020 REAL_CONST(38771.075335739348/8.0),
11021 REAL_CONST(38789.78611573892/8.0),
11022 REAL_CONST(38808.499152360368/8.0),
11023 REAL_CONST(38827.214445059573/8.0),
11024 REAL_CONST(38845.931993292739/8.0),
11025 REAL_CONST(38864.651796516388/8.0),
11026 REAL_CONST(38883.373854187383/8.0),
11027 REAL_CONST(38902.098165762916/8.0),
11028 REAL_CONST(38920.824730700486/8.0),
11029 REAL_CONST(38939.553548457938/8.0),
11030 REAL_CONST(38958.284618493431/8.0),
11031 REAL_CONST(38977.017940265461/8.0),
11032 REAL_CONST(38995.753513232834/8.0),
11033 REAL_CONST(39014.491336854699/8.0),
11034 REAL_CONST(39033.231410590517/8.0),
11035 REAL_CONST(39051.973733900079/8.0),
11036 REAL_CONST(39070.718306243485/8.0),
11037 REAL_CONST(39089.465127081188/8.0),
11038 REAL_CONST(39108.214195873945/8.0),
11039 REAL_CONST(39126.965512082832/8.0),
11040 REAL_CONST(39145.719075169261/8.0),
11041 REAL_CONST(39164.474884594965/8.0),
11042 REAL_CONST(39183.232939821988/8.0),
11043 REAL_CONST(39201.99324031271/8.0),
11044 REAL_CONST(39220.755785529815/8.0),
11045 REAL_CONST(39239.52057493633/8.0),
11046 REAL_CONST(39258.287607995589/8.0),
11047 REAL_CONST(39277.056884171245/8.0),
11048 REAL_CONST(39295.828402927284/8.0),
11049 REAL_CONST(39314.602163728006/8.0),
11050 REAL_CONST(39333.378166038019/8.0),
11051 REAL_CONST(39352.15640932227/8.0),
11052 REAL_CONST(39370.936893046004/8.0),
11053 REAL_CONST(39389.719616674811/8.0),
11054 REAL_CONST(39408.504579674584/8.0),
11055 REAL_CONST(39427.291781511522/8.0),
11056 REAL_CONST(39446.081221652174/8.0),
11057 REAL_CONST(39464.872899563372/8.0),
11058 REAL_CONST(39483.666814712291/8.0),
11059 REAL_CONST(39502.462966566411/8.0),
11060 REAL_CONST(39521.261354593538/8.0),
11061 REAL_CONST(39540.06197826178/8.0),
11062 REAL_CONST(39558.864837039568/8.0),
11063 REAL_CONST(39577.669930395656/8.0),
11064 REAL_CONST(39596.47725779911/8.0),
11065 REAL_CONST(39615.286818719302/8.0),
11066 REAL_CONST(39634.098612625923/8.0),
11067 REAL_CONST(39652.912638988993/8.0),
11068 REAL_CONST(39671.728897278823/8.0),
11069 REAL_CONST(39690.547386966064/8.0),
11070 REAL_CONST(39709.368107521652/8.0),
11071 REAL_CONST(39728.191058416858/8.0),
11072 REAL_CONST(39747.016239123259/8.0),
11073 REAL_CONST(39765.84364911275/8.0),
11074 REAL_CONST(39784.673287857528/8.0),
11075 REAL_CONST(39803.505154830105/8.0),
11076 REAL_CONST(39822.339249503319/8.0),
11077 REAL_CONST(39841.175571350293/8.0),
11078 REAL_CONST(39860.014119844491/8.0),
11079 REAL_CONST(39878.854894459677/8.0),
11080 REAL_CONST(39897.697894669909/8.0),
11081 REAL_CONST(39916.54311994958/8.0),
11082 REAL_CONST(39935.390569773372/8.0),
11083 REAL_CONST(39954.240243616303/8.0),
11084 REAL_CONST(39973.092140953675/8.0),
11085 REAL_CONST(39991.946261261117/8.0),
11086 REAL_CONST(40010.802604014549/8.0),
11087 REAL_CONST(40029.661168690225/8.0),
11088 REAL_CONST(40048.521954764678/8.0),
11089 REAL_CONST(40067.384961714779/8.0),
11090 REAL_CONST(40086.250189017679/8.0),
11091 REAL_CONST(40105.117636150855/8.0),
11092 REAL_CONST(40123.98730259209/8.0),
11093 REAL_CONST(40142.859187819471/8.0),
11094 REAL_CONST(40161.733291311379/8.0),
11095 REAL_CONST(40180.609612546526/8.0),
11096 REAL_CONST(40199.488151003912/8.0),
11097 REAL_CONST(40218.368906162854/8.0),
11098 REAL_CONST(40237.25187750296/8.0),
11099 REAL_CONST(40256.137064504153/8.0),
11100 REAL_CONST(40275.024466646668/8.0),
11101 REAL_CONST(40293.914083411029/8.0),
11102 REAL_CONST(40312.805914278084/8.0),
11103 REAL_CONST(40331.699958728961/8.0),
11104 REAL_CONST(40350.596216245103/8.0),
11105 REAL_CONST(40369.494686308273/8.0),
11106 REAL_CONST(40388.39536840051/8.0),
11107 REAL_CONST(40407.298262004173/8.0),
11108 REAL_CONST(40426.20336660192/8.0),
11109 REAL_CONST(40445.110681676706/8.0),
11110 REAL_CONST(40464.020206711793/8.0),
11111 REAL_CONST(40482.931941190756/8.0),
11112 REAL_CONST(40501.845884597446/8.0),
11113 REAL_CONST(40520.762036416032/8.0),
11114 REAL_CONST(40539.680396130985/8.0),
11115 REAL_CONST(40558.600963227072/8.0),
11116 REAL_CONST(40577.523737189367/8.0),
11117 REAL_CONST(40596.448717503234/8.0),
11118 REAL_CONST(40615.375903654342/8.0),
11119 REAL_CONST(40634.305295128659/8.0),
11120 REAL_CONST(40653.236891412453/8.0),
11121 REAL_CONST(40672.170691992294/8.0),
11122 REAL_CONST(40691.106696355047/8.0),
11123 REAL_CONST(40710.044903987873/8.0),
11124 REAL_CONST(40728.985314378238/8.0),
11125 REAL_CONST(40747.927927013901/8.0),
11126 REAL_CONST(40766.872741382918/8.0),
11127 REAL_CONST(40785.819756973651/8.0),
11128 REAL_CONST(40804.768973274746/8.0),
11129 REAL_CONST(40823.720389775161/8.0),
11130 REAL_CONST(40842.674005964131/8.0),
11131 REAL_CONST(40861.629821331211/8.0),
11132 REAL_CONST(40880.587835366234/8.0),
11133 REAL_CONST(40899.548047559321/8.0),
11134 REAL_CONST(40918.510457400931/8.0),
11135 REAL_CONST(40937.475064381761/8.0),
11136 REAL_CONST(40956.441867992849/8.0),
11137 REAL_CONST(40975.410867725499/8.0),
11138 REAL_CONST(40994.382063071331/8.0),
11139 REAL_CONST(41013.355453522236/8.0),
11140 REAL_CONST(41032.331038570417/8.0),
11141 REAL_CONST(41051.308817708363/8.0),
11142 REAL_CONST(41070.288790428858/8.0),
11143 REAL_CONST(41089.270956224987/8.0),
11144 REAL_CONST(41108.255314590111/8.0),
11145 REAL_CONST(41127.241865017888/8.0),
11146 REAL_CONST(41146.23060700229/8.0),
11147 REAL_CONST(41165.221540037543/8.0),
11148 REAL_CONST(41184.214663618193/8.0),
11149 REAL_CONST(41203.209977239079/8.0),
11150 REAL_CONST(41222.207480395307/8.0),
11151 REAL_CONST(41241.207172582297/8.0),
11152 REAL_CONST(41260.209053295752/8.0),
11153 REAL_CONST(41279.213122031659/8.0),
11154 REAL_CONST(41298.219378286303/8.0),
11155 REAL_CONST(41317.227821556255/8.0),
11156 REAL_CONST(41336.23845133838/8.0),
11157 REAL_CONST(41355.251267129832/8.0),
11158 REAL_CONST(41374.266268428037/8.0),
11159 REAL_CONST(41393.283454730743/8.0),
11160 REAL_CONST(41412.302825535953/8.0),
11161 REAL_CONST(41431.324380341983/8.0),
11162 REAL_CONST(41450.348118647416/8.0),
11163 REAL_CONST(41469.374039951144/8.0),
11164 REAL_CONST(41488.402143752326/8.0),
11165 REAL_CONST(41507.432429550427/8.0),
11166 REAL_CONST(41526.464896845187/8.0),
11167 REAL_CONST(41545.499545136627/8.0),
11168 REAL_CONST(41564.536373925075/8.0),
11169 REAL_CONST(41583.575382711126/8.0),
11170 REAL_CONST(41602.616570995662/8.0),
11171 REAL_CONST(41621.659938279874/8.0),
11172 REAL_CONST(41640.705484065205/8.0),
11173 REAL_CONST(41659.753207853406/8.0),
11174 REAL_CONST(41678.803109146495/8.0),
11175 REAL_CONST(41697.855187446803/8.0),
11176 REAL_CONST(41716.909442256911/8.0),
11177 REAL_CONST(41735.965873079709/8.0),
11178 REAL_CONST(41755.02447941836/8.0),
11179 REAL_CONST(41774.085260776315/8.0),
11180 REAL_CONST(41793.148216657297/8.0),
11181 REAL_CONST(41812.213346565331/8.0),
11182 REAL_CONST(41831.280650004708/8.0),
11183 REAL_CONST(41850.350126480014/8.0),
11184 REAL_CONST(41869.421775496106/8.0),
11185 REAL_CONST(41888.495596558132/8.0),
11186 REAL_CONST(41907.571589171515/8.0),
11187 REAL_CONST(41926.649752841957/8.0),
11188 REAL_CONST(41945.730087075463/8.0),
11189 REAL_CONST(41964.812591378286/8.0),
11190 REAL_CONST(41983.897265256979/8.0),
11191 REAL_CONST(42002.984108218378/8.0),
11192 REAL_CONST(42022.073119769593/8.0),
11193 REAL_CONST(42041.164299418015/8.0),
11194 REAL_CONST(42060.257646671307/8.0),
11195 REAL_CONST(42079.353161037419/8.0),
11196 REAL_CONST(42098.450842024591/8.0),
11197 REAL_CONST(42117.550689141324/8.0),
11198 REAL_CONST(42136.652701896404/8.0),
11199 REAL_CONST(42155.756879798893/8.0),
11200 REAL_CONST(42174.863222358137/8.0),
11201 REAL_CONST(42193.971729083758/8.0),
11202 REAL_CONST(42213.082399485655/8.0),
11203 REAL_CONST(42232.195233074002/8.0),
11204 REAL_CONST(42251.310229359246/8.0),
11205 REAL_CONST(42270.427387852127/8.0),
11206 REAL_CONST(42289.546708063644/8.0),
11207 REAL_CONST(42308.668189505079/8.0),
11208 REAL_CONST(42327.791831687995/8.0),
11209 REAL_CONST(42346.917634124227/8.0),
11210 REAL_CONST(42366.045596325886/8.0),
11211 REAL_CONST(42385.175717805352/8.0),
11212 REAL_CONST(42404.307998075295/8.0),
11213 REAL_CONST(42423.442436648642/8.0),
11214 REAL_CONST(42442.579033038608/8.0),
11215 REAL_CONST(42461.717786758672/8.0),
11216 REAL_CONST(42480.858697322597/8.0),
11217 REAL_CONST(42500.001764244422/8.0),
11218 REAL_CONST(42519.146987038446/8.0),
11219 REAL_CONST(42538.294365219248/8.0),
11220 REAL_CONST(42557.443898301688/8.0),
11221 REAL_CONST(42576.595585800882/8.0),
11222 REAL_CONST(42595.749427232236/8.0),
11223 REAL_CONST(42614.90542211142/8.0),
11224 REAL_CONST(42634.063569954378/8.0),
11225 REAL_CONST(42653.223870277317/8.0),
11226 REAL_CONST(42672.386322596729/8.0),
11227 REAL_CONST(42691.55092642938/8.0),
11228 REAL_CONST(42710.717681292292/8.0),
11229 REAL_CONST(42729.886586702756/8.0),
11230 REAL_CONST(42749.057642178363/8.0),
11231 REAL_CONST(42768.23084723694/8.0),
11232 REAL_CONST(42787.406201396603/8.0),
11233 REAL_CONST(42806.58370417574/8.0),
11234 REAL_CONST(42825.76335509299/8.0),
11235 REAL_CONST(42844.945153667286/8.0),
11236 REAL_CONST(42864.129099417805/8.0),
11237 REAL_CONST(42883.315191864014/8.0),
11238 REAL_CONST(42902.503430525649/8.0),
11239 REAL_CONST(42921.693814922692/8.0),
11240 REAL_CONST(42940.88634457541/8.0),
11241 REAL_CONST(42960.081019004348/8.0),
11242 REAL_CONST(42979.277837730297/8.0),
11243 REAL_CONST(42998.476800274322/8.0),
11244 REAL_CONST(43017.677906157769/8.0),
11245 REAL_CONST(43036.881154902228/8.0),
11246 REAL_CONST(43056.086546029583/8.0),
11247 REAL_CONST(43075.294079061961/8.0),
11248 REAL_CONST(43094.503753521763/8.0),
11249 REAL_CONST(43113.715568931671/8.0),
11250 REAL_CONST(43132.929524814601/8.0),
11251 REAL_CONST(43152.145620693766/8.0),
11252 REAL_CONST(43171.363856092619/8.0),
11253 REAL_CONST(43190.584230534907/8.0),
11254 REAL_CONST(43209.806743544621/8.0),
11255 REAL_CONST(43229.031394646016/8.0),
11256 REAL_CONST(43248.258183363621/8.0),
11257 REAL_CONST(43267.487109222224/8.0),
11258 REAL_CONST(43286.718171746885/8.0),
11259 REAL_CONST(43305.951370462906/8.0),
11260 REAL_CONST(43325.186704895881/8.0),
11261 REAL_CONST(43344.42417457165/8.0),
11262 REAL_CONST(43363.663779016322/8.0),
11263 REAL_CONST(43382.905517756262/8.0),
11264 REAL_CONST(43402.149390318104/8.0),
11265 REAL_CONST(43421.395396228749/8.0),
11266 REAL_CONST(43440.643535015348/8.0),
11267 REAL_CONST(43459.89380620532/8.0),
11268 REAL_CONST(43479.146209326354/8.0),
11269 REAL_CONST(43498.400743906379/8.0),
11270 REAL_CONST(43517.657409473606/8.0),
11271 REAL_CONST(43536.916205556496/8.0),
11272 REAL_CONST(43556.177131683784/8.0),
11273 REAL_CONST(43575.44018738444/8.0),
11274 REAL_CONST(43594.705372187724/8.0),
11275 REAL_CONST(43613.972685623135/8.0),
11276 REAL_CONST(43633.242127220445/8.0),
11277 REAL_CONST(43652.513696509668/8.0),
11278 REAL_CONST(43671.787393021099/8.0),
11279 REAL_CONST(43691.063216285271/8.0),
11280 REAL_CONST(43710.341165833001/8.0),
11281 REAL_CONST(43729.621241195346/8.0),
11282 REAL_CONST(43748.903441903625/8.0),
11283 REAL_CONST(43768.187767489413/8.0),
11284 REAL_CONST(43787.474217484552/8.0),
11285 REAL_CONST(43806.762791421126/8.0),
11286 REAL_CONST(43826.053488831501/8.0),
11287 REAL_CONST(43845.346309248278/8.0),
11288 REAL_CONST(43864.641252204325/8.0),
11289 REAL_CONST(43883.938317232765/8.0),
11290 REAL_CONST(43903.237503866971/8.0),
11291 REAL_CONST(43922.538811640596/8.0),
11292 REAL_CONST(43941.842240087513/8.0),
11293 REAL_CONST(43961.147788741881/8.0),
11294 REAL_CONST(43980.455457138101/8.0),
11295 REAL_CONST(43999.765244810835/8.0),
11296 REAL_CONST(44019.077151295001/8.0),
11297 REAL_CONST(44038.391176125755/8.0),
11298 REAL_CONST(44057.70731883854/8.0),
11299 REAL_CONST(44077.02557896902/8.0),
11300 REAL_CONST(44096.345956053141/8.0),
11301 REAL_CONST(44115.668449627083/8.0),
11302 REAL_CONST(44134.993059227287/8.0),
11303 REAL_CONST(44154.319784390456/8.0),
11304 REAL_CONST(44173.648624653535/8.0),
11305 REAL_CONST(44192.979579553728/8.0),
11306 REAL_CONST(44212.312648628489/8.0),
11307 REAL_CONST(44231.647831415532/8.0),
11308 REAL_CONST(44250.985127452805/8.0),
11309 REAL_CONST(44270.324536278538/8.0),
11310 REAL_CONST(44289.666057431183/8.0),
11311 REAL_CONST(44309.009690449464/8.0),
11312 REAL_CONST(44328.355434872348/8.0),
11313 REAL_CONST(44347.703290239064/8.0),
11314 REAL_CONST(44367.053256089079/8.0),
11315 REAL_CONST(44386.405331962109/8.0),
11316 REAL_CONST(44405.759517398139/8.0),
11317 REAL_CONST(44425.115811937387/8.0),
11318 REAL_CONST(44444.474215120332/8.0),
11319 REAL_CONST(44463.834726487694/8.0),
11320 REAL_CONST(44483.197345580462/8.0),
11321 REAL_CONST(44502.562071939843/8.0),
11322 REAL_CONST(44521.928905107328/8.0),
11323 REAL_CONST(44541.297844624634/8.0),
11324 REAL_CONST(44560.668890033732/8.0),
11325 REAL_CONST(44580.042040876848/8.0),
11326 REAL_CONST(44599.417296696454/8.0),
11327 REAL_CONST(44618.794657035272/8.0),
11328 REAL_CONST(44638.174121436256/8.0),
11329 REAL_CONST(44657.555689442641/8.0),
11330 REAL_CONST(44676.939360597877/8.0),
11331 REAL_CONST(44696.325134445673/8.0),
11332 REAL_CONST(44715.713010530002/8.0),
11333 REAL_CONST(44735.102988395054/8.0),
11334 REAL_CONST(44754.495067585296/8.0),
11335 REAL_CONST(44773.88924764542/8.0),
11336 REAL_CONST(44793.285528120374/8.0),
11337 REAL_CONST(44812.683908555344/8.0),
11338 REAL_CONST(44832.084388495779/8.0),
11339 REAL_CONST(44851.486967487363/8.0),
11340 REAL_CONST(44870.891645076015/8.0),
11341 REAL_CONST(44890.298420807922/8.0),
11342 REAL_CONST(44909.707294229491/8.0),
11343 REAL_CONST(44929.118264887409/8.0),
11344 REAL_CONST(44948.531332328566/8.0),
11345 REAL_CONST(44967.946496100136/8.0),
11346 REAL_CONST(44987.363755749502/8.0),
11347 REAL_CONST(45006.783110824319/8.0),
11348 REAL_CONST(45026.204560872473/8.0),
11349 REAL_CONST(45045.628105442098/8.0),
11350 REAL_CONST(45065.053744081561/8.0),
11351 REAL_CONST(45084.48147633949/8.0),
11352 REAL_CONST(45103.911301764747/8.0),
11353 REAL_CONST(45123.343219906426/8.0),
11354 REAL_CONST(45142.777230313885/8.0),
11355 REAL_CONST(45162.21333253671/8.0),
11356 REAL_CONST(45181.651526124733/8.0),
11357 REAL_CONST(45201.091810628037/8.0),
11358 REAL_CONST(45220.534185596924/8.0),
11359 REAL_CONST(45239.978650581965/8.0),
11360 REAL_CONST(45259.425205133957/8.0),
11361 REAL_CONST(45278.873848803938/8.0),
11362 REAL_CONST(45298.324581143192/8.0),
11363 REAL_CONST(45317.777401703235/8.0),
11364 REAL_CONST(45337.232310035848/8.0),
11365 REAL_CONST(45356.68930569302/8.0),
11366 REAL_CONST(45376.148388226997/8.0),
11367 REAL_CONST(45395.60955719027/8.0),
11368 REAL_CONST(45415.072812135557/8.0),
11369 REAL_CONST(45434.538152615823/8.0),
11370 REAL_CONST(45454.005578184282/8.0),
11371 REAL_CONST(45473.475088394356/8.0),
11372 REAL_CONST(45492.946682799746/8.0),
11373 REAL_CONST(45512.420360954362/8.0),
11374 REAL_CONST(45531.896122412363/8.0),
11375 REAL_CONST(45551.373966728155/8.0),
11376 REAL_CONST(45570.853893456362/8.0),
11377 REAL_CONST(45590.33590215187/8.0),
11378 REAL_CONST(45609.819992369776/8.0),
11379 REAL_CONST(45629.306163665438/8.0),
11380 REAL_CONST(45648.794415594442/8.0),
11381 REAL_CONST(45668.284747712612/8.0),
11382 REAL_CONST(45687.777159576006/8.0),
11383 REAL_CONST(45707.27165074092/8.0),
11384 REAL_CONST(45726.768220763894/8.0),
11385 REAL_CONST(45746.266869201696/8.0),
11386 REAL_CONST(45765.767595611323/8.0),
11387 REAL_CONST(45785.270399550034/8.0),
11388 REAL_CONST(45804.775280575297/8.0),
11389 REAL_CONST(45824.282238244828/8.0),
11390 REAL_CONST(45843.79127211657/8.0),
11391 REAL_CONST(45863.302381748719/8.0),
11392 REAL_CONST(45882.815566699683/8.0),
11393 REAL_CONST(45902.33082652813/8.0),
11394 REAL_CONST(45921.848160792935/8.0),
11395 REAL_CONST(45941.367569053225/8.0),
11396 REAL_CONST(45960.889050868354/8.0),
11397 REAL_CONST(45980.41260579793/8.0),
11398 REAL_CONST(45999.938233401757/8.0),
11399 REAL_CONST(46019.465933239902/8.0),
11400 REAL_CONST(46038.995704872657/8.0),
11401 REAL_CONST(46058.527547860547/8.0),
11402 REAL_CONST(46078.06146176433/8.0),
11403 REAL_CONST(46097.597446144995/8.0),
11404 REAL_CONST(46117.135500563774/8.0),
11405 REAL_CONST(46136.675624582109/8.0),
11406 REAL_CONST(46156.217817761702/8.0),
11407 REAL_CONST(46175.762079664462/8.0),
11408 REAL_CONST(46195.308409852543/8.0),
11409 REAL_CONST(46214.856807888333/8.0),
11410 REAL_CONST(46234.407273334444/8.0),
11411 REAL_CONST(46253.959805753715/8.0),
11412 REAL_CONST(46273.51440470924/8.0),
11413 REAL_CONST(46293.071069764315/8.0),
11414 REAL_CONST(46312.629800482478/8.0),
11415 REAL_CONST(46332.190596427499/8.0),
11416 REAL_CONST(46351.753457163381/8.0),
11417 REAL_CONST(46371.318382254351/8.0),
11418 REAL_CONST(46390.885371264863/8.0),
11419 REAL_CONST(46410.45442375962/8.0),
11420 REAL_CONST(46430.025539303526/8.0),
11421 REAL_CONST(46449.598717461733/8.0),
11422 REAL_CONST(46469.17395779962/8.0),
11423 REAL_CONST(46488.751259882782/8.0),
11424 REAL_CONST(46508.33062327707/8.0),
11425 REAL_CONST(46527.912047548532/8.0),
11426 REAL_CONST(46547.495532263471/8.0),
11427 REAL_CONST(46567.081076988397/8.0),
11428 REAL_CONST(46586.668681290059/8.0),
11429 REAL_CONST(46606.258344735434/8.0),
11430 REAL_CONST(46625.850066891719/8.0),
11431 REAL_CONST(46645.443847326351/8.0),
11432 REAL_CONST(46665.039685606986/8.0),
11433 REAL_CONST(46684.637581301497/8.0),
11434 REAL_CONST(46704.237533978005/8.0),
11435 REAL_CONST(46723.839543204842/8.0),
11436 REAL_CONST(46743.443608550573/8.0),
11437 REAL_CONST(46763.049729583989/8.0),
11438 REAL_CONST(46782.657905874104/8.0),
11439 REAL_CONST(46802.268136990162/8.0),
11440 REAL_CONST(46821.880422501628/8.0),
11441 REAL_CONST(46841.494761978196/8.0),
11442 REAL_CONST(46861.111154989776/8.0),
11443 REAL_CONST(46880.729601106526/8.0),
11444 REAL_CONST(46900.350099898795/8.0),
11445 REAL_CONST(46919.97265093719/8.0),
11446 REAL_CONST(46939.597253792526/8.0),
11447 REAL_CONST(46959.223908035841/8.0),
11448 REAL_CONST(46978.852613238392/8.0),
11449 REAL_CONST(46998.483368971691/8.0),
11450 REAL_CONST(47018.11617480743/8.0),
11451 REAL_CONST(47037.751030317551/8.0),
11452 REAL_CONST(47057.387935074221/8.0),
11453 REAL_CONST(47077.026888649809/8.0),
11454 REAL_CONST(47096.66789061694/8.0),
11455 REAL_CONST(47116.310940548428/8.0),
11456 REAL_CONST(47135.956038017328/8.0),
11457 REAL_CONST(47155.603182596918/8.0),
11458 REAL_CONST(47175.252373860698/8.0),
11459 REAL_CONST(47194.903611382375/8.0),
11460 REAL_CONST(47214.556894735892/8.0),
11461 REAL_CONST(47234.212223495422/8.0),
11462 REAL_CONST(47253.869597235338/8.0),
11463 REAL_CONST(47273.52901553025/8.0),
11464 REAL_CONST(47293.19047795498/8.0),
11465 REAL_CONST(47312.853984084577/8.0),
11466 REAL_CONST(47332.519533494306/8.0),
11467 REAL_CONST(47352.187125759658/8.0),
11468 REAL_CONST(47371.856760456343/8.0),
11469 REAL_CONST(47391.528437160297/8.0),
11470 REAL_CONST(47411.202155447652/8.0),
11471 REAL_CONST(47430.877914894787/8.0),
11472 REAL_CONST(47450.555715078299/8.0),
11473 REAL_CONST(47470.235555574982/8.0),
11474 REAL_CONST(47489.917435961863/8.0),
11475 REAL_CONST(47509.601355816201/8.0),
11476 REAL_CONST(47529.287314715453/8.0),
11477 REAL_CONST(47548.975312237308/8.0),
11478 REAL_CONST(47568.665347959672/8.0),
11479 REAL_CONST(47588.357421460656/8.0),
11480 REAL_CONST(47608.051532318605/8.0),
11481 REAL_CONST(47627.747680112072/8.0),
11482 REAL_CONST(47647.445864419846/8.0),
11483 REAL_CONST(47667.14608482091/8.0),
11484 REAL_CONST(47686.848340894474/8.0),
11485 REAL_CONST(47706.552632219973/8.0),
11486 REAL_CONST(47726.258958377046/8.0),
11487 REAL_CONST(47745.967318945557/8.0),
11488 REAL_CONST(47765.677713505589/8.0),
11489 REAL_CONST(47785.390141637428/8.0),
11490 REAL_CONST(47805.104602921601/8.0),
11491 REAL_CONST(47824.821096938824/8.0),
11492 REAL_CONST(47844.539623270044/8.0),
11493 REAL_CONST(47864.260181496429/8.0),
11494 REAL_CONST(47883.982771199349/8.0),
11495 REAL_CONST(47903.707391960394/8.0),
11496 REAL_CONST(47923.434043361369/8.0),
11497 REAL_CONST(47943.162724984308/8.0),
11498 REAL_CONST(47962.893436411439/8.0),
11499 REAL_CONST(47982.626177225218/8.0),
11500 REAL_CONST(48002.36094700831/8.0),
11501 REAL_CONST(48022.097745343599/8.0),
11502 REAL_CONST(48041.836571814172/8.0),
11503 REAL_CONST(48061.57742600335/8.0),
11504 REAL_CONST(48081.32030749465/8.0),
11505 REAL_CONST(48101.065215871815/8.0),
11506 REAL_CONST(48120.81215071879/8.0),
11507 REAL_CONST(48140.56111161974/8.0),
11508 REAL_CONST(48160.312098159047/8.0),
11509 REAL_CONST(48180.065109921306/8.0),
11510 REAL_CONST(48199.820146491307/8.0),
11511 REAL_CONST(48219.577207454073/8.0),
11512 REAL_CONST(48239.336292394844/8.0),
11513 REAL_CONST(48259.097400899045/8.0),
11514 REAL_CONST(48278.860532552339/8.0),
11515 REAL_CONST(48298.625686940592/8.0),
11516 REAL_CONST(48318.392863649875/8.0),
11517 REAL_CONST(48338.162062266485/8.0),
11518 REAL_CONST(48357.933282376915/8.0),
11519 REAL_CONST(48377.706523567889/8.0),
11520 REAL_CONST(48397.481785426316/8.0),
11521 REAL_CONST(48417.259067539344/8.0),
11522 REAL_CONST(48437.038369494308/8.0),
11523 REAL_CONST(48456.819690878765/8.0),
11524 REAL_CONST(48476.603031280487/8.0),
11525 REAL_CONST(48496.388390287451/8.0),
11526 REAL_CONST(48516.175767487839/8.0),
11527 REAL_CONST(48535.965162470042/8.0),
11528 REAL_CONST(48555.756574822684/8.0),
11529 REAL_CONST(48575.550004134566/8.0),
11530 REAL_CONST(48595.345449994718/8.0),
11531 REAL_CONST(48615.142911992378/8.0),
11532 REAL_CONST(48634.942389716991/8.0),
11533 REAL_CONST(48654.743882758201/8.0),
11534 REAL_CONST(48674.547390705877/8.0),
11535 REAL_CONST(48694.352913150084/8.0),
11536 REAL_CONST(48714.160449681112/8.0),
11537 REAL_CONST(48733.969999889443/8.0),
11538 REAL_CONST(48753.781563365759/8.0),
11539 REAL_CONST(48773.595139700978/8.0),
11540 REAL_CONST(48793.410728486211/8.0),
11541 REAL_CONST(48813.228329312769/8.0),
11542 REAL_CONST(48833.047941772187/8.0),
11543 REAL_CONST(48852.869565456189/8.0),
11544 REAL_CONST(48872.693199956717/8.0),
11545 REAL_CONST(48892.518844865925/8.0),
11546 REAL_CONST(48912.346499776155/8.0),
11547 REAL_CONST(48932.176164279976/8.0),
11548 REAL_CONST(48952.007837970152/8.0),
11549 REAL_CONST(48971.841520439666/8.0),
11550 REAL_CONST(48991.677211281676/8.0),
11551 REAL_CONST(49011.514910089587/8.0),
11552 REAL_CONST(49031.354616456978/8.0),
11553 REAL_CONST(49051.196329977654/8.0),
11554 REAL_CONST(49071.04005024561/8.0),
11555 REAL_CONST(49090.885776855059/8.0),
11556 REAL_CONST(49110.733509400408/8.0),
11557 REAL_CONST(49130.583247476279/8.0),
11558 REAL_CONST(49150.434990677488/8.0),
11559 REAL_CONST(49170.288738599062/8.0),
11560 REAL_CONST(49190.144490836232/8.0),
11561 REAL_CONST(49210.002246984441/8.0),
11562 REAL_CONST(49229.86200663932/8.0),
11563 REAL_CONST(49249.723769396718/8.0),
11564 REAL_CONST(49269.587534852675/8.0),
11565 REAL_CONST(49289.453302603448/8.0),
11566 REAL_CONST(49309.32107224549/8.0),
11567 REAL_CONST(49329.190843375451/8.0),
11568 REAL_CONST(49349.062615590192/8.0),
11569 REAL_CONST(49368.936388486785/8.0),
11570 REAL_CONST(49388.812161662492/8.0),
11571 REAL_CONST(49408.689934714785/8.0),
11572 REAL_CONST(49428.569707241324/8.0),
11573 REAL_CONST(49448.45147883999/8.0),
11574 REAL_CONST(49468.335249108866/8.0),
11575 REAL_CONST(49488.22101764621/8.0),
11576 REAL_CONST(49508.108784050521/8.0),
11577 REAL_CONST(49527.99854792047/8.0),
11578 REAL_CONST(49547.890308854934/8.0),
11579 REAL_CONST(49567.784066453009/8.0),
11580 REAL_CONST(49587.679820313977/8.0),
11581 REAL_CONST(49607.57757003732/8.0),
11582 REAL_CONST(49627.477315222721/8.0),
11583 REAL_CONST(49647.379055470075/8.0),
11584 REAL_CONST(49667.28279037946/8.0),
11585 REAL_CONST(49687.188519551179/8.0),
11586 REAL_CONST(49707.096242585707/8.0),
11587 REAL_CONST(49727.005959083741/8.0),
11588 REAL_CONST(49746.917668646165/8.0),
11589 REAL_CONST(49766.831370874068/8.0),
11590 REAL_CONST(49786.747065368734/8.0),
11591 REAL_CONST(49806.66475173166/8.0),
11592 REAL_CONST(49826.584429564515/8.0),
11593 REAL_CONST(49846.506098469203/8.0),
11594 REAL_CONST(49866.429758047794/8.0),
11595 REAL_CONST(49886.355407902578/8.0),
11596 REAL_CONST(49906.283047636032/8.0),
11597 REAL_CONST(49926.212676850846/8.0),
11598 REAL_CONST(49946.144295149883/8.0),
11599 REAL_CONST(49966.077902136225/8.0),
11600 REAL_CONST(49986.013497413151/8.0),
11601 REAL_CONST(50005.951080584135/8.0),
11602 REAL_CONST(50025.890651252834/8.0),
11603 REAL_CONST(50045.832209023123/8.0),
11604 REAL_CONST(50065.775753499074/8.0),
11605 REAL_CONST(50085.721284284933/8.0),
11606 REAL_CONST(50105.668800985164/8.0),
11607 REAL_CONST(50125.618303204428/8.0),
11608 REAL_CONST(50145.569790547575/8.0),
11609 REAL_CONST(50165.523262619652/8.0),
11610 REAL_CONST(50185.478719025901/8.0),
11611 REAL_CONST(50205.436159371769/8.0),
11612 REAL_CONST(50225.395583262893/8.0),
11613 REAL_CONST(50245.356990305103/8.0),
11614 REAL_CONST(50265.320380104429/8.0),
11615 REAL_CONST(50285.285752267104/8.0),
11616 REAL_CONST(50305.253106399534/8.0),
11617 REAL_CONST(50325.222442108337/8.0),
11618 REAL_CONST(50345.193759000336/8.0),
11619 REAL_CONST(50365.16705668252/8.0),
11620 REAL_CONST(50385.142334762102/8.0),
11621 REAL_CONST(50405.119592846473/8.0),
11622 REAL_CONST(50425.098830543218/8.0),
11623 REAL_CONST(50445.080047460127/8.0),
11624 REAL_CONST(50465.063243205179/8.0),
11625 REAL_CONST(50485.048417386541/8.0),
11626 REAL_CONST(50505.035569612577/8.0),
11627 REAL_CONST(50525.024699491856/8.0),
11628 REAL_CONST(50545.015806633128/8.0),
11629 REAL_CONST(50565.008890645338/8.0),
11630 REAL_CONST(50585.003951137631/8.0),
11631 REAL_CONST(50605.00098771933/8.0),
11632 REAL_CONST(50624.999999999971/8.0),
11633 REAL_CONST(50645.000987589265/8.0),
11634 REAL_CONST(50665.003950097132/8.0),
11635 REAL_CONST(50685.008887133677/8.0),
11636 REAL_CONST(50705.015798309192/8.0),
11637 REAL_CONST(50725.024683234165/8.0),
11638 REAL_CONST(50745.035541519283/8.0),
11639 REAL_CONST(50765.048372775411/8.0),
11640 REAL_CONST(50785.063176613621/8.0),
11641 REAL_CONST(50805.079952645159/8.0),
11642 REAL_CONST(50825.098700481489/8.0),
11643 REAL_CONST(50845.119419734241/8.0),
11644 REAL_CONST(50865.142110015244/8.0),
11645 REAL_CONST(50885.166770936521/8.0),
11646 REAL_CONST(50905.193402110279/8.0),
11647 REAL_CONST(50925.222003148934/8.0),
11648 REAL_CONST(50945.252573665071/8.0),
11649 REAL_CONST(50965.285113271471/8.0),
11650 REAL_CONST(50985.319621581119/8.0),
11651 REAL_CONST(51005.356098207172/8.0),
11652 REAL_CONST(51025.394542762981/8.0),
11653 REAL_CONST(51045.434954862096/8.0),
11654 REAL_CONST(51065.477334118244/8.0),
11655 REAL_CONST(51085.521680145357/8.0),
11656 REAL_CONST(51105.567992557546/8.0),
11657 REAL_CONST(51125.616270969113/8.0),
11658 REAL_CONST(51145.66651499454/8.0),
11659 REAL_CONST(51165.718724248516/8.0),
11660 REAL_CONST(51185.772898345916/8.0),
11661 REAL_CONST(51205.829036901778/8.0),
11662 REAL_CONST(51225.887139531362/8.0),
11663 REAL_CONST(51245.947205850105/8.0),
11664 REAL_CONST(51266.009235473619/8.0),
11665 REAL_CONST(51286.073228017718/8.0),
11666 REAL_CONST(51306.139183098399/8.0),
11667 REAL_CONST(51326.207100331856/8.0),
11668 REAL_CONST(51346.276979334456/8.0),
11669 REAL_CONST(51366.348819722756/8.0),
11670 REAL_CONST(51386.42262111351/8.0),
11671 REAL_CONST(51406.498383123653/8.0),
11672 REAL_CONST(51426.57610537031/8.0),
11673 REAL_CONST(51446.655787470787/8.0),
11674 REAL_CONST(51466.737429042587/8.0),
11675 REAL_CONST(51486.82102970338/8.0),
11676 REAL_CONST(51506.906589071048/8.0),
11677 REAL_CONST(51526.994106763632/8.0),
11678 REAL_CONST(51547.083582399391/8.0),
11679 REAL_CONST(51567.175015596738/8.0),
11680 REAL_CONST(51587.268405974297/8.0),
11681 REAL_CONST(51607.363753150858/8.0),
11682 REAL_CONST(51627.461056745415/8.0),
11683 REAL_CONST(51647.56031637713/8.0),
11684 REAL_CONST(51667.661531665362/8.0),
11685 REAL_CONST(51687.764702229651/8.0),
11686 REAL_CONST(51707.869827689727/8.0),
11687 REAL_CONST(51727.976907665499/8.0),
11688 REAL_CONST(51748.085941777055/8.0),
11689 REAL_CONST(51768.196929644677/8.0),
11690 REAL_CONST(51788.309870888836/8.0),
11691 REAL_CONST(51808.42476513017/8.0),
11692 REAL_CONST(51828.541611989524/8.0),
11693 REAL_CONST(51848.660411087905/8.0),
11694 REAL_CONST(51868.781162046515/8.0),
11695 REAL_CONST(51888.90386448674/8.0),
11696 REAL_CONST(51909.028518030143/8.0),
11697 REAL_CONST(51929.155122298485/8.0),
11698 REAL_CONST(51949.283676913685/8.0),
11699 REAL_CONST(51969.414181497872/8.0),
11700 REAL_CONST(51989.546635673345/8.0),
11701 REAL_CONST(52009.681039062583/8.0),
11702 REAL_CONST(52029.817391288263/8.0),
11703 REAL_CONST(52049.955691973213/8.0),
11704 REAL_CONST(52070.095940740481/8.0),
11705 REAL_CONST(52090.238137213273/8.0),
11706 REAL_CONST(52110.382281014987/8.0),
11707 REAL_CONST(52130.5283717692/8.0),
11708 REAL_CONST(52150.676409099666/8.0),
11709 REAL_CONST(52170.826392630333/8.0),
11710 REAL_CONST(52190.97832198532/8.0),
11711 REAL_CONST(52211.132196788931/8.0),
11712 REAL_CONST(52231.288016665654/8.0),
11713 REAL_CONST(52251.445781240145/8.0),
11714 REAL_CONST(52271.60549013727/8.0),
11715 REAL_CONST(52291.76714298204/8.0),
11716 REAL_CONST(52311.930739399664/8.0),
11717 REAL_CONST(52332.096279015546/8.0),
11718 REAL_CONST(52352.263761455244/8.0),
11719 REAL_CONST(52372.433186344519/8.0),
11720 REAL_CONST(52392.604553309284/8.0),
11721 REAL_CONST(52412.777861975665/8.0),
11722 REAL_CONST(52432.953111969946/8.0),
11723 REAL_CONST(52453.130302918595/8.0),
11724 REAL_CONST(52473.309434448267/8.0),
11725 REAL_CONST(52493.490506185793/8.0),
11726 REAL_CONST(52513.67351775818/8.0),
11727 REAL_CONST(52533.858468792605/8.0),
11728 REAL_CONST(52554.045358916446/8.0),
11729 REAL_CONST(52574.234187757254/8.0),
11730 REAL_CONST(52594.42495494274/8.0),
11731 REAL_CONST(52614.617660100812/8.0),
11732 REAL_CONST(52634.812302859558/8.0),
11733 REAL_CONST(52655.008882847229/8.0),
11734 REAL_CONST(52675.20739969227/8.0),
11735 REAL_CONST(52695.407853023295/8.0),
11736 REAL_CONST(52715.610242469098/8.0),
11737 REAL_CONST(52735.814567658657/8.0),
11738 REAL_CONST(52756.02082822111/8.0),
11739 REAL_CONST(52776.229023785803/8.0),
11740 REAL_CONST(52796.439153982225/8.0),
11741 REAL_CONST(52816.651218440056/8.0),
11742 REAL_CONST(52836.865216789171/8.0),
11743 REAL_CONST(52857.081148659599/8.0),
11744 REAL_CONST(52877.29901368155/8.0),
11745 REAL_CONST(52897.518811485425/8.0),
11746 REAL_CONST(52917.740541701773/8.0),
11747 REAL_CONST(52937.964203961354/8.0),
11748 REAL_CONST(52958.18979789508/8.0),
11749 REAL_CONST(52978.417323134046/8.0),
11750 REAL_CONST(52998.646779309529/8.0),
11751 REAL_CONST(53018.878166052978/8.0),
11752 REAL_CONST(53039.111482996006/8.0),
11753 REAL_CONST(53059.346729770419/8.0),
11754 REAL_CONST(53079.583906008193/8.0),
11755 REAL_CONST(53099.823011341483/8.0),
11756 REAL_CONST(53120.0640454026/8.0),
11757 REAL_CONST(53140.307007824063/8.0),
11758 REAL_CONST(53160.551898238533/8.0),
11759 REAL_CONST(53180.79871627887/8.0),
11760 REAL_CONST(53201.047461578091/8.0),
11761 REAL_CONST(53221.2981337694/8.0),
11762 REAL_CONST(53241.550732486176/8.0),
11763 REAL_CONST(53261.805257361964/8.0),
11764 REAL_CONST(53282.061708030487/8.0),
11765 REAL_CONST(53302.32008412564/8.0),
11766 REAL_CONST(53322.580385281493/8.0),
11767 REAL_CONST(53342.842611132299/8.0),
11768 REAL_CONST(53363.106761312469/8.0),
11769 REAL_CONST(53383.372835456597/8.0),
11770 REAL_CONST(53403.640833199453/8.0),
11771 REAL_CONST(53423.910754175973/8.0),
11772 REAL_CONST(53444.18259802126/8.0),
11773 REAL_CONST(53464.456364370613/8.0),
11774 REAL_CONST(53484.732052859479/8.0),
11775 REAL_CONST(53505.009663123499/8.0),
11776 REAL_CONST(53525.289194798468/8.0),
11777 REAL_CONST(53545.570647520362/8.0),
11778 REAL_CONST(53565.854020925333/8.0),
11779 REAL_CONST(53586.139314649699/8.0),
11780 REAL_CONST(53606.426528329954/8.0),
11781 REAL_CONST(53626.715661602764/8.0),
11782 REAL_CONST(53647.006714104959/8.0),
11783 REAL_CONST(53667.299685473547/8.0),
11784 REAL_CONST(53687.59457534572/8.0),
11785 REAL_CONST(53707.891383358816/8.0),
11786 REAL_CONST(53728.190109150361/8.0),
11787 REAL_CONST(53748.490752358055/8.0),
11788 REAL_CONST(53768.793312619753/8.0),
11789 REAL_CONST(53789.09778957349/8.0),
11790 REAL_CONST(53809.404182857485/8.0),
11791 REAL_CONST(53829.712492110106/8.0),
11792 REAL_CONST(53850.022716969899/8.0),
11793 REAL_CONST(53870.334857075584/8.0),
11794 REAL_CONST(53890.648912066055/8.0),
11795 REAL_CONST(53910.964881580367/8.0),
11796 REAL_CONST(53931.28276525774/8.0),
11797 REAL_CONST(53951.602562737586/8.0),
11798 REAL_CONST(53971.924273659461/8.0),
11799 REAL_CONST(53992.24789766311/8.0),
11800 REAL_CONST(54012.57343438844/8.0),
11801 REAL_CONST(54032.90088347553/8.0),
11802 REAL_CONST(54053.23024456462/8.0),
11803 REAL_CONST(54073.561517296133/8.0),
11804 REAL_CONST(54093.894701310644/8.0),
11805 REAL_CONST(54114.22979624891/8.0),
11806 REAL_CONST(54134.566801751855/8.0),
11807 REAL_CONST(54154.90571746057/8.0),
11808 REAL_CONST(54175.246543016314/8.0),
11809 REAL_CONST(54195.589278060506/8.0),
11810 REAL_CONST(54215.933922234755/8.0),
11811 REAL_CONST(54236.280475180814/8.0),
11812 REAL_CONST(54256.628936540626/8.0),
11813 REAL_CONST(54276.97930595628/8.0),
11814 REAL_CONST(54297.331583070045/8.0),
11815 REAL_CONST(54317.685767524359/8.0),
11816 REAL_CONST(54338.041858961828/8.0),
11817 REAL_CONST(54358.399857025215/8.0),
11818 REAL_CONST(54378.759761357462/8.0),
11819 REAL_CONST(54399.121571601667/8.0),
11820 REAL_CONST(54419.485287401105/8.0),
11821 REAL_CONST(54439.850908399218/8.0),
11822 REAL_CONST(54460.218434239614/8.0),
11823 REAL_CONST(54480.587864566056/8.0),
11824 REAL_CONST(54500.95919902248/8.0),
11825 REAL_CONST(54521.332437252997/8.0),
11826 REAL_CONST(54541.707578901878/8.0),
11827 REAL_CONST(54562.084623613555/8.0),
11828 REAL_CONST(54582.46357103264/8.0),
11829 REAL_CONST(54602.844420803893/8.0),
11830 REAL_CONST(54623.227172572246/8.0),
11831 REAL_CONST(54643.611825982807/8.0),
11832 REAL_CONST(54663.998380680838/8.0),
11833 REAL_CONST(54684.386836311773/8.0),
11834 REAL_CONST(54704.777192521207/8.0),
11835 REAL_CONST(54725.169448954897/8.0),
11836 REAL_CONST(54745.563605258772/8.0),
11837 REAL_CONST(54765.959661078923/8.0),
11838 REAL_CONST(54786.357616061614/8.0),
11839 REAL_CONST(54806.757469853255/8.0),
11840 REAL_CONST(54827.159222100439/8.0),
11841 REAL_CONST(54847.562872449904/8.0),
11842 REAL_CONST(54867.968420548583/8.0),
11843 REAL_CONST(54888.375866043534/8.0),
11844 REAL_CONST(54908.785208582012/8.0),
11845 REAL_CONST(54929.196447811417/8.0),
11846 REAL_CONST(54949.609583379322/8.0),
11847 REAL_CONST(54970.024614933463/8.0),
11848 REAL_CONST(54990.441542121727/8.0),
11849 REAL_CONST(55010.86036459219/8.0),
11850 REAL_CONST(55031.28108199306/8.0),
11851 REAL_CONST(55051.703693972733/8.0),
11852 REAL_CONST(55072.128200179759/8.0),
11853 REAL_CONST(55092.554600262847/8.0),
11854 REAL_CONST(55112.982893870874/8.0),
11855 REAL_CONST(55133.413080652877/8.0),
11856 REAL_CONST(55153.845160258061/8.0),
11857 REAL_CONST(55174.279132335789/8.0),
11858 REAL_CONST(55194.714996535586/8.0),
11859 REAL_CONST(55215.152752507143/8.0),
11860 REAL_CONST(55235.592399900306/8.0),
11861 REAL_CONST(55256.033938365079/8.0),
11862 REAL_CONST(55276.477367551655/8.0),
11863 REAL_CONST(55296.92268711036/8.0),
11864 REAL_CONST(55317.369896691685/8.0),
11865 REAL_CONST(55337.818995946305/8.0),
11866 REAL_CONST(55358.269984525024/8.0),
11867 REAL_CONST(55378.72286207883/8.0),
11868 REAL_CONST(55399.177628258869/8.0),
11869 REAL_CONST(55419.634282716441/8.0),
11870 REAL_CONST(55440.092825103013/8.0),
11871 REAL_CONST(55460.553255070205/8.0),
11872 REAL_CONST(55481.015572269804/8.0),
11873 REAL_CONST(55501.479776353764/8.0),
11874 REAL_CONST(55521.945866974187/8.0),
11875 REAL_CONST(55542.413843783339/8.0),
11876 REAL_CONST(55562.883706433655/8.0),
11877 REAL_CONST(55583.355454577715/8.0),
11878 REAL_CONST(55603.82908786826/8.0),
11879 REAL_CONST(55624.304605958219/8.0),
11880 REAL_CONST(55644.782008500639/8.0),
11881 REAL_CONST(55665.261295148754/8.0),
11882 REAL_CONST(55685.742465555952/8.0),
11883 REAL_CONST(55706.225519375774/8.0),
11884 REAL_CONST(55726.710456261928/8.0),
11885 REAL_CONST(55747.197275868275/8.0),
11886 REAL_CONST(55767.685977848843/8.0),
11887 REAL_CONST(55788.176561857814/8.0),
11888 REAL_CONST(55808.669027549528/8.0),
11889 REAL_CONST(55829.163374578478/8.0),
11890 REAL_CONST(55849.659602599328/8.0),
11891 REAL_CONST(55870.157711266889/8.0),
11892 REAL_CONST(55890.657700236145/8.0),
11893 REAL_CONST(55911.159569162221/8.0),
11894 REAL_CONST(55931.663317700411/8.0),
11895 REAL_CONST(55952.168945506164/8.0),
11896 REAL_CONST(55972.676452235086/8.0),
11897 REAL_CONST(55993.185837542944/8.0),
11898 REAL_CONST(56013.697101085651/8.0),
11899 REAL_CONST(56034.210242519301/8.0),
11900 REAL_CONST(56054.72526150012/8.0),
11901 REAL_CONST(56075.242157684508/8.0),
11902 REAL_CONST(56095.760930729011/8.0),
11903 REAL_CONST(56116.281580290342/8.0),
11904 REAL_CONST(56136.804106025367/8.0),
11905 REAL_CONST(56157.328507591104/8.0),
11906 REAL_CONST(56177.85478464474/8.0),
11907 REAL_CONST(56198.382936843598/8.0),
11908 REAL_CONST(56218.912963845185/8.0),
11909 REAL_CONST(56239.444865307138/8.0),
11910 REAL_CONST(56259.978640887268/8.0),
11911 REAL_CONST(56280.514290243525/8.0),
11912 REAL_CONST(56301.051813034042/8.0),
11913 REAL_CONST(56321.591208917082/8.0),
11914 REAL_CONST(56342.13247755108/8.0),
11915 REAL_CONST(56362.675618594607/8.0),
11916 REAL_CONST(56383.220631706419/8.0),
11917 REAL_CONST(56403.767516545398/8.0),
11918 REAL_CONST(56424.316272770608/8.0),
11919 REAL_CONST(56444.866900041241/8.0),
11920 REAL_CONST(56465.419398016667/8.0),
11921 REAL_CONST(56485.973766356394/8.0),
11922 REAL_CONST(56506.530004720102/8.0),
11923 REAL_CONST(56527.088112767611/8.0),
11924 REAL_CONST(56547.648090158902/8.0),
11925 REAL_CONST(56568.209936554107/8.0),
11926 REAL_CONST(56588.773651613519/8.0),
11927 REAL_CONST(56609.339234997584/8.0),
11928 REAL_CONST(56629.9066863669/8.0),
11929 REAL_CONST(56650.47600538221/8.0),
11930 REAL_CONST(56671.04719170442/8.0),
11931 REAL_CONST(56691.620244994599/8.0),
11932 REAL_CONST(56712.195164913959/8.0),
11933 REAL_CONST(56732.771951123868/8.0),
11934 REAL_CONST(56753.350603285835/8.0),
11935 REAL_CONST(56773.931121061541/8.0),
11936 REAL_CONST(56794.513504112823/8.0),
11937 REAL_CONST(56815.097752101647/8.0),
11938 REAL_CONST(56835.683864690152/8.0),
11939 REAL_CONST(56856.271841540627/8.0),
11940 REAL_CONST(56876.86168231551/8.0),
11941 REAL_CONST(56897.453386677393/8.0),
11942 REAL_CONST(56918.046954289028/8.0),
11943 REAL_CONST(56938.642384813298/8.0),
11944 REAL_CONST(56959.239677913261/8.0),
11945 REAL_CONST(56979.838833252121/8.0),
11946 REAL_CONST(57000.439850493225/8.0),
11947 REAL_CONST(57021.04272930009/8.0),
11948 REAL_CONST(57041.647469336371/8.0),
11949 REAL_CONST(57062.254070265873/8.0),
11950 REAL_CONST(57082.862531752558/8.0),
11951 REAL_CONST(57103.472853460553/8.0),
11952 REAL_CONST(57124.085035054108/8.0),
11953 REAL_CONST(57144.699076197649/8.0),
11954 REAL_CONST(57165.314976555739/8.0),
11955 REAL_CONST(57185.932735793103/8.0),
11956 REAL_CONST(57206.552353574611/8.0),
11957 REAL_CONST(57227.173829565276/8.0),
11958 REAL_CONST(57247.797163430281/8.0),
11959 REAL_CONST(57268.42235483494/8.0),
11960 REAL_CONST(57289.049403444733/8.0),
11961 REAL_CONST(57309.678308925286/8.0),
11962 REAL_CONST(57330.30907094237/8.0),
11963 REAL_CONST(57350.941689161911/8.0),
11964 REAL_CONST(57371.576163249985/8.0),
11965 REAL_CONST(57392.212492872815/8.0),
11966 REAL_CONST(57412.850677696784/8.0),
11967 REAL_CONST(57433.490717388406/8.0),
11968 REAL_CONST(57454.132611614368/8.0),
11969 REAL_CONST(57474.776360041491/8.0),
11970 REAL_CONST(57495.421962336746/8.0),
11971 REAL_CONST(57516.069418167266/8.0),
11972 REAL_CONST(57536.718727200314/8.0),
11973 REAL_CONST(57557.36988910332/8.0),
11974 REAL_CONST(57578.022903543861/8.0),
11975 REAL_CONST(57598.677770189643/8.0),
11976 REAL_CONST(57619.334488708548/8.0),
11977 REAL_CONST(57639.993058768589/8.0),
11978 REAL_CONST(57660.653480037938/8.0),
11979 REAL_CONST(57681.315752184906/8.0),
11980 REAL_CONST(57701.979874877965/8.0),
11981 REAL_CONST(57722.64584778573/8.0),
11982 REAL_CONST(57743.31367057695/8.0),
11983 REAL_CONST(57763.983342920546/8.0),
11984 REAL_CONST(57784.654864485572/8.0),
11985 REAL_CONST(57805.328234941233/8.0),
11986 REAL_CONST(57826.003453956881/8.0),
11987 REAL_CONST(57846.680521202026/8.0),
11988 REAL_CONST(57867.359436346305/8.0),
11989 REAL_CONST(57888.040199059527/8.0),
11990 REAL_CONST(57908.722809011633/8.0),
11991 REAL_CONST(57929.407265872709/8.0),
11992 REAL_CONST(57950.093569313001/8.0),
11993 REAL_CONST(57970.781719002895/8.0),
11994 REAL_CONST(57991.471714612911/8.0),
11995 REAL_CONST(58012.16355581375/8.0),
11996 REAL_CONST(58032.857242276223/8.0),
11997 REAL_CONST(58053.552773671312/8.0),
11998 REAL_CONST(58074.25014967013/8.0),
11999 REAL_CONST(58094.949369943948/8.0),
12000 REAL_CONST(58115.650434164185/8.0),
12001 REAL_CONST(58136.353342002389/8.0),
12002 REAL_CONST(58157.058093130276/8.0),
12003 REAL_CONST(58177.764687219693/8.0),
12004 REAL_CONST(58198.47312394264/8.0),
12005 REAL_CONST(58219.183402971255/8.0),
12006 REAL_CONST(58239.895523977837/8.0),
12007 REAL_CONST(58260.609486634821/8.0),
12008 REAL_CONST(58281.325290614775/8.0),
12009 REAL_CONST(58302.042935590434/8.0),
12010 REAL_CONST(58322.762421234678/8.0),
12011 REAL_CONST(58343.483747220511/8.0),
12012 REAL_CONST(58364.206913221096/8.0),
12013 REAL_CONST(58384.931918909751/8.0),
12014 REAL_CONST(58405.658763959924/8.0),
12015 REAL_CONST(58426.3874480452/8.0),
12016 REAL_CONST(58447.117970839339/8.0),
12017 REAL_CONST(58467.85033201622/8.0),
12018 REAL_CONST(58488.584531249864/8.0),
12019 REAL_CONST(58509.320568214462/8.0),
12020 REAL_CONST(58530.058442584334/8.0),
12021 REAL_CONST(58550.798154033931/8.0),
12022 REAL_CONST(58571.539702237875/8.0),
12023 REAL_CONST(58592.283086870906/8.0),
12024 REAL_CONST(58613.028307607929/8.0),
12025 REAL_CONST(58633.775364123983/8.0),
12026 REAL_CONST(58654.52425609425/8.0),
12027 REAL_CONST(58675.274983194053/8.0),
12028 REAL_CONST(58696.027545098877/8.0),
12029 REAL_CONST(58716.781941484325/8.0),
12030 REAL_CONST(58737.538172026158/8.0),
12031 REAL_CONST(58758.296236400274/8.0),
12032 REAL_CONST(58779.056134282728/8.0),
12033 REAL_CONST(58799.817865349694/8.0),
12034 REAL_CONST(58820.581429277503/8.0),
12035 REAL_CONST(58841.346825742643/8.0),
12036 REAL_CONST(58862.114054421712/8.0),
12037 REAL_CONST(58882.883114991484/8.0),
12038 REAL_CONST(58903.654007128847/8.0),
12039 REAL_CONST(58924.426730510851/8.0),
12040 REAL_CONST(58945.201284814684/8.0),
12041 REAL_CONST(58965.977669717664/8.0),
12042 REAL_CONST(58986.755884897269/8.0),
12043 REAL_CONST(59007.535930031117/8.0),
12044 REAL_CONST(59028.317804796949/8.0),
12045 REAL_CONST(59049.101508872664/8.0),
12046 REAL_CONST(59069.887041936301/8.0),
12047 REAL_CONST(59090.674403666046/8.0),
12048 REAL_CONST(59111.463593740213/8.0),
12049 REAL_CONST(59132.254611837263/8.0),
12050 REAL_CONST(59153.047457635803/8.0),
12051 REAL_CONST(59173.84213081457/8.0),
12052 REAL_CONST(59194.638631052461/8.0),
12053 REAL_CONST(59215.436958028506/8.0),
12054 REAL_CONST(59236.237111421855/8.0),
12055 REAL_CONST(59257.039090911829/8.0),
12056 REAL_CONST(59277.842896177877/8.0),
12057 REAL_CONST(59298.648526899589/8.0),
12058 REAL_CONST(59319.455982756685/8.0),
12059 REAL_CONST(59340.26526342905/8.0),
12060 REAL_CONST(59361.076368596696/8.0),
12061 REAL_CONST(59381.889297939757/8.0),
12062 REAL_CONST(59402.704051138542/8.0),
12063 REAL_CONST(59423.520627873484/8.0),
12064 REAL_CONST(59444.339027825139/8.0),
12065 REAL_CONST(59465.159250674224/8.0),
12066 REAL_CONST(59485.9812961016/8.0),
12067 REAL_CONST(59506.805163788253/8.0),
12068 REAL_CONST(59527.630853415307/8.0),
12069 REAL_CONST(59548.458364664046/8.0),
12070 REAL_CONST(59569.287697215863/8.0),
12071 REAL_CONST(59590.118850752311/8.0),
12072 REAL_CONST(59610.951824955089/8.0),
12073 REAL_CONST(59631.786619506012/8.0),
12074 REAL_CONST(59652.623234087048/8.0),
12075 REAL_CONST(59673.461668380311/8.0),
12076 REAL_CONST(59694.301922068029/8.0),
12077 REAL_CONST(59715.143994832593/8.0),
12078 REAL_CONST(59735.987886356525/8.0),
12079 REAL_CONST(59756.833596322482/8.0),
12080 REAL_CONST(59777.681124413255/8.0),
12081 REAL_CONST(59798.530470311794/8.0),
12082 REAL_CONST(59819.381633701159/8.0),
12083 REAL_CONST(59840.234614264569/8.0),
12084 REAL_CONST(59861.089411685381/8.0),
12085 REAL_CONST(59881.94602564707/8.0),
12086 REAL_CONST(59902.804455833269/8.0),
12087 REAL_CONST(59923.664701927737/8.0),
12088 REAL_CONST(59944.526763614384/8.0),
12089 REAL_CONST(59965.390640577243/8.0),
12090 REAL_CONST(59986.256332500488/8.0),
12091 REAL_CONST(60007.123839068438/8.0),
12092 REAL_CONST(60027.993159965539/8.0),
12093 REAL_CONST(60048.864294876381/8.0),
12094 REAL_CONST(60069.737243485688/8.0),
12095 REAL_CONST(60090.612005478324/8.0),
12096 REAL_CONST(60111.488580539284/8.0),
12097 REAL_CONST(60132.366968353708/8.0),
12098 REAL_CONST(60153.247168606867/8.0),
12099 REAL_CONST(60174.129180984164/8.0),
12100 REAL_CONST(60195.013005171153/8.0),
12101 REAL_CONST(60215.898640853513/8.0),
12102 REAL_CONST(60236.786087717061/8.0),
12103 REAL_CONST(60257.675345447751/8.0),
12104 REAL_CONST(60278.566413731671/8.0),
12105 REAL_CONST(60299.459292255044/8.0),
12106 REAL_CONST(60320.353980704247/8.0),
12107 REAL_CONST(60341.25047876576/8.0),
12108 REAL_CONST(60362.148786126229/8.0),
12109 REAL_CONST(60383.048902472423/8.0),
12110 REAL_CONST(60403.950827491237/8.0),
12111 REAL_CONST(60424.854560869717/8.0),
12112 REAL_CONST(60445.76010229504/8.0),
12113 REAL_CONST(60466.667451454516/8.0),
12114 REAL_CONST(60487.57660803559/8.0),
12115 REAL_CONST(60508.487571725847/8.0),
12116 REAL_CONST(60529.400342212997/8.0),
12117 REAL_CONST(60550.314919184893/8.0),
12118 REAL_CONST(60571.231302329521/8.0),
12119 REAL_CONST(60592.149491335003/8.0),
12120 REAL_CONST(60613.069485889588/8.0),
12121 REAL_CONST(60633.991285681674/8.0),
12122 REAL_CONST(60654.914890399785/8.0),
12123 REAL_CONST(60675.840299732568/8.0),
12124 REAL_CONST(60696.767513368832/8.0),
12125 REAL_CONST(60717.696530997484/8.0),
12126 REAL_CONST(60738.627352307602/8.0),
12127 REAL_CONST(60759.55997698837/8.0),
12128 REAL_CONST(60780.494404729128/8.0),
12129 REAL_CONST(60801.430635219323/8.0),
12130 REAL_CONST(60822.368668148556/8.0),
12131 REAL_CONST(60843.308503206565/8.0),
12132 REAL_CONST(60864.250140083204/8.0),
12133 REAL_CONST(60885.193578468468/8.0),
12134 REAL_CONST(60906.138818052495/8.0),
12135 REAL_CONST(60927.085858525541/8.0),
12136 REAL_CONST(60948.034699578006/8.0),
12137 REAL_CONST(60968.985340900421/8.0),
12138 REAL_CONST(60989.937782183442/8.0),
12139 REAL_CONST(61010.892023117864/8.0),
12140 REAL_CONST(61031.848063394616/8.0),
12141 REAL_CONST(61052.805902704764/8.0),
12142 REAL_CONST(61073.765540739492/8.0),
12143 REAL_CONST(61094.726977190134/8.0),
12144 REAL_CONST(61115.690211748137/8.0),
12145 REAL_CONST(61136.655244105103/8.0),
12146 REAL_CONST(61157.622073952742/8.0),
12147 REAL_CONST(61178.590700982917/8.0),
12148 REAL_CONST(61199.561124887616/8.0),
12149 REAL_CONST(61220.533345358948/8.0),
12150 REAL_CONST(61241.507362089171/8.0),
12151 REAL_CONST(61262.483174770663/8.0),
12152 REAL_CONST(61283.460783095943/8.0),
12153 REAL_CONST(61304.440186757645/8.0),
12154 REAL_CONST(61325.421385448557/8.0),
12155 REAL_CONST(61346.404378861582/8.0),
12156 REAL_CONST(61367.389166689762/8.0),
12157 REAL_CONST(61388.375748626262/8.0),
12158 REAL_CONST(61409.364124364387/8.0),
12159 REAL_CONST(61430.354293597571/8.0),
12160 REAL_CONST(61451.346256019373/8.0),
12161 REAL_CONST(61472.340011323497/8.0),
12162 REAL_CONST(61493.335559203762/8.0),
12163 REAL_CONST(61514.332899354122/8.0),
12164 REAL_CONST(61535.332031468672/8.0),
12165 REAL_CONST(61556.332955241618/8.0),
12166 REAL_CONST(61577.335670367313/8.0),
12167 REAL_CONST(61598.340176540238/8.0),
12168 REAL_CONST(61619.346473454993/8.0),
12169 REAL_CONST(61640.354560806329/8.0),
12170 REAL_CONST(61661.3644382891/8.0),
12171 REAL_CONST(61682.376105598312/8.0),
12172 REAL_CONST(61703.389562429089/8.0),
12173 REAL_CONST(61724.404808476691/8.0),
12174 REAL_CONST(61745.42184343651/8.0),
12175 REAL_CONST(61766.440667004063/8.0),
12176 REAL_CONST(61787.461278874987/8.0),
12177 REAL_CONST(61808.483678745069/8.0),
12178 REAL_CONST(61829.507866310203/8.0),
12179 REAL_CONST(61850.533841266435/8.0),
12180 REAL_CONST(61871.561603309929/8.0),
12181 REAL_CONST(61892.591152136971/8.0),
12182 REAL_CONST(61913.622487443987/8.0),
12183 REAL_CONST(61934.655608927525/8.0),
12184 REAL_CONST(61955.690516284267/8.0),
12185 REAL_CONST(61976.727209211022/8.0),
12186 REAL_CONST(61997.765687404724/8.0),
12187 REAL_CONST(62018.805950562448/8.0),
12188 REAL_CONST(62039.847998381381/8.0),
12189 REAL_CONST(62060.891830558845/8.0),
12190 REAL_CONST(62081.93744679229/8.0),
12191 REAL_CONST(62102.984846779298/8.0),
12192 REAL_CONST(62124.034030217575/8.0),
12193 REAL_CONST(62145.084996804966/8.0),
12194 REAL_CONST(62166.137746239416/8.0),
12195 REAL_CONST(62187.19227821903/8.0),
12196 REAL_CONST(62208.248592442025/8.0),
12197 REAL_CONST(62229.306688606739/8.0),
12198 REAL_CONST(62250.366566411656/8.0),
12199 REAL_CONST(62271.428225555377/8.0),
12200 REAL_CONST(62292.491665736627/8.0),
12201 REAL_CONST(62313.556886654267/8.0),
12202 REAL_CONST(62334.623888007271/8.0),
12203 REAL_CONST(62355.692669494762/8.0),
12204 REAL_CONST(62376.763230815974/8.0),
12205 REAL_CONST(62397.835571670272/8.0),
12206 REAL_CONST(62418.909691757144/8.0),
12207 REAL_CONST(62439.98559077621/8.0),
12208 REAL_CONST(62461.063268427228/8.0),
12209 REAL_CONST(62482.142724410049/8.0),
12210 REAL_CONST(62503.223958424685/8.0),
12211 REAL_CONST(62524.306970171267/8.0),
12212 REAL_CONST(62545.39175935003/8.0),
12213 REAL_CONST(62566.478325661366/8.0),
12214 REAL_CONST(62587.566668805768/8.0),
12215 REAL_CONST(62608.656788483881/8.0),
12216 REAL_CONST(62629.748684396451/8.0),
12217 REAL_CONST(62650.842356244357/8.0),
12218 REAL_CONST(62671.937803728622/8.0),
12219 REAL_CONST(62693.035026550366/8.0),
12220 REAL_CONST(62714.134024410858/8.0),
12221 REAL_CONST(62735.234797011479/8.0),
12222 REAL_CONST(62756.337344053733/8.0),
12223 REAL_CONST(62777.441665239276/8.0),
12224 REAL_CONST(62798.547760269852/8.0),
12225 REAL_CONST(62819.655628847358/8.0),
12226 REAL_CONST(62840.765270673801/8.0),
12227 REAL_CONST(62861.876685451323/8.0),
12228 REAL_CONST(62882.989872882186/8.0),
12229 REAL_CONST(62904.104832668774/8.0),
12230 REAL_CONST(62925.221564513602/8.0),
12231 REAL_CONST(62946.340068119309/8.0),
12232 REAL_CONST(62967.460343188657/8.0),
12233 REAL_CONST(62988.582389424526/8.0),
12234 REAL_CONST(63009.70620652994/8.0),
12235 REAL_CONST(63030.831794208025/8.0),
12236 REAL_CONST(63051.959152162039/8.0),
12237 REAL_CONST(63073.08828009537/8.0),
12238 REAL_CONST(63094.219177711529/8.0),
12239 REAL_CONST(63115.351844714154/8.0),
12240 REAL_CONST(63136.486280806988/8.0),
12241 REAL_CONST(63157.622485693922/8.0),
12242 REAL_CONST(63178.760459078956/8.0),
12243 REAL_CONST(63199.900200666219/8.0),
12244 REAL_CONST(63221.041710159967/8.0),
12245 REAL_CONST(63242.184987264569/8.0),
12246 REAL_CONST(63263.330031684534/8.0),
12247 REAL_CONST(63284.476843124474/8.0),
12248 REAL_CONST(63305.625421289144/8.0),
12249 REAL_CONST(63326.775765883409/8.0),
12250 REAL_CONST(63347.927876612259/8.0),
12251 REAL_CONST(63369.081753180813/8.0),
12252 REAL_CONST(63390.237395294316/8.0),
12253 REAL_CONST(63411.39480265812/8.0),
12254 REAL_CONST(63432.553974977716/8.0),
12255 REAL_CONST(63453.714911958712/8.0),
12256 REAL_CONST(63474.877613306839/8.0),
12257 REAL_CONST(63496.042078727944/8.0),
12258 REAL_CONST(63517.208307927998/8.0),
12259 REAL_CONST(63538.376300613119/8.0),
12260 REAL_CONST(63559.546056489504/8.0),
12261 REAL_CONST(63580.717575263516/8.0),
12262 REAL_CONST(63601.890856641607/8.0),
12263 REAL_CONST(63623.065900330374/8.0),
12264 REAL_CONST(63644.242706036515/8.0),
12265 REAL_CONST(63665.421273466869/8.0),
12266 REAL_CONST(63686.601602328381/8.0),
12267 REAL_CONST(63707.783692328136/8.0),
12268 REAL_CONST(63728.967543173334/8.0),
12269 REAL_CONST(63750.153154571279/8.0),
12270 REAL_CONST(63771.340526229418/8.0),
12271 REAL_CONST(63792.529657855317/8.0),
12272 REAL_CONST(63813.720549156649/8.0),
12273 REAL_CONST(63834.913199841227/8.0),
12274 REAL_CONST(63856.107609616978/8.0),
12275 REAL_CONST(63877.303778191941/8.0),
12276 REAL_CONST(63898.501705274284/8.0),
12277 REAL_CONST(63919.7013905723/8.0),
12278 REAL_CONST(63940.902833794404/8.0),
12279 REAL_CONST(63962.106034649114/8.0),
12280 REAL_CONST(63983.310992845094/8.0),
12281 REAL_CONST(64004.517708091109/8.0),
12282 REAL_CONST(64025.726180096048/8.0),
12283 REAL_CONST(64046.936408568938/8.0),
12284 REAL_CONST(64068.1483932189/8.0),
12285 REAL_CONST(64089.362133755196/8.0),
12286 REAL_CONST(64110.577629887193/8.0),
12287 REAL_CONST(64131.794881324393/8.0),
12288 REAL_CONST(64153.013887776404/8.0),
12289 REAL_CONST(64174.234648952966/8.0),
12290 REAL_CONST(64195.457164563937/8.0),
12291 REAL_CONST(64216.681434319289/8.0),
12292 REAL_CONST(64237.907457929112/8.0),
12293 REAL_CONST(64259.135235103626/8.0),
12294 REAL_CONST(64280.36476555316/8.0),
12295 REAL_CONST(64301.596048988169/8.0),
12296 REAL_CONST(64322.829085119236/8.0),
12297 REAL_CONST(64344.06387365704/8.0),
12298 REAL_CONST(64365.300414312398/8.0),
12299 REAL_CONST(64386.538706796251/8.0),
12300 REAL_CONST(64407.778750819634/8.0),
12301 REAL_CONST(64429.020546093721/8.0),
12302 REAL_CONST(64450.26409232981/8.0),
12303 REAL_CONST(64471.509389239291/8.0),
12304 REAL_CONST(64492.756436533709/8.0),
12305 REAL_CONST(64514.005233924705/8.0),
12306 REAL_CONST(64535.255781124033/8.0),
12307 REAL_CONST(64556.50807784358/8.0),
12308 REAL_CONST(64577.762123795357/8.0),
12309 REAL_CONST(64599.017918691468/8.0),
12310 REAL_CONST(64620.275462244172/8.0),
12311 REAL_CONST(64641.534754165805/8.0),
12312 REAL_CONST(64662.795794168844/8.0),
12313 REAL_CONST(64684.058581965895/8.0),
12314 REAL_CONST(64705.323117269661/8.0),
12315 REAL_CONST(64726.589399792974/8.0),
12316 REAL_CONST(64747.857429248776/8.0),
12317 REAL_CONST(64769.127205350138/8.0),
12318 REAL_CONST(64790.398727810236/8.0),
12319 REAL_CONST(64811.671996342375/8.0),
12320 REAL_CONST(64832.947010659969/8.0),
12321 REAL_CONST(64854.223770476558/8.0),
12322 REAL_CONST(64875.502275505794/8.0),
12323 REAL_CONST(64896.782525461451/8.0),
12324 REAL_CONST(64918.064520057414/8.0),
12325 REAL_CONST(64939.348259007682/8.0),
12326 REAL_CONST(64960.633742026388/8.0),
12327 REAL_CONST(64981.920968827762/8.0),
12328 REAL_CONST(65003.209939126165/8.0),
12329 REAL_CONST(65024.500652636067/8.0),
12330 REAL_CONST(65045.793109072067/8.0),
12331 REAL_CONST(65067.087308148861/8.0),
12332 REAL_CONST(65088.383249581282/8.0),
12333 REAL_CONST(65109.680933084259/8.0),
12334 REAL_CONST(65130.980358372864/8.0),
12335 REAL_CONST(65152.28152516226/8.0),
12336 REAL_CONST(65173.584433167736/8.0),
12337 REAL_CONST(65194.889082104703/8.0),
12338 REAL_CONST(65216.195471688683/8.0),
12339 REAL_CONST(65237.503601635319/8.0),
12340 REAL_CONST(65258.813471660353/8.0),
12341 REAL_CONST(65280.125081479666/8.0),
12342 REAL_CONST(65301.438430809241/8.0),
12343 REAL_CONST(65322.753519365178/8.0),
12344 REAL_CONST(65344.070346863708/8.0),
12345 REAL_CONST(65365.388913021146/8.0),
12346 REAL_CONST(65386.709217553958/8.0),
12347 REAL_CONST(65408.031260178701/8.0),
12348 REAL_CONST(65429.355040612056/8.0),
12349 REAL_CONST(65450.680558570821/8.0),
12350 REAL_CONST(65472.00781377191/8.0),
12351 REAL_CONST(65493.336805932355/8.0),
12352 REAL_CONST(65514.66753476928/8.0),
12353 REAL_CONST(65535.999999999956/8.0),
12354 REAL_CONST(65557.334201341757/8.0),
12355 REAL_CONST(65578.670138512171/8.0),
12356 REAL_CONST(65600.007811228788/8.0),
12357 REAL_CONST(65621.347219209332/8.0),
12358 REAL_CONST(65642.688362171626/8.0),
12359 REAL_CONST(65664.031239833639/8.0),
12360 REAL_CONST(65685.375851913413/8.0),
12361 REAL_CONST(65706.722198129137/8.0),
12362 REAL_CONST(65728.070278199084/8.0),
12363 REAL_CONST(65749.420091841661/8.0),
12364 REAL_CONST(65770.771638775404/8.0),
12365 REAL_CONST(65792.124918718939/8.0),
12366 REAL_CONST(65813.479931391004/8.0),
12367 REAL_CONST(65834.836676510458/8.0),
12368 REAL_CONST(65856.195153796303/8.0),
12369 REAL_CONST(65877.5553629676/8.0),
12370 REAL_CONST(65898.917303743554/8.0),
12371 REAL_CONST(65920.280975843489/8.0),
12372 REAL_CONST(65941.646378986843/8.0),
12373 REAL_CONST(65963.013512893158/8.0),
12374 REAL_CONST(65984.382377282076/8.0),
12375 REAL_CONST(66005.752971873386/8.0),
12376 REAL_CONST(66027.125296386963/8.0),
12377 REAL_CONST(66048.499350542799/8.0),
12378 REAL_CONST(66069.875134061018/8.0),
12379 REAL_CONST(66091.252646661844/8.0),
12380 REAL_CONST(66112.631888065618/8.0),
12381 REAL_CONST(66134.01285799277/8.0),
12382 REAL_CONST(66155.395556163887/8.0),
12383 REAL_CONST(66176.779982299631/8.0),
12384 REAL_CONST(66198.166136120795/8.0),
12385 REAL_CONST(66219.554017348273/8.0),
12386 REAL_CONST(66240.943625703105/8.0),
12387 REAL_CONST(66262.334960906388/8.0),
12388 REAL_CONST(66283.728022679396/8.0),
12389 REAL_CONST(66305.122810743444/8.0),
12390 REAL_CONST(66326.519324820023/8.0),
12391 REAL_CONST(66347.917564630698/8.0),
12392 REAL_CONST(66369.317529897162/8.0),
12393 REAL_CONST(66390.719220341227/8.0),
12394 REAL_CONST(66412.122635684791/8.0),
12395 REAL_CONST(66433.527775649884/8.0),
12396 REAL_CONST(66454.934639958636/8.0),
12397 REAL_CONST(66476.343228333324/8.0),
12398 REAL_CONST(66497.753540496284/8.0),
12399 REAL_CONST(66519.165576169995/8.0),
12400 REAL_CONST(66540.57933507704/8.0),
12401 REAL_CONST(66561.994816940118/8.0),
12402 REAL_CONST(66583.412021482043/8.0),
12403 REAL_CONST(66604.830948425733/8.0),
12404 REAL_CONST(66626.251597494222/8.0),
12405 REAL_CONST(66647.673968410629/8.0),
12406 REAL_CONST(66669.098060898235/8.0),
12407 REAL_CONST(66690.523874680381/8.0),
12408 REAL_CONST(66711.951409480564/8.0),
12409 REAL_CONST(66733.380665022371/8.0),
12410 REAL_CONST(66754.811641029475/8.0),
12411 REAL_CONST(66776.244337225711/8.0),
12412 REAL_CONST(66797.678753334985/8.0),
12413 REAL_CONST(66819.11488908132/8.0),
12414 REAL_CONST(66840.552744188884/8.0),
12415 REAL_CONST(66861.992318381905/8.0),
12416 REAL_CONST(66883.433611384738/8.0),
12417 REAL_CONST(66904.876622921889/8.0),
12418 REAL_CONST(66926.321352717903/8.0),
12419 REAL_CONST(66947.767800497502/8.0),
12420 REAL_CONST(66969.215965985466/8.0),
12421 REAL_CONST(66990.665848906734/8.0),
12422 REAL_CONST(67012.117448986304/8.0),
12423 REAL_CONST(67033.570765949335/8.0),
12424 REAL_CONST(67055.025799521056/8.0),
12425 REAL_CONST(67076.482549426815/8.0),
12426 REAL_CONST(67097.941015392076/8.0),
12427 REAL_CONST(67119.401197142433/8.0),
12428 REAL_CONST(67140.863094403554/8.0),
12429 REAL_CONST(67162.326706901222/8.0),
12430 REAL_CONST(67183.792034361351/8.0),
12431 REAL_CONST(67205.259076509959/8.0),
12432 REAL_CONST(67226.72783307315/8.0),
12433 REAL_CONST(67248.198303777172/8.0),
12434 REAL_CONST(67269.670488348347/8.0),
12435 REAL_CONST(67291.144386513144/8.0),
12436 REAL_CONST(67312.619997998088/8.0),
12437 REAL_CONST(67334.09732252988/8.0),
12438 REAL_CONST(67355.576359835293/8.0),
12439 REAL_CONST(67377.057109641188/8.0),
12440 REAL_CONST(67398.53957167457/8.0),
12441 REAL_CONST(67420.023745662547/8.0),
12442 REAL_CONST(67441.50963133233/8.0),
12443 REAL_CONST(67462.99722841123/8.0),
12444 REAL_CONST(67484.486536626689/8.0),
12445 REAL_CONST(67505.977555706224/8.0),
12446 REAL_CONST(67527.470285377494/8.0),
12447 REAL_CONST(67548.964725368263/8.0),
12448 REAL_CONST(67570.460875406367/8.0),
12449 REAL_CONST(67591.9587352198/8.0),
12450 REAL_CONST(67613.458304536631/8.0),
12451 REAL_CONST(67634.95958308503/8.0),
12452 REAL_CONST(67656.462570593329/8.0),
12453 REAL_CONST(67677.967266789899/8.0),
12454 REAL_CONST(67699.473671403248/8.0),
12455 REAL_CONST(67720.981784162024/8.0),
12456 REAL_CONST(67742.491604794923/8.0),
12457 REAL_CONST(67764.003133030797/8.0),
12458 REAL_CONST(67785.516368598575/8.0),
12459 REAL_CONST(67807.031311227314/8.0),
12460 REAL_CONST(67828.547960646174/8.0),
12461 REAL_CONST(67850.066316584402/8.0),
12462 REAL_CONST(67871.58637877139/8.0),
12463 REAL_CONST(67893.108146936589/8.0),
12464 REAL_CONST(67914.63162080961/8.0),
12465 REAL_CONST(67936.156800120138/8.0),
12466 REAL_CONST(67957.683684597971/8.0),
12467 REAL_CONST(67979.212273973011/8.0),
12468 REAL_CONST(68000.742567975263/8.0),
12469 REAL_CONST(68022.274566334876/8.0),
12470 REAL_CONST(68043.808268782057/8.0),
12471 REAL_CONST(68065.343675047145/8.0),
12472 REAL_CONST(68086.880784860579/8.0),
12473 REAL_CONST(68108.419597952918/8.0),
12474 REAL_CONST(68129.960114054789/8.0),
12475 REAL_CONST(68151.502332896969/8.0),
12476 REAL_CONST(68173.04625421032/8.0),
12477 REAL_CONST(68194.591877725834/8.0),
12478 REAL_CONST(68216.139203174564/8.0),
12479 REAL_CONST(68237.688230287706/8.0),
12480 REAL_CONST(68259.238958796544/8.0),
12481 REAL_CONST(68280.791388432481/8.0),
12482 REAL_CONST(68302.345518927032/8.0),
12483 REAL_CONST(68323.901350011787/8.0),
12484 REAL_CONST(68345.458881418483/8.0),
12485 REAL_CONST(68367.018112878912/8.0),
12486 REAL_CONST(68388.579044125028/8.0),
12487 REAL_CONST(68410.141674888844/8.0),
12488 REAL_CONST(68431.706004902502/8.0),
12489 REAL_CONST(68453.272033898262/8.0),
12490 REAL_CONST(68474.839761608455/8.0),
12491 REAL_CONST(68496.409187765545/8.0),
12492 REAL_CONST(68517.980312102081/8.0),
12493 REAL_CONST(68539.553134350732/8.0),
12494 REAL_CONST(68561.127654244279/8.0),
12495 REAL_CONST(68582.70387151558/8.0),
12496 REAL_CONST(68604.281785897634/8.0),
12497 REAL_CONST(68625.861397123503/8.0),
12498 REAL_CONST(68647.44270492639/8.0),
12499 REAL_CONST(68669.025709039604/8.0),
12500 REAL_CONST(68690.610409196524/8.0),
12501 REAL_CONST(68712.196805130661/8.0),
12502 REAL_CONST(68733.784896575627/8.0),
12503 REAL_CONST(68755.374683265123/8.0),
12504 REAL_CONST(68776.966164932994/8.0),
12505 REAL_CONST(68798.559341313128/8.0),
12506 REAL_CONST(68820.154212139591/8.0),
12507 REAL_CONST(68841.750777146473/8.0),
12508 REAL_CONST(68863.349036068044/8.0),
12509 REAL_CONST(68884.948988638629/8.0),
12510 REAL_CONST(68906.550634592684/8.0),
12511 REAL_CONST(68928.153973664739/8.0),
12512 REAL_CONST(68949.75900558944/8.0),
12513 REAL_CONST(68971.365730101577/8.0),
12514 REAL_CONST(68992.974146935987/8.0),
12515 REAL_CONST(69014.584255827634/8.0),
12516 REAL_CONST(69036.196056511588/8.0),
12517 REAL_CONST(69057.809548723017/8.0),
12518 REAL_CONST(69079.424732197207/8.0),
12519 REAL_CONST(69101.041606669532/8.0),
12520 REAL_CONST(69122.660171875468/8.0),
12521 REAL_CONST(69144.280427550606/8.0),
12522 REAL_CONST(69165.902373430625/8.0),
12523 REAL_CONST(69187.526009251334/8.0),
12524 REAL_CONST(69209.151334748618/8.0),
12525 REAL_CONST(69230.778349658474/8.0),
12526 REAL_CONST(69252.40705371699/8.0),
12527 REAL_CONST(69274.037446660412/8.0),
12528 REAL_CONST(69295.669528225/8.0),
12529 REAL_CONST(69317.303298147192/8.0),
12530 REAL_CONST(69338.938756163494/8.0),
12531 REAL_CONST(69360.575902010532/8.0),
12532 REAL_CONST(69382.214735425005/8.0),
12533 REAL_CONST(69403.855256143754/8.0),
12534 REAL_CONST(69425.497463903681/8.0),
12535 REAL_CONST(69447.141358441833/8.0),
12536 REAL_CONST(69468.78693949533/8.0),
12537 REAL_CONST(69490.434206801394/8.0),
12538 REAL_CONST(69512.083160097391/8.0),
12539 REAL_CONST(69533.733799120717/8.0),
12540 REAL_CONST(69555.386123608929/8.0),
12541 REAL_CONST(69577.04013329967/8.0),
12542 REAL_CONST(69598.695827930685/8.0),
12543 REAL_CONST(69620.353207239794/8.0),
12544 REAL_CONST(69642.012270964973/8.0),
12545 REAL_CONST(69663.67301884426/8.0),
12546 REAL_CONST(69685.335450615792/8.0),
12547 REAL_CONST(69706.999566017839/8.0),
12548 REAL_CONST(69728.665364788743/8.0),
12549 REAL_CONST(69750.332846666963/8.0),
12550 REAL_CONST(69772.002011391058/8.0),
12551 REAL_CONST(69793.672858699691/8.0),
12552 REAL_CONST(69815.345388331611/8.0),
12553 REAL_CONST(69837.019600025669/8.0),
12554 REAL_CONST(69858.695493520849/8.0),
12555 REAL_CONST(69880.373068556204/8.0),
12556 REAL_CONST(69902.052324870907/8.0),
12557 REAL_CONST(69923.733262204216/8.0),
12558 REAL_CONST(69945.415880295492/8.0),
12559 REAL_CONST(69967.100178884211/8.0),
12560 REAL_CONST(69988.786157709939/8.0),
12561 REAL_CONST(70010.473816512356/8.0),
12562 REAL_CONST(70032.163155031216/8.0),
12563 REAL_CONST(70053.854173006403/8.0),
12564 REAL_CONST(70075.546870177874/8.0),
12565 REAL_CONST(70097.241246285717/8.0),
12566 REAL_CONST(70118.937301070109/8.0),
12567 REAL_CONST(70140.635034271298/8.0),
12568 REAL_CONST(70162.334445629691/8.0),
12569 REAL_CONST(70184.035534885741/8.0),
12570 REAL_CONST(70205.738301780017/8.0),
12571 REAL_CONST(70227.442746053217/8.0),
12572 REAL_CONST(70249.1488674461/8.0),
12573 REAL_CONST(70270.856665699539/8.0),
12574 REAL_CONST(70292.566140554511/8.0),
12575 REAL_CONST(70314.277291752107/8.0),
12576 REAL_CONST(70335.990119033493/8.0),
12577 REAL_CONST(70357.704622139936/8.0),
12578 REAL_CONST(70379.420800812819/8.0),
12579 REAL_CONST(70401.138654793613/8.0),
12580 REAL_CONST(70422.85818382389/8.0),
12581 REAL_CONST(70444.579387645339/8.0),
12582 REAL_CONST(70466.302265999722/8.0),
12583 REAL_CONST(70488.026818628918/8.0),
12584 REAL_CONST(70509.753045274876/8.0),
12585 REAL_CONST(70531.480945679708/8.0),
12586 REAL_CONST(70553.210519585555/8.0),
12587 REAL_CONST(70574.941766734701/8.0),
12588 REAL_CONST(70596.674686869505/8.0),
12589 REAL_CONST(70618.409279732456/8.0),
12590 REAL_CONST(70640.145545066101/8.0),
12591 REAL_CONST(70661.883482613106/8.0),
12592 REAL_CONST(70683.623092116264/8.0),
12593 REAL_CONST(70705.364373318414/8.0),
12594 REAL_CONST(70727.107325962526/8.0),
12595 REAL_CONST(70748.851949791671/8.0),
12596 REAL_CONST(70770.598244549008/8.0),
12597 REAL_CONST(70792.346209977783/8.0),
12598 REAL_CONST(70814.095845821372/8.0),
12599 REAL_CONST(70835.847151823225/8.0),
12600 REAL_CONST(70857.600127726895/8.0),
12601 REAL_CONST(70879.354773276034/8.0),
12602 REAL_CONST(70901.111088214413/8.0),
12603 REAL_CONST(70922.869072285859/8.0),
12604 REAL_CONST(70944.628725234332/8.0),
12605 REAL_CONST(70966.390046803877/8.0),
12606 REAL_CONST(70988.153036738629/8.0),
12607 REAL_CONST(71009.917694782853/8.0),
12608 REAL_CONST(71031.684020680885/8.0),
12609 REAL_CONST(71053.45201417715/8.0),
12610 REAL_CONST(71075.221675016204/8.0),
12611 REAL_CONST(71096.993002942661/8.0),
12612 REAL_CONST(71118.765997701266/8.0),
12613 REAL_CONST(71140.540659036851/8.0),
12614 REAL_CONST(71162.316986694335/8.0),
12615 REAL_CONST(71184.09498041874/8.0),
12616 REAL_CONST(71205.874639955218/8.0),
12617 REAL_CONST(71227.655965048951/8.0),
12618 REAL_CONST(71249.438955445294/8.0),
12619 REAL_CONST(71271.223610889632/8.0),
12620 REAL_CONST(71293.009931127483/8.0),
12621 REAL_CONST(71314.797915904477/8.0),
12622 REAL_CONST(71336.587564966307/8.0),
12623 REAL_CONST(71358.378878058764/8.0),
12624 REAL_CONST(71380.171854927772/8.0),
12625 REAL_CONST(71401.966495319313/8.0),
12626 REAL_CONST(71423.762798979486/8.0),
12627 REAL_CONST(71445.560765654489/8.0),
12628 REAL_CONST(71467.360395090596/8.0),
12629 REAL_CONST(71489.161687034211/8.0),
12630 REAL_CONST(71510.964641231811/8.0),
12631 REAL_CONST(71532.769257429973/8.0),
12632 REAL_CONST(71554.575535375348/8.0),
12633 REAL_CONST(71576.383474814749/8.0),
12634 REAL_CONST(71598.19307549503/8.0),
12635 REAL_CONST(71620.004337163133/8.0),
12636 REAL_CONST(71641.817259566145/8.0),
12637 REAL_CONST(71663.631842451214/8.0),
12638 REAL_CONST(71685.4480855656/8.0),
12639 REAL_CONST(71707.26598865664/8.0),
12640 REAL_CONST(71729.085551471784/8.0),
12641 REAL_CONST(71750.906773758586/8.0),
12642 REAL_CONST(71772.729655264673/8.0),
12643 REAL_CONST(71794.554195737772/8.0),
12644 REAL_CONST(71816.380394925713/8.0),
12645 REAL_CONST(71838.208252576442/8.0),
12646 REAL_CONST(71860.037768437964/8.0),
12647 REAL_CONST(71881.868942258385/8.0),
12648 REAL_CONST(71903.701773785942/8.0),
12649 REAL_CONST(71925.536262768932/8.0),
12650 REAL_CONST(71947.372408955751/8.0),
12651 REAL_CONST(71969.210212094898/8.0),
12652 REAL_CONST(71991.049671934976/8.0),
12653 REAL_CONST(72012.890788224686/8.0),
12654 REAL_CONST(72034.73356071279/8.0),
12655 REAL_CONST(72056.577989148165/8.0),
12656 REAL_CONST(72078.424073279821/8.0),
12657 REAL_CONST(72100.271812856794/8.0),
12658 REAL_CONST(72122.121207628254/8.0),
12659 REAL_CONST(72143.97225734347/8.0),
12660 REAL_CONST(72165.824961751801/8.0),
12661 REAL_CONST(72187.679320602692/8.0),
12662 REAL_CONST(72209.53533364569/8.0),
12663 REAL_CONST(72231.393000630429/8.0),
12664 REAL_CONST(72253.252321306645/8.0),
12665 REAL_CONST(72275.113295424177/8.0),
12666 REAL_CONST(72296.975922732949/8.0),
12667 REAL_CONST(72318.840202982959/8.0),
12668 REAL_CONST(72340.706135924338/8.0),
12669 REAL_CONST(72362.573721307272/8.0),
12670 REAL_CONST(72384.442958882093/8.0),
12671 REAL_CONST(72406.313848399179/8.0),
12672 REAL_CONST(72428.186389609036/8.0),
12673 REAL_CONST(72450.060582262216/8.0),
12674 REAL_CONST(72471.936426109431/8.0),
12675 REAL_CONST(72493.813920901433/8.0),
12676 REAL_CONST(72515.693066389096/8.0),
12677 REAL_CONST(72537.573862323392/8.0),
12678 REAL_CONST(72559.456308455352/8.0),
12679 REAL_CONST(72581.340404536139/8.0),
12680 REAL_CONST(72603.226150316987/8.0),
12681 REAL_CONST(72625.113545549248/8.0),
12682 REAL_CONST(72647.002589984331/8.0),
12683 REAL_CONST(72668.893283373764/8.0),
12684 REAL_CONST(72690.785625469172/8.0),
12685 REAL_CONST(72712.679616022273/8.0),
12686 REAL_CONST(72734.575254784853/8.0),
12687 REAL_CONST(72756.472541508803/8.0),
12688 REAL_CONST(72778.371475946144/8.0),
12689 REAL_CONST(72800.272057848939/8.0),
12690 REAL_CONST(72822.174286969355/8.0),
12691 REAL_CONST(72844.07816305969/8.0),
12692 REAL_CONST(72865.983685872285/8.0),
12693 REAL_CONST(72887.890855159596/8.0),
12694 REAL_CONST(72909.799670674183/8.0),
12695 REAL_CONST(72931.710132168693/8.0),
12696 REAL_CONST(72953.622239395845/8.0),
12697 REAL_CONST(72975.535992108475/8.0),
12698 REAL_CONST(72997.451390059519/8.0),
12699 REAL_CONST(73019.368433001961/8.0),
12700 REAL_CONST(73041.287120688925/8.0),
12701 REAL_CONST(73063.207452873612/8.0),
12702 REAL_CONST(73085.129429309294/8.0),
12703 REAL_CONST(73107.053049749389/8.0),
12704 REAL_CONST(73128.978313947344/8.0),
12705 REAL_CONST(73150.905221656736/8.0),
12706 REAL_CONST(73172.833772631217/8.0),
12707 REAL_CONST(73194.763966624567/8.0),
12708 REAL_CONST(73216.695803390612/8.0),
12709 REAL_CONST(73238.62928268328/8.0),
12710 REAL_CONST(73260.564404256627/8.0),
12711 REAL_CONST(73282.501167864757/8.0),
12712 REAL_CONST(73304.439573261901/8.0),
12713 REAL_CONST(73326.379620202337/8.0),
12714 REAL_CONST(73348.321308440485/8.0),
12715 REAL_CONST(73370.264637730841/8.0),
12716 REAL_CONST(73392.209607827957/8.0),
12717 REAL_CONST(73414.156218486532/8.0),
12718 REAL_CONST(73436.104469461323/8.0),
12719 REAL_CONST(73458.054360507173/8.0),
12720 REAL_CONST(73480.005891379056/8.0),
12721 REAL_CONST(73501.959061831993/8.0),
12722 REAL_CONST(73523.913871621116/8.0),
12723 REAL_CONST(73545.870320501665/8.0),
12724 REAL_CONST(73567.828408228932/8.0),
12725 REAL_CONST(73589.78813455833/8.0),
12726 REAL_CONST(73611.749499245358/8.0),
12727 REAL_CONST(73633.712502045615/8.0),
12728 REAL_CONST(73655.677142714747/8.0),
12729 REAL_CONST(73677.643421008557/8.0),
12730 REAL_CONST(73699.611336682879/8.0),
12731 REAL_CONST(73721.580889493693/8.0),
12732 REAL_CONST(73743.552079197019/8.0),
12733 REAL_CONST(73765.524905548999/8.0),
12734 REAL_CONST(73787.499368305856/8.0),
12735 REAL_CONST(73809.475467223907/8.0),
12736 REAL_CONST(73831.453202059551/8.0),
12737 REAL_CONST(73853.432572569291/8.0),
12738 REAL_CONST(73875.413578509717/8.0),
12739 REAL_CONST(73897.396219637507/8.0),
12740 REAL_CONST(73919.380495709411/8.0),
12741 REAL_CONST(73941.36640648231/8.0),
12742 REAL_CONST(73963.353951713143/8.0),
12743 REAL_CONST(73985.343131158952/8.0),
12744 REAL_CONST(74007.333944576865/8.0),
12745 REAL_CONST(74029.326391724098/8.0),
12746 REAL_CONST(74051.320472357969/8.0),
12747 REAL_CONST(74073.316186235883/8.0),
12748 REAL_CONST(74095.313533115303/8.0),
12749 REAL_CONST(74117.312512753837/8.0),
12750 REAL_CONST(74139.313124909138/8.0),
12751 REAL_CONST(74161.315369338976/8.0),
12752 REAL_CONST(74183.319245801191/8.0),
12753 REAL_CONST(74205.324754053727/8.0),
12754 REAL_CONST(74227.331893854629/8.0),
12755 REAL_CONST(74249.340664961986/8.0),
12756 REAL_CONST(74271.351067134034/8.0),
12757 REAL_CONST(74293.363100129049/8.0),
12758 REAL_CONST(74315.376763705441/8.0),
12759 REAL_CONST(74337.392057621662/8.0),
12760 REAL_CONST(74359.408981636298/8.0),
12761 REAL_CONST(74381.427535508003/8.0),
12762 REAL_CONST(74403.447718995507/8.0),
12763 REAL_CONST(74425.469531857671/8.0),
12764 REAL_CONST(74447.492973853383/8.0),
12765 REAL_CONST(74469.518044741693/8.0),
12766 REAL_CONST(74491.54474428168/8.0),
12767 REAL_CONST(74513.573072232539/8.0),
12768 REAL_CONST(74535.603028353551/8.0),
12769 REAL_CONST(74557.634612404087/8.0),
12770 REAL_CONST(74579.667824143602/8.0),
12771 REAL_CONST(74601.702663331642/8.0),
12772 REAL_CONST(74623.739129727837/8.0),
12773 REAL_CONST(74645.777223091936/8.0),
12774 REAL_CONST(74667.816943183716/8.0),
12775 REAL_CONST(74689.858289763113/8.0),
12776 REAL_CONST(74711.901262590094/8.0),
12777 REAL_CONST(74733.945861424741/8.0),
12778 REAL_CONST(74755.992086027225/8.0),
12779 REAL_CONST(74778.039936157802/8.0),
12780 REAL_CONST(74800.089411576817/8.0),
12781 REAL_CONST(74822.140512044702/8.0),
12782 REAL_CONST(74844.193237321961/8.0),
12783 REAL_CONST(74866.24758716923/8.0),
12784 REAL_CONST(74888.303561347187/8.0),
12785 REAL_CONST(74910.36115961663/8.0),
12786 REAL_CONST(74932.420381738411/8.0),
12787 REAL_CONST(74954.481227473516/8.0),
12788 REAL_CONST(74976.543696582972/8.0),
12789 REAL_CONST(74998.607788827925/8.0),
12790 REAL_CONST(75020.673503969607/8.0),
12791 REAL_CONST(75042.740841769322/8.0),
12792 REAL_CONST(75064.809801988464/8.0),
12793 REAL_CONST(75086.88038438854/8.0),
12794 REAL_CONST(75108.952588731103/8.0),
12795 REAL_CONST(75131.026414777836/8.0),
12796 REAL_CONST(75153.101862290467/8.0),
12797 REAL_CONST(75175.178931030852/8.0),
12798 REAL_CONST(75197.257620760924/8.0),
12799 REAL_CONST(75219.33793124267/8.0),
12800 REAL_CONST(75241.419862238225/8.0),
12801 REAL_CONST(75263.503413509738/8.0),
12802 REAL_CONST(75285.588584819503/8.0),
12803 REAL_CONST(75307.675375929874/8.0),
12804 REAL_CONST(75329.763786603318/8.0),
12805 REAL_CONST(75351.853816602365/8.0),
12806 REAL_CONST(75373.945465689612/8.0),
12807 REAL_CONST(75396.038733627807/8.0),
12808 REAL_CONST(75418.133620179724/8.0),
12809 REAL_CONST(75440.230125108254/8.0),
12810 REAL_CONST(75462.32824817636/8.0),
12811 REAL_CONST(75484.427989147109/8.0),
12812 REAL_CONST(75506.529347783653/8.0),
12813 REAL_CONST(75528.63232384919/8.0),
12814 REAL_CONST(75550.736917107075/8.0),
12815 REAL_CONST(75572.843127320695/8.0),
12816 REAL_CONST(75594.950954253538/8.0),
12817 REAL_CONST(75617.060397669193/8.0),
12818 REAL_CONST(75639.171457331307/8.0),
12819 REAL_CONST(75661.284133003646/8.0),
12820 REAL_CONST(75683.398424450032/8.0),
12821 REAL_CONST(75705.514331434402/8.0),
12822 REAL_CONST(75727.631853720741/8.0),
12823 REAL_CONST(75749.750991073175/8.0),
12824 REAL_CONST(75771.871743255862/8.0),
12825 REAL_CONST(75793.994110033076/8.0),
12826 REAL_CONST(75816.118091169177/8.0),
12827 REAL_CONST(75838.243686428585/8.0),
12828 REAL_CONST(75860.370895575848/8.0),
12829 REAL_CONST(75882.499718375562/8.0),
12830 REAL_CONST(75904.630154592422/8.0),
12831 REAL_CONST(75926.762203991224/8.0),
12832 REAL_CONST(75948.895866336825/8.0),
12833 REAL_CONST(75971.031141394182/8.0),
12834 REAL_CONST(75993.168028928325/8.0),
12835 REAL_CONST(76015.306528704401/8.0),
12836 REAL_CONST(76037.4466404876/8.0),
12837 REAL_CONST(76059.588364043215/8.0),
12838 REAL_CONST(76081.731699136653/8.0),
12839 REAL_CONST(76103.876645533353/8.0),
12840 REAL_CONST(76126.023202998884/8.0),
12841 REAL_CONST(76148.171371298871/8.0),
12842 REAL_CONST(76170.321150199044/8.0),
12843 REAL_CONST(76192.472539465205/8.0),
12844 REAL_CONST(76214.625538863256/8.0),
12845 REAL_CONST(76236.780148159174/8.0),
12846 REAL_CONST(76258.936367119008/8.0),
12847 REAL_CONST(76281.094195508922/8.0),
12848 REAL_CONST(76303.253633095141/8.0),
12849 REAL_CONST(76325.414679643975/8.0),
12850 REAL_CONST(76347.577334921851/8.0),
12851 REAL_CONST(76369.741598695226/8.0),
12852 REAL_CONST(76391.907470730686/8.0),
12853 REAL_CONST(76414.074950794879/8.0),
12854 REAL_CONST(76436.244038654564/8.0),
12855 REAL_CONST(76458.414734076548/8.0),
12856 REAL_CONST(76480.587036827754/8.0),
12857 REAL_CONST(76502.760946675175/8.0),
12858 REAL_CONST(76524.936463385893/8.0),
12859 REAL_CONST(76547.11358672705/8.0),
12860 REAL_CONST(76569.292316465915/8.0),
12861 REAL_CONST(76591.472652369819/8.0),
12862 REAL_CONST(76613.654594206164/8.0),
12863 REAL_CONST(76635.838141742468/8.0),
12864 REAL_CONST(76658.023294746308/8.0),
12865 REAL_CONST(76680.210052985349/8.0),
12866 REAL_CONST(76702.398416227341/8.0),
12867 REAL_CONST(76724.588384240138/8.0),
12868 REAL_CONST(76746.779956791637/8.0),
12869 REAL_CONST(76768.973133649866/8.0),
12870 REAL_CONST(76791.167914582897/8.0),
12871 REAL_CONST(76813.364299358902/8.0),
12872 REAL_CONST(76835.562287746157/8.0),
12873 REAL_CONST(76857.761879512967/8.0),
12874 REAL_CONST(76879.963074427797/8.0),
12875 REAL_CONST(76902.165872259109/8.0),
12876 REAL_CONST(76924.37027277553/8.0),
12877 REAL_CONST(76946.576275745727/8.0),
12878 REAL_CONST(76968.783880938441/8.0),
12879 REAL_CONST(76990.993088122515/8.0),
12880 REAL_CONST(77013.203897066895/8.0),
12881 REAL_CONST(77035.416307540567/8.0),
12882 REAL_CONST(77057.630319312622/8.0),
12883 REAL_CONST(77079.845932152239/8.0),
12884 REAL_CONST(77102.063145828695/8.0),
12885 REAL_CONST(77124.281960111301/8.0),
12886 REAL_CONST(77146.50237476948/8.0),
12887 REAL_CONST(77168.724389572759/8.0),
12888 REAL_CONST(77190.948004290723/8.0),
12889 REAL_CONST(77213.173218693031/8.0),
12890 REAL_CONST(77235.400032549442/8.0),
12891 REAL_CONST(77257.628445629802/8.0),
12892 REAL_CONST(77279.858457704031/8.0),
12893 REAL_CONST(77302.090068542122/8.0),
12894 REAL_CONST(77324.323277914169/8.0),
12895 REAL_CONST(77346.558085590339/8.0),
12896 REAL_CONST(77368.794491340886/8.0),
12897 REAL_CONST(77391.032494936138/8.0),
12898 REAL_CONST(77413.272096146524/8.0),
12899 REAL_CONST(77435.51329474253/8.0),
12900 REAL_CONST(77457.756090494731/8.0),
12901 REAL_CONST(77480.000483173804/8.0),
12902 REAL_CONST(77502.246472550498/8.0),
12903 REAL_CONST(77524.494058395634/8.0),
12904 REAL_CONST(77546.743240480107/8.0),
12905 REAL_CONST(77568.994018574944/8.0),
12906 REAL_CONST(77591.246392451198/8.0),
12907 REAL_CONST(77613.500361880026/8.0),
12908 REAL_CONST(77635.755926632657/8.0),
12909 REAL_CONST(77658.013086480438/8.0),
12910 REAL_CONST(77680.271841194757/8.0),
12911 REAL_CONST(77702.532190547092/8.0),
12912 REAL_CONST(77724.794134309021/8.0),
12913 REAL_CONST(77747.057672252195/8.0),
12914 REAL_CONST(77769.322804148323/8.0),
12915 REAL_CONST(77791.589529769248/8.0),
12916 REAL_CONST(77813.857848886837/8.0),
12917 REAL_CONST(77836.127761273063/8.0),
12918 REAL_CONST(77858.399266699998/8.0),
12919 REAL_CONST(77880.67236493979/8.0),
12920 REAL_CONST(77902.947055764627/8.0),
12921 REAL_CONST(77925.223338946831/8.0),
12922 REAL_CONST(77947.50121425878/8.0),
12923 REAL_CONST(77969.780681472927/8.0),
12924 REAL_CONST(77992.061740361838/8.0),
12925 REAL_CONST(78014.344390698127/8.0),
12926 REAL_CONST(78036.628632254491/8.0),
12927 REAL_CONST(78058.914464803747/8.0),
12928 REAL_CONST(78081.201888118725/8.0),
12929 REAL_CONST(78103.490901972415/8.0),
12930 REAL_CONST(78125.781506137821/8.0),
12931 REAL_CONST(78148.073700388064/8.0),
12932 REAL_CONST(78170.367484496339/8.0),
12933 REAL_CONST(78192.662858235926/8.0),
12934 REAL_CONST(78214.959821380166/8.0),
12935 REAL_CONST(78237.258373702498/8.0),
12936 REAL_CONST(78259.558514976452/8.0),
12937 REAL_CONST(78281.860244975614/8.0),
12938 REAL_CONST(78304.163563473659/8.0),
12939 REAL_CONST(78326.468470244363/8.0),
12940 REAL_CONST(78348.77496506153/8.0),
12941 REAL_CONST(78371.083047699125/8.0),
12942 REAL_CONST(78393.392717931114/8.0),
12943 REAL_CONST(78415.703975531578/8.0),
12944 REAL_CONST(78438.016820274701/8.0),
12945 REAL_CONST(78460.331251934695/8.0),
12946 REAL_CONST(78482.647270285903/8.0),
12947 REAL_CONST(78504.964875102727/8.0),
12948 REAL_CONST(78527.284066159627/8.0),
12949 REAL_CONST(78549.604843231195/8.0),
12950 REAL_CONST(78571.927206092048/8.0),
12951 REAL_CONST(78594.251154516911/8.0),
12952 REAL_CONST(78616.576688280606/8.0),
12953 REAL_CONST(78638.903807157985/8.0),
12954 REAL_CONST(78661.232510924034/8.0),
12955 REAL_CONST(78683.562799353778/8.0),
12956 REAL_CONST(78705.894672222363/8.0),
12957 REAL_CONST(78728.228129304945/8.0),
12958 REAL_CONST(78750.563170376859/8.0),
12959 REAL_CONST(78772.899795213423/8.0),
12960 REAL_CONST(78795.238003590101/8.0),
12961 REAL_CONST(78817.577795282399/8.0),
12962 REAL_CONST(78839.919170065928/8.0),
12963 REAL_CONST(78862.262127716356/8.0),
12964 REAL_CONST(78884.606668009452/8.0),
12965 REAL_CONST(78906.952790721043/8.0),
12966 REAL_CONST(78929.300495627045/8.0),
12967 REAL_CONST(78951.64978250346/8.0),
12968 REAL_CONST(78974.000651126378/8.0),
12969 REAL_CONST(78996.353101271932/8.0),
12970 REAL_CONST(79018.707132716358/8.0),
12971 REAL_CONST(79041.062745235977/8.0),
12972 REAL_CONST(79063.41993860717/8.0),
12973 REAL_CONST(79085.778712606436/8.0),
12974 REAL_CONST(79108.139067010285/8.0),
12975 REAL_CONST(79130.501001595389/8.0),
12976 REAL_CONST(79152.864516138419/8.0),
12977 REAL_CONST(79175.22961041618/8.0),
12978 REAL_CONST(79197.596284205531/8.0),
12979 REAL_CONST(79219.96453728342/8.0),
12980 REAL_CONST(79242.33436942687/8.0),
12981 REAL_CONST(79264.705780412987/8.0),
12982 REAL_CONST(79287.078770018954/8.0),
12983 REAL_CONST(79309.453338022009/8.0),
12984 REAL_CONST(79331.829484199508/8.0),
12985 REAL_CONST(79354.207208328866/8.0),
12986 REAL_CONST(79376.586510187582/8.0),
12987 REAL_CONST(79398.967389553218/8.0),
12988 REAL_CONST(79421.349846203433/8.0),
12989 REAL_CONST(79443.733879915948/8.0),
12990 REAL_CONST(79466.119490468584/8.0),
12991 REAL_CONST(79488.50667763922/8.0),
12992 REAL_CONST(79510.895441205823/8.0),
12993 REAL_CONST(79533.285780946433/8.0),
12994 REAL_CONST(79555.677696639163/8.0),
12995 REAL_CONST(79578.071188062226/8.0),
12996 REAL_CONST(79600.466254993895/8.0),
12997 REAL_CONST(79622.862897212515/8.0),
12998 REAL_CONST(79645.261114496549/8.0),
12999 REAL_CONST(79667.660906624471/8.0),
13000 REAL_CONST(79690.062273374875/8.0),
13001 REAL_CONST(79712.465214526455/8.0),
13002 REAL_CONST(79734.869729857935/8.0),
13003 REAL_CONST(79757.275819148126/8.0),
13004 REAL_CONST(79779.683482175955/8.0),
13005 REAL_CONST(79802.092718720378/8.0),
13006 REAL_CONST(79824.503528560454/8.0),
13007 REAL_CONST(79846.915911475327/8.0),
13008 REAL_CONST(79869.329867244203/8.0),
13009 REAL_CONST(79891.745395646343/8.0),
13010 REAL_CONST(79914.162496461155/8.0),
13011 REAL_CONST(79936.581169468045/8.0),
13012 REAL_CONST(79959.001414446553/8.0),
13013 REAL_CONST(79981.423231176261/8.0),
13014 REAL_CONST(80003.846619436852/8.0),
13015 REAL_CONST(80026.271579008084/8.0),
13016 REAL_CONST(80048.698109669771/8.0),
13017 REAL_CONST(80071.12621120183/8.0),
13018 REAL_CONST(80093.555883384237/8.0),
13019 REAL_CONST(80115.987125997053/8.0),
13020 REAL_CONST(80138.419938820414/8.0),
13021 REAL_CONST(80160.854321634528/8.0),
13022 REAL_CONST(80183.290274219689/8.0),
13023 REAL_CONST(80205.727796356281/8.0),
13024 REAL_CONST(80228.166887824715/8.0),
13025 REAL_CONST(80250.607548405547/8.0),
13026 REAL_CONST(80273.049777879336/8.0),
13027 REAL_CONST(80295.493576026798/8.0),
13028 REAL_CONST(80317.938942628651/8.0),
13029 REAL_CONST(80340.385877465727/8.0),
13030 REAL_CONST(80362.834380318949/8.0),
13031 REAL_CONST(80385.28445096928/8.0),
13032 REAL_CONST(80407.736089197788/8.0),
13033 REAL_CONST(80430.189294785596/8.0),
13034 REAL_CONST(80452.644067513917/8.0),
13035 REAL_CONST(80475.100407164035/8.0),
13036 REAL_CONST(80497.558313517322/8.0),
13037 REAL_CONST(80520.017786355209/8.0),
13038 REAL_CONST(80542.478825459213/8.0),
13039 REAL_CONST(80564.941430610925/8.0),
13040 REAL_CONST(80587.405601592007/8.0),
13041 REAL_CONST(80609.871338184195/8.0),
13042 REAL_CONST(80632.338640169342/8.0),
13043 REAL_CONST(80654.8075073293/8.0),
13044 REAL_CONST(80677.277939446067/8.0),
13045 REAL_CONST(80699.749936301683/8.0),
13046 REAL_CONST(80722.223497678278/8.0),
13047 REAL_CONST(80744.698623358039/8.0),
13048 REAL_CONST(80767.17531312324/8.0),
13049 REAL_CONST(80789.653566756242/8.0),
13050 REAL_CONST(80812.133384039465/8.0),
13051 REAL_CONST(80834.614764755403/8.0),
13052 REAL_CONST(80857.097708686648/8.0),
13053 REAL_CONST(80879.582215615854/8.0),
13054 REAL_CONST(80902.068285325731/8.0),
13055 REAL_CONST(80924.555917599093/8.0),
13056 REAL_CONST(80947.045112218824/8.0),
13057 REAL_CONST(80969.535868967869/8.0),
13058 REAL_CONST(80992.028187629272/8.0),
13059 REAL_CONST(81014.522067986123/8.0),
13060 REAL_CONST(81037.017509821613/8.0),
13061 REAL_CONST(81059.514512919006/8.0),
13062 REAL_CONST(81082.013077061609/8.0),
13063 REAL_CONST(81104.513202032831/8.0),
13064 REAL_CONST(81127.014887616184/8.0),
13065 REAL_CONST(81149.518133595193/8.0),
13066 REAL_CONST(81172.022939753486/8.0),
13067 REAL_CONST(81194.529305874807/8.0),
13068 REAL_CONST(81217.037231742899/8.0),
13069 REAL_CONST(81239.546717141639/8.0),
13070 REAL_CONST(81262.057761854958/8.0),
13071 REAL_CONST(81284.570365666848/8.0),
13072 REAL_CONST(81307.084528361403/8.0),
13073 REAL_CONST(81329.600249722775/8.0),
13074 REAL_CONST(81352.117529535186/8.0),
13075 REAL_CONST(81374.636367582949/8.0),
13076 REAL_CONST(81397.156763650448/8.0),
13077 REAL_CONST(81419.678717522125/8.0),
13078 REAL_CONST(81442.202228982511/8.0),
13079 REAL_CONST(81464.727297816222/8.0),
13080 REAL_CONST(81487.253923807933/8.0),
13081 REAL_CONST(81509.782106742379/8.0),
13082 REAL_CONST(81532.311846404409/8.0),
13083 REAL_CONST(81554.843142578902/8.0),
13084 REAL_CONST(81577.375995050839/8.0),
13085 REAL_CONST(81599.910403605274/8.0),
13086 REAL_CONST(81622.446368027333/8.0),
13087 REAL_CONST(81644.983888102215/8.0),
13088 REAL_CONST(81667.522963615178/8.0),
13089 REAL_CONST(81690.063594351581/8.0),
13090 REAL_CONST(81712.605780096841/8.0),
13091 REAL_CONST(81735.149520636449/8.0),
13092 REAL_CONST(81757.694815755967/8.0),
13093 REAL_CONST(81780.241665241047/8.0),
13094 REAL_CONST(81802.79006887741/8.0),
13095 REAL_CONST(81825.340026450824/8.0),
13096 REAL_CONST(81847.891537747171/8.0),
13097 REAL_CONST(81870.444602552379/8.0),
13098 REAL_CONST(81892.999220652477/8.0),
13099 REAL_CONST(81915.555391833506/8.0),
13100 REAL_CONST(81938.113115881672/8.0),
13101 REAL_CONST(81960.672392583176/8.0),
13102 REAL_CONST(81983.233221724338/8.0),
13103 REAL_CONST(82005.795603091537/8.0),
13104 REAL_CONST(82028.359536471224/8.0),
13105 REAL_CONST(82050.925021649906/8.0),
13106 REAL_CONST(82073.492058414209/8.0),
13107 REAL_CONST(82096.060646550788/8.0),
13108 REAL_CONST(82118.630785846399/8.0),
13109 REAL_CONST(82141.202476087841/8.0),
13110 REAL_CONST(82163.775717062032/8.0),
13111 REAL_CONST(82186.35050855593/8.0),
13112 REAL_CONST(82208.926850356569/8.0),
13113 REAL_CONST(82231.504742251054/8.0),
13114 REAL_CONST(82254.084184026578/8.0),
13115 REAL_CONST(82276.665175470393/8.0),
13116 REAL_CONST(82299.24771636985/8.0),
13117 REAL_CONST(82321.831806512317/8.0),
13118 REAL_CONST(82344.417445685307/8.0),
13119 REAL_CONST(82367.004633676348/8.0),
13120 REAL_CONST(82389.593370273054/8.0),
13121 REAL_CONST(82412.183655263143/8.0),
13122 REAL_CONST(82434.775488434374/8.0),
13123 REAL_CONST(82457.368869574595/8.0),
13124 REAL_CONST(82479.963798471697/8.0),
13125 REAL_CONST(82502.560274913689/8.0),
13126 REAL_CONST(82525.158298688606/8.0),
13127 REAL_CONST(82547.757869584602/8.0),
13128 REAL_CONST(82570.35898738986/8.0),
13129 REAL_CONST(82592.961651892678/8.0),
13130 REAL_CONST(82615.565862881398/8.0),
13131 REAL_CONST(82638.171620144421/8.0),
13132 REAL_CONST(82660.778923470265/8.0),
13133 REAL_CONST(82683.387772647475/8.0),
13134 REAL_CONST(82705.998167464713/8.0),
13135 REAL_CONST(82728.610107710658/8.0),
13136 REAL_CONST(82751.223593174116/8.0),
13137 REAL_CONST(82773.83862364394/8.0),
13138 REAL_CONST(82796.45519890904/8.0),
13139 REAL_CONST(82819.073318758441/8.0),
13140 REAL_CONST(82841.692982981185/8.0),
13141 REAL_CONST(82864.314191366429/8.0),
13142 REAL_CONST(82886.936943703375/8.0),
13143 REAL_CONST(82909.561239781324/8.0),
13144 REAL_CONST(82932.187079389638/8.0),
13145 REAL_CONST(82954.814462317736/8.0),
13146 REAL_CONST(82977.443388355125/8.0),
13147 REAL_CONST(83000.073857291369/8.0),
13148 REAL_CONST(83022.70586891612/8.0),
13149 REAL_CONST(83045.339423019104/8.0),
13150 REAL_CONST(83067.974519390089/8.0),
13151 REAL_CONST(83090.611157818959/8.0),
13152 REAL_CONST(83113.249338095629/8.0),
13153 REAL_CONST(83135.8890600101/8.0),
13154 REAL_CONST(83158.530323352461/8.0),
13155 REAL_CONST(83181.173127912858/8.0),
13156 REAL_CONST(83203.817473481497/8.0),
13157 REAL_CONST(83226.463359848669/8.0),
13158 REAL_CONST(83249.11078680474/8.0),
13159 REAL_CONST(83271.759754140134/8.0),
13160 REAL_CONST(83294.410261645375/8.0),
13161 REAL_CONST(83317.062309111003/8.0),
13162 REAL_CONST(83339.715896327703/8.0),
13163 REAL_CONST(83362.371023086147/8.0),
13164 REAL_CONST(83385.027689177165/8.0),
13165 REAL_CONST(83407.685894391587/8.0),
13166 REAL_CONST(83430.345638520361/8.0),
13167 REAL_CONST(83453.006921354478/8.0),
13168 REAL_CONST(83475.669742685001/8.0),
13169 REAL_CONST(83498.334102303095/8.0),
13170 REAL_CONST(83520.999999999942/8.0),
13171 REAL_CONST(83543.667435566866/8.0),
13172 REAL_CONST(83566.336408795192/8.0),
13173 REAL_CONST(83589.006919476349/8.0),
13174 REAL_CONST(83611.678967401851/8.0),
13175 REAL_CONST(83634.352552363242/8.0),
13176 REAL_CONST(83657.027674152167/8.0),
13177 REAL_CONST(83679.704332560359/8.0),
13178 REAL_CONST(83702.382527379552/8.0),
13179 REAL_CONST(83725.062258401638/8.0),
13180 REAL_CONST(83747.743525418511/8.0),
13181 REAL_CONST(83770.42632822218/8.0),
13182 REAL_CONST(83793.110666604684/8.0),
13183 REAL_CONST(83815.796540358162/8.0),
13184 REAL_CONST(83838.483949274829/8.0),
13185 REAL_CONST(83861.172893146941/8.0),
13186 REAL_CONST(83883.863371766842/8.0),
13187 REAL_CONST(83906.555384926964/8.0),
13188 REAL_CONST(83929.248932419752/8.0),
13189 REAL_CONST(83951.944014037799/8.0),
13190 REAL_CONST(83974.640629573696/8.0),
13191 REAL_CONST(83997.338778820151/8.0),
13192 REAL_CONST(84020.038461569929/8.0),
13193 REAL_CONST(84042.739677615857/8.0),
13194 REAL_CONST(84065.442426750829/8.0),
13195 REAL_CONST(84088.146708767847/8.0),
13196 REAL_CONST(84110.852523459922/8.0),
13197 REAL_CONST(84133.559870620171/8.0),
13198 REAL_CONST(84156.268750041796/8.0),
13199 REAL_CONST(84178.979161518029/8.0),
13200 REAL_CONST(84201.691104842204/8.0),
13201 REAL_CONST(84224.404579807713/8.0),
13202 REAL_CONST(84247.119586208006/8.0),
13203 REAL_CONST(84269.83612383662/8.0),
13204 REAL_CONST(84292.55419248715/8.0),
13205 REAL_CONST(84315.273791953281/8.0),
13206 REAL_CONST(84337.994922028738/8.0),
13207 REAL_CONST(84360.717582507335/8.0),
13208 REAL_CONST(84383.441773182945/8.0),
13209 REAL_CONST(84406.167493849513/8.0),
13210 REAL_CONST(84428.894744301069/8.0),
13211 REAL_CONST(84451.623524331691/8.0),
13212 REAL_CONST(84474.353833735542/8.0),
13213 REAL_CONST(84497.085672306828/8.0),
13214 REAL_CONST(84519.819039839858/8.0),
13215 REAL_CONST(84542.553936128999/8.0),
13216 REAL_CONST(84565.290360968676/8.0),
13217 REAL_CONST(84588.028314153402/8.0),
13218 REAL_CONST(84610.767795477717/8.0),
13219 REAL_CONST(84633.508804736295/8.0),
13220 REAL_CONST(84656.251341723822/8.0),
13221 REAL_CONST(84678.995406235073/8.0),
13222 REAL_CONST(84701.740998064924/8.0),
13223 REAL_CONST(84724.488117008252/8.0),
13224 REAL_CONST(84747.236762860062/8.0),
13225 REAL_CONST(84769.986935415407/8.0),
13226 REAL_CONST(84792.73863446941/8.0),
13227 REAL_CONST(84815.491859817252/8.0),
13228 REAL_CONST(84838.246611254188/8.0),
13229 REAL_CONST(84861.002888575575/8.0),
13230 REAL_CONST(84883.760691576768/8.0),
13231 REAL_CONST(84906.520020053256/8.0),
13232 REAL_CONST(84929.28087380057/8.0),
13233 REAL_CONST(84952.043252614312/8.0),
13234 REAL_CONST(84974.807156290146/8.0),
13235 REAL_CONST(84997.572584623806/8.0),
13236 REAL_CONST(85020.339537411113/8.0),
13237 REAL_CONST(85043.108014447949/8.0),
13238 REAL_CONST(85065.878015530237/8.0),
13239 REAL_CONST(85088.649540453989/8.0),
13240 REAL_CONST(85111.422589015303/8.0),
13241 REAL_CONST(85134.197161010321/8.0),
13242 REAL_CONST(85156.973256235244/8.0),
13243 REAL_CONST(85179.750874486374/8.0),
13244 REAL_CONST(85202.530015560071/8.0),
13245 REAL_CONST(85225.310679252725/8.0),
13246 REAL_CONST(85248.092865360857/8.0),
13247 REAL_CONST(85270.876573681016/8.0),
13248 REAL_CONST(85293.661804009811/8.0),
13249 REAL_CONST(85316.448556143951/8.0),
13250 REAL_CONST(85339.236829880188/8.0),
13251 REAL_CONST(85362.026625015351/8.0),
13252 REAL_CONST(85384.817941346351/8.0),
13253 REAL_CONST(85407.610778670132/8.0),
13254 REAL_CONST(85430.405136783724/8.0),
13255 REAL_CONST(85453.201015484257/8.0),
13256 REAL_CONST(85475.998414568865/8.0),
13257 REAL_CONST(85498.797333834795/8.0),
13258 REAL_CONST(85521.597773079353/8.0),
13259 REAL_CONST(85544.399732099904/8.0),
13260 REAL_CONST(85567.203210693886/8.0),
13261 REAL_CONST(85590.008208658808/8.0),
13262 REAL_CONST(85612.814725792239/8.0),
13263 REAL_CONST(85635.62276189182/8.0),
13264 REAL_CONST(85658.432316755265/8.0),
13265 REAL_CONST(85681.243390180331/8.0),
13266 REAL_CONST(85704.055981964877/8.0),
13267 REAL_CONST(85726.870091906807/8.0),
13268 REAL_CONST(85749.685719804082/8.0),
13269 REAL_CONST(85772.502865454764/8.0),
13270 REAL_CONST(85795.321528656961/8.0),
13271 REAL_CONST(85818.141709208852/8.0),
13272 REAL_CONST(85840.963406908675/8.0),
13273 REAL_CONST(85863.78662155474/8.0),
13274 REAL_CONST(85886.611352945445/8.0),
13275 REAL_CONST(85909.437600879217/8.0),
13276 REAL_CONST(85932.26536515457/8.0),
13277 REAL_CONST(85955.094645570091/8.0),
13278 REAL_CONST(85977.92544192441/8.0),
13279 REAL_CONST(86000.757754016275/8.0),
13280 REAL_CONST(86023.591581644432/8.0),
13281 REAL_CONST(86046.426924607746/8.0),
13282 REAL_CONST(86069.263782705122/8.0),
13283 REAL_CONST(86092.102155735556/8.0),
13284 REAL_CONST(86114.942043498071/8.0),
13285 REAL_CONST(86137.783445791807/8.0),
13286 REAL_CONST(86160.626362415918/8.0),
13287 REAL_CONST(86183.470793169676/8.0),
13288 REAL_CONST(86206.316737852379/8.0),
13289 REAL_CONST(86229.164196263402/8.0),
13290 REAL_CONST(86252.013168202204/8.0),
13291 REAL_CONST(86274.863653468303/8.0),
13292 REAL_CONST(86297.715651861261/8.0),
13293 REAL_CONST(86320.569163180728/8.0),
13294 REAL_CONST(86343.424187226425/8.0),
13295 REAL_CONST(86366.280723798132/8.0),
13296 REAL_CONST(86389.138772695675/8.0),
13297 REAL_CONST(86411.998333718977/8.0),
13298 REAL_CONST(86434.859406668009/8.0),
13299 REAL_CONST(86457.721991342827/8.0),
13300 REAL_CONST(86480.586087543532/8.0),
13301 REAL_CONST(86503.451695070296/8.0),
13302 REAL_CONST(86526.318813723352/8.0),
13303 REAL_CONST(86549.187443303032/8.0),
13304 REAL_CONST(86572.057583609683/8.0),
13305 REAL_CONST(86594.929234443756/8.0),
13306 REAL_CONST(86617.802395605773/8.0),
13307 REAL_CONST(86640.677066896271/8.0),
13308 REAL_CONST(86663.553248115903/8.0),
13309 REAL_CONST(86686.43093906538/8.0),
13310 REAL_CONST(86709.310139545443/8.0),
13311 REAL_CONST(86732.190849356964/8.0),
13312 REAL_CONST(86755.073068300815/8.0),
13313 REAL_CONST(86777.956796177954/8.0),
13314 REAL_CONST(86800.842032789442/8.0),
13315 REAL_CONST(86823.728777936354/8.0),
13316 REAL_CONST(86846.617031419853/8.0),
13317 REAL_CONST(86869.506793041175/8.0),
13318 REAL_CONST(86892.398062601613/8.0),
13319 REAL_CONST(86915.290839902518/8.0),
13320 REAL_CONST(86938.185124745316/8.0),
13321 REAL_CONST(86961.080916931489/8.0),
13322 REAL_CONST(86983.978216262592/8.0),
13323 REAL_CONST(87006.87702254027/8.0),
13324 REAL_CONST(87029.777335566177/8.0),
13325 REAL_CONST(87052.67915514209/8.0),
13326 REAL_CONST(87075.582481069796/8.0),
13327 REAL_CONST(87098.487313151185/8.0),
13328 REAL_CONST(87121.39365118822/8.0),
13329 REAL_CONST(87144.301494982894/8.0),
13330 REAL_CONST(87167.210844337285/8.0),
13331 REAL_CONST(87190.121699053532/8.0),
13332 REAL_CONST(87213.034058933845/8.0),
13333 REAL_CONST(87235.947923780506/8.0),
13334 REAL_CONST(87258.863293395829/8.0),
13335 REAL_CONST(87281.780167582241/8.0),
13336 REAL_CONST(87304.698546142172/8.0),
13337 REAL_CONST(87327.618428878181/8.0),
13338 REAL_CONST(87350.539815592856/8.0),
13339 REAL_CONST(87373.462706088845/8.0),
13340 REAL_CONST(87396.387100168897/8.0),
13341 REAL_CONST(87419.312997635774/8.0),
13342 REAL_CONST(87442.240398292357/8.0),
13343 REAL_CONST(87465.16930194154/8.0),
13344 REAL_CONST(87488.099708386319/8.0),
13345 REAL_CONST(87511.031617429733/8.0),
13346 REAL_CONST(87533.965028874911/8.0),
13347 REAL_CONST(87556.899942525008/8.0),
13348 REAL_CONST(87579.836358183282/8.0),
13349 REAL_CONST(87602.774275653021/8.0),
13350 REAL_CONST(87625.713694737613/8.0),
13351 REAL_CONST(87648.654615240492/8.0),
13352 REAL_CONST(87671.597036965148/8.0),
13353 REAL_CONST(87694.540959715145/8.0),
13354 REAL_CONST(87717.486383294105/8.0),
13355 REAL_CONST(87740.433307505737/8.0),
13356 REAL_CONST(87763.381732153779/8.0),
13357 REAL_CONST(87786.331657042057/8.0),
13358 REAL_CONST(87809.283081974456/8.0),
13359 REAL_CONST(87832.236006754916/8.0),
13360 REAL_CONST(87855.190431187453/8.0),
13361 REAL_CONST(87878.146355076155/8.0),
13362 REAL_CONST(87901.103778225151/8.0),
13363 REAL_CONST(87924.062700438633/8.0),
13364 REAL_CONST(87947.023121520891/8.0),
13365 REAL_CONST(87969.985041276246/8.0),
13366 REAL_CONST(87992.948459509105/8.0),
13367 REAL_CONST(88015.913376023906/8.0),
13368 REAL_CONST(88038.879790625171/8.0),
13369 REAL_CONST(88061.847703117513/8.0),
13370 REAL_CONST(88084.817113305573/8.0),
13371 REAL_CONST(88107.788020994049/8.0),
13372 REAL_CONST(88130.760425987726/8.0),
13373 REAL_CONST(88153.734328091465/8.0),
13374 REAL_CONST(88176.709727110137/8.0),
13375 REAL_CONST(88199.686622848749/8.0),
13376 REAL_CONST(88222.665015112303/8.0),
13377 REAL_CONST(88245.644903705906/8.0),
13378 REAL_CONST(88268.626288434709/8.0),
13379 REAL_CONST(88291.609169103947/8.0),
13380 REAL_CONST(88314.593545518903/8.0),
13381 REAL_CONST(88337.579417484914/8.0),
13382 REAL_CONST(88360.566784807408/8.0),
13383 REAL_CONST(88383.555647291854/8.0),
13384 REAL_CONST(88406.546004743795/8.0),
13385 REAL_CONST(88429.537856968818/8.0),
13386 REAL_CONST(88452.531203772611/8.0),
13387 REAL_CONST(88475.52604496089/8.0),
13388 REAL_CONST(88498.522380339447/8.0),
13389 REAL_CONST(88521.52020971413/8.0),
13390 REAL_CONST(88544.519532890874/8.0),
13391 REAL_CONST(88567.520349675644/8.0),
13392 REAL_CONST(88590.522659874507/8.0),
13393 REAL_CONST(88613.526463293543/8.0),
13394 REAL_CONST(88636.531759738922/8.0),
13395 REAL_CONST(88659.538549016899/8.0),
13396 REAL_CONST(88682.546830933745/8.0),
13397 REAL_CONST(88705.556605295846/8.0),
13398 REAL_CONST(88728.567871909589/8.0),
13399 REAL_CONST(88751.580630581491/8.0),
13400 REAL_CONST(88774.594881118086/8.0),
13401 REAL_CONST(88797.610623325963/8.0),
13402 REAL_CONST(88820.62785701183/8.0),
13403 REAL_CONST(88843.646581982393/8.0),
13404 REAL_CONST(88866.666798044462/8.0),
13405 REAL_CONST(88889.688505004888/8.0),
13406 REAL_CONST(88912.711702670611/8.0),
13407 REAL_CONST(88935.7363908486/8.0),
13408 REAL_CONST(88958.762569345898/8.0),
13409 REAL_CONST(88981.790237969632/8.0),
13410 REAL_CONST(89004.81939652696/8.0),
13411 REAL_CONST(89027.850044825114/8.0),
13412 REAL_CONST(89050.882182671412/8.0),
13413 REAL_CONST(89073.9158098732/8.0),
13414 REAL_CONST(89096.950926237885/8.0),
13415 REAL_CONST(89119.987531572973/8.0),
13416 REAL_CONST(89143.025625686001/8.0),
13417 REAL_CONST(89166.065208384563/8.0),
13418 REAL_CONST(89189.106279476357/8.0),
13419 REAL_CONST(89212.148838769106/8.0),
13420 REAL_CONST(89235.192886070581/8.0),
13421 REAL_CONST(89258.238421188667/8.0),
13422 REAL_CONST(89281.285443931265/8.0),
13423 REAL_CONST(89304.333954106376/8.0),
13424 REAL_CONST(89327.383951522017/8.0),
13425 REAL_CONST(89350.435435986306/8.0),
13426 REAL_CONST(89373.488407307406/8.0),
13427 REAL_CONST(89396.542865293537/8.0),
13428 REAL_CONST(89419.598809753006/8.0),
13429 REAL_CONST(89442.656240494165/8.0),
13430 REAL_CONST(89465.715157325409/8.0),
13431 REAL_CONST(89488.775560055219/8.0),
13432 REAL_CONST(89511.837448492137/8.0),
13433 REAL_CONST(89534.900822444746/8.0),
13434 REAL_CONST(89557.965681721733/8.0),
13435 REAL_CONST(89581.032026131812/8.0),
13436 REAL_CONST(89604.099855483742/8.0),
13437 REAL_CONST(89627.169169586399/8.0),
13438 REAL_CONST(89650.239968248672/8.0),
13439 REAL_CONST(89673.312251279538/8.0),
13440 REAL_CONST(89696.386018488018/8.0),
13441 REAL_CONST(89719.461269683205/8.0),
13442 REAL_CONST(89742.53800467425/8.0),
13443 REAL_CONST(89765.616223270365/8.0),
13444 REAL_CONST(89788.69592528083/8.0),
13445 REAL_CONST(89811.777110514988/8.0),
13446 REAL_CONST(89834.859778782207/8.0),
13447 REAL_CONST(89857.943929891975/8.0),
13448 REAL_CONST(89881.029563653807/8.0),
13449 REAL_CONST(89904.116679877261/8.0),
13450 REAL_CONST(89927.205278372014/8.0),
13451 REAL_CONST(89950.29535894774/8.0),
13452 REAL_CONST(89973.386921414218/8.0),
13453 REAL_CONST(89996.479965581268/8.0),
13454 REAL_CONST(90019.574491258769/8.0),
13455 REAL_CONST(90042.670498256688/8.0),
13456 REAL_CONST(90065.767986385021/8.0),
13457 REAL_CONST(90088.866955453836/8.0),
13458 REAL_CONST(90111.967405273259/8.0),
13459 REAL_CONST(90135.069335653476/8.0),
13460 REAL_CONST(90158.172746404758/8.0),
13461 REAL_CONST(90181.277637337407/8.0),
13462 REAL_CONST(90204.384008261797/8.0),
13463 REAL_CONST(90227.49185898836/8.0),
13464 REAL_CONST(90250.601189327586/8.0),
13465 REAL_CONST(90273.711999090039/8.0),
13466 REAL_CONST(90296.824288086325/8.0),
13467 REAL_CONST(90319.938056127125/8.0),
13468 REAL_CONST(90343.053303023189/8.0),
13469 REAL_CONST(90366.170028585286/8.0),
13470 REAL_CONST(90389.288232624298/8.0),
13471 REAL_CONST(90412.407914951138/8.0),
13472 REAL_CONST(90435.529075376777/8.0),
13473 REAL_CONST(90458.651713712257/8.0),
13474 REAL_CONST(90481.775829768681/8.0),
13475 REAL_CONST(90504.901423357209/8.0),
13476 REAL_CONST(90528.028494289058/8.0),
13477 REAL_CONST(90551.157042375504/8.0),
13478 REAL_CONST(90574.287067427911/8.0),
13479 REAL_CONST(90597.418569257643/8.0),
13480 REAL_CONST(90620.551547676194/8.0),
13481 REAL_CONST(90643.686002495073/8.0),
13482 REAL_CONST(90666.821933525847/8.0),
13483 REAL_CONST(90689.959340580186/8.0),
13484 REAL_CONST(90713.098223469773/8.0),
13485 REAL_CONST(90736.238582006365/8.0),
13486 REAL_CONST(90759.380416001804/8.0),
13487 REAL_CONST(90782.523725267951/8.0),
13488 REAL_CONST(90805.668509616764/8.0),
13489 REAL_CONST(90828.814768860233/8.0),
13490 REAL_CONST(90851.962502810435/8.0),
13491 REAL_CONST(90875.11171127946/8.0),
13492 REAL_CONST(90898.262394079517/8.0),
13493 REAL_CONST(90921.414551022855/8.0),
13494 REAL_CONST(90944.568181921743/8.0),
13495 REAL_CONST(90967.72328658856/8.0),
13496 REAL_CONST(90990.879864835719/8.0),
13497 REAL_CONST(91014.037916475718/8.0),
13498 REAL_CONST(91037.19744132107/8.0),
13499 REAL_CONST(91060.358439184391/8.0),
13500 REAL_CONST(91083.520909878338/8.0),
13501 REAL_CONST(91106.684853215629/8.0),
13502 REAL_CONST(91129.850269009039/8.0),
13503 REAL_CONST(91153.017157071401/8.0),
13504 REAL_CONST(91176.185517215621/8.0),
13505 REAL_CONST(91199.355349254649/8.0),
13506 REAL_CONST(91222.526653001492/8.0),
13507 REAL_CONST(91245.699428269247/8.0),
13508 REAL_CONST(91268.873674871036/8.0),
13509 REAL_CONST(91292.049392620058/8.0),
13510 REAL_CONST(91315.226581329553/8.0),
13511 REAL_CONST(91338.405240812834/8.0),
13512 REAL_CONST(91361.585370883287/8.0),
13513 REAL_CONST(91384.766971354344/8.0),
13514 REAL_CONST(91407.950042039476/8.0),
13515 REAL_CONST(91431.134582752245/8.0),
13516 REAL_CONST(91454.320593306256/8.0),
13517 REAL_CONST(91477.508073515171/8.0),
13518 REAL_CONST(91500.697023192712/8.0),
13519 REAL_CONST(91523.887442152685/8.0),
13520 REAL_CONST(91547.07933020893/8.0),
13521 REAL_CONST(91570.272687175326/8.0),
13522 REAL_CONST(91593.467512865856/8.0),
13523 REAL_CONST(91616.663807094534/8.0),
13524 REAL_CONST(91639.861569675442/8.0),
13525 REAL_CONST(91663.060800422725/8.0),
13526 REAL_CONST(91686.261499150554/8.0),
13527 REAL_CONST(91709.463665673218/8.0),
13528 REAL_CONST(91732.66729980502/8.0),
13529 REAL_CONST(91755.872401360321/8.0),
13530 REAL_CONST(91779.078970153569/8.0),
13531 REAL_CONST(91802.287005999257/8.0),
13532 REAL_CONST(91825.49650871192/8.0),
13533 REAL_CONST(91848.707478106167/8.0),
13534 REAL_CONST(91871.91991399668/8.0),
13535 REAL_CONST(91895.133816198169/8.0),
13536 REAL_CONST(91918.349184525418/8.0),
13537 REAL_CONST(91941.566018793281/8.0),
13538 REAL_CONST(91964.784318816659/8.0),
13539 REAL_CONST(91988.004084410495/8.0),
13540 REAL_CONST(92011.22531538982/8.0),
13541 REAL_CONST(92034.448011569708/8.0),
13542 REAL_CONST(92057.672172765277/8.0),
13543 REAL_CONST(92080.897798791746/8.0),
13544 REAL_CONST(92104.124889464365/8.0),
13545 REAL_CONST(92127.353444598411/8.0),
13546 REAL_CONST(92150.58346400928/8.0),
13547 REAL_CONST(92173.814947512379/8.0),
13548 REAL_CONST(92197.04789492322/8.0),
13549 REAL_CONST(92220.282306057314/8.0),
13550 REAL_CONST(92243.518180730272/8.0),
13551 REAL_CONST(92266.755518757753/8.0),
13552 REAL_CONST(92289.994319955469/8.0),
13553 REAL_CONST(92313.234584139194/8.0),
13554 REAL_CONST(92336.476311124774/8.0),
13555 REAL_CONST(92359.719500728082/8.0),
13556 REAL_CONST(92382.964152765067/8.0),
13557 REAL_CONST(92406.210267051734/8.0),
13558 REAL_CONST(92429.457843404161/8.0),
13559 REAL_CONST(92452.706881638471/8.0),
13560 REAL_CONST(92475.957381570814/8.0),
13561 REAL_CONST(92499.209343017443/8.0),
13562 REAL_CONST(92522.462765794655/8.0),
13563 REAL_CONST(92545.717649718805/8.0),
13564 REAL_CONST(92568.973994606305/8.0),
13565 REAL_CONST(92592.231800273614/8.0),
13566 REAL_CONST(92615.491066537259/8.0),
13567 REAL_CONST(92638.751793213814/8.0),
13568 REAL_CONST(92662.01398011994/8.0),
13569 REAL_CONST(92685.277627072326/8.0),
13570 REAL_CONST(92708.54273388772/8.0),
13571 REAL_CONST(92731.809300382942/8.0),
13572 REAL_CONST(92755.077326374871/8.0),
13573 REAL_CONST(92778.346811680414/8.0),
13574 REAL_CONST(92801.617756116568/8.0),
13575 REAL_CONST(92824.890159500384/8.0),
13576 REAL_CONST(92848.164021648947/8.0),
13577 REAL_CONST(92871.439342379424/8.0),
13578 REAL_CONST(92894.716121509016/8.0),
13579 REAL_CONST(92917.994358855023/8.0),
13580 REAL_CONST(92941.274054234746/8.0),
13581 REAL_CONST(92964.555207465572/8.0),
13582 REAL_CONST(92987.837818364962/8.0),
13583 REAL_CONST(93011.121886750407/8.0),
13584 REAL_CONST(93034.407412439468/8.0),
13585 REAL_CONST(93057.694395249753/8.0),
13586 REAL_CONST(93080.982834998955/8.0),
13587 REAL_CONST(93104.272731504767/8.0),
13588 REAL_CONST(93127.564084584999/8.0),
13589 REAL_CONST(93150.856894057491/8.0),
13590 REAL_CONST(93174.15115974014/8.0),
13591 REAL_CONST(93197.446881450916/8.0),
13592 REAL_CONST(93220.744059007804/8.0),
13593 REAL_CONST(93244.04269222889/8.0),
13594 REAL_CONST(93267.342780932304/8.0),
13595 REAL_CONST(93290.644324936235/8.0),
13596 REAL_CONST(93313.947324058914/8.0),
13597 REAL_CONST(93337.251778118633/8.0),
13598 REAL_CONST(93360.557686933767/8.0),
13599 REAL_CONST(93383.865050322696/8.0),
13600 REAL_CONST(93407.173868103928/8.0),
13601 REAL_CONST(93430.484140095941/8.0),
13602 REAL_CONST(93453.795866117362/8.0),
13603 REAL_CONST(93477.109045986799/8.0),
13604 REAL_CONST(93500.423679522952/8.0),
13605 REAL_CONST(93523.739766544561/8.0),
13606 REAL_CONST(93547.057306870454/8.0),
13607 REAL_CONST(93570.376300319491/8.0),
13608 REAL_CONST(93593.696746710571/8.0),
13609 REAL_CONST(93617.018645862699/8.0),
13610 REAL_CONST(93640.341997594893/8.0),
13611 REAL_CONST(93663.666801726242/8.0),
13612 REAL_CONST(93686.993058075881/8.0),
13613 REAL_CONST(93710.320766463032/8.0),
13614 REAL_CONST(93733.64992670693/8.0),
13615 REAL_CONST(93756.980538626914/8.0),
13616 REAL_CONST(93780.312602042337/8.0),
13617 REAL_CONST(93803.646116772637/8.0),
13618 REAL_CONST(93826.981082637285/8.0),
13619 REAL_CONST(93850.317499455836/8.0),
13620 REAL_CONST(93873.655367047861/8.0),
13621 REAL_CONST(93896.994685233032/8.0),
13622 REAL_CONST(93920.335453831038/8.0),
13623 REAL_CONST(93943.677672661666/8.0),
13624 REAL_CONST(93967.021341544707/8.0),
13625 REAL_CONST(93990.366460300051/8.0),
13626 REAL_CONST(94013.713028747632/8.0),
13627 REAL_CONST(94037.061046707429/8.0),
13628 REAL_CONST(94060.410513999494/8.0),
13629 REAL_CONST(94083.761430443905/8.0),
13630 REAL_CONST(94107.113795860845/8.0),
13631 REAL_CONST(94130.467610070496/8.0),
13632 REAL_CONST(94153.822872893157/8.0),
13633 REAL_CONST(94177.179584149111/8.0),
13634 REAL_CONST(94200.537743658759/8.0),
13635 REAL_CONST(94223.897351242529/8.0),
13636 REAL_CONST(94247.25840672091/8.0),
13637 REAL_CONST(94270.620909914433/8.0),
13638 REAL_CONST(94293.98486064373/8.0),
13639 REAL_CONST(94317.350258729421/8.0),
13640 REAL_CONST(94340.71710399224/8.0),
13641 REAL_CONST(94364.085396252936/8.0),
13642 REAL_CONST(94387.455135332348/8.0),
13643 REAL_CONST(94410.82632105134/8.0),
13644 REAL_CONST(94434.198953230851/8.0),
13645 REAL_CONST(94457.573031691878/8.0),
13646 REAL_CONST(94480.948556255447/8.0),
13647 REAL_CONST(94504.325526742658/8.0),
13648 REAL_CONST(94527.70394297468/8.0),
13649 REAL_CONST(94551.083804772716/8.0),
13650 REAL_CONST(94574.465111958023/8.0),
13651 REAL_CONST(94597.847864351934/8.0),
13652 REAL_CONST(94621.232061775823/8.0),
13653 REAL_CONST(94644.617704051096/8.0),
13654 REAL_CONST(94668.004790999272/8.0),
13655 REAL_CONST(94691.393322441872/8.0),
13656 REAL_CONST(94714.783298200506/8.0),
13657 REAL_CONST(94738.174718096794/8.0),
13658 REAL_CONST(94761.567581952477/8.0),
13659 REAL_CONST(94784.961889589307/8.0),
13660 REAL_CONST(94808.357640829097/8.0),
13661 REAL_CONST(94831.754835493703/8.0),
13662 REAL_CONST(94855.153473405066/8.0),
13663 REAL_CONST(94878.553554385173/8.0),
13664 REAL_CONST(94901.955078256055/8.0),
13665 REAL_CONST(94925.358044839784/8.0),
13666 REAL_CONST(94948.762453958523/8.0),
13667 REAL_CONST(94972.168305434476/8.0),
13668 REAL_CONST(94995.575599089891/8.0),
13669 REAL_CONST(95018.984334747074/8.0),
13670 REAL_CONST(95042.394512228391/8.0),
13671 REAL_CONST(95065.806131356265/8.0),
13672 REAL_CONST(95089.219191953176/8.0),
13673 REAL_CONST(95112.633693841635/8.0),
13674 REAL_CONST(95136.04963684424/8.0),
13675 REAL_CONST(95159.467020783617/8.0),
13676 REAL_CONST(95182.885845482466/8.0),
13677 REAL_CONST(95206.306110763529/8.0),
13678 REAL_CONST(95229.727816449609/8.0),
13679 REAL_CONST(95253.150962363579/8.0),
13680 REAL_CONST(95276.575548328314/8.0),
13681 REAL_CONST(95300.001574166803/8.0),
13682 REAL_CONST(95323.429039702052/8.0),
13683 REAL_CONST(95346.857944757154/8.0),
13684 REAL_CONST(95370.288289155214/8.0),
13685 REAL_CONST(95393.720072719429/8.0),
13686 REAL_CONST(95417.153295273019/8.0),
13687 REAL_CONST(95440.587956639298/8.0),
13688 REAL_CONST(95464.024056641589/8.0),
13689 REAL_CONST(95487.461595103305/8.0),
13690 REAL_CONST(95510.900571847902/8.0),
13691 REAL_CONST(95534.340986698866/8.0),
13692 REAL_CONST(95557.782839479783/8.0),
13693 REAL_CONST(95581.226130014256/8.0),
13694 REAL_CONST(95604.670858125959/8.0),
13695 REAL_CONST(95628.117023638595/8.0),
13696 REAL_CONST(95651.564626375985/8.0),
13697 REAL_CONST(95675.013666161918/8.0),
13698 REAL_CONST(95698.464142820303/8.0),
13699 REAL_CONST(95721.916056175076/8.0),
13700 REAL_CONST(95745.369406050231/8.0),
13701 REAL_CONST(95768.824192269807/8.0),
13702 REAL_CONST(95792.280414657915/8.0),
13703 REAL_CONST(95815.738073038709/8.0),
13704 REAL_CONST(95839.197167236387/8.0),
13705 REAL_CONST(95862.657697075221/8.0),
13706 REAL_CONST(95886.11966237954/8.0),
13707 REAL_CONST(95909.583062973688/8.0),
13708 REAL_CONST(95933.047898682111/8.0),
13709 REAL_CONST(95956.514169329268/8.0),
13710 REAL_CONST(95979.981874739708/8.0),
13711 REAL_CONST(96003.451014738006/8.0),
13712 REAL_CONST(96026.921589148798/8.0),
13713 REAL_CONST(96050.393597796792/8.0),
13714 REAL_CONST(96073.867040506724/8.0),
13715 REAL_CONST(96097.341917103375/8.0),
13716 REAL_CONST(96120.818227411626/8.0),
13717 REAL_CONST(96144.295971256375/8.0),
13718 REAL_CONST(96167.775148462577/8.0),
13719 REAL_CONST(96191.255758855244/8.0),
13720 REAL_CONST(96214.737802259449/8.0),
13721 REAL_CONST(96238.221278500292/8.0),
13722 REAL_CONST(96261.70618740299/8.0),
13723 REAL_CONST(96285.192528792715/8.0),
13724 REAL_CONST(96308.680302494788/8.0),
13725 REAL_CONST(96332.169508334526/8.0),
13726 REAL_CONST(96355.660146137321/8.0),
13727 REAL_CONST(96379.152215728609/8.0),
13728 REAL_CONST(96402.645716933868/8.0),
13729 REAL_CONST(96426.14064957868/8.0),
13730 REAL_CONST(96449.637013488609/8.0),
13731 REAL_CONST(96473.134808489311/8.0),
13732 REAL_CONST(96496.63403440651/8.0),
13733 REAL_CONST(96520.134691065963/8.0),
13734 REAL_CONST(96543.636778293469/8.0),
13735 REAL_CONST(96567.140295914898/8.0),
13736 REAL_CONST(96590.645243756153/8.0),
13737 REAL_CONST(96614.151621643221/8.0),
13738 REAL_CONST(96637.659429402134/8.0),
13739 REAL_CONST(96661.168666858954/8.0),
13740 REAL_CONST(96684.679333839798/8.0),
13741 REAL_CONST(96708.191430170875/8.0),
13742 REAL_CONST(96731.70495567839/8.0),
13743 REAL_CONST(96755.219910188665/8.0),
13744 REAL_CONST(96778.736293528011/8.0),
13745 REAL_CONST(96802.254105522836/8.0),
13746 REAL_CONST(96825.77334599958/8.0),
13747 REAL_CONST(96849.29401478474/8.0),
13748 REAL_CONST(96872.816111704873/8.0),
13749 REAL_CONST(96896.339636586577/8.0),
13750 REAL_CONST(96919.864589256511/8.0),
13751 REAL_CONST(96943.390969541389/8.0),
13752 REAL_CONST(96966.918777267958/8.0),
13753 REAL_CONST(96990.448012263048/8.0),
13754 REAL_CONST(97013.978674353522/8.0),
13755 REAL_CONST(97037.510763366285/8.0),
13756 REAL_CONST(97061.044279128328/8.0),
13757 REAL_CONST(97084.579221466673/8.0),
13758 REAL_CONST(97108.115590208385/8.0),
13759 REAL_CONST(97131.653385180587/8.0),
13760 REAL_CONST(97155.19260621049/8.0),
13761 REAL_CONST(97178.733253125291/8.0),
13762 REAL_CONST(97202.2753257523/8.0),
13763 REAL_CONST(97225.81882391886/8.0),
13764 REAL_CONST(97249.363747452342/8.0),
13765 REAL_CONST(97272.910096180189/8.0),
13766 REAL_CONST(97296.457869929916/8.0),
13767 REAL_CONST(97320.007068529041/8.0),
13768 REAL_CONST(97343.557691805196/8.0),
13769 REAL_CONST(97367.109739586012/8.0),
13770 REAL_CONST(97390.663211699197/8.0),
13771 REAL_CONST(97414.218107972498/8.0),
13772 REAL_CONST(97437.774428233737/8.0),
13773 REAL_CONST(97461.332172310766/8.0),
13774 REAL_CONST(97484.891340031507/8.0),
13775 REAL_CONST(97508.451931223899/8.0),
13776 REAL_CONST(97532.013945715982/8.0),
13777 REAL_CONST(97555.577383335811/8.0),
13778 REAL_CONST(97579.142243911512/8.0),
13779 REAL_CONST(97602.708527271257/8.0),
13780 REAL_CONST(97626.276233243261/8.0),
13781 REAL_CONST(97649.845361655811/8.0),
13782 REAL_CONST(97673.415912337223/8.0),
13783 REAL_CONST(97696.987885115886/8.0),
13784 REAL_CONST(97720.561279820206/8.0),
13785 REAL_CONST(97744.1360962787/8.0),
13786 REAL_CONST(97767.712334319876/8.0),
13787 REAL_CONST(97791.289993772341/8.0),
13788 REAL_CONST(97814.869074464703/8.0),
13789 REAL_CONST(97838.449576225685/8.0),
13790 REAL_CONST(97862.031498883996/8.0),
13791 REAL_CONST(97885.614842268449/8.0),
13792 REAL_CONST(97909.199606207883/8.0),
13793 REAL_CONST(97932.785790531183/8.0),
13794 REAL_CONST(97956.37339506732/8.0),
13795 REAL_CONST(97979.962419645264/8.0),
13796 REAL_CONST(98003.552864094076/8.0),
13797 REAL_CONST(98027.144728242856/8.0),
13798 REAL_CONST(98050.738011920766/8.0),
13799 REAL_CONST(98074.332714956996/8.0),
13800 REAL_CONST(98097.928837180807/8.0),
13801 REAL_CONST(98121.526378421506/8.0),
13802 REAL_CONST(98145.125338508456/8.0),
13803 REAL_CONST(98168.725717271067/8.0),
13804 REAL_CONST(98192.327514538789/8.0),
13805 REAL_CONST(98215.930730141132/8.0),
13806 REAL_CONST(98239.535363907664/8.0),
13807 REAL_CONST(98263.141415668011/8.0),
13808 REAL_CONST(98286.748885251814/8.0),
13809 REAL_CONST(98310.357772488816/8.0),
13810 REAL_CONST(98333.968077208759/8.0),
13811 REAL_CONST(98357.579799241488/8.0),
13812 REAL_CONST(98381.192938416847/8.0),
13813 REAL_CONST(98404.807494564782/8.0),
13814 REAL_CONST(98428.42346751524/8.0),
13815 REAL_CONST(98452.040857098269/8.0),
13816 REAL_CONST(98475.659663143917/8.0),
13817 REAL_CONST(98499.27988548232/8.0),
13818 REAL_CONST(98522.901523943656/8.0),
13819 REAL_CONST(98546.524578358163/8.0),
13820 REAL_CONST(98570.149048556093/8.0),
13821 REAL_CONST(98593.774934367786/8.0),
13822 REAL_CONST(98617.402235623624/8.0),
13823 REAL_CONST(98641.030952154048/8.0),
13824 REAL_CONST(98664.661083789513/8.0),
13825 REAL_CONST(98688.292630360564/8.0),
13826 REAL_CONST(98711.925591697771/8.0),
13827 REAL_CONST(98735.559967631794/8.0),
13828 REAL_CONST(98759.195757993293/8.0),
13829 REAL_CONST(98782.832962613014/8.0),
13830 REAL_CONST(98806.471581321734/8.0),
13831 REAL_CONST(98830.111613950285/8.0),
13832 REAL_CONST(98853.753060329575/8.0),
13833 REAL_CONST(98877.39592029051/8.0),
13834 REAL_CONST(98901.040193664099/8.0),
13835 REAL_CONST(98924.68588028138/8.0),
13836 REAL_CONST(98948.33297997342/8.0),
13837 REAL_CONST(98971.981492571387/8.0),
13838 REAL_CONST(98995.63141790645/8.0),
13839 REAL_CONST(99019.282755809851/8.0),
13840 REAL_CONST(99042.935506112874/8.0),
13841 REAL_CONST(99066.589668646877/8.0),
13842 REAL_CONST(99090.245243243233/8.0),
13843 REAL_CONST(99113.902229733401/8.0),
13844 REAL_CONST(99137.560627948857/8.0),
13845 REAL_CONST(99161.220437721131/8.0),
13846 REAL_CONST(99184.881658881859/8.0),
13847 REAL_CONST(99208.544291262631/8.0),
13848 REAL_CONST(99232.208334695169/8.0),
13849 REAL_CONST(99255.87378901121/8.0),
13850 REAL_CONST(99279.540654042547/8.0),
13851 REAL_CONST(99303.208929621018/8.0),
13852 REAL_CONST(99326.878615578535/8.0),
13853 REAL_CONST(99350.549711746993/8.0),
13854 REAL_CONST(99374.222217958435/8.0),
13855 REAL_CONST(99397.896134044888/8.0),
13856 REAL_CONST(99421.571459838422/8.0),
13857 REAL_CONST(99445.248195171211/8.0),
13858 REAL_CONST(99468.926339875441/8.0),
13859 REAL_CONST(99492.605893783344/8.0),
13860 REAL_CONST(99516.286856727209/8.0),
13861 REAL_CONST(99539.969228539398/8.0),
13862 REAL_CONST(99563.653009052287/8.0),
13863 REAL_CONST(99587.338198098325/8.0),
13864 REAL_CONST(99611.024795510006/8.0),
13865 REAL_CONST(99634.712801119866/8.0),
13866 REAL_CONST(99658.402214760499/8.0),
13867 REAL_CONST(99682.093036264545/8.0),
13868 REAL_CONST(99705.785265464699/8.0),
13869 REAL_CONST(99729.478902193689/8.0),
13870 REAL_CONST(99753.173946284325/8.0),
13871 REAL_CONST(99776.870397569437/8.0),
13872 REAL_CONST(99800.56825588191/8.0),
13873 REAL_CONST(99824.267521054688/8.0),
13874 REAL_CONST(99847.968192920773/8.0),
13875 REAL_CONST(99871.670271313182/8.0),
13876 REAL_CONST(99895.373756065004/8.0),
13877 REAL_CONST(99919.078647009388/8.0),
13878 REAL_CONST(99942.78494397951/8.0),
13879 REAL_CONST(99966.492646808634/8.0),
13880 REAL_CONST(99990.20175533001/8.0),
13881 REAL_CONST(100013.91226937699/8.0),
13882 REAL_CONST(100037.62418878295/8.0),
13883 REAL_CONST(100061.33751338134/8.0),
13884 REAL_CONST(100085.05224300563/8.0),
13885 REAL_CONST(100108.76837748935/8.0),
13886 REAL_CONST(100132.4859166661/8.0),
13887 REAL_CONST(100156.2048603695/8.0),
13888 REAL_CONST(100179.92520843323/8.0),
13889 REAL_CONST(100203.64696069101/8.0),
13890 REAL_CONST(100227.37011697664/8.0),
13891 REAL_CONST(100251.09467712394/8.0),
13892 REAL_CONST(100274.82064096678/8.0),
13893 REAL_CONST(100298.54800833909/8.0),
13894 REAL_CONST(100322.27677907483/8.0),
13895 REAL_CONST(100346.00695300807/8.0),
13896 REAL_CONST(100369.73852997283/8.0),
13897 REAL_CONST(100393.47150980328/8.0),
13898 REAL_CONST(100417.20589233354/8.0),
13899 REAL_CONST(100440.94167739789/8.0),
13900 REAL_CONST(100464.67886483055/8.0),
13901 REAL_CONST(100488.41745446586/8.0),
13902 REAL_CONST(100512.1574461382/8.0),
13903 REAL_CONST(100535.89883968196/8.0),
13904 REAL_CONST(100559.64163493161/8.0),
13905 REAL_CONST(100583.38583172169/8.0),
13906 REAL_CONST(100607.13142988674/8.0),
13907 REAL_CONST(100630.87842926137/8.0),
13908 REAL_CONST(100654.62682968024/8.0),
13909 REAL_CONST(100678.37663097809/8.0),
13910 REAL_CONST(100702.12783298964/8.0),
13911 REAL_CONST(100725.88043554971/8.0),
13912 REAL_CONST(100749.63443849317/8.0),
13913 REAL_CONST(100773.38984165489/8.0),
13914 REAL_CONST(100797.14664486986/8.0),
13915 REAL_CONST(100820.90484797307/8.0),
13916 REAL_CONST(100844.66445079957/8.0),
13917 REAL_CONST(100868.42545318443/8.0),
13918 REAL_CONST(100892.18785496285/8.0),
13919 REAL_CONST(100915.95165596998/8.0),
13920 REAL_CONST(100939.71685604109/8.0),
13921 REAL_CONST(100963.48345501146/8.0),
13922 REAL_CONST(100987.25145271645/8.0),
13923 REAL_CONST(101011.02084899142/8.0),
13924 REAL_CONST(101034.79164367182/8.0),
13925 REAL_CONST(101058.56383659317/8.0),
13926 REAL_CONST(101082.33742759094/8.0),
13927 REAL_CONST(101106.11241650078/8.0),
13928 REAL_CONST(101129.88880315828/8.0),
13929 REAL_CONST(101153.66658739912/8.0),
13930 REAL_CONST(101177.44576905905/8.0),
13931 REAL_CONST(101201.22634797383/8.0),
13932 REAL_CONST(101225.00832397929/8.0),
13933 REAL_CONST(101248.7916969113/8.0),
13934 REAL_CONST(101272.57646660579/8.0),
13935 REAL_CONST(101296.36263289873/8.0),
13936 REAL_CONST(101320.15019562612/8.0),
13937 REAL_CONST(101343.93915462404/8.0),
13938 REAL_CONST(101367.7295097286/8.0),
13939 REAL_CONST(101391.52126077596/8.0),
13940 REAL_CONST(101415.31440760233/8.0),
13941 REAL_CONST(101439.10895004397/8.0),
13942 REAL_CONST(101462.9048879372/8.0),
13943 REAL_CONST(101486.70222111834/8.0),
13944 REAL_CONST(101510.50094942382/8.0),
13945 REAL_CONST(101534.30107269008/8.0),
13946 REAL_CONST(101558.10259075361/8.0),
13947 REAL_CONST(101581.90550345098/8.0),
13948 REAL_CONST(101605.70981061876/8.0),
13949 REAL_CONST(101629.5155120936/8.0),
13950 REAL_CONST(101653.32260771218/8.0),
13951 REAL_CONST(101677.13109731126/8.0),
13952 REAL_CONST(101700.9409807276/8.0),
13953 REAL_CONST(101724.75225779804/8.0),
13954 REAL_CONST(101748.56492835947/8.0),
13955 REAL_CONST(101772.37899224881/8.0),
13956 REAL_CONST(101796.19444930303/8.0),
13957 REAL_CONST(101820.01129935916/8.0),
13958 REAL_CONST(101843.82954225427/8.0),
13959 REAL_CONST(101867.64917782549/8.0),
13960 REAL_CONST(101891.47020590997/8.0),
13961 REAL_CONST(101915.29262634492/8.0),
13962 REAL_CONST(101939.11643896763/8.0),
13963 REAL_CONST(101962.94164361537/8.0),
13964 REAL_CONST(101986.76824012553/8.0),
13965 REAL_CONST(102010.59622833549/8.0),
13966 REAL_CONST(102034.42560808272/8.0),
13967 REAL_CONST(102058.25637920471/8.0),
13968 REAL_CONST(102082.08854153901/8.0),
13969 REAL_CONST(102105.9220949232/8.0),
13970 REAL_CONST(102129.75703919494/8.0),
13971 REAL_CONST(102153.59337419191/8.0),
13972 REAL_CONST(102177.43109975185/8.0),
13973 REAL_CONST(102201.27021571253/8.0),
13974 REAL_CONST(102225.1107219118/8.0),
13975 REAL_CONST(102248.95261818753/8.0),
13976 REAL_CONST(102272.79590437764/8.0),
13977 REAL_CONST(102296.64058032009/8.0),
13978 REAL_CONST(102320.48664585294/8.0),
13979 REAL_CONST(102344.33410081422/8.0),
13980 REAL_CONST(102368.18294504205/8.0),
13981 REAL_CONST(102392.03317837461/8.0),
13982 REAL_CONST(102415.88480065008/8.0),
13983 REAL_CONST(102439.73781170673/8.0),
13984 REAL_CONST(102463.59221138287/8.0),
13985 REAL_CONST(102487.44799951684/8.0),
13986 REAL_CONST(102511.30517594704/8.0),
13987 REAL_CONST(102535.1637405119/8.0),
13988 REAL_CONST(102559.02369304992/8.0),
13989 REAL_CONST(102582.88503339965/8.0),
13990 REAL_CONST(102606.74776139967/8.0),
13991 REAL_CONST(102630.61187688859/8.0),
13992 REAL_CONST(102654.4773797051/8.0),
13993 REAL_CONST(102678.34426968795/8.0),
13994 REAL_CONST(102702.21254667587/8.0),
13995 REAL_CONST(102726.08221050771/8.0),
13996 REAL_CONST(102749.95326102231/8.0),
13997 REAL_CONST(102773.8256980586/8.0),
13998 REAL_CONST(102797.69952145554/8.0),
13999 REAL_CONST(102821.57473105213/8.0),
14000 REAL_CONST(102845.45132668741/8.0),
14001 REAL_CONST(102869.32930820051/8.0),
14002 REAL_CONST(102893.20867543056/8.0),
14003 REAL_CONST(102917.08942821674/8.0),
14004 REAL_CONST(102940.97156639832/8.0),
14005 REAL_CONST(102964.85508981455/8.0),
14006 REAL_CONST(102988.73999830478/8.0),
14007 REAL_CONST(103012.6262917084/8.0),
14008 REAL_CONST(103036.51396986481/8.0),
14009 REAL_CONST(103060.40303261351/8.0),
14010 REAL_CONST(103084.293479794/8.0),
14011 REAL_CONST(103108.18531124585/8.0),
14012 REAL_CONST(103132.07852680866/8.0),
14013 REAL_CONST(103155.97312632212/8.0),
14014 REAL_CONST(103179.8691096259/8.0),
14015 REAL_CONST(103203.76647655977/8.0),
14016 REAL_CONST(103227.66522696352/8.0),
14017 REAL_CONST(103251.56536067701/8.0),
14018 REAL_CONST(103275.46687754011/8.0),
14019 REAL_CONST(103299.36977739276/8.0),
14020 REAL_CONST(103323.27406007495/8.0),
14021 REAL_CONST(103347.1797254267/8.0),
14022 REAL_CONST(103371.0867732881/8.0),
14023 REAL_CONST(103394.99520349925/8.0),
14024 REAL_CONST(103418.90501590034/8.0),
14025 REAL_CONST(103442.81621033157/8.0),
14026 REAL_CONST(103466.72878663319/8.0),
14027 REAL_CONST(103490.64274464553/8.0),
14028 REAL_CONST(103514.55808420894/8.0),
14029 REAL_CONST(103538.4748051638/8.0),
14030 REAL_CONST(103562.39290735057/8.0),
14031 REAL_CONST(103586.31239060973/8.0),
14032 REAL_CONST(103610.23325478184/8.0),
14033 REAL_CONST(103634.15549970744/8.0),
14034 REAL_CONST(103658.07912522719/8.0),
14035 REAL_CONST(103682.00413118176/8.0),
14036 REAL_CONST(103705.93051741188/8.0),
14037 REAL_CONST(103729.85828375829/8.0),
14038 REAL_CONST(103753.78743006183/8.0),
14039 REAL_CONST(103777.71795616332/8.0),
14040 REAL_CONST(103801.64986190372/8.0),
14041 REAL_CONST(103825.58314712394/8.0),
14042 REAL_CONST(103849.51781166498/8.0),
14043 REAL_CONST(103873.4538553679/8.0),
14044 REAL_CONST(103897.39127807376/8.0),
14045 REAL_CONST(103921.33007962372/8.0),
14046 REAL_CONST(103945.27025985894/8.0),
14047 REAL_CONST(103969.21181862066/8.0),
14048 REAL_CONST(103993.15475575015/8.0),
14049 REAL_CONST(104017.0990710887/8.0),
14050 REAL_CONST(104041.0447644777/8.0),
14051 REAL_CONST(104064.99183575854/8.0),
14052 REAL_CONST(104088.94028477269/8.0),
14053 REAL_CONST(104112.89011136163/8.0),
14054 REAL_CONST(104136.84131536692/8.0),
14055 REAL_CONST(104160.79389663014/8.0),
14056 REAL_CONST(104184.74785499295/8.0),
14057 REAL_CONST(104208.70319029699/8.0),
14058 REAL_CONST(104232.65990238401/8.0),
14059 REAL_CONST(104256.61799109577/8.0),
14060 REAL_CONST(104280.57745627411/8.0),
14061 REAL_CONST(104304.53829776087/8.0),
14062 REAL_CONST(104328.50051539797/8.0),
14063 REAL_CONST(104352.46410902737/8.0),
14064 REAL_CONST(104376.42907849104/8.0),
14065 REAL_CONST(104400.39542363105/8.0),
14066 REAL_CONST(104424.36314428948/8.0),
14067 REAL_CONST(104448.33224030846/8.0),
14068 REAL_CONST(104472.3027115302/8.0),
14069 REAL_CONST(104496.27455779689/8.0),
14070 REAL_CONST(104520.24777895081/8.0),
14071 REAL_CONST(104544.22237483428/8.0),
14072 REAL_CONST(104568.19834528965/8.0),
14073 REAL_CONST(104592.17569015936/8.0),
14074 REAL_CONST(104616.15440928582/8.0),
14075 REAL_CONST(104640.13450251156/8.0),
14076 REAL_CONST(104664.1159696791/8.0),
14077 REAL_CONST(104688.09881063103/8.0),
14078 REAL_CONST(104712.08302520998/8.0),
14079 REAL_CONST(104736.06861325864/8.0),
14080 REAL_CONST(104760.05557461972/8.0),
14081 REAL_CONST(104784.043909136/8.0),
14082 REAL_CONST(104808.03361665027/8.0),
14083 REAL_CONST(104832.0246970054/8.0),
14084 REAL_CONST(104856.01715004431/8.0),
14085 REAL_CONST(104880.01097560991/8.0),
14086 REAL_CONST(104904.00617354522/8.0),
14087 REAL_CONST(104928.00274369326/8.0),
14088 REAL_CONST(104952.00068589712/8.0),
14089 REAL_CONST(104975.99999999993/8.0),
14090 REAL_CONST(105000.00068584486/8.0),
14091 REAL_CONST(105024.00274327511/8.0),
14092 REAL_CONST(105048.00617213396/8.0),
14093 REAL_CONST(105072.0109722647/8.0),
14094 REAL_CONST(105096.0171435107/8.0),
14095 REAL_CONST(105120.02468571534/8.0),
14096 REAL_CONST(105144.03359872208/8.0),
14097 REAL_CONST(105168.04388237436/8.0),
14098 REAL_CONST(105192.05553651576/8.0),
14099 REAL_CONST(105216.06856098982/8.0),
14100 REAL_CONST(105240.08295564017/8.0),
14101 REAL_CONST(105264.09872031047/8.0),
14102 REAL_CONST(105288.11585484444/8.0),
14103 REAL_CONST(105312.13435908582/8.0),
14104 REAL_CONST(105336.1542328784/8.0),
14105 REAL_CONST(105360.17547606604/8.0),
14106 REAL_CONST(105384.19808849262/8.0),
14107 REAL_CONST(105408.22207000206/8.0),
14108 REAL_CONST(105432.24742043833/8.0),
14109 REAL_CONST(105456.27413964548/8.0),
14110 REAL_CONST(105480.30222746753/8.0),
14111 REAL_CONST(105504.33168374863/8.0),
14112 REAL_CONST(105528.36250833291/8.0),
14113 REAL_CONST(105552.39470106458/8.0),
14114 REAL_CONST(105576.42826178786/8.0),
14115 REAL_CONST(105600.46319034706/8.0),
14116 REAL_CONST(105624.49948658649/8.0),
14117 REAL_CONST(105648.53715035053/8.0),
14118 REAL_CONST(105672.5761814836/8.0),
14119 REAL_CONST(105696.61657983017/8.0),
14120 REAL_CONST(105720.65834523473/8.0),
14121 REAL_CONST(105744.70147754184/8.0),
14122 REAL_CONST(105768.7459765961/8.0),
14123 REAL_CONST(105792.79184224214/8.0),
14124 REAL_CONST(105816.83907432464/8.0),
14125 REAL_CONST(105840.88767268835/8.0),
14126 REAL_CONST(105864.93763717801/8.0),
14127 REAL_CONST(105888.98896763846/8.0),
14128 REAL_CONST(105913.04166391456/8.0),
14129 REAL_CONST(105937.09572585119/8.0),
14130 REAL_CONST(105961.15115329332/8.0),
14131 REAL_CONST(105985.20794608595/8.0),
14132 REAL_CONST(106009.26610407409/8.0),
14133 REAL_CONST(106033.32562710284/8.0),
14134 REAL_CONST(106057.38651501729/8.0),
14135 REAL_CONST(106081.44876766266/8.0),
14136 REAL_CONST(106105.51238488412/8.0),
14137 REAL_CONST(106129.57736652695/8.0),
14138 REAL_CONST(106153.64371243643/8.0),
14139 REAL_CONST(106177.71142245791/8.0),
14140 REAL_CONST(106201.78049643678/8.0),
14141 REAL_CONST(106225.85093421848/8.0),
14142 REAL_CONST(106249.92273564848/8.0),
14143 REAL_CONST(106273.99590057228/8.0),
14144 REAL_CONST(106298.07042883546/8.0),
14145 REAL_CONST(106322.14632028362/8.0),
14146 REAL_CONST(106346.22357476239/8.0),
14147 REAL_CONST(106370.30219211751/8.0),
14148 REAL_CONST(106394.38217219469/8.0),
14149 REAL_CONST(106418.46351483969/8.0),
14150 REAL_CONST(106442.54621989837/8.0),
14151 REAL_CONST(106466.63028721658/8.0),
14152 REAL_CONST(106490.71571664025/8.0),
14153 REAL_CONST(106514.80250801529/8.0),
14154 REAL_CONST(106538.89066118775/8.0),
14155 REAL_CONST(106562.98017600364/8.0),
14156 REAL_CONST(106587.07105230905/8.0),
14157 REAL_CONST(106611.16328995011/8.0),
14158 REAL_CONST(106635.25688877302/8.0),
14159 REAL_CONST(106659.35184862395/8.0),
14160 REAL_CONST(106683.44816934918/8.0),
14161 REAL_CONST(106707.54585079502/8.0),
14162 REAL_CONST(106731.64489280782/8.0),
14163 REAL_CONST(106755.74529523395/8.0),
14164 REAL_CONST(106779.84705791986/8.0),
14165 REAL_CONST(106803.95018071201/8.0),
14166 REAL_CONST(106828.05466345693/8.0),
14167 REAL_CONST(106852.16050600118/8.0),
14168 REAL_CONST(106876.26770819137/8.0),
14169 REAL_CONST(106900.37626987413/8.0),
14170 REAL_CONST(106924.48619089619/8.0),
14171 REAL_CONST(106948.59747110425/8.0),
14172 REAL_CONST(106972.71011034511/8.0),
14173 REAL_CONST(106996.82410846559/8.0),
14174 REAL_CONST(107020.93946531253/8.0),
14175 REAL_CONST(107045.05618073288/8.0),
14176 REAL_CONST(107069.17425457356/8.0),
14177 REAL_CONST(107093.29368668159/8.0),
14178 REAL_CONST(107117.41447690397/8.0),
14179 REAL_CONST(107141.53662508781/8.0),
14180 REAL_CONST(107165.66013108024/8.0),
14181 REAL_CONST(107189.7849947284/8.0),
14182 REAL_CONST(107213.91121587952/8.0),
14183 REAL_CONST(107238.03879438085/8.0),
14184 REAL_CONST(107262.16773007967/8.0),
14185 REAL_CONST(107286.29802282334/8.0),
14186 REAL_CONST(107310.42967245923/8.0),
14187 REAL_CONST(107334.56267883476/8.0),
14188 REAL_CONST(107358.69704179741/8.0),
14189 REAL_CONST(107382.83276119467/8.0),
14190 REAL_CONST(107406.96983687414/8.0),
14191 REAL_CONST(107431.10826868335/8.0),
14192 REAL_CONST(107455.24805646999/8.0),
14193 REAL_CONST(107479.38920008171/8.0),
14194 REAL_CONST(107503.53169936626/8.0),
14195 REAL_CONST(107527.67555417139/8.0),
14196 REAL_CONST(107551.82076434491/8.0),
14197 REAL_CONST(107575.96732973469/8.0),
14198 REAL_CONST(107600.11525018861/8.0),
14199 REAL_CONST(107624.26452555459/8.0),
14200 REAL_CONST(107648.41515568066/8.0),
14201 REAL_CONST(107672.56714041479/8.0),
14202 REAL_CONST(107696.72047960508/8.0),
14203 REAL_CONST(107720.87517309963/8.0),
14204 REAL_CONST(107745.03122074658/8.0),
14205 REAL_CONST(107769.18862239413/8.0),
14206 REAL_CONST(107793.34737789053/8.0),
14207 REAL_CONST(107817.50748708403/8.0),
14208 REAL_CONST(107841.66894982298/8.0),
14209 REAL_CONST(107865.83176595572/8.0),
14210 REAL_CONST(107889.99593533068/8.0),
14211 REAL_CONST(107914.16145779629/8.0),
14212 REAL_CONST(107938.32833320105/8.0),
14213 REAL_CONST(107962.49656139348/8.0),
14214 REAL_CONST(107986.66614222217/8.0),
14215 REAL_CONST(108010.83707553572/8.0),
14216 REAL_CONST(108035.00936118282/8.0),
14217 REAL_CONST(108059.18299901215/8.0),
14218 REAL_CONST(108083.35798887245/8.0),
14219 REAL_CONST(108107.53433061253/8.0),
14220 REAL_CONST(108131.71202408121/8.0),
14221 REAL_CONST(108155.89106912735/8.0),
14222 REAL_CONST(108180.07146559987/8.0),
14223 REAL_CONST(108204.25321334775/8.0),
14224 REAL_CONST(108228.43631221994/8.0),
14225 REAL_CONST(108252.62076206553/8.0),
14226 REAL_CONST(108276.80656273357/8.0),
14227 REAL_CONST(108300.99371407321/8.0),
14228 REAL_CONST(108325.18221593359/8.0),
14229 REAL_CONST(108349.37206816394/8.0),
14230 REAL_CONST(108373.56327061349/8.0),
14231 REAL_CONST(108397.75582313156/8.0),
14232 REAL_CONST(108421.94972556747/8.0),
14233 REAL_CONST(108446.1449777706/8.0),
14234 REAL_CONST(108470.34157959036/8.0),
14235 REAL_CONST(108494.53953087622/8.0),
14236 REAL_CONST(108518.73883147769/8.0),
14237 REAL_CONST(108542.93948124432/8.0),
14238 REAL_CONST(108567.14148002568/8.0),
14239 REAL_CONST(108591.34482767139/8.0),
14240 REAL_CONST(108615.54952403114/8.0),
14241 REAL_CONST(108639.75556895464/8.0),
14242 REAL_CONST(108663.96296229165/8.0),
14243 REAL_CONST(108688.17170389196/8.0),
14244 REAL_CONST(108712.38179360541/8.0),
14245 REAL_CONST(108736.59323128188/8.0),
14246 REAL_CONST(108760.80601677128/8.0),
14247 REAL_CONST(108785.02014992358/8.0),
14248 REAL_CONST(108809.23563058881/8.0),
14249 REAL_CONST(108833.45245861699/8.0),
14250 REAL_CONST(108857.67063385822/8.0),
14251 REAL_CONST(108881.89015616261/8.0),
14252 REAL_CONST(108906.11102538036/8.0),
14253 REAL_CONST(108930.33324136167/8.0),
14254 REAL_CONST(108954.55680395682/8.0),
14255 REAL_CONST(108978.78171301607/8.0),
14256 REAL_CONST(109003.00796838976/8.0),
14257 REAL_CONST(109027.23556992831/8.0),
14258 REAL_CONST(109051.46451748211/8.0),
14259 REAL_CONST(109075.69481090162/8.0),
14260 REAL_CONST(109099.92645003737/8.0),
14261 REAL_CONST(109124.15943473989/8.0),
14262 REAL_CONST(109148.39376485976/8.0),
14263 REAL_CONST(109172.62944024763/8.0),
14264 REAL_CONST(109196.86646075416/8.0),
14265 REAL_CONST(109221.10482623006/8.0),
14266 REAL_CONST(109245.34453652608/8.0),
14267 REAL_CONST(109269.58559149304/8.0),
14268 REAL_CONST(109293.82799098175/8.0),
14269 REAL_CONST(109318.07173484311/8.0),
14270 REAL_CONST(109342.31682292801/8.0),
14271 REAL_CONST(109366.56325508743/8.0),
14272 REAL_CONST(109390.81103117237/8.0),
14273 REAL_CONST(109415.06015103387/8.0),
14274 REAL_CONST(109439.31061452301/8.0),
14275 REAL_CONST(109463.56242149093/8.0),
14276 REAL_CONST(109487.8155717888/8.0),
14277 REAL_CONST(109512.07006526781/8.0),
14278 REAL_CONST(109536.3259017792/8.0),
14279 REAL_CONST(109560.58308117429/8.0),
14280 REAL_CONST(109584.8416033044/8.0),
14281 REAL_CONST(109609.1014680209/8.0),
14282 REAL_CONST(109633.36267517522/8.0),
14283 REAL_CONST(109657.62522461878/8.0),
14284 REAL_CONST(109681.88911620311/8.0),
14285 REAL_CONST(109706.15434977971/8.0),
14286 REAL_CONST(109730.4209252002/8.0),
14287 REAL_CONST(109754.68884231619/8.0),
14288 REAL_CONST(109778.95810097932/8.0),
14289 REAL_CONST(109803.22870104131/8.0),
14290 REAL_CONST(109827.50064235389/8.0),
14291 REAL_CONST(109851.77392476884/8.0),
14292 REAL_CONST(109876.04854813802/8.0),
14293 REAL_CONST(109900.32451231324/8.0),
14294 REAL_CONST(109924.60181714644/8.0),
14295 REAL_CONST(109948.88046248957/8.0),
14296 REAL_CONST(109973.1604481946/8.0),
14297 REAL_CONST(109997.44177411357/8.0),
14298 REAL_CONST(110021.72444009855/8.0),
14299 REAL_CONST(110046.00844600165/8.0),
14300 REAL_CONST(110070.29379167501/8.0),
14301 REAL_CONST(110094.58047697082/8.0),
14302 REAL_CONST(110118.86850174134/8.0),
14303 REAL_CONST(110143.15786583882/8.0),
14304 REAL_CONST(110167.44856911557/8.0),
14305 REAL_CONST(110191.74061142397/8.0),
14306 REAL_CONST(110216.03399261639/8.0),
14307 REAL_CONST(110240.32871254528/8.0),
14308 REAL_CONST(110264.62477106311/8.0),
14309 REAL_CONST(110288.9221680224/8.0),
14310 REAL_CONST(110313.22090327571/8.0),
14311 REAL_CONST(110337.52097667565/8.0),
14312 REAL_CONST(110361.82238807483/8.0),
14313 REAL_CONST(110386.12513732594/8.0),
14314 REAL_CONST(110410.42922428172/8.0),
14315 REAL_CONST(110434.73464879491/8.0),
14316 REAL_CONST(110459.04141071832/8.0),
14317 REAL_CONST(110483.34950990479/8.0),
14318 REAL_CONST(110507.6589462072/8.0),
14319 REAL_CONST(110531.96971947847/8.0),
14320 REAL_CONST(110556.28182957157/8.0),
14321 REAL_CONST(110580.5952763395/8.0),
14322 REAL_CONST(110604.91005963532/8.0),
14323 REAL_CONST(110629.22617931209/8.0),
14324 REAL_CONST(110653.54363522294/8.0),
14325 REAL_CONST(110677.86242722106/8.0),
14326 REAL_CONST(110702.18255515963/8.0),
14327 REAL_CONST(110726.50401889188/8.0),
14328 REAL_CONST(110750.82681827113/8.0),
14329 REAL_CONST(110775.1509531507/8.0),
14330 REAL_CONST(110799.47642338395/8.0),
14331 REAL_CONST(110823.80322882428/8.0),
14332 REAL_CONST(110848.13136932514/8.0),
14333 REAL_CONST(110872.46084474004/8.0),
14334 REAL_CONST(110896.79165492248/8.0),
14335 REAL_CONST(110921.12379972603/8.0),
14336 REAL_CONST(110945.4572790043/8.0),
14337 REAL_CONST(110969.79209261097/8.0),
14338 REAL_CONST(110994.12824039967/8.0),
14339 REAL_CONST(111018.46572222417/8.0),
14340 REAL_CONST(111042.80453793822/8.0),
14341 REAL_CONST(111067.14468739564/8.0),
14342 REAL_CONST(111091.48617045028/8.0),
14343 REAL_CONST(111115.82898695602/8.0),
14344 REAL_CONST(111140.1731367668/8.0),
14345 REAL_CONST(111164.51861973655/8.0),
14346 REAL_CONST(111188.86543571933/8.0),
14347 REAL_CONST(111213.21358456917/8.0),
14348 REAL_CONST(111237.56306614014/8.0),
14349 REAL_CONST(111261.91388028639/8.0),
14350 REAL_CONST(111286.26602686207/8.0),
14351 REAL_CONST(111310.61950572141/8.0),
14352 REAL_CONST(111334.97431671864/8.0),
14353 REAL_CONST(111359.33045970804/8.0),
14354 REAL_CONST(111383.68793454397/8.0),
14355 REAL_CONST(111408.04674108078/8.0),
14356 REAL_CONST(111432.40687917286/8.0),
14357 REAL_CONST(111456.76834867468/8.0),
14358 REAL_CONST(111481.13114944073/8.0),
14359 REAL_CONST(111505.49528132551/8.0),
14360 REAL_CONST(111529.86074418361/8.0),
14361 REAL_CONST(111554.22753786964/8.0),
14362 REAL_CONST(111578.59566223821/8.0),
14363 REAL_CONST(111602.96511714405/8.0),
14364 REAL_CONST(111627.33590244185/8.0),
14365 REAL_CONST(111651.7080179864/8.0),
14366 REAL_CONST(111676.08146363248/8.0),
14367 REAL_CONST(111700.45623923496/8.0),
14368 REAL_CONST(111724.8323446487/8.0),
14369 REAL_CONST(111749.20977972864/8.0),
14370 REAL_CONST(111773.58854432974/8.0),
14371 REAL_CONST(111797.96863830699/8.0),
14372 REAL_CONST(111822.35006151545/8.0),
14373 REAL_CONST(111846.73281381019/8.0),
14374 REAL_CONST(111871.11689504632/8.0),
14375 REAL_CONST(111895.50230507903/8.0),
14376 REAL_CONST(111919.8890437635/8.0),
14377 REAL_CONST(111944.27711095495/8.0),
14378 REAL_CONST(111968.6665065087/8.0),
14379 REAL_CONST(111993.05723028004/8.0),
14380 REAL_CONST(112017.44928212435/8.0),
14381 REAL_CONST(112041.842661897/8.0),
14382 REAL_CONST(112066.23736945343/8.0),
14383 REAL_CONST(112090.63340464912/8.0),
14384 REAL_CONST(112115.03076733962/8.0),
14385 REAL_CONST(112139.42945738042/8.0),
14386 REAL_CONST(112163.82947462716/8.0),
14387 REAL_CONST(112188.23081893545/8.0),
14388 REAL_CONST(112212.63349016097/8.0),
14389 REAL_CONST(112237.03748815943/8.0),
14390 REAL_CONST(112261.44281278658/8.0),
14391 REAL_CONST(112285.84946389822/8.0),
14392 REAL_CONST(112310.25744135017/8.0),
14393 REAL_CONST(112334.66674499828/8.0),
14394 REAL_CONST(112359.07737469849/8.0),
14395 REAL_CONST(112383.48933030672/8.0),
14396 REAL_CONST(112407.90261167898/8.0),
14397 REAL_CONST(112432.31721867126/8.0),
14398 REAL_CONST(112456.73315113965/8.0),
14399 REAL_CONST(112481.15040894024/8.0),
14400 REAL_CONST(112505.56899192919/8.0),
14401 REAL_CONST(112529.98889996267/8.0),
14402 REAL_CONST(112554.41013289688/8.0),
14403 REAL_CONST(112578.8326905881/8.0),
14404 REAL_CONST(112603.25657289263/8.0),
14405 REAL_CONST(112627.68177966679/8.0),
14406 REAL_CONST(112652.10831076698/8.0),
14407 REAL_CONST(112676.53616604958/8.0),
14408 REAL_CONST(112700.96534537108/8.0),
14409 REAL_CONST(112725.39584858794/8.0),
14410 REAL_CONST(112749.82767555672/8.0),
14411 REAL_CONST(112774.26082613398/8.0),
14412 REAL_CONST(112798.6953001763/8.0),
14413 REAL_CONST(112823.13109754038/8.0),
14414 REAL_CONST(112847.56821808286/8.0),
14415 REAL_CONST(112872.00666166049/8.0),
14416 REAL_CONST(112896.44642813003/8.0),
14417 REAL_CONST(112920.88751734827/8.0),
14418 REAL_CONST(112945.32992917208/8.0),
14419 REAL_CONST(112969.77366345831/8.0),
14420 REAL_CONST(112994.21872006389/8.0),
14421 REAL_CONST(113018.66509884578/8.0),
14422 REAL_CONST(113043.11279966099/8.0),
14423 REAL_CONST(113067.56182236652/8.0),
14424 REAL_CONST(113092.01216681948/8.0),
14425 REAL_CONST(113116.46383287695/8.0),
14426 REAL_CONST(113140.9168203961/8.0),
14427 REAL_CONST(113165.37112923413/8.0),
14428 REAL_CONST(113189.82675924824/8.0),
14429 REAL_CONST(113214.28371029573/8.0),
14430 REAL_CONST(113238.74198223387/8.0),
14431 REAL_CONST(113263.20157492002/8.0),
14432 REAL_CONST(113287.66248821157/8.0),
14433 REAL_CONST(113312.12472196593/8.0),
14434 REAL_CONST(113336.58827604055/8.0),
14435 REAL_CONST(113361.05315029295/8.0),
14436 REAL_CONST(113385.51934458067/8.0),
14437 REAL_CONST(113409.98685876124/8.0),
14438 REAL_CONST(113434.45569269233/8.0),
14439 REAL_CONST(113458.92584623155/8.0),
14440 REAL_CONST(113483.39731923661/8.0),
14441 REAL_CONST(113507.87011156522/8.0),
14442 REAL_CONST(113532.34422307517/8.0),
14443 REAL_CONST(113556.81965362425/8.0),
14444 REAL_CONST(113581.2964030703/8.0),
14445 REAL_CONST(113605.77447127122/8.0),
14446 REAL_CONST(113630.25385808491/8.0),
14447 REAL_CONST(113654.73456336933/8.0),
14448 REAL_CONST(113679.2165869825/8.0),
14449 REAL_CONST(113703.69992878241/8.0),
14450 REAL_CONST(113728.18458862718/8.0),
14451 REAL_CONST(113752.67056637487/8.0),
14452 REAL_CONST(113777.15786188368/8.0),
14453 REAL_CONST(113801.64647501177/8.0),
14454 REAL_CONST(113826.13640561736/8.0),
14455 REAL_CONST(113850.62765355874/8.0),
14456 REAL_CONST(113875.12021869418/8.0),
14457 REAL_CONST(113899.61410088204/8.0),
14458 REAL_CONST(113924.1092999807/8.0),
14459 REAL_CONST(113948.60581584855/8.0),
14460 REAL_CONST(113973.10364834407/8.0),
14461 REAL_CONST(113997.60279732574/8.0),
14462 REAL_CONST(114022.1032626521/8.0),
14463 REAL_CONST(114046.60504418171/8.0),
14464 REAL_CONST(114071.10814177318/8.0),
14465 REAL_CONST(114095.61255528514/8.0),
14466 REAL_CONST(114120.11828457628/8.0),
14467 REAL_CONST(114144.62532950533/8.0),
14468 REAL_CONST(114169.13368993104/8.0),
14469 REAL_CONST(114193.6433657122/8.0),
14470 REAL_CONST(114218.15435670764/8.0),
14471 REAL_CONST(114242.66666277625/8.0),
14472 REAL_CONST(114267.18028377694/8.0),
14473 REAL_CONST(114291.69521956862/8.0),
14474 REAL_CONST(114316.21147001031/8.0),
14475 REAL_CONST(114340.72903496103/8.0),
14476 REAL_CONST(114365.24791427983/8.0),
14477 REAL_CONST(114389.7681078258/8.0),
14478 REAL_CONST(114414.2896154581/8.0),
14479 REAL_CONST(114438.81243703589/8.0),
14480 REAL_CONST(114463.33657241837/8.0),
14481 REAL_CONST(114487.8620214648/8.0),
14482 REAL_CONST(114512.38878403447/8.0),
14483 REAL_CONST(114536.91685998671/8.0),
14484 REAL_CONST(114561.44624918087/8.0),
14485 REAL_CONST(114585.97695147636/8.0),
14486 REAL_CONST(114610.5089667326/8.0),
14487 REAL_CONST(114635.04229480909/8.0),
14488 REAL_CONST(114659.57693556532/8.0),
14489 REAL_CONST(114684.11288886084/8.0),
14490 REAL_CONST(114708.65015455526/8.0),
14491 REAL_CONST(114733.18873250818/8.0),
14492 REAL_CONST(114757.72862257928/8.0),
14493 REAL_CONST(114782.26982462825/8.0),
14494 REAL_CONST(114806.81233851484/8.0),
14495 REAL_CONST(114831.35616409882/8.0),
14496 REAL_CONST(114855.90130123998/8.0),
14497 REAL_CONST(114880.44774979822/8.0),
14498 REAL_CONST(114904.99550963337/8.0),
14499 REAL_CONST(114929.5445806054/8.0),
14500 REAL_CONST(114954.09496257425/8.0),
14501 REAL_CONST(114978.64665539992/8.0),
14502 REAL_CONST(115003.19965894247/8.0),
14503 REAL_CONST(115027.75397306195/8.0),
14504 REAL_CONST(115052.30959761847/8.0),
14505 REAL_CONST(115076.86653247218/8.0),
14506 REAL_CONST(115101.42477748329/8.0),
14507 REAL_CONST(115125.984332512/8.0),
14508 REAL_CONST(115150.54519741859/8.0),
14509 REAL_CONST(115175.10737206334/8.0),
14510 REAL_CONST(115199.67085630659/8.0),
14511 REAL_CONST(115224.23565000873/8.0),
14512 REAL_CONST(115248.80175303014/8.0),
14513 REAL_CONST(115273.3691652313/8.0),
14514 REAL_CONST(115297.93788647266/8.0),
14515 REAL_CONST(115322.50791661476/8.0),
14516 REAL_CONST(115347.07925551817/8.0),
14517 REAL_CONST(115371.65190304347/8.0),
14518 REAL_CONST(115396.22585905129/8.0),
14519 REAL_CONST(115420.80112340231/8.0),
14520 REAL_CONST(115445.37769595724/8.0),
14521 REAL_CONST(115469.95557657682/8.0),
14522 REAL_CONST(115494.53476512182/8.0),
14523 REAL_CONST(115519.11526145306/8.0),
14524 REAL_CONST(115543.69706543141/8.0),
14525 REAL_CONST(115568.28017691776/8.0),
14526 REAL_CONST(115592.86459577303/8.0),
14527 REAL_CONST(115617.4503218582/8.0),
14528 REAL_CONST(115642.03735503425/8.0),
14529 REAL_CONST(115666.62569516223/8.0),
14530 REAL_CONST(115691.21534210323/8.0),
14531 REAL_CONST(115715.80629571836/8.0),
14532 REAL_CONST(115740.39855586876/8.0),
14533 REAL_CONST(115764.99212241563/8.0),
14534 REAL_CONST(115789.58699522018/8.0),
14535 REAL_CONST(115814.18317414368/8.0),
14536 REAL_CONST(115838.78065904744/8.0),
14537 REAL_CONST(115863.37944979276/8.0),
14538 REAL_CONST(115887.97954624105/8.0),
14539 REAL_CONST(115912.5809482537/8.0),
14540 REAL_CONST(115937.18365569216/8.0),
14541 REAL_CONST(115961.78766841792/8.0),
14542 REAL_CONST(115986.39298629249/8.0),
14543 REAL_CONST(116010.99960917742/8.0),
14544 REAL_CONST(116035.60753693432/8.0),
14545 REAL_CONST(116060.21676942479/8.0),
14546 REAL_CONST(116084.82730651053/8.0),
14547 REAL_CONST(116109.43914805322/8.0),
14548 REAL_CONST(116134.0522939146/8.0),
14549 REAL_CONST(116158.66674395646/8.0),
14550 REAL_CONST(116183.2824980406/8.0),
14551 REAL_CONST(116207.89955602887/8.0),
14552 REAL_CONST(116232.51791778316/8.0),
14553 REAL_CONST(116257.13758316539/8.0),
14554 REAL_CONST(116281.75855203751/8.0),
14555 REAL_CONST(116306.38082426153/8.0),
14556 REAL_CONST(116331.00439969949/8.0),
14557 REAL_CONST(116355.62927821343/8.0),
14558 REAL_CONST(116380.25545966547/8.0),
14559 REAL_CONST(116404.88294391775/8.0),
14560 REAL_CONST(116429.51173083246/8.0),
14561 REAL_CONST(116454.14182027178/8.0),
14562 REAL_CONST(116478.77321209799/8.0),
14563 REAL_CONST(116503.40590617337/8.0),
14564 REAL_CONST(116528.03990236025/8.0),
14565 REAL_CONST(116552.67520052097/8.0),
14566 REAL_CONST(116577.31180051794/8.0),
14567 REAL_CONST(116601.94970221359/8.0),
14568 REAL_CONST(116626.5889054704/8.0),
14569 REAL_CONST(116651.22941015086/8.0),
14570 REAL_CONST(116675.87121611751/8.0),
14571 REAL_CONST(116700.51432323294/8.0),
14572 REAL_CONST(116725.15873135976/8.0),
14573 REAL_CONST(116749.8044403606/8.0),
14574 REAL_CONST(116774.45145009817/8.0),
14575 REAL_CONST(116799.0997604352/8.0),
14576 REAL_CONST(116823.74937123443/8.0),
14577 REAL_CONST(116848.40028235866/8.0),
14578 REAL_CONST(116873.05249367072/8.0),
14579 REAL_CONST(116897.70600503348/8.0),
14580 REAL_CONST(116922.36081630984/8.0),
14581 REAL_CONST(116947.01692736275/8.0),
14582 REAL_CONST(116971.67433805518/8.0),
14583 REAL_CONST(116996.33304825013/8.0),
14584 REAL_CONST(117020.99305781067/8.0),
14585 REAL_CONST(117045.65436659988/8.0),
14586 REAL_CONST(117070.31697448085/8.0),
14587 REAL_CONST(117094.98088131678/8.0),
14588 REAL_CONST(117119.64608697082/8.0),
14589 REAL_CONST(117144.31259130624/8.0),
14590 REAL_CONST(117168.98039418629/8.0),
14591 REAL_CONST(117193.64949547425/8.0),
14592 REAL_CONST(117218.31989503348/8.0),
14593 REAL_CONST(117242.99159272734/8.0),
14594 REAL_CONST(117267.66458841923/8.0),
14595 REAL_CONST(117292.33888197262/8.0),
14596 REAL_CONST(117317.01447325097/8.0),
14597 REAL_CONST(117341.6913621178/8.0),
14598 REAL_CONST(117366.36954843666/8.0),
14599 REAL_CONST(117391.04903207115/8.0),
14600 REAL_CONST(117415.72981288488/8.0),
14601 REAL_CONST(117440.41189074152/8.0),
14602 REAL_CONST(117465.09526550474/8.0),
14603 REAL_CONST(117489.77993703831/8.0),
14604 REAL_CONST(117514.46590520597/8.0),
14605 REAL_CONST(117539.15316987153/8.0),
14606 REAL_CONST(117563.84173089883/8.0),
14607 REAL_CONST(117588.53158815173/8.0),
14608 REAL_CONST(117613.22274149416/8.0),
14609 REAL_CONST(117637.91519079007/8.0),
14610 REAL_CONST(117662.60893590341/8.0),
14611 REAL_CONST(117687.30397669821/8.0),
14612 REAL_CONST(117712.00031303853/8.0),
14613 REAL_CONST(117736.69794478847/8.0),
14614 REAL_CONST(117761.39687181212/8.0),
14615 REAL_CONST(117786.09709397367/8.0),
14616 REAL_CONST(117810.7986111373/8.0),
14617 REAL_CONST(117835.50142316725/8.0),
14618 REAL_CONST(117860.20552992777/8.0),
14619 REAL_CONST(117884.91093128319/8.0),
14620 REAL_CONST(117909.6176270978/8.0),
14621 REAL_CONST(117934.32561723603/8.0),
14622 REAL_CONST(117959.03490156225/8.0),
14623 REAL_CONST(117983.74547994092/8.0),
14624 REAL_CONST(118008.45735223651/8.0),
14625 REAL_CONST(118033.17051831353/8.0),
14626 REAL_CONST(118057.88497803656/8.0),
14627 REAL_CONST(118082.60073127014/8.0),
14628 REAL_CONST(118107.31777787894/8.0),
14629 REAL_CONST(118132.03611772758/8.0),
14630 REAL_CONST(118156.75575068076/8.0),
14631 REAL_CONST(118181.47667660323/8.0),
14632 REAL_CONST(118206.19889535972/8.0),
14633 REAL_CONST(118230.92240681504/8.0),
14634 REAL_CONST(118255.64721083404/8.0),
14635 REAL_CONST(118280.37330728157/8.0),
14636 REAL_CONST(118305.10069602253/8.0),
14637 REAL_CONST(118329.82937692189/8.0),
14638 REAL_CONST(118354.55934984458/8.0),
14639 REAL_CONST(118379.29061465565/8.0),
14640 REAL_CONST(118404.02317122012/8.0),
14641 REAL_CONST(118428.75701940308/8.0),
14642 REAL_CONST(118453.49215906965/8.0),
14643 REAL_CONST(118478.22859008498/8.0),
14644 REAL_CONST(118502.96631231424/8.0),
14645 REAL_CONST(118527.70532562268/8.0),
14646 REAL_CONST(118552.44562987552/8.0),
14647 REAL_CONST(118577.18722493808/8.0),
14648 REAL_CONST(118601.93011067568/8.0),
14649 REAL_CONST(118626.67428695368/8.0),
14650 REAL_CONST(118651.41975363747/8.0),
14651 REAL_CONST(118676.16651059251/8.0),
14652 REAL_CONST(118700.91455768423/8.0),
14653 REAL_CONST(118725.66389477813/8.0),
14654 REAL_CONST(118750.41452173979/8.0),
14655 REAL_CONST(118775.16643843475/8.0),
14656 REAL_CONST(118799.91964472862/8.0),
14657 REAL_CONST(118824.67414048707/8.0),
14658 REAL_CONST(118849.42992557574/8.0),
14659 REAL_CONST(118874.18699986035/8.0),
14660 REAL_CONST(118898.94536320666/8.0),
14661 REAL_CONST(118923.70501548045/8.0),
14662 REAL_CONST(118948.46595654752/8.0),
14663 REAL_CONST(118973.22818627374/8.0),
14664 REAL_CONST(118997.99170452499/8.0),
14665 REAL_CONST(119022.7565111672/8.0),
14666 REAL_CONST(119047.52260606633/8.0),
14667 REAL_CONST(119072.28998908834/8.0),
14668 REAL_CONST(119097.0586600993/8.0),
14669 REAL_CONST(119121.82861896523/8.0),
14670 REAL_CONST(119146.59986555226/8.0),
14671 REAL_CONST(119171.3723997265/8.0),
14672 REAL_CONST(119196.14622135412/8.0),
14673 REAL_CONST(119220.92133030134/8.0),
14674 REAL_CONST(119245.69772643436/8.0),
14675 REAL_CONST(119270.47540961947/8.0),
14676 REAL_CONST(119295.25437972297/8.0),
14677 REAL_CONST(119320.03463661121/8.0),
14678 REAL_CONST(119344.81618015055/8.0),
14679 REAL_CONST(119369.5990102074/8.0),
14680 REAL_CONST(119394.38312664822/8.0),
14681 REAL_CONST(119419.16852933947/8.0),
14682 REAL_CONST(119443.95521814766/8.0),
14683 REAL_CONST(119468.74319293935/8.0),
14684 REAL_CONST(119493.53245358112/8.0),
14685 REAL_CONST(119518.32299993958/8.0),
14686 REAL_CONST(119543.11483188139/8.0),
14687 REAL_CONST(119567.90794927324/8.0),
14688 REAL_CONST(119592.70235198183/8.0),
14689 REAL_CONST(119617.49803987393/8.0),
14690 REAL_CONST(119642.29501281632/8.0),
14691 REAL_CONST(119667.09327067583/8.0),
14692 REAL_CONST(119691.89281331931/8.0),
14693 REAL_CONST(119716.69364061367/8.0),
14694 REAL_CONST(119741.49575242582/8.0),
14695 REAL_CONST(119766.29914862274/8.0),
14696 REAL_CONST(119791.10382907141/8.0),
14697 REAL_CONST(119815.90979363887/8.0),
14698 REAL_CONST(119840.71704219218/8.0),
14699 REAL_CONST(119865.52557459843/8.0),
14700 REAL_CONST(119890.33539072477/8.0),
14701 REAL_CONST(119915.14649043836/8.0),
14702 REAL_CONST(119939.95887360642/8.0),
14703 REAL_CONST(119964.77254009615/8.0),
14704 REAL_CONST(119989.58748977486/8.0),
14705 REAL_CONST(120014.40372250983/8.0),
14706 REAL_CONST(120039.22123816841/8.0),
14707 REAL_CONST(120064.04003661797/8.0),
14708 REAL_CONST(120088.86011772591/8.0),
14709 REAL_CONST(120113.6814813597/8.0),
14710 REAL_CONST(120138.5041273868/8.0),
14711 REAL_CONST(120163.3280556747/8.0),
14712 REAL_CONST(120188.15326609099/8.0),
14713 REAL_CONST(120212.97975850321/8.0),
14714 REAL_CONST(120237.807532779/8.0),
14715 REAL_CONST(120262.63658878599/8.0),
14716 REAL_CONST(120287.46692639188/8.0),
14717 REAL_CONST(120312.29854546436/8.0),
14718 REAL_CONST(120337.13144587121/8.0),
14719 REAL_CONST(120361.9656274802/8.0),
14720 REAL_CONST(120386.80109015915/8.0),
14721 REAL_CONST(120411.63783377589/8.0),
14722 REAL_CONST(120436.47585819835/8.0),
14723 REAL_CONST(120461.31516329442/8.0),
14724 REAL_CONST(120486.15574893207/8.0),
14725 REAL_CONST(120510.99761497928/8.0),
14726 REAL_CONST(120535.84076130406/8.0),
14727 REAL_CONST(120560.68518777451/8.0),
14728 REAL_CONST(120585.53089425867/8.0),
14729 REAL_CONST(120610.3778806247/8.0),
14730 REAL_CONST(120635.22614674074/8.0),
14731 REAL_CONST(120660.07569247499/8.0),
14732 REAL_CONST(120684.92651769568/8.0),
14733 REAL_CONST(120709.77862227106/8.0),
14734 REAL_CONST(120734.63200606944/8.0),
14735 REAL_CONST(120759.48666895913/8.0),
14736 REAL_CONST(120784.3426108085/8.0),
14737 REAL_CONST(120809.19983148595/8.0),
14738 REAL_CONST(120834.05833085992/8.0),
14739 REAL_CONST(120858.91810879884/8.0),
14740 REAL_CONST(120883.77916517125/8.0),
14741 REAL_CONST(120908.64149984565/8.0),
14742 REAL_CONST(120933.5051126906/8.0),
14743 REAL_CONST(120958.37000357473/8.0),
14744 REAL_CONST(120983.23617236665/8.0),
14745 REAL_CONST(121008.10361893504/8.0),
14746 REAL_CONST(121032.97234314861/8.0),
14747 REAL_CONST(121057.84234487606/8.0),
14748 REAL_CONST(121082.71362398617/8.0),
14749 REAL_CONST(121107.58618034775/8.0),
14750 REAL_CONST(121132.46001382964/8.0),
14751 REAL_CONST(121157.33512430069/8.0),
14752 REAL_CONST(121182.21151162982/8.0),
14753 REAL_CONST(121207.08917568595/8.0),
14754 REAL_CONST(121231.96811633807/8.0),
14755 REAL_CONST(121256.84833345517/8.0),
14756 REAL_CONST(121281.72982690629/8.0),
14757 REAL_CONST(121306.61259656049/8.0),
14758 REAL_CONST(121331.49664228689/8.0),
14759 REAL_CONST(121356.38196395461/8.0),
14760 REAL_CONST(121381.26856143285/8.0),
14761 REAL_CONST(121406.15643459078/8.0),
14762 REAL_CONST(121431.04558329767/8.0),
14763 REAL_CONST(121455.93600742276/8.0),
14764 REAL_CONST(121480.82770683538/8.0),
14765 REAL_CONST(121505.72068140487/8.0),
14766 REAL_CONST(121530.61493100057/8.0),
14767 REAL_CONST(121555.51045549192/8.0),
14768 REAL_CONST(121580.40725474835/8.0),
14769 REAL_CONST(121605.30532863933/8.0),
14770 REAL_CONST(121630.20467703436/8.0),
14771 REAL_CONST(121655.10529980299/8.0),
14772 REAL_CONST(121680.00719681478/8.0),
14773 REAL_CONST(121704.91036793934/8.0),
14774 REAL_CONST(121729.81481304632/8.0),
14775 REAL_CONST(121754.72053200539/8.0),
14776 REAL_CONST(121779.62752468624/8.0),
14777 REAL_CONST(121804.53579095862/8.0),
14778 REAL_CONST(121829.44533069231/8.0),
14779 REAL_CONST(121854.3561437571/8.0),
14780 REAL_CONST(121879.26823002285/8.0),
14781 REAL_CONST(121904.1815893594/8.0),
14782 REAL_CONST(121929.09622163669/8.0),
14783 REAL_CONST(121954.01212672464/8.0),
14784 REAL_CONST(121978.92930449323/8.0),
14785 REAL_CONST(122003.84775481246/8.0),
14786 REAL_CONST(122028.76747755238/8.0),
14787 REAL_CONST(122053.68847258303/8.0),
14788 REAL_CONST(122078.61073977455/8.0),
14789 REAL_CONST(122103.53427899707/8.0),
14790 REAL_CONST(122128.45909012076/8.0),
14791 REAL_CONST(122153.38517301581/8.0),
14792 REAL_CONST(122178.31252755247/8.0),
14793 REAL_CONST(122203.24115360099/8.0),
14794 REAL_CONST(122228.17105103172/8.0),
14795 REAL_CONST(122253.10221971494/8.0),
14796 REAL_CONST(122278.03465952107/8.0),
14797 REAL_CONST(122302.96837032049/8.0),
14798 REAL_CONST(122327.90335198362/8.0),
14799 REAL_CONST(122352.83960438096/8.0),
14800 REAL_CONST(122377.777127383/8.0),
14801 REAL_CONST(122402.71592086025/8.0),
14802 REAL_CONST(122427.65598468333/8.0),
14803 REAL_CONST(122452.59731872278/8.0),
14804 REAL_CONST(122477.53992284928/8.0),
14805 REAL_CONST(122502.48379693348/8.0),
14806 REAL_CONST(122527.42894084606/8.0),
14807 REAL_CONST(122552.37535445779/8.0),
14808 REAL_CONST(122577.32303763942/8.0),
14809 REAL_CONST(122602.27199026172/8.0),
14810 REAL_CONST(122627.22221219557/8.0),
14811 REAL_CONST(122652.17370331181/8.0),
14812 REAL_CONST(122677.12646348133/8.0),
14813 REAL_CONST(122702.08049257506/8.0),
14814 REAL_CONST(122727.03579046397/8.0),
14815 REAL_CONST(122751.99235701906/8.0),
14816 REAL_CONST(122776.95019211136/8.0),
14817 REAL_CONST(122801.9092956119/8.0),
14818 REAL_CONST(122826.8696673918/8.0),
14819 REAL_CONST(122851.83130732219/8.0),
14820 REAL_CONST(122876.79421527422/8.0),
14821 REAL_CONST(122901.75839111909/8.0),
14822 REAL_CONST(122926.72383472799/8.0),
14823 REAL_CONST(122951.69054597223/8.0),
14824 REAL_CONST(122976.65852472307/8.0),
14825 REAL_CONST(123001.62777085182/8.0),
14826 REAL_CONST(123026.59828422987/8.0),
14827 REAL_CONST(123051.57006472857/8.0),
14828 REAL_CONST(123076.54311221937/8.0),
14829 REAL_CONST(123101.5174265737/8.0),
14830 REAL_CONST(123126.49300766307/8.0),
14831 REAL_CONST(123151.46985535898/8.0),
14832 REAL_CONST(123176.44796953299/8.0),
14833 REAL_CONST(123201.42735005668/8.0),
14834 REAL_CONST(123226.40799680166/8.0),
14835 REAL_CONST(123251.38990963959/8.0),
14836 REAL_CONST(123276.37308844214/8.0),
14837 REAL_CONST(123301.35753308103/8.0),
14838 REAL_CONST(123326.343243428/8.0),
14839 REAL_CONST(123351.33021935483/8.0),
14840 REAL_CONST(123376.31846073334/8.0),
14841 REAL_CONST(123401.30796743535/8.0),
14842 REAL_CONST(123426.29873933276/8.0),
14843 REAL_CONST(123451.29077629748/8.0),
14844 REAL_CONST(123476.28407820144/8.0),
14845 REAL_CONST(123501.2786449166/8.0),
14846 REAL_CONST(123526.27447631498/8.0),
14847 REAL_CONST(123551.27157226863/8.0),
14848 REAL_CONST(123576.26993264959/8.0),
14849 REAL_CONST(123601.26955732999/8.0),
14850 REAL_CONST(123626.27044618195/8.0),
14851 REAL_CONST(123651.27259907764/8.0),
14852 REAL_CONST(123676.27601588926/8.0),
14853 REAL_CONST(123701.28069648903/8.0),
14854 REAL_CONST(123726.28664074924/8.0),
14855 REAL_CONST(123751.29384854218/8.0),
14856 REAL_CONST(123776.30231974016/8.0),
14857 REAL_CONST(123801.31205421555/8.0),
14858 REAL_CONST(123826.32305184075/8.0),
14859 REAL_CONST(123851.33531248817/8.0),
14860 REAL_CONST(123876.34883603029/8.0),
14861 REAL_CONST(123901.36362233957/8.0),
14862 REAL_CONST(123926.37967128855/8.0),
14863 REAL_CONST(123951.39698274979/8.0),
14864 REAL_CONST(123976.41555659588/8.0),
14865 REAL_CONST(124001.43539269941/8.0),
14866 REAL_CONST(124026.45649093305/8.0),
14867 REAL_CONST(124051.47885116948/8.0),
14868 REAL_CONST(124076.50247328142/8.0),
14869 REAL_CONST(124101.5273571416/8.0),
14870 REAL_CONST(124126.55350262282/8.0),
14871 REAL_CONST(124151.58090959788/8.0),
14872 REAL_CONST(124176.60957793961/8.0),
14873 REAL_CONST(124201.63950752091/8.0),
14874 REAL_CONST(124226.67069821467/8.0),
14875 REAL_CONST(124251.70314989384/8.0),
14876 REAL_CONST(124276.73686243138/8.0),
14877 REAL_CONST(124301.7718357003/8.0),
14878 REAL_CONST(124326.80806957364/8.0),
14879 REAL_CONST(124351.84556392446/8.0),
14880 REAL_CONST(124376.88431862585/8.0),
14881 REAL_CONST(124401.92433355095/8.0),
14882 REAL_CONST(124426.96560857294/8.0),
14883 REAL_CONST(124452.00814356498/8.0),
14884 REAL_CONST(124477.05193840031/8.0),
14885 REAL_CONST(124502.0969929522/8.0),
14886 REAL_CONST(124527.14330709392/8.0),
14887 REAL_CONST(124552.19088069882/8.0),
14888 REAL_CONST(124577.23971364023/8.0),
14889 REAL_CONST(124602.28980579154/8.0),
14890 REAL_CONST(124627.34115702618/8.0),
14891 REAL_CONST(124652.3937672176/8.0),
14892 REAL_CONST(124677.44763623926/8.0),
14893 REAL_CONST(124702.50276396469/8.0),
14894 REAL_CONST(124727.55915026742/8.0),
14895 REAL_CONST(124752.61679502104/8.0),
14896 REAL_CONST(124777.67569809916/8.0),
14897 REAL_CONST(124802.73585937542/8.0),
14898 REAL_CONST(124827.79727872348/8.0),
14899 REAL_CONST(124852.85995601704/8.0),
14900 REAL_CONST(124877.92389112986/8.0),
14901 REAL_CONST(124902.98908393568/8.0),
14902 REAL_CONST(124928.05553430831/8.0),
14903 REAL_CONST(124953.1232421216/8.0),
14904 REAL_CONST(124978.19220724938/8.0),
14905 REAL_CONST(125003.26242956554/8.0),
14906 REAL_CONST(125028.33390894404/8.0),
14907 REAL_CONST(125053.40664525882/8.0),
14908 REAL_CONST(125078.48063838384/8.0),
14909 REAL_CONST(125103.55588819318/8.0),
14910 REAL_CONST(125128.63239456083/8.0),
14911 REAL_CONST(125153.71015736091/8.0),
14912 REAL_CONST(125178.78917646752/8.0),
14913 REAL_CONST(125203.86945175481/8.0),
14914 REAL_CONST(125228.95098309696/8.0),
14915 REAL_CONST(125254.03377036817/8.0),
14916 REAL_CONST(125279.1178134427/8.0),
14917 REAL_CONST(125304.20311219479/8.0),
14918 REAL_CONST(125329.28966649878/8.0),
14919 REAL_CONST(125354.37747622898/8.0),
14920 REAL_CONST(125379.46654125977/8.0),
14921 REAL_CONST(125404.55686146552/8.0),
14922 REAL_CONST(125429.6484367207/8.0),
14923 REAL_CONST(125454.74126689974/8.0),
14924 REAL_CONST(125479.83535187715/8.0),
14925 REAL_CONST(125504.93069152744/8.0),
14926 REAL_CONST(125530.02728572517/8.0),
14927 REAL_CONST(125555.12513434493/8.0),
14928 REAL_CONST(125580.22423726133/8.0),
14929 REAL_CONST(125605.32459434902/8.0),
14930 REAL_CONST(125630.4262054827/8.0),
14931 REAL_CONST(125655.52907053704/8.0),
14932 REAL_CONST(125680.63318938682/8.0),
14933 REAL_CONST(125705.73856190679/8.0),
14934 REAL_CONST(125730.84518797178/8.0),
14935 REAL_CONST(125755.9530674566/8.0),
14936 REAL_CONST(125781.06220023613/8.0),
14937 REAL_CONST(125806.17258618528/8.0),
14938 REAL_CONST(125831.28422517896/8.0),
14939 REAL_CONST(125856.39711709213/8.0),
14940 REAL_CONST(125881.51126179981/8.0),
14941 REAL_CONST(125906.62665917698/8.0),
14942 REAL_CONST(125931.74330909875/8.0),
14943 REAL_CONST(125956.86121144016/8.0),
14944 REAL_CONST(125981.98036607634/8.0),
14945 REAL_CONST(126007.10077288245/8.0),
14946 REAL_CONST(126032.22243173365/8.0),
14947 REAL_CONST(126057.34534250517/8.0),
14948 REAL_CONST(126082.46950507225/8.0),
14949 REAL_CONST(126107.59491931014/8.0),
14950 REAL_CONST(126132.72158509417/8.0),
14951 REAL_CONST(126157.84950229966/8.0),
14952 REAL_CONST(126182.97867080198/8.0),
14953 REAL_CONST(126208.10909047653/8.0),
14954 REAL_CONST(126233.24076119871/8.0),
14955 REAL_CONST(126258.37368284403/8.0),
14956 REAL_CONST(126283.50785528794/8.0),
14957 REAL_CONST(126308.64327840599/8.0),
14958 REAL_CONST(126333.77995207369/8.0),
14959 REAL_CONST(126358.91787616667/8.0),
14960 REAL_CONST(126384.0570505605/8.0),
14961 REAL_CONST(126409.19747513086/8.0),
14962 REAL_CONST(126434.3391497534/8.0),
14963 REAL_CONST(126459.48207430386/8.0),
14964 REAL_CONST(126484.62624865794/8.0),
14965 REAL_CONST(126509.77167269142/8.0),
14966 REAL_CONST(126534.9183462801/8.0),
14967 REAL_CONST(126560.06626929982/8.0),
14968 REAL_CONST(126585.21544162642/8.0),
14969 REAL_CONST(126610.36586313581/8.0),
14970 REAL_CONST(126635.51753370393/8.0),
14971 REAL_CONST(126660.67045320668/8.0),
14972 REAL_CONST(126685.82462152008/8.0),
14973 REAL_CONST(126710.98003852014/8.0),
14974 REAL_CONST(126736.13670408291/8.0),
14975 REAL_CONST(126761.29461808444/8.0),
14976 REAL_CONST(126786.45378040087/8.0),
14977 REAL_CONST(126811.61419090834/8.0),
14978 REAL_CONST(126836.77584948298/8.0),
14979 REAL_CONST(126861.93875600102/8.0),
14980 REAL_CONST(126887.10291033868/8.0),
14981 REAL_CONST(126912.26831237224/8.0),
14982 REAL_CONST(126937.43496197795/8.0),
14983 REAL_CONST(126962.60285903217/8.0),
14984 REAL_CONST(126987.77200341123/8.0),
14985 REAL_CONST(127012.94239499152/8.0),
14986 REAL_CONST(127038.11403364947/8.0),
14987 REAL_CONST(127063.2869192615/8.0),
14988 REAL_CONST(127088.46105170409/8.0),
14989 REAL_CONST(127113.63643085376/8.0),
14990 REAL_CONST(127138.81305658702/8.0),
14991 REAL_CONST(127163.99092878048/8.0),
14992 REAL_CONST(127189.17004731069/8.0),
14993 REAL_CONST(127214.35041205429/8.0),
14994 REAL_CONST(127239.53202288797/8.0),
14995 REAL_CONST(127264.71487968838/8.0),
14996 REAL_CONST(127289.89898233226/8.0),
14997 REAL_CONST(127315.08433069635/8.0),
14998 REAL_CONST(127340.27092465744/8.0),
14999 REAL_CONST(127365.45876409234/8.0),
15000 REAL_CONST(127390.64784887788/8.0),
15001 REAL_CONST(127415.83817889093/8.0),
15002 REAL_CONST(127441.02975400841/8.0),
15003 REAL_CONST(127466.22257410725/8.0),
15004 REAL_CONST(127491.41663906439/8.0),
15005 REAL_CONST(127516.61194875685/8.0),
15006 REAL_CONST(127541.80850306165/8.0),
15007 REAL_CONST(127567.00630185583/8.0),
15008 REAL_CONST(127592.20534501647/8.0),
15009 REAL_CONST(127617.4056324207/8.0),
15010 REAL_CONST(127642.60716394568/8.0),
15011 REAL_CONST(127667.80993946856/8.0),
15012 REAL_CONST(127693.01395886653/8.0),
15013 REAL_CONST(127718.21922201688/8.0),
15014 REAL_CONST(127743.42572879682/8.0),
15015 REAL_CONST(127768.63347908368/8.0),
15016 REAL_CONST(127793.84247275478/8.0),
15017 REAL_CONST(127819.05270968749/8.0),
15018 REAL_CONST(127844.26418975917/8.0),
15019 REAL_CONST(127869.47691284724/8.0),
15020 REAL_CONST(127894.69087882918/8.0),
15021 REAL_CONST(127919.90608758242/8.0),
15022 REAL_CONST(127945.12253898452/8.0),
15023 REAL_CONST(127970.34023291297/8.0),
15024 REAL_CONST(127995.55916924537/8.0),
15025 REAL_CONST(128020.77934785932/8.0),
15026 REAL_CONST(128046.00076863244/8.0),
15027 REAL_CONST(128071.22343144237/8.0),
15028 REAL_CONST(128096.44733616684/8.0),
15029 REAL_CONST(128121.67248268353/8.0),
15030 REAL_CONST(128146.89887087021/8.0),
15031 REAL_CONST(128172.12650060465/8.0),
15032 REAL_CONST(128197.35537176467/8.0),
15033 REAL_CONST(128222.5854842281/8.0),
15034 REAL_CONST(128247.81683787282/8.0),
15035 REAL_CONST(128273.04943257671/8.0),
15036 REAL_CONST(128298.28326821771/8.0),
15037 REAL_CONST(128323.51834467379/8.0),
15038 REAL_CONST(128348.75466182294/8.0),
15039 REAL_CONST(128373.99221954317/8.0),
15040 REAL_CONST(128399.23101771252/8.0),
15041 REAL_CONST(128424.47105620909/8.0),
15042 REAL_CONST(128449.71233491098/8.0),
15043 REAL_CONST(128474.95485369631/8.0),
15044 REAL_CONST(128500.19861244329/8.0),
15045 REAL_CONST(128525.44361103009/8.0),
15046 REAL_CONST(128550.68984933494/8.0),
15047 REAL_CONST(128575.93732723613/8.0),
15048 REAL_CONST(128601.18604461191/8.0),
15049 REAL_CONST(128626.43600134061/8.0),
15050 REAL_CONST(128651.68719730059/8.0),
15051 REAL_CONST(128676.93963237021/8.0),
15052 REAL_CONST(128702.1933064279/8.0),
15053 REAL_CONST(128727.44821935208/8.0),
15054 REAL_CONST(128752.70437102125/8.0),
15055 REAL_CONST(128777.96176131385/8.0),
15056 REAL_CONST(128803.22039010846/8.0),
15057 REAL_CONST(128828.48025728362/8.0),
15058 REAL_CONST(128853.74136271792/8.0),
15059 REAL_CONST(128879.00370628996/8.0),
15060 REAL_CONST(128904.26728787841/8.0),
15061 REAL_CONST(128929.53210736193/8.0),
15062 REAL_CONST(128954.79816461923/8.0),
15063 REAL_CONST(128980.06545952905/8.0),
15064 REAL_CONST(129005.33399197015/8.0),
15065 REAL_CONST(129030.60376182134/8.0),
15066 REAL_CONST(129055.87476896142/8.0),
15067 REAL_CONST(129081.14701326926/8.0),
15068 REAL_CONST(129106.42049462376/8.0),
15069 REAL_CONST(129131.6952129038/8.0),
15070 REAL_CONST(129156.97116798835/8.0),
15071 REAL_CONST(129182.24835975636/8.0),
15072 REAL_CONST(129207.52678808685/8.0),
15073 REAL_CONST(129232.80645285884/8.0),
15074 REAL_CONST(129258.08735395141/8.0),
15075 REAL_CONST(129283.36949124365/8.0),
15076 REAL_CONST(129308.65286461466/8.0),
15077 REAL_CONST(129333.9374739436/8.0),
15078 REAL_CONST(129359.22331910966/8.0),
15079 REAL_CONST(129384.51039999202/8.0),
15080 REAL_CONST(129409.79871646997/8.0),
15081 REAL_CONST(129435.08826842274/8.0),
15082 REAL_CONST(129460.37905572963/8.0),
15083 REAL_CONST(129485.67107826998/8.0),
15084 REAL_CONST(129510.96433592314/8.0),
15085 REAL_CONST(129536.25882856851/8.0),
15086 REAL_CONST(129561.55455608548/8.0),
15087 REAL_CONST(129586.85151835352/8.0),
15088 REAL_CONST(129612.14971525209/8.0),
15089 REAL_CONST(129637.4491466607/8.0),
15090 REAL_CONST(129662.74981245887/8.0),
15091 REAL_CONST(129688.0517125262/8.0),
15092 REAL_CONST(129713.35484674224/8.0),
15093 REAL_CONST(129738.65921498663/8.0),
15094 REAL_CONST(129763.96481713903/8.0),
15095 REAL_CONST(129789.27165307909/8.0),
15096 REAL_CONST(129814.57972268655/8.0),
15097 REAL_CONST(129839.88902584116/8.0),
15098 REAL_CONST(129865.19956242264/8.0),
15099 REAL_CONST(129890.51133231082/8.0),
15100 REAL_CONST(129915.82433538554/8.0),
15101 REAL_CONST(129941.13857152662/8.0),
15102 REAL_CONST(129966.45404061397/8.0),
15103 REAL_CONST(129991.7707425275/8.0),
15104 REAL_CONST(130017.08867714716/8.0),
15105 REAL_CONST(130042.4078443529/8.0),
15106 REAL_CONST(130067.72824402474/8.0),
15107 REAL_CONST(130093.04987604271/8.0),
15108 REAL_CONST(130118.37274028687/8.0),
15109 REAL_CONST(130143.69683663732/8.0),
15110 REAL_CONST(130169.02216497416/8.0),
15111 REAL_CONST(130194.34872517755/8.0),
15112 REAL_CONST(130219.67651712766/8.0),
15113 REAL_CONST(130245.0055407047/8.0),
15114 REAL_CONST(130270.33579578891/8.0),
15115 REAL_CONST(130295.66728226055/8.0),
15116 REAL_CONST(130320.99999999991/8.0),
15117 REAL_CONST(130346.33394888733/8.0),
15118 REAL_CONST(130371.66912880314/8.0),
15119 REAL_CONST(130397.00553962773/8.0),
15120 REAL_CONST(130422.34318124152/8.0),
15121 REAL_CONST(130447.68205352494/8.0),
15122 REAL_CONST(130473.02215635845/8.0),
15123 REAL_CONST(130498.36348962256/8.0),
15124 REAL_CONST(130523.70605319779/8.0),
15125 REAL_CONST(130549.0498469647/8.0),
15126 REAL_CONST(130574.39487080388/8.0),
15127 REAL_CONST(130599.74112459592/8.0),
15128 REAL_CONST(130625.08860822149/8.0),
15129 REAL_CONST(130650.43732156123/8.0),
15130 REAL_CONST(130675.78726449587/8.0),
15131 REAL_CONST(130701.13843690613/8.0),
15132 REAL_CONST(130726.49083867275/8.0),
15133 REAL_CONST(130751.84446967654/8.0),
15134 REAL_CONST(130777.19932979831/8.0),
15135 REAL_CONST(130802.5554189189/8.0),
15136 REAL_CONST(130827.91273691918/8.0),
15137 REAL_CONST(130853.27128368006/8.0),
15138 REAL_CONST(130878.63105908247/8.0),
15139 REAL_CONST(130903.99206300738/8.0),
15140 REAL_CONST(130929.35429533575/8.0),
15141 REAL_CONST(130954.71775594862/8.0),
15142 REAL_CONST(130980.08244472703/8.0),
15143 REAL_CONST(131005.44836155206/8.0),
15144 REAL_CONST(131030.81550630482/8.0),
15145 REAL_CONST(131056.18387886642/8.0),
15146 REAL_CONST(131081.55347911804/8.0),
15147 REAL_CONST(131106.92430694087/8.0),
15148 REAL_CONST(131132.29636221612/8.0),
15149 REAL_CONST(131157.66964482504/8.0),
15150 REAL_CONST(131183.0441546489/8.0),
15151 REAL_CONST(131208.41989156904/8.0),
15152 REAL_CONST(131233.79685546676/8.0),
15153 REAL_CONST(131259.17504622342/8.0),
15154 REAL_CONST(131284.55446372041/8.0),
15155 REAL_CONST(131309.93510783918/8.0),
15156 REAL_CONST(131335.31697846117/8.0),
15157 REAL_CONST(131360.70007546784/8.0),
15158 REAL_CONST(131386.0843987407/8.0),
15159 REAL_CONST(131411.46994816128/8.0),
15160 REAL_CONST(131436.85672361116/8.0),
15161 REAL_CONST(131462.24472497194/8.0),
15162 REAL_CONST(131487.63395212521/8.0),
15163 REAL_CONST(131513.02440495262/8.0),
15164 REAL_CONST(131538.41608333588/8.0),
15165 REAL_CONST(131563.80898715663/8.0),
15166 REAL_CONST(131589.2031162967/8.0),
15167 REAL_CONST(131614.59847063778/8.0),
15168 REAL_CONST(131639.9950500617/8.0),
15169 REAL_CONST(131665.39285445024/8.0),
15170 REAL_CONST(131690.79188368531/8.0),
15171 REAL_CONST(131716.19213764873/8.0),
15172 REAL_CONST(131741.59361622241/8.0),
15173 REAL_CONST(131766.99631928833/8.0),
15174 REAL_CONST(131792.40024672839/8.0),
15175 REAL_CONST(131817.80539842462/8.0),
15176 REAL_CONST(131843.21177425905/8.0),
15177 REAL_CONST(131868.61937411371/8.0),
15178 REAL_CONST(131894.02819787065/8.0),
15179 REAL_CONST(131919.43824541202/8.0),
15180 REAL_CONST(131944.84951661993/8.0),
15181 REAL_CONST(131970.26201137656/8.0),
15182 REAL_CONST(131995.67572956407/8.0),
15183 REAL_CONST(132021.09067106468/8.0),
15184 REAL_CONST(132046.50683576067/8.0),
15185 REAL_CONST(132071.9242235343/8.0),
15186 REAL_CONST(132097.34283426782/8.0),
15187 REAL_CONST(132122.76266784366/8.0),
15188 REAL_CONST(132148.1837241441/8.0),
15189 REAL_CONST(132173.60600305157/8.0),
15190 REAL_CONST(132199.02950444847/8.0),
15191 REAL_CONST(132224.45422821722/8.0),
15192 REAL_CONST(132249.88017424036/8.0),
15193 REAL_CONST(132275.30734240031/8.0),
15194 REAL_CONST(132300.73573257966/8.0),
15195 REAL_CONST(132326.16534466096/8.0),
15196 REAL_CONST(132351.59617852676/8.0),
15197 REAL_CONST(132377.02823405969/8.0),
15198 REAL_CONST(132402.46151114244/8.0),
15199 REAL_CONST(132427.89600965759/8.0),
15200 REAL_CONST(132453.33172948789/8.0),
15201 REAL_CONST(132478.76867051609/8.0),
15202 REAL_CONST(132504.20683262491/8.0),
15203 REAL_CONST(132529.64621569714/8.0),
15204 REAL_CONST(132555.08681961559/8.0),
15205 REAL_CONST(132580.5286442631/8.0),
15206 REAL_CONST(132605.97168952253/8.0),
15207 REAL_CONST(132631.41595527678/8.0),
15208 REAL_CONST(132656.86144140881/8.0),
15209 REAL_CONST(132682.30814780149/8.0),
15210 REAL_CONST(132707.75607433787/8.0),
15211 REAL_CONST(132733.20522090094/8.0),
15212 REAL_CONST(132758.65558737374/8.0),
15213 REAL_CONST(132784.10717363929/8.0),
15214 REAL_CONST(132809.55997958075/8.0),
15215 REAL_CONST(132835.01400508118/8.0),
15216 REAL_CONST(132860.46925002377/8.0),
15217 REAL_CONST(132885.92571429166/8.0),
15218 REAL_CONST(132911.38339776811/8.0),
15219 REAL_CONST(132936.84230033628/8.0),
15220 REAL_CONST(132962.30242187946/8.0),
15221 REAL_CONST(132987.76376228096/8.0),
15222 REAL_CONST(133013.22632142407/8.0),
15223 REAL_CONST(133038.69009919214/8.0),
15224 REAL_CONST(133064.15509546854/8.0),
15225 REAL_CONST(133089.62131013666/8.0),
15226 REAL_CONST(133115.08874307995/8.0),
15227 REAL_CONST(133140.55739418184/8.0),
15228 REAL_CONST(133166.02726332581/8.0),
15229 REAL_CONST(133191.49835039541/8.0),
15230 REAL_CONST(133216.97065527414/8.0),
15231 REAL_CONST(133242.44417784561/8.0),
15232 REAL_CONST(133267.91891799335/8.0),
15233 REAL_CONST(133293.39487560102/8.0),
15234 REAL_CONST(133318.87205055228/8.0),
15235 REAL_CONST(133344.35044273079/8.0),
15236 REAL_CONST(133369.83005202023/8.0),
15237 REAL_CONST(133395.31087830439/8.0),
15238 REAL_CONST(133420.79292146701/8.0),
15239 REAL_CONST(133446.27618139185/8.0),
15240 REAL_CONST(133471.76065796276/8.0),
15241 REAL_CONST(133497.24635106357/8.0),
15242 REAL_CONST(133522.73326057816/8.0),
15243 REAL_CONST(133548.22138639039/8.0),
15244 REAL_CONST(133573.71072838426/8.0),
15245 REAL_CONST(133599.20128644365/8.0),
15246 REAL_CONST(133624.69306045261/8.0),
15247 REAL_CONST(133650.1860502951/8.0),
15248 REAL_CONST(133675.68025585517/8.0),
15249 REAL_CONST(133701.1756770169/8.0),
15250 REAL_CONST(133726.67231366437/8.0),
15251 REAL_CONST(133752.17016568172/8.0),
15252 REAL_CONST(133777.66923295305/8.0),
15253 REAL_CONST(133803.16951536259/8.0),
15254 REAL_CONST(133828.67101279454/8.0),
15255 REAL_CONST(133854.17372513309/8.0),
15256 REAL_CONST(133879.67765226253/8.0),
15257 REAL_CONST(133905.18279406714/8.0),
15258 REAL_CONST(133930.68915043125/8.0),
15259 REAL_CONST(133956.19672123916/8.0),
15260 REAL_CONST(133981.70550637526/8.0),
15261 REAL_CONST(134007.21550572399/8.0),
15262 REAL_CONST(134032.7267191697/8.0),
15263 REAL_CONST(134058.23914659687/8.0),
15264 REAL_CONST(134083.75278789/8.0),
15265 REAL_CONST(134109.26764293358/8.0),
15266 REAL_CONST(134134.78371161217/8.0),
15267 REAL_CONST(134160.30099381026/8.0),
15268 REAL_CONST(134185.8194894125/8.0),
15269 REAL_CONST(134211.33919830353/8.0),
15270 REAL_CONST(134236.8601203679/8.0),
15271 REAL_CONST(134262.38225549037/8.0),
15272 REAL_CONST(134287.90560355558/8.0),
15273 REAL_CONST(134313.43016444831/8.0),
15274 REAL_CONST(134338.95593805326/8.0),
15275 REAL_CONST(134364.48292425525/8.0),
15276 REAL_CONST(134390.01112293909/8.0),
15277 REAL_CONST(134415.54053398955/8.0),
15278 REAL_CONST(134441.07115729159/8.0),
15279 REAL_CONST(134466.60299273001/8.0),
15280 REAL_CONST(134492.1360401898/8.0),
15281 REAL_CONST(134517.67029955584/8.0),
15282 REAL_CONST(134543.20577071316/8.0),
15283 REAL_CONST(134568.74245354676/8.0),
15284 REAL_CONST(134594.28034794159/8.0),
15285 REAL_CONST(134619.81945378278/8.0),
15286 REAL_CONST(134645.35977095537/8.0),
15287 REAL_CONST(134670.90129934452/8.0),
15288 REAL_CONST(134696.4440388353/8.0),
15289 REAL_CONST(134721.98798931291/8.0),
15290 REAL_CONST(134747.53315066252/8.0),
15291 REAL_CONST(134773.07952276937/8.0),
15292 REAL_CONST(134798.62710551871/8.0),
15293 REAL_CONST(134824.17589879577/8.0),
15294 REAL_CONST(134849.72590248589/8.0),
15295 REAL_CONST(134875.27711647438/8.0),
15296 REAL_CONST(134900.82954064661/8.0),
15297 REAL_CONST(134926.38317488792/8.0),
15298 REAL_CONST(134951.93801908373/8.0),
15299 REAL_CONST(134977.49407311951/8.0),
15300 REAL_CONST(135003.05133688069/8.0),
15301 REAL_CONST(135028.60981025276/8.0),
15302 REAL_CONST(135054.16949312127/8.0),
15303 REAL_CONST(135079.73038537172/8.0),
15304 REAL_CONST(135105.29248688967/8.0),
15305 REAL_CONST(135130.85579756077/8.0),
15306 REAL_CONST(135156.42031727062/8.0),
15307 REAL_CONST(135181.98604590484/8.0),
15308 REAL_CONST(135207.55298334916/8.0),
15309 REAL_CONST(135233.12112948924/8.0),
15310 REAL_CONST(135258.69048421088/8.0),
15311 REAL_CONST(135284.26104739975/8.0),
15312 REAL_CONST(135309.83281894168/8.0),
15313 REAL_CONST(135335.4057987225/8.0),
15314 REAL_CONST(135360.97998662802/8.0),
15315 REAL_CONST(135386.55538254412/8.0),
15316 REAL_CONST(135412.13198635669/8.0),
15317 REAL_CONST(135437.70979795168/8.0),
15318 REAL_CONST(135463.28881721498/8.0),
15319 REAL_CONST(135488.86904403262/8.0),
15320 REAL_CONST(135514.45047829056/8.0),
15321 REAL_CONST(135540.03311987486/8.0),
15322 REAL_CONST(135565.61696867159/8.0),
15323 REAL_CONST(135591.20202456677/8.0),
15324 REAL_CONST(135616.78828744654/8.0),
15325 REAL_CONST(135642.37575719706/8.0),
15326 REAL_CONST(135667.96443370447/8.0),
15327 REAL_CONST(135693.55431685498/8.0),
15328 REAL_CONST(135719.14540653475/8.0),
15329 REAL_CONST(135744.73770263011/8.0),
15330 REAL_CONST(135770.33120502727/8.0),
15331 REAL_CONST(135795.92591361253/8.0),
15332 REAL_CONST(135821.52182827223/8.0),
15333 REAL_CONST(135847.11894889272/8.0),
15334 REAL_CONST(135872.7172753604/8.0),
15335 REAL_CONST(135898.31680756161/8.0),
15336 REAL_CONST(135923.91754538284/8.0),
15337 REAL_CONST(135949.51948871053/8.0),
15338 REAL_CONST(135975.12263743114/8.0),
15339 REAL_CONST(136000.72699143123/8.0),
15340 REAL_CONST(136026.33255059729/8.0),
15341 REAL_CONST(136051.93931481591/8.0),
15342 REAL_CONST(136077.54728397369/8.0),
15343 REAL_CONST(136103.15645795723/8.0),
15344 REAL_CONST(136128.76683665317/8.0),
15345 REAL_CONST(136154.37841994822/8.0),
15346 REAL_CONST(136179.99120772901/8.0),
15347 REAL_CONST(136205.60519988232/8.0),
15348 REAL_CONST(136231.2203962949/8.0),
15349 REAL_CONST(136256.83679685349/8.0),
15350 REAL_CONST(136282.45440144493/8.0),
15351 REAL_CONST(136308.07320995603/8.0),
15352 REAL_CONST(136333.69322227367/8.0),
15353 REAL_CONST(136359.31443828469/8.0),
15354 REAL_CONST(136384.93685787608/8.0),
15355 REAL_CONST(136410.56048093468/8.0),
15356 REAL_CONST(136436.18530734754/8.0),
15357 REAL_CONST(136461.81133700156/8.0),
15358 REAL_CONST(136487.43856978384/8.0),
15359 REAL_CONST(136513.06700558143/8.0),
15360 REAL_CONST(136538.6966442813/8.0),
15361 REAL_CONST(136564.32748577066/8.0),
15362 REAL_CONST(136589.95952993655/8.0),
15363 REAL_CONST(136615.59277666616/8.0),
15364 REAL_CONST(136641.22722584667/8.0),
15365 REAL_CONST(136666.86287736523/8.0),
15366 REAL_CONST(136692.49973110916/8.0),
15367 REAL_CONST(136718.13778696564/8.0),
15368 REAL_CONST(136743.77704482197/8.0),
15369 REAL_CONST(136769.41750456547/8.0),
15370 REAL_CONST(136795.05916608346/8.0),
15371 REAL_CONST(136820.70202926331/8.0),
15372 REAL_CONST(136846.34609399244/8.0),
15373 REAL_CONST(136871.99136015819/8.0),
15374 REAL_CONST(136897.63782764805/8.0),
15375 REAL_CONST(136923.28549634948/8.0),
15376 REAL_CONST(136948.93436614997/8.0),
15377 REAL_CONST(136974.58443693706/8.0),
15378 REAL_CONST(137000.23570859825/8.0),
15379 REAL_CONST(137025.88818102115/8.0),
15380 REAL_CONST(137051.54185409332/8.0),
15381 REAL_CONST(137077.19672770242/8.0),
15382 REAL_CONST(137102.85280173609/8.0),
15383 REAL_CONST(137128.51007608202/8.0),
15384 REAL_CONST(137154.16855062786/8.0),
15385 REAL_CONST(137179.82822526142/8.0),
15386 REAL_CONST(137205.48909987041/8.0),
15387 REAL_CONST(137231.15117434258/8.0),
15388 REAL_CONST(137256.8144485658/8.0),
15389 REAL_CONST(137282.47892242789/8.0),
15390 REAL_CONST(137308.14459581667/8.0),
15391 REAL_CONST(137333.81146862009/8.0),
15392 REAL_CONST(137359.47954072602/8.0),
15393 REAL_CONST(137385.14881202241/8.0),
15394 REAL_CONST(137410.81928239719/8.0),
15395 REAL_CONST(137436.49095173844/8.0),
15396 REAL_CONST(137462.16381993407/8.0),
15397 REAL_CONST(137487.83788687221/8.0),
15398 REAL_CONST(137513.51315244089/8.0),
15399 REAL_CONST(137539.18961652822/8.0),
15400 REAL_CONST(137564.86727902229/8.0),
15401 REAL_CONST(137590.54613981131/8.0),
15402 REAL_CONST(137616.22619878338/8.0),
15403 REAL_CONST(137641.90745582676/8.0),
15404 REAL_CONST(137667.58991082967/8.0),
15405 REAL_CONST(137693.27356368033/8.0),
15406 REAL_CONST(137718.95841426702/8.0),
15407 REAL_CONST(137744.64446247809/8.0),
15408 REAL_CONST(137770.33170820182/8.0),
15409 REAL_CONST(137796.02015132661/8.0),
15410 REAL_CONST(137821.70979174081/8.0),
15411 REAL_CONST(137847.40062933284/8.0),
15412 REAL_CONST(137873.09266399115/8.0),
15413 REAL_CONST(137898.78589560417/8.0),
15414 REAL_CONST(137924.48032406042/8.0),
15415 REAL_CONST(137950.17594924837/8.0),
15416 REAL_CONST(137975.8727710566/8.0),
15417 REAL_CONST(138001.57078937365/8.0),
15418 REAL_CONST(138027.27000408815/8.0),
15419 REAL_CONST(138052.97041508864/8.0),
15420 REAL_CONST(138078.67202226384/8.0),
15421 REAL_CONST(138104.3748255024/8.0),
15422 REAL_CONST(138130.07882469296/8.0),
15423 REAL_CONST(138155.78401972432/8.0),
15424 REAL_CONST(138181.49041048516/8.0),
15425 REAL_CONST(138207.1979968643/8.0),
15426 REAL_CONST(138232.9067787505/8.0),
15427 REAL_CONST(138258.61675603263/8.0),
15428 REAL_CONST(138284.32792859949/8.0),
15429 REAL_CONST(138310.04029633995/8.0),
15430 REAL_CONST(138335.75385914298/8.0),
15431 REAL_CONST(138361.46861689744/8.0),
15432 REAL_CONST(138387.18456949232/8.0),
15433 REAL_CONST(138412.90171681659/8.0),
15434 REAL_CONST(138438.62005875923/8.0),
15435 REAL_CONST(138464.33959520931/8.0),
15436 REAL_CONST(138490.06032605586/8.0),
15437 REAL_CONST(138515.78225118798/8.0),
15438 REAL_CONST(138541.50537049473/8.0),
15439 REAL_CONST(138567.2296838653/8.0),
15440 REAL_CONST(138592.95519118884/8.0),
15441 REAL_CONST(138618.68189235451/8.0),
15442 REAL_CONST(138644.40978725153/8.0),
15443 REAL_CONST(138670.13887576913/8.0),
15444 REAL_CONST(138695.86915779658/8.0),
15445 REAL_CONST(138721.60063322316/8.0),
15446 REAL_CONST(138747.33330193823/8.0),
15447 REAL_CONST(138773.06716383106/8.0),
15448 REAL_CONST(138798.80221879104/8.0),
15449 REAL_CONST(138824.53846670757/8.0),
15450 REAL_CONST(138850.27590747006/8.0),
15451 REAL_CONST(138876.01454096794/8.0),
15452 REAL_CONST(138901.7543670907/8.0),
15453 REAL_CONST(138927.49538572782/8.0),
15454 REAL_CONST(138953.2375967688/8.0),
15455 REAL_CONST(138978.9810001032/8.0),
15456 REAL_CONST(139004.72559562061/8.0),
15457 REAL_CONST(139030.47138321059/8.0),
15458 REAL_CONST(139056.2183627628/8.0),
15459 REAL_CONST(139081.96653416683/8.0),
15460 REAL_CONST(139107.71589731239/8.0),
15461 REAL_CONST(139133.46645208917/8.0),
15462 REAL_CONST(139159.21819838689/8.0),
15463 REAL_CONST(139184.97113609532/8.0),
15464 REAL_CONST(139210.72526510421/8.0),
15465 REAL_CONST(139236.48058530336/8.0),
15466 REAL_CONST(139262.23709658257/8.0),
15467 REAL_CONST(139287.99479883176/8.0),
15468 REAL_CONST(139313.75369194071/8.0),
15469 REAL_CONST(139339.51377579942/8.0),
15470 REAL_CONST(139365.27505029776/8.0),
15471 REAL_CONST(139391.03751532568/8.0),
15472 REAL_CONST(139416.80117077316/8.0),
15473 REAL_CONST(139442.56601653024/8.0),
15474 REAL_CONST(139468.33205248689/8.0),
15475 REAL_CONST(139494.09927853322/8.0),
15476 REAL_CONST(139519.86769455927/8.0),
15477 REAL_CONST(139545.63730045516/8.0),
15478 REAL_CONST(139571.408096111/8.0),
15479 REAL_CONST(139597.18008141697/8.0),
15480 REAL_CONST(139622.95325626322/8.0),
15481 REAL_CONST(139648.72762054001/8.0),
15482 REAL_CONST(139674.5031741375/8.0),
15483 REAL_CONST(139700.27991694602/8.0),
15484 REAL_CONST(139726.05784885579/8.0),
15485 REAL_CONST(139751.83696975713/8.0),
15486 REAL_CONST(139777.61727954043/8.0),
15487 REAL_CONST(139803.39877809596/8.0),
15488 REAL_CONST(139829.18146531415/8.0),
15489 REAL_CONST(139854.96534108539/8.0),
15490 REAL_CONST(139880.75040530015/8.0),
15491 REAL_CONST(139906.53665784886/8.0),
15492 REAL_CONST(139932.32409862199/8.0),
15493 REAL_CONST(139958.11272751007/8.0),
15494 REAL_CONST(139983.90254440365/8.0),
15495 REAL_CONST(140009.69354919327/8.0),
15496 REAL_CONST(140035.48574176949/8.0),
15497 REAL_CONST(140061.27912202294/8.0),
15498 REAL_CONST(140087.07368984428/8.0),
15499 REAL_CONST(140112.86944512415/8.0),
15500 REAL_CONST(140138.66638775321/8.0),
15501 REAL_CONST(140164.4645176222/8.0),
15502 REAL_CONST(140190.26383462184/8.0),
15503 REAL_CONST(140216.06433864293/8.0),
15504 REAL_CONST(140241.86602957622/8.0),
15505 REAL_CONST(140267.66890731253/8.0),
15506 REAL_CONST(140293.47297174268/8.0),
15507 REAL_CONST(140319.27822275754/8.0),
15508 REAL_CONST(140345.08466024802/8.0),
15509 REAL_CONST(140370.89228410498/8.0),
15510 REAL_CONST(140396.70109421943/8.0),
15511 REAL_CONST(140422.51109048226/8.0),
15512 REAL_CONST(140448.32227278448/8.0),
15513 REAL_CONST(140474.13464101712/8.0),
15514 REAL_CONST(140499.94819507122/8.0),
15515 REAL_CONST(140525.76293483781/8.0),
15516 REAL_CONST(140551.57886020801/8.0),
15517 REAL_CONST(140577.3959710729/8.0),
15518 REAL_CONST(140603.21426732364/8.0),
15519 REAL_CONST(140629.03374885136/8.0),
15520 REAL_CONST(140654.85441554731/8.0),
15521 REAL_CONST(140680.67626730262/8.0),
15522 REAL_CONST(140706.49930400858/8.0),
15523 REAL_CONST(140732.32352555645/8.0),
15524 REAL_CONST(140758.1489318375/8.0),
15525 REAL_CONST(140783.97552274304/8.0),
15526 REAL_CONST(140809.80329816442/8.0),
15527 REAL_CONST(140835.63225799298/8.0),
15528 REAL_CONST(140861.46240212015/8.0),
15529 REAL_CONST(140887.29373043729/8.0),
15530 REAL_CONST(140913.12624283586/8.0),
15531 REAL_CONST(140938.95993920733/8.0),
15532 REAL_CONST(140964.79481944317/8.0),
15533 REAL_CONST(140990.63088343487/8.0),
15534 REAL_CONST(141016.46813107401/8.0),
15535 REAL_CONST(141042.30656225214/8.0),
15536 REAL_CONST(141068.14617686081/8.0),
15537 REAL_CONST(141093.98697479168/8.0),
15538 REAL_CONST(141119.82895593636/8.0),
15539 REAL_CONST(141145.6721201865/8.0),
15540 REAL_CONST(141171.51646743377/8.0),
15541 REAL_CONST(141197.36199756994/8.0),
15542 REAL_CONST(141223.20871048668/8.0),
15543 REAL_CONST(141249.05660607578/8.0),
15544 REAL_CONST(141274.90568422904/8.0),
15545 REAL_CONST(141300.75594483822/8.0),
15546 REAL_CONST(141326.6073877952/8.0),
15547 REAL_CONST(141352.4600129918/8.0),
15548 REAL_CONST(141378.31382031992/8.0),
15549 REAL_CONST(141404.16880967148/8.0),
15550 REAL_CONST(141430.02498093838/8.0),
15551 REAL_CONST(141455.8823340126/8.0),
15552 REAL_CONST(141481.74086878612/8.0),
15553 REAL_CONST(141507.60058515094/8.0),
15554 REAL_CONST(141533.46148299909/8.0),
15555 REAL_CONST(141559.32356222265/8.0),
15556 REAL_CONST(141585.18682271364/8.0),
15557 REAL_CONST(141611.05126436421/8.0),
15558 REAL_CONST(141636.9168870665/8.0),
15559 REAL_CONST(141662.78369071262/8.0),
15560 REAL_CONST(141688.65167519479/8.0),
15561 REAL_CONST(141714.5208404052/8.0),
15562 REAL_CONST(141740.39118623605/8.0),
15563 REAL_CONST(141766.26271257963/8.0),
15564 REAL_CONST(141792.1354193282/8.0),
15565 REAL_CONST(141818.00930637406/8.0),
15566 REAL_CONST(141843.88437360956/8.0),
15567 REAL_CONST(141869.760620927/8.0),
15568 REAL_CONST(141895.6380482188/8.0),
15569 REAL_CONST(141921.51665537735/8.0),
15570 REAL_CONST(141947.39644229505/8.0),
15571 REAL_CONST(141973.27740886438/8.0),
15572 REAL_CONST(141999.15955497778/8.0),
15573 REAL_CONST(142025.04288052776/8.0),
15574 REAL_CONST(142050.92738540689/8.0),
15575 REAL_CONST(142076.81306950765/8.0),
15576 REAL_CONST(142102.69993272264/8.0),
15577 REAL_CONST(142128.58797494444/8.0),
15578 REAL_CONST(142154.47719606571/8.0),
15579 REAL_CONST(142180.36759597904/8.0),
15580 REAL_CONST(142206.25917457714/8.0),
15581 REAL_CONST(142232.15193175265/8.0),
15582 REAL_CONST(142258.04586739838/8.0),
15583 REAL_CONST(142283.94098140698/8.0),
15584 REAL_CONST(142309.83727367126/8.0),
15585 REAL_CONST(142335.73474408401/8.0),
15586 REAL_CONST(142361.63339253806/8.0),
15587 REAL_CONST(142387.5332189262/8.0),
15588 REAL_CONST(142413.43422314132/8.0),
15589 REAL_CONST(142439.33640507635/8.0),
15590 REAL_CONST(142465.23976462413/8.0),
15591 REAL_CONST(142491.14430167765/8.0),
15592 REAL_CONST(142517.05001612983/8.0),
15593 REAL_CONST(142542.95690787368/8.0),
15594 REAL_CONST(142568.86497680223/8.0),
15595 REAL_CONST(142594.77422280848/8.0),
15596 REAL_CONST(142620.68464578551/8.0),
15597 REAL_CONST(142646.5962456264/8.0),
15598 REAL_CONST(142672.50902222423/8.0),
15599 REAL_CONST(142698.42297547215/8.0),
15600 REAL_CONST(142724.33810526333/8.0),
15601 REAL_CONST(142750.25441149093/8.0),
15602 REAL_CONST(142776.17189404817/8.0),
15603 REAL_CONST(142802.09055282827/8.0),
15604 REAL_CONST(142828.01038772447/8.0),
15605 REAL_CONST(142853.93139863008/8.0),
15606 REAL_CONST(142879.85358543837/8.0),
15607 REAL_CONST(142905.77694804268/8.0),
15608 REAL_CONST(142931.70148633636/8.0),
15609 REAL_CONST(142957.62720021277/8.0),
15610 REAL_CONST(142983.55408956532/8.0),
15611 REAL_CONST(143009.48215428743/8.0),
15612 REAL_CONST(143035.41139427255/8.0),
15613 REAL_CONST(143061.34180941415/8.0),
15614 REAL_CONST(143087.27339960571/8.0),
15615 REAL_CONST(143113.20616474075/8.0),
15616 REAL_CONST(143139.14010471283/8.0),
15617 REAL_CONST(143165.07521941551/8.0),
15618 REAL_CONST(143191.01150874238/8.0),
15619 REAL_CONST(143216.94897258704/8.0),
15620 REAL_CONST(143242.88761084314/8.0),
15621 REAL_CONST(143268.82742340435/8.0),
15622 REAL_CONST(143294.76841016437/8.0),
15623 REAL_CONST(143320.71057101688/8.0),
15624 REAL_CONST(143346.65390585564/8.0),
15625 REAL_CONST(143372.59841457437/8.0),
15626 REAL_CONST(143398.54409706692/8.0),
15627 REAL_CONST(143424.49095322701/8.0),
15628 REAL_CONST(143450.43898294857/8.0),
15629 REAL_CONST(143476.38818612538/8.0),
15630 REAL_CONST(143502.33856265133/8.0),
15631 REAL_CONST(143528.29011242036/8.0),
15632 REAL_CONST(143554.24283532638/8.0),
15633 REAL_CONST(143580.19673126334/8.0),
15634 REAL_CONST(143606.1518001252/8.0),
15635 REAL_CONST(143632.10804180597/8.0),
15636 REAL_CONST(143658.06545619969/8.0),
15637 REAL_CONST(143684.02404320039/8.0),
15638 REAL_CONST(143709.98380270213/8.0),
15639 REAL_CONST(143735.944734599/8.0),
15640 REAL_CONST(143761.90683878519/8.0),
15641 REAL_CONST(143787.87011515474/8.0),
15642 REAL_CONST(143813.83456360188/8.0),
15643 REAL_CONST(143839.8001840208/8.0),
15644 REAL_CONST(143865.76697630569/8.0),
15645 REAL_CONST(143891.73494035081/8.0),
15646 REAL_CONST(143917.7040760504/8.0),
15647 REAL_CONST(143943.67438329876/8.0),
15648 REAL_CONST(143969.6458619902/8.0),
15649 REAL_CONST(143995.61851201905/8.0),
15650 REAL_CONST(144021.59233327967/8.0),
15651 REAL_CONST(144047.56732566646/8.0),
15652 REAL_CONST(144073.54348907378/8.0),
15653 REAL_CONST(144099.52082339607/8.0),
15654 REAL_CONST(144125.49932852783/8.0),
15655 REAL_CONST(144151.4790043635/8.0),
15656 REAL_CONST(144177.45985079758/8.0),
15657 REAL_CONST(144203.44186772458/8.0),
15658 REAL_CONST(144229.42505503909/8.0),
15659 REAL_CONST(144255.40941263564/8.0),
15660 REAL_CONST(144281.39494040885/8.0),
15661 REAL_CONST(144307.38163825331/8.0),
15662 REAL_CONST(144333.36950606373/8.0),
15663 REAL_CONST(144359.35854373468/8.0),
15664 REAL_CONST(144385.34875116093/8.0),
15665 REAL_CONST(144411.34012823718/8.0),
15666 REAL_CONST(144437.33267485813/8.0),
15667 REAL_CONST(144463.32639091855/8.0),
15668 REAL_CONST(144489.32127631325/8.0),
15669 REAL_CONST(144515.31733093705/8.0),
15670 REAL_CONST(144541.31455468474/8.0),
15671 REAL_CONST(144567.3129474512/8.0),
15672 REAL_CONST(144593.3125091313/8.0),
15673 REAL_CONST(144619.31323961995/8.0),
15674 REAL_CONST(144645.31513881206/8.0),
15675 REAL_CONST(144671.31820660262/8.0),
15676 REAL_CONST(144697.32244288657/8.0),
15677 REAL_CONST(144723.32784755889/8.0),
15678 REAL_CONST(144749.33442051467/8.0),
15679 REAL_CONST(144775.34216164888/8.0),
15680 REAL_CONST(144801.35107085665/8.0),
15681 REAL_CONST(144827.36114803303/8.0),
15682 REAL_CONST(144853.37239307314/8.0),
15683 REAL_CONST(144879.38480587213/8.0),
15684 REAL_CONST(144905.39838632516/8.0),
15685 REAL_CONST(144931.41313432742/8.0),
15686 REAL_CONST(144957.4290497741/8.0),
15687 REAL_CONST(144983.44613256046/8.0),
15688 REAL_CONST(145009.46438258173/8.0),
15689 REAL_CONST(145035.48379973322/8.0),
15690 REAL_CONST(145061.50438391021/8.0),
15691 REAL_CONST(145087.52613500805/8.0),
15692 REAL_CONST(145113.54905292206/8.0),
15693 REAL_CONST(145139.57313754765/8.0),
15694 REAL_CONST(145165.59838878017/8.0),
15695 REAL_CONST(145191.62480651509/8.0),
15696 REAL_CONST(145217.65239064783/8.0),
15697 REAL_CONST(145243.68114107384/8.0),
15698 REAL_CONST(145269.71105768863/8.0),
15699 REAL_CONST(145295.74214038774/8.0),
15700 REAL_CONST(145321.77438906668/8.0),
15701 REAL_CONST(145347.80780362099/8.0),
15702 REAL_CONST(145373.84238394629/8.0),
15703 REAL_CONST(145399.87812993818/8.0),
15704 REAL_CONST(145425.91504149229/8.0),
15705 REAL_CONST(145451.95311850426/8.0),
15706 REAL_CONST(145477.9923608698/8.0),
15707 REAL_CONST(145504.03276848458/8.0),
15708 REAL_CONST(145530.07434124436/8.0),
15709 REAL_CONST(145556.11707904484/8.0),
15710 REAL_CONST(145582.16098178181/8.0),
15711 REAL_CONST(145608.20604935108/8.0),
15712 REAL_CONST(145634.25228164849/8.0),
15713 REAL_CONST(145660.29967856981/8.0),
15714 REAL_CONST(145686.34824001096/8.0),
15715 REAL_CONST(145712.39796586783/8.0),
15716 REAL_CONST(145738.4488560363/8.0),
15717 REAL_CONST(145764.50091041232/8.0),
15718 REAL_CONST(145790.55412889185/8.0),
15719 REAL_CONST(145816.60851137087/8.0),
15720 REAL_CONST(145842.66405774537/8.0),
15721 REAL_CONST(145868.72076791141/8.0),
15722 REAL_CONST(145894.77864176501/8.0),
15723 REAL_CONST(145920.83767920226/8.0),
15724 REAL_CONST(145946.89788011924/8.0),
15725 REAL_CONST(145972.95924441208/8.0),
15726 REAL_CONST(145999.02177197693/8.0),
15727 REAL_CONST(146025.08546270995/8.0),
15728 REAL_CONST(146051.15031650732/8.0),
15729 REAL_CONST(146077.21633326527/8.0),
15730 REAL_CONST(146103.28351288004/8.0),
15731 REAL_CONST(146129.35185524789/8.0),
15732 REAL_CONST(146155.42136026506/8.0),
15733 REAL_CONST(146181.49202782792/8.0),
15734 REAL_CONST(146207.56385783272/8.0),
15735 REAL_CONST(146233.63685017588/8.0),
15736 REAL_CONST(146259.71100475377/8.0),
15737 REAL_CONST(146285.78632146274/8.0),
15738 REAL_CONST(146311.86280019928/8.0),
15739 REAL_CONST(146337.94044085976/8.0),
15740 REAL_CONST(146364.01924334071/8.0),
15741 REAL_CONST(146390.09920753856/8.0),
15742 REAL_CONST(146416.18033334985/8.0),
15743 REAL_CONST(146442.26262067116/8.0),
15744 REAL_CONST(146468.34606939898/8.0),
15745 REAL_CONST(146494.43067942993/8.0),
15746 REAL_CONST(146520.51645066062/8.0),
15747 REAL_CONST(146546.60338298764/8.0),
15748 REAL_CONST(146572.69147630769/8.0),
15749 REAL_CONST(146598.78073051744/8.0),
15750 REAL_CONST(146624.87114551352/8.0),
15751 REAL_CONST(146650.96272119274/8.0),
15752 REAL_CONST(146677.05545745179/8.0),
15753 REAL_CONST(146703.14935418745/8.0),
15754 REAL_CONST(146729.2444112965/8.0),
15755 REAL_CONST(146755.34062867577/8.0),
15756 REAL_CONST(146781.43800622207/8.0),
15757 REAL_CONST(146807.53654383228/8.0),
15758 REAL_CONST(146833.63624140329/8.0),
15759 REAL_CONST(146859.73709883197/8.0),
15760 REAL_CONST(146885.83911601527/8.0),
15761 REAL_CONST(146911.94229285014/8.0),
15762 REAL_CONST(146938.04662923355/8.0),
15763 REAL_CONST(146964.15212506248/8.0),
15764 REAL_CONST(146990.25878023397/8.0),
15765 REAL_CONST(147016.36659464505/8.0),
15766 REAL_CONST(147042.47556819281/8.0),
15767 REAL_CONST(147068.58570077427/8.0),
15768 REAL_CONST(147094.6969922866/8.0),
15769 REAL_CONST(147120.80944262692/8.0),
15770 REAL_CONST(147146.92305169237/8.0),
15771 REAL_CONST(147173.03781938017/8.0),
15772 REAL_CONST(147199.15374558745/8.0),
15773 REAL_CONST(147225.27083021149/8.0),
15774 REAL_CONST(147251.38907314953/8.0),
15775 REAL_CONST(147277.50847429881/8.0),
15776 REAL_CONST(147303.62903355664/8.0),
15777 REAL_CONST(147329.75075082036/8.0),
15778 REAL_CONST(147355.87362598727/8.0),
15779 REAL_CONST(147381.99765895473/8.0),
15780 REAL_CONST(147408.12284962015/8.0),
15781 REAL_CONST(147434.24919788091/8.0),
15782 REAL_CONST(147460.37670363448/8.0),
15783 REAL_CONST(147486.50536677826/8.0),
15784 REAL_CONST(147512.63518720976/8.0),
15785 REAL_CONST(147538.76616482646/8.0),
15786 REAL_CONST(147564.89829952587/8.0),
15787 REAL_CONST(147591.03159120557/8.0),
15788 REAL_CONST(147617.16603976308/8.0),
15789 REAL_CONST(147643.30164509601/8.0),
15790 REAL_CONST(147669.43840710199/8.0),
15791 REAL_CONST(147695.57632567859/8.0),
15792 REAL_CONST(147721.71540072354/8.0),
15793 REAL_CONST(147747.85563213445/8.0),
15794 REAL_CONST(147773.99701980909/8.0),
15795 REAL_CONST(147800.13956364512/8.0),
15796 REAL_CONST(147826.28326354033/8.0),
15797 REAL_CONST(147852.42811939248/8.0),
15798 REAL_CONST(147878.57413109933/8.0),
15799 REAL_CONST(147904.72129855872/8.0),
15800 REAL_CONST(147930.86962166851/8.0),
15801 REAL_CONST(147957.01910032652/8.0),
15802 REAL_CONST(147983.16973443062/8.0),
15803 REAL_CONST(148009.32152387875/8.0),
15804 REAL_CONST(148035.47446856883/8.0),
15805 REAL_CONST(148061.62856839882/8.0),
15806 REAL_CONST(148087.78382326665/8.0),
15807 REAL_CONST(148113.94023307035/8.0),
15808 REAL_CONST(148140.09779770792/8.0),
15809 REAL_CONST(148166.25651707739/8.0),
15810 REAL_CONST(148192.41639107687/8.0),
15811 REAL_CONST(148218.57741960438/8.0),
15812 REAL_CONST(148244.73960255808/8.0),
15813 REAL_CONST(148270.90293983606/8.0),
15814 REAL_CONST(148297.0674313365/8.0),
15815 REAL_CONST(148323.23307695755/8.0),
15816 REAL_CONST(148349.39987659742/8.0),
15817 REAL_CONST(148375.56783015432/8.0),
15818 REAL_CONST(148401.73693752653/8.0),
15819 REAL_CONST(148427.90719861226/8.0),
15820 REAL_CONST(148454.07861330983/8.0),
15821 REAL_CONST(148480.25118151752/8.0),
15822 REAL_CONST(148506.42490313368/8.0),
15823 REAL_CONST(148532.59977805667/8.0),
15824 REAL_CONST(148558.77580618486/8.0),
15825 REAL_CONST(148584.95298741665/8.0),
15826 REAL_CONST(148611.13132165043/8.0),
15827 REAL_CONST(148637.31080878471/8.0),
15828 REAL_CONST(148663.49144871789/8.0),
15829 REAL_CONST(148689.6732413485/8.0),
15830 REAL_CONST(148715.85618657502/8.0),
15831 REAL_CONST(148742.040284296/8.0),
15832 REAL_CONST(148768.22553440998/8.0),
15833 REAL_CONST(148794.41193681557/8.0),
15834 REAL_CONST(148820.59949141133/8.0),
15835 REAL_CONST(148846.78819809589/8.0),
15836 REAL_CONST(148872.97805676793/8.0),
15837 REAL_CONST(148899.16906732606/8.0),
15838 REAL_CONST(148925.36122966901/8.0),
15839 REAL_CONST(148951.55454369547/8.0),
15840 REAL_CONST(148977.74900930419/8.0),
15841 REAL_CONST(149003.9446263939/8.0),
15842 REAL_CONST(149030.1413948634/8.0),
15843 REAL_CONST(149056.33931461151/8.0),
15844 REAL_CONST(149082.53838553699/8.0),
15845 REAL_CONST(149108.73860753875/8.0),
15846 REAL_CONST(149134.9399805156/8.0),
15847 REAL_CONST(149161.14250436646/8.0),
15848 REAL_CONST(149187.34617899026/8.0),
15849 REAL_CONST(149213.5510042859/8.0),
15850 REAL_CONST(149239.75698015234/8.0),
15851 REAL_CONST(149265.96410648854/8.0),
15852 REAL_CONST(149292.17238319354/8.0),
15853 REAL_CONST(149318.38181016635/8.0),
15854 REAL_CONST(149344.59238730598/8.0),
15855 REAL_CONST(149370.80411451156/8.0),
15856 REAL_CONST(149397.01699168212/8.0),
15857 REAL_CONST(149423.23101871679/8.0),
15858 REAL_CONST(149449.44619551473/8.0),
15859 REAL_CONST(149475.66252197503/8.0),
15860 REAL_CONST(149501.87999799693/8.0),
15861 REAL_CONST(149528.0986234796/8.0),
15862 REAL_CONST(149554.31839832227/8.0),
15863 REAL_CONST(149580.53932242419/8.0),
15864 REAL_CONST(149606.76139568459/8.0),
15865 REAL_CONST(149632.98461800278/8.0),
15866 REAL_CONST(149659.20898927809/8.0),
15867 REAL_CONST(149685.43450940982/8.0),
15868 REAL_CONST(149711.66117829733/8.0),
15869 REAL_CONST(149737.88899584001/8.0),
15870 REAL_CONST(149764.11796193724/8.0),
15871 REAL_CONST(149790.34807648844/8.0),
15872 REAL_CONST(149816.57933939309/8.0),
15873 REAL_CONST(149842.81175055061/8.0),
15874 REAL_CONST(149869.04530986046/8.0),
15875 REAL_CONST(149895.28001722222/8.0),
15876 REAL_CONST(149921.51587253538/8.0),
15877 REAL_CONST(149947.75287569952/8.0),
15878 REAL_CONST(149973.99102661415/8.0),
15879 REAL_CONST(150000.23032517891/8.0),
15880 REAL_CONST(150026.47077129342/8.0),
15881 REAL_CONST(150052.71236485732/8.0),
15882 REAL_CONST(150078.95510577026/8.0),
15883 REAL_CONST(150105.1989939319/8.0),
15884 REAL_CONST(150131.444029242/8.0),
15885 REAL_CONST(150157.69021160025/8.0),
15886 REAL_CONST(150183.93754090639/8.0),
15887 REAL_CONST(150210.18601706024/8.0),
15888 REAL_CONST(150236.43563996154/8.0),
15889 REAL_CONST(150262.68640951012/8.0),
15890 REAL_CONST(150288.93832560582/8.0),
15891 REAL_CONST(150315.19138814852/8.0),
15892 REAL_CONST(150341.44559703805/8.0),
15893 REAL_CONST(150367.70095217437/8.0),
15894 REAL_CONST(150393.95745345735/8.0),
15895 REAL_CONST(150420.21510078697/8.0),
15896 REAL_CONST(150446.47389406321/8.0),
15897 REAL_CONST(150472.73383318601/8.0),
15898 REAL_CONST(150498.99491805542/8.0),
15899 REAL_CONST(150525.25714857146/8.0),
15900 REAL_CONST(150551.52052463419/8.0),
15901 REAL_CONST(150577.78504614369/8.0),
15902 REAL_CONST(150604.05071300003/8.0),
15903 REAL_CONST(150630.31752510337/8.0),
15904 REAL_CONST(150656.58548235384/8.0),
15905 REAL_CONST(150682.85458465159/8.0),
15906 REAL_CONST(150709.1248318968/8.0),
15907 REAL_CONST(150735.39622398972/8.0),
15908 REAL_CONST(150761.66876083051/8.0),
15909 REAL_CONST(150787.9424423195/8.0),
15910 REAL_CONST(150814.21726835691/8.0),
15911 REAL_CONST(150840.49323884305/8.0),
15912 REAL_CONST(150866.77035367821/8.0),
15913 REAL_CONST(150893.04861276277/8.0),
15914 REAL_CONST(150919.32801599705/8.0),
15915 REAL_CONST(150945.60856328148/8.0),
15916 REAL_CONST(150971.89025451642/8.0),
15917 REAL_CONST(150998.17308960229/8.0),
15918 REAL_CONST(151024.45706843957/8.0),
15919 REAL_CONST(151050.74219092872/8.0),
15920 REAL_CONST(151077.02845697021/8.0),
15921 REAL_CONST(151103.31586646455/8.0),
15922 REAL_CONST(151129.60441931229/8.0),
15923 REAL_CONST(151155.894115414/8.0),
15924 REAL_CONST(151182.1849546702/8.0),
15925 REAL_CONST(151208.47693698155/8.0),
15926 REAL_CONST(151234.77006224863/8.0),
15927 REAL_CONST(151261.06433037209/8.0),
15928 REAL_CONST(151287.35974125259/8.0),
15929 REAL_CONST(151313.65629479082/8.0),
15930 REAL_CONST(151339.95399088747/8.0),
15931 REAL_CONST(151366.25282944329/8.0),
15932 REAL_CONST(151392.55281035902/8.0),
15933 REAL_CONST(151418.85393353543/8.0),
15934 REAL_CONST(151445.1561988733/8.0),
15935 REAL_CONST(151471.45960627345/8.0),
15936 REAL_CONST(151497.76415563675/8.0),
15937 REAL_CONST(151524.06984686397/8.0),
15938 REAL_CONST(151550.37667985607/8.0),
15939 REAL_CONST(151576.68465451393/8.0),
15940 REAL_CONST(151602.99377073845/8.0),
15941 REAL_CONST(151629.30402843058/8.0),
15942 REAL_CONST(151655.61542749128/8.0),
15943 REAL_CONST(151681.92796782157/8.0),
15944 REAL_CONST(151708.24164932242/8.0),
15945 REAL_CONST(151734.55647189484/8.0),
15946 REAL_CONST(151760.87243543993/8.0),
15947 REAL_CONST(151787.18953985872/8.0),
15948 REAL_CONST(151813.50778505235/8.0),
15949 REAL_CONST(151839.82717092187/8.0),
15950 REAL_CONST(151866.14769736846/8.0),
15951 REAL_CONST(151892.46936429327/8.0),
15952 REAL_CONST(151918.79217159748/8.0),
15953 REAL_CONST(151945.11611918229/8.0),
15954 REAL_CONST(151971.44120694889/8.0),
15955 REAL_CONST(151997.76743479856/8.0),
15956 REAL_CONST(152024.09480263255/8.0),
15957 REAL_CONST(152050.42331035214/8.0),
15958 REAL_CONST(152076.75295785864/8.0),
15959 REAL_CONST(152103.08374505339/8.0),
15960 REAL_CONST(152129.41567183775/8.0),
15961 REAL_CONST(152155.74873811303/8.0),
15962 REAL_CONST(152182.08294378067/8.0),
15963 REAL_CONST(152208.41828874208/8.0),
15964 REAL_CONST(152234.75477289871/8.0),
15965 REAL_CONST(152261.09239615197/8.0),
15966 REAL_CONST(152287.43115840337/8.0),
15967 REAL_CONST(152313.77105955439/8.0),
15968 REAL_CONST(152340.11209950657/8.0),
15969 REAL_CONST(152366.45427816146/8.0),
15970 REAL_CONST(152392.79759542056/8.0),
15971 REAL_CONST(152419.14205118554/8.0),
15972 REAL_CONST(152445.48764535793/8.0),
15973 REAL_CONST(152471.8343778394/8.0),
15974 REAL_CONST(152498.18224853161/8.0),
15975 REAL_CONST(152524.53125733617/8.0),
15976 REAL_CONST(152550.88140415482/8.0),
15977 REAL_CONST(152577.23268888926/8.0),
15978 REAL_CONST(152603.58511144121/8.0),
15979 REAL_CONST(152629.93867171241/8.0),
15980 REAL_CONST(152656.29336960468/8.0),
15981 REAL_CONST(152682.64920501978/8.0),
15982 REAL_CONST(152709.00617785956/8.0),
15983 REAL_CONST(152735.36428802583/8.0),
15984 REAL_CONST(152761.72353542043/8.0),
15985 REAL_CONST(152788.08391994529/8.0),
15986 REAL_CONST(152814.44544150229/8.0),
15987 REAL_CONST(152840.80809999333/8.0),
15988 REAL_CONST(152867.17189532038/8.0),
15989 REAL_CONST(152893.53682738543/8.0),
15990 REAL_CONST(152919.90289609041/8.0),
15991 REAL_CONST(152946.27010133737/8.0),
15992 REAL_CONST(152972.63844302832/8.0),
15993 REAL_CONST(152999.00792106529/8.0),
15994 REAL_CONST(153025.37853535041/8.0),
15995 REAL_CONST(153051.7502857857/8.0),
15996 REAL_CONST(153078.12317227334/8.0),
15997 REAL_CONST(153104.4971947154/8.0),
15998 REAL_CONST(153130.8723530141/8.0),
15999 REAL_CONST(153157.24864707157/8.0),
16000 REAL_CONST(153183.62607679001/8.0),
16001 REAL_CONST(153210.00464207167/8.0),
16002 REAL_CONST(153236.38434281875/8.0),
16003 REAL_CONST(153262.76517893354/8.0),
16004 REAL_CONST(153289.14715031831/8.0),
16005 REAL_CONST(153315.53025687535/8.0),
16006 REAL_CONST(153341.91449850702/8.0),
16007 REAL_CONST(153368.2998751156/8.0),
16008 REAL_CONST(153394.68638660354/8.0),
16009 REAL_CONST(153421.07403287315/8.0),
16010 REAL_CONST(153447.46281382689/8.0),
16011 REAL_CONST(153473.85272936718/8.0),
16012 REAL_CONST(153500.24377939643/8.0),
16013 REAL_CONST(153526.63596381716/8.0),
16014 REAL_CONST(153553.02928253182/8.0),
16015 REAL_CONST(153579.42373544298/8.0),
16016 REAL_CONST(153605.81932245308/8.0),
16017 REAL_CONST(153632.21604346478/8.0),
16018 REAL_CONST(153658.61389838057/8.0),
16019 REAL_CONST(153685.0128871031/8.0),
16020 REAL_CONST(153711.41300953497/8.0),
16021 REAL_CONST(153737.81426557881/8.0),
16022 REAL_CONST(153764.21665513728/8.0),
16023 REAL_CONST(153790.62017811305/8.0),
16024 REAL_CONST(153817.02483440886/8.0),
16025 REAL_CONST(153843.43062392739/8.0),
16026 REAL_CONST(153869.83754657139/8.0),
16027 REAL_CONST(153896.24560224367/8.0),
16028 REAL_CONST(153922.65479084692/8.0),
16029 REAL_CONST(153949.06511228404/8.0),
16030 REAL_CONST(153975.4765664578/8.0),
16031 REAL_CONST(154001.88915327107/8.0),
16032 REAL_CONST(154028.30287262669/8.0),
16033 REAL_CONST(154054.71772442761/8.0),
16034 REAL_CONST(154081.13370857667/8.0),
16035 REAL_CONST(154107.55082497682/8.0),
16036 REAL_CONST(154133.96907353101/8.0),
16037 REAL_CONST(154160.38845414223/8.0),
16038 REAL_CONST(154186.80896671346/8.0),
16039 REAL_CONST(154213.23061114774/8.0),
16040 REAL_CONST(154239.65338734805/8.0),
16041 REAL_CONST(154266.07729521746/8.0),
16042 REAL_CONST(154292.50233465908/8.0),
16043 REAL_CONST(154318.92850557598/8.0),
16044 REAL_CONST(154345.35580787127/8.0),
16045 REAL_CONST(154371.7842414481/8.0),
16046 REAL_CONST(154398.21380620965/8.0),
16047 REAL_CONST(154424.64450205903/8.0),
16048 REAL_CONST(154451.07632889951/8.0),
16049 REAL_CONST(154477.50928663427/8.0),
16050 REAL_CONST(154503.94337516659/8.0),
16051 REAL_CONST(154530.37859439969/8.0),
16052 REAL_CONST(154556.81494423689/8.0),
16053 REAL_CONST(154583.25242458144/8.0),
16054 REAL_CONST(154609.69103533673/8.0),
16055 REAL_CONST(154636.13077640603/8.0),
16056 REAL_CONST(154662.57164769279/8.0),
16057 REAL_CONST(154689.01364910032/8.0),
16058 REAL_CONST(154715.45678053208/8.0),
16059 REAL_CONST(154741.90104189145/8.0),
16060 REAL_CONST(154768.34643308193/8.0),
16061 REAL_CONST(154794.79295400696/8.0),
16062 REAL_CONST(154821.24060457002/8.0),
16063 REAL_CONST(154847.68938467462/8.0),
16064 REAL_CONST(154874.13929422433/8.0),
16065 REAL_CONST(154900.59033312264/8.0),
16066 REAL_CONST(154927.04250127316/8.0),
16067 REAL_CONST(154953.49579857948/8.0),
16068 REAL_CONST(154979.95022494521/8.0),
16069 REAL_CONST(155006.40578027396/8.0),
16070 REAL_CONST(155032.86246446942/8.0),
16071 REAL_CONST(155059.32027743524/8.0),
16072 REAL_CONST(155085.77921907514/8.0),
16073 REAL_CONST(155112.2392892928/8.0),
16074 REAL_CONST(155138.70048799197/8.0),
16075 REAL_CONST(155165.16281507642/8.0),
16076 REAL_CONST(155191.62627044989/8.0),
16077 REAL_CONST(155218.09085401625/8.0),
16078 REAL_CONST(155244.55656567923/8.0),
16079 REAL_CONST(155271.02340534274/8.0),
16080 REAL_CONST(155297.49137291059/8.0),
16081 REAL_CONST(155323.96046828668/8.0),
16082 REAL_CONST(155350.4306913749/8.0),
16083 REAL_CONST(155376.90204207919/8.0),
16084 REAL_CONST(155403.37452030348/8.0),
16085 REAL_CONST(155429.84812595171/8.0),
16086 REAL_CONST(155456.32285892789/8.0),
16087 REAL_CONST(155482.79871913602/8.0),
16088 REAL_CONST(155509.27570648011/8.0),
16089 REAL_CONST(155535.75382086422/8.0),
16090 REAL_CONST(155562.23306219239/8.0),
16091 REAL_CONST(155588.71343036872/8.0),
16092 REAL_CONST(155615.19492529731/8.0),
16093 REAL_CONST(155641.67754688227/8.0),
16094 REAL_CONST(155668.16129502779/8.0),
16095 REAL_CONST(155694.64616963797/8.0),
16096 REAL_CONST(155721.13217061706/8.0),
16097 REAL_CONST(155747.61929786921/8.0),
16098 REAL_CONST(155774.10755129869/8.0),
16099 REAL_CONST(155800.59693080973/8.0),
16100 REAL_CONST(155827.08743630661/8.0),
16101 REAL_CONST(155853.57906769359/8.0),
16102 REAL_CONST(155880.07182487496/8.0),
16103 REAL_CONST(155906.56570775513/8.0),
16104 REAL_CONST(155933.06071623837/8.0),
16105 REAL_CONST(155959.55685022907/8.0),
16106 REAL_CONST(155986.05410963166/8.0),
16107 REAL_CONST(156012.5524943505/8.0),
16108 REAL_CONST(156039.05200429002/8.0),
16109 REAL_CONST(156065.55263935472/8.0),
16110 REAL_CONST(156092.054399449/8.0),
16111 REAL_CONST(156118.5572844774/8.0),
16112 REAL_CONST(156145.06129434443/8.0),
16113 REAL_CONST(156171.5664289546/8.0),
16114 REAL_CONST(156198.07268821247/8.0),
16115 REAL_CONST(156224.5800720226/8.0),
16116 REAL_CONST(156251.08858028959/8.0),
16117 REAL_CONST(156277.59821291809/8.0),
16118 REAL_CONST(156304.10896981266/8.0),
16119 REAL_CONST(156330.62085087801/8.0),
16120 REAL_CONST(156357.1338560188/8.0),
16121 REAL_CONST(156383.64798513969/8.0),
16122 REAL_CONST(156410.16323814544/8.0),
16123 REAL_CONST(156436.67961494075/8.0),
16124 REAL_CONST(156463.1971154304/8.0),
16125 REAL_CONST(156489.71573951913/8.0),
16126 REAL_CONST(156516.23548711176/8.0),
16127 REAL_CONST(156542.75635811311/8.0),
16128 REAL_CONST(156569.27835242799/8.0),
16129 REAL_CONST(156595.80146996127/8.0),
16130 REAL_CONST(156622.32571061782/8.0),
16131 REAL_CONST(156648.85107430254/8.0),
16132 REAL_CONST(156675.37756092031/8.0),
16133 REAL_CONST(156701.90517037612/8.0),
16134 REAL_CONST(156728.43390257491/8.0),
16135 REAL_CONST(156754.96375742162/8.0),
16136 REAL_CONST(156781.49473482129/8.0),
16137 REAL_CONST(156808.02683467892/8.0),
16138 REAL_CONST(156834.5600568995/8.0),
16139 REAL_CONST(156861.09440138817/8.0),
16140 REAL_CONST(156887.62986804993/8.0),
16141 REAL_CONST(156914.16645678994/8.0),
16142 REAL_CONST(156940.70416751326/8.0),
16143 REAL_CONST(156967.24300012505/8.0),
16144 REAL_CONST(156993.78295453047/8.0),
16145 REAL_CONST(157020.32403063469/8.0),
16146 REAL_CONST(157046.8662283429/8.0),
16147 REAL_CONST(157073.40954756032/8.0),
16148 REAL_CONST(157099.9539881922/8.0),
16149 REAL_CONST(157126.49955014378/8.0),
16150 REAL_CONST(157153.04623332032/8.0),
16151 REAL_CONST(157179.59403762716/8.0),
16152 REAL_CONST(157206.14296296958/8.0),
16153 REAL_CONST(157232.69300925292/8.0),
16154 REAL_CONST(157259.24417638258/8.0),
16155 REAL_CONST(157285.79646426387/8.0),
16156 REAL_CONST(157312.34987280221/8.0),
16157 REAL_CONST(157338.90440190304/8.0),
16158 REAL_CONST(157365.46005147175/8.0),
16159 REAL_CONST(157392.01682141385/8.0),
16160 REAL_CONST(157418.57471163478/8.0),
16161 REAL_CONST(157445.13372204005/8.0),
16162 REAL_CONST(157471.69385253513/8.0),
16163 REAL_CONST(157498.25510302564/8.0),
16164 REAL_CONST(157524.81747341706/8.0),
16165 REAL_CONST(157551.38096361503/8.0),
16166 REAL_CONST(157577.9455735251/8.0),
16167 REAL_CONST(157604.51130305286/8.0),
16168 REAL_CONST(157631.07815210402/8.0),
16169 REAL_CONST(157657.64612058419/8.0),
16170 REAL_CONST(157684.21520839902/8.0),
16171 REAL_CONST(157710.78541545427/8.0),
16172 REAL_CONST(157737.35674165559/8.0),
16173 REAL_CONST(157763.92918690876/8.0),
16174 REAL_CONST(157790.50275111952/8.0),
16175 REAL_CONST(157817.07743419363/8.0),
16176 REAL_CONST(157843.65323603692/8.0),
16177 REAL_CONST(157870.23015655516/8.0),
16178 REAL_CONST(157896.80819565422/8.0),
16179 REAL_CONST(157923.3873532399/8.0),
16180 REAL_CONST(157949.96762921812/8.0),
16181 REAL_CONST(157976.54902349479/8.0),
16182 REAL_CONST(158003.13153597576/8.0),
16183 REAL_CONST(158029.71516656701/8.0),
16184 REAL_CONST(158056.29991517449/8.0),
16185 REAL_CONST(158082.88578170416/8.0),
16186 REAL_CONST(158109.47276606198/8.0),
16187 REAL_CONST(158136.06086815402/8.0),
16188 REAL_CONST(158162.65008788629/8.0),
16189 REAL_CONST(158189.24042516484/8.0),
16190 REAL_CONST(158215.83187989573/8.0),
16191 REAL_CONST(158242.42445198505/8.0),
16192 REAL_CONST(158269.01814133892/8.0),
16193 REAL_CONST(158295.61294786347/8.0),
16194 REAL_CONST(158322.20887146486/8.0),
16195 REAL_CONST(158348.80591204923/8.0),
16196 REAL_CONST(158375.4040695228/8.0),
16197 REAL_CONST(158402.00334379176/8.0),
16198 REAL_CONST(158428.60373476235/8.0),
16199 REAL_CONST(158455.2052423408/8.0),
16200 REAL_CONST(158481.80786643337/8.0),
16201 REAL_CONST(158508.41160694641/8.0),
16202 REAL_CONST(158535.01646378616/8.0),
16203 REAL_CONST(158561.62243685898/8.0),
16204 REAL_CONST(158588.2295260712/8.0),
16205 REAL_CONST(158614.8377313292/8.0),
16206 REAL_CONST(158641.44705253936/8.0),
16207 REAL_CONST(158668.05748960807/8.0),
16208 REAL_CONST(158694.66904244179/8.0),
16209 REAL_CONST(158721.28171094693/8.0),
16210 REAL_CONST(158747.89549502998/8.0),
16211 REAL_CONST(158774.5103945974/8.0),
16212 REAL_CONST(158801.12640955573/8.0),
16213 REAL_CONST(158827.74353981143/8.0),
16214 REAL_CONST(158854.36178527112/8.0),
16215 REAL_CONST(158880.9811458413/8.0),
16216 REAL_CONST(158907.60162142856/8.0),
16217 REAL_CONST(158934.22321193956/8.0),
16218 REAL_CONST(158960.84591728085/8.0),
16219 REAL_CONST(158987.46973735912/8.0),
16220 REAL_CONST(159014.09467208097/8.0),
16221 REAL_CONST(159040.72072135314/8.0),
16222 REAL_CONST(159067.3478850823/8.0),
16223 REAL_CONST(159093.97616317519/8.0),
16224 REAL_CONST(159120.60555553852/8.0),
16225 REAL_CONST(159147.23606207906/8.0),
16226 REAL_CONST(159173.8676827036/8.0),
16227 REAL_CONST(159200.50041731889/8.0),
16228 REAL_CONST(159227.13426583182/8.0),
16229 REAL_CONST(159253.76922814918/8.0),
16230 REAL_CONST(159280.40530417781/8.0),
16231 REAL_CONST(159307.04249382461/8.0),
16232 REAL_CONST(159333.68079699649/8.0),
16233 REAL_CONST(159360.32021360032/8.0),
16234 REAL_CONST(159386.96074354305/8.0),
16235 REAL_CONST(159413.60238673165/8.0),
16236 REAL_CONST(159440.24514307309/8.0),
16237 REAL_CONST(159466.88901247433/8.0),
16238 REAL_CONST(159493.53399484244/8.0),
16239 REAL_CONST(159520.18009008438/8.0),
16240 REAL_CONST(159546.82729810724/8.0),
16241 REAL_CONST(159573.47561881805/8.0),
16242 REAL_CONST(159600.12505212394/8.0),
16243 REAL_CONST(159626.77559793202/8.0),
16244 REAL_CONST(159653.42725614941/8.0),
16245 REAL_CONST(159680.08002668325/8.0),
16246 REAL_CONST(159706.73390944069/8.0),
16247 REAL_CONST(159733.38890432892/8.0),
16248 REAL_CONST(159760.04501125516/8.0),
16249 REAL_CONST(159786.70223012666/8.0),
16250 REAL_CONST(159813.36056085059/8.0),
16251 REAL_CONST(159840.02000333427/8.0),
16252 REAL_CONST(159866.68055748497/8.0),
16253 REAL_CONST(159893.34222320997/8.0),
16254 REAL_CONST(159920.00500041663/8.0),
16255 REAL_CONST(159946.66888901225/8.0),
16256 REAL_CONST(159973.33388890422/8.0),
16257 REAL_CONST(159999.99999999988/8.0),
16258 REAL_CONST(160026.66722220668/8.0),
16259 REAL_CONST(160053.33555543202/8.0),
16260 REAL_CONST(160080.0049995833/8.0),
16261 REAL_CONST(160106.67555456801/8.0),
16262 REAL_CONST(160133.3472202936/8.0),
16263 REAL_CONST(160160.0199966676/8.0),
16264 REAL_CONST(160186.6938835975/8.0),
16265 REAL_CONST(160213.36888099083/8.0),
16266 REAL_CONST(160240.04498875517/8.0),
16267 REAL_CONST(160266.72220679806/8.0),
16268 REAL_CONST(160293.40053502709/8.0),
16269 REAL_CONST(160320.07997334987/8.0),
16270 REAL_CONST(160346.76052167406/8.0),
16271 REAL_CONST(160373.44217990729/8.0),
16272 REAL_CONST(160400.1249479572/8.0),
16273 REAL_CONST(160426.80882573154/8.0),
16274 REAL_CONST(160453.49381313793/8.0),
16275 REAL_CONST(160480.17991008417/8.0),
16276 REAL_CONST(160506.86711647795/8.0),
16277 REAL_CONST(160533.55543222709/8.0),
16278 REAL_CONST(160560.24485723933/8.0),
16279 REAL_CONST(160586.93539142248/8.0),
16280 REAL_CONST(160613.62703468435/8.0),
16281 REAL_CONST(160640.31978693281/8.0),
16282 REAL_CONST(160667.01364807569/8.0),
16283 REAL_CONST(160693.70861802087/8.0),
16284 REAL_CONST(160720.40469667627/8.0),
16285 REAL_CONST(160747.1018839498/8.0),
16286 REAL_CONST(160773.80017974938/8.0),
16287 REAL_CONST(160800.49958398298/8.0),
16288 REAL_CONST(160827.20009655855/8.0),
16289 REAL_CONST(160853.90171738411/8.0),
16290 REAL_CONST(160880.60444636765/8.0),
16291 REAL_CONST(160907.30828341722/8.0),
16292 REAL_CONST(160934.01322844089/8.0),
16293 REAL_CONST(160960.71928134665/8.0),
16294 REAL_CONST(160987.42644204266/8.0),
16295 REAL_CONST(161014.13471043704/8.0),
16296 REAL_CONST(161040.84408643784/8.0),
16297 REAL_CONST(161067.55456995327/8.0),
16298 REAL_CONST(161094.26616089148/8.0),
16299 REAL_CONST(161120.97885916062/8.0),
16300 REAL_CONST(161147.69266466892/8.0),
16301 REAL_CONST(161174.40757732463/8.0),
16302 REAL_CONST(161201.12359703594/8.0),
16303 REAL_CONST(161227.84072371112/8.0),
16304 REAL_CONST(161254.55895725847/8.0),
16305 REAL_CONST(161281.27829758628/8.0),
16306 REAL_CONST(161307.99874460287/8.0),
16307 REAL_CONST(161334.72029821656/8.0),
16308 REAL_CONST(161361.44295833571/8.0),
16309 REAL_CONST(161388.1667248687/8.0),
16310 REAL_CONST(161414.89159772391/8.0),
16311 REAL_CONST(161441.61757680977/8.0),
16312 REAL_CONST(161468.34466203468/8.0),
16313 REAL_CONST(161495.07285330712/8.0),
16314 REAL_CONST(161521.80215053557/8.0),
16315 REAL_CONST(161548.53255362847/8.0),
16316 REAL_CONST(161575.26406249436/8.0),
16317 REAL_CONST(161601.99667704175/8.0),
16318 REAL_CONST(161628.7303971792/8.0),
16319 REAL_CONST(161655.46522281526/8.0),
16320 REAL_CONST(161682.20115385848/8.0),
16321 REAL_CONST(161708.93819021754/8.0),
16322 REAL_CONST(161735.67633180099/8.0),
16323 REAL_CONST(161762.41557851751/8.0),
16324 REAL_CONST(161789.15593027571/8.0),
16325 REAL_CONST(161815.89738698432/8.0),
16326 REAL_CONST(161842.63994855201/8.0),
16327 REAL_CONST(161869.38361488748/8.0),
16328 REAL_CONST(161896.1283858995/8.0),
16329 REAL_CONST(161922.87426149679/8.0),
16330 REAL_CONST(161949.62124158812/8.0),
16331 REAL_CONST(161976.36932608229/8.0),
16332 REAL_CONST(162003.1185148881/8.0),
16333 REAL_CONST(162029.8688079144/8.0),
16334 REAL_CONST(162056.62020507001/8.0),
16335 REAL_CONST(162083.37270626382/8.0),
16336 REAL_CONST(162110.12631140469/8.0),
16337 REAL_CONST(162136.88102040152/8.0),
16338 REAL_CONST(162163.63683316324/8.0),
16339 REAL_CONST(162190.39374959879/8.0),
16340 REAL_CONST(162217.15176961714/8.0),
16341 REAL_CONST(162243.91089312723/8.0),
16342 REAL_CONST(162270.67112003808/8.0),
16343 REAL_CONST(162297.43245025873/8.0),
16344 REAL_CONST(162324.19488369819/8.0),
16345 REAL_CONST(162350.9584202655/8.0),
16346 REAL_CONST(162377.72305986975/8.0),
16347 REAL_CONST(162404.48880242003/8.0),
16348 REAL_CONST(162431.25564782543/8.0),
16349 REAL_CONST(162458.02359599507/8.0),
16350 REAL_CONST(162484.79264683815/8.0),
16351 REAL_CONST(162511.56280026378/8.0),
16352 REAL_CONST(162538.33405618116/8.0),
16353 REAL_CONST(162565.10641449949/8.0),
16354 REAL_CONST(162591.87987512801/8.0),
16355 REAL_CONST(162618.65443797593/8.0),
16356 REAL_CONST(162645.43010295252/8.0),
16357 REAL_CONST(162672.20686996708/8.0),
16358 REAL_CONST(162698.98473892888/8.0),
16359 REAL_CONST(162725.76370974723/8.0),
16360 REAL_CONST(162752.54378233149/8.0),
16361 REAL_CONST(162779.32495659095/8.0),
16362 REAL_CONST(162806.10723243505/8.0),
16363 REAL_CONST(162832.89060977317/8.0),
16364 REAL_CONST(162859.67508851466/8.0),
16365 REAL_CONST(162886.46066856899/8.0),
16366 REAL_CONST(162913.24734984562/8.0),
16367 REAL_CONST(162940.03513225398/8.0),
16368 REAL_CONST(162966.82401570358/8.0),
16369 REAL_CONST(162993.6140001039/8.0),
16370 REAL_CONST(163020.40508536444/8.0),
16371 REAL_CONST(163047.19727139481/8.0),
16372 REAL_CONST(163073.99055810447/8.0),
16373 REAL_CONST(163100.78494540305/8.0),
16374 REAL_CONST(163127.58043320014/8.0),
16375 REAL_CONST(163154.37702140535/8.0),
16376 REAL_CONST(163181.17470992831/8.0),
16377 REAL_CONST(163207.97349867865/8.0),
16378 REAL_CONST(163234.77338756606/8.0),
16379 REAL_CONST(163261.57437650024/8.0),
16380 REAL_CONST(163288.37646539087/8.0),
16381 REAL_CONST(163315.17965414765/8.0),
16382 REAL_CONST(163341.98394268038/8.0),
16383 REAL_CONST(163368.78933089875/8.0),
16384 REAL_CONST(163395.59581871261/8.0),
16385 REAL_CONST(163422.40340603172/8.0),
16386 REAL_CONST(163449.2120927659/8.0),
16387 REAL_CONST(163476.02187882498/8.0),
16388 REAL_CONST(163502.83276411882/8.0),
16389 REAL_CONST(163529.6447485573/8.0),
16390 REAL_CONST(163556.45783205028/8.0),
16391 REAL_CONST(163583.2720145077/8.0),
16392 REAL_CONST(163610.08729583945/8.0),
16393 REAL_CONST(163636.90367595552/8.0),
16394 REAL_CONST(163663.72115476584/8.0),
16395 REAL_CONST(163690.53973218042/8.0),
16396 REAL_CONST(163717.35940810922/8.0),
16397 REAL_CONST(163744.18018246227/8.0),
16398 REAL_CONST(163771.00205514964/8.0),
16399 REAL_CONST(163797.82502608138/8.0),
16400 REAL_CONST(163824.64909516752/8.0),
16401 REAL_CONST(163851.4742623182/8.0),
16402 REAL_CONST(163878.3005274435/8.0),
16403 REAL_CONST(163905.12789045356/8.0),
16404 REAL_CONST(163931.95635125853/8.0),
16405 REAL_CONST(163958.78590976857/8.0),
16406 REAL_CONST(163985.61656589387/8.0),
16407 REAL_CONST(164012.44831954464/8.0),
16408 REAL_CONST(164039.28117063109/8.0),
16409 REAL_CONST(164066.11511906344/8.0),
16410 REAL_CONST(164092.95016475199/8.0),
16411 REAL_CONST(164119.78630760699/8.0),
16412 REAL_CONST(164146.62354753874/8.0),
16413 REAL_CONST(164173.46188445756/8.0),
16414 REAL_CONST(164200.30131827376/8.0),
16415 REAL_CONST(164227.14184889771/8.0),
16416 REAL_CONST(164253.98347623978/8.0),
16417 REAL_CONST(164280.82620021031/8.0),
16418 REAL_CONST(164307.67002071979/8.0),
16419 REAL_CONST(164334.51493767856/8.0),
16420 REAL_CONST(164361.3609509971/8.0),
16421 REAL_CONST(164388.20806058586/8.0),
16422 REAL_CONST(164415.05626635533/8.0),
16423 REAL_CONST(164441.905568216/8.0),
16424 REAL_CONST(164468.75596607837/8.0),
16425 REAL_CONST(164495.607459853/8.0),
16426 REAL_CONST(164522.4600494504/8.0),
16427 REAL_CONST(164549.31373478117/8.0),
16428 REAL_CONST(164576.16851575591/8.0),
16429 REAL_CONST(164603.02439228518/8.0),
16430 REAL_CONST(164629.88136427966/8.0),
16431 REAL_CONST(164656.73943164994/8.0),
16432 REAL_CONST(164683.59859430668/8.0),
16433 REAL_CONST(164710.45885216061/8.0),
16434 REAL_CONST(164737.32020512238/8.0),
16435 REAL_CONST(164764.1826531027/8.0),
16436 REAL_CONST(164791.04619601235/8.0),
16437 REAL_CONST(164817.91083376206/8.0),
16438 REAL_CONST(164844.77656626256/8.0),
16439 REAL_CONST(164871.64339342469/8.0),
16440 REAL_CONST(164898.51131515924/8.0),
16441 REAL_CONST(164925.38033137703/8.0),
16442 REAL_CONST(164952.25044198887/8.0),
16443 REAL_CONST(164979.1216469057/8.0),
16444 REAL_CONST(165005.9939460383/8.0),
16445 REAL_CONST(165032.86733929763/8.0),
16446 REAL_CONST(165059.7418265946/8.0),
16447 REAL_CONST(165086.61740784015/8.0),
16448 REAL_CONST(165113.4940829452/8.0)
16449 #endif
16450 };
16451
16452 #endif
16453
16454 #ifdef __cplusplus
16455 }
16456 #endif
16457 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: is.c,v 1.28 2007/11/01 12:33:31 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #include "syntax.h"
34 #include "is.h"
35
36 #ifdef FIXED_POINT
37 static real_t pow05_table[] = {
38 COEF_CONST(1.68179283050743), /* 0.5^(-3/4) */
39 COEF_CONST(1.41421356237310), /* 0.5^(-2/4) */
40 COEF_CONST(1.18920711500272), /* 0.5^(-1/4) */
41 COEF_CONST(1.0), /* 0.5^( 0/4) */
42 COEF_CONST(0.84089641525371), /* 0.5^(+1/4) */
43 COEF_CONST(0.70710678118655), /* 0.5^(+2/4) */
44 COEF_CONST(0.59460355750136) /* 0.5^(+3/4) */
45 };
46 #endif
47
48 void is_decode(ic_stream *ics, ic_stream *icsr, real_t *l_spec, real_t *r_spec,
49 uint16_t frame_len)
50 {
51 uint8_t g, sfb, b;
52 uint16_t i;
53 #ifndef FIXED_POINT
54 real_t scale;
55 #else
56 int32_t exp, frac;
57 #endif
58
59 uint16_t nshort = frame_len/8;
60 uint8_t group = 0;
61
62 for (g = 0; g < icsr->num_window_groups; g++)
63 {
64 /* Do intensity stereo decoding */
65 for (b = 0; b < icsr->window_group_length[g]; b++)
66 {
67 for (sfb = 0; sfb < icsr->max_sfb; sfb++)
68 {
69 if (is_intensity(icsr, g, sfb))
70 {
71 #ifdef MAIN_DEC
72 /* For scalefactor bands coded in intensity stereo the
73 corresponding predictors in the right channel are
74 switched to "off".
75 */
76 ics->pred.prediction_used[sfb] = 0;
77 icsr->pred.prediction_used[sfb] = 0;
78 #endif
79
80 #ifndef FIXED_POINT
81 scale = (real_t)pow(0.5, (0.25*icsr->scale_factors[g][sfb]));
82 #else
83 exp = icsr->scale_factors[g][sfb] >> 2;
84 frac = icsr->scale_factors[g][sfb] & 3;
85 #endif
86
87 /* Scale from left to right channel,
88 do not touch left channel */
89 for (i = icsr->swb_offset[sfb]; i < min(icsr->swb_offset[sfb+1], ics->swb_offset_max); i++)
90 {
91 #ifndef FIXED_POINT
92 r_spec[(group*nshort)+i] = MUL_R(l_spec[(group*nshort)+i], scale);
93 #else
94 if (exp < 0)
95 r_spec[(group*nshort)+i] = l_spec[(group*nshort)+i] << -exp;
96 else
97 r_spec[(group*nshort)+i] = l_spec[(group*nshort)+i] >> exp;
98 r_spec[(group*nshort)+i] = MUL_C(r_spec[(group*nshort)+i], pow05_table[frac + 3]);
99 #endif
100 if (is_intensity(icsr, g, sfb) != invert_intensity(ics, g, sfb))
101 r_spec[(group*nshort)+i] = -r_spec[(group*nshort)+i];
102 }
103 }
104 }
105 group++;
106 }
107 }
108 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: is.h,v 1.20 2007/11/01 12:33:31 menno Exp $
28 **/
29
30 #ifndef __IS_H__
31 #define __IS_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #include "syntax.h"
38
39 void is_decode(ic_stream *ics, ic_stream *icsr, real_t *l_spec, real_t *r_spec,
40 uint16_t frame_len);
41
42 static INLINE int8_t is_intensity(ic_stream *ics, uint8_t group, uint8_t sfb)
43 {
44 switch (ics->sfb_cb[group][sfb])
45 {
46 case INTENSITY_HCB:
47 return 1;
48 case INTENSITY_HCB2:
49 return -1;
50 default:
51 return 0;
52 }
53 }
54
55 static INLINE int8_t invert_intensity(ic_stream *ics, uint8_t group, uint8_t sfb)
56 {
57 if (ics->ms_mask_present == 1)
58 return (1-2*ics->ms_used[group][sfb]);
59 return 1;
60 }
61
62
63 #ifdef __cplusplus
64 }
65 #endif
66 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: kbd_win.h,v 1.21 2007/11/01 12:33:31 menno Exp $
28 **/
29
30 #ifndef __KBD_WIN_H__
31 #define __KBD_WIN_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #ifdef _MSC_VER
38 #pragma warning(disable:4305)
39 #pragma warning(disable:4244)
40 #endif
41
42 ALIGN static const real_t kbd_long_1024[] =
43 {
44 FRAC_CONST(0.00029256153896361),
45 FRAC_CONST(0.00042998567353047),
46 FRAC_CONST(0.00054674074589540),
47 FRAC_CONST(0.00065482304299792),
48 FRAC_CONST(0.00075870195068747),
49 FRAC_CONST(0.00086059331713336),
50 FRAC_CONST(0.00096177541439010),
51 FRAC_CONST(0.0010630609410878),
52 FRAC_CONST(0.0011650036308132),
53 FRAC_CONST(0.0012680012194148),
54 FRAC_CONST(0.0013723517232956),
55 FRAC_CONST(0.0014782864109136),
56 FRAC_CONST(0.0015859901976719),
57 FRAC_CONST(0.0016956148252373),
58 FRAC_CONST(0.0018072876903517),
59 FRAC_CONST(0.0019211179405514),
60 FRAC_CONST(0.0020372007924215),
61 FRAC_CONST(0.0021556206591754),
62 FRAC_CONST(0.0022764534599614),
63 FRAC_CONST(0.0023997683540995),
64 FRAC_CONST(0.0025256290631156),
65 FRAC_CONST(0.0026540948920831),
66 FRAC_CONST(0.0027852215281403),
67 FRAC_CONST(0.0029190616715331),
68 FRAC_CONST(0.0030556655443223),
69 FRAC_CONST(0.0031950812943391),
70 FRAC_CONST(0.0033373553240392),
71 FRAC_CONST(0.0034825325586930),
72 FRAC_CONST(0.0036306566699199),
73 FRAC_CONST(0.0037817702604646),
74 FRAC_CONST(0.0039359150179719),
75 FRAC_CONST(0.0040931318437260),
76 FRAC_CONST(0.0042534609610026),
77 FRAC_CONST(0.0044169420066964),
78 FRAC_CONST(0.0045836141091341),
79 FRAC_CONST(0.0047535159544086),
80 FRAC_CONST(0.0049266858431214),
81 FRAC_CONST(0.0051031617390698),
82 FRAC_CONST(0.0052829813111335),
83 FRAC_CONST(0.0054661819693975),
84 FRAC_CONST(0.0056528008963682),
85 FRAC_CONST(0.0058428750739943),
86 FRAC_CONST(0.0060364413070882),
87 FRAC_CONST(0.0062335362436492),
88 FRAC_CONST(0.0064341963925079),
89 FRAC_CONST(0.0066384581386503),
90 FRAC_CONST(0.0068463577565218),
91 FRAC_CONST(0.0070579314215715),
92 FRAC_CONST(0.0072732152202559),
93 FRAC_CONST(0.0074922451586909),
94 FRAC_CONST(0.0077150571701162),
95 FRAC_CONST(0.0079416871213115),
96 FRAC_CONST(0.0081721708180857),
97 FRAC_CONST(0.0084065440099458),
98 FRAC_CONST(0.0086448423940363),
99 FRAC_CONST(0.0088871016184291),
100 FRAC_CONST(0.0091333572848345),
101 FRAC_CONST(0.0093836449507939),
102 FRAC_CONST(0.0096380001314086),
103 FRAC_CONST(0.0098964583006517),
104 FRAC_CONST(0.010159054892306),
105 FRAC_CONST(0.010425825300561),
106 FRAC_CONST(0.010696804880310),
107 FRAC_CONST(0.010972028947167),
108 FRAC_CONST(0.011251532777236),
109 FRAC_CONST(0.011535351606646),
110 FRAC_CONST(0.011823520630897),
111 FRAC_CONST(0.012116075003993),
112 FRAC_CONST(0.012413049837429),
113 FRAC_CONST(0.012714480198999),
114 FRAC_CONST(0.013020401111478),
115 FRAC_CONST(0.013330847551161),
116 FRAC_CONST(0.013645854446288),
117 FRAC_CONST(0.013965456675352),
118 FRAC_CONST(0.014289689065314),
119 FRAC_CONST(0.014618586389712),
120 FRAC_CONST(0.014952183366697),
121 FRAC_CONST(0.015290514656976),
122 FRAC_CONST(0.015633614861688),
123 FRAC_CONST(0.015981518520214),
124 FRAC_CONST(0.016334260107915),
125 FRAC_CONST(0.016691874033817),
126 FRAC_CONST(0.017054394638241),
127 FRAC_CONST(0.017421856190380),
128 FRAC_CONST(0.017794292885832),
129 FRAC_CONST(0.018171738844085),
130 FRAC_CONST(0.018554228105962),
131 FRAC_CONST(0.018941794631032),
132 FRAC_CONST(0.019334472294980),
133 FRAC_CONST(0.019732294886947),
134 FRAC_CONST(0.020135296106839),
135 FRAC_CONST(0.020543509562604),
136 FRAC_CONST(0.020956968767488),
137 FRAC_CONST(0.021375707137257),
138 FRAC_CONST(0.021799757987407),
139 FRAC_CONST(0.022229154530343),
140 FRAC_CONST(0.022663929872540),
141 FRAC_CONST(0.023104117011689),
142 FRAC_CONST(0.023549748833816),
143 FRAC_CONST(0.024000858110398),
144 FRAC_CONST(0.024457477495451),
145 FRAC_CONST(0.024919639522613),
146 FRAC_CONST(0.025387376602207),
147 FRAC_CONST(0.025860721018295),
148 FRAC_CONST(0.026339704925726),
149 FRAC_CONST(0.026824360347160),
150 FRAC_CONST(0.027314719170100),
151 FRAC_CONST(0.027810813143900),
152 FRAC_CONST(0.028312673876775),
153 FRAC_CONST(0.028820332832801),
154 FRAC_CONST(0.029333821328905),
155 FRAC_CONST(0.029853170531859),
156 FRAC_CONST(0.030378411455255),
157 FRAC_CONST(0.030909574956490),
158 FRAC_CONST(0.031446691733739),
159 FRAC_CONST(0.031989792322926),
160 FRAC_CONST(0.032538907094693),
161 FRAC_CONST(0.033094066251369),
162 FRAC_CONST(0.033655299823935),
163 FRAC_CONST(0.034222637668991),
164 FRAC_CONST(0.034796109465717),
165 FRAC_CONST(0.035375744712844),
166 FRAC_CONST(0.035961572725616),
167 FRAC_CONST(0.036553622632758),
168 FRAC_CONST(0.037151923373446),
169 FRAC_CONST(0.037756503694277),
170 FRAC_CONST(0.038367392146243),
171 FRAC_CONST(0.038984617081711),
172 FRAC_CONST(0.039608206651398),
173 FRAC_CONST(0.040238188801359),
174 FRAC_CONST(0.040874591269976),
175 FRAC_CONST(0.041517441584950),
176 FRAC_CONST(0.042166767060301),
177 FRAC_CONST(0.042822594793376),
178 FRAC_CONST(0.043484951661852),
179 FRAC_CONST(0.044153864320760),
180 FRAC_CONST(0.044829359199509),
181 FRAC_CONST(0.045511462498913),
182 FRAC_CONST(0.046200200188234),
183 FRAC_CONST(0.046895598002228),
184 FRAC_CONST(0.047597681438201),
185 FRAC_CONST(0.048306475753074),
186 FRAC_CONST(0.049022005960455),
187 FRAC_CONST(0.049744296827725),
188 FRAC_CONST(0.050473372873129),
189 FRAC_CONST(0.051209258362879),
190 FRAC_CONST(0.051951977308273),
191 FRAC_CONST(0.052701553462813),
192 FRAC_CONST(0.053458010319350),
193 FRAC_CONST(0.054221371107223),
194 FRAC_CONST(0.054991658789428),
195 FRAC_CONST(0.055768896059787),
196 FRAC_CONST(0.056553105340134),
197 FRAC_CONST(0.057344308777513),
198 FRAC_CONST(0.058142528241393),
199 FRAC_CONST(0.058947785320893),
200 FRAC_CONST(0.059760101322019),
201 FRAC_CONST(0.060579497264926),
202 FRAC_CONST(0.061405993881180),
203 FRAC_CONST(0.062239611611049),
204 FRAC_CONST(0.063080370600799),
205 FRAC_CONST(0.063928290700012),
206 FRAC_CONST(0.064783391458919),
207 FRAC_CONST(0.065645692125747),
208 FRAC_CONST(0.066515211644086),
209 FRAC_CONST(0.067391968650269),
210 FRAC_CONST(0.068275981470777),
211 FRAC_CONST(0.069167268119652),
212 FRAC_CONST(0.070065846295935),
213 FRAC_CONST(0.070971733381121),
214 FRAC_CONST(0.071884946436630),
215 FRAC_CONST(0.072805502201299),
216 FRAC_CONST(0.073733417088896),
217 FRAC_CONST(0.074668707185649),
218 FRAC_CONST(0.075611388247794),
219 FRAC_CONST(0.076561475699152),
220 FRAC_CONST(0.077518984628715),
221 FRAC_CONST(0.078483929788261),
222 FRAC_CONST(0.079456325589986),
223 FRAC_CONST(0.080436186104162),
224 FRAC_CONST(0.081423525056808),
225 FRAC_CONST(0.082418355827392),
226 FRAC_CONST(0.083420691446553),
227 FRAC_CONST(0.084430544593841),
228 FRAC_CONST(0.085447927595483),
229 FRAC_CONST(0.086472852422178),
230 FRAC_CONST(0.087505330686900),
231 FRAC_CONST(0.088545373642744),
232 FRAC_CONST(0.089592992180780),
233 FRAC_CONST(0.090648196827937),
234 FRAC_CONST(0.091710997744919),
235 FRAC_CONST(0.092781404724131),
236 FRAC_CONST(0.093859427187640),
237 FRAC_CONST(0.094945074185163),
238 FRAC_CONST(0.096038354392069),
239 FRAC_CONST(0.097139276107423),
240 FRAC_CONST(0.098247847252041),
241 FRAC_CONST(0.099364075366580),
242 FRAC_CONST(0.10048796760965),
243 FRAC_CONST(0.10161953075597),
244 FRAC_CONST(0.10275877119451),
245 FRAC_CONST(0.10390569492671),
246 FRAC_CONST(0.10506030756469),
247 FRAC_CONST(0.10622261432949),
248 FRAC_CONST(0.10739262004941),
249 FRAC_CONST(0.10857032915821),
250 FRAC_CONST(0.10975574569357),
251 FRAC_CONST(0.11094887329534),
252 FRAC_CONST(0.11214971520402),
253 FRAC_CONST(0.11335827425914),
254 FRAC_CONST(0.11457455289772),
255 FRAC_CONST(0.11579855315274),
256 FRAC_CONST(0.11703027665170),
257 FRAC_CONST(0.11826972461510),
258 FRAC_CONST(0.11951689785504),
259 FRAC_CONST(0.12077179677383),
260 FRAC_CONST(0.12203442136263),
261 FRAC_CONST(0.12330477120008),
262 FRAC_CONST(0.12458284545102),
263 FRAC_CONST(0.12586864286523),
264 FRAC_CONST(0.12716216177615),
265 FRAC_CONST(0.12846340009971),
266 FRAC_CONST(0.12977235533312),
267 FRAC_CONST(0.13108902455375),
268 FRAC_CONST(0.13241340441801),
269 FRAC_CONST(0.13374549116025),
270 FRAC_CONST(0.13508528059173),
271 FRAC_CONST(0.13643276809961),
272 FRAC_CONST(0.13778794864595),
273 FRAC_CONST(0.13915081676677),
274 FRAC_CONST(0.14052136657114),
275 FRAC_CONST(0.14189959174027),
276 FRAC_CONST(0.14328548552671),
277 FRAC_CONST(0.14467904075349),
278 FRAC_CONST(0.14608024981336),
279 FRAC_CONST(0.14748910466804),
280 FRAC_CONST(0.14890559684750),
281 FRAC_CONST(0.15032971744929),
282 FRAC_CONST(0.15176145713790),
283 FRAC_CONST(0.15320080614414),
284 FRAC_CONST(0.15464775426459),
285 FRAC_CONST(0.15610229086100),
286 FRAC_CONST(0.15756440485987),
287 FRAC_CONST(0.15903408475193),
288 FRAC_CONST(0.16051131859170),
289 FRAC_CONST(0.16199609399712),
290 FRAC_CONST(0.16348839814917),
291 FRAC_CONST(0.16498821779156),
292 FRAC_CONST(0.16649553923042),
293 FRAC_CONST(0.16801034833404),
294 FRAC_CONST(0.16953263053270),
295 FRAC_CONST(0.17106237081842),
296 FRAC_CONST(0.17259955374484),
297 FRAC_CONST(0.17414416342714),
298 FRAC_CONST(0.17569618354193),
299 FRAC_CONST(0.17725559732720),
300 FRAC_CONST(0.17882238758238),
301 FRAC_CONST(0.18039653666830),
302 FRAC_CONST(0.18197802650733),
303 FRAC_CONST(0.18356683858343),
304 FRAC_CONST(0.18516295394233),
305 FRAC_CONST(0.18676635319174),
306 FRAC_CONST(0.18837701650148),
307 FRAC_CONST(0.18999492360384),
308 FRAC_CONST(0.19162005379380),
309 FRAC_CONST(0.19325238592940),
310 FRAC_CONST(0.19489189843209),
311 FRAC_CONST(0.19653856928714),
312 FRAC_CONST(0.19819237604409),
313 FRAC_CONST(0.19985329581721),
314 FRAC_CONST(0.20152130528605),
315 FRAC_CONST(0.20319638069594),
316 FRAC_CONST(0.20487849785865),
317 FRAC_CONST(0.20656763215298),
318 FRAC_CONST(0.20826375852540),
319 FRAC_CONST(0.20996685149083),
320 FRAC_CONST(0.21167688513330),
321 FRAC_CONST(0.21339383310678),
322 FRAC_CONST(0.21511766863598),
323 FRAC_CONST(0.21684836451719),
324 FRAC_CONST(0.21858589311922),
325 FRAC_CONST(0.22033022638425),
326 FRAC_CONST(0.22208133582887),
327 FRAC_CONST(0.22383919254503),
328 FRAC_CONST(0.22560376720111),
329 FRAC_CONST(0.22737503004300),
330 FRAC_CONST(0.22915295089517),
331 FRAC_CONST(0.23093749916189),
332 FRAC_CONST(0.23272864382838),
333 FRAC_CONST(0.23452635346201),
334 FRAC_CONST(0.23633059621364),
335 FRAC_CONST(0.23814133981883),
336 FRAC_CONST(0.23995855159925),
337 FRAC_CONST(0.24178219846403),
338 FRAC_CONST(0.24361224691114),
339 FRAC_CONST(0.24544866302890),
340 FRAC_CONST(0.24729141249740),
341 FRAC_CONST(0.24914046059007),
342 FRAC_CONST(0.25099577217522),
343 FRAC_CONST(0.25285731171763),
344 FRAC_CONST(0.25472504328019),
345 FRAC_CONST(0.25659893052556),
346 FRAC_CONST(0.25847893671788),
347 FRAC_CONST(0.26036502472451),
348 FRAC_CONST(0.26225715701781),
349 FRAC_CONST(0.26415529567692),
350 FRAC_CONST(0.26605940238966),
351 FRAC_CONST(0.26796943845439),
352 FRAC_CONST(0.26988536478190),
353 FRAC_CONST(0.27180714189742),
354 FRAC_CONST(0.27373472994256),
355 FRAC_CONST(0.27566808867736),
356 FRAC_CONST(0.27760717748238),
357 FRAC_CONST(0.27955195536071),
358 FRAC_CONST(0.28150238094021),
359 FRAC_CONST(0.28345841247557),
360 FRAC_CONST(0.28542000785059),
361 FRAC_CONST(0.28738712458038),
362 FRAC_CONST(0.28935971981364),
363 FRAC_CONST(0.29133775033492),
364 FRAC_CONST(0.29332117256704),
365 FRAC_CONST(0.29530994257338),
366 FRAC_CONST(0.29730401606034),
367 FRAC_CONST(0.29930334837974),
368 FRAC_CONST(0.30130789453132),
369 FRAC_CONST(0.30331760916521),
370 FRAC_CONST(0.30533244658452),
371 FRAC_CONST(0.30735236074785),
372 FRAC_CONST(0.30937730527195),
373 FRAC_CONST(0.31140723343430),
374 FRAC_CONST(0.31344209817583),
375 FRAC_CONST(0.31548185210356),
376 FRAC_CONST(0.31752644749341),
377 FRAC_CONST(0.31957583629288),
378 FRAC_CONST(0.32162997012390),
379 FRAC_CONST(0.32368880028565),
380 FRAC_CONST(0.32575227775738),
381 FRAC_CONST(0.32782035320134),
382 FRAC_CONST(0.32989297696566),
383 FRAC_CONST(0.33197009908736),
384 FRAC_CONST(0.33405166929523),
385 FRAC_CONST(0.33613763701295),
386 FRAC_CONST(0.33822795136203),
387 FRAC_CONST(0.34032256116495),
388 FRAC_CONST(0.34242141494820),
389 FRAC_CONST(0.34452446094547),
390 FRAC_CONST(0.34663164710072),
391 FRAC_CONST(0.34874292107143),
392 FRAC_CONST(0.35085823023181),
393 FRAC_CONST(0.35297752167598),
394 FRAC_CONST(0.35510074222129),
395 FRAC_CONST(0.35722783841160),
396 FRAC_CONST(0.35935875652060),
397 FRAC_CONST(0.36149344255514),
398 FRAC_CONST(0.36363184225864),
399 FRAC_CONST(0.36577390111444),
400 FRAC_CONST(0.36791956434930),
401 FRAC_CONST(0.37006877693676),
402 FRAC_CONST(0.37222148360070),
403 FRAC_CONST(0.37437762881878),
404 FRAC_CONST(0.37653715682603),
405 FRAC_CONST(0.37870001161834),
406 FRAC_CONST(0.38086613695607),
407 FRAC_CONST(0.38303547636766),
408 FRAC_CONST(0.38520797315322),
409 FRAC_CONST(0.38738357038821),
410 FRAC_CONST(0.38956221092708),
411 FRAC_CONST(0.39174383740701),
412 FRAC_CONST(0.39392839225157),
413 FRAC_CONST(0.39611581767449),
414 FRAC_CONST(0.39830605568342),
415 FRAC_CONST(0.40049904808370),
416 FRAC_CONST(0.40269473648218),
417 FRAC_CONST(0.40489306229101),
418 FRAC_CONST(0.40709396673153),
419 FRAC_CONST(0.40929739083810),
420 FRAC_CONST(0.41150327546197),
421 FRAC_CONST(0.41371156127524),
422 FRAC_CONST(0.41592218877472),
423 FRAC_CONST(0.41813509828594),
424 FRAC_CONST(0.42035022996702),
425 FRAC_CONST(0.42256752381274),
426 FRAC_CONST(0.42478691965848),
427 FRAC_CONST(0.42700835718423),
428 FRAC_CONST(0.42923177591866),
429 FRAC_CONST(0.43145711524314),
430 FRAC_CONST(0.43368431439580),
431 FRAC_CONST(0.43591331247564),
432 FRAC_CONST(0.43814404844658),
433 FRAC_CONST(0.44037646114161),
434 FRAC_CONST(0.44261048926688),
435 FRAC_CONST(0.44484607140589),
436 FRAC_CONST(0.44708314602359),
437 FRAC_CONST(0.44932165147057),
438 FRAC_CONST(0.45156152598727),
439 FRAC_CONST(0.45380270770813),
440 FRAC_CONST(0.45604513466581),
441 FRAC_CONST(0.45828874479543),
442 FRAC_CONST(0.46053347593880),
443 FRAC_CONST(0.46277926584861),
444 FRAC_CONST(0.46502605219277),
445 FRAC_CONST(0.46727377255861),
446 FRAC_CONST(0.46952236445718),
447 FRAC_CONST(0.47177176532752),
448 FRAC_CONST(0.47402191254100),
449 FRAC_CONST(0.47627274340557),
450 FRAC_CONST(0.47852419517009),
451 FRAC_CONST(0.48077620502869),
452 FRAC_CONST(0.48302871012505),
453 FRAC_CONST(0.48528164755674),
454 FRAC_CONST(0.48753495437962),
455 FRAC_CONST(0.48978856761212),
456 FRAC_CONST(0.49204242423966),
457 FRAC_CONST(0.49429646121898),
458 FRAC_CONST(0.49655061548250),
459 FRAC_CONST(0.49880482394273),
460 FRAC_CONST(0.50105902349665),
461 FRAC_CONST(0.50331315103004),
462 FRAC_CONST(0.50556714342194),
463 FRAC_CONST(0.50782093754901),
464 FRAC_CONST(0.51007447028990),
465 FRAC_CONST(0.51232767852971),
466 FRAC_CONST(0.51458049916433),
467 FRAC_CONST(0.51683286910489),
468 FRAC_CONST(0.51908472528213),
469 FRAC_CONST(0.52133600465083),
470 FRAC_CONST(0.52358664419420),
471 FRAC_CONST(0.52583658092832),
472 FRAC_CONST(0.52808575190648),
473 FRAC_CONST(0.53033409422367),
474 FRAC_CONST(0.53258154502092),
475 FRAC_CONST(0.53482804148974),
476 FRAC_CONST(0.53707352087652),
477 FRAC_CONST(0.53931792048690),
478 FRAC_CONST(0.54156117769021),
479 FRAC_CONST(0.54380322992385),
480 FRAC_CONST(0.54604401469766),
481 FRAC_CONST(0.54828346959835),
482 FRAC_CONST(0.55052153229384),
483 FRAC_CONST(0.55275814053768),
484 FRAC_CONST(0.55499323217338),
485 FRAC_CONST(0.55722674513883),
486 FRAC_CONST(0.55945861747062),
487 FRAC_CONST(0.56168878730842),
488 FRAC_CONST(0.56391719289930),
489 FRAC_CONST(0.56614377260214),
490 FRAC_CONST(0.56836846489188),
491 FRAC_CONST(0.57059120836390),
492 FRAC_CONST(0.57281194173835),
493 FRAC_CONST(0.57503060386439),
494 FRAC_CONST(0.57724713372458),
495 FRAC_CONST(0.57946147043912),
496 FRAC_CONST(0.58167355327012),
497 FRAC_CONST(0.58388332162591),
498 FRAC_CONST(0.58609071506528),
499 FRAC_CONST(0.58829567330173),
500 FRAC_CONST(0.59049813620770),
501 FRAC_CONST(0.59269804381879),
502 FRAC_CONST(0.59489533633802),
503 FRAC_CONST(0.59708995413996),
504 FRAC_CONST(0.59928183777495),
505 FRAC_CONST(0.60147092797329),
506 FRAC_CONST(0.60365716564937),
507 FRAC_CONST(0.60584049190582),
508 FRAC_CONST(0.60802084803764),
509 FRAC_CONST(0.61019817553632),
510 FRAC_CONST(0.61237241609393),
511 FRAC_CONST(0.61454351160718),
512 FRAC_CONST(0.61671140418155),
513 FRAC_CONST(0.61887603613527),
514 FRAC_CONST(0.62103735000336),
515 FRAC_CONST(0.62319528854167),
516 FRAC_CONST(0.62534979473088),
517 FRAC_CONST(0.62750081178042),
518 FRAC_CONST(0.62964828313250),
519 FRAC_CONST(0.63179215246597),
520 FRAC_CONST(0.63393236370030),
521 FRAC_CONST(0.63606886099946),
522 FRAC_CONST(0.63820158877577),
523 FRAC_CONST(0.64033049169379),
524 FRAC_CONST(0.64245551467413),
525 FRAC_CONST(0.64457660289729),
526 FRAC_CONST(0.64669370180740),
527 FRAC_CONST(0.64880675711607),
528 FRAC_CONST(0.65091571480603),
529 FRAC_CONST(0.65302052113494),
530 FRAC_CONST(0.65512112263906),
531 FRAC_CONST(0.65721746613689),
532 FRAC_CONST(0.65930949873289),
533 FRAC_CONST(0.66139716782102),
534 FRAC_CONST(0.66348042108842),
535 FRAC_CONST(0.66555920651892),
536 FRAC_CONST(0.66763347239664),
537 FRAC_CONST(0.66970316730947),
538 FRAC_CONST(0.67176824015260),
539 FRAC_CONST(0.67382864013196),
540 FRAC_CONST(0.67588431676768),
541 FRAC_CONST(0.67793521989751),
542 FRAC_CONST(0.67998129968017),
543 FRAC_CONST(0.68202250659876),
544 FRAC_CONST(0.68405879146403),
545 FRAC_CONST(0.68609010541774),
546 FRAC_CONST(0.68811639993588),
547 FRAC_CONST(0.69013762683195),
548 FRAC_CONST(0.69215373826012),
549 FRAC_CONST(0.69416468671849),
550 FRAC_CONST(0.69617042505214),
551 FRAC_CONST(0.69817090645634),
552 FRAC_CONST(0.70016608447958),
553 FRAC_CONST(0.70215591302664),
554 FRAC_CONST(0.70414034636163),
555 FRAC_CONST(0.70611933911096),
556 FRAC_CONST(0.70809284626630),
557 FRAC_CONST(0.71006082318751),
558 FRAC_CONST(0.71202322560554),
559 FRAC_CONST(0.71398000962530),
560 FRAC_CONST(0.71593113172842),
561 FRAC_CONST(0.71787654877613),
562 FRAC_CONST(0.71981621801195),
563 FRAC_CONST(0.72175009706445),
564 FRAC_CONST(0.72367814394990),
565 FRAC_CONST(0.72560031707496),
566 FRAC_CONST(0.72751657523927),
567 FRAC_CONST(0.72942687763803),
568 FRAC_CONST(0.73133118386457),
569 FRAC_CONST(0.73322945391280),
570 FRAC_CONST(0.73512164817975),
571 FRAC_CONST(0.73700772746796),
572 FRAC_CONST(0.73888765298787),
573 FRAC_CONST(0.74076138636020),
574 FRAC_CONST(0.74262888961827),
575 FRAC_CONST(0.74449012521027),
576 FRAC_CONST(0.74634505600152),
577 FRAC_CONST(0.74819364527663),
578 FRAC_CONST(0.75003585674175),
579 FRAC_CONST(0.75187165452661),
580 FRAC_CONST(0.75370100318668),
581 FRAC_CONST(0.75552386770515),
582 FRAC_CONST(0.75734021349500),
583 FRAC_CONST(0.75915000640095),
584 FRAC_CONST(0.76095321270137),
585 FRAC_CONST(0.76274979911019),
586 FRAC_CONST(0.76453973277875),
587 FRAC_CONST(0.76632298129757),
588 FRAC_CONST(0.76809951269819),
589 FRAC_CONST(0.76986929545481),
590 FRAC_CONST(0.77163229848604),
591 FRAC_CONST(0.77338849115651),
592 FRAC_CONST(0.77513784327849),
593 FRAC_CONST(0.77688032511340),
594 FRAC_CONST(0.77861590737340),
595 FRAC_CONST(0.78034456122283),
596 FRAC_CONST(0.78206625827961),
597 FRAC_CONST(0.78378097061667),
598 FRAC_CONST(0.78548867076330),
599 FRAC_CONST(0.78718933170643),
600 FRAC_CONST(0.78888292689189),
601 FRAC_CONST(0.79056943022564),
602 FRAC_CONST(0.79224881607494),
603 FRAC_CONST(0.79392105926949),
604 FRAC_CONST(0.79558613510249),
605 FRAC_CONST(0.79724401933170),
606 FRAC_CONST(0.79889468818046),
607 FRAC_CONST(0.80053811833858),
608 FRAC_CONST(0.80217428696334),
609 FRAC_CONST(0.80380317168028),
610 FRAC_CONST(0.80542475058405),
611 FRAC_CONST(0.80703900223920),
612 FRAC_CONST(0.80864590568089),
613 FRAC_CONST(0.81024544041560),
614 FRAC_CONST(0.81183758642175),
615 FRAC_CONST(0.81342232415032),
616 FRAC_CONST(0.81499963452540),
617 FRAC_CONST(0.81656949894467),
618 FRAC_CONST(0.81813189927991),
619 FRAC_CONST(0.81968681787738),
620 FRAC_CONST(0.82123423755821),
621 FRAC_CONST(0.82277414161874),
622 FRAC_CONST(0.82430651383076),
623 FRAC_CONST(0.82583133844180),
624 FRAC_CONST(0.82734860017528),
625 FRAC_CONST(0.82885828423070),
626 FRAC_CONST(0.83036037628369),
627 FRAC_CONST(0.83185486248609),
628 FRAC_CONST(0.83334172946597),
629 FRAC_CONST(0.83482096432759),
630 FRAC_CONST(0.83629255465130),
631 FRAC_CONST(0.83775648849344),
632 FRAC_CONST(0.83921275438615),
633 FRAC_CONST(0.84066134133716),
634 FRAC_CONST(0.84210223882952),
635 FRAC_CONST(0.84353543682130),
636 FRAC_CONST(0.84496092574524),
637 FRAC_CONST(0.84637869650833),
638 FRAC_CONST(0.84778874049138),
639 FRAC_CONST(0.84919104954855),
640 FRAC_CONST(0.85058561600677),
641 FRAC_CONST(0.85197243266520),
642 FRAC_CONST(0.85335149279457),
643 FRAC_CONST(0.85472279013653),
644 FRAC_CONST(0.85608631890295),
645 FRAC_CONST(0.85744207377513),
646 FRAC_CONST(0.85879004990298),
647 FRAC_CONST(0.86013024290422),
648 FRAC_CONST(0.86146264886346),
649 FRAC_CONST(0.86278726433124),
650 FRAC_CONST(0.86410408632306),
651 FRAC_CONST(0.86541311231838),
652 FRAC_CONST(0.86671434025950),
653 FRAC_CONST(0.86800776855046),
654 FRAC_CONST(0.86929339605590),
655 FRAC_CONST(0.87057122209981),
656 FRAC_CONST(0.87184124646433),
657 FRAC_CONST(0.87310346938840),
658 FRAC_CONST(0.87435789156650),
659 FRAC_CONST(0.87560451414719),
660 FRAC_CONST(0.87684333873173),
661 FRAC_CONST(0.87807436737261),
662 FRAC_CONST(0.87929760257204),
663 FRAC_CONST(0.88051304728038),
664 FRAC_CONST(0.88172070489456),
665 FRAC_CONST(0.88292057925645),
666 FRAC_CONST(0.88411267465117),
667 FRAC_CONST(0.88529699580537),
668 FRAC_CONST(0.88647354788545),
669 FRAC_CONST(0.88764233649580),
670 FRAC_CONST(0.88880336767692),
671 FRAC_CONST(0.88995664790351),
672 FRAC_CONST(0.89110218408260),
673 FRAC_CONST(0.89223998355154),
674 FRAC_CONST(0.89337005407600),
675 FRAC_CONST(0.89449240384793),
676 FRAC_CONST(0.89560704148345),
677 FRAC_CONST(0.89671397602074),
678 FRAC_CONST(0.89781321691786),
679 FRAC_CONST(0.89890477405053),
680 FRAC_CONST(0.89998865770993),
681 FRAC_CONST(0.90106487860034),
682 FRAC_CONST(0.90213344783689),
683 FRAC_CONST(0.90319437694315),
684 FRAC_CONST(0.90424767784873),
685 FRAC_CONST(0.90529336288690),
686 FRAC_CONST(0.90633144479201),
687 FRAC_CONST(0.90736193669708),
688 FRAC_CONST(0.90838485213119),
689 FRAC_CONST(0.90940020501694),
690 FRAC_CONST(0.91040800966776),
691 FRAC_CONST(0.91140828078533),
692 FRAC_CONST(0.91240103345685),
693 FRAC_CONST(0.91338628315231),
694 FRAC_CONST(0.91436404572173),
695 FRAC_CONST(0.91533433739238),
696 FRAC_CONST(0.91629717476594),
697 FRAC_CONST(0.91725257481564),
698 FRAC_CONST(0.91820055488334),
699 FRAC_CONST(0.91914113267664),
700 FRAC_CONST(0.92007432626589),
701 FRAC_CONST(0.92100015408120),
702 FRAC_CONST(0.92191863490944),
703 FRAC_CONST(0.92282978789113),
704 FRAC_CONST(0.92373363251740),
705 FRAC_CONST(0.92463018862687),
706 FRAC_CONST(0.92551947640245),
707 FRAC_CONST(0.92640151636824),
708 FRAC_CONST(0.92727632938624),
709 FRAC_CONST(0.92814393665320),
710 FRAC_CONST(0.92900435969727),
711 FRAC_CONST(0.92985762037477),
712 FRAC_CONST(0.93070374086684),
713 FRAC_CONST(0.93154274367610),
714 FRAC_CONST(0.93237465162328),
715 FRAC_CONST(0.93319948784382),
716 FRAC_CONST(0.93401727578443),
717 FRAC_CONST(0.93482803919967),
718 FRAC_CONST(0.93563180214841),
719 FRAC_CONST(0.93642858899043),
720 FRAC_CONST(0.93721842438279),
721 FRAC_CONST(0.93800133327637),
722 FRAC_CONST(0.93877734091223),
723 FRAC_CONST(0.93954647281807),
724 FRAC_CONST(0.94030875480458),
725 FRAC_CONST(0.94106421296182),
726 FRAC_CONST(0.94181287365556),
727 FRAC_CONST(0.94255476352362),
728 FRAC_CONST(0.94328990947213),
729 FRAC_CONST(0.94401833867184),
730 FRAC_CONST(0.94474007855439),
731 FRAC_CONST(0.94545515680855),
732 FRAC_CONST(0.94616360137644),
733 FRAC_CONST(0.94686544044975),
734 FRAC_CONST(0.94756070246592),
735 FRAC_CONST(0.94824941610434),
736 FRAC_CONST(0.94893161028248),
737 FRAC_CONST(0.94960731415209),
738 FRAC_CONST(0.95027655709525),
739 FRAC_CONST(0.95093936872056),
740 FRAC_CONST(0.95159577885924),
741 FRAC_CONST(0.95224581756115),
742 FRAC_CONST(0.95288951509097),
743 FRAC_CONST(0.95352690192417),
744 FRAC_CONST(0.95415800874314),
745 FRAC_CONST(0.95478286643320),
746 FRAC_CONST(0.95540150607863),
747 FRAC_CONST(0.95601395895871),
748 FRAC_CONST(0.95662025654373),
749 FRAC_CONST(0.95722043049100),
750 FRAC_CONST(0.95781451264084),
751 FRAC_CONST(0.95840253501260),
752 FRAC_CONST(0.95898452980058),
753 FRAC_CONST(0.95956052937008),
754 FRAC_CONST(0.96013056625336),
755 FRAC_CONST(0.96069467314557),
756 FRAC_CONST(0.96125288290073),
757 FRAC_CONST(0.96180522852773),
758 FRAC_CONST(0.96235174318622),
759 FRAC_CONST(0.96289246018262),
760 FRAC_CONST(0.96342741296604),
761 FRAC_CONST(0.96395663512424),
762 FRAC_CONST(0.96448016037959),
763 FRAC_CONST(0.96499802258499),
764 FRAC_CONST(0.96551025571985),
765 FRAC_CONST(0.96601689388602),
766 FRAC_CONST(0.96651797130376),
767 FRAC_CONST(0.96701352230768),
768 FRAC_CONST(0.96750358134269),
769 FRAC_CONST(0.96798818295998),
770 FRAC_CONST(0.96846736181297),
771 FRAC_CONST(0.96894115265327),
772 FRAC_CONST(0.96940959032667),
773 FRAC_CONST(0.96987270976912),
774 FRAC_CONST(0.97033054600270),
775 FRAC_CONST(0.97078313413161),
776 FRAC_CONST(0.97123050933818),
777 FRAC_CONST(0.97167270687887),
778 FRAC_CONST(0.97210976208030),
779 FRAC_CONST(0.97254171033525),
780 FRAC_CONST(0.97296858709871),
781 FRAC_CONST(0.97339042788392),
782 FRAC_CONST(0.97380726825843),
783 FRAC_CONST(0.97421914384017),
784 FRAC_CONST(0.97462609029350),
785 FRAC_CONST(0.97502814332534),
786 FRAC_CONST(0.97542533868127),
787 FRAC_CONST(0.97581771214160),
788 FRAC_CONST(0.97620529951759),
789 FRAC_CONST(0.97658813664749),
790 FRAC_CONST(0.97696625939282),
791 FRAC_CONST(0.97733970363445),
792 FRAC_CONST(0.97770850526884),
793 FRAC_CONST(0.97807270020427),
794 FRAC_CONST(0.97843232435704),
795 FRAC_CONST(0.97878741364771),
796 FRAC_CONST(0.97913800399743),
797 FRAC_CONST(0.97948413132414),
798 FRAC_CONST(0.97982583153895),
799 FRAC_CONST(0.98016314054243),
800 FRAC_CONST(0.98049609422096),
801 FRAC_CONST(0.98082472844313),
802 FRAC_CONST(0.98114907905608),
803 FRAC_CONST(0.98146918188197),
804 FRAC_CONST(0.98178507271438),
805 FRAC_CONST(0.98209678731477),
806 FRAC_CONST(0.98240436140902),
807 FRAC_CONST(0.98270783068385),
808 FRAC_CONST(0.98300723078342),
809 FRAC_CONST(0.98330259730589),
810 FRAC_CONST(0.98359396579995),
811 FRAC_CONST(0.98388137176152),
812 FRAC_CONST(0.98416485063031),
813 FRAC_CONST(0.98444443778651),
814 FRAC_CONST(0.98472016854752),
815 FRAC_CONST(0.98499207816463),
816 FRAC_CONST(0.98526020181980),
817 FRAC_CONST(0.98552457462240),
818 FRAC_CONST(0.98578523160609),
819 FRAC_CONST(0.98604220772560),
820 FRAC_CONST(0.98629553785362),
821 FRAC_CONST(0.98654525677772),
822 FRAC_CONST(0.98679139919726),
823 FRAC_CONST(0.98703399972035),
824 FRAC_CONST(0.98727309286089),
825 FRAC_CONST(0.98750871303556),
826 FRAC_CONST(0.98774089456089),
827 FRAC_CONST(0.98796967165036),
828 FRAC_CONST(0.98819507841154),
829 FRAC_CONST(0.98841714884323),
830 FRAC_CONST(0.98863591683269),
831 FRAC_CONST(0.98885141615285),
832 FRAC_CONST(0.98906368045957),
833 FRAC_CONST(0.98927274328896),
834 FRAC_CONST(0.98947863805473),
835 FRAC_CONST(0.98968139804554),
836 FRAC_CONST(0.98988105642241),
837 FRAC_CONST(0.99007764621618),
838 FRAC_CONST(0.99027120032501),
839 FRAC_CONST(0.99046175151186),
840 FRAC_CONST(0.99064933240208),
841 FRAC_CONST(0.99083397548099),
842 FRAC_CONST(0.99101571309153),
843 FRAC_CONST(0.99119457743191),
844 FRAC_CONST(0.99137060055337),
845 FRAC_CONST(0.99154381435784),
846 FRAC_CONST(0.99171425059582),
847 FRAC_CONST(0.99188194086414),
848 FRAC_CONST(0.99204691660388),
849 FRAC_CONST(0.99220920909823),
850 FRAC_CONST(0.99236884947045),
851 FRAC_CONST(0.99252586868186),
852 FRAC_CONST(0.99268029752989),
853 FRAC_CONST(0.99283216664606),
854 FRAC_CONST(0.99298150649419),
855 FRAC_CONST(0.99312834736847),
856 FRAC_CONST(0.99327271939167),
857 FRAC_CONST(0.99341465251338),
858 FRAC_CONST(0.99355417650825),
859 FRAC_CONST(0.99369132097430),
860 FRAC_CONST(0.99382611533130),
861 FRAC_CONST(0.99395858881910),
862 FRAC_CONST(0.99408877049612),
863 FRAC_CONST(0.99421668923778),
864 FRAC_CONST(0.99434237373503),
865 FRAC_CONST(0.99446585249289),
866 FRAC_CONST(0.99458715382906),
867 FRAC_CONST(0.99470630587254),
868 FRAC_CONST(0.99482333656229),
869 FRAC_CONST(0.99493827364600),
870 FRAC_CONST(0.99505114467878),
871 FRAC_CONST(0.99516197702200),
872 FRAC_CONST(0.99527079784214),
873 FRAC_CONST(0.99537763410962),
874 FRAC_CONST(0.99548251259777),
875 FRAC_CONST(0.99558545988178),
876 FRAC_CONST(0.99568650233767),
877 FRAC_CONST(0.99578566614138),
878 FRAC_CONST(0.99588297726783),
879 FRAC_CONST(0.99597846149005),
880 FRAC_CONST(0.99607214437834),
881 FRAC_CONST(0.99616405129947),
882 FRAC_CONST(0.99625420741595),
883 FRAC_CONST(0.99634263768527),
884 FRAC_CONST(0.99642936685928),
885 FRAC_CONST(0.99651441948352),
886 FRAC_CONST(0.99659781989663),
887 FRAC_CONST(0.99667959222978),
888 FRAC_CONST(0.99675976040620),
889 FRAC_CONST(0.99683834814063),
890 FRAC_CONST(0.99691537893895),
891 FRAC_CONST(0.99699087609774),
892 FRAC_CONST(0.99706486270391),
893 FRAC_CONST(0.99713736163442),
894 FRAC_CONST(0.99720839555593),
895 FRAC_CONST(0.99727798692461),
896 FRAC_CONST(0.99734615798589),
897 FRAC_CONST(0.99741293077431),
898 FRAC_CONST(0.99747832711337),
899 FRAC_CONST(0.99754236861541),
900 FRAC_CONST(0.99760507668158),
901 FRAC_CONST(0.99766647250181),
902 FRAC_CONST(0.99772657705478),
903 FRAC_CONST(0.99778541110799),
904 FRAC_CONST(0.99784299521785),
905 FRAC_CONST(0.99789934972976),
906 FRAC_CONST(0.99795449477828),
907 FRAC_CONST(0.99800845028730),
908 FRAC_CONST(0.99806123597027),
909 FRAC_CONST(0.99811287133042),
910 FRAC_CONST(0.99816337566108),
911 FRAC_CONST(0.99821276804596),
912 FRAC_CONST(0.99826106735952),
913 FRAC_CONST(0.99830829226732),
914 FRAC_CONST(0.99835446122649),
915 FRAC_CONST(0.99839959248609),
916 FRAC_CONST(0.99844370408765),
917 FRAC_CONST(0.99848681386566),
918 FRAC_CONST(0.99852893944805),
919 FRAC_CONST(0.99857009825685),
920 FRAC_CONST(0.99861030750869),
921 FRAC_CONST(0.99864958421549),
922 FRAC_CONST(0.99868794518504),
923 FRAC_CONST(0.99872540702178),
924 FRAC_CONST(0.99876198612738),
925 FRAC_CONST(0.99879769870160),
926 FRAC_CONST(0.99883256074295),
927 FRAC_CONST(0.99886658804953),
928 FRAC_CONST(0.99889979621983),
929 FRAC_CONST(0.99893220065356),
930 FRAC_CONST(0.99896381655254),
931 FRAC_CONST(0.99899465892154),
932 FRAC_CONST(0.99902474256924),
933 FRAC_CONST(0.99905408210916),
934 FRAC_CONST(0.99908269196056),
935 FRAC_CONST(0.99911058634952),
936 FRAC_CONST(0.99913777930986),
937 FRAC_CONST(0.99916428468421),
938 FRAC_CONST(0.99919011612505),
939 FRAC_CONST(0.99921528709576),
940 FRAC_CONST(0.99923981087174),
941 FRAC_CONST(0.99926370054150),
942 FRAC_CONST(0.99928696900779),
943 FRAC_CONST(0.99930962898876),
944 FRAC_CONST(0.99933169301910),
945 FRAC_CONST(0.99935317345126),
946 FRAC_CONST(0.99937408245662),
947 FRAC_CONST(0.99939443202674),
948 FRAC_CONST(0.99941423397457),
949 FRAC_CONST(0.99943349993572),
950 FRAC_CONST(0.99945224136972),
951 FRAC_CONST(0.99947046956130),
952 FRAC_CONST(0.99948819562171),
953 FRAC_CONST(0.99950543049000),
954 FRAC_CONST(0.99952218493439),
955 FRAC_CONST(0.99953846955355),
956 FRAC_CONST(0.99955429477803),
957 FRAC_CONST(0.99956967087154),
958 FRAC_CONST(0.99958460793242),
959 FRAC_CONST(0.99959911589494),
960 FRAC_CONST(0.99961320453077),
961 FRAC_CONST(0.99962688345035),
962 FRAC_CONST(0.99964016210433),
963 FRAC_CONST(0.99965304978499),
964 FRAC_CONST(0.99966555562769),
965 FRAC_CONST(0.99967768861231),
966 FRAC_CONST(0.99968945756473),
967 FRAC_CONST(0.99970087115825),
968 FRAC_CONST(0.99971193791510),
969 FRAC_CONST(0.99972266620792),
970 FRAC_CONST(0.99973306426121),
971 FRAC_CONST(0.99974314015288),
972 FRAC_CONST(0.99975290181568),
973 FRAC_CONST(0.99976235703876),
974 FRAC_CONST(0.99977151346914),
975 FRAC_CONST(0.99978037861326),
976 FRAC_CONST(0.99978895983845),
977 FRAC_CONST(0.99979726437448),
978 FRAC_CONST(0.99980529931507),
979 FRAC_CONST(0.99981307161943),
980 FRAC_CONST(0.99982058811377),
981 FRAC_CONST(0.99982785549283),
982 FRAC_CONST(0.99983488032144),
983 FRAC_CONST(0.99984166903600),
984 FRAC_CONST(0.99984822794606),
985 FRAC_CONST(0.99985456323584),
986 FRAC_CONST(0.99986068096572),
987 FRAC_CONST(0.99986658707386),
988 FRAC_CONST(0.99987228737764),
989 FRAC_CONST(0.99987778757524),
990 FRAC_CONST(0.99988309324717),
991 FRAC_CONST(0.99988820985777),
992 FRAC_CONST(0.99989314275675),
993 FRAC_CONST(0.99989789718072),
994 FRAC_CONST(0.99990247825468),
995 FRAC_CONST(0.99990689099357),
996 FRAC_CONST(0.99991114030376),
997 FRAC_CONST(0.99991523098456),
998 FRAC_CONST(0.99991916772971),
999 FRAC_CONST(0.99992295512891),
1000 FRAC_CONST(0.99992659766930),
1001 FRAC_CONST(0.99993009973692),
1002 FRAC_CONST(0.99993346561824),
1003 FRAC_CONST(0.99993669950161),
1004 FRAC_CONST(0.99993980547870),
1005 FRAC_CONST(0.99994278754604),
1006 FRAC_CONST(0.99994564960642),
1007 FRAC_CONST(0.99994839547033),
1008 FRAC_CONST(0.99995102885747),
1009 FRAC_CONST(0.99995355339809),
1010 FRAC_CONST(0.99995597263451),
1011 FRAC_CONST(0.99995829002249),
1012 FRAC_CONST(0.99996050893264),
1013 FRAC_CONST(0.99996263265183),
1014 FRAC_CONST(0.99996466438460),
1015 FRAC_CONST(0.99996660725452),
1016 FRAC_CONST(0.99996846430558),
1017 FRAC_CONST(0.99997023850356),
1018 FRAC_CONST(0.99997193273736),
1019 FRAC_CONST(0.99997354982037),
1020 FRAC_CONST(0.99997509249183),
1021 FRAC_CONST(0.99997656341810),
1022 FRAC_CONST(0.99997796519400),
1023 FRAC_CONST(0.99997930034415),
1024 FRAC_CONST(0.99998057132421),
1025 FRAC_CONST(0.99998178052220),
1026 FRAC_CONST(0.99998293025975),
1027 FRAC_CONST(0.99998402279338),
1028 FRAC_CONST(0.99998506031574),
1029 FRAC_CONST(0.99998604495686),
1030 FRAC_CONST(0.99998697878536),
1031 FRAC_CONST(0.99998786380966),
1032 FRAC_CONST(0.99998870197921),
1033 FRAC_CONST(0.99998949518567),
1034 FRAC_CONST(0.99999024526408),
1035 FRAC_CONST(0.99999095399401),
1036 FRAC_CONST(0.99999162310077),
1037 FRAC_CONST(0.99999225425649),
1038 FRAC_CONST(0.99999284908128),
1039 FRAC_CONST(0.99999340914435),
1040 FRAC_CONST(0.99999393596510),
1041 FRAC_CONST(0.99999443101421),
1042 FRAC_CONST(0.99999489571473),
1043 FRAC_CONST(0.99999533144314),
1044 FRAC_CONST(0.99999573953040),
1045 FRAC_CONST(0.99999612126300),
1046 FRAC_CONST(0.99999647788395),
1047 FRAC_CONST(0.99999681059383),
1048 FRAC_CONST(0.99999712055178),
1049 FRAC_CONST(0.99999740887647),
1050 FRAC_CONST(0.99999767664709),
1051 FRAC_CONST(0.99999792490431),
1052 FRAC_CONST(0.99999815465123),
1053 FRAC_CONST(0.99999836685427),
1054 FRAC_CONST(0.99999856244415),
1055 FRAC_CONST(0.99999874231676),
1056 FRAC_CONST(0.99999890733405),
1057 FRAC_CONST(0.99999905832493),
1058 FRAC_CONST(0.99999919608613),
1059 FRAC_CONST(0.99999932138304),
1060 FRAC_CONST(0.99999943495056),
1061 FRAC_CONST(0.99999953749392),
1062 FRAC_CONST(0.99999962968950),
1063 FRAC_CONST(0.99999971218563),
1064 FRAC_CONST(0.99999978560337),
1065 FRAC_CONST(0.99999985053727),
1066 FRAC_CONST(0.99999990755616),
1067 FRAC_CONST(0.99999995720387)
1068 };
1069
1070 #ifdef ALLOW_SMALL_FRAMELENGTH
1071 ALIGN static const real_t kbd_long_960[] = {
1072 FRAC_CONST(0.0003021562530949),
1073 FRAC_CONST(0.0004452267024786),
1074 FRAC_CONST(0.0005674947527496),
1075 FRAC_CONST(0.0006812465553466),
1076 FRAC_CONST(0.0007910496776387),
1077 FRAC_CONST(0.0008991655033895),
1078 FRAC_CONST(0.0010068978259384),
1079 FRAC_CONST(0.0011150758515751),
1080 FRAC_CONST(0.0012242653193642),
1081 FRAC_CONST(0.0013348735658205),
1082 FRAC_CONST(0.0014472068670273),
1083 FRAC_CONST(0.0015615039850448),
1084 FRAC_CONST(0.0016779568885263),
1085 FRAC_CONST(0.0017967241232412),
1086 FRAC_CONST(0.0019179397560955),
1087 FRAC_CONST(0.0020417195415393),
1088 FRAC_CONST(0.0021681652836642),
1089 FRAC_CONST(0.0022973679910599),
1090 FRAC_CONST(0.0024294102029937),
1091 FRAC_CONST(0.0025643677339078),
1092 FRAC_CONST(0.0027023110014772),
1093 FRAC_CONST(0.0028433060512612),
1094 FRAC_CONST(0.0029874153568025),
1095 FRAC_CONST(0.0031346984511728),
1096 FRAC_CONST(0.0032852124303662),
1097 FRAC_CONST(0.0034390123581190),
1098 FRAC_CONST(0.0035961515940931),
1099 FRAC_CONST(0.0037566820618961),
1100 FRAC_CONST(0.0039206544694386),
1101 FRAC_CONST(0.0040881184912194),
1102 FRAC_CONST(0.0042591229199617),
1103 FRAC_CONST(0.0044337157933972),
1104 FRAC_CONST(0.0046119445007641),
1105 FRAC_CONST(0.0047938558726415),
1106 FRAC_CONST(0.0049794962570131),
1107 FRAC_CONST(0.0051689115838900),
1108 FRAC_CONST(0.0053621474203763),
1109 FRAC_CONST(0.0055592490177131),
1110 FRAC_CONST(0.0057602613515573),
1111 FRAC_CONST(0.0059652291565289),
1112 FRAC_CONST(0.0061741969558843),
1113 FRAC_CONST(0.0063872090870253),
1114 FRAC_CONST(0.0066043097234387),
1115 FRAC_CONST(0.0068255428935640),
1116 FRAC_CONST(0.0070509524970088),
1117 FRAC_CONST(0.0072805823184660),
1118 FRAC_CONST(0.0075144760396340),
1119 FRAC_CONST(0.0077526772493942),
1120 FRAC_CONST(0.0079952294524673),
1121 FRAC_CONST(0.0082421760767325),
1122 FRAC_CONST(0.0084935604793733),
1123 FRAC_CONST(0.0087494259519870),
1124 FRAC_CONST(0.0090098157247792),
1125 FRAC_CONST(0.0092747729699467),
1126 FRAC_CONST(0.0095443408043399),
1127 FRAC_CONST(0.0098185622914832),
1128 FRAC_CONST(0.0100974804430226),
1129 FRAC_CONST(0.0103811382196612),
1130 FRAC_CONST(0.0106695785316351),
1131 FRAC_CONST(0.0109628442387771),
1132 FRAC_CONST(0.0112609781502091),
1133 FRAC_CONST(0.0115640230236993),
1134 FRAC_CONST(0.0118720215647169),
1135 FRAC_CONST(0.0121850164252137),
1136 FRAC_CONST(0.0125030502021561),
1137 FRAC_CONST(0.0128261654358321),
1138 FRAC_CONST(0.0131544046079532),
1139 FRAC_CONST(0.0134878101395681),
1140 FRAC_CONST(0.0138264243888068),
1141 FRAC_CONST(0.0141702896484671),
1142 FRAC_CONST(0.0145194481434592),
1143 FRAC_CONST(0.0148739420281182),
1144 FRAC_CONST(0.0152338133833959),
1145 FRAC_CONST(0.0155991042139432),
1146 FRAC_CONST(0.0159698564450882),
1147 FRAC_CONST(0.0163461119197227),
1148 FRAC_CONST(0.0167279123950996),
1149 FRAC_CONST(0.0171152995395520),
1150 FRAC_CONST(0.0175083149291368),
1151 FRAC_CONST(0.0179070000442104),
1152 FRAC_CONST(0.0183113962659409),
1153 FRAC_CONST(0.0187215448727609),
1154 FRAC_CONST(0.0191374870367659),
1155 FRAC_CONST(0.0195592638200623),
1156 FRAC_CONST(0.0199869161710679),
1157 FRAC_CONST(0.0204204849207691),
1158 FRAC_CONST(0.0208600107789370),
1159 FRAC_CONST(0.0213055343303066),
1160 FRAC_CONST(0.0217570960307201),
1161 FRAC_CONST(0.0222147362032386),
1162 FRAC_CONST(0.0226784950342228),
1163 FRAC_CONST(0.0231484125693867),
1164 FRAC_CONST(0.0236245287098244),
1165 FRAC_CONST(0.0241068832080138),
1166 FRAC_CONST(0.0245955156637973),
1167 FRAC_CONST(0.0250904655203431),
1168 FRAC_CONST(0.0255917720600868),
1169 FRAC_CONST(0.0260994744006559),
1170 FRAC_CONST(0.0266136114907790),
1171 FRAC_CONST(0.0271342221061795),
1172 FRAC_CONST(0.0276613448454576),
1173 FRAC_CONST(0.0281950181259587),
1174 FRAC_CONST(0.0287352801796329),
1175 FRAC_CONST(0.0292821690488833),
1176 FRAC_CONST(0.0298357225824074),
1177 FRAC_CONST(0.0303959784310299),
1178 FRAC_CONST(0.0309629740435296),
1179 FRAC_CONST(0.0315367466624615),
1180 FRAC_CONST(0.0321173333199732),
1181 FRAC_CONST(0.0327047708336193),
1182 FRAC_CONST(0.0332990958021720),
1183 FRAC_CONST(0.0339003446014307),
1184 FRAC_CONST(0.0345085533800302),
1185 FRAC_CONST(0.0351237580552491),
1186 FRAC_CONST(0.0357459943088193),
1187 FRAC_CONST(0.0363752975827358),
1188 FRAC_CONST(0.0370117030750704),
1189 FRAC_CONST(0.0376552457357870),
1190 FRAC_CONST(0.0383059602625614),
1191 FRAC_CONST(0.0389638810966056),
1192 FRAC_CONST(0.0396290424184964),
1193 FRAC_CONST(0.0403014781440112),
1194 FRAC_CONST(0.0409812219199691),
1195 FRAC_CONST(0.0416683071200799),
1196 FRAC_CONST(0.0423627668408009),
1197 FRAC_CONST(0.0430646338972016),
1198 FRAC_CONST(0.0437739408188385),
1199 FRAC_CONST(0.0444907198456388),
1200 FRAC_CONST(0.0452150029237951),
1201 FRAC_CONST(0.0459468217016708),
1202 FRAC_CONST(0.0466862075257170),
1203 FRAC_CONST(0.0474331914364021),
1204 FRAC_CONST(0.0481878041641539),
1205 FRAC_CONST(0.0489500761253148),
1206 FRAC_CONST(0.0497200374181119),
1207 FRAC_CONST(0.0504977178186404),
1208 FRAC_CONST(0.0512831467768636),
1209 FRAC_CONST(0.0520763534126273),
1210 FRAC_CONST(0.0528773665116913),
1211 FRAC_CONST(0.0536862145217772),
1212 FRAC_CONST(0.0545029255486345),
1213 FRAC_CONST(0.0553275273521232),
1214 FRAC_CONST(0.0561600473423164),
1215 FRAC_CONST(0.0570005125756209),
1216 FRAC_CONST(0.0578489497509179),
1217 FRAC_CONST(0.0587053852057233),
1218 FRAC_CONST(0.0595698449123695),
1219 FRAC_CONST(0.0604423544742077),
1220 FRAC_CONST(0.0613229391218317),
1221 FRAC_CONST(0.0622116237093247),
1222 FRAC_CONST(0.0631084327105284),
1223 FRAC_CONST(0.0640133902153352),
1224 FRAC_CONST(0.0649265199260043),
1225 FRAC_CONST(0.0658478451535027),
1226 FRAC_CONST(0.0667773888138695),
1227 FRAC_CONST(0.0677151734246072),
1228 FRAC_CONST(0.0686612211010977),
1229 FRAC_CONST(0.0696155535530446),
1230 FRAC_CONST(0.0705781920809429),
1231 FRAC_CONST(0.0715491575725758),
1232 FRAC_CONST(0.0725284704995383),
1233 FRAC_CONST(0.0735161509137906),
1234 FRAC_CONST(0.0745122184442388),
1235 FRAC_CONST(0.0755166922933461),
1236 FRAC_CONST(0.0765295912337720),
1237 FRAC_CONST(0.0775509336050437),
1238 FRAC_CONST(0.0785807373102561),
1239 FRAC_CONST(0.0796190198128044),
1240 FRAC_CONST(0.0806657981331473),
1241 FRAC_CONST(0.0817210888456026),
1242 FRAC_CONST(0.0827849080751753),
1243 FRAC_CONST(0.0838572714944183),
1244 FRAC_CONST(0.0849381943203265),
1245 FRAC_CONST(0.0860276913112652),
1246 FRAC_CONST(0.0871257767639319),
1247 FRAC_CONST(0.0882324645103534),
1248 FRAC_CONST(0.0893477679149177),
1249 FRAC_CONST(0.0904716998714418),
1250 FRAC_CONST(0.0916042728002747),
1251 FRAC_CONST(0.0927454986454381),
1252 FRAC_CONST(0.0938953888718020),
1253 FRAC_CONST(0.0950539544622996),
1254 FRAC_CONST(0.0962212059151784),
1255 FRAC_CONST(0.0973971532412897),
1256 FRAC_CONST(0.0985818059614169),
1257 FRAC_CONST(0.0997751731036425),
1258 FRAC_CONST(0.1009772632007537),
1259 FRAC_CONST(0.1021880842876888),
1260 FRAC_CONST(0.1034076438990227),
1261 FRAC_CONST(0.1046359490664932),
1262 FRAC_CONST(0.1058730063165681),
1263 FRAC_CONST(0.1071188216680533),
1264 FRAC_CONST(0.1083734006297428),
1265 FRAC_CONST(0.1096367481981100),
1266 FRAC_CONST(0.1109088688550422),
1267 FRAC_CONST(0.1121897665656167),
1268 FRAC_CONST(0.1134794447759207),
1269 FRAC_CONST(0.1147779064109143),
1270 FRAC_CONST(0.1160851538723372),
1271 FRAC_CONST(0.1174011890366591),
1272 FRAC_CONST(0.1187260132530751),
1273 FRAC_CONST(0.1200596273415457),
1274 FRAC_CONST(0.1214020315908810),
1275 FRAC_CONST(0.1227532257568719),
1276 FRAC_CONST(0.1241132090604651),
1277 FRAC_CONST(0.1254819801859856),
1278 FRAC_CONST(0.1268595372794049),
1279 FRAC_CONST(0.1282458779466558),
1280 FRAC_CONST(0.1296409992519942),
1281 FRAC_CONST(0.1310448977164081),
1282 FRAC_CONST(0.1324575693160745),
1283 FRAC_CONST(0.1338790094808633),
1284 FRAC_CONST(0.1353092130928902),
1285 FRAC_CONST(0.1367481744851168),
1286 FRAC_CONST(0.1381958874400010),
1287 FRAC_CONST(0.1396523451881945),
1288 FRAC_CONST(0.1411175404072910),
1289 FRAC_CONST(0.1425914652206223),
1290 FRAC_CONST(0.1440741111961058),
1291 FRAC_CONST(0.1455654693451402),
1292 FRAC_CONST(0.1470655301215526),
1293 FRAC_CONST(0.1485742834205956),
1294 FRAC_CONST(0.1500917185779945),
1295 FRAC_CONST(0.1516178243690463),
1296 FRAC_CONST(0.1531525890077689),
1297 FRAC_CONST(0.1546960001461024),
1298 FRAC_CONST(0.1562480448731608),
1299 FRAC_CONST(0.1578087097145364),
1300 FRAC_CONST(0.1593779806316558),
1301 FRAC_CONST(0.1609558430211876),
1302 FRAC_CONST(0.1625422817145027),
1303 FRAC_CONST(0.1641372809771871),
1304 FRAC_CONST(0.1657408245086070),
1305 FRAC_CONST(0.1673528954415270),
1306 FRAC_CONST(0.1689734763417811),
1307 FRAC_CONST(0.1706025492079969),
1308 FRAC_CONST(0.1722400954713725),
1309 FRAC_CONST(0.1738860959955082),
1310 FRAC_CONST(0.1755405310762898),
1311 FRAC_CONST(0.1772033804418275),
1312 FRAC_CONST(0.1788746232524467),
1313 FRAC_CONST(0.1805542381007349),
1314 FRAC_CONST(0.1822422030116404),
1315 FRAC_CONST(0.1839384954426268),
1316 FRAC_CONST(0.1856430922838810),
1317 FRAC_CONST(0.1873559698585756),
1318 FRAC_CONST(0.1890771039231862),
1319 FRAC_CONST(0.1908064696678625),
1320 FRAC_CONST(0.1925440417168546),
1321 FRAC_CONST(0.1942897941289937),
1322 FRAC_CONST(0.1960437003982277),
1323 FRAC_CONST(0.1978057334542116),
1324 FRAC_CONST(0.1995758656629525),
1325 FRAC_CONST(0.2013540688275098),
1326 FRAC_CONST(0.2031403141887507),
1327 FRAC_CONST(0.2049345724261595),
1328 FRAC_CONST(0.2067368136587033),
1329 FRAC_CONST(0.2085470074457521),
1330 FRAC_CONST(0.2103651227880538),
1331 FRAC_CONST(0.2121911281287646),
1332 FRAC_CONST(0.2140249913545346),
1333 FRAC_CONST(0.2158666797966480),
1334 FRAC_CONST(0.2177161602322188),
1335 FRAC_CONST(0.2195733988854414),
1336 FRAC_CONST(0.2214383614288963),
1337 FRAC_CONST(0.2233110129849106),
1338 FRAC_CONST(0.2251913181269740),
1339 FRAC_CONST(0.2270792408812093),
1340 FRAC_CONST(0.2289747447278976),
1341 FRAC_CONST(0.2308777926030592),
1342 FRAC_CONST(0.2327883469000885),
1343 FRAC_CONST(0.2347063694714437),
1344 FRAC_CONST(0.2366318216303919),
1345 FRAC_CONST(0.2385646641528076),
1346 FRAC_CONST(0.2405048572790267),
1347 FRAC_CONST(0.2424523607157545),
1348 FRAC_CONST(0.2444071336380283),
1349 FRAC_CONST(0.2463691346912334),
1350 FRAC_CONST(0.2483383219931741),
1351 FRAC_CONST(0.2503146531361985),
1352 FRAC_CONST(0.2522980851893767),
1353 FRAC_CONST(0.2542885747007335),
1354 FRAC_CONST(0.2562860776995335),
1355 FRAC_CONST(0.2582905496986215),
1356 FRAC_CONST(0.2603019456968142),
1357 FRAC_CONST(0.2623202201813464),
1358 FRAC_CONST(0.2643453271303700),
1359 FRAC_CONST(0.2663772200155053),
1360 FRAC_CONST(0.2684158518044454),
1361 FRAC_CONST(0.2704611749636135),
1362 FRAC_CONST(0.2725131414608710),
1363 FRAC_CONST(0.2745717027682799),
1364 FRAC_CONST(0.2766368098649151),
1365 FRAC_CONST(0.2787084132397296),
1366 FRAC_CONST(0.2807864628944707),
1367 FRAC_CONST(0.2828709083466482),
1368 FRAC_CONST(0.2849616986325523),
1369 FRAC_CONST(0.2870587823103237),
1370 FRAC_CONST(0.2891621074630737),
1371 FRAC_CONST(0.2912716217020546),
1372 FRAC_CONST(0.2933872721698803),
1373 FRAC_CONST(0.2955090055437973),
1374 FRAC_CONST(0.2976367680390041),
1375 FRAC_CONST(0.2997705054120213),
1376 FRAC_CONST(0.3019101629641097),
1377 FRAC_CONST(0.3040556855447379),
1378 FRAC_CONST(0.3062070175550981),
1379 FRAC_CONST(0.3083641029516701),
1380 FRAC_CONST(0.3105268852498334),
1381 FRAC_CONST(0.3126953075275265),
1382 FRAC_CONST(0.3148693124289546),
1383 FRAC_CONST(0.3170488421683428),
1384 FRAC_CONST(0.3192338385337370),
1385 FRAC_CONST(0.3214242428908514),
1386 FRAC_CONST(0.3236199961869606),
1387 FRAC_CONST(0.3258210389548392),
1388 FRAC_CONST(0.3280273113167459),
1389 FRAC_CONST(0.3302387529884521),
1390 FRAC_CONST(0.3324553032833160),
1391 FRAC_CONST(0.3346769011164010),
1392 FRAC_CONST(0.3369034850086373),
1393 FRAC_CONST(0.3391349930910280),
1394 FRAC_CONST(0.3413713631088974),
1395 FRAC_CONST(0.3436125324261830),
1396 FRAC_CONST(0.3458584380297697),
1397 FRAC_CONST(0.3481090165338656),
1398 FRAC_CONST(0.3503642041844199),
1399 FRAC_CONST(0.3526239368635820),
1400 FRAC_CONST(0.3548881500942010),
1401 FRAC_CONST(0.3571567790443668),
1402 FRAC_CONST(0.3594297585319891),
1403 FRAC_CONST(0.3617070230294185),
1404 FRAC_CONST(0.3639885066681048),
1405 FRAC_CONST(0.3662741432432950),
1406 FRAC_CONST(0.3685638662187693),
1407 FRAC_CONST(0.3708576087316147),
1408 FRAC_CONST(0.3731553035970366),
1409 FRAC_CONST(0.3754568833132069),
1410 FRAC_CONST(0.3777622800661488),
1411 FRAC_CONST(0.3800714257346570),
1412 FRAC_CONST(0.3823842518952546),
1413 FRAC_CONST(0.3847006898271841),
1414 FRAC_CONST(0.3870206705174334),
1415 FRAC_CONST(0.3893441246657958),
1416 FRAC_CONST(0.3916709826899639),
1417 FRAC_CONST(0.3940011747306560),
1418 FRAC_CONST(0.3963346306567764),
1419 FRAC_CONST(0.3986712800706062),
1420 FRAC_CONST(0.4010110523130271),
1421 FRAC_CONST(0.4033538764687756),
1422 FRAC_CONST(0.4056996813717284),
1423 FRAC_CONST(0.4080483956102172),
1424 FRAC_CONST(0.4103999475323736),
1425 FRAC_CONST(0.4127542652515031),
1426 FRAC_CONST(0.4151112766514873),
1427 FRAC_CONST(0.4174709093922143),
1428 FRAC_CONST(0.4198330909150365),
1429 FRAC_CONST(0.4221977484482556),
1430 FRAC_CONST(0.4245648090126334),
1431 FRAC_CONST(0.4269341994269293),
1432 FRAC_CONST(0.4293058463134616),
1433 FRAC_CONST(0.4316796761036958),
1434 FRAC_CONST(0.4340556150438547),
1435 FRAC_CONST(0.4364335892005536),
1436 FRAC_CONST(0.4388135244664580),
1437 FRAC_CONST(0.4411953465659639),
1438 FRAC_CONST(0.4435789810609000),
1439 FRAC_CONST(0.4459643533562509),
1440 FRAC_CONST(0.4483513887059016),
1441 FRAC_CONST(0.4507400122184019),
1442 FRAC_CONST(0.4531301488627497),
1443 FRAC_CONST(0.4555217234741947),
1444 FRAC_CONST(0.4579146607600593),
1445 FRAC_CONST(0.4603088853055777),
1446 FRAC_CONST(0.4627043215797521),
1447 FRAC_CONST(0.4651008939412254),
1448 FRAC_CONST(0.4674985266441709),
1449 FRAC_CONST(0.4698971438441951),
1450 FRAC_CONST(0.4722966696042580),
1451 FRAC_CONST(0.4746970279006055),
1452 FRAC_CONST(0.4770981426287164),
1453 FRAC_CONST(0.4794999376092619),
1454 FRAC_CONST(0.4819023365940778),
1455 FRAC_CONST(0.4843052632721476),
1456 FRAC_CONST(0.4867086412755978),
1457 FRAC_CONST(0.4891123941857028),
1458 FRAC_CONST(0.4915164455388997),
1459 FRAC_CONST(0.4939207188328126),
1460 FRAC_CONST(0.4963251375322855),
1461 FRAC_CONST(0.4987296250754225),
1462 FRAC_CONST(0.5011341048796359),
1463 FRAC_CONST(0.5035385003477012),
1464 FRAC_CONST(0.5059427348738168),
1465 FRAC_CONST(0.5083467318496706),
1466 FRAC_CONST(0.5107504146705106),
1467 FRAC_CONST(0.5131537067412193),
1468 FRAC_CONST(0.5155565314823923),
1469 FRAC_CONST(0.5179588123364193),
1470 FRAC_CONST(0.5203604727735667),
1471 FRAC_CONST(0.5227614362980630),
1472 FRAC_CONST(0.5251616264541841),
1473 FRAC_CONST(0.5275609668323384),
1474 FRAC_CONST(0.5299593810751532),
1475 FRAC_CONST(0.5323567928835578),
1476 FRAC_CONST(0.5347531260228663),
1477 FRAC_CONST(0.5371483043288580),
1478 FRAC_CONST(0.5395422517138538),
1479 FRAC_CONST(0.5419348921727899),
1480 FRAC_CONST(0.5443261497892862),
1481 FRAC_CONST(0.5467159487417104),
1482 FRAC_CONST(0.5491042133092364),
1483 FRAC_CONST(0.5514908678778958),
1484 FRAC_CONST(0.5538758369466227),
1485 FRAC_CONST(0.5562590451332913),
1486 FRAC_CONST(0.5586404171807443),
1487 FRAC_CONST(0.5610198779628133),
1488 FRAC_CONST(0.5633973524903286),
1489 FRAC_CONST(0.5657727659171199),
1490 FRAC_CONST(0.5681460435460047),
1491 FRAC_CONST(0.5705171108347663),
1492 FRAC_CONST(0.5728858934021188),
1493 FRAC_CONST(0.5752523170336598),
1494 FRAC_CONST(0.5776163076878088),
1495 FRAC_CONST(0.5799777915017323),
1496 FRAC_CONST(0.5823366947972535),
1497 FRAC_CONST(0.5846929440867458),
1498 FRAC_CONST(0.5870464660790119),
1499 FRAC_CONST(0.5893971876851449),
1500 FRAC_CONST(0.5917450360243719),
1501 FRAC_CONST(0.5940899384298793),
1502 FRAC_CONST(0.5964318224546208),
1503 FRAC_CONST(0.5987706158771039),
1504 FRAC_CONST(0.6011062467071583),
1505 FRAC_CONST(0.6034386431916822),
1506 FRAC_CONST(0.6057677338203681),
1507 FRAC_CONST(0.6080934473314057),
1508 FRAC_CONST(0.6104157127171639),
1509 FRAC_CONST(0.6127344592298474),
1510 FRAC_CONST(0.6150496163871310),
1511 FRAC_CONST(0.6173611139777690),
1512 FRAC_CONST(0.6196688820671789),
1513 FRAC_CONST(0.6219728510029997),
1514 FRAC_CONST(0.6242729514206247),
1515 FRAC_CONST(0.6265691142487051),
1516 FRAC_CONST(0.6288612707146283),
1517 FRAC_CONST(0.6311493523499663),
1518 FRAC_CONST(0.6334332909958958),
1519 FRAC_CONST(0.6357130188085891),
1520 FRAC_CONST(0.6379884682645743),
1521 FRAC_CONST(0.6402595721660647),
1522 FRAC_CONST(0.6425262636462578),
1523 FRAC_CONST(0.6447884761746012),
1524 FRAC_CONST(0.6470461435620266),
1525 FRAC_CONST(0.6492991999661505),
1526 FRAC_CONST(0.6515475798964411),
1527 FRAC_CONST(0.6537912182193508),
1528 FRAC_CONST(0.6560300501634142),
1529 FRAC_CONST(0.6582640113243098),
1530 FRAC_CONST(0.6604930376698862),
1531 FRAC_CONST(0.6627170655451516),
1532 FRAC_CONST(0.6649360316772256),
1533 FRAC_CONST(0.6671498731802533),
1534 FRAC_CONST(0.6693585275602818),
1535 FRAC_CONST(0.6715619327200959),
1536 FRAC_CONST(0.6737600269640164),
1537 FRAC_CONST(0.6759527490026566),
1538 FRAC_CONST(0.6781400379576392),
1539 FRAC_CONST(0.6803218333662715),
1540 FRAC_CONST(0.6824980751861787),
1541 FRAC_CONST(0.6846687037998949),
1542 FRAC_CONST(0.6868336600194123),
1543 FRAC_CONST(0.6889928850906855),
1544 FRAC_CONST(0.6911463206980928),
1545 FRAC_CONST(0.6932939089688525),
1546 FRAC_CONST(0.6954355924773949),
1547 FRAC_CONST(0.6975713142496884),
1548 FRAC_CONST(0.6997010177675195),
1549 FRAC_CONST(0.7018246469727265),
1550 FRAC_CONST(0.7039421462713862),
1551 FRAC_CONST(0.7060534605379528),
1552 FRAC_CONST(0.7081585351193496),
1553 FRAC_CONST(0.7102573158390105),
1554 FRAC_CONST(0.7123497490008750),
1555 FRAC_CONST(0.7144357813933307),
1556 FRAC_CONST(0.7165153602931092),
1557 FRAC_CONST(0.7185884334691287),
1558 FRAC_CONST(0.7206549491862871),
1559 FRAC_CONST(0.7227148562092042),
1560 FRAC_CONST(0.7247681038059106),
1561 FRAC_CONST(0.7268146417514855),
1562 FRAC_CONST(0.7288544203316418),
1563 FRAC_CONST(0.7308873903462577),
1564 FRAC_CONST(0.7329135031128549),
1565 FRAC_CONST(0.7349327104700221),
1566 FRAC_CONST(0.7369449647807855),
1567 FRAC_CONST(0.7389502189359237),
1568 FRAC_CONST(0.7409484263572271),
1569 FRAC_CONST(0.7429395410007016),
1570 FRAC_CONST(0.7449235173597176),
1571 FRAC_CONST(0.7469003104681008),
1572 FRAC_CONST(0.7488698759031670),
1573 FRAC_CONST(0.7508321697887005),
1574 FRAC_CONST(0.7527871487978728),
1575 FRAC_CONST(0.7547347701561059),
1576 FRAC_CONST(0.7566749916438754),
1577 FRAC_CONST(0.7586077715994560),
1578 FRAC_CONST(0.7605330689216074),
1579 FRAC_CONST(0.7624508430722016),
1580 FRAC_CONST(0.7643610540787891),
1581 FRAC_CONST(0.7662636625371070),
1582 FRAC_CONST(0.7681586296135255),
1583 FRAC_CONST(0.7700459170474343),
1584 FRAC_CONST(0.7719254871535672),
1585 FRAC_CONST(0.7737973028242671),
1586 FRAC_CONST(0.7756613275316875),
1587 FRAC_CONST(0.7775175253299340),
1588 FRAC_CONST(0.7793658608571425),
1589 FRAC_CONST(0.7812062993374951),
1590 FRAC_CONST(0.7830388065831744),
1591 FRAC_CONST(0.7848633489962533),
1592 FRAC_CONST(0.7866798935705233),
1593 FRAC_CONST(0.7884884078932579),
1594 FRAC_CONST(0.7902888601469138),
1595 FRAC_CONST(0.7920812191107668),
1596 FRAC_CONST(0.7938654541624850),
1597 FRAC_CONST(0.7956415352796368),
1598 FRAC_CONST(0.7974094330411343),
1599 FRAC_CONST(0.7991691186286133),
1600 FRAC_CONST(0.8009205638277465),
1601 FRAC_CONST(0.8026637410294932),
1602 FRAC_CONST(0.8043986232312831),
1603 FRAC_CONST(0.8061251840381346),
1604 FRAC_CONST(0.8078433976637077),
1605 FRAC_CONST(0.8095532389312917),
1606 FRAC_CONST(0.8112546832747255),
1607 FRAC_CONST(0.8129477067392539),
1608 FRAC_CONST(0.8146322859823164),
1609 FRAC_CONST(0.8163083982742698),
1610 FRAC_CONST(0.8179760214990457),
1611 FRAC_CONST(0.8196351341547393),
1612 FRAC_CONST(0.8212857153541345),
1613 FRAC_CONST(0.8229277448251595),
1614 FRAC_CONST(0.8245612029112778),
1615 FRAC_CONST(0.8261860705718113),
1616 FRAC_CONST(0.8278023293821971),
1617 FRAC_CONST(0.8294099615341773),
1618 FRAC_CONST(0.8310089498359212),
1619 FRAC_CONST(0.8325992777120815),
1620 FRAC_CONST(0.8341809292037831),
1621 FRAC_CONST(0.8357538889685445),
1622 FRAC_CONST(0.8373181422801330),
1623 FRAC_CONST(0.8388736750283521),
1624 FRAC_CONST(0.8404204737187619),
1625 FRAC_CONST(0.8419585254723335),
1626 FRAC_CONST(0.8434878180250348),
1627 FRAC_CONST(0.8450083397273509),
1628 FRAC_CONST(0.8465200795437368),
1629 FRAC_CONST(0.8480230270520029),
1630 FRAC_CONST(0.8495171724426350),
1631 FRAC_CONST(0.8510025065180464),
1632 FRAC_CONST(0.8524790206917633),
1633 FRAC_CONST(0.8539467069875448),
1634 FRAC_CONST(0.8554055580384357),
1635 FRAC_CONST(0.8568555670857525),
1636 FRAC_CONST(0.8582967279780043),
1637 FRAC_CONST(0.8597290351697464),
1638 FRAC_CONST(0.8611524837203691),
1639 FRAC_CONST(0.8625670692928198),
1640 FRAC_CONST(0.8639727881522599),
1641 FRAC_CONST(0.8653696371646555),
1642 FRAC_CONST(0.8667576137953045),
1643 FRAC_CONST(0.8681367161072958),
1644 FRAC_CONST(0.8695069427599065),
1645 FRAC_CONST(0.8708682930069319),
1646 FRAC_CONST(0.8722207666949527),
1647 FRAC_CONST(0.8735643642615368),
1648 FRAC_CONST(0.8748990867333771),
1649 FRAC_CONST(0.8762249357243662),
1650 FRAC_CONST(0.8775419134336067),
1651 FRAC_CONST(0.8788500226433579),
1652 FRAC_CONST(0.8801492667169208),
1653 FRAC_CONST(0.8814396495964587),
1654 FRAC_CONST(0.8827211758007560),
1655 FRAC_CONST(0.8839938504229149),
1656 FRAC_CONST(0.8852576791279895),
1657 FRAC_CONST(0.8865126681505587),
1658 FRAC_CONST(0.8877588242922386),
1659 FRAC_CONST(0.8889961549191320),
1660 FRAC_CONST(0.8902246679592184),
1661 FRAC_CONST(0.8914443718996848),
1662 FRAC_CONST(0.8926552757841945),
1663 FRAC_CONST(0.8938573892100969),
1664 FRAC_CONST(0.8950507223255798),
1665 FRAC_CONST(0.8962352858267605),
1666 FRAC_CONST(0.8974110909547198),
1667 FRAC_CONST(0.8985781494924783),
1668 FRAC_CONST(0.8997364737619142),
1669 FRAC_CONST(0.9008860766206249),
1670 FRAC_CONST(0.9020269714587307),
1671 FRAC_CONST(0.9031591721956235),
1672 FRAC_CONST(0.9042826932766591),
1673 FRAC_CONST(0.9053975496697941),
1674 FRAC_CONST(0.9065037568621681),
1675 FRAC_CONST(0.9076013308566311),
1676 FRAC_CONST(0.9086902881682180),
1677 FRAC_CONST(0.9097706458205682),
1678 FRAC_CONST(0.9108424213422940),
1679 FRAC_CONST(0.9119056327632955),
1680 FRAC_CONST(0.9129602986110235),
1681 FRAC_CONST(0.9140064379066919),
1682 FRAC_CONST(0.9150440701614393),
1683 FRAC_CONST(0.9160732153724396),
1684 FRAC_CONST(0.9170938940189634),
1685 FRAC_CONST(0.9181061270583908),
1686 FRAC_CONST(0.9191099359221748),
1687 FRAC_CONST(0.9201053425117579),
1688 FRAC_CONST(0.9210923691944400),
1689 FRAC_CONST(0.9220710387992010),
1690 FRAC_CONST(0.9230413746124764),
1691 FRAC_CONST(0.9240034003738882),
1692 FRAC_CONST(0.9249571402719298),
1693 FRAC_CONST(0.9259026189396085),
1694 FRAC_CONST(0.9268398614500427),
1695 FRAC_CONST(0.9277688933120170),
1696 FRAC_CONST(0.9286897404654957),
1697 FRAC_CONST(0.9296024292770939),
1698 FRAC_CONST(0.9305069865355076),
1699 FRAC_CONST(0.9314034394469048),
1700 FRAC_CONST(0.9322918156302762),
1701 FRAC_CONST(0.9331721431127471),
1702 FRAC_CONST(0.9340444503248519),
1703 FRAC_CONST(0.9349087660957711),
1704 FRAC_CONST(0.9357651196485313),
1705 FRAC_CONST(0.9366135405951697),
1706 FRAC_CONST(0.9374540589318637),
1707 FRAC_CONST(0.9382867050340261),
1708 FRAC_CONST(0.9391115096513655),
1709 FRAC_CONST(0.9399285039029165),
1710 FRAC_CONST(0.9407377192720349),
1711 FRAC_CONST(0.9415391876013639),
1712 FRAC_CONST(0.9423329410877687),
1713 FRAC_CONST(0.9431190122772415),
1714 FRAC_CONST(0.9438974340597782),
1715 FRAC_CONST(0.9446682396642262),
1716 FRAC_CONST(0.9454314626531054),
1717 FRAC_CONST(0.9461871369174033),
1718 FRAC_CONST(0.9469352966713429),
1719 FRAC_CONST(0.9476759764471278),
1720 FRAC_CONST(0.9484092110896616),
1721 FRAC_CONST(0.9491350357512457),
1722 FRAC_CONST(0.9498534858862532),
1723 FRAC_CONST(0.9505645972457831),
1724 FRAC_CONST(0.9512684058722927),
1725 FRAC_CONST(0.9519649480942105),
1726 FRAC_CONST(0.9526542605205314),
1727 FRAC_CONST(0.9533363800353921),
1728 FRAC_CONST(0.9540113437926313),
1729 FRAC_CONST(0.9546791892103320),
1730 FRAC_CONST(0.9553399539653500),
1731 FRAC_CONST(0.9559936759878265),
1732 FRAC_CONST(0.9566403934556893),
1733 FRAC_CONST(0.9572801447891388),
1734 FRAC_CONST(0.9579129686451244),
1735 FRAC_CONST(0.9585389039118085),
1736 FRAC_CONST(0.9591579897030224),
1737 FRAC_CONST(0.9597702653527108),
1738 FRAC_CONST(0.9603757704093711),
1739 FRAC_CONST(0.9609745446304828),
1740 FRAC_CONST(0.9615666279769324),
1741 FRAC_CONST(0.9621520606074324),
1742 FRAC_CONST(0.9627308828729358),
1743 FRAC_CONST(0.9633031353110477),
1744 FRAC_CONST(0.9638688586404335),
1745 FRAC_CONST(0.9644280937552258),
1746 FRAC_CONST(0.9649808817194311),
1747 FRAC_CONST(0.9655272637613366),
1748 FRAC_CONST(0.9660672812679171),
1749 FRAC_CONST(0.9666009757792454),
1750 FRAC_CONST(0.9671283889829055),
1751 FRAC_CONST(0.9676495627084089),
1752 FRAC_CONST(0.9681645389216160),
1753 FRAC_CONST(0.9686733597191652),
1754 FRAC_CONST(0.9691760673229058),
1755 FRAC_CONST(0.9696727040743406),
1756 FRAC_CONST(0.9701633124290767),
1757 FRAC_CONST(0.9706479349512860),
1758 FRAC_CONST(0.9711266143081750),
1759 FRAC_CONST(0.9715993932644684),
1760 FRAC_CONST(0.9720663146769026),
1761 FRAC_CONST(0.9725274214887337),
1762 FRAC_CONST(0.9729827567242596),
1763 FRAC_CONST(0.9734323634833574),
1764 FRAC_CONST(0.9738762849360358),
1765 FRAC_CONST(0.9743145643170059),
1766 FRAC_CONST(0.9747472449202687),
1767 FRAC_CONST(0.9751743700937215),
1768 FRAC_CONST(0.9755959832337850),
1769 FRAC_CONST(0.9760121277800496),
1770 FRAC_CONST(0.9764228472099433),
1771 FRAC_CONST(0.9768281850334235),
1772 FRAC_CONST(0.9772281847876897),
1773 FRAC_CONST(0.9776228900319223),
1774 FRAC_CONST(0.9780123443420448),
1775 FRAC_CONST(0.9783965913055132),
1776 FRAC_CONST(0.9787756745161313),
1777 FRAC_CONST(0.9791496375688939),
1778 FRAC_CONST(0.9795185240548578),
1779 FRAC_CONST(0.9798823775560431),
1780 FRAC_CONST(0.9802412416403639),
1781 FRAC_CONST(0.9805951598565897),
1782 FRAC_CONST(0.9809441757293399),
1783 FRAC_CONST(0.9812883327541090),
1784 FRAC_CONST(0.9816276743923267),
1785 FRAC_CONST(0.9819622440664515),
1786 FRAC_CONST(0.9822920851550995),
1787 FRAC_CONST(0.9826172409882086),
1788 FRAC_CONST(0.9829377548422400),
1789 FRAC_CONST(0.9832536699354163),
1790 FRAC_CONST(0.9835650294229984),
1791 FRAC_CONST(0.9838718763926001),
1792 FRAC_CONST(0.9841742538595437),
1793 FRAC_CONST(0.9844722047622547),
1794 FRAC_CONST(0.9847657719576983),
1795 FRAC_CONST(0.9850549982168574),
1796 FRAC_CONST(0.9853399262202529),
1797 FRAC_CONST(0.9856205985535073),
1798 FRAC_CONST(0.9858970577029519),
1799 FRAC_CONST(0.9861693460512790),
1800 FRAC_CONST(0.9864375058732389),
1801 FRAC_CONST(0.9867015793313820),
1802 FRAC_CONST(0.9869616084718489),
1803 FRAC_CONST(0.9872176352202061),
1804 FRAC_CONST(0.9874697013773301),
1805 FRAC_CONST(0.9877178486153397),
1806 FRAC_CONST(0.9879621184735767),
1807 FRAC_CONST(0.9882025523546365),
1808 FRAC_CONST(0.9884391915204485),
1809 FRAC_CONST(0.9886720770884069),
1810 FRAC_CONST(0.9889012500275530),
1811 FRAC_CONST(0.9891267511548089),
1812 FRAC_CONST(0.9893486211312621),
1813 FRAC_CONST(0.9895669004585049),
1814 FRAC_CONST(0.9897816294750255),
1815 FRAC_CONST(0.9899928483526520),
1816 FRAC_CONST(0.9902005970930525),
1817 FRAC_CONST(0.9904049155242876),
1818 FRAC_CONST(0.9906058432974180),
1819 FRAC_CONST(0.9908034198831690),
1820 FRAC_CONST(0.9909976845686489),
1821 FRAC_CONST(0.9911886764541239),
1822 FRAC_CONST(0.9913764344498495),
1823 FRAC_CONST(0.9915609972729590),
1824 FRAC_CONST(0.9917424034444086),
1825 FRAC_CONST(0.9919206912859797),
1826 FRAC_CONST(0.9920958989173397),
1827 FRAC_CONST(0.9922680642531603),
1828 FRAC_CONST(0.9924372250002933),
1829 FRAC_CONST(0.9926034186550070),
1830 FRAC_CONST(0.9927666825002789),
1831 FRAC_CONST(0.9929270536031491),
1832 FRAC_CONST(0.9930845688121325),
1833 FRAC_CONST(0.9932392647546895),
1834 FRAC_CONST(0.9933911778347579),
1835 FRAC_CONST(0.9935403442303433),
1836 FRAC_CONST(0.9936867998911693),
1837 FRAC_CONST(0.9938305805363887),
1838 FRAC_CONST(0.9939717216523539),
1839 FRAC_CONST(0.9941102584904481),
1840 FRAC_CONST(0.9942462260649764),
1841 FRAC_CONST(0.9943796591511174),
1842 FRAC_CONST(0.9945105922829353),
1843 FRAC_CONST(0.9946390597514524),
1844 FRAC_CONST(0.9947650956027824),
1845 FRAC_CONST(0.9948887336363228),
1846 FRAC_CONST(0.9950100074030103),
1847 FRAC_CONST(0.9951289502036336),
1848 FRAC_CONST(0.9952455950872091),
1849 FRAC_CONST(0.9953599748494155),
1850 FRAC_CONST(0.9954721220310890),
1851 FRAC_CONST(0.9955820689167787),
1852 FRAC_CONST(0.9956898475333619),
1853 FRAC_CONST(0.9957954896487196),
1854 FRAC_CONST(0.9958990267704713),
1855 FRAC_CONST(0.9960004901447701),
1856 FRAC_CONST(0.9960999107551559),
1857 FRAC_CONST(0.9961973193214694),
1858 FRAC_CONST(0.9962927462988245),
1859 FRAC_CONST(0.9963862218766388),
1860 FRAC_CONST(0.9964777759777242),
1861 FRAC_CONST(0.9965674382574342),
1862 FRAC_CONST(0.9966552381028704),
1863 FRAC_CONST(0.9967412046321465),
1864 FRAC_CONST(0.9968253666937095),
1865 FRAC_CONST(0.9969077528657186),
1866 FRAC_CONST(0.9969883914554805),
1867 FRAC_CONST(0.9970673104989413),
1868 FRAC_CONST(0.9971445377602348),
1869 FRAC_CONST(0.9972201007312871),
1870 FRAC_CONST(0.9972940266314749),
1871 FRAC_CONST(0.9973663424073412),
1872 FRAC_CONST(0.9974370747323638),
1873 FRAC_CONST(0.9975062500067785),
1874 FRAC_CONST(0.9975738943574574),
1875 FRAC_CONST(0.9976400336378379),
1876 FRAC_CONST(0.9977046934279079),
1877 FRAC_CONST(0.9977678990342401),
1878 FRAC_CONST(0.9978296754900812),
1879 FRAC_CONST(0.9978900475554902),
1880 FRAC_CONST(0.9979490397175296),
1881 FRAC_CONST(0.9980066761905056),
1882 FRAC_CONST(0.9980629809162593),
1883 FRAC_CONST(0.9981179775645063),
1884 FRAC_CONST(0.9981716895332257),
1885 FRAC_CONST(0.9982241399490979),
1886 FRAC_CONST(0.9982753516679893),
1887 FRAC_CONST(0.9983253472754841),
1888 FRAC_CONST(0.9983741490874634),
1889 FRAC_CONST(0.9984217791507299),
1890 FRAC_CONST(0.9984682592436778),
1891 FRAC_CONST(0.9985136108770075),
1892 FRAC_CONST(0.9985578552944850),
1893 FRAC_CONST(0.9986010134737439),
1894 FRAC_CONST(0.9986431061271304),
1895 FRAC_CONST(0.9986841537025921),
1896 FRAC_CONST(0.9987241763846056),
1897 FRAC_CONST(0.9987631940951476),
1898 FRAC_CONST(0.9988012264947044),
1899 FRAC_CONST(0.9988382929833222),
1900 FRAC_CONST(0.9988744127016956),
1901 FRAC_CONST(0.9989096045322947),
1902 FRAC_CONST(0.9989438871005292),
1903 FRAC_CONST(0.9989772787759494),
1904 FRAC_CONST(0.9990097976734847),
1905 FRAC_CONST(0.9990414616547146),
1906 FRAC_CONST(0.9990722883291779),
1907 FRAC_CONST(0.9991022950557125),
1908 FRAC_CONST(0.9991314989438310),
1909 FRAC_CONST(0.9991599168551279),
1910 FRAC_CONST(0.9991875654047181),
1911 FRAC_CONST(0.9992144609627068),
1912 FRAC_CONST(0.9992406196556911),
1913 FRAC_CONST(0.9992660573682882),
1914 FRAC_CONST(0.9992907897446957),
1915 FRAC_CONST(0.9993148321902777),
1916 FRAC_CONST(0.9993381998731797),
1917 FRAC_CONST(0.9993609077259696),
1918 FRAC_CONST(0.9993829704473038),
1919 FRAC_CONST(0.9994044025036201),
1920 FRAC_CONST(0.9994252181308537),
1921 FRAC_CONST(0.9994454313361775),
1922 FRAC_CONST(0.9994650558997651),
1923 FRAC_CONST(0.9994841053765757),
1924 FRAC_CONST(0.9995025930981609),
1925 FRAC_CONST(0.9995205321744921),
1926 FRAC_CONST(0.9995379354958073),
1927 FRAC_CONST(0.9995548157344778),
1928 FRAC_CONST(0.9995711853468930),
1929 FRAC_CONST(0.9995870565753632),
1930 FRAC_CONST(0.9996024414500382),
1931 FRAC_CONST(0.9996173517908444),
1932 FRAC_CONST(0.9996317992094352),
1933 FRAC_CONST(0.9996457951111574),
1934 FRAC_CONST(0.9996593506970310),
1935 FRAC_CONST(0.9996724769657434),
1936 FRAC_CONST(0.9996851847156547),
1937 FRAC_CONST(0.9996974845468164),
1938 FRAC_CONST(0.9997093868630000),
1939 FRAC_CONST(0.9997209018737374),
1940 FRAC_CONST(0.9997320395963699),
1941 FRAC_CONST(0.9997428098581069),
1942 FRAC_CONST(0.9997532222980933),
1943 FRAC_CONST(0.9997632863694836),
1944 FRAC_CONST(0.9997730113415246),
1945 FRAC_CONST(0.9997824063016426),
1946 FRAC_CONST(0.9997914801575380),
1947 FRAC_CONST(0.9998002416392840),
1948 FRAC_CONST(0.9998086993014300),
1949 FRAC_CONST(0.9998168615251084),
1950 FRAC_CONST(0.9998247365201450),
1951 FRAC_CONST(0.9998323323271717),
1952 FRAC_CONST(0.9998396568197407),
1953 FRAC_CONST(0.9998467177064404),
1954 FRAC_CONST(0.9998535225330116),
1955 FRAC_CONST(0.9998600786844637),
1956 FRAC_CONST(0.9998663933871905),
1957 FRAC_CONST(0.9998724737110845),
1958 FRAC_CONST(0.9998783265716498),
1959 FRAC_CONST(0.9998839587321121),
1960 FRAC_CONST(0.9998893768055266),
1961 FRAC_CONST(0.9998945872568815),
1962 FRAC_CONST(0.9998995964051983),
1963 FRAC_CONST(0.9999044104256269),
1964 FRAC_CONST(0.9999090353515359),
1965 FRAC_CONST(0.9999134770765971),
1966 FRAC_CONST(0.9999177413568642),
1967 FRAC_CONST(0.9999218338128448),
1968 FRAC_CONST(0.9999257599315647),
1969 FRAC_CONST(0.9999295250686255),
1970 FRAC_CONST(0.9999331344502529),
1971 FRAC_CONST(0.9999365931753376),
1972 FRAC_CONST(0.9999399062174669),
1973 FRAC_CONST(0.9999430784269460),
1974 FRAC_CONST(0.9999461145328103),
1975 FRAC_CONST(0.9999490191448277),
1976 FRAC_CONST(0.9999517967554878),
1977 FRAC_CONST(0.9999544517419835),
1978 FRAC_CONST(0.9999569883681778),
1979 FRAC_CONST(0.9999594107865607),
1980 FRAC_CONST(0.9999617230401926),
1981 FRAC_CONST(0.9999639290646355),
1982 FRAC_CONST(0.9999660326898712),
1983 FRAC_CONST(0.9999680376422052),
1984 FRAC_CONST(0.9999699475461585),
1985 FRAC_CONST(0.9999717659263435),
1986 FRAC_CONST(0.9999734962093266),
1987 FRAC_CONST(0.9999751417254756),
1988 FRAC_CONST(0.9999767057107922),
1989 FRAC_CONST(0.9999781913087290),
1990 FRAC_CONST(0.9999796015719915),
1991 FRAC_CONST(0.9999809394643231),
1992 FRAC_CONST(0.9999822078622751),
1993 FRAC_CONST(0.9999834095569596),
1994 FRAC_CONST(0.9999845472557860),
1995 FRAC_CONST(0.9999856235841805),
1996 FRAC_CONST(0.9999866410872889),
1997 FRAC_CONST(0.9999876022316609),
1998 FRAC_CONST(0.9999885094069193),
1999 FRAC_CONST(0.9999893649274085),
2000 FRAC_CONST(0.9999901710338274),
2001 FRAC_CONST(0.9999909298948430),
2002 FRAC_CONST(0.9999916436086862),
2003 FRAC_CONST(0.9999923142047299),
2004 FRAC_CONST(0.9999929436450469),
2005 FRAC_CONST(0.9999935338259505),
2006 FRAC_CONST(0.9999940865795161),
2007 FRAC_CONST(0.9999946036750835),
2008 FRAC_CONST(0.9999950868207405),
2009 FRAC_CONST(0.9999955376647868),
2010 FRAC_CONST(0.9999959577971798),
2011 FRAC_CONST(0.9999963487509599),
2012 FRAC_CONST(0.9999967120036571),
2013 FRAC_CONST(0.9999970489786785),
2014 FRAC_CONST(0.9999973610466748),
2015 FRAC_CONST(0.9999976495268890),
2016 FRAC_CONST(0.9999979156884846),
2017 FRAC_CONST(0.9999981607518545),
2018 FRAC_CONST(0.9999983858899099),
2019 FRAC_CONST(0.9999985922293493),
2020 FRAC_CONST(0.9999987808519092),
2021 FRAC_CONST(0.9999989527955938),
2022 FRAC_CONST(0.9999991090558848),
2023 FRAC_CONST(0.9999992505869332),
2024 FRAC_CONST(0.9999993783027293),
2025 FRAC_CONST(0.9999994930782556),
2026 FRAC_CONST(0.9999995957506171),
2027 FRAC_CONST(0.9999996871201549),
2028 FRAC_CONST(0.9999997679515386),
2029 FRAC_CONST(0.9999998389748399),
2030 FRAC_CONST(0.9999999008865869),
2031 FRAC_CONST(0.9999999543507984)
2032 };
2033 #endif
2034
2035 ALIGN static const real_t kbd_short_128[] =
2036 {
2037 FRAC_CONST(4.3795702929468881e-005),
2038 FRAC_CONST(0.00011867384265436617),
2039 FRAC_CONST(0.0002307165763996192),
2040 FRAC_CONST(0.00038947282760568383),
2041 FRAC_CONST(0.00060581272288302553),
2042 FRAC_CONST(0.00089199695169487453),
2043 FRAC_CONST(0.0012617254423430522),
2044 FRAC_CONST(0.0017301724373162003),
2045 FRAC_CONST(0.0023140071937421476),
2046 FRAC_CONST(0.0030313989666022221),
2047 FRAC_CONST(0.0039020049735530842),
2048 FRAC_CONST(0.0049469401815512024),
2049 FRAC_CONST(0.0061887279335368318),
2050 FRAC_CONST(0.0076512306364647726),
2051 FRAC_CONST(0.0093595599562652423),
2052 FRAC_CONST(0.011339966208377799),
2053 FRAC_CONST(0.013619706891715299),
2054 FRAC_CONST(0.016226894586323766),
2055 FRAC_CONST(0.019190324717288168),
2056 FRAC_CONST(0.022539283975960878),
2057 FRAC_CONST(0.026303340480472455),
2058 FRAC_CONST(0.030512117046644357),
2059 FRAC_CONST(0.03519504922365594),
2060 FRAC_CONST(0.040381130021856941),
2061 FRAC_CONST(0.046098643518702249),
2062 FRAC_CONST(0.052374889768730587),
2063 FRAC_CONST(0.059235903660769147),
2064 FRAC_CONST(0.066706170556282418),
2065 FRAC_CONST(0.074808341703430481),
2066 FRAC_CONST(0.083562952548726227),
2067 FRAC_CONST(0.092988147159339674),
2068 FRAC_CONST(0.1030994120216919),
2069 FRAC_CONST(0.11390932249409955),
2070 FRAC_CONST(0.12542730516149531),
2071 FRAC_CONST(0.13765941926783826),
2072 FRAC_CONST(0.15060816028651081),
2073 FRAC_CONST(0.16427228853114245),
2074 FRAC_CONST(0.17864668550988483),
2075 FRAC_CONST(0.19372224048676889),
2076 FRAC_CONST(0.20948576943658073),
2077 FRAC_CONST(0.22591996826744942),
2078 FRAC_CONST(0.24300340184133981),
2079 FRAC_CONST(0.26071052995068139),
2080 FRAC_CONST(0.27901177101369551),
2081 FRAC_CONST(0.29787360383626599),
2082 FRAC_CONST(0.3172587073594233),
2083 FRAC_CONST(0.33712613787396362),
2084 FRAC_CONST(0.35743154274286698),
2085 FRAC_CONST(0.37812740923363009),
2086 FRAC_CONST(0.39916334663203618),
2087 FRAC_CONST(0.42048639939189658),
2088 FRAC_CONST(0.4420413886774246),
2089 FRAC_CONST(0.4637712792815169),
2090 FRAC_CONST(0.4856175685594023),
2091 FRAC_CONST(0.50752069370766872),
2092 FRAC_CONST(0.52942045344797806),
2093 FRAC_CONST(0.55125643994680196),
2094 FRAC_CONST(0.57296847662071559),
2095 FRAC_CONST(0.59449705734411495),
2096 FRAC_CONST(0.61578378249506627),
2097 FRAC_CONST(0.63677178724712891),
2098 FRAC_CONST(0.65740615754163356),
2099 FRAC_CONST(0.67763432925662526),
2100 FRAC_CONST(0.69740646622548552),
2101 FRAC_CONST(0.71667581294953808),
2102 FRAC_CONST(0.73539901809352737),
2103 FRAC_CONST(0.75353642514900732),
2104 FRAC_CONST(0.77105232699609816),
2105 FRAC_CONST(0.78791518148597028),
2106 FRAC_CONST(0.80409778560147072),
2107 FRAC_CONST(0.81957740622770781),
2108 FRAC_CONST(0.83433586607383625),
2109 FRAC_CONST(0.84835958382689225),
2110 FRAC_CONST(0.86163956818294229),
2111 FRAC_CONST(0.87417136598406997),
2112 FRAC_CONST(0.88595496528524853),
2113 FRAC_CONST(0.89699465477567619),
2114 FRAC_CONST(0.90729884157670959),
2115 FRAC_CONST(0.91687983002436779),
2116 FRAC_CONST(0.92575356460899649),
2117 FRAC_CONST(0.93393934077779084),
2118 FRAC_CONST(0.94145948779657318),
2119 FRAC_CONST(0.94833902830402828),
2120 FRAC_CONST(0.95460531956280026),
2121 FRAC_CONST(0.96028768170574896),
2122 FRAC_CONST(0.96541701848104766),
2123 FRAC_CONST(0.97002543610646474),
2124 FRAC_CONST(0.97414586584250062),
2125 FRAC_CONST(0.97781169577969584),
2126 FRAC_CONST(0.98105641710392333),
2127 FRAC_CONST(0.98391328975491177),
2128 FRAC_CONST(0.98641503193166202),
2129 FRAC_CONST(0.98859353733226141),
2130 FRAC_CONST(0.99047962335771556),
2131 FRAC_CONST(0.9921028127769449),
2132 FRAC_CONST(0.99349115056397752),
2133 FRAC_CONST(0.99467105680259038),
2134 FRAC_CONST(0.9956672157341897),
2135 FRAC_CONST(0.99650250022834352),
2136 FRAC_CONST(0.99719793020823266),
2137 FRAC_CONST(0.99777266288955657),
2138 FRAC_CONST(0.99824401211201486),
2139 FRAC_CONST(0.99862749357391212),
2140 FRAC_CONST(0.99893689243401962),
2141 FRAC_CONST(0.99918434952623147),
2142 FRAC_CONST(0.99938046234161726),
2143 FRAC_CONST(0.99953439696357238),
2144 FRAC_CONST(0.99965400728430465),
2145 FRAC_CONST(0.99974595807027455),
2146 FRAC_CONST(0.99981584876278362),
2147 FRAC_CONST(0.99986833527824281),
2148 FRAC_CONST(0.99990724749057802),
2149 FRAC_CONST(0.99993570051598468),
2150 FRAC_CONST(0.99995619835942084),
2151 FRAC_CONST(0.99997072890647543),
2152 FRAC_CONST(0.9999808496399144),
2153 FRAC_CONST(0.99998776381655818),
2154 FRAC_CONST(0.99999238714961569),
2155 FRAC_CONST(0.99999540529959718),
2156 FRAC_CONST(0.99999732268176988),
2157 FRAC_CONST(0.99999850325054862),
2158 FRAC_CONST(0.99999920402413744),
2159 FRAC_CONST(0.9999996021706401),
2160 FRAC_CONST(0.99999981649545566),
2161 FRAC_CONST(0.99999992415545547),
2162 FRAC_CONST(0.99999997338493041),
2163 FRAC_CONST(0.99999999295825959),
2164 FRAC_CONST(0.99999999904096815)
2165 };
2166
2167 #ifdef ALLOW_SMALL_FRAMELENGTH
2168 ALIGN static const real_t kbd_short_120[] =
2169 {
2170 FRAC_CONST(0.0000452320086910),
2171 FRAC_CONST(0.0001274564692111),
2172 FRAC_CONST(0.0002529398385345),
2173 FRAC_CONST(0.0004335140496648),
2174 FRAC_CONST(0.0006827100966952),
2175 FRAC_CONST(0.0010158708222246),
2176 FRAC_CONST(0.0014502162869659),
2177 FRAC_CONST(0.0020048865156264),
2178 FRAC_CONST(0.0027009618393178),
2179 FRAC_CONST(0.0035614590925043),
2180 FRAC_CONST(0.0046113018122711),
2181 FRAC_CONST(0.0058772627936484),
2182 FRAC_CONST(0.0073878776584103),
2183 FRAC_CONST(0.0091733284512589),
2184 FRAC_CONST(0.0112652966728373),
2185 FRAC_CONST(0.0136967855861945),
2186 FRAC_CONST(0.0165019120857793),
2187 FRAC_CONST(0.0197156688892217),
2188 FRAC_CONST(0.0233736582950619),
2189 FRAC_CONST(0.0275117992367496),
2190 FRAC_CONST(0.0321660098468534),
2191 FRAC_CONST(0.0373718682174417),
2192 FRAC_CONST(0.0431642544948834),
2193 FRAC_CONST(0.0495769778717676),
2194 FRAC_CONST(0.0566423924273392),
2195 FRAC_CONST(0.0643910061132260),
2196 FRAC_CONST(0.0728510874761729),
2197 FRAC_CONST(0.0820482749475221),
2198 FRAC_CONST(0.0920051937045235),
2199 FRAC_CONST(0.1027410852163450),
2200 FRAC_CONST(0.1142714546239370),
2201 FRAC_CONST(0.1266077410648368),
2202 FRAC_CONST(0.1397570159398145),
2203 FRAC_CONST(0.1537217139274270),
2204 FRAC_CONST(0.1684994012857075),
2205 FRAC_CONST(0.1840825856392944),
2206 FRAC_CONST(0.2004585710384133),
2207 FRAC_CONST(0.2176093615976121),
2208 FRAC_CONST(0.2355116164824983),
2209 FRAC_CONST(0.2541366584185075),
2210 FRAC_CONST(0.2734505372545160),
2211 FRAC_CONST(0.2934141494343369),
2212 FRAC_CONST(0.3139834135200387),
2213 FRAC_CONST(0.3351095011824163),
2214 FRAC_CONST(0.3567391223361566),
2215 FRAC_CONST(0.3788148623608774),
2216 FRAC_CONST(0.4012755686250732),
2217 FRAC_CONST(0.4240567828288110),
2218 FRAC_CONST(0.4470912150133537),
2219 FRAC_CONST(0.4703092544619664),
2220 FRAC_CONST(0.4936395121456694),
2221 FRAC_CONST(0.5170093888596962),
2222 FRAC_CONST(0.5403456627591340),
2223 FRAC_CONST(0.5635750896430154),
2224 FRAC_CONST(0.5866250090612892),
2225 FRAC_CONST(0.6094239491338723),
2226 FRAC_CONST(0.6319022228794100),
2227 FRAC_CONST(0.6539925088563087),
2228 FRAC_CONST(0.6756304090216887),
2229 FRAC_CONST(0.6967549769155277),
2230 FRAC_CONST(0.7173092095766250),
2231 FRAC_CONST(0.7372404969921184),
2232 FRAC_CONST(0.7565010233699827),
2233 FRAC_CONST(0.7750481150999984),
2234 FRAC_CONST(0.7928445309277697),
2235 FRAC_CONST(0.8098586906021583),
2236 FRAC_CONST(0.8260648390616000),
2237 FRAC_CONST(0.8414431440907889),
2238 FRAC_CONST(0.8559797262966709),
2239 FRAC_CONST(0.8696666212110165),
2240 FRAC_CONST(0.8825016743142358),
2241 FRAC_CONST(0.8944883707784486),
2242 FRAC_CONST(0.9056356027326216),
2243 FRAC_CONST(0.9159573778427816),
2244 FRAC_CONST(0.9254724739583072),
2245 FRAC_CONST(0.9342040454819434),
2246 FRAC_CONST(0.9421791879559176),
2247 FRAC_CONST(0.9494284680976784),
2248 FRAC_CONST(0.9559854271440150),
2249 FRAC_CONST(0.9618860658493898),
2250 FRAC_CONST(0.9671683198119525),
2251 FRAC_CONST(0.9718715339497299),
2252 FRAC_CONST(0.9760359449042233),
2253 FRAC_CONST(0.9797021798981759),
2254 FRAC_CONST(0.9829107801140203),
2255 FRAC_CONST(0.9857017559923277),
2256 FRAC_CONST(0.9881141809867999),
2257 FRAC_CONST(0.9901858292742826),
2258 FRAC_CONST(0.9919528617340944),
2259 FRAC_CONST(0.9934495632180476),
2260 FRAC_CONST(0.9947081327749199),
2261 FRAC_CONST(0.9957585271195989),
2262 FRAC_CONST(0.9966283562984427),
2263 FRAC_CONST(0.9973428292485683),
2264 FRAC_CONST(0.9979247458259197),
2265 FRAC_CONST(0.9983945309245774),
2266 FRAC_CONST(0.9987703055583410),
2267 FRAC_CONST(0.9990679892449266),
2268 FRAC_CONST(0.9993014277313617),
2269 FRAC_CONST(0.9994825400228521),
2270 FRAC_CONST(0.9996214788122335),
2271 FRAC_CONST(0.9997267987294857),
2272 FRAC_CONST(0.9998056273097539),
2273 FRAC_CONST(0.9998638341781910),
2274 FRAC_CONST(0.9999061946325793),
2275 FRAC_CONST(0.9999365445321382),
2276 FRAC_CONST(0.9999579241373735),
2277 FRAC_CONST(0.9999727092594598),
2278 FRAC_CONST(0.9999827287418790),
2279 FRAC_CONST(0.9999893678912771),
2280 FRAC_CONST(0.9999936579844555),
2281 FRAC_CONST(0.9999963523959187),
2282 FRAC_CONST(0.9999979902130101),
2283 FRAC_CONST(0.9999989484358076),
2284 FRAC_CONST(0.9999994840031031),
2285 FRAC_CONST(0.9999997669534347),
2286 FRAC_CONST(0.9999999060327799),
2287 FRAC_CONST(0.9999999680107184),
2288 FRAC_CONST(0.9999999918774242),
2289 FRAC_CONST(0.9999999989770326)
2290 };
2291 #endif
2292
2293 #ifdef __cplusplus
2294 }
2295 #endif
2296 #endif
0 # Microsoft Developer Studio Project File - Name="libfaad" - Package Owner=<4>
1 # Microsoft Developer Studio Generated Build File, Format Version 6.00
2 # ** DO NOT EDIT **
3
4 # TARGTYPE "Win32 (x86) Static Library" 0x0104
5
6 CFG=libfaad - Win32 Debug
7 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
8 !MESSAGE use the Export Makefile command and run
9 !MESSAGE
10 !MESSAGE NMAKE /f "libfaad.mak".
11 !MESSAGE
12 !MESSAGE You can specify a configuration when running NMAKE
13 !MESSAGE by defining the macro CFG on the command line. For example:
14 !MESSAGE
15 !MESSAGE NMAKE /f "libfaad.mak" CFG="libfaad - Win32 Debug"
16 !MESSAGE
17 !MESSAGE Possible choices for configuration are:
18 !MESSAGE
19 !MESSAGE "libfaad - Win32 Release" (based on "Win32 (x86) Static Library")
20 !MESSAGE "libfaad - Win32 Debug" (based on "Win32 (x86) Static Library")
21 !MESSAGE
22
23 # Begin Project
24 # PROP AllowPerConfigDependencies 0
25 # PROP Scc_ProjName ""
26 # PROP Scc_LocalPath ""
27 CPP=xicl6.exe
28 RSC=rc.exe
29
30 !IF "$(CFG)" == "libfaad - Win32 Release"
31
32 # PROP BASE Use_MFC 0
33 # PROP BASE Use_Debug_Libraries 0
34 # PROP BASE Output_Dir "Release"
35 # PROP BASE Intermediate_Dir "Release"
36 # PROP BASE Target_Dir ""
37 # PROP Use_MFC 0
38 # PROP Use_Debug_Libraries 0
39 # PROP Output_Dir "Release"
40 # PROP Intermediate_Dir "Release"
41 # PROP Target_Dir ""
42 MTL=midl.exe
43 F90=df.exe
44 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
45 # ADD CPP /nologo /G6 /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /c
46 # ADD BASE RSC /l 0x413 /d "NDEBUG"
47 # ADD RSC /l 0x413 /d "NDEBUG"
48 BSC32=bscmake.exe
49 # ADD BASE BSC32 /nologo
50 # ADD BSC32 /nologo
51 LIB32=link.exe -lib
52 # ADD BASE LIB32 /nologo
53 # ADD LIB32 /nologo
54
55 !ELSEIF "$(CFG)" == "libfaad - Win32 Debug"
56
57 # PROP BASE Use_MFC 0
58 # PROP BASE Use_Debug_Libraries 1
59 # PROP BASE Output_Dir "Debug"
60 # PROP BASE Intermediate_Dir "Debug"
61 # PROP BASE Target_Dir ""
62 # PROP Use_MFC 0
63 # PROP Use_Debug_Libraries 1
64 # PROP Output_Dir "Debug"
65 # PROP Intermediate_Dir "Debug"
66 # PROP Target_Dir ""
67 MTL=midl.exe
68 F90=df.exe
69 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
70 # ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
71 # ADD BASE RSC /l 0x413 /d "_DEBUG"
72 # ADD RSC /l 0x413 /d "_DEBUG"
73 BSC32=bscmake.exe
74 # ADD BASE BSC32 /nologo
75 # ADD BSC32 /nologo
76 LIB32=link.exe -lib
77 # ADD BASE LIB32 /nologo
78 # ADD LIB32 /nologo
79
80 !ENDIF
81
82 # Begin Target
83
84 # Name "libfaad - Win32 Release"
85 # Name "libfaad - Win32 Debug"
86 # Begin Group "Source Files"
87
88 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
89 # Begin Source File
90
91 SOURCE=.\bits.c
92 # End Source File
93 # Begin Source File
94
95 SOURCE=.\cfft.c
96 # End Source File
97 # Begin Source File
98
99 SOURCE=.\common.c
100 # End Source File
101 # Begin Source File
102
103 SOURCE=.\decoder.c
104 # End Source File
105 # Begin Source File
106
107 SOURCE=.\drc.c
108 # End Source File
109 # Begin Source File
110
111 SOURCE=.\drm_dec.c
112 # End Source File
113 # Begin Source File
114
115 SOURCE=.\error.c
116 # End Source File
117 # Begin Source File
118
119 SOURCE=.\filtbank.c
120 # End Source File
121 # Begin Source File
122
123 SOURCE=.\hcr.c
124 # End Source File
125 # Begin Source File
126
127 SOURCE=.\huffman.c
128 # End Source File
129 # Begin Source File
130
131 SOURCE=.\ic_predict.c
132 # End Source File
133 # Begin Source File
134
135 SOURCE=.\is.c
136 # End Source File
137 # Begin Source File
138
139 SOURCE=.\lt_predict.c
140 # End Source File
141 # Begin Source File
142
143 SOURCE=.\mdct.c
144 # End Source File
145 # Begin Source File
146
147 SOURCE=.\mp4.c
148 # End Source File
149 # Begin Source File
150
151 SOURCE=.\ms.c
152 # End Source File
153 # Begin Source File
154
155 SOURCE=.\output.c
156 # End Source File
157 # Begin Source File
158
159 SOURCE=.\pns.c
160 # End Source File
161 # Begin Source File
162
163 SOURCE=.\ps_dec.c
164 # End Source File
165 # Begin Source File
166
167 SOURCE=.\ps_syntax.c
168 # End Source File
169 # Begin Source File
170
171 SOURCE=.\pulse.c
172 # End Source File
173 # Begin Source File
174
175 SOURCE=.\rvlc.c
176 # End Source File
177 # Begin Source File
178
179 SOURCE=.\sbr_dct.c
180 # End Source File
181 # Begin Source File
182
183 SOURCE=.\sbr_dec.c
184 # End Source File
185 # Begin Source File
186
187 SOURCE=.\sbr_e_nf.c
188 # End Source File
189 # Begin Source File
190
191 SOURCE=.\sbr_fbt.c
192 # End Source File
193 # Begin Source File
194
195 SOURCE=.\sbr_hfadj.c
196 # End Source File
197 # Begin Source File
198
199 SOURCE=.\sbr_hfgen.c
200 # End Source File
201 # Begin Source File
202
203 SOURCE=.\sbr_huff.c
204 # End Source File
205 # Begin Source File
206
207 SOURCE=.\sbr_qmf.c
208 # End Source File
209 # Begin Source File
210
211 SOURCE=.\sbr_syntax.c
212 # End Source File
213 # Begin Source File
214
215 SOURCE=.\sbr_tf_grid.c
216 # End Source File
217 # Begin Source File
218
219 SOURCE=.\specrec.c
220 # End Source File
221 # Begin Source File
222
223 SOURCE=.\ssr.c
224 # End Source File
225 # Begin Source File
226
227 SOURCE=.\ssr_fb.c
228 # End Source File
229 # Begin Source File
230
231 SOURCE=.\ssr_ipqf.c
232 # End Source File
233 # Begin Source File
234
235 SOURCE=.\syntax.c
236 # End Source File
237 # Begin Source File
238
239 SOURCE=.\tns.c
240 # End Source File
241 # End Group
242 # Begin Group "Header Files"
243
244 # PROP Default_Filter "h;hpp;hxx;hm;inl"
245 # Begin Group "codebook"
246
247 # PROP Default_Filter ""
248 # Begin Source File
249
250 SOURCE=.\codebook\hcb_1.h
251 # End Source File
252 # Begin Source File
253
254 SOURCE=.\codebook\hcb_10.h
255 # End Source File
256 # Begin Source File
257
258 SOURCE=.\codebook\hcb_11.h
259 # End Source File
260 # Begin Source File
261
262 SOURCE=.\codebook\hcb_2.h
263 # End Source File
264 # Begin Source File
265
266 SOURCE=.\codebook\hcb_3.h
267 # End Source File
268 # Begin Source File
269
270 SOURCE=.\codebook\hcb_4.h
271 # End Source File
272 # Begin Source File
273
274 SOURCE=.\codebook\hcb_5.h
275 # End Source File
276 # Begin Source File
277
278 SOURCE=.\codebook\hcb_6.h
279 # End Source File
280 # Begin Source File
281
282 SOURCE=.\codebook\hcb_7.h
283 # End Source File
284 # Begin Source File
285
286 SOURCE=.\codebook\hcb_8.h
287 # End Source File
288 # Begin Source File
289
290 SOURCE=.\codebook\hcb_9.h
291 # End Source File
292 # Begin Source File
293
294 SOURCE=.\codebook\hcb_sf.h
295 # End Source File
296 # End Group
297 # Begin Source File
298
299 SOURCE=.\analysis.h
300 # End Source File
301 # Begin Source File
302
303 SOURCE=.\bits.h
304 # End Source File
305 # Begin Source File
306
307 SOURCE=.\cfft.h
308 # End Source File
309 # Begin Source File
310
311 SOURCE=.\cfft_tab.h
312 # End Source File
313 # Begin Source File
314
315 SOURCE=.\common.h
316 # End Source File
317 # Begin Source File
318
319 SOURCE=.\decoder.h
320 # End Source File
321 # Begin Source File
322
323 SOURCE=.\drc.h
324 # End Source File
325 # Begin Source File
326
327 SOURCE=.\drm_dec.h
328 # End Source File
329 # Begin Source File
330
331 SOURCE=.\error.h
332 # End Source File
333 # Begin Source File
334
335 SOURCE=.\filtbank.h
336 # End Source File
337 # Begin Source File
338
339 SOURCE=.\fixed.h
340 # End Source File
341 # Begin Source File
342
343 SOURCE=.\codebook\hcb.h
344 # End Source File
345 # Begin Source File
346
347 SOURCE=.\huffman.h
348 # End Source File
349 # Begin Source File
350
351 SOURCE=.\ic_predict.h
352 # End Source File
353 # Begin Source File
354
355 SOURCE=.\iq_table.h
356 # End Source File
357 # Begin Source File
358
359 SOURCE=.\is.h
360 # End Source File
361 # Begin Source File
362
363 SOURCE=.\kbd_win.h
364 # End Source File
365 # Begin Source File
366
367 SOURCE=.\lt_predict.h
368 # End Source File
369 # Begin Source File
370
371 SOURCE=.\mdct.h
372 # End Source File
373 # Begin Source File
374
375 SOURCE=.\mdct_tab.h
376 # End Source File
377 # Begin Source File
378
379 SOURCE=.\mp4.h
380 # End Source File
381 # Begin Source File
382
383 SOURCE=.\ms.h
384 # End Source File
385 # Begin Source File
386
387 SOURCE=.\output.h
388 # End Source File
389 # Begin Source File
390
391 SOURCE=.\pns.h
392 # End Source File
393 # Begin Source File
394
395 SOURCE=.\ps_dec.h
396 # End Source File
397 # Begin Source File
398
399 SOURCE=.\ps_tables.h
400 # End Source File
401 # Begin Source File
402
403 SOURCE=.\pulse.h
404 # End Source File
405 # Begin Source File
406
407 SOURCE=.\rvlc.h
408 # End Source File
409 # Begin Source File
410
411 SOURCE=.\sbr_dct.h
412 # End Source File
413 # Begin Source File
414
415 SOURCE=.\sbr_dec.h
416 # End Source File
417 # Begin Source File
418
419 SOURCE=.\sbr_e_nf.h
420 # End Source File
421 # Begin Source File
422
423 SOURCE=.\sbr_fbt.h
424 # End Source File
425 # Begin Source File
426
427 SOURCE=.\sbr_hfadj.h
428 # End Source File
429 # Begin Source File
430
431 SOURCE=.\sbr_hfgen.h
432 # End Source File
433 # Begin Source File
434
435 SOURCE=.\sbr_huff.h
436 # End Source File
437 # Begin Source File
438
439 SOURCE=.\sbr_noise.h
440 # End Source File
441 # Begin Source File
442
443 SOURCE=.\sbr_qmf.h
444 # End Source File
445 # Begin Source File
446
447 SOURCE=.\sbr_qmf_c.h
448 # End Source File
449 # Begin Source File
450
451 SOURCE=.\sbr_syntax.h
452 # End Source File
453 # Begin Source File
454
455 SOURCE=.\sbr_tf_grid.h
456 # End Source File
457 # Begin Source File
458
459 SOURCE=.\sine_win.h
460 # End Source File
461 # Begin Source File
462
463 SOURCE=.\specrec.h
464 # End Source File
465 # Begin Source File
466
467 SOURCE=.\ssr.h
468 # End Source File
469 # Begin Source File
470
471 SOURCE=.\structs.h
472 # End Source File
473 # Begin Source File
474
475 SOURCE=.\syntax.h
476 # End Source File
477 # Begin Source File
478
479 SOURCE=.\tns.h
480 # End Source File
481 # End Group
482 # End Target
483 # End Project
0 Microsoft Developer Studio Workspace File, Format Version 6.00
1 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
2
3 ###############################################################################
4
5 Project: "libfaad"=.\libfaad.dsp - Package Owner=<4>
6
7 Package=<5>
8 {{{
9 }}}
10
11 Package=<4>
12 {{{
13 }}}
14
15 ###############################################################################
16
17 Global:
18
19 Package=<5>
20 {{{
21 }}}
22
23 Package=<3>
24 {{{
25 }}}
26
27 ###############################################################################
28
0 Microsoft Visual Studio Solution File, Format Version 8.00
1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "libfaad.vcproj", "{4274723E-6B9D-4B3E-A8BE-7566165AA169}"
2 ProjectSection(ProjectDependencies) = postProject
3 EndProjectSection
4 EndProject
5 Global
6 GlobalSection(DPCodeReviewSolutionGUID) = preSolution
7 DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
8 EndGlobalSection
9 GlobalSection(SolutionConfiguration) = preSolution
10 Debug = Debug
11 Release = Release
12 EndGlobalSection
13 GlobalSection(ProjectConfiguration) = postSolution
14 {4274723E-6B9D-4B3E-A8BE-7566165AA169}.Debug.ActiveCfg = Debug|Win32
15 {4274723E-6B9D-4B3E-A8BE-7566165AA169}.Debug.Build.0 = Debug|Win32
16 {4274723E-6B9D-4B3E-A8BE-7566165AA169}.Release.ActiveCfg = Release|Win32
17 {4274723E-6B9D-4B3E-A8BE-7566165AA169}.Release.Build.0 = Release|Win32
18 EndGlobalSection
19 GlobalSection(ExtensibilityGlobals) = postSolution
20 EndGlobalSection
21 GlobalSection(ExtensibilityAddIns) = postSolution
22 EndGlobalSection
23 EndGlobal
0 <?xml version="1.0" encoding="Windows-1252"?>
1 <VisualStudioProject
2 ProjectType="Visual C++"
3 Version="8,00"
4 Name="libfaad"
5 ProjectGUID="{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}"
6 >
7 <Platforms>
8 <Platform
9 Name="Win32"
10 />
11 </Platforms>
12 <ToolFiles>
13 </ToolFiles>
14 <Configurations>
15 <Configuration
16 Name="Release|Win32"
17 OutputDirectory=".\Release"
18 IntermediateDirectory=".\Release"
19 ConfigurationType="4"
20 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
21 UseOfMFC="0"
22 ATLMinimizesCRunTimeLibraryUsage="false"
23 CharacterSet="2"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 />
40 <Tool
41 Name="VCCLCompilerTool"
42 AdditionalOptions=""
43 Optimization="2"
44 InlineFunctionExpansion="1"
45 PreprocessorDefinitions="NDEBUG;WIN32;_LIB"
46 StringPooling="true"
47 RuntimeLibrary="2"
48 EnableFunctionLevelLinking="true"
49 UsePrecompiledHeader="0"
50 PrecompiledHeaderFile=".\Release/libfaad.pch"
51 AssemblerListingLocation=".\Release/"
52 ObjectFile=".\Release/"
53 ProgramDataBaseFileName=".\Release/"
54 WarningLevel="3"
55 SuppressStartupBanner="true"
56 Detect64BitPortabilityProblems="true"
57 />
58 <Tool
59 Name="VCManagedResourceCompilerTool"
60 />
61 <Tool
62 Name="VCResourceCompilerTool"
63 PreprocessorDefinitions="NDEBUG"
64 Culture="1043"
65 />
66 <Tool
67 Name="VCPreLinkEventTool"
68 />
69 <Tool
70 Name="VCLibrarianTool"
71 AdditionalOptions=""
72 OutputFile=".\Release\libfaad.lib"
73 SuppressStartupBanner="true"
74 />
75 <Tool
76 Name="VCALinkTool"
77 />
78 <Tool
79 Name="VCXDCMakeTool"
80 />
81 <Tool
82 Name="VCBscMakeTool"
83 />
84 <Tool
85 Name="VCFxCopTool"
86 />
87 <Tool
88 Name="VCPostBuildEventTool"
89 />
90 </Configuration>
91 <Configuration
92 Name="Debug|Win32"
93 OutputDirectory=".\Debug"
94 IntermediateDirectory=".\Debug"
95 ConfigurationType="4"
96 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
97 UseOfMFC="0"
98 ATLMinimizesCRunTimeLibraryUsage="false"
99 CharacterSet="2"
100 >
101 <Tool
102 Name="VCPreBuildEventTool"
103 />
104 <Tool
105 Name="VCCustomBuildTool"
106 />
107 <Tool
108 Name="VCXMLDataGeneratorTool"
109 />
110 <Tool
111 Name="VCWebServiceProxyGeneratorTool"
112 />
113 <Tool
114 Name="VCMIDLTool"
115 />
116 <Tool
117 Name="VCCLCompilerTool"
118 AdditionalOptions=""
119 Optimization="0"
120 PreprocessorDefinitions="_DEBUG;WIN32;_LIB"
121 BasicRuntimeChecks="3"
122 RuntimeLibrary="3"
123 UsePrecompiledHeader="0"
124 PrecompiledHeaderFile=".\Debug/libfaad.pch"
125 AssemblerListingLocation=".\Debug/"
126 ObjectFile=".\Debug/"
127 ProgramDataBaseFileName=".\Debug/"
128 WarningLevel="3"
129 SuppressStartupBanner="true"
130 DebugInformationFormat="4"
131 />
132 <Tool
133 Name="VCManagedResourceCompilerTool"
134 />
135 <Tool
136 Name="VCResourceCompilerTool"
137 PreprocessorDefinitions="_DEBUG"
138 Culture="1043"
139 />
140 <Tool
141 Name="VCPreLinkEventTool"
142 />
143 <Tool
144 Name="VCLibrarianTool"
145 AdditionalOptions=""
146 OutputFile=".\Debug\libfaad.lib"
147 SuppressStartupBanner="true"
148 />
149 <Tool
150 Name="VCALinkTool"
151 />
152 <Tool
153 Name="VCXDCMakeTool"
154 />
155 <Tool
156 Name="VCBscMakeTool"
157 />
158 <Tool
159 Name="VCFxCopTool"
160 />
161 <Tool
162 Name="VCPostBuildEventTool"
163 />
164 </Configuration>
165 </Configurations>
166 <References>
167 </References>
168 <Files>
169 <Filter
170 Name="Source Files"
171 Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
172 >
173 <File
174 RelativePath="bits.c"
175 >
176 <FileConfiguration
177 Name="Release|Win32"
178 >
179 <Tool
180 Name="VCCLCompilerTool"
181 AdditionalOptions=""
182 Optimization="2"
183 PreprocessorDefinitions=""
184 />
185 </FileConfiguration>
186 <FileConfiguration
187 Name="Debug|Win32"
188 >
189 <Tool
190 Name="VCCLCompilerTool"
191 AdditionalOptions=""
192 Optimization="0"
193 PreprocessorDefinitions=""
194 BasicRuntimeChecks="3"
195 />
196 </FileConfiguration>
197 </File>
198 <File
199 RelativePath="cfft.c"
200 >
201 <FileConfiguration
202 Name="Release|Win32"
203 >
204 <Tool
205 Name="VCCLCompilerTool"
206 AdditionalOptions=""
207 Optimization="2"
208 PreprocessorDefinitions=""
209 />
210 </FileConfiguration>
211 <FileConfiguration
212 Name="Debug|Win32"
213 >
214 <Tool
215 Name="VCCLCompilerTool"
216 AdditionalOptions=""
217 Optimization="0"
218 PreprocessorDefinitions=""
219 BasicRuntimeChecks="3"
220 />
221 </FileConfiguration>
222 </File>
223 <File
224 RelativePath="common.c"
225 >
226 <FileConfiguration
227 Name="Release|Win32"
228 >
229 <Tool
230 Name="VCCLCompilerTool"
231 AdditionalOptions=""
232 Optimization="2"
233 PreprocessorDefinitions=""
234 />
235 </FileConfiguration>
236 <FileConfiguration
237 Name="Debug|Win32"
238 >
239 <Tool
240 Name="VCCLCompilerTool"
241 AdditionalOptions=""
242 Optimization="0"
243 PreprocessorDefinitions=""
244 BasicRuntimeChecks="3"
245 />
246 </FileConfiguration>
247 </File>
248 <File
249 RelativePath="decoder.c"
250 >
251 <FileConfiguration
252 Name="Release|Win32"
253 >
254 <Tool
255 Name="VCCLCompilerTool"
256 AdditionalOptions=""
257 Optimization="2"
258 PreprocessorDefinitions=""
259 />
260 </FileConfiguration>
261 <FileConfiguration
262 Name="Debug|Win32"
263 >
264 <Tool
265 Name="VCCLCompilerTool"
266 AdditionalOptions=""
267 Optimization="0"
268 PreprocessorDefinitions=""
269 BasicRuntimeChecks="3"
270 />
271 </FileConfiguration>
272 </File>
273 <File
274 RelativePath="drc.c"
275 >
276 <FileConfiguration
277 Name="Release|Win32"
278 >
279 <Tool
280 Name="VCCLCompilerTool"
281 AdditionalOptions=""
282 Optimization="2"
283 PreprocessorDefinitions=""
284 />
285 </FileConfiguration>
286 <FileConfiguration
287 Name="Debug|Win32"
288 >
289 <Tool
290 Name="VCCLCompilerTool"
291 AdditionalOptions=""
292 Optimization="0"
293 PreprocessorDefinitions=""
294 BasicRuntimeChecks="3"
295 />
296 </FileConfiguration>
297 </File>
298 <File
299 RelativePath=".\drm_dec.c"
300 >
301 </File>
302 <File
303 RelativePath="error.c"
304 >
305 <FileConfiguration
306 Name="Release|Win32"
307 >
308 <Tool
309 Name="VCCLCompilerTool"
310 AdditionalOptions=""
311 Optimization="2"
312 PreprocessorDefinitions=""
313 />
314 </FileConfiguration>
315 <FileConfiguration
316 Name="Debug|Win32"
317 >
318 <Tool
319 Name="VCCLCompilerTool"
320 AdditionalOptions=""
321 Optimization="0"
322 PreprocessorDefinitions=""
323 BasicRuntimeChecks="3"
324 />
325 </FileConfiguration>
326 </File>
327 <File
328 RelativePath="filtbank.c"
329 >
330 <FileConfiguration
331 Name="Release|Win32"
332 >
333 <Tool
334 Name="VCCLCompilerTool"
335 AdditionalOptions=""
336 Optimization="2"
337 PreprocessorDefinitions=""
338 />
339 </FileConfiguration>
340 <FileConfiguration
341 Name="Debug|Win32"
342 >
343 <Tool
344 Name="VCCLCompilerTool"
345 AdditionalOptions=""
346 Optimization="0"
347 PreprocessorDefinitions=""
348 BasicRuntimeChecks="3"
349 />
350 </FileConfiguration>
351 </File>
352 <File
353 RelativePath="hcr.c"
354 >
355 <FileConfiguration
356 Name="Release|Win32"
357 >
358 <Tool
359 Name="VCCLCompilerTool"
360 AdditionalOptions=""
361 Optimization="2"
362 PreprocessorDefinitions=""
363 />
364 </FileConfiguration>
365 <FileConfiguration
366 Name="Debug|Win32"
367 >
368 <Tool
369 Name="VCCLCompilerTool"
370 AdditionalOptions=""
371 Optimization="0"
372 PreprocessorDefinitions=""
373 BasicRuntimeChecks="3"
374 />
375 </FileConfiguration>
376 </File>
377 <File
378 RelativePath="huffman.c"
379 >
380 <FileConfiguration
381 Name="Release|Win32"
382 >
383 <Tool
384 Name="VCCLCompilerTool"
385 AdditionalOptions=""
386 Optimization="2"
387 PreprocessorDefinitions=""
388 />
389 </FileConfiguration>
390 <FileConfiguration
391 Name="Debug|Win32"
392 >
393 <Tool
394 Name="VCCLCompilerTool"
395 AdditionalOptions=""
396 Optimization="0"
397 PreprocessorDefinitions=""
398 BasicRuntimeChecks="3"
399 />
400 </FileConfiguration>
401 </File>
402 <File
403 RelativePath="ic_predict.c"
404 >
405 <FileConfiguration
406 Name="Release|Win32"
407 >
408 <Tool
409 Name="VCCLCompilerTool"
410 AdditionalOptions=""
411 Optimization="2"
412 PreprocessorDefinitions=""
413 />
414 </FileConfiguration>
415 <FileConfiguration
416 Name="Debug|Win32"
417 >
418 <Tool
419 Name="VCCLCompilerTool"
420 AdditionalOptions=""
421 Optimization="0"
422 PreprocessorDefinitions=""
423 BasicRuntimeChecks="3"
424 />
425 </FileConfiguration>
426 </File>
427 <File
428 RelativePath="is.c"
429 >
430 <FileConfiguration
431 Name="Release|Win32"
432 >
433 <Tool
434 Name="VCCLCompilerTool"
435 AdditionalOptions=""
436 Optimization="2"
437 PreprocessorDefinitions=""
438 />
439 </FileConfiguration>
440 <FileConfiguration
441 Name="Debug|Win32"
442 >
443 <Tool
444 Name="VCCLCompilerTool"
445 AdditionalOptions=""
446 Optimization="0"
447 PreprocessorDefinitions=""
448 BasicRuntimeChecks="3"
449 />
450 </FileConfiguration>
451 </File>
452 <File
453 RelativePath="lt_predict.c"
454 >
455 <FileConfiguration
456 Name="Release|Win32"
457 >
458 <Tool
459 Name="VCCLCompilerTool"
460 AdditionalOptions=""
461 Optimization="2"
462 PreprocessorDefinitions=""
463 />
464 </FileConfiguration>
465 <FileConfiguration
466 Name="Debug|Win32"
467 >
468 <Tool
469 Name="VCCLCompilerTool"
470 AdditionalOptions=""
471 Optimization="0"
472 PreprocessorDefinitions=""
473 BasicRuntimeChecks="3"
474 />
475 </FileConfiguration>
476 </File>
477 <File
478 RelativePath="mdct.c"
479 >
480 <FileConfiguration
481 Name="Release|Win32"
482 >
483 <Tool
484 Name="VCCLCompilerTool"
485 AdditionalOptions=""
486 Optimization="2"
487 PreprocessorDefinitions=""
488 />
489 </FileConfiguration>
490 <FileConfiguration
491 Name="Debug|Win32"
492 >
493 <Tool
494 Name="VCCLCompilerTool"
495 AdditionalOptions=""
496 Optimization="0"
497 PreprocessorDefinitions=""
498 BasicRuntimeChecks="3"
499 />
500 </FileConfiguration>
501 </File>
502 <File
503 RelativePath="mp4.c"
504 >
505 <FileConfiguration
506 Name="Release|Win32"
507 >
508 <Tool
509 Name="VCCLCompilerTool"
510 AdditionalOptions=""
511 Optimization="2"
512 PreprocessorDefinitions=""
513 />
514 </FileConfiguration>
515 <FileConfiguration
516 Name="Debug|Win32"
517 >
518 <Tool
519 Name="VCCLCompilerTool"
520 AdditionalOptions=""
521 Optimization="0"
522 PreprocessorDefinitions=""
523 BasicRuntimeChecks="3"
524 />
525 </FileConfiguration>
526 </File>
527 <File
528 RelativePath="ms.c"
529 >
530 <FileConfiguration
531 Name="Release|Win32"
532 >
533 <Tool
534 Name="VCCLCompilerTool"
535 AdditionalOptions=""
536 Optimization="2"
537 PreprocessorDefinitions=""
538 />
539 </FileConfiguration>
540 <FileConfiguration
541 Name="Debug|Win32"
542 >
543 <Tool
544 Name="VCCLCompilerTool"
545 AdditionalOptions=""
546 Optimization="0"
547 PreprocessorDefinitions=""
548 BasicRuntimeChecks="3"
549 />
550 </FileConfiguration>
551 </File>
552 <File
553 RelativePath="output.c"
554 >
555 <FileConfiguration
556 Name="Release|Win32"
557 >
558 <Tool
559 Name="VCCLCompilerTool"
560 AdditionalOptions=""
561 Optimization="2"
562 PreprocessorDefinitions=""
563 />
564 </FileConfiguration>
565 <FileConfiguration
566 Name="Debug|Win32"
567 >
568 <Tool
569 Name="VCCLCompilerTool"
570 AdditionalOptions=""
571 Optimization="0"
572 PreprocessorDefinitions=""
573 BasicRuntimeChecks="3"
574 />
575 </FileConfiguration>
576 </File>
577 <File
578 RelativePath="pns.c"
579 >
580 <FileConfiguration
581 Name="Release|Win32"
582 >
583 <Tool
584 Name="VCCLCompilerTool"
585 AdditionalOptions=""
586 Optimization="2"
587 PreprocessorDefinitions=""
588 />
589 </FileConfiguration>
590 <FileConfiguration
591 Name="Debug|Win32"
592 >
593 <Tool
594 Name="VCCLCompilerTool"
595 AdditionalOptions=""
596 Optimization="0"
597 PreprocessorDefinitions=""
598 BasicRuntimeChecks="3"
599 />
600 </FileConfiguration>
601 </File>
602 <File
603 RelativePath=".\ps_dec.c"
604 >
605 </File>
606 <File
607 RelativePath=".\ps_syntax.c"
608 >
609 </File>
610 <File
611 RelativePath="pulse.c"
612 >
613 <FileConfiguration
614 Name="Release|Win32"
615 >
616 <Tool
617 Name="VCCLCompilerTool"
618 AdditionalOptions=""
619 Optimization="2"
620 PreprocessorDefinitions=""
621 />
622 </FileConfiguration>
623 <FileConfiguration
624 Name="Debug|Win32"
625 >
626 <Tool
627 Name="VCCLCompilerTool"
628 AdditionalOptions=""
629 Optimization="0"
630 PreprocessorDefinitions=""
631 BasicRuntimeChecks="3"
632 />
633 </FileConfiguration>
634 </File>
635 <File
636 RelativePath="rvlc.c"
637 >
638 <FileConfiguration
639 Name="Release|Win32"
640 >
641 <Tool
642 Name="VCCLCompilerTool"
643 AdditionalOptions=""
644 Optimization="2"
645 PreprocessorDefinitions=""
646 />
647 </FileConfiguration>
648 <FileConfiguration
649 Name="Debug|Win32"
650 >
651 <Tool
652 Name="VCCLCompilerTool"
653 AdditionalOptions=""
654 Optimization="0"
655 PreprocessorDefinitions=""
656 BasicRuntimeChecks="3"
657 />
658 </FileConfiguration>
659 </File>
660 <File
661 RelativePath="sbr_dct.c"
662 >
663 <FileConfiguration
664 Name="Release|Win32"
665 >
666 <Tool
667 Name="VCCLCompilerTool"
668 AdditionalOptions=""
669 Optimization="2"
670 PreprocessorDefinitions=""
671 />
672 </FileConfiguration>
673 <FileConfiguration
674 Name="Debug|Win32"
675 >
676 <Tool
677 Name="VCCLCompilerTool"
678 AdditionalOptions=""
679 Optimization="0"
680 PreprocessorDefinitions=""
681 BasicRuntimeChecks="3"
682 />
683 </FileConfiguration>
684 </File>
685 <File
686 RelativePath="sbr_dec.c"
687 >
688 <FileConfiguration
689 Name="Release|Win32"
690 >
691 <Tool
692 Name="VCCLCompilerTool"
693 AdditionalOptions=""
694 Optimization="2"
695 PreprocessorDefinitions=""
696 />
697 </FileConfiguration>
698 <FileConfiguration
699 Name="Debug|Win32"
700 >
701 <Tool
702 Name="VCCLCompilerTool"
703 AdditionalOptions=""
704 Optimization="0"
705 PreprocessorDefinitions=""
706 BasicRuntimeChecks="3"
707 />
708 </FileConfiguration>
709 </File>
710 <File
711 RelativePath="sbr_e_nf.c"
712 >
713 <FileConfiguration
714 Name="Release|Win32"
715 >
716 <Tool
717 Name="VCCLCompilerTool"
718 AdditionalOptions=""
719 Optimization="2"
720 PreprocessorDefinitions=""
721 />
722 </FileConfiguration>
723 <FileConfiguration
724 Name="Debug|Win32"
725 >
726 <Tool
727 Name="VCCLCompilerTool"
728 AdditionalOptions=""
729 Optimization="0"
730 PreprocessorDefinitions=""
731 BasicRuntimeChecks="3"
732 />
733 </FileConfiguration>
734 </File>
735 <File
736 RelativePath="sbr_fbt.c"
737 >
738 <FileConfiguration
739 Name="Release|Win32"
740 >
741 <Tool
742 Name="VCCLCompilerTool"
743 AdditionalOptions=""
744 Optimization="2"
745 PreprocessorDefinitions=""
746 />
747 </FileConfiguration>
748 <FileConfiguration
749 Name="Debug|Win32"
750 >
751 <Tool
752 Name="VCCLCompilerTool"
753 AdditionalOptions=""
754 Optimization="0"
755 PreprocessorDefinitions=""
756 BasicRuntimeChecks="3"
757 />
758 </FileConfiguration>
759 </File>
760 <File
761 RelativePath="sbr_hfadj.c"
762 >
763 <FileConfiguration
764 Name="Release|Win32"
765 >
766 <Tool
767 Name="VCCLCompilerTool"
768 AdditionalOptions=""
769 Optimization="2"
770 PreprocessorDefinitions=""
771 />
772 </FileConfiguration>
773 <FileConfiguration
774 Name="Debug|Win32"
775 >
776 <Tool
777 Name="VCCLCompilerTool"
778 AdditionalOptions=""
779 Optimization="0"
780 PreprocessorDefinitions=""
781 BasicRuntimeChecks="3"
782 />
783 </FileConfiguration>
784 </File>
785 <File
786 RelativePath="sbr_hfgen.c"
787 >
788 <FileConfiguration
789 Name="Release|Win32"
790 >
791 <Tool
792 Name="VCCLCompilerTool"
793 AdditionalOptions=""
794 Optimization="2"
795 PreprocessorDefinitions=""
796 />
797 </FileConfiguration>
798 <FileConfiguration
799 Name="Debug|Win32"
800 >
801 <Tool
802 Name="VCCLCompilerTool"
803 AdditionalOptions=""
804 Optimization="0"
805 PreprocessorDefinitions=""
806 BasicRuntimeChecks="3"
807 />
808 </FileConfiguration>
809 </File>
810 <File
811 RelativePath="sbr_huff.c"
812 >
813 <FileConfiguration
814 Name="Release|Win32"
815 >
816 <Tool
817 Name="VCCLCompilerTool"
818 AdditionalOptions=""
819 Optimization="2"
820 PreprocessorDefinitions=""
821 />
822 </FileConfiguration>
823 <FileConfiguration
824 Name="Debug|Win32"
825 >
826 <Tool
827 Name="VCCLCompilerTool"
828 AdditionalOptions=""
829 Optimization="0"
830 PreprocessorDefinitions=""
831 BasicRuntimeChecks="3"
832 />
833 </FileConfiguration>
834 </File>
835 <File
836 RelativePath="sbr_qmf.c"
837 >
838 <FileConfiguration
839 Name="Release|Win32"
840 >
841 <Tool
842 Name="VCCLCompilerTool"
843 AdditionalOptions=""
844 Optimization="2"
845 PreprocessorDefinitions=""
846 />
847 </FileConfiguration>
848 <FileConfiguration
849 Name="Debug|Win32"
850 >
851 <Tool
852 Name="VCCLCompilerTool"
853 AdditionalOptions=""
854 Optimization="0"
855 PreprocessorDefinitions=""
856 BasicRuntimeChecks="3"
857 />
858 </FileConfiguration>
859 </File>
860 <File
861 RelativePath="sbr_syntax.c"
862 >
863 <FileConfiguration
864 Name="Release|Win32"
865 >
866 <Tool
867 Name="VCCLCompilerTool"
868 AdditionalOptions=""
869 Optimization="2"
870 PreprocessorDefinitions=""
871 />
872 </FileConfiguration>
873 <FileConfiguration
874 Name="Debug|Win32"
875 >
876 <Tool
877 Name="VCCLCompilerTool"
878 AdditionalOptions=""
879 Optimization="0"
880 PreprocessorDefinitions=""
881 BasicRuntimeChecks="3"
882 />
883 </FileConfiguration>
884 </File>
885 <File
886 RelativePath="sbr_tf_grid.c"
887 >
888 <FileConfiguration
889 Name="Release|Win32"
890 >
891 <Tool
892 Name="VCCLCompilerTool"
893 AdditionalOptions=""
894 Optimization="2"
895 PreprocessorDefinitions=""
896 />
897 </FileConfiguration>
898 <FileConfiguration
899 Name="Debug|Win32"
900 >
901 <Tool
902 Name="VCCLCompilerTool"
903 AdditionalOptions=""
904 Optimization="0"
905 PreprocessorDefinitions=""
906 BasicRuntimeChecks="3"
907 />
908 </FileConfiguration>
909 </File>
910 <File
911 RelativePath="specrec.c"
912 >
913 <FileConfiguration
914 Name="Release|Win32"
915 >
916 <Tool
917 Name="VCCLCompilerTool"
918 AdditionalOptions=""
919 Optimization="2"
920 PreprocessorDefinitions=""
921 />
922 </FileConfiguration>
923 <FileConfiguration
924 Name="Debug|Win32"
925 >
926 <Tool
927 Name="VCCLCompilerTool"
928 AdditionalOptions=""
929 Optimization="0"
930 PreprocessorDefinitions=""
931 BasicRuntimeChecks="3"
932 />
933 </FileConfiguration>
934 </File>
935 <File
936 RelativePath="ssr.c"
937 >
938 <FileConfiguration
939 Name="Release|Win32"
940 >
941 <Tool
942 Name="VCCLCompilerTool"
943 AdditionalOptions=""
944 Optimization="2"
945 PreprocessorDefinitions=""
946 />
947 </FileConfiguration>
948 <FileConfiguration
949 Name="Debug|Win32"
950 >
951 <Tool
952 Name="VCCLCompilerTool"
953 AdditionalOptions=""
954 Optimization="0"
955 PreprocessorDefinitions=""
956 BasicRuntimeChecks="3"
957 />
958 </FileConfiguration>
959 </File>
960 <File
961 RelativePath="ssr_fb.c"
962 >
963 <FileConfiguration
964 Name="Release|Win32"
965 >
966 <Tool
967 Name="VCCLCompilerTool"
968 AdditionalOptions=""
969 Optimization="2"
970 PreprocessorDefinitions=""
971 />
972 </FileConfiguration>
973 <FileConfiguration
974 Name="Debug|Win32"
975 >
976 <Tool
977 Name="VCCLCompilerTool"
978 AdditionalOptions=""
979 Optimization="0"
980 PreprocessorDefinitions=""
981 BasicRuntimeChecks="3"
982 />
983 </FileConfiguration>
984 </File>
985 <File
986 RelativePath="ssr_ipqf.c"
987 >
988 <FileConfiguration
989 Name="Release|Win32"
990 >
991 <Tool
992 Name="VCCLCompilerTool"
993 AdditionalOptions=""
994 Optimization="2"
995 PreprocessorDefinitions=""
996 />
997 </FileConfiguration>
998 <FileConfiguration
999 Name="Debug|Win32"
1000 >
1001 <Tool
1002 Name="VCCLCompilerTool"
1003 AdditionalOptions=""
1004 Optimization="0"
1005 PreprocessorDefinitions=""
1006 BasicRuntimeChecks="3"
1007 />
1008 </FileConfiguration>
1009 </File>
1010 <File
1011 RelativePath="syntax.c"
1012 >
1013 <FileConfiguration
1014 Name="Release|Win32"
1015 >
1016 <Tool
1017 Name="VCCLCompilerTool"
1018 AdditionalOptions=""
1019 Optimization="2"
1020 PreprocessorDefinitions=""
1021 />
1022 </FileConfiguration>
1023 <FileConfiguration
1024 Name="Debug|Win32"
1025 >
1026 <Tool
1027 Name="VCCLCompilerTool"
1028 AdditionalOptions=""
1029 Optimization="0"
1030 PreprocessorDefinitions=""
1031 BasicRuntimeChecks="3"
1032 />
1033 </FileConfiguration>
1034 </File>
1035 <File
1036 RelativePath="tns.c"
1037 >
1038 <FileConfiguration
1039 Name="Release|Win32"
1040 >
1041 <Tool
1042 Name="VCCLCompilerTool"
1043 AdditionalOptions=""
1044 Optimization="2"
1045 PreprocessorDefinitions=""
1046 />
1047 </FileConfiguration>
1048 <FileConfiguration
1049 Name="Debug|Win32"
1050 >
1051 <Tool
1052 Name="VCCLCompilerTool"
1053 AdditionalOptions=""
1054 Optimization="0"
1055 PreprocessorDefinitions=""
1056 BasicRuntimeChecks="3"
1057 />
1058 </FileConfiguration>
1059 </File>
1060 </Filter>
1061 <Filter
1062 Name="Header Files"
1063 Filter="h;hpp;hxx;hm;inl"
1064 >
1065 <File
1066 RelativePath="analysis.h"
1067 >
1068 </File>
1069 <File
1070 RelativePath="bits.h"
1071 >
1072 </File>
1073 <File
1074 RelativePath="cfft.h"
1075 >
1076 </File>
1077 <File
1078 RelativePath="cfft_tab.h"
1079 >
1080 </File>
1081 <File
1082 RelativePath="common.h"
1083 >
1084 </File>
1085 <File
1086 RelativePath="decoder.h"
1087 >
1088 </File>
1089 <File
1090 RelativePath="drc.h"
1091 >
1092 </File>
1093 <File
1094 RelativePath=".\drm_dec.h"
1095 >
1096 </File>
1097 <File
1098 RelativePath="error.h"
1099 >
1100 </File>
1101 <File
1102 RelativePath="filtbank.h"
1103 >
1104 </File>
1105 <File
1106 RelativePath="fixed.h"
1107 >
1108 </File>
1109 <File
1110 RelativePath="codebook\hcb.h"
1111 >
1112 </File>
1113 <File
1114 RelativePath="huffman.h"
1115 >
1116 </File>
1117 <File
1118 RelativePath="ic_predict.h"
1119 >
1120 </File>
1121 <File
1122 RelativePath="iq_table.h"
1123 >
1124 </File>
1125 <File
1126 RelativePath="is.h"
1127 >
1128 </File>
1129 <File
1130 RelativePath="kbd_win.h"
1131 >
1132 </File>
1133 <File
1134 RelativePath="lt_predict.h"
1135 >
1136 </File>
1137 <File
1138 RelativePath="mdct.h"
1139 >
1140 </File>
1141 <File
1142 RelativePath="mp4.h"
1143 >
1144 </File>
1145 <File
1146 RelativePath="ms.h"
1147 >
1148 </File>
1149 <File
1150 RelativePath="output.h"
1151 >
1152 </File>
1153 <File
1154 RelativePath="pns.h"
1155 >
1156 </File>
1157 <File
1158 RelativePath=".\ps_dec.h"
1159 >
1160 </File>
1161 <File
1162 RelativePath=".\ps_tables.h"
1163 >
1164 </File>
1165 <File
1166 RelativePath="pulse.h"
1167 >
1168 </File>
1169 <File
1170 RelativePath="rvlc.h"
1171 >
1172 </File>
1173 <File
1174 RelativePath="sbr_dct.h"
1175 >
1176 </File>
1177 <File
1178 RelativePath="sbr_dec.h"
1179 >
1180 </File>
1181 <File
1182 RelativePath="sbr_e_nf.h"
1183 >
1184 </File>
1185 <File
1186 RelativePath="sbr_fbt.h"
1187 >
1188 </File>
1189 <File
1190 RelativePath="sbr_hfadj.h"
1191 >
1192 </File>
1193 <File
1194 RelativePath="sbr_hfgen.h"
1195 >
1196 </File>
1197 <File
1198 RelativePath="sbr_huff.h"
1199 >
1200 </File>
1201 <File
1202 RelativePath="sbr_noise.h"
1203 >
1204 </File>
1205 <File
1206 RelativePath="sbr_qmf.h"
1207 >
1208 </File>
1209 <File
1210 RelativePath="sbr_syntax.h"
1211 >
1212 </File>
1213 <File
1214 RelativePath="sbr_tf_grid.h"
1215 >
1216 </File>
1217 <File
1218 RelativePath="sine_win.h"
1219 >
1220 </File>
1221 <File
1222 RelativePath="specrec.h"
1223 >
1224 </File>
1225 <File
1226 RelativePath="ssr.h"
1227 >
1228 </File>
1229 <File
1230 RelativePath="structs.h"
1231 >
1232 </File>
1233 <File
1234 RelativePath="syntax.h"
1235 >
1236 </File>
1237 <File
1238 RelativePath="tns.h"
1239 >
1240 </File>
1241 <Filter
1242 Name="codebook"
1243 >
1244 <File
1245 RelativePath="codebook\hcb_1.h"
1246 >
1247 </File>
1248 <File
1249 RelativePath="codebook\hcb_10.h"
1250 >
1251 </File>
1252 <File
1253 RelativePath="codebook\hcb_11.h"
1254 >
1255 </File>
1256 <File
1257 RelativePath="codebook\hcb_2.h"
1258 >
1259 </File>
1260 <File
1261 RelativePath="codebook\hcb_3.h"
1262 >
1263 </File>
1264 <File
1265 RelativePath="codebook\hcb_4.h"
1266 >
1267 </File>
1268 <File
1269 RelativePath="codebook\hcb_5.h"
1270 >
1271 </File>
1272 <File
1273 RelativePath="codebook\hcb_6.h"
1274 >
1275 </File>
1276 <File
1277 RelativePath="codebook\hcb_7.h"
1278 >
1279 </File>
1280 <File
1281 RelativePath="codebook\hcb_8.h"
1282 >
1283 </File>
1284 <File
1285 RelativePath="codebook\hcb_9.h"
1286 >
1287 </File>
1288 <File
1289 RelativePath="codebook\hcb_sf.h"
1290 >
1291 </File>
1292 </Filter>
1293 </Filter>
1294 </Files>
1295 <Globals>
1296 </Globals>
1297 </VisualStudioProject>
0 LIBRARY libfaad2.dll
1 EXPORTS
2 ;
3 ; libfaad2 exports
4 ;
5 NeAACDecOpen @1
6 NeAACDecGetCurrentConfiguration @2
7 NeAACDecSetConfiguration @3
8 NeAACDecInit @4
9 NeAACDecInit2 @5
10 NeAACDecDecode @6
11 NeAACDecClose @7
12 NeAACDecGetErrorMessage @8
13 NeAACDecAudioSpecificConfig @9
0 # Microsoft eMbedded Visual Tools Project File - Name="libfaad2" - Package Owner=<4>
1 # Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02
2 # ** DO NOT EDIT **
3
4 # TARGTYPE "Win32 (WCE x86) Static Library" 0x8304
5 # TARGTYPE "Win32 (WCE ARM) Static Library" 0x8504
6
7 CFG=libfaad2 - Win32 (WCE ARM) Debug
8 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
9 !MESSAGE use the Export Makefile command and run
10 !MESSAGE
11 !MESSAGE NMAKE /f "libfaad2.vcn".
12 !MESSAGE
13 !MESSAGE You can specify a configuration when running NMAKE
14 !MESSAGE by defining the macro CFG on the command line. For example:
15 !MESSAGE
16 !MESSAGE NMAKE /f "libfaad2.vcn" CFG="libfaad2 - Win32 (WCE ARM) Debug"
17 !MESSAGE
18 !MESSAGE Possible choices for configuration are:
19 !MESSAGE
20 !MESSAGE "libfaad2 - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Static Library")
21 !MESSAGE "libfaad2 - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Static Library")
22 !MESSAGE "libfaad2 - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Static Library")
23 !MESSAGE "libfaad2 - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Static Library")
24 !MESSAGE
25
26 # Begin Project
27 # PROP AllowPerConfigDependencies 0
28 # PROP Scc_ProjName ""
29 # PROP Scc_LocalPath ""
30 # PROP ATL_Project 2
31
32 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
33
34 # PROP BASE Use_MFC 0
35 # PROP BASE Use_Debug_Libraries 0
36 # PROP BASE Output_Dir "ARMRel"
37 # PROP BASE Intermediate_Dir "ARMRel"
38 # PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
39 # PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
40 # PROP BASE Target_Dir ""
41 # PROP Use_MFC 0
42 # PROP Use_Debug_Libraries 0
43 # PROP Output_Dir "ARMRel"
44 # PROP Intermediate_Dir "ARMRel"
45 # PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
46 # PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
47 # PROP Target_Dir ""
48 CPP=clarm.exe
49 # ADD BASE CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c
50 # ADD CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c
51 LIB32=link.exe -lib
52 # ADD BASE LIB32 /nologo
53 # ADD LIB32 /nologo
54 BSC32=bscmake.exe
55 # ADD BASE BSC32 /nologo
56 # ADD BSC32 /nologo
57
58 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
59
60 # PROP BASE Use_MFC 0
61 # PROP BASE Use_Debug_Libraries 1
62 # PROP BASE Output_Dir "ARMDbg"
63 # PROP BASE Intermediate_Dir "ARMDbg"
64 # PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
65 # PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
66 # PROP BASE Target_Dir ""
67 # PROP Use_MFC 0
68 # PROP Use_Debug_Libraries 1
69 # PROP Output_Dir "ARMDbg"
70 # PROP Intermediate_Dir "ARMDbg"
71 # PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
72 # PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
73 # PROP Target_Dir ""
74 CPP=clarm.exe
75 # ADD BASE CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c
76 # ADD CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c
77 LIB32=link.exe -lib
78 # ADD BASE LIB32 /nologo
79 # ADD LIB32 /nologo
80 BSC32=bscmake.exe
81 # ADD BASE BSC32 /nologo
82 # ADD BSC32 /nologo
83
84 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
85
86 # PROP BASE Use_MFC 0
87 # PROP BASE Use_Debug_Libraries 0
88 # PROP BASE Output_Dir "X86Rel"
89 # PROP BASE Intermediate_Dir "X86Rel"
90 # PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
91 # PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
92 # PROP BASE Target_Dir ""
93 # PROP Use_MFC 0
94 # PROP Use_Debug_Libraries 0
95 # PROP Output_Dir "X86Rel"
96 # PROP Intermediate_Dir "X86Rel"
97 # PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
98 # PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
99 # PROP Target_Dir ""
100 CPP=cl.exe
101 # ADD BASE CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /Oxs /c
102 # ADD CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /Oxs /c
103 LIB32=link.exe -lib
104 # ADD BASE LIB32 /nologo
105 # ADD LIB32 /nologo
106 BSC32=bscmake.exe
107 # ADD BASE BSC32 /nologo
108 # ADD BSC32 /nologo
109
110 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
111
112 # PROP BASE Use_MFC 0
113 # PROP BASE Use_Debug_Libraries 1
114 # PROP BASE Output_Dir "X86Dbg"
115 # PROP BASE Intermediate_Dir "X86Dbg"
116 # PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
117 # PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
118 # PROP BASE Target_Dir ""
119 # PROP Use_MFC 0
120 # PROP Use_Debug_Libraries 1
121 # PROP Output_Dir "X86Dbg"
122 # PROP Intermediate_Dir "X86Dbg"
123 # PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
124 # PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
125 # PROP Target_Dir ""
126 CPP=cl.exe
127 # ADD BASE CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c
128 # ADD CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c
129 LIB32=link.exe -lib
130 # ADD BASE LIB32 /nologo
131 # ADD LIB32 /nologo
132 BSC32=bscmake.exe
133 # ADD BASE BSC32 /nologo
134 # ADD BSC32 /nologo
135
136 !ENDIF
137
138 # Begin Target
139
140 # Name "libfaad2 - Win32 (WCE ARM) Release"
141 # Name "libfaad2 - Win32 (WCE ARM) Debug"
142 # Name "libfaad2 - Win32 (WCE x86) Release"
143 # Name "libfaad2 - Win32 (WCE x86) Debug"
144 # Begin Group "Source Files"
145
146 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
147 # Begin Group "codebook"
148
149 # PROP Default_Filter ""
150 # Begin Source File
151
152 SOURCE=.\codebook\hcb_1.c
153
154 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
155
156 DEP_CPP_HCB_1=\
157 ".\codebook\hcb.h"\
158 ".\common.h"\
159 ".\fixed.h"\
160
161
162 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
163
164 DEP_CPP_HCB_1=\
165 ".\codebook\hcb.h"\
166 ".\common.h"\
167 ".\fixed.h"\
168
169
170 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
171
172 DEP_CPP_HCB_1=\
173 ".\codebook\hcb.h"\
174 ".\common.h"\
175 ".\fixed.h"\
176
177
178 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
179
180 DEP_CPP_HCB_1=\
181 ".\codebook\hcb.h"\
182 ".\common.h"\
183 ".\fixed.h"\
184
185
186 !ENDIF
187
188 # End Source File
189 # Begin Source File
190
191 SOURCE=.\codebook\hcb_10.c
192
193 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
194
195 DEP_CPP_HCB_10=\
196 ".\codebook\hcb.h"\
197 ".\common.h"\
198 ".\fixed.h"\
199
200
201 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
202
203 DEP_CPP_HCB_10=\
204 ".\codebook\hcb.h"\
205 ".\common.h"\
206 ".\fixed.h"\
207
208
209 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
210
211 DEP_CPP_HCB_10=\
212 ".\codebook\hcb.h"\
213 ".\common.h"\
214 ".\fixed.h"\
215
216
217 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
218
219 DEP_CPP_HCB_10=\
220 ".\codebook\hcb.h"\
221 ".\common.h"\
222 ".\fixed.h"\
223
224
225 !ENDIF
226
227 # End Source File
228 # Begin Source File
229
230 SOURCE=.\codebook\hcb_11.c
231
232 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
233
234 DEP_CPP_HCB_11=\
235 ".\codebook\hcb.h"\
236 ".\common.h"\
237 ".\fixed.h"\
238
239
240 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
241
242 DEP_CPP_HCB_11=\
243 ".\codebook\hcb.h"\
244 ".\common.h"\
245 ".\fixed.h"\
246
247
248 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
249
250 DEP_CPP_HCB_11=\
251 ".\codebook\hcb.h"\
252 ".\common.h"\
253 ".\fixed.h"\
254
255
256 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
257
258 DEP_CPP_HCB_11=\
259 ".\codebook\hcb.h"\
260 ".\common.h"\
261 ".\fixed.h"\
262
263
264 !ENDIF
265
266 # End Source File
267 # Begin Source File
268
269 SOURCE=.\codebook\hcb_2.c
270
271 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
272
273 DEP_CPP_HCB_2=\
274 ".\codebook\hcb.h"\
275 ".\common.h"\
276 ".\fixed.h"\
277
278
279 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
280
281 DEP_CPP_HCB_2=\
282 ".\codebook\hcb.h"\
283 ".\common.h"\
284 ".\fixed.h"\
285
286
287 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
288
289 DEP_CPP_HCB_2=\
290 ".\codebook\hcb.h"\
291 ".\common.h"\
292 ".\fixed.h"\
293
294
295 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
296
297 DEP_CPP_HCB_2=\
298 ".\codebook\hcb.h"\
299 ".\common.h"\
300 ".\fixed.h"\
301
302
303 !ENDIF
304
305 # End Source File
306 # Begin Source File
307
308 SOURCE=.\codebook\hcb_3.c
309
310 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
311
312 DEP_CPP_HCB_3=\
313 ".\codebook\hcb.h"\
314 ".\common.h"\
315 ".\fixed.h"\
316
317
318 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
319
320 DEP_CPP_HCB_3=\
321 ".\codebook\hcb.h"\
322 ".\common.h"\
323 ".\fixed.h"\
324
325
326 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
327
328 DEP_CPP_HCB_3=\
329 ".\codebook\hcb.h"\
330 ".\common.h"\
331 ".\fixed.h"\
332
333
334 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
335
336 DEP_CPP_HCB_3=\
337 ".\codebook\hcb.h"\
338 ".\common.h"\
339 ".\fixed.h"\
340
341
342 !ENDIF
343
344 # End Source File
345 # Begin Source File
346
347 SOURCE=.\codebook\hcb_4.c
348
349 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
350
351 DEP_CPP_HCB_4=\
352 ".\codebook\hcb.h"\
353 ".\common.h"\
354 ".\fixed.h"\
355
356
357 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
358
359 DEP_CPP_HCB_4=\
360 ".\codebook\hcb.h"\
361 ".\common.h"\
362 ".\fixed.h"\
363
364
365 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
366
367 DEP_CPP_HCB_4=\
368 ".\codebook\hcb.h"\
369 ".\common.h"\
370 ".\fixed.h"\
371
372
373 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
374
375 DEP_CPP_HCB_4=\
376 ".\codebook\hcb.h"\
377 ".\common.h"\
378 ".\fixed.h"\
379
380
381 !ENDIF
382
383 # End Source File
384 # Begin Source File
385
386 SOURCE=.\codebook\hcb_5.c
387
388 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
389
390 DEP_CPP_HCB_5=\
391 ".\codebook\hcb.h"\
392 ".\common.h"\
393 ".\fixed.h"\
394
395
396 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
397
398 DEP_CPP_HCB_5=\
399 ".\codebook\hcb.h"\
400 ".\common.h"\
401 ".\fixed.h"\
402
403
404 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
405
406 DEP_CPP_HCB_5=\
407 ".\codebook\hcb.h"\
408 ".\common.h"\
409 ".\fixed.h"\
410
411
412 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
413
414 DEP_CPP_HCB_5=\
415 ".\codebook\hcb.h"\
416 ".\common.h"\
417 ".\fixed.h"\
418
419
420 !ENDIF
421
422 # End Source File
423 # Begin Source File
424
425 SOURCE=.\codebook\hcb_6.c
426
427 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
428
429 DEP_CPP_HCB_6=\
430 ".\codebook\hcb.h"\
431 ".\common.h"\
432 ".\fixed.h"\
433
434
435 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
436
437 DEP_CPP_HCB_6=\
438 ".\codebook\hcb.h"\
439 ".\common.h"\
440 ".\fixed.h"\
441
442
443 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
444
445 DEP_CPP_HCB_6=\
446 ".\codebook\hcb.h"\
447 ".\common.h"\
448 ".\fixed.h"\
449
450
451 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
452
453 DEP_CPP_HCB_6=\
454 ".\codebook\hcb.h"\
455 ".\common.h"\
456 ".\fixed.h"\
457
458
459 !ENDIF
460
461 # End Source File
462 # Begin Source File
463
464 SOURCE=.\codebook\hcb_7.c
465
466 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
467
468 DEP_CPP_HCB_7=\
469 ".\codebook\hcb.h"\
470 ".\common.h"\
471 ".\fixed.h"\
472
473
474 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
475
476 DEP_CPP_HCB_7=\
477 ".\codebook\hcb.h"\
478 ".\common.h"\
479 ".\fixed.h"\
480
481
482 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
483
484 DEP_CPP_HCB_7=\
485 ".\codebook\hcb.h"\
486 ".\common.h"\
487 ".\fixed.h"\
488
489
490 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
491
492 DEP_CPP_HCB_7=\
493 ".\codebook\hcb.h"\
494 ".\common.h"\
495 ".\fixed.h"\
496
497
498 !ENDIF
499
500 # End Source File
501 # Begin Source File
502
503 SOURCE=.\codebook\hcb_8.c
504
505 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
506
507 DEP_CPP_HCB_8=\
508 ".\codebook\hcb.h"\
509 ".\common.h"\
510 ".\fixed.h"\
511
512
513 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
514
515 DEP_CPP_HCB_8=\
516 ".\codebook\hcb.h"\
517 ".\common.h"\
518 ".\fixed.h"\
519
520
521 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
522
523 DEP_CPP_HCB_8=\
524 ".\codebook\hcb.h"\
525 ".\common.h"\
526 ".\fixed.h"\
527
528
529 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
530
531 DEP_CPP_HCB_8=\
532 ".\codebook\hcb.h"\
533 ".\common.h"\
534 ".\fixed.h"\
535
536
537 !ENDIF
538
539 # End Source File
540 # Begin Source File
541
542 SOURCE=.\codebook\hcb_9.c
543
544 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
545
546 DEP_CPP_HCB_9=\
547 ".\codebook\hcb.h"\
548 ".\common.h"\
549 ".\fixed.h"\
550
551
552 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
553
554 DEP_CPP_HCB_9=\
555 ".\codebook\hcb.h"\
556 ".\common.h"\
557 ".\fixed.h"\
558
559
560 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
561
562 DEP_CPP_HCB_9=\
563 ".\codebook\hcb.h"\
564 ".\common.h"\
565 ".\fixed.h"\
566
567
568 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
569
570 DEP_CPP_HCB_9=\
571 ".\codebook\hcb.h"\
572 ".\common.h"\
573 ".\fixed.h"\
574
575
576 !ENDIF
577
578 # End Source File
579 # Begin Source File
580
581 SOURCE=.\codebook\hcb_sf.c
582
583 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
584
585 DEP_CPP_HCB_S=\
586 ".\codebook\hcb.h"\
587 ".\common.h"\
588 ".\fixed.h"\
589
590
591 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
592
593 DEP_CPP_HCB_S=\
594 ".\codebook\hcb.h"\
595 ".\common.h"\
596 ".\fixed.h"\
597
598
599 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
600
601 DEP_CPP_HCB_S=\
602 ".\codebook\hcb.h"\
603 ".\common.h"\
604 ".\fixed.h"\
605
606
607 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
608
609 DEP_CPP_HCB_S=\
610 ".\codebook\hcb.h"\
611 ".\common.h"\
612 ".\fixed.h"\
613
614
615 !ENDIF
616
617 # End Source File
618 # End Group
619 # Begin Source File
620
621 SOURCE=.\bits.c
622
623 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
624
625 DEP_CPP_BITS_=\
626 ".\analysis.h"\
627 ".\bits.h"\
628 ".\common.h"\
629 ".\fixed.h"\
630
631
632 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
633
634 DEP_CPP_BITS_=\
635 ".\analysis.h"\
636 ".\bits.h"\
637 ".\common.h"\
638 ".\fixed.h"\
639
640
641 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
642
643 DEP_CPP_BITS_=\
644 ".\analysis.h"\
645 ".\bits.h"\
646 ".\common.h"\
647 ".\fixed.h"\
648
649
650 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
651
652 DEP_CPP_BITS_=\
653 ".\analysis.h"\
654 ".\bits.h"\
655 ".\common.h"\
656 ".\fixed.h"\
657
658
659 !ENDIF
660
661 # End Source File
662 # Begin Source File
663
664 SOURCE=.\cfft.c
665
666 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
667
668 DEP_CPP_CFFT_=\
669 ".\cfft.h"\
670 ".\cfft_tab.h"\
671 ".\common.h"\
672 ".\fixed.h"\
673
674
675 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
676
677 DEP_CPP_CFFT_=\
678 ".\cfft.h"\
679 ".\cfft_tab.h"\
680 ".\common.h"\
681 ".\fixed.h"\
682
683
684 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
685
686 DEP_CPP_CFFT_=\
687 ".\cfft.h"\
688 ".\cfft_tab.h"\
689 ".\common.h"\
690 ".\fixed.h"\
691
692
693 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
694
695 DEP_CPP_CFFT_=\
696 ".\cfft.h"\
697 ".\cfft_tab.h"\
698 ".\common.h"\
699 ".\fixed.h"\
700
701
702 !ENDIF
703
704 # End Source File
705 # Begin Source File
706
707 SOURCE=.\common.c
708
709 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
710
711 DEP_CPP_COMMO=\
712 ".\analysis.h"\
713 ".\bits.h"\
714 ".\common.h"\
715 ".\fixed.h"\
716 ".\syntax.h"\
717
718
719 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
720
721 DEP_CPP_COMMO=\
722 ".\analysis.h"\
723 ".\bits.h"\
724 ".\common.h"\
725 ".\fixed.h"\
726 ".\syntax.h"\
727
728
729 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
730
731 DEP_CPP_COMMO=\
732 ".\analysis.h"\
733 ".\bits.h"\
734 ".\common.h"\
735 ".\fixed.h"\
736 ".\syntax.h"\
737
738
739 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
740
741 DEP_CPP_COMMO=\
742 ".\analysis.h"\
743 ".\bits.h"\
744 ".\common.h"\
745 ".\fixed.h"\
746 ".\syntax.h"\
747
748
749 !ENDIF
750
751 # End Source File
752 # Begin Source File
753
754 SOURCE=.\data.c
755
756 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
757
758 DEP_CPP_DATA_=\
759 ".\common.h"\
760 ".\data.h"\
761 ".\fixed.h"\
762
763
764 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
765
766 DEP_CPP_DATA_=\
767 ".\common.h"\
768 ".\data.h"\
769 ".\fixed.h"\
770
771
772 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
773
774 DEP_CPP_DATA_=\
775 ".\common.h"\
776 ".\data.h"\
777 ".\fixed.h"\
778
779
780 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
781
782 DEP_CPP_DATA_=\
783 ".\common.h"\
784 ".\data.h"\
785 ".\fixed.h"\
786
787
788 !ENDIF
789
790 # End Source File
791 # Begin Source File
792
793 SOURCE=.\decoder.c
794
795 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
796
797 DEP_CPP_DECOD=\
798 ".\analysis.h"\
799 ".\bits.h"\
800 ".\cfft.h"\
801 ".\common.h"\
802 ".\data.h"\
803 ".\decoder.h"\
804 ".\dither.h"\
805 ".\drc.h"\
806 ".\error.h"\
807 ".\filtbank.h"\
808 ".\fixed.h"\
809 ".\ic_predict.h"\
810 ".\is.h"\
811 ".\lt_predict.h"\
812 ".\mdct.h"\
813 ".\mp4.h"\
814 ".\ms.h"\
815 ".\output.h"\
816 ".\pns.h"\
817 ".\specrec.h"\
818 ".\syntax.h"\
819 ".\tns.h"\
820
821
822 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
823
824 DEP_CPP_DECOD=\
825 ".\analysis.h"\
826 ".\bits.h"\
827 ".\cfft.h"\
828 ".\common.h"\
829 ".\data.h"\
830 ".\decoder.h"\
831 ".\dither.h"\
832 ".\drc.h"\
833 ".\error.h"\
834 ".\filtbank.h"\
835 ".\fixed.h"\
836 ".\ic_predict.h"\
837 ".\is.h"\
838 ".\lt_predict.h"\
839 ".\mdct.h"\
840 ".\mp4.h"\
841 ".\ms.h"\
842 ".\output.h"\
843 ".\pns.h"\
844 ".\specrec.h"\
845 ".\syntax.h"\
846 ".\tns.h"\
847
848
849 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
850
851 DEP_CPP_DECOD=\
852 ".\analysis.h"\
853 ".\bits.h"\
854 ".\cfft.h"\
855 ".\common.h"\
856 ".\data.h"\
857 ".\decoder.h"\
858 ".\dither.h"\
859 ".\drc.h"\
860 ".\error.h"\
861 ".\filtbank.h"\
862 ".\fixed.h"\
863 ".\ic_predict.h"\
864 ".\is.h"\
865 ".\lt_predict.h"\
866 ".\mdct.h"\
867 ".\mp4.h"\
868 ".\ms.h"\
869 ".\output.h"\
870 ".\pns.h"\
871 ".\specrec.h"\
872 ".\syntax.h"\
873 ".\tns.h"\
874
875
876 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
877
878 DEP_CPP_DECOD=\
879 ".\analysis.h"\
880 ".\bits.h"\
881 ".\cfft.h"\
882 ".\common.h"\
883 ".\data.h"\
884 ".\decoder.h"\
885 ".\dither.h"\
886 ".\drc.h"\
887 ".\error.h"\
888 ".\filtbank.h"\
889 ".\fixed.h"\
890 ".\ic_predict.h"\
891 ".\is.h"\
892 ".\lt_predict.h"\
893 ".\mdct.h"\
894 ".\mp4.h"\
895 ".\ms.h"\
896 ".\output.h"\
897 ".\pns.h"\
898 ".\specrec.h"\
899 ".\syntax.h"\
900 ".\tns.h"\
901
902
903 !ENDIF
904
905 # End Source File
906 # Begin Source File
907
908 SOURCE=.\dither.c
909
910 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
911
912 DEP_CPP_DITHE=\
913 ".\common.h"\
914 ".\dither.h"\
915 ".\fixed.h"\
916
917
918 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
919
920 DEP_CPP_DITHE=\
921 ".\common.h"\
922 ".\dither.h"\
923 ".\fixed.h"\
924
925
926 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
927
928 DEP_CPP_DITHE=\
929 ".\common.h"\
930 ".\dither.h"\
931 ".\fixed.h"\
932
933
934 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
935
936 DEP_CPP_DITHE=\
937 ".\common.h"\
938 ".\dither.h"\
939 ".\fixed.h"\
940
941
942 !ENDIF
943
944 # End Source File
945 # Begin Source File
946
947 SOURCE=.\drc.c
948
949 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
950
951 DEP_CPP_DRC_C=\
952 ".\analysis.h"\
953 ".\bits.h"\
954 ".\common.h"\
955 ".\drc.h"\
956 ".\fixed.h"\
957 ".\syntax.h"\
958
959
960 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
961
962 DEP_CPP_DRC_C=\
963 ".\analysis.h"\
964 ".\bits.h"\
965 ".\common.h"\
966 ".\drc.h"\
967 ".\fixed.h"\
968 ".\syntax.h"\
969
970
971 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
972
973 DEP_CPP_DRC_C=\
974 ".\analysis.h"\
975 ".\bits.h"\
976 ".\common.h"\
977 ".\drc.h"\
978 ".\fixed.h"\
979 ".\syntax.h"\
980
981
982 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
983
984 DEP_CPP_DRC_C=\
985 ".\analysis.h"\
986 ".\bits.h"\
987 ".\common.h"\
988 ".\drc.h"\
989 ".\fixed.h"\
990 ".\syntax.h"\
991
992
993 !ENDIF
994
995 # End Source File
996 # Begin Source File
997
998 SOURCE=.\error.c
999
1000 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
1001
1002 DEP_CPP_ERROR=\
1003 ".\common.h"\
1004 ".\error.h"\
1005 ".\fixed.h"\
1006
1007
1008 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
1009
1010 DEP_CPP_ERROR=\
1011 ".\common.h"\
1012 ".\error.h"\
1013 ".\fixed.h"\
1014
1015
1016 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
1017
1018 DEP_CPP_ERROR=\
1019 ".\common.h"\
1020 ".\error.h"\
1021 ".\fixed.h"\
1022
1023
1024 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
1025
1026 DEP_CPP_ERROR=\
1027 ".\common.h"\
1028 ".\error.h"\
1029 ".\fixed.h"\
1030
1031
1032 !ENDIF
1033
1034 # End Source File
1035 # Begin Source File
1036
1037 SOURCE=.\filtbank.c
1038
1039 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
1040
1041 DEP_CPP_FILTB=\
1042 ".\analysis.h"\
1043 ".\bits.h"\
1044 ".\cfft.h"\
1045 ".\common.h"\
1046 ".\decoder.h"\
1047 ".\filtbank.h"\
1048 ".\fixed.h"\
1049 ".\ic_predict.h"\
1050 ".\kbd_win.h"\
1051 ".\mdct.h"\
1052 ".\sine_win.h"\
1053 ".\specrec.h"\
1054 ".\syntax.h"\
1055
1056
1057 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
1058
1059 DEP_CPP_FILTB=\
1060 ".\analysis.h"\
1061 ".\bits.h"\
1062 ".\cfft.h"\
1063 ".\common.h"\
1064 ".\decoder.h"\
1065 ".\filtbank.h"\
1066 ".\fixed.h"\
1067 ".\ic_predict.h"\
1068 ".\kbd_win.h"\
1069 ".\mdct.h"\
1070 ".\sine_win.h"\
1071 ".\specrec.h"\
1072 ".\syntax.h"\
1073
1074
1075 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
1076
1077 DEP_CPP_FILTB=\
1078 ".\analysis.h"\
1079 ".\bits.h"\
1080 ".\cfft.h"\
1081 ".\common.h"\
1082 ".\decoder.h"\
1083 ".\filtbank.h"\
1084 ".\fixed.h"\
1085 ".\ic_predict.h"\
1086 ".\kbd_win.h"\
1087 ".\mdct.h"\
1088 ".\sine_win.h"\
1089 ".\specrec.h"\
1090 ".\syntax.h"\
1091
1092
1093 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
1094
1095 DEP_CPP_FILTB=\
1096 ".\analysis.h"\
1097 ".\bits.h"\
1098 ".\cfft.h"\
1099 ".\common.h"\
1100 ".\decoder.h"\
1101 ".\filtbank.h"\
1102 ".\fixed.h"\
1103 ".\ic_predict.h"\
1104 ".\kbd_win.h"\
1105 ".\mdct.h"\
1106 ".\sine_win.h"\
1107 ".\specrec.h"\
1108 ".\syntax.h"\
1109
1110
1111 !ENDIF
1112
1113 # End Source File
1114 # Begin Source File
1115
1116 SOURCE=.\ic_predict.c
1117
1118 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
1119
1120 DEP_CPP_IC_PR=\
1121 ".\analysis.h"\
1122 ".\bits.h"\
1123 ".\common.h"\
1124 ".\fixed.h"\
1125 ".\ic_predict.h"\
1126 ".\pns.h"\
1127 ".\syntax.h"\
1128
1129
1130 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
1131
1132 DEP_CPP_IC_PR=\
1133 ".\analysis.h"\
1134 ".\bits.h"\
1135 ".\common.h"\
1136 ".\fixed.h"\
1137 ".\ic_predict.h"\
1138 ".\pns.h"\
1139 ".\syntax.h"\
1140
1141
1142 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
1143
1144 DEP_CPP_IC_PR=\
1145 ".\analysis.h"\
1146 ".\bits.h"\
1147 ".\common.h"\
1148 ".\fixed.h"\
1149 ".\ic_predict.h"\
1150 ".\pns.h"\
1151 ".\syntax.h"\
1152
1153
1154 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
1155
1156 DEP_CPP_IC_PR=\
1157 ".\analysis.h"\
1158 ".\bits.h"\
1159 ".\common.h"\
1160 ".\fixed.h"\
1161 ".\ic_predict.h"\
1162 ".\pns.h"\
1163 ".\syntax.h"\
1164
1165
1166 !ENDIF
1167
1168 # End Source File
1169 # Begin Source File
1170
1171 SOURCE=.\is.c
1172
1173 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
1174
1175 DEP_CPP_IS_C2c=\
1176 ".\analysis.h"\
1177 ".\bits.h"\
1178 ".\common.h"\
1179 ".\fixed.h"\
1180 ".\is.h"\
1181 ".\syntax.h"\
1182
1183
1184 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
1185
1186 DEP_CPP_IS_C2c=\
1187 ".\analysis.h"\
1188 ".\bits.h"\
1189 ".\common.h"\
1190 ".\fixed.h"\
1191 ".\is.h"\
1192 ".\syntax.h"\
1193
1194
1195 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
1196
1197 DEP_CPP_IS_C2c=\
1198 ".\analysis.h"\
1199 ".\bits.h"\
1200 ".\common.h"\
1201 ".\fixed.h"\
1202 ".\is.h"\
1203 ".\syntax.h"\
1204
1205
1206 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
1207
1208 DEP_CPP_IS_C2c=\
1209 ".\analysis.h"\
1210 ".\bits.h"\
1211 ".\common.h"\
1212 ".\fixed.h"\
1213 ".\is.h"\
1214 ".\syntax.h"\
1215
1216
1217 !ENDIF
1218
1219 # End Source File
1220 # Begin Source File
1221
1222 SOURCE=.\lt_predict.c
1223
1224 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
1225
1226 DEP_CPP_LT_PR=\
1227 ".\analysis.h"\
1228 ".\bits.h"\
1229 ".\cfft.h"\
1230 ".\common.h"\
1231 ".\filtbank.h"\
1232 ".\fixed.h"\
1233 ".\lt_predict.h"\
1234 ".\mdct.h"\
1235 ".\syntax.h"\
1236 ".\tns.h"\
1237
1238
1239 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
1240
1241 DEP_CPP_LT_PR=\
1242 ".\analysis.h"\
1243 ".\bits.h"\
1244 ".\cfft.h"\
1245 ".\common.h"\
1246 ".\filtbank.h"\
1247 ".\fixed.h"\
1248 ".\lt_predict.h"\
1249 ".\mdct.h"\
1250 ".\syntax.h"\
1251 ".\tns.h"\
1252
1253
1254 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
1255
1256 DEP_CPP_LT_PR=\
1257 ".\analysis.h"\
1258 ".\bits.h"\
1259 ".\cfft.h"\
1260 ".\common.h"\
1261 ".\filtbank.h"\
1262 ".\fixed.h"\
1263 ".\lt_predict.h"\
1264 ".\mdct.h"\
1265 ".\syntax.h"\
1266 ".\tns.h"\
1267
1268
1269 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
1270
1271 DEP_CPP_LT_PR=\
1272 ".\analysis.h"\
1273 ".\bits.h"\
1274 ".\cfft.h"\
1275 ".\common.h"\
1276 ".\filtbank.h"\
1277 ".\fixed.h"\
1278 ".\lt_predict.h"\
1279 ".\mdct.h"\
1280 ".\syntax.h"\
1281 ".\tns.h"\
1282
1283
1284 !ENDIF
1285
1286 # End Source File
1287 # Begin Source File
1288
1289 SOURCE=.\mdct.c
1290
1291 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
1292
1293 DEP_CPP_MDCT_=\
1294 ".\cfft.h"\
1295 ".\common.h"\
1296 ".\fixed.h"\
1297 ".\mdct.h"\
1298
1299
1300 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
1301
1302 DEP_CPP_MDCT_=\
1303 ".\cfft.h"\
1304 ".\common.h"\
1305 ".\fixed.h"\
1306 ".\mdct.h"\
1307
1308
1309 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
1310
1311 DEP_CPP_MDCT_=\
1312 ".\cfft.h"\
1313 ".\common.h"\
1314 ".\fixed.h"\
1315 ".\mdct.h"\
1316
1317
1318 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
1319
1320 DEP_CPP_MDCT_=\
1321 ".\cfft.h"\
1322 ".\common.h"\
1323 ".\fixed.h"\
1324 ".\mdct.h"\
1325
1326
1327 !ENDIF
1328
1329 # End Source File
1330 # Begin Source File
1331
1332 SOURCE=.\mp4.c
1333
1334 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
1335
1336 DEP_CPP_MP4_C=\
1337 ".\analysis.h"\
1338 ".\bits.h"\
1339 ".\cfft.h"\
1340 ".\common.h"\
1341 ".\data.h"\
1342 ".\decoder.h"\
1343 ".\filtbank.h"\
1344 ".\fixed.h"\
1345 ".\ic_predict.h"\
1346 ".\mdct.h"\
1347 ".\mp4.h"\
1348 ".\specrec.h"\
1349 ".\syntax.h"\
1350
1351
1352 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
1353
1354 DEP_CPP_MP4_C=\
1355 ".\analysis.h"\
1356 ".\bits.h"\
1357 ".\cfft.h"\
1358 ".\common.h"\
1359 ".\data.h"\
1360 ".\decoder.h"\
1361 ".\filtbank.h"\
1362 ".\fixed.h"\
1363 ".\ic_predict.h"\
1364 ".\mdct.h"\
1365 ".\mp4.h"\
1366 ".\specrec.h"\
1367 ".\syntax.h"\
1368
1369
1370 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
1371
1372 DEP_CPP_MP4_C=\
1373 ".\analysis.h"\
1374 ".\bits.h"\
1375 ".\cfft.h"\
1376 ".\common.h"\
1377 ".\data.h"\
1378 ".\decoder.h"\
1379 ".\filtbank.h"\
1380 ".\fixed.h"\
1381 ".\ic_predict.h"\
1382 ".\mdct.h"\
1383 ".\mp4.h"\
1384 ".\specrec.h"\
1385 ".\syntax.h"\
1386
1387
1388 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
1389
1390 DEP_CPP_MP4_C=\
1391 ".\analysis.h"\
1392 ".\bits.h"\
1393 ".\cfft.h"\
1394 ".\common.h"\
1395 ".\data.h"\
1396 ".\decoder.h"\
1397 ".\filtbank.h"\
1398 ".\fixed.h"\
1399 ".\ic_predict.h"\
1400 ".\mdct.h"\
1401 ".\mp4.h"\
1402 ".\specrec.h"\
1403 ".\syntax.h"\
1404
1405
1406 !ENDIF
1407
1408 # End Source File
1409 # Begin Source File
1410
1411 SOURCE=.\ms.c
1412
1413 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
1414
1415 DEP_CPP_MS_C34=\
1416 ".\analysis.h"\
1417 ".\bits.h"\
1418 ".\common.h"\
1419 ".\fixed.h"\
1420 ".\is.h"\
1421 ".\ms.h"\
1422 ".\pns.h"\
1423 ".\syntax.h"\
1424
1425
1426 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
1427
1428 DEP_CPP_MS_C34=\
1429 ".\analysis.h"\
1430 ".\bits.h"\
1431 ".\common.h"\
1432 ".\fixed.h"\
1433 ".\is.h"\
1434 ".\ms.h"\
1435 ".\pns.h"\
1436 ".\syntax.h"\
1437
1438
1439 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
1440
1441 DEP_CPP_MS_C34=\
1442 ".\analysis.h"\
1443 ".\bits.h"\
1444 ".\common.h"\
1445 ".\fixed.h"\
1446 ".\is.h"\
1447 ".\ms.h"\
1448 ".\pns.h"\
1449 ".\syntax.h"\
1450
1451
1452 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
1453
1454 DEP_CPP_MS_C34=\
1455 ".\analysis.h"\
1456 ".\bits.h"\
1457 ".\common.h"\
1458 ".\fixed.h"\
1459 ".\is.h"\
1460 ".\ms.h"\
1461 ".\pns.h"\
1462 ".\syntax.h"\
1463
1464
1465 !ENDIF
1466
1467 # End Source File
1468 # Begin Source File
1469
1470 SOURCE=.\output.c
1471
1472 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
1473
1474 DEP_CPP_OUTPU=\
1475 ".\analysis.h"\
1476 ".\bits.h"\
1477 ".\cfft.h"\
1478 ".\common.h"\
1479 ".\decoder.h"\
1480 ".\dither.h"\
1481 ".\filtbank.h"\
1482 ".\fixed.h"\
1483 ".\ic_predict.h"\
1484 ".\mdct.h"\
1485 ".\output.h"\
1486 ".\specrec.h"\
1487 ".\syntax.h"\
1488
1489
1490 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
1491
1492 DEP_CPP_OUTPU=\
1493 ".\analysis.h"\
1494 ".\bits.h"\
1495 ".\cfft.h"\
1496 ".\common.h"\
1497 ".\decoder.h"\
1498 ".\dither.h"\
1499 ".\filtbank.h"\
1500 ".\fixed.h"\
1501 ".\ic_predict.h"\
1502 ".\mdct.h"\
1503 ".\output.h"\
1504 ".\specrec.h"\
1505 ".\syntax.h"\
1506
1507
1508 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
1509
1510 DEP_CPP_OUTPU=\
1511 ".\analysis.h"\
1512 ".\bits.h"\
1513 ".\cfft.h"\
1514 ".\common.h"\
1515 ".\decoder.h"\
1516 ".\dither.h"\
1517 ".\filtbank.h"\
1518 ".\fixed.h"\
1519 ".\ic_predict.h"\
1520 ".\mdct.h"\
1521 ".\output.h"\
1522 ".\specrec.h"\
1523 ".\syntax.h"\
1524
1525
1526 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
1527
1528 DEP_CPP_OUTPU=\
1529 ".\analysis.h"\
1530 ".\bits.h"\
1531 ".\cfft.h"\
1532 ".\common.h"\
1533 ".\decoder.h"\
1534 ".\dither.h"\
1535 ".\filtbank.h"\
1536 ".\fixed.h"\
1537 ".\ic_predict.h"\
1538 ".\mdct.h"\
1539 ".\output.h"\
1540 ".\specrec.h"\
1541 ".\syntax.h"\
1542
1543
1544 !ENDIF
1545
1546 # End Source File
1547 # Begin Source File
1548
1549 SOURCE=.\pns.c
1550
1551 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
1552
1553 DEP_CPP_PNS_C=\
1554 ".\analysis.h"\
1555 ".\bits.h"\
1556 ".\common.h"\
1557 ".\fixed.h"\
1558 ".\pns.h"\
1559 ".\syntax.h"\
1560
1561
1562 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
1563
1564 DEP_CPP_PNS_C=\
1565 ".\analysis.h"\
1566 ".\bits.h"\
1567 ".\common.h"\
1568 ".\fixed.h"\
1569 ".\pns.h"\
1570 ".\syntax.h"\
1571
1572
1573 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
1574
1575 DEP_CPP_PNS_C=\
1576 ".\analysis.h"\
1577 ".\bits.h"\
1578 ".\common.h"\
1579 ".\fixed.h"\
1580 ".\pns.h"\
1581 ".\syntax.h"\
1582
1583
1584 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
1585
1586 DEP_CPP_PNS_C=\
1587 ".\analysis.h"\
1588 ".\bits.h"\
1589 ".\common.h"\
1590 ".\fixed.h"\
1591 ".\pns.h"\
1592 ".\syntax.h"\
1593
1594
1595 !ENDIF
1596
1597 # End Source File
1598 # Begin Source File
1599
1600 SOURCE=.\pulse.c
1601
1602 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
1603
1604 DEP_CPP_PULSE=\
1605 ".\analysis.h"\
1606 ".\bits.h"\
1607 ".\common.h"\
1608 ".\fixed.h"\
1609 ".\pulse.h"\
1610 ".\syntax.h"\
1611
1612
1613 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
1614
1615 DEP_CPP_PULSE=\
1616 ".\analysis.h"\
1617 ".\bits.h"\
1618 ".\common.h"\
1619 ".\fixed.h"\
1620 ".\pulse.h"\
1621 ".\syntax.h"\
1622
1623
1624 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
1625
1626 DEP_CPP_PULSE=\
1627 ".\analysis.h"\
1628 ".\bits.h"\
1629 ".\common.h"\
1630 ".\fixed.h"\
1631 ".\pulse.h"\
1632 ".\syntax.h"\
1633
1634
1635 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
1636
1637 DEP_CPP_PULSE=\
1638 ".\analysis.h"\
1639 ".\bits.h"\
1640 ".\common.h"\
1641 ".\fixed.h"\
1642 ".\pulse.h"\
1643 ".\syntax.h"\
1644
1645
1646 !ENDIF
1647
1648 # End Source File
1649 # Begin Source File
1650
1651 SOURCE=.\reordered_spectral_data.c
1652
1653 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
1654
1655 DEP_CPP_REORD=\
1656 ".\analysis.h"\
1657 ".\bits.h"\
1658 ".\codebook\hcb.h"\
1659 ".\common.h"\
1660 ".\data.h"\
1661 ".\fixed.h"\
1662 ".\pulse.h"\
1663 ".\specrec.h"\
1664 ".\syntax.h"\
1665
1666
1667 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
1668
1669 DEP_CPP_REORD=\
1670 ".\analysis.h"\
1671 ".\bits.h"\
1672 ".\codebook\hcb.h"\
1673 ".\common.h"\
1674 ".\data.h"\
1675 ".\fixed.h"\
1676 ".\pulse.h"\
1677 ".\specrec.h"\
1678 ".\syntax.h"\
1679
1680
1681 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
1682
1683 DEP_CPP_REORD=\
1684 ".\analysis.h"\
1685 ".\bits.h"\
1686 ".\codebook\hcb.h"\
1687 ".\common.h"\
1688 ".\data.h"\
1689 ".\fixed.h"\
1690 ".\pulse.h"\
1691 ".\specrec.h"\
1692 ".\syntax.h"\
1693
1694
1695 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
1696
1697 DEP_CPP_REORD=\
1698 ".\analysis.h"\
1699 ".\bits.h"\
1700 ".\codebook\hcb.h"\
1701 ".\common.h"\
1702 ".\data.h"\
1703 ".\fixed.h"\
1704 ".\pulse.h"\
1705 ".\specrec.h"\
1706 ".\syntax.h"\
1707
1708
1709 !ENDIF
1710
1711 # End Source File
1712 # Begin Source File
1713
1714 SOURCE=.\rvlc_scale_factors.c
1715
1716 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
1717
1718 DEP_CPP_RVLC_=\
1719 ".\analysis.h"\
1720 ".\bits.h"\
1721 ".\common.h"\
1722 ".\fixed.h"\
1723 ".\rvlc_scale_factors.h"\
1724 ".\syntax.h"\
1725
1726
1727 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
1728
1729 DEP_CPP_RVLC_=\
1730 ".\analysis.h"\
1731 ".\bits.h"\
1732 ".\common.h"\
1733 ".\fixed.h"\
1734 ".\rvlc_scale_factors.h"\
1735 ".\syntax.h"\
1736
1737
1738 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
1739
1740 DEP_CPP_RVLC_=\
1741 ".\analysis.h"\
1742 ".\bits.h"\
1743 ".\common.h"\
1744 ".\fixed.h"\
1745 ".\rvlc_scale_factors.h"\
1746 ".\syntax.h"\
1747
1748
1749 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
1750
1751 DEP_CPP_RVLC_=\
1752 ".\analysis.h"\
1753 ".\bits.h"\
1754 ".\common.h"\
1755 ".\fixed.h"\
1756 ".\rvlc_scale_factors.h"\
1757 ".\syntax.h"\
1758
1759
1760 !ENDIF
1761
1762 # End Source File
1763 # Begin Source File
1764
1765 SOURCE=.\specrec.c
1766
1767 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
1768
1769 DEP_CPP_SPECR=\
1770 ".\analysis.h"\
1771 ".\bits.h"\
1772 ".\common.h"\
1773 ".\data.h"\
1774 ".\fixed.h"\
1775 ".\iq_table.h"\
1776 ".\specrec.h"\
1777 ".\syntax.h"\
1778
1779
1780 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
1781
1782 DEP_CPP_SPECR=\
1783 ".\analysis.h"\
1784 ".\bits.h"\
1785 ".\common.h"\
1786 ".\data.h"\
1787 ".\fixed.h"\
1788 ".\iq_table.h"\
1789 ".\specrec.h"\
1790 ".\syntax.h"\
1791
1792
1793 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
1794
1795 DEP_CPP_SPECR=\
1796 ".\analysis.h"\
1797 ".\bits.h"\
1798 ".\common.h"\
1799 ".\data.h"\
1800 ".\fixed.h"\
1801 ".\iq_table.h"\
1802 ".\specrec.h"\
1803 ".\syntax.h"\
1804
1805
1806 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
1807
1808 DEP_CPP_SPECR=\
1809 ".\analysis.h"\
1810 ".\bits.h"\
1811 ".\common.h"\
1812 ".\data.h"\
1813 ".\fixed.h"\
1814 ".\iq_table.h"\
1815 ".\specrec.h"\
1816 ".\syntax.h"\
1817
1818
1819 !ENDIF
1820
1821 # End Source File
1822 # Begin Source File
1823
1824 SOURCE=.\syntax.c
1825
1826 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
1827
1828 DEP_CPP_SYNTA=\
1829 ".\analysis.h"\
1830 ".\bits.h"\
1831 ".\cfft.h"\
1832 ".\codebook\hcb.h"\
1833 ".\common.h"\
1834 ".\data.h"\
1835 ".\decoder.h"\
1836 ".\filtbank.h"\
1837 ".\fixed.h"\
1838 ".\huffman.h"\
1839 ".\ic_predict.h"\
1840 ".\mdct.h"\
1841 ".\pulse.h"\
1842 ".\rvlc_scale_factors.h"\
1843 ".\specrec.h"\
1844 ".\syntax.h"\
1845
1846
1847 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
1848
1849 DEP_CPP_SYNTA=\
1850 ".\analysis.h"\
1851 ".\bits.h"\
1852 ".\cfft.h"\
1853 ".\codebook\hcb.h"\
1854 ".\common.h"\
1855 ".\data.h"\
1856 ".\decoder.h"\
1857 ".\filtbank.h"\
1858 ".\fixed.h"\
1859 ".\huffman.h"\
1860 ".\ic_predict.h"\
1861 ".\mdct.h"\
1862 ".\pulse.h"\
1863 ".\rvlc_scale_factors.h"\
1864 ".\specrec.h"\
1865 ".\syntax.h"\
1866
1867
1868 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
1869
1870 DEP_CPP_SYNTA=\
1871 ".\analysis.h"\
1872 ".\bits.h"\
1873 ".\cfft.h"\
1874 ".\codebook\hcb.h"\
1875 ".\common.h"\
1876 ".\data.h"\
1877 ".\decoder.h"\
1878 ".\filtbank.h"\
1879 ".\fixed.h"\
1880 ".\huffman.h"\
1881 ".\ic_predict.h"\
1882 ".\mdct.h"\
1883 ".\pulse.h"\
1884 ".\rvlc_scale_factors.h"\
1885 ".\specrec.h"\
1886 ".\syntax.h"\
1887
1888
1889 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
1890
1891 DEP_CPP_SYNTA=\
1892 ".\analysis.h"\
1893 ".\bits.h"\
1894 ".\cfft.h"\
1895 ".\codebook\hcb.h"\
1896 ".\common.h"\
1897 ".\data.h"\
1898 ".\decoder.h"\
1899 ".\filtbank.h"\
1900 ".\fixed.h"\
1901 ".\huffman.h"\
1902 ".\ic_predict.h"\
1903 ".\mdct.h"\
1904 ".\pulse.h"\
1905 ".\rvlc_scale_factors.h"\
1906 ".\specrec.h"\
1907 ".\syntax.h"\
1908
1909
1910 !ENDIF
1911
1912 # End Source File
1913 # Begin Source File
1914
1915 SOURCE=.\tns.c
1916
1917 !IF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Release"
1918
1919 DEP_CPP_TNS_C=\
1920 ".\analysis.h"\
1921 ".\bits.h"\
1922 ".\common.h"\
1923 ".\fixed.h"\
1924 ".\syntax.h"\
1925 ".\tns.h"\
1926
1927
1928 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE ARM) Debug"
1929
1930 DEP_CPP_TNS_C=\
1931 ".\analysis.h"\
1932 ".\bits.h"\
1933 ".\common.h"\
1934 ".\fixed.h"\
1935 ".\syntax.h"\
1936 ".\tns.h"\
1937
1938
1939 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Release"
1940
1941 DEP_CPP_TNS_C=\
1942 ".\analysis.h"\
1943 ".\bits.h"\
1944 ".\common.h"\
1945 ".\fixed.h"\
1946 ".\syntax.h"\
1947 ".\tns.h"\
1948
1949
1950 !ELSEIF "$(CFG)" == "libfaad2 - Win32 (WCE x86) Debug"
1951
1952 DEP_CPP_TNS_C=\
1953 ".\analysis.h"\
1954 ".\bits.h"\
1955 ".\common.h"\
1956 ".\fixed.h"\
1957 ".\syntax.h"\
1958 ".\tns.h"\
1959
1960
1961 !ENDIF
1962
1963 # End Source File
1964 # End Group
1965 # Begin Group "Header Files"
1966
1967 # PROP Default_Filter "h;hpp;hxx;hm;inl"
1968 # Begin Source File
1969
1970 SOURCE=.\analysis.h
1971 # End Source File
1972 # Begin Source File
1973
1974 SOURCE=.\bits.h
1975 # End Source File
1976 # Begin Source File
1977
1978 SOURCE=.\cfft.h
1979 # End Source File
1980 # Begin Source File
1981
1982 SOURCE=.\cfft_tab.h
1983 # End Source File
1984 # Begin Source File
1985
1986 SOURCE=.\common.h
1987 # End Source File
1988 # Begin Source File
1989
1990 SOURCE=.\data.h
1991 # End Source File
1992 # Begin Source File
1993
1994 SOURCE=.\decoder.h
1995 # End Source File
1996 # Begin Source File
1997
1998 SOURCE=.\dither.h
1999 # End Source File
2000 # Begin Source File
2001
2002 SOURCE=.\drc.h
2003 # End Source File
2004 # Begin Source File
2005
2006 SOURCE=.\error.h
2007 # End Source File
2008 # Begin Source File
2009
2010 SOURCE=.\filtbank.h
2011 # End Source File
2012 # Begin Source File
2013
2014 SOURCE=.\fixed.h
2015 # End Source File
2016 # Begin Source File
2017
2018 SOURCE=.\codebook\hcb.h
2019 # End Source File
2020 # Begin Source File
2021
2022 SOURCE=.\huffman.h
2023 # End Source File
2024 # Begin Source File
2025
2026 SOURCE=.\ic_predict.h
2027 # End Source File
2028 # Begin Source File
2029
2030 SOURCE=.\iq_table.h
2031 # End Source File
2032 # Begin Source File
2033
2034 SOURCE=.\is.h
2035 # End Source File
2036 # Begin Source File
2037
2038 SOURCE=.\kbd_win.h
2039 # End Source File
2040 # Begin Source File
2041
2042 SOURCE=.\lt_predict.h
2043 # End Source File
2044 # Begin Source File
2045
2046 SOURCE=.\mdct.h
2047 # End Source File
2048 # Begin Source File
2049
2050 SOURCE=.\mp4.h
2051 # End Source File
2052 # Begin Source File
2053
2054 SOURCE=.\ms.h
2055 # End Source File
2056 # Begin Source File
2057
2058 SOURCE=.\output.h
2059 # End Source File
2060 # Begin Source File
2061
2062 SOURCE=.\pns.h
2063 # End Source File
2064 # Begin Source File
2065
2066 SOURCE=.\pulse.h
2067 # End Source File
2068 # Begin Source File
2069
2070 SOURCE=.\rvlc_scale_factors.h
2071 # End Source File
2072 # Begin Source File
2073
2074 SOURCE=.\sine_win.h
2075 # End Source File
2076 # Begin Source File
2077
2078 SOURCE=.\specrec.h
2079 # End Source File
2080 # Begin Source File
2081
2082 SOURCE=.\syntax.h
2083 # End Source File
2084 # Begin Source File
2085
2086 SOURCE=.\tns.h
2087 # End Source File
2088 # End Group
2089 # End Target
2090 # End Project
0 Microsoft eMbedded Visual Tools Workspace File, Format Version 3.00
1 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
2
3 ###############################################################################
4
5 Project: "libfaad2"=".\libfaad2.vcp" - Package Owner=<4>
6
7 Package=<5>
8 {{{
9 }}}
10
11 Package=<4>
12 {{{
13 }}}
14
15 ###############################################################################
16
17 Global:
18
19 Package=<5>
20 {{{
21 }}}
22
23 Package=<3>
24 {{{
25 }}}
26
27 ###############################################################################
28
0 # Microsoft Developer Studio Project File - Name="libfaad2_dll" - Package Owner=<4>
1 # Microsoft Developer Studio Generated Build File, Format Version 6.00
2 # ** DO NOT EDIT **
3
4 # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
5
6 CFG=libfaad2_dll - Win32 Debug
7 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
8 !MESSAGE use the Export Makefile command and run
9 !MESSAGE
10 !MESSAGE NMAKE /f "libfaad2_dll.mak".
11 !MESSAGE
12 !MESSAGE You can specify a configuration when running NMAKE
13 !MESSAGE by defining the macro CFG on the command line. For example:
14 !MESSAGE
15 !MESSAGE NMAKE /f "libfaad2_dll.mak" CFG="libfaad2_dll - Win32 Debug"
16 !MESSAGE
17 !MESSAGE Possible choices for configuration are:
18 !MESSAGE
19 !MESSAGE "libfaad2_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
20 !MESSAGE "libfaad2_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
21 !MESSAGE
22
23 # Begin Project
24 # PROP AllowPerConfigDependencies 0
25 # PROP Scc_ProjName ""
26 # PROP Scc_LocalPath ""
27 CPP=cl.exe
28 MTL=midl.exe
29 RSC=rc.exe
30
31 !IF "$(CFG)" == "libfaad2_dll - Win32 Release"
32
33 # PROP BASE Use_MFC 0
34 # PROP BASE Use_Debug_Libraries 0
35 # PROP BASE Output_Dir "libfaad2_dll___Win32_Release"
36 # PROP BASE Intermediate_Dir "libfaad2_dll___Win32_Release"
37 # PROP BASE Target_Dir ""
38 # PROP Use_MFC 0
39 # PROP Use_Debug_Libraries 0
40 # PROP Output_Dir "ReleaseDLL"
41 # PROP Intermediate_Dir "ReleaseDLL"
42 # PROP Ignore_Export_Lib 0
43 # PROP Target_Dir ""
44 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "libfaad2_dll_EXPORTS" /YX /FD /c
45 # ADD CPP /nologo /MD /W3 /GX /O2 /I "fftw" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "libfaad2_dll_EXPORTS" /YX /FD /c
46 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
47 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
48 # ADD BASE RSC /l 0x407 /d "NDEBUG"
49 # ADD RSC /l 0x407 /d "NDEBUG"
50 BSC32=bscmake.exe
51 # ADD BASE BSC32 /nologo
52 # ADD BSC32 /nologo
53 LINK32=link.exe
54 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
55 # ADD LINK32 /nologo /dll /machine:I386 /out:"ReleaseDLL/libfaad2.dll"
56
57 !ELSEIF "$(CFG)" == "libfaad2_dll - Win32 Debug"
58
59 # PROP BASE Use_MFC 0
60 # PROP BASE Use_Debug_Libraries 1
61 # PROP BASE Output_Dir "libfaad2_dll___Win32_Debug"
62 # PROP BASE Intermediate_Dir "libfaad2_dll___Win32_Debug"
63 # PROP BASE Target_Dir ""
64 # PROP Use_MFC 0
65 # PROP Use_Debug_Libraries 1
66 # PROP Output_Dir "DebugDLL"
67 # PROP Intermediate_Dir "DebugDLL"
68 # PROP Ignore_Export_Lib 0
69 # PROP Target_Dir ""
70 # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "libfaad2_dll_EXPORTS" /YX /FD /GZ /c
71 # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "fftw" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "libfaad2_dll_EXPORTS" /YX /FD /GZ /c
72 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
73 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
74 # ADD BASE RSC /l 0x407 /d "_DEBUG"
75 # ADD RSC /l 0x407 /d "_DEBUG"
76 BSC32=bscmake.exe
77 # ADD BASE BSC32 /nologo
78 # ADD BSC32 /nologo
79 LINK32=link.exe
80 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
81 # ADD LINK32 /nologo /dll /debug /machine:I386 /out:"DebugDLL/libfaad2.dll" /pdbtype:sept
82
83 !ENDIF
84
85 # Begin Target
86
87 # Name "libfaad2_dll - Win32 Release"
88 # Name "libfaad2_dll - Win32 Debug"
89 # Begin Group "Source Files"
90
91 # PROP Default_Filter ""
92 # Begin Source File
93
94 SOURCE=.\bits.c
95 # End Source File
96 # Begin Source File
97
98 SOURCE=.\cfft.c
99 # End Source File
100 # Begin Source File
101
102 SOURCE=.\common.c
103 # End Source File
104 # Begin Source File
105
106 SOURCE=.\decoder.c
107 # End Source File
108 # Begin Source File
109
110 SOURCE=.\drc.c
111 # End Source File
112 # Begin Source File
113
114 SOURCE=.\error.c
115 # End Source File
116 # Begin Source File
117
118 SOURCE=.\filtbank.c
119 # End Source File
120 # Begin Source File
121
122 SOURCE=.\hcr.c
123 # End Source File
124 # Begin Source File
125
126 SOURCE=.\huffman.c
127 # End Source File
128 # Begin Source File
129
130 SOURCE=.\ic_predict.c
131 # End Source File
132 # Begin Source File
133
134 SOURCE=.\is.c
135 # End Source File
136 # Begin Source File
137
138 SOURCE=.\lt_predict.c
139 # End Source File
140 # Begin Source File
141
142 SOURCE=.\mdct.c
143 # End Source File
144 # Begin Source File
145
146 SOURCE=.\mp4.c
147 # End Source File
148 # Begin Source File
149
150 SOURCE=.\ms.c
151 # End Source File
152 # Begin Source File
153
154 SOURCE=.\output.c
155 # End Source File
156 # Begin Source File
157
158 SOURCE=.\pns.c
159 # End Source File
160 # Begin Source File
161
162 SOURCE=.\ps_dec.c
163 # End Source File
164 # Begin Source File
165
166 SOURCE=.\ps_syntax.c
167 # End Source File
168 # Begin Source File
169
170 SOURCE=.\pulse.c
171 # End Source File
172 # Begin Source File
173
174 SOURCE=.\rvlc.c
175 # End Source File
176 # Begin Source File
177
178 SOURCE=.\sbr_dct.c
179 # End Source File
180 # Begin Source File
181
182 SOURCE=.\sbr_dec.c
183 # End Source File
184 # Begin Source File
185
186 SOURCE=.\sbr_e_nf.c
187 # End Source File
188 # Begin Source File
189
190 SOURCE=.\sbr_fbt.c
191 # End Source File
192 # Begin Source File
193
194 SOURCE=.\sbr_hfadj.c
195 # End Source File
196 # Begin Source File
197
198 SOURCE=.\sbr_hfgen.c
199 # End Source File
200 # Begin Source File
201
202 SOURCE=.\sbr_huff.c
203 # End Source File
204 # Begin Source File
205
206 SOURCE=.\sbr_qmf.c
207 # End Source File
208 # Begin Source File
209
210 SOURCE=.\sbr_syntax.c
211 # End Source File
212 # Begin Source File
213
214 SOURCE=.\sbr_tf_grid.c
215 # End Source File
216 # Begin Source File
217
218 SOURCE=.\specrec.c
219 # End Source File
220 # Begin Source File
221
222 SOURCE=.\ssr.c
223 # End Source File
224 # Begin Source File
225
226 SOURCE=.\ssr_fb.c
227 # End Source File
228 # Begin Source File
229
230 SOURCE=.\ssr_ipqf.c
231 # End Source File
232 # Begin Source File
233
234 SOURCE=.\syntax.c
235 # End Source File
236 # Begin Source File
237
238 SOURCE=.\tns.c
239 # End Source File
240 # End Group
241 # Begin Group "Header Files"
242
243 # PROP Default_Filter ""
244 # Begin Source File
245
246 SOURCE=.\analysis.h
247 # End Source File
248 # Begin Source File
249
250 SOURCE=.\bits.h
251 # End Source File
252 # Begin Source File
253
254 SOURCE=.\cfft.h
255 # End Source File
256 # Begin Source File
257
258 SOURCE=.\common.h
259 # End Source File
260 # Begin Source File
261
262 SOURCE=.\data.h
263 # End Source File
264 # Begin Source File
265
266 SOURCE=.\decoder.h
267 # End Source File
268 # Begin Source File
269
270 SOURCE=.\dither.h
271 # End Source File
272 # Begin Source File
273
274 SOURCE=.\drc.h
275 # End Source File
276 # Begin Source File
277
278 SOURCE=.\error.h
279 # End Source File
280 # Begin Source File
281
282 SOURCE=.\filtbank.h
283 # End Source File
284 # Begin Source File
285
286 SOURCE=.\codebook\hcb.h
287 # End Source File
288 # Begin Source File
289
290 SOURCE=.\huffman.h
291 # End Source File
292 # Begin Source File
293
294 SOURCE=.\ic_predict.h
295 # End Source File
296 # Begin Source File
297
298 SOURCE=.\is.h
299 # End Source File
300 # Begin Source File
301
302 SOURCE=.\kbd_win.h
303 # End Source File
304 # Begin Source File
305
306 SOURCE=.\lt_predict.h
307 # End Source File
308 # Begin Source File
309
310 SOURCE=.\mdct.h
311 # End Source File
312 # Begin Source File
313
314 SOURCE=.\mp4.h
315 # End Source File
316 # Begin Source File
317
318 SOURCE=.\ms.h
319 # End Source File
320 # Begin Source File
321
322 SOURCE=.\output.h
323 # End Source File
324 # Begin Source File
325
326 SOURCE=.\pns.h
327 # End Source File
328 # Begin Source File
329
330 SOURCE=.\pulse.h
331 # End Source File
332 # Begin Source File
333
334 SOURCE=.\rvlc.h
335 # End Source File
336 # Begin Source File
337
338 SOURCE=.\specrec.h
339 # End Source File
340 # Begin Source File
341
342 SOURCE=.\ssr.h
343 # End Source File
344 # Begin Source File
345
346 SOURCE=.\syntax.h
347 # End Source File
348 # Begin Source File
349
350 SOURCE=.\Tns.h
351 # End Source File
352 # End Group
353 # Begin Source File
354
355 SOURCE=.\libfaad2.def
356 # End Source File
357 # End Target
358 # End Project
0 Microsoft Developer Studio Workspace File, Format Version 6.00
1 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
2
3 ###############################################################################
4
5 Project: "libfaad2_dll"=.\libfaad2_dll.dsp - Package Owner=<4>
6
7 Package=<5>
8 {{{
9 }}}
10
11 Package=<4>
12 {{{
13 }}}
14
15 ###############################################################################
16
17 Global:
18
19 Package=<5>
20 {{{
21 }}}
22
23 Package=<3>
24 {{{
25 }}}
26
27 ###############################################################################
28
0 Microsoft Visual Studio Solution File, Format Version 7.00
1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad2_dll", "libfaad2_dll.vcproj", "{482DA264-EE88-4575-B208-87C4CB80CD08}"
2 EndProject
3 Global
4 GlobalSection(SolutionConfiguration) = preSolution
5 ConfigName.0 = Debug
6 ConfigName.1 = Release
7 EndGlobalSection
8 GlobalSection(ProjectDependencies) = postSolution
9 EndGlobalSection
10 GlobalSection(ProjectConfiguration) = postSolution
11 {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug.ActiveCfg = Debug|Win32
12 {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug.Build.0 = Debug|Win32
13 {482DA264-EE88-4575-B208-87C4CB80CD08}.Release.ActiveCfg = Release|Win32
14 {482DA264-EE88-4575-B208-87C4CB80CD08}.Release.Build.0 = Release|Win32
15 EndGlobalSection
16 GlobalSection(ExtensibilityGlobals) = postSolution
17 EndGlobalSection
18 GlobalSection(ExtensibilityAddIns) = postSolution
19 EndGlobalSection
20 EndGlobal
0 <?xml version="1.0" encoding = "Windows-1252"?>
1 <VisualStudioProject
2 ProjectType="Visual C++"
3 Version="7.00"
4 Name="libfaad2_dll"
5 SccProjectName=""
6 SccLocalPath="">
7 <Platforms>
8 <Platform
9 Name="Win32"/>
10 </Platforms>
11 <Configurations>
12 <Configuration
13 Name="Debug|Win32"
14 OutputDirectory=".\DebugDLL"
15 IntermediateDirectory=".\DebugDLL"
16 ConfigurationType="2"
17 UseOfMFC="0"
18 ATLMinimizesCRunTimeLibraryUsage="FALSE"
19 CharacterSet="2">
20 <Tool
21 Name="VCCLCompilerTool"
22 Optimization="0"
23 AdditionalIncludeDirectories="fftw"
24 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;libfaad2_dll_EXPORTS"
25 BasicRuntimeChecks="3"
26 RuntimeLibrary="3"
27 UsePrecompiledHeader="2"
28 PrecompiledHeaderFile=".\DebugDLL/libfaad2_dll.pch"
29 AssemblerListingLocation=".\DebugDLL/"
30 ObjectFile=".\DebugDLL/"
31 ProgramDataBaseFileName=".\DebugDLL/"
32 WarningLevel="3"
33 SuppressStartupBanner="TRUE"
34 DebugInformationFormat="4"
35 CompileAs="0"
36 AdditionalOptions="">
37 <IntelOptions
38 Optimization="0"
39 MinimalRebuild="1"
40 BasicRuntimeChecks="3"
41 RuntimeLibrary="3"
42 AllOptions="/c /I &quot;fftw&quot; /ZI /nologo /W3 /Od /D &quot;WIN32&quot; /D &quot;_DEBUG&quot; /D &quot;_WINDOWS&quot; /D &quot;_USRDLL&quot; /D &quot;libfaad2_dll_EXPORTS&quot; /D &quot;_WINDLL&quot; /D &quot;_MBCS&quot; /Gm /EHsc /RTC1 /MDd /YX&quot;StdAfx.h&quot; /Fp&quot;.\DebugDLL/libfaad2_dll.pch&quot; /Fo&quot;.\DebugDLL/&quot; /Fd&quot;.\DebugDLL/&quot; /Gd"
43 MSOriginalAdditionalOptions=""/>
44 </Tool>
45 <Tool
46 Name="VCCustomBuildTool"/>
47 <Tool
48 Name="VCLinkerTool"
49 AdditionalOptions="/MACHINE:I386"
50 AdditionalDependencies="odbc32.lib odbccp32.lib"
51 OutputFile="DebugDLL/libfaad2.dll"
52 LinkIncremental="2"
53 SuppressStartupBanner="TRUE"
54 ModuleDefinitionFile=".\libfaad2.def"
55 GenerateDebugInformation="TRUE"
56 ProgramDatabaseFile=".\DebugDLL/libfaad2.pdb"
57 ImportLibrary=".\DebugDLL/libfaad2.lib">
58 <IntelOptions
59 AllOptions="/NOLOGO /DLL /OUT:&quot;DebugDLL/libfaad2.dll&quot; /INCREMENTAL odbc32.lib odbccp32.lib /DEF:&quot;.\libfaad2.def&quot; /DEBUG /PDB:&quot;.\DebugDLL/libfaad2.pdb&quot; /TLBID:1 /IMPLIB:&quot;.\DebugDLL/libfaad2.lib&quot; /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
60 MSOriginalAdditionalOptions="/MACHINE:I386"/>
61 </Tool>
62 <Tool
63 Name="VCMIDLTool"
64 PreprocessorDefinitions="_DEBUG"
65 MkTypLibCompatible="TRUE"
66 SuppressStartupBanner="TRUE"
67 TargetEnvironment="1"
68 TypeLibraryName=".\DebugDLL/libfaad2_dll.tlb"/>
69 <Tool
70 Name="VCPostBuildEventTool"/>
71 <Tool
72 Name="VCPreBuildEventTool"/>
73 <Tool
74 Name="VCPreLinkEventTool"/>
75 <Tool
76 Name="VCResourceCompilerTool"
77 PreprocessorDefinitions="_DEBUG"
78 Culture="1031"/>
79 <Tool
80 Name="VCWebServiceProxyGeneratorTool"/>
81 <Tool
82 Name="VCWebDeploymentTool"/>
83 </Configuration>
84 <Configuration
85 Name="Release|Win32"
86 OutputDirectory=".\ReleaseDLL"
87 IntermediateDirectory=".\ReleaseDLL"
88 ConfigurationType="2"
89 UseOfMFC="0"
90 ATLMinimizesCRunTimeLibraryUsage="FALSE"
91 CharacterSet="2">
92 <Tool
93 Name="VCCLCompilerTool"
94 GlobalOptimizations="TRUE"
95 InlineFunctionExpansion="1"
96 EnableIntrinsicFunctions="TRUE"
97 FavorSizeOrSpeed="1"
98 OptimizeForProcessor="2"
99 AdditionalIncludeDirectories=""
100 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;libfaad2_dll_EXPORTS"
101 StringPooling="TRUE"
102 RuntimeLibrary="2"
103 EnableFunctionLevelLinking="TRUE"
104 UsePrecompiledHeader="2"
105 PrecompiledHeaderFile=".\ReleaseDLL/libfaad2_dll.pch"
106 AssemblerListingLocation=".\ReleaseDLL/"
107 ObjectFile=".\ReleaseDLL/"
108 ProgramDataBaseFileName=".\ReleaseDLL/"
109 WarningLevel="3"
110 SuppressStartupBanner="TRUE"
111 CompileAs="0"
112 AdditionalOptions="">
113 <IntelOptions
114 Optimization="2"
115 GlobalOptimizations="1"
116 InlineFuncExpansion="1"
117 OmitFramePtrs="1"
118 StringPooling="1"
119 RuntimeLibrary="2"
120 BufferSecurityCheck="1"
121 FunctionLevelLinking="1"
122 AllOptions="/c /nologo /W3 /O2 /Og /Ob1 /Oy /D &quot;WIN32&quot; /D &quot;NDEBUG&quot; /D &quot;_WINDOWS&quot; /D &quot;_USRDLL&quot; /D &quot;libfaad2_dll_EXPORTS&quot; /D &quot;_WINDLL&quot; /D &quot;_MBCS&quot; /GF /FD /EHsc /MD /GS /Gy /YX&quot;StdAfx.h&quot; /Fp&quot;.\ReleaseDLL/libfaad2_dll.pch&quot; /Fo&quot;.\ReleaseDLL/&quot; /Fd&quot;.\ReleaseDLL/&quot; /Gd"
123 MSOriginalAdditionalOptions=""/>
124 </Tool>
125 <Tool
126 Name="VCCustomBuildTool"/>
127 <Tool
128 Name="VCLinkerTool"
129 AdditionalOptions="/MACHINE:I386"
130 OutputFile="ReleaseDLL/libfaad2.dll"
131 LinkIncremental="1"
132 SuppressStartupBanner="TRUE"
133 ModuleDefinitionFile=".\libfaad2.def"
134 ProgramDatabaseFile=".\ReleaseDLL/libfaad2.pdb"
135 ImportLibrary=".\ReleaseDLL/libfaad2.lib">
136 <IntelOptions
137 AllOptions="/NOLOGO /DLL /OUT:&quot;ReleaseDLL/libfaad2.dll&quot; /INCREMENTAL:NO /DEF:&quot;.\libfaad2.def&quot; /PDB:&quot;.\ReleaseDLL/libfaad2.pdb&quot; /TLBID:1 /IMPLIB:&quot;.\ReleaseDLL/libfaad2.lib&quot; /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
138 MSOriginalAdditionalOptions="/MACHINE:I386"/>
139 </Tool>
140 <Tool
141 Name="VCMIDLTool"
142 PreprocessorDefinitions="NDEBUG"
143 MkTypLibCompatible="TRUE"
144 SuppressStartupBanner="TRUE"
145 TargetEnvironment="1"
146 TypeLibraryName=".\ReleaseDLL/libfaad2_dll.tlb"/>
147 <Tool
148 Name="VCPostBuildEventTool"/>
149 <Tool
150 Name="VCPreBuildEventTool"/>
151 <Tool
152 Name="VCPreLinkEventTool"/>
153 <Tool
154 Name="VCResourceCompilerTool"
155 PreprocessorDefinitions="NDEBUG"
156 Culture="1031"/>
157 <Tool
158 Name="VCWebServiceProxyGeneratorTool"/>
159 <Tool
160 Name="VCWebDeploymentTool"/>
161 </Configuration>
162 </Configurations>
163 <Files>
164 <Filter
165 Name="Source Files"
166 Filter="">
167 <File
168 RelativePath=".\bits.c"/>
169 <File
170 RelativePath=".\cfft.c"/>
171 <File
172 RelativePath="common.c"/>
173 <File
174 RelativePath=".\data.c"/>
175 <File
176 RelativePath=".\decoder.c"/>
177 <File
178 RelativePath="dither.c"/>
179 <File
180 RelativePath=".\drc.c"/>
181 <File
182 RelativePath=".\error.c"/>
183 <File
184 RelativePath=".\filtbank.c"/>
185 <File
186 RelativePath="hcr.c"/>
187 <File
188 RelativePath=".\ic_predict.c"/>
189 <File
190 RelativePath=".\is.c"/>
191 <File
192 RelativePath=".\lt_predict.c"/>
193 <File
194 RelativePath=".\mdct.c"/>
195 <File
196 RelativePath=".\mp4.c"/>
197 <File
198 RelativePath=".\ms.c"/>
199 <File
200 RelativePath=".\output.c"/>
201 <File
202 RelativePath=".\pns.c"/>
203 <File
204 RelativePath=".\pulse.c"/>
205 <File
206 RelativePath="rvlc.c"/>
207 <File
208 RelativePath=".\specrec.c"/>
209 <File
210 RelativePath="ssr.c"/>
211 <File
212 RelativePath=".\syntax.c"/>
213 <File
214 RelativePath=".\tns.c"/>
215 <Filter
216 Name="codebook"
217 Filter="">
218 <File
219 RelativePath=".\codebook\hcb_1.c"/>
220 <File
221 RelativePath=".\codebook\hcb_10.c"/>
222 <File
223 RelativePath=".\codebook\hcb_11.c"/>
224 <File
225 RelativePath=".\codebook\hcb_2.c"/>
226 <File
227 RelativePath=".\codebook\hcb_3.c"/>
228 <File
229 RelativePath=".\codebook\hcb_4.c"/>
230 <File
231 RelativePath=".\codebook\hcb_5.c"/>
232 <File
233 RelativePath=".\codebook\hcb_6.c"/>
234 <File
235 RelativePath=".\codebook\hcb_7.c"/>
236 <File
237 RelativePath=".\codebook\hcb_8.c"/>
238 <File
239 RelativePath=".\codebook\hcb_9.c"/>
240 <File
241 RelativePath=".\codebook\hcb_sf.c"/>
242 </Filter>
243 </Filter>
244 <Filter
245 Name="Header Files"
246 Filter="">
247 <File
248 RelativePath=".\Tns.h"/>
249 <File
250 RelativePath=".\analysis.h"/>
251 <File
252 RelativePath=".\bits.h"/>
253 <File
254 RelativePath=".\cfft.h"/>
255 <File
256 RelativePath=".\common.h"/>
257 <File
258 RelativePath=".\data.h"/>
259 <File
260 RelativePath=".\decoder.h"/>
261 <File
262 RelativePath="dither.h"/>
263 <File
264 RelativePath=".\drc.h"/>
265 <File
266 RelativePath=".\error.h"/>
267 <File
268 RelativePath=".\filtbank.h"/>
269 <File
270 RelativePath=".\codebook\hcb.h"/>
271 <File
272 RelativePath=".\huffman.h"/>
273 <File
274 RelativePath=".\ic_predict.h"/>
275 <File
276 RelativePath=".\is.h"/>
277 <File
278 RelativePath=".\kbd_win.h"/>
279 <File
280 RelativePath=".\lt_predict.h"/>
281 <File
282 RelativePath=".\mdct.h"/>
283 <File
284 RelativePath=".\mp4.h"/>
285 <File
286 RelativePath=".\ms.h"/>
287 <File
288 RelativePath=".\output.h"/>
289 <File
290 RelativePath=".\pns.h"/>
291 <File
292 RelativePath=".\pulse.h"/>
293 <File
294 RelativePath="rvlc.h"/>
295 <File
296 RelativePath=".\specrec.h"/>
297 <File
298 RelativePath="ssr.h"/>
299 <File
300 RelativePath=".\syntax.h"/>
301 </Filter>
302 <File
303 RelativePath=".\libfaad2.def"/>
304 </Files>
305 <Globals/>
306 </VisualStudioProject>
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: lt_predict.c,v 1.27 2007/11/01 12:33:31 menno Exp $
28 **/
29
30
31 #include "common.h"
32 #include "structs.h"
33
34 #ifdef LTP_DEC
35
36 #include <stdlib.h>
37 #include "syntax.h"
38 #include "lt_predict.h"
39 #include "filtbank.h"
40 #include "tns.h"
41
42
43 /* static function declarations */
44 static int16_t real_to_int16(real_t sig_in);
45
46
47 /* check if the object type is an object type that can have LTP */
48 uint8_t is_ltp_ot(uint8_t object_type)
49 {
50 #ifdef LTP_DEC
51 if ((object_type == LTP)
52 #ifdef ERROR_RESILIENCE
53 || (object_type == ER_LTP)
54 #endif
55 #ifdef LD_DEC
56 || (object_type == LD)
57 #endif
58 )
59 {
60 return 1;
61 }
62 #endif
63
64 return 0;
65 }
66
67 ALIGN static const real_t codebook[8] =
68 {
69 REAL_CONST(0.570829),
70 REAL_CONST(0.696616),
71 REAL_CONST(0.813004),
72 REAL_CONST(0.911304),
73 REAL_CONST(0.984900),
74 REAL_CONST(1.067894),
75 REAL_CONST(1.194601),
76 REAL_CONST(1.369533)
77 };
78
79 void lt_prediction(ic_stream *ics, ltp_info *ltp, real_t *spec,
80 int16_t *lt_pred_stat, fb_info *fb, uint8_t win_shape,
81 uint8_t win_shape_prev, uint8_t sr_index,
82 uint8_t object_type, uint16_t frame_len)
83 {
84 uint8_t sfb;
85 uint16_t bin, i, num_samples;
86 ALIGN real_t x_est[2048];
87 ALIGN real_t X_est[2048];
88
89 if (ics->window_sequence != EIGHT_SHORT_SEQUENCE)
90 {
91 if (ltp->data_present)
92 {
93 num_samples = frame_len << 1;
94
95 for(i = 0; i < num_samples; i++)
96 {
97 /* The extra lookback M (N/2 for LD, 0 for LTP) is handled
98 in the buffer updating */
99
100 #if 0
101 x_est[i] = MUL_R_C(lt_pred_stat[num_samples + i - ltp->lag],
102 codebook[ltp->coef]);
103 #else
104 /* lt_pred_stat is a 16 bit int, multiplied with the fixed point real
105 this gives a real for x_est
106 */
107 x_est[i] = (real_t)lt_pred_stat[num_samples + i - ltp->lag] * codebook[ltp->coef];
108 #endif
109 }
110
111 filter_bank_ltp(fb, ics->window_sequence, win_shape, win_shape_prev,
112 x_est, X_est, object_type, frame_len);
113
114 tns_encode_frame(ics, &(ics->tns), sr_index, object_type, X_est,
115 frame_len);
116
117 for (sfb = 0; sfb < ltp->last_band; sfb++)
118 {
119 if (ltp->long_used[sfb])
120 {
121 uint16_t low = ics->swb_offset[sfb];
122 uint16_t high = min(ics->swb_offset[sfb+1], ics->swb_offset_max);
123
124 for (bin = low; bin < high; bin++)
125 {
126 spec[bin] += X_est[bin];
127 }
128 }
129 }
130 }
131 }
132 }
133
134 #ifdef FIXED_POINT
135 static INLINE int16_t real_to_int16(real_t sig_in)
136 {
137 if (sig_in >= 0)
138 {
139 sig_in += (1 << (REAL_BITS-1));
140 if (sig_in >= REAL_CONST(32768))
141 return 32767;
142 } else {
143 sig_in += -(1 << (REAL_BITS-1));
144 if (sig_in <= REAL_CONST(-32768))
145 return -32768;
146 }
147
148 return (sig_in >> REAL_BITS);
149 }
150 #else
151 static INLINE int16_t real_to_int16(real_t sig_in)
152 {
153 if (sig_in >= 0)
154 {
155 #ifndef HAS_LRINTF
156 sig_in += 0.5f;
157 #endif
158 if (sig_in >= 32768.0f)
159 return 32767;
160 } else {
161 #ifndef HAS_LRINTF
162 sig_in += -0.5f;
163 #endif
164 if (sig_in <= -32768.0f)
165 return -32768;
166 }
167
168 return lrintf(sig_in);
169 }
170 #endif
171
172 void lt_update_state(int16_t *lt_pred_stat, real_t *time, real_t *overlap,
173 uint16_t frame_len, uint8_t object_type)
174 {
175 uint16_t i;
176
177 /*
178 * The reference point for index i and the content of the buffer
179 * lt_pred_stat are arranged so that lt_pred_stat(0 ... N/2 - 1) contains the
180 * last aliased half window from the IMDCT, and lt_pred_stat(N/2 ... N-1)
181 * is always all zeros. The rest of lt_pred_stat (i<0) contains the previous
182 * fully reconstructed time domain samples, i.e., output of the decoder.
183 *
184 * These values are shifted up by N*2 to avoid (i<0)
185 *
186 * For the LD object type an extra 512 samples lookback is accomodated here.
187 */
188 #ifdef LD_DEC
189 if (object_type == LD)
190 {
191 for (i = 0; i < frame_len; i++)
192 {
193 lt_pred_stat[i] /* extra 512 */ = lt_pred_stat[i + frame_len];
194 lt_pred_stat[frame_len + i] = lt_pred_stat[i + (frame_len * 2)];
195 lt_pred_stat[(frame_len * 2) + i] = real_to_int16(time[i]);
196 lt_pred_stat[(frame_len * 3) + i] = real_to_int16(overlap[i]);
197 }
198 } else {
199 #endif
200 for (i = 0; i < frame_len; i++)
201 {
202 lt_pred_stat[i] = lt_pred_stat[i + frame_len];
203 lt_pred_stat[frame_len + i] = real_to_int16(time[i]);
204 lt_pred_stat[(frame_len * 2) + i] = real_to_int16(overlap[i]);
205 #if 0 /* set to zero once upon initialisation */
206 lt_pred_stat[(frame_len * 3) + i] = 0;
207 #endif
208 }
209 #ifdef LD_DEC
210 }
211 #endif
212 }
213
214 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: lt_predict.h,v 1.20 2007/11/01 12:33:31 menno Exp $
28 **/
29
30 #ifdef LTP_DEC
31
32 #ifndef __LT_PREDICT_H__
33 #define __LT_PREDICT_H__
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 #include "filtbank.h"
40
41 uint8_t is_ltp_ot(uint8_t object_type);
42
43 void lt_prediction(ic_stream *ics,
44 ltp_info *ltp,
45 real_t *spec,
46 int16_t *lt_pred_stat,
47 fb_info *fb,
48 uint8_t win_shape,
49 uint8_t win_shape_prev,
50 uint8_t sr_index,
51 uint8_t object_type,
52 uint16_t frame_len);
53
54 void lt_update_state(int16_t *lt_pred_stat,
55 real_t *time,
56 real_t *overlap,
57 uint16_t frame_len,
58 uint8_t object_type);
59
60 #ifdef __cplusplus
61 }
62 #endif
63 #endif
64
65 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: mdct.c,v 1.47 2007/11/01 12:33:31 menno Exp $
28 **/
29
30 /*
31 * Fast (I)MDCT Implementation using (I)FFT ((Inverse) Fast Fourier Transform)
32 * and consists of three steps: pre-(I)FFT complex multiplication, complex
33 * (I)FFT, post-(I)FFT complex multiplication,
34 *
35 * As described in:
36 * P. Duhamel, Y. Mahieux, and J.P. Petit, "A Fast Algorithm for the
37 * Implementation of Filter Banks Based on 'Time Domain Aliasing
38 * Cancellation’," IEEE Proc. on ICASSP‘91, 1991, pp. 2209-2212.
39 *
40 *
41 * As of April 6th 2002 completely rewritten.
42 * This (I)MDCT can now be used for any data size n, where n is divisible by 8.
43 *
44 */
45
46 #include "common.h"
47 #include "structs.h"
48
49 #include <stdlib.h>
50 #ifdef _WIN32_WCE
51 #define assert(x)
52 #else
53 #include <assert.h>
54 #endif
55
56 #include "cfft.h"
57 #include "mdct.h"
58 #include "mdct_tab.h"
59
60
61 mdct_info *faad_mdct_init(uint16_t N)
62 {
63 mdct_info *mdct = (mdct_info*)faad_malloc(sizeof(mdct_info));
64
65 assert(N % 8 == 0);
66
67 mdct->N = N;
68
69 /* NOTE: For "small framelengths" in FIXED_POINT the coefficients need to be
70 * scaled by sqrt("(nearest power of 2) > N" / N) */
71
72 /* RE(mdct->sincos[k]) = scale*(real_t)(cos(2.0*M_PI*(k+1./8.) / (real_t)N));
73 * IM(mdct->sincos[k]) = scale*(real_t)(sin(2.0*M_PI*(k+1./8.) / (real_t)N)); */
74 /* scale is 1 for fixed point, sqrt(N) for floating point */
75 switch (N)
76 {
77 case 2048: mdct->sincos = (complex_t*)mdct_tab_2048; break;
78 case 256: mdct->sincos = (complex_t*)mdct_tab_256; break;
79 #ifdef LD_DEC
80 case 1024: mdct->sincos = (complex_t*)mdct_tab_1024; break;
81 #endif
82 #ifdef ALLOW_SMALL_FRAMELENGTH
83 case 1920: mdct->sincos = (complex_t*)mdct_tab_1920; break;
84 case 240: mdct->sincos = (complex_t*)mdct_tab_240; break;
85 #ifdef LD_DEC
86 case 960: mdct->sincos = (complex_t*)mdct_tab_960; break;
87 #endif
88 #endif
89 #ifdef SSR_DEC
90 case 512: mdct->sincos = (complex_t*)mdct_tab_512; break;
91 case 64: mdct->sincos = (complex_t*)mdct_tab_64; break;
92 #endif
93 }
94
95 /* initialise fft */
96 mdct->cfft = cffti(N/4);
97
98 #ifdef PROFILE
99 mdct->cycles = 0;
100 mdct->fft_cycles = 0;
101 #endif
102
103 return mdct;
104 }
105
106 void faad_mdct_end(mdct_info *mdct)
107 {
108 if (mdct != NULL)
109 {
110 #ifdef PROFILE
111 printf("MDCT[%.4d]: %I64d cycles\n", mdct->N, mdct->cycles);
112 printf("CFFT[%.4d]: %I64d cycles\n", mdct->N/4, mdct->fft_cycles);
113 #endif
114
115 cfftu(mdct->cfft);
116
117 faad_free(mdct);
118 }
119 }
120
121 void faad_imdct(mdct_info *mdct, real_t *X_in, real_t *X_out)
122 {
123 uint16_t k;
124
125 complex_t x;
126 #ifdef ALLOW_SMALL_FRAMELENGTH
127 #ifdef FIXED_POINT
128 real_t scale, b_scale = 0;
129 #endif
130 #endif
131 ALIGN complex_t Z1[512];
132 complex_t *sincos = mdct->sincos;
133
134 uint16_t N = mdct->N;
135 uint16_t N2 = N >> 1;
136 uint16_t N4 = N >> 2;
137 uint16_t N8 = N >> 3;
138
139 #ifdef PROFILE
140 int64_t count1, count2 = faad_get_ts();
141 #endif
142
143 #ifdef ALLOW_SMALL_FRAMELENGTH
144 #ifdef FIXED_POINT
145 /* detect non-power of 2 */
146 if (N & (N-1))
147 {
148 /* adjust scale for non-power of 2 MDCT */
149 /* 2048/1920 */
150 b_scale = 1;
151 scale = COEF_CONST(1.0666666666666667);
152 }
153 #endif
154 #endif
155
156 /* pre-IFFT complex multiplication */
157 for (k = 0; k < N4; k++)
158 {
159 ComplexMult(&IM(Z1[k]), &RE(Z1[k]),
160 X_in[2*k], X_in[N2 - 1 - 2*k], RE(sincos[k]), IM(sincos[k]));
161 }
162
163 #ifdef PROFILE
164 count1 = faad_get_ts();
165 #endif
166
167 /* complex IFFT, any non-scaling FFT can be used here */
168 cfftb(mdct->cfft, Z1);
169
170 #ifdef PROFILE
171 count1 = faad_get_ts() - count1;
172 #endif
173
174 /* post-IFFT complex multiplication */
175 for (k = 0; k < N4; k++)
176 {
177 RE(x) = RE(Z1[k]);
178 IM(x) = IM(Z1[k]);
179 ComplexMult(&IM(Z1[k]), &RE(Z1[k]),
180 IM(x), RE(x), RE(sincos[k]), IM(sincos[k]));
181
182 #ifdef ALLOW_SMALL_FRAMELENGTH
183 #ifdef FIXED_POINT
184 /* non-power of 2 MDCT scaling */
185 if (b_scale)
186 {
187 RE(Z1[k]) = MUL_C(RE(Z1[k]), scale);
188 IM(Z1[k]) = MUL_C(IM(Z1[k]), scale);
189 }
190 #endif
191 #endif
192 }
193
194 /* reordering */
195 for (k = 0; k < N8; k+=2)
196 {
197 X_out[ 2*k] = IM(Z1[N8 + k]);
198 X_out[ 2 + 2*k] = IM(Z1[N8 + 1 + k]);
199
200 X_out[ 1 + 2*k] = -RE(Z1[N8 - 1 - k]);
201 X_out[ 3 + 2*k] = -RE(Z1[N8 - 2 - k]);
202
203 X_out[N4 + 2*k] = RE(Z1[ k]);
204 X_out[N4 + + 2 + 2*k] = RE(Z1[ 1 + k]);
205
206 X_out[N4 + 1 + 2*k] = -IM(Z1[N4 - 1 - k]);
207 X_out[N4 + 3 + 2*k] = -IM(Z1[N4 - 2 - k]);
208
209 X_out[N2 + 2*k] = RE(Z1[N8 + k]);
210 X_out[N2 + + 2 + 2*k] = RE(Z1[N8 + 1 + k]);
211
212 X_out[N2 + 1 + 2*k] = -IM(Z1[N8 - 1 - k]);
213 X_out[N2 + 3 + 2*k] = -IM(Z1[N8 - 2 - k]);
214
215 X_out[N2 + N4 + 2*k] = -IM(Z1[ k]);
216 X_out[N2 + N4 + 2 + 2*k] = -IM(Z1[ 1 + k]);
217
218 X_out[N2 + N4 + 1 + 2*k] = RE(Z1[N4 - 1 - k]);
219 X_out[N2 + N4 + 3 + 2*k] = RE(Z1[N4 - 2 - k]);
220 }
221
222 #ifdef PROFILE
223 count2 = faad_get_ts() - count2;
224 mdct->fft_cycles += count1;
225 mdct->cycles += (count2 - count1);
226 #endif
227 }
228
229 #ifdef LTP_DEC
230 void faad_mdct(mdct_info *mdct, real_t *X_in, real_t *X_out)
231 {
232 uint16_t k;
233
234 complex_t x;
235 ALIGN complex_t Z1[512];
236 complex_t *sincos = mdct->sincos;
237
238 uint16_t N = mdct->N;
239 uint16_t N2 = N >> 1;
240 uint16_t N4 = N >> 2;
241 uint16_t N8 = N >> 3;
242
243 #ifndef FIXED_POINT
244 real_t scale = REAL_CONST(N);
245 #else
246 real_t scale = REAL_CONST(4.0/N);
247 #endif
248
249 #ifdef ALLOW_SMALL_FRAMELENGTH
250 #ifdef FIXED_POINT
251 /* detect non-power of 2 */
252 if (N & (N-1))
253 {
254 /* adjust scale for non-power of 2 MDCT */
255 /* *= sqrt(2048/1920) */
256 scale = MUL_C(scale, COEF_CONST(1.0327955589886444));
257 }
258 #endif
259 #endif
260
261 /* pre-FFT complex multiplication */
262 for (k = 0; k < N8; k++)
263 {
264 uint16_t n = k << 1;
265 RE(x) = X_in[N - N4 - 1 - n] + X_in[N - N4 + n];
266 IM(x) = X_in[ N4 + n] - X_in[ N4 - 1 - n];
267
268 ComplexMult(&RE(Z1[k]), &IM(Z1[k]),
269 RE(x), IM(x), RE(sincos[k]), IM(sincos[k]));
270
271 RE(Z1[k]) = MUL_R(RE(Z1[k]), scale);
272 IM(Z1[k]) = MUL_R(IM(Z1[k]), scale);
273
274 RE(x) = X_in[N2 - 1 - n] - X_in[ n];
275 IM(x) = X_in[N2 + n] + X_in[N - 1 - n];
276
277 ComplexMult(&RE(Z1[k + N8]), &IM(Z1[k + N8]),
278 RE(x), IM(x), RE(sincos[k + N8]), IM(sincos[k + N8]));
279
280 RE(Z1[k + N8]) = MUL_R(RE(Z1[k + N8]), scale);
281 IM(Z1[k + N8]) = MUL_R(IM(Z1[k + N8]), scale);
282 }
283
284 /* complex FFT, any non-scaling FFT can be used here */
285 cfftf(mdct->cfft, Z1);
286
287 /* post-FFT complex multiplication */
288 for (k = 0; k < N4; k++)
289 {
290 uint16_t n = k << 1;
291 ComplexMult(&RE(x), &IM(x),
292 RE(Z1[k]), IM(Z1[k]), RE(sincos[k]), IM(sincos[k]));
293
294 X_out[ n] = -RE(x);
295 X_out[N2 - 1 - n] = IM(x);
296 X_out[N2 + n] = -IM(x);
297 X_out[N - 1 - n] = RE(x);
298 }
299 }
300 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: mdct.h,v 1.30 2007/11/01 12:33:31 menno Exp $
28 **/
29
30 #ifndef __MDCT_H__
31 #define __MDCT_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37
38 mdct_info *faad_mdct_init(uint16_t N);
39 void faad_mdct_end(mdct_info *mdct);
40 void faad_imdct(mdct_info *mdct, real_t *X_in, real_t *X_out);
41 void faad_mdct(mdct_info *mdct, real_t *X_in, real_t *X_out);
42
43
44 #ifdef __cplusplus
45 }
46 #endif
47 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: mdct_tab.h,v 1.7 2007/11/01 12:33:32 menno Exp $
28 **/
29
30 #ifndef __MDCT_TAB_H__
31 #define __MDCT_TAB_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #ifdef FIXED_POINT
38
39 /* 256 (N/4) complex twiddle factors */
40 ALIGN static const complex_t mdct_tab_2048[] =
41 {
42 { FRAC_CONST(0.999999926465718), FRAC_CONST(0.000383495187571) },
43 { FRAC_CONST(0.999994043728986), FRAC_CONST(0.003451449920136) },
44 { FRAC_CONST(0.999978748667469), FRAC_CONST(0.006519372166339) },
45 { FRAC_CONST(0.999954041425130), FRAC_CONST(0.009587233049729) },
46 { FRAC_CONST(0.999919922234523), FRAC_CONST(0.012655003694430) },
47 { FRAC_CONST(0.999876391416790), FRAC_CONST(0.015722655225417) },
48 { FRAC_CONST(0.999823449381662), FRAC_CONST(0.018790158768785) },
49 { FRAC_CONST(0.999761096627447), FRAC_CONST(0.021857485452022) },
50 { FRAC_CONST(0.999689333741034), FRAC_CONST(0.024924606404281) },
51 { FRAC_CONST(0.999608161397882), FRAC_CONST(0.027991492756653) },
52 { FRAC_CONST(0.999517580362017), FRAC_CONST(0.031058115642435) },
53 { FRAC_CONST(0.999417591486022), FRAC_CONST(0.034124446197403) },
54 { FRAC_CONST(0.999308195711029), FRAC_CONST(0.037190455560088) },
55 { FRAC_CONST(0.999189394066715), FRAC_CONST(0.040256114872041) },
56 { FRAC_CONST(0.999061187671285), FRAC_CONST(0.043321395278110) },
57 { FRAC_CONST(0.998923577731466), FRAC_CONST(0.046386267926707) },
58 { FRAC_CONST(0.998776565542496), FRAC_CONST(0.049450703970085) },
59 { FRAC_CONST(0.998620152488109), FRAC_CONST(0.052514674564603) },
60 { FRAC_CONST(0.998454340040525), FRAC_CONST(0.055578150871005) },
61 { FRAC_CONST(0.998279129760433), FRAC_CONST(0.058641104054683) },
62 { FRAC_CONST(0.998094523296980), FRAC_CONST(0.061703505285957) },
63 { FRAC_CONST(0.997900522387752), FRAC_CONST(0.064765325740340) },
64 { FRAC_CONST(0.997697128858759), FRAC_CONST(0.067826536598811) },
65 { FRAC_CONST(0.997484344624418), FRAC_CONST(0.070887109048088) },
66 { FRAC_CONST(0.997262171687536), FRAC_CONST(0.073947014280897) },
67 { FRAC_CONST(0.997030612139289), FRAC_CONST(0.077006223496246) },
68 { FRAC_CONST(0.996789668159205), FRAC_CONST(0.080064707899691) },
69 { FRAC_CONST(0.996539342015138), FRAC_CONST(0.083122438703613) },
70 { FRAC_CONST(0.996279636063255), FRAC_CONST(0.086179387127485) },
71 { FRAC_CONST(0.996010552748006), FRAC_CONST(0.089235524398144) },
72 { FRAC_CONST(0.995732094602106), FRAC_CONST(0.092290821750062) },
73 { FRAC_CONST(0.995444264246510), FRAC_CONST(0.095345250425618) },
74 { FRAC_CONST(0.995147064390386), FRAC_CONST(0.098398781675364) },
75 { FRAC_CONST(0.994840497831093), FRAC_CONST(0.101451386758302) },
76 { FRAC_CONST(0.994524567454152), FRAC_CONST(0.104503036942151) },
77 { FRAC_CONST(0.994199276233219), FRAC_CONST(0.107553703503616) },
78 { FRAC_CONST(0.993864627230060), FRAC_CONST(0.110603357728662) },
79 { FRAC_CONST(0.993520623594518), FRAC_CONST(0.113651970912782) },
80 { FRAC_CONST(0.993167268564487), FRAC_CONST(0.116699514361268) },
81 { FRAC_CONST(0.992804565465879), FRAC_CONST(0.119745959389480) },
82 { FRAC_CONST(0.992432517712594), FRAC_CONST(0.122791277323117) },
83 { FRAC_CONST(0.992051128806486), FRAC_CONST(0.125835439498487) },
84 { FRAC_CONST(0.991660402337333), FRAC_CONST(0.128878417262777) },
85 { FRAC_CONST(0.991260341982802), FRAC_CONST(0.131920181974320) },
86 { FRAC_CONST(0.990850951508414), FRAC_CONST(0.134960705002869) },
87 { FRAC_CONST(0.990432234767506), FRAC_CONST(0.137999957729863) },
88 { FRAC_CONST(0.990004195701201), FRAC_CONST(0.141037911548698) },
89 { FRAC_CONST(0.989566838338365), FRAC_CONST(0.144074537864995) },
90 { FRAC_CONST(0.989120166795573), FRAC_CONST(0.147109808096872) },
91 { FRAC_CONST(0.988664185277066), FRAC_CONST(0.150143693675208) },
92 { FRAC_CONST(0.988198898074718), FRAC_CONST(0.153176166043918) },
93 { FRAC_CONST(0.987724309567987), FRAC_CONST(0.156207196660216) },
94 { FRAC_CONST(0.987240424223882), FRAC_CONST(0.159236756994888) },
95 { FRAC_CONST(0.986747246596917), FRAC_CONST(0.162264818532558) },
96 { FRAC_CONST(0.986244781329065), FRAC_CONST(0.165291352771958) },
97 { FRAC_CONST(0.985733033149723), FRAC_CONST(0.168316331226195) },
98 { FRAC_CONST(0.985212006875659), FRAC_CONST(0.171339725423019) },
99 { FRAC_CONST(0.984681707410971), FRAC_CONST(0.174361506905094) },
100 { FRAC_CONST(0.984142139747039), FRAC_CONST(0.177381647230260) },
101 { FRAC_CONST(0.983593308962479), FRAC_CONST(0.180400117971807) },
102 { FRAC_CONST(0.983035220223096), FRAC_CONST(0.183416890718739) },
103 { FRAC_CONST(0.982467878781833), FRAC_CONST(0.186431937076042) },
104 { FRAC_CONST(0.981891289978725), FRAC_CONST(0.189445228664950) },
105 { FRAC_CONST(0.981305459240845), FRAC_CONST(0.192456737123217) },
106 { FRAC_CONST(0.980710392082254), FRAC_CONST(0.195466434105377) },
107 { FRAC_CONST(0.980106094103952), FRAC_CONST(0.198474291283016) },
108 { FRAC_CONST(0.979492570993821), FRAC_CONST(0.201480280345038) },
109 { FRAC_CONST(0.978869828526574), FRAC_CONST(0.204484372997927) },
110 { FRAC_CONST(0.978237872563701), FRAC_CONST(0.207486540966021) },
111 { FRAC_CONST(0.977596709053412), FRAC_CONST(0.210486755991770) },
112 { FRAC_CONST(0.976946344030582), FRAC_CONST(0.213484989836008) },
113 { FRAC_CONST(0.976286783616694), FRAC_CONST(0.216481214278217) },
114 { FRAC_CONST(0.975618034019782), FRAC_CONST(0.219475401116790) },
115 { FRAC_CONST(0.974940101534372), FRAC_CONST(0.222467522169302) },
116 { FRAC_CONST(0.974252992541423), FRAC_CONST(0.225457549272769) },
117 { FRAC_CONST(0.973556713508266), FRAC_CONST(0.228445454283916) },
118 { FRAC_CONST(0.972851270988544), FRAC_CONST(0.231431209079446) },
119 { FRAC_CONST(0.972136671622152), FRAC_CONST(0.234414785556295) },
120 { FRAC_CONST(0.971412922135171), FRAC_CONST(0.237396155631907) },
121 { FRAC_CONST(0.970680029339806), FRAC_CONST(0.240375291244489) },
122 { FRAC_CONST(0.969938000134324), FRAC_CONST(0.243352164353285) },
123 { FRAC_CONST(0.969186841502986), FRAC_CONST(0.246326746938829) },
124 { FRAC_CONST(0.968426560515983), FRAC_CONST(0.249299011003218) },
125 { FRAC_CONST(0.967657164329370), FRAC_CONST(0.252268928570371) },
126 { FRAC_CONST(0.966878660184996), FRAC_CONST(0.255236471686292) },
127 { FRAC_CONST(0.966091055410439), FRAC_CONST(0.258201612419335) },
128 { FRAC_CONST(0.965294357418935), FRAC_CONST(0.261164322860466) },
129 { FRAC_CONST(0.964488573709308), FRAC_CONST(0.264124575123528) },
130 { FRAC_CONST(0.963673711865903), FRAC_CONST(0.267082341345496) },
131 { FRAC_CONST(0.962849779558509), FRAC_CONST(0.270037593686751) },
132 { FRAC_CONST(0.962016784542291), FRAC_CONST(0.272990304331330) },
133 { FRAC_CONST(0.961174734657714), FRAC_CONST(0.275940445487197) },
134 { FRAC_CONST(0.960323637830474), FRAC_CONST(0.278887989386500) },
135 { FRAC_CONST(0.959463502071418), FRAC_CONST(0.281832908285833) },
136 { FRAC_CONST(0.958594335476470), FRAC_CONST(0.284775174466498) },
137 { FRAC_CONST(0.957716146226559), FRAC_CONST(0.287714760234765) },
138 { FRAC_CONST(0.956828942587535), FRAC_CONST(0.290651637922133) },
139 { FRAC_CONST(0.955932732910098), FRAC_CONST(0.293585779885591) },
140 { FRAC_CONST(0.955027525629714), FRAC_CONST(0.296517158507877) },
141 { FRAC_CONST(0.954113329266539), FRAC_CONST(0.299445746197740) },
142 { FRAC_CONST(0.953190152425337), FRAC_CONST(0.302371515390196) },
143 { FRAC_CONST(0.952258003795400), FRAC_CONST(0.305294438546792) },
144 { FRAC_CONST(0.951316892150466), FRAC_CONST(0.308214488155861) },
145 { FRAC_CONST(0.950366826348636), FRAC_CONST(0.311131636732785) },
146 { FRAC_CONST(0.949407815332292), FRAC_CONST(0.314045856820251) },
147 { FRAC_CONST(0.948439868128010), FRAC_CONST(0.316957120988508) },
148 { FRAC_CONST(0.947462993846478), FRAC_CONST(0.319865401835631) },
149 { FRAC_CONST(0.946477201682409), FRAC_CONST(0.322770671987771) },
150 { FRAC_CONST(0.945482500914454), FRAC_CONST(0.325672904099420) },
151 { FRAC_CONST(0.944478900905116), FRAC_CONST(0.328572070853664) },
152 { FRAC_CONST(0.943466411100659), FRAC_CONST(0.331468144962441) },
153 { FRAC_CONST(0.942445041031025), FRAC_CONST(0.334361099166799) },
154 { FRAC_CONST(0.941414800309736), FRAC_CONST(0.337250906237151) },
155 { FRAC_CONST(0.940375698633812), FRAC_CONST(0.340137538973532) },
156 { FRAC_CONST(0.939327745783671), FRAC_CONST(0.343020970205856) },
157 { FRAC_CONST(0.938270951623047), FRAC_CONST(0.345901172794169) },
158 { FRAC_CONST(0.937205326098888), FRAC_CONST(0.348778119628908) },
159 { FRAC_CONST(0.936130879241267), FRAC_CONST(0.351651783631155) },
160 { FRAC_CONST(0.935047621163287), FRAC_CONST(0.354522137752887) },
161 { FRAC_CONST(0.933955562060987), FRAC_CONST(0.357389154977241) },
162 { FRAC_CONST(0.932854712213241), FRAC_CONST(0.360252808318757) },
163 { FRAC_CONST(0.931745081981669), FRAC_CONST(0.363113070823639) },
164 { FRAC_CONST(0.930626681810532), FRAC_CONST(0.365969915570009) },
165 { FRAC_CONST(0.929499522226639), FRAC_CONST(0.368823315668154) },
166 { FRAC_CONST(0.928363613839244), FRAC_CONST(0.371673244260787) },
167 { FRAC_CONST(0.927218967339952), FRAC_CONST(0.374519674523293) },
168 { FRAC_CONST(0.926065593502609), FRAC_CONST(0.377362579663988) },
169 { FRAC_CONST(0.924903503183211), FRAC_CONST(0.380201932924366) },
170 { FRAC_CONST(0.923732707319793), FRAC_CONST(0.383037707579352) },
171 { FRAC_CONST(0.922553216932333), FRAC_CONST(0.385869876937555) },
172 { FRAC_CONST(0.921365043122642), FRAC_CONST(0.388698414341519) },
173 { FRAC_CONST(0.920168197074266), FRAC_CONST(0.391523293167972) },
174 { FRAC_CONST(0.918962690052376), FRAC_CONST(0.394344486828080) },
175 { FRAC_CONST(0.917748533403661), FRAC_CONST(0.397161968767692) },
176 { FRAC_CONST(0.916525738556228), FRAC_CONST(0.399975712467595) },
177 { FRAC_CONST(0.915294317019487), FRAC_CONST(0.402785691443764) },
178 { FRAC_CONST(0.914054280384047), FRAC_CONST(0.405591879247604) },
179 { FRAC_CONST(0.912805640321604), FRAC_CONST(0.408394249466208) },
180 { FRAC_CONST(0.911548408584834), FRAC_CONST(0.411192775722600) },
181 { FRAC_CONST(0.910282597007282), FRAC_CONST(0.413987431675985) },
182 { FRAC_CONST(0.909008217503247), FRAC_CONST(0.416778191021998) },
183 { FRAC_CONST(0.907725282067676), FRAC_CONST(0.419565027492947) },
184 { FRAC_CONST(0.906433802776045), FRAC_CONST(0.422347914858067) },
185 { FRAC_CONST(0.905133791784250), FRAC_CONST(0.425126826923762) },
186 { FRAC_CONST(0.903825261328488), FRAC_CONST(0.427901737533854) },
187 { FRAC_CONST(0.902508223725146), FRAC_CONST(0.430672620569827) },
188 { FRAC_CONST(0.901182691370685), FRAC_CONST(0.433439449951074) },
189 { FRAC_CONST(0.899848676741519), FRAC_CONST(0.436202199635144) },
190 { FRAC_CONST(0.898506192393902), FRAC_CONST(0.438960843617984) },
191 { FRAC_CONST(0.897155250963809), FRAC_CONST(0.441715355934187) },
192 { FRAC_CONST(0.895795865166814), FRAC_CONST(0.444465710657234) },
193 { FRAC_CONST(0.894428047797974), FRAC_CONST(0.447211881899738) },
194 { FRAC_CONST(0.893051811731707), FRAC_CONST(0.449953843813691) },
195 { FRAC_CONST(0.891667169921672), FRAC_CONST(0.452691570590701) },
196 { FRAC_CONST(0.890274135400645), FRAC_CONST(0.455425036462242) },
197 { FRAC_CONST(0.888872721280396), FRAC_CONST(0.458154215699893) },
198 { FRAC_CONST(0.887462940751569), FRAC_CONST(0.460879082615579) },
199 { FRAC_CONST(0.886044807083556), FRAC_CONST(0.463599611561814) },
200 { FRAC_CONST(0.884618333624370), FRAC_CONST(0.466315776931944) },
201 { FRAC_CONST(0.883183533800523), FRAC_CONST(0.469027553160387) },
202 { FRAC_CONST(0.881740421116898), FRAC_CONST(0.471734914722871) },
203 { FRAC_CONST(0.880289009156621), FRAC_CONST(0.474437836136679) },
204 { FRAC_CONST(0.878829311580933), FRAC_CONST(0.477136291960885) },
205 { FRAC_CONST(0.877361342129065), FRAC_CONST(0.479830256796594) },
206 { FRAC_CONST(0.875885114618104), FRAC_CONST(0.482519705287184) },
207 { FRAC_CONST(0.874400642942865), FRAC_CONST(0.485204612118542) },
208 { FRAC_CONST(0.872907941075761), FRAC_CONST(0.487884952019301) },
209 { FRAC_CONST(0.871407023066671), FRAC_CONST(0.490560699761082) },
210 { FRAC_CONST(0.869897903042806), FRAC_CONST(0.493231830158728) },
211 { FRAC_CONST(0.868380595208580), FRAC_CONST(0.495898318070542) },
212 { FRAC_CONST(0.866855113845470), FRAC_CONST(0.498560138398525) },
213 { FRAC_CONST(0.865321473311890), FRAC_CONST(0.501217266088610) },
214 { FRAC_CONST(0.863779688043047), FRAC_CONST(0.503869676130899) },
215 { FRAC_CONST(0.862229772550811), FRAC_CONST(0.506517343559899) },
216 { FRAC_CONST(0.860671741423578), FRAC_CONST(0.509160243454755) },
217 { FRAC_CONST(0.859105609326130), FRAC_CONST(0.511798350939487) },
218 { FRAC_CONST(0.857531390999499), FRAC_CONST(0.514431641183223) },
219 { FRAC_CONST(0.855949101260827), FRAC_CONST(0.517060089400432) },
220 { FRAC_CONST(0.854358755003227), FRAC_CONST(0.519683670851158) },
221 { FRAC_CONST(0.852760367195645), FRAC_CONST(0.522302360841255) },
222 { FRAC_CONST(0.851153952882715), FRAC_CONST(0.524916134722613) },
223 { FRAC_CONST(0.849539527184621), FRAC_CONST(0.527524967893398) },
224 { FRAC_CONST(0.847917105296951), FRAC_CONST(0.530128835798279) },
225 { FRAC_CONST(0.846286702490560), FRAC_CONST(0.532727713928659) },
226 { FRAC_CONST(0.844648334111418), FRAC_CONST(0.535321577822907) },
227 { FRAC_CONST(0.843002015580473), FRAC_CONST(0.537910403066589) },
228 { FRAC_CONST(0.841347762393502), FRAC_CONST(0.540494165292695) },
229 { FRAC_CONST(0.839685590120966), FRAC_CONST(0.543072840181872) },
230 { FRAC_CONST(0.838015514407864), FRAC_CONST(0.545646403462649) },
231 { FRAC_CONST(0.836337550973584), FRAC_CONST(0.548214830911668) },
232 { FRAC_CONST(0.834651715611756), FRAC_CONST(0.550778098353912) },
233 { FRAC_CONST(0.832958024190107), FRAC_CONST(0.553336181662932) },
234 { FRAC_CONST(0.831256492650303), FRAC_CONST(0.555889056761074) },
235 { FRAC_CONST(0.829547137007809), FRAC_CONST(0.558436699619704) },
236 { FRAC_CONST(0.827829973351730), FRAC_CONST(0.560979086259438) },
237 { FRAC_CONST(0.826105017844665), FRAC_CONST(0.563516192750365) },
238 { FRAC_CONST(0.824372286722551), FRAC_CONST(0.566047995212271) },
239 { FRAC_CONST(0.822631796294515), FRAC_CONST(0.568574469814869) },
240 { FRAC_CONST(0.820883562942715), FRAC_CONST(0.571095592778017) },
241 { FRAC_CONST(0.819127603122188), FRAC_CONST(0.573611340371945) },
242 { FRAC_CONST(0.817363933360698), FRAC_CONST(0.576121688917478) },
243 { FRAC_CONST(0.815592570258577), FRAC_CONST(0.578626614786261) },
244 { FRAC_CONST(0.813813530488567), FRAC_CONST(0.581126094400978) },
245 { FRAC_CONST(0.812026830795670), FRAC_CONST(0.583620104235573) },
246 { FRAC_CONST(0.810232487996982), FRAC_CONST(0.586108620815476) },
247 { FRAC_CONST(0.808430518981543), FRAC_CONST(0.588591620717823) },
248 { FRAC_CONST(0.806620940710170), FRAC_CONST(0.591069080571671) },
249 { FRAC_CONST(0.804803770215303), FRAC_CONST(0.593540977058226) },
250 { FRAC_CONST(0.802979024600843), FRAC_CONST(0.596007286911057) },
251 { FRAC_CONST(0.801146721041991), FRAC_CONST(0.598467986916314) },
252 { FRAC_CONST(0.799306876785086), FRAC_CONST(0.600923053912954) },
253 { FRAC_CONST(0.797459509147442), FRAC_CONST(0.603372464792950) },
254 { FRAC_CONST(0.795604635517188), FRAC_CONST(0.605816196501515) },
255 { FRAC_CONST(0.793742273353100), FRAC_CONST(0.608254226037314) },
256 { FRAC_CONST(0.791872440184440), FRAC_CONST(0.610686530452686) },
257 { FRAC_CONST(0.789995153610791), FRAC_CONST(0.613113086853855) },
258 { FRAC_CONST(0.788110431301888), FRAC_CONST(0.615533872401147) },
259 { FRAC_CONST(0.786218290997456), FRAC_CONST(0.617948864309208) },
260 { FRAC_CONST(0.784318750507039), FRAC_CONST(0.620358039847214) },
261 { FRAC_CONST(0.782411827709837), FRAC_CONST(0.622761376339086) },
262 { FRAC_CONST(0.780497540554532), FRAC_CONST(0.625158851163708) },
263 { FRAC_CONST(0.778575907059125), FRAC_CONST(0.627550441755132) },
264 { FRAC_CONST(0.776646945310762), FRAC_CONST(0.629936125602796) },
265 { FRAC_CONST(0.774710673465566), FRAC_CONST(0.632315880251738) },
266 { FRAC_CONST(0.772767109748464), FRAC_CONST(0.634689683302798) },
267 { FRAC_CONST(0.770816272453019), FRAC_CONST(0.637057512412839) },
268 { FRAC_CONST(0.768858179941253), FRAC_CONST(0.639419345294951) },
269 { FRAC_CONST(0.766892850643481), FRAC_CONST(0.641775159718664) },
270 { FRAC_CONST(0.764920303058128), FRAC_CONST(0.644124933510155) },
271 { FRAC_CONST(0.762940555751566), FRAC_CONST(0.646468644552458) },
272 { FRAC_CONST(0.760953627357928), FRAC_CONST(0.648806270785673) },
273 { FRAC_CONST(0.758959536578942), FRAC_CONST(0.651137790207170) },
274 { FRAC_CONST(0.756958302183750), FRAC_CONST(0.653463180871802) },
275 { FRAC_CONST(0.754949943008733), FRAC_CONST(0.655782420892106) },
276 { FRAC_CONST(0.752934477957330), FRAC_CONST(0.658095488438511) },
277 { FRAC_CONST(0.750911925999868), FRAC_CONST(0.660402361739545) },
278 { FRAC_CONST(0.748882306173375), FRAC_CONST(0.662703019082037) },
279 { FRAC_CONST(0.746845637581407), FRAC_CONST(0.664997438811325) },
280 { FRAC_CONST(0.744801939393863), FRAC_CONST(0.667285599331456) },
281 { FRAC_CONST(0.742751230846809), FRAC_CONST(0.669567479105392) },
282 { FRAC_CONST(0.740693531242296), FRAC_CONST(0.671843056655212) },
283 { FRAC_CONST(0.738628859948175), FRAC_CONST(0.674112310562312) },
284 { FRAC_CONST(0.736557236397919), FRAC_CONST(0.676375219467612) },
285 { FRAC_CONST(0.734478680090438), FRAC_CONST(0.678631762071749) },
286 { FRAC_CONST(0.732393210589896), FRAC_CONST(0.680881917135287) },
287 { FRAC_CONST(0.730300847525525), FRAC_CONST(0.683125663478909) },
288 { FRAC_CONST(0.728201610591445), FRAC_CONST(0.685362979983619) },
289 { FRAC_CONST(0.726095519546471), FRAC_CONST(0.687593845590942) },
290 { FRAC_CONST(0.723982594213936), FRAC_CONST(0.689818239303122) },
291 { FRAC_CONST(0.721862854481496), FRAC_CONST(0.692036140183319) },
292 { FRAC_CONST(0.719736320300951), FRAC_CONST(0.694247527355803) },
293 { FRAC_CONST(0.717603011688049), FRAC_CONST(0.696452380006158) },
294 { FRAC_CONST(0.715462948722304), FRAC_CONST(0.698650677381469) },
295 { FRAC_CONST(0.713316151546803), FRAC_CONST(0.700842398790526) },
296 { FRAC_CONST(0.711162640368018), FRAC_CONST(0.703027523604011) },
297 { FRAC_CONST(0.709002435455618), FRAC_CONST(0.705206031254698) },
298 { FRAC_CONST(0.706835557142274), FRAC_CONST(0.707377901237642) },
299 { FRAC_CONST(0.704662025823469), FRAC_CONST(0.709543113110377) },
300 { FRAC_CONST(0.702481861957308), FRAC_CONST(0.711701646493103) },
301 { FRAC_CONST(0.700295086064324), FRAC_CONST(0.713853481068882) },
302 { FRAC_CONST(0.698101718727284), FRAC_CONST(0.715998596583829) },
303 { FRAC_CONST(0.695901780590997), FRAC_CONST(0.718136972847297) },
304 { FRAC_CONST(0.693695292362118), FRAC_CONST(0.720268589732077) },
305 { FRAC_CONST(0.691482274808956), FRAC_CONST(0.722393427174578) },
306 { FRAC_CONST(0.689262748761273), FRAC_CONST(0.724511465175020) },
307 { FRAC_CONST(0.687036735110096), FRAC_CONST(0.726622683797623) },
308 { FRAC_CONST(0.684804254807511), FRAC_CONST(0.728727063170794) },
309 { FRAC_CONST(0.682565328866473), FRAC_CONST(0.730824583487312) },
310 { FRAC_CONST(0.680319978360607), FRAC_CONST(0.732915225004518) },
311 { FRAC_CONST(0.678068224424007), FRAC_CONST(0.734998968044497) },
312 { FRAC_CONST(0.675810088251037), FRAC_CONST(0.737075792994266) },
313 { FRAC_CONST(0.673545591096136), FRAC_CONST(0.739145680305957) },
314 { FRAC_CONST(0.671274754273613), FRAC_CONST(0.741208610497004) },
315 { FRAC_CONST(0.668997599157450), FRAC_CONST(0.743264564150321) },
316 { FRAC_CONST(0.666714147181098), FRAC_CONST(0.745313521914490) },
317 { FRAC_CONST(0.664424419837275), FRAC_CONST(0.747355464503940) },
318 { FRAC_CONST(0.662128438677769), FRAC_CONST(0.749390372699130) },
319 { FRAC_CONST(0.659826225313227), FRAC_CONST(0.751418227346727) },
320 { FRAC_CONST(0.657517801412960), FRAC_CONST(0.753439009359794) },
321 { FRAC_CONST(0.655203188704732), FRAC_CONST(0.755452699717958) },
322 { FRAC_CONST(0.652882408974559), FRAC_CONST(0.757459279467601) },
323 { FRAC_CONST(0.650555484066504), FRAC_CONST(0.759458729722028) },
324 { FRAC_CONST(0.648222435882470), FRAC_CONST(0.761451031661654) },
325 { FRAC_CONST(0.645883286381996), FRAC_CONST(0.763436166534172) },
326 { FRAC_CONST(0.643538057582048), FRAC_CONST(0.765414115654738) },
327 { FRAC_CONST(0.641186771556811), FRAC_CONST(0.767384860406142) },
328 { FRAC_CONST(0.638829450437486), FRAC_CONST(0.769348382238982) },
329 { FRAC_CONST(0.636466116412077), FRAC_CONST(0.771304662671845) },
330 { FRAC_CONST(0.634096791725184), FRAC_CONST(0.773253683291473) },
331 { FRAC_CONST(0.631721498677792), FRAC_CONST(0.775195425752941) },
332 { FRAC_CONST(0.629340259627066), FRAC_CONST(0.777129871779832) },
333 { FRAC_CONST(0.626953096986133), FRAC_CONST(0.779057003164401) },
334 { FRAC_CONST(0.624560033223877), FRAC_CONST(0.780976801767754) },
335 { FRAC_CONST(0.622161090864727), FRAC_CONST(0.782889249520015) },
336 { FRAC_CONST(0.619756292488441), FRAC_CONST(0.784794328420499) },
337 { FRAC_CONST(0.617345660729897), FRAC_CONST(0.786692020537877) },
338 { FRAC_CONST(0.614929218278880), FRAC_CONST(0.788582308010347) },
339 { FRAC_CONST(0.612506987879866), FRAC_CONST(0.790465173045805) },
340 { FRAC_CONST(0.610078992331810), FRAC_CONST(0.792340597922007) },
341 { FRAC_CONST(0.607645254487931), FRAC_CONST(0.794208564986741) },
342 { FRAC_CONST(0.605205797255497), FRAC_CONST(0.796069056657988) },
343 { FRAC_CONST(0.602760643595607), FRAC_CONST(0.797922055424093) },
344 { FRAC_CONST(0.600309816522980), FRAC_CONST(0.799767543843926) },
345 { FRAC_CONST(0.597853339105734), FRAC_CONST(0.801605504547046) },
346 { FRAC_CONST(0.595391234465169), FRAC_CONST(0.803435920233868) },
347 { FRAC_CONST(0.592923525775551), FRAC_CONST(0.805258773675822) },
348 { FRAC_CONST(0.590450236263896), FRAC_CONST(0.807074047715518) },
349 { FRAC_CONST(0.587971389209745), FRAC_CONST(0.808881725266904) },
350 { FRAC_CONST(0.585487007944951), FRAC_CONST(0.810681789315431) },
351 { FRAC_CONST(0.582997115853458), FRAC_CONST(0.812474222918210) },
352 { FRAC_CONST(0.580501736371077), FRAC_CONST(0.814259009204175) },
353 { FRAC_CONST(0.578000892985270), FRAC_CONST(0.816036131374237) },
354 { FRAC_CONST(0.575494609234928), FRAC_CONST(0.817805572701444) },
355 { FRAC_CONST(0.572982908710149), FRAC_CONST(0.819567316531142) },
356 { FRAC_CONST(0.570465815052013), FRAC_CONST(0.821321346281127) },
357 { FRAC_CONST(0.567943351952366), FRAC_CONST(0.823067645441802) },
358 { FRAC_CONST(0.565415543153590), FRAC_CONST(0.824806197576334) },
359 { FRAC_CONST(0.562882412448385), FRAC_CONST(0.826536986320810) },
360 { FRAC_CONST(0.560343983679541), FRAC_CONST(0.828259995384386) },
361 { FRAC_CONST(0.557800280739717), FRAC_CONST(0.829975208549444) },
362 { FRAC_CONST(0.555251327571214), FRAC_CONST(0.831682609671745) },
363 { FRAC_CONST(0.552697148165750), FRAC_CONST(0.833382182680580) },
364 { FRAC_CONST(0.550137766564234), FRAC_CONST(0.835073911578919) },
365 { FRAC_CONST(0.547573206856540), FRAC_CONST(0.836757780443567) },
366 { FRAC_CONST(0.545003493181281), FRAC_CONST(0.838433773425308) },
367 { FRAC_CONST(0.542428649725581), FRAC_CONST(0.840101874749058) },
368 { FRAC_CONST(0.539848700724848), FRAC_CONST(0.841762068714012) },
369 { FRAC_CONST(0.537263670462543), FRAC_CONST(0.843414339693793) },
370 { FRAC_CONST(0.534673583269956), FRAC_CONST(0.845058672136595) },
371 { FRAC_CONST(0.532078463525974), FRAC_CONST(0.846695050565337) },
372 { FRAC_CONST(0.529478335656852), FRAC_CONST(0.848323459577802) },
373 { FRAC_CONST(0.526873224135985), FRAC_CONST(0.849943883846782) },
374 { FRAC_CONST(0.524263153483673), FRAC_CONST(0.851556308120229) },
375 { FRAC_CONST(0.521648148266897), FRAC_CONST(0.853160717221390) },
376 { FRAC_CONST(0.519028233099081), FRAC_CONST(0.854757096048957) },
377 { FRAC_CONST(0.516403432639864), FRAC_CONST(0.856345429577204) },
378 { FRAC_CONST(0.513773771594868), FRAC_CONST(0.857925702856130) },
379 { FRAC_CONST(0.511139274715464), FRAC_CONST(0.859497901011602) },
380 { FRAC_CONST(0.508499966798541), FRAC_CONST(0.861062009245491) },
381 { FRAC_CONST(0.505855872686269), FRAC_CONST(0.862618012835817) },
382 { FRAC_CONST(0.503207017265869), FRAC_CONST(0.864165897136879) },
383 { FRAC_CONST(0.500553425469378), FRAC_CONST(0.865705647579402) },
384 { FRAC_CONST(0.497895122273411), FRAC_CONST(0.867237249670668) },
385 { FRAC_CONST(0.495232132698931), FRAC_CONST(0.868760688994655) },
386 { FRAC_CONST(0.492564481811011), FRAC_CONST(0.870275951212172) },
387 { FRAC_CONST(0.489892194718595), FRAC_CONST(0.871783022060993) },
388 { FRAC_CONST(0.487215296574269), FRAC_CONST(0.873281887355994) },
389 { FRAC_CONST(0.484533812574016), FRAC_CONST(0.874772532989284) },
390 { FRAC_CONST(0.481847767956986), FRAC_CONST(0.876254944930338) },
391 { FRAC_CONST(0.479157188005253), FRAC_CONST(0.877729109226132) },
392 { FRAC_CONST(0.476462098043581), FRAC_CONST(0.879195012001267) },
393 { FRAC_CONST(0.473762523439183), FRAC_CONST(0.880652639458111) },
394 { FRAC_CONST(0.471058489601483), FRAC_CONST(0.882101977876918) },
395 { FRAC_CONST(0.468350021981877), FRAC_CONST(0.883543013615962) },
396 { FRAC_CONST(0.465637146073494), FRAC_CONST(0.884975733111667) },
397 { FRAC_CONST(0.462919887410955), FRAC_CONST(0.886400122878730) },
398 { FRAC_CONST(0.460198271570134), FRAC_CONST(0.887816169510255) },
399 { FRAC_CONST(0.457472324167916), FRAC_CONST(0.889223859677868) },
400 { FRAC_CONST(0.454742070861955), FRAC_CONST(0.890623180131856) },
401 { FRAC_CONST(0.452007537350437), FRAC_CONST(0.892014117701280) },
402 { FRAC_CONST(0.449268749371830), FRAC_CONST(0.893396659294108) },
403 { FRAC_CONST(0.446525732704651), FRAC_CONST(0.894770791897330) },
404 { FRAC_CONST(0.443778513167218), FRAC_CONST(0.896136502577087) },
405 { FRAC_CONST(0.441027116617407), FRAC_CONST(0.897493778478790) },
406 { FRAC_CONST(0.438271568952410), FRAC_CONST(0.898842606827242) },
407 { FRAC_CONST(0.435511896108492), FRAC_CONST(0.900182974926757) },
408 { FRAC_CONST(0.432748124060744), FRAC_CONST(0.901514870161279) },
409 { FRAC_CONST(0.429980278822841), FRAC_CONST(0.902838279994503) },
410 { FRAC_CONST(0.427208386446796), FRAC_CONST(0.904153191969992) },
411 { FRAC_CONST(0.424432473022717), FRAC_CONST(0.905459593711293) },
412 { FRAC_CONST(0.421652564678558), FRAC_CONST(0.906757472922057) },
413 { FRAC_CONST(0.418868687579875), FRAC_CONST(0.908046817386148) },
414 { FRAC_CONST(0.416080867929579), FRAC_CONST(0.909327614967767) },
415 { FRAC_CONST(0.413289131967691), FRAC_CONST(0.910599853611559) },
416 { FRAC_CONST(0.410493505971093), FRAC_CONST(0.911863521342729) },
417 { FRAC_CONST(0.407694016253280), FRAC_CONST(0.913118606267154) },
418 { FRAC_CONST(0.404890689164118), FRAC_CONST(0.914365096571498) },
419 { FRAC_CONST(0.402083551089587), FRAC_CONST(0.915602980523320) },
420 { FRAC_CONST(0.399272628451541), FRAC_CONST(0.916832246471184) },
421 { FRAC_CONST(0.396457947707454), FRAC_CONST(0.918052882844770) },
422 { FRAC_CONST(0.393639535350173), FRAC_CONST(0.919264878154985) },
423 { FRAC_CONST(0.390817417907669), FRAC_CONST(0.920468220994067) },
424 { FRAC_CONST(0.387991621942785), FRAC_CONST(0.921662900035695) },
425 { FRAC_CONST(0.385162174052990), FRAC_CONST(0.922848904035094) },
426 { FRAC_CONST(0.382329100870125), FRAC_CONST(0.924026221829144) },
427 { FRAC_CONST(0.379492429060153), FRAC_CONST(0.925194842336480) },
428 { FRAC_CONST(0.376652185322910), FRAC_CONST(0.926354754557603) },
429 { FRAC_CONST(0.373808396391851), FRAC_CONST(0.927505947574975) },
430 { FRAC_CONST(0.370961089033802), FRAC_CONST(0.928648410553131) },
431 { FRAC_CONST(0.368110290048703), FRAC_CONST(0.929782132738772) },
432 { FRAC_CONST(0.365256026269360), FRAC_CONST(0.930907103460875) },
433 { FRAC_CONST(0.362398324561191), FRAC_CONST(0.932023312130786) },
434 { FRAC_CONST(0.359537211821973), FRAC_CONST(0.933130748242325) },
435 { FRAC_CONST(0.356672714981588), FRAC_CONST(0.934229401371881) },
436 { FRAC_CONST(0.353804861001772), FRAC_CONST(0.935319261178512) },
437 { FRAC_CONST(0.350933676875858), FRAC_CONST(0.936400317404042) },
438 { FRAC_CONST(0.348059189628526), FRAC_CONST(0.937472559873159) },
439 { FRAC_CONST(0.345181426315543), FRAC_CONST(0.938535978493509) },
440 { FRAC_CONST(0.342300414023514), FRAC_CONST(0.939590563255789) },
441 { FRAC_CONST(0.339416179869623), FRAC_CONST(0.940636304233848) },
442 { FRAC_CONST(0.336528751001382), FRAC_CONST(0.941673191584771) },
443 { FRAC_CONST(0.333638154596371), FRAC_CONST(0.942701215548982) },
444 { FRAC_CONST(0.330744417861983), FRAC_CONST(0.943720366450326) },
445 { FRAC_CONST(0.327847568035171), FRAC_CONST(0.944730634696168) },
446 { FRAC_CONST(0.324947632382188), FRAC_CONST(0.945732010777477) },
447 { FRAC_CONST(0.322044638198335), FRAC_CONST(0.946724485268921) },
448 { FRAC_CONST(0.319138612807696), FRAC_CONST(0.947708048828952) },
449 { FRAC_CONST(0.316229583562890), FRAC_CONST(0.948682692199895) },
450 { FRAC_CONST(0.313317577844809), FRAC_CONST(0.949648406208035) },
451 { FRAC_CONST(0.310402623062359), FRAC_CONST(0.950605181763705) },
452 { FRAC_CONST(0.307484746652204), FRAC_CONST(0.951553009861369) },
453 { FRAC_CONST(0.304563976078509), FRAC_CONST(0.952491881579706) },
454 { FRAC_CONST(0.301640338832679), FRAC_CONST(0.953421788081700) },
455 { FRAC_CONST(0.298713862433100), FRAC_CONST(0.954342720614716) },
456 { FRAC_CONST(0.295784574424884), FRAC_CONST(0.955254670510587) },
457 { FRAC_CONST(0.292852502379605), FRAC_CONST(0.956157629185692) },
458 { FRAC_CONST(0.289917673895041), FRAC_CONST(0.957051588141041) },
459 { FRAC_CONST(0.286980116594916), FRAC_CONST(0.957936538962351) },
460 { FRAC_CONST(0.284039858128637), FRAC_CONST(0.958812473320129) },
461 { FRAC_CONST(0.281096926171038), FRAC_CONST(0.959679382969747) },
462 { FRAC_CONST(0.278151348422115), FRAC_CONST(0.960537259751520) },
463 { FRAC_CONST(0.275203152606767), FRAC_CONST(0.961386095590786) },
464 { FRAC_CONST(0.272252366474537), FRAC_CONST(0.962225882497979) },
465 { FRAC_CONST(0.269299017799346), FRAC_CONST(0.963056612568704) },
466 { FRAC_CONST(0.266343134379238), FRAC_CONST(0.963878277983814) },
467 { FRAC_CONST(0.263384744036113), FRAC_CONST(0.964690871009481) },
468 { FRAC_CONST(0.260423874615468), FRAC_CONST(0.965494383997270) },
469 { FRAC_CONST(0.257460553986133), FRAC_CONST(0.966288809384210) },
470 { FRAC_CONST(0.254494810040011), FRAC_CONST(0.967074139692867) },
471 { FRAC_CONST(0.251526670691813), FRAC_CONST(0.967850367531414) },
472 { FRAC_CONST(0.248556163878797), FRAC_CONST(0.968617485593698) },
473 { FRAC_CONST(0.245583317560504), FRAC_CONST(0.969375486659311) },
474 { FRAC_CONST(0.242608159718497), FRAC_CONST(0.970124363593660) },
475 { FRAC_CONST(0.239630718356094), FRAC_CONST(0.970864109348029) },
476 { FRAC_CONST(0.236651021498106), FRAC_CONST(0.971594716959650) },
477 { FRAC_CONST(0.233669097190577), FRAC_CONST(0.972316179551765) },
478 { FRAC_CONST(0.230684973500512), FRAC_CONST(0.973028490333694) },
479 { FRAC_CONST(0.227698678515621), FRAC_CONST(0.973731642600896) },
480 { FRAC_CONST(0.224710240344050), FRAC_CONST(0.974425629735035) },
481 { FRAC_CONST(0.221719687114115), FRAC_CONST(0.975110445204039) },
482 { FRAC_CONST(0.218727046974045), FRAC_CONST(0.975786082562164) },
483 { FRAC_CONST(0.215732348091706), FRAC_CONST(0.976452535450054) },
484 { FRAC_CONST(0.212735618654346), FRAC_CONST(0.977109797594801) },
485 { FRAC_CONST(0.209736886868323), FRAC_CONST(0.977757862810003) },
486 { FRAC_CONST(0.206736180958844), FRAC_CONST(0.978396724995823) },
487 { FRAC_CONST(0.203733529169694), FRAC_CONST(0.979026378139048) },
488 { FRAC_CONST(0.200728959762976), FRAC_CONST(0.979646816313141) },
489 { FRAC_CONST(0.197722501018842), FRAC_CONST(0.980258033678304) },
490 { FRAC_CONST(0.194714181235226), FRAC_CONST(0.980860024481524) },
491 { FRAC_CONST(0.191704028727580), FRAC_CONST(0.981452783056636) },
492 { FRAC_CONST(0.188692071828605), FRAC_CONST(0.982036303824369) },
493 { FRAC_CONST(0.185678338887988), FRAC_CONST(0.982610581292405) },
494 { FRAC_CONST(0.182662858272129), FRAC_CONST(0.983175610055424) },
495 { FRAC_CONST(0.179645658363882), FRAC_CONST(0.983731384795162) },
496 { FRAC_CONST(0.176626767562281), FRAC_CONST(0.984277900280454) },
497 { FRAC_CONST(0.173606214282275), FRAC_CONST(0.984815151367289) },
498 { FRAC_CONST(0.170584026954464), FRAC_CONST(0.985343132998855) },
499 { FRAC_CONST(0.167560234024824), FRAC_CONST(0.985861840205587) },
500 { FRAC_CONST(0.164534863954446), FRAC_CONST(0.986371268105216) },
501 { FRAC_CONST(0.161507945219266), FRAC_CONST(0.986871411902812) },
502 { FRAC_CONST(0.158479506309796), FRAC_CONST(0.987362266890832) },
503 { FRAC_CONST(0.155449575730856), FRAC_CONST(0.987843828449162) },
504 { FRAC_CONST(0.152418182001307), FRAC_CONST(0.988316092045160) },
505 { FRAC_CONST(0.149385353653780), FRAC_CONST(0.988779053233702) },
506 { FRAC_CONST(0.146351119234411), FRAC_CONST(0.989232707657220) },
507 { FRAC_CONST(0.143315507302572), FRAC_CONST(0.989677051045747) },
508 { FRAC_CONST(0.140278546430595), FRAC_CONST(0.990112079216954) },
509 { FRAC_CONST(0.137240265203516), FRAC_CONST(0.990537788076189) },
510 { FRAC_CONST(0.134200692218792), FRAC_CONST(0.990954173616519) },
511 { FRAC_CONST(0.131159856086043), FRAC_CONST(0.991361231918763) },
512 { FRAC_CONST(0.128117785426777), FRAC_CONST(0.991758959151536) },
513 { FRAC_CONST(0.125074508874121), FRAC_CONST(0.992147351571276) },
514 { FRAC_CONST(0.122030055072553), FRAC_CONST(0.992526405522286) },
515 { FRAC_CONST(0.118984452677633), FRAC_CONST(0.992896117436766) },
516 { FRAC_CONST(0.115937730355728), FRAC_CONST(0.993256483834846) },
517 { FRAC_CONST(0.112889916783750), FRAC_CONST(0.993607501324622) },
518 { FRAC_CONST(0.109841040648883), FRAC_CONST(0.993949166602181) },
519 { FRAC_CONST(0.106791130648307), FRAC_CONST(0.994281476451642) },
520 { FRAC_CONST(0.103740215488939), FRAC_CONST(0.994604427745176) },
521 { FRAC_CONST(0.100688323887154), FRAC_CONST(0.994918017443043) },
522 { FRAC_CONST(0.097635484568517), FRAC_CONST(0.995222242593618) },
523 { FRAC_CONST(0.094581726267515), FRAC_CONST(0.995517100333418) },
524 { FRAC_CONST(0.091527077727285), FRAC_CONST(0.995802587887129) },
525 { FRAC_CONST(0.088471567699341), FRAC_CONST(0.996078702567634) },
526 { FRAC_CONST(0.085415224943307), FRAC_CONST(0.996345441776036) },
527 { FRAC_CONST(0.082358078226647), FRAC_CONST(0.996602803001684) },
528 { FRAC_CONST(0.079300156324388), FRAC_CONST(0.996850783822197) },
529 { FRAC_CONST(0.076241488018856), FRAC_CONST(0.997089381903483) },
530 { FRAC_CONST(0.073182102099403), FRAC_CONST(0.997318594999769) },
531 { FRAC_CONST(0.070122027362134), FRAC_CONST(0.997538420953611) },
532 { FRAC_CONST(0.067061292609637), FRAC_CONST(0.997748857695926) },
533 { FRAC_CONST(0.063999926650714), FRAC_CONST(0.997949903246001) },
534 { FRAC_CONST(0.060937958300107), FRAC_CONST(0.998141555711521) },
535 { FRAC_CONST(0.057875416378229), FRAC_CONST(0.998323813288578) },
536 { FRAC_CONST(0.054812329710890), FRAC_CONST(0.998496674261695) },
537 { FRAC_CONST(0.051748727129028), FRAC_CONST(0.998660137003838) },
538 { FRAC_CONST(0.048684637468439), FRAC_CONST(0.998814199976435) },
539 { FRAC_CONST(0.045620089569500), FRAC_CONST(0.998958861729386) },
540 { FRAC_CONST(0.042555112276904), FRAC_CONST(0.999094120901079) },
541 { FRAC_CONST(0.039489734439384), FRAC_CONST(0.999219976218404) },
542 { FRAC_CONST(0.036423984909444), FRAC_CONST(0.999336426496761) },
543 { FRAC_CONST(0.033357892543086), FRAC_CONST(0.999443470640078) },
544 { FRAC_CONST(0.030291486199539), FRAC_CONST(0.999541107640813) },
545 { FRAC_CONST(0.027224794740988), FRAC_CONST(0.999629336579970) },
546 { FRAC_CONST(0.024157847032300), FRAC_CONST(0.999708156627105) },
547 { FRAC_CONST(0.021090671940755), FRAC_CONST(0.999777567040333) },
548 { FRAC_CONST(0.018023298335774), FRAC_CONST(0.999837567166337) },
549 { FRAC_CONST(0.014955755088644), FRAC_CONST(0.999888156440373) },
550 { FRAC_CONST(0.011888071072252), FRAC_CONST(0.999929334386276) },
551 { FRAC_CONST(0.008820275160808), FRAC_CONST(0.999961100616463) },
552 { FRAC_CONST(0.005752396229574), FRAC_CONST(0.999983454831938) },
553 { FRAC_CONST(0.002684463154596), FRAC_CONST(0.999996396822294) }
554 };
555
556 /* 64 (N/4) complex twiddle factors */
557 ALIGN static const complex_t mdct_tab_256[] =
558 {
559 { FRAC_CONST(0.999995293809576), FRAC_CONST(0.003067956762966) },
560 { FRAC_CONST(0.999618822495179), FRAC_CONST(0.027608145778966) },
561 { FRAC_CONST(0.998640218180265), FRAC_CONST(0.052131704680283) },
562 { FRAC_CONST(0.997060070339483), FRAC_CONST(0.076623861392031) },
563 { FRAC_CONST(0.994879330794806), FRAC_CONST(0.101069862754828) },
564 { FRAC_CONST(0.992099313142192), FRAC_CONST(0.125454983411546) },
565 { FRAC_CONST(0.988721691960324), FRAC_CONST(0.149764534677322) },
566 { FRAC_CONST(0.984748501801904), FRAC_CONST(0.173983873387464) },
567 { FRAC_CONST(0.980182135968117), FRAC_CONST(0.198098410717954) },
568 { FRAC_CONST(0.975025345066994), FRAC_CONST(0.222093620973204) },
569 { FRAC_CONST(0.969281235356549), FRAC_CONST(0.245955050335795) },
570 { FRAC_CONST(0.962953266873684), FRAC_CONST(0.269668325572915) },
571 { FRAC_CONST(0.956045251349996), FRAC_CONST(0.293219162694259) },
572 { FRAC_CONST(0.948561349915730), FRAC_CONST(0.316593375556166) },
573 { FRAC_CONST(0.940506070593268), FRAC_CONST(0.339776884406827) },
574 { FRAC_CONST(0.931884265581668), FRAC_CONST(0.362755724367397) },
575 { FRAC_CONST(0.922701128333879), FRAC_CONST(0.385516053843919) },
576 { FRAC_CONST(0.912962190428398), FRAC_CONST(0.408044162864979) },
577 { FRAC_CONST(0.902673318237259), FRAC_CONST(0.430326481340083) },
578 { FRAC_CONST(0.891840709392343), FRAC_CONST(0.452349587233771) },
579 { FRAC_CONST(0.880470889052161), FRAC_CONST(0.474100214650550) },
580 { FRAC_CONST(0.868570705971341), FRAC_CONST(0.495565261825773) },
581 { FRAC_CONST(0.856147328375194), FRAC_CONST(0.516731799017650) },
582 { FRAC_CONST(0.843208239641845), FRAC_CONST(0.537587076295645) },
583 { FRAC_CONST(0.829761233794523), FRAC_CONST(0.558118531220556) },
584 { FRAC_CONST(0.815814410806734), FRAC_CONST(0.578313796411656) },
585 { FRAC_CONST(0.801376171723140), FRAC_CONST(0.598160706996342) },
586 { FRAC_CONST(0.786455213599086), FRAC_CONST(0.617647307937804) },
587 { FRAC_CONST(0.771060524261814), FRAC_CONST(0.636761861236284) },
588 { FRAC_CONST(0.755201376896537), FRAC_CONST(0.655492852999615) },
589 { FRAC_CONST(0.738887324460615), FRAC_CONST(0.673829000378756) },
590 { FRAC_CONST(0.722128193929215), FRAC_CONST(0.691759258364158) },
591 { FRAC_CONST(0.704934080375905), FRAC_CONST(0.709272826438866) },
592 { FRAC_CONST(0.687315340891759), FRAC_CONST(0.726359155084346) },
593 { FRAC_CONST(0.669282588346636), FRAC_CONST(0.743007952135122) },
594 { FRAC_CONST(0.650846684996381), FRAC_CONST(0.759209188978388) },
595 { FRAC_CONST(0.632018735939809), FRAC_CONST(0.774953106594874) },
596 { FRAC_CONST(0.612810082429410), FRAC_CONST(0.790230221437310) },
597 { FRAC_CONST(0.593232295039800), FRAC_CONST(0.805031331142964) },
598 { FRAC_CONST(0.573297166698042), FRAC_CONST(0.819347520076797) },
599 { FRAC_CONST(0.553016705580028), FRAC_CONST(0.833170164701913) },
600 { FRAC_CONST(0.532403127877198), FRAC_CONST(0.846490938774052) },
601 { FRAC_CONST(0.511468850437971), FRAC_CONST(0.859301818357008) },
602 { FRAC_CONST(0.490226483288291), FRAC_CONST(0.871595086655951) },
603 { FRAC_CONST(0.468688822035828), FRAC_CONST(0.883363338665732) },
604 { FRAC_CONST(0.446868840162374), FRAC_CONST(0.894599485631383) },
605 { FRAC_CONST(0.424779681209109), FRAC_CONST(0.905296759318119) },
606 { FRAC_CONST(0.402434650859419), FRAC_CONST(0.915448716088268) },
607 { FRAC_CONST(0.379847208924051), FRAC_CONST(0.925049240782678) },
608 { FRAC_CONST(0.357030961233430), FRAC_CONST(0.934092550404259) },
609 { FRAC_CONST(0.333999651442009), FRAC_CONST(0.942573197601447) },
610 { FRAC_CONST(0.310767152749611), FRAC_CONST(0.950486073949482) },
611 { FRAC_CONST(0.287347459544730), FRAC_CONST(0.957826413027533) },
612 { FRAC_CONST(0.263754678974832), FRAC_CONST(0.964589793289813) },
613 { FRAC_CONST(0.240003022448742), FRAC_CONST(0.970772140728950) },
614 { FRAC_CONST(0.216106797076220), FRAC_CONST(0.976369731330021) },
615 { FRAC_CONST(0.192080397049892), FRAC_CONST(0.981379193313755) },
616 { FRAC_CONST(0.167938294974731), FRAC_CONST(0.985797509167567) },
617 { FRAC_CONST(0.143695033150295), FRAC_CONST(0.989622017463201) },
618 { FRAC_CONST(0.119365214810991), FRAC_CONST(0.992850414459865) },
619 { FRAC_CONST(0.094963495329639), FRAC_CONST(0.995480755491927) },
620 { FRAC_CONST(0.070504573389614), FRAC_CONST(0.997511456140303) },
621 { FRAC_CONST(0.046003182130915), FRAC_CONST(0.998941293186857) },
622 { FRAC_CONST(0.021474080275470), FRAC_CONST(0.999769405351215) }
623 };
624
625 #ifdef LD_DEC
626 /* 256 (N/4) complex twiddle factors */
627 ALIGN static const complex_t mdct_tab_1024[] =
628 {
629 { FRAC_CONST(0.999999705862882), FRAC_CONST(0.000766990318743) },
630 { FRAC_CONST(0.999976174986898), FRAC_CONST(0.006902858724730) },
631 { FRAC_CONST(0.999914995573113), FRAC_CONST(0.013038467241987) },
632 { FRAC_CONST(0.999816169924900), FRAC_CONST(0.019173584868323) },
633 { FRAC_CONST(0.999679701762988), FRAC_CONST(0.025307980620025) },
634 { FRAC_CONST(0.999505596225325), FRAC_CONST(0.031441423540560) },
635 { FRAC_CONST(0.999293859866888), FRAC_CONST(0.037573682709270) },
636 { FRAC_CONST(0.999044500659429), FRAC_CONST(0.043704527250063) },
637 { FRAC_CONST(0.998757527991183), FRAC_CONST(0.049833726340107) },
638 { FRAC_CONST(0.998432952666508), FRAC_CONST(0.055961049218521) },
639 { FRAC_CONST(0.998070786905482), FRAC_CONST(0.062086265195060) },
640 { FRAC_CONST(0.997671044343441), FRAC_CONST(0.068209143658806) },
641 { FRAC_CONST(0.997233740030466), FRAC_CONST(0.074329454086846) },
642 { FRAC_CONST(0.996758890430818), FRAC_CONST(0.080446966052950) },
643 { FRAC_CONST(0.996246513422316), FRAC_CONST(0.086561449236251) },
644 { FRAC_CONST(0.995696628295664), FRAC_CONST(0.092672673429913) },
645 { FRAC_CONST(0.995109255753726), FRAC_CONST(0.098780408549800) },
646 { FRAC_CONST(0.994484417910748), FRAC_CONST(0.104884424643135) },
647 { FRAC_CONST(0.993822138291520), FRAC_CONST(0.110984491897163) },
648 { FRAC_CONST(0.993122441830496), FRAC_CONST(0.117080380647801) },
649 { FRAC_CONST(0.992385354870852), FRAC_CONST(0.123171861388280) },
650 { FRAC_CONST(0.991610905163495), FRAC_CONST(0.129258704777796) },
651 { FRAC_CONST(0.990799121866020), FRAC_CONST(0.135340681650134) },
652 { FRAC_CONST(0.989950035541609), FRAC_CONST(0.141417563022303) },
653 { FRAC_CONST(0.989063678157882), FRAC_CONST(0.147489120103154) },
654 { FRAC_CONST(0.988140083085693), FRAC_CONST(0.153555124301993) },
655 { FRAC_CONST(0.987179285097874), FRAC_CONST(0.159615347237193) },
656 { FRAC_CONST(0.986181320367928), FRAC_CONST(0.165669560744784) },
657 { FRAC_CONST(0.985146226468662), FRAC_CONST(0.171717536887050) },
658 { FRAC_CONST(0.984074042370776), FRAC_CONST(0.177759047961107) },
659 { FRAC_CONST(0.982964808441396), FRAC_CONST(0.183793866507478) },
660 { FRAC_CONST(0.981818566442553), FRAC_CONST(0.189821765318656) },
661 { FRAC_CONST(0.980635359529608), FRAC_CONST(0.195842517447658) },
662 { FRAC_CONST(0.979415232249635), FRAC_CONST(0.201855896216568) },
663 { FRAC_CONST(0.978158230539735), FRAC_CONST(0.207861675225075) },
664 { FRAC_CONST(0.976864401725313), FRAC_CONST(0.213859628358994) },
665 { FRAC_CONST(0.975533794518291), FRAC_CONST(0.219849529798779) },
666 { FRAC_CONST(0.974166459015280), FRAC_CONST(0.225831154028026) },
667 { FRAC_CONST(0.972762446695689), FRAC_CONST(0.231804275841965) },
668 { FRAC_CONST(0.971321810419786), FRAC_CONST(0.237768670355934) },
669 { FRAC_CONST(0.969844604426715), FRAC_CONST(0.243724113013852) },
670 { FRAC_CONST(0.968330884332445), FRAC_CONST(0.249670379596669) },
671 { FRAC_CONST(0.966780707127683), FRAC_CONST(0.255607246230807) },
672 { FRAC_CONST(0.965194131175725), FRAC_CONST(0.261534489396596) },
673 { FRAC_CONST(0.963571216210257), FRAC_CONST(0.267451885936678) },
674 { FRAC_CONST(0.961912023333112), FRAC_CONST(0.273359213064419) },
675 { FRAC_CONST(0.960216615011963), FRAC_CONST(0.279256248372291) },
676 { FRAC_CONST(0.958485055077976), FRAC_CONST(0.285142769840249) },
677 { FRAC_CONST(0.956717408723403), FRAC_CONST(0.291018555844085) },
678 { FRAC_CONST(0.954913742499131), FRAC_CONST(0.296883385163778) },
679 { FRAC_CONST(0.953074124312172), FRAC_CONST(0.302737036991819) },
680 { FRAC_CONST(0.951198623423113), FRAC_CONST(0.308579290941525) },
681 { FRAC_CONST(0.949287310443502), FRAC_CONST(0.314409927055337) },
682 { FRAC_CONST(0.947340257333192), FRAC_CONST(0.320228725813100) },
683 { FRAC_CONST(0.945357537397632), FRAC_CONST(0.326035468140330) },
684 { FRAC_CONST(0.943339225285108), FRAC_CONST(0.331829935416461) },
685 { FRAC_CONST(0.941285396983929), FRAC_CONST(0.337611909483075) },
686 { FRAC_CONST(0.939196129819570), FRAC_CONST(0.343381172652115) },
687 { FRAC_CONST(0.937071502451759), FRAC_CONST(0.349137507714085) },
688 { FRAC_CONST(0.934911594871516), FRAC_CONST(0.354880697946223) },
689 { FRAC_CONST(0.932716488398140), FRAC_CONST(0.360610527120662) },
690 { FRAC_CONST(0.930486265676150), FRAC_CONST(0.366326779512574) },
691 { FRAC_CONST(0.928221010672169), FRAC_CONST(0.372029239908285) },
692 { FRAC_CONST(0.925920808671770), FRAC_CONST(0.377717693613386) },
693 { FRAC_CONST(0.923585746276257), FRAC_CONST(0.383391926460809) },
694 { FRAC_CONST(0.921215911399409), FRAC_CONST(0.389051724818894) },
695 { FRAC_CONST(0.918811393264170), FRAC_CONST(0.394696875599434) },
696 { FRAC_CONST(0.916372282399289), FRAC_CONST(0.400327166265690) },
697 { FRAC_CONST(0.913898670635912), FRAC_CONST(0.405942384840403) },
698 { FRAC_CONST(0.911390651104122), FRAC_CONST(0.411542319913765) },
699 { FRAC_CONST(0.908848318229439), FRAC_CONST(0.417126760651388) },
700 { FRAC_CONST(0.906271767729258), FRAC_CONST(0.422695496802233) },
701 { FRAC_CONST(0.903661096609248), FRAC_CONST(0.428248318706532) },
702 { FRAC_CONST(0.901016403159702), FRAC_CONST(0.433785017303679) },
703 { FRAC_CONST(0.898337786951834), FRAC_CONST(0.439305384140100) },
704 { FRAC_CONST(0.895625348834030), FRAC_CONST(0.444809211377105) },
705 { FRAC_CONST(0.892879190928052), FRAC_CONST(0.450296291798709) },
706 { FRAC_CONST(0.890099416625192), FRAC_CONST(0.455766418819435) },
707 { FRAC_CONST(0.887286130582383), FRAC_CONST(0.461219386492092) },
708 { FRAC_CONST(0.884439438718254), FRAC_CONST(0.466654989515531) },
709 { FRAC_CONST(0.881559448209144), FRAC_CONST(0.472073023242369) },
710 { FRAC_CONST(0.878646267485068), FRAC_CONST(0.477473283686698) },
711 { FRAC_CONST(0.875700006225635), FRAC_CONST(0.482855567531766) },
712 { FRAC_CONST(0.872720775355914), FRAC_CONST(0.488219672137627) },
713 { FRAC_CONST(0.869708687042266), FRAC_CONST(0.493565395548775) },
714 { FRAC_CONST(0.866663854688111), FRAC_CONST(0.498892536501745) },
715 { FRAC_CONST(0.863586392929668), FRAC_CONST(0.504200894432690) },
716 { FRAC_CONST(0.860476417631632), FRAC_CONST(0.509490269484936) },
717 { FRAC_CONST(0.857334045882816), FRAC_CONST(0.514760462516501) },
718 { FRAC_CONST(0.854159395991739), FRAC_CONST(0.520011275107596) },
719 { FRAC_CONST(0.850952587482176), FRAC_CONST(0.525242509568095) },
720 { FRAC_CONST(0.847713741088654), FRAC_CONST(0.530453968944976) },
721 { FRAC_CONST(0.844442978751911), FRAC_CONST(0.535645457029741) },
722 { FRAC_CONST(0.841140423614298), FRAC_CONST(0.540816778365797) },
723 { FRAC_CONST(0.837806200015151), FRAC_CONST(0.545967738255818) },
724 { FRAC_CONST(0.834440433486103), FRAC_CONST(0.551098142769075) },
725 { FRAC_CONST(0.831043250746362), FRAC_CONST(0.556207798748740) },
726 { FRAC_CONST(0.827614779697938), FRAC_CONST(0.561296513819151) },
727 { FRAC_CONST(0.824155149420829), FRAC_CONST(0.566364096393064) },
728 { FRAC_CONST(0.820664490168157), FRAC_CONST(0.571410355678857) },
729 { FRAC_CONST(0.817142933361273), FRAC_CONST(0.576435101687722) },
730 { FRAC_CONST(0.813590611584799), FRAC_CONST(0.581438145240810) },
731 { FRAC_CONST(0.810007658581641), FRAC_CONST(0.586419297976361) },
732 { FRAC_CONST(0.806394209247956), FRAC_CONST(0.591378372356788) },
733 { FRAC_CONST(0.802750399628069), FRAC_CONST(0.596315181675744) },
734 { FRAC_CONST(0.799076366909352), FRAC_CONST(0.601229540065149) },
735 { FRAC_CONST(0.795372249417061), FRAC_CONST(0.606121262502186) },
736 { FRAC_CONST(0.791638186609126), FRAC_CONST(0.610990164816272) },
737 { FRAC_CONST(0.787874319070900), FRAC_CONST(0.615836063695985) },
738 { FRAC_CONST(0.784080788509870), FRAC_CONST(0.620658776695972) },
739 { FRAC_CONST(0.780257737750317), FRAC_CONST(0.625458122243814) },
740 { FRAC_CONST(0.776405310727940), FRAC_CONST(0.630233919646864) },
741 { FRAC_CONST(0.772523652484441), FRAC_CONST(0.634985989099049) },
742 { FRAC_CONST(0.768612909162058), FRAC_CONST(0.639714151687640) },
743 { FRAC_CONST(0.764673227998067), FRAC_CONST(0.644418229399988) },
744 { FRAC_CONST(0.760704757319237), FRAC_CONST(0.649098045130226) },
745 { FRAC_CONST(0.756707646536246), FRAC_CONST(0.653753422685936) },
746 { FRAC_CONST(0.752682046138055), FRAC_CONST(0.658384186794785) },
747 { FRAC_CONST(0.748628107686245), FRAC_CONST(0.662990163111121) },
748 { FRAC_CONST(0.744545983809307), FRAC_CONST(0.667571178222540) },
749 { FRAC_CONST(0.740435828196898), FRAC_CONST(0.672127059656412) },
750 { FRAC_CONST(0.736297795594053), FRAC_CONST(0.676657635886375) },
751 { FRAC_CONST(0.732132041795361), FRAC_CONST(0.681162736338795) },
752 { FRAC_CONST(0.727938723639099), FRAC_CONST(0.685642191399187) },
753 { FRAC_CONST(0.723717999001324), FRAC_CONST(0.690095832418600) },
754 { FRAC_CONST(0.719470026789933), FRAC_CONST(0.694523491719966) },
755 { FRAC_CONST(0.715194966938680), FRAC_CONST(0.698925002604414) },
756 { FRAC_CONST(0.710892980401152), FRAC_CONST(0.703300199357549) },
757 { FRAC_CONST(0.706564229144710), FRAC_CONST(0.707648917255684) },
758 { FRAC_CONST(0.702208876144392), FRAC_CONST(0.711970992572050) },
759 { FRAC_CONST(0.697827085376777), FRAC_CONST(0.716266262582953) },
760 { FRAC_CONST(0.693419021813812), FRAC_CONST(0.720534565573905) },
761 { FRAC_CONST(0.688984851416597), FRAC_CONST(0.724775740845711) },
762 { FRAC_CONST(0.684524741129142), FRAC_CONST(0.728989628720519) },
763 { FRAC_CONST(0.680038858872079), FRAC_CONST(0.733176070547833) },
764 { FRAC_CONST(0.675527373536339), FRAC_CONST(0.737334908710483) },
765 { FRAC_CONST(0.670990454976794), FRAC_CONST(0.741465986630563) },
766 { FRAC_CONST(0.666428274005865), FRAC_CONST(0.745569148775325) },
767 { FRAC_CONST(0.661841002387087), FRAC_CONST(0.749644240663033) },
768 { FRAC_CONST(0.657228812828643), FRAC_CONST(0.753691108868781) },
769 { FRAC_CONST(0.652591878976863), FRAC_CONST(0.757709601030268) },
770 { FRAC_CONST(0.647930375409685), FRAC_CONST(0.761699565853535) },
771 { FRAC_CONST(0.643244477630086), FRAC_CONST(0.765660853118662) },
772 { FRAC_CONST(0.638534362059467), FRAC_CONST(0.769593313685423) },
773 { FRAC_CONST(0.633800206031017), FRAC_CONST(0.773496799498899) },
774 { FRAC_CONST(0.629042187783036), FRAC_CONST(0.777371163595056) },
775 { FRAC_CONST(0.624260486452221), FRAC_CONST(0.781216260106276) },
776 { FRAC_CONST(0.619455282066924), FRAC_CONST(0.785031944266848) },
777 { FRAC_CONST(0.614626755540375), FRAC_CONST(0.788818072418420) },
778 { FRAC_CONST(0.609775088663868), FRAC_CONST(0.792574502015408) },
779 { FRAC_CONST(0.604900464099920), FRAC_CONST(0.796301091630359) },
780 { FRAC_CONST(0.600003065375389), FRAC_CONST(0.799997700959282) },
781 { FRAC_CONST(0.595083076874570), FRAC_CONST(0.803664190826924) },
782 { FRAC_CONST(0.590140683832249), FRAC_CONST(0.807300423192014) },
783 { FRAC_CONST(0.585176072326730), FRAC_CONST(0.810906261152460) },
784 { FRAC_CONST(0.580189429272832), FRAC_CONST(0.814481568950499) },
785 { FRAC_CONST(0.575180942414845), FRAC_CONST(0.818026211977813) },
786 { FRAC_CONST(0.570150800319470), FRAC_CONST(0.821540056780598) },
787 { FRAC_CONST(0.565099192368714), FRAC_CONST(0.825022971064580) },
788 { FRAC_CONST(0.560026308752760), FRAC_CONST(0.828474823700007) },
789 { FRAC_CONST(0.554932340462810), FRAC_CONST(0.831895484726578) },
790 { FRAC_CONST(0.549817479283891), FRAC_CONST(0.835284825358337) },
791 { FRAC_CONST(0.544681917787635), FRAC_CONST(0.838642717988527) },
792 { FRAC_CONST(0.539525849325029), FRAC_CONST(0.841969036194388) },
793 { FRAC_CONST(0.534349468019138), FRAC_CONST(0.845263654741918) },
794 { FRAC_CONST(0.529152968757791), FRAC_CONST(0.848526449590593) },
795 { FRAC_CONST(0.523936547186249), FRAC_CONST(0.851757297898029) },
796 { FRAC_CONST(0.518700399699835), FRAC_CONST(0.854956078024615) },
797 { FRAC_CONST(0.513444723436544), FRAC_CONST(0.858122669538086) },
798 { FRAC_CONST(0.508169716269615), FRAC_CONST(0.861256953218062) },
799 { FRAC_CONST(0.502875576800087), FRAC_CONST(0.864358811060534) },
800 { FRAC_CONST(0.497562504349319), FRAC_CONST(0.867428126282307) },
801 { FRAC_CONST(0.492230698951486), FRAC_CONST(0.870464783325398) },
802 { FRAC_CONST(0.486880361346047), FRAC_CONST(0.873468667861385) },
803 { FRAC_CONST(0.481511692970190), FRAC_CONST(0.876439666795714) },
804 { FRAC_CONST(0.476124895951244), FRAC_CONST(0.879377668271953) },
805 { FRAC_CONST(0.470720173099072), FRAC_CONST(0.882282561676009) },
806 { FRAC_CONST(0.465297727898435), FRAC_CONST(0.885154237640285) },
807 { FRAC_CONST(0.459857764501330), FRAC_CONST(0.887992588047806) },
808 { FRAC_CONST(0.454400487719304), FRAC_CONST(0.890797506036281) },
809 { FRAC_CONST(0.448926103015743), FRAC_CONST(0.893568886002136) },
810 { FRAC_CONST(0.443434816498138), FRAC_CONST(0.896306623604480) },
811 { FRAC_CONST(0.437926834910323), FRAC_CONST(0.899010615769039) },
812 { FRAC_CONST(0.432402365624690), FRAC_CONST(0.901680760692038) },
813 { FRAC_CONST(0.426861616634386), FRAC_CONST(0.904316957844028) },
814 { FRAC_CONST(0.421304796545480), FRAC_CONST(0.906919107973678) },
815 { FRAC_CONST(0.415732114569105), FRAC_CONST(0.909487113111505) },
816 { FRAC_CONST(0.410143780513590), FRAC_CONST(0.912020876573568) },
817 { FRAC_CONST(0.404540004776553), FRAC_CONST(0.914520302965104) },
818 { FRAC_CONST(0.398920998336983), FRAC_CONST(0.916985298184123) },
819 { FRAC_CONST(0.393286972747297), FRAC_CONST(0.919415769424947) },
820 { FRAC_CONST(0.387638140125373), FRAC_CONST(0.921811625181708) },
821 { FRAC_CONST(0.381974713146567), FRAC_CONST(0.924172775251791) },
822 { FRAC_CONST(0.376296905035705), FRAC_CONST(0.926499130739231) },
823 { FRAC_CONST(0.370604929559052), FRAC_CONST(0.928790604058057) },
824 { FRAC_CONST(0.364899001016267), FRAC_CONST(0.931047108935595) },
825 { FRAC_CONST(0.359179334232337), FRAC_CONST(0.933268560415712) },
826 { FRAC_CONST(0.353446144549481), FRAC_CONST(0.935454874862015) },
827 { FRAC_CONST(0.347699647819051), FRAC_CONST(0.937605969961000) },
828 { FRAC_CONST(0.341940060393402), FRAC_CONST(0.939721764725153) },
829 { FRAC_CONST(0.336167599117745), FRAC_CONST(0.941802179495998) },
830 { FRAC_CONST(0.330382481321983), FRAC_CONST(0.943847135947093) },
831 { FRAC_CONST(0.324584924812532), FRAC_CONST(0.945856557086984) },
832 { FRAC_CONST(0.318775147864118), FRAC_CONST(0.947830367262101) },
833 { FRAC_CONST(0.312953369211560), FRAC_CONST(0.949768492159607) },
834 { FRAC_CONST(0.307119808041533), FRAC_CONST(0.951670858810194) },
835 { FRAC_CONST(0.301274683984318), FRAC_CONST(0.953537395590833) },
836 { FRAC_CONST(0.295418217105532), FRAC_CONST(0.955368032227470) },
837 { FRAC_CONST(0.289550627897843), FRAC_CONST(0.957162699797670) },
838 { FRAC_CONST(0.283672137272669), FRAC_CONST(0.958921330733213) },
839 { FRAC_CONST(0.277782966551858), FRAC_CONST(0.960643858822638) },
840 { FRAC_CONST(0.271883337459360), FRAC_CONST(0.962330219213737) },
841 { FRAC_CONST(0.265973472112876), FRAC_CONST(0.963980348415994) },
842 { FRAC_CONST(0.260053593015495), FRAC_CONST(0.965594184302977) },
843 { FRAC_CONST(0.254123923047321), FRAC_CONST(0.967171666114677) },
844 { FRAC_CONST(0.248184685457075), FRAC_CONST(0.968712734459795) },
845 { FRAC_CONST(0.242236103853696), FRAC_CONST(0.970217331317979) },
846 { FRAC_CONST(0.236278402197920), FRAC_CONST(0.971685400042009) },
847 { FRAC_CONST(0.230311804793846), FRAC_CONST(0.973116885359925) },
848 { FRAC_CONST(0.224336536280494), FRAC_CONST(0.974511733377116) },
849 { FRAC_CONST(0.218352821623346), FRAC_CONST(0.975869891578341) },
850 { FRAC_CONST(0.212360886105879), FRAC_CONST(0.977191308829712) },
851 { FRAC_CONST(0.206360955321076), FRAC_CONST(0.978475935380617) },
852 { FRAC_CONST(0.200353255162940), FRAC_CONST(0.979723722865591) },
853 { FRAC_CONST(0.194338011817989), FRAC_CONST(0.980934624306142) },
854 { FRAC_CONST(0.188315451756732), FRAC_CONST(0.982108594112514) },
855 { FRAC_CONST(0.182285801725153), FRAC_CONST(0.983245588085407) },
856 { FRAC_CONST(0.176249288736168), FRAC_CONST(0.984345563417642) },
857 { FRAC_CONST(0.170206140061078), FRAC_CONST(0.985408478695768) },
858 { FRAC_CONST(0.164156583221016), FRAC_CONST(0.986434293901627) },
859 { FRAC_CONST(0.158100845978377), FRAC_CONST(0.987422970413855) },
860 { FRAC_CONST(0.152039156328246), FRAC_CONST(0.988374471009341) },
861 { FRAC_CONST(0.145971742489812), FRAC_CONST(0.989288759864625) },
862 { FRAC_CONST(0.139898832897777), FRAC_CONST(0.990165802557248) },
863 { FRAC_CONST(0.133820656193755), FRAC_CONST(0.991005566067049) },
864 { FRAC_CONST(0.127737441217662), FRAC_CONST(0.991808018777406) },
865 { FRAC_CONST(0.121649416999106), FRAC_CONST(0.992573130476429) },
866 { FRAC_CONST(0.115556812748755), FRAC_CONST(0.993300872358093) },
867 { FRAC_CONST(0.109459857849718), FRAC_CONST(0.993991217023329) },
868 { FRAC_CONST(0.103358781848900), FRAC_CONST(0.994644138481051) },
869 { FRAC_CONST(0.097253814448363), FRAC_CONST(0.995259612149133) },
870 { FRAC_CONST(0.091145185496681), FRAC_CONST(0.995837614855342) },
871 { FRAC_CONST(0.085033124980280), FRAC_CONST(0.996378124838200) },
872 { FRAC_CONST(0.078917863014785), FRAC_CONST(0.996881121747814) },
873 { FRAC_CONST(0.072799629836352), FRAC_CONST(0.997346586646633) },
874 { FRAC_CONST(0.066678655793002), FRAC_CONST(0.997774502010168) },
875 { FRAC_CONST(0.060555171335948), FRAC_CONST(0.998164851727646) },
876 { FRAC_CONST(0.054429407010919), FRAC_CONST(0.998517621102622) },
877 { FRAC_CONST(0.048301593449480), FRAC_CONST(0.998832796853528) },
878 { FRAC_CONST(0.042171961360348), FRAC_CONST(0.999110367114175) },
879 { FRAC_CONST(0.036040741520706), FRAC_CONST(0.999350321434199) },
880 { FRAC_CONST(0.029908164767517), FRAC_CONST(0.999552650779457) },
881 { FRAC_CONST(0.023774461988828), FRAC_CONST(0.999717347532362) },
882 { FRAC_CONST(0.017639864115082), FRAC_CONST(0.999844405492175) },
883 { FRAC_CONST(0.011504602110423), FRAC_CONST(0.999933819875236) },
884 { FRAC_CONST(0.005368906963996), FRAC_CONST(0.999985587315143) }
885 };
886 #endif // LD_DEC
887
888 #ifdef ALLOW_SMALL_FRAMELENGTH
889 /* 480 (N/4) complex twiddle factors */
890 ALIGN static const complex_t mdct_tab_1920[] =
891 {
892 { FRAC_CONST(0.999999916334328), FRAC_CONST(0.000409061532028) },
893 { FRAC_CONST(0.999993223088129), FRAC_CONST(0.003681545574400) },
894 { FRAC_CONST(0.999975820717897), FRAC_CONST(0.006953990190376) },
895 { FRAC_CONST(0.999947709409999), FRAC_CONST(0.010226360334704) },
896 { FRAC_CONST(0.999908889465485), FRAC_CONST(0.013498620962929) },
897 { FRAC_CONST(0.999859361300084), FRAC_CONST(0.016770737031768) },
898 { FRAC_CONST(0.999799125444203), FRAC_CONST(0.020042673499487) },
899 { FRAC_CONST(0.999728182542920), FRAC_CONST(0.023314395326274) },
900 { FRAC_CONST(0.999646533355977), FRAC_CONST(0.026585867474619) },
901 { FRAC_CONST(0.999554178757770), FRAC_CONST(0.029857054909681) },
902 { FRAC_CONST(0.999451119737344), FRAC_CONST(0.033127922599673) },
903 { FRAC_CONST(0.999337357398377), FRAC_CONST(0.036398435516228) },
904 { FRAC_CONST(0.999212892959173), FRAC_CONST(0.039668558634781) },
905 { FRAC_CONST(0.999077727752645), FRAC_CONST(0.042938256934941) },
906 { FRAC_CONST(0.998931863226306), FRAC_CONST(0.046207495400865) },
907 { FRAC_CONST(0.998775300942246), FRAC_CONST(0.049476239021636) },
908 { FRAC_CONST(0.998608042577122), FRAC_CONST(0.052744452791636) },
909 { FRAC_CONST(0.998430089922136), FRAC_CONST(0.056012101710921) },
910 { FRAC_CONST(0.998241444883019), FRAC_CONST(0.059279150785597) },
911 { FRAC_CONST(0.998042109480008), FRAC_CONST(0.062545565028192) },
912 { FRAC_CONST(0.997832085847824), FRAC_CONST(0.065811309458034) },
913 { FRAC_CONST(0.997611376235651), FRAC_CONST(0.069076349101624) },
914 { FRAC_CONST(0.997379983007114), FRAC_CONST(0.072340648993011) },
915 { FRAC_CONST(0.997137908640245), FRAC_CONST(0.075604174174166) },
916 { FRAC_CONST(0.996885155727469), FRAC_CONST(0.078866889695354) },
917 { FRAC_CONST(0.996621726975566), FRAC_CONST(0.082128760615515) },
918 { FRAC_CONST(0.996347625205645), FRAC_CONST(0.085389752002632) },
919 { FRAC_CONST(0.996062853353117), FRAC_CONST(0.088649828934106) },
920 { FRAC_CONST(0.995767414467660), FRAC_CONST(0.091908956497133) },
921 { FRAC_CONST(0.995461311713186), FRAC_CONST(0.095167099789075) },
922 { FRAC_CONST(0.995144548367810), FRAC_CONST(0.098424223917834) },
923 { FRAC_CONST(0.994817127823813), FRAC_CONST(0.101680294002229) },
924 { FRAC_CONST(0.994479053587606), FRAC_CONST(0.104935275172364) },
925 { FRAC_CONST(0.994130329279692), FRAC_CONST(0.108189132570007) },
926 { FRAC_CONST(0.993770958634630), FRAC_CONST(0.111441831348957) },
927 { FRAC_CONST(0.993400945500988), FRAC_CONST(0.114693336675426) },
928 { FRAC_CONST(0.993020293841312), FRAC_CONST(0.117943613728403) },
929 { FRAC_CONST(0.992629007732074), FRAC_CONST(0.121192627700032) },
930 { FRAC_CONST(0.992227091363634), FRAC_CONST(0.124440343795983) },
931 { FRAC_CONST(0.991814549040194), FRAC_CONST(0.127686727235827) },
932 { FRAC_CONST(0.991391385179751), FRAC_CONST(0.130931743253405) },
933 { FRAC_CONST(0.990957604314048), FRAC_CONST(0.134175357097202) },
934 { FRAC_CONST(0.990513211088533), FRAC_CONST(0.137417534030720) },
935 { FRAC_CONST(0.990058210262297), FRAC_CONST(0.140658239332849) },
936 { FRAC_CONST(0.989592606708036), FRAC_CONST(0.143897438298239) },
937 { FRAC_CONST(0.989116405411988), FRAC_CONST(0.147135096237670) },
938 { FRAC_CONST(0.988629611473887), FRAC_CONST(0.150371178478428) },
939 { FRAC_CONST(0.988132230106905), FRAC_CONST(0.153605650364672) },
940 { FRAC_CONST(0.987624266637598), FRAC_CONST(0.156838477257806) },
941 { FRAC_CONST(0.987105726505845), FRAC_CONST(0.160069624536852) },
942 { FRAC_CONST(0.986576615264794), FRAC_CONST(0.163299057598817) },
943 { FRAC_CONST(0.986036938580803), FRAC_CONST(0.166526741859069) },
944 { FRAC_CONST(0.985486702233375), FRAC_CONST(0.169752642751702) },
945 { FRAC_CONST(0.984925912115099), FRAC_CONST(0.172976725729910) },
946 { FRAC_CONST(0.984354574231587), FRAC_CONST(0.176198956266353) },
947 { FRAC_CONST(0.983772694701407), FRAC_CONST(0.179419299853531) },
948 { FRAC_CONST(0.983180279756024), FRAC_CONST(0.182637722004152) },
949 { FRAC_CONST(0.982577335739725), FRAC_CONST(0.185854188251500) },
950 { FRAC_CONST(0.981963869109555), FRAC_CONST(0.189068664149806) },
951 { FRAC_CONST(0.981339886435250), FRAC_CONST(0.192281115274616) },
952 { FRAC_CONST(0.980705394399163), FRAC_CONST(0.195491507223158) },
953 { FRAC_CONST(0.980060399796194), FRAC_CONST(0.198699805614714) },
954 { FRAC_CONST(0.979404909533716), FRAC_CONST(0.201905976090986) },
955 { FRAC_CONST(0.978738930631504), FRAC_CONST(0.205109984316464) },
956 { FRAC_CONST(0.978062470221657), FRAC_CONST(0.208311795978794) },
957 { FRAC_CONST(0.977375535548522), FRAC_CONST(0.211511376789145) },
958 { FRAC_CONST(0.976678133968618), FRAC_CONST(0.214708692482577) },
959 { FRAC_CONST(0.975970272950556), FRAC_CONST(0.217903708818409) },
960 { FRAC_CONST(0.975251960074958), FRAC_CONST(0.221096391580581) },
961 { FRAC_CONST(0.974523203034377), FRAC_CONST(0.224286706578026) },
962 { FRAC_CONST(0.973784009633218), FRAC_CONST(0.227474619645035) },
963 { FRAC_CONST(0.973034387787646), FRAC_CONST(0.230660096641619) },
964 { FRAC_CONST(0.972274345525510), FRAC_CONST(0.233843103453878) },
965 { FRAC_CONST(0.971503890986252), FRAC_CONST(0.237023605994367) },
966 { FRAC_CONST(0.970723032420820), FRAC_CONST(0.240201570202459) },
967 { FRAC_CONST(0.969931778191584), FRAC_CONST(0.243376962044711) },
968 { FRAC_CONST(0.969130136772239), FRAC_CONST(0.246549747515226) },
969 { FRAC_CONST(0.968318116747721), FRAC_CONST(0.249719892636022) },
970 { FRAC_CONST(0.967495726814114), FRAC_CONST(0.252887363457390) },
971 { FRAC_CONST(0.966662975778551), FRAC_CONST(0.256052126058264) },
972 { FRAC_CONST(0.965819872559127), FRAC_CONST(0.259214146546579) },
973 { FRAC_CONST(0.964966426184802), FRAC_CONST(0.262373391059634) },
974 { FRAC_CONST(0.964102645795299), FRAC_CONST(0.265529825764461) },
975 { FRAC_CONST(0.963228540641012), FRAC_CONST(0.268683416858178) },
976 { FRAC_CONST(0.962344120082907), FRAC_CONST(0.271834130568359) },
977 { FRAC_CONST(0.961449393592416), FRAC_CONST(0.274981933153391) },
978 { FRAC_CONST(0.960544370751341), FRAC_CONST(0.278126790902837) },
979 { FRAC_CONST(0.959629061251750), FRAC_CONST(0.281268670137799) },
980 { FRAC_CONST(0.958703474895872), FRAC_CONST(0.284407537211272) },
981 { FRAC_CONST(0.957767621595993), FRAC_CONST(0.287543358508512) },
982 { FRAC_CONST(0.956821511374351), FRAC_CONST(0.290676100447394) },
983 { FRAC_CONST(0.955865154363025), FRAC_CONST(0.293805729478766) },
984 { FRAC_CONST(0.954898560803832), FRAC_CONST(0.296932212086818) },
985 { FRAC_CONST(0.953921741048211), FRAC_CONST(0.300055514789431) },
986 { FRAC_CONST(0.952934705557117), FRAC_CONST(0.303175604138543) },
987 { FRAC_CONST(0.951937464900908), FRAC_CONST(0.306292446720504) },
988 { FRAC_CONST(0.950930029759229), FRAC_CONST(0.309406009156434) },
989 { FRAC_CONST(0.949912410920903), FRAC_CONST(0.312516258102580) },
990 { FRAC_CONST(0.948884619283808), FRAC_CONST(0.315623160250676) },
991 { FRAC_CONST(0.947846665854767), FRAC_CONST(0.318726682328294) },
992 { FRAC_CONST(0.946798561749429), FRAC_CONST(0.321826791099207) },
993 { FRAC_CONST(0.945740318192145), FRAC_CONST(0.324923453363742) },
994 { FRAC_CONST(0.944671946515855), FRAC_CONST(0.328016635959131) },
995 { FRAC_CONST(0.943593458161960), FRAC_CONST(0.331106305759876) },
996 { FRAC_CONST(0.942504864680205), FRAC_CONST(0.334192429678095) },
997 { FRAC_CONST(0.941406177728551), FRAC_CONST(0.337274974663880) },
998 { FRAC_CONST(0.940297409073052), FRAC_CONST(0.340353907705650) },
999 { FRAC_CONST(0.939178570587730), FRAC_CONST(0.343429195830507) },
1000 { FRAC_CONST(0.938049674254446), FRAC_CONST(0.346500806104585) },
1001 { FRAC_CONST(0.936910732162774), FRAC_CONST(0.349568705633406) },
1002 { FRAC_CONST(0.935761756509868), FRAC_CONST(0.352632861562230) },
1003 { FRAC_CONST(0.934602759600334), FRAC_CONST(0.355693241076410) },
1004 { FRAC_CONST(0.933433753846097), FRAC_CONST(0.358749811401739) },
1005 { FRAC_CONST(0.932254751766271), FRAC_CONST(0.361802539804806) },
1006 { FRAC_CONST(0.931065765987021), FRAC_CONST(0.364851393593340) },
1007 { FRAC_CONST(0.929866809241428), FRAC_CONST(0.367896340116568) },
1008 { FRAC_CONST(0.928657894369357), FRAC_CONST(0.370937346765559) },
1009 { FRAC_CONST(0.927439034317314), FRAC_CONST(0.373974380973575) },
1010 { FRAC_CONST(0.926210242138311), FRAC_CONST(0.377007410216418) },
1011 { FRAC_CONST(0.924971530991726), FRAC_CONST(0.380036402012783) },
1012 { FRAC_CONST(0.923722914143160), FRAC_CONST(0.383061323924602) },
1013 { FRAC_CONST(0.922464404964295), FRAC_CONST(0.386082143557389) },
1014 { FRAC_CONST(0.921196016932755), FRAC_CONST(0.389098828560595) },
1015 { FRAC_CONST(0.919917763631956), FRAC_CONST(0.392111346627946) },
1016 { FRAC_CONST(0.918629658750963), FRAC_CONST(0.395119665497795) },
1017 { FRAC_CONST(0.917331716084346), FRAC_CONST(0.398123752953462) },
1018 { FRAC_CONST(0.916023949532027), FRAC_CONST(0.401123576823585) },
1019 { FRAC_CONST(0.914706373099136), FRAC_CONST(0.404119104982459) },
1020 { FRAC_CONST(0.913379000895858), FRAC_CONST(0.407110305350386) },
1021 { FRAC_CONST(0.912041847137282), FRAC_CONST(0.410097145894012) },
1022 { FRAC_CONST(0.910694926143251), FRAC_CONST(0.413079594626675) },
1023 { FRAC_CONST(0.909338252338207), FRAC_CONST(0.416057619608744) },
1024 { FRAC_CONST(0.907971840251037), FRAC_CONST(0.419031188947965) },
1025 { FRAC_CONST(0.906595704514915), FRAC_CONST(0.422000270799800) },
1026 { FRAC_CONST(0.905209859867151), FRAC_CONST(0.424964833367766) },
1027 { FRAC_CONST(0.903814321149027), FRAC_CONST(0.427924844903780) },
1028 { FRAC_CONST(0.902409103305641), FRAC_CONST(0.430880273708497) },
1029 { FRAC_CONST(0.900994221385748), FRAC_CONST(0.433831088131649) },
1030 { FRAC_CONST(0.899569690541596), FRAC_CONST(0.436777256572384) },
1031 { FRAC_CONST(0.898135526028766), FRAC_CONST(0.439718747479604) },
1032 { FRAC_CONST(0.896691743206008), FRAC_CONST(0.442655529352306) },
1033 { FRAC_CONST(0.895238357535076), FRAC_CONST(0.445587570739915) },
1034 { FRAC_CONST(0.893775384580563), FRAC_CONST(0.448514840242624) },
1035 { FRAC_CONST(0.892302840009734), FRAC_CONST(0.451437306511726) },
1036 { FRAC_CONST(0.890820739592359), FRAC_CONST(0.454354938249958) },
1037 { FRAC_CONST(0.889329099200541), FRAC_CONST(0.457267704211826) },
1038 { FRAC_CONST(0.887827934808551), FRAC_CONST(0.460175573203949) },
1039 { FRAC_CONST(0.886317262492655), FRAC_CONST(0.463078514085383) },
1040 { FRAC_CONST(0.884797098430938), FRAC_CONST(0.465976495767966) },
1041 { FRAC_CONST(0.883267458903136), FRAC_CONST(0.468869487216642) },
1042 { FRAC_CONST(0.881728360290461), FRAC_CONST(0.471757457449795) },
1043 { FRAC_CONST(0.880179819075421), FRAC_CONST(0.474640375539586) },
1044 { FRAC_CONST(0.878621851841649), FRAC_CONST(0.477518210612278) },
1045 { FRAC_CONST(0.877054475273722), FRAC_CONST(0.480390931848569) },
1046 { FRAC_CONST(0.875477706156984), FRAC_CONST(0.483258508483922) },
1047 { FRAC_CONST(0.873891561377366), FRAC_CONST(0.486120909808896) },
1048 { FRAC_CONST(0.872296057921204), FRAC_CONST(0.488978105169472) },
1049 { FRAC_CONST(0.870691212875058), FRAC_CONST(0.491830063967383) },
1050 { FRAC_CONST(0.869077043425529), FRAC_CONST(0.494676755660442) },
1051 { FRAC_CONST(0.867453566859076), FRAC_CONST(0.497518149762867) },
1052 { FRAC_CONST(0.865820800561827), FRAC_CONST(0.500354215845611) },
1053 { FRAC_CONST(0.864178762019399), FRAC_CONST(0.503184923536685) },
1054 { FRAC_CONST(0.862527468816704), FRAC_CONST(0.506010242521482) },
1055 { FRAC_CONST(0.860866938637767), FRAC_CONST(0.508830142543107) },
1056 { FRAC_CONST(0.859197189265532), FRAC_CONST(0.511644593402696) },
1057 { FRAC_CONST(0.857518238581672), FRAC_CONST(0.514453564959741) },
1058 { FRAC_CONST(0.855830104566401), FRAC_CONST(0.517257027132414) },
1059 { FRAC_CONST(0.854132805298278), FRAC_CONST(0.520054949897887) },
1060 { FRAC_CONST(0.852426358954015), FRAC_CONST(0.522847303292655) },
1061 { FRAC_CONST(0.850710783808280), FRAC_CONST(0.525634057412856) },
1062 { FRAC_CONST(0.848986098233506), FRAC_CONST(0.528415182414593) },
1063 { FRAC_CONST(0.847252320699689), FRAC_CONST(0.531190648514252) },
1064 { FRAC_CONST(0.845509469774194), FRAC_CONST(0.533960425988819) },
1065 { FRAC_CONST(0.843757564121554), FRAC_CONST(0.536724485176205) },
1066 { FRAC_CONST(0.841996622503271), FRAC_CONST(0.539482796475555) },
1067 { FRAC_CONST(0.840226663777615), FRAC_CONST(0.542235330347571) },
1068 { FRAC_CONST(0.838447706899422), FRAC_CONST(0.544982057314827) },
1069 { FRAC_CONST(0.836659770919891), FRAC_CONST(0.547722947962084) },
1070 { FRAC_CONST(0.834862874986380), FRAC_CONST(0.550457972936605) },
1071 { FRAC_CONST(0.833057038342201), FRAC_CONST(0.553187102948470) },
1072 { FRAC_CONST(0.831242280326413), FRAC_CONST(0.555910308770889) },
1073 { FRAC_CONST(0.829418620373617), FRAC_CONST(0.558627561240515) },
1074 { FRAC_CONST(0.827586078013746), FRAC_CONST(0.561338831257758) },
1075 { FRAC_CONST(0.825744672871856), FRAC_CONST(0.564044089787093) },
1076 { FRAC_CONST(0.823894424667918), FRAC_CONST(0.566743307857377) },
1077 { FRAC_CONST(0.822035353216601), FRAC_CONST(0.569436456562150) },
1078 { FRAC_CONST(0.820167478427070), FRAC_CONST(0.572123507059955) },
1079 { FRAC_CONST(0.818290820302761), FRAC_CONST(0.574804430574639) },
1080 { FRAC_CONST(0.816405398941175), FRAC_CONST(0.577479198395666) },
1081 { FRAC_CONST(0.814511234533661), FRAC_CONST(0.580147781878420) },
1082 { FRAC_CONST(0.812608347365198), FRAC_CONST(0.582810152444517) },
1083 { FRAC_CONST(0.810696757814178), FRAC_CONST(0.585466281582107) },
1084 { FRAC_CONST(0.808776486352191), FRAC_CONST(0.588116140846181) },
1085 { FRAC_CONST(0.806847553543799), FRAC_CONST(0.590759701858874) },
1086 { FRAC_CONST(0.804909980046325), FRAC_CONST(0.593396936309773) },
1087 { FRAC_CONST(0.802963786609623), FRAC_CONST(0.596027815956215) },
1088 { FRAC_CONST(0.801008994075862), FRAC_CONST(0.598652312623592) },
1089 { FRAC_CONST(0.799045623379300), FRAC_CONST(0.601270398205654) },
1090 { FRAC_CONST(0.797073695546059), FRAC_CONST(0.603882044664808) },
1091 { FRAC_CONST(0.795093231693901), FRAC_CONST(0.606487224032418) },
1092 { FRAC_CONST(0.793104253032005), FRAC_CONST(0.609085908409106) },
1093 { FRAC_CONST(0.791106780860733), FRAC_CONST(0.611678069965050) },
1094 { FRAC_CONST(0.789100836571407), FRAC_CONST(0.614263680940283) },
1095 { FRAC_CONST(0.787086441646080), FRAC_CONST(0.616842713644988) },
1096 { FRAC_CONST(0.785063617657302), FRAC_CONST(0.619415140459796) },
1097 { FRAC_CONST(0.783032386267894), FRAC_CONST(0.621980933836084) },
1098 { FRAC_CONST(0.780992769230711), FRAC_CONST(0.624540066296266) },
1099 { FRAC_CONST(0.778944788388414), FRAC_CONST(0.627092510434089) },
1100 { FRAC_CONST(0.776888465673232), FRAC_CONST(0.629638238914927) },
1101 { FRAC_CONST(0.774823823106730), FRAC_CONST(0.632177224476073) },
1102 { FRAC_CONST(0.772750882799570), FRAC_CONST(0.634709439927031) },
1103 { FRAC_CONST(0.770669666951277), FRAC_CONST(0.637234858149809) },
1104 { FRAC_CONST(0.768580197850002), FRAC_CONST(0.639753452099206) },
1105 { FRAC_CONST(0.766482497872280), FRAC_CONST(0.642265194803105) },
1106 { FRAC_CONST(0.764376589482793), FRAC_CONST(0.644770059362758) },
1107 { FRAC_CONST(0.762262495234126), FRAC_CONST(0.647268018953079) },
1108 { FRAC_CONST(0.760140237766532), FRAC_CONST(0.649759046822928) },
1109 { FRAC_CONST(0.758009839807683), FRAC_CONST(0.652243116295397) },
1110 { FRAC_CONST(0.755871324172429), FRAC_CONST(0.654720200768098) },
1111 { FRAC_CONST(0.753724713762555), FRAC_CONST(0.657190273713446) },
1112 { FRAC_CONST(0.751570031566534), FRAC_CONST(0.659653308678945) },
1113 { FRAC_CONST(0.749407300659280), FRAC_CONST(0.662109279287469) },
1114 { FRAC_CONST(0.747236544201905), FRAC_CONST(0.664558159237545) },
1115 { FRAC_CONST(0.745057785441466), FRAC_CONST(0.666999922303638) },
1116 { FRAC_CONST(0.742871047710719), FRAC_CONST(0.669434542336425) },
1117 { FRAC_CONST(0.740676354427868), FRAC_CONST(0.671861993263083) },
1118 { FRAC_CONST(0.738473729096316), FRAC_CONST(0.674282249087562) },
1119 { FRAC_CONST(0.736263195304409), FRAC_CONST(0.676695283890867) },
1120 { FRAC_CONST(0.734044776725190), FRAC_CONST(0.679101071831334) },
1121 { FRAC_CONST(0.731818497116138), FRAC_CONST(0.681499587144906) },
1122 { FRAC_CONST(0.729584380318920), FRAC_CONST(0.683890804145412) },
1123 { FRAC_CONST(0.727342450259131), FRAC_CONST(0.686274697224838) },
1124 { FRAC_CONST(0.725092730946042), FRAC_CONST(0.688651240853606) },
1125 { FRAC_CONST(0.722835246472338), FRAC_CONST(0.691020409580841) },
1126 { FRAC_CONST(0.720570021013866), FRAC_CONST(0.693382178034651) },
1127 { FRAC_CONST(0.718297078829369), FRAC_CONST(0.695736520922392) },
1128 { FRAC_CONST(0.716016444260233), FRAC_CONST(0.698083413030944) },
1129 { FRAC_CONST(0.713728141730222), FRAC_CONST(0.700422829226978) },
1130 { FRAC_CONST(0.711432195745216), FRAC_CONST(0.702754744457225) },
1131 { FRAC_CONST(0.709128630892954), FRAC_CONST(0.705079133748748) },
1132 { FRAC_CONST(0.706817471842764), FRAC_CONST(0.707395972209203) },
1133 { FRAC_CONST(0.704498743345302), FRAC_CONST(0.709705235027113) },
1134 { FRAC_CONST(0.702172470232289), FRAC_CONST(0.712006897472128) },
1135 { FRAC_CONST(0.699838677416240), FRAC_CONST(0.714300934895292) },
1136 { FRAC_CONST(0.697497389890200), FRAC_CONST(0.716587322729308) },
1137 { FRAC_CONST(0.695148632727480), FRAC_CONST(0.718866036488799) },
1138 { FRAC_CONST(0.692792431081381), FRAC_CONST(0.721137051770570) },
1139 { FRAC_CONST(0.690428810184929), FRAC_CONST(0.723400344253874) },
1140 { FRAC_CONST(0.688057795350606), FRAC_CONST(0.725655889700665) },
1141 { FRAC_CONST(0.685679411970075), FRAC_CONST(0.727903663955865) },
1142 { FRAC_CONST(0.683293685513912), FRAC_CONST(0.730143642947616) },
1143 { FRAC_CONST(0.680900641531330), FRAC_CONST(0.732375802687543) },
1144 { FRAC_CONST(0.678500305649909), FRAC_CONST(0.734600119271009) },
1145 { FRAC_CONST(0.676092703575316), FRAC_CONST(0.736816568877370) },
1146 { FRAC_CONST(0.673677861091036), FRAC_CONST(0.739025127770231) },
1147 { FRAC_CONST(0.671255804058092), FRAC_CONST(0.741225772297702) },
1148 { FRAC_CONST(0.668826558414768), FRAC_CONST(0.743418478892647) },
1149 { FRAC_CONST(0.666390150176334), FRAC_CONST(0.745603224072940) },
1150 { FRAC_CONST(0.663946605434765), FRAC_CONST(0.747779984441716) },
1151 { FRAC_CONST(0.661495950358462), FRAC_CONST(0.749948736687619) },
1152 { FRAC_CONST(0.659038211191971), FRAC_CONST(0.752109457585056) },
1153 { FRAC_CONST(0.656573414255705), FRAC_CONST(0.754262123994441) },
1154 { FRAC_CONST(0.654101585945659), FRAC_CONST(0.756406712862448) },
1155 { FRAC_CONST(0.651622752733128), FRAC_CONST(0.758543201222251) },
1156 { FRAC_CONST(0.649136941164425), FRAC_CONST(0.760671566193777) },
1157 { FRAC_CONST(0.646644177860593), FRAC_CONST(0.762791784983948) },
1158 { FRAC_CONST(0.644144489517126), FRAC_CONST(0.764903834886923) },
1159 { FRAC_CONST(0.641637902903677), FRAC_CONST(0.767007693284345) },
1160 { FRAC_CONST(0.639124444863776), FRAC_CONST(0.769103337645580) },
1161 { FRAC_CONST(0.636604142314538), FRAC_CONST(0.771190745527961) },
1162 { FRAC_CONST(0.634077022246379), FRAC_CONST(0.773269894577026) },
1163 { FRAC_CONST(0.631543111722725), FRAC_CONST(0.775340762526760) },
1164 { FRAC_CONST(0.629002437879721), FRAC_CONST(0.777403327199831) },
1165 { FRAC_CONST(0.626455027925944), FRAC_CONST(0.779457566507828) },
1166 { FRAC_CONST(0.623900909142107), FRAC_CONST(0.781503458451498) },
1167 { FRAC_CONST(0.621340108880771), FRAC_CONST(0.783540981120982) },
1168 { FRAC_CONST(0.618772654566049), FRAC_CONST(0.785570112696050) },
1169 { FRAC_CONST(0.616198573693314), FRAC_CONST(0.787590831446332) },
1170 { FRAC_CONST(0.613617893828905), FRAC_CONST(0.789603115731555) },
1171 { FRAC_CONST(0.611030642609828), FRAC_CONST(0.791606944001769) },
1172 { FRAC_CONST(0.608436847743468), FRAC_CONST(0.793602294797585) },
1173 { FRAC_CONST(0.605836537007281), FRAC_CONST(0.795589146750397) },
1174 { FRAC_CONST(0.603229738248508), FRAC_CONST(0.797567478582619) },
1175 { FRAC_CONST(0.600616479383869), FRAC_CONST(0.799537269107905) },
1176 { FRAC_CONST(0.597996788399267), FRAC_CONST(0.801498497231381) },
1177 { FRAC_CONST(0.595370693349487), FRAC_CONST(0.803451141949871) },
1178 { FRAC_CONST(0.592738222357898), FRAC_CONST(0.805395182352117) },
1179 { FRAC_CONST(0.590099403616149), FRAC_CONST(0.807330597619008) },
1180 { FRAC_CONST(0.587454265383869), FRAC_CONST(0.809257367023803) },
1181 { FRAC_CONST(0.584802835988364), FRAC_CONST(0.811175469932349) },
1182 { FRAC_CONST(0.582145143824311), FRAC_CONST(0.813084885803304) },
1183 { FRAC_CONST(0.579481217353460), FRAC_CONST(0.814985594188359) },
1184 { FRAC_CONST(0.576811085104321), FRAC_CONST(0.816877574732454) },
1185 { FRAC_CONST(0.574134775671867), FRAC_CONST(0.818760807173997) },
1186 { FRAC_CONST(0.571452317717222), FRAC_CONST(0.820635271345081) },
1187 { FRAC_CONST(0.568763739967354), FRAC_CONST(0.822500947171703) },
1188 { FRAC_CONST(0.566069071214772), FRAC_CONST(0.824357814673971) },
1189 { FRAC_CONST(0.563368340317214), FRAC_CONST(0.826205853966327) },
1190 { FRAC_CONST(0.560661576197336), FRAC_CONST(0.828045045257756) },
1191 { FRAC_CONST(0.557948807842409), FRAC_CONST(0.829875368851995) },
1192 { FRAC_CONST(0.555230064304002), FRAC_CONST(0.831696805147750) },
1193 { FRAC_CONST(0.552505374697674), FRAC_CONST(0.833509334638900) },
1194 { FRAC_CONST(0.549774768202663), FRAC_CONST(0.835312937914713) },
1195 { FRAC_CONST(0.547038274061568), FRAC_CONST(0.837107595660044) },
1196 { FRAC_CONST(0.544295921580046), FRAC_CONST(0.838893288655553) },
1197 { FRAC_CONST(0.541547740126486), FRAC_CONST(0.840669997777901) },
1198 { FRAC_CONST(0.538793759131706), FRAC_CONST(0.842437703999961) },
1199 { FRAC_CONST(0.536034008088628), FRAC_CONST(0.844196388391019) },
1200 { FRAC_CONST(0.533268516551970), FRAC_CONST(0.845946032116980) },
1201 { FRAC_CONST(0.530497314137923), FRAC_CONST(0.847686616440563) },
1202 { FRAC_CONST(0.527720430523840), FRAC_CONST(0.849418122721510) },
1203 { FRAC_CONST(0.524937895447912), FRAC_CONST(0.851140532416778) },
1204 { FRAC_CONST(0.522149738708856), FRAC_CONST(0.852853827080745) },
1205 { FRAC_CONST(0.519355990165590), FRAC_CONST(0.854557988365401) },
1206 { FRAC_CONST(0.516556679736915), FRAC_CONST(0.856252998020546) },
1207 { FRAC_CONST(0.513751837401199), FRAC_CONST(0.857938837893991) },
1208 { FRAC_CONST(0.510941493196049), FRAC_CONST(0.859615489931744) },
1209 { FRAC_CONST(0.508125677217994), FRAC_CONST(0.861282936178208) },
1210 { FRAC_CONST(0.505304419622159), FRAC_CONST(0.862941158776375) },
1211 { FRAC_CONST(0.502477750621949), FRAC_CONST(0.864590139968012) },
1212 { FRAC_CONST(0.499645700488717), FRAC_CONST(0.866229862093855) },
1213 { FRAC_CONST(0.496808299551444), FRAC_CONST(0.867860307593799) },
1214 { FRAC_CONST(0.493965578196415), FRAC_CONST(0.869481459007080) },
1215 { FRAC_CONST(0.491117566866892), FRAC_CONST(0.871093298972471) },
1216 { FRAC_CONST(0.488264296062789), FRAC_CONST(0.872695810228461) },
1217 { FRAC_CONST(0.485405796340343), FRAC_CONST(0.874288975613440) },
1218 { FRAC_CONST(0.482542098311789), FRAC_CONST(0.875872778065888) },
1219 { FRAC_CONST(0.479673232645033), FRAC_CONST(0.877447200624553) },
1220 { FRAC_CONST(0.476799230063322), FRAC_CONST(0.879012226428633) },
1221 { FRAC_CONST(0.473920121344914), FRAC_CONST(0.880567838717962) },
1222 { FRAC_CONST(0.471035937322751), FRAC_CONST(0.882114020833179) },
1223 { FRAC_CONST(0.468146708884125), FRAC_CONST(0.883650756215917) },
1224 { FRAC_CONST(0.465252466970353), FRAC_CONST(0.885178028408975) },
1225 { FRAC_CONST(0.462353242576441), FRAC_CONST(0.886695821056495) },
1226 { FRAC_CONST(0.459449066750752), FRAC_CONST(0.888204117904136) },
1227 { FRAC_CONST(0.456539970594675), FRAC_CONST(0.889702902799251) },
1228 { FRAC_CONST(0.453625985262295), FRAC_CONST(0.891192159691058) },
1229 { FRAC_CONST(0.450707141960053), FRAC_CONST(0.892671872630812) },
1230 { FRAC_CONST(0.447783471946415), FRAC_CONST(0.894142025771977) },
1231 { FRAC_CONST(0.444855006531538), FRAC_CONST(0.895602603370393) },
1232 { FRAC_CONST(0.441921777076935), FRAC_CONST(0.897053589784447) },
1233 { FRAC_CONST(0.438983814995137), FRAC_CONST(0.898494969475242) },
1234 { FRAC_CONST(0.436041151749356), FRAC_CONST(0.899926727006758) },
1235 { FRAC_CONST(0.433093818853152), FRAC_CONST(0.901348847046022) },
1236 { FRAC_CONST(0.430141847870093), FRAC_CONST(0.902761314363272) },
1237 { FRAC_CONST(0.427185270413416), FRAC_CONST(0.904164113832116) },
1238 { FRAC_CONST(0.424224118145690), FRAC_CONST(0.905557230429701) },
1239 { FRAC_CONST(0.421258422778478), FRAC_CONST(0.906940649236866) },
1240 { FRAC_CONST(0.418288216071994), FRAC_CONST(0.908314355438308) },
1241 { FRAC_CONST(0.415313529834766), FRAC_CONST(0.909678334322736) },
1242 { FRAC_CONST(0.412334395923293), FRAC_CONST(0.911032571283032) },
1243 { FRAC_CONST(0.409350846241706), FRAC_CONST(0.912377051816407) },
1244 { FRAC_CONST(0.406362912741425), FRAC_CONST(0.913711761524555) },
1245 { FRAC_CONST(0.403370627420818), FRAC_CONST(0.915036686113806) },
1246 { FRAC_CONST(0.400374022324857), FRAC_CONST(0.916351811395282) },
1247 { FRAC_CONST(0.397373129544774), FRAC_CONST(0.917657123285050) },
1248 { FRAC_CONST(0.394367981217720), FRAC_CONST(0.918952607804266) },
1249 { FRAC_CONST(0.391358609526420), FRAC_CONST(0.920238251079332) },
1250 { FRAC_CONST(0.388345046698826), FRAC_CONST(0.921514039342042) },
1251 { FRAC_CONST(0.385327325007776), FRAC_CONST(0.922779958929729) },
1252 { FRAC_CONST(0.382305476770645), FRAC_CONST(0.924035996285410) },
1253 { FRAC_CONST(0.379279534348999), FRAC_CONST(0.925282137957935) },
1254 { FRAC_CONST(0.376249530148250), FRAC_CONST(0.926518370602127) },
1255 { FRAC_CONST(0.373215496617310), FRAC_CONST(0.927744680978929) },
1256 { FRAC_CONST(0.370177466248239), FRAC_CONST(0.928961055955541) },
1257 { FRAC_CONST(0.367135471575903), FRAC_CONST(0.930167482505564) },
1258 { FRAC_CONST(0.364089545177621), FRAC_CONST(0.931363947709140) },
1259 { FRAC_CONST(0.361039719672816), FRAC_CONST(0.932550438753087) },
1260 { FRAC_CONST(0.357986027722671), FRAC_CONST(0.933726942931039) },
1261 { FRAC_CONST(0.354928502029772), FRAC_CONST(0.934893447643582) },
1262 { FRAC_CONST(0.351867175337763), FRAC_CONST(0.936049940398387) },
1263 { FRAC_CONST(0.348802080430994), FRAC_CONST(0.937196408810347) },
1264 { FRAC_CONST(0.345733250134169), FRAC_CONST(0.938332840601705) },
1265 { FRAC_CONST(0.342660717311994), FRAC_CONST(0.939459223602190) },
1266 { FRAC_CONST(0.339584514868829), FRAC_CONST(0.940575545749145) },
1267 { FRAC_CONST(0.336504675748328), FRAC_CONST(0.941681795087657) },
1268 { FRAC_CONST(0.333421232933097), FRAC_CONST(0.942777959770684) },
1269 { FRAC_CONST(0.330334219444328), FRAC_CONST(0.943864028059183) },
1270 { FRAC_CONST(0.327243668341457), FRAC_CONST(0.944939988322235) },
1271 { FRAC_CONST(0.324149612721804), FRAC_CONST(0.946005829037171) },
1272 { FRAC_CONST(0.321052085720218), FRAC_CONST(0.947061538789691) },
1273 { FRAC_CONST(0.317951120508725), FRAC_CONST(0.948107106273994) },
1274 { FRAC_CONST(0.314846750296171), FRAC_CONST(0.949142520292891) },
1275 { FRAC_CONST(0.311739008327867), FRAC_CONST(0.950167769757930) },
1276 { FRAC_CONST(0.308627927885232), FRAC_CONST(0.951182843689513) },
1277 { FRAC_CONST(0.305513542285440), FRAC_CONST(0.952187731217013) },
1278 { FRAC_CONST(0.302395884881056), FRAC_CONST(0.953182421578893) },
1279 { FRAC_CONST(0.299274989059689), FRAC_CONST(0.954166904122818) },
1280 { FRAC_CONST(0.296150888243624), FRAC_CONST(0.955141168305771) },
1281 { FRAC_CONST(0.293023615889471), FRAC_CONST(0.956105203694164) },
1282 { FRAC_CONST(0.289893205487806), FRAC_CONST(0.957058999963955) },
1283 { FRAC_CONST(0.286759690562807), FRAC_CONST(0.958002546900750) },
1284 { FRAC_CONST(0.283623104671904), FRAC_CONST(0.958935834399920) },
1285 { FRAC_CONST(0.280483481405410), FRAC_CONST(0.959858852466706) },
1286 { FRAC_CONST(0.277340854386169), FRAC_CONST(0.960771591216325) },
1287 { FRAC_CONST(0.274195257269191), FRAC_CONST(0.961674040874080) },
1288 { FRAC_CONST(0.271046723741295), FRAC_CONST(0.962566191775459) },
1289 { FRAC_CONST(0.267895287520743), FRAC_CONST(0.963448034366243) },
1290 { FRAC_CONST(0.264740982356888), FRAC_CONST(0.964319559202607) },
1291 { FRAC_CONST(0.261583842029803), FRAC_CONST(0.965180756951218) },
1292 { FRAC_CONST(0.258423900349924), FRAC_CONST(0.966031618389343) },
1293 { FRAC_CONST(0.255261191157689), FRAC_CONST(0.966872134404937) },
1294 { FRAC_CONST(0.252095748323171), FRAC_CONST(0.967702295996750) },
1295 { FRAC_CONST(0.248927605745720), FRAC_CONST(0.968522094274417) },
1296 { FRAC_CONST(0.245756797353599), FRAC_CONST(0.969331520458559) },
1297 { FRAC_CONST(0.242583357103617), FRAC_CONST(0.970130565880871) },
1298 { FRAC_CONST(0.239407318980770), FRAC_CONST(0.970919221984218) },
1299 { FRAC_CONST(0.236228716997876), FRAC_CONST(0.971697480322728) },
1300 { FRAC_CONST(0.233047585195206), FRAC_CONST(0.972465332561878) },
1301 { FRAC_CONST(0.229863957640129), FRAC_CONST(0.973222770478587) },
1302 { FRAC_CONST(0.226677868426735), FRAC_CONST(0.973969785961306) },
1303 { FRAC_CONST(0.223489351675482), FRAC_CONST(0.974706371010097) },
1304 { FRAC_CONST(0.220298441532823), FRAC_CONST(0.975432517736727) },
1305 { FRAC_CONST(0.217105172170841), FRAC_CONST(0.976148218364747) },
1306 { FRAC_CONST(0.213909577786886), FRAC_CONST(0.976853465229579) },
1307 { FRAC_CONST(0.210711692603206), FRAC_CONST(0.977548250778596) },
1308 { FRAC_CONST(0.207511550866582), FRAC_CONST(0.978232567571202) },
1309 { FRAC_CONST(0.204309186847962), FRAC_CONST(0.978906408278914) },
1310 { FRAC_CONST(0.201104634842092), FRAC_CONST(0.979569765685441) },
1311 { FRAC_CONST(0.197897929167148), FRAC_CONST(0.980222632686756) },
1312 { FRAC_CONST(0.194689104164373), FRAC_CONST(0.980865002291179) },
1313 { FRAC_CONST(0.191478194197704), FRAC_CONST(0.981496867619447) },
1314 { FRAC_CONST(0.188265233653407), FRAC_CONST(0.982118221904791) },
1315 { FRAC_CONST(0.185050256939710), FRAC_CONST(0.982729058493005) },
1316 { FRAC_CONST(0.181833298486427), FRAC_CONST(0.983329370842520) },
1317 { FRAC_CONST(0.178614392744603), FRAC_CONST(0.983919152524473) },
1318 { FRAC_CONST(0.175393574186129), FRAC_CONST(0.984498397222776) },
1319 { FRAC_CONST(0.172170877303385), FRAC_CONST(0.985067098734184) },
1320 { FRAC_CONST(0.168946336608867), FRAC_CONST(0.985625250968360) },
1321 { FRAC_CONST(0.165719986634814), FRAC_CONST(0.986172847947943) },
1322 { FRAC_CONST(0.162491861932842), FRAC_CONST(0.986709883808609) },
1323 { FRAC_CONST(0.159261997073573), FRAC_CONST(0.987236352799134) },
1324 { FRAC_CONST(0.156030426646266), FRAC_CONST(0.987752249281460) },
1325 { FRAC_CONST(0.152797185258443), FRAC_CONST(0.988257567730749) },
1326 { FRAC_CONST(0.149562307535523), FRAC_CONST(0.988752302735447) },
1327 { FRAC_CONST(0.146325828120446), FRAC_CONST(0.989236448997339) },
1328 { FRAC_CONST(0.143087781673307), FRAC_CONST(0.989710001331608) },
1329 { FRAC_CONST(0.139848202870981), FRAC_CONST(0.990172954666889) },
1330 { FRAC_CONST(0.136607126406757), FRAC_CONST(0.990625304045323) },
1331 { FRAC_CONST(0.133364586989957), FRAC_CONST(0.991067044622612) },
1332 { FRAC_CONST(0.130120619345575), FRAC_CONST(0.991498171668069) },
1333 { FRAC_CONST(0.126875258213898), FRAC_CONST(0.991918680564670) },
1334 { FRAC_CONST(0.123628538350136), FRAC_CONST(0.992328566809103) },
1335 { FRAC_CONST(0.120380494524051), FRAC_CONST(0.992727826011815) },
1336 { FRAC_CONST(0.117131161519582), FRAC_CONST(0.993116453897061) },
1337 { FRAC_CONST(0.113880574134475), FRAC_CONST(0.993494446302948) },
1338 { FRAC_CONST(0.110628767179910), FRAC_CONST(0.993861799181482) },
1339 { FRAC_CONST(0.107375775480128), FRAC_CONST(0.994218508598608) },
1340 { FRAC_CONST(0.104121633872055), FRAC_CONST(0.994564570734255) },
1341 { FRAC_CONST(0.100866377204933), FRAC_CONST(0.994899981882376) },
1342 { FRAC_CONST(0.097610040339947), FRAC_CONST(0.995224738450986) },
1343 { FRAC_CONST(0.094352658149849), FRAC_CONST(0.995538836962204) },
1344 { FRAC_CONST(0.091094265518583), FRAC_CONST(0.995842274052287) },
1345 { FRAC_CONST(0.087834897340919), FRAC_CONST(0.996135046471667) },
1346 { FRAC_CONST(0.084574588522070), FRAC_CONST(0.996417151084987) },
1347 { FRAC_CONST(0.081313373977324), FRAC_CONST(0.996688584871134) },
1348 { FRAC_CONST(0.078051288631670), FRAC_CONST(0.996949344923269) },
1349 { FRAC_CONST(0.074788367419420), FRAC_CONST(0.997199428448862) },
1350 { FRAC_CONST(0.071524645283840), FRAC_CONST(0.997438832769720) },
1351 { FRAC_CONST(0.068260157176771), FRAC_CONST(0.997667555322013) },
1352 { FRAC_CONST(0.064994938058259), FRAC_CONST(0.997885593656308) },
1353 { FRAC_CONST(0.061729022896176), FRAC_CONST(0.998092945437590) },
1354 { FRAC_CONST(0.058462446665851), FRAC_CONST(0.998289608445286) },
1355 { FRAC_CONST(0.055195244349690), FRAC_CONST(0.998475580573295) },
1356 { FRAC_CONST(0.051927450936806), FRAC_CONST(0.998650859830004) },
1357 { FRAC_CONST(0.048659101422640), FRAC_CONST(0.998815444338313) },
1358 { FRAC_CONST(0.045390230808591), FRAC_CONST(0.998969332335654) },
1359 { FRAC_CONST(0.042120874101635), FRAC_CONST(0.999112522174011) },
1360 { FRAC_CONST(0.038851066313958), FRAC_CONST(0.999245012319936) },
1361 { FRAC_CONST(0.035580842462574), FRAC_CONST(0.999366801354564) },
1362 { FRAC_CONST(0.032310237568951), FRAC_CONST(0.999477887973635) },
1363 { FRAC_CONST(0.029039286658643), FRAC_CONST(0.999578270987499) },
1364 { FRAC_CONST(0.025768024760904), FRAC_CONST(0.999667949321134) },
1365 { FRAC_CONST(0.022496486908322), FRAC_CONST(0.999746922014158) },
1366 { FRAC_CONST(0.019224708136438), FRAC_CONST(0.999815188220837) },
1367 { FRAC_CONST(0.015952723483375), FRAC_CONST(0.999872747210095) },
1368 { FRAC_CONST(0.012680567989461), FRAC_CONST(0.999919598365521) },
1369 { FRAC_CONST(0.009408276696850), FRAC_CONST(0.999955741185376) },
1370 { FRAC_CONST(0.006135884649155), FRAC_CONST(0.999981175282601) },
1371 { FRAC_CONST(0.002863426891064), FRAC_CONST(0.999995900384816) }
1372 };
1373
1374 #ifdef LD_DEC
1375 /* 240 (N/4) complex twiddle factors */
1376 ALIGN static const complex_t mdct_tab_960[] =
1377 {
1378 { FRAC_CONST(0.999999665337326), FRAC_CONST(0.000818122995607) },
1379 { FRAC_CONST(0.999972892444367), FRAC_CONST(0.007363041249780) },
1380 { FRAC_CONST(0.999903284040864), FRAC_CONST(0.013907644095771) },
1381 { FRAC_CONST(0.999790843108610), FRAC_CONST(0.020451651184577) },
1382 { FRAC_CONST(0.999635574464198), FRAC_CONST(0.026994782192715) },
1383 { FRAC_CONST(0.999437484758823), FRAC_CONST(0.033536756834230) },
1384 { FRAC_CONST(0.999196582477986), FRAC_CONST(0.040077294872701) },
1385 { FRAC_CONST(0.998912877941140), FRAC_CONST(0.046616116133247) },
1386 { FRAC_CONST(0.998586383301244), FRAC_CONST(0.053152940514528) },
1387 { FRAC_CONST(0.998217112544241), FRAC_CONST(0.059687488000744) },
1388 { FRAC_CONST(0.997805081488460), FRAC_CONST(0.066219478673630) },
1389 { FRAC_CONST(0.997350307783942), FRAC_CONST(0.072748632724445) },
1390 { FRAC_CONST(0.996852810911678), FRAC_CONST(0.079274670465961) },
1391 { FRAC_CONST(0.996312612182778), FRAC_CONST(0.085797312344440) },
1392 { FRAC_CONST(0.995729734737558), FRAC_CONST(0.092316278951614) },
1393 { FRAC_CONST(0.995104203544548), FRAC_CONST(0.098831291036650) },
1394 { FRAC_CONST(0.994436045399422), FRAC_CONST(0.105342069518114) },
1395 { FRAC_CONST(0.993725288923851), FRAC_CONST(0.111848335495926) },
1396 { FRAC_CONST(0.992971964564277), FRAC_CONST(0.118349810263305) },
1397 { FRAC_CONST(0.992176104590608), FRAC_CONST(0.124846215318711) },
1398 { FRAC_CONST(0.991337743094838), FRAC_CONST(0.131337272377774) },
1399 { FRAC_CONST(0.990456915989581), FRAC_CONST(0.137822703385212) },
1400 { FRAC_CONST(0.989533661006540), FRAC_CONST(0.144302230526747) },
1401 { FRAC_CONST(0.988568017694885), FRAC_CONST(0.150775576241001) },
1402 { FRAC_CONST(0.987560027419562), FRAC_CONST(0.157242463231389) },
1403 { FRAC_CONST(0.986509733359519), FRAC_CONST(0.163702614477995) },
1404 { FRAC_CONST(0.985417180505858), FRAC_CONST(0.170155753249442) },
1405 { FRAC_CONST(0.984282415659907), FRAC_CONST(0.176601603114742) },
1406 { FRAC_CONST(0.983105487431216), FRAC_CONST(0.183039887955141) },
1407 { FRAC_CONST(0.981886446235473), FRAC_CONST(0.189470331975943) },
1408 { FRAC_CONST(0.980625344292344), FRAC_CONST(0.195892659718330) },
1409 { FRAC_CONST(0.979322235623241), FRAC_CONST(0.202306596071156) },
1410 { FRAC_CONST(0.977977176049000), FRAC_CONST(0.208711866282735) },
1411 { FRAC_CONST(0.976590223187499), FRAC_CONST(0.215108195972610) },
1412 { FRAC_CONST(0.975161436451181), FRAC_CONST(0.221495311143304) },
1413 { FRAC_CONST(0.973690877044515), FRAC_CONST(0.227872938192063) },
1414 { FRAC_CONST(0.972178607961371), FRAC_CONST(0.234240803922570) },
1415 { FRAC_CONST(0.970624693982323), FRAC_CONST(0.240598635556650) },
1416 { FRAC_CONST(0.969029201671875), FRAC_CONST(0.246946160745958) },
1417 { FRAC_CONST(0.967392199375607), FRAC_CONST(0.253283107583640) },
1418 { FRAC_CONST(0.965713757217249), FRAC_CONST(0.259609204615985) },
1419 { FRAC_CONST(0.963993947095677), FRAC_CONST(0.265924180854051) },
1420 { FRAC_CONST(0.962232842681832), FRAC_CONST(0.272227765785273) },
1421 { FRAC_CONST(0.960430519415566), FRAC_CONST(0.278519689385053) },
1422 { FRAC_CONST(0.958587054502409), FRAC_CONST(0.284799682128326) },
1423 { FRAC_CONST(0.956702526910263), FRAC_CONST(0.291067475001103) },
1424 { FRAC_CONST(0.954777017366017), FRAC_CONST(0.297322799511998) },
1425 { FRAC_CONST(0.952810608352092), FRAC_CONST(0.303565387703730) },
1426 { FRAC_CONST(0.950803384102905), FRAC_CONST(0.309794972164597) },
1427 { FRAC_CONST(0.948755430601263), FRAC_CONST(0.316011286039934) },
1428 { FRAC_CONST(0.946666835574676), FRAC_CONST(0.322214063043544) },
1429 { FRAC_CONST(0.944537688491606), FRAC_CONST(0.328403037469105) },
1430 { FRAC_CONST(0.942368080557626), FRAC_CONST(0.334577944201551) },
1431 { FRAC_CONST(0.940158104711519), FRAC_CONST(0.340738518728429) },
1432 { FRAC_CONST(0.937907855621296), FRAC_CONST(0.346884497151231) },
1433 { FRAC_CONST(0.935617429680138), FRAC_CONST(0.353015616196696) },
1434 { FRAC_CONST(0.933286925002268), FRAC_CONST(0.359131613228090) },
1435 { FRAC_CONST(0.930916441418752), FRAC_CONST(0.365232226256457) },
1436 { FRAC_CONST(0.928506080473216), FRAC_CONST(0.371317193951838) },
1437 { FRAC_CONST(0.926055945417500), FRAC_CONST(0.377386255654469) },
1438 { FRAC_CONST(0.923566141207236), FRAC_CONST(0.383439151385947) },
1439 { FRAC_CONST(0.921036774497350), FRAC_CONST(0.389475621860365) },
1440 { FRAC_CONST(0.918467953637492), FRAC_CONST(0.395495408495417) },
1441 { FRAC_CONST(0.915859788667400), FRAC_CONST(0.401498253423481) },
1442 { FRAC_CONST(0.913212391312179), FRAC_CONST(0.407483899502658) },
1443 { FRAC_CONST(0.910525874977521), FRAC_CONST(0.413452090327791) },
1444 { FRAC_CONST(0.907800354744844), FRAC_CONST(0.419402570241451) },
1445 { FRAC_CONST(0.905035947366364), FRAC_CONST(0.425335084344881) },
1446 { FRAC_CONST(0.902232771260093), FRAC_CONST(0.431249378508924) },
1447 { FRAC_CONST(0.899390946504764), FRAC_CONST(0.437145199384900) },
1448 { FRAC_CONST(0.896510594834693), FRAC_CONST(0.443022294415467) },
1449 { FRAC_CONST(0.893591839634558), FRAC_CONST(0.448880411845433) },
1450 { FRAC_CONST(0.890634805934118), FRAC_CONST(0.454719300732547) },
1451 { FRAC_CONST(0.887639620402854), FRAC_CONST(0.460538710958240) },
1452 { FRAC_CONST(0.884606411344546), FRAC_CONST(0.466338393238348) },
1453 { FRAC_CONST(0.881535308691775), FRAC_CONST(0.472118099133784) },
1454 { FRAC_CONST(0.878426444000357), FRAC_CONST(0.477877581061184) },
1455 { FRAC_CONST(0.875279950443708), FRAC_CONST(0.483616592303511) },
1456 { FRAC_CONST(0.872095962807140), FRAC_CONST(0.489334887020625) },
1457 { FRAC_CONST(0.868874617482085), FRAC_CONST(0.495032220259813) },
1458 { FRAC_CONST(0.865616052460258), FRAC_CONST(0.500708347966279) },
1459 { FRAC_CONST(0.862320407327736), FRAC_CONST(0.506363026993605) },
1460 { FRAC_CONST(0.858987823258990), FRAC_CONST(0.511996015114162) },
1461 { FRAC_CONST(0.855618443010829), FRAC_CONST(0.517607071029487) },
1462 { FRAC_CONST(0.852212410916289), FRAC_CONST(0.523195954380619) },
1463 { FRAC_CONST(0.848769872878448), FRAC_CONST(0.528762425758396) },
1464 { FRAC_CONST(0.845290976364179), FRAC_CONST(0.534306246713712) },
1465 { FRAC_CONST(0.841775870397828), FRAC_CONST(0.539827179767727) },
1466 { FRAC_CONST(0.838224705554838), FRAC_CONST(0.545324988422046) },
1467 { FRAC_CONST(0.834637633955290), FRAC_CONST(0.550799437168844) },
1468 { FRAC_CONST(0.831014809257393), FRAC_CONST(0.556250291500956) },
1469 { FRAC_CONST(0.827356386650900), FRAC_CONST(0.561677317921925) },
1470 { FRAC_CONST(0.823662522850458), FRAC_CONST(0.567080283956001) },
1471 { FRAC_CONST(0.819933376088899), FRAC_CONST(0.572458958158102) },
1472 { FRAC_CONST(0.816169106110459), FRAC_CONST(0.577813110123727) },
1473 { FRAC_CONST(0.812369874163934), FRAC_CONST(0.583142510498826) },
1474 { FRAC_CONST(0.808535842995778), FRAC_CONST(0.588446930989624) },
1475 { FRAC_CONST(0.804667176843123), FRAC_CONST(0.593726144372402) },
1476 { FRAC_CONST(0.800764041426753), FRAC_CONST(0.598979924503229) },
1477 { FRAC_CONST(0.796826603943998), FRAC_CONST(0.604208046327650) },
1478 { FRAC_CONST(0.792855033061574), FRAC_CONST(0.609410285890327) },
1479 { FRAC_CONST(0.788849498908361), FRAC_CONST(0.614586420344631) },
1480 { FRAC_CONST(0.784810173068109), FRAC_CONST(0.619736227962191) },
1481 { FRAC_CONST(0.780737228572094), FRAC_CONST(0.624859488142386) },
1482 { FRAC_CONST(0.776630839891703), FRAC_CONST(0.629955981421804) },
1483 { FRAC_CONST(0.772491182930959), FRAC_CONST(0.635025489483633) },
1484 { FRAC_CONST(0.768318435018988), FRAC_CONST(0.640067795167023) },
1485 { FRAC_CONST(0.764112774902423), FRAC_CONST(0.645082682476378) },
1486 { FRAC_CONST(0.759874382737746), FRAC_CONST(0.650069936590618) },
1487 { FRAC_CONST(0.755603440083571), FRAC_CONST(0.655029343872374) },
1488 { FRAC_CONST(0.751300129892866), FRAC_CONST(0.659960691877147) },
1489 { FRAC_CONST(0.746964636505118), FRAC_CONST(0.664863769362399) },
1490 { FRAC_CONST(0.742597145638433), FRAC_CONST(0.669738366296610) },
1491 { FRAC_CONST(0.738197844381584), FRAC_CONST(0.674584273868271) },
1492 { FRAC_CONST(0.733766921185995), FRAC_CONST(0.679401284494831) },
1493 { FRAC_CONST(0.729304565857668), FRAC_CONST(0.684189191831585) },
1494 { FRAC_CONST(0.724810969549055), FRAC_CONST(0.688947790780520) },
1495 { FRAC_CONST(0.720286324750863), FRAC_CONST(0.693676877499095) },
1496 { FRAC_CONST(0.715730825283819), FRAC_CONST(0.698376249408973) },
1497 { FRAC_CONST(0.711144666290356), FRAC_CONST(0.703045705204703) },
1498 { FRAC_CONST(0.706528044226263), FRAC_CONST(0.707685044862340) },
1499 { FRAC_CONST(0.701881156852263), FRAC_CONST(0.712294069648014) },
1500 { FRAC_CONST(0.697204203225545), FRAC_CONST(0.716872582126442) },
1501 { FRAC_CONST(0.692497383691237), FRAC_CONST(0.721420386169390) },
1502 { FRAC_CONST(0.687760899873822), FRAC_CONST(0.725937286964068) },
1503 { FRAC_CONST(0.682994954668502), FRAC_CONST(0.730423091021479) },
1504 { FRAC_CONST(0.678199752232508), FRAC_CONST(0.734877606184707) },
1505 { FRAC_CONST(0.673375497976352), FRAC_CONST(0.739300641637149) },
1506 { FRAC_CONST(0.668522398555031), FRAC_CONST(0.743692007910687) },
1507 { FRAC_CONST(0.663640661859171), FRAC_CONST(0.748051516893805) },
1508 { FRAC_CONST(0.658730497006124), FRAC_CONST(0.752378981839648) },
1509 { FRAC_CONST(0.653792114331011), FRAC_CONST(0.756674217374021) },
1510 { FRAC_CONST(0.648825725377709), FRAC_CONST(0.760937039503328) },
1511 { FRAC_CONST(0.643831542889792), FRAC_CONST(0.765167265622459) },
1512 { FRAC_CONST(0.638809780801414), FRAC_CONST(0.769364714522605) },
1513 { FRAC_CONST(0.633760654228152), FRAC_CONST(0.773529206399025) },
1514 { FRAC_CONST(0.628684379457781), FRAC_CONST(0.777660562858748) },
1515 { FRAC_CONST(0.623581173941019), FRAC_CONST(0.781758606928213) },
1516 { FRAC_CONST(0.618451256282204), FRAC_CONST(0.785823163060853) },
1517 { FRAC_CONST(0.613294846229936), FRAC_CONST(0.789854057144609) },
1518 { FRAC_CONST(0.608112164667659), FRAC_CONST(0.793851116509396) },
1519 { FRAC_CONST(0.602903433604202), FRAC_CONST(0.797814169934493) },
1520 { FRAC_CONST(0.597668876164268), FRAC_CONST(0.801743047655882) },
1521 { FRAC_CONST(0.592408716578875), FRAC_CONST(0.805637581373517) },
1522 { FRAC_CONST(0.587123180175754), FRAC_CONST(0.809497604258536) },
1523 { FRAC_CONST(0.581812493369691), FRAC_CONST(0.813322950960406) },
1524 { FRAC_CONST(0.576476883652835), FRAC_CONST(0.817113457614006) },
1525 { FRAC_CONST(0.571116579584947), FRAC_CONST(0.820868961846646) },
1526 { FRAC_CONST(0.565731810783613), FRAC_CONST(0.824589302785025) },
1527 { FRAC_CONST(0.560322807914407), FRAC_CONST(0.828274321062119) },
1528 { FRAC_CONST(0.554889802681009), FRAC_CONST(0.831923858824010) },
1529 { FRAC_CONST(0.549433027815281), FRAC_CONST(0.835537759736646) },
1530 { FRAC_CONST(0.543952717067296), FRAC_CONST(0.839115868992540) },
1531 { FRAC_CONST(0.538449105195327), FRAC_CONST(0.842658033317402) },
1532 { FRAC_CONST(0.532922427955790), FRAC_CONST(0.846164100976699) },
1533 { FRAC_CONST(0.527372922093142), FRAC_CONST(0.849633921782164) },
1534 { FRAC_CONST(0.521800825329746), FRAC_CONST(0.853067347098221) },
1535 { FRAC_CONST(0.516206376355680), FRAC_CONST(0.856464229848356) },
1536 { FRAC_CONST(0.510589814818519), FRAC_CONST(0.859824424521420) },
1537 { FRAC_CONST(0.504951381313066), FRAC_CONST(0.863147787177854) },
1538 { FRAC_CONST(0.499291317371047), FRAC_CONST(0.866434175455865) },
1539 { FRAC_CONST(0.493609865450762), FRAC_CONST(0.869683448577516) },
1540 { FRAC_CONST(0.487907268926702), FRAC_CONST(0.872895467354761) },
1541 { FRAC_CONST(0.482183772079123), FRAC_CONST(0.876070094195407) },
1542 { FRAC_CONST(0.476439620083580), FRAC_CONST(0.879207193109004) },
1543 { FRAC_CONST(0.470675059000427), FRAC_CONST(0.882306629712678) },
1544 { FRAC_CONST(0.464890335764274), FRAC_CONST(0.885368271236879) },
1545 { FRAC_CONST(0.459085698173413), FRAC_CONST(0.888391986531075) },
1546 { FRAC_CONST(0.453261394879198), FRAC_CONST(0.891377646069366) },
1547 { FRAC_CONST(0.447417675375397), FRAC_CONST(0.894325121956035) },
1548 { FRAC_CONST(0.441554789987504), FRAC_CONST(0.897234287931024) },
1549 { FRAC_CONST(0.435672989862017), FRAC_CONST(0.900105019375345) },
1550 { FRAC_CONST(0.429772526955677), FRAC_CONST(0.902937193316419) },
1551 { FRAC_CONST(0.423853654024676), FRAC_CONST(0.905730688433339) },
1552 { FRAC_CONST(0.417916624613831), FRAC_CONST(0.908485385062073) },
1553 { FRAC_CONST(0.411961693045722), FRAC_CONST(0.911201165200584) },
1554 { FRAC_CONST(0.405989114409798), FRAC_CONST(0.913877912513892) },
1555 { FRAC_CONST(0.399999144551449), FRAC_CONST(0.916515512339049) },
1556 { FRAC_CONST(0.393992040061048), FRAC_CONST(0.919113851690058) },
1557 { FRAC_CONST(0.387968058262959), FRAC_CONST(0.921672819262709) },
1558 { FRAC_CONST(0.381927457204511), FRAC_CONST(0.924192305439348) },
1559 { FRAC_CONST(0.375870495644949), FRAC_CONST(0.926672202293573) },
1560 { FRAC_CONST(0.369797433044349), FRAC_CONST(0.929112403594856) },
1561 { FRAC_CONST(0.363708529552499), FRAC_CONST(0.931512804813095) },
1562 { FRAC_CONST(0.357604045997758), FRAC_CONST(0.933873303123091) },
1563 { FRAC_CONST(0.351484243875885), FRAC_CONST(0.936193797408954) },
1564 { FRAC_CONST(0.345349385338836), FRAC_CONST(0.938474188268430) },
1565 { FRAC_CONST(0.339199733183530), FRAC_CONST(0.940714378017165) },
1566 { FRAC_CONST(0.333035550840599), FRAC_CONST(0.942914270692887) },
1567 { FRAC_CONST(0.326857102363098), FRAC_CONST(0.945073772059514) },
1568 { FRAC_CONST(0.320664652415198), FRAC_CONST(0.947192789611197) },
1569 { FRAC_CONST(0.314458466260842), FRAC_CONST(0.949271232576274) },
1570 { FRAC_CONST(0.308238809752391), FRAC_CONST(0.951309011921168) },
1571 { FRAC_CONST(0.302005949319228), FRAC_CONST(0.953306040354194) },
1572 { FRAC_CONST(0.295760151956351), FRAC_CONST(0.955262232329299) },
1573 { FRAC_CONST(0.289501685212929), FRAC_CONST(0.957177504049732) },
1574 { FRAC_CONST(0.283230817180850), FRAC_CONST(0.959051773471624) },
1575 { FRAC_CONST(0.276947816483228), FRAC_CONST(0.960884960307514) },
1576 { FRAC_CONST(0.270652952262902), FRAC_CONST(0.962676986029777) },
1577 { FRAC_CONST(0.264346494170904), FRAC_CONST(0.964427773873996) },
1578 { FRAC_CONST(0.258028712354909), FRAC_CONST(0.966137248842248) },
1579 { FRAC_CONST(0.251699877447663), FRAC_CONST(0.967805337706313) },
1580 { FRAC_CONST(0.245360260555389), FRAC_CONST(0.969431969010818) },
1581 { FRAC_CONST(0.239010133246176), FRAC_CONST(0.971017073076290) },
1582 { FRAC_CONST(0.232649767538342), FRAC_CONST(0.972560582002147) },
1583 { FRAC_CONST(0.226279435888785), FRAC_CONST(0.974062429669605) },
1584 { FRAC_CONST(0.219899411181310), FRAC_CONST(0.975522551744506) },
1585 { FRAC_CONST(0.213509966714943), FRAC_CONST(0.976940885680082) },
1586 { FRAC_CONST(0.207111376192219), FRAC_CONST(0.978317370719628) },
1587 { FRAC_CONST(0.200703913707458), FRAC_CONST(0.979651947899104) },
1588 { FRAC_CONST(0.194287853735029), FRAC_CONST(0.980944560049668) },
1589 { FRAC_CONST(0.187863471117585), FRAC_CONST(0.982195151800116) },
1590 { FRAC_CONST(0.181431041054297), FRAC_CONST(0.983403669579260) },
1591 { FRAC_CONST(0.174990839089060), FRAC_CONST(0.984570061618221) },
1592 { FRAC_CONST(0.168543141098691), FRAC_CONST(0.985694277952645) },
1593 { FRAC_CONST(0.162088223281113), FRAC_CONST(0.986776270424848) },
1594 { FRAC_CONST(0.155626362143520), FRAC_CONST(0.987815992685872) },
1595 { FRAC_CONST(0.149157834490539), FRAC_CONST(0.988813400197476) },
1596 { FRAC_CONST(0.142682917412363), FRAC_CONST(0.989768450234042) },
1597 { FRAC_CONST(0.136201888272891), FRAC_CONST(0.990681101884405) },
1598 { FRAC_CONST(0.129715024697841), FRAC_CONST(0.991551316053606) },
1599 { FRAC_CONST(0.123222604562857), FRAC_CONST(0.992379055464567) },
1600 { FRAC_CONST(0.116724905981611), FRAC_CONST(0.993164284659685) },
1601 { FRAC_CONST(0.110222207293883), FRAC_CONST(0.993906970002356) },
1602 { FRAC_CONST(0.103714787053643), FRAC_CONST(0.994607079678411) },
1603 { FRAC_CONST(0.097202924017115), FRAC_CONST(0.995264583697482) },
1604 { FRAC_CONST(0.090686897130838), FRAC_CONST(0.995879453894286) },
1605 { FRAC_CONST(0.084166985519718), FRAC_CONST(0.996451663929828) },
1606 { FRAC_CONST(0.077643468475068), FRAC_CONST(0.996981189292537) },
1607 { FRAC_CONST(0.071116625442645), FRAC_CONST(0.997468007299307) },
1608 { FRAC_CONST(0.064586736010684), FRAC_CONST(0.997912097096476) },
1609 { FRAC_CONST(0.058054079897912), FRAC_CONST(0.998313439660714) },
1610 { FRAC_CONST(0.051518936941578), FRAC_CONST(0.998672017799843) },
1611 { FRAC_CONST(0.044981587085452), FRAC_CONST(0.998987816153567) },
1612 { FRAC_CONST(0.038442310367847), FRAC_CONST(0.999260821194138) },
1613 { FRAC_CONST(0.031901386909611), FRAC_CONST(0.999491021226926) },
1614 { FRAC_CONST(0.025359096902136), FRAC_CONST(0.999678406390929) },
1615 { FRAC_CONST(0.018815720595351), FRAC_CONST(0.999822968659191) },
1616 { FRAC_CONST(0.012271538285720), FRAC_CONST(0.999924701839145) },
1617 { FRAC_CONST(0.005726830304231), FRAC_CONST(0.999983601572879) }
1618 };
1619 #endif // LD_DEC
1620
1621 /* 60 (N/4) complex twiddle factors */
1622 ALIGN static const complex_t mdct_tab_240[] =
1623 {
1624 { FRAC_CONST(0.999994645401696), FRAC_CONST(0.003272486506527) },
1625 { FRAC_CONST(0.999566308502021), FRAC_CONST(0.029448173247963) },
1626 { FRAC_CONST(0.998452918783950), FRAC_CONST(0.055603677682425) },
1627 { FRAC_CONST(0.996655239309180), FRAC_CONST(0.081721074133668) },
1628 { FRAC_CONST(0.994174502117428), FRAC_CONST(0.107782463042759) },
1629 { FRAC_CONST(0.991012407382049), FRAC_CONST(0.133769983235535) },
1630 { FRAC_CONST(0.987171122244825), FRAC_CONST(0.159665824163761) },
1631 { FRAC_CONST(0.982653279330712), FRAC_CONST(0.185452238111591) },
1632 { FRAC_CONST(0.977461974943572), FRAC_CONST(0.211111552358965) },
1633 { FRAC_CONST(0.971600766944121), FRAC_CONST(0.236626181293610) },
1634 { FRAC_CONST(0.965073672311547), FRAC_CONST(0.261978638463337) },
1635 { FRAC_CONST(0.957885164390477), FRAC_CONST(0.287151548560387) },
1636 { FRAC_CONST(0.950040169825165), FRAC_CONST(0.312127659329594) },
1637 { FRAC_CONST(0.941544065183021), FRAC_CONST(0.336889853392220) },
1638 { FRAC_CONST(0.932402673269775), FRAC_CONST(0.361421159977355) },
1639 { FRAC_CONST(0.922622259138823), FRAC_CONST(0.385704766552831) },
1640 { FRAC_CONST(0.912209525797468), FRAC_CONST(0.409724030347695) },
1641 { FRAC_CONST(0.901171609613013), FRAC_CONST(0.433462489758331) },
1642 { FRAC_CONST(0.889516075421856), FRAC_CONST(0.456903875630421) },
1643 { FRAC_CONST(0.877250911344924), FRAC_CONST(0.480032122409011) },
1644 { FRAC_CONST(0.864384523313017), FRAC_CONST(0.502831379149042) },
1645 { FRAC_CONST(0.850925729305802), FRAC_CONST(0.525286020378792) },
1646 { FRAC_CONST(0.836883753308409), FRAC_CONST(0.547380656808797) },
1647 { FRAC_CONST(0.822268218989775), FRAC_CONST(0.569100145878898) },
1648 { FRAC_CONST(0.807089143107059), FRAC_CONST(0.590429602136201) },
1649 { FRAC_CONST(0.791356928640660), FRAC_CONST(0.611354407436816) },
1650 { FRAC_CONST(0.775082357664531), FRAC_CONST(0.631860220964409) },
1651 { FRAC_CONST(0.758276583956687), FRAC_CONST(0.651932989058674) },
1652 { FRAC_CONST(0.740951125354959), FRAC_CONST(0.671558954847018) },
1653 { FRAC_CONST(0.723117855863248), FRAC_CONST(0.690724667672829) },
1654 { FRAC_CONST(0.704788997513670), FRAC_CONST(0.709416992313883) },
1655 { FRAC_CONST(0.685977111990193), FRAC_CONST(0.727623117984575) },
1656 { FRAC_CONST(0.666695092019479), FRAC_CONST(0.745330567115786) },
1657 { FRAC_CONST(0.646956152534857), FRAC_CONST(0.762527203906388) },
1658 { FRAC_CONST(0.626773821619469), FRAC_CONST(0.779201242640517) },
1659 { FRAC_CONST(0.606161931234795), FRAC_CONST(0.795341255764910) },
1660 { FRAC_CONST(0.585134607740916), FRAC_CONST(0.810936181720784) },
1661 { FRAC_CONST(0.563706262215017), FRAC_CONST(0.825975332524873) },
1662 { FRAC_CONST(0.541891580574752), FRAC_CONST(0.840448401094438) },
1663 { FRAC_CONST(0.519705513513249), FRAC_CONST(0.854345468311227) },
1664 { FRAC_CONST(0.497163266252654), FRAC_CONST(0.867657009819544) },
1665 { FRAC_CONST(0.474280288123229), FRAC_CONST(0.880373902553765) },
1666 { FRAC_CONST(0.451072261975153), FRAC_CONST(0.892487430990834) },
1667 { FRAC_CONST(0.427555093430282), FRAC_CONST(0.903989293123443) },
1668 { FRAC_CONST(0.403744899981227), FRAC_CONST(0.914871606149819) },
1669 { FRAC_CONST(0.379657999945233), FRAC_CONST(0.925126911876195) },
1670 { FRAC_CONST(0.355310901280416), FRAC_CONST(0.934748181828292) },
1671 { FRAC_CONST(0.330720290272038), FRAC_CONST(0.943728822068278) },
1672 { FRAC_CONST(0.305903020096554), FRAC_CONST(0.952062677713924) },
1673 { FRAC_CONST(0.280876099271292), FRAC_CONST(0.959744037156857) },
1674 { FRAC_CONST(0.255656679997665), FRAC_CONST(0.966767635977008) },
1675 { FRAC_CONST(0.230262046405902), FRAC_CONST(0.973128660550580) },
1676 { FRAC_CONST(0.204709602709380), FRAC_CONST(0.978822751349072) },
1677 { FRAC_CONST(0.179016861276633), FRAC_CONST(0.983846005927077) },
1678 { FRAC_CONST(0.153201430629259), FRAC_CONST(0.988194981596825) },
1679 { FRAC_CONST(0.127281003373913), FRAC_CONST(0.991866697787626) },
1680 { FRAC_CONST(0.101273344076683), FRAC_CONST(0.994858638088611) },
1681 { FRAC_CONST(0.075196277088140), FRAC_CONST(0.997168751973348) },
1682 { FRAC_CONST(0.049067674327418), FRAC_CONST(0.998795456205172) },
1683 { FRAC_CONST(0.022905443033697), FRAC_CONST(0.999737635922260) }
1684 };
1685 #endif // ALLOW_SMALL_FRAMELENGTH
1686
1687 #ifdef SSR_DEC
1688 /* 128 (N/4) complex twiddle factors */
1689 ALIGN static const complex_t mdct_tab_512[] =
1690 {
1691 { FRAC_CONST(0.999998823451702), FRAC_CONST(0.001533980186285) },
1692 { FRAC_CONST(0.999904701082853), FRAC_CONST(0.013805388528060) },
1693 { FRAC_CONST(0.999659996743959), FRAC_CONST(0.026074717829104) },
1694 { FRAC_CONST(0.999264747286594), FRAC_CONST(0.038340120373553) },
1695 { FRAC_CONST(0.998719012233873), FRAC_CONST(0.050599749036899) },
1696 { FRAC_CONST(0.998022873771486), FRAC_CONST(0.062851757564161) },
1697 { FRAC_CONST(0.997176436735326), FRAC_CONST(0.075094300847921) },
1698 { FRAC_CONST(0.996179828595697), FRAC_CONST(0.087325535206192) },
1699 { FRAC_CONST(0.995033199438119), FRAC_CONST(0.099543618660069) },
1700 { FRAC_CONST(0.993736721940725), FRAC_CONST(0.111746711211127) },
1701 { FRAC_CONST(0.992290591348257), FRAC_CONST(0.123932975118512) },
1702 { FRAC_CONST(0.990695025442665), FRAC_CONST(0.136100575175706) },
1703 { FRAC_CONST(0.988950264510303), FRAC_CONST(0.148247678986896) },
1704 { FRAC_CONST(0.987056571305751), FRAC_CONST(0.160372457242928) },
1705 { FRAC_CONST(0.985014231012240), FRAC_CONST(0.172473083996796) },
1706 { FRAC_CONST(0.982823551198705), FRAC_CONST(0.184547736938620) },
1707 { FRAC_CONST(0.980484861773469), FRAC_CONST(0.196594597670080) },
1708 { FRAC_CONST(0.977998514934557), FRAC_CONST(0.208611851978263) },
1709 { FRAC_CONST(0.975364885116657), FRAC_CONST(0.220597690108874) },
1710 { FRAC_CONST(0.972584368934732), FRAC_CONST(0.232550307038775) },
1711 { FRAC_CONST(0.969657385124292), FRAC_CONST(0.244467902747824) },
1712 { FRAC_CONST(0.966584374478333), FRAC_CONST(0.256348682489943) },
1713 { FRAC_CONST(0.963365799780954), FRAC_CONST(0.268190857063403) },
1714 { FRAC_CONST(0.960002145737666), FRAC_CONST(0.279992643080273) },
1715 { FRAC_CONST(0.956493918902395), FRAC_CONST(0.291752263234989) },
1716 { FRAC_CONST(0.952841647601199), FRAC_CONST(0.303467946572011) },
1717 { FRAC_CONST(0.949045881852701), FRAC_CONST(0.315137928752522) },
1718 { FRAC_CONST(0.945107193285261), FRAC_CONST(0.326760452320132) },
1719 { FRAC_CONST(0.941026175050889), FRAC_CONST(0.338333766965541) },
1720 { FRAC_CONST(0.936803441735922), FRAC_CONST(0.349856129790135) },
1721 { FRAC_CONST(0.932439629268462), FRAC_CONST(0.361325805568454) },
1722 { FRAC_CONST(0.927935394822618), FRAC_CONST(0.372741067009516) },
1723 { FRAC_CONST(0.923291416719528), FRAC_CONST(0.384100195016935) },
1724 { FRAC_CONST(0.918508394325212), FRAC_CONST(0.395401478947816) },
1725 { FRAC_CONST(0.913587047945251), FRAC_CONST(0.406643216870369) },
1726 { FRAC_CONST(0.908528118716306), FRAC_CONST(0.417823715820212) },
1727 { FRAC_CONST(0.903332368494512), FRAC_CONST(0.428941292055329) },
1728 { FRAC_CONST(0.898000579740740), FRAC_CONST(0.439994271309633) },
1729 { FRAC_CONST(0.892533555402765), FRAC_CONST(0.450980989045104) },
1730 { FRAC_CONST(0.886932118794342), FRAC_CONST(0.461899790702463) },
1731 { FRAC_CONST(0.881197113471222), FRAC_CONST(0.472749031950343) },
1732 { FRAC_CONST(0.875329403104111), FRAC_CONST(0.483527078932919) },
1733 { FRAC_CONST(0.869329871348607), FRAC_CONST(0.494232308515960) },
1734 { FRAC_CONST(0.863199421712124), FRAC_CONST(0.504863108531268) },
1735 { FRAC_CONST(0.856938977417829), FRAC_CONST(0.515417878019463) },
1736 { FRAC_CONST(0.850549481265603), FRAC_CONST(0.525895027471085) },
1737 { FRAC_CONST(0.844031895490066), FRAC_CONST(0.536292979065963) },
1738 { FRAC_CONST(0.837387201615662), FRAC_CONST(0.546610166910835) },
1739 { FRAC_CONST(0.830616400308846), FRAC_CONST(0.556845037275160) },
1740 { FRAC_CONST(0.823720511227391), FRAC_CONST(0.566996048825109) },
1741 { FRAC_CONST(0.816700572866828), FRAC_CONST(0.577061672855679) },
1742 { FRAC_CONST(0.809557642404051), FRAC_CONST(0.587040393520918) },
1743 { FRAC_CONST(0.802292795538116), FRAC_CONST(0.596930708062197) },
1744 { FRAC_CONST(0.794907126328237), FRAC_CONST(0.606731127034524) },
1745 { FRAC_CONST(0.787401747029031), FRAC_CONST(0.616440174530854) },
1746 { FRAC_CONST(0.779777787923015), FRAC_CONST(0.626056388404344) },
1747 { FRAC_CONST(0.772036397150385), FRAC_CONST(0.635578320488556) },
1748 { FRAC_CONST(0.764178740536117), FRAC_CONST(0.645004536815544) },
1749 { FRAC_CONST(0.756206001414395), FRAC_CONST(0.654333617831800) },
1750 { FRAC_CONST(0.748119380450404), FRAC_CONST(0.663564158612040) },
1751 { FRAC_CONST(0.739920095459516), FRAC_CONST(0.672694769070773) },
1752 { FRAC_CONST(0.731609381223893), FRAC_CONST(0.681724074171650) },
1753 { FRAC_CONST(0.723188489306527), FRAC_CONST(0.690650714134535) },
1754 { FRAC_CONST(0.714658687862769), FRAC_CONST(0.699473344640284) },
1755 { FRAC_CONST(0.706021261449340), FRAC_CONST(0.708190637033195) },
1756 { FRAC_CONST(0.697277510830887), FRAC_CONST(0.716801278521100) },
1757 { FRAC_CONST(0.688428752784091), FRAC_CONST(0.725303972373061) },
1758 { FRAC_CONST(0.679476319899365), FRAC_CONST(0.733697438114660) },
1759 { FRAC_CONST(0.670421560380173), FRAC_CONST(0.741980411720831) },
1760 { FRAC_CONST(0.661265837839992), FRAC_CONST(0.750151645806215) },
1761 { FRAC_CONST(0.652010531096960), FRAC_CONST(0.758209909813015) },
1762 { FRAC_CONST(0.642657033966227), FRAC_CONST(0.766153990196313) },
1763 { FRAC_CONST(0.633206755050057), FRAC_CONST(0.773982690606823) },
1764 { FRAC_CONST(0.623661117525695), FRAC_CONST(0.781694832071059) },
1765 { FRAC_CONST(0.614021558931038), FRAC_CONST(0.789289253168886) },
1766 { FRAC_CONST(0.604289530948156), FRAC_CONST(0.796764810208419) },
1767 { FRAC_CONST(0.594466499184665), FRAC_CONST(0.804120377398266) },
1768 { FRAC_CONST(0.584553942953015), FRAC_CONST(0.811354847017064) },
1769 { FRAC_CONST(0.574553355047716), FRAC_CONST(0.818467129580299) },
1770 { FRAC_CONST(0.564466241520520), FRAC_CONST(0.825456154004377) },
1771 { FRAC_CONST(0.554294121453620), FRAC_CONST(0.832320867767930) },
1772 { FRAC_CONST(0.544038526730884), FRAC_CONST(0.839060237070313) },
1773 { FRAC_CONST(0.533701001807153), FRAC_CONST(0.845673246987299) },
1774 { FRAC_CONST(0.523283103475656), FRAC_CONST(0.852158901623920) },
1775 { FRAC_CONST(0.512786400633563), FRAC_CONST(0.858516224264443) },
1776 { FRAC_CONST(0.502212474045711), FRAC_CONST(0.864744257519462) },
1777 { FRAC_CONST(0.491562916106550), FRAC_CONST(0.870842063470079) },
1778 { FRAC_CONST(0.480839330600334), FRAC_CONST(0.876808723809146) },
1779 { FRAC_CONST(0.470043332459596), FRAC_CONST(0.882643339979563) },
1780 { FRAC_CONST(0.459176547521944), FRAC_CONST(0.888345033309596) },
1781 { FRAC_CONST(0.448240612285220), FRAC_CONST(0.893912945145203) },
1782 { FRAC_CONST(0.437237173661044), FRAC_CONST(0.899346236979341) },
1783 { FRAC_CONST(0.426167888726800), FRAC_CONST(0.904644090578246) },
1784 { FRAC_CONST(0.415034424476082), FRAC_CONST(0.909805708104652) },
1785 { FRAC_CONST(0.403838457567654), FRAC_CONST(0.914830312237946) },
1786 { FRAC_CONST(0.392581674072952), FRAC_CONST(0.919717146291227) },
1787 { FRAC_CONST(0.381265769222162), FRAC_CONST(0.924465474325263) },
1788 { FRAC_CONST(0.369892447148934), FRAC_CONST(0.929074581259316) },
1789 { FRAC_CONST(0.358463420633737), FRAC_CONST(0.933543772978836) },
1790 { FRAC_CONST(0.346980410845924), FRAC_CONST(0.937872376439990) },
1791 { FRAC_CONST(0.335445147084532), FRAC_CONST(0.942059739771017) },
1792 { FRAC_CONST(0.323859366517853), FRAC_CONST(0.946105232370403) },
1793 { FRAC_CONST(0.312224813921825), FRAC_CONST(0.950008245001843) },
1794 { FRAC_CONST(0.300543241417273), FRAC_CONST(0.953768189885990) },
1795 { FRAC_CONST(0.288816408206049), FRAC_CONST(0.957384500788976) },
1796 { FRAC_CONST(0.277046080306100), FRAC_CONST(0.960856633107680) },
1797 { FRAC_CONST(0.265234030285512), FRAC_CONST(0.964184063951746) },
1798 { FRAC_CONST(0.253382036995570), FRAC_CONST(0.967366292222329) },
1799 { FRAC_CONST(0.241491885302869), FRAC_CONST(0.970402838687556) },
1800 { FRAC_CONST(0.229565365820519), FRAC_CONST(0.973293246054698) },
1801 { FRAC_CONST(0.217604274638484), FRAC_CONST(0.976037079039039) },
1802 { FRAC_CONST(0.205610413053099), FRAC_CONST(0.978633924429423) },
1803 { FRAC_CONST(0.193585587295804), FRAC_CONST(0.981083391150487) },
1804 { FRAC_CONST(0.181531608261125), FRAC_CONST(0.983385110321551) },
1805 { FRAC_CONST(0.169450291233968), FRAC_CONST(0.985538735312176) },
1806 { FRAC_CONST(0.157343455616238), FRAC_CONST(0.987543941794359) },
1807 { FRAC_CONST(0.145212924652848), FRAC_CONST(0.989400427791380) },
1808 { FRAC_CONST(0.133060525157139), FRAC_CONST(0.991107913723277) },
1809 { FRAC_CONST(0.120888087235777), FRAC_CONST(0.992666142448948) },
1810 { FRAC_CONST(0.108697444013139), FRAC_CONST(0.994074879304879) },
1811 { FRAC_CONST(0.096490431355253), FRAC_CONST(0.995333912140482) },
1812 { FRAC_CONST(0.084268887593324), FRAC_CONST(0.996443051350043) },
1813 { FRAC_CONST(0.072034653246889), FRAC_CONST(0.997402129901275) },
1814 { FRAC_CONST(0.059789570746640), FRAC_CONST(0.998211003360478) },
1815 { FRAC_CONST(0.047535484156959), FRAC_CONST(0.998869549914284) },
1816 { FRAC_CONST(0.035274238898214), FRAC_CONST(0.999377670388003) },
1817 { FRAC_CONST(0.023007681468839), FRAC_CONST(0.999735288260562) },
1818 { FRAC_CONST(0.010737659167265), FRAC_CONST(0.999942349676024) }
1819 };
1820
1821 /* 16 (N/4) complex twiddle factors */
1822 ALIGN static const complex_t mdct_tab_64[] =
1823 {
1824 { FRAC_CONST(0.999924701839145), FRAC_CONST(0.012271538285720) },
1825 { FRAC_CONST(0.993906970002356), FRAC_CONST(0.110222207293883) },
1826 { FRAC_CONST(0.978317370719628), FRAC_CONST(0.207111376192219) },
1827 { FRAC_CONST(0.953306040354194), FRAC_CONST(0.302005949319228) },
1828 { FRAC_CONST(0.919113851690058), FRAC_CONST(0.393992040061048) },
1829 { FRAC_CONST(0.876070094195407), FRAC_CONST(0.482183772079123) },
1830 { FRAC_CONST(0.824589302785025), FRAC_CONST(0.565731810783613) },
1831 { FRAC_CONST(0.765167265622459), FRAC_CONST(0.643831542889791) },
1832 { FRAC_CONST(0.698376249408973), FRAC_CONST(0.715730825283819) },
1833 { FRAC_CONST(0.624859488142386), FRAC_CONST(0.780737228572094) },
1834 { FRAC_CONST(0.545324988422046), FRAC_CONST(0.838224705554838) },
1835 { FRAC_CONST(0.460538710958240), FRAC_CONST(0.887639620402854) },
1836 { FRAC_CONST(0.371317193951838), FRAC_CONST(0.928506080473215) },
1837 { FRAC_CONST(0.278519689385053), FRAC_CONST(0.960430519415566) },
1838 { FRAC_CONST(0.183039887955141), FRAC_CONST(0.983105487431216) },
1839 { FRAC_CONST(0.085797312344440), FRAC_CONST(0.996312612182778) }
1840 };
1841 #endif // SSR_DEC
1842
1843 #else // FIXED_POINT
1844
1845 /* 256 (N/4) complex twiddle factors */
1846 ALIGN static const complex_t mdct_tab_2048[] =
1847 {
1848 { FRAC_CONST(0.031249997702054), FRAC_CONST(0.000011984224612) },
1849 { FRAC_CONST(0.031249813866531), FRAC_CONST(0.000107857810004) },
1850 { FRAC_CONST(0.031249335895858), FRAC_CONST(0.000203730380198) },
1851 { FRAC_CONST(0.031248563794535), FRAC_CONST(0.000299601032804) },
1852 { FRAC_CONST(0.031247497569829), FRAC_CONST(0.000395468865451) },
1853 { FRAC_CONST(0.031246137231775), FRAC_CONST(0.000491332975794) },
1854 { FRAC_CONST(0.031244482793177), FRAC_CONST(0.000587192461525) },
1855 { FRAC_CONST(0.031242534269608), FRAC_CONST(0.000683046420376) },
1856 { FRAC_CONST(0.031240291679407), FRAC_CONST(0.000778893950134) },
1857 { FRAC_CONST(0.031237755043684), FRAC_CONST(0.000874734148645) },
1858 { FRAC_CONST(0.031234924386313), FRAC_CONST(0.000970566113826) },
1859 { FRAC_CONST(0.031231799733938), FRAC_CONST(0.001066388943669) },
1860 { FRAC_CONST(0.031228381115970), FRAC_CONST(0.001162201736253) },
1861 { FRAC_CONST(0.031224668564585), FRAC_CONST(0.001258003589751) },
1862 { FRAC_CONST(0.031220662114728), FRAC_CONST(0.001353793602441) },
1863 { FRAC_CONST(0.031216361804108), FRAC_CONST(0.001449570872710) },
1864 { FRAC_CONST(0.031211767673203), FRAC_CONST(0.001545334499065) },
1865 { FRAC_CONST(0.031206879765253), FRAC_CONST(0.001641083580144) },
1866 { FRAC_CONST(0.031201698126266), FRAC_CONST(0.001736817214719) },
1867 { FRAC_CONST(0.031196222805014), FRAC_CONST(0.001832534501709) },
1868 { FRAC_CONST(0.031190453853031), FRAC_CONST(0.001928234540186) },
1869 { FRAC_CONST(0.031184391324617), FRAC_CONST(0.002023916429386) },
1870 { FRAC_CONST(0.031178035276836), FRAC_CONST(0.002119579268713) },
1871 { FRAC_CONST(0.031171385769513), FRAC_CONST(0.002215222157753) },
1872 { FRAC_CONST(0.031164442865236), FRAC_CONST(0.002310844196278) },
1873 { FRAC_CONST(0.031157206629353), FRAC_CONST(0.002406444484258) },
1874 { FRAC_CONST(0.031149677129975), FRAC_CONST(0.002502022121865) },
1875 { FRAC_CONST(0.031141854437973), FRAC_CONST(0.002597576209488) },
1876 { FRAC_CONST(0.031133738626977), FRAC_CONST(0.002693105847734) },
1877 { FRAC_CONST(0.031125329773375), FRAC_CONST(0.002788610137442) },
1878 { FRAC_CONST(0.031116627956316), FRAC_CONST(0.002884088179689) },
1879 { FRAC_CONST(0.031107633257703), FRAC_CONST(0.002979539075801) },
1880 { FRAC_CONST(0.031098345762200), FRAC_CONST(0.003074961927355) },
1881 { FRAC_CONST(0.031088765557222), FRAC_CONST(0.003170355836197) },
1882 { FRAC_CONST(0.031078892732942), FRAC_CONST(0.003265719904442) },
1883 { FRAC_CONST(0.031068727382288), FRAC_CONST(0.003361053234488) },
1884 { FRAC_CONST(0.031058269600939), FRAC_CONST(0.003456354929021) },
1885 { FRAC_CONST(0.031047519487329), FRAC_CONST(0.003551624091024) },
1886 { FRAC_CONST(0.031036477142640), FRAC_CONST(0.003646859823790) },
1887 { FRAC_CONST(0.031025142670809), FRAC_CONST(0.003742061230921) },
1888 { FRAC_CONST(0.031013516178519), FRAC_CONST(0.003837227416347) },
1889 { FRAC_CONST(0.031001597775203), FRAC_CONST(0.003932357484328) },
1890 { FRAC_CONST(0.030989387573042), FRAC_CONST(0.004027450539462) },
1891 { FRAC_CONST(0.030976885686963), FRAC_CONST(0.004122505686697) },
1892 { FRAC_CONST(0.030964092234638), FRAC_CONST(0.004217522031340) },
1893 { FRAC_CONST(0.030951007336485), FRAC_CONST(0.004312498679058) },
1894 { FRAC_CONST(0.030937631115663), FRAC_CONST(0.004407434735897) },
1895 { FRAC_CONST(0.030923963698074), FRAC_CONST(0.004502329308281) },
1896 { FRAC_CONST(0.030910005212362), FRAC_CONST(0.004597181503027) },
1897 { FRAC_CONST(0.030895755789908), FRAC_CONST(0.004691990427350) },
1898 { FRAC_CONST(0.030881215564835), FRAC_CONST(0.004786755188872) },
1899 { FRAC_CONST(0.030866384674000), FRAC_CONST(0.004881474895632) },
1900 { FRAC_CONST(0.030851263256996), FRAC_CONST(0.004976148656090) },
1901 { FRAC_CONST(0.030835851456154), FRAC_CONST(0.005070775579142) },
1902 { FRAC_CONST(0.030820149416533), FRAC_CONST(0.005165354774124) },
1903 { FRAC_CONST(0.030804157285929), FRAC_CONST(0.005259885350819) },
1904 { FRAC_CONST(0.030787875214864), FRAC_CONST(0.005354366419469) },
1905 { FRAC_CONST(0.030771303356593), FRAC_CONST(0.005448797090784) },
1906 { FRAC_CONST(0.030754441867095), FRAC_CONST(0.005543176475946) },
1907 { FRAC_CONST(0.030737290905077), FRAC_CONST(0.005637503686619) },
1908 { FRAC_CONST(0.030719850631972), FRAC_CONST(0.005731777834961) },
1909 { FRAC_CONST(0.030702121211932), FRAC_CONST(0.005825998033626) },
1910 { FRAC_CONST(0.030684102811835), FRAC_CONST(0.005920163395780) },
1911 { FRAC_CONST(0.030665795601276), FRAC_CONST(0.006014273035101) },
1912 { FRAC_CONST(0.030647199752570), FRAC_CONST(0.006108326065793) },
1913 { FRAC_CONST(0.030628315440748), FRAC_CONST(0.006202321602594) },
1914 { FRAC_CONST(0.030609142843557), FRAC_CONST(0.006296258760782) },
1915 { FRAC_CONST(0.030589682141455), FRAC_CONST(0.006390136656185) },
1916 { FRAC_CONST(0.030569933517616), FRAC_CONST(0.006483954405188) },
1917 { FRAC_CONST(0.030549897157919), FRAC_CONST(0.006577711124743) },
1918 { FRAC_CONST(0.030529573250956), FRAC_CONST(0.006671405932375) },
1919 { FRAC_CONST(0.030508961988022), FRAC_CONST(0.006765037946194) },
1920 { FRAC_CONST(0.030488063563118), FRAC_CONST(0.006858606284900) },
1921 { FRAC_CONST(0.030466878172949), FRAC_CONST(0.006952110067791) },
1922 { FRAC_CONST(0.030445406016919), FRAC_CONST(0.007045548414774) },
1923 { FRAC_CONST(0.030423647297133), FRAC_CONST(0.007138920446372) },
1924 { FRAC_CONST(0.030401602218392), FRAC_CONST(0.007232225283733) },
1925 { FRAC_CONST(0.030379270988192), FRAC_CONST(0.007325462048634) },
1926 { FRAC_CONST(0.030356653816724), FRAC_CONST(0.007418629863497) },
1927 { FRAC_CONST(0.030333750916869), FRAC_CONST(0.007511727851390) },
1928 { FRAC_CONST(0.030310562504198), FRAC_CONST(0.007604755136040) },
1929 { FRAC_CONST(0.030287088796968), FRAC_CONST(0.007697710841838) },
1930 { FRAC_CONST(0.030263330016124), FRAC_CONST(0.007790594093851) },
1931 { FRAC_CONST(0.030239286385293), FRAC_CONST(0.007883404017824) },
1932 { FRAC_CONST(0.030214958130781), FRAC_CONST(0.007976139740197) },
1933 { FRAC_CONST(0.030190345481576), FRAC_CONST(0.008068800388104) },
1934 { FRAC_CONST(0.030165448669342), FRAC_CONST(0.008161385089390) },
1935 { FRAC_CONST(0.030140267928416), FRAC_CONST(0.008253892972610) },
1936 { FRAC_CONST(0.030114803495809), FRAC_CONST(0.008346323167047) },
1937 { FRAC_CONST(0.030089055611203), FRAC_CONST(0.008438674802711) },
1938 { FRAC_CONST(0.030063024516947), FRAC_CONST(0.008530947010354) },
1939 { FRAC_CONST(0.030036710458054), FRAC_CONST(0.008623138921475) },
1940 { FRAC_CONST(0.030010113682202), FRAC_CONST(0.008715249668328) },
1941 { FRAC_CONST(0.029983234439732), FRAC_CONST(0.008807278383932) },
1942 { FRAC_CONST(0.029956072983640), FRAC_CONST(0.008899224202078) },
1943 { FRAC_CONST(0.029928629569580), FRAC_CONST(0.008991086257336) },
1944 { FRAC_CONST(0.029900904455860), FRAC_CONST(0.009082863685067) },
1945 { FRAC_CONST(0.029872897903441), FRAC_CONST(0.009174555621425) },
1946 { FRAC_CONST(0.029844610175929), FRAC_CONST(0.009266161203371) },
1947 { FRAC_CONST(0.029816041539579), FRAC_CONST(0.009357679568679) },
1948 { FRAC_CONST(0.029787192263292), FRAC_CONST(0.009449109855944) },
1949 { FRAC_CONST(0.029758062618606), FRAC_CONST(0.009540451204587) },
1950 { FRAC_CONST(0.029728652879702), FRAC_CONST(0.009631702754871) },
1951 { FRAC_CONST(0.029698963323395), FRAC_CONST(0.009722863647900) },
1952 { FRAC_CONST(0.029668994229134), FRAC_CONST(0.009813933025633) },
1953 { FRAC_CONST(0.029638745879000), FRAC_CONST(0.009904910030891) },
1954 { FRAC_CONST(0.029608218557702), FRAC_CONST(0.009995793807363) },
1955 { FRAC_CONST(0.029577412552575), FRAC_CONST(0.010086583499618) },
1956 { FRAC_CONST(0.029546328153577), FRAC_CONST(0.010177278253107) },
1957 { FRAC_CONST(0.029514965653285), FRAC_CONST(0.010267877214177) },
1958 { FRAC_CONST(0.029483325346896), FRAC_CONST(0.010358379530076) },
1959 { FRAC_CONST(0.029451407532220), FRAC_CONST(0.010448784348962) },
1960 { FRAC_CONST(0.029419212509679), FRAC_CONST(0.010539090819911) },
1961 { FRAC_CONST(0.029386740582307), FRAC_CONST(0.010629298092923) },
1962 { FRAC_CONST(0.029353992055740), FRAC_CONST(0.010719405318933) },
1963 { FRAC_CONST(0.029320967238220), FRAC_CONST(0.010809411649818) },
1964 { FRAC_CONST(0.029287666440590), FRAC_CONST(0.010899316238403) },
1965 { FRAC_CONST(0.029254089976290), FRAC_CONST(0.010989118238474) },
1966 { FRAC_CONST(0.029220238161353), FRAC_CONST(0.011078816804778) },
1967 { FRAC_CONST(0.029186111314406), FRAC_CONST(0.011168411093039) },
1968 { FRAC_CONST(0.029151709756664), FRAC_CONST(0.011257900259961) },
1969 { FRAC_CONST(0.029117033811927), FRAC_CONST(0.011347283463239) },
1970 { FRAC_CONST(0.029082083806579), FRAC_CONST(0.011436559861563) },
1971 { FRAC_CONST(0.029046860069582), FRAC_CONST(0.011525728614630) },
1972 { FRAC_CONST(0.029011362932476), FRAC_CONST(0.011614788883150) },
1973 { FRAC_CONST(0.028975592729373), FRAC_CONST(0.011703739828853) },
1974 { FRAC_CONST(0.028939549796957), FRAC_CONST(0.011792580614500) },
1975 { FRAC_CONST(0.028903234474475), FRAC_CONST(0.011881310403886) },
1976 { FRAC_CONST(0.028866647103744), FRAC_CONST(0.011969928361855) },
1977 { FRAC_CONST(0.028829788029135), FRAC_CONST(0.012058433654299) },
1978 { FRAC_CONST(0.028792657597583), FRAC_CONST(0.012146825448172) },
1979 { FRAC_CONST(0.028755256158571), FRAC_CONST(0.012235102911499) },
1980 { FRAC_CONST(0.028717584064137), FRAC_CONST(0.012323265213377) },
1981 { FRAC_CONST(0.028679641668864), FRAC_CONST(0.012411311523990) },
1982 { FRAC_CONST(0.028641429329882), FRAC_CONST(0.012499241014612) },
1983 { FRAC_CONST(0.028602947406859), FRAC_CONST(0.012587052857618) },
1984 { FRAC_CONST(0.028564196262001), FRAC_CONST(0.012674746226488) },
1985 { FRAC_CONST(0.028525176260050), FRAC_CONST(0.012762320295819) },
1986 { FRAC_CONST(0.028485887768276), FRAC_CONST(0.012849774241331) },
1987 { FRAC_CONST(0.028446331156478), FRAC_CONST(0.012937107239875) },
1988 { FRAC_CONST(0.028406506796976), FRAC_CONST(0.013024318469437) },
1989 { FRAC_CONST(0.028366415064615), FRAC_CONST(0.013111407109155) },
1990 { FRAC_CONST(0.028326056336751), FRAC_CONST(0.013198372339315) },
1991 { FRAC_CONST(0.028285430993258), FRAC_CONST(0.013285213341368) },
1992 { FRAC_CONST(0.028244539416515), FRAC_CONST(0.013371929297933) },
1993 { FRAC_CONST(0.028203381991411), FRAC_CONST(0.013458519392807) },
1994 { FRAC_CONST(0.028161959105334), FRAC_CONST(0.013544982810971) },
1995 { FRAC_CONST(0.028120271148172), FRAC_CONST(0.013631318738598) },
1996 { FRAC_CONST(0.028078318512309), FRAC_CONST(0.013717526363062) },
1997 { FRAC_CONST(0.028036101592619), FRAC_CONST(0.013803604872943) },
1998 { FRAC_CONST(0.027993620786463), FRAC_CONST(0.013889553458039) },
1999 { FRAC_CONST(0.027950876493687), FRAC_CONST(0.013975371309367) },
2000 { FRAC_CONST(0.027907869116616), FRAC_CONST(0.014061057619178) },
2001 { FRAC_CONST(0.027864599060052), FRAC_CONST(0.014146611580959) },
2002 { FRAC_CONST(0.027821066731270), FRAC_CONST(0.014232032389445) },
2003 { FRAC_CONST(0.027777272540012), FRAC_CONST(0.014317319240622) },
2004 { FRAC_CONST(0.027733216898487), FRAC_CONST(0.014402471331737) },
2005 { FRAC_CONST(0.027688900221361), FRAC_CONST(0.014487487861307) },
2006 { FRAC_CONST(0.027644322925762), FRAC_CONST(0.014572368029123) },
2007 { FRAC_CONST(0.027599485431266), FRAC_CONST(0.014657111036262) },
2008 { FRAC_CONST(0.027554388159903), FRAC_CONST(0.014741716085090) },
2009 { FRAC_CONST(0.027509031536144), FRAC_CONST(0.014826182379271) },
2010 { FRAC_CONST(0.027463415986904), FRAC_CONST(0.014910509123778) },
2011 { FRAC_CONST(0.027417541941533), FRAC_CONST(0.014994695524894) },
2012 { FRAC_CONST(0.027371409831816), FRAC_CONST(0.015078740790225) },
2013 { FRAC_CONST(0.027325020091965), FRAC_CONST(0.015162644128704) },
2014 { FRAC_CONST(0.027278373158618), FRAC_CONST(0.015246404750603) },
2015 { FRAC_CONST(0.027231469470833), FRAC_CONST(0.015330021867534) },
2016 { FRAC_CONST(0.027184309470088), FRAC_CONST(0.015413494692460) },
2017 { FRAC_CONST(0.027136893600268), FRAC_CONST(0.015496822439704) },
2018 { FRAC_CONST(0.027089222307671), FRAC_CONST(0.015580004324954) },
2019 { FRAC_CONST(0.027041296040997), FRAC_CONST(0.015663039565269) },
2020 { FRAC_CONST(0.026993115251345), FRAC_CONST(0.015745927379091) },
2021 { FRAC_CONST(0.026944680392213), FRAC_CONST(0.015828666986247) },
2022 { FRAC_CONST(0.026895991919487), FRAC_CONST(0.015911257607961) },
2023 { FRAC_CONST(0.026847050291442), FRAC_CONST(0.015993698466859) },
2024 { FRAC_CONST(0.026797855968734), FRAC_CONST(0.016075988786976) },
2025 { FRAC_CONST(0.026748409414401), FRAC_CONST(0.016158127793763) },
2026 { FRAC_CONST(0.026698711093851), FRAC_CONST(0.016240114714099) },
2027 { FRAC_CONST(0.026648761474864), FRAC_CONST(0.016321948776289) },
2028 { FRAC_CONST(0.026598561027585), FRAC_CONST(0.016403629210082) },
2029 { FRAC_CONST(0.026548110224519), FRAC_CONST(0.016485155246669) },
2030 { FRAC_CONST(0.026497409540530), FRAC_CONST(0.016566526118696) },
2031 { FRAC_CONST(0.026446459452830), FRAC_CONST(0.016647741060271) },
2032 { FRAC_CONST(0.026395260440982), FRAC_CONST(0.016728799306966) },
2033 { FRAC_CONST(0.026343812986890), FRAC_CONST(0.016809700095831) },
2034 { FRAC_CONST(0.026292117574797), FRAC_CONST(0.016890442665397) },
2035 { FRAC_CONST(0.026240174691280), FRAC_CONST(0.016971026255683) },
2036 { FRAC_CONST(0.026187984825246), FRAC_CONST(0.017051450108208) },
2037 { FRAC_CONST(0.026135548467924), FRAC_CONST(0.017131713465990) },
2038 { FRAC_CONST(0.026082866112867), FRAC_CONST(0.017211815573560) },
2039 { FRAC_CONST(0.026029938255941), FRAC_CONST(0.017291755676967) },
2040 { FRAC_CONST(0.025976765395322), FRAC_CONST(0.017371533023784) },
2041 { FRAC_CONST(0.025923348031494), FRAC_CONST(0.017451146863116) },
2042 { FRAC_CONST(0.025869686667242), FRAC_CONST(0.017530596445607) },
2043 { FRAC_CONST(0.025815781807646), FRAC_CONST(0.017609881023449) },
2044 { FRAC_CONST(0.025761633960080), FRAC_CONST(0.017688999850383) },
2045 { FRAC_CONST(0.025707243634204), FRAC_CONST(0.017767952181715) },
2046 { FRAC_CONST(0.025652611341960), FRAC_CONST(0.017846737274313) },
2047 { FRAC_CONST(0.025597737597568), FRAC_CONST(0.017925354386623) },
2048 { FRAC_CONST(0.025542622917522), FRAC_CONST(0.018003802778671) },
2049 { FRAC_CONST(0.025487267820581), FRAC_CONST(0.018082081712071) },
2050 { FRAC_CONST(0.025431672827768), FRAC_CONST(0.018160190450031) },
2051 { FRAC_CONST(0.025375838462365), FRAC_CONST(0.018238128257362) },
2052 { FRAC_CONST(0.025319765249906), FRAC_CONST(0.018315894400484) },
2053 { FRAC_CONST(0.025263453718173), FRAC_CONST(0.018393488147432) },
2054 { FRAC_CONST(0.025206904397193), FRAC_CONST(0.018470908767865) },
2055 { FRAC_CONST(0.025150117819228), FRAC_CONST(0.018548155533070) },
2056 { FRAC_CONST(0.025093094518776), FRAC_CONST(0.018625227715971) },
2057 { FRAC_CONST(0.025035835032562), FRAC_CONST(0.018702124591135) },
2058 { FRAC_CONST(0.024978339899534), FRAC_CONST(0.018778845434780) },
2059 { FRAC_CONST(0.024920609660858), FRAC_CONST(0.018855389524780) },
2060 { FRAC_CONST(0.024862644859912), FRAC_CONST(0.018931756140672) },
2061 { FRAC_CONST(0.024804446042284), FRAC_CONST(0.019007944563666) },
2062 { FRAC_CONST(0.024746013755764), FRAC_CONST(0.019083954076646) },
2063 { FRAC_CONST(0.024687348550337), FRAC_CONST(0.019159783964183) },
2064 { FRAC_CONST(0.024628450978184), FRAC_CONST(0.019235433512536) },
2065 { FRAC_CONST(0.024569321593670), FRAC_CONST(0.019310902009663) },
2066 { FRAC_CONST(0.024509960953345), FRAC_CONST(0.019386188745225) },
2067 { FRAC_CONST(0.024450369615932), FRAC_CONST(0.019461293010596) },
2068 { FRAC_CONST(0.024390548142329), FRAC_CONST(0.019536214098866) },
2069 { FRAC_CONST(0.024330497095598), FRAC_CONST(0.019610951304848) },
2070 { FRAC_CONST(0.024270217040961), FRAC_CONST(0.019685503925087) },
2071 { FRAC_CONST(0.024209708545799), FRAC_CONST(0.019759871257867) },
2072 { FRAC_CONST(0.024148972179639), FRAC_CONST(0.019834052603212) },
2073 { FRAC_CONST(0.024088008514157), FRAC_CONST(0.019908047262901) },
2074 { FRAC_CONST(0.024026818123164), FRAC_CONST(0.019981854540467) },
2075 { FRAC_CONST(0.023965401582609), FRAC_CONST(0.020055473741208) },
2076 { FRAC_CONST(0.023903759470567), FRAC_CONST(0.020128904172192) },
2077 { FRAC_CONST(0.023841892367236), FRAC_CONST(0.020202145142264) },
2078 { FRAC_CONST(0.023779800854935), FRAC_CONST(0.020275195962052) },
2079 { FRAC_CONST(0.023717485518092), FRAC_CONST(0.020348055943974) },
2080 { FRAC_CONST(0.023654946943242), FRAC_CONST(0.020420724402244) },
2081 { FRAC_CONST(0.023592185719023), FRAC_CONST(0.020493200652878) },
2082 { FRAC_CONST(0.023529202436167), FRAC_CONST(0.020565484013703) },
2083 { FRAC_CONST(0.023465997687496), FRAC_CONST(0.020637573804361) },
2084 { FRAC_CONST(0.023402572067918), FRAC_CONST(0.020709469346314) },
2085 { FRAC_CONST(0.023338926174419), FRAC_CONST(0.020781169962854) },
2086 { FRAC_CONST(0.023275060606058), FRAC_CONST(0.020852674979108) },
2087 { FRAC_CONST(0.023210975963963), FRAC_CONST(0.020923983722044) },
2088 { FRAC_CONST(0.023146672851322), FRAC_CONST(0.020995095520475) },
2089 { FRAC_CONST(0.023082151873380), FRAC_CONST(0.021066009705072) },
2090 { FRAC_CONST(0.023017413637435), FRAC_CONST(0.021136725608363) },
2091 { FRAC_CONST(0.022952458752826), FRAC_CONST(0.021207242564742) },
2092 { FRAC_CONST(0.022887287830934), FRAC_CONST(0.021277559910478) },
2093 { FRAC_CONST(0.022821901485173), FRAC_CONST(0.021347676983716) },
2094 { FRAC_CONST(0.022756300330983), FRAC_CONST(0.021417593124488) },
2095 { FRAC_CONST(0.022690484985827), FRAC_CONST(0.021487307674717) },
2096 { FRAC_CONST(0.022624456069185), FRAC_CONST(0.021556819978223) },
2097 { FRAC_CONST(0.022558214202547), FRAC_CONST(0.021626129380729) },
2098 { FRAC_CONST(0.022491760009405), FRAC_CONST(0.021695235229869) },
2099 { FRAC_CONST(0.022425094115252), FRAC_CONST(0.021764136875192) },
2100 { FRAC_CONST(0.022358217147572), FRAC_CONST(0.021832833668171) },
2101 { FRAC_CONST(0.022291129735838), FRAC_CONST(0.021901324962204) },
2102 { FRAC_CONST(0.022223832511501), FRAC_CONST(0.021969610112625) },
2103 { FRAC_CONST(0.022156326107988), FRAC_CONST(0.022037688476709) },
2104 { FRAC_CONST(0.022088611160696), FRAC_CONST(0.022105559413676) },
2105 { FRAC_CONST(0.022020688306983), FRAC_CONST(0.022173222284699) },
2106 { FRAC_CONST(0.021952558186166), FRAC_CONST(0.022240676452909) },
2107 { FRAC_CONST(0.021884221439510), FRAC_CONST(0.022307921283403) },
2108 { FRAC_CONST(0.021815678710228), FRAC_CONST(0.022374956143245) },
2109 { FRAC_CONST(0.021746930643469), FRAC_CONST(0.022441780401478) },
2110 { FRAC_CONST(0.021677977886316), FRAC_CONST(0.022508393429127) },
2111 { FRAC_CONST(0.021608821087780), FRAC_CONST(0.022574794599206) },
2112 { FRAC_CONST(0.021539460898790), FRAC_CONST(0.022640983286719) },
2113 { FRAC_CONST(0.021469897972190), FRAC_CONST(0.022706958868676) },
2114 { FRAC_CONST(0.021400132962735), FRAC_CONST(0.022772720724087) },
2115 { FRAC_CONST(0.021330166527077), FRAC_CONST(0.022838268233979) },
2116 { FRAC_CONST(0.021259999323769), FRAC_CONST(0.022903600781391) },
2117 { FRAC_CONST(0.021189632013250), FRAC_CONST(0.022968717751391) },
2118 { FRAC_CONST(0.021119065257845), FRAC_CONST(0.023033618531071) },
2119 { FRAC_CONST(0.021048299721754), FRAC_CONST(0.023098302509561) },
2120 { FRAC_CONST(0.020977336071050), FRAC_CONST(0.023162769078031) },
2121 { FRAC_CONST(0.020906174973670), FRAC_CONST(0.023227017629698) },
2122 { FRAC_CONST(0.020834817099409), FRAC_CONST(0.023291047559828) },
2123 { FRAC_CONST(0.020763263119915), FRAC_CONST(0.023354858265748) },
2124 { FRAC_CONST(0.020691513708680), FRAC_CONST(0.023418449146848) },
2125 { FRAC_CONST(0.020619569541038), FRAC_CONST(0.023481819604585) },
2126 { FRAC_CONST(0.020547431294155), FRAC_CONST(0.023544969042494) },
2127 { FRAC_CONST(0.020475099647023), FRAC_CONST(0.023607896866186) },
2128 { FRAC_CONST(0.020402575280455), FRAC_CONST(0.023670602483363) },
2129 { FRAC_CONST(0.020329858877078), FRAC_CONST(0.023733085303813) },
2130 { FRAC_CONST(0.020256951121327), FRAC_CONST(0.023795344739427) },
2131 { FRAC_CONST(0.020183852699437), FRAC_CONST(0.023857380204193) },
2132 { FRAC_CONST(0.020110564299439), FRAC_CONST(0.023919191114211) },
2133 { FRAC_CONST(0.020037086611150), FRAC_CONST(0.023980776887692) },
2134 { FRAC_CONST(0.019963420326171), FRAC_CONST(0.024042136944968) },
2135 { FRAC_CONST(0.019889566137877), FRAC_CONST(0.024103270708495) },
2136 { FRAC_CONST(0.019815524741412), FRAC_CONST(0.024164177602859) },
2137 { FRAC_CONST(0.019741296833681), FRAC_CONST(0.024224857054779) },
2138 { FRAC_CONST(0.019666883113346), FRAC_CONST(0.024285308493120) },
2139 { FRAC_CONST(0.019592284280817), FRAC_CONST(0.024345531348888) },
2140 { FRAC_CONST(0.019517501038246), FRAC_CONST(0.024405525055242) },
2141 { FRAC_CONST(0.019442534089523), FRAC_CONST(0.024465289047500) },
2142 { FRAC_CONST(0.019367384140264), FRAC_CONST(0.024524822763141) },
2143 { FRAC_CONST(0.019292051897809), FRAC_CONST(0.024584125641809) },
2144 { FRAC_CONST(0.019216538071215), FRAC_CONST(0.024643197125323) },
2145 { FRAC_CONST(0.019140843371246), FRAC_CONST(0.024702036657681) },
2146 { FRAC_CONST(0.019064968510369), FRAC_CONST(0.024760643685063) },
2147 { FRAC_CONST(0.018988914202748), FRAC_CONST(0.024819017655836) },
2148 { FRAC_CONST(0.018912681164234), FRAC_CONST(0.024877158020562) },
2149 { FRAC_CONST(0.018836270112363), FRAC_CONST(0.024935064232003) },
2150 { FRAC_CONST(0.018759681766343), FRAC_CONST(0.024992735745123) },
2151 { FRAC_CONST(0.018682916847054), FRAC_CONST(0.025050172017095) },
2152 { FRAC_CONST(0.018605976077037), FRAC_CONST(0.025107372507308) },
2153 { FRAC_CONST(0.018528860180486), FRAC_CONST(0.025164336677369) },
2154 { FRAC_CONST(0.018451569883247), FRAC_CONST(0.025221063991110) },
2155 { FRAC_CONST(0.018374105912805), FRAC_CONST(0.025277553914591) },
2156 { FRAC_CONST(0.018296468998280), FRAC_CONST(0.025333805916107) },
2157 { FRAC_CONST(0.018218659870421), FRAC_CONST(0.025389819466194) },
2158 { FRAC_CONST(0.018140679261596), FRAC_CONST(0.025445594037630) },
2159 { FRAC_CONST(0.018062527905790), FRAC_CONST(0.025501129105445) },
2160 { FRAC_CONST(0.017984206538592), FRAC_CONST(0.025556424146920) },
2161 { FRAC_CONST(0.017905715897192), FRAC_CONST(0.025611478641598) },
2162 { FRAC_CONST(0.017827056720375), FRAC_CONST(0.025666292071285) },
2163 { FRAC_CONST(0.017748229748511), FRAC_CONST(0.025720863920056) },
2164 { FRAC_CONST(0.017669235723550), FRAC_CONST(0.025775193674260) },
2165 { FRAC_CONST(0.017590075389012), FRAC_CONST(0.025829280822525) },
2166 { FRAC_CONST(0.017510749489986), FRAC_CONST(0.025883124855762) },
2167 { FRAC_CONST(0.017431258773116), FRAC_CONST(0.025936725267170) },
2168 { FRAC_CONST(0.017351603986600), FRAC_CONST(0.025990081552242) },
2169 { FRAC_CONST(0.017271785880180), FRAC_CONST(0.026043193208768) },
2170 { FRAC_CONST(0.017191805205132), FRAC_CONST(0.026096059736841) },
2171 { FRAC_CONST(0.017111662714267), FRAC_CONST(0.026148680638861) },
2172 { FRAC_CONST(0.017031359161915), FRAC_CONST(0.026201055419541) },
2173 { FRAC_CONST(0.016950895303924), FRAC_CONST(0.026253183585908) },
2174 { FRAC_CONST(0.016870271897651), FRAC_CONST(0.026305064647313) },
2175 { FRAC_CONST(0.016789489701954), FRAC_CONST(0.026356698115431) },
2176 { FRAC_CONST(0.016708549477186), FRAC_CONST(0.026408083504269) },
2177 { FRAC_CONST(0.016627451985187), FRAC_CONST(0.026459220330167) },
2178 { FRAC_CONST(0.016546197989277), FRAC_CONST(0.026510108111806) },
2179 { FRAC_CONST(0.016464788254250), FRAC_CONST(0.026560746370212) },
2180 { FRAC_CONST(0.016383223546365), FRAC_CONST(0.026611134628757) },
2181 { FRAC_CONST(0.016301504633341), FRAC_CONST(0.026661272413168) },
2182 { FRAC_CONST(0.016219632284346), FRAC_CONST(0.026711159251530) },
2183 { FRAC_CONST(0.016137607269996), FRAC_CONST(0.026760794674288) },
2184 { FRAC_CONST(0.016055430362340), FRAC_CONST(0.026810178214254) },
2185 { FRAC_CONST(0.015973102334858), FRAC_CONST(0.026859309406613) },
2186 { FRAC_CONST(0.015890623962454), FRAC_CONST(0.026908187788922) },
2187 { FRAC_CONST(0.015807996021446), FRAC_CONST(0.026956812901119) },
2188 { FRAC_CONST(0.015725219289558), FRAC_CONST(0.027005184285527) },
2189 { FRAC_CONST(0.015642294545918), FRAC_CONST(0.027053301486856) },
2190 { FRAC_CONST(0.015559222571044), FRAC_CONST(0.027101164052208) },
2191 { FRAC_CONST(0.015476004146842), FRAC_CONST(0.027148771531083) },
2192 { FRAC_CONST(0.015392640056594), FRAC_CONST(0.027196123475380) },
2193 { FRAC_CONST(0.015309131084956), FRAC_CONST(0.027243219439406) },
2194 { FRAC_CONST(0.015225478017946), FRAC_CONST(0.027290058979875) },
2195 { FRAC_CONST(0.015141681642938), FRAC_CONST(0.027336641655915) },
2196 { FRAC_CONST(0.015057742748656), FRAC_CONST(0.027382967029073) },
2197 { FRAC_CONST(0.014973662125164), FRAC_CONST(0.027429034663317) },
2198 { FRAC_CONST(0.014889440563862), FRAC_CONST(0.027474844125040) },
2199 { FRAC_CONST(0.014805078857474), FRAC_CONST(0.027520394983066) },
2200 { FRAC_CONST(0.014720577800046), FRAC_CONST(0.027565686808654) },
2201 { FRAC_CONST(0.014635938186934), FRAC_CONST(0.027610719175499) },
2202 { FRAC_CONST(0.014551160814797), FRAC_CONST(0.027655491659740) },
2203 { FRAC_CONST(0.014466246481592), FRAC_CONST(0.027700003839960) },
2204 { FRAC_CONST(0.014381195986567), FRAC_CONST(0.027744255297195) },
2205 { FRAC_CONST(0.014296010130247), FRAC_CONST(0.027788245614933) },
2206 { FRAC_CONST(0.014210689714436), FRAC_CONST(0.027831974379120) },
2207 { FRAC_CONST(0.014125235542201), FRAC_CONST(0.027875441178165) },
2208 { FRAC_CONST(0.014039648417870), FRAC_CONST(0.027918645602941) },
2209 { FRAC_CONST(0.013953929147020), FRAC_CONST(0.027961587246792) },
2210 { FRAC_CONST(0.013868078536476), FRAC_CONST(0.028004265705534) },
2211 { FRAC_CONST(0.013782097394294), FRAC_CONST(0.028046680577462) },
2212 { FRAC_CONST(0.013695986529763), FRAC_CONST(0.028088831463351) },
2213 { FRAC_CONST(0.013609746753390), FRAC_CONST(0.028130717966461) },
2214 { FRAC_CONST(0.013523378876898), FRAC_CONST(0.028172339692540) },
2215 { FRAC_CONST(0.013436883713214), FRAC_CONST(0.028213696249828) },
2216 { FRAC_CONST(0.013350262076462), FRAC_CONST(0.028254787249062) },
2217 { FRAC_CONST(0.013263514781960), FRAC_CONST(0.028295612303478) },
2218 { FRAC_CONST(0.013176642646205), FRAC_CONST(0.028336171028814) },
2219 { FRAC_CONST(0.013089646486871), FRAC_CONST(0.028376463043317) },
2220 { FRAC_CONST(0.013002527122799), FRAC_CONST(0.028416487967743) },
2221 { FRAC_CONST(0.012915285373990), FRAC_CONST(0.028456245425361) },
2222 { FRAC_CONST(0.012827922061597), FRAC_CONST(0.028495735041960) },
2223 { FRAC_CONST(0.012740438007915), FRAC_CONST(0.028534956445849) },
2224 { FRAC_CONST(0.012652834036379), FRAC_CONST(0.028573909267859) },
2225 { FRAC_CONST(0.012565110971550), FRAC_CONST(0.028612593141354) },
2226 { FRAC_CONST(0.012477269639111), FRAC_CONST(0.028651007702224) },
2227 { FRAC_CONST(0.012389310865858), FRAC_CONST(0.028689152588899) },
2228 { FRAC_CONST(0.012301235479693), FRAC_CONST(0.028727027442343) },
2229 { FRAC_CONST(0.012213044309615), FRAC_CONST(0.028764631906065) },
2230 { FRAC_CONST(0.012124738185712), FRAC_CONST(0.028801965626115) },
2231 { FRAC_CONST(0.012036317939156), FRAC_CONST(0.028839028251097) },
2232 { FRAC_CONST(0.011947784402191), FRAC_CONST(0.028875819432161) },
2233 { FRAC_CONST(0.011859138408130), FRAC_CONST(0.028912338823015) },
2234 { FRAC_CONST(0.011770380791341), FRAC_CONST(0.028948586079925) },
2235 { FRAC_CONST(0.011681512387245), FRAC_CONST(0.028984560861718) },
2236 { FRAC_CONST(0.011592534032306), FRAC_CONST(0.029020262829785) },
2237 { FRAC_CONST(0.011503446564022), FRAC_CONST(0.029055691648087) },
2238 { FRAC_CONST(0.011414250820918), FRAC_CONST(0.029090846983152) },
2239 { FRAC_CONST(0.011324947642537), FRAC_CONST(0.029125728504087) },
2240 { FRAC_CONST(0.011235537869437), FRAC_CONST(0.029160335882573) },
2241 { FRAC_CONST(0.011146022343175), FRAC_CONST(0.029194668792871) },
2242 { FRAC_CONST(0.011056401906305), FRAC_CONST(0.029228726911828) },
2243 { FRAC_CONST(0.010966677402371), FRAC_CONST(0.029262509918876) },
2244 { FRAC_CONST(0.010876849675891), FRAC_CONST(0.029296017496036) },
2245 { FRAC_CONST(0.010786919572361), FRAC_CONST(0.029329249327922) },
2246 { FRAC_CONST(0.010696887938235), FRAC_CONST(0.029362205101743) },
2247 { FRAC_CONST(0.010606755620926), FRAC_CONST(0.029394884507308) },
2248 { FRAC_CONST(0.010516523468793), FRAC_CONST(0.029427287237024) },
2249 { FRAC_CONST(0.010426192331137), FRAC_CONST(0.029459412985906) },
2250 { FRAC_CONST(0.010335763058187), FRAC_CONST(0.029491261451573) },
2251 { FRAC_CONST(0.010245236501099), FRAC_CONST(0.029522832334255) },
2252 { FRAC_CONST(0.010154613511943), FRAC_CONST(0.029554125336796) },
2253 { FRAC_CONST(0.010063894943698), FRAC_CONST(0.029585140164654) },
2254 { FRAC_CONST(0.009973081650240), FRAC_CONST(0.029615876525905) },
2255 { FRAC_CONST(0.009882174486340), FRAC_CONST(0.029646334131247) },
2256 { FRAC_CONST(0.009791174307650), FRAC_CONST(0.029676512694001) },
2257 { FRAC_CONST(0.009700081970699), FRAC_CONST(0.029706411930116) },
2258 { FRAC_CONST(0.009608898332881), FRAC_CONST(0.029736031558168) },
2259 { FRAC_CONST(0.009517624252453), FRAC_CONST(0.029765371299366) },
2260 { FRAC_CONST(0.009426260588521), FRAC_CONST(0.029794430877553) },
2261 { FRAC_CONST(0.009334808201034), FRAC_CONST(0.029823210019210) },
2262 { FRAC_CONST(0.009243267950778), FRAC_CONST(0.029851708453456) },
2263 { FRAC_CONST(0.009151640699363), FRAC_CONST(0.029879925912053) },
2264 { FRAC_CONST(0.009059927309220), FRAC_CONST(0.029907862129408) },
2265 { FRAC_CONST(0.008968128643591), FRAC_CONST(0.029935516842573) },
2266 { FRAC_CONST(0.008876245566520), FRAC_CONST(0.029962889791254) },
2267 { FRAC_CONST(0.008784278942845), FRAC_CONST(0.029989980717805) },
2268 { FRAC_CONST(0.008692229638191), FRAC_CONST(0.030016789367235) },
2269 { FRAC_CONST(0.008600098518961), FRAC_CONST(0.030043315487212) },
2270 { FRAC_CONST(0.008507886452329), FRAC_CONST(0.030069558828062) },
2271 { FRAC_CONST(0.008415594306230), FRAC_CONST(0.030095519142772) },
2272 { FRAC_CONST(0.008323222949351), FRAC_CONST(0.030121196186994) },
2273 { FRAC_CONST(0.008230773251129), FRAC_CONST(0.030146589719046) },
2274 { FRAC_CONST(0.008138246081733), FRAC_CONST(0.030171699499915) },
2275 { FRAC_CONST(0.008045642312067), FRAC_CONST(0.030196525293257) },
2276 { FRAC_CONST(0.007952962813750), FRAC_CONST(0.030221066865402) },
2277 { FRAC_CONST(0.007860208459119), FRAC_CONST(0.030245323985357) },
2278 { FRAC_CONST(0.007767380121212), FRAC_CONST(0.030269296424803) },
2279 { FRAC_CONST(0.007674478673766), FRAC_CONST(0.030292983958103) },
2280 { FRAC_CONST(0.007581504991203), FRAC_CONST(0.030316386362302) },
2281 { FRAC_CONST(0.007488459948628), FRAC_CONST(0.030339503417126) },
2282 { FRAC_CONST(0.007395344421816), FRAC_CONST(0.030362334904989) },
2283 { FRAC_CONST(0.007302159287206), FRAC_CONST(0.030384880610993) },
2284 { FRAC_CONST(0.007208905421891), FRAC_CONST(0.030407140322928) },
2285 { FRAC_CONST(0.007115583703613), FRAC_CONST(0.030429113831278) },
2286 { FRAC_CONST(0.007022195010752), FRAC_CONST(0.030450800929220) },
2287 { FRAC_CONST(0.006928740222316), FRAC_CONST(0.030472201412626) },
2288 { FRAC_CONST(0.006835220217939), FRAC_CONST(0.030493315080068) },
2289 { FRAC_CONST(0.006741635877866), FRAC_CONST(0.030514141732814) },
2290 { FRAC_CONST(0.006647988082948), FRAC_CONST(0.030534681174838) },
2291 { FRAC_CONST(0.006554277714635), FRAC_CONST(0.030554933212813) },
2292 { FRAC_CONST(0.006460505654964), FRAC_CONST(0.030574897656119) },
2293 { FRAC_CONST(0.006366672786553), FRAC_CONST(0.030594574316845) },
2294 { FRAC_CONST(0.006272779992593), FRAC_CONST(0.030613963009786) },
2295 { FRAC_CONST(0.006178828156839), FRAC_CONST(0.030633063552447) },
2296 { FRAC_CONST(0.006084818163601), FRAC_CONST(0.030651875765048) },
2297 { FRAC_CONST(0.005990750897737), FRAC_CONST(0.030670399470520) },
2298 { FRAC_CONST(0.005896627244644), FRAC_CONST(0.030688634494512) },
2299 { FRAC_CONST(0.005802448090250), FRAC_CONST(0.030706580665388) },
2300 { FRAC_CONST(0.005708214321004), FRAC_CONST(0.030724237814232) },
2301 { FRAC_CONST(0.005613926823871), FRAC_CONST(0.030741605774849) },
2302 { FRAC_CONST(0.005519586486321), FRAC_CONST(0.030758684383764) },
2303 { FRAC_CONST(0.005425194196321), FRAC_CONST(0.030775473480228) },
2304 { FRAC_CONST(0.005330750842327), FRAC_CONST(0.030791972906214) },
2305 { FRAC_CONST(0.005236257313276), FRAC_CONST(0.030808182506425) },
2306 { FRAC_CONST(0.005141714498576), FRAC_CONST(0.030824102128288) },
2307 { FRAC_CONST(0.005047123288102), FRAC_CONST(0.030839731621963) },
2308 { FRAC_CONST(0.004952484572181), FRAC_CONST(0.030855070840339) },
2309 { FRAC_CONST(0.004857799241589), FRAC_CONST(0.030870119639036) },
2310 { FRAC_CONST(0.004763068187541), FRAC_CONST(0.030884877876411) },
2311 { FRAC_CONST(0.004668292301681), FRAC_CONST(0.030899345413553) },
2312 { FRAC_CONST(0.004573472476075), FRAC_CONST(0.030913522114288) },
2313 { FRAC_CONST(0.004478609603205), FRAC_CONST(0.030927407845180) },
2314 { FRAC_CONST(0.004383704575956), FRAC_CONST(0.030941002475530) },
2315 { FRAC_CONST(0.004288758287610), FRAC_CONST(0.030954305877381) },
2316 { FRAC_CONST(0.004193771631837), FRAC_CONST(0.030967317925516) },
2317 { FRAC_CONST(0.004098745502689), FRAC_CONST(0.030980038497461) },
2318 { FRAC_CONST(0.004003680794587), FRAC_CONST(0.030992467473486) },
2319 { FRAC_CONST(0.003908578402316), FRAC_CONST(0.031004604736602) },
2320 { FRAC_CONST(0.003813439221017), FRAC_CONST(0.031016450172571) },
2321 { FRAC_CONST(0.003718264146176), FRAC_CONST(0.031028003669899) },
2322 { FRAC_CONST(0.003623054073616), FRAC_CONST(0.031039265119839) },
2323 { FRAC_CONST(0.003527809899492), FRAC_CONST(0.031050234416394) },
2324 { FRAC_CONST(0.003432532520278), FRAC_CONST(0.031060911456318) },
2325 { FRAC_CONST(0.003337222832760), FRAC_CONST(0.031071296139114) },
2326 { FRAC_CONST(0.003241881734029), FRAC_CONST(0.031081388367037) },
2327 { FRAC_CONST(0.003146510121474), FRAC_CONST(0.031091188045095) },
2328 { FRAC_CONST(0.003051108892766), FRAC_CONST(0.031100695081051) },
2329 { FRAC_CONST(0.002955678945860), FRAC_CONST(0.031109909385419) },
2330 { FRAC_CONST(0.002860221178978), FRAC_CONST(0.031118830871473) },
2331 { FRAC_CONST(0.002764736490604), FRAC_CONST(0.031127459455239) },
2332 { FRAC_CONST(0.002669225779478), FRAC_CONST(0.031135795055501) },
2333 { FRAC_CONST(0.002573689944583), FRAC_CONST(0.031143837593803) },
2334 { FRAC_CONST(0.002478129885137), FRAC_CONST(0.031151586994444) },
2335 { FRAC_CONST(0.002382546500589), FRAC_CONST(0.031159043184484) },
2336 { FRAC_CONST(0.002286940690606), FRAC_CONST(0.031166206093743) },
2337 { FRAC_CONST(0.002191313355067), FRAC_CONST(0.031173075654800) },
2338 { FRAC_CONST(0.002095665394051), FRAC_CONST(0.031179651802998) },
2339 { FRAC_CONST(0.001999997707835), FRAC_CONST(0.031185934476438) },
2340 { FRAC_CONST(0.001904311196878), FRAC_CONST(0.031191923615985) },
2341 { FRAC_CONST(0.001808606761820), FRAC_CONST(0.031197619165268) },
2342 { FRAC_CONST(0.001712885303465), FRAC_CONST(0.031203021070678) },
2343 { FRAC_CONST(0.001617147722782), FRAC_CONST(0.031208129281370) },
2344 { FRAC_CONST(0.001521394920889), FRAC_CONST(0.031212943749264) },
2345 { FRAC_CONST(0.001425627799047), FRAC_CONST(0.031217464429043) },
2346 { FRAC_CONST(0.001329847258653), FRAC_CONST(0.031221691278159) },
2347 { FRAC_CONST(0.001234054201231), FRAC_CONST(0.031225624256825) },
2348 { FRAC_CONST(0.001138249528420), FRAC_CONST(0.031229263328024) },
2349 { FRAC_CONST(0.001042434141971), FRAC_CONST(0.031232608457502) },
2350 { FRAC_CONST(0.000946608943736), FRAC_CONST(0.031235659613775) },
2351 { FRAC_CONST(0.000850774835656), FRAC_CONST(0.031238416768124) },
2352 { FRAC_CONST(0.000754932719759), FRAC_CONST(0.031240879894597) },
2353 { FRAC_CONST(0.000659083498149), FRAC_CONST(0.031243048970010) },
2354 { FRAC_CONST(0.000563228072993), FRAC_CONST(0.031244923973948) },
2355 { FRAC_CONST(0.000467367346520), FRAC_CONST(0.031246504888762) },
2356 { FRAC_CONST(0.000371502221008), FRAC_CONST(0.031247791699571) },
2357 { FRAC_CONST(0.000275633598775), FRAC_CONST(0.031248784394264) },
2358 { FRAC_CONST(0.000179762382174), FRAC_CONST(0.031249482963498) },
2359 { FRAC_CONST(0.000083889473581), FRAC_CONST(0.031249887400697) }
2360 };
2361
2362 /* 64 (N/4) complex twiddle factors */
2363 ALIGN static const complex_t mdct_tab_256[] =
2364 {
2365 { FRAC_CONST(0.088387931675923), FRAC_CONST(0.000271171628935) },
2366 { FRAC_CONST(0.088354655998507), FRAC_CONST(0.002440238387037) },
2367 { FRAC_CONST(0.088268158780110), FRAC_CONST(0.004607835236780) },
2368 { FRAC_CONST(0.088128492123423), FRAC_CONST(0.006772656498875) },
2369 { FRAC_CONST(0.087935740158418), FRAC_CONST(0.008933398165942) },
2370 { FRAC_CONST(0.087690018991670), FRAC_CONST(0.011088758687994) },
2371 { FRAC_CONST(0.087391476636423), FRAC_CONST(0.013237439756448) },
2372 { FRAC_CONST(0.087040292923427), FRAC_CONST(0.015378147086172) },
2373 { FRAC_CONST(0.086636679392621), FRAC_CONST(0.017509591195118) },
2374 { FRAC_CONST(0.086180879165703), FRAC_CONST(0.019630488181053) },
2375 { FRAC_CONST(0.085673166799686), FRAC_CONST(0.021739560494940) },
2376 { FRAC_CONST(0.085113848121515), FRAC_CONST(0.023835537710479) },
2377 { FRAC_CONST(0.084503260043847), FRAC_CONST(0.025917157289369) },
2378 { FRAC_CONST(0.083841770362110), FRAC_CONST(0.027983165341813) },
2379 { FRAC_CONST(0.083129777532952), FRAC_CONST(0.030032317381813) },
2380 { FRAC_CONST(0.082367710434230), FRAC_CONST(0.032063379076803) },
2381 { FRAC_CONST(0.081556028106671), FRAC_CONST(0.034075126991164) },
2382 { FRAC_CONST(0.080695219477356), FRAC_CONST(0.036066349323177) },
2383 { FRAC_CONST(0.079785803065216), FRAC_CONST(0.038035846634965) },
2384 { FRAC_CONST(0.078828326668693), FRAC_CONST(0.039982432574992) },
2385 { FRAC_CONST(0.077823367035766), FRAC_CONST(0.041904934592675) },
2386 { FRAC_CONST(0.076771529516540), FRAC_CONST(0.043802194644686) },
2387 { FRAC_CONST(0.075673447698606), FRAC_CONST(0.045673069892513) },
2388 { FRAC_CONST(0.074529783025390), FRAC_CONST(0.047516433390863) },
2389 { FRAC_CONST(0.073341224397728), FRAC_CONST(0.049331174766491) },
2390 { FRAC_CONST(0.072108487758894), FRAC_CONST(0.051116200887052) },
2391 { FRAC_CONST(0.070832315663343), FRAC_CONST(0.052870436519557) },
2392 { FRAC_CONST(0.069513476829429), FRAC_CONST(0.054592824978055) },
2393 { FRAC_CONST(0.068152765676348), FRAC_CONST(0.056282328760143) },
2394 { FRAC_CONST(0.066751001845620), FRAC_CONST(0.057937930171918) },
2395 { FRAC_CONST(0.065309029707361), FRAC_CONST(0.059558631940996) },
2396 { FRAC_CONST(0.063827717851668), FRAC_CONST(0.061143457817234) },
2397 { FRAC_CONST(0.062307958565413), FRAC_CONST(0.062691453160784) },
2398 { FRAC_CONST(0.060750667294763), FRAC_CONST(0.064201685517134) },
2399 { FRAC_CONST(0.059156782093749), FRAC_CONST(0.065673245178784) },
2400 { FRAC_CONST(0.057527263059216), FRAC_CONST(0.067105245733220) },
2401 { FRAC_CONST(0.055863091752499), FRAC_CONST(0.068496824596852) },
2402 { FRAC_CONST(0.054165270608165), FRAC_CONST(0.069847143534609) },
2403 { FRAC_CONST(0.052434822330188), FRAC_CONST(0.071155389164853) },
2404 { FRAC_CONST(0.050672789275903), FRAC_CONST(0.072420773449336) },
2405 { FRAC_CONST(0.048880232828135), FRAC_CONST(0.073642534167879) },
2406 { FRAC_CONST(0.047058232755862), FRAC_CONST(0.074819935377512) },
2407 { FRAC_CONST(0.045207886563797), FRAC_CONST(0.075952267855771) },
2408 { FRAC_CONST(0.043330308831298), FRAC_CONST(0.077038849527912) },
2409 { FRAC_CONST(0.041426630540984), FRAC_CONST(0.078079025877766) },
2410 { FRAC_CONST(0.039497998397473), FRAC_CONST(0.079072170341994) },
2411 { FRAC_CONST(0.037545574136653), FRAC_CONST(0.080017684687506) },
2412 { FRAC_CONST(0.035570533825892), FRAC_CONST(0.080914999371817) },
2413 { FRAC_CONST(0.033574067155622), FRAC_CONST(0.081763573886112) },
2414 { FRAC_CONST(0.031557376722714), FRAC_CONST(0.082562897080836) },
2415 { FRAC_CONST(0.029521677306074), FRAC_CONST(0.083312487473584) },
2416 { FRAC_CONST(0.027468195134911), FRAC_CONST(0.084011893539132) },
2417 { FRAC_CONST(0.025398167150101), FRAC_CONST(0.084660693981419) },
2418 { FRAC_CONST(0.023312840259098), FRAC_CONST(0.085258497987320) },
2419 { FRAC_CONST(0.021213470584847), FRAC_CONST(0.085804945462053) },
2420 { FRAC_CONST(0.019101322709138), FRAC_CONST(0.086299707246093) },
2421 { FRAC_CONST(0.016977668910873), FRAC_CONST(0.086742485313442) },
2422 { FRAC_CONST(0.014843788399692), FRAC_CONST(0.087133012951149) },
2423 { FRAC_CONST(0.012700966545425), FRAC_CONST(0.087471054919968) },
2424 { FRAC_CONST(0.010550494103830), FRAC_CONST(0.087756407596056) },
2425 { FRAC_CONST(0.008393666439096), FRAC_CONST(0.087988899093631) },
2426 { FRAC_CONST(0.006231782743558), FRAC_CONST(0.088168389368510) },
2427 { FRAC_CONST(0.004066145255116), FRAC_CONST(0.088294770302461) },
2428 { FRAC_CONST(0.001898058472816), FRAC_CONST(0.088367965768336) }
2429 };
2430
2431 #ifdef LD_DEC
2432 /* 128 (N/4) complex twiddle factors */
2433 ALIGN static const complex_t mdct_tab_1024[] =
2434 {
2435 { FRAC_CONST(0.044194160825012), FRAC_CONST(0.000033896503468) },
2436 { FRAC_CONST(0.044193120897389), FRAC_CONST(0.000305066138364) },
2437 { FRAC_CONST(0.044190417123742), FRAC_CONST(0.000576224287693) },
2438 { FRAC_CONST(0.044186049605866), FRAC_CONST(0.000847360742503) },
2439 { FRAC_CONST(0.044180018508197), FRAC_CONST(0.001118465294660) },
2440 { FRAC_CONST(0.044172324057802), FRAC_CONST(0.001389527737231) },
2441 { FRAC_CONST(0.044162966544372), FRAC_CONST(0.001660537864867) },
2442 { FRAC_CONST(0.044151946320213), FRAC_CONST(0.001931485474192) },
2443 { FRAC_CONST(0.044139263800230), FRAC_CONST(0.002202360364180) },
2444 { FRAC_CONST(0.044124919461912), FRAC_CONST(0.002473152336546) },
2445 { FRAC_CONST(0.044108913845316), FRAC_CONST(0.002743851196123) },
2446 { FRAC_CONST(0.044091247553044), FRAC_CONST(0.003014446751254) },
2447 { FRAC_CONST(0.044071921250223), FRAC_CONST(0.003284928814169) },
2448 { FRAC_CONST(0.044050935664476), FRAC_CONST(0.003555287201370) },
2449 { FRAC_CONST(0.044028291585898), FRAC_CONST(0.003825511734018) },
2450 { FRAC_CONST(0.044003989867028), FRAC_CONST(0.004095592238311) },
2451 { FRAC_CONST(0.043978031422810), FRAC_CONST(0.004365518545871) },
2452 { FRAC_CONST(0.043950417230565), FRAC_CONST(0.004635280494126) },
2453 { FRAC_CONST(0.043921148329953), FRAC_CONST(0.004904867926689) },
2454 { FRAC_CONST(0.043890225822930), FRAC_CONST(0.005174270693748) },
2455 { FRAC_CONST(0.043857650873712), FRAC_CONST(0.005443478652439) },
2456 { FRAC_CONST(0.043823424708727), FRAC_CONST(0.005712481667236) },
2457 { FRAC_CONST(0.043787548616571), FRAC_CONST(0.005981269610326) },
2458 { FRAC_CONST(0.043750023947958), FRAC_CONST(0.006249832361997) },
2459 { FRAC_CONST(0.043710852115672), FRAC_CONST(0.006518159811011) },
2460 { FRAC_CONST(0.043670034594508), FRAC_CONST(0.006786241854993) },
2461 { FRAC_CONST(0.043627572921225), FRAC_CONST(0.007054068400804) },
2462 { FRAC_CONST(0.043583468694479), FRAC_CONST(0.007321629364927) },
2463 { FRAC_CONST(0.043537723574771), FRAC_CONST(0.007588914673843) },
2464 { FRAC_CONST(0.043490339284377), FRAC_CONST(0.007855914264410) },
2465 { FRAC_CONST(0.043441317607290), FRAC_CONST(0.008122618084246) },
2466 { FRAC_CONST(0.043390660389149), FRAC_CONST(0.008389016092101) },
2467 { FRAC_CONST(0.043338369537168), FRAC_CONST(0.008655098258243) },
2468 { FRAC_CONST(0.043284447020070), FRAC_CONST(0.008920854564826) },
2469 { FRAC_CONST(0.043228894868005), FRAC_CONST(0.009186275006278) },
2470 { FRAC_CONST(0.043171715172482), FRAC_CONST(0.009451349589667) },
2471 { FRAC_CONST(0.043112910086283), FRAC_CONST(0.009716068335087) },
2472 { FRAC_CONST(0.043052481823387), FRAC_CONST(0.009980421276025) },
2473 { FRAC_CONST(0.042990432658884), FRAC_CONST(0.010244398459743) },
2474 { FRAC_CONST(0.042926764928889), FRAC_CONST(0.010507989947649) },
2475 { FRAC_CONST(0.042861481030457), FRAC_CONST(0.010771185815673) },
2476 { FRAC_CONST(0.042794583421490), FRAC_CONST(0.011033976154639) },
2477 { FRAC_CONST(0.042726074620644), FRAC_CONST(0.011296351070639) },
2478 { FRAC_CONST(0.042655957207238), FRAC_CONST(0.011558300685406) },
2479 { FRAC_CONST(0.042584233821153), FRAC_CONST(0.011819815136685) },
2480 { FRAC_CONST(0.042510907162732), FRAC_CONST(0.012080884578604) },
2481 { FRAC_CONST(0.042435979992684), FRAC_CONST(0.012341499182048) },
2482 { FRAC_CONST(0.042359455131975), FRAC_CONST(0.012601649135022) },
2483 { FRAC_CONST(0.042281335461721), FRAC_CONST(0.012861324643029) },
2484 { FRAC_CONST(0.042201623923085), FRAC_CONST(0.013120515929433) },
2485 { FRAC_CONST(0.042120323517160), FRAC_CONST(0.013379213235827) },
2486 { FRAC_CONST(0.042037437304862), FRAC_CONST(0.013637406822406) },
2487 { FRAC_CONST(0.041952968406809), FRAC_CONST(0.013895086968325) },
2488 { FRAC_CONST(0.041866920003207), FRAC_CONST(0.014152243972073) },
2489 { FRAC_CONST(0.041779295333730), FRAC_CONST(0.014408868151835) },
2490 { FRAC_CONST(0.041690097697398), FRAC_CONST(0.014664949845855) },
2491 { FRAC_CONST(0.041599330452450), FRAC_CONST(0.014920479412801) },
2492 { FRAC_CONST(0.041506997016224), FRAC_CONST(0.015175447232131) },
2493 { FRAC_CONST(0.041413100865019), FRAC_CONST(0.015429843704450) },
2494 { FRAC_CONST(0.041317645533974), FRAC_CONST(0.015683659251874) },
2495 { FRAC_CONST(0.041220634616927), FRAC_CONST(0.015936884318392) },
2496 { FRAC_CONST(0.041122071766285), FRAC_CONST(0.016189509370223) },
2497 { FRAC_CONST(0.041021960692883), FRAC_CONST(0.016441524896177) },
2498 { FRAC_CONST(0.040920305165846), FRAC_CONST(0.016692921408010) },
2499 { FRAC_CONST(0.040817109012449), FRAC_CONST(0.016943689440788) },
2500 { FRAC_CONST(0.040712376117967), FRAC_CONST(0.017193819553235) },
2501 { FRAC_CONST(0.040606110425535), FRAC_CONST(0.017443302328094) },
2502 { FRAC_CONST(0.040498315935996), FRAC_CONST(0.017692128372479) },
2503 { FRAC_CONST(0.040388996707752), FRAC_CONST(0.017940288318230) },
2504 { FRAC_CONST(0.040278156856609), FRAC_CONST(0.018187772822267) },
2505 { FRAC_CONST(0.040165800555627), FRAC_CONST(0.018434572566936) },
2506 { FRAC_CONST(0.040051932034955), FRAC_CONST(0.018680678260367) },
2507 { FRAC_CONST(0.039936555581679), FRAC_CONST(0.018926080636820) },
2508 { FRAC_CONST(0.039819675539659), FRAC_CONST(0.019170770457035) },
2509 { FRAC_CONST(0.039701296309360), FRAC_CONST(0.019414738508577) },
2510 { FRAC_CONST(0.039581422347694), FRAC_CONST(0.019657975606187) },
2511 { FRAC_CONST(0.039460058167849), FRAC_CONST(0.019900472592126) },
2512 { FRAC_CONST(0.039337208339116), FRAC_CONST(0.020142220336521) },
2513 { FRAC_CONST(0.039212877486723), FRAC_CONST(0.020383209737704) },
2514 { FRAC_CONST(0.039087070291656), FRAC_CONST(0.020623431722561) },
2515 { FRAC_CONST(0.038959791490485), FRAC_CONST(0.020862877246870) },
2516 { FRAC_CONST(0.038831045875184), FRAC_CONST(0.021101537295642) },
2517 { FRAC_CONST(0.038700838292953), FRAC_CONST(0.021339402883462) },
2518 { FRAC_CONST(0.038569173646034), FRAC_CONST(0.021576465054824) },
2519 { FRAC_CONST(0.038436056891527), FRAC_CONST(0.021812714884472) },
2520 { FRAC_CONST(0.038301493041202), FRAC_CONST(0.022048143477734) },
2521 { FRAC_CONST(0.038165487161312), FRAC_CONST(0.022282741970855) },
2522 { FRAC_CONST(0.038028044372402), FRAC_CONST(0.022516501531335) },
2523 { FRAC_CONST(0.037889169849115), FRAC_CONST(0.022749413358259) },
2524 { FRAC_CONST(0.037748868819998), FRAC_CONST(0.022981468682628) },
2525 { FRAC_CONST(0.037607146567305), FRAC_CONST(0.023212658767690) },
2526 { FRAC_CONST(0.037464008426800), FRAC_CONST(0.023442974909269) },
2527 { FRAC_CONST(0.037319459787553), FRAC_CONST(0.023672408436094) },
2528 { FRAC_CONST(0.037173506091737), FRAC_CONST(0.023900950710120) },
2529 { FRAC_CONST(0.037026152834428), FRAC_CONST(0.024128593126861) },
2530 { FRAC_CONST(0.036877405563392), FRAC_CONST(0.024355327115708) },
2531 { FRAC_CONST(0.036727269878879), FRAC_CONST(0.024581144140255) },
2532 { FRAC_CONST(0.036575751433414), FRAC_CONST(0.024806035698618) },
2533 { FRAC_CONST(0.036422855931580), FRAC_CONST(0.025029993323758) },
2534 { FRAC_CONST(0.036268589129807), FRAC_CONST(0.025253008583796) },
2535 { FRAC_CONST(0.036112956836151), FRAC_CONST(0.025475073082334) },
2536 { FRAC_CONST(0.035955964910083), FRAC_CONST(0.025696178458769) },
2537 { FRAC_CONST(0.035797619262257), FRAC_CONST(0.025916316388609) },
2538 { FRAC_CONST(0.035637925854300), FRAC_CONST(0.026135478583784) },
2539 { FRAC_CONST(0.035476890698576), FRAC_CONST(0.026353656792963) },
2540 { FRAC_CONST(0.035314519857970), FRAC_CONST(0.026570842801858) },
2541 { FRAC_CONST(0.035150819445650), FRAC_CONST(0.026787028433540) },
2542 { FRAC_CONST(0.034985795624846), FRAC_CONST(0.027002205548742) },
2543 { FRAC_CONST(0.034819454608610), FRAC_CONST(0.027216366046166) },
2544 { FRAC_CONST(0.034651802659589), FRAC_CONST(0.027429501862792) },
2545 { FRAC_CONST(0.034482846089783), FRAC_CONST(0.027641604974175) },
2546 { FRAC_CONST(0.034312591260311), FRAC_CONST(0.027852667394755) },
2547 { FRAC_CONST(0.034141044581172), FRAC_CONST(0.028062681178149) },
2548 { FRAC_CONST(0.033968212511001), FRAC_CONST(0.028271638417458) },
2549 { FRAC_CONST(0.033794101556828), FRAC_CONST(0.028479531245560) },
2550 { FRAC_CONST(0.033618718273831), FRAC_CONST(0.028686351835407) },
2551 { FRAC_CONST(0.033442069265093), FRAC_CONST(0.028892092400321) },
2552 { FRAC_CONST(0.033264161181349), FRAC_CONST(0.029096745194286) },
2553 { FRAC_CONST(0.033085000720737), FRAC_CONST(0.029300302512241) },
2554 { FRAC_CONST(0.032904594628548), FRAC_CONST(0.029502756690366) },
2555 { FRAC_CONST(0.032722949696969), FRAC_CONST(0.029704100106376) },
2556 { FRAC_CONST(0.032540072764829), FRAC_CONST(0.029904325179807) },
2557 { FRAC_CONST(0.032355970717341), FRAC_CONST(0.030103424372297) },
2558 { FRAC_CONST(0.032170650485843), FRAC_CONST(0.030301390187873) },
2559 { FRAC_CONST(0.031984119047537), FRAC_CONST(0.030498215173235) },
2560 { FRAC_CONST(0.031796383425227), FRAC_CONST(0.030693891918034) },
2561 { FRAC_CONST(0.031607450687052), FRAC_CONST(0.030888413055150) },
2562 { FRAC_CONST(0.031417327946223), FRAC_CONST(0.031081771260973) },
2563 { FRAC_CONST(0.031226022360754), FRAC_CONST(0.031273959255676) },
2564 { FRAC_CONST(0.031033541133193), FRAC_CONST(0.031464969803488) },
2565 { FRAC_CONST(0.030839891510348), FRAC_CONST(0.031654795712972) },
2566 { FRAC_CONST(0.030645080783018), FRAC_CONST(0.031843429837288) },
2567 { FRAC_CONST(0.030449116285718), FRAC_CONST(0.032030865074469) },
2568 { FRAC_CONST(0.030252005396399), FRAC_CONST(0.032217094367684) },
2569 { FRAC_CONST(0.030053755536176), FRAC_CONST(0.032402110705505) },
2570 { FRAC_CONST(0.029854374169043), FRAC_CONST(0.032585907122172) },
2571 { FRAC_CONST(0.029653868801596), FRAC_CONST(0.032768476697853) },
2572 { FRAC_CONST(0.029452246982750), FRAC_CONST(0.032949812558907) },
2573 { FRAC_CONST(0.029249516303451), FRAC_CONST(0.033129907878142) },
2574 { FRAC_CONST(0.029045684396395), FRAC_CONST(0.033308755875070) },
2575 { FRAC_CONST(0.028840758935738), FRAC_CONST(0.033486349816166) },
2576 { FRAC_CONST(0.028634747636808), FRAC_CONST(0.033662683015118) },
2577 { FRAC_CONST(0.028427658255815), FRAC_CONST(0.033837748833080) },
2578 { FRAC_CONST(0.028219498589555), FRAC_CONST(0.034011540678924) },
2579 { FRAC_CONST(0.028010276475123), FRAC_CONST(0.034184052009485) },
2580 { FRAC_CONST(0.027799999789613), FRAC_CONST(0.034355276329809) },
2581 { FRAC_CONST(0.027588676449824), FRAC_CONST(0.034525207193396) },
2582 { FRAC_CONST(0.027376314411959), FRAC_CONST(0.034693838202447) },
2583 { FRAC_CONST(0.027162921671330), FRAC_CONST(0.034861163008098) },
2584 { FRAC_CONST(0.026948506262053), FRAC_CONST(0.035027175310665) },
2585 { FRAC_CONST(0.026733076256746), FRAC_CONST(0.035191868859880) },
2586 { FRAC_CONST(0.026516639766228), FRAC_CONST(0.035355237455122) },
2587 { FRAC_CONST(0.026299204939210), FRAC_CONST(0.035517274945657) },
2588 { FRAC_CONST(0.026080779961991), FRAC_CONST(0.035677975230865) },
2589 { FRAC_CONST(0.025861373058146), FRAC_CONST(0.035837332260471) },
2590 { FRAC_CONST(0.025640992488223), FRAC_CONST(0.035995340034772) },
2591 { FRAC_CONST(0.025419646549425), FRAC_CONST(0.036151992604866) },
2592 { FRAC_CONST(0.025197343575302), FRAC_CONST(0.036307284072871) },
2593 { FRAC_CONST(0.024974091935435), FRAC_CONST(0.036461208592152) },
2594 { FRAC_CONST(0.024749900035122), FRAC_CONST(0.036613760367538) },
2595 { FRAC_CONST(0.024524776315061), FRAC_CONST(0.036764933655540) },
2596 { FRAC_CONST(0.024298729251033), FRAC_CONST(0.036914722764569) },
2597 { FRAC_CONST(0.024071767353583), FRAC_CONST(0.037063122055150) },
2598 { FRAC_CONST(0.023843899167697), FRAC_CONST(0.037210125940135) },
2599 { FRAC_CONST(0.023615133272485), FRAC_CONST(0.037355728884908) },
2600 { FRAC_CONST(0.023385478280852), FRAC_CONST(0.037499925407603) },
2601 { FRAC_CONST(0.023154942839179), FRAC_CONST(0.037642710079302) },
2602 { FRAC_CONST(0.022923535626995), FRAC_CONST(0.037784077524241) },
2603 { FRAC_CONST(0.022691265356652), FRAC_CONST(0.037924022420018) },
2604 { FRAC_CONST(0.022458140772993), FRAC_CONST(0.038062539497785) },
2605 { FRAC_CONST(0.022224170653027), FRAC_CONST(0.038199623542453) },
2606 { FRAC_CONST(0.021989363805598), FRAC_CONST(0.038335269392885) },
2607 { FRAC_CONST(0.021753729071049), FRAC_CONST(0.038469471942092) },
2608 { FRAC_CONST(0.021517275320897), FRAC_CONST(0.038602226137423) },
2609 { FRAC_CONST(0.021280011457490), FRAC_CONST(0.038733526980758) },
2610 { FRAC_CONST(0.021041946413679), FRAC_CONST(0.038863369528695) },
2611 { FRAC_CONST(0.020803089152479), FRAC_CONST(0.038991748892734) },
2612 { FRAC_CONST(0.020563448666730), FRAC_CONST(0.039118660239466) },
2613 { FRAC_CONST(0.020323033978761), FRAC_CONST(0.039244098790750) },
2614 { FRAC_CONST(0.020081854140050), FRAC_CONST(0.039368059823895) },
2615 { FRAC_CONST(0.019839918230880), FRAC_CONST(0.039490538671839) },
2616 { FRAC_CONST(0.019597235360003), FRAC_CONST(0.039611530723322) },
2617 { FRAC_CONST(0.019353814664291), FRAC_CONST(0.039731031423061) },
2618 { FRAC_CONST(0.019109665308395), FRAC_CONST(0.039849036271924) },
2619 { FRAC_CONST(0.018864796484402), FRAC_CONST(0.039965540827094) },
2620 { FRAC_CONST(0.018619217411483), FRAC_CONST(0.040080540702240) },
2621 { FRAC_CONST(0.018372937335552), FRAC_CONST(0.040194031567683) },
2622 { FRAC_CONST(0.018125965528915), FRAC_CONST(0.040306009150554) },
2623 { FRAC_CONST(0.017878311289921), FRAC_CONST(0.040416469234963) },
2624 { FRAC_CONST(0.017629983942612), FRAC_CONST(0.040525407662148) },
2625 { FRAC_CONST(0.017380992836371), FRAC_CONST(0.040632820330639) },
2626 { FRAC_CONST(0.017131347345575), FRAC_CONST(0.040738703196411) },
2627 { FRAC_CONST(0.016881056869233), FRAC_CONST(0.040843052273033) },
2628 { FRAC_CONST(0.016630130830641), FRAC_CONST(0.040945863631822) },
2629 { FRAC_CONST(0.016378578677023), FRAC_CONST(0.041047133401988) },
2630 { FRAC_CONST(0.016126409879175), FRAC_CONST(0.041146857770781) },
2631 { FRAC_CONST(0.015873633931110), FRAC_CONST(0.041245032983635) },
2632 { FRAC_CONST(0.015620260349699), FRAC_CONST(0.041341655344309) },
2633 { FRAC_CONST(0.015366298674314), FRAC_CONST(0.041436721215026) },
2634 { FRAC_CONST(0.015111758466470), FRAC_CONST(0.041530227016609) },
2635 { FRAC_CONST(0.014856649309460), FRAC_CONST(0.041622169228618) },
2636 { FRAC_CONST(0.014600980808001), FRAC_CONST(0.041712544389481) },
2637 { FRAC_CONST(0.014344762587867), FRAC_CONST(0.041801349096623) },
2638 { FRAC_CONST(0.014088004295529), FRAC_CONST(0.041888580006598) },
2639 { FRAC_CONST(0.013830715597792), FRAC_CONST(0.041974233835211) },
2640 { FRAC_CONST(0.013572906181430), FRAC_CONST(0.042058307357645) },
2641 { FRAC_CONST(0.013314585752822), FRAC_CONST(0.042140797408577) },
2642 { FRAC_CONST(0.013055764037585), FRAC_CONST(0.042221700882306) },
2643 { FRAC_CONST(0.012796450780212), FRAC_CONST(0.042301014732860) },
2644 { FRAC_CONST(0.012536655743699), FRAC_CONST(0.042378735974118) },
2645 { FRAC_CONST(0.012276388709183), FRAC_CONST(0.042454861679919) },
2646 { FRAC_CONST(0.012015659475571), FRAC_CONST(0.042529388984173) },
2647 { FRAC_CONST(0.011754477859172), FRAC_CONST(0.042602315080970) },
2648 { FRAC_CONST(0.011492853693324), FRAC_CONST(0.042673637224683) },
2649 { FRAC_CONST(0.011230796828031), FRAC_CONST(0.042743352730074) },
2650 { FRAC_CONST(0.010968317129584), FRAC_CONST(0.042811458972393) },
2651 { FRAC_CONST(0.010705424480197), FRAC_CONST(0.042877953387479) },
2652 { FRAC_CONST(0.010442128777629), FRAC_CONST(0.042942833471854) },
2653 { FRAC_CONST(0.010178439934815), FRAC_CONST(0.043006096782821) },
2654 { FRAC_CONST(0.009914367879490), FRAC_CONST(0.043067740938551) },
2655 { FRAC_CONST(0.009649922553818), FRAC_CONST(0.043127763618177) },
2656 { FRAC_CONST(0.009385113914016), FRAC_CONST(0.043186162561878) },
2657 { FRAC_CONST(0.009119951929979), FRAC_CONST(0.043242935570968) },
2658 { FRAC_CONST(0.008854446584907), FRAC_CONST(0.043298080507974) },
2659 { FRAC_CONST(0.008588607874926), FRAC_CONST(0.043351595296722) },
2660 { FRAC_CONST(0.008322445808712), FRAC_CONST(0.043403477922409) },
2661 { FRAC_CONST(0.008055970407118), FRAC_CONST(0.043453726431684) },
2662 { FRAC_CONST(0.007789191702791), FRAC_CONST(0.043502338932719) },
2663 { FRAC_CONST(0.007522119739798), FRAC_CONST(0.043549313595281) },
2664 { FRAC_CONST(0.007254764573250), FRAC_CONST(0.043594648650800) },
2665 { FRAC_CONST(0.006987136268915), FRAC_CONST(0.043638342392438) },
2666 { FRAC_CONST(0.006719244902849), FRAC_CONST(0.043680393175148) },
2667 { FRAC_CONST(0.006451100561010), FRAC_CONST(0.043720799415744) },
2668 { FRAC_CONST(0.006182713338881), FRAC_CONST(0.043759559592953) },
2669 { FRAC_CONST(0.005914093341090), FRAC_CONST(0.043796672247476) },
2670 { FRAC_CONST(0.005645250681027), FRAC_CONST(0.043832135982044) },
2671 { FRAC_CONST(0.005376195480466), FRAC_CONST(0.043865949461465) },
2672 { FRAC_CONST(0.005106937869184), FRAC_CONST(0.043898111412683) },
2673 { FRAC_CONST(0.004837487984578), FRAC_CONST(0.043928620624817) },
2674 { FRAC_CONST(0.004567855971284), FRAC_CONST(0.043957475949213) },
2675 { FRAC_CONST(0.004298051980793), FRAC_CONST(0.043984676299484) },
2676 { FRAC_CONST(0.004028086171076), FRAC_CONST(0.044010220651553) },
2677 { FRAC_CONST(0.003757968706190), FRAC_CONST(0.044034108043689) },
2678 { FRAC_CONST(0.003487709755907), FRAC_CONST(0.044056337576546) },
2679 { FRAC_CONST(0.003217319495322), FRAC_CONST(0.044076908413193) },
2680 { FRAC_CONST(0.002946808104477), FRAC_CONST(0.044095819779151) },
2681 { FRAC_CONST(0.002676185767973), FRAC_CONST(0.044113070962418) },
2682 { FRAC_CONST(0.002405462674586), FRAC_CONST(0.044128661313495) },
2683 { FRAC_CONST(0.002134649016890), FRAC_CONST(0.044142590245416) },
2684 { FRAC_CONST(0.001863754990865), FRAC_CONST(0.044154857233763) },
2685 { FRAC_CONST(0.001592790795518), FRAC_CONST(0.044165461816692) },
2686 { FRAC_CONST(0.001321766632497), FRAC_CONST(0.044174403594946) },
2687 { FRAC_CONST(0.001050692705710), FRAC_CONST(0.044181682231873) },
2688 { FRAC_CONST(0.000779579220936), FRAC_CONST(0.044187297453434) },
2689 { FRAC_CONST(0.000508436385446), FRAC_CONST(0.044191249048222) },
2690 { FRAC_CONST(0.000237274407613), FRAC_CONST(0.044193536867459) }
2691 };
2692 #endif // LD_DEC
2693
2694 #ifdef ALLOW_SMALL_FRAMELENGTH
2695 /* 480 (N/4) complex twiddle factors */
2696 ALIGN static const complex_t mdct_tab_1920[] =
2697 {
2698 { FRAC_CONST(0.032274858518097), FRAC_CONST(0.000013202404176) },
2699 { FRAC_CONST(0.032274642494505), FRAC_CONST(0.000118821372483) },
2700 { FRAC_CONST(0.032274080835421), FRAC_CONST(0.000224439068308) },
2701 { FRAC_CONST(0.032273173546860), FRAC_CONST(0.000330054360572) },
2702 { FRAC_CONST(0.032271920638538), FRAC_CONST(0.000435666118218) },
2703 { FRAC_CONST(0.032270322123873), FRAC_CONST(0.000541273210231) },
2704 { FRAC_CONST(0.032268378019984), FRAC_CONST(0.000646874505642) },
2705 { FRAC_CONST(0.032266088347691), FRAC_CONST(0.000752468873546) },
2706 { FRAC_CONST(0.032263453131514), FRAC_CONST(0.000858055183114) },
2707 { FRAC_CONST(0.032260472399674), FRAC_CONST(0.000963632303600) },
2708 { FRAC_CONST(0.032257146184092), FRAC_CONST(0.001069199104358) },
2709 { FRAC_CONST(0.032253474520390), FRAC_CONST(0.001174754454853) },
2710 { FRAC_CONST(0.032249457447888), FRAC_CONST(0.001280297224671) },
2711 { FRAC_CONST(0.032245095009606), FRAC_CONST(0.001385826283535) },
2712 { FRAC_CONST(0.032240387252262), FRAC_CONST(0.001491340501313) },
2713 { FRAC_CONST(0.032235334226272), FRAC_CONST(0.001596838748031) },
2714 { FRAC_CONST(0.032229935985750), FRAC_CONST(0.001702319893890) },
2715 { FRAC_CONST(0.032224192588507), FRAC_CONST(0.001807782809271) },
2716 { FRAC_CONST(0.032218104096050), FRAC_CONST(0.001913226364749) },
2717 { FRAC_CONST(0.032211670573582), FRAC_CONST(0.002018649431111) },
2718 { FRAC_CONST(0.032204892090000), FRAC_CONST(0.002124050879359) },
2719 { FRAC_CONST(0.032197768717898), FRAC_CONST(0.002229429580728) },
2720 { FRAC_CONST(0.032190300533560), FRAC_CONST(0.002334784406698) },
2721 { FRAC_CONST(0.032182487616965), FRAC_CONST(0.002440114229003) },
2722 { FRAC_CONST(0.032174330051782), FRAC_CONST(0.002545417919644) },
2723 { FRAC_CONST(0.032165827925374), FRAC_CONST(0.002650694350905) },
2724 { FRAC_CONST(0.032156981328790), FRAC_CONST(0.002755942395358) },
2725 { FRAC_CONST(0.032147790356771), FRAC_CONST(0.002861160925883) },
2726 { FRAC_CONST(0.032138255107744), FRAC_CONST(0.002966348815672) },
2727 { FRAC_CONST(0.032128375683825), FRAC_CONST(0.003071504938250) },
2728 { FRAC_CONST(0.032118152190814), FRAC_CONST(0.003176628167476) },
2729 { FRAC_CONST(0.032107584738196), FRAC_CONST(0.003281717377568) },
2730 { FRAC_CONST(0.032096673439141), FRAC_CONST(0.003386771443102) },
2731 { FRAC_CONST(0.032085418410500), FRAC_CONST(0.003491789239036) },
2732 { FRAC_CONST(0.032073819772804), FRAC_CONST(0.003596769640711) },
2733 { FRAC_CONST(0.032061877650267), FRAC_CONST(0.003701711523874) },
2734 { FRAC_CONST(0.032049592170778), FRAC_CONST(0.003806613764680) },
2735 { FRAC_CONST(0.032036963465906), FRAC_CONST(0.003911475239711) },
2736 { FRAC_CONST(0.032023991670893), FRAC_CONST(0.004016294825985) },
2737 { FRAC_CONST(0.032010676924657), FRAC_CONST(0.004121071400967) },
2738 { FRAC_CONST(0.031997019369789), FRAC_CONST(0.004225803842586) },
2739 { FRAC_CONST(0.031983019152549), FRAC_CONST(0.004330491029241) },
2740 { FRAC_CONST(0.031968676422869), FRAC_CONST(0.004435131839816) },
2741 { FRAC_CONST(0.031953991334348), FRAC_CONST(0.004539725153692) },
2742 { FRAC_CONST(0.031938964044252), FRAC_CONST(0.004644269850758) },
2743 { FRAC_CONST(0.031923594713510), FRAC_CONST(0.004748764811426) },
2744 { FRAC_CONST(0.031907883506716), FRAC_CONST(0.004853208916638) },
2745 { FRAC_CONST(0.031891830592124), FRAC_CONST(0.004957601047881) },
2746 { FRAC_CONST(0.031875436141648), FRAC_CONST(0.005061940087200) },
2747 { FRAC_CONST(0.031858700330859), FRAC_CONST(0.005166224917208) },
2748 { FRAC_CONST(0.031841623338985), FRAC_CONST(0.005270454421097) },
2749 { FRAC_CONST(0.031824205348907), FRAC_CONST(0.005374627482653) },
2750 { FRAC_CONST(0.031806446547156), FRAC_CONST(0.005478742986267) },
2751 { FRAC_CONST(0.031788347123916), FRAC_CONST(0.005582799816945) },
2752 { FRAC_CONST(0.031769907273017), FRAC_CONST(0.005686796860323) },
2753 { FRAC_CONST(0.031751127191935), FRAC_CONST(0.005790733002674) },
2754 { FRAC_CONST(0.031732007081789), FRAC_CONST(0.005894607130928) },
2755 { FRAC_CONST(0.031712547147340), FRAC_CONST(0.005998418132675) },
2756 { FRAC_CONST(0.031692747596989), FRAC_CONST(0.006102164896182) },
2757 { FRAC_CONST(0.031672608642773), FRAC_CONST(0.006205846310406) },
2758 { FRAC_CONST(0.031652130500364), FRAC_CONST(0.006309461265002) },
2759 { FRAC_CONST(0.031631313389067), FRAC_CONST(0.006413008650337) },
2760 { FRAC_CONST(0.031610157531816), FRAC_CONST(0.006516487357501) },
2761 { FRAC_CONST(0.031588663155172), FRAC_CONST(0.006619896278321) },
2762 { FRAC_CONST(0.031566830489325), FRAC_CONST(0.006723234305370) },
2763 { FRAC_CONST(0.031544659768083), FRAC_CONST(0.006826500331981) },
2764 { FRAC_CONST(0.031522151228878), FRAC_CONST(0.006929693252258) },
2765 { FRAC_CONST(0.031499305112758), FRAC_CONST(0.007032811961088) },
2766 { FRAC_CONST(0.031476121664387), FRAC_CONST(0.007135855354151) },
2767 { FRAC_CONST(0.031452601132040), FRAC_CONST(0.007238822327937) },
2768 { FRAC_CONST(0.031428743767604), FRAC_CONST(0.007341711779751) },
2769 { FRAC_CONST(0.031404549826572), FRAC_CONST(0.007444522607730) },
2770 { FRAC_CONST(0.031380019568042), FRAC_CONST(0.007547253710853) },
2771 { FRAC_CONST(0.031355153254712), FRAC_CONST(0.007649903988952) },
2772 { FRAC_CONST(0.031329951152882), FRAC_CONST(0.007752472342725) },
2773 { FRAC_CONST(0.031304413532445), FRAC_CONST(0.007854957673748) },
2774 { FRAC_CONST(0.031278540666888), FRAC_CONST(0.007957358884484) },
2775 { FRAC_CONST(0.031252332833290), FRAC_CONST(0.008059674878300) },
2776 { FRAC_CONST(0.031225790312316), FRAC_CONST(0.008161904559473) },
2777 { FRAC_CONST(0.031198913388214), FRAC_CONST(0.008264046833205) },
2778 { FRAC_CONST(0.031171702348814), FRAC_CONST(0.008366100605636) },
2779 { FRAC_CONST(0.031144157485525), FRAC_CONST(0.008468064783849) },
2780 { FRAC_CONST(0.031116279093331), FRAC_CONST(0.008569938275893) },
2781 { FRAC_CONST(0.031088067470786), FRAC_CONST(0.008671719990782) },
2782 { FRAC_CONST(0.031059522920014), FRAC_CONST(0.008773408838517) },
2783 { FRAC_CONST(0.031030645746705), FRAC_CONST(0.008875003730092) },
2784 { FRAC_CONST(0.031001436260110), FRAC_CONST(0.008976503577507) },
2785 { FRAC_CONST(0.030971894773039), FRAC_CONST(0.009077907293780) },
2786 { FRAC_CONST(0.030942021601857), FRAC_CONST(0.009179213792959) },
2787 { FRAC_CONST(0.030911817066483), FRAC_CONST(0.009280421990133) },
2788 { FRAC_CONST(0.030881281490382), FRAC_CONST(0.009381530801444) },
2789 { FRAC_CONST(0.030850415200566), FRAC_CONST(0.009482539144097) },
2790 { FRAC_CONST(0.030819218527589), FRAC_CONST(0.009583445936373) },
2791 { FRAC_CONST(0.030787691805541), FRAC_CONST(0.009684250097643) },
2792 { FRAC_CONST(0.030755835372048), FRAC_CONST(0.009784950548375) },
2793 { FRAC_CONST(0.030723649568268), FRAC_CONST(0.009885546210147) },
2794 { FRAC_CONST(0.030691134738883), FRAC_CONST(0.009986036005661) },
2795 { FRAC_CONST(0.030658291232103), FRAC_CONST(0.010086418858753) },
2796 { FRAC_CONST(0.030625119399655), FRAC_CONST(0.010186693694402) },
2797 { FRAC_CONST(0.030591619596781), FRAC_CONST(0.010286859438745) },
2798 { FRAC_CONST(0.030557792182239), FRAC_CONST(0.010386915019088) },
2799 { FRAC_CONST(0.030523637518292), FRAC_CONST(0.010486859363916) },
2800 { FRAC_CONST(0.030489155970710), FRAC_CONST(0.010586691402906) },
2801 { FRAC_CONST(0.030454347908763), FRAC_CONST(0.010686410066936) },
2802 { FRAC_CONST(0.030419213705216), FRAC_CONST(0.010786014288099) },
2803 { FRAC_CONST(0.030383753736329), FRAC_CONST(0.010885502999714) },
2804 { FRAC_CONST(0.030347968381849), FRAC_CONST(0.010984875136338) },
2805 { FRAC_CONST(0.030311858025010), FRAC_CONST(0.011084129633775) },
2806 { FRAC_CONST(0.030275423052523), FRAC_CONST(0.011183265429088) },
2807 { FRAC_CONST(0.030238663854579), FRAC_CONST(0.011282281460612) },
2808 { FRAC_CONST(0.030201580824838), FRAC_CONST(0.011381176667967) },
2809 { FRAC_CONST(0.030164174360430), FRAC_CONST(0.011479949992062) },
2810 { FRAC_CONST(0.030126444861948), FRAC_CONST(0.011578600375117) },
2811 { FRAC_CONST(0.030088392733446), FRAC_CONST(0.011677126760663) },
2812 { FRAC_CONST(0.030050018382430), FRAC_CONST(0.011775528093563) },
2813 { FRAC_CONST(0.030011322219859), FRAC_CONST(0.011873803320018) },
2814 { FRAC_CONST(0.029972304660138), FRAC_CONST(0.011971951387578) },
2815 { FRAC_CONST(0.029932966121114), FRAC_CONST(0.012069971245157) },
2816 { FRAC_CONST(0.029893307024070), FRAC_CONST(0.012167861843041) },
2817 { FRAC_CONST(0.029853327793724), FRAC_CONST(0.012265622132901) },
2818 { FRAC_CONST(0.029813028858222), FRAC_CONST(0.012363251067801) },
2819 { FRAC_CONST(0.029772410649132), FRAC_CONST(0.012460747602215) },
2820 { FRAC_CONST(0.029731473601443), FRAC_CONST(0.012558110692033) },
2821 { FRAC_CONST(0.029690218153558), FRAC_CONST(0.012655339294575) },
2822 { FRAC_CONST(0.029648644747289), FRAC_CONST(0.012752432368600) },
2823 { FRAC_CONST(0.029606753827855), FRAC_CONST(0.012849388874320) },
2824 { FRAC_CONST(0.029564545843872), FRAC_CONST(0.012946207773407) },
2825 { FRAC_CONST(0.029522021247356), FRAC_CONST(0.013042888029011) },
2826 { FRAC_CONST(0.029479180493710), FRAC_CONST(0.013139428605762) },
2827 { FRAC_CONST(0.029436024041725), FRAC_CONST(0.013235828469789) },
2828 { FRAC_CONST(0.029392552353570), FRAC_CONST(0.013332086588727) },
2829 { FRAC_CONST(0.029348765894794), FRAC_CONST(0.013428201931728) },
2830 { FRAC_CONST(0.029304665134313), FRAC_CONST(0.013524173469475) },
2831 { FRAC_CONST(0.029260250544412), FRAC_CONST(0.013620000174189) },
2832 { FRAC_CONST(0.029215522600735), FRAC_CONST(0.013715681019643) },
2833 { FRAC_CONST(0.029170481782283), FRAC_CONST(0.013811214981173) },
2834 { FRAC_CONST(0.029125128571406), FRAC_CONST(0.013906601035686) },
2835 { FRAC_CONST(0.029079463453801), FRAC_CONST(0.014001838161674) },
2836 { FRAC_CONST(0.029033486918505), FRAC_CONST(0.014096925339225) },
2837 { FRAC_CONST(0.028987199457889), FRAC_CONST(0.014191861550031) },
2838 { FRAC_CONST(0.028940601567655), FRAC_CONST(0.014286645777401) },
2839 { FRAC_CONST(0.028893693746829), FRAC_CONST(0.014381277006273) },
2840 { FRAC_CONST(0.028846476497755), FRAC_CONST(0.014475754223221) },
2841 { FRAC_CONST(0.028798950326094), FRAC_CONST(0.014570076416472) },
2842 { FRAC_CONST(0.028751115740811), FRAC_CONST(0.014664242575910) },
2843 { FRAC_CONST(0.028702973254178), FRAC_CONST(0.014758251693091) },
2844 { FRAC_CONST(0.028654523381760), FRAC_CONST(0.014852102761253) },
2845 { FRAC_CONST(0.028605766642418), FRAC_CONST(0.014945794775326) },
2846 { FRAC_CONST(0.028556703558297), FRAC_CONST(0.015039326731945) },
2847 { FRAC_CONST(0.028507334654823), FRAC_CONST(0.015132697629457) },
2848 { FRAC_CONST(0.028457660460698), FRAC_CONST(0.015225906467935) },
2849 { FRAC_CONST(0.028407681507891), FRAC_CONST(0.015318952249187) },
2850 { FRAC_CONST(0.028357398331639), FRAC_CONST(0.015411833976768) },
2851 { FRAC_CONST(0.028306811470432), FRAC_CONST(0.015504550655988) },
2852 { FRAC_CONST(0.028255921466016), FRAC_CONST(0.015597101293927) },
2853 { FRAC_CONST(0.028204728863381), FRAC_CONST(0.015689484899442) },
2854 { FRAC_CONST(0.028153234210760), FRAC_CONST(0.015781700483179) },
2855 { FRAC_CONST(0.028101438059619), FRAC_CONST(0.015873747057582) },
2856 { FRAC_CONST(0.028049340964652), FRAC_CONST(0.015965623636907) },
2857 { FRAC_CONST(0.027996943483779), FRAC_CONST(0.016057329237229) },
2858 { FRAC_CONST(0.027944246178133), FRAC_CONST(0.016148862876456) },
2859 { FRAC_CONST(0.027891249612061), FRAC_CONST(0.016240223574335) },
2860 { FRAC_CONST(0.027837954353113), FRAC_CONST(0.016331410352467) },
2861 { FRAC_CONST(0.027784360972039), FRAC_CONST(0.016422422234315) },
2862 { FRAC_CONST(0.027730470042780), FRAC_CONST(0.016513258245214) },
2863 { FRAC_CONST(0.027676282142466), FRAC_CONST(0.016603917412384) },
2864 { FRAC_CONST(0.027621797851405), FRAC_CONST(0.016694398764938) },
2865 { FRAC_CONST(0.027567017753080), FRAC_CONST(0.016784701333894) },
2866 { FRAC_CONST(0.027511942434143), FRAC_CONST(0.016874824152183) },
2867 { FRAC_CONST(0.027456572484404), FRAC_CONST(0.016964766254662) },
2868 { FRAC_CONST(0.027400908496833), FRAC_CONST(0.017054526678124) },
2869 { FRAC_CONST(0.027344951067546), FRAC_CONST(0.017144104461307) },
2870 { FRAC_CONST(0.027288700795801), FRAC_CONST(0.017233498644904) },
2871 { FRAC_CONST(0.027232158283994), FRAC_CONST(0.017322708271577) },
2872 { FRAC_CONST(0.027175324137651), FRAC_CONST(0.017411732385960) },
2873 { FRAC_CONST(0.027118198965418), FRAC_CONST(0.017500570034678) },
2874 { FRAC_CONST(0.027060783379060), FRAC_CONST(0.017589220266351) },
2875 { FRAC_CONST(0.027003077993454), FRAC_CONST(0.017677682131607) },
2876 { FRAC_CONST(0.026945083426576), FRAC_CONST(0.017765954683088) },
2877 { FRAC_CONST(0.026886800299502), FRAC_CONST(0.017854036975468) },
2878 { FRAC_CONST(0.026828229236397), FRAC_CONST(0.017941928065456) },
2879 { FRAC_CONST(0.026769370864511), FRAC_CONST(0.018029627011808) },
2880 { FRAC_CONST(0.026710225814170), FRAC_CONST(0.018117132875340) },
2881 { FRAC_CONST(0.026650794718768), FRAC_CONST(0.018204444718934) },
2882 { FRAC_CONST(0.026591078214767), FRAC_CONST(0.018291561607551) },
2883 { FRAC_CONST(0.026531076941680), FRAC_CONST(0.018378482608238) },
2884 { FRAC_CONST(0.026470791542075), FRAC_CONST(0.018465206790142) },
2885 { FRAC_CONST(0.026410222661558), FRAC_CONST(0.018551733224515) },
2886 { FRAC_CONST(0.026349370948775), FRAC_CONST(0.018638060984730) },
2887 { FRAC_CONST(0.026288237055398), FRAC_CONST(0.018724189146286) },
2888 { FRAC_CONST(0.026226821636121), FRAC_CONST(0.018810116786819) },
2889 { FRAC_CONST(0.026165125348656), FRAC_CONST(0.018895842986112) },
2890 { FRAC_CONST(0.026103148853718), FRAC_CONST(0.018981366826109) },
2891 { FRAC_CONST(0.026040892815028), FRAC_CONST(0.019066687390916) },
2892 { FRAC_CONST(0.025978357899296), FRAC_CONST(0.019151803766819) },
2893 { FRAC_CONST(0.025915544776223), FRAC_CONST(0.019236715042290) },
2894 { FRAC_CONST(0.025852454118485), FRAC_CONST(0.019321420307998) },
2895 { FRAC_CONST(0.025789086601733), FRAC_CONST(0.019405918656817) },
2896 { FRAC_CONST(0.025725442904582), FRAC_CONST(0.019490209183837) },
2897 { FRAC_CONST(0.025661523708606), FRAC_CONST(0.019574290986376) },
2898 { FRAC_CONST(0.025597329698327), FRAC_CONST(0.019658163163984) },
2899 { FRAC_CONST(0.025532861561211), FRAC_CONST(0.019741824818458) },
2900 { FRAC_CONST(0.025468119987662), FRAC_CONST(0.019825275053848) },
2901 { FRAC_CONST(0.025403105671008), FRAC_CONST(0.019908512976470) },
2902 { FRAC_CONST(0.025337819307501), FRAC_CONST(0.019991537694913) },
2903 { FRAC_CONST(0.025272261596305), FRAC_CONST(0.020074348320047) },
2904 { FRAC_CONST(0.025206433239491), FRAC_CONST(0.020156943965039) },
2905 { FRAC_CONST(0.025140334942028), FRAC_CONST(0.020239323745355) },
2906 { FRAC_CONST(0.025073967411776), FRAC_CONST(0.020321486778774) },
2907 { FRAC_CONST(0.025007331359476), FRAC_CONST(0.020403432185395) },
2908 { FRAC_CONST(0.024940427498748), FRAC_CONST(0.020485159087650) },
2909 { FRAC_CONST(0.024873256546079), FRAC_CONST(0.020566666610309) },
2910 { FRAC_CONST(0.024805819220816), FRAC_CONST(0.020647953880491) },
2911 { FRAC_CONST(0.024738116245157), FRAC_CONST(0.020729020027676) },
2912 { FRAC_CONST(0.024670148344147), FRAC_CONST(0.020809864183709) },
2913 { FRAC_CONST(0.024601916245669), FRAC_CONST(0.020890485482816) },
2914 { FRAC_CONST(0.024533420680433), FRAC_CONST(0.020970883061607) },
2915 { FRAC_CONST(0.024464662381971), FRAC_CONST(0.021051056059087) },
2916 { FRAC_CONST(0.024395642086630), FRAC_CONST(0.021131003616670) },
2917 { FRAC_CONST(0.024326360533561), FRAC_CONST(0.021210724878181) },
2918 { FRAC_CONST(0.024256818464715), FRAC_CONST(0.021290218989868) },
2919 { FRAC_CONST(0.024187016624830), FRAC_CONST(0.021369485100415) },
2920 { FRAC_CONST(0.024116955761430), FRAC_CONST(0.021448522360944) },
2921 { FRAC_CONST(0.024046636624808), FRAC_CONST(0.021527329925030) },
2922 { FRAC_CONST(0.023976059968027), FRAC_CONST(0.021605906948708) },
2923 { FRAC_CONST(0.023905226546906), FRAC_CONST(0.021684252590480) },
2924 { FRAC_CONST(0.023834137120014), FRAC_CONST(0.021762366011328) },
2925 { FRAC_CONST(0.023762792448662), FRAC_CONST(0.021840246374720) },
2926 { FRAC_CONST(0.023691193296893), FRAC_CONST(0.021917892846620) },
2927 { FRAC_CONST(0.023619340431478), FRAC_CONST(0.021995304595495) },
2928 { FRAC_CONST(0.023547234621902), FRAC_CONST(0.022072480792330) },
2929 { FRAC_CONST(0.023474876640361), FRAC_CONST(0.022149420610628) },
2930 { FRAC_CONST(0.023402267261751), FRAC_CONST(0.022226123226426) },
2931 { FRAC_CONST(0.023329407263659), FRAC_CONST(0.022302587818300) },
2932 { FRAC_CONST(0.023256297426359), FRAC_CONST(0.022378813567377) },
2933 { FRAC_CONST(0.023182938532797), FRAC_CONST(0.022454799657339) },
2934 { FRAC_CONST(0.023109331368588), FRAC_CONST(0.022530545274437) },
2935 { FRAC_CONST(0.023035476722006), FRAC_CONST(0.022606049607496) },
2936 { FRAC_CONST(0.022961375383975), FRAC_CONST(0.022681311847926) },
2937 { FRAC_CONST(0.022887028148061), FRAC_CONST(0.022756331189727) },
2938 { FRAC_CONST(0.022812435810462), FRAC_CONST(0.022831106829504) },
2939 { FRAC_CONST(0.022737599170003), FRAC_CONST(0.022905637966469) },
2940 { FRAC_CONST(0.022662519028125), FRAC_CONST(0.022979923802453) },
2941 { FRAC_CONST(0.022587196188874), FRAC_CONST(0.023053963541915) },
2942 { FRAC_CONST(0.022511631458899), FRAC_CONST(0.023127756391950) },
2943 { FRAC_CONST(0.022435825647437), FRAC_CONST(0.023201301562294) },
2944 { FRAC_CONST(0.022359779566306), FRAC_CONST(0.023274598265338) },
2945 { FRAC_CONST(0.022283494029900), FRAC_CONST(0.023347645716133) },
2946 { FRAC_CONST(0.022206969855176), FRAC_CONST(0.023420443132400) },
2947 { FRAC_CONST(0.022130207861645), FRAC_CONST(0.023492989734537) },
2948 { FRAC_CONST(0.022053208871367), FRAC_CONST(0.023565284745628) },
2949 { FRAC_CONST(0.021975973708940), FRAC_CONST(0.023637327391451) },
2950 { FRAC_CONST(0.021898503201489), FRAC_CONST(0.023709116900488) },
2951 { FRAC_CONST(0.021820798178663), FRAC_CONST(0.023780652503931) },
2952 { FRAC_CONST(0.021742859472618), FRAC_CONST(0.023851933435691) },
2953 { FRAC_CONST(0.021664687918017), FRAC_CONST(0.023922958932406) },
2954 { FRAC_CONST(0.021586284352013), FRAC_CONST(0.023993728233451) },
2955 { FRAC_CONST(0.021507649614247), FRAC_CONST(0.024064240580942) },
2956 { FRAC_CONST(0.021428784546832), FRAC_CONST(0.024134495219750) },
2957 { FRAC_CONST(0.021349689994350), FRAC_CONST(0.024204491397504) },
2958 { FRAC_CONST(0.021270366803840), FRAC_CONST(0.024274228364600) },
2959 { FRAC_CONST(0.021190815824791), FRAC_CONST(0.024343705374213) },
2960 { FRAC_CONST(0.021111037909128), FRAC_CONST(0.024412921682298) },
2961 { FRAC_CONST(0.021031033911210), FRAC_CONST(0.024481876547605) },
2962 { FRAC_CONST(0.020950804687815), FRAC_CONST(0.024550569231683) },
2963 { FRAC_CONST(0.020870351098134), FRAC_CONST(0.024618998998889) },
2964 { FRAC_CONST(0.020789674003759), FRAC_CONST(0.024687165116394) },
2965 { FRAC_CONST(0.020708774268678), FRAC_CONST(0.024755066854194) },
2966 { FRAC_CONST(0.020627652759262), FRAC_CONST(0.024822703485116) },
2967 { FRAC_CONST(0.020546310344257), FRAC_CONST(0.024890074284826) },
2968 { FRAC_CONST(0.020464747894775), FRAC_CONST(0.024957178531837) },
2969 { FRAC_CONST(0.020382966284284), FRAC_CONST(0.025024015507516) },
2970 { FRAC_CONST(0.020300966388600), FRAC_CONST(0.025090584496093) },
2971 { FRAC_CONST(0.020218749085876), FRAC_CONST(0.025156884784668) },
2972 { FRAC_CONST(0.020136315256592), FRAC_CONST(0.025222915663218) },
2973 { FRAC_CONST(0.020053665783549), FRAC_CONST(0.025288676424605) },
2974 { FRAC_CONST(0.019970801551857), FRAC_CONST(0.025354166364584) },
2975 { FRAC_CONST(0.019887723448925), FRAC_CONST(0.025419384781811) },
2976 { FRAC_CONST(0.019804432364452), FRAC_CONST(0.025484330977848) },
2977 { FRAC_CONST(0.019720929190419), FRAC_CONST(0.025549004257175) },
2978 { FRAC_CONST(0.019637214821078), FRAC_CONST(0.025613403927192) },
2979 { FRAC_CONST(0.019553290152943), FRAC_CONST(0.025677529298230) },
2980 { FRAC_CONST(0.019469156084779), FRAC_CONST(0.025741379683559) },
2981 { FRAC_CONST(0.019384813517595), FRAC_CONST(0.025804954399392) },
2982 { FRAC_CONST(0.019300263354632), FRAC_CONST(0.025868252764895) },
2983 { FRAC_CONST(0.019215506501354), FRAC_CONST(0.025931274102193) },
2984 { FRAC_CONST(0.019130543865439), FRAC_CONST(0.025994017736379) },
2985 { FRAC_CONST(0.019045376356769), FRAC_CONST(0.026056482995518) },
2986 { FRAC_CONST(0.018960004887419), FRAC_CONST(0.026118669210657) },
2987 { FRAC_CONST(0.018874430371648), FRAC_CONST(0.026180575715833) },
2988 { FRAC_CONST(0.018788653725892), FRAC_CONST(0.026242201848076) },
2989 { FRAC_CONST(0.018702675868750), FRAC_CONST(0.026303546947421) },
2990 { FRAC_CONST(0.018616497720974), FRAC_CONST(0.026364610356909) },
2991 { FRAC_CONST(0.018530120205464), FRAC_CONST(0.026425391422602) },
2992 { FRAC_CONST(0.018443544247254), FRAC_CONST(0.026485889493583) },
2993 { FRAC_CONST(0.018356770773502), FRAC_CONST(0.026546103921965) },
2994 { FRAC_CONST(0.018269800713483), FRAC_CONST(0.026606034062902) },
2995 { FRAC_CONST(0.018182634998576), FRAC_CONST(0.026665679274589) },
2996 { FRAC_CONST(0.018095274562256), FRAC_CONST(0.026725038918274) },
2997 { FRAC_CONST(0.018007720340083), FRAC_CONST(0.026784112358263) },
2998 { FRAC_CONST(0.017919973269692), FRAC_CONST(0.026842898961926) },
2999 { FRAC_CONST(0.017832034290785), FRAC_CONST(0.026901398099707) },
3000 { FRAC_CONST(0.017743904345116), FRAC_CONST(0.026959609145127) },
3001 { FRAC_CONST(0.017655584376488), FRAC_CONST(0.027017531474792) },
3002 { FRAC_CONST(0.017567075330734), FRAC_CONST(0.027075164468401) },
3003 { FRAC_CONST(0.017478378155718), FRAC_CONST(0.027132507508750) },
3004 { FRAC_CONST(0.017389493801313), FRAC_CONST(0.027189559981742) },
3005 { FRAC_CONST(0.017300423219401), FRAC_CONST(0.027246321276391) },
3006 { FRAC_CONST(0.017211167363854), FRAC_CONST(0.027302790784828) },
3007 { FRAC_CONST(0.017121727190533), FRAC_CONST(0.027358967902310) },
3008 { FRAC_CONST(0.017032103657269), FRAC_CONST(0.027414852027226) },
3009 { FRAC_CONST(0.016942297723858), FRAC_CONST(0.027470442561102) },
3010 { FRAC_CONST(0.016852310352050), FRAC_CONST(0.027525738908608) },
3011 { FRAC_CONST(0.016762142505537), FRAC_CONST(0.027580740477564) },
3012 { FRAC_CONST(0.016671795149944), FRAC_CONST(0.027635446678948) },
3013 { FRAC_CONST(0.016581269252819), FRAC_CONST(0.027689856926900) },
3014 { FRAC_CONST(0.016490565783622), FRAC_CONST(0.027743970638730) },
3015 { FRAC_CONST(0.016399685713714), FRAC_CONST(0.027797787234924) },
3016 { FRAC_CONST(0.016308630016347), FRAC_CONST(0.027851306139149) },
3017 { FRAC_CONST(0.016217399666655), FRAC_CONST(0.027904526778260) },
3018 { FRAC_CONST(0.016125995641641), FRAC_CONST(0.027957448582309) },
3019 { FRAC_CONST(0.016034418920170), FRAC_CONST(0.028010070984544) },
3020 { FRAC_CONST(0.015942670482954), FRAC_CONST(0.028062393421421) },
3021 { FRAC_CONST(0.015850751312545), FRAC_CONST(0.028114415332610) },
3022 { FRAC_CONST(0.015758662393324), FRAC_CONST(0.028166136160998) },
3023 { FRAC_CONST(0.015666404711489), FRAC_CONST(0.028217555352697) },
3024 { FRAC_CONST(0.015573979255046), FRAC_CONST(0.028268672357047) },
3025 { FRAC_CONST(0.015481387013797), FRAC_CONST(0.028319486626627) },
3026 { FRAC_CONST(0.015388628979331), FRAC_CONST(0.028369997617257) },
3027 { FRAC_CONST(0.015295706145012), FRAC_CONST(0.028420204788004) },
3028 { FRAC_CONST(0.015202619505968), FRAC_CONST(0.028470107601191) },
3029 { FRAC_CONST(0.015109370059084), FRAC_CONST(0.028519705522399) },
3030 { FRAC_CONST(0.015015958802984), FRAC_CONST(0.028568998020472) },
3031 { FRAC_CONST(0.014922386738030), FRAC_CONST(0.028617984567529) },
3032 { FRAC_CONST(0.014828654866302), FRAC_CONST(0.028666664638963) },
3033 { FRAC_CONST(0.014734764191593), FRAC_CONST(0.028715037713449) },
3034 { FRAC_CONST(0.014640715719398), FRAC_CONST(0.028763103272951) },
3035 { FRAC_CONST(0.014546510456900), FRAC_CONST(0.028810860802724) },
3036 { FRAC_CONST(0.014452149412962), FRAC_CONST(0.028858309791325) },
3037 { FRAC_CONST(0.014357633598114), FRAC_CONST(0.028905449730613) },
3038 { FRAC_CONST(0.014262964024545), FRAC_CONST(0.028952280115756) },
3039 { FRAC_CONST(0.014168141706090), FRAC_CONST(0.028998800445240) },
3040 { FRAC_CONST(0.014073167658220), FRAC_CONST(0.029045010220868) },
3041 { FRAC_CONST(0.013978042898030), FRAC_CONST(0.029090908947771) },
3042 { FRAC_CONST(0.013882768444231), FRAC_CONST(0.029136496134411) },
3043 { FRAC_CONST(0.013787345317136), FRAC_CONST(0.029181771292585) },
3044 { FRAC_CONST(0.013691774538648), FRAC_CONST(0.029226733937433) },
3045 { FRAC_CONST(0.013596057132255), FRAC_CONST(0.029271383587441) },
3046 { FRAC_CONST(0.013500194123014), FRAC_CONST(0.029315719764447) },
3047 { FRAC_CONST(0.013404186537539), FRAC_CONST(0.029359741993647) },
3048 { FRAC_CONST(0.013308035403995), FRAC_CONST(0.029403449803598) },
3049 { FRAC_CONST(0.013211741752084), FRAC_CONST(0.029446842726223) },
3050 { FRAC_CONST(0.013115306613032), FRAC_CONST(0.029489920296820) },
3051 { FRAC_CONST(0.013018731019584), FRAC_CONST(0.029532682054063) },
3052 { FRAC_CONST(0.012922016005985), FRAC_CONST(0.029575127540008) },
3053 { FRAC_CONST(0.012825162607977), FRAC_CONST(0.029617256300097) },
3054 { FRAC_CONST(0.012728171862781), FRAC_CONST(0.029659067883165) },
3055 { FRAC_CONST(0.012631044809089), FRAC_CONST(0.029700561841444) },
3056 { FRAC_CONST(0.012533782487056), FRAC_CONST(0.029741737730567) },
3057 { FRAC_CONST(0.012436385938281), FRAC_CONST(0.029782595109573) },
3058 { FRAC_CONST(0.012338856205805), FRAC_CONST(0.029823133540913) },
3059 { FRAC_CONST(0.012241194334091), FRAC_CONST(0.029863352590452) },
3060 { FRAC_CONST(0.012143401369021), FRAC_CONST(0.029903251827477) },
3061 { FRAC_CONST(0.012045478357878), FRAC_CONST(0.029942830824699) },
3062 { FRAC_CONST(0.011947426349339), FRAC_CONST(0.029982089158259) },
3063 { FRAC_CONST(0.011849246393462), FRAC_CONST(0.030021026407731) },
3064 { FRAC_CONST(0.011750939541676), FRAC_CONST(0.030059642156129) },
3065 { FRAC_CONST(0.011652506846768), FRAC_CONST(0.030097935989909) },
3066 { FRAC_CONST(0.011553949362874), FRAC_CONST(0.030135907498976) },
3067 { FRAC_CONST(0.011455268145464), FRAC_CONST(0.030173556276684) },
3068 { FRAC_CONST(0.011356464251335), FRAC_CONST(0.030210881919845) },
3069 { FRAC_CONST(0.011257538738598), FRAC_CONST(0.030247884028732) },
3070 { FRAC_CONST(0.011158492666665), FRAC_CONST(0.030284562207083) },
3071 { FRAC_CONST(0.011059327096240), FRAC_CONST(0.030320916062102) },
3072 { FRAC_CONST(0.010960043089307), FRAC_CONST(0.030356945204470) },
3073 { FRAC_CONST(0.010860641709118), FRAC_CONST(0.030392649248343) },
3074 { FRAC_CONST(0.010761124020182), FRAC_CONST(0.030428027811361) },
3075 { FRAC_CONST(0.010661491088253), FRAC_CONST(0.030463080514646) },
3076 { FRAC_CONST(0.010561743980319), FRAC_CONST(0.030497806982812) },
3077 { FRAC_CONST(0.010461883764593), FRAC_CONST(0.030532206843968) },
3078 { FRAC_CONST(0.010361911510496), FRAC_CONST(0.030566279729717) },
3079 { FRAC_CONST(0.010261828288652), FRAC_CONST(0.030600025275167) },
3080 { FRAC_CONST(0.010161635170872), FRAC_CONST(0.030633443118931) },
3081 { FRAC_CONST(0.010061333230142), FRAC_CONST(0.030666532903129) },
3082 { FRAC_CONST(0.009960923540617), FRAC_CONST(0.030699294273397) },
3083 { FRAC_CONST(0.009860407177603), FRAC_CONST(0.030731726878888) },
3084 { FRAC_CONST(0.009759785217550), FRAC_CONST(0.030763830372273) },
3085 { FRAC_CONST(0.009659058738038), FRAC_CONST(0.030795604409750) },
3086 { FRAC_CONST(0.009558228817767), FRAC_CONST(0.030827048651045) },
3087 { FRAC_CONST(0.009457296536545), FRAC_CONST(0.030858162759415) },
3088 { FRAC_CONST(0.009356262975275), FRAC_CONST(0.030888946401653) },
3089 { FRAC_CONST(0.009255129215945), FRAC_CONST(0.030919399248091) },
3090 { FRAC_CONST(0.009153896341616), FRAC_CONST(0.030949520972603) },
3091 { FRAC_CONST(0.009052565436412), FRAC_CONST(0.030979311252611) },
3092 { FRAC_CONST(0.008951137585505), FRAC_CONST(0.031008769769084) },
3093 { FRAC_CONST(0.008849613875105), FRAC_CONST(0.031037896206544) },
3094 { FRAC_CONST(0.008747995392451), FRAC_CONST(0.031066690253072) },
3095 { FRAC_CONST(0.008646283225794), FRAC_CONST(0.031095151600306) },
3096 { FRAC_CONST(0.008544478464390), FRAC_CONST(0.031123279943448) },
3097 { FRAC_CONST(0.008442582198486), FRAC_CONST(0.031151074981266) },
3098 { FRAC_CONST(0.008340595519310), FRAC_CONST(0.031178536416098) },
3099 { FRAC_CONST(0.008238519519057), FRAC_CONST(0.031205663953853) },
3100 { FRAC_CONST(0.008136355290878), FRAC_CONST(0.031232457304017) },
3101 { FRAC_CONST(0.008034103928871), FRAC_CONST(0.031258916179656) },
3102 { FRAC_CONST(0.007931766528065), FRAC_CONST(0.031285040297416) },
3103 { FRAC_CONST(0.007829344184412), FRAC_CONST(0.031310829377528) },
3104 { FRAC_CONST(0.007726837994772), FRAC_CONST(0.031336283143813) },
3105 { FRAC_CONST(0.007624249056906), FRAC_CONST(0.031361401323680) },
3106 { FRAC_CONST(0.007521578469457), FRAC_CONST(0.031386183648135) },
3107 { FRAC_CONST(0.007418827331946), FRAC_CONST(0.031410629851778) },
3108 { FRAC_CONST(0.007315996744755), FRAC_CONST(0.031434739672811) },
3109 { FRAC_CONST(0.007213087809115), FRAC_CONST(0.031458512853036) },
3110 { FRAC_CONST(0.007110101627101), FRAC_CONST(0.031481949137863) },
3111 { FRAC_CONST(0.007007039301610), FRAC_CONST(0.031505048276306) },
3112 { FRAC_CONST(0.006903901936357), FRAC_CONST(0.031527810020993) },
3113 { FRAC_CONST(0.006800690635862), FRAC_CONST(0.031550234128164) },
3114 { FRAC_CONST(0.006697406505433), FRAC_CONST(0.031572320357675) },
3115 { FRAC_CONST(0.006594050651161), FRAC_CONST(0.031594068473000) },
3116 { FRAC_CONST(0.006490624179905), FRAC_CONST(0.031615478241233) },
3117 { FRAC_CONST(0.006387128199278), FRAC_CONST(0.031636549433095) },
3118 { FRAC_CONST(0.006283563817639), FRAC_CONST(0.031657281822929) },
3119 { FRAC_CONST(0.006179932144080), FRAC_CONST(0.031677675188707) },
3120 { FRAC_CONST(0.006076234288412), FRAC_CONST(0.031697729312034) },
3121 { FRAC_CONST(0.005972471361157), FRAC_CONST(0.031717443978146) },
3122 { FRAC_CONST(0.005868644473532), FRAC_CONST(0.031736818975914) },
3123 { FRAC_CONST(0.005764754737440), FRAC_CONST(0.031755854097848) },
3124 { FRAC_CONST(0.005660803265456), FRAC_CONST(0.031774549140098) },
3125 { FRAC_CONST(0.005556791170816), FRAC_CONST(0.031792903902453) },
3126 { FRAC_CONST(0.005452719567407), FRAC_CONST(0.031810918188350) },
3127 { FRAC_CONST(0.005348589569753), FRAC_CONST(0.031828591804869) },
3128 { FRAC_CONST(0.005244402293001), FRAC_CONST(0.031845924562742) },
3129 { FRAC_CONST(0.005140158852914), FRAC_CONST(0.031862916276347) },
3130 { FRAC_CONST(0.005035860365855), FRAC_CONST(0.031879566763717) },
3131 { FRAC_CONST(0.004931507948778), FRAC_CONST(0.031895875846539) },
3132 { FRAC_CONST(0.004827102719212), FRAC_CONST(0.031911843350155) },
3133 { FRAC_CONST(0.004722645795254), FRAC_CONST(0.031927469103567) },
3134 { FRAC_CONST(0.004618138295554), FRAC_CONST(0.031942752939435) },
3135 { FRAC_CONST(0.004513581339303), FRAC_CONST(0.031957694694082) },
3136 { FRAC_CONST(0.004408976046222), FRAC_CONST(0.031972294207493) },
3137 { FRAC_CONST(0.004304323536549), FRAC_CONST(0.031986551323320) },
3138 { FRAC_CONST(0.004199624931030), FRAC_CONST(0.032000465888879) },
3139 { FRAC_CONST(0.004094881350902), FRAC_CONST(0.032014037755158) },
3140 { FRAC_CONST(0.003990093917884), FRAC_CONST(0.032027266776813) },
3141 { FRAC_CONST(0.003885263754166), FRAC_CONST(0.032040152812170) },
3142 { FRAC_CONST(0.003780391982394), FRAC_CONST(0.032052695723232) },
3143 { FRAC_CONST(0.003675479725661), FRAC_CONST(0.032064895375674) },
3144 { FRAC_CONST(0.003570528107494), FRAC_CONST(0.032076751638847) },
3145 { FRAC_CONST(0.003465538251839), FRAC_CONST(0.032088264385780) },
3146 { FRAC_CONST(0.003360511283053), FRAC_CONST(0.032099433493181) },
3147 { FRAC_CONST(0.003255448325892), FRAC_CONST(0.032110258841438) },
3148 { FRAC_CONST(0.003150350505494), FRAC_CONST(0.032120740314619) },
3149 { FRAC_CONST(0.003045218947373), FRAC_CONST(0.032130877800478) },
3150 { FRAC_CONST(0.002940054777404), FRAC_CONST(0.032140671190449) },
3151 { FRAC_CONST(0.002834859121810), FRAC_CONST(0.032150120379653) },
3152 { FRAC_CONST(0.002729633107153), FRAC_CONST(0.032159225266897) },
3153 { FRAC_CONST(0.002624377860318), FRAC_CONST(0.032167985754674) },
3154 { FRAC_CONST(0.002519094508504), FRAC_CONST(0.032176401749168) },
3155 { FRAC_CONST(0.002413784179212), FRAC_CONST(0.032184473160250) },
3156 { FRAC_CONST(0.002308448000231), FRAC_CONST(0.032192199901481) },
3157 { FRAC_CONST(0.002203087099626), FRAC_CONST(0.032199581890114) },
3158 { FRAC_CONST(0.002097702605728), FRAC_CONST(0.032206619047093) },
3159 { FRAC_CONST(0.001992295647121), FRAC_CONST(0.032213311297057) },
3160 { FRAC_CONST(0.001886867352628), FRAC_CONST(0.032219658568338) },
3161 { FRAC_CONST(0.001781418851302), FRAC_CONST(0.032225660792960) },
3162 { FRAC_CONST(0.001675951272410), FRAC_CONST(0.032231317906644) },
3163 { FRAC_CONST(0.001570465745428), FRAC_CONST(0.032236629848809) },
3164 { FRAC_CONST(0.001464963400018), FRAC_CONST(0.032241596562566) },
3165 { FRAC_CONST(0.001359445366028), FRAC_CONST(0.032246217994727) },
3166 { FRAC_CONST(0.001253912773470), FRAC_CONST(0.032250494095799) },
3167 { FRAC_CONST(0.001148366752513), FRAC_CONST(0.032254424819990) },
3168 { FRAC_CONST(0.001042808433471), FRAC_CONST(0.032258010125204) },
3169 { FRAC_CONST(0.000937238946789), FRAC_CONST(0.032261249973045) },
3170 { FRAC_CONST(0.000831659423030), FRAC_CONST(0.032264144328817) },
3171 { FRAC_CONST(0.000726070992868), FRAC_CONST(0.032266693161525) },
3172 { FRAC_CONST(0.000620474787068), FRAC_CONST(0.032268896443871) },
3173 { FRAC_CONST(0.000514871936481), FRAC_CONST(0.032270754152261) },
3174 { FRAC_CONST(0.000409263572030), FRAC_CONST(0.032272266266801) },
3175 { FRAC_CONST(0.000303650824695), FRAC_CONST(0.032273432771295) },
3176 { FRAC_CONST(0.000198034825504), FRAC_CONST(0.032274253653254) },
3177 { FRAC_CONST(0.000092416705518), FRAC_CONST(0.032274728903884) }
3178 };
3179
3180 #ifdef LD_DEC
3181 /* 240 (N/4) complex twiddle factors */
3182 ALIGN static const complex_t mdct_tab_960[] =
3183 {
3184 { FRAC_CONST(0.045643531183573), FRAC_CONST(0.000037342034959) },
3185 { FRAC_CONST(0.045642309173789), FRAC_CONST(0.000336075315362) },
3186 { FRAC_CONST(0.045639131999390), FRAC_CONST(0.000634794199417) },
3187 { FRAC_CONST(0.045633999796474), FRAC_CONST(0.000933485891002) },
3188 { FRAC_CONST(0.045626912784890), FRAC_CONST(0.001232137595157) },
3189 { FRAC_CONST(0.045617871268219), FRAC_CONST(0.001530736518639) },
3190 { FRAC_CONST(0.045606875633772), FRAC_CONST(0.001829269870464) },
3191 { FRAC_CONST(0.045593926352564), FRAC_CONST(0.002127724862455) },
3192 { FRAC_CONST(0.045579023979299), FRAC_CONST(0.002426088709795) },
3193 { FRAC_CONST(0.045562169152346), FRAC_CONST(0.002724348631569) },
3194 { FRAC_CONST(0.045543362593709), FRAC_CONST(0.003022491851315) },
3195 { FRAC_CONST(0.045522605108999), FRAC_CONST(0.003320505597570) },
3196 { FRAC_CONST(0.045499897587396), FRAC_CONST(0.003618377104416) },
3197 { FRAC_CONST(0.045475241001617), FRAC_CONST(0.003916093612031) },
3198 { FRAC_CONST(0.045448636407866), FRAC_CONST(0.004213642367228) },
3199 { FRAC_CONST(0.045420084945797), FRAC_CONST(0.004511010624011) },
3200 { FRAC_CONST(0.045389587838458), FRAC_CONST(0.004808185644112) },
3201 { FRAC_CONST(0.045357146392244), FRAC_CONST(0.005105154697544) },
3202 { FRAC_CONST(0.045322761996840), FRAC_CONST(0.005401905063139) },
3203 { FRAC_CONST(0.045286436125157), FRAC_CONST(0.005698424029100) },
3204 { FRAC_CONST(0.045248170333275), FRAC_CONST(0.005994698893542) },
3205 { FRAC_CONST(0.045207966260374), FRAC_CONST(0.006290716965035) },
3206 { FRAC_CONST(0.045165825628663), FRAC_CONST(0.006586465563151) },
3207 { FRAC_CONST(0.045121750243305), FRAC_CONST(0.006881932019003) },
3208 { FRAC_CONST(0.045075741992343), FRAC_CONST(0.007177103675792) },
3209 { FRAC_CONST(0.045027802846618), FRAC_CONST(0.007471967889347) },
3210 { FRAC_CONST(0.044977934859683), FRAC_CONST(0.007766512028667) },
3211 { FRAC_CONST(0.044926140167717), FRAC_CONST(0.008060723476460) },
3212 { FRAC_CONST(0.044872420989432), FRAC_CONST(0.008354589629687) },
3213 { FRAC_CONST(0.044816779625979), FRAC_CONST(0.008648097900101) },
3214 { FRAC_CONST(0.044759218460849), FRAC_CONST(0.008941235714784) },
3215 { FRAC_CONST(0.044699739959770), FRAC_CONST(0.009233990516688) },
3216 { FRAC_CONST(0.044638346670603), FRAC_CONST(0.009526349765171) },
3217 { FRAC_CONST(0.044575041223233), FRAC_CONST(0.009818300936537) },
3218 { FRAC_CONST(0.044509826329454), FRAC_CONST(0.010109831524568) },
3219 { FRAC_CONST(0.044442704782856), FRAC_CONST(0.010400929041064) },
3220 { FRAC_CONST(0.044373679458701), FRAC_CONST(0.010691581016378) },
3221 { FRAC_CONST(0.044302753313806), FRAC_CONST(0.010981774999945) },
3222 { FRAC_CONST(0.044229929386409), FRAC_CONST(0.011271498560822) },
3223 { FRAC_CONST(0.044155210796046), FRAC_CONST(0.011560739288214) },
3224 { FRAC_CONST(0.044078600743413), FRAC_CONST(0.011849484792012) },
3225 { FRAC_CONST(0.044000102510229), FRAC_CONST(0.012137722703321) },
3226 { FRAC_CONST(0.043919719459097), FRAC_CONST(0.012425440674986) },
3227 { FRAC_CONST(0.043837455033359), FRAC_CONST(0.012712626382127) },
3228 { FRAC_CONST(0.043753312756950), FRAC_CONST(0.012999267522665) },
3229 { FRAC_CONST(0.043667296234245), FRAC_CONST(0.013285351817848) },
3230 { FRAC_CONST(0.043579409149906), FRAC_CONST(0.013570867012776) },
3231 { FRAC_CONST(0.043489655268722), FRAC_CONST(0.013855800876928) },
3232 { FRAC_CONST(0.043398038435451), FRAC_CONST(0.014140141204686) },
3233 { FRAC_CONST(0.043304562574653), FRAC_CONST(0.014423875815857) },
3234 { FRAC_CONST(0.043209231690524), FRAC_CONST(0.014706992556195) },
3235 { FRAC_CONST(0.043112049866720), FRAC_CONST(0.014989479297920) },
3236 { FRAC_CONST(0.043013021266188), FRAC_CONST(0.015271323940241) },
3237 { FRAC_CONST(0.042912150130984), FRAC_CONST(0.015552514409871) },
3238 { FRAC_CONST(0.042809440782090), FRAC_CONST(0.015833038661547) },
3239 { FRAC_CONST(0.042704897619235), FRAC_CONST(0.016112884678543) },
3240 { FRAC_CONST(0.042598525120698), FRAC_CONST(0.016392040473187) },
3241 { FRAC_CONST(0.042490327843124), FRAC_CONST(0.016670494087374) },
3242 { FRAC_CONST(0.042380310421324), FRAC_CONST(0.016948233593079) },
3243 { FRAC_CONST(0.042268477568078), FRAC_CONST(0.017225247092864) },
3244 { FRAC_CONST(0.042154834073934), FRAC_CONST(0.017501522720393) },
3245 { FRAC_CONST(0.042039384807000), FRAC_CONST(0.017777048640940) },
3246 { FRAC_CONST(0.041922134712739), FRAC_CONST(0.018051813051888) },
3247 { FRAC_CONST(0.041803088813754), FRAC_CONST(0.018325804183247) },
3248 { FRAC_CONST(0.041682252209576), FRAC_CONST(0.018599010298148) },
3249 { FRAC_CONST(0.041559630076443), FRAC_CONST(0.018871419693350) },
3250 { FRAC_CONST(0.041435227667079), FRAC_CONST(0.019143020699741) },
3251 { FRAC_CONST(0.041309050310468), FRAC_CONST(0.019413801682838) },
3252 { FRAC_CONST(0.041181103411629), FRAC_CONST(0.019683751043285) },
3253 { FRAC_CONST(0.041051392451382), FRAC_CONST(0.019952857217350) },
3254 { FRAC_CONST(0.040919922986111), FRAC_CONST(0.020221108677421) },
3255 { FRAC_CONST(0.040786700647532), FRAC_CONST(0.020488493932496) },
3256 { FRAC_CONST(0.040651731142446), FRAC_CONST(0.020755001528683) },
3257 { FRAC_CONST(0.040515020252497), FRAC_CONST(0.021020620049682) },
3258 { FRAC_CONST(0.040376573833925), FRAC_CONST(0.021285338117280) },
3259 { FRAC_CONST(0.040236397817314), FRAC_CONST(0.021549144391836) },
3260 { FRAC_CONST(0.040094498207337), FRAC_CONST(0.021812027572768) },
3261 { FRAC_CONST(0.039950881082502), FRAC_CONST(0.022073976399034) },
3262 { FRAC_CONST(0.039805552594888), FRAC_CONST(0.022334979649620) },
3263 { FRAC_CONST(0.039658518969884), FRAC_CONST(0.022595026144014) },
3264 { FRAC_CONST(0.039509786505922), FRAC_CONST(0.022854104742690) },
3265 { FRAC_CONST(0.039359361574204), FRAC_CONST(0.023112204347583) },
3266 { FRAC_CONST(0.039207250618434), FRAC_CONST(0.023369313902565) },
3267 { FRAC_CONST(0.039053460154540), FRAC_CONST(0.023625422393919) },
3268 { FRAC_CONST(0.038897996770393), FRAC_CONST(0.023880518850809) },
3269 { FRAC_CONST(0.038740867125527), FRAC_CONST(0.024134592345752) },
3270 { FRAC_CONST(0.038582077950852), FRAC_CONST(0.024387631995085) },
3271 { FRAC_CONST(0.038421636048370), FRAC_CONST(0.024639626959432) },
3272 { FRAC_CONST(0.038259548290876), FRAC_CONST(0.024890566444167) },
3273 { FRAC_CONST(0.038095821621671), FRAC_CONST(0.025140439699877) },
3274 { FRAC_CONST(0.037930463054261), FRAC_CONST(0.025389236022825) },
3275 { FRAC_CONST(0.037763479672055), FRAC_CONST(0.025636944755403) },
3276 { FRAC_CONST(0.037594878628068), FRAC_CONST(0.025883555286595) },
3277 { FRAC_CONST(0.037424667144605), FRAC_CONST(0.026129057052425) },
3278 { FRAC_CONST(0.037252852512960), FRAC_CONST(0.026373439536415) },
3279 { FRAC_CONST(0.037079442093102), FRAC_CONST(0.026616692270033) },
3280 { FRAC_CONST(0.036904443313354), FRAC_CONST(0.026858804833142) },
3281 { FRAC_CONST(0.036727863670081), FRAC_CONST(0.027099766854444) },
3282 { FRAC_CONST(0.036549710727369), FRAC_CONST(0.027339568011930) },
3283 { FRAC_CONST(0.036369992116697), FRAC_CONST(0.027578198033315) },
3284 { FRAC_CONST(0.036188715536611), FRAC_CONST(0.027815646696484) },
3285 { FRAC_CONST(0.036005888752396), FRAC_CONST(0.028051903829926) },
3286 { FRAC_CONST(0.035821519595745), FRAC_CONST(0.028286959313171) },
3287 { FRAC_CONST(0.035635615964417), FRAC_CONST(0.028520803077226) },
3288 { FRAC_CONST(0.035448185821906), FRAC_CONST(0.028753425105002) },
3289 { FRAC_CONST(0.035259237197095), FRAC_CONST(0.028984815431745) },
3290 { FRAC_CONST(0.035068778183914), FRAC_CONST(0.029214964145465) },
3291 { FRAC_CONST(0.034876816940994), FRAC_CONST(0.029443861387355) },
3292 { FRAC_CONST(0.034683361691315), FRAC_CONST(0.029671497352220) },
3293 { FRAC_CONST(0.034488420721856), FRAC_CONST(0.029897862288892) },
3294 { FRAC_CONST(0.034292002383240), FRAC_CONST(0.030122946500652) },
3295 { FRAC_CONST(0.034094115089375), FRAC_CONST(0.030346740345641) },
3296 { FRAC_CONST(0.033894767317093), FRAC_CONST(0.030569234237276) },
3297 { FRAC_CONST(0.033693967605790), FRAC_CONST(0.030790418644658) },
3298 { FRAC_CONST(0.033491724557057), FRAC_CONST(0.031010284092984) },
3299 { FRAC_CONST(0.033288046834313), FRAC_CONST(0.031228821163949) },
3300 { FRAC_CONST(0.033082943162434), FRAC_CONST(0.031446020496153) },
3301 { FRAC_CONST(0.032876422327378), FRAC_CONST(0.031661872785500) },
3302 { FRAC_CONST(0.032668493175811), FRAC_CONST(0.031876368785596) },
3303 { FRAC_CONST(0.032459164614726), FRAC_CONST(0.032089499308145) },
3304 { FRAC_CONST(0.032248445611061), FRAC_CONST(0.032301255223347) },
3305 { FRAC_CONST(0.032036345191317), FRAC_CONST(0.032511627460281) },
3306 { FRAC_CONST(0.031822872441171), FRAC_CONST(0.032720607007302) },
3307 { FRAC_CONST(0.031608036505083), FRAC_CONST(0.032928184912422) },
3308 { FRAC_CONST(0.031391846585912), FRAC_CONST(0.033134352283693) },
3309 { FRAC_CONST(0.031174311944513), FRAC_CONST(0.033339100289593) },
3310 { FRAC_CONST(0.030955441899347), FRAC_CONST(0.033542420159397) },
3311 { FRAC_CONST(0.030735245826077), FRAC_CONST(0.033744303183559) },
3312 { FRAC_CONST(0.030513733157171), FRAC_CONST(0.033944740714083) },
3313 { FRAC_CONST(0.030290913381494), FRAC_CONST(0.034143724164891) },
3314 { FRAC_CONST(0.030066796043904), FRAC_CONST(0.034341245012195) },
3315 { FRAC_CONST(0.029841390744841), FRAC_CONST(0.034537294794860) },
3316 { FRAC_CONST(0.029614707139919), FRAC_CONST(0.034731865114764) },
3317 { FRAC_CONST(0.029386754939508), FRAC_CONST(0.034924947637164) },
3318 { FRAC_CONST(0.029157543908322), FRAC_CONST(0.035116534091046) },
3319 { FRAC_CONST(0.028927083864999), FRAC_CONST(0.035306616269485) },
3320 { FRAC_CONST(0.028695384681680), FRAC_CONST(0.035495186029992) },
3321 { FRAC_CONST(0.028462456283587), FRAC_CONST(0.035682235294866) },
3322 { FRAC_CONST(0.028228308648598), FRAC_CONST(0.035867756051541) },
3323 { FRAC_CONST(0.027992951806817), FRAC_CONST(0.036051740352923) },
3324 { FRAC_CONST(0.027756395840148), FRAC_CONST(0.036234180317738) },
3325 { FRAC_CONST(0.027518650881862), FRAC_CONST(0.036415068130865) },
3326 { FRAC_CONST(0.027279727116161), FRAC_CONST(0.036594396043672) },
3327 { FRAC_CONST(0.027039634777745), FRAC_CONST(0.036772156374348) },
3328 { FRAC_CONST(0.026798384151369), FRAC_CONST(0.036948341508233) },
3329 { FRAC_CONST(0.026555985571409), FRAC_CONST(0.037122943898140) },
3330 { FRAC_CONST(0.026312449421412), FRAC_CONST(0.037295956064686) },
3331 { FRAC_CONST(0.026067786133656), FRAC_CONST(0.037467370596605) },
3332 { FRAC_CONST(0.025822006188702), FRAC_CONST(0.037637180151068) },
3333 { FRAC_CONST(0.025575120114946), FRAC_CONST(0.037805377454000) },
3334 { FRAC_CONST(0.025327138488165), FRAC_CONST(0.037971955300388) },
3335 { FRAC_CONST(0.025078071931066), FRAC_CONST(0.038136906554591) },
3336 { FRAC_CONST(0.024827931112832), FRAC_CONST(0.038300224150647) },
3337 { FRAC_CONST(0.024576726748663), FRAC_CONST(0.038461901092573) },
3338 { FRAC_CONST(0.024324469599317), FRAC_CONST(0.038621930454668) },
3339 { FRAC_CONST(0.024071170470652), FRAC_CONST(0.038780305381806) },
3340 { FRAC_CONST(0.023816840213160), FRAC_CONST(0.038937019089732) },
3341 { FRAC_CONST(0.023561489721501), FRAC_CONST(0.039092064865353) },
3342 { FRAC_CONST(0.023305129934041), FRAC_CONST(0.039245436067023) },
3343 { FRAC_CONST(0.023047771832380), FRAC_CONST(0.039397126124832) },
3344 { FRAC_CONST(0.022789426440883), FRAC_CONST(0.039547128540881) },
3345 { FRAC_CONST(0.022530104826206), FRAC_CONST(0.039695436889566) },
3346 { FRAC_CONST(0.022269818096825), FRAC_CONST(0.039842044817851) },
3347 { FRAC_CONST(0.022008577402555), FRAC_CONST(0.039986946045542) },
3348 { FRAC_CONST(0.021746393934081), FRAC_CONST(0.040130134365550) },
3349 { FRAC_CONST(0.021483278922467), FRAC_CONST(0.040271603644166) },
3350 { FRAC_CONST(0.021219243638687), FRAC_CONST(0.040411347821316) },
3351 { FRAC_CONST(0.020954299393132), FRAC_CONST(0.040549360910825) },
3352 { FRAC_CONST(0.020688457535133), FRAC_CONST(0.040685637000671) },
3353 { FRAC_CONST(0.020421729452469), FRAC_CONST(0.040820170253240) },
3354 { FRAC_CONST(0.020154126570884), FRAC_CONST(0.040952954905576) },
3355 { FRAC_CONST(0.019885660353596), FRAC_CONST(0.041083985269625) },
3356 { FRAC_CONST(0.019616342300802), FRAC_CONST(0.041213255732484) },
3357 { FRAC_CONST(0.019346183949192), FRAC_CONST(0.041340760756635) },
3358 { FRAC_CONST(0.019075196871451), FRAC_CONST(0.041466494880189) },
3359 { FRAC_CONST(0.018803392675763), FRAC_CONST(0.041590452717113) },
3360 { FRAC_CONST(0.018530783005316), FRAC_CONST(0.041712628957466) },
3361 { FRAC_CONST(0.018257379537800), FRAC_CONST(0.041833018367625) },
3362 { FRAC_CONST(0.017983193984910), FRAC_CONST(0.041951615790509) },
3363 { FRAC_CONST(0.017708238091842), FRAC_CONST(0.042068416145797) },
3364 { FRAC_CONST(0.017432523636792), FRAC_CONST(0.042183414430153) },
3365 { FRAC_CONST(0.017156062430449), FRAC_CONST(0.042296605717432) },
3366 { FRAC_CONST(0.016878866315491), FRAC_CONST(0.042407985158896) },
3367 { FRAC_CONST(0.016600947166078), FRAC_CONST(0.042517547983420) },
3368 { FRAC_CONST(0.016322316887341), FRAC_CONST(0.042625289497698) },
3369 { FRAC_CONST(0.016042987414872), FRAC_CONST(0.042731205086442) },
3370 { FRAC_CONST(0.015762970714219), FRAC_CONST(0.042835290212581) },
3371 { FRAC_CONST(0.015482278780363), FRAC_CONST(0.042937540417454) },
3372 { FRAC_CONST(0.015200923637213), FRAC_CONST(0.043037951321002) },
3373 { FRAC_CONST(0.014918917337087), FRAC_CONST(0.043136518621958) },
3374 { FRAC_CONST(0.014636271960196), FRAC_CONST(0.043233238098025) },
3375 { FRAC_CONST(0.014352999614128), FRAC_CONST(0.043328105606063) },
3376 { FRAC_CONST(0.014069112433327), FRAC_CONST(0.043421117082265) },
3377 { FRAC_CONST(0.013784622578575), FRAC_CONST(0.043512268542327) },
3378 { FRAC_CONST(0.013499542236471), FRAC_CONST(0.043601556081625) },
3379 { FRAC_CONST(0.013213883618907), FRAC_CONST(0.043688975875378) },
3380 { FRAC_CONST(0.012927658962548), FRAC_CONST(0.043774524178812) },
3381 { FRAC_CONST(0.012640880528305), FRAC_CONST(0.043858197327323) },
3382 { FRAC_CONST(0.012353560600813), FRAC_CONST(0.043939991736633) },
3383 { FRAC_CONST(0.012065711487901), FRAC_CONST(0.044019903902940) },
3384 { FRAC_CONST(0.011777345520066), FRAC_CONST(0.044097930403073) },
3385 { FRAC_CONST(0.011488475049948), FRAC_CONST(0.044174067894638) },
3386 { FRAC_CONST(0.011199112451794), FRAC_CONST(0.044248313116156) },
3387 { FRAC_CONST(0.010909270120937), FRAC_CONST(0.044320662887211) },
3388 { FRAC_CONST(0.010618960473257), FRAC_CONST(0.044391114108577) },
3389 { FRAC_CONST(0.010328195944653), FRAC_CONST(0.044459663762361) },
3390 { FRAC_CONST(0.010036988990509), FRAC_CONST(0.044526308912122) },
3391 { FRAC_CONST(0.009745352085163), FRAC_CONST(0.044591046703005) },
3392 { FRAC_CONST(0.009453297721368), FRAC_CONST(0.044653874361857) },
3393 { FRAC_CONST(0.009160838409762), FRAC_CONST(0.044714789197351) },
3394 { FRAC_CONST(0.008867986678328), FRAC_CONST(0.044773788600099) },
3395 { FRAC_CONST(0.008574755071860), FRAC_CONST(0.044830870042761) },
3396 { FRAC_CONST(0.008281156151424), FRAC_CONST(0.044886031080160) },
3397 { FRAC_CONST(0.007987202493820), FRAC_CONST(0.044939269349379) },
3398 { FRAC_CONST(0.007692906691044), FRAC_CONST(0.044990582569869) },
3399 { FRAC_CONST(0.007398281349750), FRAC_CONST(0.045039968543542) },
3400 { FRAC_CONST(0.007103339090706), FRAC_CONST(0.045087425154868) },
3401 { FRAC_CONST(0.006808092548258), FRAC_CONST(0.045132950370962) },
3402 { FRAC_CONST(0.006512554369783), FRAC_CONST(0.045176542241676) },
3403 { FRAC_CONST(0.006216737215155), FRAC_CONST(0.045218198899680) },
3404 { FRAC_CONST(0.005920653756196), FRAC_CONST(0.045257918560541) },
3405 { FRAC_CONST(0.005624316676135), FRAC_CONST(0.045295699522801) },
3406 { FRAC_CONST(0.005327738669067), FRAC_CONST(0.045331540168049) },
3407 { FRAC_CONST(0.005030932439406), FRAC_CONST(0.045365438960992) },
3408 { FRAC_CONST(0.004733910701344), FRAC_CONST(0.045397394449517) },
3409 { FRAC_CONST(0.004436686178303), FRAC_CONST(0.045427405264758) },
3410 { FRAC_CONST(0.004139271602393), FRAC_CONST(0.045455470121152) },
3411 { FRAC_CONST(0.003841679713863), FRAC_CONST(0.045481587816494) },
3412 { FRAC_CONST(0.003543923260561), FRAC_CONST(0.045505757231988) },
3413 { FRAC_CONST(0.003246014997382), FRAC_CONST(0.045527977332297) },
3414 { FRAC_CONST(0.002947967685724), FRAC_CONST(0.045548247165585) },
3415 { FRAC_CONST(0.002649794092941), FRAC_CONST(0.045566565863562) },
3416 { FRAC_CONST(0.002351506991799), FRAC_CONST(0.045582932641515) },
3417 { FRAC_CONST(0.002053119159924), FRAC_CONST(0.045597346798344) },
3418 { FRAC_CONST(0.001754643379257), FRAC_CONST(0.045609807716597) },
3419 { FRAC_CONST(0.001456092435508), FRAC_CONST(0.045620314862489) },
3420 { FRAC_CONST(0.001157479117605), FRAC_CONST(0.045628867785927) },
3421 { FRAC_CONST(0.000858816217149), FRAC_CONST(0.045635466120535) },
3422 { FRAC_CONST(0.000560116527865), FRAC_CONST(0.045640109583661) },
3423 { FRAC_CONST(0.000261392845053), FRAC_CONST(0.045642797976394) }
3424 };
3425 #endif // LD_DEC
3426
3427 /* 60 (N/4) complex twiddle factors */
3428 ALIGN static const complex_t mdct_tab_240[] =
3429 {
3430 { FRAC_CONST(0.091286604111815), FRAC_CONST(0.000298735779793) },
3431 { FRAC_CONST(0.091247502481454), FRAC_CONST(0.002688238127538) },
3432 { FRAC_CONST(0.091145864370807), FRAC_CONST(0.005075898091152) },
3433 { FRAC_CONST(0.090981759437558), FRAC_CONST(0.007460079287760) },
3434 { FRAC_CONST(0.090755300151030), FRAC_CONST(0.009839147718664) },
3435 { FRAC_CONST(0.090466641715108), FRAC_CONST(0.012211472889198) },
3436 { FRAC_CONST(0.090115981961863), FRAC_CONST(0.014575428926191) },
3437 { FRAC_CONST(0.089703561215976), FRAC_CONST(0.016929395692256) },
3438 { FRAC_CONST(0.089229662130024), FRAC_CONST(0.019271759896156) },
3439 { FRAC_CONST(0.088694609490769), FRAC_CONST(0.021600916198470) },
3440 { FRAC_CONST(0.088098769996564), FRAC_CONST(0.023915268311810) },
3441 { FRAC_CONST(0.087442552006035), FRAC_CONST(0.026213230094844) },
3442 { FRAC_CONST(0.086726405258214), FRAC_CONST(0.028493226639351) },
3443 { FRAC_CONST(0.085950820564309), FRAC_CONST(0.030753695349588) },
3444 { FRAC_CONST(0.085116329471329), FRAC_CONST(0.032993087013213) },
3445 { FRAC_CONST(0.084223503897785), FRAC_CONST(0.035209866863042) },
3446 { FRAC_CONST(0.083272955741727), FRAC_CONST(0.037402515628894) },
3447 { FRAC_CONST(0.082265336461381), FRAC_CONST(0.039569530578832) },
3448 { FRAC_CONST(0.081201336628670), FRAC_CONST(0.041709426549053) },
3449 { FRAC_CONST(0.080081685455930), FRAC_CONST(0.043820736961749) },
3450 { FRAC_CONST(0.078907150296148), FRAC_CONST(0.045902014830227) },
3451 { FRAC_CONST(0.077678536117054), FRAC_CONST(0.047951833750597) },
3452 { FRAC_CONST(0.076396684949434), FRAC_CONST(0.049968788879362) },
3453 { FRAC_CONST(0.075062475310050), FRAC_CONST(0.051951497896226) },
3454 { FRAC_CONST(0.073676821599542), FRAC_CONST(0.053898601951466) },
3455 { FRAC_CONST(0.072240673475749), FRAC_CONST(0.055808766597225) },
3456 { FRAC_CONST(0.070755015202858), FRAC_CONST(0.057680682702068) },
3457 { FRAC_CONST(0.069220864976840), FRAC_CONST(0.059513067348201) },
3458 { FRAC_CONST(0.067639274227625), FRAC_CONST(0.061304664710718) },
3459 { FRAC_CONST(0.066011326898512), FRAC_CONST(0.063054246918278) },
3460 { FRAC_CONST(0.064338138703282), FRAC_CONST(0.064760614894630) },
3461 { FRAC_CONST(0.062620856361546), FRAC_CONST(0.066422599180399) },
3462 { FRAC_CONST(0.060860656812842), FRAC_CONST(0.068039060734572) },
3463 { FRAC_CONST(0.059058746410016), FRAC_CONST(0.069608891715145) },
3464 { FRAC_CONST(0.057216360092450), FRAC_CONST(0.071131016238378) },
3465 { FRAC_CONST(0.055334760539699), FRAC_CONST(0.072604391116154) },
3466 { FRAC_CONST(0.053415237306106), FRAC_CONST(0.074028006570930) },
3467 { FRAC_CONST(0.051459105937014), FRAC_CONST(0.075400886927784) },
3468 { FRAC_CONST(0.049467707067153), FRAC_CONST(0.076722091283096) },
3469 { FRAC_CONST(0.047442405501835), FRAC_CONST(0.077990714149396) },
3470 { FRAC_CONST(0.045384589281588), FRAC_CONST(0.079205886075941) },
3471 { FRAC_CONST(0.043295668730857), FRAC_CONST(0.080366774244592) },
3472 { FRAC_CONST(0.041177075491445), FRAC_CONST(0.081472583040586) },
3473 { FRAC_CONST(0.039030261541332), FRAC_CONST(0.082522554597810) },
3474 { FRAC_CONST(0.036856698199564), FRAC_CONST(0.083515969318206) },
3475 { FRAC_CONST(0.034657875117883), FRAC_CONST(0.084452146364948) },
3476 { FRAC_CONST(0.032435299259796), FRAC_CONST(0.085330444129049) },
3477 { FRAC_CONST(0.030190493867775), FRAC_CONST(0.086150260669096) },
3478 { FRAC_CONST(0.027924997419306), FRAC_CONST(0.086911034123781) },
3479 { FRAC_CONST(0.025640362572491), FRAC_CONST(0.087612243096981) },
3480 { FRAC_CONST(0.023338155101933), FRAC_CONST(0.088253407015092) },
3481 { FRAC_CONST(0.021019952825636), FRAC_CONST(0.088834086456390) },
3482 { FRAC_CONST(0.018687344523641), FRAC_CONST(0.089353883452193) },
3483 { FRAC_CONST(0.016341928849164), FRAC_CONST(0.089812441759604) },
3484 { FRAC_CONST(0.013985313232951), FRAC_CONST(0.090209447105664) },
3485 { FRAC_CONST(0.011619112781631), FRAC_CONST(0.090544627402740) },
3486 { FRAC_CONST(0.009244949170797), FRAC_CONST(0.090817752935000) },
3487 { FRAC_CONST(0.006864449533597), FRAC_CONST(0.091028636515846) },
3488 { FRAC_CONST(0.004479245345574), FRAC_CONST(0.091177133616206) },
3489 { FRAC_CONST(0.002090971306534), FRAC_CONST(0.091263142463585) }
3490 };
3491 #endif // ALLOW_SMALL_FRAMELENGTH
3492
3493 #ifdef SSR_DEC
3494 /* 128 (N/4) complex twiddle factors */
3495 ALIGN static const complex_t mdct_tab_512[] =
3496 {
3497 { FRAC_CONST(0.062499926465731), FRAC_CONST(0.000095873761643) },
3498 { FRAC_CONST(0.062494043817678), FRAC_CONST(0.000862836783004) },
3499 { FRAC_CONST(0.062478749796497), FRAC_CONST(0.001629669864319) },
3500 { FRAC_CONST(0.062454046705412), FRAC_CONST(0.002396257523347) },
3501 { FRAC_CONST(0.062419938264617), FRAC_CONST(0.003162484314806) },
3502 { FRAC_CONST(0.062376429610718), FRAC_CONST(0.003928234847760) },
3503 { FRAC_CONST(0.062323527295958), FRAC_CONST(0.004693393802995) },
3504 { FRAC_CONST(0.062261239287231), FRAC_CONST(0.005457845950387) },
3505 { FRAC_CONST(0.062189574964882), FRAC_CONST(0.006221476166254) },
3506 { FRAC_CONST(0.062108545121295), FRAC_CONST(0.006984169450695) },
3507 { FRAC_CONST(0.062018161959266), FRAC_CONST(0.007745810944907) },
3508 { FRAC_CONST(0.061918439090167), FRAC_CONST(0.008506285948482) },
3509 { FRAC_CONST(0.061809391531894), FRAC_CONST(0.009265479936681) },
3510 { FRAC_CONST(0.061691035706609), FRAC_CONST(0.010023278577683) },
3511 { FRAC_CONST(0.061563389438265), FRAC_CONST(0.010779567749800) },
3512 { FRAC_CONST(0.061426471949919), FRAC_CONST(0.011534233558664) },
3513 { FRAC_CONST(0.061280303860842), FRAC_CONST(0.012287162354380) },
3514 { FRAC_CONST(0.061124907183410), FRAC_CONST(0.013038240748641) },
3515 { FRAC_CONST(0.060960305319791), FRAC_CONST(0.013787355631805) },
3516 { FRAC_CONST(0.060786523058421), FRAC_CONST(0.014534394189923) },
3517 { FRAC_CONST(0.060603586570268), FRAC_CONST(0.015279243921739) },
3518 { FRAC_CONST(0.060411523404896), FRAC_CONST(0.016021792655621) },
3519 { FRAC_CONST(0.060210362486310), FRAC_CONST(0.016761928566463) },
3520 { FRAC_CONST(0.060000134108604), FRAC_CONST(0.017499540192517) },
3521 { FRAC_CONST(0.059780869931400), FRAC_CONST(0.018234516452187) },
3522 { FRAC_CONST(0.059552602975075), FRAC_CONST(0.018966746660751) },
3523 { FRAC_CONST(0.059315367615794), FRAC_CONST(0.019696120547033) },
3524 { FRAC_CONST(0.059069199580329), FRAC_CONST(0.020422528270008) },
3525 { FRAC_CONST(0.058814135940681), FRAC_CONST(0.021145860435346) },
3526 { FRAC_CONST(0.058550215108495), FRAC_CONST(0.021866008111883) },
3527 { FRAC_CONST(0.058277476829279), FRAC_CONST(0.022582862848028) },
3528 { FRAC_CONST(0.057995962176414), FRAC_CONST(0.023296316688095) },
3529 { FRAC_CONST(0.057705713544970), FRAC_CONST(0.024006262188558) },
3530 { FRAC_CONST(0.057406774645326), FRAC_CONST(0.024712592434239) },
3531 { FRAC_CONST(0.057099190496578), FRAC_CONST(0.025415201054398) },
3532 { FRAC_CONST(0.056783007419769), FRAC_CONST(0.026113982238763) },
3533 { FRAC_CONST(0.056458273030907), FRAC_CONST(0.026808830753458) },
3534 { FRAC_CONST(0.056125036233796), FRAC_CONST(0.027499641956852) },
3535 { FRAC_CONST(0.055783347212673), FRAC_CONST(0.028186311815319) },
3536 { FRAC_CONST(0.055433257424646), FRAC_CONST(0.028868736918904) },
3537 { FRAC_CONST(0.055074819591951), FRAC_CONST(0.029546814496896) },
3538 { FRAC_CONST(0.054708087694007), FRAC_CONST(0.030220442433307) },
3539 { FRAC_CONST(0.054333116959288), FRAC_CONST(0.030889519282247) },
3540 { FRAC_CONST(0.053949963857008), FRAC_CONST(0.031553944283204) },
3541 { FRAC_CONST(0.053558686088614), FRAC_CONST(0.032213617376216) },
3542 { FRAC_CONST(0.053159342579100), FRAC_CONST(0.032868439216943) },
3543 { FRAC_CONST(0.052751993468129), FRAC_CONST(0.033518311191623) },
3544 { FRAC_CONST(0.052336700100979), FRAC_CONST(0.034163135431927) },
3545 { FRAC_CONST(0.051913525019303), FRAC_CONST(0.034802814829698) },
3546 { FRAC_CONST(0.051482531951712), FRAC_CONST(0.035437253051569) },
3547 { FRAC_CONST(0.051043785804177), FRAC_CONST(0.036066354553480) },
3548 { FRAC_CONST(0.050597352650253), FRAC_CONST(0.036690024595057) },
3549 { FRAC_CONST(0.050143299721132), FRAC_CONST(0.037308169253887) },
3550 { FRAC_CONST(0.049681695395515), FRAC_CONST(0.037920695439658) },
3551 { FRAC_CONST(0.049212609189314), FRAC_CONST(0.038527510908178) },
3552 { FRAC_CONST(0.048736111745188), FRAC_CONST(0.039128524275271) },
3553 { FRAC_CONST(0.048252274821899), FRAC_CONST(0.039723645030535) },
3554 { FRAC_CONST(0.047761171283507), FRAC_CONST(0.040312783550971) },
3555 { FRAC_CONST(0.047262875088400), FRAC_CONST(0.040895851114488) },
3556 { FRAC_CONST(0.046757461278150), FRAC_CONST(0.041472759913252) },
3557 { FRAC_CONST(0.046245005966220), FRAC_CONST(0.042043423066923) },
3558 { FRAC_CONST(0.045725586326493), FRAC_CONST(0.042607754635728) },
3559 { FRAC_CONST(0.045199280581658), FRAC_CONST(0.043165669633408) },
3560 { FRAC_CONST(0.044666167991423), FRAC_CONST(0.043717084040018) },
3561 { FRAC_CONST(0.044126328840584), FRAC_CONST(0.044261914814575) },
3562 { FRAC_CONST(0.043579844426930), FRAC_CONST(0.044800079907569) },
3563 { FRAC_CONST(0.043026797049006), FRAC_CONST(0.045331498273316) },
3564 { FRAC_CONST(0.042467269993710), FRAC_CONST(0.045856089882166) },
3565 { FRAC_CONST(0.041901347523761), FRAC_CONST(0.046373775732552) },
3566 { FRAC_CONST(0.041329114865000), FRAC_CONST(0.046884477862888) },
3567 { FRAC_CONST(0.040750658193560), FRAC_CONST(0.047388119363313) },
3568 { FRAC_CONST(0.040166064622889), FRAC_CONST(0.047884624387270) },
3569 { FRAC_CONST(0.039575422190629), FRAC_CONST(0.048373918162926) },
3570 { FRAC_CONST(0.038978819845356), FRAC_CONST(0.048855927004441) },
3571 { FRAC_CONST(0.038376347433190), FRAC_CONST(0.049330578323055) },
3572 { FRAC_CONST(0.037768095684260), FRAC_CONST(0.049797800638026) },
3573 { FRAC_CONST(0.037154156199042), FRAC_CONST(0.050257523587392) },
3574 { FRAC_CONST(0.036534621434563), FRAC_CONST(0.050709677938566) },
3575 { FRAC_CONST(0.035909584690482), FRAC_CONST(0.051154195598769) },
3576 { FRAC_CONST(0.035279140095032), FRAC_CONST(0.051591009625274) },
3577 { FRAC_CONST(0.034643382590851), FRAC_CONST(0.052020054235496) },
3578 { FRAC_CONST(0.034002407920680), FRAC_CONST(0.052441264816895) },
3579 { FRAC_CONST(0.033356312612947), FRAC_CONST(0.052854577936706) },
3580 { FRAC_CONST(0.032705193967229), FRAC_CONST(0.053259931351495) },
3581 { FRAC_CONST(0.032049150039598), FRAC_CONST(0.053657264016528) },
3582 { FRAC_CONST(0.031388279627857), FRAC_CONST(0.054046516094966) },
3583 { FRAC_CONST(0.030722682256659), FRAC_CONST(0.054427628966880) },
3584 { FRAC_CONST(0.030052458162521), FRAC_CONST(0.054800545238072) },
3585 { FRAC_CONST(0.029377708278725), FRAC_CONST(0.055165208748723) },
3586 { FRAC_CONST(0.028698534220122), FRAC_CONST(0.055521564581850) },
3587 { FRAC_CONST(0.028015038267826), FRAC_CONST(0.055869559071575) },
3588 { FRAC_CONST(0.027327323353815), FRAC_CONST(0.056209139811209) },
3589 { FRAC_CONST(0.026635493045425), FRAC_CONST(0.056540255661140) },
3590 { FRAC_CONST(0.025939651529755), FRAC_CONST(0.056862856756541) },
3591 { FRAC_CONST(0.025239903597978), FRAC_CONST(0.057176894514872) },
3592 { FRAC_CONST(0.024536354629559), FRAC_CONST(0.057482321643202) },
3593 { FRAC_CONST(0.023829110576385), FRAC_CONST(0.057779092145329) },
3594 { FRAC_CONST(0.023118277946808), FRAC_CONST(0.058067161328707) },
3595 { FRAC_CONST(0.022403963789609), FRAC_CONST(0.058346485811177) },
3596 { FRAC_CONST(0.021686275677870), FRAC_CONST(0.058617023527499) },
3597 { FRAC_CONST(0.020965321692783), FRAC_CONST(0.058878733735689) },
3598 { FRAC_CONST(0.020241210407366), FRAC_CONST(0.059131577023150) },
3599 { FRAC_CONST(0.019514050870114), FRAC_CONST(0.059375515312615) },
3600 { FRAC_CONST(0.018783952588580), FRAC_CONST(0.059610511867874) },
3601 { FRAC_CONST(0.018051025512878), FRAC_CONST(0.059836531299311) },
3602 { FRAC_CONST(0.017315380019131), FRAC_CONST(0.060053539569230) },
3603 { FRAC_CONST(0.016577126892844), FRAC_CONST(0.060261503996984) },
3604 { FRAC_CONST(0.015836377312223), FRAC_CONST(0.060460393263896) },
3605 { FRAC_CONST(0.015093242831429), FRAC_CONST(0.060650177417972) },
3606 { FRAC_CONST(0.014347835363782), FRAC_CONST(0.060830827878419) },
3607 { FRAC_CONST(0.013600267164905), FRAC_CONST(0.061002317439940) },
3608 { FRAC_CONST(0.012850650815819), FRAC_CONST(0.061164620276839) },
3609 { FRAC_CONST(0.012099099205988), FRAC_CONST(0.061317711946905) },
3610 { FRAC_CONST(0.011345725516320), FRAC_CONST(0.061461569395097) },
3611 { FRAC_CONST(0.010590643202123), FRAC_CONST(0.061596170957011) },
3612 { FRAC_CONST(0.009833965976015), FRAC_CONST(0.061721496362147) },
3613 { FRAC_CONST(0.009075807790803), FRAC_CONST(0.061837526736961) },
3614 { FRAC_CONST(0.008316282822321), FRAC_CONST(0.061944244607705) },
3615 { FRAC_CONST(0.007555505452236), FRAC_CONST(0.062041633903059) },
3616 { FRAC_CONST(0.006793590250821), FRAC_CONST(0.062129679956555) },
3617 { FRAC_CONST(0.006030651959703), FRAC_CONST(0.062208369508780) },
3618 { FRAC_CONST(0.005266805474583), FRAC_CONST(0.062277690709378) },
3619 { FRAC_CONST(0.004502165827931), FRAC_CONST(0.062337633118830) },
3620 { FRAC_CONST(0.003736848171665), FRAC_CONST(0.062388187710030) },
3621 { FRAC_CONST(0.002970967759810), FRAC_CONST(0.062429346869643) },
3622 { FRAC_CONST(0.002204639931138), FRAC_CONST(0.062461104399250) },
3623 { FRAC_CONST(0.001437980091802), FRAC_CONST(0.062483455516285) },
3624 { FRAC_CONST(0.000671103697954), FRAC_CONST(0.062496396854751) }
3625 };
3626
3627 /* 16 (N/4) complex twiddle factors */
3628 ALIGN static const complex_t mdct_tab_64[] =
3629 {
3630 { FRAC_CONST(0.176763384336599), FRAC_CONST(0.002169321984356) },
3631 { FRAC_CONST(0.175699589589310), FRAC_CONST(0.019484717553714) },
3632 { FRAC_CONST(0.172943711747111), FRAC_CONST(0.036612464641599) },
3633 { FRAC_CONST(0.168522291420137), FRAC_CONST(0.053387613680577) },
3634 { FRAC_CONST(0.162477909303132), FRAC_CONST(0.069648610815172) },
3635 { FRAC_CONST(0.154868776100077), FRAC_CONST(0.085238853753814) },
3636 { FRAC_CONST(0.145768171923295), FRAC_CONST(0.100008199934509) },
3637 { FRAC_CONST(0.135263740565902), FRAC_CONST(0.113814412479792) },
3638 { FRAC_CONST(0.123456645444178), FRAC_CONST(0.126524530015608) },
3639 { FRAC_CONST(0.110460595338559), FRAC_CONST(0.138016147162030) },
3640 { FRAC_CONST(0.096400749315926), FRAC_CONST(0.148178593363981) },
3641 { FRAC_CONST(0.081412511379371), FRAC_CONST(0.156913998709178) },
3642 { FRAC_CONST(0.065640226453626), FRAC_CONST(0.164138236468888) },
3643 { FRAC_CONST(0.049235790264535), FRAC_CONST(0.169781733284316) },
3644 { FRAC_CONST(0.032357186500177), FRAC_CONST(0.173790139196080) },
3645 { FRAC_CONST(0.015166965341583), FRAC_CONST(0.176124851064031) }
3646 };
3647 #endif // SSR_DEC
3648
3649 #endif // FIXED_POINT
3650
3651 #ifdef __cplusplus
3652 }
3653 #endif
3654 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: mp4.c,v 1.38 2007/11/01 12:33:32 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #include <stdlib.h>
34
35 #include "bits.h"
36 #include "mp4.h"
37 #include "syntax.h"
38
39 /* defines if an object type can be decoded by this library or not */
40 static uint8_t ObjectTypesTable[32] = {
41 0, /* 0 NULL */
42 #ifdef MAIN_DEC
43 1, /* 1 AAC Main */
44 #else
45 0, /* 1 AAC Main */
46 #endif
47 1, /* 2 AAC LC */
48 #ifdef SSR_DEC
49 1, /* 3 AAC SSR */
50 #else
51 0, /* 3 AAC SSR */
52 #endif
53 #ifdef LTP_DEC
54 1, /* 4 AAC LTP */
55 #else
56 0, /* 4 AAC LTP */
57 #endif
58 #ifdef SBR_DEC
59 1, /* 5 SBR */
60 #else
61 0, /* 5 SBR */
62 #endif
63 0, /* 6 AAC Scalable */
64 0, /* 7 TwinVQ */
65 0, /* 8 CELP */
66 0, /* 9 HVXC */
67 0, /* 10 Reserved */
68 0, /* 11 Reserved */
69 0, /* 12 TTSI */
70 0, /* 13 Main synthetic */
71 0, /* 14 Wavetable synthesis */
72 0, /* 15 General MIDI */
73 0, /* 16 Algorithmic Synthesis and Audio FX */
74
75 /* MPEG-4 Version 2 */
76 #ifdef ERROR_RESILIENCE
77 1, /* 17 ER AAC LC */
78 0, /* 18 (Reserved) */
79 #ifdef LTP_DEC
80 1, /* 19 ER AAC LTP */
81 #else
82 0, /* 19 ER AAC LTP */
83 #endif
84 0, /* 20 ER AAC scalable */
85 0, /* 21 ER TwinVQ */
86 0, /* 22 ER BSAC */
87 #ifdef LD_DEC
88 1, /* 23 ER AAC LD */
89 #else
90 0, /* 23 ER AAC LD */
91 #endif
92 0, /* 24 ER CELP */
93 0, /* 25 ER HVXC */
94 0, /* 26 ER HILN */
95 0, /* 27 ER Parametric */
96 #else /* No ER defined */
97 0, /* 17 ER AAC LC */
98 0, /* 18 (Reserved) */
99 0, /* 19 ER AAC LTP */
100 0, /* 20 ER AAC scalable */
101 0, /* 21 ER TwinVQ */
102 0, /* 22 ER BSAC */
103 0, /* 23 ER AAC LD */
104 0, /* 24 ER CELP */
105 0, /* 25 ER HVXC */
106 0, /* 26 ER HILN */
107 0, /* 27 ER Parametric */
108 #endif
109 0, /* 28 (Reserved) */
110 0, /* 29 (Reserved) */
111 0, /* 30 (Reserved) */
112 0 /* 31 (Reserved) */
113 };
114
115 /* Table 1.6.1 */
116 int8_t NEAACDECAPI NeAACDecAudioSpecificConfig(uint8_t *pBuffer,
117 uint32_t buffer_size,
118 mp4AudioSpecificConfig *mp4ASC)
119 {
120 return AudioSpecificConfig2(pBuffer, buffer_size, mp4ASC, NULL);
121 }
122
123 int8_t AudioSpecificConfig2(uint8_t *pBuffer,
124 uint32_t buffer_size,
125 mp4AudioSpecificConfig *mp4ASC,
126 program_config *pce)
127 {
128 bitfile ld;
129 int8_t result = 0;
130 #ifdef SBR_DEC
131 int8_t bits_to_decode = 0;
132 #endif
133
134 if (pBuffer == NULL)
135 return -7;
136 if (mp4ASC == NULL)
137 return -8;
138
139 memset(mp4ASC, 0, sizeof(mp4AudioSpecificConfig));
140
141 faad_initbits(&ld, pBuffer, buffer_size);
142 faad_byte_align(&ld);
143
144 mp4ASC->objectTypeIndex = (uint8_t)faad_getbits(&ld, 5
145 DEBUGVAR(1,1,"parse_audio_decoder_specific_info(): ObjectTypeIndex"));
146
147 mp4ASC->samplingFrequencyIndex = (uint8_t)faad_getbits(&ld, 4
148 DEBUGVAR(1,2,"parse_audio_decoder_specific_info(): SamplingFrequencyIndex"));
149
150 mp4ASC->channelsConfiguration = (uint8_t)faad_getbits(&ld, 4
151 DEBUGVAR(1,3,"parse_audio_decoder_specific_info(): ChannelsConfiguration"));
152
153 mp4ASC->samplingFrequency = get_sample_rate(mp4ASC->samplingFrequencyIndex);
154
155 if (ObjectTypesTable[mp4ASC->objectTypeIndex] != 1)
156 {
157 faad_endbits(&ld);
158 return -1;
159 }
160
161 if (mp4ASC->samplingFrequency == 0)
162 {
163 faad_endbits(&ld);
164 return -2;
165 }
166
167 if (mp4ASC->channelsConfiguration > 7)
168 {
169 faad_endbits(&ld);
170 return -3;
171 }
172
173 #if (defined(PS_DEC) || defined(DRM_PS))
174 /* check if we have a mono file */
175 if (mp4ASC->channelsConfiguration == 1)
176 {
177 /* upMatrix to 2 channels for implicit signalling of PS */
178 mp4ASC->channelsConfiguration = 2;
179 }
180 #endif
181
182 #ifdef SBR_DEC
183 mp4ASC->sbr_present_flag = -1;
184 if (mp4ASC->objectTypeIndex == 5)
185 {
186 uint8_t tmp;
187
188 mp4ASC->sbr_present_flag = 1;
189 tmp = (uint8_t)faad_getbits(&ld, 4
190 DEBUGVAR(1,5,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
191 /* check for downsampled SBR */
192 if (tmp == mp4ASC->samplingFrequencyIndex)
193 mp4ASC->downSampledSBR = 1;
194 mp4ASC->samplingFrequencyIndex = tmp;
195 if (mp4ASC->samplingFrequencyIndex == 15)
196 {
197 mp4ASC->samplingFrequency = (uint32_t)faad_getbits(&ld, 24
198 DEBUGVAR(1,6,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
199 } else {
200 mp4ASC->samplingFrequency = get_sample_rate(mp4ASC->samplingFrequencyIndex);
201 }
202 mp4ASC->objectTypeIndex = (uint8_t)faad_getbits(&ld, 5
203 DEBUGVAR(1,7,"parse_audio_decoder_specific_info(): ObjectTypeIndex"));
204 }
205 #endif
206
207 /* get GASpecificConfig */
208 if (mp4ASC->objectTypeIndex == 1 || mp4ASC->objectTypeIndex == 2 ||
209 mp4ASC->objectTypeIndex == 3 || mp4ASC->objectTypeIndex == 4 ||
210 mp4ASC->objectTypeIndex == 6 || mp4ASC->objectTypeIndex == 7)
211 {
212 result = GASpecificConfig(&ld, mp4ASC, pce);
213
214 #ifdef ERROR_RESILIENCE
215 } else if (mp4ASC->objectTypeIndex >= ER_OBJECT_START) { /* ER */
216 result = GASpecificConfig(&ld, mp4ASC, pce);
217 mp4ASC->epConfig = (uint8_t)faad_getbits(&ld, 2
218 DEBUGVAR(1,143,"parse_audio_decoder_specific_info(): epConfig"));
219
220 if (mp4ASC->epConfig != 0)
221 result = -5;
222 #endif
223
224 } else {
225 result = -4;
226 }
227
228 #ifdef SSR_DEC
229 /* shorter frames not allowed for SSR */
230 if ((mp4ASC->objectTypeIndex == 4) && mp4ASC->frameLengthFlag)
231 return -6;
232 #endif
233
234
235 #ifdef SBR_DEC
236 bits_to_decode = (int8_t)(buffer_size*8 - faad_get_processed_bits(&ld));
237
238 if ((mp4ASC->objectTypeIndex != 5) && (bits_to_decode >= 16))
239 {
240 int16_t syncExtensionType = (int16_t)faad_getbits(&ld, 11
241 DEBUGVAR(1,9,"parse_audio_decoder_specific_info(): syncExtensionType"));
242
243 if (syncExtensionType == 0x2b7)
244 {
245 uint8_t tmp_OTi = (uint8_t)faad_getbits(&ld, 5
246 DEBUGVAR(1,10,"parse_audio_decoder_specific_info(): extensionAudioObjectType"));
247
248 if (tmp_OTi == 5)
249 {
250 mp4ASC->sbr_present_flag = (uint8_t)faad_get1bit(&ld
251 DEBUGVAR(1,11,"parse_audio_decoder_specific_info(): sbr_present_flag"));
252
253 if (mp4ASC->sbr_present_flag)
254 {
255 uint8_t tmp;
256
257 /* Don't set OT to SBR until checked that it is actually there */
258 mp4ASC->objectTypeIndex = tmp_OTi;
259
260 tmp = (uint8_t)faad_getbits(&ld, 4
261 DEBUGVAR(1,12,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
262
263 /* check for downsampled SBR */
264 if (tmp == mp4ASC->samplingFrequencyIndex)
265 mp4ASC->downSampledSBR = 1;
266 mp4ASC->samplingFrequencyIndex = tmp;
267
268 if (mp4ASC->samplingFrequencyIndex == 15)
269 {
270 mp4ASC->samplingFrequency = (uint32_t)faad_getbits(&ld, 24
271 DEBUGVAR(1,13,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
272 } else {
273 mp4ASC->samplingFrequency = get_sample_rate(mp4ASC->samplingFrequencyIndex);
274 }
275 }
276 }
277 }
278 }
279
280 /* no SBR signalled, this could mean either implicit signalling or no SBR in this file */
281 /* MPEG specification states: assume SBR on files with samplerate <= 24000 Hz */
282 if (mp4ASC->sbr_present_flag == -1)
283 {
284 if (mp4ASC->samplingFrequency <= 24000)
285 {
286 mp4ASC->samplingFrequency *= 2;
287 mp4ASC->forceUpSampling = 1;
288 } else /* > 24000*/ {
289 mp4ASC->downSampledSBR = 1;
290 }
291 }
292 #endif
293
294 faad_endbits(&ld);
295
296 return result;
297 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: mp4.h,v 1.25 2007/11/01 12:33:32 menno Exp $
28 **/
29
30 #ifndef __MP4_H__
31 #define __MP4_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #include "decoder.h"
38
39 int8_t NEAACDECAPI NeAACDecAudioSpecificConfig(uint8_t *pBuffer,
40 uint32_t buffer_size,
41 mp4AudioSpecificConfig *mp4ASC);
42
43 int8_t AudioSpecificConfig2(uint8_t *pBuffer,
44 uint32_t buffer_size,
45 mp4AudioSpecificConfig *mp4ASC,
46 program_config *pce);
47
48 #ifdef __cplusplus
49 }
50 #endif
51 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: ms.c,v 1.21 2007/11/01 12:33:32 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #include "syntax.h"
34 #include "ms.h"
35 #include "is.h"
36 #include "pns.h"
37
38 void ms_decode(ic_stream *ics, ic_stream *icsr, real_t *l_spec, real_t *r_spec,
39 uint16_t frame_len)
40 {
41 uint8_t g, b, sfb;
42 uint8_t group = 0;
43 uint16_t nshort = frame_len/8;
44
45 uint16_t i, k;
46 real_t tmp;
47
48 if (ics->ms_mask_present >= 1)
49 {
50 for (g = 0; g < ics->num_window_groups; g++)
51 {
52 for (b = 0; b < ics->window_group_length[g]; b++)
53 {
54 for (sfb = 0; sfb < ics->max_sfb; sfb++)
55 {
56 /* If intensity stereo coding or noise substitution is on
57 for a particular scalefactor band, no M/S stereo decoding
58 is carried out.
59 */
60 if ((ics->ms_used[g][sfb] || ics->ms_mask_present == 2) &&
61 !is_intensity(icsr, g, sfb) && !is_noise(ics, g, sfb))
62 {
63 for (i = ics->swb_offset[sfb]; i < min(ics->swb_offset[sfb+1], ics->swb_offset_max); i++)
64 {
65 k = (group*nshort) + i;
66 tmp = l_spec[k] - r_spec[k];
67 l_spec[k] = l_spec[k] + r_spec[k];
68 r_spec[k] = tmp;
69 }
70 }
71 }
72 group++;
73 }
74 }
75 }
76 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: ms.h,v 1.19 2007/11/01 12:33:32 menno Exp $
28 **/
29
30 #ifndef __MS_H__
31 #define __MS_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 void ms_decode(ic_stream *ics, ic_stream *icsr, real_t *l_spec, real_t *r_spec,
38 uint16_t frame_len);
39
40 #ifdef __cplusplus
41 }
42 #endif
43 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: output.c,v 1.46 2007/11/01 12:33:32 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #include "output.h"
34 #include "decoder.h"
35
36 #ifndef FIXED_POINT
37
38
39 #define FLOAT_SCALE (1.0f/(1<<15))
40
41 #define DM_MUL REAL_CONST(0.3203772410170407) // 1/(1+sqrt(2) + 1/sqrt(2))
42 #define RSQRT2 REAL_CONST(0.7071067811865475244) // 1/sqrt(2)
43
44
45 static INLINE real_t get_sample(real_t **input, uint8_t channel, uint16_t sample,
46 uint8_t down_matrix, uint8_t *internal_channel)
47 {
48 if (!down_matrix)
49 return input[internal_channel[channel]][sample];
50
51 if (channel == 0)
52 {
53 return DM_MUL * (input[internal_channel[1]][sample] +
54 input[internal_channel[0]][sample] * RSQRT2 +
55 input[internal_channel[3]][sample] * RSQRT2);
56 } else {
57 return DM_MUL * (input[internal_channel[2]][sample] +
58 input[internal_channel[0]][sample] * RSQRT2 +
59 input[internal_channel[4]][sample] * RSQRT2);
60 }
61 }
62
63 #ifndef HAS_LRINTF
64 #define CLIP(sample, max, min) \
65 if (sample >= 0.0f) \
66 { \
67 sample += 0.5f; \
68 if (sample >= max) \
69 sample = max; \
70 } else { \
71 sample += -0.5f; \
72 if (sample <= min) \
73 sample = min; \
74 }
75 #else
76 #define CLIP(sample, max, min) \
77 if (sample >= 0.0f) \
78 { \
79 if (sample >= max) \
80 sample = max; \
81 } else { \
82 if (sample <= min) \
83 sample = min; \
84 }
85 #endif
86
87 #define CONV(a,b) ((a<<1)|(b&0x1))
88
89 static void to_PCM_16bit(NeAACDecHandle hDecoder, real_t **input,
90 uint8_t channels, uint16_t frame_len,
91 int16_t **sample_buffer)
92 {
93 uint8_t ch, ch1;
94 uint16_t i;
95
96 switch (CONV(channels,hDecoder->downMatrix))
97 {
98 case CONV(1,0):
99 case CONV(1,1):
100 for(i = 0; i < frame_len; i++)
101 {
102 real_t inp = input[hDecoder->internal_channel[0]][i];
103
104 CLIP(inp, 32767.0f, -32768.0f);
105
106 (*sample_buffer)[i] = (int16_t)lrintf(inp);
107 }
108 break;
109 case CONV(2,0):
110 if (hDecoder->upMatrix)
111 {
112 ch = hDecoder->internal_channel[0];
113 for(i = 0; i < frame_len; i++)
114 {
115 real_t inp0 = input[ch][i];
116
117 CLIP(inp0, 32767.0f, -32768.0f);
118
119 (*sample_buffer)[(i*2)+0] = (int16_t)lrintf(inp0);
120 (*sample_buffer)[(i*2)+1] = (int16_t)lrintf(inp0);
121 }
122 } else {
123 ch = hDecoder->internal_channel[0];
124 ch1 = hDecoder->internal_channel[1];
125 for(i = 0; i < frame_len; i++)
126 {
127 real_t inp0 = input[ch ][i];
128 real_t inp1 = input[ch1][i];
129
130 CLIP(inp0, 32767.0f, -32768.0f);
131 CLIP(inp1, 32767.0f, -32768.0f);
132
133 (*sample_buffer)[(i*2)+0] = (int16_t)lrintf(inp0);
134 (*sample_buffer)[(i*2)+1] = (int16_t)lrintf(inp1);
135 }
136 }
137 break;
138 default:
139 for (ch = 0; ch < channels; ch++)
140 {
141 for(i = 0; i < frame_len; i++)
142 {
143 real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
144
145 CLIP(inp, 32767.0f, -32768.0f);
146
147 (*sample_buffer)[(i*channels)+ch] = (int16_t)lrintf(inp);
148 }
149 }
150 break;
151 }
152 }
153
154 static void to_PCM_24bit(NeAACDecHandle hDecoder, real_t **input,
155 uint8_t channels, uint16_t frame_len,
156 int32_t **sample_buffer)
157 {
158 uint8_t ch, ch1;
159 uint16_t i;
160
161 switch (CONV(channels,hDecoder->downMatrix))
162 {
163 case CONV(1,0):
164 case CONV(1,1):
165 for(i = 0; i < frame_len; i++)
166 {
167 real_t inp = input[hDecoder->internal_channel[0]][i];
168
169 inp *= 256.0f;
170 CLIP(inp, 8388607.0f, -8388608.0f);
171
172 (*sample_buffer)[i] = (int32_t)lrintf(inp);
173 }
174 break;
175 case CONV(2,0):
176 if (hDecoder->upMatrix)
177 {
178 ch = hDecoder->internal_channel[0];
179 for(i = 0; i < frame_len; i++)
180 {
181 real_t inp0 = input[ch][i];
182
183 inp0 *= 256.0f;
184 CLIP(inp0, 8388607.0f, -8388608.0f);
185
186 (*sample_buffer)[(i*2)+0] = (int32_t)lrintf(inp0);
187 (*sample_buffer)[(i*2)+1] = (int32_t)lrintf(inp0);
188 }
189 } else {
190 ch = hDecoder->internal_channel[0];
191 ch1 = hDecoder->internal_channel[1];
192 for(i = 0; i < frame_len; i++)
193 {
194 real_t inp0 = input[ch ][i];
195 real_t inp1 = input[ch1][i];
196
197 inp0 *= 256.0f;
198 inp1 *= 256.0f;
199 CLIP(inp0, 8388607.0f, -8388608.0f);
200 CLIP(inp1, 8388607.0f, -8388608.0f);
201
202 (*sample_buffer)[(i*2)+0] = (int32_t)lrintf(inp0);
203 (*sample_buffer)[(i*2)+1] = (int32_t)lrintf(inp1);
204 }
205 }
206 break;
207 default:
208 for (ch = 0; ch < channels; ch++)
209 {
210 for(i = 0; i < frame_len; i++)
211 {
212 real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
213
214 inp *= 256.0f;
215 CLIP(inp, 8388607.0f, -8388608.0f);
216
217 (*sample_buffer)[(i*channels)+ch] = (int32_t)lrintf(inp);
218 }
219 }
220 break;
221 }
222 }
223
224 static void to_PCM_32bit(NeAACDecHandle hDecoder, real_t **input,
225 uint8_t channels, uint16_t frame_len,
226 int32_t **sample_buffer)
227 {
228 uint8_t ch, ch1;
229 uint16_t i;
230
231 switch (CONV(channels,hDecoder->downMatrix))
232 {
233 case CONV(1,0):
234 case CONV(1,1):
235 for(i = 0; i < frame_len; i++)
236 {
237 real_t inp = input[hDecoder->internal_channel[0]][i];
238
239 inp *= 65536.0f;
240 CLIP(inp, 2147483647.0f, -2147483648.0f);
241
242 (*sample_buffer)[i] = (int32_t)lrintf(inp);
243 }
244 break;
245 case CONV(2,0):
246 if (hDecoder->upMatrix)
247 {
248 ch = hDecoder->internal_channel[0];
249 for(i = 0; i < frame_len; i++)
250 {
251 real_t inp0 = input[ch][i];
252
253 inp0 *= 65536.0f;
254 CLIP(inp0, 2147483647.0f, -2147483648.0f);
255
256 (*sample_buffer)[(i*2)+0] = (int32_t)lrintf(inp0);
257 (*sample_buffer)[(i*2)+1] = (int32_t)lrintf(inp0);
258 }
259 } else {
260 ch = hDecoder->internal_channel[0];
261 ch1 = hDecoder->internal_channel[1];
262 for(i = 0; i < frame_len; i++)
263 {
264 real_t inp0 = input[ch ][i];
265 real_t inp1 = input[ch1][i];
266
267 inp0 *= 65536.0f;
268 inp1 *= 65536.0f;
269 CLIP(inp0, 2147483647.0f, -2147483648.0f);
270 CLIP(inp1, 2147483647.0f, -2147483648.0f);
271
272 (*sample_buffer)[(i*2)+0] = (int32_t)lrintf(inp0);
273 (*sample_buffer)[(i*2)+1] = (int32_t)lrintf(inp1);
274 }
275 }
276 break;
277 default:
278 for (ch = 0; ch < channels; ch++)
279 {
280 for(i = 0; i < frame_len; i++)
281 {
282 real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
283
284 inp *= 65536.0f;
285 CLIP(inp, 2147483647.0f, -2147483648.0f);
286
287 (*sample_buffer)[(i*channels)+ch] = (int32_t)lrintf(inp);
288 }
289 }
290 break;
291 }
292 }
293
294 static void to_PCM_float(NeAACDecHandle hDecoder, real_t **input,
295 uint8_t channels, uint16_t frame_len,
296 float32_t **sample_buffer)
297 {
298 uint8_t ch, ch1;
299 uint16_t i;
300
301 switch (CONV(channels,hDecoder->downMatrix))
302 {
303 case CONV(1,0):
304 case CONV(1,1):
305 for(i = 0; i < frame_len; i++)
306 {
307 real_t inp = input[hDecoder->internal_channel[0]][i];
308 (*sample_buffer)[i] = inp*FLOAT_SCALE;
309 }
310 break;
311 case CONV(2,0):
312 if (hDecoder->upMatrix)
313 {
314 ch = hDecoder->internal_channel[0];
315 for(i = 0; i < frame_len; i++)
316 {
317 real_t inp0 = input[ch][i];
318 (*sample_buffer)[(i*2)+0] = inp0*FLOAT_SCALE;
319 (*sample_buffer)[(i*2)+1] = inp0*FLOAT_SCALE;
320 }
321 } else {
322 ch = hDecoder->internal_channel[0];
323 ch1 = hDecoder->internal_channel[1];
324 for(i = 0; i < frame_len; i++)
325 {
326 real_t inp0 = input[ch ][i];
327 real_t inp1 = input[ch1][i];
328 (*sample_buffer)[(i*2)+0] = inp0*FLOAT_SCALE;
329 (*sample_buffer)[(i*2)+1] = inp1*FLOAT_SCALE;
330 }
331 }
332 break;
333 default:
334 for (ch = 0; ch < channels; ch++)
335 {
336 for(i = 0; i < frame_len; i++)
337 {
338 real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
339 (*sample_buffer)[(i*channels)+ch] = inp*FLOAT_SCALE;
340 }
341 }
342 break;
343 }
344 }
345
346 static void to_PCM_double(NeAACDecHandle hDecoder, real_t **input,
347 uint8_t channels, uint16_t frame_len,
348 double **sample_buffer)
349 {
350 uint8_t ch, ch1;
351 uint16_t i;
352
353 switch (CONV(channels,hDecoder->downMatrix))
354 {
355 case CONV(1,0):
356 case CONV(1,1):
357 for(i = 0; i < frame_len; i++)
358 {
359 real_t inp = input[hDecoder->internal_channel[0]][i];
360 (*sample_buffer)[i] = (double)inp*FLOAT_SCALE;
361 }
362 break;
363 case CONV(2,0):
364 if (hDecoder->upMatrix)
365 {
366 ch = hDecoder->internal_channel[0];
367 for(i = 0; i < frame_len; i++)
368 {
369 real_t inp0 = input[ch][i];
370 (*sample_buffer)[(i*2)+0] = (double)inp0*FLOAT_SCALE;
371 (*sample_buffer)[(i*2)+1] = (double)inp0*FLOAT_SCALE;
372 }
373 } else {
374 ch = hDecoder->internal_channel[0];
375 ch1 = hDecoder->internal_channel[1];
376 for(i = 0; i < frame_len; i++)
377 {
378 real_t inp0 = input[ch ][i];
379 real_t inp1 = input[ch1][i];
380 (*sample_buffer)[(i*2)+0] = (double)inp0*FLOAT_SCALE;
381 (*sample_buffer)[(i*2)+1] = (double)inp1*FLOAT_SCALE;
382 }
383 }
384 break;
385 default:
386 for (ch = 0; ch < channels; ch++)
387 {
388 for(i = 0; i < frame_len; i++)
389 {
390 real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
391 (*sample_buffer)[(i*channels)+ch] = (double)inp*FLOAT_SCALE;
392 }
393 }
394 break;
395 }
396 }
397
398 void *output_to_PCM(NeAACDecHandle hDecoder,
399 real_t **input, void *sample_buffer, uint8_t channels,
400 uint16_t frame_len, uint8_t format)
401 {
402 int16_t *short_sample_buffer = (int16_t*)sample_buffer;
403 int32_t *int_sample_buffer = (int32_t*)sample_buffer;
404 float32_t *float_sample_buffer = (float32_t*)sample_buffer;
405 double *double_sample_buffer = (double*)sample_buffer;
406
407 #ifdef PROFILE
408 int64_t count = faad_get_ts();
409 #endif
410
411 /* Copy output to a standard PCM buffer */
412 switch (format)
413 {
414 case FAAD_FMT_16BIT:
415 to_PCM_16bit(hDecoder, input, channels, frame_len, &short_sample_buffer);
416 break;
417 case FAAD_FMT_24BIT:
418 to_PCM_24bit(hDecoder, input, channels, frame_len, &int_sample_buffer);
419 break;
420 case FAAD_FMT_32BIT:
421 to_PCM_32bit(hDecoder, input, channels, frame_len, &int_sample_buffer);
422 break;
423 case FAAD_FMT_FLOAT:
424 to_PCM_float(hDecoder, input, channels, frame_len, &float_sample_buffer);
425 break;
426 case FAAD_FMT_DOUBLE:
427 to_PCM_double(hDecoder, input, channels, frame_len, &double_sample_buffer);
428 break;
429 }
430
431 #ifdef PROFILE
432 count = faad_get_ts() - count;
433 hDecoder->output_cycles += count;
434 #endif
435
436 return sample_buffer;
437 }
438
439 #else
440
441 #define DM_MUL FRAC_CONST(0.3203772410170407) // 1/(1+sqrt(2) + 1/sqrt(2))
442 #define RSQRT2 FRAC_CONST(0.7071067811865475244) // 1/sqrt(2)
443
444 static INLINE real_t get_sample(real_t **input, uint8_t channel, uint16_t sample,
445 uint8_t down_matrix, uint8_t up_matrix,
446 uint8_t *internal_channel)
447 {
448 if (up_matrix == 1)
449 return input[internal_channel[0]][sample];
450
451 if (!down_matrix)
452 return input[internal_channel[channel]][sample];
453
454 if (channel == 0)
455 {
456 real_t C = MUL_F(input[internal_channel[0]][sample], RSQRT2);
457 real_t L_S = MUL_F(input[internal_channel[3]][sample], RSQRT2);
458 real_t cum = input[internal_channel[1]][sample] + C + L_S;
459 return MUL_F(cum, DM_MUL);
460 } else {
461 real_t C = MUL_F(input[internal_channel[0]][sample], RSQRT2);
462 real_t R_S = MUL_F(input[internal_channel[4]][sample], RSQRT2);
463 real_t cum = input[internal_channel[2]][sample] + C + R_S;
464 return MUL_F(cum, DM_MUL);
465 }
466 }
467
468 void* output_to_PCM(NeAACDecHandle hDecoder,
469 real_t **input, void *sample_buffer, uint8_t channels,
470 uint16_t frame_len, uint8_t format)
471 {
472 uint8_t ch;
473 uint16_t i;
474 int16_t *short_sample_buffer = (int16_t*)sample_buffer;
475 int32_t *int_sample_buffer = (int32_t*)sample_buffer;
476
477 /* Copy output to a standard PCM buffer */
478 for (ch = 0; ch < channels; ch++)
479 {
480 switch (format)
481 {
482 case FAAD_FMT_16BIT:
483 for(i = 0; i < frame_len; i++)
484 {
485 int32_t tmp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->upMatrix,
486 hDecoder->internal_channel);
487 if (tmp >= 0)
488 {
489 tmp += (1 << (REAL_BITS-1));
490 if (tmp >= REAL_CONST(32767))
491 {
492 tmp = REAL_CONST(32767);
493 }
494 } else {
495 tmp += -(1 << (REAL_BITS-1));
496 if (tmp <= REAL_CONST(-32768))
497 {
498 tmp = REAL_CONST(-32768);
499 }
500 }
501 tmp >>= REAL_BITS;
502 short_sample_buffer[(i*channels)+ch] = (int16_t)tmp;
503 }
504 break;
505 case FAAD_FMT_24BIT:
506 for(i = 0; i < frame_len; i++)
507 {
508 int32_t tmp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->upMatrix,
509 hDecoder->internal_channel);
510 if (tmp >= 0)
511 {
512 tmp += (1 << (REAL_BITS-9));
513 tmp >>= (REAL_BITS-8);
514 if (tmp >= 8388607)
515 {
516 tmp = 8388607;
517 }
518 } else {
519 tmp += -(1 << (REAL_BITS-9));
520 tmp >>= (REAL_BITS-8);
521 if (tmp <= -8388608)
522 {
523 tmp = -8388608;
524 }
525 }
526 int_sample_buffer[(i*channels)+ch] = (int32_t)tmp;
527 }
528 break;
529 case FAAD_FMT_32BIT:
530 for(i = 0; i < frame_len; i++)
531 {
532 int32_t tmp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->upMatrix,
533 hDecoder->internal_channel);
534 if (tmp >= 0)
535 {
536 tmp += (1 << (16-REAL_BITS-1));
537 tmp <<= (16-REAL_BITS);
538 } else {
539 tmp += -(1 << (16-REAL_BITS-1));
540 tmp <<= (16-REAL_BITS);
541 }
542 int_sample_buffer[(i*channels)+ch] = (int32_t)tmp;
543 }
544 break;
545 case FAAD_FMT_FIXED:
546 for(i = 0; i < frame_len; i++)
547 {
548 real_t tmp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->upMatrix,
549 hDecoder->internal_channel);
550 int_sample_buffer[(i*channels)+ch] = (int32_t)tmp;
551 }
552 break;
553 }
554 }
555
556 return sample_buffer;
557 }
558
559 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: output.h,v 1.25 2007/11/01 12:33:32 menno Exp $
28 **/
29
30 #ifndef __OUTPUT_H__
31 #define __OUTPUT_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 void* output_to_PCM(NeAACDecHandle hDecoder,
38 real_t **input,
39 void *samplebuffer,
40 uint8_t channels,
41 uint16_t frame_len,
42 uint8_t format);
43
44 #ifdef __cplusplus
45 }
46 #endif
47 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: pns.c,v 1.38 2007/11/01 12:33:32 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #include "pns.h"
34
35
36 /* static function declarations */
37 static void gen_rand_vector(real_t *spec, int16_t scale_factor, uint16_t size,
38 uint8_t sub,
39 /* RNG states */ uint32_t *__r1, uint32_t *__r2);
40
41
42 #ifdef FIXED_POINT
43
44 #define DIV(A, B) (((int64_t)A << REAL_BITS)/B)
45
46 #define step(shift) \
47 if ((0x40000000l >> shift) + root <= value) \
48 { \
49 value -= (0x40000000l >> shift) + root; \
50 root = (root >> 1) | (0x40000000l >> shift); \
51 } else { \
52 root = root >> 1; \
53 }
54
55 /* fixed point square root approximation */
56 /* !!!! ONLY WORKS FOR EVEN %REAL_BITS% !!!! */
57 real_t fp_sqrt(real_t value)
58 {
59 real_t root = 0;
60
61 step( 0); step( 2); step( 4); step( 6);
62 step( 8); step(10); step(12); step(14);
63 step(16); step(18); step(20); step(22);
64 step(24); step(26); step(28); step(30);
65
66 if (root < value)
67 ++root;
68
69 root <<= (REAL_BITS/2);
70
71 return root;
72 }
73
74 static real_t const pow2_table[] =
75 {
76 COEF_CONST(1.0),
77 COEF_CONST(1.18920711500272),
78 COEF_CONST(1.41421356237310),
79 COEF_CONST(1.68179283050743)
80 };
81 #endif
82
83 /* The function gen_rand_vector(addr, size) generates a vector of length
84 <size> with signed random values of average energy MEAN_NRG per random
85 value. A suitable random number generator can be realized using one
86 multiplication/accumulation per random value.
87 */
88 static INLINE void gen_rand_vector(real_t *spec, int16_t scale_factor, uint16_t size,
89 uint8_t sub,
90 /* RNG states */ uint32_t *__r1, uint32_t *__r2)
91 {
92 #ifndef FIXED_POINT
93 uint16_t i;
94 real_t energy = 0.0;
95
96 real_t scale = (real_t)1.0/(real_t)size;
97
98 for (i = 0; i < size; i++)
99 {
100 real_t tmp = scale*(real_t)(int32_t)ne_rng(__r1, __r2);
101 spec[i] = tmp;
102 energy += tmp*tmp;
103 }
104
105 scale = (real_t)1.0/(real_t)sqrt(energy);
106 scale *= (real_t)pow(2.0, 0.25 * scale_factor);
107 for (i = 0; i < size; i++)
108 {
109 spec[i] *= scale;
110 }
111 #else
112 uint16_t i;
113 real_t energy = 0, scale;
114 int32_t exp, frac;
115
116 for (i = 0; i < size; i++)
117 {
118 /* this can be replaced by a 16 bit random generator!!!! */
119 real_t tmp = (int32_t)ne_rng(__r1, __r2);
120 if (tmp < 0)
121 tmp = -(tmp & ((1<<(REAL_BITS-1))-1));
122 else
123 tmp = (tmp & ((1<<(REAL_BITS-1))-1));
124
125 energy += MUL_R(tmp,tmp);
126
127 spec[i] = tmp;
128 }
129
130 energy = fp_sqrt(energy);
131 if (energy > 0)
132 {
133 scale = DIV(REAL_CONST(1),energy);
134
135 exp = scale_factor >> 2;
136 frac = scale_factor & 3;
137
138 /* IMDCT pre-scaling */
139 exp -= sub;
140
141 if (exp < 0)
142 scale >>= -exp;
143 else
144 scale <<= exp;
145
146 if (frac)
147 scale = MUL_C(scale, pow2_table[frac]);
148
149 for (i = 0; i < size; i++)
150 {
151 spec[i] = MUL_R(spec[i], scale);
152 }
153 }
154 #endif
155 }
156
157 void pns_decode(ic_stream *ics_left, ic_stream *ics_right,
158 real_t *spec_left, real_t *spec_right, uint16_t frame_len,
159 uint8_t channel_pair, uint8_t object_type,
160 /* RNG states */ uint32_t *__r1, uint32_t *__r2)
161 {
162 uint8_t g, sfb, b;
163 uint16_t size, offs;
164
165 uint8_t group = 0;
166 uint16_t nshort = frame_len >> 3;
167
168 uint8_t sub = 0;
169
170 #ifdef FIXED_POINT
171 /* IMDCT scaling */
172 if (object_type == LD)
173 {
174 sub = 9 /*9*/;
175 } else {
176 if (ics_left->window_sequence == EIGHT_SHORT_SEQUENCE)
177 sub = 7 /*7*/;
178 else
179 sub = 10 /*10*/;
180 }
181 #endif
182
183 for (g = 0; g < ics_left->num_window_groups; g++)
184 {
185 /* Do perceptual noise substitution decoding */
186 for (b = 0; b < ics_left->window_group_length[g]; b++)
187 {
188 for (sfb = 0; sfb < ics_left->max_sfb; sfb++)
189 {
190 if (is_noise(ics_left, g, sfb))
191 {
192 #ifdef LTP_DEC
193 /* Simultaneous use of LTP and PNS is not prevented in the
194 syntax. If both LTP, and PNS are enabled on the same
195 scalefactor band, PNS takes precedence, and no prediction
196 is applied to this band.
197 */
198 ics_left->ltp.long_used[sfb] = 0;
199 ics_left->ltp2.long_used[sfb] = 0;
200 #endif
201
202 #ifdef MAIN_DEC
203 /* For scalefactor bands coded using PNS the corresponding
204 predictors are switched to "off".
205 */
206 ics_left->pred.prediction_used[sfb] = 0;
207 #endif
208
209 offs = ics_left->swb_offset[sfb];
210 size = min(ics_left->swb_offset[sfb+1], ics_left->swb_offset_max) - offs;
211
212 /* Generate random vector */
213 gen_rand_vector(&spec_left[(group*nshort)+offs],
214 ics_left->scale_factors[g][sfb], size, sub, __r1, __r2);
215 }
216
217 /* From the spec:
218 If the same scalefactor band and group is coded by perceptual noise
219 substitution in both channels of a channel pair, the correlation of
220 the noise signal can be controlled by means of the ms_used field: While
221 the default noise generation process works independently for each channel
222 (separate generation of random vectors), the same random vector is used
223 for both channels if ms_used[] is set for a particular scalefactor band
224 and group. In this case, no M/S stereo coding is carried out (because M/S
225 stereo coding and noise substitution coding are mutually exclusive).
226 If the same scalefactor band and group is coded by perceptual noise
227 substitution in only one channel of a channel pair the setting of ms_used[]
228 is not evaluated.
229 */
230 if (channel_pair)
231 {
232 if (is_noise(ics_right, g, sfb))
233 {
234 if (((ics_left->ms_mask_present == 1) &&
235 (ics_left->ms_used[g][sfb])) ||
236 (ics_left->ms_mask_present == 2))
237 {
238 uint16_t c;
239
240 offs = ics_right->swb_offset[sfb];
241 size = min(ics_right->swb_offset[sfb+1], ics_right->swb_offset_max) - offs;
242
243 for (c = 0; c < size; c++)
244 {
245 spec_right[(group*nshort) + offs + c] =
246 spec_left[(group*nshort) + offs + c];
247 }
248 } else /*if (ics_left->ms_mask_present == 0)*/ {
249 #ifdef LTP_DEC
250 ics_right->ltp.long_used[sfb] = 0;
251 ics_right->ltp2.long_used[sfb] = 0;
252 #endif
253 #ifdef MAIN_DEC
254 ics_right->pred.prediction_used[sfb] = 0;
255 #endif
256
257 offs = ics_right->swb_offset[sfb];
258 size = min(ics_right->swb_offset[sfb+1], ics_right->swb_offset_max) - offs;
259
260 /* Generate random vector */
261 gen_rand_vector(&spec_right[(group*nshort)+offs],
262 ics_right->scale_factors[g][sfb], size, sub, __r1, __r2);
263 }
264 }
265 }
266 } /* sfb */
267 group++;
268 } /* b */
269 } /* g */
270 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: pns.h,v 1.27 2007/11/01 12:33:33 menno Exp $
28 **/
29
30 #ifndef __PNS_H__
31 #define __PNS_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #include "syntax.h"
38
39 #define NOISE_OFFSET 90
40
41 void pns_decode(ic_stream *ics_left, ic_stream *ics_right,
42 real_t *spec_left, real_t *spec_right, uint16_t frame_len,
43 uint8_t channel_pair, uint8_t object_type,
44 /* RNG states */ uint32_t *__r1, uint32_t *__r2);
45
46 static INLINE uint8_t is_noise(ic_stream *ics, uint8_t group, uint8_t sfb)
47 {
48 if (ics->sfb_cb[group][sfb] == NOISE_HCB)
49 return 1;
50 return 0;
51 }
52
53 #ifdef __cplusplus
54 }
55 #endif
56 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: ps_dec.c,v 1.14 2007/11/01 12:33:33 menno Exp $
28 **/
29
30 #include "common.h"
31
32 #ifdef PS_DEC
33
34 #include <stdlib.h>
35 #include "ps_dec.h"
36 #include "ps_tables.h"
37
38 /* constants */
39 #define NEGATE_IPD_MASK (0x1000)
40 #define DECAY_SLOPE FRAC_CONST(0.05)
41 #define COEF_SQRT2 COEF_CONST(1.4142135623731)
42
43 /* tables */
44 /* filters are mirrored in coef 6, second half left out */
45 static const real_t p8_13_20[7] =
46 {
47 FRAC_CONST(0.00746082949812),
48 FRAC_CONST(0.02270420949825),
49 FRAC_CONST(0.04546865930473),
50 FRAC_CONST(0.07266113929591),
51 FRAC_CONST(0.09885108575264),
52 FRAC_CONST(0.11793710567217),
53 FRAC_CONST(0.125)
54 };
55
56 static const real_t p2_13_20[7] =
57 {
58 FRAC_CONST(0.0),
59 FRAC_CONST(0.01899487526049),
60 FRAC_CONST(0.0),
61 FRAC_CONST(-0.07293139167538),
62 FRAC_CONST(0.0),
63 FRAC_CONST(0.30596630545168),
64 FRAC_CONST(0.5)
65 };
66
67 static const real_t p12_13_34[7] =
68 {
69 FRAC_CONST(0.04081179924692),
70 FRAC_CONST(0.03812810994926),
71 FRAC_CONST(0.05144908135699),
72 FRAC_CONST(0.06399831151592),
73 FRAC_CONST(0.07428313801106),
74 FRAC_CONST(0.08100347892914),
75 FRAC_CONST(0.08333333333333)
76 };
77
78 static const real_t p8_13_34[7] =
79 {
80 FRAC_CONST(0.01565675600122),
81 FRAC_CONST(0.03752716391991),
82 FRAC_CONST(0.05417891378782),
83 FRAC_CONST(0.08417044116767),
84 FRAC_CONST(0.10307344158036),
85 FRAC_CONST(0.12222452249753),
86 FRAC_CONST(0.125)
87 };
88
89 static const real_t p4_13_34[7] =
90 {
91 FRAC_CONST(-0.05908211155639),
92 FRAC_CONST(-0.04871498374946),
93 FRAC_CONST(0.0),
94 FRAC_CONST(0.07778723915851),
95 FRAC_CONST(0.16486303567403),
96 FRAC_CONST(0.23279856662996),
97 FRAC_CONST(0.25)
98 };
99
100 #ifdef PARAM_32KHZ
101 static const uint8_t delay_length_d[2][NO_ALLPASS_LINKS] = {
102 { 1, 2, 3 } /* d_24kHz */,
103 { 3, 4, 5 } /* d_48kHz */
104 };
105 #else
106 static const uint8_t delay_length_d[NO_ALLPASS_LINKS] = {
107 3, 4, 5 /* d_48kHz */
108 };
109 #endif
110 static const real_t filter_a[NO_ALLPASS_LINKS] = { /* a(m) = exp(-d_48kHz(m)/7) */
111 FRAC_CONST(0.65143905753106),
112 FRAC_CONST(0.56471812200776),
113 FRAC_CONST(0.48954165955695)
114 };
115
116 static const uint8_t group_border20[10+12 + 1] =
117 {
118 6, 7, 0, 1, 2, 3, /* 6 subqmf subbands */
119 9, 8, /* 2 subqmf subbands */
120 10, 11, /* 2 subqmf subbands */
121 3, 4, 5, 6, 7, 8, 9, 11, 14, 18, 23, 35, 64
122 };
123
124 static const uint8_t group_border34[32+18 + 1] =
125 {
126 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, /* 12 subqmf subbands */
127 12, 13, 14, 15, 16, 17, 18, 19, /* 8 subqmf subbands */
128 20, 21, 22, 23, /* 4 subqmf subbands */
129 24, 25, 26, 27, /* 4 subqmf subbands */
130 28, 29, 30, 31, /* 4 subqmf subbands */
131 32-27, 33-27, 34-27, 35-27, 36-27, 37-27, 38-27, 40-27, 42-27, 44-27, 46-27, 48-27, 51-27, 54-27, 57-27, 60-27, 64-27, 68-27, 91-27
132 };
133
134 static const uint16_t map_group2bk20[10+12] =
135 {
136 (NEGATE_IPD_MASK | 1), (NEGATE_IPD_MASK | 0),
137 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
138 };
139
140 static const uint16_t map_group2bk34[32+18] =
141 {
142 0, 1, 2, 3, 4, 5, 6, 6, 7, (NEGATE_IPD_MASK | 2), (NEGATE_IPD_MASK | 1), (NEGATE_IPD_MASK | 0),
143 10, 10, 4, 5, 6, 7, 8, 9,
144 10, 11, 12, 9,
145 14, 11, 12, 13,
146 14, 15, 16, 13,
147 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33
148 };
149
150 /* type definitions */
151 typedef struct
152 {
153 uint8_t frame_len;
154 uint8_t resolution20[3];
155 uint8_t resolution34[5];
156
157 qmf_t *work;
158 qmf_t **buffer;
159 qmf_t **temp;
160 } hyb_info;
161
162 /* static function declarations */
163 static void ps_data_decode(ps_info *ps);
164 static hyb_info *hybrid_init();
165 static void channel_filter2(hyb_info *hyb, uint8_t frame_len, const real_t *filter,
166 qmf_t *buffer, qmf_t **X_hybrid);
167 static void INLINE DCT3_4_unscaled(real_t *y, real_t *x);
168 static void channel_filter8(hyb_info *hyb, uint8_t frame_len, const real_t *filter,
169 qmf_t *buffer, qmf_t **X_hybrid);
170 static void hybrid_analysis(hyb_info *hyb, qmf_t X[32][64], qmf_t X_hybrid[32][32],
171 uint8_t use34);
172 static void hybrid_synthesis(hyb_info *hyb, qmf_t X[32][64], qmf_t X_hybrid[32][32],
173 uint8_t use34);
174 static int8_t delta_clip(int8_t i, int8_t min, int8_t max);
175 static void delta_decode(uint8_t enable, int8_t *index, int8_t *index_prev,
176 uint8_t dt_flag, uint8_t nr_par, uint8_t stride,
177 int8_t min_index, int8_t max_index);
178 static void delta_modulo_decode(uint8_t enable, int8_t *index, int8_t *index_prev,
179 uint8_t dt_flag, uint8_t nr_par, uint8_t stride,
180 int8_t and_modulo);
181 static void map20indexto34(int8_t *index, uint8_t bins);
182 #ifdef PS_LOW_POWER
183 static void map34indexto20(int8_t *index, uint8_t bins);
184 #endif
185 static void ps_data_decode(ps_info *ps);
186 static void ps_decorrelate(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64],
187 qmf_t X_hybrid_left[32][32], qmf_t X_hybrid_right[32][32]);
188 static void ps_mix_phase(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64],
189 qmf_t X_hybrid_left[32][32], qmf_t X_hybrid_right[32][32]);
190
191 /* */
192
193
194 static hyb_info *hybrid_init()
195 {
196 uint8_t i;
197
198 hyb_info *hyb = (hyb_info*)faad_malloc(sizeof(hyb_info));
199
200 hyb->resolution34[0] = 12;
201 hyb->resolution34[1] = 8;
202 hyb->resolution34[2] = 4;
203 hyb->resolution34[3] = 4;
204 hyb->resolution34[4] = 4;
205
206 hyb->resolution20[0] = 8;
207 hyb->resolution20[1] = 2;
208 hyb->resolution20[2] = 2;
209
210 hyb->frame_len = 32;
211
212 hyb->work = (qmf_t*)faad_malloc((hyb->frame_len+12) * sizeof(qmf_t));
213 memset(hyb->work, 0, (hyb->frame_len+12) * sizeof(qmf_t));
214
215 hyb->buffer = (qmf_t**)faad_malloc(5 * sizeof(qmf_t*));
216 for (i = 0; i < 5; i++)
217 {
218 hyb->buffer[i] = (qmf_t*)faad_malloc(hyb->frame_len * sizeof(qmf_t));
219 memset(hyb->buffer[i], 0, hyb->frame_len * sizeof(qmf_t));
220 }
221
222 hyb->temp = (qmf_t**)faad_malloc(hyb->frame_len * sizeof(qmf_t*));
223 for (i = 0; i < hyb->frame_len; i++)
224 {
225 hyb->temp[i] = (qmf_t*)faad_malloc(12 /*max*/ * sizeof(qmf_t));
226 }
227
228 return hyb;
229 }
230
231 static void hybrid_free(hyb_info *hyb)
232 {
233 uint8_t i;
234
235 if (hyb->work)
236 faad_free(hyb->work);
237
238 for (i = 0; i < 5; i++)
239 {
240 if (hyb->buffer[i])
241 faad_free(hyb->buffer[i]);
242 }
243 if (hyb->buffer)
244 faad_free(hyb->buffer);
245
246 for (i = 0; i < hyb->frame_len; i++)
247 {
248 if (hyb->temp[i])
249 faad_free(hyb->temp[i]);
250 }
251 if (hyb->temp)
252 faad_free(hyb->temp);
253 }
254
255 /* real filter, size 2 */
256 static void channel_filter2(hyb_info *hyb, uint8_t frame_len, const real_t *filter,
257 qmf_t *buffer, qmf_t **X_hybrid)
258 {
259 uint8_t i;
260
261 for (i = 0; i < frame_len; i++)
262 {
263 real_t r0 = MUL_F(filter[0],(QMF_RE(buffer[0+i]) + QMF_RE(buffer[12+i])));
264 real_t r1 = MUL_F(filter[1],(QMF_RE(buffer[1+i]) + QMF_RE(buffer[11+i])));
265 real_t r2 = MUL_F(filter[2],(QMF_RE(buffer[2+i]) + QMF_RE(buffer[10+i])));
266 real_t r3 = MUL_F(filter[3],(QMF_RE(buffer[3+i]) + QMF_RE(buffer[9+i])));
267 real_t r4 = MUL_F(filter[4],(QMF_RE(buffer[4+i]) + QMF_RE(buffer[8+i])));
268 real_t r5 = MUL_F(filter[5],(QMF_RE(buffer[5+i]) + QMF_RE(buffer[7+i])));
269 real_t r6 = MUL_F(filter[6],QMF_RE(buffer[6+i]));
270 real_t i0 = MUL_F(filter[0],(QMF_IM(buffer[0+i]) + QMF_IM(buffer[12+i])));
271 real_t i1 = MUL_F(filter[1],(QMF_IM(buffer[1+i]) + QMF_IM(buffer[11+i])));
272 real_t i2 = MUL_F(filter[2],(QMF_IM(buffer[2+i]) + QMF_IM(buffer[10+i])));
273 real_t i3 = MUL_F(filter[3],(QMF_IM(buffer[3+i]) + QMF_IM(buffer[9+i])));
274 real_t i4 = MUL_F(filter[4],(QMF_IM(buffer[4+i]) + QMF_IM(buffer[8+i])));
275 real_t i5 = MUL_F(filter[5],(QMF_IM(buffer[5+i]) + QMF_IM(buffer[7+i])));
276 real_t i6 = MUL_F(filter[6],QMF_IM(buffer[6+i]));
277
278 /* q = 0 */
279 QMF_RE(X_hybrid[i][0]) = r0 + r1 + r2 + r3 + r4 + r5 + r6;
280 QMF_IM(X_hybrid[i][0]) = i0 + i1 + i2 + i3 + i4 + i5 + i6;
281
282 /* q = 1 */
283 QMF_RE(X_hybrid[i][1]) = r0 - r1 + r2 - r3 + r4 - r5 + r6;
284 QMF_IM(X_hybrid[i][1]) = i0 - i1 + i2 - i3 + i4 - i5 + i6;
285 }
286 }
287
288 /* complex filter, size 4 */
289 static void channel_filter4(hyb_info *hyb, uint8_t frame_len, const real_t *filter,
290 qmf_t *buffer, qmf_t **X_hybrid)
291 {
292 uint8_t i;
293 real_t input_re1[2], input_re2[2], input_im1[2], input_im2[2];
294
295 for (i = 0; i < frame_len; i++)
296 {
297 input_re1[0] = -MUL_F(filter[2], (QMF_RE(buffer[i+2]) + QMF_RE(buffer[i+10]))) +
298 MUL_F(filter[6], QMF_RE(buffer[i+6]));
299 input_re1[1] = MUL_F(FRAC_CONST(-0.70710678118655),
300 (MUL_F(filter[1], (QMF_RE(buffer[i+1]) + QMF_RE(buffer[i+11]))) +
301 MUL_F(filter[3], (QMF_RE(buffer[i+3]) + QMF_RE(buffer[i+9]))) -
302 MUL_F(filter[5], (QMF_RE(buffer[i+5]) + QMF_RE(buffer[i+7])))));
303
304 input_im1[0] = MUL_F(filter[0], (QMF_IM(buffer[i+0]) - QMF_IM(buffer[i+12]))) -
305 MUL_F(filter[4], (QMF_IM(buffer[i+4]) - QMF_IM(buffer[i+8])));
306 input_im1[1] = MUL_F(FRAC_CONST(0.70710678118655),
307 (MUL_F(filter[1], (QMF_IM(buffer[i+1]) - QMF_IM(buffer[i+11]))) -
308 MUL_F(filter[3], (QMF_IM(buffer[i+3]) - QMF_IM(buffer[i+9]))) -
309 MUL_F(filter[5], (QMF_IM(buffer[i+5]) - QMF_IM(buffer[i+7])))));
310
311 input_re2[0] = MUL_F(filter[0], (QMF_RE(buffer[i+0]) - QMF_RE(buffer[i+12]))) -
312 MUL_F(filter[4], (QMF_RE(buffer[i+4]) - QMF_RE(buffer[i+8])));
313 input_re2[1] = MUL_F(FRAC_CONST(0.70710678118655),
314 (MUL_F(filter[1], (QMF_RE(buffer[i+1]) - QMF_RE(buffer[i+11]))) -
315 MUL_F(filter[3], (QMF_RE(buffer[i+3]) - QMF_RE(buffer[i+9]))) -
316 MUL_F(filter[5], (QMF_RE(buffer[i+5]) - QMF_RE(buffer[i+7])))));
317
318 input_im2[0] = -MUL_F(filter[2], (QMF_IM(buffer[i+2]) + QMF_IM(buffer[i+10]))) +
319 MUL_F(filter[6], QMF_IM(buffer[i+6]));
320 input_im2[1] = MUL_F(FRAC_CONST(-0.70710678118655),
321 (MUL_F(filter[1], (QMF_IM(buffer[i+1]) + QMF_IM(buffer[i+11]))) +
322 MUL_F(filter[3], (QMF_IM(buffer[i+3]) + QMF_IM(buffer[i+9]))) -
323 MUL_F(filter[5], (QMF_IM(buffer[i+5]) + QMF_IM(buffer[i+7])))));
324
325 /* q == 0 */
326 QMF_RE(X_hybrid[i][0]) = input_re1[0] + input_re1[1] + input_im1[0] + input_im1[1];
327 QMF_IM(X_hybrid[i][0]) = -input_re2[0] - input_re2[1] + input_im2[0] + input_im2[1];
328
329 /* q == 1 */
330 QMF_RE(X_hybrid[i][1]) = input_re1[0] - input_re1[1] - input_im1[0] + input_im1[1];
331 QMF_IM(X_hybrid[i][1]) = input_re2[0] - input_re2[1] + input_im2[0] - input_im2[1];
332
333 /* q == 2 */
334 QMF_RE(X_hybrid[i][2]) = input_re1[0] - input_re1[1] + input_im1[0] - input_im1[1];
335 QMF_IM(X_hybrid[i][2]) = -input_re2[0] + input_re2[1] + input_im2[0] - input_im2[1];
336
337 /* q == 3 */
338 QMF_RE(X_hybrid[i][3]) = input_re1[0] + input_re1[1] - input_im1[0] - input_im1[1];
339 QMF_IM(X_hybrid[i][3]) = input_re2[0] + input_re2[1] + input_im2[0] + input_im2[1];
340 }
341 }
342
343 static void INLINE DCT3_4_unscaled(real_t *y, real_t *x)
344 {
345 real_t f0, f1, f2, f3, f4, f5, f6, f7, f8;
346
347 f0 = MUL_F(x[2], FRAC_CONST(0.7071067811865476));
348 f1 = x[0] - f0;
349 f2 = x[0] + f0;
350 f3 = x[1] + x[3];
351 f4 = MUL_C(x[1], COEF_CONST(1.3065629648763766));
352 f5 = MUL_F(f3, FRAC_CONST(-0.9238795325112866));
353 f6 = MUL_F(x[3], FRAC_CONST(-0.5411961001461967));
354 f7 = f4 + f5;
355 f8 = f6 - f5;
356 y[3] = f2 - f8;
357 y[0] = f2 + f8;
358 y[2] = f1 - f7;
359 y[1] = f1 + f7;
360 }
361
362 /* complex filter, size 8 */
363 static void channel_filter8(hyb_info *hyb, uint8_t frame_len, const real_t *filter,
364 qmf_t *buffer, qmf_t **X_hybrid)
365 {
366 uint8_t i, n;
367 real_t input_re1[4], input_re2[4], input_im1[4], input_im2[4];
368 real_t x[4];
369
370 for (i = 0; i < frame_len; i++)
371 {
372 input_re1[0] = MUL_F(filter[6],QMF_RE(buffer[6+i]));
373 input_re1[1] = MUL_F(filter[5],(QMF_RE(buffer[5+i]) + QMF_RE(buffer[7+i])));
374 input_re1[2] = -MUL_F(filter[0],(QMF_RE(buffer[0+i]) + QMF_RE(buffer[12+i]))) + MUL_F(filter[4],(QMF_RE(buffer[4+i]) + QMF_RE(buffer[8+i])));
375 input_re1[3] = -MUL_F(filter[1],(QMF_RE(buffer[1+i]) + QMF_RE(buffer[11+i]))) + MUL_F(filter[3],(QMF_RE(buffer[3+i]) + QMF_RE(buffer[9+i])));
376
377 input_im1[0] = MUL_F(filter[5],(QMF_IM(buffer[7+i]) - QMF_IM(buffer[5+i])));
378 input_im1[1] = MUL_F(filter[0],(QMF_IM(buffer[12+i]) - QMF_IM(buffer[0+i]))) + MUL_F(filter[4],(QMF_IM(buffer[8+i]) - QMF_IM(buffer[4+i])));
379 input_im1[2] = MUL_F(filter[1],(QMF_IM(buffer[11+i]) - QMF_IM(buffer[1+i]))) + MUL_F(filter[3],(QMF_IM(buffer[9+i]) - QMF_IM(buffer[3+i])));
380 input_im1[3] = MUL_F(filter[2],(QMF_IM(buffer[10+i]) - QMF_IM(buffer[2+i])));
381
382 for (n = 0; n < 4; n++)
383 {
384 x[n] = input_re1[n] - input_im1[3-n];
385 }
386 DCT3_4_unscaled(x, x);
387 QMF_RE(X_hybrid[i][7]) = x[0];
388 QMF_RE(X_hybrid[i][5]) = x[2];
389 QMF_RE(X_hybrid[i][3]) = x[3];
390 QMF_RE(X_hybrid[i][1]) = x[1];
391
392 for (n = 0; n < 4; n++)
393 {
394 x[n] = input_re1[n] + input_im1[3-n];
395 }
396 DCT3_4_unscaled(x, x);
397 QMF_RE(X_hybrid[i][6]) = x[1];
398 QMF_RE(X_hybrid[i][4]) = x[3];
399 QMF_RE(X_hybrid[i][2]) = x[2];
400 QMF_RE(X_hybrid[i][0]) = x[0];
401
402 input_im2[0] = MUL_F(filter[6],QMF_IM(buffer[6+i]));
403 input_im2[1] = MUL_F(filter[5],(QMF_IM(buffer[5+i]) + QMF_IM(buffer[7+i])));
404 input_im2[2] = -MUL_F(filter[0],(QMF_IM(buffer[0+i]) + QMF_IM(buffer[12+i]))) + MUL_F(filter[4],(QMF_IM(buffer[4+i]) + QMF_IM(buffer[8+i])));
405 input_im2[3] = -MUL_F(filter[1],(QMF_IM(buffer[1+i]) + QMF_IM(buffer[11+i]))) + MUL_F(filter[3],(QMF_IM(buffer[3+i]) + QMF_IM(buffer[9+i])));
406
407 input_re2[0] = MUL_F(filter[5],(QMF_RE(buffer[7+i]) - QMF_RE(buffer[5+i])));
408 input_re2[1] = MUL_F(filter[0],(QMF_RE(buffer[12+i]) - QMF_RE(buffer[0+i]))) + MUL_F(filter[4],(QMF_RE(buffer[8+i]) - QMF_RE(buffer[4+i])));
409 input_re2[2] = MUL_F(filter[1],(QMF_RE(buffer[11+i]) - QMF_RE(buffer[1+i]))) + MUL_F(filter[3],(QMF_RE(buffer[9+i]) - QMF_RE(buffer[3+i])));
410 input_re2[3] = MUL_F(filter[2],(QMF_RE(buffer[10+i]) - QMF_RE(buffer[2+i])));
411
412 for (n = 0; n < 4; n++)
413 {
414 x[n] = input_im2[n] + input_re2[3-n];
415 }
416 DCT3_4_unscaled(x, x);
417 QMF_IM(X_hybrid[i][7]) = x[0];
418 QMF_IM(X_hybrid[i][5]) = x[2];
419 QMF_IM(X_hybrid[i][3]) = x[3];
420 QMF_IM(X_hybrid[i][1]) = x[1];
421
422 for (n = 0; n < 4; n++)
423 {
424 x[n] = input_im2[n] - input_re2[3-n];
425 }
426 DCT3_4_unscaled(x, x);
427 QMF_IM(X_hybrid[i][6]) = x[1];
428 QMF_IM(X_hybrid[i][4]) = x[3];
429 QMF_IM(X_hybrid[i][2]) = x[2];
430 QMF_IM(X_hybrid[i][0]) = x[0];
431 }
432 }
433
434 static void INLINE DCT3_6_unscaled(real_t *y, real_t *x)
435 {
436 real_t f0, f1, f2, f3, f4, f5, f6, f7;
437
438 f0 = MUL_F(x[3], FRAC_CONST(0.70710678118655));
439 f1 = x[0] + f0;
440 f2 = x[0] - f0;
441 f3 = MUL_F((x[1] - x[5]), FRAC_CONST(0.70710678118655));
442 f4 = MUL_F(x[2], FRAC_CONST(0.86602540378444)) + MUL_F(x[4], FRAC_CONST(0.5));
443 f5 = f4 - x[4];
444 f6 = MUL_F(x[1], FRAC_CONST(0.96592582628907)) + MUL_F(x[5], FRAC_CONST(0.25881904510252));
445 f7 = f6 - f3;
446 y[0] = f1 + f6 + f4;
447 y[1] = f2 + f3 - x[4];
448 y[2] = f7 + f2 - f5;
449 y[3] = f1 - f7 - f5;
450 y[4] = f1 - f3 - x[4];
451 y[5] = f2 - f6 + f4;
452 }
453
454 /* complex filter, size 12 */
455 static void channel_filter12(hyb_info *hyb, uint8_t frame_len, const real_t *filter,
456 qmf_t *buffer, qmf_t **X_hybrid)
457 {
458 uint8_t i, n;
459 real_t input_re1[6], input_re2[6], input_im1[6], input_im2[6];
460 real_t out_re1[6], out_re2[6], out_im1[6], out_im2[6];
461
462 for (i = 0; i < frame_len; i++)
463 {
464 for (n = 0; n < 6; n++)
465 {
466 if (n == 0)
467 {
468 input_re1[0] = MUL_F(QMF_RE(buffer[6+i]), filter[6]);
469 input_re2[0] = MUL_F(QMF_IM(buffer[6+i]), filter[6]);
470 } else {
471 input_re1[6-n] = MUL_F((QMF_RE(buffer[n+i]) + QMF_RE(buffer[12-n+i])), filter[n]);
472 input_re2[6-n] = MUL_F((QMF_IM(buffer[n+i]) + QMF_IM(buffer[12-n+i])), filter[n]);
473 }
474 input_im2[n] = MUL_F((QMF_RE(buffer[n+i]) - QMF_RE(buffer[12-n+i])), filter[n]);
475 input_im1[n] = MUL_F((QMF_IM(buffer[n+i]) - QMF_IM(buffer[12-n+i])), filter[n]);
476 }
477
478 DCT3_6_unscaled(out_re1, input_re1);
479 DCT3_6_unscaled(out_re2, input_re2);
480
481 DCT3_6_unscaled(out_im1, input_im1);
482 DCT3_6_unscaled(out_im2, input_im2);
483
484 for (n = 0; n < 6; n += 2)
485 {
486 QMF_RE(X_hybrid[i][n]) = out_re1[n] - out_im1[n];
487 QMF_IM(X_hybrid[i][n]) = out_re2[n] + out_im2[n];
488 QMF_RE(X_hybrid[i][n+1]) = out_re1[n+1] + out_im1[n+1];
489 QMF_IM(X_hybrid[i][n+1]) = out_re2[n+1] - out_im2[n+1];
490
491 QMF_RE(X_hybrid[i][10-n]) = out_re1[n+1] - out_im1[n+1];
492 QMF_IM(X_hybrid[i][10-n]) = out_re2[n+1] + out_im2[n+1];
493 QMF_RE(X_hybrid[i][11-n]) = out_re1[n] + out_im1[n];
494 QMF_IM(X_hybrid[i][11-n]) = out_re2[n] - out_im2[n];
495 }
496 }
497 }
498
499 /* Hybrid analysis: further split up QMF subbands
500 * to improve frequency resolution
501 */
502 static void hybrid_analysis(hyb_info *hyb, qmf_t X[32][64], qmf_t X_hybrid[32][32],
503 uint8_t use34)
504 {
505 uint8_t k, n, band;
506 uint8_t offset = 0;
507 uint8_t qmf_bands = (use34) ? 5 : 3;
508 uint8_t *resolution = (use34) ? hyb->resolution34 : hyb->resolution20;
509
510 for (band = 0; band < qmf_bands; band++)
511 {
512 /* build working buffer */
513 memcpy(hyb->work, hyb->buffer[band], 12 * sizeof(qmf_t));
514
515 /* add new samples */
516 for (n = 0; n < hyb->frame_len; n++)
517 {
518 QMF_RE(hyb->work[12 + n]) = QMF_RE(X[n + 6 /*delay*/][band]);
519 QMF_IM(hyb->work[12 + n]) = QMF_IM(X[n + 6 /*delay*/][band]);
520 }
521
522 /* store samples */
523 memcpy(hyb->buffer[band], hyb->work + hyb->frame_len, 12 * sizeof(qmf_t));
524
525
526 switch(resolution[band])
527 {
528 case 2:
529 /* Type B real filter, Q[p] = 2 */
530 channel_filter2(hyb, hyb->frame_len, p2_13_20, hyb->work, hyb->temp);
531 break;
532 case 4:
533 /* Type A complex filter, Q[p] = 4 */
534 channel_filter4(hyb, hyb->frame_len, p4_13_34, hyb->work, hyb->temp);
535 break;
536 case 8:
537 /* Type A complex filter, Q[p] = 8 */
538 channel_filter8(hyb, hyb->frame_len, (use34) ? p8_13_34 : p8_13_20,
539 hyb->work, hyb->temp);
540 break;
541 case 12:
542 /* Type A complex filter, Q[p] = 12 */
543 channel_filter12(hyb, hyb->frame_len, p12_13_34, hyb->work, hyb->temp);
544 break;
545 }
546
547 for (n = 0; n < hyb->frame_len; n++)
548 {
549 for (k = 0; k < resolution[band]; k++)
550 {
551 QMF_RE(X_hybrid[n][offset + k]) = QMF_RE(hyb->temp[n][k]);
552 QMF_IM(X_hybrid[n][offset + k]) = QMF_IM(hyb->temp[n][k]);
553 }
554 }
555 offset += resolution[band];
556 }
557
558 /* group hybrid channels */
559 if (!use34)
560 {
561 for (n = 0; n < 32 /*30?*/; n++)
562 {
563 QMF_RE(X_hybrid[n][3]) += QMF_RE(X_hybrid[n][4]);
564 QMF_IM(X_hybrid[n][3]) += QMF_IM(X_hybrid[n][4]);
565 QMF_RE(X_hybrid[n][4]) = 0;
566 QMF_IM(X_hybrid[n][4]) = 0;
567
568 QMF_RE(X_hybrid[n][2]) += QMF_RE(X_hybrid[n][5]);
569 QMF_IM(X_hybrid[n][2]) += QMF_IM(X_hybrid[n][5]);
570 QMF_RE(X_hybrid[n][5]) = 0;
571 QMF_IM(X_hybrid[n][5]) = 0;
572 }
573 }
574 }
575
576 static void hybrid_synthesis(hyb_info *hyb, qmf_t X[32][64], qmf_t X_hybrid[32][32],
577 uint8_t use34)
578 {
579 uint8_t k, n, band;
580 uint8_t offset = 0;
581 uint8_t qmf_bands = (use34) ? 5 : 3;
582 uint8_t *resolution = (use34) ? hyb->resolution34 : hyb->resolution20;
583
584 for(band = 0; band < qmf_bands; band++)
585 {
586 for (n = 0; n < hyb->frame_len; n++)
587 {
588 QMF_RE(X[n][band]) = 0;
589 QMF_IM(X[n][band]) = 0;
590
591 for (k = 0; k < resolution[band]; k++)
592 {
593 QMF_RE(X[n][band]) += QMF_RE(X_hybrid[n][offset + k]);
594 QMF_IM(X[n][band]) += QMF_IM(X_hybrid[n][offset + k]);
595 }
596 }
597 offset += resolution[band];
598 }
599 }
600
601 /* limits the value i to the range [min,max] */
602 static int8_t delta_clip(int8_t i, int8_t min, int8_t max)
603 {
604 if (i < min)
605 return min;
606 else if (i > max)
607 return max;
608 else
609 return i;
610 }
611
612 //int iid = 0;
613
614 /* delta decode array */
615 static void delta_decode(uint8_t enable, int8_t *index, int8_t *index_prev,
616 uint8_t dt_flag, uint8_t nr_par, uint8_t stride,
617 int8_t min_index, int8_t max_index)
618 {
619 int8_t i;
620
621 if (enable == 1)
622 {
623 if (dt_flag == 0)
624 {
625 /* delta coded in frequency direction */
626 index[0] = 0 + index[0];
627 index[0] = delta_clip(index[0], min_index, max_index);
628
629 for (i = 1; i < nr_par; i++)
630 {
631 index[i] = index[i-1] + index[i];
632 index[i] = delta_clip(index[i], min_index, max_index);
633 }
634 } else {
635 /* delta coded in time direction */
636 for (i = 0; i < nr_par; i++)
637 {
638 //int8_t tmp2;
639 //int8_t tmp = index[i];
640
641 //printf("%d %d\n", index_prev[i*stride], index[i]);
642 //printf("%d\n", index[i]);
643
644 index[i] = index_prev[i*stride] + index[i];
645 //tmp2 = index[i];
646 index[i] = delta_clip(index[i], min_index, max_index);
647
648 //if (iid)
649 //{
650 // if (index[i] == 7)
651 // {
652 // printf("%d %d %d\n", index_prev[i*stride], tmp, tmp2);
653 // }
654 //}
655 }
656 }
657 } else {
658 /* set indices to zero */
659 for (i = 0; i < nr_par; i++)
660 {
661 index[i] = 0;
662 }
663 }
664
665 /* coarse */
666 if (stride == 2)
667 {
668 for (i = (nr_par<<1)-1; i > 0; i--)
669 {
670 index[i] = index[i>>1];
671 }
672 }
673 }
674
675 /* delta modulo decode array */
676 /* in: log2 value of the modulo value to allow using AND instead of MOD */
677 static void delta_modulo_decode(uint8_t enable, int8_t *index, int8_t *index_prev,
678 uint8_t dt_flag, uint8_t nr_par, uint8_t stride,
679 int8_t and_modulo)
680 {
681 int8_t i;
682
683 if (enable == 1)
684 {
685 if (dt_flag == 0)
686 {
687 /* delta coded in frequency direction */
688 index[0] = 0 + index[0];
689 index[0] &= and_modulo;
690
691 for (i = 1; i < nr_par; i++)
692 {
693 index[i] = index[i-1] + index[i];
694 index[i] &= and_modulo;
695 }
696 } else {
697 /* delta coded in time direction */
698 for (i = 0; i < nr_par; i++)
699 {
700 index[i] = index_prev[i*stride] + index[i];
701 index[i] &= and_modulo;
702 }
703 }
704 } else {
705 /* set indices to zero */
706 for (i = 0; i < nr_par; i++)
707 {
708 index[i] = 0;
709 }
710 }
711
712 /* coarse */
713 if (stride == 2)
714 {
715 index[0] = 0;
716 for (i = (nr_par<<1)-1; i > 0; i--)
717 {
718 index[i] = index[i>>1];
719 }
720 }
721 }
722
723 #ifdef PS_LOW_POWER
724 static void map34indexto20(int8_t *index, uint8_t bins)
725 {
726 index[0] = (2*index[0]+index[1])/3;
727 index[1] = (index[1]+2*index[2])/3;
728 index[2] = (2*index[3]+index[4])/3;
729 index[3] = (index[4]+2*index[5])/3;
730 index[4] = (index[6]+index[7])/2;
731 index[5] = (index[8]+index[9])/2;
732 index[6] = index[10];
733 index[7] = index[11];
734 index[8] = (index[12]+index[13])/2;
735 index[9] = (index[14]+index[15])/2;
736 index[10] = index[16];
737
738 if (bins == 34)
739 {
740 index[11] = index[17];
741 index[12] = index[18];
742 index[13] = index[19];
743 index[14] = (index[20]+index[21])/2;
744 index[15] = (index[22]+index[23])/2;
745 index[16] = (index[24]+index[25])/2;
746 index[17] = (index[26]+index[27])/2;
747 index[18] = (index[28]+index[29]+index[30]+index[31])/4;
748 index[19] = (index[32]+index[33])/2;
749 }
750 }
751 #endif
752
753 static void map20indexto34(int8_t *index, uint8_t bins)
754 {
755 index[0] = index[0];
756 index[1] = (index[0] + index[1])/2;
757 index[2] = index[1];
758 index[3] = index[2];
759 index[4] = (index[2] + index[3])/2;
760 index[5] = index[3];
761 index[6] = index[4];
762 index[7] = index[4];
763 index[8] = index[5];
764 index[9] = index[5];
765 index[10] = index[6];
766 index[11] = index[7];
767 index[12] = index[8];
768 index[13] = index[8];
769 index[14] = index[9];
770 index[15] = index[9];
771 index[16] = index[10];
772
773 if (bins == 34)
774 {
775 index[17] = index[11];
776 index[18] = index[12];
777 index[19] = index[13];
778 index[20] = index[14];
779 index[21] = index[14];
780 index[22] = index[15];
781 index[23] = index[15];
782 index[24] = index[16];
783 index[25] = index[16];
784 index[26] = index[17];
785 index[27] = index[17];
786 index[28] = index[18];
787 index[29] = index[18];
788 index[30] = index[18];
789 index[31] = index[18];
790 index[32] = index[19];
791 index[33] = index[19];
792 }
793 }
794
795 /* parse the bitstream data decoded in ps_data() */
796 static void ps_data_decode(ps_info *ps)
797 {
798 uint8_t env, bin;
799
800 /* ps data not available, use data from previous frame */
801 if (ps->ps_data_available == 0)
802 {
803 ps->num_env = 0;
804 }
805
806 for (env = 0; env < ps->num_env; env++)
807 {
808 int8_t *iid_index_prev;
809 int8_t *icc_index_prev;
810 int8_t *ipd_index_prev;
811 int8_t *opd_index_prev;
812
813 int8_t num_iid_steps = (ps->iid_mode < 3) ? 7 : 15 /*fine quant*/;
814
815 if (env == 0)
816 {
817 /* take last envelope from previous frame */
818 iid_index_prev = ps->iid_index_prev;
819 icc_index_prev = ps->icc_index_prev;
820 ipd_index_prev = ps->ipd_index_prev;
821 opd_index_prev = ps->opd_index_prev;
822 } else {
823 /* take index values from previous envelope */
824 iid_index_prev = ps->iid_index[env - 1];
825 icc_index_prev = ps->icc_index[env - 1];
826 ipd_index_prev = ps->ipd_index[env - 1];
827 opd_index_prev = ps->opd_index[env - 1];
828 }
829
830 // iid = 1;
831 /* delta decode iid parameters */
832 delta_decode(ps->enable_iid, ps->iid_index[env], iid_index_prev,
833 ps->iid_dt[env], ps->nr_iid_par,
834 (ps->iid_mode == 0 || ps->iid_mode == 3) ? 2 : 1,
835 -num_iid_steps, num_iid_steps);
836 // iid = 0;
837
838 /* delta decode icc parameters */
839 delta_decode(ps->enable_icc, ps->icc_index[env], icc_index_prev,
840 ps->icc_dt[env], ps->nr_icc_par,
841 (ps->icc_mode == 0 || ps->icc_mode == 3) ? 2 : 1,
842 0, 7);
843
844 /* delta modulo decode ipd parameters */
845 delta_modulo_decode(ps->enable_ipdopd, ps->ipd_index[env], ipd_index_prev,
846 ps->ipd_dt[env], ps->nr_ipdopd_par, 1, 7);
847
848 /* delta modulo decode opd parameters */
849 delta_modulo_decode(ps->enable_ipdopd, ps->opd_index[env], opd_index_prev,
850 ps->opd_dt[env], ps->nr_ipdopd_par, 1, 7);
851 }
852
853 /* handle error case */
854 if (ps->num_env == 0)
855 {
856 /* force to 1 */
857 ps->num_env = 1;
858
859 if (ps->enable_iid)
860 {
861 for (bin = 0; bin < 34; bin++)
862 ps->iid_index[0][bin] = ps->iid_index_prev[bin];
863 } else {
864 for (bin = 0; bin < 34; bin++)
865 ps->iid_index[0][bin] = 0;
866 }
867
868 if (ps->enable_icc)
869 {
870 for (bin = 0; bin < 34; bin++)
871 ps->icc_index[0][bin] = ps->icc_index_prev[bin];
872 } else {
873 for (bin = 0; bin < 34; bin++)
874 ps->icc_index[0][bin] = 0;
875 }
876
877 if (ps->enable_ipdopd)
878 {
879 for (bin = 0; bin < 17; bin++)
880 {
881 ps->ipd_index[0][bin] = ps->ipd_index_prev[bin];
882 ps->opd_index[0][bin] = ps->opd_index_prev[bin];
883 }
884 } else {
885 for (bin = 0; bin < 17; bin++)
886 {
887 ps->ipd_index[0][bin] = 0;
888 ps->opd_index[0][bin] = 0;
889 }
890 }
891 }
892
893 /* update previous indices */
894 for (bin = 0; bin < 34; bin++)
895 ps->iid_index_prev[bin] = ps->iid_index[ps->num_env-1][bin];
896 for (bin = 0; bin < 34; bin++)
897 ps->icc_index_prev[bin] = ps->icc_index[ps->num_env-1][bin];
898 for (bin = 0; bin < 17; bin++)
899 {
900 ps->ipd_index_prev[bin] = ps->ipd_index[ps->num_env-1][bin];
901 ps->opd_index_prev[bin] = ps->opd_index[ps->num_env-1][bin];
902 }
903
904 ps->ps_data_available = 0;
905
906 if (ps->frame_class == 0)
907 {
908 ps->border_position[0] = 0;
909 for (env = 1; env < ps->num_env; env++)
910 {
911 ps->border_position[env] = (env * 32 /* 30 for 960? */) / ps->num_env;
912 }
913 ps->border_position[ps->num_env] = 32 /* 30 for 960? */;
914 } else {
915 ps->border_position[0] = 0;
916
917 if (ps->border_position[ps->num_env] < 32 /* 30 for 960? */)
918 {
919 for (bin = 0; bin < 34; bin++)
920 {
921 ps->iid_index[ps->num_env][bin] = ps->iid_index[ps->num_env-1][bin];
922 ps->icc_index[ps->num_env][bin] = ps->icc_index[ps->num_env-1][bin];
923 }
924 for (bin = 0; bin < 17; bin++)
925 {
926 ps->ipd_index[ps->num_env][bin] = ps->ipd_index[ps->num_env-1][bin];
927 ps->opd_index[ps->num_env][bin] = ps->opd_index[ps->num_env-1][bin];
928 }
929 ps->num_env++;
930 ps->border_position[ps->num_env] = 32 /* 30 for 960? */;
931 }
932
933 for (env = 1; env < ps->num_env; env++)
934 {
935 int8_t thr = 32 /* 30 for 960? */ - (ps->num_env - env);
936
937 if (ps->border_position[env] > thr)
938 {
939 ps->border_position[env] = thr;
940 } else {
941 thr = ps->border_position[env-1]+1;
942 if (ps->border_position[env] < thr)
943 {
944 ps->border_position[env] = thr;
945 }
946 }
947 }
948 }
949
950 /* make sure that the indices of all parameters can be mapped
951 * to the same hybrid synthesis filterbank
952 */
953 #ifdef PS_LOW_POWER
954 for (env = 0; env < ps->num_env; env++)
955 {
956 if (ps->iid_mode == 2 || ps->iid_mode == 5)
957 map34indexto20(ps->iid_index[env], 34);
958 if (ps->icc_mode == 2 || ps->icc_mode == 5)
959 map34indexto20(ps->icc_index[env], 34);
960
961 /* disable ipd/opd */
962 for (bin = 0; bin < 17; bin++)
963 {
964 ps->aaIpdIndex[env][bin] = 0;
965 ps->aaOpdIndex[env][bin] = 0;
966 }
967 }
968 #else
969 if (ps->use34hybrid_bands)
970 {
971 for (env = 0; env < ps->num_env; env++)
972 {
973 if (ps->iid_mode != 2 && ps->iid_mode != 5)
974 map20indexto34(ps->iid_index[env], 34);
975 if (ps->icc_mode != 2 && ps->icc_mode != 5)
976 map20indexto34(ps->icc_index[env], 34);
977 if (ps->ipd_mode != 2 && ps->ipd_mode != 5)
978 {
979 map20indexto34(ps->ipd_index[env], 17);
980 map20indexto34(ps->opd_index[env], 17);
981 }
982 }
983 }
984 #endif
985
986 #if 0
987 for (env = 0; env < ps->num_env; env++)
988 {
989 printf("iid[env:%d]:", env);
990 for (bin = 0; bin < 34; bin++)
991 {
992 printf(" %d", ps->iid_index[env][bin]);
993 }
994 printf("\n");
995 }
996 for (env = 0; env < ps->num_env; env++)
997 {
998 printf("icc[env:%d]:", env);
999 for (bin = 0; bin < 34; bin++)
1000 {
1001 printf(" %d", ps->icc_index[env][bin]);
1002 }
1003 printf("\n");
1004 }
1005 for (env = 0; env < ps->num_env; env++)
1006 {
1007 printf("ipd[env:%d]:", env);
1008 for (bin = 0; bin < 17; bin++)
1009 {
1010 printf(" %d", ps->ipd_index[env][bin]);
1011 }
1012 printf("\n");
1013 }
1014 for (env = 0; env < ps->num_env; env++)
1015 {
1016 printf("opd[env:%d]:", env);
1017 for (bin = 0; bin < 17; bin++)
1018 {
1019 printf(" %d", ps->opd_index[env][bin]);
1020 }
1021 printf("\n");
1022 }
1023 printf("\n");
1024 #endif
1025 }
1026
1027 /* decorrelate the mono signal using an allpass filter */
1028 static void ps_decorrelate(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64],
1029 qmf_t X_hybrid_left[32][32], qmf_t X_hybrid_right[32][32])
1030 {
1031 uint8_t gr, n, m, bk;
1032 uint8_t temp_delay;
1033 uint8_t sb, maxsb;
1034 const complex_t *Phi_Fract_SubQmf;
1035 uint8_t temp_delay_ser[NO_ALLPASS_LINKS];
1036 real_t P_SmoothPeakDecayDiffNrg, nrg;
1037 real_t P[32][34];
1038 real_t G_TransientRatio[32][34] = {{0}};
1039 complex_t inputLeft;
1040
1041
1042 /* chose hybrid filterbank: 20 or 34 band case */
1043 if (ps->use34hybrid_bands)
1044 {
1045 Phi_Fract_SubQmf = Phi_Fract_SubQmf34;
1046 } else{
1047 Phi_Fract_SubQmf = Phi_Fract_SubQmf20;
1048 }
1049
1050 /* clear the energy values */
1051 for (n = 0; n < 32; n++)
1052 {
1053 for (bk = 0; bk < 34; bk++)
1054 {
1055 P[n][bk] = 0;
1056 }
1057 }
1058
1059 /* calculate the energy in each parameter band b(k) */
1060 for (gr = 0; gr < ps->num_groups; gr++)
1061 {
1062 /* select the parameter index b(k) to which this group belongs */
1063 bk = (~NEGATE_IPD_MASK) & ps->map_group2bk[gr];
1064
1065 /* select the upper subband border for this group */
1066 maxsb = (gr < ps->num_hybrid_groups) ? ps->group_border[gr]+1 : ps->group_border[gr+1];
1067
1068 for (sb = ps->group_border[gr]; sb < maxsb; sb++)
1069 {
1070 for (n = ps->border_position[0]; n < ps->border_position[ps->num_env]; n++)
1071 {
1072 #ifdef FIXED_POINT
1073 uint32_t in_re, in_im;
1074 #endif
1075
1076 /* input from hybrid subbands or QMF subbands */
1077 if (gr < ps->num_hybrid_groups)
1078 {
1079 RE(inputLeft) = QMF_RE(X_hybrid_left[n][sb]);
1080 IM(inputLeft) = QMF_IM(X_hybrid_left[n][sb]);
1081 } else {
1082 RE(inputLeft) = QMF_RE(X_left[n][sb]);
1083 IM(inputLeft) = QMF_IM(X_left[n][sb]);
1084 }
1085
1086 /* accumulate energy */
1087 #ifdef FIXED_POINT
1088 /* NOTE: all input is scaled by 2^(-5) because of fixed point QMF
1089 * meaning that P will be scaled by 2^(-10) compared to floating point version
1090 */
1091 in_re = ((abs(RE(inputLeft))+(1<<(REAL_BITS-1)))>>REAL_BITS);
1092 in_im = ((abs(IM(inputLeft))+(1<<(REAL_BITS-1)))>>REAL_BITS);
1093 P[n][bk] += in_re*in_re + in_im*in_im;
1094 #else
1095 P[n][bk] += MUL_R(RE(inputLeft),RE(inputLeft)) + MUL_R(IM(inputLeft),IM(inputLeft));
1096 #endif
1097 }
1098 }
1099 }
1100
1101 #if 0
1102 for (n = 0; n < 32; n++)
1103 {
1104 for (bk = 0; bk < 34; bk++)
1105 {
1106 #ifdef FIXED_POINT
1107 printf("%d %d: %d\n", n, bk, P[n][bk] /*/(float)REAL_PRECISION*/);
1108 #else
1109 printf("%d %d: %f\n", n, bk, P[n][bk]/1024.0);
1110 #endif
1111 }
1112 }
1113 #endif
1114
1115 /* calculate transient reduction ratio for each parameter band b(k) */
1116 for (bk = 0; bk < ps->nr_par_bands; bk++)
1117 {
1118 for (n = ps->border_position[0]; n < ps->border_position[ps->num_env]; n++)
1119 {
1120 const real_t gamma = COEF_CONST(1.5);
1121
1122 ps->P_PeakDecayNrg[bk] = MUL_F(ps->P_PeakDecayNrg[bk], ps->alpha_decay);
1123 if (ps->P_PeakDecayNrg[bk] < P[n][bk])
1124 ps->P_PeakDecayNrg[bk] = P[n][bk];
1125
1126 /* apply smoothing filter to peak decay energy */
1127 P_SmoothPeakDecayDiffNrg = ps->P_SmoothPeakDecayDiffNrg_prev[bk];
1128 P_SmoothPeakDecayDiffNrg += MUL_F((ps->P_PeakDecayNrg[bk] - P[n][bk] - ps->P_SmoothPeakDecayDiffNrg_prev[bk]), ps->alpha_smooth);
1129 ps->P_SmoothPeakDecayDiffNrg_prev[bk] = P_SmoothPeakDecayDiffNrg;
1130
1131 /* apply smoothing filter to energy */
1132 nrg = ps->P_prev[bk];
1133 nrg += MUL_F((P[n][bk] - ps->P_prev[bk]), ps->alpha_smooth);
1134 ps->P_prev[bk] = nrg;
1135
1136 /* calculate transient ratio */
1137 if (MUL_C(P_SmoothPeakDecayDiffNrg, gamma) <= nrg)
1138 {
1139 G_TransientRatio[n][bk] = REAL_CONST(1.0);
1140 } else {
1141 G_TransientRatio[n][bk] = DIV_R(nrg, (MUL_C(P_SmoothPeakDecayDiffNrg, gamma)));
1142 }
1143 }
1144 }
1145
1146 #if 0
1147 for (n = 0; n < 32; n++)
1148 {
1149 for (bk = 0; bk < 34; bk++)
1150 {
1151 #ifdef FIXED_POINT
1152 printf("%d %d: %f\n", n, bk, G_TransientRatio[n][bk]/(float)REAL_PRECISION);
1153 #else
1154 printf("%d %d: %f\n", n, bk, G_TransientRatio[n][bk]);
1155 #endif
1156 }
1157 }
1158 #endif
1159
1160 /* apply stereo decorrelation filter to the signal */
1161 for (gr = 0; gr < ps->num_groups; gr++)
1162 {
1163 if (gr < ps->num_hybrid_groups)
1164 maxsb = ps->group_border[gr] + 1;
1165 else
1166 maxsb = ps->group_border[gr + 1];
1167
1168 /* QMF channel */
1169 for (sb = ps->group_border[gr]; sb < maxsb; sb++)
1170 {
1171 real_t g_DecaySlope;
1172 real_t g_DecaySlope_filt[NO_ALLPASS_LINKS];
1173
1174 /* g_DecaySlope: [0..1] */
1175 if (gr < ps->num_hybrid_groups || sb <= ps->decay_cutoff)
1176 {
1177 g_DecaySlope = FRAC_CONST(1.0);
1178 } else {
1179 int8_t decay = ps->decay_cutoff - sb;
1180 if (decay <= -20 /* -1/DECAY_SLOPE */)
1181 {
1182 g_DecaySlope = 0;
1183 } else {
1184 /* decay(int)*decay_slope(frac) = g_DecaySlope(frac) */
1185 g_DecaySlope = FRAC_CONST(1.0) + DECAY_SLOPE * decay;
1186 }
1187 }
1188
1189 /* calculate g_DecaySlope_filt for every m multiplied by filter_a[m] */
1190 for (m = 0; m < NO_ALLPASS_LINKS; m++)
1191 {
1192 g_DecaySlope_filt[m] = MUL_F(g_DecaySlope, filter_a[m]);
1193 }
1194
1195
1196 /* set delay indices */
1197 temp_delay = ps->saved_delay;
1198 for (n = 0; n < NO_ALLPASS_LINKS; n++)
1199 temp_delay_ser[n] = ps->delay_buf_index_ser[n];
1200
1201 for (n = ps->border_position[0]; n < ps->border_position[ps->num_env]; n++)
1202 {
1203 complex_t tmp, tmp0, R0;
1204
1205 if (gr < ps->num_hybrid_groups)
1206 {
1207 /* hybrid filterbank input */
1208 RE(inputLeft) = QMF_RE(X_hybrid_left[n][sb]);
1209 IM(inputLeft) = QMF_IM(X_hybrid_left[n][sb]);
1210 } else {
1211 /* QMF filterbank input */
1212 RE(inputLeft) = QMF_RE(X_left[n][sb]);
1213 IM(inputLeft) = QMF_IM(X_left[n][sb]);
1214 }
1215
1216 if (sb > ps->nr_allpass_bands && gr >= ps->num_hybrid_groups)
1217 {
1218 /* delay */
1219
1220 /* never hybrid subbands here, always QMF subbands */
1221 RE(tmp) = RE(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]);
1222 IM(tmp) = IM(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]);
1223 RE(R0) = RE(tmp);
1224 IM(R0) = IM(tmp);
1225 RE(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]) = RE(inputLeft);
1226 IM(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]) = IM(inputLeft);
1227 } else {
1228 /* allpass filter */
1229 uint8_t m;
1230 complex_t Phi_Fract;
1231
1232 /* fetch parameters */
1233 if (gr < ps->num_hybrid_groups)
1234 {
1235 /* select data from the hybrid subbands */
1236 RE(tmp0) = RE(ps->delay_SubQmf[temp_delay][sb]);
1237 IM(tmp0) = IM(ps->delay_SubQmf[temp_delay][sb]);
1238
1239 RE(ps->delay_SubQmf[temp_delay][sb]) = RE(inputLeft);
1240 IM(ps->delay_SubQmf[temp_delay][sb]) = IM(inputLeft);
1241
1242 RE(Phi_Fract) = RE(Phi_Fract_SubQmf[sb]);
1243 IM(Phi_Fract) = IM(Phi_Fract_SubQmf[sb]);
1244 } else {
1245 /* select data from the QMF subbands */
1246 RE(tmp0) = RE(ps->delay_Qmf[temp_delay][sb]);
1247 IM(tmp0) = IM(ps->delay_Qmf[temp_delay][sb]);
1248
1249 RE(ps->delay_Qmf[temp_delay][sb]) = RE(inputLeft);
1250 IM(ps->delay_Qmf[temp_delay][sb]) = IM(inputLeft);
1251
1252 RE(Phi_Fract) = RE(Phi_Fract_Qmf[sb]);
1253 IM(Phi_Fract) = IM(Phi_Fract_Qmf[sb]);
1254 }
1255
1256 /* z^(-2) * Phi_Fract[k] */
1257 ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
1258
1259 RE(R0) = RE(tmp);
1260 IM(R0) = IM(tmp);
1261 for (m = 0; m < NO_ALLPASS_LINKS; m++)
1262 {
1263 complex_t Q_Fract_allpass, tmp2;
1264
1265 /* fetch parameters */
1266 if (gr < ps->num_hybrid_groups)
1267 {
1268 /* select data from the hybrid subbands */
1269 RE(tmp0) = RE(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]);
1270 IM(tmp0) = IM(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]);
1271
1272 if (ps->use34hybrid_bands)
1273 {
1274 RE(Q_Fract_allpass) = RE(Q_Fract_allpass_SubQmf34[sb][m]);
1275 IM(Q_Fract_allpass) = IM(Q_Fract_allpass_SubQmf34[sb][m]);
1276 } else {
1277 RE(Q_Fract_allpass) = RE(Q_Fract_allpass_SubQmf20[sb][m]);
1278 IM(Q_Fract_allpass) = IM(Q_Fract_allpass_SubQmf20[sb][m]);
1279 }
1280 } else {
1281 /* select data from the QMF subbands */
1282 RE(tmp0) = RE(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]);
1283 IM(tmp0) = IM(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]);
1284
1285 RE(Q_Fract_allpass) = RE(Q_Fract_allpass_Qmf[sb][m]);
1286 IM(Q_Fract_allpass) = IM(Q_Fract_allpass_Qmf[sb][m]);
1287 }
1288
1289 /* delay by a fraction */
1290 /* z^(-d(m)) * Q_Fract_allpass[k,m] */
1291 ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Q_Fract_allpass), IM(Q_Fract_allpass));
1292
1293 /* -a(m) * g_DecaySlope[k] */
1294 RE(tmp) += -MUL_F(g_DecaySlope_filt[m], RE(R0));
1295 IM(tmp) += -MUL_F(g_DecaySlope_filt[m], IM(R0));
1296
1297 /* -a(m) * g_DecaySlope[k] * Q_Fract_allpass[k,m] * z^(-d(m)) */
1298 RE(tmp2) = RE(R0) + MUL_F(g_DecaySlope_filt[m], RE(tmp));
1299 IM(tmp2) = IM(R0) + MUL_F(g_DecaySlope_filt[m], IM(tmp));
1300
1301 /* store sample */
1302 if (gr < ps->num_hybrid_groups)
1303 {
1304 RE(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]) = RE(tmp2);
1305 IM(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]) = IM(tmp2);
1306 } else {
1307 RE(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]) = RE(tmp2);
1308 IM(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]) = IM(tmp2);
1309 }
1310
1311 /* store for next iteration (or as output value if last iteration) */
1312 RE(R0) = RE(tmp);
1313 IM(R0) = IM(tmp);
1314 }
1315 }
1316
1317 /* select b(k) for reading the transient ratio */
1318 bk = (~NEGATE_IPD_MASK) & ps->map_group2bk[gr];
1319
1320 /* duck if a past transient is found */
1321 RE(R0) = MUL_R(G_TransientRatio[n][bk], RE(R0));
1322 IM(R0) = MUL_R(G_TransientRatio[n][bk], IM(R0));
1323
1324 if (gr < ps->num_hybrid_groups)
1325 {
1326 /* hybrid */
1327 QMF_RE(X_hybrid_right[n][sb]) = RE(R0);
1328 QMF_IM(X_hybrid_right[n][sb]) = IM(R0);
1329 } else {
1330 /* QMF */
1331 QMF_RE(X_right[n][sb]) = RE(R0);
1332 QMF_IM(X_right[n][sb]) = IM(R0);
1333 }
1334
1335 /* Update delay buffer index */
1336 if (++temp_delay >= 2)
1337 {
1338 temp_delay = 0;
1339 }
1340
1341 /* update delay indices */
1342 if (sb > ps->nr_allpass_bands && gr >= ps->num_hybrid_groups)
1343 {
1344 /* delay_D depends on the samplerate, it can hold the values 14 and 1 */
1345 if (++ps->delay_buf_index_delay[sb] >= ps->delay_D[sb])
1346 {
1347 ps->delay_buf_index_delay[sb] = 0;
1348 }
1349 }
1350
1351 for (m = 0; m < NO_ALLPASS_LINKS; m++)
1352 {
1353 if (++temp_delay_ser[m] >= ps->num_sample_delay_ser[m])
1354 {
1355 temp_delay_ser[m] = 0;
1356 }
1357 }
1358 }
1359 }
1360 }
1361
1362 /* update delay indices */
1363 ps->saved_delay = temp_delay;
1364 for (m = 0; m < NO_ALLPASS_LINKS; m++)
1365 ps->delay_buf_index_ser[m] = temp_delay_ser[m];
1366 }
1367
1368 #ifdef FIXED_POINT
1369 #define step(shift) \
1370 if ((0x40000000l >> shift) + root <= value) \
1371 { \
1372 value -= (0x40000000l >> shift) + root; \
1373 root = (root >> 1) | (0x40000000l >> shift); \
1374 } else { \
1375 root = root >> 1; \
1376 }
1377
1378 /* fixed point square root approximation */
1379 static real_t ps_sqrt(real_t value)
1380 {
1381 real_t root = 0;
1382
1383 step( 0); step( 2); step( 4); step( 6);
1384 step( 8); step(10); step(12); step(14);
1385 step(16); step(18); step(20); step(22);
1386 step(24); step(26); step(28); step(30);
1387
1388 if (root < value)
1389 ++root;
1390
1391 root <<= (REAL_BITS/2);
1392
1393 return root;
1394 }
1395 #else
1396 #define ps_sqrt(A) sqrt(A)
1397 #endif
1398
1399 static const real_t ipdopd_cos_tab[] = {
1400 FRAC_CONST(1.000000000000000),
1401 FRAC_CONST(0.707106781186548),
1402 FRAC_CONST(0.000000000000000),
1403 FRAC_CONST(-0.707106781186547),
1404 FRAC_CONST(-1.000000000000000),
1405 FRAC_CONST(-0.707106781186548),
1406 FRAC_CONST(-0.000000000000000),
1407 FRAC_CONST(0.707106781186547),
1408 FRAC_CONST(1.000000000000000)
1409 };
1410
1411 static const real_t ipdopd_sin_tab[] = {
1412 FRAC_CONST(0.000000000000000),
1413 FRAC_CONST(0.707106781186547),
1414 FRAC_CONST(1.000000000000000),
1415 FRAC_CONST(0.707106781186548),
1416 FRAC_CONST(0.000000000000000),
1417 FRAC_CONST(-0.707106781186547),
1418 FRAC_CONST(-1.000000000000000),
1419 FRAC_CONST(-0.707106781186548),
1420 FRAC_CONST(-0.000000000000000)
1421 };
1422
1423 static real_t magnitude_c(complex_t c)
1424 {
1425 #ifdef FIXED_POINT
1426 #define ps_abs(A) (((A) > 0) ? (A) : (-(A)))
1427 #define ALPHA FRAC_CONST(0.948059448969)
1428 #define BETA FRAC_CONST(0.392699081699)
1429
1430 real_t abs_inphase = ps_abs(RE(c));
1431 real_t abs_quadrature = ps_abs(IM(c));
1432
1433 if (abs_inphase > abs_quadrature) {
1434 return MUL_F(abs_inphase, ALPHA) + MUL_F(abs_quadrature, BETA);
1435 } else {
1436 return MUL_F(abs_quadrature, ALPHA) + MUL_F(abs_inphase, BETA);
1437 }
1438 #else
1439 return sqrt(RE(c)*RE(c) + IM(c)*IM(c));
1440 #endif
1441 }
1442
1443 static void ps_mix_phase(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64],
1444 qmf_t X_hybrid_left[32][32], qmf_t X_hybrid_right[32][32])
1445 {
1446 uint8_t n;
1447 uint8_t gr;
1448 uint8_t bk = 0;
1449 uint8_t sb, maxsb;
1450 uint8_t env;
1451 uint8_t nr_ipdopd_par;
1452 complex_t h11, h12, h21, h22;
1453 complex_t H11, H12, H21, H22;
1454 complex_t deltaH11, deltaH12, deltaH21, deltaH22;
1455 complex_t tempLeft;
1456 complex_t tempRight;
1457 complex_t phaseLeft;
1458 complex_t phaseRight;
1459 real_t L;
1460 const real_t *sf_iid;
1461 uint8_t no_iid_steps;
1462
1463 if (ps->iid_mode >= 3)
1464 {
1465 no_iid_steps = 15;
1466 sf_iid = sf_iid_fine;
1467 } else {
1468 no_iid_steps = 7;
1469 sf_iid = sf_iid_normal;
1470 }
1471
1472 if (ps->ipd_mode == 0 || ps->ipd_mode == 3)
1473 {
1474 nr_ipdopd_par = 11; /* resolution */
1475 } else {
1476 nr_ipdopd_par = ps->nr_ipdopd_par;
1477 }
1478
1479 for (gr = 0; gr < ps->num_groups; gr++)
1480 {
1481 bk = (~NEGATE_IPD_MASK) & ps->map_group2bk[gr];
1482
1483 /* use one channel per group in the subqmf domain */
1484 maxsb = (gr < ps->num_hybrid_groups) ? ps->group_border[gr] + 1 : ps->group_border[gr + 1];
1485
1486 for (env = 0; env < ps->num_env; env++)
1487 {
1488 if (ps->icc_mode < 3)
1489 {
1490 /* type 'A' mixing as described in 8.6.4.6.2.1 */
1491 real_t c_1, c_2;
1492 real_t cosa, sina;
1493 real_t cosb, sinb;
1494 real_t ab1, ab2;
1495 real_t ab3, ab4;
1496
1497 /*
1498 c_1 = sqrt(2.0 / (1.0 + pow(10.0, quant_iid[no_iid_steps + iid_index] / 10.0)));
1499 c_2 = sqrt(2.0 / (1.0 + pow(10.0, quant_iid[no_iid_steps - iid_index] / 10.0)));
1500 alpha = 0.5 * acos(quant_rho[icc_index]);
1501 beta = alpha * ( c_1 - c_2 ) / sqrt(2.0);
1502 */
1503
1504 //printf("%d\n", ps->iid_index[env][bk]);
1505
1506 /* calculate the scalefactors c_1 and c_2 from the intensity differences */
1507 c_1 = sf_iid[no_iid_steps + ps->iid_index[env][bk]];
1508 c_2 = sf_iid[no_iid_steps - ps->iid_index[env][bk]];
1509
1510 /* calculate alpha and beta using the ICC parameters */
1511 cosa = cos_alphas[ps->icc_index[env][bk]];
1512 sina = sin_alphas[ps->icc_index[env][bk]];
1513
1514 if (ps->iid_mode >= 3)
1515 {
1516 if (ps->iid_index[env][bk] < 0)
1517 {
1518 cosb = cos_betas_fine[-ps->iid_index[env][bk]][ps->icc_index[env][bk]];
1519 sinb = -sin_betas_fine[-ps->iid_index[env][bk]][ps->icc_index[env][bk]];
1520 } else {
1521 cosb = cos_betas_fine[ps->iid_index[env][bk]][ps->icc_index[env][bk]];
1522 sinb = sin_betas_fine[ps->iid_index[env][bk]][ps->icc_index[env][bk]];
1523 }
1524 } else {
1525 if (ps->iid_index[env][bk] < 0)
1526 {
1527 cosb = cos_betas_normal[-ps->iid_index[env][bk]][ps->icc_index[env][bk]];
1528 sinb = -sin_betas_normal[-ps->iid_index[env][bk]][ps->icc_index[env][bk]];
1529 } else {
1530 cosb = cos_betas_normal[ps->iid_index[env][bk]][ps->icc_index[env][bk]];
1531 sinb = sin_betas_normal[ps->iid_index[env][bk]][ps->icc_index[env][bk]];
1532 }
1533 }
1534
1535 ab1 = MUL_C(cosb, cosa);
1536 ab2 = MUL_C(sinb, sina);
1537 ab3 = MUL_C(sinb, cosa);
1538 ab4 = MUL_C(cosb, sina);
1539
1540 /* h_xy: COEF */
1541 RE(h11) = MUL_C(c_2, (ab1 - ab2));
1542 RE(h12) = MUL_C(c_1, (ab1 + ab2));
1543 RE(h21) = MUL_C(c_2, (ab3 + ab4));
1544 RE(h22) = MUL_C(c_1, (ab3 - ab4));
1545 } else {
1546 /* type 'B' mixing as described in 8.6.4.6.2.2 */
1547 real_t sina, cosa;
1548 real_t cosg, sing;
1549
1550 /*
1551 real_t c, rho, mu, alpha, gamma;
1552 uint8_t i;
1553
1554 i = ps->iid_index[env][bk];
1555 c = (real_t)pow(10.0, ((i)?(((i>0)?1:-1)*quant_iid[((i>0)?i:-i)-1]):0.)/20.0);
1556 rho = quant_rho[ps->icc_index[env][bk]];
1557
1558 if (rho == 0.0f && c == 1.)
1559 {
1560 alpha = (real_t)M_PI/4.0f;
1561 rho = 0.05f;
1562 } else {
1563 if (rho <= 0.05f)
1564 {
1565 rho = 0.05f;
1566 }
1567 alpha = 0.5f*(real_t)atan( (2.0f*c*rho) / (c*c-1.0f) );
1568
1569 if (alpha < 0.)
1570 {
1571 alpha += (real_t)M_PI/2.0f;
1572 }
1573 if (rho < 0.)
1574 {
1575 alpha += (real_t)M_PI;
1576 }
1577 }
1578 mu = c+1.0f/c;
1579 mu = 1+(4.0f*rho*rho-4.0f)/(mu*mu);
1580 gamma = (real_t)atan(sqrt((1.0f-sqrt(mu))/(1.0f+sqrt(mu))));
1581 */
1582
1583 if (ps->iid_mode >= 3)
1584 {
1585 uint8_t abs_iid = abs(ps->iid_index[env][bk]);
1586
1587 cosa = sincos_alphas_B_fine[no_iid_steps + ps->iid_index[env][bk]][ps->icc_index[env][bk]];
1588 sina = sincos_alphas_B_fine[30 - (no_iid_steps + ps->iid_index[env][bk])][ps->icc_index[env][bk]];
1589 cosg = cos_gammas_fine[abs_iid][ps->icc_index[env][bk]];
1590 sing = sin_gammas_fine[abs_iid][ps->icc_index[env][bk]];
1591 } else {
1592 uint8_t abs_iid = abs(ps->iid_index[env][bk]);
1593
1594 cosa = sincos_alphas_B_normal[no_iid_steps + ps->iid_index[env][bk]][ps->icc_index[env][bk]];
1595 sina = sincos_alphas_B_normal[14 - (no_iid_steps + ps->iid_index[env][bk])][ps->icc_index[env][bk]];
1596 cosg = cos_gammas_normal[abs_iid][ps->icc_index[env][bk]];
1597 sing = sin_gammas_normal[abs_iid][ps->icc_index[env][bk]];
1598 }
1599
1600 RE(h11) = MUL_C(COEF_SQRT2, MUL_C(cosa, cosg));
1601 RE(h12) = MUL_C(COEF_SQRT2, MUL_C(sina, cosg));
1602 RE(h21) = MUL_C(COEF_SQRT2, MUL_C(-cosa, sing));
1603 RE(h22) = MUL_C(COEF_SQRT2, MUL_C(sina, sing));
1604 }
1605
1606 /* calculate phase rotation parameters H_xy */
1607 /* note that the imaginary part of these parameters are only calculated when
1608 IPD and OPD are enabled
1609 */
1610 if ((ps->enable_ipdopd) && (bk < nr_ipdopd_par))
1611 {
1612 int8_t i;
1613 real_t xy, pq, xypq;
1614
1615 /* ringbuffer index */
1616 i = ps->phase_hist;
1617
1618 /* previous value */
1619 #ifdef FIXED_POINT
1620 /* divide by 4, shift right 2 bits */
1621 RE(tempLeft) = RE(ps->ipd_prev[bk][i]) >> 2;
1622 IM(tempLeft) = IM(ps->ipd_prev[bk][i]) >> 2;
1623 RE(tempRight) = RE(ps->opd_prev[bk][i]) >> 2;
1624 IM(tempRight) = IM(ps->opd_prev[bk][i]) >> 2;
1625 #else
1626 RE(tempLeft) = MUL_F(RE(ps->ipd_prev[bk][i]), FRAC_CONST(0.25));
1627 IM(tempLeft) = MUL_F(IM(ps->ipd_prev[bk][i]), FRAC_CONST(0.25));
1628 RE(tempRight) = MUL_F(RE(ps->opd_prev[bk][i]), FRAC_CONST(0.25));
1629 IM(tempRight) = MUL_F(IM(ps->opd_prev[bk][i]), FRAC_CONST(0.25));
1630 #endif
1631
1632 /* save current value */
1633 RE(ps->ipd_prev[bk][i]) = ipdopd_cos_tab[abs(ps->ipd_index[env][bk])];
1634 IM(ps->ipd_prev[bk][i]) = ipdopd_sin_tab[abs(ps->ipd_index[env][bk])];
1635 RE(ps->opd_prev[bk][i]) = ipdopd_cos_tab[abs(ps->opd_index[env][bk])];
1636 IM(ps->opd_prev[bk][i]) = ipdopd_sin_tab[abs(ps->opd_index[env][bk])];
1637
1638 /* add current value */
1639 RE(tempLeft) += RE(ps->ipd_prev[bk][i]);
1640 IM(tempLeft) += IM(ps->ipd_prev[bk][i]);
1641 RE(tempRight) += RE(ps->opd_prev[bk][i]);
1642 IM(tempRight) += IM(ps->opd_prev[bk][i]);
1643
1644 /* ringbuffer index */
1645 if (i == 0)
1646 {
1647 i = 2;
1648 }
1649 i--;
1650
1651 /* get value before previous */
1652 #ifdef FIXED_POINT
1653 /* dividing by 2, shift right 1 bit */
1654 RE(tempLeft) += (RE(ps->ipd_prev[bk][i]) >> 1);
1655 IM(tempLeft) += (IM(ps->ipd_prev[bk][i]) >> 1);
1656 RE(tempRight) += (RE(ps->opd_prev[bk][i]) >> 1);
1657 IM(tempRight) += (IM(ps->opd_prev[bk][i]) >> 1);
1658 #else
1659 RE(tempLeft) += MUL_F(RE(ps->ipd_prev[bk][i]), FRAC_CONST(0.5));
1660 IM(tempLeft) += MUL_F(IM(ps->ipd_prev[bk][i]), FRAC_CONST(0.5));
1661 RE(tempRight) += MUL_F(RE(ps->opd_prev[bk][i]), FRAC_CONST(0.5));
1662 IM(tempRight) += MUL_F(IM(ps->opd_prev[bk][i]), FRAC_CONST(0.5));
1663 #endif
1664
1665 #if 0 /* original code */
1666 ipd = (float)atan2(IM(tempLeft), RE(tempLeft));
1667 opd = (float)atan2(IM(tempRight), RE(tempRight));
1668
1669 /* phase rotation */
1670 RE(phaseLeft) = (float)cos(opd);
1671 IM(phaseLeft) = (float)sin(opd);
1672 opd -= ipd;
1673 RE(phaseRight) = (float)cos(opd);
1674 IM(phaseRight) = (float)sin(opd);
1675 #else
1676
1677 // x = IM(tempLeft)
1678 // y = RE(tempLeft)
1679 // p = IM(tempRight)
1680 // q = RE(tempRight)
1681 // cos(atan2(x,y)) = y/sqrt((x*x) + (y*y))
1682 // sin(atan2(x,y)) = x/sqrt((x*x) + (y*y))
1683 // cos(atan2(x,y)-atan2(p,q)) = (y*q + x*p) / ( sqrt((x*x) + (y*y)) * sqrt((p*p) + (q*q)) );
1684 // sin(atan2(x,y)-atan2(p,q)) = (x*q - y*p) / ( sqrt((x*x) + (y*y)) * sqrt((p*p) + (q*q)) );
1685
1686 xy = magnitude_c(tempRight);
1687 pq = magnitude_c(tempLeft);
1688
1689 if (xy != 0)
1690 {
1691 RE(phaseLeft) = DIV_R(RE(tempRight), xy);
1692 IM(phaseLeft) = DIV_R(IM(tempRight), xy);
1693 } else {
1694 RE(phaseLeft) = 0;
1695 IM(phaseLeft) = 0;
1696 }
1697
1698 xypq = MUL_R(xy, pq);
1699
1700 if (xypq != 0)
1701 {
1702 real_t tmp1 = MUL_R(RE(tempRight), RE(tempLeft)) + MUL_R(IM(tempRight), IM(tempLeft));
1703 real_t tmp2 = MUL_R(IM(tempRight), RE(tempLeft)) - MUL_R(RE(tempRight), IM(tempLeft));
1704
1705 RE(phaseRight) = DIV_R(tmp1, xypq);
1706 IM(phaseRight) = DIV_R(tmp2, xypq);
1707 } else {
1708 RE(phaseRight) = 0;
1709 IM(phaseRight) = 0;
1710 }
1711
1712 #endif
1713
1714 /* MUL_F(COEF, REAL) = COEF */
1715 IM(h11) = MUL_R(RE(h11), IM(phaseLeft));
1716 IM(h12) = MUL_R(RE(h12), IM(phaseRight));
1717 IM(h21) = MUL_R(RE(h21), IM(phaseLeft));
1718 IM(h22) = MUL_R(RE(h22), IM(phaseRight));
1719
1720 RE(h11) = MUL_R(RE(h11), RE(phaseLeft));
1721 RE(h12) = MUL_R(RE(h12), RE(phaseRight));
1722 RE(h21) = MUL_R(RE(h21), RE(phaseLeft));
1723 RE(h22) = MUL_R(RE(h22), RE(phaseRight));
1724 }
1725
1726 /* length of the envelope n_e+1 - n_e (in time samples) */
1727 /* 0 < L <= 32: integer */
1728 L = (real_t)(ps->border_position[env + 1] - ps->border_position[env]);
1729
1730 /* obtain final H_xy by means of linear interpolation */
1731 RE(deltaH11) = (RE(h11) - RE(ps->h11_prev[gr])) / L;
1732 RE(deltaH12) = (RE(h12) - RE(ps->h12_prev[gr])) / L;
1733 RE(deltaH21) = (RE(h21) - RE(ps->h21_prev[gr])) / L;
1734 RE(deltaH22) = (RE(h22) - RE(ps->h22_prev[gr])) / L;
1735
1736 RE(H11) = RE(ps->h11_prev[gr]);
1737 RE(H12) = RE(ps->h12_prev[gr]);
1738 RE(H21) = RE(ps->h21_prev[gr]);
1739 RE(H22) = RE(ps->h22_prev[gr]);
1740
1741 RE(ps->h11_prev[gr]) = RE(h11);
1742 RE(ps->h12_prev[gr]) = RE(h12);
1743 RE(ps->h21_prev[gr]) = RE(h21);
1744 RE(ps->h22_prev[gr]) = RE(h22);
1745
1746 /* only calculate imaginary part when needed */
1747 if ((ps->enable_ipdopd) && (bk < nr_ipdopd_par))
1748 {
1749 /* obtain final H_xy by means of linear interpolation */
1750 IM(deltaH11) = (IM(h11) - IM(ps->h11_prev[gr])) / L;
1751 IM(deltaH12) = (IM(h12) - IM(ps->h12_prev[gr])) / L;
1752 IM(deltaH21) = (IM(h21) - IM(ps->h21_prev[gr])) / L;
1753 IM(deltaH22) = (IM(h22) - IM(ps->h22_prev[gr])) / L;
1754
1755 IM(H11) = IM(ps->h11_prev[gr]);
1756 IM(H12) = IM(ps->h12_prev[gr]);
1757 IM(H21) = IM(ps->h21_prev[gr]);
1758 IM(H22) = IM(ps->h22_prev[gr]);
1759
1760 if ((NEGATE_IPD_MASK & ps->map_group2bk[gr]) != 0)
1761 {
1762 IM(deltaH11) = -IM(deltaH11);
1763 IM(deltaH12) = -IM(deltaH12);
1764 IM(deltaH21) = -IM(deltaH21);
1765 IM(deltaH22) = -IM(deltaH22);
1766
1767 IM(H11) = -IM(H11);
1768 IM(H12) = -IM(H12);
1769 IM(H21) = -IM(H21);
1770 IM(H22) = -IM(H22);
1771 }
1772
1773 IM(ps->h11_prev[gr]) = IM(h11);
1774 IM(ps->h12_prev[gr]) = IM(h12);
1775 IM(ps->h21_prev[gr]) = IM(h21);
1776 IM(ps->h22_prev[gr]) = IM(h22);
1777 }
1778
1779 /* apply H_xy to the current envelope band of the decorrelated subband */
1780 for (n = ps->border_position[env]; n < ps->border_position[env + 1]; n++)
1781 {
1782 /* addition finalises the interpolation over every n */
1783 RE(H11) += RE(deltaH11);
1784 RE(H12) += RE(deltaH12);
1785 RE(H21) += RE(deltaH21);
1786 RE(H22) += RE(deltaH22);
1787 if ((ps->enable_ipdopd) && (bk < nr_ipdopd_par))
1788 {
1789 IM(H11) += IM(deltaH11);
1790 IM(H12) += IM(deltaH12);
1791 IM(H21) += IM(deltaH21);
1792 IM(H22) += IM(deltaH22);
1793 }
1794
1795 /* channel is an alias to the subband */
1796 for (sb = ps->group_border[gr]; sb < maxsb; sb++)
1797 {
1798 complex_t inLeft, inRight;
1799
1800 /* load decorrelated samples */
1801 if (gr < ps->num_hybrid_groups)
1802 {
1803 RE(inLeft) = RE(X_hybrid_left[n][sb]);
1804 IM(inLeft) = IM(X_hybrid_left[n][sb]);
1805 RE(inRight) = RE(X_hybrid_right[n][sb]);
1806 IM(inRight) = IM(X_hybrid_right[n][sb]);
1807 } else {
1808 RE(inLeft) = RE(X_left[n][sb]);
1809 IM(inLeft) = IM(X_left[n][sb]);
1810 RE(inRight) = RE(X_right[n][sb]);
1811 IM(inRight) = IM(X_right[n][sb]);
1812 }
1813
1814 /* apply mixing */
1815 RE(tempLeft) = MUL_C(RE(H11), RE(inLeft)) + MUL_C(RE(H21), RE(inRight));
1816 IM(tempLeft) = MUL_C(RE(H11), IM(inLeft)) + MUL_C(RE(H21), IM(inRight));
1817 RE(tempRight) = MUL_C(RE(H12), RE(inLeft)) + MUL_C(RE(H22), RE(inRight));
1818 IM(tempRight) = MUL_C(RE(H12), IM(inLeft)) + MUL_C(RE(H22), IM(inRight));
1819
1820 /* only perform imaginary operations when needed */
1821 if ((ps->enable_ipdopd) && (bk < nr_ipdopd_par))
1822 {
1823 /* apply rotation */
1824 RE(tempLeft) -= MUL_C(IM(H11), IM(inLeft)) + MUL_C(IM(H21), IM(inRight));
1825 IM(tempLeft) += MUL_C(IM(H11), RE(inLeft)) + MUL_C(IM(H21), RE(inRight));
1826 RE(tempRight) -= MUL_C(IM(H12), IM(inLeft)) + MUL_C(IM(H22), IM(inRight));
1827 IM(tempRight) += MUL_C(IM(H12), RE(inLeft)) + MUL_C(IM(H22), RE(inRight));
1828 }
1829
1830 /* store final samples */
1831 if (gr < ps->num_hybrid_groups)
1832 {
1833 RE(X_hybrid_left[n][sb]) = RE(tempLeft);
1834 IM(X_hybrid_left[n][sb]) = IM(tempLeft);
1835 RE(X_hybrid_right[n][sb]) = RE(tempRight);
1836 IM(X_hybrid_right[n][sb]) = IM(tempRight);
1837 } else {
1838 RE(X_left[n][sb]) = RE(tempLeft);
1839 IM(X_left[n][sb]) = IM(tempLeft);
1840 RE(X_right[n][sb]) = RE(tempRight);
1841 IM(X_right[n][sb]) = IM(tempRight);
1842 }
1843 }
1844 }
1845
1846 /* shift phase smoother's circular buffer index */
1847 ps->phase_hist++;
1848 if (ps->phase_hist == 2)
1849 {
1850 ps->phase_hist = 0;
1851 }
1852 }
1853 }
1854 }
1855
1856 void ps_free(ps_info *ps)
1857 {
1858 /* free hybrid filterbank structures */
1859 hybrid_free(ps->hyb);
1860
1861 faad_free(ps);
1862 }
1863
1864 ps_info *ps_init(uint8_t sr_index)
1865 {
1866 uint8_t i;
1867 uint8_t short_delay_band;
1868
1869 ps_info *ps = (ps_info*)faad_malloc(sizeof(ps_info));
1870 memset(ps, 0, sizeof(ps_info));
1871
1872 ps->hyb = hybrid_init();
1873
1874 ps->ps_data_available = 0;
1875
1876 /* delay stuff*/
1877 ps->saved_delay = 0;
1878
1879 for (i = 0; i < 64; i++)
1880 {
1881 ps->delay_buf_index_delay[i] = 0;
1882 }
1883
1884 for (i = 0; i < NO_ALLPASS_LINKS; i++)
1885 {
1886 ps->delay_buf_index_ser[i] = 0;
1887 #ifdef PARAM_32KHZ
1888 if (sr_index <= 5) /* >= 32 kHz*/
1889 {
1890 ps->num_sample_delay_ser[i] = delay_length_d[1][i];
1891 } else {
1892 ps->num_sample_delay_ser[i] = delay_length_d[0][i];
1893 }
1894 #else
1895 /* THESE ARE CONSTANTS NOW */
1896 ps->num_sample_delay_ser[i] = delay_length_d[i];
1897 #endif
1898 }
1899
1900 #ifdef PARAM_32KHZ
1901 if (sr_index <= 5) /* >= 32 kHz*/
1902 {
1903 short_delay_band = 35;
1904 ps->nr_allpass_bands = 22;
1905 ps->alpha_decay = FRAC_CONST(0.76592833836465);
1906 ps->alpha_smooth = FRAC_CONST(0.25);
1907 } else {
1908 short_delay_band = 64;
1909 ps->nr_allpass_bands = 45;
1910 ps->alpha_decay = FRAC_CONST(0.58664621951003);
1911 ps->alpha_smooth = FRAC_CONST(0.6);
1912 }
1913 #else
1914 /* THESE ARE CONSTANTS NOW */
1915 short_delay_band = 35;
1916 ps->nr_allpass_bands = 22;
1917 ps->alpha_decay = FRAC_CONST(0.76592833836465);
1918 ps->alpha_smooth = FRAC_CONST(0.25);
1919 #endif
1920
1921 /* THESE ARE CONSTANT NOW IF PS IS INDEPENDANT OF SAMPLERATE */
1922 for (i = 0; i < short_delay_band; i++)
1923 {
1924 ps->delay_D[i] = 14;
1925 }
1926 for (i = short_delay_band; i < 64; i++)
1927 {
1928 ps->delay_D[i] = 1;
1929 }
1930
1931 /* mixing and phase */
1932 for (i = 0; i < 50; i++)
1933 {
1934 RE(ps->h11_prev[i]) = 1;
1935 IM(ps->h12_prev[i]) = 1;
1936 RE(ps->h11_prev[i]) = 1;
1937 IM(ps->h12_prev[i]) = 1;
1938 }
1939
1940 ps->phase_hist = 0;
1941
1942 for (i = 0; i < 20; i++)
1943 {
1944 RE(ps->ipd_prev[i][0]) = 0;
1945 IM(ps->ipd_prev[i][0]) = 0;
1946 RE(ps->ipd_prev[i][1]) = 0;
1947 IM(ps->ipd_prev[i][1]) = 0;
1948 RE(ps->opd_prev[i][0]) = 0;
1949 IM(ps->opd_prev[i][0]) = 0;
1950 RE(ps->opd_prev[i][1]) = 0;
1951 IM(ps->opd_prev[i][1]) = 0;
1952 }
1953
1954 return ps;
1955 }
1956
1957 /* main Parametric Stereo decoding function */
1958 uint8_t ps_decode(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64])
1959 {
1960 qmf_t X_hybrid_left[32][32] = {{0}};
1961 qmf_t X_hybrid_right[32][32] = {{0}};
1962
1963 /* delta decoding of the bitstream data */
1964 ps_data_decode(ps);
1965
1966 /* set up some parameters depending on filterbank type */
1967 if (ps->use34hybrid_bands)
1968 {
1969 ps->group_border = (uint8_t*)group_border34;
1970 ps->map_group2bk = (uint16_t*)map_group2bk34;
1971 ps->num_groups = 32+18;
1972 ps->num_hybrid_groups = 32;
1973 ps->nr_par_bands = 34;
1974 ps->decay_cutoff = 5;
1975 } else {
1976 ps->group_border = (uint8_t*)group_border20;
1977 ps->map_group2bk = (uint16_t*)map_group2bk20;
1978 ps->num_groups = 10+12;
1979 ps->num_hybrid_groups = 10;
1980 ps->nr_par_bands = 20;
1981 ps->decay_cutoff = 3;
1982 }
1983
1984 /* Perform further analysis on the lowest subbands to get a higher
1985 * frequency resolution
1986 */
1987 hybrid_analysis((hyb_info*)ps->hyb, X_left, X_hybrid_left,
1988 ps->use34hybrid_bands);
1989
1990 /* decorrelate mono signal */
1991 ps_decorrelate(ps, X_left, X_right, X_hybrid_left, X_hybrid_right);
1992
1993 /* apply mixing and phase parameters */
1994 ps_mix_phase(ps, X_left, X_right, X_hybrid_left, X_hybrid_right);
1995
1996 /* hybrid synthesis, to rebuild the SBR QMF matrices */
1997 hybrid_synthesis((hyb_info*)ps->hyb, X_left, X_hybrid_left,
1998 ps->use34hybrid_bands);
1999
2000 hybrid_synthesis((hyb_info*)ps->hyb, X_right, X_hybrid_right,
2001 ps->use34hybrid_bands);
2002
2003 return 0;
2004 }
2005
2006 #endif
2007
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: ps_dec.h,v 1.12 2007/11/01 12:33:33 menno Exp $
28 **/
29
30 #ifndef __PS_DEC_H__
31 #define __PS_DEC_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #include "bits.h"
38
39 #define EXTENSION_ID_PS 2
40
41 #define MAX_PS_ENVELOPES 5
42 #define NO_ALLPASS_LINKS 3
43
44 typedef struct
45 {
46 /* bitstream parameters */
47 uint8_t enable_iid;
48 uint8_t enable_icc;
49 uint8_t enable_ext;
50
51 uint8_t iid_mode;
52 uint8_t icc_mode;
53 uint8_t nr_iid_par;
54 uint8_t nr_ipdopd_par;
55 uint8_t nr_icc_par;
56
57 uint8_t frame_class;
58 uint8_t num_env;
59
60 uint8_t border_position[MAX_PS_ENVELOPES+1];
61
62 uint8_t iid_dt[MAX_PS_ENVELOPES];
63 uint8_t icc_dt[MAX_PS_ENVELOPES];
64
65 uint8_t enable_ipdopd;
66 uint8_t ipd_mode;
67 uint8_t ipd_dt[MAX_PS_ENVELOPES];
68 uint8_t opd_dt[MAX_PS_ENVELOPES];
69
70 /* indices */
71 int8_t iid_index_prev[34];
72 int8_t icc_index_prev[34];
73 int8_t ipd_index_prev[17];
74 int8_t opd_index_prev[17];
75 int8_t iid_index[MAX_PS_ENVELOPES][34];
76 int8_t icc_index[MAX_PS_ENVELOPES][34];
77 int8_t ipd_index[MAX_PS_ENVELOPES][17];
78 int8_t opd_index[MAX_PS_ENVELOPES][17];
79
80 int8_t ipd_index_1[17];
81 int8_t opd_index_1[17];
82 int8_t ipd_index_2[17];
83 int8_t opd_index_2[17];
84
85 /* ps data was correctly read */
86 uint8_t ps_data_available;
87
88 /* a header has been read */
89 uint8_t header_read;
90
91 /* hybrid filterbank parameters */
92 void *hyb;
93 uint8_t use34hybrid_bands;
94
95 /**/
96 uint8_t num_groups;
97 uint8_t num_hybrid_groups;
98 uint8_t nr_par_bands;
99 uint8_t nr_allpass_bands;
100 uint8_t decay_cutoff;
101
102 uint8_t *group_border;
103 uint16_t *map_group2bk;
104
105 /* filter delay handling */
106 uint8_t saved_delay;
107 uint8_t delay_buf_index_ser[NO_ALLPASS_LINKS];
108 uint8_t num_sample_delay_ser[NO_ALLPASS_LINKS];
109 uint8_t delay_D[64];
110 uint8_t delay_buf_index_delay[64];
111
112 complex_t delay_Qmf[14][64]; /* 14 samples delay max, 64 QMF channels */
113 complex_t delay_SubQmf[2][32]; /* 2 samples delay max (SubQmf is always allpass filtered) */
114 complex_t delay_Qmf_ser[NO_ALLPASS_LINKS][5][64]; /* 5 samples delay max (table 8.34), 64 QMF channels */
115 complex_t delay_SubQmf_ser[NO_ALLPASS_LINKS][5][32]; /* 5 samples delay max (table 8.34) */
116
117 /* transients */
118 real_t alpha_decay;
119 real_t alpha_smooth;
120
121 real_t P_PeakDecayNrg[34];
122 real_t P_prev[34];
123 real_t P_SmoothPeakDecayDiffNrg_prev[34];
124
125 /* mixing and phase */
126 complex_t h11_prev[50];
127 complex_t h12_prev[50];
128 complex_t h21_prev[50];
129 complex_t h22_prev[50];
130 uint8_t phase_hist;
131 complex_t ipd_prev[20][2];
132 complex_t opd_prev[20][2];
133
134 } ps_info;
135
136 /* ps_syntax.c */
137 uint16_t ps_data(ps_info *ps, bitfile *ld, uint8_t *header);
138
139 /* ps_dec.c */
140 ps_info *ps_init(uint8_t sr_index);
141 void ps_free(ps_info *ps);
142
143 uint8_t ps_decode(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64]);
144
145
146 #ifdef __cplusplus
147 }
148 #endif
149 #endif
150
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: ps_syntax.c,v 1.11 2007/11/01 12:33:33 menno Exp $
28 **/
29
30 #include "common.h"
31
32 #ifdef PS_DEC
33
34 #include "bits.h"
35 #include "ps_dec.h"
36
37 /* type definitaions */
38 typedef const int8_t (*ps_huff_tab)[2];
39
40 /* static data tables */
41 static const uint8_t nr_iid_par_tab[] = {
42 10, 20, 34, 10, 20, 34, 0, 0
43 };
44 static const uint8_t nr_ipdopd_par_tab[] = {
45 5, 11, 17, 5, 11, 17, 0, 0
46 };
47 static const uint8_t nr_icc_par_tab[] = {
48 10, 20, 34, 10, 20, 34, 0, 0
49 };
50 static const uint8_t num_env_tab[][4] = {
51 { 0, 1, 2, 4 },
52 { 1, 2, 3, 4 }
53 };
54
55 /* binary lookup huffman tables */
56 static const int8_t f_huff_iid_def[][2] = {
57 { /*0*/ -31, 1 }, /* index 0: 1 bits: x */
58 { 2, 3 }, /* index 1: 2 bits: 1x */
59 { /*1*/ -30, /*-1*/ -32 }, /* index 2: 3 bits: 10x */
60 { 4, 5 }, /* index 3: 3 bits: 11x */
61 { /*2*/ -29, /*-2*/ -33 }, /* index 4: 4 bits: 110x */
62 { 6, 7 }, /* index 5: 4 bits: 111x */
63 { /*3*/ -28, /*-3*/ -34 }, /* index 6: 5 bits: 1110x */
64 { 8, 9 }, /* index 7: 5 bits: 1111x */
65 { /*-4*/ -35, /*4*/ -27 }, /* index 8: 6 bits: 11110x */
66 { /*5*/ -26, 10 }, /* index 9: 6 bits: 11111x */
67 { /*-5*/ -36, 11 }, /* index 10: 7 bits: 111111x */
68 { /*6*/ -25, 12 }, /* index 11: 8 bits: 1111111x */
69 { /*-6*/ -37, 13 }, /* index 12: 9 bits: 11111111x */
70 { /*-7*/ -38, 14 }, /* index 13: 10 bits: 111111111x */
71 { /*7*/ -24, 15 }, /* index 14: 11 bits: 1111111111x */
72 { 16, 17 }, /* index 15: 12 bits: 11111111111x */
73 { /*8*/ -23, /*-8*/ -39 }, /* index 16: 13 bits: 111111111110x */
74 { 18, 19 }, /* index 17: 13 bits: 111111111111x */
75 { /*9*/ -22, /*10*/ -21 }, /* index 18: 14 bits: 1111111111110x */
76 { 20, 21 }, /* index 19: 14 bits: 1111111111111x */
77 { /*-9*/ -40, /*11*/ -20 }, /* index 20: 15 bits: 11111111111110x */
78 { 22, 23 }, /* index 21: 15 bits: 11111111111111x */
79 { /*-10*/ -41, 24 }, /* index 22: 16 bits: 111111111111110x */
80 { 25, 26 }, /* index 23: 16 bits: 111111111111111x */
81 { /*-11*/ -42, /*-14*/ -45 }, /* index 24: 17 bits: 1111111111111101x */
82 { /*-13*/ -44, /*-12*/ -43 }, /* index 25: 17 bits: 1111111111111110x */
83 { /*12*/ -19, 27 }, /* index 26: 17 bits: 1111111111111111x */
84 { /*13*/ -18, /*14*/ -17 } /* index 27: 18 bits: 11111111111111111x */
85 };
86
87 static const int8_t t_huff_iid_def[][2] = {
88 { /*0*/ -31, 1 }, /* index 0: 1 bits: x */
89 { /*-1*/ -32, 2 }, /* index 1: 2 bits: 1x */
90 { /*1*/ -30, 3 }, /* index 2: 3 bits: 11x */
91 { /*-2*/ -33, 4 }, /* index 3: 4 bits: 111x */
92 { /*2*/ -29, 5 }, /* index 4: 5 bits: 1111x */
93 { /*-3*/ -34, 6 }, /* index 5: 6 bits: 11111x */
94 { /*3*/ -28, 7 }, /* index 6: 7 bits: 111111x */
95 { /*-4*/ -35, 8 }, /* index 7: 8 bits: 1111111x */
96 { /*4*/ -27, 9 }, /* index 8: 9 bits: 11111111x */
97 { /*-5*/ -36, 10 }, /* index 9: 10 bits: 111111111x */
98 { /*5*/ -26, 11 }, /* index 10: 11 bits: 1111111111x */
99 { /*-6*/ -37, 12 }, /* index 11: 12 bits: 11111111111x */
100 { /*6*/ -25, 13 }, /* index 12: 13 bits: 111111111111x */
101 { /*7*/ -24, 14 }, /* index 13: 14 bits: 1111111111111x */
102 { /*-7*/ -38, 15 }, /* index 14: 15 bits: 11111111111111x */
103 { 16, 17 }, /* index 15: 16 bits: 111111111111111x */
104 { /*8*/ -23, /*-8*/ -39 }, /* index 16: 17 bits: 1111111111111110x */
105 { 18, 19 }, /* index 17: 17 bits: 1111111111111111x */
106 { 20, 21 }, /* index 18: 18 bits: 11111111111111110x */
107 { 22, 23 }, /* index 19: 18 bits: 11111111111111111x */
108 { /*9*/ -22, /*-14*/ -45 }, /* index 20: 19 bits: 111111111111111100x */
109 { /*-13*/ -44, /*-12*/ -43 }, /* index 21: 19 bits: 111111111111111101x */
110 { 24, 25 }, /* index 22: 19 bits: 111111111111111110x */
111 { 26, 27 }, /* index 23: 19 bits: 111111111111111111x */
112 { /*-11*/ -42, /*-10*/ -41 }, /* index 24: 20 bits: 1111111111111111100x */
113 { /*-9*/ -40, /*10*/ -21 }, /* index 25: 20 bits: 1111111111111111101x */
114 { /*11*/ -20, /*12*/ -19 }, /* index 26: 20 bits: 1111111111111111110x */
115 { /*13*/ -18, /*14*/ -17 } /* index 27: 20 bits: 1111111111111111111x */
116 };
117
118 static const int8_t f_huff_iid_fine[][2] = {
119 { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
120 { 2, 3 }, /* index 1: 2 bits: 0x */
121 { 4, /*-1*/ -32 }, /* index 2: 3 bits: 00x */
122 { /*1*/ -30, 5 }, /* index 3: 3 bits: 01x */
123 { /*-2*/ -33, /*2*/ -29 }, /* index 4: 4 bits: 000x */
124 { 6, 7 }, /* index 5: 4 bits: 011x */
125 { /*-3*/ -34, /*3*/ -28 }, /* index 6: 5 bits: 0110x */
126 { 8, 9 }, /* index 7: 5 bits: 0111x */
127 { /*-4*/ -35, /*4*/ -27 }, /* index 8: 6 bits: 01110x */
128 { 10, 11 }, /* index 9: 6 bits: 01111x */
129 { /*-5*/ -36, /*5*/ -26 }, /* index 10: 7 bits: 011110x */
130 { 12, 13 }, /* index 11: 7 bits: 011111x */
131 { /*-6*/ -37, /*6*/ -25 }, /* index 12: 8 bits: 0111110x */
132 { 14, 15 }, /* index 13: 8 bits: 0111111x */
133 { /*7*/ -24, 16 }, /* index 14: 9 bits: 01111110x */
134 { 17, 18 }, /* index 15: 9 bits: 01111111x */
135 { 19, /*-8*/ -39 }, /* index 16: 10 bits: 011111101x */
136 { /*8*/ -23, 20 }, /* index 17: 10 bits: 011111110x */
137 { 21, /*-7*/ -38 }, /* index 18: 10 bits: 011111111x */
138 { /*10*/ -21, 22 }, /* index 19: 11 bits: 0111111010x */
139 { 23, /*-9*/ -40 }, /* index 20: 11 bits: 0111111101x */
140 { /*9*/ -22, 24 }, /* index 21: 11 bits: 0111111110x */
141 { /*-11*/ -42, /*11*/ -20 }, /* index 22: 12 bits: 01111110101x */
142 { 25, 26 }, /* index 23: 12 bits: 01111111010x */
143 { 27, /*-10*/ -41 }, /* index 24: 12 bits: 01111111101x */
144 { 28, /*-12*/ -43 }, /* index 25: 13 bits: 011111110100x */
145 { /*12*/ -19, 29 }, /* index 26: 13 bits: 011111110101x */
146 { 30, 31 }, /* index 27: 13 bits: 011111111010x */
147 { 32, /*-14*/ -45 }, /* index 28: 14 bits: 0111111101000x */
148 { /*14*/ -17, 33 }, /* index 29: 14 bits: 0111111101011x */
149 { 34, /*-13*/ -44 }, /* index 30: 14 bits: 0111111110100x */
150 { /*13*/ -18, 35 }, /* index 31: 14 bits: 0111111110101x */
151 { 36, 37 }, /* index 32: 15 bits: 01111111010000x */
152 { 38, /*-15*/ -46 }, /* index 33: 15 bits: 01111111010111x */
153 { /*15*/ -16, 39 }, /* index 34: 15 bits: 01111111101000x */
154 { 40, 41 }, /* index 35: 15 bits: 01111111101011x */
155 { 42, 43 }, /* index 36: 16 bits: 011111110100000x */
156 { /*-17*/ -48, /*17*/ -14 }, /* index 37: 16 bits: 011111110100001x */
157 { 44, 45 }, /* index 38: 16 bits: 011111110101110x */
158 { 46, 47 }, /* index 39: 16 bits: 011111111010001x */
159 { 48, 49 }, /* index 40: 16 bits: 011111111010110x */
160 { /*-16*/ -47, /*16*/ -15 }, /* index 41: 16 bits: 011111111010111x */
161 { /*-21*/ -52, /*21*/ -10 }, /* index 42: 17 bits: 0111111101000000x */
162 { /*-19*/ -50, /*19*/ -12 }, /* index 43: 17 bits: 0111111101000001x */
163 { /*-18*/ -49, /*18*/ -13 }, /* index 44: 17 bits: 0111111101011100x */
164 { 50, 51 }, /* index 45: 17 bits: 0111111101011101x */
165 { 52, 53 }, /* index 46: 17 bits: 0111111110100010x */
166 { 54, 55 }, /* index 47: 17 bits: 0111111110100011x */
167 { 56, 57 }, /* index 48: 17 bits: 0111111110101100x */
168 { 58, 59 }, /* index 49: 17 bits: 0111111110101101x */
169 { /*-26*/ -57, /*-25*/ -56 }, /* index 50: 18 bits: 01111111010111010x */
170 { /*-28*/ -59, /*-27*/ -58 }, /* index 51: 18 bits: 01111111010111011x */
171 { /*-22*/ -53, /*22*/ -9 }, /* index 52: 18 bits: 01111111101000100x */
172 { /*-24*/ -55, /*-23*/ -54 }, /* index 53: 18 bits: 01111111101000101x */
173 { /*25*/ -6, /*26*/ -5 }, /* index 54: 18 bits: 01111111101000110x */
174 { /*23*/ -8, /*24*/ -7 }, /* index 55: 18 bits: 01111111101000111x */
175 { /*29*/ -2, /*30*/ -1 }, /* index 56: 18 bits: 01111111101011000x */
176 { /*27*/ -4, /*28*/ -3 }, /* index 57: 18 bits: 01111111101011001x */
177 { /*-30*/ -61, /*-29*/ -60 }, /* index 58: 18 bits: 01111111101011010x */
178 { /*-20*/ -51, /*20*/ -11 } /* index 59: 18 bits: 01111111101011011x */
179 };
180
181 static const int8_t t_huff_iid_fine[][2] = {
182 { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
183 { /*1*/ -30, 2 }, /* index 1: 2 bits: 0x */
184 { 3, /*-1*/ -32 }, /* index 2: 3 bits: 01x */
185 { 4, 5 }, /* index 3: 4 bits: 010x */
186 { 6, 7 }, /* index 4: 5 bits: 0100x */
187 { /*-2*/ -33, /*2*/ -29 }, /* index 5: 5 bits: 0101x */
188 { 8, /*-3*/ -34 }, /* index 6: 6 bits: 01000x */
189 { /*3*/ -28, 9 }, /* index 7: 6 bits: 01001x */
190 { /*-4*/ -35, /*4*/ -27 }, /* index 8: 7 bits: 010000x */
191 { 10, 11 }, /* index 9: 7 bits: 010011x */
192 { /*5*/ -26, 12 }, /* index 10: 8 bits: 0100110x */
193 { 13, 14 }, /* index 11: 8 bits: 0100111x */
194 { /*-6*/ -37, /*6*/ -25 }, /* index 12: 9 bits: 01001101x */
195 { 15, 16 }, /* index 13: 9 bits: 01001110x */
196 { 17, /*-5*/ -36 }, /* index 14: 9 bits: 01001111x */
197 { 18, /*-7*/ -38 }, /* index 15: 10 bits: 010011100x */
198 { /*7*/ -24, 19 }, /* index 16: 10 bits: 010011101x */
199 { 20, 21 }, /* index 17: 10 bits: 010011110x */
200 { /*9*/ -22, 22 }, /* index 18: 11 bits: 0100111000x */
201 { 23, 24 }, /* index 19: 11 bits: 0100111011x */
202 { /*-8*/ -39, /*8*/ -23 }, /* index 20: 11 bits: 0100111100x */
203 { 25, 26 }, /* index 21: 11 bits: 0100111101x */
204 { /*11*/ -20, 27 }, /* index 22: 12 bits: 01001110001x */
205 { 28, 29 }, /* index 23: 12 bits: 01001110110x */
206 { /*-10*/ -41, /*10*/ -21 }, /* index 24: 12 bits: 01001110111x */
207 { 30, 31 }, /* index 25: 12 bits: 01001111010x */
208 { 32, /*-9*/ -40 }, /* index 26: 12 bits: 01001111011x */
209 { 33, /*-13*/ -44 }, /* index 27: 13 bits: 010011100011x */
210 { /*13*/ -18, 34 }, /* index 28: 13 bits: 010011101100x */
211 { 35, 36 }, /* index 29: 13 bits: 010011101101x */
212 { 37, /*-12*/ -43 }, /* index 30: 13 bits: 010011110100x */
213 { /*12*/ -19, 38 }, /* index 31: 13 bits: 010011110101x */
214 { 39, /*-11*/ -42 }, /* index 32: 13 bits: 010011110110x */
215 { 40, 41 }, /* index 33: 14 bits: 0100111000110x */
216 { 42, 43 }, /* index 34: 14 bits: 0100111011001x */
217 { 44, 45 }, /* index 35: 14 bits: 0100111011010x */
218 { 46, /*-15*/ -46 }, /* index 36: 14 bits: 0100111011011x */
219 { /*15*/ -16, 47 }, /* index 37: 14 bits: 0100111101000x */
220 { /*-14*/ -45, /*14*/ -17 }, /* index 38: 14 bits: 0100111101011x */
221 { 48, 49 }, /* index 39: 14 bits: 0100111101100x */
222 { /*-21*/ -52, /*-20*/ -51 }, /* index 40: 15 bits: 01001110001100x */
223 { /*18*/ -13, /*19*/ -12 }, /* index 41: 15 bits: 01001110001101x */
224 { /*-19*/ -50, /*-18*/ -49 }, /* index 42: 15 bits: 01001110110010x */
225 { 50, 51 }, /* index 43: 15 bits: 01001110110011x */
226 { 52, 53 }, /* index 44: 15 bits: 01001110110100x */
227 { 54, 55 }, /* index 45: 15 bits: 01001110110101x */
228 { 56, /*-17*/ -48 }, /* index 46: 15 bits: 01001110110110x */
229 { /*17*/ -14, 57 }, /* index 47: 15 bits: 01001111010001x */
230 { 58, /*-16*/ -47 }, /* index 48: 15 bits: 01001111011000x */
231 { /*16*/ -15, 59 }, /* index 49: 15 bits: 01001111011001x */
232 { /*-26*/ -57, /*26*/ -5 }, /* index 50: 16 bits: 010011101100110x */
233 { /*-28*/ -59, /*-27*/ -58 }, /* index 51: 16 bits: 010011101100111x */
234 { /*29*/ -2, /*30*/ -1 }, /* index 52: 16 bits: 010011101101000x */
235 { /*27*/ -4, /*28*/ -3 }, /* index 53: 16 bits: 010011101101001x */
236 { /*-30*/ -61, /*-29*/ -60 }, /* index 54: 16 bits: 010011101101010x */
237 { /*-25*/ -56, /*25*/ -6 }, /* index 55: 16 bits: 010011101101011x */
238 { /*-24*/ -55, /*24*/ -7 }, /* index 56: 16 bits: 010011101101100x */
239 { /*-23*/ -54, /*23*/ -8 }, /* index 57: 16 bits: 010011110100011x */
240 { /*-22*/ -53, /*22*/ -9 }, /* index 58: 16 bits: 010011110110000x */
241 { /*20*/ -11, /*21*/ -10 } /* index 59: 16 bits: 010011110110011x */
242 };
243
244 static const int8_t f_huff_icc[][2] = {
245 { /*0*/ -31, 1 }, /* index 0: 1 bits: x */
246 { /*1*/ -30, 2 }, /* index 1: 2 bits: 1x */
247 { /*-1*/ -32, 3 }, /* index 2: 3 bits: 11x */
248 { /*2*/ -29, 4 }, /* index 3: 4 bits: 111x */
249 { /*-2*/ -33, 5 }, /* index 4: 5 bits: 1111x */
250 { /*3*/ -28, 6 }, /* index 5: 6 bits: 11111x */
251 { /*-3*/ -34, 7 }, /* index 6: 7 bits: 111111x */
252 { /*4*/ -27, 8 }, /* index 7: 8 bits: 1111111x */
253 { /*5*/ -26, 9 }, /* index 8: 9 bits: 11111111x */
254 { /*-4*/ -35, 10 }, /* index 9: 10 bits: 111111111x */
255 { /*6*/ -25, 11 }, /* index 10: 11 bits: 1111111111x */
256 { /*-5*/ -36, 12 }, /* index 11: 12 bits: 11111111111x */
257 { /*7*/ -24, 13 }, /* index 12: 13 bits: 111111111111x */
258 { /*-6*/ -37, /*-7*/ -38 } /* index 13: 14 bits: 1111111111111x */
259 };
260
261 static const int8_t t_huff_icc[][2] = {
262 { /*0*/ -31, 1 }, /* index 0: 1 bits: x */
263 { /*1*/ -30, 2 }, /* index 1: 2 bits: 1x */
264 { /*-1*/ -32, 3 }, /* index 2: 3 bits: 11x */
265 { /*2*/ -29, 4 }, /* index 3: 4 bits: 111x */
266 { /*-2*/ -33, 5 }, /* index 4: 5 bits: 1111x */
267 { /*3*/ -28, 6 }, /* index 5: 6 bits: 11111x */
268 { /*-3*/ -34, 7 }, /* index 6: 7 bits: 111111x */
269 { /*4*/ -27, 8 }, /* index 7: 8 bits: 1111111x */
270 { /*-4*/ -35, 9 }, /* index 8: 9 bits: 11111111x */
271 { /*5*/ -26, 10 }, /* index 9: 10 bits: 111111111x */
272 { /*-5*/ -36, 11 }, /* index 10: 11 bits: 1111111111x */
273 { /*6*/ -25, 12 }, /* index 11: 12 bits: 11111111111x */
274 { /*-6*/ -37, 13 }, /* index 12: 13 bits: 111111111111x */
275 { /*-7*/ -38, /*7*/ -24 } /* index 13: 14 bits: 1111111111111x */
276 };
277
278 static const int8_t f_huff_ipd[][2] = {
279 { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
280 { 2, 3 }, /* index 1: 2 bits: 0x */
281 { /*1*/ -30, 4 }, /* index 2: 3 bits: 00x */
282 { 5, 6 }, /* index 3: 3 bits: 01x */
283 { /*4*/ -27, /*5*/ -26 }, /* index 4: 4 bits: 001x */
284 { /*3*/ -28, /*6*/ -25 }, /* index 5: 4 bits: 010x */
285 { /*2*/ -29, /*7*/ -24 } /* index 6: 4 bits: 011x */
286 };
287
288 static const int8_t t_huff_ipd[][2] = {
289 { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
290 { 2, 3 }, /* index 1: 2 bits: 0x */
291 { 4, 5 }, /* index 2: 3 bits: 00x */
292 { /*1*/ -30, /*7*/ -24 }, /* index 3: 3 bits: 01x */
293 { /*5*/ -26, 6 }, /* index 4: 4 bits: 000x */
294 { /*2*/ -29, /*6*/ -25 }, /* index 5: 4 bits: 001x */
295 { /*4*/ -27, /*3*/ -28 } /* index 6: 5 bits: 0001x */
296 };
297
298 static const int8_t f_huff_opd[][2] = {
299 { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
300 { 2, 3 }, /* index 1: 2 bits: 0x */
301 { /*7*/ -24, /*1*/ -30 }, /* index 2: 3 bits: 00x */
302 { 4, 5 }, /* index 3: 3 bits: 01x */
303 { /*3*/ -28, /*6*/ -25 }, /* index 4: 4 bits: 010x */
304 { /*2*/ -29, 6 }, /* index 5: 4 bits: 011x */
305 { /*5*/ -26, /*4*/ -27 } /* index 6: 5 bits: 0111x */
306 };
307
308 static const int8_t t_huff_opd[][2] = {
309 { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
310 { 2, 3 }, /* index 1: 2 bits: 0x */
311 { 4, 5 }, /* index 2: 3 bits: 00x */
312 { /*1*/ -30, /*7*/ -24 }, /* index 3: 3 bits: 01x */
313 { /*5*/ -26, /*2*/ -29 }, /* index 4: 4 bits: 000x */
314 { /*6*/ -25, 6 }, /* index 5: 4 bits: 001x */
315 { /*4*/ -27, /*3*/ -28 } /* index 6: 5 bits: 0011x */
316 };
317
318 /* static function declarations */
319 static uint16_t ps_extension(ps_info *ps, bitfile *ld,
320 const uint8_t ps_extension_id,
321 const uint16_t num_bits_left);
322 static void huff_data(bitfile *ld, const uint8_t dt, const uint8_t nr_par,
323 ps_huff_tab t_huff, ps_huff_tab f_huff, int8_t *par);
324 static INLINE int8_t ps_huff_dec(bitfile *ld, ps_huff_tab t_huff);
325
326
327 uint16_t ps_data(ps_info *ps, bitfile *ld, uint8_t *header)
328 {
329 uint8_t tmp, n;
330 uint16_t bits = (uint16_t)faad_get_processed_bits(ld);
331
332 *header = 0;
333
334 /* check for new PS header */
335 if (faad_get1bit(ld
336 DEBUGVAR(1,1000,"ps_data(): enable_ps_header")))
337 {
338 *header = 1;
339
340 ps->header_read = 1;
341
342 ps->use34hybrid_bands = 0;
343
344 /* Inter-channel Intensity Difference (IID) parameters enabled */
345 ps->enable_iid = (uint8_t)faad_get1bit(ld
346 DEBUGVAR(1,1001,"ps_data(): enable_iid"));
347
348 if (ps->enable_iid)
349 {
350 ps->iid_mode = (uint8_t)faad_getbits(ld, 3
351 DEBUGVAR(1,1002,"ps_data(): iid_mode"));
352
353 ps->nr_iid_par = nr_iid_par_tab[ps->iid_mode];
354 ps->nr_ipdopd_par = nr_ipdopd_par_tab[ps->iid_mode];
355
356 if (ps->iid_mode == 2 || ps->iid_mode == 5)
357 ps->use34hybrid_bands = 1;
358
359 /* IPD freq res equal to IID freq res */
360 ps->ipd_mode = ps->iid_mode;
361 }
362
363 /* Inter-channel Coherence (ICC) parameters enabled */
364 ps->enable_icc = (uint8_t)faad_get1bit(ld
365 DEBUGVAR(1,1003,"ps_data(): enable_icc"));
366
367 if (ps->enable_icc)
368 {
369 ps->icc_mode = (uint8_t)faad_getbits(ld, 3
370 DEBUGVAR(1,1004,"ps_data(): icc_mode"));
371
372 ps->nr_icc_par = nr_icc_par_tab[ps->icc_mode];
373
374 if (ps->icc_mode == 2 || ps->icc_mode == 5)
375 ps->use34hybrid_bands = 1;
376 }
377
378 /* PS extension layer enabled */
379 ps->enable_ext = (uint8_t)faad_get1bit(ld
380 DEBUGVAR(1,1005,"ps_data(): enable_ext"));
381 }
382
383 /* we are here, but no header has been read yet */
384 if (ps->header_read == 0)
385 {
386 ps->ps_data_available = 0;
387 return 1;
388 }
389
390 ps->frame_class = (uint8_t)faad_get1bit(ld
391 DEBUGVAR(1,1006,"ps_data(): frame_class"));
392 tmp = (uint8_t)faad_getbits(ld, 2
393 DEBUGVAR(1,1007,"ps_data(): num_env_idx"));
394
395 ps->num_env = num_env_tab[ps->frame_class][tmp];
396
397 if (ps->frame_class)
398 {
399 for (n = 1; n < ps->num_env+1; n++)
400 {
401 ps->border_position[n] = (uint8_t)faad_getbits(ld, 5
402 DEBUGVAR(1,1008,"ps_data(): border_position")) + 1;
403 }
404 }
405
406 if (ps->enable_iid)
407 {
408 for (n = 0; n < ps->num_env; n++)
409 {
410 ps->iid_dt[n] = (uint8_t)faad_get1bit(ld
411 DEBUGVAR(1,1009,"ps_data(): iid_dt"));
412
413 /* iid_data */
414 if (ps->iid_mode < 3)
415 {
416 huff_data(ld, ps->iid_dt[n], ps->nr_iid_par, t_huff_iid_def,
417 f_huff_iid_def, ps->iid_index[n]);
418 } else {
419 huff_data(ld, ps->iid_dt[n], ps->nr_iid_par, t_huff_iid_fine,
420 f_huff_iid_fine, ps->iid_index[n]);
421 }
422 }
423 }
424
425 if (ps->enable_icc)
426 {
427 for (n = 0; n < ps->num_env; n++)
428 {
429 ps->icc_dt[n] = (uint8_t)faad_get1bit(ld
430 DEBUGVAR(1,1010,"ps_data(): icc_dt"));
431
432 /* icc_data */
433 huff_data(ld, ps->icc_dt[n], ps->nr_icc_par, t_huff_icc,
434 f_huff_icc, ps->icc_index[n]);
435 }
436 }
437
438 if (ps->enable_ext)
439 {
440 uint16_t num_bits_left;
441 uint16_t cnt = (uint16_t)faad_getbits(ld, 4
442 DEBUGVAR(1,1011,"ps_data(): ps_extension_size"));
443 if (cnt == 15)
444 {
445 cnt += (uint16_t)faad_getbits(ld, 8
446 DEBUGVAR(1,1012,"ps_data(): esc_count"));
447 }
448
449 num_bits_left = 8 * cnt;
450 while (num_bits_left > 7)
451 {
452 uint8_t ps_extension_id = (uint8_t)faad_getbits(ld, 2
453 DEBUGVAR(1,1013,"ps_data(): ps_extension_size"));
454
455 num_bits_left -= 2;
456 num_bits_left -= ps_extension(ps, ld, ps_extension_id, num_bits_left);
457 }
458
459 faad_getbits(ld, num_bits_left
460 DEBUGVAR(1,1014,"ps_data(): fill_bits"));
461 }
462
463 bits = (uint16_t)faad_get_processed_bits(ld) - bits;
464
465 ps->ps_data_available = 1;
466
467 return bits;
468 }
469
470 static uint16_t ps_extension(ps_info *ps, bitfile *ld,
471 const uint8_t ps_extension_id,
472 const uint16_t num_bits_left)
473 {
474 uint8_t n;
475 uint16_t bits = (uint16_t)faad_get_processed_bits(ld);
476
477 if (ps_extension_id == 0)
478 {
479 ps->enable_ipdopd = (uint8_t)faad_get1bit(ld
480 DEBUGVAR(1,1015,"ps_extension(): enable_ipdopd"));
481
482 if (ps->enable_ipdopd)
483 {
484 for (n = 0; n < ps->num_env; n++)
485 {
486 ps->ipd_dt[n] = (uint8_t)faad_get1bit(ld
487 DEBUGVAR(1,1016,"ps_extension(): ipd_dt"));
488
489 /* ipd_data */
490 huff_data(ld, ps->ipd_dt[n], ps->nr_ipdopd_par, t_huff_ipd,
491 f_huff_ipd, ps->ipd_index[n]);
492
493 ps->opd_dt[n] = (uint8_t)faad_get1bit(ld
494 DEBUGVAR(1,1017,"ps_extension(): opd_dt"));
495
496 /* opd_data */
497 huff_data(ld, ps->opd_dt[n], ps->nr_ipdopd_par, t_huff_opd,
498 f_huff_opd, ps->opd_index[n]);
499 }
500 }
501 faad_get1bit(ld
502 DEBUGVAR(1,1018,"ps_extension(): reserved_ps"));
503 }
504
505 /* return number of bits read */
506 bits = (uint16_t)faad_get_processed_bits(ld) - bits;
507
508 return bits;
509 }
510
511 /* read huffman data coded in either the frequency or the time direction */
512 static void huff_data(bitfile *ld, const uint8_t dt, const uint8_t nr_par,
513 ps_huff_tab t_huff, ps_huff_tab f_huff, int8_t *par)
514 {
515 uint8_t n;
516
517 if (dt)
518 {
519 /* coded in time direction */
520 for (n = 0; n < nr_par; n++)
521 {
522 par[n] = ps_huff_dec(ld, t_huff);
523 }
524 } else {
525 /* coded in frequency direction */
526 par[0] = ps_huff_dec(ld, f_huff);
527
528 for (n = 1; n < nr_par; n++)
529 {
530 par[n] = ps_huff_dec(ld, f_huff);
531 }
532 }
533 }
534
535 /* binary search huffman decoding */
536 static INLINE int8_t ps_huff_dec(bitfile *ld, ps_huff_tab t_huff)
537 {
538 uint8_t bit;
539 int16_t index = 0;
540
541 while (index >= 0)
542 {
543 bit = (uint8_t)faad_get1bit(ld);
544 index = t_huff[index][bit];
545 }
546
547 return index + 31;
548 }
549
550 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: ps_tables.h,v 1.8 2007/11/01 12:33:33 menno Exp $
28 **/
29
30 #ifndef __PS_TABLES_H__
31 #define __PS_TABLES_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #ifdef _MSC_VER
38 #pragma warning(disable:4305)
39 #pragma warning(disable:4244)
40 #endif
41
42 #if 0
43 #if 0
44 float f_center_20[12] = {
45 0.5/4, 1.5/4, 2.5/4, 3.5/4,
46 4.5/4*0, 5.5/4*0, -1.5/4, -0.5/4,
47 3.5/2, 2.5/2, 4.5/2, 5.5/2
48 };
49 #else
50 float f_center_20[12] = {
51 0.5/8, 1.5/8, 2.5/8, 3.5/8,
52 4.5/8*0, 5.5/8*0, -1.5/8, -0.5/8,
53 3.5/4, 2.5/4, 4.5/4, 5.5/4
54 };
55 #endif
56
57 float f_center_34[32] = {
58 1/12, 3/12, 5/12, 7/12,
59 9/12, 11/12, 13/12, 15/12,
60 17/12, -5/12, -3/12, -1/12,
61 17/8, 19/8, 5/8, 7/8,
62 9/8, 11/8, 13/8, 15/8,
63 9/4, 11/4, 13/4, 7/4,
64 17/4, 11/4, 13/4, 15/4,
65 17/4, 19/4, 21/4, 15/4
66 };
67
68 static const real_t frac_delay_q[] = {
69 FRAC_CONST(0.43),
70 FRAC_CONST(0.75),
71 FRAC_CONST(0.347)
72 };
73 #endif
74
75 /* RE(ps->Phi_Fract_Qmf[j]) = (float)cos(M_PI*(j+0.5)*(0.39)); */
76 /* IM(ps->Phi_Fract_Qmf[j]) = (float)sin(M_PI*(j+0.5)*(0.39)); */
77 static const complex_t Phi_Fract_Qmf[] = {
78 { FRAC_CONST(0.8181497455), FRAC_CONST(0.5750052333) },
79 { FRAC_CONST(-0.2638730407), FRAC_CONST(0.9645574093) },
80 { FRAC_CONST(-0.9969173074), FRAC_CONST(0.0784590989) },
81 { FRAC_CONST(-0.4115143716), FRAC_CONST(-0.9114032984) },
82 { FRAC_CONST(0.7181262970), FRAC_CONST(-0.6959127784) },
83 { FRAC_CONST(0.8980275989), FRAC_CONST(0.4399391711) },
84 { FRAC_CONST(-0.1097343117), FRAC_CONST(0.9939609766) },
85 { FRAC_CONST(-0.9723699093), FRAC_CONST(0.2334453613) },
86 { FRAC_CONST(-0.5490227938), FRAC_CONST(-0.8358073831) },
87 { FRAC_CONST(0.6004202366), FRAC_CONST(-0.7996846437) },
88 { FRAC_CONST(0.9557930231), FRAC_CONST(0.2940403223) },
89 { FRAC_CONST(0.0471064523), FRAC_CONST(0.9988898635) },
90 { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) },
91 { FRAC_CONST(-0.6730124950), FRAC_CONST(-0.7396311164) },
92 { FRAC_CONST(0.4679298103), FRAC_CONST(-0.8837656379) },
93 { FRAC_CONST(0.9900236726), FRAC_CONST(0.1409012377) },
94 { FRAC_CONST(0.2027872950), FRAC_CONST(0.9792228341) },
95 { FRAC_CONST(-0.8526401520), FRAC_CONST(0.5224985480) },
96 { FRAC_CONST(-0.7804304361), FRAC_CONST(-0.6252426505) },
97 { FRAC_CONST(0.3239174187), FRAC_CONST(-0.9460853338) },
98 { FRAC_CONST(0.9998766184), FRAC_CONST(-0.0157073177) },
99 { FRAC_CONST(0.3534748554), FRAC_CONST(0.9354440570) },
100 { FRAC_CONST(-0.7604059577), FRAC_CONST(0.6494480371) },
101 { FRAC_CONST(-0.8686315417), FRAC_CONST(-0.4954586625) },
102 { FRAC_CONST(0.1719291061), FRAC_CONST(-0.9851093292) },
103 { FRAC_CONST(0.9851093292), FRAC_CONST(-0.1719291061) },
104 { FRAC_CONST(0.4954586625), FRAC_CONST(0.8686315417) },
105 { FRAC_CONST(-0.6494480371), FRAC_CONST(0.7604059577) },
106 { FRAC_CONST(-0.9354440570), FRAC_CONST(-0.3534748554) },
107 { FRAC_CONST(0.0157073177), FRAC_CONST(-0.9998766184) },
108 { FRAC_CONST(0.9460853338), FRAC_CONST(-0.3239174187) },
109 { FRAC_CONST(0.6252426505), FRAC_CONST(0.7804304361) },
110 { FRAC_CONST(-0.5224985480), FRAC_CONST(0.8526401520) },
111 { FRAC_CONST(-0.9792228341), FRAC_CONST(-0.2027872950) },
112 { FRAC_CONST(-0.1409012377), FRAC_CONST(-0.9900236726) },
113 { FRAC_CONST(0.8837656379), FRAC_CONST(-0.4679298103) },
114 { FRAC_CONST(0.7396311164), FRAC_CONST(0.6730124950) },
115 { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) },
116 { FRAC_CONST(-0.9988898635), FRAC_CONST(-0.0471064523) },
117 { FRAC_CONST(-0.2940403223), FRAC_CONST(-0.9557930231) },
118 { FRAC_CONST(0.7996846437), FRAC_CONST(-0.6004202366) },
119 { FRAC_CONST(0.8358073831), FRAC_CONST(0.5490227938) },
120 { FRAC_CONST(-0.2334453613), FRAC_CONST(0.9723699093) },
121 { FRAC_CONST(-0.9939609766), FRAC_CONST(0.1097343117) },
122 { FRAC_CONST(-0.4399391711), FRAC_CONST(-0.8980275989) },
123 { FRAC_CONST(0.6959127784), FRAC_CONST(-0.7181262970) },
124 { FRAC_CONST(0.9114032984), FRAC_CONST(0.4115143716) },
125 { FRAC_CONST(-0.0784590989), FRAC_CONST(0.9969173074) },
126 { FRAC_CONST(-0.9645574093), FRAC_CONST(0.2638730407) },
127 { FRAC_CONST(-0.5750052333), FRAC_CONST(-0.8181497455) },
128 { FRAC_CONST(0.5750052333), FRAC_CONST(-0.8181497455) },
129 { FRAC_CONST(0.9645574093), FRAC_CONST(0.2638730407) },
130 { FRAC_CONST(0.0784590989), FRAC_CONST(0.9969173074) },
131 { FRAC_CONST(-0.9114032984), FRAC_CONST(0.4115143716) },
132 { FRAC_CONST(-0.6959127784), FRAC_CONST(-0.7181262970) },
133 { FRAC_CONST(0.4399391711), FRAC_CONST(-0.8980275989) },
134 { FRAC_CONST(0.9939609766), FRAC_CONST(0.1097343117) },
135 { FRAC_CONST(0.2334453613), FRAC_CONST(0.9723699093) },
136 { FRAC_CONST(-0.8358073831), FRAC_CONST(0.5490227938) },
137 { FRAC_CONST(-0.7996846437), FRAC_CONST(-0.6004202366) },
138 { FRAC_CONST(0.2940403223), FRAC_CONST(-0.9557930231) },
139 { FRAC_CONST(0.9988898635), FRAC_CONST(-0.0471064523) },
140 { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) },
141 { FRAC_CONST(-0.7396311164), FRAC_CONST(0.6730124950) }
142 };
143
144 /* RE(Phi_Fract_SubQmf20[j]) = (float)cos(M_PI*f_center_20[j]*0.39); */
145 /* IM(Phi_Fract_SubQmf20[j]) = (float)sin(M_PI*f_center_20[j]*0.39); */
146 static const complex_t Phi_Fract_SubQmf20[] = {
147 { FRAC_CONST(0.9882950187), FRAC_CONST(0.1525546312) },
148 { FRAC_CONST(0.8962930441), FRAC_CONST(0.4434623122) },
149 { FRAC_CONST(0.7208535671), FRAC_CONST(0.6930873394) },
150 { FRAC_CONST(0.4783087075), FRAC_CONST(0.8781917691) },
151 { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
152 { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
153 { FRAC_CONST(0.8962930441), FRAC_CONST(-0.4434623122) },
154 { FRAC_CONST(0.9882950187), FRAC_CONST(-0.1525546312) },
155 { FRAC_CONST(-0.5424415469), FRAC_CONST(0.8400935531) },
156 { FRAC_CONST(0.0392598175), FRAC_CONST(0.9992290139) },
157 { FRAC_CONST(-0.9268565774), FRAC_CONST(0.3754155636) },
158 { FRAC_CONST(-0.9741733670), FRAC_CONST(-0.2258012742) }
159 };
160
161 /* RE(Phi_Fract_SubQmf34[j]) = (float)cos(M_PI*f_center_34[j]*0.39); */
162 /* IM(Phi_Fract_SubQmf34[j]) = (float)sin(M_PI*f_center_34[j]*0.39); */
163 static const complex_t Phi_Fract_SubQmf34[] = {
164 { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
165 { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
166 { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
167 { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
168 { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
169 { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
170 { FRAC_CONST(0.3387379348), FRAC_CONST(0.9408807755) },
171 { FRAC_CONST(0.3387379348), FRAC_CONST(0.9408807755) },
172 { FRAC_CONST(0.3387379348), FRAC_CONST(0.9408807755) },
173 { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
174 { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
175 { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
176 { FRAC_CONST(-0.7705132365), FRAC_CONST(0.6374239922) },
177 { FRAC_CONST(-0.7705132365), FRAC_CONST(0.6374239922) },
178 { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
179 { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
180 { FRAC_CONST(0.3387379348), FRAC_CONST(0.9408807755) },
181 { FRAC_CONST(0.3387379348), FRAC_CONST(0.9408807755) },
182 { FRAC_CONST(0.3387379348), FRAC_CONST(0.9408807755) },
183 { FRAC_CONST(0.3387379348), FRAC_CONST(0.9408807755) },
184 { FRAC_CONST(-0.7705132365), FRAC_CONST(0.6374239922) },
185 { FRAC_CONST(-0.7705132365), FRAC_CONST(0.6374239922) },
186 { FRAC_CONST(-0.8607420325), FRAC_CONST(-0.5090414286) },
187 { FRAC_CONST(0.3387379348), FRAC_CONST(0.9408807755) },
188 { FRAC_CONST(0.1873813123), FRAC_CONST(-0.9822872281) },
189 { FRAC_CONST(-0.7705132365), FRAC_CONST(0.6374239922) },
190 { FRAC_CONST(-0.8607420325), FRAC_CONST(-0.5090414286) },
191 { FRAC_CONST(-0.8607420325), FRAC_CONST(-0.5090414286) },
192 { FRAC_CONST(0.1873813123), FRAC_CONST(-0.9822872281) },
193 { FRAC_CONST(0.1873813123), FRAC_CONST(-0.9822872281) },
194 { FRAC_CONST(0.9876883626), FRAC_CONST(-0.1564344615) },
195 { FRAC_CONST(-0.8607420325), FRAC_CONST(-0.5090414286) }
196 };
197
198 /* RE(Q_Fract_allpass_Qmf[j][i]) = (float)cos(M_PI*(j+0.5)*(frac_delay_q[i])); */
199 /* IM(Q_Fract_allpass_Qmf[j][i]) = (float)sin(M_PI*(j+0.5)*(frac_delay_q[i])); */
200 static const complex_t Q_Fract_allpass_Qmf[][3] = {
201 { { FRAC_CONST(0.7804303765), FRAC_CONST(0.6252426505) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.8550928831), FRAC_CONST(0.5184748173) } },
202 { { FRAC_CONST(-0.4399392009), FRAC_CONST(0.8980275393) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.0643581524), FRAC_CONST(0.9979268909) } },
203 { { FRAC_CONST(-0.9723699093), FRAC_CONST(-0.2334454209) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.9146071672), FRAC_CONST(0.4043435752) } },
204 { { FRAC_CONST(0.0157073960), FRAC_CONST(-0.9998766184) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.7814115286), FRAC_CONST(-0.6240159869) } },
205 { { FRAC_CONST(0.9792228341), FRAC_CONST(-0.2027871907) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.1920081824), FRAC_CONST(-0.9813933372) } },
206 { { FRAC_CONST(0.4115142524), FRAC_CONST(0.9114032984) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.9589683414), FRAC_CONST(-0.2835132182) } },
207 { { FRAC_CONST(-0.7996847630), FRAC_CONST(0.6004201174) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.6947838664), FRAC_CONST(0.7192186117) } },
208 { { FRAC_CONST(-0.7604058385), FRAC_CONST(-0.6494481564) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.3164770305), FRAC_CONST(0.9486001730) } },
209 { { FRAC_CONST(0.4679299891), FRAC_CONST(-0.8837655187) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.9874414206), FRAC_CONST(0.1579856575) } },
210 { { FRAC_CONST(0.9645573497), FRAC_CONST(0.2638732493) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.5966450572), FRAC_CONST(-0.8025052547) } },
211 { { FRAC_CONST(-0.0471066870), FRAC_CONST(0.9988898635) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.4357025325), FRAC_CONST(-0.9000906944) } },
212 { { FRAC_CONST(-0.9851093888), FRAC_CONST(0.1719288528) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.9995546937), FRAC_CONST(-0.0298405960) } },
213 { { FRAC_CONST(-0.3826831877), FRAC_CONST(-0.9238796234) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.4886211455), FRAC_CONST(0.8724960685) } },
214 { { FRAC_CONST(0.8181498647), FRAC_CONST(-0.5750049949) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.5477093458), FRAC_CONST(0.8366686702) } },
215 { { FRAC_CONST(0.7396308780), FRAC_CONST(0.6730127335) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.9951074123), FRAC_CONST(-0.0987988561) } },
216 { { FRAC_CONST(-0.4954589605), FRAC_CONST(0.8686313629) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.3725017905), FRAC_CONST(-0.9280315042) } },
217 { { FRAC_CONST(-0.9557929039), FRAC_CONST(-0.2940406799) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.6506417990), FRAC_CONST(-0.7593847513) } },
218 { { FRAC_CONST(0.0784594864), FRAC_CONST(-0.9969173074) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.9741733670), FRAC_CONST(0.2258014232) } },
219 { { FRAC_CONST(0.9900237322), FRAC_CONST(-0.1409008205) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.2502108514), FRAC_CONST(0.9681913853) } },
220 { { FRAC_CONST(0.3534744382), FRAC_CONST(0.9354441762) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.7427945137), FRAC_CONST(0.6695194840) } },
221 { { FRAC_CONST(-0.8358076215), FRAC_CONST(0.5490224361) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.9370992780), FRAC_CONST(-0.3490629196) } },
222 { { FRAC_CONST(-0.7181259394), FRAC_CONST(-0.6959131360) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.1237744763), FRAC_CONST(-0.9923103452) } },
223 { { FRAC_CONST(0.5224990249), FRAC_CONST(-0.8526399136) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.8226406574), FRAC_CONST(-0.5685616732) } },
224 { { FRAC_CONST(0.9460852146), FRAC_CONST(0.3239179254) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.8844994903), FRAC_CONST(0.4665412009) } },
225 { { FRAC_CONST(-0.1097348556), FRAC_CONST(0.9939609170) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.0047125919), FRAC_CONST(0.9999889135) } },
226 { { FRAC_CONST(-0.9939610362), FRAC_CONST(0.1097337380) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.8888573647), FRAC_CONST(0.4581840038) } },
227 { { FRAC_CONST(-0.3239168525), FRAC_CONST(-0.9460855722) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.8172453642), FRAC_CONST(-0.5762898922) } },
228 { { FRAC_CONST(0.8526405096), FRAC_CONST(-0.5224980116) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.1331215799), FRAC_CONST(-0.9910997152) } },
229 { { FRAC_CONST(0.6959123611), FRAC_CONST(0.7181267142) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.9403476119), FRAC_CONST(-0.3402152061) } },
230 { { FRAC_CONST(-0.5490233898), FRAC_CONST(0.8358070254) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.7364512086), FRAC_CONST(0.6764906645) } },
231 { { FRAC_CONST(-0.9354437590), FRAC_CONST(-0.3534754813) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.2593250275), FRAC_CONST(0.9657900929) } },
232 { { FRAC_CONST(0.1409019381), FRAC_CONST(-0.9900235534) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.9762582779), FRAC_CONST(0.2166097313) } },
233 { { FRAC_CONST(0.9969173670), FRAC_CONST(-0.0784583688) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.6434556246), FRAC_CONST(-0.7654833794) } },
234 { { FRAC_CONST(0.2940396070), FRAC_CONST(0.9557932615) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.3812320232), FRAC_CONST(-0.9244794250) } },
235 { { FRAC_CONST(-0.8686318994), FRAC_CONST(0.4954580069) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.9959943891), FRAC_CONST(-0.0894154981) } },
236 { { FRAC_CONST(-0.6730118990), FRAC_CONST(-0.7396316528) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.5397993922), FRAC_CONST(0.8417937160) } },
237 { { FRAC_CONST(0.5750059485), FRAC_CONST(-0.8181492686) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.4968227744), FRAC_CONST(0.8678520322) } },
238 { { FRAC_CONST(0.9238792062), FRAC_CONST(0.3826842010) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.9992290139), FRAC_CONST(-0.0392601527) } },
239 { { FRAC_CONST(-0.1719299555), FRAC_CONST(0.9851091504) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.4271997511), FRAC_CONST(-0.9041572809) } },
240 { { FRAC_CONST(-0.9988899231), FRAC_CONST(0.0471055657) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.6041822433), FRAC_CONST(-0.7968461514) } },
241 { { FRAC_CONST(-0.2638721764), FRAC_CONST(-0.9645576477) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.9859085083), FRAC_CONST(0.1672853529) } },
242 { { FRAC_CONST(0.8837660551), FRAC_CONST(-0.4679289758) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.3075223565), FRAC_CONST(0.9515408874) } },
243 { { FRAC_CONST(0.6494473219), FRAC_CONST(0.7604066133) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.7015317082), FRAC_CONST(0.7126382589) } },
244 { { FRAC_CONST(-0.6004210114), FRAC_CONST(0.7996840477) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.9562535882), FRAC_CONST(-0.2925389707) } },
245 { { FRAC_CONST(-0.9114028811), FRAC_CONST(-0.4115152657) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.1827499419), FRAC_CONST(-0.9831594229) } },
246 { { FRAC_CONST(0.2027882934), FRAC_CONST(-0.9792225957) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.7872582674), FRAC_CONST(-0.6166234016) } },
247 { { FRAC_CONST(0.9998766780), FRAC_CONST(-0.0157062728) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.9107555747), FRAC_CONST(0.4129458666) } },
248 { { FRAC_CONST(0.2334443331), FRAC_CONST(0.9723701477) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.0549497530), FRAC_CONST(0.9984891415) } },
249 { { FRAC_CONST(-0.8980280757), FRAC_CONST(0.4399381876) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.8599416018), FRAC_CONST(0.5103924870) } },
250 { { FRAC_CONST(-0.6252418160), FRAC_CONST(-0.7804310918) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.8501682281), FRAC_CONST(-0.5265110731) } },
251 { { FRAC_CONST(0.6252435446), FRAC_CONST(-0.7804297209) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.0737608299), FRAC_CONST(-0.9972759485) } },
252 { { FRAC_CONST(0.8980270624), FRAC_CONST(0.4399402142) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.9183775187), FRAC_CONST(-0.3957053721) } },
253 { { FRAC_CONST(-0.2334465086), FRAC_CONST(0.9723696709) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.7754954696), FRAC_CONST(0.6313531399) } },
254 { { FRAC_CONST(-0.9998766184), FRAC_CONST(-0.0157085191) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.2012493610), FRAC_CONST(0.9795400500) } },
255 { { FRAC_CONST(-0.2027861029), FRAC_CONST(-0.9792230725) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.9615978599), FRAC_CONST(0.2744622827) } },
256 { { FRAC_CONST(0.9114037752), FRAC_CONST(-0.4115132093) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.6879743338), FRAC_CONST(-0.7257350087) } },
257 { { FRAC_CONST(0.6004192233), FRAC_CONST(0.7996854186) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.3254036009), FRAC_CONST(-0.9455752373) } },
258 { { FRAC_CONST(-0.6494490504), FRAC_CONST(0.7604051232) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.9888865948), FRAC_CONST(-0.1486719251) } },
259 { { FRAC_CONST(-0.8837650418), FRAC_CONST(-0.4679309726) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.5890548825), FRAC_CONST(0.8080930114) } },
260 { { FRAC_CONST(0.2638743520), FRAC_CONST(-0.9645570517) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.4441666007), FRAC_CONST(0.8959442377) } },
261 { { FRAC_CONST(0.9988898039), FRAC_CONST(0.0471078083) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.9997915030), FRAC_CONST(0.0204183888) } },
262 { { FRAC_CONST(0.1719277352), FRAC_CONST(0.9851095676) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.4803760946), FRAC_CONST(-0.8770626187) } },
263 { { FRAC_CONST(-0.9238800406), FRAC_CONST(0.3826821446) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.5555707216), FRAC_CONST(-0.8314692974) } },
264 { { FRAC_CONST(-0.5750041008), FRAC_CONST(-0.8181505203) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.9941320419), FRAC_CONST(0.1081734300) } }
265 };
266
267 /* RE(Q_Fract_allpass_SubQmf20[j][i]) = (float)cos(M_PI*f_center_20[j]*frac_delay_q[i]); */
268 /* IM(Q_Fract_allpass_SubQmf20[j][i]) = (float)sin(M_PI*f_center_20[j]*frac_delay_q[i]); */
269 static const complex_t Q_Fract_allpass_SubQmf20[][3] = {
270 { { FRAC_CONST(0.9857769012), FRAC_CONST(0.1680592746) }, { FRAC_CONST(0.9569403529), FRAC_CONST(0.2902846634) }, { FRAC_CONST(0.9907300472), FRAC_CONST(0.1358452588) } },
271 { { FRAC_CONST(0.8744080663), FRAC_CONST(0.4851911962) }, { FRAC_CONST(0.6343932748), FRAC_CONST(0.7730104327) }, { FRAC_CONST(0.9175986052), FRAC_CONST(0.3975082636) } },
272 { { FRAC_CONST(0.6642524004), FRAC_CONST(0.7475083470) }, { FRAC_CONST(0.0980171412), FRAC_CONST(0.9951847196) }, { FRAC_CONST(0.7767338753), FRAC_CONST(0.6298289299) } },
273 { { FRAC_CONST(0.3790524006), FRAC_CONST(0.9253752232) }, { FRAC_CONST(-0.4713967443), FRAC_CONST(0.8819212914) }, { FRAC_CONST(0.5785340071), FRAC_CONST(0.8156582713) } },
274 { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
275 { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
276 { { FRAC_CONST(0.8744080663), FRAC_CONST(-0.4851911962) }, { FRAC_CONST(0.6343932748), FRAC_CONST(-0.7730104327) }, { FRAC_CONST(0.9175986052), FRAC_CONST(-0.3975082636) } },
277 { { FRAC_CONST(0.9857769012), FRAC_CONST(-0.1680592746) }, { FRAC_CONST(0.9569403529), FRAC_CONST(-0.2902846634) }, { FRAC_CONST(0.9907300472), FRAC_CONST(-0.1358452588) } },
278 { { FRAC_CONST(-0.7126385570), FRAC_CONST(0.7015314102) }, { FRAC_CONST(-0.5555702448), FRAC_CONST(-0.8314695954) }, { FRAC_CONST(-0.3305967748), FRAC_CONST(0.9437720776) } },
279 { { FRAC_CONST(-0.1175374240), FRAC_CONST(0.9930684566) }, { FRAC_CONST(-0.9807852507), FRAC_CONST(0.1950903237) }, { FRAC_CONST(0.2066311091), FRAC_CONST(0.9784189463) } },
280 { { FRAC_CONST(-0.9947921634), FRAC_CONST(0.1019244045) }, { FRAC_CONST(0.5555702448), FRAC_CONST(-0.8314695954) }, { FRAC_CONST(-0.7720130086), FRAC_CONST(0.6356067061) } },
281 { { FRAC_CONST(-0.8400934935), FRAC_CONST(-0.5424416065) }, { FRAC_CONST(0.9807852507), FRAC_CONST(0.1950903237) }, { FRAC_CONST(-0.9896889329), FRAC_CONST(0.1432335079) } }
282 };
283
284 /* RE(Q_Fract_allpass_SubQmf34[j][i]) = (float)cos(M_PI*f_center_34[j]*frac_delay_q[i]); */
285 /* IM(Q_Fract_allpass_SubQmf34[j][i]) = (float)sin(M_PI*f_center_34[j]*frac_delay_q[i]); */
286 static const complex_t Q_Fract_allpass_SubQmf34[][3] = {
287 { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
288 { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
289 { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
290 { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
291 { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
292 { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
293 { { FRAC_CONST(0.2181432247), FRAC_CONST(0.9759167433) }, { FRAC_CONST(-0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(0.4623677433), FRAC_CONST(0.8866882324) } },
294 { { FRAC_CONST(0.2181432247), FRAC_CONST(0.9759167433) }, { FRAC_CONST(-0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(0.4623677433), FRAC_CONST(0.8866882324) } },
295 { { FRAC_CONST(0.2181432247), FRAC_CONST(0.9759167433) }, { FRAC_CONST(-0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(0.4623677433), FRAC_CONST(0.8866882324) } },
296 { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
297 { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
298 { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
299 { { FRAC_CONST(-0.9048270583), FRAC_CONST(0.4257792532) }, { FRAC_CONST(-0.0000000000), FRAC_CONST(-1.0000000000) }, { FRAC_CONST(-0.5724321604), FRAC_CONST(0.8199520707) } },
300 { { FRAC_CONST(-0.9048270583), FRAC_CONST(0.4257792532) }, { FRAC_CONST(-0.0000000000), FRAC_CONST(-1.0000000000) }, { FRAC_CONST(-0.5724321604), FRAC_CONST(0.8199520707) } },
301 { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
302 { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
303 { { FRAC_CONST(0.2181432247), FRAC_CONST(0.9759167433) }, { FRAC_CONST(-0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(0.4623677433), FRAC_CONST(0.8866882324) } },
304 { { FRAC_CONST(0.2181432247), FRAC_CONST(0.9759167433) }, { FRAC_CONST(-0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(0.4623677433), FRAC_CONST(0.8866882324) } },
305 { { FRAC_CONST(0.2181432247), FRAC_CONST(0.9759167433) }, { FRAC_CONST(-0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(0.4623677433), FRAC_CONST(0.8866882324) } },
306 { { FRAC_CONST(0.2181432247), FRAC_CONST(0.9759167433) }, { FRAC_CONST(-0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(0.4623677433), FRAC_CONST(0.8866882324) } },
307 { { FRAC_CONST(-0.9048270583), FRAC_CONST(0.4257792532) }, { FRAC_CONST(-0.0000000000), FRAC_CONST(-1.0000000000) }, { FRAC_CONST(-0.5724321604), FRAC_CONST(0.8199520707) } },
308 { { FRAC_CONST(-0.9048270583), FRAC_CONST(0.4257792532) }, { FRAC_CONST(-0.0000000000), FRAC_CONST(-1.0000000000) }, { FRAC_CONST(-0.5724321604), FRAC_CONST(0.8199520707) } },
309 { { FRAC_CONST(-0.6129069924), FRAC_CONST(-0.7901550531) }, { FRAC_CONST(0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(-0.9917160273), FRAC_CONST(-0.1284494549) } },
310 { { FRAC_CONST(0.2181432247), FRAC_CONST(0.9759167433) }, { FRAC_CONST(-0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(0.4623677433), FRAC_CONST(0.8866882324) } },
311 { { FRAC_CONST(0.6374240518), FRAC_CONST(-0.7705131769) }, { FRAC_CONST(-1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(-0.3446428776), FRAC_CONST(-0.9387338758) } },
312 { { FRAC_CONST(-0.9048270583), FRAC_CONST(0.4257792532) }, { FRAC_CONST(-0.0000000000), FRAC_CONST(-1.0000000000) }, { FRAC_CONST(-0.5724321604), FRAC_CONST(0.8199520707) } },
313 { { FRAC_CONST(-0.6129069924), FRAC_CONST(-0.7901550531) }, { FRAC_CONST(0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(-0.9917160273), FRAC_CONST(-0.1284494549) } },
314 { { FRAC_CONST(-0.6129069924), FRAC_CONST(-0.7901550531) }, { FRAC_CONST(0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(-0.9917160273), FRAC_CONST(-0.1284494549) } },
315 { { FRAC_CONST(0.6374240518), FRAC_CONST(-0.7705131769) }, { FRAC_CONST(-1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(-0.3446428776), FRAC_CONST(-0.9387338758) } },
316 { { FRAC_CONST(0.6374240518), FRAC_CONST(-0.7705131769) }, { FRAC_CONST(-1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(-0.3446428776), FRAC_CONST(-0.9387338758) } },
317 { { FRAC_CONST(0.8910064697), FRAC_CONST(0.4539906085) }, { FRAC_CONST(0.7071067691), FRAC_CONST(-0.7071067691) }, { FRAC_CONST(0.6730125546), FRAC_CONST(-0.7396310568) } },
318 { { FRAC_CONST(-0.6129069924), FRAC_CONST(-0.7901550531) }, { FRAC_CONST(0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(-0.9917160273), FRAC_CONST(-0.1284494549) } }
319 };
320
321 #if 0
322 static float quant_rho[8] =
323 {
324 FRAC_CONST(1.0), FRAC_CONST(0.937), FRAC_CONST(0.84118), FRAC_CONST(0.60092),
325 FRAC_CONST(0.36764), FRAC_CONST(0.0), FRAC_CONST(-0.589), FRAC_CONST(-1.0)
326 };
327
328 static const uint8_t quant_iid_normal[7] =
329 {
330 2, 4, 7, 10, 14, 18, 25
331 };
332
333 static const uint8_t quant_iid_fine[15] =
334 {
335 2, 4, 6, 8, 10, 13, 16, 19, 22, 25, 30, 35, 40, 45, 50
336 };
337 #endif
338
339 static const real_t cos_alphas[] = {
340 COEF_CONST(1.0000000000), COEF_CONST(0.9841239700), COEF_CONST(0.9594738210),
341 COEF_CONST(0.8946843079), COEF_CONST(0.8269340931), COEF_CONST(0.7071067812),
342 COEF_CONST(0.4533210856), COEF_CONST(0.0000000000)
343 };
344
345 static const real_t sin_alphas[] = {
346 COEF_CONST(0.0000000000), COEF_CONST(0.1774824264), COEF_CONST(0.2817977763),
347 COEF_CONST(0.4466989918), COEF_CONST(0.5622988580), COEF_CONST(0.7071067812),
348 COEF_CONST(0.8913472911), COEF_CONST(1.0000000000)
349 };
350
351 static const real_t cos_betas_normal[][8] = {
352 { COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000) },
353 { COEF_CONST(1.0000000000), COEF_CONST(0.9995871699), COEF_CONST(0.9989419133), COEF_CONST(0.9972204583), COEF_CONST(0.9953790839), COEF_CONST(0.9920112747), COEF_CONST(0.9843408180), COEF_CONST(0.9681727381) },
354 { COEF_CONST(1.0000000000), COEF_CONST(0.9984497744), COEF_CONST(0.9960279377), COEF_CONST(0.9895738413), COEF_CONST(0.9826814632), COEF_CONST(0.9701058164), COEF_CONST(0.9416098832), COEF_CONST(0.8822105900) },
355 { COEF_CONST(1.0000000000), COEF_CONST(0.9959398908), COEF_CONST(0.9896038018), COEF_CONST(0.9727589768), COEF_CONST(0.9548355329), COEF_CONST(0.9223070404), COEF_CONST(0.8494349490), COEF_CONST(0.7013005535) },
356 { COEF_CONST(1.0000000000), COEF_CONST(0.9932417400), COEF_CONST(0.9827071856), COEF_CONST(0.9547730996), COEF_CONST(0.9251668930), COEF_CONST(0.8717461589), COEF_CONST(0.7535520592), COEF_CONST(0.5198827312) },
357 { COEF_CONST(1.0000000000), COEF_CONST(0.9902068095), COEF_CONST(0.9749613872), COEF_CONST(0.9346538534), COEF_CONST(0.8921231300), COEF_CONST(0.8158851259), COEF_CONST(0.6495964302), COEF_CONST(0.3313370772) },
358 { COEF_CONST(1.0000000000), COEF_CONST(0.9880510933), COEF_CONST(0.9694670261), COEF_CONST(0.9204347876), COEF_CONST(0.8688622825), COEF_CONST(0.7768516704), COEF_CONST(0.5782161800), COEF_CONST(0.2069970356) },
359 { COEF_CONST(1.0000000000), COEF_CONST(0.9858996945), COEF_CONST(0.9639898866), COEF_CONST(0.9063034786), COEF_CONST(0.8458214608), COEF_CONST(0.7384262300), COEF_CONST(0.5089811277), COEF_CONST(0.0905465944) }
360 };
361
362 static const real_t sin_betas_normal[][8] = {
363 { COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000) },
364 { COEF_CONST(0.0000000000), COEF_CONST(-0.0287313368), COEF_CONST(-0.0459897147), COEF_CONST(-0.0745074328), COEF_CONST(-0.0960233266), COEF_CONST(-0.1261492408), COEF_CONST(-0.1762757894), COEF_CONST(-0.2502829383) },
365 { COEF_CONST(0.0000000000), COEF_CONST(-0.0556601118), COEF_CONST(-0.0890412670), COEF_CONST(-0.1440264301), COEF_CONST(-0.1853028382), COEF_CONST(-0.2426823129), COEF_CONST(-0.3367058477), COEF_CONST(-0.4708550466) },
366 { COEF_CONST(0.0000000000), COEF_CONST(-0.0900207420), COEF_CONST(-0.1438204281), COEF_CONST(-0.2318188366), COEF_CONST(-0.2971348264), COEF_CONST(-0.3864579191), COEF_CONST(-0.5276933461), COEF_CONST(-0.7128657193) },
367 { COEF_CONST(0.0000000000), COEF_CONST(-0.1160639735), COEF_CONST(-0.1851663774), COEF_CONST(-0.2973353800), COEF_CONST(-0.3795605619), COEF_CONST(-0.4899577884), COEF_CONST(-0.6573882369), COEF_CONST(-0.8542376401) },
368 { COEF_CONST(0.0000000000), COEF_CONST(-0.1396082894), COEF_CONST(-0.2223742196), COEF_CONST(-0.3555589603), COEF_CONST(-0.4517923427), COEF_CONST(-0.5782140273), COEF_CONST(-0.7602792104), COEF_CONST(-0.9435124489) },
369 { COEF_CONST(0.0000000000), COEF_CONST(-0.1541266914), COEF_CONST(-0.2452217065), COEF_CONST(-0.3908961522), COEF_CONST(-0.4950538699), COEF_CONST(-0.6296836366), COEF_CONST(-0.8158836002), COEF_CONST(-0.9783415698) },
370 { COEF_CONST(0.0000000000), COEF_CONST(-0.1673373610), COEF_CONST(-0.2659389001), COEF_CONST(-0.4226275012), COEF_CONST(-0.5334660781), COEF_CONST(-0.6743342664), COEF_CONST(-0.8607776784), COEF_CONST(-0.9958922202) }
371 };
372
373 static const real_t cos_betas_fine[][8] = {
374 { COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000) },
375 { COEF_CONST(1.0000000000), COEF_CONST(0.9995871699), COEF_CONST(0.9989419133), COEF_CONST(0.9972204583), COEF_CONST(0.9953790839), COEF_CONST(0.9920112747), COEF_CONST(0.9843408180), COEF_CONST(0.9681727381) },
376 { COEF_CONST(1.0000000000), COEF_CONST(0.9984497744), COEF_CONST(0.9960279377), COEF_CONST(0.9895738413), COEF_CONST(0.9826814632), COEF_CONST(0.9701058164), COEF_CONST(0.9416098832), COEF_CONST(0.8822105900) },
377 { COEF_CONST(1.0000000000), COEF_CONST(0.9968361371), COEF_CONST(0.9918968104), COEF_CONST(0.9787540479), COEF_CONST(0.9647515190), COEF_CONST(0.9392903010), COEF_CONST(0.8820167114), COEF_CONST(0.7645325390) },
378 { COEF_CONST(1.0000000000), COEF_CONST(0.9950262915), COEF_CONST(0.9872675041), COEF_CONST(0.9666584578), COEF_CONST(0.9447588606), COEF_CONST(0.9050918405), COEF_CONST(0.8165997379), COEF_CONST(0.6383824796) },
379 { COEF_CONST(1.0000000000), COEF_CONST(0.9932417400), COEF_CONST(0.9827071856), COEF_CONST(0.9547730996), COEF_CONST(0.9251668930), COEF_CONST(0.8717461589), COEF_CONST(0.7535520592), COEF_CONST(0.5198827312) },
380 { COEF_CONST(1.0000000000), COEF_CONST(0.9908827998), COEF_CONST(0.9766855904), COEF_CONST(0.9391249214), COEF_CONST(0.8994531782), COEF_CONST(0.8282352693), COEF_CONST(0.6723983174), COEF_CONST(0.3719473225) },
381 { COEF_CONST(1.0000000000), COEF_CONST(0.9890240165), COEF_CONST(0.9719459866), COEF_CONST(0.9268448110), COEF_CONST(0.8793388536), COEF_CONST(0.7944023271), COEF_CONST(0.6101812098), COEF_CONST(0.2621501145) },
382 { COEF_CONST(1.0000000000), COEF_CONST(0.9876350461), COEF_CONST(0.9684073447), COEF_CONST(0.9176973944), COEF_CONST(0.8643930070), COEF_CONST(0.7693796058), COEF_CONST(0.5646720713), COEF_CONST(0.1838899556) },
383 { COEF_CONST(1.0000000000), COEF_CONST(0.9866247085), COEF_CONST(0.9658349704), COEF_CONST(0.9110590761), COEF_CONST(0.8535668048), COEF_CONST(0.7513165426), COEF_CONST(0.5320914819), COEF_CONST(0.1289530943) },
384 { COEF_CONST(1.0000000000), COEF_CONST(0.9858996945), COEF_CONST(0.9639898866), COEF_CONST(0.9063034786), COEF_CONST(0.8458214608), COEF_CONST(0.7384262300), COEF_CONST(0.5089811277), COEF_CONST(0.0905465944) },
385 { COEF_CONST(1.0000000000), COEF_CONST(0.9851245614), COEF_CONST(0.9620180268), COEF_CONST(0.9012265590), COEF_CONST(0.8375623272), COEF_CONST(0.7247108045), COEF_CONST(0.4845204297), COEF_CONST(0.0504115003) },
386 { COEF_CONST(1.0000000000), COEF_CONST(0.9846869856), COEF_CONST(0.9609052357), COEF_CONST(0.8983639533), COEF_CONST(0.8329098386), COEF_CONST(0.7169983441), COEF_CONST(0.4708245354), COEF_CONST(0.0281732509) },
387 { COEF_CONST(1.0000000000), COEF_CONST(0.9844406325), COEF_CONST(0.9602788522), COEF_CONST(0.8967533934), COEF_CONST(0.8302936455), COEF_CONST(0.7126658102), COEF_CONST(0.4631492839), COEF_CONST(0.0157851140) },
388 { COEF_CONST(1.0000000000), COEF_CONST(0.9843020502), COEF_CONST(0.9599265269), COEF_CONST(0.8958477331), COEF_CONST(0.8288229094), COEF_CONST(0.7102315840), COEF_CONST(0.4588429315), COEF_CONST(0.0088578059) },
389 { COEF_CONST(1.0000000000), COEF_CONST(0.9842241136), COEF_CONST(0.9597283916), COEF_CONST(0.8953385094), COEF_CONST(0.8279961409), COEF_CONST(0.7088635748), COEF_CONST(0.4564246834), COEF_CONST(0.0049751355) }
390 };
391
392 static const real_t sin_betas_fine[][8] = {
393 { COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000) },
394 { COEF_CONST(0.0000000000), COEF_CONST(-0.0287313368), COEF_CONST(-0.0459897147), COEF_CONST(-0.0745074328), COEF_CONST(-0.0960233266), COEF_CONST(-0.1261492408), COEF_CONST(-0.1762757894), COEF_CONST(-0.2502829383) },
395 { COEF_CONST(0.0000000000), COEF_CONST(-0.0556601118), COEF_CONST(-0.0890412670), COEF_CONST(-0.1440264301), COEF_CONST(-0.1853028382), COEF_CONST(-0.2426823129), COEF_CONST(-0.3367058477), COEF_CONST(-0.4708550466) },
396 { COEF_CONST(0.0000000000), COEF_CONST(-0.0794840594), COEF_CONST(-0.1270461238), COEF_CONST(-0.2050378347), COEF_CONST(-0.2631625097), COEF_CONST(-0.3431234916), COEF_CONST(-0.4712181245), COEF_CONST(-0.6445851354) },
397 { COEF_CONST(0.0000000000), COEF_CONST(-0.0996126459), COEF_CONST(-0.1590687758), COEF_CONST(-0.2560691819), COEF_CONST(-0.3277662204), COEF_CONST(-0.4252161335), COEF_CONST(-0.5772043556), COEF_CONST(-0.7697193058) },
398 { COEF_CONST(0.0000000000), COEF_CONST(-0.1160639735), COEF_CONST(-0.1851663774), COEF_CONST(-0.2973353800), COEF_CONST(-0.3795605619), COEF_CONST(-0.4899577884), COEF_CONST(-0.6573882369), COEF_CONST(-0.8542376401) },
399 { COEF_CONST(0.0000000000), COEF_CONST(-0.1347266752), COEF_CONST(-0.2146747714), COEF_CONST(-0.3435758752), COEF_CONST(-0.4370171396), COEF_CONST(-0.5603805303), COEF_CONST(-0.7401895046), COEF_CONST(-0.9282538388) },
400 { COEF_CONST(0.0000000000), COEF_CONST(-0.1477548470), COEF_CONST(-0.2352041647), COEF_CONST(-0.3754446647), COEF_CONST(-0.4761965776), COEF_CONST(-0.6073919186), COEF_CONST(-0.7922618830), COEF_CONST(-0.9650271071) },
401 { COEF_CONST(0.0000000000), COEF_CONST(-0.1567705832), COEF_CONST(-0.2493736450), COEF_CONST(-0.3972801182), COEF_CONST(-0.5028167951), COEF_CONST(-0.6387918458), COEF_CONST(-0.8253153651), COEF_CONST(-0.9829468369) },
402 { COEF_CONST(0.0000000000), COEF_CONST(-0.1630082348), COEF_CONST(-0.2591578860), COEF_CONST(-0.4122758299), COEF_CONST(-0.5209834064), COEF_CONST(-0.6599420072), COEF_CONST(-0.8466868694), COEF_CONST(-0.9916506943) },
403 { COEF_CONST(0.0000000000), COEF_CONST(-0.1673373610), COEF_CONST(-0.2659389001), COEF_CONST(-0.4226275012), COEF_CONST(-0.5334660781), COEF_CONST(-0.6743342664), COEF_CONST(-0.8607776784), COEF_CONST(-0.9958922202) },
404 { COEF_CONST(0.0000000000), COEF_CONST(-0.1718417832), COEF_CONST(-0.2729859267), COEF_CONST(-0.4333482310), COEF_CONST(-0.5463417868), COEF_CONST(-0.6890531546), COEF_CONST(-0.8747799456), COEF_CONST(-0.9987285320) },
405 { COEF_CONST(0.0000000000), COEF_CONST(-0.1743316967), COEF_CONST(-0.2768774604), COEF_CONST(-0.4392518725), COEF_CONST(-0.5534087104), COEF_CONST(-0.6970748701), COEF_CONST(-0.8822268738), COEF_CONST(-0.9996030552) },
406 { COEF_CONST(0.0000000000), COEF_CONST(-0.1757175038), COEF_CONST(-0.2790421580), COEF_CONST(-0.4425306221), COEF_CONST(-0.5573261722), COEF_CONST(-0.7015037013), COEF_CONST(-0.8862802834), COEF_CONST(-0.9998754073) },
407 { COEF_CONST(0.0000000000), COEF_CONST(-0.1764921355), COEF_CONST(-0.2802517850), COEF_CONST(-0.4443611583), COEF_CONST(-0.5595110229), COEF_CONST(-0.7039681080), COEF_CONST(-0.8885173967), COEF_CONST(-0.9999607689) },
408 { COEF_CONST(0.0000000000), COEF_CONST(-0.1769262394), COEF_CONST(-0.2809295540), COEF_CONST(-0.4453862969), COEF_CONST(-0.5607337966), COEF_CONST(-0.7053456119), COEF_CONST(-0.8897620516), COEF_CONST(-0.9999876239) }
409 };
410
411 static const real_t sincos_alphas_B_normal[][8] = {
412 { COEF_CONST(0.0561454100), COEF_CONST(0.0526385859), COEF_CONST(0.0472937334), COEF_CONST(0.0338410641), COEF_CONST(0.0207261065), COEF_CONST(0.0028205635), COEF_CONST(0.0028205635), COEF_CONST(0.0028205635) },
413 { COEF_CONST(0.1249065138), COEF_CONST(0.1173697697), COEF_CONST(0.1057888284), COEF_CONST(0.0761985131), COEF_CONST(0.0468732723), COEF_CONST(0.0063956103), COEF_CONST(0.0063956103), COEF_CONST(0.0063956103) },
414 { COEF_CONST(0.1956693050), COEF_CONST(0.1846090179), COEF_CONST(0.1673645109), COEF_CONST(0.1220621836), COEF_CONST(0.0757362479), COEF_CONST(0.0103882630), COEF_CONST(0.0103882630), COEF_CONST(0.0103882630) },
415 { COEF_CONST(0.3015113269), COEF_CONST(0.2870525790), COEF_CONST(0.2637738799), COEF_CONST(0.1984573949), COEF_CONST(0.1260749909), COEF_CONST(0.0175600126), COEF_CONST(0.0175600126), COEF_CONST(0.0175600126) },
416 { COEF_CONST(0.4078449476), COEF_CONST(0.3929852420), COEF_CONST(0.3680589270), COEF_CONST(0.2911029124), COEF_CONST(0.1934512363), COEF_CONST(0.0278686716), COEF_CONST(0.0278686716), COEF_CONST(0.0278686716) },
417 { COEF_CONST(0.5336171261), COEF_CONST(0.5226637762), COEF_CONST(0.5033652606), COEF_CONST(0.4349162672), COEF_CONST(0.3224682122), COEF_CONST(0.0521999036), COEF_CONST(0.0521999036), COEF_CONST(0.0521999036) },
418 { COEF_CONST(0.6219832023), COEF_CONST(0.6161847276), COEF_CONST(0.6057251063), COEF_CONST(0.5654342668), COEF_CONST(0.4826149915), COEF_CONST(0.1058044758), COEF_CONST(0.1058044758), COEF_CONST(0.1058044758) },
419 { COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657) },
420 { COEF_CONST(0.7830305572), COEF_CONST(0.7876016373), COEF_CONST(0.7956739618), COEF_CONST(0.8247933372), COEF_CONST(0.8758325942), COEF_CONST(0.9943869542), COEF_CONST(0.9943869542), COEF_CONST(0.9943869542) },
421 { COEF_CONST(0.8457261833), COEF_CONST(0.8525388778), COEF_CONST(0.8640737401), COEF_CONST(0.9004708933), COEF_CONST(0.9465802987), COEF_CONST(0.9986366532), COEF_CONST(0.9986366532), COEF_CONST(0.9986366532) },
422 { COEF_CONST(0.9130511848), COEF_CONST(0.9195447612), COEF_CONST(0.9298024282), COEF_CONST(0.9566917233), COEF_CONST(0.9811098801), COEF_CONST(0.9996115928), COEF_CONST(0.9996115928), COEF_CONST(0.9996115928) },
423 { COEF_CONST(0.9534625907), COEF_CONST(0.9579148236), COEF_CONST(0.9645845234), COEF_CONST(0.9801095128), COEF_CONST(0.9920207064), COEF_CONST(0.9998458099), COEF_CONST(0.9998458099), COEF_CONST(0.9998458099) },
424 { COEF_CONST(0.9806699215), COEF_CONST(0.9828120260), COEF_CONST(0.9858950861), COEF_CONST(0.9925224431), COEF_CONST(0.9971278825), COEF_CONST(0.9999460406), COEF_CONST(0.9999460406), COEF_CONST(0.9999460406) },
425 { COEF_CONST(0.9921685024), COEF_CONST(0.9930882705), COEF_CONST(0.9943886135), COEF_CONST(0.9970926648), COEF_CONST(0.9989008403), COEF_CONST(0.9999795479), COEF_CONST(0.9999795479), COEF_CONST(0.9999795479) },
426 { COEF_CONST(0.9984226014), COEF_CONST(0.9986136287), COEF_CONST(0.9988810254), COEF_CONST(0.9994272242), COEF_CONST(0.9997851906), COEF_CONST(0.9999960221), COEF_CONST(0.9999960221), COEF_CONST(0.9999960221) }
427 };
428
429 static const real_t sincos_alphas_B_fine[][8] = {
430 { COEF_CONST(0.0031622158), COEF_CONST(0.0029630181), COEF_CONST(0.0026599892), COEF_CONST(0.0019002704), COEF_CONST(0.0011626042), COEF_CONST(0.0001580278), COEF_CONST(0.0001580278), COEF_CONST(0.0001580278) },
431 { COEF_CONST(0.0056232673), COEF_CONST(0.0052689825), COEF_CONST(0.0047302825), COEF_CONST(0.0033791756), COEF_CONST(0.0020674015), COEF_CONST(0.0002811710), COEF_CONST(0.0002811710), COEF_CONST(0.0002811710) },
432 { COEF_CONST(0.0099994225), COEF_CONST(0.0093696693), COEF_CONST(0.0084117414), COEF_CONST(0.0060093796), COEF_CONST(0.0036766009), COEF_CONST(0.0005000392), COEF_CONST(0.0005000392), COEF_CONST(0.0005000392) },
433 { COEF_CONST(0.0177799194), COEF_CONST(0.0166607102), COEF_CONST(0.0149581377), COEF_CONST(0.0106875809), COEF_CONST(0.0065392545), COEF_CONST(0.0008893767), COEF_CONST(0.0008893767), COEF_CONST(0.0008893767) },
434 { COEF_CONST(0.0316069684), COEF_CONST(0.0296211579), COEF_CONST(0.0265987295), COEF_CONST(0.0190113813), COEF_CONST(0.0116349973), COEF_CONST(0.0015826974), COEF_CONST(0.0015826974), COEF_CONST(0.0015826974) },
435 { COEF_CONST(0.0561454100), COEF_CONST(0.0526385859), COEF_CONST(0.0472937334), COEF_CONST(0.0338410641), COEF_CONST(0.0207261065), COEF_CONST(0.0028205635), COEF_CONST(0.0028205635), COEF_CONST(0.0028205635) },
436 { COEF_CONST(0.0791834041), COEF_CONST(0.0742798103), COEF_CONST(0.0667907269), COEF_CONST(0.0478705292), COEF_CONST(0.0293500747), COEF_CONST(0.0039966755), COEF_CONST(0.0039966755), COEF_CONST(0.0039966755) },
437 { COEF_CONST(0.1115021177), COEF_CONST(0.1047141985), COEF_CONST(0.0943053154), COEF_CONST(0.0678120561), COEF_CONST(0.0416669150), COEF_CONST(0.0056813213), COEF_CONST(0.0056813213), COEF_CONST(0.0056813213) },
438 { COEF_CONST(0.1565355066), COEF_CONST(0.1473258371), COEF_CONST(0.1330924027), COEF_CONST(0.0963282233), COEF_CONST(0.0594509113), COEF_CONST(0.0081277946), COEF_CONST(0.0081277946), COEF_CONST(0.0081277946) },
439 { COEF_CONST(0.2184643682), COEF_CONST(0.2064579524), COEF_CONST(0.1876265439), COEF_CONST(0.1375744167), COEF_CONST(0.0856896681), COEF_CONST(0.0117817338), COEF_CONST(0.0117817338), COEF_CONST(0.0117817338) },
440 { COEF_CONST(0.3015113269), COEF_CONST(0.2870525790), COEF_CONST(0.2637738799), COEF_CONST(0.1984573949), COEF_CONST(0.1260749909), COEF_CONST(0.0175600126), COEF_CONST(0.0175600126), COEF_CONST(0.0175600126) },
441 { COEF_CONST(0.3698741335), COEF_CONST(0.3547727297), COEF_CONST(0.3298252076), COEF_CONST(0.2556265829), COEF_CONST(0.1665990017), COEF_CONST(0.0236344541), COEF_CONST(0.0236344541), COEF_CONST(0.0236344541) },
442 { COEF_CONST(0.4480623975), COEF_CONST(0.4339410024), COEF_CONST(0.4098613774), COEF_CONST(0.3322709108), COEF_CONST(0.2266784729), COEF_CONST(0.0334094131), COEF_CONST(0.0334094131), COEF_CONST(0.0334094131) },
443 { COEF_CONST(0.5336171261), COEF_CONST(0.5226637762), COEF_CONST(0.5033652606), COEF_CONST(0.4349162672), COEF_CONST(0.3224682122), COEF_CONST(0.0521999036), COEF_CONST(0.0521999036), COEF_CONST(0.0521999036) },
444 { COEF_CONST(0.6219832023), COEF_CONST(0.6161847276), COEF_CONST(0.6057251063), COEF_CONST(0.5654342668), COEF_CONST(0.4826149915), COEF_CONST(0.1058044758), COEF_CONST(0.1058044758), COEF_CONST(0.1058044758) },
445 { COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657) },
446 { COEF_CONST(0.7830305572), COEF_CONST(0.7876016373), COEF_CONST(0.7956739618), COEF_CONST(0.8247933372), COEF_CONST(0.8758325942), COEF_CONST(0.9943869542), COEF_CONST(0.9943869542), COEF_CONST(0.9943869542) },
447 { COEF_CONST(0.8457261833), COEF_CONST(0.8525388778), COEF_CONST(0.8640737401), COEF_CONST(0.9004708933), COEF_CONST(0.9465802987), COEF_CONST(0.9986366532), COEF_CONST(0.9986366532), COEF_CONST(0.9986366532) },
448 { COEF_CONST(0.8940022267), COEF_CONST(0.9009412572), COEF_CONST(0.9121477564), COEF_CONST(0.9431839770), COEF_CONST(0.9739696219), COEF_CONST(0.9994417480), COEF_CONST(0.9994417480), COEF_CONST(0.9994417480) },
449 { COEF_CONST(0.9290818561), COEF_CONST(0.9349525662), COEF_CONST(0.9440420138), COEF_CONST(0.9667755833), COEF_CONST(0.9860247275), COEF_CONST(0.9997206664), COEF_CONST(0.9997206664), COEF_CONST(0.9997206664) },
450 { COEF_CONST(0.9534625907), COEF_CONST(0.9579148236), COEF_CONST(0.9645845234), COEF_CONST(0.9801095128), COEF_CONST(0.9920207064), COEF_CONST(0.9998458099), COEF_CONST(0.9998458099), COEF_CONST(0.9998458099) },
451 { COEF_CONST(0.9758449068), COEF_CONST(0.9784554646), COEF_CONST(0.9822404252), COEF_CONST(0.9904914275), COEF_CONST(0.9963218730), COEF_CONST(0.9999305926), COEF_CONST(0.9999305926), COEF_CONST(0.9999305926) },
452 { COEF_CONST(0.9876723320), COEF_CONST(0.9890880155), COEF_CONST(0.9911036356), COEF_CONST(0.9953496173), COEF_CONST(0.9982312259), COEF_CONST(0.9999669685), COEF_CONST(0.9999669685), COEF_CONST(0.9999669685) },
453 { COEF_CONST(0.9937641889), COEF_CONST(0.9945023501), COEF_CONST(0.9955433130), COEF_CONST(0.9976981117), COEF_CONST(0.9991315558), COEF_CONST(0.9999838610), COEF_CONST(0.9999838610), COEF_CONST(0.9999838610) },
454 { COEF_CONST(0.9968600642), COEF_CONST(0.9972374385), COEF_CONST(0.9977670024), COEF_CONST(0.9988535464), COEF_CONST(0.9995691924), COEF_CONST(0.9999920129), COEF_CONST(0.9999920129), COEF_CONST(0.9999920129) },
455 { COEF_CONST(0.9984226014), COEF_CONST(0.9986136287), COEF_CONST(0.9988810254), COEF_CONST(0.9994272242), COEF_CONST(0.9997851906), COEF_CONST(0.9999960221), COEF_CONST(0.9999960221), COEF_CONST(0.9999960221) },
456 { COEF_CONST(0.9995003746), COEF_CONST(0.9995611974), COEF_CONST(0.9996461891), COEF_CONST(0.9998192657), COEF_CONST(0.9999323103), COEF_CONST(0.9999987475), COEF_CONST(0.9999987475), COEF_CONST(0.9999987475) },
457 { COEF_CONST(0.9998419236), COEF_CONST(0.9998611991), COEF_CONST(0.9998881193), COEF_CONST(0.9999428861), COEF_CONST(0.9999786185), COEF_CONST(0.9999996045), COEF_CONST(0.9999996045), COEF_CONST(0.9999996045) },
458 { COEF_CONST(0.9999500038), COEF_CONST(0.9999561034), COEF_CONST(0.9999646206), COEF_CONST(0.9999819429), COEF_CONST(0.9999932409), COEF_CONST(0.9999998750), COEF_CONST(0.9999998750), COEF_CONST(0.9999998750) },
459 { COEF_CONST(0.9999841890), COEF_CONST(0.9999861183), COEF_CONST(0.9999888121), COEF_CONST(0.9999942902), COEF_CONST(0.9999978628), COEF_CONST(0.9999999605), COEF_CONST(0.9999999605), COEF_CONST(0.9999999605) },
460 { COEF_CONST(0.9999950000), COEF_CONST(0.9999956102), COEF_CONST(0.9999964621), COEF_CONST(0.9999981945), COEF_CONST(0.9999993242), COEF_CONST(0.9999999875), COEF_CONST(0.9999999875), COEF_CONST(0.9999999875) }
461 };
462
463 static const real_t cos_gammas_normal[][8] = {
464 { COEF_CONST(1.0000000000), COEF_CONST(0.9841239707), COEF_CONST(0.9594738226), COEF_CONST(0.8946843024), COEF_CONST(0.8269341029), COEF_CONST(0.7245688486), COEF_CONST(0.7245688486), COEF_CONST(0.7245688486) },
465 { COEF_CONST(1.0000000000), COEF_CONST(0.9849690570), COEF_CONST(0.9617776789), COEF_CONST(0.9020941550), COEF_CONST(0.8436830391), COEF_CONST(0.7846832804), COEF_CONST(0.7846832804), COEF_CONST(0.7846832804) },
466 { COEF_CONST(1.0000000000), COEF_CONST(0.9871656089), COEF_CONST(0.9676774734), COEF_CONST(0.9199102884), COEF_CONST(0.8785067015), COEF_CONST(0.8464232214), COEF_CONST(0.8464232214), COEF_CONST(0.8464232214) },
467 { COEF_CONST(1.0000000000), COEF_CONST(0.9913533967), COEF_CONST(0.9786000177), COEF_CONST(0.9496063381), COEF_CONST(0.9277157252), COEF_CONST(0.9133354077), COEF_CONST(0.9133354077), COEF_CONST(0.9133354077) },
468 { COEF_CONST(1.0000000000), COEF_CONST(0.9948924435), COEF_CONST(0.9875319180), COEF_CONST(0.9716329849), COEF_CONST(0.9604805241), COEF_CONST(0.9535949574), COEF_CONST(0.9535949574), COEF_CONST(0.9535949574) },
469 { COEF_CONST(1.0000000000), COEF_CONST(0.9977406278), COEF_CONST(0.9945423840), COEF_CONST(0.9878736667), COEF_CONST(0.9833980494), COEF_CONST(0.9807207440), COEF_CONST(0.9807207440), COEF_CONST(0.9807207440) },
470 { COEF_CONST(1.0000000000), COEF_CONST(0.9990607067), COEF_CONST(0.9977417734), COEF_CONST(0.9950323970), COEF_CONST(0.9932453273), COEF_CONST(0.9921884740), COEF_CONST(0.9921884740), COEF_CONST(0.9921884740) },
471 { COEF_CONST(1.0000000000), COEF_CONST(0.9998081748), COEF_CONST(0.9995400312), COEF_CONST(0.9989936459), COEF_CONST(0.9986365356), COEF_CONST(0.9984265591), COEF_CONST(0.9984265591), COEF_CONST(0.9984265591) }
472 };
473
474 static const real_t cos_gammas_fine[][8] = {
475 { COEF_CONST(1.0000000000), COEF_CONST(0.9841239707), COEF_CONST(0.9594738226), COEF_CONST(0.8946843024), COEF_CONST(0.8269341029), COEF_CONST(0.7245688486), COEF_CONST(0.7245688486), COEF_CONST(0.7245688486) },
476 { COEF_CONST(1.0000000000), COEF_CONST(0.9849690570), COEF_CONST(0.9617776789), COEF_CONST(0.9020941550), COEF_CONST(0.8436830391), COEF_CONST(0.7846832804), COEF_CONST(0.7846832804), COEF_CONST(0.7846832804) },
477 { COEF_CONST(1.0000000000), COEF_CONST(0.9871656089), COEF_CONST(0.9676774734), COEF_CONST(0.9199102884), COEF_CONST(0.8785067015), COEF_CONST(0.8464232214), COEF_CONST(0.8464232214), COEF_CONST(0.8464232214) },
478 { COEF_CONST(1.0000000000), COEF_CONST(0.9899597309), COEF_CONST(0.9750098690), COEF_CONST(0.9402333855), COEF_CONST(0.9129698759), COEF_CONST(0.8943765944), COEF_CONST(0.8943765944), COEF_CONST(0.8943765944) },
479 { COEF_CONST(1.0000000000), COEF_CONST(0.9926607607), COEF_CONST(0.9819295710), COEF_CONST(0.9580160104), COEF_CONST(0.9404993670), COEF_CONST(0.9293004472), COEF_CONST(0.9293004472), COEF_CONST(0.9293004472) },
480 { COEF_CONST(1.0000000000), COEF_CONST(0.9948924435), COEF_CONST(0.9875319180), COEF_CONST(0.9716329849), COEF_CONST(0.9604805241), COEF_CONST(0.9535949574), COEF_CONST(0.9535949574), COEF_CONST(0.9535949574) },
481 { COEF_CONST(1.0000000000), COEF_CONST(0.9972074644), COEF_CONST(0.9932414270), COEF_CONST(0.9849197629), COEF_CONST(0.9792926592), COEF_CONST(0.9759092525), COEF_CONST(0.9759092525), COEF_CONST(0.9759092525) },
482 { COEF_CONST(1.0000000000), COEF_CONST(0.9985361982), COEF_CONST(0.9964742028), COEF_CONST(0.9922136306), COEF_CONST(0.9893845420), COEF_CONST(0.9877041371), COEF_CONST(0.9877041371), COEF_CONST(0.9877041371) },
483 { COEF_CONST(1.0000000000), COEF_CONST(0.9992494366), COEF_CONST(0.9981967170), COEF_CONST(0.9960386625), COEF_CONST(0.9946185834), COEF_CONST(0.9937800239), COEF_CONST(0.9937800239), COEF_CONST(0.9937800239) },
484 { COEF_CONST(1.0000000000), COEF_CONST(0.9996194722), COEF_CONST(0.9990869422), COEF_CONST(0.9979996269), COEF_CONST(0.9972873651), COEF_CONST(0.9968679747), COEF_CONST(0.9968679747), COEF_CONST(0.9968679747) },
485 { COEF_CONST(1.0000000000), COEF_CONST(0.9998081748), COEF_CONST(0.9995400312), COEF_CONST(0.9989936459), COEF_CONST(0.9986365356), COEF_CONST(0.9984265591), COEF_CONST(0.9984265591), COEF_CONST(0.9984265591) },
486 { COEF_CONST(1.0000000000), COEF_CONST(0.9999390971), COEF_CONST(0.9998540271), COEF_CONST(0.9996809352), COEF_CONST(0.9995679735), COEF_CONST(0.9995016284), COEF_CONST(0.9995016284), COEF_CONST(0.9995016284) },
487 { COEF_CONST(1.0000000000), COEF_CONST(0.9999807170), COEF_CONST(0.9999537862), COEF_CONST(0.9998990191), COEF_CONST(0.9998632947), COEF_CONST(0.9998423208), COEF_CONST(0.9998423208), COEF_CONST(0.9998423208) },
488 { COEF_CONST(1.0000000000), COEF_CONST(0.9999938979), COEF_CONST(0.9999853814), COEF_CONST(0.9999680568), COEF_CONST(0.9999567596), COEF_CONST(0.9999501270), COEF_CONST(0.9999501270), COEF_CONST(0.9999501270) },
489 { COEF_CONST(1.0000000000), COEF_CONST(0.9999980703), COEF_CONST(0.9999953731), COEF_CONST(0.9999898968), COEF_CONST(0.9999863277), COEF_CONST(0.9999842265), COEF_CONST(0.9999842265), COEF_CONST(0.9999842265) },
490 { COEF_CONST(1.0000000000), COEF_CONST(0.9999993891), COEF_CONST(0.9999985397), COEF_CONST(0.9999968037), COEF_CONST(0.9999956786), COEF_CONST(0.9999950155), COEF_CONST(0.9999950155), COEF_CONST(0.9999950155) }
491 };
492
493 static const real_t sin_gammas_normal[][8] = {
494 { COEF_CONST(0.0000000000), COEF_CONST(0.1774824223), COEF_CONST(0.2817977711), COEF_CONST(0.4466990028), COEF_CONST(0.5622988435), COEF_CONST(0.6892024258), COEF_CONST(0.6892024258), COEF_CONST(0.6892024258) },
495 { COEF_CONST(0.0000000000), COEF_CONST(0.1727308798), COEF_CONST(0.2738315110), COEF_CONST(0.4315392630), COEF_CONST(0.5368416242), COEF_CONST(0.6198968861), COEF_CONST(0.6198968861), COEF_CONST(0.6198968861) },
496 { COEF_CONST(0.0000000000), COEF_CONST(0.1596999079), COEF_CONST(0.2521910140), COEF_CONST(0.3921288836), COEF_CONST(0.4777300236), COEF_CONST(0.5325107795), COEF_CONST(0.5325107795), COEF_CONST(0.5325107795) },
497 { COEF_CONST(0.0000000000), COEF_CONST(0.1312190642), COEF_CONST(0.2057717310), COEF_CONST(0.3134450552), COEF_CONST(0.3732874674), COEF_CONST(0.4072080955), COEF_CONST(0.4072080955), COEF_CONST(0.4072080955) },
498 { COEF_CONST(0.0000000000), COEF_CONST(0.1009407043), COEF_CONST(0.1574189028), COEF_CONST(0.2364938532), COEF_CONST(0.2783471983), COEF_CONST(0.3010924396), COEF_CONST(0.3010924396), COEF_CONST(0.3010924396) },
499 { COEF_CONST(0.0000000000), COEF_CONST(0.0671836269), COEF_CONST(0.1043333428), COEF_CONST(0.1552598422), COEF_CONST(0.1814615013), COEF_CONST(0.1954144885), COEF_CONST(0.1954144885), COEF_CONST(0.1954144885) },
500 { COEF_CONST(0.0000000000), COEF_CONST(0.0433324862), COEF_CONST(0.0671666110), COEF_CONST(0.0995516398), COEF_CONST(0.1160332699), COEF_CONST(0.1247478739), COEF_CONST(0.1247478739), COEF_CONST(0.1247478739) },
501 { COEF_CONST(0.0000000000), COEF_CONST(0.0195860576), COEF_CONST(0.0303269852), COEF_CONST(0.0448519274), COEF_CONST(0.0522022017), COEF_CONST(0.0560750040), COEF_CONST(0.0560750040), COEF_CONST(0.0560750040) }
502 };
503
504 static const real_t sin_gammas_fine[][8] = {
505 { COEF_CONST(0.0000000000), COEF_CONST(0.1774824223), COEF_CONST(0.2817977711), COEF_CONST(0.4466990028), COEF_CONST(0.5622988435), COEF_CONST(0.6892024258), COEF_CONST(0.6892024258), COEF_CONST(0.6892024258) },
506 { COEF_CONST(0.0000000000), COEF_CONST(0.1727308798), COEF_CONST(0.2738315110), COEF_CONST(0.4315392630), COEF_CONST(0.5368416242), COEF_CONST(0.6198968861), COEF_CONST(0.6198968861), COEF_CONST(0.6198968861) },
507 { COEF_CONST(0.0000000000), COEF_CONST(0.1596999079), COEF_CONST(0.2521910140), COEF_CONST(0.3921288836), COEF_CONST(0.4777300236), COEF_CONST(0.5325107795), COEF_CONST(0.5325107795), COEF_CONST(0.5325107795) },
508 { COEF_CONST(0.0000000000), COEF_CONST(0.1413496768), COEF_CONST(0.2221615526), COEF_CONST(0.3405307340), COEF_CONST(0.4080269669), COEF_CONST(0.4473147744), COEF_CONST(0.4473147744), COEF_CONST(0.4473147744) },
509 { COEF_CONST(0.0000000000), COEF_CONST(0.1209322714), COEF_CONST(0.1892467110), COEF_CONST(0.2867147079), COEF_CONST(0.3397954394), COEF_CONST(0.3693246252), COEF_CONST(0.3693246252), COEF_CONST(0.3693246252) },
510 { COEF_CONST(0.0000000000), COEF_CONST(0.1009407043), COEF_CONST(0.1574189028), COEF_CONST(0.2364938532), COEF_CONST(0.2783471983), COEF_CONST(0.3010924396), COEF_CONST(0.3010924396), COEF_CONST(0.3010924396) },
511 { COEF_CONST(0.0000000000), COEF_CONST(0.0746811420), COEF_CONST(0.1160666523), COEF_CONST(0.1730117353), COEF_CONST(0.2024497161), COEF_CONST(0.2181768341), COEF_CONST(0.2181768341), COEF_CONST(0.2181768341) },
512 { COEF_CONST(0.0000000000), COEF_CONST(0.0540875291), COEF_CONST(0.0838997203), COEF_CONST(0.1245476266), COEF_CONST(0.1453211203), COEF_CONST(0.1563346972), COEF_CONST(0.1563346972), COEF_CONST(0.1563346972) },
513 { COEF_CONST(0.0000000000), COEF_CONST(0.0387371058), COEF_CONST(0.0600276114), COEF_CONST(0.0889212171), COEF_CONST(0.1036044086), COEF_CONST(0.1113609634), COEF_CONST(0.1113609634), COEF_CONST(0.1113609634) },
514 { COEF_CONST(0.0000000000), COEF_CONST(0.0275846110), COEF_CONST(0.0427233177), COEF_CONST(0.0632198125), COEF_CONST(0.0736064637), COEF_CONST(0.0790837596), COEF_CONST(0.0790837596), COEF_CONST(0.0790837596) },
515 { COEF_CONST(0.0000000000), COEF_CONST(0.0195860576), COEF_CONST(0.0303269852), COEF_CONST(0.0448519274), COEF_CONST(0.0522022017), COEF_CONST(0.0560750040), COEF_CONST(0.0560750040), COEF_CONST(0.0560750040) },
516 { COEF_CONST(0.0000000000), COEF_CONST(0.0110363955), COEF_CONST(0.0170857974), COEF_CONST(0.0252592108), COEF_CONST(0.0293916021), COEF_CONST(0.0315673054), COEF_CONST(0.0315673054), COEF_CONST(0.0315673054) },
517 { COEF_CONST(0.0000000000), COEF_CONST(0.0062101284), COEF_CONST(0.0096138203), COEF_CONST(0.0142109649), COEF_CONST(0.0165345659), COEF_CONST(0.0177576316), COEF_CONST(0.0177576316), COEF_CONST(0.0177576316) },
518 { COEF_CONST(0.0000000000), COEF_CONST(0.0034934509), COEF_CONST(0.0054071189), COEF_CONST(0.0079928316), COEF_CONST(0.0092994041), COEF_CONST(0.0099871631), COEF_CONST(0.0099871631), COEF_CONST(0.0099871631) },
519 { COEF_CONST(0.0000000000), COEF_CONST(0.0019645397), COEF_CONST(0.0030419905), COEF_CONST(0.0044951511), COEF_CONST(0.0052291853), COEF_CONST(0.0056166498), COEF_CONST(0.0056166498), COEF_CONST(0.0056166498) },
520 { COEF_CONST(0.0000000000), COEF_CONST(0.0011053943), COEF_CONST(0.0017089869), COEF_CONST(0.0025283670), COEF_CONST(0.0029398552), COEF_CONST(0.0031573685), COEF_CONST(0.0031573685), COEF_CONST(0.0031573685) }
521 };
522
523 static const real_t sf_iid_normal[] = {
524 COEF_CONST(1.4119827747), COEF_CONST(1.4031381607), COEF_CONST(1.3868767023),
525 COEF_CONST(1.3483997583), COEF_CONST(1.2912493944), COEF_CONST(1.1960374117),
526 COEF_CONST(1.1073724031), COEF_CONST(1.0000000000), COEF_CONST(0.8796171546),
527 COEF_CONST(0.7546485662), COEF_CONST(0.5767799020), COEF_CONST(0.4264014363),
528 COEF_CONST(0.2767182887), COEF_CONST(0.1766446233), COEF_CONST(0.0794016272)
529 };
530
531 static const real_t sf_iid_fine[] = {
532 COEF_CONST(1.4142065048), COEF_CONST(1.4141912460), COEF_CONST(1.4141428471),
533 COEF_CONST(1.4139900208), COEF_CONST(1.4135069847), COEF_CONST(1.4119827747),
534 COEF_CONST(1.4097729921), COEF_CONST(1.4053947926), COEF_CONST(1.3967796564),
535 COEF_CONST(1.3800530434), COEF_CONST(1.3483997583), COEF_CONST(1.3139201403),
536 COEF_CONST(1.2643101215), COEF_CONST(1.1960374117), COEF_CONST(1.1073724031),
537 COEF_CONST(1.0000000000), COEF_CONST(0.8796171546), COEF_CONST(0.7546485662),
538 COEF_CONST(0.6336560845), COEF_CONST(0.5230810642), COEF_CONST(0.4264014363),
539 COEF_CONST(0.3089554012), COEF_CONST(0.2213746458), COEF_CONST(0.1576878875),
540 COEF_CONST(0.1119822487), COEF_CONST(0.0794016272), COEF_CONST(0.0446990170),
541 COEF_CONST(0.0251446925), COEF_CONST(0.0141414283), COEF_CONST(0.0079525812),
542 COEF_CONST(0.0044721137)
543 };
544
545 #ifdef __cplusplus
546 }
547 #endif
548 #endif
549
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: pulse.c,v 1.21 2007/11/01 12:33:34 menno Exp $
28 **/
29 #include "common.h"
30 #include "structs.h"
31
32 #include "syntax.h"
33 #include "pulse.h"
34
35 uint8_t pulse_decode(ic_stream *ics, int16_t *spec_data, uint16_t framelen)
36 {
37 uint8_t i;
38 uint16_t k;
39 pulse_info *pul = &(ics->pul);
40
41 k = min(ics->swb_offset[pul->pulse_start_sfb], ics->swb_offset_max);
42
43 for (i = 0; i <= pul->number_pulse; i++)
44 {
45 k += pul->pulse_offset[i];
46
47 if (k >= framelen)
48 return 15; /* should not be possible */
49
50 if (spec_data[k] > 0)
51 spec_data[k] += pul->pulse_amp[i];
52 else
53 spec_data[k] -= pul->pulse_amp[i];
54 }
55
56 return 0;
57 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: pulse.h,v 1.20 2007/11/01 12:33:34 menno Exp $
28 **/
29
30 #ifndef __PULSE_H__
31 #define __PULSE_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 uint8_t pulse_decode(ic_stream *ics, int16_t *spec_coef, uint16_t framelen);
38
39 #ifdef __cplusplus
40 }
41 #endif
42 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: rvlc.c,v 1.21 2007/11/01 12:33:34 menno Exp $
28 **/
29
30 /* RVLC scalefactor decoding
31 *
32 * RVLC works like this:
33 * 1. Only symmetric huffman codewords are used
34 * 2. Total length of the scalefactor data is stored in the bitsream
35 * 3. Scalefactors are DPCM coded
36 * 4. Next to the starting value for DPCM the ending value is also stored
37 *
38 * With all this it is possible to read the scalefactor data from 2 sides.
39 * If there is a bit error in the scalefactor data it is possible to start
40 * decoding from the other end of the data, to find all but 1 scalefactor.
41 */
42
43 #include "common.h"
44 #include "structs.h"
45
46 #include <stdlib.h>
47
48 #include "syntax.h"
49 #include "bits.h"
50 #include "rvlc.h"
51
52
53 #ifdef ERROR_RESILIENCE
54
55 //#define PRINT_RVLC
56
57 /* static function declarations */
58 static uint8_t rvlc_decode_sf_forward(ic_stream *ics,
59 bitfile *ld_sf,
60 bitfile *ld_esc,
61 uint8_t *is_used);
62 #if 0
63 static uint8_t rvlc_decode_sf_reverse(ic_stream *ics,
64 bitfile *ld_sf,
65 bitfile *ld_esc,
66 uint8_t is_used);
67 #endif
68 static int8_t rvlc_huffman_sf(bitfile *ld_sf, bitfile *ld_esc,
69 int8_t direction);
70 static int8_t rvlc_huffman_esc(bitfile *ld_esc, int8_t direction);
71
72
73 uint8_t rvlc_scale_factor_data(ic_stream *ics, bitfile *ld)
74 {
75 uint8_t bits = 9;
76
77 ics->sf_concealment = faad_get1bit(ld
78 DEBUGVAR(1,149,"rvlc_scale_factor_data(): sf_concealment"));
79 ics->rev_global_gain = (uint8_t)faad_getbits(ld, 8
80 DEBUGVAR(1,150,"rvlc_scale_factor_data(): rev_global_gain"));
81
82 if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
83 bits = 11;
84
85 /* the number of bits used for the huffman codewords */
86 ics->length_of_rvlc_sf = (uint16_t)faad_getbits(ld, bits
87 DEBUGVAR(1,151,"rvlc_scale_factor_data(): length_of_rvlc_sf"));
88
89 if (ics->noise_used)
90 {
91 ics->dpcm_noise_nrg = (uint16_t)faad_getbits(ld, 9
92 DEBUGVAR(1,152,"rvlc_scale_factor_data(): dpcm_noise_nrg"));
93
94 ics->length_of_rvlc_sf -= 9;
95 }
96
97 ics->sf_escapes_present = faad_get1bit(ld
98 DEBUGVAR(1,153,"rvlc_scale_factor_data(): sf_escapes_present"));
99
100 if (ics->sf_escapes_present)
101 {
102 ics->length_of_rvlc_escapes = (uint8_t)faad_getbits(ld, 8
103 DEBUGVAR(1,154,"rvlc_scale_factor_data(): length_of_rvlc_escapes"));
104 }
105
106 if (ics->noise_used)
107 {
108 ics->dpcm_noise_last_position = (uint16_t)faad_getbits(ld, 9
109 DEBUGVAR(1,155,"rvlc_scale_factor_data(): dpcm_noise_last_position"));
110 }
111
112 return 0;
113 }
114
115 uint8_t rvlc_decode_scale_factors(ic_stream *ics, bitfile *ld)
116 {
117 uint8_t result;
118 uint8_t intensity_used = 0;
119 uint8_t *rvlc_sf_buffer = NULL;
120 uint8_t *rvlc_esc_buffer = NULL;
121 bitfile ld_rvlc_sf, ld_rvlc_esc;
122 // bitfile ld_rvlc_sf_rev, ld_rvlc_esc_rev;
123
124 if (ics->length_of_rvlc_sf > 0)
125 {
126 /* We read length_of_rvlc_sf bits here to put it in a
127 seperate bitfile.
128 */
129 rvlc_sf_buffer = faad_getbitbuffer(ld, ics->length_of_rvlc_sf
130 DEBUGVAR(1,156,"rvlc_decode_scale_factors(): bitbuffer: length_of_rvlc_sf"));
131
132 faad_initbits(&ld_rvlc_sf, (void*)rvlc_sf_buffer, bit2byte(ics->length_of_rvlc_sf));
133 // faad_initbits_rev(&ld_rvlc_sf_rev, (void*)rvlc_sf_buffer,
134 // ics->length_of_rvlc_sf);
135 }
136
137 if (ics->sf_escapes_present)
138 {
139 /* We read length_of_rvlc_escapes bits here to put it in a
140 seperate bitfile.
141 */
142 rvlc_esc_buffer = faad_getbitbuffer(ld, ics->length_of_rvlc_escapes
143 DEBUGVAR(1,157,"rvlc_decode_scale_factors(): bitbuffer: length_of_rvlc_escapes"));
144
145 faad_initbits(&ld_rvlc_esc, (void*)rvlc_esc_buffer, bit2byte(ics->length_of_rvlc_escapes));
146 // faad_initbits_rev(&ld_rvlc_esc_rev, (void*)rvlc_esc_buffer,
147 // ics->length_of_rvlc_escapes);
148 }
149
150 /* decode the rvlc scale factors and escapes */
151 result = rvlc_decode_sf_forward(ics, &ld_rvlc_sf,
152 &ld_rvlc_esc, &intensity_used);
153 // result = rvlc_decode_sf_reverse(ics, &ld_rvlc_sf_rev,
154 // &ld_rvlc_esc_rev, intensity_used);
155
156
157 if (rvlc_esc_buffer) faad_free(rvlc_esc_buffer);
158 if (rvlc_sf_buffer) faad_free(rvlc_sf_buffer);
159
160 if (ics->length_of_rvlc_sf > 0)
161 faad_endbits(&ld_rvlc_sf);
162 if (ics->sf_escapes_present)
163 faad_endbits(&ld_rvlc_esc);
164
165 return result;
166 }
167
168 static uint8_t rvlc_decode_sf_forward(ic_stream *ics, bitfile *ld_sf, bitfile *ld_esc,
169 uint8_t *intensity_used)
170 {
171 int8_t g, sfb;
172 int8_t t = 0;
173 int8_t error = 0;
174 int8_t noise_pcm_flag = 1;
175
176 int16_t scale_factor = ics->global_gain;
177 int16_t is_position = 0;
178 int16_t noise_energy = ics->global_gain - 90 - 256;
179
180 #ifdef PRINT_RVLC
181 printf("\nglobal_gain: %d\n", ics->global_gain);
182 #endif
183
184 for (g = 0; g < ics->num_window_groups; g++)
185 {
186 for (sfb = 0; sfb < ics->max_sfb; sfb++)
187 {
188 if (error)
189 {
190 ics->scale_factors[g][sfb] = 0;
191 } else {
192 switch (ics->sfb_cb[g][sfb])
193 {
194 case ZERO_HCB: /* zero book */
195 ics->scale_factors[g][sfb] = 0;
196 break;
197 case INTENSITY_HCB: /* intensity books */
198 case INTENSITY_HCB2:
199
200 *intensity_used = 1;
201
202 /* decode intensity position */
203 t = rvlc_huffman_sf(ld_sf, ld_esc, +1);
204
205 is_position += t;
206 ics->scale_factors[g][sfb] = is_position;
207
208 break;
209 case NOISE_HCB: /* noise books */
210
211 /* decode noise energy */
212 if (noise_pcm_flag)
213 {
214 int16_t n = ics->dpcm_noise_nrg;
215 noise_pcm_flag = 0;
216 noise_energy += n;
217 } else {
218 t = rvlc_huffman_sf(ld_sf, ld_esc, +1);
219 noise_energy += t;
220 }
221
222 ics->scale_factors[g][sfb] = noise_energy;
223
224 break;
225 default: /* spectral books */
226
227 /* decode scale factor */
228 t = rvlc_huffman_sf(ld_sf, ld_esc, +1);
229
230 scale_factor += t;
231 if (scale_factor < 0)
232 return 4;
233
234 ics->scale_factors[g][sfb] = scale_factor;
235
236 break;
237 }
238 #ifdef PRINT_RVLC
239 printf("%3d:%4d%4d\n", sfb, ics->sfb_cb[g][sfb],
240 ics->scale_factors[g][sfb]);
241 #endif
242 if (t == 99)
243 {
244 error = 1;
245 }
246 }
247 }
248 }
249 #ifdef PRINT_RVLC
250 printf("\n\n");
251 #endif
252
253 return 0;
254 }
255
256 #if 0 // not used right now, doesn't work correctly yet
257 static uint8_t rvlc_decode_sf_reverse(ic_stream *ics, bitfile *ld_sf, bitfile *ld_esc,
258 uint8_t intensity_used)
259 {
260 int8_t g, sfb;
261 int8_t t = 0;
262 int8_t error = 0;
263 int8_t noise_pcm_flag = 1, is_pcm_flag = 1, sf_pcm_flag = 1;
264
265 int16_t scale_factor = ics->rev_global_gain;
266 int16_t is_position = 0;
267 int16_t noise_energy = ics->rev_global_gain;
268
269 #ifdef PRINT_RVLC
270 printf("\nrev_global_gain: %d\n", ics->rev_global_gain);
271 #endif
272
273 if (intensity_used)
274 {
275 is_position = rvlc_huffman_sf(ld_sf, ld_esc, -1);
276 #ifdef PRINT_RVLC
277 printf("is_position: %d\n", is_position);
278 #endif
279 }
280
281 for (g = ics->num_window_groups-1; g >= 0; g--)
282 {
283 for (sfb = ics->max_sfb-1; sfb >= 0; sfb--)
284 {
285 if (error)
286 {
287 ics->scale_factors[g][sfb] = 0;
288 } else {
289 switch (ics->sfb_cb[g][sfb])
290 {
291 case ZERO_HCB: /* zero book */
292 ics->scale_factors[g][sfb] = 0;
293 break;
294 case INTENSITY_HCB: /* intensity books */
295 case INTENSITY_HCB2:
296
297 if (is_pcm_flag)
298 {
299 is_pcm_flag = 0;
300 ics->scale_factors[g][sfb] = is_position;
301 } else {
302 t = rvlc_huffman_sf(ld_sf, ld_esc, -1);
303 is_position -= t;
304
305 ics->scale_factors[g][sfb] = (uint8_t)is_position;
306 }
307 break;
308 case NOISE_HCB: /* noise books */
309
310 /* decode noise energy */
311 if (noise_pcm_flag)
312 {
313 noise_pcm_flag = 0;
314 noise_energy = ics->dpcm_noise_last_position;
315 } else {
316 t = rvlc_huffman_sf(ld_sf, ld_esc, -1);
317 noise_energy -= t;
318 }
319
320 ics->scale_factors[g][sfb] = (uint8_t)noise_energy;
321 break;
322 default: /* spectral books */
323
324 if (sf_pcm_flag || (sfb == 0))
325 {
326 sf_pcm_flag = 0;
327 if (sfb == 0)
328 scale_factor = ics->global_gain;
329 } else {
330 /* decode scale factor */
331 t = rvlc_huffman_sf(ld_sf, ld_esc, -1);
332 scale_factor -= t;
333 }
334
335 if (scale_factor < 0)
336 return 4;
337
338 ics->scale_factors[g][sfb] = (uint8_t)scale_factor;
339 break;
340 }
341 #ifdef PRINT_RVLC
342 printf("%3d:%4d%4d\n", sfb, ics->sfb_cb[g][sfb],
343 ics->scale_factors[g][sfb]);
344 #endif
345 if (t == 99)
346 {
347 error = 1;
348 }
349 }
350 }
351 }
352
353 #ifdef PRINT_RVLC
354 printf("\n\n");
355 #endif
356
357 return 0;
358 }
359 #endif
360
361 /* index == 99 means not allowed codeword */
362 static rvlc_huff_table book_rvlc[] = {
363 /*index length codeword */
364 { 0, 1, 0 }, /* 0 */
365 { -1, 3, 5 }, /* 101 */
366 { 1, 3, 7 }, /* 111 */
367 { -2, 4, 9 }, /* 1001 */
368 { -3, 5, 17 }, /* 10001 */
369 { 2, 5, 27 }, /* 11011 */
370 { -4, 6, 33 }, /* 100001 */
371 { 99, 6, 50 }, /* 110010 */
372 { 3, 6, 51 }, /* 110011 */
373 { 99, 6, 52 }, /* 110100 */
374 { -7, 7, 65 }, /* 1000001 */
375 { 99, 7, 96 }, /* 1100000 */
376 { 99, 7, 98 }, /* 1100010 */
377 { 7, 7, 99 }, /* 1100011 */
378 { 4, 7, 107 }, /* 1101011 */
379 { -5, 8, 129 }, /* 10000001 */
380 { 99, 8, 194 }, /* 11000010 */
381 { 5, 8, 195 }, /* 11000011 */
382 { 99, 8, 212 }, /* 11010100 */
383 { 99, 9, 256 }, /* 100000000 */
384 { -6, 9, 257 }, /* 100000001 */
385 { 99, 9, 426 }, /* 110101010 */
386 { 6, 9, 427 }, /* 110101011 */
387 { 99, 10, 0 } /* Shouldn't come this far */
388 };
389
390 static rvlc_huff_table book_escape[] = {
391 /*index length codeword */
392 { 1, 2, 0 },
393 { 0, 2, 2 },
394 { 3, 3, 2 },
395 { 2, 3, 6 },
396 { 4, 4, 14 },
397 { 7, 5, 13 },
398 { 6, 5, 15 },
399 { 5, 5, 31 },
400 { 11, 6, 24 },
401 { 10, 6, 25 },
402 { 9, 6, 29 },
403 { 8, 6, 61 },
404 { 13, 7, 56 },
405 { 12, 7, 120 },
406 { 15, 8, 114 },
407 { 14, 8, 242 },
408 { 17, 9, 230 },
409 { 16, 9, 486 },
410 { 19, 10, 463 },
411 { 18, 10, 974 },
412 { 22, 11, 925 },
413 { 20, 11, 1950 },
414 { 21, 11, 1951 },
415 { 23, 12, 1848 },
416 { 25, 13, 3698 },
417 { 24, 14, 7399 },
418 { 26, 15, 14797 },
419 { 49, 19, 236736 },
420 { 50, 19, 236737 },
421 { 51, 19, 236738 },
422 { 52, 19, 236739 },
423 { 53, 19, 236740 },
424 { 27, 20, 473482 },
425 { 28, 20, 473483 },
426 { 29, 20, 473484 },
427 { 30, 20, 473485 },
428 { 31, 20, 473486 },
429 { 32, 20, 473487 },
430 { 33, 20, 473488 },
431 { 34, 20, 473489 },
432 { 35, 20, 473490 },
433 { 36, 20, 473491 },
434 { 37, 20, 473492 },
435 { 38, 20, 473493 },
436 { 39, 20, 473494 },
437 { 40, 20, 473495 },
438 { 41, 20, 473496 },
439 { 42, 20, 473497 },
440 { 43, 20, 473498 },
441 { 44, 20, 473499 },
442 { 45, 20, 473500 },
443 { 46, 20, 473501 },
444 { 47, 20, 473502 },
445 { 48, 20, 473503 },
446 { 99, 21, 0 } /* Shouldn't come this far */
447 };
448
449 static int8_t rvlc_huffman_sf(bitfile *ld_sf, bitfile *ld_esc,
450 int8_t direction)
451 {
452 uint8_t i, j;
453 int8_t index;
454 uint32_t cw;
455 rvlc_huff_table *h = book_rvlc;
456
457 i = h->len;
458 if (direction > 0)
459 cw = faad_getbits(ld_sf, i DEBUGVAR(1,0,""));
460 else
461 cw = faad_getbits_rev(ld_sf, i DEBUGVAR(1,0,""));
462
463 while ((cw != h->cw)
464 && (i < 10))
465 {
466 h++;
467 j = h->len-i;
468 i += j;
469 cw <<= j;
470 if (direction > 0)
471 cw |= faad_getbits(ld_sf, j DEBUGVAR(1,0,""));
472 else
473 cw |= faad_getbits_rev(ld_sf, j DEBUGVAR(1,0,""));
474 }
475
476 index = h->index;
477
478 if (index == +ESC_VAL)
479 {
480 int8_t esc = rvlc_huffman_esc(ld_esc, direction);
481 if (esc == 99)
482 return 99;
483 index += esc;
484 #ifdef PRINT_RVLC
485 printf("esc: %d - ", esc);
486 #endif
487 }
488 if (index == -ESC_VAL)
489 {
490 int8_t esc = rvlc_huffman_esc(ld_esc, direction);
491 if (esc == 99)
492 return 99;
493 index -= esc;
494 #ifdef PRINT_RVLC
495 printf("esc: %d - ", esc);
496 #endif
497 }
498
499 return index;
500 }
501
502 static int8_t rvlc_huffman_esc(bitfile *ld,
503 int8_t direction)
504 {
505 uint8_t i, j;
506 uint32_t cw;
507 rvlc_huff_table *h = book_escape;
508
509 i = h->len;
510 if (direction > 0)
511 cw = faad_getbits(ld, i DEBUGVAR(1,0,""));
512 else
513 cw = faad_getbits_rev(ld, i DEBUGVAR(1,0,""));
514
515 while ((cw != h->cw)
516 && (i < 21))
517 {
518 h++;
519 j = h->len-i;
520 i += j;
521 cw <<= j;
522 if (direction > 0)
523 cw |= faad_getbits(ld, j DEBUGVAR(1,0,""));
524 else
525 cw |= faad_getbits_rev(ld, j DEBUGVAR(1,0,""));
526 }
527
528 return h->index;
529 }
530
531 #endif
532
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: rvlc.h,v 1.17 2007/11/01 12:33:34 menno Exp $
28 **/
29
30 #ifndef __RVLC_SCF_H__
31 #define __RVLC_SCF_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 typedef struct
38 {
39 int8_t index;
40 uint8_t len;
41 uint32_t cw;
42 } rvlc_huff_table;
43
44
45 #define ESC_VAL 7
46
47
48 uint8_t rvlc_scale_factor_data(ic_stream *ics, bitfile *ld);
49 uint8_t rvlc_decode_scale_factors(ic_stream *ics, bitfile *ld);
50
51
52 #ifdef __cplusplus
53 }
54 #endif
55 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_dct.c,v 1.20 2007/11/01 12:33:34 menno Exp $
28 **/
29
30
31 /* Most of the DCT/DST codes here are generated using Spiral which is GPL
32 * For more info see: http://www.spiral.net/
33 */
34
35 #include "common.h"
36
37 #ifdef SBR_DEC
38
39 #ifdef _MSC_VER
40 #pragma warning(disable:4305)
41 #pragma warning(disable:4244)
42 #endif
43
44
45 #include "sbr_dct.h"
46
47 void DCT4_32(real_t *y, real_t *x)
48 {
49 real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
50 real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
51 real_t f21, f22, f23, f24, f25, f26, f27, f28, f29, f30;
52 real_t f31, f32, f33, f34, f35, f36, f37, f38, f39, f40;
53 real_t f41, f42, f43, f44, f45, f46, f47, f48, f49, f50;
54 real_t f51, f52, f53, f54, f55, f56, f57, f58, f59, f60;
55 real_t f61, f62, f63, f64, f65, f66, f67, f68, f69, f70;
56 real_t f71, f72, f73, f74, f75, f76, f77, f78, f79, f80;
57 real_t f81, f82, f83, f84, f85, f86, f87, f88, f89, f90;
58 real_t f91, f92, f93, f94, f95, f96, f97, f98, f99, f100;
59 real_t f101, f102, f103, f104, f105, f106, f107, f108, f109, f110;
60 real_t f111, f112, f113, f114, f115, f116, f117, f118, f119, f120;
61 real_t f121, f122, f123, f124, f125, f126, f127, f128, f129, f130;
62 real_t f131, f132, f133, f134, f135, f136, f137, f138, f139, f140;
63 real_t f141, f142, f143, f144, f145, f146, f147, f148, f149, f150;
64 real_t f151, f152, f153, f154, f155, f156, f157, f158, f159, f160;
65 real_t f161, f162, f163, f164, f165, f166, f167, f168, f169, f170;
66 real_t f171, f172, f173, f174, f175, f176, f177, f178, f179, f180;
67 real_t f181, f182, f183, f184, f185, f186, f187, f188, f189, f190;
68 real_t f191, f192, f193, f194, f195, f196, f197, f198, f199, f200;
69 real_t f201, f202, f203, f204, f205, f206, f207, f208, f209, f210;
70 real_t f211, f212, f213, f214, f215, f216, f217, f218, f219, f220;
71 real_t f221, f222, f223, f224, f225, f226, f227, f228, f229, f230;
72 real_t f231, f232, f233, f234, f235, f236, f237, f238, f239, f240;
73 real_t f241, f242, f243, f244, f245, f246, f247, f248, f249, f250;
74 real_t f251, f252, f253, f254, f255, f256, f257, f258, f259, f260;
75 real_t f261, f262, f263, f264, f265, f266, f267, f268, f269, f270;
76 real_t f271, f272, f273, f274, f275, f276, f277, f278, f279, f280;
77 real_t f281, f282, f283, f284, f285, f286, f287, f288, f289, f290;
78 real_t f291, f292, f293, f294, f295, f296, f297, f298, f299, f300;
79 real_t f301, f302, f303, f304, f305, f306, f307, f310, f311, f312;
80 real_t f313, f316, f317, f318, f319, f322, f323, f324, f325, f328;
81 real_t f329, f330, f331, f334, f335, f336, f337, f340, f341, f342;
82 real_t f343, f346, f347, f348, f349, f352, f353, f354, f355, f358;
83 real_t f359, f360, f361, f364, f365, f366, f367, f370, f371, f372;
84 real_t f373, f376, f377, f378, f379, f382, f383, f384, f385, f388;
85 real_t f389, f390, f391, f394, f395, f396, f397;
86
87 f0 = x[15] - x[16];
88 f1 = x[15] + x[16];
89 f2 = MUL_F(FRAC_CONST(0.7071067811865476), f1);
90 f3 = MUL_F(FRAC_CONST(0.7071067811865476), f0);
91 f4 = x[8] - x[23];
92 f5 = x[8] + x[23];
93 f6 = MUL_F(FRAC_CONST(0.7071067811865476), f5);
94 f7 = MUL_F(FRAC_CONST(0.7071067811865476), f4);
95 f8 = x[12] - x[19];
96 f9 = x[12] + x[19];
97 f10 = MUL_F(FRAC_CONST(0.7071067811865476), f9);
98 f11 = MUL_F(FRAC_CONST(0.7071067811865476), f8);
99 f12 = x[11] - x[20];
100 f13 = x[11] + x[20];
101 f14 = MUL_F(FRAC_CONST(0.7071067811865476), f13);
102 f15 = MUL_F(FRAC_CONST(0.7071067811865476), f12);
103 f16 = x[14] - x[17];
104 f17 = x[14] + x[17];
105 f18 = MUL_F(FRAC_CONST(0.7071067811865476), f17);
106 f19 = MUL_F(FRAC_CONST(0.7071067811865476), f16);
107 f20 = x[9] - x[22];
108 f21 = x[9] + x[22];
109 f22 = MUL_F(FRAC_CONST(0.7071067811865476), f21);
110 f23 = MUL_F(FRAC_CONST(0.7071067811865476), f20);
111 f24 = x[13] - x[18];
112 f25 = x[13] + x[18];
113 f26 = MUL_F(FRAC_CONST(0.7071067811865476), f25);
114 f27 = MUL_F(FRAC_CONST(0.7071067811865476), f24);
115 f28 = x[10] - x[21];
116 f29 = x[10] + x[21];
117 f30 = MUL_F(FRAC_CONST(0.7071067811865476), f29);
118 f31 = MUL_F(FRAC_CONST(0.7071067811865476), f28);
119 f32 = x[0] - f2;
120 f33 = x[0] + f2;
121 f34 = x[31] - f3;
122 f35 = x[31] + f3;
123 f36 = x[7] - f6;
124 f37 = x[7] + f6;
125 f38 = x[24] - f7;
126 f39 = x[24] + f7;
127 f40 = x[3] - f10;
128 f41 = x[3] + f10;
129 f42 = x[28] - f11;
130 f43 = x[28] + f11;
131 f44 = x[4] - f14;
132 f45 = x[4] + f14;
133 f46 = x[27] - f15;
134 f47 = x[27] + f15;
135 f48 = x[1] - f18;
136 f49 = x[1] + f18;
137 f50 = x[30] - f19;
138 f51 = x[30] + f19;
139 f52 = x[6] - f22;
140 f53 = x[6] + f22;
141 f54 = x[25] - f23;
142 f55 = x[25] + f23;
143 f56 = x[2] - f26;
144 f57 = x[2] + f26;
145 f58 = x[29] - f27;
146 f59 = x[29] + f27;
147 f60 = x[5] - f30;
148 f61 = x[5] + f30;
149 f62 = x[26] - f31;
150 f63 = x[26] + f31;
151 f64 = f39 + f37;
152 f65 = MUL_F(FRAC_CONST(-0.5411961001461969), f39);
153 f66 = MUL_F(FRAC_CONST(0.9238795325112867), f64);
154 f67 = MUL_C(COEF_CONST(1.3065629648763766), f37);
155 f68 = f65 + f66;
156 f69 = f67 - f66;
157 f70 = f38 + f36;
158 f71 = MUL_C(COEF_CONST(1.3065629648763770), f38);
159 f72 = MUL_F(FRAC_CONST(-0.3826834323650904), f70);
160 f73 = MUL_F(FRAC_CONST(0.5411961001461961), f36);
161 f74 = f71 + f72;
162 f75 = f73 - f72;
163 f76 = f47 + f45;
164 f77 = MUL_F(FRAC_CONST(-0.5411961001461969), f47);
165 f78 = MUL_F(FRAC_CONST(0.9238795325112867), f76);
166 f79 = MUL_C(COEF_CONST(1.3065629648763766), f45);
167 f80 = f77 + f78;
168 f81 = f79 - f78;
169 f82 = f46 + f44;
170 f83 = MUL_C(COEF_CONST(1.3065629648763770), f46);
171 f84 = MUL_F(FRAC_CONST(-0.3826834323650904), f82);
172 f85 = MUL_F(FRAC_CONST(0.5411961001461961), f44);
173 f86 = f83 + f84;
174 f87 = f85 - f84;
175 f88 = f55 + f53;
176 f89 = MUL_F(FRAC_CONST(-0.5411961001461969), f55);
177 f90 = MUL_F(FRAC_CONST(0.9238795325112867), f88);
178 f91 = MUL_C(COEF_CONST(1.3065629648763766), f53);
179 f92 = f89 + f90;
180 f93 = f91 - f90;
181 f94 = f54 + f52;
182 f95 = MUL_C(COEF_CONST(1.3065629648763770), f54);
183 f96 = MUL_F(FRAC_CONST(-0.3826834323650904), f94);
184 f97 = MUL_F(FRAC_CONST(0.5411961001461961), f52);
185 f98 = f95 + f96;
186 f99 = f97 - f96;
187 f100 = f63 + f61;
188 f101 = MUL_F(FRAC_CONST(-0.5411961001461969), f63);
189 f102 = MUL_F(FRAC_CONST(0.9238795325112867), f100);
190 f103 = MUL_C(COEF_CONST(1.3065629648763766), f61);
191 f104 = f101 + f102;
192 f105 = f103 - f102;
193 f106 = f62 + f60;
194 f107 = MUL_C(COEF_CONST(1.3065629648763770), f62);
195 f108 = MUL_F(FRAC_CONST(-0.3826834323650904), f106);
196 f109 = MUL_F(FRAC_CONST(0.5411961001461961), f60);
197 f110 = f107 + f108;
198 f111 = f109 - f108;
199 f112 = f33 - f68;
200 f113 = f33 + f68;
201 f114 = f35 - f69;
202 f115 = f35 + f69;
203 f116 = f32 - f74;
204 f117 = f32 + f74;
205 f118 = f34 - f75;
206 f119 = f34 + f75;
207 f120 = f41 - f80;
208 f121 = f41 + f80;
209 f122 = f43 - f81;
210 f123 = f43 + f81;
211 f124 = f40 - f86;
212 f125 = f40 + f86;
213 f126 = f42 - f87;
214 f127 = f42 + f87;
215 f128 = f49 - f92;
216 f129 = f49 + f92;
217 f130 = f51 - f93;
218 f131 = f51 + f93;
219 f132 = f48 - f98;
220 f133 = f48 + f98;
221 f134 = f50 - f99;
222 f135 = f50 + f99;
223 f136 = f57 - f104;
224 f137 = f57 + f104;
225 f138 = f59 - f105;
226 f139 = f59 + f105;
227 f140 = f56 - f110;
228 f141 = f56 + f110;
229 f142 = f58 - f111;
230 f143 = f58 + f111;
231 f144 = f123 + f121;
232 f145 = MUL_F(FRAC_CONST(-0.7856949583871021), f123);
233 f146 = MUL_F(FRAC_CONST(0.9807852804032304), f144);
234 f147 = MUL_C(COEF_CONST(1.1758756024193588), f121);
235 f148 = f145 + f146;
236 f149 = f147 - f146;
237 f150 = f127 + f125;
238 f151 = MUL_F(FRAC_CONST(0.2758993792829431), f127);
239 f152 = MUL_F(FRAC_CONST(0.5555702330196022), f150);
240 f153 = MUL_C(COEF_CONST(1.3870398453221475), f125);
241 f154 = f151 + f152;
242 f155 = f153 - f152;
243 f156 = f122 + f120;
244 f157 = MUL_C(COEF_CONST(1.1758756024193591), f122);
245 f158 = MUL_F(FRAC_CONST(-0.1950903220161287), f156);
246 f159 = MUL_F(FRAC_CONST(0.7856949583871016), f120);
247 f160 = f157 + f158;
248 f161 = f159 - f158;
249 f162 = f126 + f124;
250 f163 = MUL_C(COEF_CONST(1.3870398453221473), f126);
251 f164 = MUL_F(FRAC_CONST(-0.8314696123025455), f162);
252 f165 = MUL_F(FRAC_CONST(-0.2758993792829436), f124);
253 f166 = f163 + f164;
254 f167 = f165 - f164;
255 f168 = f139 + f137;
256 f169 = MUL_F(FRAC_CONST(-0.7856949583871021), f139);
257 f170 = MUL_F(FRAC_CONST(0.9807852804032304), f168);
258 f171 = MUL_C(COEF_CONST(1.1758756024193588), f137);
259 f172 = f169 + f170;
260 f173 = f171 - f170;
261 f174 = f143 + f141;
262 f175 = MUL_F(FRAC_CONST(0.2758993792829431), f143);
263 f176 = MUL_F(FRAC_CONST(0.5555702330196022), f174);
264 f177 = MUL_C(COEF_CONST(1.3870398453221475), f141);
265 f178 = f175 + f176;
266 f179 = f177 - f176;
267 f180 = f138 + f136;
268 f181 = MUL_C(COEF_CONST(1.1758756024193591), f138);
269 f182 = MUL_F(FRAC_CONST(-0.1950903220161287), f180);
270 f183 = MUL_F(FRAC_CONST(0.7856949583871016), f136);
271 f184 = f181 + f182;
272 f185 = f183 - f182;
273 f186 = f142 + f140;
274 f187 = MUL_C(COEF_CONST(1.3870398453221473), f142);
275 f188 = MUL_F(FRAC_CONST(-0.8314696123025455), f186);
276 f189 = MUL_F(FRAC_CONST(-0.2758993792829436), f140);
277 f190 = f187 + f188;
278 f191 = f189 - f188;
279 f192 = f113 - f148;
280 f193 = f113 + f148;
281 f194 = f115 - f149;
282 f195 = f115 + f149;
283 f196 = f117 - f154;
284 f197 = f117 + f154;
285 f198 = f119 - f155;
286 f199 = f119 + f155;
287 f200 = f112 - f160;
288 f201 = f112 + f160;
289 f202 = f114 - f161;
290 f203 = f114 + f161;
291 f204 = f116 - f166;
292 f205 = f116 + f166;
293 f206 = f118 - f167;
294 f207 = f118 + f167;
295 f208 = f129 - f172;
296 f209 = f129 + f172;
297 f210 = f131 - f173;
298 f211 = f131 + f173;
299 f212 = f133 - f178;
300 f213 = f133 + f178;
301 f214 = f135 - f179;
302 f215 = f135 + f179;
303 f216 = f128 - f184;
304 f217 = f128 + f184;
305 f218 = f130 - f185;
306 f219 = f130 + f185;
307 f220 = f132 - f190;
308 f221 = f132 + f190;
309 f222 = f134 - f191;
310 f223 = f134 + f191;
311 f224 = f211 + f209;
312 f225 = MUL_F(FRAC_CONST(-0.8971675863426361), f211);
313 f226 = MUL_F(FRAC_CONST(0.9951847266721968), f224);
314 f227 = MUL_C(COEF_CONST(1.0932018670017576), f209);
315 f228 = f225 + f226;
316 f229 = f227 - f226;
317 f230 = f215 + f213;
318 f231 = MUL_F(FRAC_CONST(-0.4105245275223571), f215);
319 f232 = MUL_F(FRAC_CONST(0.8819212643483549), f230);
320 f233 = MUL_C(COEF_CONST(1.3533180011743529), f213);
321 f234 = f231 + f232;
322 f235 = f233 - f232;
323 f236 = f219 + f217;
324 f237 = MUL_F(FRAC_CONST(0.1386171691990915), f219);
325 f238 = MUL_F(FRAC_CONST(0.6343932841636455), f236);
326 f239 = MUL_C(COEF_CONST(1.4074037375263826), f217);
327 f240 = f237 + f238;
328 f241 = f239 - f238;
329 f242 = f223 + f221;
330 f243 = MUL_F(FRAC_CONST(0.6666556584777466), f223);
331 f244 = MUL_F(FRAC_CONST(0.2902846772544623), f242);
332 f245 = MUL_C(COEF_CONST(1.2472250129866711), f221);
333 f246 = f243 + f244;
334 f247 = f245 - f244;
335 f248 = f210 + f208;
336 f249 = MUL_C(COEF_CONST(1.0932018670017574), f210);
337 f250 = MUL_F(FRAC_CONST(-0.0980171403295605), f248);
338 f251 = MUL_F(FRAC_CONST(0.8971675863426364), f208);
339 f252 = f249 + f250;
340 f253 = f251 - f250;
341 f254 = f214 + f212;
342 f255 = MUL_C(COEF_CONST(1.3533180011743529), f214);
343 f256 = MUL_F(FRAC_CONST(-0.4713967368259979), f254);
344 f257 = MUL_F(FRAC_CONST(0.4105245275223569), f212);
345 f258 = f255 + f256;
346 f259 = f257 - f256;
347 f260 = f218 + f216;
348 f261 = MUL_C(COEF_CONST(1.4074037375263826), f218);
349 f262 = MUL_F(FRAC_CONST(-0.7730104533627369), f260);
350 f263 = MUL_F(FRAC_CONST(-0.1386171691990913), f216);
351 f264 = f261 + f262;
352 f265 = f263 - f262;
353 f266 = f222 + f220;
354 f267 = MUL_C(COEF_CONST(1.2472250129866711), f222);
355 f268 = MUL_F(FRAC_CONST(-0.9569403357322089), f266);
356 f269 = MUL_F(FRAC_CONST(-0.6666556584777469), f220);
357 f270 = f267 + f268;
358 f271 = f269 - f268;
359 f272 = f193 - f228;
360 f273 = f193 + f228;
361 f274 = f195 - f229;
362 f275 = f195 + f229;
363 f276 = f197 - f234;
364 f277 = f197 + f234;
365 f278 = f199 - f235;
366 f279 = f199 + f235;
367 f280 = f201 - f240;
368 f281 = f201 + f240;
369 f282 = f203 - f241;
370 f283 = f203 + f241;
371 f284 = f205 - f246;
372 f285 = f205 + f246;
373 f286 = f207 - f247;
374 f287 = f207 + f247;
375 f288 = f192 - f252;
376 f289 = f192 + f252;
377 f290 = f194 - f253;
378 f291 = f194 + f253;
379 f292 = f196 - f258;
380 f293 = f196 + f258;
381 f294 = f198 - f259;
382 f295 = f198 + f259;
383 f296 = f200 - f264;
384 f297 = f200 + f264;
385 f298 = f202 - f265;
386 f299 = f202 + f265;
387 f300 = f204 - f270;
388 f301 = f204 + f270;
389 f302 = f206 - f271;
390 f303 = f206 + f271;
391 f304 = f275 + f273;
392 f305 = MUL_F(FRAC_CONST(-0.9751575901732920), f275);
393 f306 = MUL_F(FRAC_CONST(0.9996988186962043), f304);
394 f307 = MUL_C(COEF_CONST(1.0242400472191164), f273);
395 y[0] = f305 + f306;
396 y[31] = f307 - f306;
397 f310 = f279 + f277;
398 f311 = MUL_F(FRAC_CONST(-0.8700688593994936), f279);
399 f312 = MUL_F(FRAC_CONST(0.9924795345987100), f310);
400 f313 = MUL_C(COEF_CONST(1.1148902097979263), f277);
401 y[2] = f311 + f312;
402 y[29] = f313 - f312;
403 f316 = f283 + f281;
404 f317 = MUL_F(FRAC_CONST(-0.7566008898816587), f283);
405 f318 = MUL_F(FRAC_CONST(0.9757021300385286), f316);
406 f319 = MUL_C(COEF_CONST(1.1948033701953984), f281);
407 y[4] = f317 + f318;
408 y[27] = f319 - f318;
409 f322 = f287 + f285;
410 f323 = MUL_F(FRAC_CONST(-0.6358464401941451), f287);
411 f324 = MUL_F(FRAC_CONST(0.9495281805930367), f322);
412 f325 = MUL_C(COEF_CONST(1.2632099209919283), f285);
413 y[6] = f323 + f324;
414 y[25] = f325 - f324;
415 f328 = f291 + f289;
416 f329 = MUL_F(FRAC_CONST(-0.5089684416985408), f291);
417 f330 = MUL_F(FRAC_CONST(0.9142097557035307), f328);
418 f331 = MUL_C(COEF_CONST(1.3194510697085207), f289);
419 y[8] = f329 + f330;
420 y[23] = f331 - f330;
421 f334 = f295 + f293;
422 f335 = MUL_F(FRAC_CONST(-0.3771887988789273), f295);
423 f336 = MUL_F(FRAC_CONST(0.8700869911087114), f334);
424 f337 = MUL_C(COEF_CONST(1.3629851833384954), f293);
425 y[10] = f335 + f336;
426 y[21] = f337 - f336;
427 f340 = f299 + f297;
428 f341 = MUL_F(FRAC_CONST(-0.2417766217337384), f299);
429 f342 = MUL_F(FRAC_CONST(0.8175848131515837), f340);
430 f343 = MUL_C(COEF_CONST(1.3933930045694289), f297);
431 y[12] = f341 + f342;
432 y[19] = f343 - f342;
433 f346 = f303 + f301;
434 f347 = MUL_F(FRAC_CONST(-0.1040360035527077), f303);
435 f348 = MUL_F(FRAC_CONST(0.7572088465064845), f346);
436 f349 = MUL_C(COEF_CONST(1.4103816894602612), f301);
437 y[14] = f347 + f348;
438 y[17] = f349 - f348;
439 f352 = f274 + f272;
440 f353 = MUL_F(FRAC_CONST(0.0347065382144002), f274);
441 f354 = MUL_F(FRAC_CONST(0.6895405447370668), f352);
442 f355 = MUL_C(COEF_CONST(1.4137876276885337), f272);
443 y[16] = f353 + f354;
444 y[15] = f355 - f354;
445 f358 = f278 + f276;
446 f359 = MUL_F(FRAC_CONST(0.1731148370459795), f278);
447 f360 = MUL_F(FRAC_CONST(0.6152315905806268), f358);
448 f361 = MUL_C(COEF_CONST(1.4035780182072330), f276);
449 y[18] = f359 + f360;
450 y[13] = f361 - f360;
451 f364 = f282 + f280;
452 f365 = MUL_F(FRAC_CONST(0.3098559453626100), f282);
453 f366 = MUL_F(FRAC_CONST(0.5349976198870972), f364);
454 f367 = MUL_C(COEF_CONST(1.3798511851368043), f280);
455 y[20] = f365 + f366;
456 y[11] = f367 - f366;
457 f370 = f286 + f284;
458 f371 = MUL_F(FRAC_CONST(0.4436129715409088), f286);
459 f372 = MUL_F(FRAC_CONST(0.4496113296546065), f370);
460 f373 = MUL_C(COEF_CONST(1.3428356308501219), f284);
461 y[22] = f371 + f372;
462 y[9] = f373 - f372;
463 f376 = f290 + f288;
464 f377 = MUL_F(FRAC_CONST(0.5730977622997509), f290);
465 f378 = MUL_F(FRAC_CONST(0.3598950365349881), f376);
466 f379 = MUL_C(COEF_CONST(1.2928878353697271), f288);
467 y[24] = f377 + f378;
468 y[7] = f379 - f378;
469 f382 = f294 + f292;
470 f383 = MUL_F(FRAC_CONST(0.6970633083205415), f294);
471 f384 = MUL_F(FRAC_CONST(0.2667127574748984), f382);
472 f385 = MUL_C(COEF_CONST(1.2304888232703382), f292);
473 y[26] = f383 + f384;
474 y[5] = f385 - f384;
475 f388 = f298 + f296;
476 f389 = MUL_F(FRAC_CONST(0.8143157536286401), f298);
477 f390 = MUL_F(FRAC_CONST(0.1709618887603012), f388);
478 f391 = MUL_C(COEF_CONST(1.1562395311492424), f296);
479 y[28] = f389 + f390;
480 y[3] = f391 - f390;
481 f394 = f302 + f300;
482 f395 = MUL_F(FRAC_CONST(0.9237258930790228), f302);
483 f396 = MUL_F(FRAC_CONST(0.0735645635996674), f394);
484 f397 = MUL_C(COEF_CONST(1.0708550202783576), f300);
485 y[30] = f395 + f396;
486 y[1] = f397 - f396;
487 }
488
489 void DST4_32(real_t *y, real_t *x)
490 {
491 real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9;
492 real_t f10, f11, f12, f13, f14, f15, f16, f17, f18, f19;
493 real_t f20, f21, f22, f23, f24, f25, f26, f27, f28, f29;
494 real_t f30, f31, f32, f33, f34, f35, f36, f37, f38, f39;
495 real_t f40, f41, f42, f43, f44, f45, f46, f47, f48, f49;
496 real_t f50, f51, f52, f53, f54, f55, f56, f57, f58, f59;
497 real_t f60, f61, f62, f63, f64, f65, f66, f67, f68, f69;
498 real_t f70, f71, f72, f73, f74, f75, f76, f77, f78, f79;
499 real_t f80, f81, f82, f83, f84, f85, f86, f87, f88, f89;
500 real_t f90, f91, f92, f93, f94, f95, f96, f97, f98, f99;
501 real_t f100, f101, f102, f103, f104, f105, f106, f107, f108, f109;
502 real_t f110, f111, f112, f113, f114, f115, f116, f117, f118, f119;
503 real_t f120, f121, f122, f123, f124, f125, f126, f127, f128, f129;
504 real_t f130, f131, f132, f133, f134, f135, f136, f137, f138, f139;
505 real_t f140, f141, f142, f143, f144, f145, f146, f147, f148, f149;
506 real_t f150, f151, f152, f153, f154, f155, f156, f157, f158, f159;
507 real_t f160, f161, f162, f163, f164, f165, f166, f167, f168, f169;
508 real_t f170, f171, f172, f173, f174, f175, f176, f177, f178, f179;
509 real_t f180, f181, f182, f183, f184, f185, f186, f187, f188, f189;
510 real_t f190, f191, f192, f193, f194, f195, f196, f197, f198, f199;
511 real_t f200, f201, f202, f203, f204, f205, f206, f207, f208, f209;
512 real_t f210, f211, f212, f213, f214, f215, f216, f217, f218, f219;
513 real_t f220, f221, f222, f223, f224, f225, f226, f227, f228, f229;
514 real_t f230, f231, f232, f233, f234, f235, f236, f237, f238, f239;
515 real_t f240, f241, f242, f243, f244, f245, f246, f247, f248, f249;
516 real_t f250, f251, f252, f253, f254, f255, f256, f257, f258, f259;
517 real_t f260, f261, f262, f263, f264, f265, f266, f267, f268, f269;
518 real_t f270, f271, f272, f273, f274, f275, f276, f277, f278, f279;
519 real_t f280, f281, f282, f283, f284, f285, f286, f287, f288, f289;
520 real_t f290, f291, f292, f293, f294, f295, f296, f297, f298, f299;
521 real_t f300, f301, f302, f303, f304, f305, f306, f307, f308, f309;
522 real_t f310, f311, f312, f313, f314, f315, f316, f317, f318, f319;
523 real_t f320, f321, f322, f323, f324, f325, f326, f327, f328, f329;
524 real_t f330, f331, f332, f333, f334, f335;
525
526 f0 = x[0] - x[1];
527 f1 = x[2] - x[1];
528 f2 = x[2] - x[3];
529 f3 = x[4] - x[3];
530 f4 = x[4] - x[5];
531 f5 = x[6] - x[5];
532 f6 = x[6] - x[7];
533 f7 = x[8] - x[7];
534 f8 = x[8] - x[9];
535 f9 = x[10] - x[9];
536 f10 = x[10] - x[11];
537 f11 = x[12] - x[11];
538 f12 = x[12] - x[13];
539 f13 = x[14] - x[13];
540 f14 = x[14] - x[15];
541 f15 = x[16] - x[15];
542 f16 = x[16] - x[17];
543 f17 = x[18] - x[17];
544 f18 = x[18] - x[19];
545 f19 = x[20] - x[19];
546 f20 = x[20] - x[21];
547 f21 = x[22] - x[21];
548 f22 = x[22] - x[23];
549 f23 = x[24] - x[23];
550 f24 = x[24] - x[25];
551 f25 = x[26] - x[25];
552 f26 = x[26] - x[27];
553 f27 = x[28] - x[27];
554 f28 = x[28] - x[29];
555 f29 = x[30] - x[29];
556 f30 = x[30] - x[31];
557 f31 = MUL_F(FRAC_CONST(0.7071067811865476), f15);
558 f32 = x[0] - f31;
559 f33 = x[0] + f31;
560 f34 = f7 + f23;
561 f35 = MUL_C(COEF_CONST(1.3065629648763766), f7);
562 f36 = MUL_F(FRAC_CONST(-0.9238795325112866), f34);
563 f37 = MUL_F(FRAC_CONST(-0.5411961001461967), f23);
564 f38 = f35 + f36;
565 f39 = f37 - f36;
566 f40 = f33 - f39;
567 f41 = f33 + f39;
568 f42 = f32 - f38;
569 f43 = f32 + f38;
570 f44 = f11 - f19;
571 f45 = f11 + f19;
572 f46 = MUL_F(FRAC_CONST(0.7071067811865476), f45);
573 f47 = f3 - f46;
574 f48 = f3 + f46;
575 f49 = MUL_F(FRAC_CONST(0.7071067811865476), f44);
576 f50 = f49 - f27;
577 f51 = f49 + f27;
578 f52 = f51 + f48;
579 f53 = MUL_F(FRAC_CONST(-0.7856949583871021), f51);
580 f54 = MUL_F(FRAC_CONST(0.9807852804032304), f52);
581 f55 = MUL_C(COEF_CONST(1.1758756024193588), f48);
582 f56 = f53 + f54;
583 f57 = f55 - f54;
584 f58 = f50 + f47;
585 f59 = MUL_F(FRAC_CONST(-0.2758993792829430), f50);
586 f60 = MUL_F(FRAC_CONST(0.8314696123025452), f58);
587 f61 = MUL_C(COEF_CONST(1.3870398453221475), f47);
588 f62 = f59 + f60;
589 f63 = f61 - f60;
590 f64 = f41 - f56;
591 f65 = f41 + f56;
592 f66 = f43 - f62;
593 f67 = f43 + f62;
594 f68 = f42 - f63;
595 f69 = f42 + f63;
596 f70 = f40 - f57;
597 f71 = f40 + f57;
598 f72 = f5 - f9;
599 f73 = f5 + f9;
600 f74 = f13 - f17;
601 f75 = f13 + f17;
602 f76 = f21 - f25;
603 f77 = f21 + f25;
604 f78 = MUL_F(FRAC_CONST(0.7071067811865476), f75);
605 f79 = f1 - f78;
606 f80 = f1 + f78;
607 f81 = f73 + f77;
608 f82 = MUL_C(COEF_CONST(1.3065629648763766), f73);
609 f83 = MUL_F(FRAC_CONST(-0.9238795325112866), f81);
610 f84 = MUL_F(FRAC_CONST(-0.5411961001461967), f77);
611 f85 = f82 + f83;
612 f86 = f84 - f83;
613 f87 = f80 - f86;
614 f88 = f80 + f86;
615 f89 = f79 - f85;
616 f90 = f79 + f85;
617 f91 = MUL_F(FRAC_CONST(0.7071067811865476), f74);
618 f92 = f29 - f91;
619 f93 = f29 + f91;
620 f94 = f76 + f72;
621 f95 = MUL_C(COEF_CONST(1.3065629648763766), f76);
622 f96 = MUL_F(FRAC_CONST(-0.9238795325112866), f94);
623 f97 = MUL_F(FRAC_CONST(-0.5411961001461967), f72);
624 f98 = f95 + f96;
625 f99 = f97 - f96;
626 f100 = f93 - f99;
627 f101 = f93 + f99;
628 f102 = f92 - f98;
629 f103 = f92 + f98;
630 f104 = f101 + f88;
631 f105 = MUL_F(FRAC_CONST(-0.8971675863426361), f101);
632 f106 = MUL_F(FRAC_CONST(0.9951847266721968), f104);
633 f107 = MUL_C(COEF_CONST(1.0932018670017576), f88);
634 f108 = f105 + f106;
635 f109 = f107 - f106;
636 f110 = f90 - f103;
637 f111 = MUL_F(FRAC_CONST(-0.6666556584777466), f103);
638 f112 = MUL_F(FRAC_CONST(0.9569403357322089), f110);
639 f113 = MUL_C(COEF_CONST(1.2472250129866713), f90);
640 f114 = f112 - f111;
641 f115 = f113 - f112;
642 f116 = f102 + f89;
643 f117 = MUL_F(FRAC_CONST(-0.4105245275223571), f102);
644 f118 = MUL_F(FRAC_CONST(0.8819212643483549), f116);
645 f119 = MUL_C(COEF_CONST(1.3533180011743529), f89);
646 f120 = f117 + f118;
647 f121 = f119 - f118;
648 f122 = f87 - f100;
649 f123 = MUL_F(FRAC_CONST(-0.1386171691990915), f100);
650 f124 = MUL_F(FRAC_CONST(0.7730104533627370), f122);
651 f125 = MUL_C(COEF_CONST(1.4074037375263826), f87);
652 f126 = f124 - f123;
653 f127 = f125 - f124;
654 f128 = f65 - f108;
655 f129 = f65 + f108;
656 f130 = f67 - f114;
657 f131 = f67 + f114;
658 f132 = f69 - f120;
659 f133 = f69 + f120;
660 f134 = f71 - f126;
661 f135 = f71 + f126;
662 f136 = f70 - f127;
663 f137 = f70 + f127;
664 f138 = f68 - f121;
665 f139 = f68 + f121;
666 f140 = f66 - f115;
667 f141 = f66 + f115;
668 f142 = f64 - f109;
669 f143 = f64 + f109;
670 f144 = f0 + f30;
671 f145 = MUL_C(COEF_CONST(1.0478631305325901), f0);
672 f146 = MUL_F(FRAC_CONST(-0.9987954562051724), f144);
673 f147 = MUL_F(FRAC_CONST(-0.9497277818777548), f30);
674 f148 = f145 + f146;
675 f149 = f147 - f146;
676 f150 = f4 + f26;
677 f151 = MUL_F(FRAC_CONST(1.2130114330978077), f4);
678 f152 = MUL_F(FRAC_CONST(-0.9700312531945440), f150);
679 f153 = MUL_F(FRAC_CONST(-0.7270510732912803), f26);
680 f154 = f151 + f152;
681 f155 = f153 - f152;
682 f156 = f8 + f22;
683 f157 = MUL_C(COEF_CONST(1.3315443865537255), f8);
684 f158 = MUL_F(FRAC_CONST(-0.9039892931234433), f156);
685 f159 = MUL_F(FRAC_CONST(-0.4764341996931612), f22);
686 f160 = f157 + f158;
687 f161 = f159 - f158;
688 f162 = f12 + f18;
689 f163 = MUL_C(COEF_CONST(1.3989068359730781), f12);
690 f164 = MUL_F(FRAC_CONST(-0.8032075314806453), f162);
691 f165 = MUL_F(FRAC_CONST(-0.2075082269882124), f18);
692 f166 = f163 + f164;
693 f167 = f165 - f164;
694 f168 = f16 + f14;
695 f169 = MUL_C(COEF_CONST(1.4125100802019777), f16);
696 f170 = MUL_F(FRAC_CONST(-0.6715589548470187), f168);
697 f171 = MUL_F(FRAC_CONST(0.0693921705079402), f14);
698 f172 = f169 + f170;
699 f173 = f171 - f170;
700 f174 = f20 + f10;
701 f175 = MUL_C(COEF_CONST(1.3718313541934939), f20);
702 f176 = MUL_F(FRAC_CONST(-0.5141027441932219), f174);
703 f177 = MUL_F(FRAC_CONST(0.3436258658070501), f10);
704 f178 = f175 + f176;
705 f179 = f177 - f176;
706 f180 = f24 + f6;
707 f181 = MUL_C(COEF_CONST(1.2784339185752409), f24);
708 f182 = MUL_F(FRAC_CONST(-0.3368898533922200), f180);
709 f183 = MUL_F(FRAC_CONST(0.6046542117908008), f6);
710 f184 = f181 + f182;
711 f185 = f183 - f182;
712 f186 = f28 + f2;
713 f187 = MUL_C(COEF_CONST(1.1359069844201433), f28);
714 f188 = MUL_F(FRAC_CONST(-0.1467304744553624), f186);
715 f189 = MUL_F(FRAC_CONST(0.8424460355094185), f2);
716 f190 = f187 + f188;
717 f191 = f189 - f188;
718 f192 = f149 - f173;
719 f193 = f149 + f173;
720 f194 = f148 - f172;
721 f195 = f148 + f172;
722 f196 = f155 - f179;
723 f197 = f155 + f179;
724 f198 = f154 - f178;
725 f199 = f154 + f178;
726 f200 = f161 - f185;
727 f201 = f161 + f185;
728 f202 = f160 - f184;
729 f203 = f160 + f184;
730 f204 = f167 - f191;
731 f205 = f167 + f191;
732 f206 = f166 - f190;
733 f207 = f166 + f190;
734 f208 = f192 + f194;
735 f209 = MUL_C(COEF_CONST(1.1758756024193588), f192);
736 f210 = MUL_F(FRAC_CONST(-0.9807852804032304), f208);
737 f211 = MUL_F(FRAC_CONST(-0.7856949583871021), f194);
738 f212 = f209 + f210;
739 f213 = f211 - f210;
740 f214 = f196 + f198;
741 f215 = MUL_C(COEF_CONST(1.3870398453221475), f196);
742 f216 = MUL_F(FRAC_CONST(-0.5555702330196022), f214);
743 f217 = MUL_F(FRAC_CONST(0.2758993792829431), f198);
744 f218 = f215 + f216;
745 f219 = f217 - f216;
746 f220 = f200 + f202;
747 f221 = MUL_F(FRAC_CONST(0.7856949583871022), f200);
748 f222 = MUL_F(FRAC_CONST(0.1950903220161283), f220);
749 f223 = MUL_C(COEF_CONST(1.1758756024193586), f202);
750 f224 = f221 + f222;
751 f225 = f223 - f222;
752 f226 = f204 + f206;
753 f227 = MUL_F(FRAC_CONST(-0.2758993792829430), f204);
754 f228 = MUL_F(FRAC_CONST(0.8314696123025452), f226);
755 f229 = MUL_C(COEF_CONST(1.3870398453221475), f206);
756 f230 = f227 + f228;
757 f231 = f229 - f228;
758 f232 = f193 - f201;
759 f233 = f193 + f201;
760 f234 = f195 - f203;
761 f235 = f195 + f203;
762 f236 = f197 - f205;
763 f237 = f197 + f205;
764 f238 = f199 - f207;
765 f239 = f199 + f207;
766 f240 = f213 - f225;
767 f241 = f213 + f225;
768 f242 = f212 - f224;
769 f243 = f212 + f224;
770 f244 = f219 - f231;
771 f245 = f219 + f231;
772 f246 = f218 - f230;
773 f247 = f218 + f230;
774 f248 = f232 + f234;
775 f249 = MUL_C(COEF_CONST(1.3065629648763766), f232);
776 f250 = MUL_F(FRAC_CONST(-0.9238795325112866), f248);
777 f251 = MUL_F(FRAC_CONST(-0.5411961001461967), f234);
778 f252 = f249 + f250;
779 f253 = f251 - f250;
780 f254 = f236 + f238;
781 f255 = MUL_F(FRAC_CONST(0.5411961001461969), f236);
782 f256 = MUL_F(FRAC_CONST(0.3826834323650898), f254);
783 f257 = MUL_C(COEF_CONST(1.3065629648763766), f238);
784 f258 = f255 + f256;
785 f259 = f257 - f256;
786 f260 = f240 + f242;
787 f261 = MUL_C(COEF_CONST(1.3065629648763766), f240);
788 f262 = MUL_F(FRAC_CONST(-0.9238795325112866), f260);
789 f263 = MUL_F(FRAC_CONST(-0.5411961001461967), f242);
790 f264 = f261 + f262;
791 f265 = f263 - f262;
792 f266 = f244 + f246;
793 f267 = MUL_F(FRAC_CONST(0.5411961001461969), f244);
794 f268 = MUL_F(FRAC_CONST(0.3826834323650898), f266);
795 f269 = MUL_C(COEF_CONST(1.3065629648763766), f246);
796 f270 = f267 + f268;
797 f271 = f269 - f268;
798 f272 = f233 - f237;
799 f273 = f233 + f237;
800 f274 = f235 - f239;
801 f275 = f235 + f239;
802 f276 = f253 - f259;
803 f277 = f253 + f259;
804 f278 = f252 - f258;
805 f279 = f252 + f258;
806 f280 = f241 - f245;
807 f281 = f241 + f245;
808 f282 = f243 - f247;
809 f283 = f243 + f247;
810 f284 = f265 - f271;
811 f285 = f265 + f271;
812 f286 = f264 - f270;
813 f287 = f264 + f270;
814 f288 = f272 - f274;
815 f289 = f272 + f274;
816 f290 = MUL_F(FRAC_CONST(0.7071067811865474), f288);
817 f291 = MUL_F(FRAC_CONST(0.7071067811865474), f289);
818 f292 = f276 - f278;
819 f293 = f276 + f278;
820 f294 = MUL_F(FRAC_CONST(0.7071067811865474), f292);
821 f295 = MUL_F(FRAC_CONST(0.7071067811865474), f293);
822 f296 = f280 - f282;
823 f297 = f280 + f282;
824 f298 = MUL_F(FRAC_CONST(0.7071067811865474), f296);
825 f299 = MUL_F(FRAC_CONST(0.7071067811865474), f297);
826 f300 = f284 - f286;
827 f301 = f284 + f286;
828 f302 = MUL_F(FRAC_CONST(0.7071067811865474), f300);
829 f303 = MUL_F(FRAC_CONST(0.7071067811865474), f301);
830 f304 = f129 - f273;
831 f305 = f129 + f273;
832 f306 = f131 - f281;
833 f307 = f131 + f281;
834 f308 = f133 - f285;
835 f309 = f133 + f285;
836 f310 = f135 - f277;
837 f311 = f135 + f277;
838 f312 = f137 - f295;
839 f313 = f137 + f295;
840 f314 = f139 - f303;
841 f315 = f139 + f303;
842 f316 = f141 - f299;
843 f317 = f141 + f299;
844 f318 = f143 - f291;
845 f319 = f143 + f291;
846 f320 = f142 - f290;
847 f321 = f142 + f290;
848 f322 = f140 - f298;
849 f323 = f140 + f298;
850 f324 = f138 - f302;
851 f325 = f138 + f302;
852 f326 = f136 - f294;
853 f327 = f136 + f294;
854 f328 = f134 - f279;
855 f329 = f134 + f279;
856 f330 = f132 - f287;
857 f331 = f132 + f287;
858 f332 = f130 - f283;
859 f333 = f130 + f283;
860 f334 = f128 - f275;
861 f335 = f128 + f275;
862 y[31] = MUL_F(FRAC_CONST(0.5001506360206510), f305);
863 y[30] = MUL_F(FRAC_CONST(0.5013584524464084), f307);
864 y[29] = MUL_F(FRAC_CONST(0.5037887256810443), f309);
865 y[28] = MUL_F(FRAC_CONST(0.5074711720725553), f311);
866 y[27] = MUL_F(FRAC_CONST(0.5124514794082247), f313);
867 y[26] = MUL_F(FRAC_CONST(0.5187927131053328), f315);
868 y[25] = MUL_F(FRAC_CONST(0.5265773151542700), f317);
869 y[24] = MUL_F(FRAC_CONST(0.5359098169079920), f319);
870 y[23] = MUL_F(FRAC_CONST(0.5469204379855088), f321);
871 y[22] = MUL_F(FRAC_CONST(0.5597698129470802), f323);
872 y[21] = MUL_F(FRAC_CONST(0.5746551840326600), f325);
873 y[20] = MUL_F(FRAC_CONST(0.5918185358574165), f327);
874 y[19] = MUL_F(FRAC_CONST(0.6115573478825099), f329);
875 y[18] = MUL_F(FRAC_CONST(0.6342389366884031), f331);
876 y[17] = MUL_F(FRAC_CONST(0.6603198078137061), f333);
877 y[16] = MUL_F(FRAC_CONST(0.6903721282002123), f335);
878 y[15] = MUL_F(FRAC_CONST(0.7251205223771985), f334);
879 y[14] = MUL_F(FRAC_CONST(0.7654941649730891), f332);
880 y[13] = MUL_F(FRAC_CONST(0.8127020908144905), f330);
881 y[12] = MUL_F(FRAC_CONST(0.8683447152233481), f328);
882 y[11] = MUL_F(FRAC_CONST(0.9345835970364075), f326);
883 y[10] = MUL_C(COEF_CONST(1.0144082649970547), f324);
884 y[9] = MUL_C(COEF_CONST(1.1120716205797176), f322);
885 y[8] = MUL_C(COEF_CONST(1.2338327379765710), f320);
886 y[7] = MUL_C(COEF_CONST(1.3892939586328277), f318);
887 y[6] = MUL_C(COEF_CONST(1.5939722833856311), f316);
888 y[5] = MUL_C(COEF_CONST(1.8746759800084078), f314);
889 y[4] = MUL_C(COEF_CONST(2.2820500680051619), f312);
890 y[3] = MUL_C(COEF_CONST(2.9246284281582162), f310);
891 y[2] = MUL_C(COEF_CONST(4.0846110781292477), f308);
892 y[1] = MUL_C(COEF_CONST(6.7967507116736332), f306);
893 y[0] = MUL_R(REAL_CONST(20.3738781672314530), f304);
894 }
895
896 #ifdef SBR_LOW_POWER
897
898 void DCT2_16_unscaled(real_t *y, real_t *x)
899 {
900 real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
901 real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
902 real_t f21, f22, f23, f24, f25, f26, f27, f28, f31, f32;
903 real_t f33, f34, f37, f38, f39, f40, f41, f42, f43, f44;
904 real_t f45, f46, f47, f48, f49, f51, f53, f54, f57, f58;
905 real_t f59, f60, f61, f62, f63, f64, f65, f66, f67, f68;
906 real_t f69, f70, f71, f72, f73, f74, f75, f76, f77, f78;
907 real_t f79, f80, f81, f82, f83, f84, f85, f86, f87, f88;
908 real_t f89, f90, f91, f92, f95, f96, f97, f98, f101, f102;
909 real_t f103, f104, f107, f108, f109, f110;
910
911 f0 = x[0] - x[15];
912 f1 = x[0] + x[15];
913 f2 = x[1] - x[14];
914 f3 = x[1] + x[14];
915 f4 = x[2] - x[13];
916 f5 = x[2] + x[13];
917 f6 = x[3] - x[12];
918 f7 = x[3] + x[12];
919 f8 = x[4] - x[11];
920 f9 = x[4] + x[11];
921 f10 = x[5] - x[10];
922 f11 = x[5] + x[10];
923 f12 = x[6] - x[9];
924 f13 = x[6] + x[9];
925 f14 = x[7] - x[8];
926 f15 = x[7] + x[8];
927 f16 = f1 - f15;
928 f17 = f1 + f15;
929 f18 = f3 - f13;
930 f19 = f3 + f13;
931 f20 = f5 - f11;
932 f21 = f5 + f11;
933 f22 = f7 - f9;
934 f23 = f7 + f9;
935 f24 = f17 - f23;
936 f25 = f17 + f23;
937 f26 = f19 - f21;
938 f27 = f19 + f21;
939 f28 = f25 - f27;
940 y[0] = f25 + f27;
941 y[8] = MUL_F(f28, FRAC_CONST(0.7071067811865476));
942 f31 = f24 + f26;
943 f32 = MUL_C(f24, COEF_CONST(1.3065629648763766));
944 f33 = MUL_F(f31, FRAC_CONST(-0.9238795325112866));
945 f34 = MUL_F(f26, FRAC_CONST(-0.5411961001461967));
946 y[12] = f32 + f33;
947 y[4] = f34 - f33;
948 f37 = f16 + f22;
949 f38 = MUL_C(f16, COEF_CONST(1.1758756024193588));
950 f39 = MUL_F(f37, FRAC_CONST(-0.9807852804032304));
951 f40 = MUL_F(f22, FRAC_CONST(-0.7856949583871021));
952 f41 = f38 + f39;
953 f42 = f40 - f39;
954 f43 = f18 + f20;
955 f44 = MUL_C(f18, COEF_CONST(1.3870398453221473));
956 f45 = MUL_F(f43, FRAC_CONST(-0.8314696123025455));
957 f46 = MUL_F(f20, FRAC_CONST(-0.2758993792829436));
958 f47 = f44 + f45;
959 f48 = f46 - f45;
960 f49 = f42 - f48;
961 y[2] = f42 + f48;
962 f51 = MUL_F(f49, FRAC_CONST(0.7071067811865476));
963 y[14] = f41 - f47;
964 f53 = f41 + f47;
965 f54 = MUL_F(f53, FRAC_CONST(0.7071067811865476));
966 y[10] = f51 - f54;
967 y[6] = f51 + f54;
968 f57 = f2 - f4;
969 f58 = f2 + f4;
970 f59 = f6 - f8;
971 f60 = f6 + f8;
972 f61 = f10 - f12;
973 f62 = f10 + f12;
974 f63 = MUL_F(f60, FRAC_CONST(0.7071067811865476));
975 f64 = f0 - f63;
976 f65 = f0 + f63;
977 f66 = f58 + f62;
978 f67 = MUL_C(f58, COEF_CONST(1.3065629648763766));
979 f68 = MUL_F(f66, FRAC_CONST(-0.9238795325112866));
980 f69 = MUL_F(f62, FRAC_CONST(-0.5411961001461967));
981 f70 = f67 + f68;
982 f71 = f69 - f68;
983 f72 = f65 - f71;
984 f73 = f65 + f71;
985 f74 = f64 - f70;
986 f75 = f64 + f70;
987 f76 = MUL_F(f59, FRAC_CONST(0.7071067811865476));
988 f77 = f14 - f76;
989 f78 = f14 + f76;
990 f79 = f61 + f57;
991 f80 = MUL_C(f61, COEF_CONST(1.3065629648763766));
992 f81 = MUL_F(f79, FRAC_CONST(-0.9238795325112866));
993 f82 = MUL_F(f57, FRAC_CONST(-0.5411961001461967));
994 f83 = f80 + f81;
995 f84 = f82 - f81;
996 f85 = f78 - f84;
997 f86 = f78 + f84;
998 f87 = f77 - f83;
999 f88 = f77 + f83;
1000 f89 = f86 + f73;
1001 f90 = MUL_F(f86, FRAC_CONST(-0.8971675863426361));
1002 f91 = MUL_F(f89, FRAC_CONST(0.9951847266721968));
1003 f92 = MUL_C(f73, COEF_CONST(1.0932018670017576));
1004 y[1] = f90 + f91;
1005 y[15] = f92 - f91;
1006 f95 = f75 - f88;
1007 f96 = MUL_F(f88, FRAC_CONST(-0.6666556584777466));
1008 f97 = MUL_F(f95, FRAC_CONST(0.9569403357322089));
1009 f98 = MUL_C(f75, COEF_CONST(1.2472250129866713));
1010 y[3] = f97 - f96;
1011 y[13] = f98 - f97;
1012 f101 = f87 + f74;
1013 f102 = MUL_F(f87, FRAC_CONST(-0.4105245275223571));
1014 f103 = MUL_F(f101, FRAC_CONST(0.8819212643483549));
1015 f104 = MUL_C(f74, COEF_CONST(1.3533180011743529));
1016 y[5] = f102 + f103;
1017 y[11] = f104 - f103;
1018 f107 = f72 - f85;
1019 f108 = MUL_F(f85, FRAC_CONST(-0.1386171691990915));
1020 f109 = MUL_F(f107, FRAC_CONST(0.7730104533627370));
1021 f110 = MUL_C(f72, COEF_CONST(1.4074037375263826));
1022 y[7] = f109 - f108;
1023 y[9] = f110 - f109;
1024 }
1025
1026 void DCT4_16(real_t *y, real_t *x)
1027 {
1028 real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
1029 real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
1030 real_t f21, f22, f23, f24, f25, f26, f27, f28, f29, f30;
1031 real_t f31, f32, f33, f34, f35, f36, f37, f38, f39, f40;
1032 real_t f41, f42, f43, f44, f45, f46, f47, f48, f49, f50;
1033 real_t f51, f52, f53, f54, f55, f56, f57, f58, f59, f60;
1034 real_t f61, f62, f63, f64, f65, f66, f67, f68, f69, f70;
1035 real_t f71, f72, f73, f74, f75, f76, f77, f78, f79, f80;
1036 real_t f81, f82, f83, f84, f85, f86, f87, f88, f89, f90;
1037 real_t f91, f92, f93, f94, f95, f96, f97, f98, f99, f100;
1038 real_t f101, f102, f103, f104, f105, f106, f107, f108, f109, f110;
1039 real_t f111, f112, f113, f114, f115, f116, f117, f118, f119, f120;
1040 real_t f121, f122, f123, f124, f125, f126, f127, f128, f130, f132;
1041 real_t f134, f136, f138, f140, f142, f144, f145, f148, f149, f152;
1042 real_t f153, f156, f157;
1043
1044 f0 = x[0] + x[15];
1045 f1 = MUL_C(COEF_CONST(1.0478631305325901), x[0]);
1046 f2 = MUL_F(FRAC_CONST(-0.9987954562051724), f0);
1047 f3 = MUL_F(FRAC_CONST(-0.9497277818777548), x[15]);
1048 f4 = f1 + f2;
1049 f5 = f3 - f2;
1050 f6 = x[2] + x[13];
1051 f7 = MUL_C(COEF_CONST(1.2130114330978077), x[2]);
1052 f8 = MUL_F(FRAC_CONST(-0.9700312531945440), f6);
1053 f9 = MUL_F(FRAC_CONST(-0.7270510732912803), x[13]);
1054 f10 = f7 + f8;
1055 f11 = f9 - f8;
1056 f12 = x[4] + x[11];
1057 f13 = MUL_C(COEF_CONST(1.3315443865537255), x[4]);
1058 f14 = MUL_F(FRAC_CONST(-0.9039892931234433), f12);
1059 f15 = MUL_F(FRAC_CONST(-0.4764341996931612), x[11]);
1060 f16 = f13 + f14;
1061 f17 = f15 - f14;
1062 f18 = x[6] + x[9];
1063 f19 = MUL_C(COEF_CONST(1.3989068359730781), x[6]);
1064 f20 = MUL_F(FRAC_CONST(-0.8032075314806453), f18);
1065 f21 = MUL_F(FRAC_CONST(-0.2075082269882124), x[9]);
1066 f22 = f19 + f20;
1067 f23 = f21 - f20;
1068 f24 = x[8] + x[7];
1069 f25 = MUL_C(COEF_CONST(1.4125100802019777), x[8]);
1070 f26 = MUL_F(FRAC_CONST(-0.6715589548470187), f24);
1071 f27 = MUL_F(FRAC_CONST(0.0693921705079402), x[7]);
1072 f28 = f25 + f26;
1073 f29 = f27 - f26;
1074 f30 = x[10] + x[5];
1075 f31 = MUL_C(COEF_CONST(1.3718313541934939), x[10]);
1076 f32 = MUL_F(FRAC_CONST(-0.5141027441932219), f30);
1077 f33 = MUL_F(FRAC_CONST(0.3436258658070501), x[5]);
1078 f34 = f31 + f32;
1079 f35 = f33 - f32;
1080 f36 = x[12] + x[3];
1081 f37 = MUL_C(COEF_CONST(1.2784339185752409), x[12]);
1082 f38 = MUL_F(FRAC_CONST(-0.3368898533922200), f36);
1083 f39 = MUL_F(FRAC_CONST(0.6046542117908008), x[3]);
1084 f40 = f37 + f38;
1085 f41 = f39 - f38;
1086 f42 = x[14] + x[1];
1087 f43 = MUL_C(COEF_CONST(1.1359069844201433), x[14]);
1088 f44 = MUL_F(FRAC_CONST(-0.1467304744553624), f42);
1089 f45 = MUL_F(FRAC_CONST(0.8424460355094185), x[1]);
1090 f46 = f43 + f44;
1091 f47 = f45 - f44;
1092 f48 = f5 - f29;
1093 f49 = f5 + f29;
1094 f50 = f4 - f28;
1095 f51 = f4 + f28;
1096 f52 = f11 - f35;
1097 f53 = f11 + f35;
1098 f54 = f10 - f34;
1099 f55 = f10 + f34;
1100 f56 = f17 - f41;
1101 f57 = f17 + f41;
1102 f58 = f16 - f40;
1103 f59 = f16 + f40;
1104 f60 = f23 - f47;
1105 f61 = f23 + f47;
1106 f62 = f22 - f46;
1107 f63 = f22 + f46;
1108 f64 = f48 + f50;
1109 f65 = MUL_C(COEF_CONST(1.1758756024193588), f48);
1110 f66 = MUL_F(FRAC_CONST(-0.9807852804032304), f64);
1111 f67 = MUL_F(FRAC_CONST(-0.7856949583871021), f50);
1112 f68 = f65 + f66;
1113 f69 = f67 - f66;
1114 f70 = f52 + f54;
1115 f71 = MUL_C(COEF_CONST(1.3870398453221475), f52);
1116 f72 = MUL_F(FRAC_CONST(-0.5555702330196022), f70);
1117 f73 = MUL_F(FRAC_CONST(0.2758993792829431), f54);
1118 f74 = f71 + f72;
1119 f75 = f73 - f72;
1120 f76 = f56 + f58;
1121 f77 = MUL_F(FRAC_CONST(0.7856949583871022), f56);
1122 f78 = MUL_F(FRAC_CONST(0.1950903220161283), f76);
1123 f79 = MUL_C(COEF_CONST(1.1758756024193586), f58);
1124 f80 = f77 + f78;
1125 f81 = f79 - f78;
1126 f82 = f60 + f62;
1127 f83 = MUL_F(FRAC_CONST(-0.2758993792829430), f60);
1128 f84 = MUL_F(FRAC_CONST(0.8314696123025452), f82);
1129 f85 = MUL_C(COEF_CONST(1.3870398453221475), f62);
1130 f86 = f83 + f84;
1131 f87 = f85 - f84;
1132 f88 = f49 - f57;
1133 f89 = f49 + f57;
1134 f90 = f51 - f59;
1135 f91 = f51 + f59;
1136 f92 = f53 - f61;
1137 f93 = f53 + f61;
1138 f94 = f55 - f63;
1139 f95 = f55 + f63;
1140 f96 = f69 - f81;
1141 f97 = f69 + f81;
1142 f98 = f68 - f80;
1143 f99 = f68 + f80;
1144 f100 = f75 - f87;
1145 f101 = f75 + f87;
1146 f102 = f74 - f86;
1147 f103 = f74 + f86;
1148 f104 = f88 + f90;
1149 f105 = MUL_C(COEF_CONST(1.3065629648763766), f88);
1150 f106 = MUL_F(FRAC_CONST(-0.9238795325112866), f104);
1151 f107 = MUL_F(FRAC_CONST(-0.5411961001461967), f90);
1152 f108 = f105 + f106;
1153 f109 = f107 - f106;
1154 f110 = f92 + f94;
1155 f111 = MUL_F(FRAC_CONST(0.5411961001461969), f92);
1156 f112 = MUL_F(FRAC_CONST(0.3826834323650898), f110);
1157 f113 = MUL_C(COEF_CONST(1.3065629648763766), f94);
1158 f114 = f111 + f112;
1159 f115 = f113 - f112;
1160 f116 = f96 + f98;
1161 f117 = MUL_C(COEF_CONST(1.3065629648763766), f96);
1162 f118 = MUL_F(FRAC_CONST(-0.9238795325112866), f116);
1163 f119 = MUL_F(FRAC_CONST(-0.5411961001461967), f98);
1164 f120 = f117 + f118;
1165 f121 = f119 - f118;
1166 f122 = f100 + f102;
1167 f123 = MUL_F(FRAC_CONST(0.5411961001461969), f100);
1168 f124 = MUL_F(FRAC_CONST(0.3826834323650898), f122);
1169 f125 = MUL_C(COEF_CONST(1.3065629648763766), f102);
1170 f126 = f123 + f124;
1171 f127 = f125 - f124;
1172 f128 = f89 - f93;
1173 y[0] = f89 + f93;
1174 f130 = f91 - f95;
1175 y[15] = f91 + f95;
1176 f132 = f109 - f115;
1177 y[3] = f109 + f115;
1178 f134 = f108 - f114;
1179 y[12] = f108 + f114;
1180 f136 = f97 - f101;
1181 y[1] = f97 + f101;
1182 f138 = f99 - f103;
1183 y[14] = f99 + f103;
1184 f140 = f121 - f127;
1185 y[2] = f121 + f127;
1186 f142 = f120 - f126;
1187 y[13] = f120 + f126;
1188 f144 = f128 - f130;
1189 f145 = f128 + f130;
1190 y[8] = MUL_F(FRAC_CONST(0.7071067811865474), f144);
1191 y[7] = MUL_F(FRAC_CONST(0.7071067811865474), f145);
1192 f148 = f132 - f134;
1193 f149 = f132 + f134;
1194 y[11] = MUL_F(FRAC_CONST(0.7071067811865474), f148);
1195 y[4] = MUL_F(FRAC_CONST(0.7071067811865474), f149);
1196 f152 = f136 - f138;
1197 f153 = f136 + f138;
1198 y[9] = MUL_F(FRAC_CONST(0.7071067811865474), f152);
1199 y[6] = MUL_F(FRAC_CONST(0.7071067811865474), f153);
1200 f156 = f140 - f142;
1201 f157 = f140 + f142;
1202 y[10] = MUL_F(FRAC_CONST(0.7071067811865474), f156);
1203 y[5] = MUL_F(FRAC_CONST(0.7071067811865474), f157);
1204 }
1205
1206 void DCT3_32_unscaled(real_t *y, real_t *x)
1207 {
1208 real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
1209 real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
1210 real_t f21, f22, f23, f24, f25, f26, f27, f28, f29, f30;
1211 real_t f31, f32, f33, f34, f35, f36, f37, f38, f39, f40;
1212 real_t f41, f42, f43, f44, f45, f46, f47, f48, f49, f50;
1213 real_t f51, f52, f53, f54, f55, f56, f57, f58, f59, f60;
1214 real_t f61, f62, f63, f64, f65, f66, f67, f68, f69, f70;
1215 real_t f71, f72, f73, f74, f75, f76, f77, f78, f79, f80;
1216 real_t f81, f82, f83, f84, f85, f86, f87, f88, f89, f90;
1217 real_t f91, f92, f93, f94, f95, f96, f97, f98, f99, f100;
1218 real_t f101, f102, f103, f104, f105, f106, f107, f108, f109, f110;
1219 real_t f111, f112, f113, f114, f115, f116, f117, f118, f119, f120;
1220 real_t f121, f122, f123, f124, f125, f126, f127, f128, f129, f130;
1221 real_t f131, f132, f133, f134, f135, f136, f137, f138, f139, f140;
1222 real_t f141, f142, f143, f144, f145, f146, f147, f148, f149, f150;
1223 real_t f151, f152, f153, f154, f155, f156, f157, f158, f159, f160;
1224 real_t f161, f162, f163, f164, f165, f166, f167, f168, f169, f170;
1225 real_t f171, f172, f173, f174, f175, f176, f177, f178, f179, f180;
1226 real_t f181, f182, f183, f184, f185, f186, f187, f188, f189, f190;
1227 real_t f191, f192, f193, f194, f195, f196, f197, f198, f199, f200;
1228 real_t f201, f202, f203, f204, f205, f206, f207, f208, f209, f210;
1229 real_t f211, f212, f213, f214, f215, f216, f217, f218, f219, f220;
1230 real_t f221, f222, f223, f224, f225, f226, f227, f228, f229, f230;
1231 real_t f231, f232, f233, f234, f235, f236, f237, f238, f239, f240;
1232 real_t f241, f242, f243, f244, f245, f246, f247, f248, f249, f250;
1233 real_t f251, f252, f253, f254, f255, f256, f257, f258, f259, f260;
1234 real_t f261, f262, f263, f264, f265, f266, f267, f268, f269, f270;
1235 real_t f271, f272;
1236
1237 f0 = MUL_F(x[16], FRAC_CONST(0.7071067811865476));
1238 f1 = x[0] - f0;
1239 f2 = x[0] + f0;
1240 f3 = x[8] + x[24];
1241 f4 = MUL_C(x[8], COEF_CONST(1.3065629648763766));
1242 f5 = MUL_F(f3, FRAC_CONST((-0.9238795325112866)));
1243 f6 = MUL_F(x[24], FRAC_CONST((-0.5411961001461967)));
1244 f7 = f4 + f5;
1245 f8 = f6 - f5;
1246 f9 = f2 - f8;
1247 f10 = f2 + f8;
1248 f11 = f1 - f7;
1249 f12 = f1 + f7;
1250 f13 = x[4] + x[28];
1251 f14 = MUL_C(x[4], COEF_CONST(1.1758756024193588));
1252 f15 = MUL_F(f13, FRAC_CONST((-0.9807852804032304)));
1253 f16 = MUL_F(x[28], FRAC_CONST((-0.7856949583871021)));
1254 f17 = f14 + f15;
1255 f18 = f16 - f15;
1256 f19 = x[12] + x[20];
1257 f20 = MUL_C(x[12], COEF_CONST(1.3870398453221473));
1258 f21 = MUL_F(f19, FRAC_CONST((-0.8314696123025455)));
1259 f22 = MUL_F(x[20], FRAC_CONST((-0.2758993792829436)));
1260 f23 = f20 + f21;
1261 f24 = f22 - f21;
1262 f25 = f18 - f24;
1263 f26 = f18 + f24;
1264 f27 = MUL_F(f25, FRAC_CONST(0.7071067811865476));
1265 f28 = f17 - f23;
1266 f29 = f17 + f23;
1267 f30 = MUL_F(f29, FRAC_CONST(0.7071067811865476));
1268 f31 = f27 - f30;
1269 f32 = f27 + f30;
1270 f33 = f10 - f26;
1271 f34 = f10 + f26;
1272 f35 = f12 - f32;
1273 f36 = f12 + f32;
1274 f37 = f11 - f31;
1275 f38 = f11 + f31;
1276 f39 = f9 - f28;
1277 f40 = f9 + f28;
1278 f41 = x[2] + x[30];
1279 f42 = MUL_C(x[2], COEF_CONST(1.0932018670017569));
1280 f43 = MUL_F(f41, FRAC_CONST((-0.9951847266721969)));
1281 f44 = MUL_F(x[30], FRAC_CONST((-0.8971675863426368)));
1282 f45 = f42 + f43;
1283 f46 = f44 - f43;
1284 f47 = x[6] + x[26];
1285 f48 = MUL_C(x[6], COEF_CONST(1.2472250129866711));
1286 f49 = MUL_F(f47, FRAC_CONST((-0.9569403357322089)));
1287 f50 = MUL_F(x[26], FRAC_CONST((-0.6666556584777469)));
1288 f51 = f48 + f49;
1289 f52 = f50 - f49;
1290 f53 = x[10] + x[22];
1291 f54 = MUL_C(x[10], COEF_CONST(1.3533180011743526));
1292 f55 = MUL_F(f53, FRAC_CONST((-0.8819212643483551)));
1293 f56 = MUL_F(x[22], FRAC_CONST((-0.4105245275223575)));
1294 f57 = f54 + f55;
1295 f58 = f56 - f55;
1296 f59 = x[14] + x[18];
1297 f60 = MUL_C(x[14], COEF_CONST(1.4074037375263826));
1298 f61 = MUL_F(f59, FRAC_CONST((-0.7730104533627369)));
1299 f62 = MUL_F(x[18], FRAC_CONST((-0.1386171691990913)));
1300 f63 = f60 + f61;
1301 f64 = f62 - f61;
1302 f65 = f46 - f64;
1303 f66 = f46 + f64;
1304 f67 = f52 - f58;
1305 f68 = f52 + f58;
1306 f69 = f66 - f68;
1307 f70 = f66 + f68;
1308 f71 = MUL_F(f69, FRAC_CONST(0.7071067811865476));
1309 f72 = f65 + f67;
1310 f73 = MUL_C(f65, COEF_CONST(1.3065629648763766));
1311 f74 = MUL_F(f72, FRAC_CONST((-0.9238795325112866)));
1312 f75 = MUL_F(f67, FRAC_CONST((-0.5411961001461967)));
1313 f76 = f73 + f74;
1314 f77 = f75 - f74;
1315 f78 = f45 - f63;
1316 f79 = f45 + f63;
1317 f80 = f51 - f57;
1318 f81 = f51 + f57;
1319 f82 = f79 + f81;
1320 f83 = MUL_C(f79, COEF_CONST(1.3065629648763770));
1321 f84 = MUL_F(f82, FRAC_CONST((-0.3826834323650904)));
1322 f85 = MUL_F(f81, FRAC_CONST(0.5411961001461961));
1323 f86 = f83 + f84;
1324 f87 = f85 - f84;
1325 f88 = f78 - f80;
1326 f89 = f78 + f80;
1327 f90 = MUL_F(f89, FRAC_CONST(0.7071067811865476));
1328 f91 = f77 - f87;
1329 f92 = f77 + f87;
1330 f93 = f71 - f90;
1331 f94 = f71 + f90;
1332 f95 = f76 - f86;
1333 f96 = f76 + f86;
1334 f97 = f34 - f70;
1335 f98 = f34 + f70;
1336 f99 = f36 - f92;
1337 f100 = f36 + f92;
1338 f101 = f38 - f91;
1339 f102 = f38 + f91;
1340 f103 = f40 - f94;
1341 f104 = f40 + f94;
1342 f105 = f39 - f93;
1343 f106 = f39 + f93;
1344 f107 = f37 - f96;
1345 f108 = f37 + f96;
1346 f109 = f35 - f95;
1347 f110 = f35 + f95;
1348 f111 = f33 - f88;
1349 f112 = f33 + f88;
1350 f113 = x[1] + x[31];
1351 f114 = MUL_C(x[1], COEF_CONST(1.0478631305325901));
1352 f115 = MUL_F(f113, FRAC_CONST((-0.9987954562051724)));
1353 f116 = MUL_F(x[31], FRAC_CONST((-0.9497277818777548)));
1354 f117 = f114 + f115;
1355 f118 = f116 - f115;
1356 f119 = x[5] + x[27];
1357 f120 = MUL_C(x[5], COEF_CONST(1.2130114330978077));
1358 f121 = MUL_F(f119, FRAC_CONST((-0.9700312531945440)));
1359 f122 = MUL_F(x[27], FRAC_CONST((-0.7270510732912803)));
1360 f123 = f120 + f121;
1361 f124 = f122 - f121;
1362 f125 = x[9] + x[23];
1363 f126 = MUL_C(x[9], COEF_CONST(1.3315443865537255));
1364 f127 = MUL_F(f125, FRAC_CONST((-0.9039892931234433)));
1365 f128 = MUL_F(x[23], FRAC_CONST((-0.4764341996931612)));
1366 f129 = f126 + f127;
1367 f130 = f128 - f127;
1368 f131 = x[13] + x[19];
1369 f132 = MUL_C(x[13], COEF_CONST(1.3989068359730781));
1370 f133 = MUL_F(f131, FRAC_CONST((-0.8032075314806453)));
1371 f134 = MUL_F(x[19], FRAC_CONST((-0.2075082269882124)));
1372 f135 = f132 + f133;
1373 f136 = f134 - f133;
1374 f137 = x[17] + x[15];
1375 f138 = MUL_C(x[17], COEF_CONST(1.4125100802019777));
1376 f139 = MUL_F(f137, FRAC_CONST((-0.6715589548470187)));
1377 f140 = MUL_F(x[15], FRAC_CONST(0.0693921705079402));
1378 f141 = f138 + f139;
1379 f142 = f140 - f139;
1380 f143 = x[21] + x[11];
1381 f144 = MUL_C(x[21], COEF_CONST(1.3718313541934939));
1382 f145 = MUL_F(f143, FRAC_CONST((-0.5141027441932219)));
1383 f146 = MUL_F(x[11], FRAC_CONST(0.3436258658070501));
1384 f147 = f144 + f145;
1385 f148 = f146 - f145;
1386 f149 = x[25] + x[7];
1387 f150 = MUL_C(x[25], COEF_CONST(1.2784339185752409));
1388 f151 = MUL_F(f149, FRAC_CONST((-0.3368898533922200)));
1389 f152 = MUL_F(x[7], FRAC_CONST(0.6046542117908008));
1390 f153 = f150 + f151;
1391 f154 = f152 - f151;
1392 f155 = x[29] + x[3];
1393 f156 = MUL_C(x[29], COEF_CONST(1.1359069844201433));
1394 f157 = MUL_F(f155, FRAC_CONST((-0.1467304744553624)));
1395 f158 = MUL_F(x[3], FRAC_CONST(0.8424460355094185));
1396 f159 = f156 + f157;
1397 f160 = f158 - f157;
1398 f161 = f118 - f142;
1399 f162 = f118 + f142;
1400 f163 = f117 - f141;
1401 f164 = f117 + f141;
1402 f165 = f124 - f148;
1403 f166 = f124 + f148;
1404 f167 = f123 - f147;
1405 f168 = f123 + f147;
1406 f169 = f130 - f154;
1407 f170 = f130 + f154;
1408 f171 = f129 - f153;
1409 f172 = f129 + f153;
1410 f173 = f136 - f160;
1411 f174 = f136 + f160;
1412 f175 = f135 - f159;
1413 f176 = f135 + f159;
1414 f177 = f161 + f163;
1415 f178 = MUL_C(f161, COEF_CONST(1.1758756024193588));
1416 f179 = MUL_F(f177, FRAC_CONST((-0.9807852804032304)));
1417 f180 = MUL_F(f163, FRAC_CONST((-0.7856949583871021)));
1418 f181 = f178 + f179;
1419 f182 = f180 - f179;
1420 f183 = f165 + f167;
1421 f184 = MUL_C(f165, COEF_CONST(1.3870398453221475));
1422 f185 = MUL_F(f183, FRAC_CONST((-0.5555702330196022)));
1423 f186 = MUL_F(f167, FRAC_CONST(0.2758993792829431));
1424 f187 = f184 + f185;
1425 f188 = f186 - f185;
1426 f189 = f169 + f171;
1427 f190 = MUL_F(f169, FRAC_CONST(0.7856949583871022));
1428 f191 = MUL_F(f189, FRAC_CONST(0.1950903220161283));
1429 f192 = MUL_C(f171, COEF_CONST(1.1758756024193586));
1430 f193 = f190 + f191;
1431 f194 = f192 - f191;
1432 f195 = f173 + f175;
1433 f196 = MUL_F(f173, FRAC_CONST((-0.2758993792829430)));
1434 f197 = MUL_F(f195, FRAC_CONST(0.8314696123025452));
1435 f198 = MUL_C(f175, COEF_CONST(1.3870398453221475));
1436 f199 = f196 + f197;
1437 f200 = f198 - f197;
1438 f201 = f162 - f170;
1439 f202 = f162 + f170;
1440 f203 = f164 - f172;
1441 f204 = f164 + f172;
1442 f205 = f166 - f174;
1443 f206 = f166 + f174;
1444 f207 = f168 - f176;
1445 f208 = f168 + f176;
1446 f209 = f182 - f194;
1447 f210 = f182 + f194;
1448 f211 = f181 - f193;
1449 f212 = f181 + f193;
1450 f213 = f188 - f200;
1451 f214 = f188 + f200;
1452 f215 = f187 - f199;
1453 f216 = f187 + f199;
1454 f217 = f201 + f203;
1455 f218 = MUL_C(f201, COEF_CONST(1.3065629648763766));
1456 f219 = MUL_F(f217, FRAC_CONST((-0.9238795325112866)));
1457 f220 = MUL_F(f203, FRAC_CONST((-0.5411961001461967)));
1458 f221 = f218 + f219;
1459 f222 = f220 - f219;
1460 f223 = f205 + f207;
1461 f224 = MUL_F(f205, FRAC_CONST(0.5411961001461969));
1462 f225 = MUL_F(f223, FRAC_CONST(0.3826834323650898));
1463 f226 = MUL_C(f207, COEF_CONST(1.3065629648763766));
1464 f227 = f224 + f225;
1465 f228 = f226 - f225;
1466 f229 = f209 + f211;
1467 f230 = MUL_C(f209, COEF_CONST(1.3065629648763766));
1468 f231 = MUL_F(f229, FRAC_CONST((-0.9238795325112866)));
1469 f232 = MUL_F(f211, FRAC_CONST((-0.5411961001461967)));
1470 f233 = f230 + f231;
1471 f234 = f232 - f231;
1472 f235 = f213 + f215;
1473 f236 = MUL_F(f213, FRAC_CONST(0.5411961001461969));
1474 f237 = MUL_F(f235, FRAC_CONST(0.3826834323650898));
1475 f238 = MUL_C(f215, COEF_CONST(1.3065629648763766));
1476 f239 = f236 + f237;
1477 f240 = f238 - f237;
1478 f241 = f202 - f206;
1479 f242 = f202 + f206;
1480 f243 = f204 - f208;
1481 f244 = f204 + f208;
1482 f245 = f222 - f228;
1483 f246 = f222 + f228;
1484 f247 = f221 - f227;
1485 f248 = f221 + f227;
1486 f249 = f210 - f214;
1487 f250 = f210 + f214;
1488 f251 = f212 - f216;
1489 f252 = f212 + f216;
1490 f253 = f234 - f240;
1491 f254 = f234 + f240;
1492 f255 = f233 - f239;
1493 f256 = f233 + f239;
1494 f257 = f241 - f243;
1495 f258 = f241 + f243;
1496 f259 = MUL_F(f257, FRAC_CONST(0.7071067811865474));
1497 f260 = MUL_F(f258, FRAC_CONST(0.7071067811865474));
1498 f261 = f245 - f247;
1499 f262 = f245 + f247;
1500 f263 = MUL_F(f261, FRAC_CONST(0.7071067811865474));
1501 f264 = MUL_F(f262, FRAC_CONST(0.7071067811865474));
1502 f265 = f249 - f251;
1503 f266 = f249 + f251;
1504 f267 = MUL_F(f265, FRAC_CONST(0.7071067811865474));
1505 f268 = MUL_F(f266, FRAC_CONST(0.7071067811865474));
1506 f269 = f253 - f255;
1507 f270 = f253 + f255;
1508 f271 = MUL_F(f269, FRAC_CONST(0.7071067811865474));
1509 f272 = MUL_F(f270, FRAC_CONST(0.7071067811865474));
1510 y[31] = f98 - f242;
1511 y[0] = f98 + f242;
1512 y[30] = f100 - f250;
1513 y[1] = f100 + f250;
1514 y[29] = f102 - f254;
1515 y[2] = f102 + f254;
1516 y[28] = f104 - f246;
1517 y[3] = f104 + f246;
1518 y[27] = f106 - f264;
1519 y[4] = f106 + f264;
1520 y[26] = f108 - f272;
1521 y[5] = f108 + f272;
1522 y[25] = f110 - f268;
1523 y[6] = f110 + f268;
1524 y[24] = f112 - f260;
1525 y[7] = f112 + f260;
1526 y[23] = f111 - f259;
1527 y[8] = f111 + f259;
1528 y[22] = f109 - f267;
1529 y[9] = f109 + f267;
1530 y[21] = f107 - f271;
1531 y[10] = f107 + f271;
1532 y[20] = f105 - f263;
1533 y[11] = f105 + f263;
1534 y[19] = f103 - f248;
1535 y[12] = f103 + f248;
1536 y[18] = f101 - f256;
1537 y[13] = f101 + f256;
1538 y[17] = f99 - f252;
1539 y[14] = f99 + f252;
1540 y[16] = f97 - f244;
1541 y[15] = f97 + f244;
1542 }
1543
1544 void DCT2_32_unscaled(real_t *y, real_t *x)
1545 {
1546 real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
1547 real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
1548 real_t f21, f22, f23, f24, f25, f26, f27, f28, f29, f30;
1549 real_t f31, f32, f33, f34, f35, f36, f37, f38, f39, f40;
1550 real_t f41, f42, f43, f44, f45, f46, f47, f48, f49, f50;
1551 real_t f51, f52, f53, f54, f55, f56, f57, f58, f59, f60;
1552 real_t f63, f64, f65, f66, f69, f70, f71, f72, f73, f74;
1553 real_t f75, f76, f77, f78, f79, f80, f81, f83, f85, f86;
1554 real_t f89, f90, f91, f92, f93, f94, f95, f96, f97, f98;
1555 real_t f99, f100, f101, f102, f103, f104, f105, f106, f107, f108;
1556 real_t f109, f110, f111, f112, f113, f114, f115, f116, f117, f118;
1557 real_t f119, f120, f121, f122, f123, f124, f127, f128, f129, f130;
1558 real_t f133, f134, f135, f136, f139, f140, f141, f142, f145, f146;
1559 real_t f147, f148, f149, f150, f151, f152, f153, f154, f155, f156;
1560 real_t f157, f158, f159, f160, f161, f162, f163, f164, f165, f166;
1561 real_t f167, f168, f169, f170, f171, f172, f173, f174, f175, f176;
1562 real_t f177, f178, f179, f180, f181, f182, f183, f184, f185, f186;
1563 real_t f187, f188, f189, f190, f191, f192, f193, f194, f195, f196;
1564 real_t f197, f198, f199, f200, f201, f202, f203, f204, f205, f206;
1565 real_t f207, f208, f209, f210, f211, f212, f213, f214, f215, f216;
1566 real_t f217, f218, f219, f220, f221, f222, f223, f224, f225, f226;
1567 real_t f227, f228, f229, f230, f231, f232, f233, f234, f235, f236;
1568 real_t f237, f238, f239, f240, f241, f242, f243, f244, f247, f248;
1569 real_t f249, f250, f253, f254, f255, f256, f259, f260, f261, f262;
1570 real_t f265, f266, f267, f268, f271, f272, f273, f274, f277, f278;
1571 real_t f279, f280, f283, f284, f285, f286;
1572
1573 f0 = x[0] - x[31];
1574 f1 = x[0] + x[31];
1575 f2 = x[1] - x[30];
1576 f3 = x[1] + x[30];
1577 f4 = x[2] - x[29];
1578 f5 = x[2] + x[29];
1579 f6 = x[3] - x[28];
1580 f7 = x[3] + x[28];
1581 f8 = x[4] - x[27];
1582 f9 = x[4] + x[27];
1583 f10 = x[5] - x[26];
1584 f11 = x[5] + x[26];
1585 f12 = x[6] - x[25];
1586 f13 = x[6] + x[25];
1587 f14 = x[7] - x[24];
1588 f15 = x[7] + x[24];
1589 f16 = x[8] - x[23];
1590 f17 = x[8] + x[23];
1591 f18 = x[9] - x[22];
1592 f19 = x[9] + x[22];
1593 f20 = x[10] - x[21];
1594 f21 = x[10] + x[21];
1595 f22 = x[11] - x[20];
1596 f23 = x[11] + x[20];
1597 f24 = x[12] - x[19];
1598 f25 = x[12] + x[19];
1599 f26 = x[13] - x[18];
1600 f27 = x[13] + x[18];
1601 f28 = x[14] - x[17];
1602 f29 = x[14] + x[17];
1603 f30 = x[15] - x[16];
1604 f31 = x[15] + x[16];
1605 f32 = f1 - f31;
1606 f33 = f1 + f31;
1607 f34 = f3 - f29;
1608 f35 = f3 + f29;
1609 f36 = f5 - f27;
1610 f37 = f5 + f27;
1611 f38 = f7 - f25;
1612 f39 = f7 + f25;
1613 f40 = f9 - f23;
1614 f41 = f9 + f23;
1615 f42 = f11 - f21;
1616 f43 = f11 + f21;
1617 f44 = f13 - f19;
1618 f45 = f13 + f19;
1619 f46 = f15 - f17;
1620 f47 = f15 + f17;
1621 f48 = f33 - f47;
1622 f49 = f33 + f47;
1623 f50 = f35 - f45;
1624 f51 = f35 + f45;
1625 f52 = f37 - f43;
1626 f53 = f37 + f43;
1627 f54 = f39 - f41;
1628 f55 = f39 + f41;
1629 f56 = f49 - f55;
1630 f57 = f49 + f55;
1631 f58 = f51 - f53;
1632 f59 = f51 + f53;
1633 f60 = f57 - f59;
1634 y[0] = f57 + f59;
1635 y[16] = MUL_F(FRAC_CONST(0.7071067811865476), f60);
1636 f63 = f56 + f58;
1637 f64 = MUL_C(COEF_CONST(1.3065629648763766), f56);
1638 f65 = MUL_F(FRAC_CONST(-0.9238795325112866), f63);
1639 f66 = MUL_F(FRAC_CONST(-0.5411961001461967), f58);
1640 y[24] = f64 + f65;
1641 y[8] = f66 - f65;
1642 f69 = f48 + f54;
1643 f70 = MUL_C(COEF_CONST(1.1758756024193588), f48);
1644 f71 = MUL_F(FRAC_CONST(-0.9807852804032304), f69);
1645 f72 = MUL_F(FRAC_CONST(-0.7856949583871021), f54);
1646 f73 = f70 + f71;
1647 f74 = f72 - f71;
1648 f75 = f50 + f52;
1649 f76 = MUL_C(COEF_CONST(1.3870398453221473), f50);
1650 f77 = MUL_F(FRAC_CONST(-0.8314696123025455), f75);
1651 f78 = MUL_F(FRAC_CONST(-0.2758993792829436), f52);
1652 f79 = f76 + f77;
1653 f80 = f78 - f77;
1654 f81 = f74 - f80;
1655 y[4] = f74 + f80;
1656 f83 = MUL_F(FRAC_CONST(0.7071067811865476), f81);
1657 y[28] = f73 - f79;
1658 f85 = f73 + f79;
1659 f86 = MUL_F(FRAC_CONST(0.7071067811865476), f85);
1660 y[20] = f83 - f86;
1661 y[12] = f83 + f86;
1662 f89 = f34 - f36;
1663 f90 = f34 + f36;
1664 f91 = f38 - f40;
1665 f92 = f38 + f40;
1666 f93 = f42 - f44;
1667 f94 = f42 + f44;
1668 f95 = MUL_F(FRAC_CONST(0.7071067811865476), f92);
1669 f96 = f32 - f95;
1670 f97 = f32 + f95;
1671 f98 = f90 + f94;
1672 f99 = MUL_C(COEF_CONST(1.3065629648763766), f90);
1673 f100 = MUL_F(FRAC_CONST(-0.9238795325112866), f98);
1674 f101 = MUL_F(FRAC_CONST(-0.5411961001461967), f94);
1675 f102 = f99 + f100;
1676 f103 = f101 - f100;
1677 f104 = f97 - f103;
1678 f105 = f97 + f103;
1679 f106 = f96 - f102;
1680 f107 = f96 + f102;
1681 f108 = MUL_F(FRAC_CONST(0.7071067811865476), f91);
1682 f109 = f46 - f108;
1683 f110 = f46 + f108;
1684 f111 = f93 + f89;
1685 f112 = MUL_C(COEF_CONST(1.3065629648763766), f93);
1686 f113 = MUL_F(FRAC_CONST(-0.9238795325112866), f111);
1687 f114 = MUL_F(FRAC_CONST(-0.5411961001461967), f89);
1688 f115 = f112 + f113;
1689 f116 = f114 - f113;
1690 f117 = f110 - f116;
1691 f118 = f110 + f116;
1692 f119 = f109 - f115;
1693 f120 = f109 + f115;
1694 f121 = f118 + f105;
1695 f122 = MUL_F(FRAC_CONST(-0.8971675863426361), f118);
1696 f123 = MUL_F(FRAC_CONST(0.9951847266721968), f121);
1697 f124 = MUL_C(COEF_CONST(1.0932018670017576), f105);
1698 y[2] = f122 + f123;
1699 y[30] = f124 - f123;
1700 f127 = f107 - f120;
1701 f128 = MUL_F(FRAC_CONST(-0.6666556584777466), f120);
1702 f129 = MUL_F(FRAC_CONST(0.9569403357322089), f127);
1703 f130 = MUL_C(COEF_CONST(1.2472250129866713), f107);
1704 y[6] = f129 - f128;
1705 y[26] = f130 - f129;
1706 f133 = f119 + f106;
1707 f134 = MUL_F(FRAC_CONST(-0.4105245275223571), f119);
1708 f135 = MUL_F(FRAC_CONST(0.8819212643483549), f133);
1709 f136 = MUL_C(COEF_CONST(1.3533180011743529), f106);
1710 y[10] = f134 + f135;
1711 y[22] = f136 - f135;
1712 f139 = f104 - f117;
1713 f140 = MUL_F(FRAC_CONST(-0.1386171691990915), f117);
1714 f141 = MUL_F(FRAC_CONST(0.7730104533627370), f139);
1715 f142 = MUL_C(COEF_CONST(1.4074037375263826), f104);
1716 y[14] = f141 - f140;
1717 y[18] = f142 - f141;
1718 f145 = f2 - f4;
1719 f146 = f2 + f4;
1720 f147 = f6 - f8;
1721 f148 = f6 + f8;
1722 f149 = f10 - f12;
1723 f150 = f10 + f12;
1724 f151 = f14 - f16;
1725 f152 = f14 + f16;
1726 f153 = f18 - f20;
1727 f154 = f18 + f20;
1728 f155 = f22 - f24;
1729 f156 = f22 + f24;
1730 f157 = f26 - f28;
1731 f158 = f26 + f28;
1732 f159 = MUL_F(FRAC_CONST(0.7071067811865476), f152);
1733 f160 = f0 - f159;
1734 f161 = f0 + f159;
1735 f162 = f148 + f156;
1736 f163 = MUL_C(COEF_CONST(1.3065629648763766), f148);
1737 f164 = MUL_F(FRAC_CONST(-0.9238795325112866), f162);
1738 f165 = MUL_F(FRAC_CONST(-0.5411961001461967), f156);
1739 f166 = f163 + f164;
1740 f167 = f165 - f164;
1741 f168 = f161 - f167;
1742 f169 = f161 + f167;
1743 f170 = f160 - f166;
1744 f171 = f160 + f166;
1745 f172 = f146 + f158;
1746 f173 = MUL_C(COEF_CONST(1.1758756024193588), f146);
1747 f174 = MUL_F(FRAC_CONST(-0.9807852804032304), f172);
1748 f175 = MUL_F(FRAC_CONST(-0.7856949583871021), f158);
1749 f176 = f173 + f174;
1750 f177 = f175 - f174;
1751 f178 = f150 + f154;
1752 f179 = MUL_C(COEF_CONST(1.3870398453221473), f150);
1753 f180 = MUL_F(FRAC_CONST(-0.8314696123025455), f178);
1754 f181 = MUL_F(FRAC_CONST(-0.2758993792829436), f154);
1755 f182 = f179 + f180;
1756 f183 = f181 - f180;
1757 f184 = f177 - f183;
1758 f185 = f177 + f183;
1759 f186 = MUL_F(FRAC_CONST(0.7071067811865476), f184);
1760 f187 = f176 - f182;
1761 f188 = f176 + f182;
1762 f189 = MUL_F(FRAC_CONST(0.7071067811865476), f188);
1763 f190 = f186 - f189;
1764 f191 = f186 + f189;
1765 f192 = f169 - f185;
1766 f193 = f169 + f185;
1767 f194 = f171 - f191;
1768 f195 = f171 + f191;
1769 f196 = f170 - f190;
1770 f197 = f170 + f190;
1771 f198 = f168 - f187;
1772 f199 = f168 + f187;
1773 f200 = MUL_F(FRAC_CONST(0.7071067811865476), f151);
1774 f201 = f30 - f200;
1775 f202 = f30 + f200;
1776 f203 = f155 + f147;
1777 f204 = MUL_C(COEF_CONST(1.3065629648763766), f155);
1778 f205 = MUL_F(FRAC_CONST(-0.9238795325112866), f203);
1779 f206 = MUL_F(FRAC_CONST(-0.5411961001461967), f147);
1780 f207 = f204 + f205;
1781 f208 = f206 - f205;
1782 f209 = f202 - f208;
1783 f210 = f202 + f208;
1784 f211 = f201 - f207;
1785 f212 = f201 + f207;
1786 f213 = f157 + f145;
1787 f214 = MUL_C(COEF_CONST(1.1758756024193588), f157);
1788 f215 = MUL_F(FRAC_CONST(-0.9807852804032304), f213);
1789 f216 = MUL_F(FRAC_CONST(-0.7856949583871021), f145);
1790 f217 = f214 + f215;
1791 f218 = f216 - f215;
1792 f219 = f153 + f149;
1793 f220 = MUL_C(COEF_CONST(1.3870398453221473), f153);
1794 f221 = MUL_F(FRAC_CONST(-0.8314696123025455), f219);
1795 f222 = MUL_F(FRAC_CONST(-0.2758993792829436), f149);
1796 f223 = f220 + f221;
1797 f224 = f222 - f221;
1798 f225 = f218 - f224;
1799 f226 = f218 + f224;
1800 f227 = MUL_F(FRAC_CONST(0.7071067811865476), f225);
1801 f228 = f217 - f223;
1802 f229 = f217 + f223;
1803 f230 = MUL_F(FRAC_CONST(0.7071067811865476), f229);
1804 f231 = f227 - f230;
1805 f232 = f227 + f230;
1806 f233 = f210 - f226;
1807 f234 = f210 + f226;
1808 f235 = f212 - f232;
1809 f236 = f212 + f232;
1810 f237 = f211 - f231;
1811 f238 = f211 + f231;
1812 f239 = f209 - f228;
1813 f240 = f209 + f228;
1814 f241 = f234 + f193;
1815 f242 = MUL_F(FRAC_CONST(-0.9497277818777543), f234);
1816 f243 = MUL_F(FRAC_CONST(0.9987954562051724), f241);
1817 f244 = MUL_C(COEF_CONST(1.0478631305325905), f193);
1818 y[1] = f242 + f243;
1819 y[31] = f244 - f243;
1820 f247 = f195 - f236;
1821 f248 = MUL_F(FRAC_CONST(-0.8424460355094192), f236);
1822 f249 = MUL_F(FRAC_CONST(0.9891765099647810), f247);
1823 f250 = MUL_C(COEF_CONST(1.1359069844201428), f195);
1824 y[3] = f249 - f248;
1825 y[29] = f250 - f249;
1826 f253 = f238 + f197;
1827 f254 = MUL_F(FRAC_CONST(-0.7270510732912801), f238);
1828 f255 = MUL_F(FRAC_CONST(0.9700312531945440), f253);
1829 f256 = MUL_C(COEF_CONST(1.2130114330978079), f197);
1830 y[5] = f254 + f255;
1831 y[27] = f256 - f255;
1832 f259 = f199 - f240;
1833 f260 = MUL_F(FRAC_CONST(-0.6046542117908007), f240);
1834 f261 = MUL_F(FRAC_CONST(0.9415440651830208), f259);
1835 f262 = MUL_C(COEF_CONST(1.2784339185752409), f199);
1836 y[7] = f261 - f260;
1837 y[25] = f262 - f261;
1838 f265 = f239 + f198;
1839 f266 = MUL_F(FRAC_CONST(-0.4764341996931611), f239);
1840 f267 = MUL_F(FRAC_CONST(0.9039892931234433), f265);
1841 f268 = MUL_C(COEF_CONST(1.3315443865537255), f198);
1842 y[9] = f266 + f267;
1843 y[23] = f268 - f267;
1844 f271 = f196 - f237;
1845 f272 = MUL_F(FRAC_CONST(-0.3436258658070505), f237);
1846 f273 = MUL_F(FRAC_CONST(0.8577286100002721), f271);
1847 f274 = MUL_C(COEF_CONST(1.3718313541934939), f196);
1848 y[11] = f273 - f272;
1849 y[21] = f274 - f273;
1850 f277 = f235 + f194;
1851 f278 = MUL_F(FRAC_CONST(-0.2075082269882114), f235);
1852 f279 = MUL_F(FRAC_CONST(0.8032075314806448), f277);
1853 f280 = MUL_C(COEF_CONST(1.3989068359730783), f194);
1854 y[13] = f278 + f279;
1855 y[19] = f280 - f279;
1856 f283 = f192 - f233;
1857 f284 = MUL_F(FRAC_CONST(-0.0693921705079408), f233);
1858 f285 = MUL_F(FRAC_CONST(0.7409511253549591), f283);
1859 f286 = MUL_C(COEF_CONST(1.4125100802019774), f192);
1860 y[15] = f285 - f284;
1861 y[17] = f286 - f285;
1862 }
1863
1864 #else
1865
1866
1867 #define n 32
1868 #define log2n 5
1869
1870 // w_array_real[i] = cos(2*M_PI*i/32)
1871 static const real_t w_array_real[] = {
1872 FRAC_CONST(1.000000000000000), FRAC_CONST(0.980785279337272),
1873 FRAC_CONST(0.923879528329380), FRAC_CONST(0.831469603195765),
1874 FRAC_CONST(0.707106765732237), FRAC_CONST(0.555570210304169),
1875 FRAC_CONST(0.382683402077046), FRAC_CONST(0.195090284503576),
1876 FRAC_CONST(0.000000000000000), FRAC_CONST(-0.195090370246552),
1877 FRAC_CONST(-0.382683482845162), FRAC_CONST(-0.555570282993553),
1878 FRAC_CONST(-0.707106827549476), FRAC_CONST(-0.831469651765257),
1879 FRAC_CONST(-0.923879561784627), FRAC_CONST(-0.980785296392607)
1880 };
1881
1882 // w_array_imag[i] = sin(-2*M_PI*i/32)
1883 static const real_t w_array_imag[] = {
1884 FRAC_CONST(0.000000000000000), FRAC_CONST(-0.195090327375064),
1885 FRAC_CONST(-0.382683442461104), FRAC_CONST(-0.555570246648862),
1886 FRAC_CONST(-0.707106796640858), FRAC_CONST(-0.831469627480512),
1887 FRAC_CONST(-0.923879545057005), FRAC_CONST(-0.980785287864940),
1888 FRAC_CONST(-1.000000000000000), FRAC_CONST(-0.980785270809601),
1889 FRAC_CONST(-0.923879511601754), FRAC_CONST(-0.831469578911016),
1890 FRAC_CONST(-0.707106734823616), FRAC_CONST(-0.555570173959476),
1891 FRAC_CONST(-0.382683361692986), FRAC_CONST(-0.195090241632088)
1892 };
1893
1894 // FFT decimation in frequency
1895 // 4*16*2+16=128+16=144 multiplications
1896 // 6*16*2+10*8+4*16*2=192+80+128=400 additions
1897 static void fft_dif(real_t * Real, real_t * Imag)
1898 {
1899 real_t w_real, w_imag; // For faster access
1900 real_t point1_real, point1_imag, point2_real, point2_imag; // For faster access
1901 uint32_t j, i, i2, w_index; // Counters
1902
1903 // First 2 stages of 32 point FFT decimation in frequency
1904 // 4*16*2=64*2=128 multiplications
1905 // 6*16*2=96*2=192 additions
1906 // Stage 1 of 32 point FFT decimation in frequency
1907 for (i = 0; i < 16; i++)
1908 {
1909 point1_real = Real[i];
1910 point1_imag = Imag[i];
1911 i2 = i+16;
1912 point2_real = Real[i2];
1913 point2_imag = Imag[i2];
1914
1915 w_real = w_array_real[i];
1916 w_imag = w_array_imag[i];
1917
1918 // temp1 = x[i] - x[i2]
1919 point1_real -= point2_real;
1920 point1_imag -= point2_imag;
1921
1922 // x[i1] = x[i] + x[i2]
1923 Real[i] += point2_real;
1924 Imag[i] += point2_imag;
1925
1926 // x[i2] = (x[i] - x[i2]) * w
1927 Real[i2] = (MUL_F(point1_real,w_real) - MUL_F(point1_imag,w_imag));
1928 Imag[i2] = (MUL_F(point1_real,w_imag) + MUL_F(point1_imag,w_real));
1929 }
1930 // Stage 2 of 32 point FFT decimation in frequency
1931 for (j = 0, w_index = 0; j < 8; j++, w_index += 2)
1932 {
1933 w_real = w_array_real[w_index];
1934 w_imag = w_array_imag[w_index];
1935
1936 i = j;
1937 point1_real = Real[i];
1938 point1_imag = Imag[i];
1939 i2 = i+8;
1940 point2_real = Real[i2];
1941 point2_imag = Imag[i2];
1942
1943 // temp1 = x[i] - x[i2]
1944 point1_real -= point2_real;
1945 point1_imag -= point2_imag;
1946
1947 // x[i1] = x[i] + x[i2]
1948 Real[i] += point2_real;
1949 Imag[i] += point2_imag;
1950
1951 // x[i2] = (x[i] - x[i2]) * w
1952 Real[i2] = (MUL_F(point1_real,w_real) - MUL_F(point1_imag,w_imag));
1953 Imag[i2] = (MUL_F(point1_real,w_imag) + MUL_F(point1_imag,w_real));
1954
1955 i = j+16;
1956 point1_real = Real[i];
1957 point1_imag = Imag[i];
1958 i2 = i+8;
1959 point2_real = Real[i2];
1960 point2_imag = Imag[i2];
1961
1962 // temp1 = x[i] - x[i2]
1963 point1_real -= point2_real;
1964 point1_imag -= point2_imag;
1965
1966 // x[i1] = x[i] + x[i2]
1967 Real[i] += point2_real;
1968 Imag[i] += point2_imag;
1969
1970 // x[i2] = (x[i] - x[i2]) * w
1971 Real[i2] = (MUL_F(point1_real,w_real) - MUL_F(point1_imag,w_imag));
1972 Imag[i2] = (MUL_F(point1_real,w_imag) + MUL_F(point1_imag,w_real));
1973 }
1974
1975 // Stage 3 of 32 point FFT decimation in frequency
1976 // 2*4*2=16 multiplications
1977 // 4*4*2+6*4*2=10*8=80 additions
1978 for (i = 0; i < n; i += 8)
1979 {
1980 i2 = i+4;
1981 point1_real = Real[i];
1982 point1_imag = Imag[i];
1983
1984 point2_real = Real[i2];
1985 point2_imag = Imag[i2];
1986
1987 // out[i1] = point1 + point2
1988 Real[i] += point2_real;
1989 Imag[i] += point2_imag;
1990
1991 // out[i2] = point1 - point2
1992 Real[i2] = point1_real - point2_real;
1993 Imag[i2] = point1_imag - point2_imag;
1994 }
1995 w_real = w_array_real[4]; // = sqrt(2)/2
1996 // w_imag = -w_real; // = w_array_imag[4]; // = -sqrt(2)/2
1997 for (i = 1; i < n; i += 8)
1998 {
1999 i2 = i+4;
2000 point1_real = Real[i];
2001 point1_imag = Imag[i];
2002
2003 point2_real = Real[i2];
2004 point2_imag = Imag[i2];
2005
2006 // temp1 = x[i] - x[i2]
2007 point1_real -= point2_real;
2008 point1_imag -= point2_imag;
2009
2010 // x[i1] = x[i] + x[i2]
2011 Real[i] += point2_real;
2012 Imag[i] += point2_imag;
2013
2014 // x[i2] = (x[i] - x[i2]) * w
2015 Real[i2] = MUL_F(point1_real+point1_imag, w_real);
2016 Imag[i2] = MUL_F(point1_imag-point1_real, w_real);
2017 }
2018 for (i = 2; i < n; i += 8)
2019 {
2020 i2 = i+4;
2021 point1_real = Real[i];
2022 point1_imag = Imag[i];
2023
2024 point2_real = Real[i2];
2025 point2_imag = Imag[i2];
2026
2027 // x[i] = x[i] + x[i2]
2028 Real[i] += point2_real;
2029 Imag[i] += point2_imag;
2030
2031 // x[i2] = (x[i] - x[i2]) * (-i)
2032 Real[i2] = point1_imag - point2_imag;
2033 Imag[i2] = point2_real - point1_real;
2034 }
2035 w_real = w_array_real[12]; // = -sqrt(2)/2
2036 // w_imag = w_real; // = w_array_imag[12]; // = -sqrt(2)/2
2037 for (i = 3; i < n; i += 8)
2038 {
2039 i2 = i+4;
2040 point1_real = Real[i];
2041 point1_imag = Imag[i];
2042
2043 point2_real = Real[i2];
2044 point2_imag = Imag[i2];
2045
2046 // temp1 = x[i] - x[i2]
2047 point1_real -= point2_real;
2048 point1_imag -= point2_imag;
2049
2050 // x[i1] = x[i] + x[i2]
2051 Real[i] += point2_real;
2052 Imag[i] += point2_imag;
2053
2054 // x[i2] = (x[i] - x[i2]) * w
2055 Real[i2] = MUL_F(point1_real-point1_imag, w_real);
2056 Imag[i2] = MUL_F(point1_real+point1_imag, w_real);
2057 }
2058
2059
2060 // Stage 4 of 32 point FFT decimation in frequency (no multiplications)
2061 // 16*4=64 additions
2062 for (i = 0; i < n; i += 4)
2063 {
2064 i2 = i+2;
2065 point1_real = Real[i];
2066 point1_imag = Imag[i];
2067
2068 point2_real = Real[i2];
2069 point2_imag = Imag[i2];
2070
2071 // x[i1] = x[i] + x[i2]
2072 Real[i] += point2_real;
2073 Imag[i] += point2_imag;
2074
2075 // x[i2] = x[i] - x[i2]
2076 Real[i2] = point1_real - point2_real;
2077 Imag[i2] = point1_imag - point2_imag;
2078 }
2079 for (i = 1; i < n; i += 4)
2080 {
2081 i2 = i+2;
2082 point1_real = Real[i];
2083 point1_imag = Imag[i];
2084
2085 point2_real = Real[i2];
2086 point2_imag = Imag[i2];
2087
2088 // x[i] = x[i] + x[i2]
2089 Real[i] += point2_real;
2090 Imag[i] += point2_imag;
2091
2092 // x[i2] = (x[i] - x[i2]) * (-i)
2093 Real[i2] = point1_imag - point2_imag;
2094 Imag[i2] = point2_real - point1_real;
2095 }
2096
2097 // Stage 5 of 32 point FFT decimation in frequency (no multiplications)
2098 // 16*4=64 additions
2099 for (i = 0; i < n; i += 2)
2100 {
2101 i2 = i+1;
2102 point1_real = Real[i];
2103 point1_imag = Imag[i];
2104
2105 point2_real = Real[i2];
2106 point2_imag = Imag[i2];
2107
2108 // out[i1] = point1 + point2
2109 Real[i] += point2_real;
2110 Imag[i] += point2_imag;
2111
2112 // out[i2] = point1 - point2
2113 Real[i2] = point1_real - point2_real;
2114 Imag[i2] = point1_imag - point2_imag;
2115 }
2116
2117 #ifdef REORDER_IN_FFT
2118 FFTReorder(Real, Imag);
2119 #endif // #ifdef REORDER_IN_FFT
2120 }
2121 #undef n
2122 #undef log2n
2123
2124 static const real_t dct4_64_tab[] = {
2125 COEF_CONST(0.999924719333649), COEF_CONST(0.998118102550507),
2126 COEF_CONST(0.993906974792480), COEF_CONST(0.987301409244537),
2127 COEF_CONST(0.978317379951477), COEF_CONST(0.966976463794708),
2128 COEF_CONST(0.953306019306183), COEF_CONST(0.937339007854462),
2129 COEF_CONST(0.919113874435425), COEF_CONST(0.898674488067627),
2130 COEF_CONST(0.876070082187653), COEF_CONST(0.851355195045471),
2131 COEF_CONST(0.824589252471924), COEF_CONST(0.795836925506592),
2132 COEF_CONST(0.765167236328125), COEF_CONST(0.732654273509979),
2133 COEF_CONST(0.698376238346100), COEF_CONST(0.662415742874146),
2134 COEF_CONST(0.624859452247620), COEF_CONST(0.585797846317291),
2135 COEF_CONST(0.545324981212616), COEF_CONST(0.503538429737091),
2136 COEF_CONST(0.460538715124130), COEF_CONST(0.416429549455643),
2137 COEF_CONST(0.371317148208618), COEF_CONST(0.325310230255127),
2138 COEF_CONST(0.278519600629807), COEF_CONST(0.231058135628700),
2139 COEF_CONST(0.183039888739586), COEF_CONST(0.134580686688423),
2140 COEF_CONST(0.085797272622585), COEF_CONST(0.036807164549828),
2141 COEF_CONST(-1.012196302413940), COEF_CONST(-1.059438824653626),
2142 COEF_CONST(-1.104129195213318), COEF_CONST(-1.146159529685974),
2143 COEF_CONST(-1.185428738594055), COEF_CONST(-1.221842169761658),
2144 COEF_CONST(-1.255311965942383), COEF_CONST(-1.285757660865784),
2145 COEF_CONST(-1.313105940818787), COEF_CONST(-1.337290763854981),
2146 COEF_CONST(-1.358253836631775), COEF_CONST(-1.375944852828980),
2147 COEF_CONST(-1.390321016311646), COEF_CONST(-1.401347875595093),
2148 COEF_CONST(-1.408998727798462), COEF_CONST(-1.413255214691162),
2149 COEF_CONST(-1.414107084274292), COEF_CONST(-1.411552190780640),
2150 COEF_CONST(-1.405596733093262), COEF_CONST(-1.396255016326904),
2151 COEF_CONST(-1.383549690246582), COEF_CONST(-1.367511272430420),
2152 COEF_CONST(-1.348178386688232), COEF_CONST(-1.325597524642944),
2153 COEF_CONST(-1.299823284149170), COEF_CONST(-1.270917654037476),
2154 COEF_CONST(-1.238950133323669), COEF_CONST(-1.203998088836670),
2155 COEF_CONST(-1.166145324707031), COEF_CONST(-1.125483393669128),
2156 COEF_CONST(-1.082109928131104), COEF_CONST(-1.036129593849182),
2157 COEF_CONST(-0.987653195858002), COEF_CONST(-0.936797380447388),
2158 COEF_CONST(-0.883684754371643), COEF_CONST(-0.828443288803101),
2159 COEF_CONST(-0.771206021308899), COEF_CONST(-0.712110757827759),
2160 COEF_CONST(-0.651300072669983), COEF_CONST(-0.588920354843140),
2161 COEF_CONST(-0.525121808052063), COEF_CONST(-0.460058242082596),
2162 COEF_CONST(-0.393886327743530), COEF_CONST(-0.326765477657318),
2163 COEF_CONST(-0.258857429027557), COEF_CONST(-0.190325915813446),
2164 COEF_CONST(-0.121335685253143), COEF_CONST(-0.052053272724152),
2165 COEF_CONST(0.017354607582092), COEF_CONST(0.086720645427704),
2166 COEF_CONST(0.155877828598022), COEF_CONST(0.224659323692322),
2167 COEF_CONST(0.292899727821350), COEF_CONST(0.360434412956238),
2168 COEF_CONST(0.427100926637650), COEF_CONST(0.492738455533981),
2169 COEF_CONST(0.557188928127289), COEF_CONST(0.620297133922577),
2170 COEF_CONST(0.681910991668701), COEF_CONST(0.741881847381592),
2171 COEF_CONST(0.800065577030182), COEF_CONST(0.856321990489960),
2172 COEF_CONST(0.910515367984772), COEF_CONST(0.962515234947205),
2173 COEF_CONST(1.000000000000000), COEF_CONST(0.998795449733734),
2174 COEF_CONST(0.995184719562531), COEF_CONST(0.989176511764526),
2175 COEF_CONST(0.980785250663757), COEF_CONST(0.970031261444092),
2176 COEF_CONST(0.956940352916718), COEF_CONST(0.941544055938721),
2177 COEF_CONST(0.923879504203796), COEF_CONST(0.903989315032959),
2178 COEF_CONST(0.881921231746674), COEF_CONST(0.857728600502014),
2179 COEF_CONST(0.831469595432281), COEF_CONST(0.803207516670227),
2180 COEF_CONST(0.773010432720184), COEF_CONST(0.740951120853424),
2181 COEF_CONST(0.707106769084930), COEF_CONST(0.671558916568756),
2182 COEF_CONST(0.634393274784088), COEF_CONST(0.595699310302734),
2183 COEF_CONST(0.555570185184479), COEF_CONST(0.514102697372437),
2184 COEF_CONST(0.471396654844284), COEF_CONST(0.427555114030838),
2185 COEF_CONST(0.382683426141739), COEF_CONST(0.336889833211899),
2186 COEF_CONST(0.290284633636475), COEF_CONST(0.242980122566223),
2187 COEF_CONST(0.195090234279633), COEF_CONST(0.146730497479439),
2188 COEF_CONST(0.098017133772373), COEF_CONST(0.049067649990320),
2189 COEF_CONST(-1.000000000000000), COEF_CONST(-1.047863125801086),
2190 COEF_CONST(-1.093201875686646), COEF_CONST(-1.135906934738159),
2191 COEF_CONST(-1.175875544548035), COEF_CONST(-1.213011503219605),
2192 COEF_CONST(-1.247225046157837), COEF_CONST(-1.278433918952942),
2193 COEF_CONST(-1.306562900543213), COEF_CONST(-1.331544399261475),
2194 COEF_CONST(-1.353317975997925), COEF_CONST(-1.371831417083740),
2195 COEF_CONST(-1.387039899826050), COEF_CONST(-1.398906826972961),
2196 COEF_CONST(-1.407403707504273), COEF_CONST(-1.412510156631470),
2197 COEF_CONST(0), COEF_CONST(-1.412510156631470),
2198 COEF_CONST(-1.407403707504273), COEF_CONST(-1.398906826972961),
2199 COEF_CONST(-1.387039899826050), COEF_CONST(-1.371831417083740),
2200 COEF_CONST(-1.353317975997925), COEF_CONST(-1.331544399261475),
2201 COEF_CONST(-1.306562900543213), COEF_CONST(-1.278433918952942),
2202 COEF_CONST(-1.247225046157837), COEF_CONST(-1.213011384010315),
2203 COEF_CONST(-1.175875544548035), COEF_CONST(-1.135907053947449),
2204 COEF_CONST(-1.093201875686646), COEF_CONST(-1.047863125801086),
2205 COEF_CONST(-1.000000000000000), COEF_CONST(-0.949727773666382),
2206 COEF_CONST(-0.897167563438416), COEF_CONST(-0.842446029186249),
2207 COEF_CONST(-0.785694956779480), COEF_CONST(-0.727051079273224),
2208 COEF_CONST(-0.666655659675598), COEF_CONST(-0.604654192924500),
2209 COEF_CONST(-0.541196048259735), COEF_CONST(-0.476434230804443),
2210 COEF_CONST(-0.410524487495422), COEF_CONST(-0.343625843524933),
2211 COEF_CONST(-0.275899350643158), COEF_CONST(-0.207508206367493),
2212 COEF_CONST(-0.138617098331451), COEF_CONST(-0.069392144680023),
2213 COEF_CONST(0), COEF_CONST(0.069392263889313),
2214 COEF_CONST(0.138617157936096), COEF_CONST(0.207508206367493),
2215 COEF_CONST(0.275899469852448), COEF_CONST(0.343625962734222),
2216 COEF_CONST(0.410524636507034), COEF_CONST(0.476434201002121),
2217 COEF_CONST(0.541196107864380), COEF_CONST(0.604654192924500),
2218 COEF_CONST(0.666655719280243), COEF_CONST(0.727051138877869),
2219 COEF_CONST(0.785695075988770), COEF_CONST(0.842446029186249),
2220 COEF_CONST(0.897167563438416), COEF_CONST(0.949727773666382)
2221 };
2222
2223 /* size 64 only! */
2224 void dct4_kernel(real_t * in_real, real_t * in_imag, real_t * out_real, real_t * out_imag)
2225 {
2226 // Tables with bit reverse values for 5 bits, bit reverse of i at i-th position
2227 const uint8_t bit_rev_tab[32] = { 0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31 };
2228 uint32_t i, i_rev;
2229
2230 /* Step 2: modulate */
2231 // 3*32=96 multiplications
2232 // 3*32=96 additions
2233 for (i = 0; i < 32; i++)
2234 {
2235 real_t x_re, x_im, tmp;
2236 x_re = in_real[i];
2237 x_im = in_imag[i];
2238 tmp = MUL_C(x_re + x_im, dct4_64_tab[i]);
2239 in_real[i] = MUL_C(x_im, dct4_64_tab[i + 64]) + tmp;
2240 in_imag[i] = MUL_C(x_re, dct4_64_tab[i + 32]) + tmp;
2241 }
2242
2243 /* Step 3: FFT, but with output in bit reverse order */
2244 fft_dif(in_real, in_imag);
2245
2246 /* Step 4: modulate + bitreverse reordering */
2247 // 3*31+2=95 multiplications
2248 // 3*31+2=95 additions
2249 for (i = 0; i < 16; i++)
2250 {
2251 real_t x_re, x_im, tmp;
2252 i_rev = bit_rev_tab[i];
2253 x_re = in_real[i_rev];
2254 x_im = in_imag[i_rev];
2255
2256 tmp = MUL_C(x_re + x_im, dct4_64_tab[i + 3*32]);
2257 out_real[i] = MUL_C(x_im, dct4_64_tab[i + 5*32]) + tmp;
2258 out_imag[i] = MUL_C(x_re, dct4_64_tab[i + 4*32]) + tmp;
2259 }
2260 // i = 16, i_rev = 1 = rev(16);
2261 out_imag[16] = MUL_C(in_imag[1] - in_real[1], dct4_64_tab[16 + 3*32]);
2262 out_real[16] = MUL_C(in_real[1] + in_imag[1], dct4_64_tab[16 + 3*32]);
2263 for (i = 17; i < 32; i++)
2264 {
2265 real_t x_re, x_im, tmp;
2266 i_rev = bit_rev_tab[i];
2267 x_re = in_real[i_rev];
2268 x_im = in_imag[i_rev];
2269 tmp = MUL_C(x_re + x_im, dct4_64_tab[i + 3*32]);
2270 out_real[i] = MUL_C(x_im, dct4_64_tab[i + 5*32]) + tmp;
2271 out_imag[i] = MUL_C(x_re, dct4_64_tab[i + 4*32]) + tmp;
2272 }
2273
2274 }
2275
2276 #endif
2277
2278 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_dct.h,v 1.19 2007/11/01 12:33:34 menno Exp $
28 **/
29
30 #ifndef __SBR_DCT_H__
31 #define __SBR_DCT_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 void dct4_kernel(real_t * in_real, real_t * in_imag, real_t * out_real, real_t * out_imag);
38
39 void DCT3_32_unscaled(real_t *y, real_t *x);
40 void DCT4_32(real_t *y, real_t *x);
41 void DST4_32(real_t *y, real_t *x);
42 void DCT2_32_unscaled(real_t *y, real_t *x);
43 void DCT4_16(real_t *y, real_t *x);
44 void DCT2_16_unscaled(real_t *y, real_t *x);
45
46
47 #ifdef __cplusplus
48 }
49 #endif
50 #endif
51
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_dec.c,v 1.43 2007/11/01 12:33:34 menno Exp $
28 **/
29
30
31 #include "common.h"
32 #include "structs.h"
33
34 #ifdef SBR_DEC
35
36 #include <string.h>
37 #include <stdlib.h>
38
39 #include "syntax.h"
40 #include "bits.h"
41 #include "sbr_syntax.h"
42 #include "sbr_qmf.h"
43 #include "sbr_hfgen.h"
44 #include "sbr_hfadj.h"
45
46
47 /* static function declarations */
48 static uint8_t sbr_save_prev_data(sbr_info *sbr, uint8_t ch);
49 static void sbr_save_matrix(sbr_info *sbr, uint8_t ch);
50
51
52 sbr_info *sbrDecodeInit(uint16_t framelength, uint8_t id_aac,
53 uint32_t sample_rate, uint8_t downSampledSBR
54 #ifdef DRM
55 , uint8_t IsDRM
56 #endif
57 )
58 {
59 sbr_info *sbr = faad_malloc(sizeof(sbr_info));
60 memset(sbr, 0, sizeof(sbr_info));
61
62 /* save id of the parent element */
63 sbr->id_aac = id_aac;
64 sbr->sample_rate = sample_rate;
65
66 sbr->bs_freq_scale = 2;
67 sbr->bs_alter_scale = 1;
68 sbr->bs_noise_bands = 2;
69 sbr->bs_limiter_bands = 2;
70 sbr->bs_limiter_gains = 2;
71 sbr->bs_interpol_freq = 1;
72 sbr->bs_smoothing_mode = 1;
73 sbr->bs_start_freq = 5;
74 sbr->bs_amp_res = 1;
75 sbr->bs_samplerate_mode = 1;
76 sbr->prevEnvIsShort[0] = -1;
77 sbr->prevEnvIsShort[1] = -1;
78 sbr->header_count = 0;
79 sbr->Reset = 1;
80
81 #ifdef DRM
82 sbr->Is_DRM_SBR = IsDRM;
83 #endif
84 sbr->tHFGen = T_HFGEN;
85 sbr->tHFAdj = T_HFADJ;
86
87 sbr->bsco = 0;
88 sbr->bsco_prev = 0;
89 sbr->M_prev = 0;
90 sbr->frame_len = framelength;
91
92 /* force sbr reset */
93 sbr->bs_start_freq_prev = -1;
94
95 if (framelength == 960)
96 {
97 sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS_960;
98 sbr->numTimeSlots = NO_TIME_SLOTS_960;
99 } else {
100 sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS;
101 sbr->numTimeSlots = NO_TIME_SLOTS;
102 }
103
104 sbr->GQ_ringbuf_index[0] = 0;
105 sbr->GQ_ringbuf_index[1] = 0;
106
107 if (id_aac == ID_CPE)
108 {
109 /* stereo */
110 uint8_t j;
111 sbr->qmfa[0] = qmfa_init(32);
112 sbr->qmfa[1] = qmfa_init(32);
113 sbr->qmfs[0] = qmfs_init((downSampledSBR)?32:64);
114 sbr->qmfs[1] = qmfs_init((downSampledSBR)?32:64);
115
116 for (j = 0; j < 5; j++)
117 {
118 sbr->G_temp_prev[0][j] = faad_malloc(64*sizeof(real_t));
119 sbr->G_temp_prev[1][j] = faad_malloc(64*sizeof(real_t));
120 sbr->Q_temp_prev[0][j] = faad_malloc(64*sizeof(real_t));
121 sbr->Q_temp_prev[1][j] = faad_malloc(64*sizeof(real_t));
122 }
123
124 memset(sbr->Xsbr[0], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
125 memset(sbr->Xsbr[1], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
126 } else {
127 /* mono */
128 uint8_t j;
129 sbr->qmfa[0] = qmfa_init(32);
130 sbr->qmfs[0] = qmfs_init((downSampledSBR)?32:64);
131 sbr->qmfs[1] = NULL;
132
133 for (j = 0; j < 5; j++)
134 {
135 sbr->G_temp_prev[0][j] = faad_malloc(64*sizeof(real_t));
136 sbr->Q_temp_prev[0][j] = faad_malloc(64*sizeof(real_t));
137 }
138
139 memset(sbr->Xsbr[0], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
140 }
141
142 return sbr;
143 }
144
145 void sbrDecodeEnd(sbr_info *sbr)
146 {
147 uint8_t j;
148
149 if (sbr)
150 {
151 qmfa_end(sbr->qmfa[0]);
152 qmfs_end(sbr->qmfs[0]);
153 if (sbr->qmfs[1] != NULL)
154 {
155 qmfa_end(sbr->qmfa[1]);
156 qmfs_end(sbr->qmfs[1]);
157 }
158
159 for (j = 0; j < 5; j++)
160 {
161 if (sbr->G_temp_prev[0][j]) faad_free(sbr->G_temp_prev[0][j]);
162 if (sbr->Q_temp_prev[0][j]) faad_free(sbr->Q_temp_prev[0][j]);
163 if (sbr->G_temp_prev[1][j]) faad_free(sbr->G_temp_prev[1][j]);
164 if (sbr->Q_temp_prev[1][j]) faad_free(sbr->Q_temp_prev[1][j]);
165 }
166
167 #ifdef PS_DEC
168 if (sbr->ps != NULL)
169 ps_free(sbr->ps);
170 #endif
171
172 #ifdef DRM_PS
173 if (sbr->drm_ps != NULL)
174 drm_ps_free(sbr->drm_ps);
175 #endif
176
177 faad_free(sbr);
178 }
179 }
180
181 void sbrReset(sbr_info *sbr)
182 {
183 uint8_t j;
184 if (sbr->qmfa[0] != NULL)
185 memset(sbr->qmfa[0]->x, 0, 2 * sbr->qmfa[0]->channels * 10 * sizeof(real_t));
186 if (sbr->qmfa[1] != NULL)
187 memset(sbr->qmfa[1]->x, 0, 2 * sbr->qmfa[1]->channels * 10 * sizeof(real_t));
188 if (sbr->qmfs[0] != NULL)
189 memset(sbr->qmfs[0]->v, 0, 2 * sbr->qmfs[0]->channels * 20 * sizeof(real_t));
190 if (sbr->qmfs[1] != NULL)
191 memset(sbr->qmfs[1]->v, 0, 2 * sbr->qmfs[1]->channels * 20 * sizeof(real_t));
192
193 for (j = 0; j < 5; j++)
194 {
195 if (sbr->G_temp_prev[0][j] != NULL)
196 memset(sbr->G_temp_prev[0][j], 0, 64*sizeof(real_t));
197 if (sbr->G_temp_prev[1][j] != NULL)
198 memset(sbr->G_temp_prev[1][j], 0, 64*sizeof(real_t));
199 if (sbr->Q_temp_prev[0][j] != NULL)
200 memset(sbr->Q_temp_prev[0][j], 0, 64*sizeof(real_t));
201 if (sbr->Q_temp_prev[1][j] != NULL)
202 memset(sbr->Q_temp_prev[1][j], 0, 64*sizeof(real_t));
203 }
204
205 memset(sbr->Xsbr[0], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
206 memset(sbr->Xsbr[1], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
207
208 sbr->GQ_ringbuf_index[0] = 0;
209 sbr->GQ_ringbuf_index[1] = 0;
210 sbr->header_count = 0;
211 sbr->Reset = 1;
212
213 sbr->L_E_prev[0] = 0;
214 sbr->L_E_prev[1] = 0;
215 sbr->bs_freq_scale = 2;
216 sbr->bs_alter_scale = 1;
217 sbr->bs_noise_bands = 2;
218 sbr->bs_limiter_bands = 2;
219 sbr->bs_limiter_gains = 2;
220 sbr->bs_interpol_freq = 1;
221 sbr->bs_smoothing_mode = 1;
222 sbr->bs_start_freq = 5;
223 sbr->bs_amp_res = 1;
224 sbr->bs_samplerate_mode = 1;
225 sbr->prevEnvIsShort[0] = -1;
226 sbr->prevEnvIsShort[1] = -1;
227 sbr->bsco = 0;
228 sbr->bsco_prev = 0;
229 sbr->M_prev = 0;
230 sbr->bs_start_freq_prev = -1;
231
232 sbr->f_prev[0] = 0;
233 sbr->f_prev[1] = 0;
234 for (j = 0; j < MAX_M; j++)
235 {
236 sbr->E_prev[0][j] = 0;
237 sbr->Q_prev[0][j] = 0;
238 sbr->E_prev[1][j] = 0;
239 sbr->Q_prev[1][j] = 0;
240 sbr->bs_add_harmonic_prev[0][j] = 0;
241 sbr->bs_add_harmonic_prev[1][j] = 0;
242 }
243 sbr->bs_add_harmonic_flag_prev[0] = 0;
244 sbr->bs_add_harmonic_flag_prev[1] = 0;
245 }
246
247 static uint8_t sbr_save_prev_data(sbr_info *sbr, uint8_t ch)
248 {
249 uint8_t i;
250
251 /* save data for next frame */
252 sbr->kx_prev = sbr->kx;
253 sbr->M_prev = sbr->M;
254 sbr->bsco_prev = sbr->bsco;
255
256 sbr->L_E_prev[ch] = sbr->L_E[ch];
257
258 /* sbr->L_E[ch] can become 0 on files with bit errors */
259 if (sbr->L_E[ch] <= 0)
260 return 19;
261
262 sbr->f_prev[ch] = sbr->f[ch][sbr->L_E[ch] - 1];
263 for (i = 0; i < MAX_M; i++)
264 {
265 sbr->E_prev[ch][i] = sbr->E[ch][i][sbr->L_E[ch] - 1];
266 sbr->Q_prev[ch][i] = sbr->Q[ch][i][sbr->L_Q[ch] - 1];
267 }
268
269 for (i = 0; i < MAX_M; i++)
270 {
271 sbr->bs_add_harmonic_prev[ch][i] = sbr->bs_add_harmonic[ch][i];
272 }
273 sbr->bs_add_harmonic_flag_prev[ch] = sbr->bs_add_harmonic_flag[ch];
274
275 if (sbr->l_A[ch] == sbr->L_E[ch])
276 sbr->prevEnvIsShort[ch] = 0;
277 else
278 sbr->prevEnvIsShort[ch] = -1;
279
280 return 0;
281 }
282
283 static void sbr_save_matrix(sbr_info *sbr, uint8_t ch)
284 {
285 uint8_t i;
286
287 for (i = 0; i < sbr->tHFGen; i++)
288 {
289 memmove(sbr->Xsbr[ch][i], sbr->Xsbr[ch][i+sbr->numTimeSlotsRate], 64 * sizeof(qmf_t));
290 }
291 for (i = sbr->tHFGen; i < MAX_NTSRHFG; i++)
292 {
293 memset(sbr->Xsbr[ch][i], 0, 64 * sizeof(qmf_t));
294 }
295 }
296
297 static uint8_t sbr_process_channel(sbr_info *sbr, real_t *channel_buf, qmf_t X[MAX_NTSR][64],
298 uint8_t ch, uint8_t dont_process,
299 const uint8_t downSampledSBR)
300 {
301 int16_t k, l;
302 uint8_t ret = 0;
303
304 #ifdef SBR_LOW_POWER
305 ALIGN real_t deg[64];
306 #endif
307
308 #ifdef DRM
309 if (sbr->Is_DRM_SBR)
310 {
311 sbr->bsco = max((int32_t)sbr->maxAACLine*32/(int32_t)sbr->frame_len - (int32_t)sbr->kx, 0);
312 } else {
313 #endif
314 sbr->bsco = 0;
315 #ifdef DRM
316 }
317 #endif
318
319
320 //#define PRE_QMF_PRINT
321 #ifdef PRE_QMF_PRINT
322 {
323 int i;
324 for (i = 0; i < 1024; i++)
325 {
326 printf("%d\n", channel_buf[i]);
327 }
328 }
329 #endif
330
331
332 /* subband analysis */
333 if (dont_process)
334 sbr_qmf_analysis_32(sbr, sbr->qmfa[ch], channel_buf, sbr->Xsbr[ch], sbr->tHFGen, 32);
335 else
336 sbr_qmf_analysis_32(sbr, sbr->qmfa[ch], channel_buf, sbr->Xsbr[ch], sbr->tHFGen, sbr->kx);
337
338 if (!dont_process)
339 {
340 #if 1
341 /* insert high frequencies here */
342 /* hf generation using patching */
343 hf_generation(sbr, sbr->Xsbr[ch], sbr->Xsbr[ch]
344 #ifdef SBR_LOW_POWER
345 ,deg
346 #endif
347 ,ch);
348 #endif
349
350 #if 0 //def SBR_LOW_POWER
351 for (l = sbr->t_E[ch][0]; l < sbr->t_E[ch][sbr->L_E[ch]]; l++)
352 {
353 for (k = 0; k < sbr->kx; k++)
354 {
355 QMF_RE(sbr->Xsbr[ch][sbr->tHFAdj + l][k]) = 0;
356 }
357 }
358 #endif
359
360 #if 1
361 /* hf adjustment */
362 ret = hf_adjustment(sbr, sbr->Xsbr[ch]
363 #ifdef SBR_LOW_POWER
364 ,deg
365 #endif
366 ,ch);
367 #endif
368 if (ret > 0)
369 {
370 dont_process = 1;
371 }
372 }
373
374 if ((sbr->just_seeked != 0) || dont_process)
375 {
376 for (l = 0; l < sbr->numTimeSlotsRate; l++)
377 {
378 for (k = 0; k < 32; k++)
379 {
380 QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
381 #ifndef SBR_LOW_POWER
382 QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
383 #endif
384 }
385 for (k = 32; k < 64; k++)
386 {
387 QMF_RE(X[l][k]) = 0;
388 #ifndef SBR_LOW_POWER
389 QMF_IM(X[l][k]) = 0;
390 #endif
391 }
392 }
393 } else {
394 for (l = 0; l < sbr->numTimeSlotsRate; l++)
395 {
396 uint8_t kx_band, M_band, bsco_band;
397
398 if (l < sbr->t_E[ch][0])
399 {
400 kx_band = sbr->kx_prev;
401 M_band = sbr->M_prev;
402 bsco_band = sbr->bsco_prev;
403 } else {
404 kx_band = sbr->kx;
405 M_band = sbr->M;
406 bsco_band = sbr->bsco;
407 }
408
409 #ifndef SBR_LOW_POWER
410 for (k = 0; k < kx_band + bsco_band; k++)
411 {
412 QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
413 QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
414 }
415 for (k = kx_band + bsco_band; k < kx_band + M_band; k++)
416 {
417 QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
418 QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
419 }
420 for (k = max(kx_band + bsco_band, kx_band + M_band); k < 64; k++)
421 {
422 QMF_RE(X[l][k]) = 0;
423 QMF_IM(X[l][k]) = 0;
424 }
425 #else
426 for (k = 0; k < kx_band + bsco_band; k++)
427 {
428 QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
429 }
430 for (k = kx_band + bsco_band; k < min(kx_band + M_band, 63); k++)
431 {
432 QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
433 }
434 for (k = max(kx_band + bsco_band, kx_band + M_band); k < 64; k++)
435 {
436 QMF_RE(X[l][k]) = 0;
437 }
438 QMF_RE(X[l][kx_band - 1 + bsco_band]) +=
439 QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][kx_band - 1 + bsco_band]);
440 #endif
441 }
442 }
443
444 return ret;
445 }
446
447 uint8_t sbrDecodeCoupleFrame(sbr_info *sbr, real_t *left_chan, real_t *right_chan,
448 const uint8_t just_seeked, const uint8_t downSampledSBR)
449 {
450 uint8_t dont_process = 0;
451 uint8_t ret = 0;
452 ALIGN qmf_t X[MAX_NTSR][64];
453
454 if (sbr == NULL)
455 return 20;
456
457 /* case can occur due to bit errors */
458 if (sbr->id_aac != ID_CPE)
459 return 21;
460
461 if (sbr->ret || (sbr->header_count == 0))
462 {
463 /* don't process just upsample */
464 dont_process = 1;
465
466 /* Re-activate reset for next frame */
467 if (sbr->ret && sbr->Reset)
468 sbr->bs_start_freq_prev = -1;
469 }
470
471 if (just_seeked)
472 {
473 sbr->just_seeked = 1;
474 } else {
475 sbr->just_seeked = 0;
476 }
477
478 sbr->ret += sbr_process_channel(sbr, left_chan, X, 0, dont_process, downSampledSBR);
479 /* subband synthesis */
480 if (downSampledSBR)
481 {
482 sbr_qmf_synthesis_32(sbr, sbr->qmfs[0], X, left_chan);
483 } else {
484 sbr_qmf_synthesis_64(sbr, sbr->qmfs[0], X, left_chan);
485 }
486
487 sbr->ret += sbr_process_channel(sbr, right_chan, X, 1, dont_process, downSampledSBR);
488 /* subband synthesis */
489 if (downSampledSBR)
490 {
491 sbr_qmf_synthesis_32(sbr, sbr->qmfs[1], X, right_chan);
492 } else {
493 sbr_qmf_synthesis_64(sbr, sbr->qmfs[1], X, right_chan);
494 }
495
496 if (sbr->bs_header_flag)
497 sbr->just_seeked = 0;
498
499 if (sbr->header_count != 0 && sbr->ret == 0)
500 {
501 ret = sbr_save_prev_data(sbr, 0);
502 if (ret) return ret;
503 ret = sbr_save_prev_data(sbr, 1);
504 if (ret) return ret;
505 }
506
507 sbr_save_matrix(sbr, 0);
508 sbr_save_matrix(sbr, 1);
509
510 sbr->frame++;
511
512 //#define POST_QMF_PRINT
513 #ifdef POST_QMF_PRINT
514 {
515 int i;
516 for (i = 0; i < 2048; i++)
517 {
518 printf("%d\n", left_chan[i]);
519 }
520 for (i = 0; i < 2048; i++)
521 {
522 printf("%d\n", right_chan[i]);
523 }
524 }
525 #endif
526
527 return 0;
528 }
529
530 uint8_t sbrDecodeSingleFrame(sbr_info *sbr, real_t *channel,
531 const uint8_t just_seeked, const uint8_t downSampledSBR)
532 {
533 uint8_t dont_process = 0;
534 uint8_t ret = 0;
535 ALIGN qmf_t X[MAX_NTSR][64];
536
537 if (sbr == NULL)
538 return 20;
539
540 /* case can occur due to bit errors */
541 if (sbr->id_aac != ID_SCE && sbr->id_aac != ID_LFE)
542 return 21;
543
544 if (sbr->ret || (sbr->header_count == 0))
545 {
546 /* don't process just upsample */
547 dont_process = 1;
548
549 /* Re-activate reset for next frame */
550 if (sbr->ret && sbr->Reset)
551 sbr->bs_start_freq_prev = -1;
552 }
553
554 if (just_seeked)
555 {
556 sbr->just_seeked = 1;
557 } else {
558 sbr->just_seeked = 0;
559 }
560
561 sbr->ret += sbr_process_channel(sbr, channel, X, 0, dont_process, downSampledSBR);
562 /* subband synthesis */
563 if (downSampledSBR)
564 {
565 sbr_qmf_synthesis_32(sbr, sbr->qmfs[0], X, channel);
566 } else {
567 sbr_qmf_synthesis_64(sbr, sbr->qmfs[0], X, channel);
568 }
569
570 if (sbr->bs_header_flag)
571 sbr->just_seeked = 0;
572
573 if (sbr->header_count != 0 && sbr->ret == 0)
574 {
575 ret = sbr_save_prev_data(sbr, 0);
576 if (ret) return ret;
577 }
578
579 sbr_save_matrix(sbr, 0);
580
581 sbr->frame++;
582
583 //#define POST_QMF_PRINT
584 #ifdef POST_QMF_PRINT
585 {
586 int i;
587 for (i = 0; i < 2048; i++)
588 {
589 printf("%d\n", channel[i]);
590 }
591 }
592 #endif
593
594 return 0;
595 }
596
597 #if (defined(PS_DEC) || defined(DRM_PS))
598 uint8_t sbrDecodeSingleFramePS(sbr_info *sbr, real_t *left_channel, real_t *right_channel,
599 const uint8_t just_seeked, const uint8_t downSampledSBR)
600 {
601 uint8_t l, k;
602 uint8_t dont_process = 0;
603 uint8_t ret = 0;
604 ALIGN qmf_t X_left[38][64] = {{0}};
605 ALIGN qmf_t X_right[38][64] = {{0}}; /* must set this to 0 */
606
607 if (sbr == NULL)
608 return 20;
609
610 /* case can occur due to bit errors */
611 if (sbr->id_aac != ID_SCE && sbr->id_aac != ID_LFE)
612 return 21;
613
614 if (sbr->ret || (sbr->header_count == 0))
615 {
616 /* don't process just upsample */
617 dont_process = 1;
618
619 /* Re-activate reset for next frame */
620 if (sbr->ret && sbr->Reset)
621 sbr->bs_start_freq_prev = -1;
622 }
623
624 if (just_seeked)
625 {
626 sbr->just_seeked = 1;
627 } else {
628 sbr->just_seeked = 0;
629 }
630
631 if (sbr->qmfs[1] == NULL)
632 {
633 sbr->qmfs[1] = qmfs_init((downSampledSBR)?32:64);
634 }
635
636 sbr->ret += sbr_process_channel(sbr, left_channel, X_left, 0, dont_process, downSampledSBR);
637
638 /* copy some extra data for PS */
639 for (l = 32; l < 38; l++)
640 {
641 for (k = 0; k < 5; k++)
642 {
643 QMF_RE(X_left[l][k]) = QMF_RE(sbr->Xsbr[0][sbr->tHFAdj+l][k]);
644 QMF_IM(X_left[l][k]) = QMF_IM(sbr->Xsbr[0][sbr->tHFAdj+l][k]);
645 }
646 }
647
648 /* perform parametric stereo */
649 #ifdef DRM_PS
650 if (sbr->Is_DRM_SBR)
651 {
652 drm_ps_decode(sbr->drm_ps, (sbr->ret > 0), X_left, X_right);
653 } else {
654 #endif
655 #ifdef PS_DEC
656 ps_decode(sbr->ps, X_left, X_right);
657 #endif
658 #ifdef DRM_PS
659 }
660 #endif
661
662 /* subband synthesis */
663 if (downSampledSBR)
664 {
665 sbr_qmf_synthesis_32(sbr, sbr->qmfs[0], X_left, left_channel);
666 sbr_qmf_synthesis_32(sbr, sbr->qmfs[1], X_right, right_channel);
667 } else {
668 sbr_qmf_synthesis_64(sbr, sbr->qmfs[0], X_left, left_channel);
669 sbr_qmf_synthesis_64(sbr, sbr->qmfs[1], X_right, right_channel);
670 }
671
672 if (sbr->bs_header_flag)
673 sbr->just_seeked = 0;
674
675 if (sbr->header_count != 0 && sbr->ret == 0)
676 {
677 ret = sbr_save_prev_data(sbr, 0);
678 if (ret) return ret;
679 }
680
681 sbr_save_matrix(sbr, 0);
682
683 sbr->frame++;
684
685 return 0;
686 }
687 #endif
688
689 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_dec.h,v 1.39 2007/11/01 12:33:34 menno Exp $
28 **/
29
30 #ifndef __SBR_DEC_H__
31 #define __SBR_DEC_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #ifdef PS_DEC
38 #include "ps_dec.h"
39 #endif
40 #ifdef DRM_PS
41 #include "drm_dec.h"
42 #endif
43
44 /* MAX_NTSRHFG: maximum of number_time_slots * rate + HFGen. 16*2+8 */
45 #define MAX_NTSRHFG 40
46 #define MAX_NTSR 32 /* max number_time_slots * rate, ok for DRM and not DRM mode */
47
48 /* MAX_M: maximum value for M */
49 #define MAX_M 49
50 /* MAX_L_E: maximum value for L_E */
51 #define MAX_L_E 5
52
53 typedef struct {
54 real_t *x;
55 int16_t x_index;
56 uint8_t channels;
57 } qmfa_info;
58
59 typedef struct {
60 real_t *v;
61 int16_t v_index;
62 uint8_t channels;
63 } qmfs_info;
64
65 typedef struct
66 {
67 uint32_t sample_rate;
68 uint32_t maxAACLine;
69
70 uint8_t rate;
71 uint8_t just_seeked;
72 uint8_t ret;
73
74 uint8_t amp_res[2];
75
76 uint8_t k0;
77 uint8_t kx;
78 uint8_t M;
79 uint8_t N_master;
80 uint8_t N_high;
81 uint8_t N_low;
82 uint8_t N_Q;
83 uint8_t N_L[4];
84 uint8_t n[2];
85
86 uint8_t f_master[64];
87 uint8_t f_table_res[2][64];
88 uint8_t f_table_noise[64];
89 uint8_t f_table_lim[4][64];
90 #ifdef SBR_LOW_POWER
91 uint8_t f_group[5][64];
92 uint8_t N_G[5];
93 #endif
94
95 uint8_t table_map_k_to_g[64];
96
97 uint8_t abs_bord_lead[2];
98 uint8_t abs_bord_trail[2];
99 uint8_t n_rel_lead[2];
100 uint8_t n_rel_trail[2];
101
102 uint8_t L_E[2];
103 uint8_t L_E_prev[2];
104 uint8_t L_Q[2];
105
106 uint8_t t_E[2][MAX_L_E+1];
107 uint8_t t_Q[2][3];
108 uint8_t f[2][MAX_L_E+1];
109 uint8_t f_prev[2];
110
111 real_t *G_temp_prev[2][5];
112 real_t *Q_temp_prev[2][5];
113 int8_t GQ_ringbuf_index[2];
114
115 int16_t E[2][64][MAX_L_E];
116 int16_t E_prev[2][64];
117 #ifndef FIXED_POINT
118 real_t E_orig[2][64][MAX_L_E];
119 #endif
120 real_t E_curr[2][64][MAX_L_E];
121 int32_t Q[2][64][2];
122 #ifndef FIXED_POINT
123 real_t Q_div[2][64][2];
124 real_t Q_div2[2][64][2];
125 #endif
126 int32_t Q_prev[2][64];
127
128 int8_t l_A[2];
129 int8_t l_A_prev[2];
130
131 uint8_t bs_invf_mode[2][MAX_L_E];
132 uint8_t bs_invf_mode_prev[2][MAX_L_E];
133 real_t bwArray[2][64];
134 real_t bwArray_prev[2][64];
135
136 uint8_t noPatches;
137 uint8_t patchNoSubbands[64];
138 uint8_t patchStartSubband[64];
139
140 uint8_t bs_add_harmonic[2][64];
141 uint8_t bs_add_harmonic_prev[2][64];
142
143 uint16_t index_noise_prev[2];
144 uint8_t psi_is_prev[2];
145
146 uint8_t bs_start_freq_prev;
147 uint8_t bs_stop_freq_prev;
148 uint8_t bs_xover_band_prev;
149 uint8_t bs_freq_scale_prev;
150 uint8_t bs_alter_scale_prev;
151 uint8_t bs_noise_bands_prev;
152
153 int8_t prevEnvIsShort[2];
154
155 int8_t kx_prev;
156 uint8_t bsco;
157 uint8_t bsco_prev;
158 uint8_t M_prev;
159 uint16_t frame_len;
160
161 uint8_t Reset;
162 uint32_t frame;
163 uint32_t header_count;
164
165 uint8_t id_aac;
166 qmfa_info *qmfa[2];
167 qmfs_info *qmfs[2];
168
169 qmf_t Xsbr[2][MAX_NTSRHFG][64];
170
171 #ifdef DRM
172 uint8_t Is_DRM_SBR;
173 #ifdef DRM_PS
174 drm_ps_info *drm_ps;
175 #endif
176 #endif
177
178 uint8_t numTimeSlotsRate;
179 uint8_t numTimeSlots;
180 uint8_t tHFGen;
181 uint8_t tHFAdj;
182
183 #ifdef PS_DEC
184 ps_info *ps;
185 #endif
186 #if (defined(PS_DEC) || defined(DRM_PS))
187 uint8_t ps_used;
188 uint8_t psResetFlag;
189 #endif
190
191 /* to get it compiling */
192 /* we'll see during the coding of all the tools, whether
193 these are all used or not.
194 */
195 uint8_t bs_header_flag;
196 uint8_t bs_crc_flag;
197 uint16_t bs_sbr_crc_bits;
198 uint8_t bs_protocol_version;
199 uint8_t bs_amp_res;
200 uint8_t bs_start_freq;
201 uint8_t bs_stop_freq;
202 uint8_t bs_xover_band;
203 uint8_t bs_freq_scale;
204 uint8_t bs_alter_scale;
205 uint8_t bs_noise_bands;
206 uint8_t bs_limiter_bands;
207 uint8_t bs_limiter_gains;
208 uint8_t bs_interpol_freq;
209 uint8_t bs_smoothing_mode;
210 uint8_t bs_samplerate_mode;
211 uint8_t bs_add_harmonic_flag[2];
212 uint8_t bs_add_harmonic_flag_prev[2];
213 uint8_t bs_extended_data;
214 uint8_t bs_extension_id;
215 uint8_t bs_extension_data;
216 uint8_t bs_coupling;
217 uint8_t bs_frame_class[2];
218 uint8_t bs_rel_bord[2][9];
219 uint8_t bs_rel_bord_0[2][9];
220 uint8_t bs_rel_bord_1[2][9];
221 uint8_t bs_pointer[2];
222 uint8_t bs_abs_bord_0[2];
223 uint8_t bs_abs_bord_1[2];
224 uint8_t bs_num_rel_0[2];
225 uint8_t bs_num_rel_1[2];
226 uint8_t bs_df_env[2][9];
227 uint8_t bs_df_noise[2][3];
228 } sbr_info;
229
230 sbr_info *sbrDecodeInit(uint16_t framelength, uint8_t id_aac,
231 uint32_t sample_rate, uint8_t downSampledSBR
232 #ifdef DRM
233 , uint8_t IsDRM
234 #endif
235 );
236 void sbrDecodeEnd(sbr_info *sbr);
237 void sbrReset(sbr_info *sbr);
238
239 uint8_t sbrDecodeCoupleFrame(sbr_info *sbr, real_t *left_chan, real_t *right_chan,
240 const uint8_t just_seeked, const uint8_t downSampledSBR);
241 uint8_t sbrDecodeSingleFrame(sbr_info *sbr, real_t *channel,
242 const uint8_t just_seeked, const uint8_t downSampledSBR);
243 #if (defined(PS_DEC) || defined(DRM_PS))
244 uint8_t sbrDecodeSingleFramePS(sbr_info *sbr, real_t *left_channel, real_t *right_channel,
245 const uint8_t just_seeked, const uint8_t downSampledSBR);
246 #endif
247
248
249 #ifdef __cplusplus
250 }
251 #endif
252 #endif
253
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_e_nf.c,v 1.21 2007/11/01 12:33:35 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #ifdef SBR_DEC
34
35 #include <stdlib.h>
36
37 #include "sbr_syntax.h"
38 #include "sbr_e_nf.h"
39
40 void extract_envelope_data(sbr_info *sbr, uint8_t ch)
41 {
42 uint8_t l, k;
43
44 for (l = 0; l < sbr->L_E[ch]; l++)
45 {
46 if (sbr->bs_df_env[ch][l] == 0)
47 {
48 for (k = 1; k < sbr->n[sbr->f[ch][l]]; k++)
49 {
50 sbr->E[ch][k][l] = sbr->E[ch][k - 1][l] + sbr->E[ch][k][l];
51 if (sbr->E[ch][k][l] < 0)
52 sbr->E[ch][k][l] = 0;
53 }
54
55 } else { /* bs_df_env == 1 */
56
57 uint8_t g = (l == 0) ? sbr->f_prev[ch] : sbr->f[ch][l-1];
58 int16_t E_prev;
59
60 if (sbr->f[ch][l] == g)
61 {
62 for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
63 {
64 if (l == 0)
65 E_prev = sbr->E_prev[ch][k];
66 else
67 E_prev = sbr->E[ch][k][l - 1];
68
69 sbr->E[ch][k][l] = E_prev + sbr->E[ch][k][l];
70 }
71
72 } else if ((g == 1) && (sbr->f[ch][l] == 0)) {
73 uint8_t i;
74
75 for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
76 {
77 for (i = 0; i < sbr->N_high; i++)
78 {
79 if (sbr->f_table_res[HI_RES][i] == sbr->f_table_res[LO_RES][k])
80 {
81 if (l == 0)
82 E_prev = sbr->E_prev[ch][i];
83 else
84 E_prev = sbr->E[ch][i][l - 1];
85
86 sbr->E[ch][k][l] = E_prev + sbr->E[ch][k][l];
87 }
88 }
89 }
90
91 } else if ((g == 0) && (sbr->f[ch][l] == 1)) {
92 uint8_t i;
93
94 for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
95 {
96 for (i = 0; i < sbr->N_low; i++)
97 {
98 if ((sbr->f_table_res[LO_RES][i] <= sbr->f_table_res[HI_RES][k]) &&
99 (sbr->f_table_res[HI_RES][k] < sbr->f_table_res[LO_RES][i + 1]))
100 {
101 if (l == 0)
102 E_prev = sbr->E_prev[ch][i];
103 else
104 E_prev = sbr->E[ch][i][l - 1];
105
106 sbr->E[ch][k][l] = E_prev + sbr->E[ch][k][l];
107 }
108 }
109 }
110 }
111 }
112 }
113 }
114
115 void extract_noise_floor_data(sbr_info *sbr, uint8_t ch)
116 {
117 uint8_t l, k;
118
119 for (l = 0; l < sbr->L_Q[ch]; l++)
120 {
121 if (sbr->bs_df_noise[ch][l] == 0)
122 {
123 for (k = 1; k < sbr->N_Q; k++)
124 {
125 sbr->Q[ch][k][l] = sbr->Q[ch][k][l] + sbr->Q[ch][k-1][l];
126 }
127 } else {
128 if (l == 0)
129 {
130 for (k = 0; k < sbr->N_Q; k++)
131 {
132 sbr->Q[ch][k][l] = sbr->Q_prev[ch][k] + sbr->Q[ch][k][0];
133 }
134 } else {
135 for (k = 0; k < sbr->N_Q; k++)
136 {
137 sbr->Q[ch][k][l] = sbr->Q[ch][k][l - 1] + sbr->Q[ch][k][l];
138 }
139 }
140 }
141 }
142 }
143
144 #ifndef FIXED_POINT
145
146 /* table for Q_div values when no coupling */
147 static const real_t Q_div_tab[31] = {
148 FRAC_CONST(0.0153846), FRAC_CONST(0.030303),
149 FRAC_CONST(0.0588235), FRAC_CONST(0.111111),
150 FRAC_CONST(0.2), FRAC_CONST(0.333333),
151 FRAC_CONST(0.5), FRAC_CONST(0.666667),
152 FRAC_CONST(0.8), FRAC_CONST(0.888889),
153 FRAC_CONST(0.941176), FRAC_CONST(0.969697),
154 FRAC_CONST(0.984615), FRAC_CONST(0.992248),
155 FRAC_CONST(0.996109), FRAC_CONST(0.998051),
156 FRAC_CONST(0.999024), FRAC_CONST(0.999512),
157 FRAC_CONST(0.999756), FRAC_CONST(0.999878),
158 FRAC_CONST(0.999939), FRAC_CONST(0.999969),
159 FRAC_CONST(0.999985), FRAC_CONST(0.999992),
160 FRAC_CONST(0.999996), FRAC_CONST(0.999998),
161 FRAC_CONST(0.999999), FRAC_CONST(1),
162 FRAC_CONST(1), FRAC_CONST(1),
163 FRAC_CONST(1)
164 };
165
166 static const real_t Q_div_tab_left[31][13] = {
167 { FRAC_CONST(0.969704), FRAC_CONST(0.888985), FRAC_CONST(0.667532), FRAC_CONST(0.336788), FRAC_CONST(0.117241), FRAC_CONST(0.037594), FRAC_CONST(0.0153846), FRAC_CONST(0.00967118), FRAC_CONST(0.00823245), FRAC_CONST(0.00787211), FRAC_CONST(0.00778198), FRAC_CONST(0.00775945), FRAC_CONST(0.00775382) },
168 { FRAC_CONST(0.984619), FRAC_CONST(0.94123), FRAC_CONST(0.800623), FRAC_CONST(0.503876), FRAC_CONST(0.209877), FRAC_CONST(0.0724638), FRAC_CONST(0.030303), FRAC_CONST(0.0191571), FRAC_CONST(0.0163305), FRAC_CONST(0.0156212), FRAC_CONST(0.0154438), FRAC_CONST(0.0153994), FRAC_CONST(0.0153883) },
169 { FRAC_CONST(0.99225), FRAC_CONST(0.969726), FRAC_CONST(0.889273), FRAC_CONST(0.670103), FRAC_CONST(0.346939), FRAC_CONST(0.135135), FRAC_CONST(0.0588235), FRAC_CONST(0.037594), FRAC_CONST(0.0321361), FRAC_CONST(0.0307619), FRAC_CONST(0.0304178), FRAC_CONST(0.0303317), FRAC_CONST(0.0303102) },
170 { FRAC_CONST(0.99611), FRAC_CONST(0.98463), FRAC_CONST(0.941392), FRAC_CONST(0.802469), FRAC_CONST(0.515152), FRAC_CONST(0.238095), FRAC_CONST(0.111111), FRAC_CONST(0.0724638), FRAC_CONST(0.0622711), FRAC_CONST(0.0596878), FRAC_CONST(0.0590397), FRAC_CONST(0.0588776), FRAC_CONST(0.058837) },
171 { FRAC_CONST(0.998051), FRAC_CONST(0.992256), FRAC_CONST(0.969811), FRAC_CONST(0.890411), FRAC_CONST(0.68), FRAC_CONST(0.384615), FRAC_CONST(0.2), FRAC_CONST(0.135135), FRAC_CONST(0.117241), FRAC_CONST(0.112652), FRAC_CONST(0.111497), FRAC_CONST(0.111208), FRAC_CONST(0.111135) },
172 { FRAC_CONST(0.999025), FRAC_CONST(0.996113), FRAC_CONST(0.984674), FRAC_CONST(0.942029), FRAC_CONST(0.809524), FRAC_CONST(0.555556), FRAC_CONST(0.333333), FRAC_CONST(0.238095), FRAC_CONST(0.209877), FRAC_CONST(0.202492), FRAC_CONST(0.200625), FRAC_CONST(0.200156), FRAC_CONST(0.200039) },
173 { FRAC_CONST(0.999512), FRAC_CONST(0.998053), FRAC_CONST(0.992278), FRAC_CONST(0.970149), FRAC_CONST(0.894737), FRAC_CONST(0.714286), FRAC_CONST(0.5), FRAC_CONST(0.384615), FRAC_CONST(0.346939), FRAC_CONST(0.336788), FRAC_CONST(0.3342), FRAC_CONST(0.33355), FRAC_CONST(0.333388) },
174 { FRAC_CONST(0.999756), FRAC_CONST(0.999025), FRAC_CONST(0.996124), FRAC_CONST(0.984848), FRAC_CONST(0.944444), FRAC_CONST(0.833333), FRAC_CONST(0.666667), FRAC_CONST(0.555556), FRAC_CONST(0.515152), FRAC_CONST(0.503876), FRAC_CONST(0.500975), FRAC_CONST(0.500244), FRAC_CONST(0.500061) },
175 { FRAC_CONST(0.999878), FRAC_CONST(0.999512), FRAC_CONST(0.998058), FRAC_CONST(0.992366), FRAC_CONST(0.971429), FRAC_CONST(0.909091), FRAC_CONST(0.8), FRAC_CONST(0.714286), FRAC_CONST(0.68), FRAC_CONST(0.670103), FRAC_CONST(0.667532), FRAC_CONST(0.666884), FRAC_CONST(0.666721) },
176 { FRAC_CONST(0.999939), FRAC_CONST(0.999756), FRAC_CONST(0.999028), FRAC_CONST(0.996169), FRAC_CONST(0.985507), FRAC_CONST(0.952381), FRAC_CONST(0.888889), FRAC_CONST(0.833333), FRAC_CONST(0.809524), FRAC_CONST(0.802469), FRAC_CONST(0.800623), FRAC_CONST(0.800156), FRAC_CONST(0.800039) },
177 { FRAC_CONST(0.999969), FRAC_CONST(0.999878), FRAC_CONST(0.999514), FRAC_CONST(0.998081), FRAC_CONST(0.992701), FRAC_CONST(0.97561), FRAC_CONST(0.941176), FRAC_CONST(0.909091), FRAC_CONST(0.894737), FRAC_CONST(0.890411), FRAC_CONST(0.889273), FRAC_CONST(0.888985), FRAC_CONST(0.888913) },
178 { FRAC_CONST(0.999985), FRAC_CONST(0.999939), FRAC_CONST(0.999757), FRAC_CONST(0.999039), FRAC_CONST(0.996337), FRAC_CONST(0.987654), FRAC_CONST(0.969697), FRAC_CONST(0.952381), FRAC_CONST(0.944444), FRAC_CONST(0.942029), FRAC_CONST(0.941392), FRAC_CONST(0.94123), FRAC_CONST(0.94119) },
179 { FRAC_CONST(0.999992), FRAC_CONST(0.99997), FRAC_CONST(0.999878), FRAC_CONST(0.999519), FRAC_CONST(0.998165), FRAC_CONST(0.993789), FRAC_CONST(0.984615), FRAC_CONST(0.97561), FRAC_CONST(0.971429), FRAC_CONST(0.970149), FRAC_CONST(0.969811), FRAC_CONST(0.969726), FRAC_CONST(0.969704) },
180 { FRAC_CONST(0.999996), FRAC_CONST(0.999985), FRAC_CONST(0.999939), FRAC_CONST(0.99976), FRAC_CONST(0.999082), FRAC_CONST(0.996885), FRAC_CONST(0.992248), FRAC_CONST(0.987654), FRAC_CONST(0.985507), FRAC_CONST(0.984848), FRAC_CONST(0.984674), FRAC_CONST(0.98463), FRAC_CONST(0.984619) },
181 { FRAC_CONST(0.999998), FRAC_CONST(0.999992), FRAC_CONST(0.99997), FRAC_CONST(0.99988), FRAC_CONST(0.999541), FRAC_CONST(0.99844), FRAC_CONST(0.996109), FRAC_CONST(0.993789), FRAC_CONST(0.992701), FRAC_CONST(0.992366), FRAC_CONST(0.992278), FRAC_CONST(0.992256), FRAC_CONST(0.99225) },
182 { FRAC_CONST(0.999999), FRAC_CONST(0.999996), FRAC_CONST(0.999985), FRAC_CONST(0.99994), FRAC_CONST(0.99977), FRAC_CONST(0.999219), FRAC_CONST(0.998051), FRAC_CONST(0.996885), FRAC_CONST(0.996337), FRAC_CONST(0.996169), FRAC_CONST(0.996124), FRAC_CONST(0.996113), FRAC_CONST(0.99611) },
183 { FRAC_CONST(1), FRAC_CONST(0.999998), FRAC_CONST(0.999992), FRAC_CONST(0.99997), FRAC_CONST(0.999885), FRAC_CONST(0.99961), FRAC_CONST(0.999024), FRAC_CONST(0.99844), FRAC_CONST(0.998165), FRAC_CONST(0.998081), FRAC_CONST(0.998058), FRAC_CONST(0.998053), FRAC_CONST(0.998051) },
184 { FRAC_CONST(1), FRAC_CONST(0.999999), FRAC_CONST(0.999996), FRAC_CONST(0.999985), FRAC_CONST(0.999943), FRAC_CONST(0.999805), FRAC_CONST(0.999512), FRAC_CONST(0.999219), FRAC_CONST(0.999082), FRAC_CONST(0.999039), FRAC_CONST(0.999028), FRAC_CONST(0.999025), FRAC_CONST(0.999025) },
185 { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999998), FRAC_CONST(0.999992), FRAC_CONST(0.999971), FRAC_CONST(0.999902), FRAC_CONST(0.999756), FRAC_CONST(0.99961), FRAC_CONST(0.999541), FRAC_CONST(0.999519), FRAC_CONST(0.999514), FRAC_CONST(0.999512), FRAC_CONST(0.999512) },
186 { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999999), FRAC_CONST(0.999996), FRAC_CONST(0.999986), FRAC_CONST(0.999951), FRAC_CONST(0.999878), FRAC_CONST(0.999805), FRAC_CONST(0.99977), FRAC_CONST(0.99976), FRAC_CONST(0.999757), FRAC_CONST(0.999756), FRAC_CONST(0.999756) },
187 { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999998), FRAC_CONST(0.999993), FRAC_CONST(0.999976), FRAC_CONST(0.999939), FRAC_CONST(0.999902), FRAC_CONST(0.999885), FRAC_CONST(0.99988), FRAC_CONST(0.999878), FRAC_CONST(0.999878), FRAC_CONST(0.999878) },
188 { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999999), FRAC_CONST(0.999996), FRAC_CONST(0.999988), FRAC_CONST(0.999969), FRAC_CONST(0.999951), FRAC_CONST(0.999943), FRAC_CONST(0.99994), FRAC_CONST(0.999939), FRAC_CONST(0.999939), FRAC_CONST(0.999939) },
189 { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999998), FRAC_CONST(0.999994), FRAC_CONST(0.999985), FRAC_CONST(0.999976), FRAC_CONST(0.999971), FRAC_CONST(0.99997), FRAC_CONST(0.99997), FRAC_CONST(0.99997), FRAC_CONST(0.999969) },
190 { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999999), FRAC_CONST(0.999997), FRAC_CONST(0.999992), FRAC_CONST(0.999988), FRAC_CONST(0.999986), FRAC_CONST(0.999985), FRAC_CONST(0.999985), FRAC_CONST(0.999985), FRAC_CONST(0.999985) },
191 { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999998), FRAC_CONST(0.999996), FRAC_CONST(0.999994), FRAC_CONST(0.999993), FRAC_CONST(0.999992), FRAC_CONST(0.999992), FRAC_CONST(0.999992), FRAC_CONST(0.999992) },
192 { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999999), FRAC_CONST(0.999998), FRAC_CONST(0.999997), FRAC_CONST(0.999996), FRAC_CONST(0.999996), FRAC_CONST(0.999996), FRAC_CONST(0.999996), FRAC_CONST(0.999996) },
193 { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999999), FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999998) },
194 { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(0.999999) },
195 { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
196 { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
197 { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) }
198 };
199
200 static const real_t Q_div_tab_right[31][13] = {
201 { FRAC_CONST(0.00775382), FRAC_CONST(0.00775945), FRAC_CONST(0.00778198), FRAC_CONST(0.00787211), FRAC_CONST(0.00823245), FRAC_CONST(0.00967118), FRAC_CONST(0.0153846), FRAC_CONST(0.037594), FRAC_CONST(0.117241), FRAC_CONST(0.336788), FRAC_CONST(0.667532), FRAC_CONST(0.888985), FRAC_CONST(0.969704) },
202 { FRAC_CONST(0.0153883), FRAC_CONST(0.0153994), FRAC_CONST(0.0154438), FRAC_CONST(0.0156212), FRAC_CONST(0.0163305), FRAC_CONST(0.0191571), FRAC_CONST(0.030303), FRAC_CONST(0.0724638), FRAC_CONST(0.209877), FRAC_CONST(0.503876), FRAC_CONST(0.800623), FRAC_CONST(0.94123), FRAC_CONST(0.984619) },
203 { FRAC_CONST(0.0303102), FRAC_CONST(0.0303317), FRAC_CONST(0.0304178), FRAC_CONST(0.0307619), FRAC_CONST(0.0321361), FRAC_CONST(0.037594), FRAC_CONST(0.0588235), FRAC_CONST(0.135135), FRAC_CONST(0.346939), FRAC_CONST(0.670103), FRAC_CONST(0.889273), FRAC_CONST(0.969726), FRAC_CONST(0.99225) },
204 { FRAC_CONST(0.058837), FRAC_CONST(0.0588776), FRAC_CONST(0.0590397), FRAC_CONST(0.0596878), FRAC_CONST(0.0622711), FRAC_CONST(0.0724638), FRAC_CONST(0.111111), FRAC_CONST(0.238095), FRAC_CONST(0.515152), FRAC_CONST(0.802469), FRAC_CONST(0.941392), FRAC_CONST(0.98463), FRAC_CONST(0.99611) },
205 { FRAC_CONST(0.111135), FRAC_CONST(0.111208), FRAC_CONST(0.111497), FRAC_CONST(0.112652), FRAC_CONST(0.117241), FRAC_CONST(0.135135), FRAC_CONST(0.2), FRAC_CONST(0.384615), FRAC_CONST(0.68), FRAC_CONST(0.890411), FRAC_CONST(0.969811), FRAC_CONST(0.992256), FRAC_CONST(0.998051) },
206 { FRAC_CONST(0.200039), FRAC_CONST(0.200156), FRAC_CONST(0.200625), FRAC_CONST(0.202492), FRAC_CONST(0.209877), FRAC_CONST(0.238095), FRAC_CONST(0.333333), FRAC_CONST(0.555556), FRAC_CONST(0.809524), FRAC_CONST(0.942029), FRAC_CONST(0.984674), FRAC_CONST(0.996113), FRAC_CONST(0.999025) },
207 { FRAC_CONST(0.333388), FRAC_CONST(0.33355), FRAC_CONST(0.3342), FRAC_CONST(0.336788), FRAC_CONST(0.346939), FRAC_CONST(0.384615), FRAC_CONST(0.5), FRAC_CONST(0.714286), FRAC_CONST(0.894737), FRAC_CONST(0.970149), FRAC_CONST(0.992278), FRAC_CONST(0.998053), FRAC_CONST(0.999512) },
208 { FRAC_CONST(0.500061), FRAC_CONST(0.500244), FRAC_CONST(0.500975), FRAC_CONST(0.503876), FRAC_CONST(0.515152), FRAC_CONST(0.555556), FRAC_CONST(0.666667), FRAC_CONST(0.833333), FRAC_CONST(0.944444), FRAC_CONST(0.984848), FRAC_CONST(0.996124), FRAC_CONST(0.999025), FRAC_CONST(0.999756) },
209 { FRAC_CONST(0.666721), FRAC_CONST(0.666884), FRAC_CONST(0.667532), FRAC_CONST(0.670103), FRAC_CONST(0.68), FRAC_CONST(0.714286), FRAC_CONST(0.8), FRAC_CONST(0.909091), FRAC_CONST(0.971429), FRAC_CONST(0.992366), FRAC_CONST(0.998058), FRAC_CONST(0.999512), FRAC_CONST(0.999878) },
210 { FRAC_CONST(0.800039), FRAC_CONST(0.800156), FRAC_CONST(0.800623), FRAC_CONST(0.802469), FRAC_CONST(0.809524), FRAC_CONST(0.833333), FRAC_CONST(0.888889), FRAC_CONST(0.952381), FRAC_CONST(0.985507), FRAC_CONST(0.996169), FRAC_CONST(0.999028), FRAC_CONST(0.999756), FRAC_CONST(0.999939) },
211 { FRAC_CONST(0.888913), FRAC_CONST(0.888985), FRAC_CONST(0.889273), FRAC_CONST(0.890411), FRAC_CONST(0.894737), FRAC_CONST(0.909091), FRAC_CONST(0.941176), FRAC_CONST(0.97561), FRAC_CONST(0.992701), FRAC_CONST(0.998081), FRAC_CONST(0.999514), FRAC_CONST(0.999878), FRAC_CONST(0.999969) },
212 { FRAC_CONST(0.94119), FRAC_CONST(0.94123), FRAC_CONST(0.941392), FRAC_CONST(0.942029), FRAC_CONST(0.944444), FRAC_CONST(0.952381), FRAC_CONST(0.969697), FRAC_CONST(0.987654), FRAC_CONST(0.996337), FRAC_CONST(0.999039), FRAC_CONST(0.999757), FRAC_CONST(0.999939), FRAC_CONST(0.999985) },
213 { FRAC_CONST(0.969704), FRAC_CONST(0.969726), FRAC_CONST(0.969811), FRAC_CONST(0.970149), FRAC_CONST(0.971429), FRAC_CONST(0.97561), FRAC_CONST(0.984615), FRAC_CONST(0.993789), FRAC_CONST(0.998165), FRAC_CONST(0.999519), FRAC_CONST(0.999878), FRAC_CONST(0.99997), FRAC_CONST(0.999992) },
214 { FRAC_CONST(0.984619), FRAC_CONST(0.98463), FRAC_CONST(0.984674), FRAC_CONST(0.984848), FRAC_CONST(0.985507), FRAC_CONST(0.987654), FRAC_CONST(0.992248), FRAC_CONST(0.996885), FRAC_CONST(0.999082), FRAC_CONST(0.99976), FRAC_CONST(0.999939), FRAC_CONST(0.999985), FRAC_CONST(0.999996) },
215 { FRAC_CONST(0.99225), FRAC_CONST(0.992256), FRAC_CONST(0.992278), FRAC_CONST(0.992366), FRAC_CONST(0.992701), FRAC_CONST(0.993789), FRAC_CONST(0.996109), FRAC_CONST(0.99844), FRAC_CONST(0.999541), FRAC_CONST(0.99988), FRAC_CONST(0.99997), FRAC_CONST(0.999992), FRAC_CONST(0.999998) },
216 { FRAC_CONST(0.99611), FRAC_CONST(0.996113), FRAC_CONST(0.996124), FRAC_CONST(0.996169), FRAC_CONST(0.996337), FRAC_CONST(0.996885), FRAC_CONST(0.998051), FRAC_CONST(0.999219), FRAC_CONST(0.99977), FRAC_CONST(0.99994), FRAC_CONST(0.999985), FRAC_CONST(0.999996), FRAC_CONST(0.999999) },
217 { FRAC_CONST(0.998051), FRAC_CONST(0.998053), FRAC_CONST(0.998058), FRAC_CONST(0.998081), FRAC_CONST(0.998165), FRAC_CONST(0.99844), FRAC_CONST(0.999024), FRAC_CONST(0.99961), FRAC_CONST(0.999885), FRAC_CONST(0.99997), FRAC_CONST(0.999992), FRAC_CONST(0.999998), FRAC_CONST(1) },
218 { FRAC_CONST(0.999025), FRAC_CONST(0.999025), FRAC_CONST(0.999028), FRAC_CONST(0.999039), FRAC_CONST(0.999082), FRAC_CONST(0.999219), FRAC_CONST(0.999512), FRAC_CONST(0.999805), FRAC_CONST(0.999943), FRAC_CONST(0.999985), FRAC_CONST(0.999996), FRAC_CONST(0.999999), FRAC_CONST(1) },
219 { FRAC_CONST(0.999512), FRAC_CONST(0.999512), FRAC_CONST(0.999514), FRAC_CONST(0.999519), FRAC_CONST(0.999541), FRAC_CONST(0.99961), FRAC_CONST(0.999756), FRAC_CONST(0.999902), FRAC_CONST(0.999971), FRAC_CONST(0.999992), FRAC_CONST(0.999998), FRAC_CONST(1), FRAC_CONST(1) },
220 { FRAC_CONST(0.999756), FRAC_CONST(0.999756), FRAC_CONST(0.999757), FRAC_CONST(0.99976), FRAC_CONST(0.99977), FRAC_CONST(0.999805), FRAC_CONST(0.999878), FRAC_CONST(0.999951), FRAC_CONST(0.999986), FRAC_CONST(0.999996), FRAC_CONST(0.999999), FRAC_CONST(1), FRAC_CONST(1) },
221 { FRAC_CONST(0.999878), FRAC_CONST(0.999878), FRAC_CONST(0.999878), FRAC_CONST(0.99988), FRAC_CONST(0.999885), FRAC_CONST(0.999902), FRAC_CONST(0.999939), FRAC_CONST(0.999976), FRAC_CONST(0.999993), FRAC_CONST(0.999998), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
222 { FRAC_CONST(0.999939), FRAC_CONST(0.999939), FRAC_CONST(0.999939), FRAC_CONST(0.99994), FRAC_CONST(0.999943), FRAC_CONST(0.999951), FRAC_CONST(0.999969), FRAC_CONST(0.999988), FRAC_CONST(0.999996), FRAC_CONST(0.999999), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
223 { FRAC_CONST(0.999969), FRAC_CONST(0.99997), FRAC_CONST(0.99997), FRAC_CONST(0.99997), FRAC_CONST(0.999971), FRAC_CONST(0.999976), FRAC_CONST(0.999985), FRAC_CONST(0.999994), FRAC_CONST(0.999998), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
224 { FRAC_CONST(0.999985), FRAC_CONST(0.999985), FRAC_CONST(0.999985), FRAC_CONST(0.999985), FRAC_CONST(0.999986), FRAC_CONST(0.999988), FRAC_CONST(0.999992), FRAC_CONST(0.999997), FRAC_CONST(0.999999), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
225 { FRAC_CONST(0.999992), FRAC_CONST(0.999992), FRAC_CONST(0.999992), FRAC_CONST(0.999992), FRAC_CONST(0.999993), FRAC_CONST(0.999994), FRAC_CONST(0.999996), FRAC_CONST(0.999998), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
226 { FRAC_CONST(0.999996), FRAC_CONST(0.999996), FRAC_CONST(0.999996), FRAC_CONST(0.999996), FRAC_CONST(0.999996), FRAC_CONST(0.999997), FRAC_CONST(0.999998), FRAC_CONST(0.999999), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
227 { FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999999), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
228 { FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
229 { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
230 { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
231 { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) }
232 };
233
234 /* calculates 1/(1+Q) */
235 /* [0..1] */
236 real_t calc_Q_div(sbr_info *sbr, uint8_t ch, uint8_t m, uint8_t l)
237 {
238 if (sbr->bs_coupling)
239 {
240 /* left channel */
241 if ((sbr->Q[0][m][l] < 0 || sbr->Q[0][m][l] > 30) ||
242 (sbr->Q[1][m][l] < 0 || sbr->Q[1][m][l] > 24 /* 2*panOffset(1) */))
243 {
244 return 0;
245 } else {
246 /* the pan parameter is always even */
247 if (ch == 0)
248 {
249 return Q_div_tab_left[sbr->Q[0][m][l]][sbr->Q[1][m][l] >> 1];
250 } else {
251 return Q_div_tab_right[sbr->Q[0][m][l]][sbr->Q[1][m][l] >> 1];
252 }
253 }
254 } else {
255 /* no coupling */
256 if (sbr->Q[ch][m][l] < 0 || sbr->Q[ch][m][l] > 30)
257 {
258 return 0;
259 } else {
260 return Q_div_tab[sbr->Q[ch][m][l]];
261 }
262 }
263 }
264
265 /* table for Q_div2 values when no coupling */
266 static const real_t Q_div2_tab[31] = {
267 FRAC_CONST(0.984615), FRAC_CONST(0.969697),
268 FRAC_CONST(0.941176), FRAC_CONST(0.888889),
269 FRAC_CONST(0.8), FRAC_CONST(0.666667),
270 FRAC_CONST(0.5), FRAC_CONST(0.333333),
271 FRAC_CONST(0.2), FRAC_CONST(0.111111),
272 FRAC_CONST(0.0588235), FRAC_CONST(0.030303),
273 FRAC_CONST(0.0153846), FRAC_CONST(0.00775194),
274 FRAC_CONST(0.00389105), FRAC_CONST(0.00194932),
275 FRAC_CONST(0.00097561), FRAC_CONST(0.000488043),
276 FRAC_CONST(0.000244081), FRAC_CONST(0.000122055),
277 FRAC_CONST(6.10314E-005), FRAC_CONST(3.05166E-005),
278 FRAC_CONST(1.52586E-005), FRAC_CONST(7.62934E-006),
279 FRAC_CONST(3.81468E-006), FRAC_CONST(1.90734E-006),
280 FRAC_CONST(9.53673E-007), FRAC_CONST(4.76837E-007),
281 FRAC_CONST(2.38419E-007), FRAC_CONST(1.19209E-007),
282 FRAC_CONST(5.96046E-008)
283 };
284
285 static const real_t Q_div2_tab_left[31][13] = {
286 { FRAC_CONST(0.0302959), FRAC_CONST(0.111015), FRAC_CONST(0.332468), FRAC_CONST(0.663212), FRAC_CONST(0.882759), FRAC_CONST(0.962406), FRAC_CONST(0.984615), FRAC_CONST(0.990329), FRAC_CONST(0.991768), FRAC_CONST(0.992128), FRAC_CONST(0.992218), FRAC_CONST(0.992241), FRAC_CONST(0.992246) },
287 { FRAC_CONST(0.0153809), FRAC_CONST(0.0587695), FRAC_CONST(0.199377), FRAC_CONST(0.496124), FRAC_CONST(0.790123), FRAC_CONST(0.927536), FRAC_CONST(0.969697), FRAC_CONST(0.980843), FRAC_CONST(0.98367), FRAC_CONST(0.984379), FRAC_CONST(0.984556), FRAC_CONST(0.984601), FRAC_CONST(0.984612) },
288 { FRAC_CONST(0.00775006), FRAC_CONST(0.0302744), FRAC_CONST(0.110727), FRAC_CONST(0.329897), FRAC_CONST(0.653061), FRAC_CONST(0.864865), FRAC_CONST(0.941176), FRAC_CONST(0.962406), FRAC_CONST(0.967864), FRAC_CONST(0.969238), FRAC_CONST(0.969582), FRAC_CONST(0.969668), FRAC_CONST(0.96969) },
289 { FRAC_CONST(0.0038901), FRAC_CONST(0.0153698), FRAC_CONST(0.0586081), FRAC_CONST(0.197531), FRAC_CONST(0.484848), FRAC_CONST(0.761905), FRAC_CONST(0.888889), FRAC_CONST(0.927536), FRAC_CONST(0.937729), FRAC_CONST(0.940312), FRAC_CONST(0.94096), FRAC_CONST(0.941122), FRAC_CONST(0.941163) },
290 { FRAC_CONST(0.00194884), FRAC_CONST(0.00774443), FRAC_CONST(0.0301887), FRAC_CONST(0.109589), FRAC_CONST(0.32), FRAC_CONST(0.615385), FRAC_CONST(0.8), FRAC_CONST(0.864865), FRAC_CONST(0.882759), FRAC_CONST(0.887348), FRAC_CONST(0.888503), FRAC_CONST(0.888792), FRAC_CONST(0.888865) },
291 { FRAC_CONST(0.000975372), FRAC_CONST(0.00388727), FRAC_CONST(0.0153257), FRAC_CONST(0.057971), FRAC_CONST(0.190476), FRAC_CONST(0.444444), FRAC_CONST(0.666667), FRAC_CONST(0.761905), FRAC_CONST(0.790123), FRAC_CONST(0.797508), FRAC_CONST(0.799375), FRAC_CONST(0.799844), FRAC_CONST(0.799961) },
292 { FRAC_CONST(0.000487924), FRAC_CONST(0.00194742), FRAC_CONST(0.00772201), FRAC_CONST(0.0298507), FRAC_CONST(0.105263), FRAC_CONST(0.285714), FRAC_CONST(0.5), FRAC_CONST(0.615385), FRAC_CONST(0.653061), FRAC_CONST(0.663212), FRAC_CONST(0.6658), FRAC_CONST(0.66645), FRAC_CONST(0.666612) },
293 { FRAC_CONST(0.000244021), FRAC_CONST(0.000974659), FRAC_CONST(0.00387597), FRAC_CONST(0.0151515), FRAC_CONST(0.0555556), FRAC_CONST(0.166667), FRAC_CONST(0.333333), FRAC_CONST(0.444444), FRAC_CONST(0.484848), FRAC_CONST(0.496124), FRAC_CONST(0.499025), FRAC_CONST(0.499756), FRAC_CONST(0.499939) },
294 { FRAC_CONST(0.000122026), FRAC_CONST(0.000487567), FRAC_CONST(0.00194175), FRAC_CONST(0.00763359), FRAC_CONST(0.0285714), FRAC_CONST(0.0909091), FRAC_CONST(0.2), FRAC_CONST(0.285714), FRAC_CONST(0.32), FRAC_CONST(0.329897), FRAC_CONST(0.332468), FRAC_CONST(0.333116), FRAC_CONST(0.333279) },
295 { FRAC_CONST(6.10165E-005), FRAC_CONST(0.000243843), FRAC_CONST(0.000971817), FRAC_CONST(0.00383142), FRAC_CONST(0.0144928), FRAC_CONST(0.047619), FRAC_CONST(0.111111), FRAC_CONST(0.166667), FRAC_CONST(0.190476), FRAC_CONST(0.197531), FRAC_CONST(0.199377), FRAC_CONST(0.199844), FRAC_CONST(0.199961) },
296 { FRAC_CONST(3.05092E-005), FRAC_CONST(0.000121936), FRAC_CONST(0.000486145), FRAC_CONST(0.00191939), FRAC_CONST(0.00729927), FRAC_CONST(0.0243902), FRAC_CONST(0.0588235), FRAC_CONST(0.0909091), FRAC_CONST(0.105263), FRAC_CONST(0.109589), FRAC_CONST(0.110727), FRAC_CONST(0.111015), FRAC_CONST(0.111087) },
297 { FRAC_CONST(1.52548E-005), FRAC_CONST(6.09719E-005), FRAC_CONST(0.000243132), FRAC_CONST(0.000960615), FRAC_CONST(0.003663), FRAC_CONST(0.0123457), FRAC_CONST(0.030303), FRAC_CONST(0.047619), FRAC_CONST(0.0555556), FRAC_CONST(0.057971), FRAC_CONST(0.0586081), FRAC_CONST(0.0587695), FRAC_CONST(0.05881) },
298 { FRAC_CONST(7.62747E-006), FRAC_CONST(3.04869E-005), FRAC_CONST(0.000121581), FRAC_CONST(0.000480538), FRAC_CONST(0.00183486), FRAC_CONST(0.00621118), FRAC_CONST(0.0153846), FRAC_CONST(0.0243902), FRAC_CONST(0.0285714), FRAC_CONST(0.0298507), FRAC_CONST(0.0301887), FRAC_CONST(0.0302744), FRAC_CONST(0.0302959) },
299 { FRAC_CONST(3.81375E-006), FRAC_CONST(1.52437E-005), FRAC_CONST(6.0794E-005), FRAC_CONST(0.000240327), FRAC_CONST(0.000918274), FRAC_CONST(0.00311526), FRAC_CONST(0.00775194), FRAC_CONST(0.0123457), FRAC_CONST(0.0144928), FRAC_CONST(0.0151515), FRAC_CONST(0.0153257), FRAC_CONST(0.0153698), FRAC_CONST(0.0153809) },
300 { FRAC_CONST(1.90688E-006), FRAC_CONST(7.62189E-006), FRAC_CONST(3.03979E-005), FRAC_CONST(0.000120178), FRAC_CONST(0.000459348), FRAC_CONST(0.00156006), FRAC_CONST(0.00389105), FRAC_CONST(0.00621118), FRAC_CONST(0.00729927), FRAC_CONST(0.00763359), FRAC_CONST(0.00772201), FRAC_CONST(0.00774443), FRAC_CONST(0.00775006) },
301 { FRAC_CONST(9.53441E-007), FRAC_CONST(3.81096E-006), FRAC_CONST(1.51992E-005), FRAC_CONST(6.00925E-005), FRAC_CONST(0.000229727), FRAC_CONST(0.00078064), FRAC_CONST(0.00194932), FRAC_CONST(0.00311526), FRAC_CONST(0.003663), FRAC_CONST(0.00383142), FRAC_CONST(0.00387597), FRAC_CONST(0.00388727), FRAC_CONST(0.0038901) },
302 { FRAC_CONST(4.76721E-007), FRAC_CONST(1.90548E-006), FRAC_CONST(7.59965E-006), FRAC_CONST(3.00472E-005), FRAC_CONST(0.000114877), FRAC_CONST(0.000390472), FRAC_CONST(0.00097561), FRAC_CONST(0.00156006), FRAC_CONST(0.00183486), FRAC_CONST(0.00191939), FRAC_CONST(0.00194175), FRAC_CONST(0.00194742), FRAC_CONST(0.00194884) },
303 { FRAC_CONST(2.3836E-007), FRAC_CONST(9.52743E-007), FRAC_CONST(3.79984E-006), FRAC_CONST(1.50238E-005), FRAC_CONST(5.74416E-005), FRAC_CONST(0.000195274), FRAC_CONST(0.000488043), FRAC_CONST(0.00078064), FRAC_CONST(0.000918274), FRAC_CONST(0.000960615), FRAC_CONST(0.000971817), FRAC_CONST(0.000974659), FRAC_CONST(0.000975372) },
304 { FRAC_CONST(1.1918E-007), FRAC_CONST(4.76372E-007), FRAC_CONST(1.89992E-006), FRAC_CONST(7.51196E-006), FRAC_CONST(2.87216E-005), FRAC_CONST(9.76467E-005), FRAC_CONST(0.000244081), FRAC_CONST(0.000390472), FRAC_CONST(0.000459348), FRAC_CONST(0.000480538), FRAC_CONST(0.000486145), FRAC_CONST(0.000487567), FRAC_CONST(0.000487924) },
305 { FRAC_CONST(5.95901E-008), FRAC_CONST(2.38186E-007), FRAC_CONST(9.49963E-007), FRAC_CONST(3.756E-006), FRAC_CONST(1.4361E-005), FRAC_CONST(4.88257E-005), FRAC_CONST(0.000122055), FRAC_CONST(0.000195274), FRAC_CONST(0.000229727), FRAC_CONST(0.000240327), FRAC_CONST(0.000243132), FRAC_CONST(0.000243843), FRAC_CONST(0.000244021) },
306 { FRAC_CONST(2.9795E-008), FRAC_CONST(1.19093E-007), FRAC_CONST(4.74982E-007), FRAC_CONST(1.878E-006), FRAC_CONST(7.18056E-006), FRAC_CONST(2.44135E-005), FRAC_CONST(6.10314E-005), FRAC_CONST(9.76467E-005), FRAC_CONST(0.000114877), FRAC_CONST(0.000120178), FRAC_CONST(0.000121581), FRAC_CONST(0.000121936), FRAC_CONST(0.000122026) },
307 { FRAC_CONST(1.48975E-008), FRAC_CONST(5.95465E-008), FRAC_CONST(2.37491E-007), FRAC_CONST(9.39002E-007), FRAC_CONST(3.59029E-006), FRAC_CONST(1.22069E-005), FRAC_CONST(3.05166E-005), FRAC_CONST(4.88257E-005), FRAC_CONST(5.74416E-005), FRAC_CONST(6.00925E-005), FRAC_CONST(6.0794E-005), FRAC_CONST(6.09719E-005), FRAC_CONST(6.10165E-005) },
308 { FRAC_CONST(7.44876E-009), FRAC_CONST(2.97732E-008), FRAC_CONST(1.18745E-007), FRAC_CONST(4.69501E-007), FRAC_CONST(1.79515E-006), FRAC_CONST(6.10348E-006), FRAC_CONST(1.52586E-005), FRAC_CONST(2.44135E-005), FRAC_CONST(2.87216E-005), FRAC_CONST(3.00472E-005), FRAC_CONST(3.03979E-005), FRAC_CONST(3.04869E-005), FRAC_CONST(3.05092E-005) },
309 { FRAC_CONST(3.72438E-009), FRAC_CONST(1.48866E-008), FRAC_CONST(5.93727E-008), FRAC_CONST(2.34751E-007), FRAC_CONST(8.97575E-007), FRAC_CONST(3.05175E-006), FRAC_CONST(7.62934E-006), FRAC_CONST(1.22069E-005), FRAC_CONST(1.4361E-005), FRAC_CONST(1.50238E-005), FRAC_CONST(1.51992E-005), FRAC_CONST(1.52437E-005), FRAC_CONST(1.52548E-005) },
310 { FRAC_CONST(1.86219E-009), FRAC_CONST(7.44331E-009), FRAC_CONST(2.96864E-008), FRAC_CONST(1.17375E-007), FRAC_CONST(4.48788E-007), FRAC_CONST(1.52588E-006), FRAC_CONST(3.81468E-006), FRAC_CONST(6.10348E-006), FRAC_CONST(7.18056E-006), FRAC_CONST(7.51196E-006), FRAC_CONST(7.59965E-006), FRAC_CONST(7.62189E-006), FRAC_CONST(7.62747E-006) },
311 { FRAC_CONST(9.31095E-010), FRAC_CONST(3.72166E-009), FRAC_CONST(1.48432E-008), FRAC_CONST(5.86876E-008), FRAC_CONST(2.24394E-007), FRAC_CONST(7.62939E-007), FRAC_CONST(1.90734E-006), FRAC_CONST(3.05175E-006), FRAC_CONST(3.59029E-006), FRAC_CONST(3.756E-006), FRAC_CONST(3.79984E-006), FRAC_CONST(3.81096E-006), FRAC_CONST(3.81375E-006) },
312 { FRAC_CONST(4.65548E-010), FRAC_CONST(1.86083E-009), FRAC_CONST(7.42159E-009), FRAC_CONST(2.93438E-008), FRAC_CONST(1.12197E-007), FRAC_CONST(3.8147E-007), FRAC_CONST(9.53673E-007), FRAC_CONST(1.52588E-006), FRAC_CONST(1.79515E-006), FRAC_CONST(1.878E-006), FRAC_CONST(1.89992E-006), FRAC_CONST(1.90548E-006), FRAC_CONST(1.90688E-006) },
313 { FRAC_CONST(2.32774E-010), FRAC_CONST(9.30414E-010), FRAC_CONST(3.71079E-009), FRAC_CONST(1.46719E-008), FRAC_CONST(5.60985E-008), FRAC_CONST(1.90735E-007), FRAC_CONST(4.76837E-007), FRAC_CONST(7.62939E-007), FRAC_CONST(8.97575E-007), FRAC_CONST(9.39002E-007), FRAC_CONST(9.49963E-007), FRAC_CONST(9.52743E-007), FRAC_CONST(9.53441E-007) },
314 { FRAC_CONST(1.16387E-010), FRAC_CONST(4.65207E-010), FRAC_CONST(1.8554E-009), FRAC_CONST(7.33596E-009), FRAC_CONST(2.80492E-008), FRAC_CONST(9.53674E-008), FRAC_CONST(2.38419E-007), FRAC_CONST(3.8147E-007), FRAC_CONST(4.48788E-007), FRAC_CONST(4.69501E-007), FRAC_CONST(4.74982E-007), FRAC_CONST(4.76372E-007), FRAC_CONST(4.76721E-007) },
315 { FRAC_CONST(5.81935E-011), FRAC_CONST(2.32603E-010), FRAC_CONST(9.27699E-010), FRAC_CONST(3.66798E-009), FRAC_CONST(1.40246E-008), FRAC_CONST(4.76837E-008), FRAC_CONST(1.19209E-007), FRAC_CONST(1.90735E-007), FRAC_CONST(2.24394E-007), FRAC_CONST(2.34751E-007), FRAC_CONST(2.37491E-007), FRAC_CONST(2.38186E-007), FRAC_CONST(2.3836E-007) },
316 { FRAC_CONST(2.90967E-011), FRAC_CONST(1.16302E-010), FRAC_CONST(4.63849E-010), FRAC_CONST(1.83399E-009), FRAC_CONST(7.01231E-009), FRAC_CONST(2.38419E-008), FRAC_CONST(5.96046E-008), FRAC_CONST(9.53674E-008), FRAC_CONST(1.12197E-007), FRAC_CONST(1.17375E-007), FRAC_CONST(1.18745E-007), FRAC_CONST(1.19093E-007), FRAC_CONST(1.1918E-007) }
317 };
318
319 static const real_t Q_div2_tab_right[31][13] = {
320 { FRAC_CONST(0.992246), FRAC_CONST(0.992241), FRAC_CONST(0.992218), FRAC_CONST(0.992128), FRAC_CONST(0.991768), FRAC_CONST(0.990329), FRAC_CONST(0.984615), FRAC_CONST(0.962406), FRAC_CONST(0.882759), FRAC_CONST(0.663212), FRAC_CONST(0.332468), FRAC_CONST(0.111015), FRAC_CONST(0.0302959) },
321 { FRAC_CONST(0.984612), FRAC_CONST(0.984601), FRAC_CONST(0.984556), FRAC_CONST(0.984379), FRAC_CONST(0.98367), FRAC_CONST(0.980843), FRAC_CONST(0.969697), FRAC_CONST(0.927536), FRAC_CONST(0.790123), FRAC_CONST(0.496124), FRAC_CONST(0.199377), FRAC_CONST(0.0587695), FRAC_CONST(0.0153809) },
322 { FRAC_CONST(0.96969), FRAC_CONST(0.969668), FRAC_CONST(0.969582), FRAC_CONST(0.969238), FRAC_CONST(0.967864), FRAC_CONST(0.962406), FRAC_CONST(0.941176), FRAC_CONST(0.864865), FRAC_CONST(0.653061), FRAC_CONST(0.329897), FRAC_CONST(0.110727), FRAC_CONST(0.0302744), FRAC_CONST(0.00775006) },
323 { FRAC_CONST(0.941163), FRAC_CONST(0.941122), FRAC_CONST(0.94096), FRAC_CONST(0.940312), FRAC_CONST(0.937729), FRAC_CONST(0.927536), FRAC_CONST(0.888889), FRAC_CONST(0.761905), FRAC_CONST(0.484848), FRAC_CONST(0.197531), FRAC_CONST(0.0586081), FRAC_CONST(0.0153698), FRAC_CONST(0.0038901) },
324 { FRAC_CONST(0.888865), FRAC_CONST(0.888792), FRAC_CONST(0.888503), FRAC_CONST(0.887348), FRAC_CONST(0.882759), FRAC_CONST(0.864865), FRAC_CONST(0.8), FRAC_CONST(0.615385), FRAC_CONST(0.32), FRAC_CONST(0.109589), FRAC_CONST(0.0301887), FRAC_CONST(0.00774443), FRAC_CONST(0.00194884) },
325 { FRAC_CONST(0.799961), FRAC_CONST(0.799844), FRAC_CONST(0.799375), FRAC_CONST(0.797508), FRAC_CONST(0.790123), FRAC_CONST(0.761905), FRAC_CONST(0.666667), FRAC_CONST(0.444444), FRAC_CONST(0.190476), FRAC_CONST(0.057971), FRAC_CONST(0.0153257), FRAC_CONST(0.00388727), FRAC_CONST(0.000975372) },
326 { FRAC_CONST(0.666612), FRAC_CONST(0.66645), FRAC_CONST(0.6658), FRAC_CONST(0.663212), FRAC_CONST(0.653061), FRAC_CONST(0.615385), FRAC_CONST(0.5), FRAC_CONST(0.285714), FRAC_CONST(0.105263), FRAC_CONST(0.0298507), FRAC_CONST(0.00772201), FRAC_CONST(0.00194742), FRAC_CONST(0.000487924) },
327 { FRAC_CONST(0.499939), FRAC_CONST(0.499756), FRAC_CONST(0.499025), FRAC_CONST(0.496124), FRAC_CONST(0.484848), FRAC_CONST(0.444444), FRAC_CONST(0.333333), FRAC_CONST(0.166667), FRAC_CONST(0.0555556), FRAC_CONST(0.0151515), FRAC_CONST(0.00387597), FRAC_CONST(0.000974659), FRAC_CONST(0.000244021) },
328 { FRAC_CONST(0.333279), FRAC_CONST(0.333116), FRAC_CONST(0.332468), FRAC_CONST(0.329897), FRAC_CONST(0.32), FRAC_CONST(0.285714), FRAC_CONST(0.2), FRAC_CONST(0.0909091), FRAC_CONST(0.0285714), FRAC_CONST(0.00763359), FRAC_CONST(0.00194175), FRAC_CONST(0.000487567), FRAC_CONST(0.000122026) },
329 { FRAC_CONST(0.199961), FRAC_CONST(0.199844), FRAC_CONST(0.199377), FRAC_CONST(0.197531), FRAC_CONST(0.190476), FRAC_CONST(0.166667), FRAC_CONST(0.111111), FRAC_CONST(0.047619), FRAC_CONST(0.0144928), FRAC_CONST(0.00383142), FRAC_CONST(0.000971817), FRAC_CONST(0.000243843), FRAC_CONST(6.10165E-005) },
330 { FRAC_CONST(0.111087), FRAC_CONST(0.111015), FRAC_CONST(0.110727), FRAC_CONST(0.109589), FRAC_CONST(0.105263), FRAC_CONST(0.0909091), FRAC_CONST(0.0588235), FRAC_CONST(0.0243902), FRAC_CONST(0.00729927), FRAC_CONST(0.00191939), FRAC_CONST(0.000486145), FRAC_CONST(0.000121936), FRAC_CONST(3.05092E-005) },
331 { FRAC_CONST(0.05881), FRAC_CONST(0.0587695), FRAC_CONST(0.0586081), FRAC_CONST(0.057971), FRAC_CONST(0.0555556), FRAC_CONST(0.047619), FRAC_CONST(0.030303), FRAC_CONST(0.0123457), FRAC_CONST(0.003663), FRAC_CONST(0.000960615), FRAC_CONST(0.000243132), FRAC_CONST(6.09719E-005), FRAC_CONST(1.52548E-005) },
332 { FRAC_CONST(0.0302959), FRAC_CONST(0.0302744), FRAC_CONST(0.0301887), FRAC_CONST(0.0298507), FRAC_CONST(0.0285714), FRAC_CONST(0.0243902), FRAC_CONST(0.0153846), FRAC_CONST(0.00621118), FRAC_CONST(0.00183486), FRAC_CONST(0.000480538), FRAC_CONST(0.000121581), FRAC_CONST(3.04869E-005), FRAC_CONST(7.62747E-006) },
333 { FRAC_CONST(0.0153809), FRAC_CONST(0.0153698), FRAC_CONST(0.0153257), FRAC_CONST(0.0151515), FRAC_CONST(0.0144928), FRAC_CONST(0.0123457), FRAC_CONST(0.00775194), FRAC_CONST(0.00311526), FRAC_CONST(0.000918274), FRAC_CONST(0.000240327), FRAC_CONST(6.0794E-005), FRAC_CONST(1.52437E-005), FRAC_CONST(3.81375E-006) },
334 { FRAC_CONST(0.00775006), FRAC_CONST(0.00774443), FRAC_CONST(0.00772201), FRAC_CONST(0.00763359), FRAC_CONST(0.00729927), FRAC_CONST(0.00621118), FRAC_CONST(0.00389105), FRAC_CONST(0.00156006), FRAC_CONST(0.000459348), FRAC_CONST(0.000120178), FRAC_CONST(3.03979E-005), FRAC_CONST(7.62189E-006), FRAC_CONST(1.90688E-006) },
335 { FRAC_CONST(0.0038901), FRAC_CONST(0.00388727), FRAC_CONST(0.00387597), FRAC_CONST(0.00383142), FRAC_CONST(0.003663), FRAC_CONST(0.00311526), FRAC_CONST(0.00194932), FRAC_CONST(0.00078064), FRAC_CONST(0.000229727), FRAC_CONST(6.00925E-005), FRAC_CONST(1.51992E-005), FRAC_CONST(3.81096E-006), FRAC_CONST(9.53441E-007) },
336 { FRAC_CONST(0.00194884), FRAC_CONST(0.00194742), FRAC_CONST(0.00194175), FRAC_CONST(0.00191939), FRAC_CONST(0.00183486), FRAC_CONST(0.00156006), FRAC_CONST(0.00097561), FRAC_CONST(0.000390472), FRAC_CONST(0.000114877), FRAC_CONST(3.00472E-005), FRAC_CONST(7.59965E-006), FRAC_CONST(1.90548E-006), FRAC_CONST(4.76721E-007) },
337 { FRAC_CONST(0.000975372), FRAC_CONST(0.000974659), FRAC_CONST(0.000971817), FRAC_CONST(0.000960615), FRAC_CONST(0.000918274), FRAC_CONST(0.00078064), FRAC_CONST(0.000488043), FRAC_CONST(0.000195274), FRAC_CONST(5.74416E-005), FRAC_CONST(1.50238E-005), FRAC_CONST(3.79984E-006), FRAC_CONST(9.52743E-007), FRAC_CONST(2.3836E-007) },
338 { FRAC_CONST(0.000487924), FRAC_CONST(0.000487567), FRAC_CONST(0.000486145), FRAC_CONST(0.000480538), FRAC_CONST(0.000459348), FRAC_CONST(0.000390472), FRAC_CONST(0.000244081), FRAC_CONST(9.76467E-005), FRAC_CONST(2.87216E-005), FRAC_CONST(7.51196E-006), FRAC_CONST(1.89992E-006), FRAC_CONST(4.76372E-007), FRAC_CONST(1.1918E-007) },
339 { FRAC_CONST(0.000244021), FRAC_CONST(0.000243843), FRAC_CONST(0.000243132), FRAC_CONST(0.000240327), FRAC_CONST(0.000229727), FRAC_CONST(0.000195274), FRAC_CONST(0.000122055), FRAC_CONST(4.88257E-005), FRAC_CONST(1.4361E-005), FRAC_CONST(3.756E-006), FRAC_CONST(9.49963E-007), FRAC_CONST(2.38186E-007), FRAC_CONST(5.95901E-008) },
340 { FRAC_CONST(0.000122026), FRAC_CONST(0.000121936), FRAC_CONST(0.000121581), FRAC_CONST(0.000120178), FRAC_CONST(0.000114877), FRAC_CONST(9.76467E-005), FRAC_CONST(6.10314E-005), FRAC_CONST(2.44135E-005), FRAC_CONST(7.18056E-006), FRAC_CONST(1.878E-006), FRAC_CONST(4.74982E-007), FRAC_CONST(1.19093E-007), FRAC_CONST(2.9795E-008) },
341 { FRAC_CONST(6.10165E-005), FRAC_CONST(6.09719E-005), FRAC_CONST(6.0794E-005), FRAC_CONST(6.00925E-005), FRAC_CONST(5.74416E-005), FRAC_CONST(4.88257E-005), FRAC_CONST(3.05166E-005), FRAC_CONST(1.22069E-005), FRAC_CONST(3.59029E-006), FRAC_CONST(9.39002E-007), FRAC_CONST(2.37491E-007), FRAC_CONST(5.95465E-008), FRAC_CONST(1.48975E-008) },
342 { FRAC_CONST(3.05092E-005), FRAC_CONST(3.04869E-005), FRAC_CONST(3.03979E-005), FRAC_CONST(3.00472E-005), FRAC_CONST(2.87216E-005), FRAC_CONST(2.44135E-005), FRAC_CONST(1.52586E-005), FRAC_CONST(6.10348E-006), FRAC_CONST(1.79515E-006), FRAC_CONST(4.69501E-007), FRAC_CONST(1.18745E-007), FRAC_CONST(2.97732E-008), FRAC_CONST(7.44876E-009) },
343 { FRAC_CONST(1.52548E-005), FRAC_CONST(1.52437E-005), FRAC_CONST(1.51992E-005), FRAC_CONST(1.50238E-005), FRAC_CONST(1.4361E-005), FRAC_CONST(1.22069E-005), FRAC_CONST(7.62934E-006), FRAC_CONST(3.05175E-006), FRAC_CONST(8.97575E-007), FRAC_CONST(2.34751E-007), FRAC_CONST(5.93727E-008), FRAC_CONST(1.48866E-008), FRAC_CONST(3.72438E-009) },
344 { FRAC_CONST(7.62747E-006), FRAC_CONST(7.62189E-006), FRAC_CONST(7.59965E-006), FRAC_CONST(7.51196E-006), FRAC_CONST(7.18056E-006), FRAC_CONST(6.10348E-006), FRAC_CONST(3.81468E-006), FRAC_CONST(1.52588E-006), FRAC_CONST(4.48788E-007), FRAC_CONST(1.17375E-007), FRAC_CONST(2.96864E-008), FRAC_CONST(7.44331E-009), FRAC_CONST(1.86219E-009) },
345 { FRAC_CONST(3.81375E-006), FRAC_CONST(3.81096E-006), FRAC_CONST(3.79984E-006), FRAC_CONST(3.756E-006), FRAC_CONST(3.59029E-006), FRAC_CONST(3.05175E-006), FRAC_CONST(1.90734E-006), FRAC_CONST(7.62939E-007), FRAC_CONST(2.24394E-007), FRAC_CONST(5.86876E-008), FRAC_CONST(1.48432E-008), FRAC_CONST(3.72166E-009), FRAC_CONST(9.31095E-010) },
346 { FRAC_CONST(1.90688E-006), FRAC_CONST(1.90548E-006), FRAC_CONST(1.89992E-006), FRAC_CONST(1.878E-006), FRAC_CONST(1.79515E-006), FRAC_CONST(1.52588E-006), FRAC_CONST(9.53673E-007), FRAC_CONST(3.8147E-007), FRAC_CONST(1.12197E-007), FRAC_CONST(2.93438E-008), FRAC_CONST(7.42159E-009), FRAC_CONST(1.86083E-009), FRAC_CONST(4.65548E-010) },
347 { FRAC_CONST(9.53441E-007), FRAC_CONST(9.52743E-007), FRAC_CONST(9.49963E-007), FRAC_CONST(9.39002E-007), FRAC_CONST(8.97575E-007), FRAC_CONST(7.62939E-007), FRAC_CONST(4.76837E-007), FRAC_CONST(1.90735E-007), FRAC_CONST(5.60985E-008), FRAC_CONST(1.46719E-008), FRAC_CONST(3.71079E-009), FRAC_CONST(9.30414E-010), FRAC_CONST(2.32774E-010) },
348 { FRAC_CONST(4.76721E-007), FRAC_CONST(4.76372E-007), FRAC_CONST(4.74982E-007), FRAC_CONST(4.69501E-007), FRAC_CONST(4.48788E-007), FRAC_CONST(3.8147E-007), FRAC_CONST(2.38419E-007), FRAC_CONST(9.53674E-008), FRAC_CONST(2.80492E-008), FRAC_CONST(7.33596E-009), FRAC_CONST(1.8554E-009), FRAC_CONST(4.65207E-010), FRAC_CONST(1.16387E-010) },
349 { FRAC_CONST(2.3836E-007), FRAC_CONST(2.38186E-007), FRAC_CONST(2.37491E-007), FRAC_CONST(2.34751E-007), FRAC_CONST(2.24394E-007), FRAC_CONST(1.90735E-007), FRAC_CONST(1.19209E-007), FRAC_CONST(4.76837E-008), FRAC_CONST(1.40246E-008), FRAC_CONST(3.66798E-009), FRAC_CONST(9.27699E-010), FRAC_CONST(2.32603E-010), FRAC_CONST(5.81935E-011) },
350 { FRAC_CONST(1.1918E-007), FRAC_CONST(1.19093E-007), FRAC_CONST(1.18745E-007), FRAC_CONST(1.17375E-007), FRAC_CONST(1.12197E-007), FRAC_CONST(9.53674E-008), FRAC_CONST(5.96046E-008), FRAC_CONST(2.38419E-008), FRAC_CONST(7.01231E-009), FRAC_CONST(1.83399E-009), FRAC_CONST(4.63849E-010), FRAC_CONST(1.16302E-010), FRAC_CONST(2.90967E-011) }
351 };
352
353 /* calculates Q/(1+Q) */
354 /* [0..1] */
355 real_t calc_Q_div2(sbr_info *sbr, uint8_t ch, uint8_t m, uint8_t l)
356 {
357 if (sbr->bs_coupling)
358 {
359 if ((sbr->Q[0][m][l] < 0 || sbr->Q[0][m][l] > 30) ||
360 (sbr->Q[1][m][l] < 0 || sbr->Q[1][m][l] > 24 /* 2*panOffset(1) */))
361 {
362 return 0;
363 } else {
364 /* the pan parameter is always even */
365 if (ch == 0)
366 {
367 return Q_div2_tab_left[sbr->Q[0][m][l]][sbr->Q[1][m][l] >> 1];
368 } else {
369 return Q_div2_tab_right[sbr->Q[0][m][l]][sbr->Q[1][m][l] >> 1];
370 }
371 }
372 } else {
373 /* no coupling */
374 if (sbr->Q[ch][m][l] < 0 || sbr->Q[ch][m][l] > 30)
375 {
376 return 0;
377 } else {
378 return Q_div2_tab[sbr->Q[ch][m][l]];
379 }
380 }
381 }
382
383 static const real_t E_deq_tab[64] = {
384 64.0f, 128.0f, 256.0f, 512.0f, 1024.0f, 2048.0f, 4096.0f, 8192.0f,
385 16384.0f, 32768.0f, 65536.0f, 131072.0f, 262144.0f, 524288.0f, 1.04858E+006f, 2.09715E+006f,
386 4.1943E+006f, 8.38861E+006f, 1.67772E+007f, 3.35544E+007f, 6.71089E+007f, 1.34218E+008f, 2.68435E+008f, 5.36871E+008f,
387 1.07374E+009f, 2.14748E+009f, 4.29497E+009f, 8.58993E+009f, 1.71799E+010f, 3.43597E+010f, 6.87195E+010f, 1.37439E+011f,
388 2.74878E+011f, 5.49756E+011f, 1.09951E+012f, 2.19902E+012f, 4.39805E+012f, 8.79609E+012f, 1.75922E+013f, 3.51844E+013f,
389 7.03687E+013f, 1.40737E+014f, 2.81475E+014f, 5.6295E+014f, 1.1259E+015f, 2.2518E+015f, 4.5036E+015f, 9.0072E+015f,
390 1.80144E+016f, 3.60288E+016f, 7.20576E+016f, 1.44115E+017f, 2.8823E+017f, 5.76461E+017f, 1.15292E+018f, 2.30584E+018f,
391 4.61169E+018f, 9.22337E+018f, 1.84467E+019f, 3.68935E+019f, 7.3787E+019f, 1.47574E+020f, 2.95148E+020f, 5.90296E+020f
392 };
393
394 void envelope_noise_dequantisation(sbr_info *sbr, uint8_t ch)
395 {
396 if (sbr->bs_coupling == 0)
397 {
398 int16_t exp;
399 uint8_t l, k;
400 uint8_t amp = (sbr->amp_res[ch]) ? 0 : 1;
401
402 for (l = 0; l < sbr->L_E[ch]; l++)
403 {
404 for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
405 {
406 /* +6 for the *64 and -10 for the /32 in the synthesis QMF (fixed)
407 * since this is a energy value: (x/32)^2 = (x^2)/1024
408 */
409 /* exp = (sbr->E[ch][k][l] >> amp) + 6; */
410 exp = (sbr->E[ch][k][l] >> amp);
411
412 if ((exp < 0) || (exp >= 64))
413 {
414 sbr->E_orig[ch][k][l] = 0;
415 } else {
416 sbr->E_orig[ch][k][l] = E_deq_tab[exp];
417
418 /* save half the table size at the cost of 1 multiply */
419 if (amp && (sbr->E[ch][k][l] & 1))
420 {
421 sbr->E_orig[ch][k][l] = MUL_C(sbr->E_orig[ch][k][l], COEF_CONST(1.414213562));
422 }
423 }
424 }
425 }
426
427 for (l = 0; l < sbr->L_Q[ch]; l++)
428 {
429 for (k = 0; k < sbr->N_Q; k++)
430 {
431 sbr->Q_div[ch][k][l] = calc_Q_div(sbr, ch, k, l);
432 sbr->Q_div2[ch][k][l] = calc_Q_div2(sbr, ch, k, l);
433 }
434 }
435 }
436 }
437
438 static const real_t E_pan_tab[25] = {
439 FRAC_CONST(0.000244081), FRAC_CONST(0.000488043),
440 FRAC_CONST(0.00097561), FRAC_CONST(0.00194932),
441 FRAC_CONST(0.00389105), FRAC_CONST(0.00775194),
442 FRAC_CONST(0.0153846), FRAC_CONST(0.030303),
443 FRAC_CONST(0.0588235), FRAC_CONST(0.111111),
444 FRAC_CONST(0.2), FRAC_CONST(0.333333),
445 FRAC_CONST(0.5), FRAC_CONST(0.666667),
446 FRAC_CONST(0.8), FRAC_CONST(0.888889),
447 FRAC_CONST(0.941176), FRAC_CONST(0.969697),
448 FRAC_CONST(0.984615), FRAC_CONST(0.992248),
449 FRAC_CONST(0.996109), FRAC_CONST(0.998051),
450 FRAC_CONST(0.999024), FRAC_CONST(0.999512),
451 FRAC_CONST(0.999756)
452 };
453
454 void unmap_envelope_noise(sbr_info *sbr)
455 {
456 real_t tmp;
457 int16_t exp0, exp1;
458 uint8_t l, k;
459 uint8_t amp0 = (sbr->amp_res[0]) ? 0 : 1;
460 uint8_t amp1 = (sbr->amp_res[1]) ? 0 : 1;
461
462 for (l = 0; l < sbr->L_E[0]; l++)
463 {
464 for (k = 0; k < sbr->n[sbr->f[0][l]]; k++)
465 {
466 /* +6: * 64 ; +1: * 2 ; */
467 exp0 = (sbr->E[0][k][l] >> amp0) + 1;
468
469 /* UN_MAP removed: (x / 4096) same as (x >> 12) */
470 /* E[1] is always even so no need for compensating the divide by 2 with
471 * an extra multiplication
472 */
473 /* exp1 = (sbr->E[1][k][l] >> amp1) - 12; */
474 exp1 = (sbr->E[1][k][l] >> amp1);
475
476 if ((exp0 < 0) || (exp0 >= 64) ||
477 (exp1 < 0) || (exp1 > 24))
478 {
479 sbr->E_orig[1][k][l] = 0;
480 sbr->E_orig[0][k][l] = 0;
481 } else {
482 tmp = E_deq_tab[exp0];
483 if (amp0 && (sbr->E[0][k][l] & 1))
484 {
485 tmp = MUL_C(tmp, COEF_CONST(1.414213562));
486 }
487
488 /* panning */
489 sbr->E_orig[0][k][l] = MUL_F(tmp, E_pan_tab[exp1]);
490 sbr->E_orig[1][k][l] = MUL_F(tmp, E_pan_tab[24 - exp1]);
491 }
492 }
493 }
494
495 for (l = 0; l < sbr->L_Q[0]; l++)
496 {
497 for (k = 0; k < sbr->N_Q; k++)
498 {
499 sbr->Q_div[0][k][l] = calc_Q_div(sbr, 0, k, l);
500 sbr->Q_div[1][k][l] = calc_Q_div(sbr, 1, k, l);
501 sbr->Q_div2[0][k][l] = calc_Q_div2(sbr, 0, k, l);
502 sbr->Q_div2[1][k][l] = calc_Q_div2(sbr, 1, k, l);
503 }
504 }
505 }
506
507 #endif
508
509 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_e_nf.h,v 1.18 2007/11/01 12:33:35 menno Exp $
28 **/
29
30 #ifndef __SBR_E_NF_H__
31 #define __SBR_E_NF_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37
38 void extract_envelope_data(sbr_info *sbr, uint8_t ch);
39 void extract_noise_floor_data(sbr_info *sbr, uint8_t ch);
40 #ifndef FIXED_POINT
41 void envelope_noise_dequantisation(sbr_info *sbr, uint8_t ch);
42 void unmap_envelope_noise(sbr_info *sbr);
43 #endif
44
45 #ifdef __cplusplus
46 }
47 #endif
48 #endif
49
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_fbt.c,v 1.21 2007/11/01 12:33:35 menno Exp $
28 **/
29
30 /* Calculate frequency band tables */
31
32 #include "common.h"
33 #include "structs.h"
34
35 #ifdef SBR_DEC
36
37 #include <stdlib.h>
38
39 #include "sbr_syntax.h"
40 #include "sbr_fbt.h"
41
42 /* static function declarations */
43 static int32_t find_bands(uint8_t warp, uint8_t bands, uint8_t a0, uint8_t a1);
44
45
46 /* calculate the start QMF channel for the master frequency band table */
47 /* parameter is also called k0 */
48 uint8_t qmf_start_channel(uint8_t bs_start_freq, uint8_t bs_samplerate_mode,
49 uint32_t sample_rate)
50 {
51 static const uint8_t startMinTable[12] = { 7, 7, 10, 11, 12, 16, 16,
52 17, 24, 32, 35, 48 };
53 static const uint8_t offsetIndexTable[12] = { 5, 5, 4, 4, 4, 3, 2, 1, 0,
54 6, 6, 6 };
55 static const int8_t offset[7][16] = {
56 { -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7 },
57 { -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13 },
58 { -5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16 },
59 { -6, -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16 },
60 { -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20 },
61 { -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24 },
62 { 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24, 28, 33 }
63 };
64 uint8_t startMin = startMinTable[get_sr_index(sample_rate)];
65 uint8_t offsetIndex = offsetIndexTable[get_sr_index(sample_rate)];
66
67 #if 0 /* replaced with table (startMinTable) */
68 if (sample_rate >= 64000)
69 {
70 startMin = (uint8_t)((5000.*128.)/(float)sample_rate + 0.5);
71 } else if (sample_rate < 32000) {
72 startMin = (uint8_t)((3000.*128.)/(float)sample_rate + 0.5);
73 } else {
74 startMin = (uint8_t)((4000.*128.)/(float)sample_rate + 0.5);
75 }
76 #endif
77
78 if (bs_samplerate_mode)
79 {
80 return startMin + offset[offsetIndex][bs_start_freq];
81
82 #if 0 /* replaced by offsetIndexTable */
83 switch (sample_rate)
84 {
85 case 16000:
86 return startMin + offset[0][bs_start_freq];
87 case 22050:
88 return startMin + offset[1][bs_start_freq];
89 case 24000:
90 return startMin + offset[2][bs_start_freq];
91 case 32000:
92 return startMin + offset[3][bs_start_freq];
93 default:
94 if (sample_rate > 64000)
95 {
96 return startMin + offset[5][bs_start_freq];
97 } else { /* 44100 <= sample_rate <= 64000 */
98 return startMin + offset[4][bs_start_freq];
99 }
100 }
101 #endif
102 } else {
103 return startMin + offset[6][bs_start_freq];
104 }
105 }
106
107 static int longcmp(const void *a, const void *b)
108 {
109 return ((int)(*(int32_t*)a - *(int32_t*)b));
110 }
111
112 /* calculate the stop QMF channel for the master frequency band table */
113 /* parameter is also called k2 */
114 uint8_t qmf_stop_channel(uint8_t bs_stop_freq, uint32_t sample_rate,
115 uint8_t k0)
116 {
117 if (bs_stop_freq == 15)
118 {
119 return min(64, k0 * 3);
120 } else if (bs_stop_freq == 14) {
121 return min(64, k0 * 2);
122 } else {
123 static const uint8_t stopMinTable[12] = { 13, 15, 20, 21, 23,
124 32, 32, 35, 48, 64, 70, 96 };
125 static const int8_t offset[12][14] = {
126 { 0, 2, 4, 6, 8, 11, 14, 18, 22, 26, 31, 37, 44, 51 },
127 { 0, 2, 4, 6, 8, 11, 14, 18, 22, 26, 31, 36, 42, 49 },
128 { 0, 2, 4, 6, 8, 11, 14, 17, 21, 25, 29, 34, 39, 44 },
129 { 0, 2, 4, 6, 8, 11, 14, 17, 20, 24, 28, 33, 38, 43 },
130 { 0, 2, 4, 6, 8, 11, 14, 17, 20, 24, 28, 32, 36, 41 },
131 { 0, 2, 4, 6, 8, 10, 12, 14, 17, 20, 23, 26, 29, 32 },
132 { 0, 2, 4, 6, 8, 10, 12, 14, 17, 20, 23, 26, 29, 32 },
133 { 0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 20, 23, 26, 29 },
134 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16 },
135 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
136 { 0, -1, -2, -3, -4, -5, -6, -6, -6, -6, -6, -6, -6, -6 },
137 { 0, -3, -6, -9, -12, -15, -18, -20, -22, -24, -26, -28, -30, -32 }
138 };
139 #if 0
140 uint8_t i;
141 int32_t stopDk[13], stopDk_t[14], k2;
142 #endif
143 uint8_t stopMin = stopMinTable[get_sr_index(sample_rate)];
144
145 #if 0 /* replaced by table lookup */
146 if (sample_rate >= 64000)
147 {
148 stopMin = (uint8_t)((10000.*128.)/(float)sample_rate + 0.5);
149 } else if (sample_rate < 32000) {
150 stopMin = (uint8_t)((6000.*128.)/(float)sample_rate + 0.5);
151 } else {
152 stopMin = (uint8_t)((8000.*128.)/(float)sample_rate + 0.5);
153 }
154 #endif
155
156 #if 0 /* replaced by table lookup */
157 /* diverging power series */
158 for (i = 0; i <= 13; i++)
159 {
160 stopDk_t[i] = (int32_t)(stopMin*pow(64.0/stopMin, i/13.0) + 0.5);
161 }
162 for (i = 0; i < 13; i++)
163 {
164 stopDk[i] = stopDk_t[i+1] - stopDk_t[i];
165 }
166
167 /* needed? */
168 qsort(stopDk, 13, sizeof(stopDk[0]), longcmp);
169
170 k2 = stopMin;
171 for (i = 0; i < bs_stop_freq; i++)
172 {
173 k2 += stopDk[i];
174 }
175 return min(64, k2);
176 #endif
177 /* bs_stop_freq <= 13 */
178 return min(64, stopMin + offset[get_sr_index(sample_rate)][min(bs_stop_freq, 13)]);
179 }
180
181 return 0;
182 }
183
184 /* calculate the master frequency table from k0, k2, bs_freq_scale
185 and bs_alter_scale
186
187 version for bs_freq_scale = 0
188 */
189 uint8_t master_frequency_table_fs0(sbr_info *sbr, uint8_t k0, uint8_t k2,
190 uint8_t bs_alter_scale)
191 {
192 int8_t incr;
193 uint8_t k;
194 uint8_t dk;
195 uint32_t nrBands, k2Achieved;
196 int32_t k2Diff, vDk[64] = {0};
197
198 /* mft only defined for k2 > k0 */
199 if (k2 <= k0)
200 {
201 sbr->N_master = 0;
202 return 1;
203 }
204
205 dk = bs_alter_scale ? 2 : 1;
206
207 #if 0 /* replaced by float-less design */
208 nrBands = 2 * (int32_t)((float)(k2-k0)/(dk*2) + (-1+dk)/2.0f);
209 #else
210 if (bs_alter_scale)
211 {
212 nrBands = (((k2-k0+2)>>2)<<1);
213 } else {
214 nrBands = (((k2-k0)>>1)<<1);
215 }
216 #endif
217 nrBands = min(nrBands, 63);
218 if (nrBands <= 0)
219 return 1;
220
221 k2Achieved = k0 + nrBands * dk;
222 k2Diff = k2 - k2Achieved;
223 for (k = 0; k < nrBands; k++)
224 vDk[k] = dk;
225
226 if (k2Diff)
227 {
228 incr = (k2Diff > 0) ? -1 : 1;
229 k = (uint8_t) ((k2Diff > 0) ? (nrBands-1) : 0);
230
231 while (k2Diff != 0)
232 {
233 vDk[k] -= incr;
234 k += incr;
235 k2Diff += incr;
236 }
237 }
238
239 sbr->f_master[0] = k0;
240 for (k = 1; k <= nrBands; k++)
241 sbr->f_master[k] = (uint8_t)(sbr->f_master[k-1] + vDk[k-1]);
242
243 sbr->N_master = (uint8_t)nrBands;
244 sbr->N_master = (min(sbr->N_master, 64));
245
246 #if 0
247 printf("f_master[%d]: ", nrBands);
248 for (k = 0; k <= nrBands; k++)
249 {
250 printf("%d ", sbr->f_master[k]);
251 }
252 printf("\n");
253 #endif
254
255 return 0;
256 }
257
258 /*
259 This function finds the number of bands using this formula:
260 bands * log(a1/a0)/log(2.0) + 0.5
261 */
262 static int32_t find_bands(uint8_t warp, uint8_t bands, uint8_t a0, uint8_t a1)
263 {
264 #ifdef FIXED_POINT
265 /* table with log2() values */
266 static const real_t log2Table[65] = {
267 COEF_CONST(0.0), COEF_CONST(0.0), COEF_CONST(1.0000000000), COEF_CONST(1.5849625007),
268 COEF_CONST(2.0000000000), COEF_CONST(2.3219280949), COEF_CONST(2.5849625007), COEF_CONST(2.8073549221),
269 COEF_CONST(3.0000000000), COEF_CONST(3.1699250014), COEF_CONST(3.3219280949), COEF_CONST(3.4594316186),
270 COEF_CONST(3.5849625007), COEF_CONST(3.7004397181), COEF_CONST(3.8073549221), COEF_CONST(3.9068905956),
271 COEF_CONST(4.0000000000), COEF_CONST(4.0874628413), COEF_CONST(4.1699250014), COEF_CONST(4.2479275134),
272 COEF_CONST(4.3219280949), COEF_CONST(4.3923174228), COEF_CONST(4.4594316186), COEF_CONST(4.5235619561),
273 COEF_CONST(4.5849625007), COEF_CONST(4.6438561898), COEF_CONST(4.7004397181), COEF_CONST(4.7548875022),
274 COEF_CONST(4.8073549221), COEF_CONST(4.8579809951), COEF_CONST(4.9068905956), COEF_CONST(4.9541963104),
275 COEF_CONST(5.0000000000), COEF_CONST(5.0443941194), COEF_CONST(5.0874628413), COEF_CONST(5.1292830169),
276 COEF_CONST(5.1699250014), COEF_CONST(5.2094533656), COEF_CONST(5.2479275134), COEF_CONST(5.2854022189),
277 COEF_CONST(5.3219280949), COEF_CONST(5.3575520046), COEF_CONST(5.3923174228), COEF_CONST(5.4262647547),
278 COEF_CONST(5.4594316186), COEF_CONST(5.4918530963), COEF_CONST(5.5235619561), COEF_CONST(5.5545888517),
279 COEF_CONST(5.5849625007), COEF_CONST(5.6147098441), COEF_CONST(5.6438561898), COEF_CONST(5.6724253420),
280 COEF_CONST(5.7004397181), COEF_CONST(5.7279204546), COEF_CONST(5.7548875022), COEF_CONST(5.7813597135),
281 COEF_CONST(5.8073549221), COEF_CONST(5.8328900142), COEF_CONST(5.8579809951), COEF_CONST(5.8826430494),
282 COEF_CONST(5.9068905956), COEF_CONST(5.9307373376), COEF_CONST(5.9541963104), COEF_CONST(5.9772799235),
283 COEF_CONST(6.0)
284 };
285 real_t r0 = log2Table[a0]; /* coef */
286 real_t r1 = log2Table[a1]; /* coef */
287 real_t r2 = (r1 - r0); /* coef */
288
289 if (warp)
290 r2 = MUL_C(r2, COEF_CONST(1.0/1.3));
291
292 /* convert r2 to real and then multiply and round */
293 r2 = (r2 >> (COEF_BITS-REAL_BITS)) * bands + (1<<(REAL_BITS-1));
294
295 return (r2 >> REAL_BITS);
296 #else
297 real_t div = (real_t)log(2.0);
298 if (warp) div *= (real_t)1.3;
299
300 return (int32_t)(bands * log((float)a1/(float)a0)/div + 0.5);
301 #endif
302 }
303
304 static real_t find_initial_power(uint8_t bands, uint8_t a0, uint8_t a1)
305 {
306 #ifdef FIXED_POINT
307 /* table with log() values */
308 static const real_t logTable[65] = {
309 COEF_CONST(0.0), COEF_CONST(0.0), COEF_CONST(0.6931471806), COEF_CONST(1.0986122887),
310 COEF_CONST(1.3862943611), COEF_CONST(1.6094379124), COEF_CONST(1.7917594692), COEF_CONST(1.9459101491),
311 COEF_CONST(2.0794415417), COEF_CONST(2.1972245773), COEF_CONST(2.3025850930), COEF_CONST(2.3978952728),
312 COEF_CONST(2.4849066498), COEF_CONST(2.5649493575), COEF_CONST(2.6390573296), COEF_CONST(2.7080502011),
313 COEF_CONST(2.7725887222), COEF_CONST(2.8332133441), COEF_CONST(2.8903717579), COEF_CONST(2.9444389792),
314 COEF_CONST(2.9957322736), COEF_CONST(3.0445224377), COEF_CONST(3.0910424534), COEF_CONST(3.1354942159),
315 COEF_CONST(3.1780538303), COEF_CONST(3.2188758249), COEF_CONST(3.2580965380), COEF_CONST(3.2958368660),
316 COEF_CONST(3.3322045102), COEF_CONST(3.3672958300), COEF_CONST(3.4011973817), COEF_CONST(3.4339872045),
317 COEF_CONST(3.4657359028), COEF_CONST(3.4965075615), COEF_CONST(3.5263605246), COEF_CONST(3.5553480615),
318 COEF_CONST(3.5835189385), COEF_CONST(3.6109179126), COEF_CONST(3.6375861597), COEF_CONST(3.6635616461),
319 COEF_CONST(3.6888794541), COEF_CONST(3.7135720667), COEF_CONST(3.7376696183), COEF_CONST(3.7612001157),
320 COEF_CONST(3.7841896339), COEF_CONST(3.8066624898), COEF_CONST(3.8286413965), COEF_CONST(3.8501476017),
321 COEF_CONST(3.8712010109), COEF_CONST(3.8918202981), COEF_CONST(3.9120230054), COEF_CONST(3.9318256327),
322 COEF_CONST(3.9512437186), COEF_CONST(3.9702919136), COEF_CONST(3.9889840466), COEF_CONST(4.0073331852),
323 COEF_CONST(4.0253516907), COEF_CONST(4.0430512678), COEF_CONST(4.0604430105), COEF_CONST(4.0775374439),
324 COEF_CONST(4.0943445622), COEF_CONST(4.1108738642), COEF_CONST(4.1271343850), COEF_CONST(4.1431347264),
325 COEF_CONST(4.158883083)
326 };
327 /* standard Taylor polynomial coefficients for exp(x) around 0 */
328 /* a polynomial around x=1 is more precise, as most values are around 1.07,
329 but this is just fine already */
330 static const real_t c1 = COEF_CONST(1.0);
331 static const real_t c2 = COEF_CONST(1.0/2.0);
332 static const real_t c3 = COEF_CONST(1.0/6.0);
333 static const real_t c4 = COEF_CONST(1.0/24.0);
334
335 real_t r0 = logTable[a0]; /* coef */
336 real_t r1 = logTable[a1]; /* coef */
337 real_t r2 = (r1 - r0) / bands; /* coef */
338 real_t rexp = c1 + MUL_C((c1 + MUL_C((c2 + MUL_C((c3 + MUL_C(c4,r2)), r2)), r2)), r2);
339
340 return (rexp >> (COEF_BITS-REAL_BITS)); /* real */
341 #else
342 return (real_t)pow((real_t)a1/(real_t)a0, 1.0/(real_t)bands);
343 #endif
344 }
345
346 /*
347 version for bs_freq_scale > 0
348 */
349 uint8_t master_frequency_table(sbr_info *sbr, uint8_t k0, uint8_t k2,
350 uint8_t bs_freq_scale, uint8_t bs_alter_scale)
351 {
352 uint8_t k, bands, twoRegions;
353 uint8_t k1;
354 uint8_t nrBand0, nrBand1;
355 int32_t vDk0[64] = {0}, vDk1[64] = {0};
356 int32_t vk0[64] = {0}, vk1[64] = {0};
357 uint8_t temp1[] = { 6, 5, 4 };
358 real_t q, qk;
359 int32_t A_1;
360 #ifdef FIXED_POINT
361 real_t rk2, rk0;
362 #endif
363
364 /* mft only defined for k2 > k0 */
365 if (k2 <= k0)
366 {
367 sbr->N_master = 0;
368 return 1;
369 }
370
371 bands = temp1[bs_freq_scale-1];
372
373 #ifdef FIXED_POINT
374 rk0 = (real_t)k0 << REAL_BITS;
375 rk2 = (real_t)k2 << REAL_BITS;
376 if (rk2 > MUL_C(rk0, COEF_CONST(2.2449)))
377 #else
378 if ((float)k2/(float)k0 > 2.2449)
379 #endif
380 {
381 twoRegions = 1;
382 k1 = k0 << 1;
383 } else {
384 twoRegions = 0;
385 k1 = k2;
386 }
387
388 nrBand0 = (uint8_t)(2 * find_bands(0, bands, k0, k1));
389 nrBand0 = min(nrBand0, 63);
390 if (nrBand0 <= 0)
391 return 1;
392
393 q = find_initial_power(nrBand0, k0, k1);
394 #ifdef FIXED_POINT
395 qk = (real_t)k0 << REAL_BITS;
396 //A_1 = (int32_t)((qk + REAL_CONST(0.5)) >> REAL_BITS);
397 A_1 = k0;
398 #else
399 qk = REAL_CONST(k0);
400 A_1 = (int32_t)(qk + .5);
401 #endif
402 for (k = 0; k <= nrBand0; k++)
403 {
404 int32_t A_0 = A_1;
405 #ifdef FIXED_POINT
406 qk = MUL_R(qk,q);
407 A_1 = (int32_t)((qk + REAL_CONST(0.5)) >> REAL_BITS);
408 #else
409 qk *= q;
410 A_1 = (int32_t)(qk + 0.5);
411 #endif
412 vDk0[k] = A_1 - A_0;
413 }
414
415 /* needed? */
416 qsort(vDk0, nrBand0, sizeof(vDk0[0]), longcmp);
417
418 vk0[0] = k0;
419 for (k = 1; k <= nrBand0; k++)
420 {
421 vk0[k] = vk0[k-1] + vDk0[k-1];
422 if (vDk0[k-1] == 0)
423 return 1;
424 }
425
426 if (!twoRegions)
427 {
428 for (k = 0; k <= nrBand0; k++)
429 sbr->f_master[k] = (uint8_t) vk0[k];
430
431 sbr->N_master = nrBand0;
432 sbr->N_master = min(sbr->N_master, 64);
433 return 0;
434 }
435
436 nrBand1 = (uint8_t)(2 * find_bands(1 /* warped */, bands, k1, k2));
437 nrBand1 = min(nrBand1, 63);
438
439 q = find_initial_power(nrBand1, k1, k2);
440 #ifdef FIXED_POINT
441 qk = (real_t)k1 << REAL_BITS;
442 //A_1 = (int32_t)((qk + REAL_CONST(0.5)) >> REAL_BITS);
443 A_1 = k1;
444 #else
445 qk = REAL_CONST(k1);
446 A_1 = (int32_t)(qk + .5);
447 #endif
448 for (k = 0; k <= nrBand1 - 1; k++)
449 {
450 int32_t A_0 = A_1;
451 #ifdef FIXED_POINT
452 qk = MUL_R(qk,q);
453 A_1 = (int32_t)((qk + REAL_CONST(0.5)) >> REAL_BITS);
454 #else
455 qk *= q;
456 A_1 = (int32_t)(qk + 0.5);
457 #endif
458 vDk1[k] = A_1 - A_0;
459 }
460
461 if (vDk1[0] < vDk0[nrBand0 - 1])
462 {
463 int32_t change;
464
465 /* needed? */
466 qsort(vDk1, nrBand1 + 1, sizeof(vDk1[0]), longcmp);
467 change = vDk0[nrBand0 - 1] - vDk1[0];
468 vDk1[0] = vDk0[nrBand0 - 1];
469 vDk1[nrBand1 - 1] = vDk1[nrBand1 - 1] - change;
470 }
471
472 /* needed? */
473 qsort(vDk1, nrBand1, sizeof(vDk1[0]), longcmp);
474 vk1[0] = k1;
475 for (k = 1; k <= nrBand1; k++)
476 {
477 vk1[k] = vk1[k-1] + vDk1[k-1];
478 if (vDk1[k-1] == 0)
479 return 1;
480 }
481
482 sbr->N_master = nrBand0 + nrBand1;
483 sbr->N_master = min(sbr->N_master, 64);
484 for (k = 0; k <= nrBand0; k++)
485 {
486 sbr->f_master[k] = (uint8_t) vk0[k];
487 }
488 for (k = nrBand0 + 1; k <= sbr->N_master; k++)
489 {
490 sbr->f_master[k] = (uint8_t) vk1[k - nrBand0];
491 }
492
493 #if 0
494 printf("f_master[%d]: ", sbr->N_master);
495 for (k = 0; k <= sbr->N_master; k++)
496 {
497 printf("%d ", sbr->f_master[k]);
498 }
499 printf("\n");
500 #endif
501
502 return 0;
503 }
504
505 /* calculate the derived frequency border tables from f_master */
506 uint8_t derived_frequency_table(sbr_info *sbr, uint8_t bs_xover_band,
507 uint8_t k2)
508 {
509 uint8_t k, i;
510 uint32_t minus;
511
512 /* The following relation shall be satisfied: bs_xover_band < N_Master */
513 if (sbr->N_master <= bs_xover_band)
514 return 1;
515
516 sbr->N_high = sbr->N_master - bs_xover_band;
517 sbr->N_low = (sbr->N_high>>1) + (sbr->N_high - ((sbr->N_high>>1)<<1));
518
519 sbr->n[0] = sbr->N_low;
520 sbr->n[1] = sbr->N_high;
521
522 for (k = 0; k <= sbr->N_high; k++)
523 {
524 sbr->f_table_res[HI_RES][k] = sbr->f_master[k + bs_xover_band];
525 }
526
527 sbr->M = sbr->f_table_res[HI_RES][sbr->N_high] - sbr->f_table_res[HI_RES][0];
528 sbr->kx = sbr->f_table_res[HI_RES][0];
529 if (sbr->kx > 32)
530 return 1;
531 if (sbr->kx + sbr->M > 64)
532 return 1;
533
534 minus = (sbr->N_high & 1) ? 1 : 0;
535
536 for (k = 0; k <= sbr->N_low; k++)
537 {
538 if (k == 0)
539 i = 0;
540 else
541 i = (uint8_t)(2*k - minus);
542 sbr->f_table_res[LO_RES][k] = sbr->f_table_res[HI_RES][i];
543 }
544
545 #if 0
546 printf("bs_freq_scale: %d\n", sbr->bs_freq_scale);
547 printf("bs_limiter_bands: %d\n", sbr->bs_limiter_bands);
548 printf("f_table_res[HI_RES][%d]: ", sbr->N_high);
549 for (k = 0; k <= sbr->N_high; k++)
550 {
551 printf("%d ", sbr->f_table_res[HI_RES][k]);
552 }
553 printf("\n");
554 #endif
555 #if 0
556 printf("f_table_res[LO_RES][%d]: ", sbr->N_low);
557 for (k = 0; k <= sbr->N_low; k++)
558 {
559 printf("%d ", sbr->f_table_res[LO_RES][k]);
560 }
561 printf("\n");
562 #endif
563
564 sbr->N_Q = 0;
565 if (sbr->bs_noise_bands == 0)
566 {
567 sbr->N_Q = 1;
568 } else {
569 #if 0
570 sbr->N_Q = max(1, (int32_t)(sbr->bs_noise_bands*(log(k2/(float)sbr->kx)/log(2.0)) + 0.5));
571 #else
572 sbr->N_Q = (uint8_t)(max(1, find_bands(0, sbr->bs_noise_bands, sbr->kx, k2)));
573 #endif
574 sbr->N_Q = min(5, sbr->N_Q);
575 }
576
577 for (k = 0; k <= sbr->N_Q; k++)
578 {
579 if (k == 0)
580 {
581 i = 0;
582 } else {
583 /* i = i + (int32_t)((sbr->N_low - i)/(sbr->N_Q + 1 - k)); */
584 i = i + (sbr->N_low - i)/(sbr->N_Q + 1 - k);
585 }
586 sbr->f_table_noise[k] = sbr->f_table_res[LO_RES][i];
587 }
588
589 /* build table for mapping k to g in hf patching */
590 for (k = 0; k < 64; k++)
591 {
592 uint8_t g;
593 for (g = 0; g < sbr->N_Q; g++)
594 {
595 if ((sbr->f_table_noise[g] <= k) &&
596 (k < sbr->f_table_noise[g+1]))
597 {
598 sbr->table_map_k_to_g[k] = g;
599 break;
600 }
601 }
602 }
603
604 #if 0
605 printf("f_table_noise[%d]: ", sbr->N_Q);
606 for (k = 0; k <= sbr->N_Q; k++)
607 {
608 printf("%d ", sbr->f_table_noise[k] - sbr->kx);
609 }
610 printf("\n");
611 #endif
612
613 return 0;
614 }
615
616 /* TODO: blegh, ugly */
617 /* Modified to calculate for all possible bs_limiter_bands always
618 * This reduces the number calls to this functions needed (now only on
619 * header reset)
620 */
621 void limiter_frequency_table(sbr_info *sbr)
622 {
623 #if 0
624 static const real_t limiterBandsPerOctave[] = { REAL_CONST(1.2),
625 REAL_CONST(2), REAL_CONST(3) };
626 #else
627 static const real_t limiterBandsCompare[] = { REAL_CONST(1.327152),
628 REAL_CONST(1.185093), REAL_CONST(1.119872) };
629 #endif
630 uint8_t k, s;
631 int8_t nrLim;
632 #if 0
633 real_t limBands;
634 #endif
635
636 sbr->f_table_lim[0][0] = sbr->f_table_res[LO_RES][0] - sbr->kx;
637 sbr->f_table_lim[0][1] = sbr->f_table_res[LO_RES][sbr->N_low] - sbr->kx;
638 sbr->N_L[0] = 1;
639
640 #if 0
641 printf("f_table_lim[%d][%d]: ", 0, sbr->N_L[0]);
642 for (k = 0; k <= sbr->N_L[0]; k++)
643 {
644 printf("%d ", sbr->f_table_lim[0][k]);
645 }
646 printf("\n");
647 #endif
648
649 for (s = 1; s < 4; s++)
650 {
651 int32_t limTable[100 /*TODO*/] = {0};
652 uint8_t patchBorders[64/*??*/] = {0};
653
654 #if 0
655 limBands = limiterBandsPerOctave[s - 1];
656 #endif
657
658 patchBorders[0] = sbr->kx;
659 for (k = 1; k <= sbr->noPatches; k++)
660 {
661 patchBorders[k] = patchBorders[k-1] + sbr->patchNoSubbands[k-1];
662 }
663
664 for (k = 0; k <= sbr->N_low; k++)
665 {
666 limTable[k] = sbr->f_table_res[LO_RES][k];
667 }
668 for (k = 1; k < sbr->noPatches; k++)
669 {
670 limTable[k+sbr->N_low] = patchBorders[k];
671 }
672
673 /* needed */
674 qsort(limTable, sbr->noPatches + sbr->N_low, sizeof(limTable[0]), longcmp);
675 k = 1;
676 nrLim = sbr->noPatches + sbr->N_low - 1;
677
678 if (nrLim < 0) // TODO: BIG FAT PROBLEM
679 return;
680
681 restart:
682 if (k <= nrLim)
683 {
684 real_t nOctaves;
685
686 if (limTable[k-1] != 0)
687 #if 0
688 nOctaves = REAL_CONST(log((float)limTable[k]/(float)limTable[k-1])/log(2.0));
689 #else
690 #ifdef FIXED_POINT
691 nOctaves = DIV_R((limTable[k]<<REAL_BITS),REAL_CONST(limTable[k-1]));
692 #else
693 nOctaves = (real_t)limTable[k]/(real_t)limTable[k-1];
694 #endif
695 #endif
696 else
697 nOctaves = 0;
698
699 #if 0
700 if ((MUL_R(nOctaves,limBands)) < REAL_CONST(0.49))
701 #else
702 if (nOctaves < limiterBandsCompare[s - 1])
703 #endif
704 {
705 uint8_t i;
706 if (limTable[k] != limTable[k-1])
707 {
708 uint8_t found = 0, found2 = 0;
709 for (i = 0; i <= sbr->noPatches; i++)
710 {
711 if (limTable[k] == patchBorders[i])
712 found = 1;
713 }
714 if (found)
715 {
716 found2 = 0;
717 for (i = 0; i <= sbr->noPatches; i++)
718 {
719 if (limTable[k-1] == patchBorders[i])
720 found2 = 1;
721 }
722 if (found2)
723 {
724 k++;
725 goto restart;
726 } else {
727 /* remove (k-1)th element */
728 limTable[k-1] = sbr->f_table_res[LO_RES][sbr->N_low];
729 qsort(limTable, sbr->noPatches + sbr->N_low, sizeof(limTable[0]), longcmp);
730 nrLim--;
731 goto restart;
732 }
733 }
734 }
735 /* remove kth element */
736 limTable[k] = sbr->f_table_res[LO_RES][sbr->N_low];
737 qsort(limTable, nrLim, sizeof(limTable[0]), longcmp);
738 nrLim--;
739 goto restart;
740 } else {
741 k++;
742 goto restart;
743 }
744 }
745
746 sbr->N_L[s] = nrLim;
747 for (k = 0; k <= nrLim; k++)
748 {
749 sbr->f_table_lim[s][k] = limTable[k] - sbr->kx;
750 }
751
752 #if 0
753 printf("f_table_lim[%d][%d]: ", s, sbr->N_L[s]);
754 for (k = 0; k <= sbr->N_L[s]; k++)
755 {
756 printf("%d ", sbr->f_table_lim[s][k]);
757 }
758 printf("\n");
759 #endif
760 }
761 }
762
763 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_fbt.h,v 1.18 2007/11/01 12:33:35 menno Exp $
28 **/
29
30 #ifndef __SBR_FBT_H__
31 #define __SBR_FBT_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 uint8_t qmf_start_channel(uint8_t bs_start_freq, uint8_t bs_samplerate_mode,
38 uint32_t sample_rate);
39 uint8_t qmf_stop_channel(uint8_t bs_stop_freq, uint32_t sample_rate,
40 uint8_t k0);
41 uint8_t master_frequency_table_fs0(sbr_info *sbr, uint8_t k0, uint8_t k2,
42 uint8_t bs_alter_scale);
43 uint8_t master_frequency_table(sbr_info *sbr, uint8_t k0, uint8_t k2,
44 uint8_t bs_freq_scale, uint8_t bs_alter_scale);
45 uint8_t derived_frequency_table(sbr_info *sbr, uint8_t bs_xover_band,
46 uint8_t k2);
47 void limiter_frequency_table(sbr_info *sbr);
48
49
50 #ifdef __cplusplus
51 }
52 #endif
53 #endif
54
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_hfadj.c,v 1.22 2007/11/01 12:33:35 menno Exp $
28 **/
29
30 /* High Frequency adjustment */
31
32 #include "common.h"
33 #include "structs.h"
34
35 #ifdef SBR_DEC
36
37 #include "sbr_syntax.h"
38 #include "sbr_hfadj.h"
39
40 #include "sbr_noise.h"
41
42
43 /* static function declarations */
44 static uint8_t estimate_current_envelope(sbr_info *sbr, sbr_hfadj_info *adj,
45 qmf_t Xsbr[MAX_NTSRHFG][64], uint8_t ch);
46 static void calculate_gain(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch);
47 #ifdef SBR_LOW_POWER
48 static void calc_gain_groups(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg, uint8_t ch);
49 static void aliasing_reduction(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg, uint8_t ch);
50 #endif
51 static void hf_assembly(sbr_info *sbr, sbr_hfadj_info *adj, qmf_t Xsbr[MAX_NTSRHFG][64], uint8_t ch);
52
53
54 uint8_t hf_adjustment(sbr_info *sbr, qmf_t Xsbr[MAX_NTSRHFG][64]
55 #ifdef SBR_LOW_POWER
56 ,real_t *deg /* aliasing degree */
57 #endif
58 ,uint8_t ch)
59 {
60 ALIGN sbr_hfadj_info adj = {{{0}}};
61 uint8_t ret = 0;
62
63 if (sbr->bs_frame_class[ch] == FIXFIX)
64 {
65 sbr->l_A[ch] = -1;
66 } else if (sbr->bs_frame_class[ch] == VARFIX) {
67 if (sbr->bs_pointer[ch] > 1)
68 sbr->l_A[ch] = -1;
69 else
70 sbr->l_A[ch] = sbr->bs_pointer[ch] - 1;
71 } else {
72 if (sbr->bs_pointer[ch] == 0)
73 sbr->l_A[ch] = -1;
74 else
75 sbr->l_A[ch] = sbr->L_E[ch] + 1 - sbr->bs_pointer[ch];
76 }
77
78 ret = estimate_current_envelope(sbr, &adj, Xsbr, ch);
79 if (ret > 0)
80 return 1;
81
82 calculate_gain(sbr, &adj, ch);
83
84 #ifdef SBR_LOW_POWER
85 calc_gain_groups(sbr, &adj, deg, ch);
86 aliasing_reduction(sbr, &adj, deg, ch);
87 #endif
88
89 hf_assembly(sbr, &adj, Xsbr, ch);
90
91 return 0;
92 }
93
94 static uint8_t get_S_mapped(sbr_info *sbr, uint8_t ch, uint8_t l, uint8_t current_band)
95 {
96 if (sbr->f[ch][l] == HI_RES)
97 {
98 /* in case of using f_table_high we just have 1 to 1 mapping
99 * from bs_add_harmonic[l][k]
100 */
101 if ((l >= sbr->l_A[ch]) ||
102 (sbr->bs_add_harmonic_prev[ch][current_band] && sbr->bs_add_harmonic_flag_prev[ch]))
103 {
104 return sbr->bs_add_harmonic[ch][current_band];
105 }
106 } else {
107 uint8_t b, lb, ub;
108
109 /* in case of f_table_low we check if any of the HI_RES bands
110 * within this LO_RES band has bs_add_harmonic[l][k] turned on
111 * (note that borders in the LO_RES table are also present in
112 * the HI_RES table)
113 */
114
115 /* find first HI_RES band in current LO_RES band */
116 lb = 2*current_band - ((sbr->N_high & 1) ? 1 : 0);
117 /* find first HI_RES band in next LO_RES band */
118 ub = 2*(current_band+1) - ((sbr->N_high & 1) ? 1 : 0);
119
120 /* check all HI_RES bands in current LO_RES band for sinusoid */
121 for (b = lb; b < ub; b++)
122 {
123 if ((l >= sbr->l_A[ch]) ||
124 (sbr->bs_add_harmonic_prev[ch][b] && sbr->bs_add_harmonic_flag_prev[ch]))
125 {
126 if (sbr->bs_add_harmonic[ch][b] == 1)
127 return 1;
128 }
129 }
130 }
131
132 return 0;
133 }
134
135 static uint8_t estimate_current_envelope(sbr_info *sbr, sbr_hfadj_info *adj,
136 qmf_t Xsbr[MAX_NTSRHFG][64], uint8_t ch)
137 {
138 uint8_t m, l, j, k, k_l, k_h, p;
139 real_t nrg, div;
140
141 if (sbr->bs_interpol_freq == 1)
142 {
143 for (l = 0; l < sbr->L_E[ch]; l++)
144 {
145 uint8_t i, l_i, u_i;
146
147 l_i = sbr->t_E[ch][l];
148 u_i = sbr->t_E[ch][l+1];
149
150 div = (real_t)(u_i - l_i);
151
152 if (div == 0)
153 div = 1;
154
155 for (m = 0; m < sbr->M; m++)
156 {
157 nrg = 0;
158
159 for (i = l_i + sbr->tHFAdj; i < u_i + sbr->tHFAdj; i++)
160 {
161 #ifdef FIXED_POINT
162 #ifdef SBR_LOW_POWER
163 nrg += ((QMF_RE(Xsbr[i][m + sbr->kx])+(1<<(REAL_BITS-1)))>>REAL_BITS)*((QMF_RE(Xsbr[i][m + sbr->kx])+(1<<(REAL_BITS-1)))>>REAL_BITS);
164 #else
165 nrg += ((QMF_RE(Xsbr[i][m + sbr->kx])+(1<<(REAL_BITS-1)))>>REAL_BITS)*((QMF_RE(Xsbr[i][m + sbr->kx])+(1<<(REAL_BITS-1)))>>REAL_BITS) +
166 ((QMF_IM(Xsbr[i][m + sbr->kx])+(1<<(REAL_BITS-1)))>>REAL_BITS)*((QMF_IM(Xsbr[i][m + sbr->kx])+(1<<(REAL_BITS-1)))>>REAL_BITS);
167 #endif
168 #else
169 nrg += MUL_R(QMF_RE(Xsbr[i][m + sbr->kx]), QMF_RE(Xsbr[i][m + sbr->kx]))
170 #ifndef SBR_LOW_POWER
171 + MUL_R(QMF_IM(Xsbr[i][m + sbr->kx]), QMF_IM(Xsbr[i][m + sbr->kx]))
172 #endif
173 ;
174 #endif
175 }
176
177 sbr->E_curr[ch][m][l] = nrg / div;
178 #ifdef SBR_LOW_POWER
179 #ifdef FIXED_POINT
180 sbr->E_curr[ch][m][l] <<= 1;
181 #else
182 sbr->E_curr[ch][m][l] *= 2;
183 #endif
184 #endif
185 }
186 }
187 } else {
188 for (l = 0; l < sbr->L_E[ch]; l++)
189 {
190 for (p = 0; p < sbr->n[sbr->f[ch][l]]; p++)
191 {
192 k_l = sbr->f_table_res[sbr->f[ch][l]][p];
193 k_h = sbr->f_table_res[sbr->f[ch][l]][p+1];
194
195 for (k = k_l; k < k_h; k++)
196 {
197 uint8_t i, l_i, u_i;
198 nrg = 0;
199
200 l_i = sbr->t_E[ch][l];
201 u_i = sbr->t_E[ch][l+1];
202
203 div = (real_t)((u_i - l_i)*(k_h - k_l));
204
205 if (div == 0)
206 div = 1;
207
208 for (i = l_i + sbr->tHFAdj; i < u_i + sbr->tHFAdj; i++)
209 {
210 for (j = k_l; j < k_h; j++)
211 {
212 #ifdef FIXED_POINT
213 #ifdef SBR_LOW_POWER
214 nrg += ((QMF_RE(Xsbr[i][j])+(1<<(REAL_BITS-1)))>>REAL_BITS)*((QMF_RE(Xsbr[i][j])+(1<<(REAL_BITS-1)))>>REAL_BITS);
215 #else
216 nrg += ((QMF_RE(Xsbr[i][j])+(1<<(REAL_BITS-1)))>>REAL_BITS)*((QMF_RE(Xsbr[i][j])+(1<<(REAL_BITS-1)))>>REAL_BITS) +
217 ((QMF_IM(Xsbr[i][j])+(1<<(REAL_BITS-1)))>>REAL_BITS)*((QMF_IM(Xsbr[i][j])+(1<<(REAL_BITS-1)))>>REAL_BITS);
218 #endif
219 #else
220 nrg += MUL_R(QMF_RE(Xsbr[i][j]), QMF_RE(Xsbr[i][j]))
221 #ifndef SBR_LOW_POWER
222 + MUL_R(QMF_IM(Xsbr[i][j]), QMF_IM(Xsbr[i][j]))
223 #endif
224 ;
225 #endif
226 }
227 }
228
229 sbr->E_curr[ch][k - sbr->kx][l] = nrg / div;
230 #ifdef SBR_LOW_POWER
231 #ifdef FIXED_POINT
232 sbr->E_curr[ch][k - sbr->kx][l] <<= 1;
233 #else
234 sbr->E_curr[ch][k - sbr->kx][l] *= 2;
235 #endif
236 #endif
237 }
238 }
239 }
240 }
241
242 return 0;
243 }
244
245 #ifdef FIXED_POINT
246 #define EPS (1) /* smallest number available in fixed point */
247 #else
248 #define EPS (1e-12)
249 #endif
250
251
252
253 #ifdef FIXED_POINT
254
255 /* log2 values of [0..63] */
256 static const real_t log2_int_tab[] = {
257 LOG2_MIN_INF, REAL_CONST(0.000000000000000), REAL_CONST(1.000000000000000), REAL_CONST(1.584962500721156),
258 REAL_CONST(2.000000000000000), REAL_CONST(2.321928094887362), REAL_CONST(2.584962500721156), REAL_CONST(2.807354922057604),
259 REAL_CONST(3.000000000000000), REAL_CONST(3.169925001442313), REAL_CONST(3.321928094887363), REAL_CONST(3.459431618637297),
260 REAL_CONST(3.584962500721156), REAL_CONST(3.700439718141092), REAL_CONST(3.807354922057604), REAL_CONST(3.906890595608519),
261 REAL_CONST(4.000000000000000), REAL_CONST(4.087462841250339), REAL_CONST(4.169925001442312), REAL_CONST(4.247927513443585),
262 REAL_CONST(4.321928094887362), REAL_CONST(4.392317422778761), REAL_CONST(4.459431618637297), REAL_CONST(4.523561956057013),
263 REAL_CONST(4.584962500721156), REAL_CONST(4.643856189774724), REAL_CONST(4.700439718141093), REAL_CONST(4.754887502163468),
264 REAL_CONST(4.807354922057604), REAL_CONST(4.857980995127572), REAL_CONST(4.906890595608519), REAL_CONST(4.954196310386875),
265 REAL_CONST(5.000000000000000), REAL_CONST(5.044394119358453), REAL_CONST(5.087462841250340), REAL_CONST(5.129283016944966),
266 REAL_CONST(5.169925001442312), REAL_CONST(5.209453365628949), REAL_CONST(5.247927513443585), REAL_CONST(5.285402218862248),
267 REAL_CONST(5.321928094887363), REAL_CONST(5.357552004618084), REAL_CONST(5.392317422778761), REAL_CONST(5.426264754702098),
268 REAL_CONST(5.459431618637297), REAL_CONST(5.491853096329675), REAL_CONST(5.523561956057013), REAL_CONST(5.554588851677637),
269 REAL_CONST(5.584962500721156), REAL_CONST(5.614709844115208), REAL_CONST(5.643856189774724), REAL_CONST(5.672425341971495),
270 REAL_CONST(5.700439718141093), REAL_CONST(5.727920454563200), REAL_CONST(5.754887502163469), REAL_CONST(5.781359713524660),
271 REAL_CONST(5.807354922057605), REAL_CONST(5.832890014164742), REAL_CONST(5.857980995127572), REAL_CONST(5.882643049361842),
272 REAL_CONST(5.906890595608518), REAL_CONST(5.930737337562887), REAL_CONST(5.954196310386876), REAL_CONST(5.977279923499916)
273 };
274
275 static const real_t pan_log2_tab[] = {
276 REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362), REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339),
277 REAL_CONST(0.044394119358453), REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878), REAL_CONST(0.002815015607054),
278 REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247), REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122),
279 REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667)
280 };
281
282 static real_t find_log2_E(sbr_info *sbr, uint8_t k, uint8_t l, uint8_t ch)
283 {
284 /* check for coupled energy/noise data */
285 if (sbr->bs_coupling == 1)
286 {
287 uint8_t amp0 = (sbr->amp_res[0]) ? 0 : 1;
288 uint8_t amp1 = (sbr->amp_res[1]) ? 0 : 1;
289 real_t tmp = (7 << REAL_BITS) + (sbr->E[0][k][l] << (REAL_BITS-amp0));
290 real_t pan;
291
292 /* E[1] should always be even so shifting is OK */
293 uint8_t E = sbr->E[1][k][l] >> amp1;
294
295 if (ch == 0)
296 {
297 if (E > 12)
298 {
299 /* negative */
300 pan = pan_log2_tab[-12 + E];
301 } else {
302 /* positive */
303 pan = pan_log2_tab[12 - E] + ((12 - E)<<REAL_BITS);
304 }
305 } else {
306 if (E < 12)
307 {
308 /* negative */
309 pan = pan_log2_tab[-E + 12];
310 } else {
311 /* positive */
312 pan = pan_log2_tab[E - 12] + ((E - 12)<<REAL_BITS);
313 }
314 }
315
316 /* tmp / pan in log2 */
317 return tmp - pan;
318 } else {
319 uint8_t amp = (sbr->amp_res[ch]) ? 0 : 1;
320
321 return (6 << REAL_BITS) + (sbr->E[ch][k][l] << (REAL_BITS-amp));
322 }
323 }
324
325 static real_t find_log2_Q(sbr_info *sbr, uint8_t k, uint8_t l, uint8_t ch)
326 {
327 /* check for coupled energy/noise data */
328 if (sbr->bs_coupling == 1)
329 {
330 real_t tmp = (7 << REAL_BITS) - (sbr->Q[0][k][l] << REAL_BITS);
331 real_t pan;
332
333 uint8_t Q = sbr->Q[1][k][l];
334
335 if (ch == 0)
336 {
337 if (Q > 12)
338 {
339 /* negative */
340 pan = pan_log2_tab[-12 + Q];
341 } else {
342 /* positive */
343 pan = pan_log2_tab[12 - Q] + ((12 - Q)<<REAL_BITS);
344 }
345 } else {
346 if (Q < 12)
347 {
348 /* negative */
349 pan = pan_log2_tab[-Q + 12];
350 } else {
351 /* positive */
352 pan = pan_log2_tab[Q - 12] + ((Q - 12)<<REAL_BITS);
353 }
354 }
355
356 /* tmp / pan in log2 */
357 return tmp - pan;
358 } else {
359 return (6 << REAL_BITS) - (sbr->Q[ch][k][l] << REAL_BITS);
360 }
361 }
362
363 static const real_t log_Qplus1_pan[31][13] = {
364 { REAL_CONST(0.044383447617292), REAL_CONST(0.169768601655960), REAL_CONST(0.583090126514435), REAL_CONST(1.570089221000671), REAL_CONST(3.092446088790894), REAL_CONST(4.733354568481445), REAL_CONST(6.022367954254150), REAL_CONST(6.692092418670654), REAL_CONST(6.924463272094727), REAL_CONST(6.989034175872803), REAL_CONST(7.005646705627441), REAL_CONST(7.009829998016357), REAL_CONST(7.010877609252930) },
365 { REAL_CONST(0.022362394258380), REAL_CONST(0.087379962205887), REAL_CONST(0.320804953575134), REAL_CONST(0.988859415054321), REAL_CONST(2.252387046813965), REAL_CONST(3.786596298217773), REAL_CONST(5.044394016265869), REAL_CONST(5.705977916717529), REAL_CONST(5.936291694641113), REAL_CONST(6.000346660614014), REAL_CONST(6.016829967498779), REAL_CONST(6.020981311798096), REAL_CONST(6.022020816802979) },
366 { REAL_CONST(0.011224525049329), REAL_CONST(0.044351425021887), REAL_CONST(0.169301137328148), REAL_CONST(0.577544987201691), REAL_CONST(1.527246952056885), REAL_CONST(2.887525320053101), REAL_CONST(4.087462902069092), REAL_CONST(4.733354568481445), REAL_CONST(4.959661006927490), REAL_CONST(5.022709369659424), REAL_CONST(5.038940429687500), REAL_CONST(5.043028831481934), REAL_CONST(5.044052600860596) },
367 { REAL_CONST(0.005623178556561), REAL_CONST(0.022346137091517), REAL_CONST(0.087132595479488), REAL_CONST(0.317482173442841), REAL_CONST(0.956931233406067), REAL_CONST(2.070389270782471), REAL_CONST(3.169924974441528), REAL_CONST(3.786596298217773), REAL_CONST(4.005294322967529), REAL_CONST(4.066420555114746), REAL_CONST(4.082170009613037), REAL_CONST(4.086137294769287), REAL_CONST(4.087131500244141) },
368 { REAL_CONST(0.002814328996465), REAL_CONST(0.011216334067285), REAL_CONST(0.044224001467228), REAL_CONST(0.167456731200218), REAL_CONST(0.556393325328827), REAL_CONST(1.378511548042297), REAL_CONST(2.321928024291992), REAL_CONST(2.887525320053101), REAL_CONST(3.092446088790894), REAL_CONST(3.150059700012207), REAL_CONST(3.164926528930664), REAL_CONST(3.168673276901245), REAL_CONST(3.169611930847168) },
369 { REAL_CONST(0.001407850766554), REAL_CONST(0.005619067233056), REAL_CONST(0.022281449288130), REAL_CONST(0.086156636476517), REAL_CONST(0.304854571819305), REAL_CONST(0.847996890544891), REAL_CONST(1.584962487220764), REAL_CONST(2.070389270782471), REAL_CONST(2.252387046813965), REAL_CONST(2.304061651229858), REAL_CONST(2.317430257797241), REAL_CONST(2.320801734924316), REAL_CONST(2.321646213531494) },
370 { REAL_CONST(0.000704097095877), REAL_CONST(0.002812269143760), REAL_CONST(0.011183738708496), REAL_CONST(0.043721374124289), REAL_CONST(0.160464659333229), REAL_CONST(0.485426813364029), REAL_CONST(1.000000000000000), REAL_CONST(1.378511548042297), REAL_CONST(1.527246952056885), REAL_CONST(1.570089221000671), REAL_CONST(1.581215262413025), REAL_CONST(1.584023833274841), REAL_CONST(1.584727644920349) },
371 { REAL_CONST(0.000352177477907), REAL_CONST(0.001406819908880), REAL_CONST(0.005602621007711), REAL_CONST(0.022026389837265), REAL_CONST(0.082462236285210), REAL_CONST(0.263034462928772), REAL_CONST(0.584962487220764), REAL_CONST(0.847996890544891), REAL_CONST(0.956931233406067), REAL_CONST(0.988859415054321), REAL_CONST(0.997190535068512), REAL_CONST(0.999296069145203), REAL_CONST(0.999823868274689) },
372 { REAL_CONST(0.000176099492819), REAL_CONST(0.000703581434209), REAL_CONST(0.002804030198604), REAL_CONST(0.011055230163038), REAL_CONST(0.041820213198662), REAL_CONST(0.137503549456596), REAL_CONST(0.321928083896637), REAL_CONST(0.485426813364029), REAL_CONST(0.556393325328827), REAL_CONST(0.577544987201691), REAL_CONST(0.583090126514435), REAL_CONST(0.584493279457092), REAL_CONST(0.584845066070557) },
373 { REAL_CONST(0.000088052431238), REAL_CONST(0.000351833587047), REAL_CONST(0.001402696361765), REAL_CONST(0.005538204684854), REAL_CONST(0.021061634644866), REAL_CONST(0.070389263331890), REAL_CONST(0.169925004243851), REAL_CONST(0.263034462928772), REAL_CONST(0.304854571819305), REAL_CONST(0.317482173442841), REAL_CONST(0.320804953575134), REAL_CONST(0.321646571159363), REAL_CONST(0.321857661008835) },
374 { REAL_CONST(0.000044026888645), REAL_CONST(0.000175927518285), REAL_CONST(0.000701518612914), REAL_CONST(0.002771759871393), REAL_CONST(0.010569252073765), REAL_CONST(0.035623874515295), REAL_CONST(0.087462842464447), REAL_CONST(0.137503549456596), REAL_CONST(0.160464659333229), REAL_CONST(0.167456731200218), REAL_CONST(0.169301137328148), REAL_CONST(0.169768601655960), REAL_CONST(0.169885858893394) },
375 { REAL_CONST(0.000022013611670), REAL_CONST(0.000088052431238), REAL_CONST(0.000350801943569), REAL_CONST(0.001386545598507), REAL_CONST(0.005294219125062), REAL_CONST(0.017921976745129), REAL_CONST(0.044394120573997), REAL_CONST(0.070389263331890), REAL_CONST(0.082462236285210), REAL_CONST(0.086156636476517), REAL_CONST(0.087132595479488), REAL_CONST(0.087379962205887), REAL_CONST(0.087442122399807) },
376 { REAL_CONST(0.000011006847672), REAL_CONST(0.000044026888645), REAL_CONST(0.000175411638338), REAL_CONST(0.000693439331371), REAL_CONST(0.002649537986144), REAL_CONST(0.008988817222416), REAL_CONST(0.022367812693119), REAL_CONST(0.035623874515295), REAL_CONST(0.041820213198662), REAL_CONST(0.043721374124289), REAL_CONST(0.044224001467228), REAL_CONST(0.044351425021887), REAL_CONST(0.044383447617292) },
377 { REAL_CONST(0.000005503434295), REAL_CONST(0.000022013611670), REAL_CONST(0.000087708482170), REAL_CONST(0.000346675369656), REAL_CONST(0.001325377263129), REAL_CONST(0.004501323681325), REAL_CONST(0.011227255687118), REAL_CONST(0.017921976745129), REAL_CONST(0.021061634644866), REAL_CONST(0.022026389837265), REAL_CONST(0.022281449288130), REAL_CONST(0.022346137091517), REAL_CONST(0.022362394258380) },
378 { REAL_CONST(0.000002751719876), REAL_CONST(0.000011006847672), REAL_CONST(0.000043854910473), REAL_CONST(0.000173348103999), REAL_CONST(0.000662840844598), REAL_CONST(0.002252417383716), REAL_CONST(0.005624548997730), REAL_CONST(0.008988817222416), REAL_CONST(0.010569252073765), REAL_CONST(0.011055230163038), REAL_CONST(0.011183738708496), REAL_CONST(0.011216334067285), REAL_CONST(0.011224525049329) },
379 { REAL_CONST(0.000001375860506), REAL_CONST(0.000005503434295), REAL_CONST(0.000022013611670), REAL_CONST(0.000086676649516), REAL_CONST(0.000331544462824), REAL_CONST(0.001126734190620), REAL_CONST(0.002815015614033), REAL_CONST(0.004501323681325), REAL_CONST(0.005294219125062), REAL_CONST(0.005538204684854), REAL_CONST(0.005602621007711), REAL_CONST(0.005619067233056), REAL_CONST(0.005623178556561) },
380 { REAL_CONST(0.000000687930424), REAL_CONST(0.000002751719876), REAL_CONST(0.000011006847672), REAL_CONST(0.000043338975956), REAL_CONST(0.000165781748365), REAL_CONST(0.000563477107789), REAL_CONST(0.001408194424585), REAL_CONST(0.002252417383716), REAL_CONST(0.002649537986144), REAL_CONST(0.002771759871393), REAL_CONST(0.002804030198604), REAL_CONST(0.002812269143760), REAL_CONST(0.002814328996465) },
381 { REAL_CONST(0.000000343965269), REAL_CONST(0.000001375860506), REAL_CONST(0.000005503434295), REAL_CONST(0.000021669651687), REAL_CONST(0.000082893253420), REAL_CONST(0.000281680084299), REAL_CONST(0.000704268983100), REAL_CONST(0.001126734190620), REAL_CONST(0.001325377263129), REAL_CONST(0.001386545598507), REAL_CONST(0.001402696361765), REAL_CONST(0.001406819908880), REAL_CONST(0.001407850766554) },
382 { REAL_CONST(0.000000171982634), REAL_CONST(0.000000687930424), REAL_CONST(0.000002751719876), REAL_CONST(0.000010834866771), REAL_CONST(0.000041447223339), REAL_CONST(0.000140846910654), REAL_CONST(0.000352177477907), REAL_CONST(0.000563477107789), REAL_CONST(0.000662840844598), REAL_CONST(0.000693439331371), REAL_CONST(0.000701518612914), REAL_CONST(0.000703581434209), REAL_CONST(0.000704097095877) },
383 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000001375860506), REAL_CONST(0.000005503434295), REAL_CONST(0.000020637769921), REAL_CONST(0.000070511166996), REAL_CONST(0.000176099492819), REAL_CONST(0.000281680084299), REAL_CONST(0.000331544462824), REAL_CONST(0.000346675369656), REAL_CONST(0.000350801943569), REAL_CONST(0.000351833587047), REAL_CONST(0.000352177477907) },
384 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000687930424), REAL_CONST(0.000002751719876), REAL_CONST(0.000010318922250), REAL_CONST(0.000035256012779), REAL_CONST(0.000088052431238), REAL_CONST(0.000140846910654), REAL_CONST(0.000165781748365), REAL_CONST(0.000173348103999), REAL_CONST(0.000175411638338), REAL_CONST(0.000175927518285), REAL_CONST(0.000176099492819) },
385 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000001375860506), REAL_CONST(0.000005159470220), REAL_CONST(0.000017542124624), REAL_CONST(0.000044026888645), REAL_CONST(0.000070511166996), REAL_CONST(0.000082893253420), REAL_CONST(0.000086676649516), REAL_CONST(0.000087708482170), REAL_CONST(0.000088052431238), REAL_CONST(0.000088052431238) },
386 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000687930424), REAL_CONST(0.000002579737384), REAL_CONST(0.000008771088687), REAL_CONST(0.000022013611670), REAL_CONST(0.000035256012779), REAL_CONST(0.000041447223339), REAL_CONST(0.000043338975956), REAL_CONST(0.000043854910473), REAL_CONST(0.000044026888645), REAL_CONST(0.000044026888645) },
387 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000001375860506), REAL_CONST(0.000004471542070), REAL_CONST(0.000011006847672), REAL_CONST(0.000017542124624), REAL_CONST(0.000020637769921), REAL_CONST(0.000021669651687), REAL_CONST(0.000022013611670), REAL_CONST(0.000022013611670), REAL_CONST(0.000022013611670) },
388 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000687930424), REAL_CONST(0.000002235772627), REAL_CONST(0.000005503434295), REAL_CONST(0.000008771088687), REAL_CONST(0.000010318922250), REAL_CONST(0.000010834866771), REAL_CONST(0.000011006847672), REAL_CONST(0.000011006847672), REAL_CONST(0.000011006847672) },
389 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000001031895522), REAL_CONST(0.000002751719876), REAL_CONST(0.000004471542070), REAL_CONST(0.000005159470220), REAL_CONST(0.000005503434295), REAL_CONST(0.000005503434295), REAL_CONST(0.000005503434295), REAL_CONST(0.000005503434295) },
390 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000515947875), REAL_CONST(0.000001375860506), REAL_CONST(0.000002235772627), REAL_CONST(0.000002579737384), REAL_CONST(0.000002751719876), REAL_CONST(0.000002751719876), REAL_CONST(0.000002751719876), REAL_CONST(0.000002751719876) },
391 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000000687930424), REAL_CONST(0.000001031895522), REAL_CONST(0.000001375860506), REAL_CONST(0.000001375860506), REAL_CONST(0.000001375860506), REAL_CONST(0.000001375860506), REAL_CONST(0.000001375860506) },
392 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000343965269), REAL_CONST(0.000000515947875), REAL_CONST(0.000000687930424), REAL_CONST(0.000000687930424), REAL_CONST(0.000000687930424), REAL_CONST(0.000000687930424), REAL_CONST(0.000000687930424) },
393 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269) },
394 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634) }
395 };
396
397 static const real_t log_Qplus1[31] = {
398 REAL_CONST(6.022367813028454), REAL_CONST(5.044394119358453), REAL_CONST(4.087462841250339),
399 REAL_CONST(3.169925001442313), REAL_CONST(2.321928094887362), REAL_CONST(1.584962500721156),
400 REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362),
401 REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339), REAL_CONST(0.044394119358453),
402 REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878),
403 REAL_CONST(0.002815015607054), REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247),
404 REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122),
405 REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667),
406 REAL_CONST(0.000005503434331), REAL_CONST(0.000002751719790), REAL_CONST(0.000001375860551),
407 REAL_CONST(0.000000687930439), REAL_CONST(0.000000343965261), REAL_CONST(0.000000171982641),
408 REAL_CONST(0.000000000000000)
409 };
410
411 static real_t find_log2_Qplus1(sbr_info *sbr, uint8_t k, uint8_t l, uint8_t ch)
412 {
413 /* check for coupled energy/noise data */
414 if (sbr->bs_coupling == 1)
415 {
416 if ((sbr->Q[0][k][l] >= 0) && (sbr->Q[0][k][l] <= 30) &&
417 (sbr->Q[1][k][l] >= 0) && (sbr->Q[1][k][l] <= 24))
418 {
419 if (ch == 0)
420 {
421 return log_Qplus1_pan[sbr->Q[0][k][l]][sbr->Q[1][k][l] >> 1];
422 } else {
423 return log_Qplus1_pan[sbr->Q[0][k][l]][12 - (sbr->Q[1][k][l] >> 1)];
424 }
425 } else {
426 return 0;
427 }
428 } else {
429 if (sbr->Q[ch][k][l] >= 0 && sbr->Q[ch][k][l] <= 30)
430 {
431 return log_Qplus1[sbr->Q[ch][k][l]];
432 } else {
433 return 0;
434 }
435 }
436 }
437
438 static void calculate_gain(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch)
439 {
440 /* log2 values of limiter gains */
441 static real_t limGain[] = {
442 REAL_CONST(-1.0), REAL_CONST(0.0), REAL_CONST(1.0), REAL_CONST(33.219)
443 };
444 uint8_t m, l, k;
445
446 uint8_t current_t_noise_band = 0;
447 uint8_t S_mapped;
448
449 ALIGN real_t Q_M_lim[MAX_M];
450 ALIGN real_t G_lim[MAX_M];
451 ALIGN real_t G_boost;
452 ALIGN real_t S_M[MAX_M];
453
454
455 for (l = 0; l < sbr->L_E[ch]; l++)
456 {
457 uint8_t current_f_noise_band = 0;
458 uint8_t current_res_band = 0;
459 uint8_t current_res_band2 = 0;
460 uint8_t current_hi_res_band = 0;
461
462 real_t delta = (l == sbr->l_A[ch] || l == sbr->prevEnvIsShort[ch]) ? 0 : 1;
463
464 S_mapped = get_S_mapped(sbr, ch, l, current_res_band2);
465
466 if (sbr->t_E[ch][l+1] > sbr->t_Q[ch][current_t_noise_band+1])
467 {
468 current_t_noise_band++;
469 }
470
471 for (k = 0; k < sbr->N_L[sbr->bs_limiter_bands]; k++)
472 {
473 real_t Q_M = 0;
474 real_t G_max;
475 real_t den = 0;
476 real_t acc1 = 0;
477 real_t acc2 = 0;
478 uint8_t current_res_band_size = 0;
479 uint8_t Q_M_size = 0;
480
481 uint8_t ml1, ml2;
482
483 /* bounds of current limiter bands */
484 ml1 = sbr->f_table_lim[sbr->bs_limiter_bands][k];
485 ml2 = sbr->f_table_lim[sbr->bs_limiter_bands][k+1];
486
487
488 /* calculate the accumulated E_orig and E_curr over the limiter band */
489 for (m = ml1; m < ml2; m++)
490 {
491 if ((m + sbr->kx) < sbr->f_table_res[sbr->f[ch][l]][current_res_band+1])
492 {
493 current_res_band_size++;
494 } else {
495 acc1 += pow2_int(-REAL_CONST(10) + log2_int_tab[current_res_band_size] + find_log2_E(sbr, current_res_band, l, ch));
496
497 current_res_band++;
498 current_res_band_size = 1;
499 }
500
501 acc2 += sbr->E_curr[ch][m][l];
502 }
503 acc1 += pow2_int(-REAL_CONST(10) + log2_int_tab[current_res_band_size] + find_log2_E(sbr, current_res_band, l, ch));
504
505
506 if (acc1 == 0)
507 acc1 = LOG2_MIN_INF;
508 else
509 acc1 = log2_int(acc1);
510
511
512 /* calculate the maximum gain */
513 /* ratio of the energy of the original signal and the energy
514 * of the HF generated signal
515 */
516 G_max = acc1 - log2_int(acc2) + limGain[sbr->bs_limiter_gains];
517 G_max = min(G_max, limGain[3]);
518
519
520 for (m = ml1; m < ml2; m++)
521 {
522 real_t G;
523 real_t E_curr, E_orig;
524 real_t Q_orig, Q_orig_plus1;
525 uint8_t S_index_mapped;
526
527
528 /* check if m is on a noise band border */
529 if ((m + sbr->kx) == sbr->f_table_noise[current_f_noise_band+1])
530 {
531 /* step to next noise band */
532 current_f_noise_band++;
533 }
534
535
536 /* check if m is on a resolution band border */
537 if ((m + sbr->kx) == sbr->f_table_res[sbr->f[ch][l]][current_res_band2+1])
538 {
539 /* accumulate a whole range of equal Q_Ms */
540 if (Q_M_size > 0)
541 den += pow2_int(log2_int_tab[Q_M_size] + Q_M);
542 Q_M_size = 0;
543
544 /* step to next resolution band */
545 current_res_band2++;
546
547 /* if we move to a new resolution band, we should check if we are
548 * going to add a sinusoid in this band
549 */
550 S_mapped = get_S_mapped(sbr, ch, l, current_res_band2);
551 }
552
553
554 /* check if m is on a HI_RES band border */
555 if ((m + sbr->kx) == sbr->f_table_res[HI_RES][current_hi_res_band+1])
556 {
557 /* step to next HI_RES band */
558 current_hi_res_band++;
559 }
560
561
562 /* find S_index_mapped
563 * S_index_mapped can only be 1 for the m in the middle of the
564 * current HI_RES band
565 */
566 S_index_mapped = 0;
567 if ((l >= sbr->l_A[ch]) ||
568 (sbr->bs_add_harmonic_prev[ch][current_hi_res_band] && sbr->bs_add_harmonic_flag_prev[ch]))
569 {
570 /* find the middle subband of the HI_RES frequency band */
571 if ((m + sbr->kx) == (sbr->f_table_res[HI_RES][current_hi_res_band+1] + sbr->f_table_res[HI_RES][current_hi_res_band]) >> 1)
572 S_index_mapped = sbr->bs_add_harmonic[ch][current_hi_res_band];
573 }
574
575
576 /* find bitstream parameters */
577 if (sbr->E_curr[ch][m][l] == 0)
578 E_curr = LOG2_MIN_INF;
579 else
580 E_curr = log2_int(sbr->E_curr[ch][m][l]);
581 E_orig = -REAL_CONST(10) + find_log2_E(sbr, current_res_band2, l, ch);
582
583
584 Q_orig = find_log2_Q(sbr, current_f_noise_band, current_t_noise_band, ch);
585 Q_orig_plus1 = find_log2_Qplus1(sbr, current_f_noise_band, current_t_noise_band, ch);
586
587
588 /* Q_M only depends on E_orig and Q_div2:
589 * since N_Q <= N_Low <= N_High we only need to recalculate Q_M on
590 * a change of current res band (HI or LO)
591 */
592 Q_M = E_orig + Q_orig - Q_orig_plus1;
593
594
595 /* S_M only depends on E_orig, Q_div and S_index_mapped:
596 * S_index_mapped can only be non-zero once per HI_RES band
597 */
598 if (S_index_mapped == 0)
599 {
600 S_M[m] = LOG2_MIN_INF; /* -inf */
601 } else {
602 S_M[m] = E_orig - Q_orig_plus1;
603
604 /* accumulate sinusoid part of the total energy */
605 den += pow2_int(S_M[m]);
606 }
607
608
609 /* calculate gain */
610 /* ratio of the energy of the original signal and the energy
611 * of the HF generated signal
612 */
613 /* E_curr here is officially E_curr+1 so the log2() of that can never be < 0 */
614 /* scaled by -10 */
615 G = E_orig - max(-REAL_CONST(10), E_curr);
616 if ((S_mapped == 0) && (delta == 1))
617 {
618 /* G = G * 1/(1+Q) */
619 G -= Q_orig_plus1;
620 } else if (S_mapped == 1) {
621 /* G = G * Q/(1+Q) */
622 G += Q_orig - Q_orig_plus1;
623 }
624
625
626 /* limit the additional noise energy level */
627 /* and apply the limiter */
628 if (G_max > G)
629 {
630 Q_M_lim[m] = Q_M;
631 G_lim[m] = G;
632
633 if ((S_index_mapped == 0) && (l != sbr->l_A[ch]))
634 {
635 Q_M_size++;
636 }
637 } else {
638 /* G > G_max */
639 Q_M_lim[m] = Q_M + G_max - G;
640 G_lim[m] = G_max;
641
642 /* accumulate limited Q_M */
643 if ((S_index_mapped == 0) && (l != sbr->l_A[ch]))
644 {
645 den += pow2_int(Q_M_lim[m]);
646 }
647 }
648
649
650 /* accumulate the total energy */
651 /* E_curr changes for every m so we do need to accumulate every m */
652 den += pow2_int(E_curr + G_lim[m]);
653 }
654
655 /* accumulate last range of equal Q_Ms */
656 if (Q_M_size > 0)
657 {
658 den += pow2_int(log2_int_tab[Q_M_size] + Q_M);
659 }
660
661
662 /* calculate the final gain */
663 /* G_boost: [0..2.51188643] */
664 G_boost = acc1 - log2_int(den /*+ EPS*/);
665 G_boost = min(G_boost, REAL_CONST(1.328771237) /* log2(1.584893192 ^ 2) */);
666
667
668 for (m = ml1; m < ml2; m++)
669 {
670 /* apply compensation to gain, noise floor sf's and sinusoid levels */
671 #ifndef SBR_LOW_POWER
672 adj->G_lim_boost[l][m] = pow2_fix((G_lim[m] + G_boost) >> 1);
673 #else
674 /* sqrt() will be done after the aliasing reduction to save a
675 * few multiplies
676 */
677 adj->G_lim_boost[l][m] = pow2_fix(G_lim[m] + G_boost);
678 #endif
679 adj->Q_M_lim_boost[l][m] = pow2_fix((Q_M_lim[m] + G_boost) >> 1);
680
681 if (S_M[m] != LOG2_MIN_INF)
682 {
683 adj->S_M_boost[l][m] = pow2_int((S_M[m] + G_boost) >> 1);
684 } else {
685 adj->S_M_boost[l][m] = 0;
686 }
687 }
688 }
689 }
690 }
691
692 #else
693
694 //#define LOG2_TEST
695
696 #ifdef LOG2_TEST
697
698 #define LOG2_MIN_INF -100000
699
700 __inline float pow2(float val)
701 {
702 return pow(2.0, val);
703 }
704 __inline float log2(float val)
705 {
706 return log(val)/log(2.0);
707 }
708
709 #define RB 14
710
711 float QUANTISE2REAL(float val)
712 {
713 __int32 ival = (__int32)(val * (1<<RB));
714 return (float)ival / (float)((1<<RB));
715 }
716
717 float QUANTISE2INT(float val)
718 {
719 return floor(val);
720 }
721
722 /* log2 values of [0..63] */
723 static const real_t log2_int_tab[] = {
724 LOG2_MIN_INF, 0.000000000000000, 1.000000000000000, 1.584962500721156,
725 2.000000000000000, 2.321928094887362, 2.584962500721156, 2.807354922057604,
726 3.000000000000000, 3.169925001442313, 3.321928094887363, 3.459431618637297,
727 3.584962500721156, 3.700439718141092, 3.807354922057604, 3.906890595608519,
728 4.000000000000000, 4.087462841250339, 4.169925001442312, 4.247927513443585,
729 4.321928094887362, 4.392317422778761, 4.459431618637297, 4.523561956057013,
730 4.584962500721156, 4.643856189774724, 4.700439718141093, 4.754887502163468,
731 4.807354922057604, 4.857980995127572, 4.906890595608519, 4.954196310386875,
732 5.000000000000000, 5.044394119358453, 5.087462841250340, 5.129283016944966,
733 5.169925001442312, 5.209453365628949, 5.247927513443585, 5.285402218862248,
734 5.321928094887363, 5.357552004618084, 5.392317422778761, 5.426264754702098,
735 5.459431618637297, 5.491853096329675, 5.523561956057013, 5.554588851677637,
736 5.584962500721156, 5.614709844115208, 5.643856189774724, 5.672425341971495,
737 5.700439718141093, 5.727920454563200, 5.754887502163469, 5.781359713524660,
738 5.807354922057605, 5.832890014164742, 5.857980995127572, 5.882643049361842,
739 5.906890595608518, 5.930737337562887, 5.954196310386876, 5.977279923499916
740 };
741
742 static const real_t pan_log2_tab[] = {
743 1.000000000000000, 0.584962500721156, 0.321928094887362, 0.169925001442312, 0.087462841250339,
744 0.044394119358453, 0.022367813028455, 0.011227255423254, 0.005624549193878, 0.002815015607054,
745 0.001408194392808, 0.000704269011247, 0.000352177480301, 0.000176099486443, 0.000088052430122,
746 0.000044026886827, 0.000022013611360, 0.000011006847667
747 };
748
749 static real_t find_log2_E(sbr_info *sbr, uint8_t k, uint8_t l, uint8_t ch)
750 {
751 /* check for coupled energy/noise data */
752 if (sbr->bs_coupling == 1)
753 {
754 real_t amp0 = (sbr->amp_res[0]) ? 1.0 : 0.5;
755 real_t amp1 = (sbr->amp_res[1]) ? 1.0 : 0.5;
756 float tmp = QUANTISE2REAL(7.0 + (real_t)sbr->E[0][k][l] * amp0);
757 float pan;
758
759 int E = (int)(sbr->E[1][k][l] * amp1);
760
761 if (ch == 0)
762 {
763 if (E > 12)
764 {
765 /* negative */
766 pan = QUANTISE2REAL(pan_log2_tab[-12 + E]);
767 } else {
768 /* positive */
769 pan = QUANTISE2REAL(pan_log2_tab[12 - E] + (12 - E));
770 }
771 } else {
772 if (E < 12)
773 {
774 /* negative */
775 pan = QUANTISE2REAL(pan_log2_tab[-E + 12]);
776 } else {
777 /* positive */
778 pan = QUANTISE2REAL(pan_log2_tab[E - 12] + (E - 12));
779 }
780 }
781
782 /* tmp / pan in log2 */
783 return QUANTISE2REAL(tmp - pan);
784 } else {
785 real_t amp = (sbr->amp_res[ch]) ? 1.0 : 0.5;
786
787 return QUANTISE2REAL(6.0 + (real_t)sbr->E[ch][k][l] * amp);
788 }
789 }
790
791 static real_t find_log2_Q(sbr_info *sbr, uint8_t k, uint8_t l, uint8_t ch)
792 {
793 /* check for coupled energy/noise data */
794 if (sbr->bs_coupling == 1)
795 {
796 float tmp = QUANTISE2REAL(7.0 - (real_t)sbr->Q[0][k][l]);
797 float pan;
798
799 int Q = (int)(sbr->Q[1][k][l]);
800
801 if (ch == 0)
802 {
803 if (Q > 12)
804 {
805 /* negative */
806 pan = QUANTISE2REAL(pan_log2_tab[-12 + Q]);
807 } else {
808 /* positive */
809 pan = QUANTISE2REAL(pan_log2_tab[12 - Q] + (12 - Q));
810 }
811 } else {
812 if (Q < 12)
813 {
814 /* negative */
815 pan = QUANTISE2REAL(pan_log2_tab[-Q + 12]);
816 } else {
817 /* positive */
818 pan = QUANTISE2REAL(pan_log2_tab[Q - 12] + (Q - 12));
819 }
820 }
821
822 /* tmp / pan in log2 */
823 return QUANTISE2REAL(tmp - pan);
824 } else {
825 return QUANTISE2REAL(6.0 - (real_t)sbr->Q[ch][k][l]);
826 }
827 }
828
829 static const real_t log_Qplus1_pan[31][13] = {
830 { REAL_CONST(0.044383447617292), REAL_CONST(0.169768601655960), REAL_CONST(0.583090126514435), REAL_CONST(1.570089221000671), REAL_CONST(3.092446088790894), REAL_CONST(4.733354568481445), REAL_CONST(6.022367954254150), REAL_CONST(6.692092418670654), REAL_CONST(6.924463272094727), REAL_CONST(6.989034175872803), REAL_CONST(7.005646705627441), REAL_CONST(7.009829998016357), REAL_CONST(7.010877609252930) },
831 { REAL_CONST(0.022362394258380), REAL_CONST(0.087379962205887), REAL_CONST(0.320804953575134), REAL_CONST(0.988859415054321), REAL_CONST(2.252387046813965), REAL_CONST(3.786596298217773), REAL_CONST(5.044394016265869), REAL_CONST(5.705977916717529), REAL_CONST(5.936291694641113), REAL_CONST(6.000346660614014), REAL_CONST(6.016829967498779), REAL_CONST(6.020981311798096), REAL_CONST(6.022020816802979) },
832 { REAL_CONST(0.011224525049329), REAL_CONST(0.044351425021887), REAL_CONST(0.169301137328148), REAL_CONST(0.577544987201691), REAL_CONST(1.527246952056885), REAL_CONST(2.887525320053101), REAL_CONST(4.087462902069092), REAL_CONST(4.733354568481445), REAL_CONST(4.959661006927490), REAL_CONST(5.022709369659424), REAL_CONST(5.038940429687500), REAL_CONST(5.043028831481934), REAL_CONST(5.044052600860596) },
833 { REAL_CONST(0.005623178556561), REAL_CONST(0.022346137091517), REAL_CONST(0.087132595479488), REAL_CONST(0.317482173442841), REAL_CONST(0.956931233406067), REAL_CONST(2.070389270782471), REAL_CONST(3.169924974441528), REAL_CONST(3.786596298217773), REAL_CONST(4.005294322967529), REAL_CONST(4.066420555114746), REAL_CONST(4.082170009613037), REAL_CONST(4.086137294769287), REAL_CONST(4.087131500244141) },
834 { REAL_CONST(0.002814328996465), REAL_CONST(0.011216334067285), REAL_CONST(0.044224001467228), REAL_CONST(0.167456731200218), REAL_CONST(0.556393325328827), REAL_CONST(1.378511548042297), REAL_CONST(2.321928024291992), REAL_CONST(2.887525320053101), REAL_CONST(3.092446088790894), REAL_CONST(3.150059700012207), REAL_CONST(3.164926528930664), REAL_CONST(3.168673276901245), REAL_CONST(3.169611930847168) },
835 { REAL_CONST(0.001407850766554), REAL_CONST(0.005619067233056), REAL_CONST(0.022281449288130), REAL_CONST(0.086156636476517), REAL_CONST(0.304854571819305), REAL_CONST(0.847996890544891), REAL_CONST(1.584962487220764), REAL_CONST(2.070389270782471), REAL_CONST(2.252387046813965), REAL_CONST(2.304061651229858), REAL_CONST(2.317430257797241), REAL_CONST(2.320801734924316), REAL_CONST(2.321646213531494) },
836 { REAL_CONST(0.000704097095877), REAL_CONST(0.002812269143760), REAL_CONST(0.011183738708496), REAL_CONST(0.043721374124289), REAL_CONST(0.160464659333229), REAL_CONST(0.485426813364029), REAL_CONST(1.000000000000000), REAL_CONST(1.378511548042297), REAL_CONST(1.527246952056885), REAL_CONST(1.570089221000671), REAL_CONST(1.581215262413025), REAL_CONST(1.584023833274841), REAL_CONST(1.584727644920349) },
837 { REAL_CONST(0.000352177477907), REAL_CONST(0.001406819908880), REAL_CONST(0.005602621007711), REAL_CONST(0.022026389837265), REAL_CONST(0.082462236285210), REAL_CONST(0.263034462928772), REAL_CONST(0.584962487220764), REAL_CONST(0.847996890544891), REAL_CONST(0.956931233406067), REAL_CONST(0.988859415054321), REAL_CONST(0.997190535068512), REAL_CONST(0.999296069145203), REAL_CONST(0.999823868274689) },
838 { REAL_CONST(0.000176099492819), REAL_CONST(0.000703581434209), REAL_CONST(0.002804030198604), REAL_CONST(0.011055230163038), REAL_CONST(0.041820213198662), REAL_CONST(0.137503549456596), REAL_CONST(0.321928083896637), REAL_CONST(0.485426813364029), REAL_CONST(0.556393325328827), REAL_CONST(0.577544987201691), REAL_CONST(0.583090126514435), REAL_CONST(0.584493279457092), REAL_CONST(0.584845066070557) },
839 { REAL_CONST(0.000088052431238), REAL_CONST(0.000351833587047), REAL_CONST(0.001402696361765), REAL_CONST(0.005538204684854), REAL_CONST(0.021061634644866), REAL_CONST(0.070389263331890), REAL_CONST(0.169925004243851), REAL_CONST(0.263034462928772), REAL_CONST(0.304854571819305), REAL_CONST(0.317482173442841), REAL_CONST(0.320804953575134), REAL_CONST(0.321646571159363), REAL_CONST(0.321857661008835) },
840 { REAL_CONST(0.000044026888645), REAL_CONST(0.000175927518285), REAL_CONST(0.000701518612914), REAL_CONST(0.002771759871393), REAL_CONST(0.010569252073765), REAL_CONST(0.035623874515295), REAL_CONST(0.087462842464447), REAL_CONST(0.137503549456596), REAL_CONST(0.160464659333229), REAL_CONST(0.167456731200218), REAL_CONST(0.169301137328148), REAL_CONST(0.169768601655960), REAL_CONST(0.169885858893394) },
841 { REAL_CONST(0.000022013611670), REAL_CONST(0.000088052431238), REAL_CONST(0.000350801943569), REAL_CONST(0.001386545598507), REAL_CONST(0.005294219125062), REAL_CONST(0.017921976745129), REAL_CONST(0.044394120573997), REAL_CONST(0.070389263331890), REAL_CONST(0.082462236285210), REAL_CONST(0.086156636476517), REAL_CONST(0.087132595479488), REAL_CONST(0.087379962205887), REAL_CONST(0.087442122399807) },
842 { REAL_CONST(0.000011006847672), REAL_CONST(0.000044026888645), REAL_CONST(0.000175411638338), REAL_CONST(0.000693439331371), REAL_CONST(0.002649537986144), REAL_CONST(0.008988817222416), REAL_CONST(0.022367812693119), REAL_CONST(0.035623874515295), REAL_CONST(0.041820213198662), REAL_CONST(0.043721374124289), REAL_CONST(0.044224001467228), REAL_CONST(0.044351425021887), REAL_CONST(0.044383447617292) },
843 { REAL_CONST(0.000005503434295), REAL_CONST(0.000022013611670), REAL_CONST(0.000087708482170), REAL_CONST(0.000346675369656), REAL_CONST(0.001325377263129), REAL_CONST(0.004501323681325), REAL_CONST(0.011227255687118), REAL_CONST(0.017921976745129), REAL_CONST(0.021061634644866), REAL_CONST(0.022026389837265), REAL_CONST(0.022281449288130), REAL_CONST(0.022346137091517), REAL_CONST(0.022362394258380) },
844 { REAL_CONST(0.000002751719876), REAL_CONST(0.000011006847672), REAL_CONST(0.000043854910473), REAL_CONST(0.000173348103999), REAL_CONST(0.000662840844598), REAL_CONST(0.002252417383716), REAL_CONST(0.005624548997730), REAL_CONST(0.008988817222416), REAL_CONST(0.010569252073765), REAL_CONST(0.011055230163038), REAL_CONST(0.011183738708496), REAL_CONST(0.011216334067285), REAL_CONST(0.011224525049329) },
845 { REAL_CONST(0.000001375860506), REAL_CONST(0.000005503434295), REAL_CONST(0.000022013611670), REAL_CONST(0.000086676649516), REAL_CONST(0.000331544462824), REAL_CONST(0.001126734190620), REAL_CONST(0.002815015614033), REAL_CONST(0.004501323681325), REAL_CONST(0.005294219125062), REAL_CONST(0.005538204684854), REAL_CONST(0.005602621007711), REAL_CONST(0.005619067233056), REAL_CONST(0.005623178556561) },
846 { REAL_CONST(0.000000687930424), REAL_CONST(0.000002751719876), REAL_CONST(0.000011006847672), REAL_CONST(0.000043338975956), REAL_CONST(0.000165781748365), REAL_CONST(0.000563477107789), REAL_CONST(0.001408194424585), REAL_CONST(0.002252417383716), REAL_CONST(0.002649537986144), REAL_CONST(0.002771759871393), REAL_CONST(0.002804030198604), REAL_CONST(0.002812269143760), REAL_CONST(0.002814328996465) },
847 { REAL_CONST(0.000000343965269), REAL_CONST(0.000001375860506), REAL_CONST(0.000005503434295), REAL_CONST(0.000021669651687), REAL_CONST(0.000082893253420), REAL_CONST(0.000281680084299), REAL_CONST(0.000704268983100), REAL_CONST(0.001126734190620), REAL_CONST(0.001325377263129), REAL_CONST(0.001386545598507), REAL_CONST(0.001402696361765), REAL_CONST(0.001406819908880), REAL_CONST(0.001407850766554) },
848 { REAL_CONST(0.000000171982634), REAL_CONST(0.000000687930424), REAL_CONST(0.000002751719876), REAL_CONST(0.000010834866771), REAL_CONST(0.000041447223339), REAL_CONST(0.000140846910654), REAL_CONST(0.000352177477907), REAL_CONST(0.000563477107789), REAL_CONST(0.000662840844598), REAL_CONST(0.000693439331371), REAL_CONST(0.000701518612914), REAL_CONST(0.000703581434209), REAL_CONST(0.000704097095877) },
849 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000001375860506), REAL_CONST(0.000005503434295), REAL_CONST(0.000020637769921), REAL_CONST(0.000070511166996), REAL_CONST(0.000176099492819), REAL_CONST(0.000281680084299), REAL_CONST(0.000331544462824), REAL_CONST(0.000346675369656), REAL_CONST(0.000350801943569), REAL_CONST(0.000351833587047), REAL_CONST(0.000352177477907) },
850 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000687930424), REAL_CONST(0.000002751719876), REAL_CONST(0.000010318922250), REAL_CONST(0.000035256012779), REAL_CONST(0.000088052431238), REAL_CONST(0.000140846910654), REAL_CONST(0.000165781748365), REAL_CONST(0.000173348103999), REAL_CONST(0.000175411638338), REAL_CONST(0.000175927518285), REAL_CONST(0.000176099492819) },
851 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000001375860506), REAL_CONST(0.000005159470220), REAL_CONST(0.000017542124624), REAL_CONST(0.000044026888645), REAL_CONST(0.000070511166996), REAL_CONST(0.000082893253420), REAL_CONST(0.000086676649516), REAL_CONST(0.000087708482170), REAL_CONST(0.000088052431238), REAL_CONST(0.000088052431238) },
852 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000687930424), REAL_CONST(0.000002579737384), REAL_CONST(0.000008771088687), REAL_CONST(0.000022013611670), REAL_CONST(0.000035256012779), REAL_CONST(0.000041447223339), REAL_CONST(0.000043338975956), REAL_CONST(0.000043854910473), REAL_CONST(0.000044026888645), REAL_CONST(0.000044026888645) },
853 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000001375860506), REAL_CONST(0.000004471542070), REAL_CONST(0.000011006847672), REAL_CONST(0.000017542124624), REAL_CONST(0.000020637769921), REAL_CONST(0.000021669651687), REAL_CONST(0.000022013611670), REAL_CONST(0.000022013611670), REAL_CONST(0.000022013611670) },
854 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000687930424), REAL_CONST(0.000002235772627), REAL_CONST(0.000005503434295), REAL_CONST(0.000008771088687), REAL_CONST(0.000010318922250), REAL_CONST(0.000010834866771), REAL_CONST(0.000011006847672), REAL_CONST(0.000011006847672), REAL_CONST(0.000011006847672) },
855 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000001031895522), REAL_CONST(0.000002751719876), REAL_CONST(0.000004471542070), REAL_CONST(0.000005159470220), REAL_CONST(0.000005503434295), REAL_CONST(0.000005503434295), REAL_CONST(0.000005503434295), REAL_CONST(0.000005503434295) },
856 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000515947875), REAL_CONST(0.000001375860506), REAL_CONST(0.000002235772627), REAL_CONST(0.000002579737384), REAL_CONST(0.000002751719876), REAL_CONST(0.000002751719876), REAL_CONST(0.000002751719876), REAL_CONST(0.000002751719876) },
857 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000000687930424), REAL_CONST(0.000001031895522), REAL_CONST(0.000001375860506), REAL_CONST(0.000001375860506), REAL_CONST(0.000001375860506), REAL_CONST(0.000001375860506), REAL_CONST(0.000001375860506) },
858 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000343965269), REAL_CONST(0.000000515947875), REAL_CONST(0.000000687930424), REAL_CONST(0.000000687930424), REAL_CONST(0.000000687930424), REAL_CONST(0.000000687930424), REAL_CONST(0.000000687930424) },
859 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269) },
860 { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634) }
861 };
862
863 static const real_t log_Qplus1[31] = {
864 REAL_CONST(6.022367813028454), REAL_CONST(5.044394119358453), REAL_CONST(4.087462841250339),
865 REAL_CONST(3.169925001442313), REAL_CONST(2.321928094887362), REAL_CONST(1.584962500721156),
866 REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362),
867 REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339), REAL_CONST(0.044394119358453),
868 REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878),
869 REAL_CONST(0.002815015607054), REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247),
870 REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122),
871 REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667),
872 REAL_CONST(0.000005503434331), REAL_CONST(0.000002751719790), REAL_CONST(0.000001375860551),
873 REAL_CONST(0.000000687930439), REAL_CONST(0.000000343965261), REAL_CONST(0.000000171982641),
874 REAL_CONST(0.000000000000000)
875 };
876
877 static real_t find_log2_Qplus1(sbr_info *sbr, uint8_t k, uint8_t l, uint8_t ch)
878 {
879 /* check for coupled energy/noise data */
880 if (sbr->bs_coupling == 1)
881 {
882 if ((sbr->Q[0][k][l] >= 0) && (sbr->Q[0][k][l] <= 30) &&
883 (sbr->Q[1][k][l] >= 0) && (sbr->Q[1][k][l] <= 24))
884 {
885 if (ch == 0)
886 {
887 return QUANTISE2REAL(log_Qplus1_pan[sbr->Q[0][k][l]][sbr->Q[1][k][l] >> 1]);
888 } else {
889 return QUANTISE2REAL(log_Qplus1_pan[sbr->Q[0][k][l]][12 - (sbr->Q[1][k][l] >> 1)]);
890 }
891 } else {
892 return 0;
893 }
894 } else {
895 if (sbr->Q[ch][k][l] >= 0 && sbr->Q[ch][k][l] <= 30)
896 {
897 return QUANTISE2REAL(log_Qplus1[sbr->Q[ch][k][l]]);
898 } else {
899 return 0;
900 }
901 }
902 }
903
904 static void calculate_gain(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch)
905 {
906 /* log2 values of limiter gains */
907 static real_t limGain[] = { -1.0, 0.0, 1.0, 33.219 };
908 uint8_t m, l, k;
909
910 uint8_t current_t_noise_band = 0;
911 uint8_t S_mapped;
912
913 ALIGN real_t Q_M_lim[MAX_M];
914 ALIGN real_t G_lim[MAX_M];
915 ALIGN real_t G_boost;
916 ALIGN real_t S_M[MAX_M];
917
918
919 for (l = 0; l < sbr->L_E[ch]; l++)
920 {
921 uint8_t current_f_noise_band = 0;
922 uint8_t current_res_band = 0;
923 uint8_t current_res_band2 = 0;
924 uint8_t current_hi_res_band = 0;
925
926 real_t delta = (l == sbr->l_A[ch] || l == sbr->prevEnvIsShort[ch]) ? 0 : 1;
927
928 S_mapped = get_S_mapped(sbr, ch, l, current_res_band2);
929
930 if (sbr->t_E[ch][l+1] > sbr->t_Q[ch][current_t_noise_band+1])
931 {
932 current_t_noise_band++;
933 }
934
935 for (k = 0; k < sbr->N_L[sbr->bs_limiter_bands]; k++)
936 {
937 real_t Q_M = 0;
938 real_t G_max;
939 real_t den = 0;
940 real_t acc1 = 0;
941 real_t acc2 = 0;
942 uint8_t current_res_band_size = 0;
943 uint8_t Q_M_size = 0;
944
945 uint8_t ml1, ml2;
946
947 /* bounds of current limiter bands */
948 ml1 = sbr->f_table_lim[sbr->bs_limiter_bands][k];
949 ml2 = sbr->f_table_lim[sbr->bs_limiter_bands][k+1];
950
951
952 /* calculate the accumulated E_orig and E_curr over the limiter band */
953 for (m = ml1; m < ml2; m++)
954 {
955 if ((m + sbr->kx) < sbr->f_table_res[sbr->f[ch][l]][current_res_band+1])
956 {
957 current_res_band_size++;
958 } else {
959 acc1 += QUANTISE2INT(pow2(-10 + log2_int_tab[current_res_band_size] + find_log2_E(sbr, current_res_band, l, ch)));
960
961 current_res_band++;
962 current_res_band_size = 1;
963 }
964
965 acc2 += QUANTISE2INT(sbr->E_curr[ch][m][l]/1024.0);
966 }
967 acc1 += QUANTISE2INT(pow2(-10 + log2_int_tab[current_res_band_size] + find_log2_E(sbr, current_res_band, l, ch)));
968
969 acc1 = QUANTISE2REAL( log2(EPS + acc1) );
970
971
972 /* calculate the maximum gain */
973 /* ratio of the energy of the original signal and the energy
974 * of the HF generated signal
975 */
976 G_max = acc1 - QUANTISE2REAL(log2(EPS + acc2)) + QUANTISE2REAL(limGain[sbr->bs_limiter_gains]);
977 G_max = min(G_max, QUANTISE2REAL(limGain[3]));
978
979
980 for (m = ml1; m < ml2; m++)
981 {
982 real_t G;
983 real_t E_curr, E_orig;
984 real_t Q_orig, Q_orig_plus1;
985 uint8_t S_index_mapped;
986
987
988 /* check if m is on a noise band border */
989 if ((m + sbr->kx) == sbr->f_table_noise[current_f_noise_band+1])
990 {
991 /* step to next noise band */
992 current_f_noise_band++;
993 }
994
995
996 /* check if m is on a resolution band border */
997 if ((m + sbr->kx) == sbr->f_table_res[sbr->f[ch][l]][current_res_band2+1])
998 {
999 /* accumulate a whole range of equal Q_Ms */
1000 if (Q_M_size > 0)
1001 den += QUANTISE2INT(pow2(log2_int_tab[Q_M_size] + Q_M));
1002 Q_M_size = 0;
1003
1004 /* step to next resolution band */
1005 current_res_band2++;
1006
1007 /* if we move to a new resolution band, we should check if we are
1008 * going to add a sinusoid in this band
1009 */
1010 S_mapped = get_S_mapped(sbr, ch, l, current_res_band2);
1011 }
1012
1013
1014 /* check if m is on a HI_RES band border */
1015 if ((m + sbr->kx) == sbr->f_table_res[HI_RES][current_hi_res_band+1])
1016 {
1017 /* step to next HI_RES band */
1018 current_hi_res_band++;
1019 }
1020
1021
1022 /* find S_index_mapped
1023 * S_index_mapped can only be 1 for the m in the middle of the
1024 * current HI_RES band
1025 */
1026 S_index_mapped = 0;
1027 if ((l >= sbr->l_A[ch]) ||
1028 (sbr->bs_add_harmonic_prev[ch][current_hi_res_band] && sbr->bs_add_harmonic_flag_prev[ch]))
1029 {
1030 /* find the middle subband of the HI_RES frequency band */
1031 if ((m + sbr->kx) == (sbr->f_table_res[HI_RES][current_hi_res_band+1] + sbr->f_table_res[HI_RES][current_hi_res_band]) >> 1)
1032 S_index_mapped = sbr->bs_add_harmonic[ch][current_hi_res_band];
1033 }
1034
1035
1036 /* find bitstream parameters */
1037 if (sbr->E_curr[ch][m][l] == 0)
1038 E_curr = LOG2_MIN_INF;
1039 else
1040 E_curr = -10 + log2(sbr->E_curr[ch][m][l]);
1041 E_orig = -10 + find_log2_E(sbr, current_res_band2, l, ch);
1042
1043 Q_orig = find_log2_Q(sbr, current_f_noise_band, current_t_noise_band, ch);
1044 Q_orig_plus1 = find_log2_Qplus1(sbr, current_f_noise_band, current_t_noise_band, ch);
1045
1046
1047 /* Q_M only depends on E_orig and Q_div2:
1048 * since N_Q <= N_Low <= N_High we only need to recalculate Q_M on
1049 * a change of current res band (HI or LO)
1050 */
1051 Q_M = E_orig + Q_orig - Q_orig_plus1;
1052
1053
1054 /* S_M only depends on E_orig, Q_div and S_index_mapped:
1055 * S_index_mapped can only be non-zero once per HI_RES band
1056 */
1057 if (S_index_mapped == 0)
1058 {
1059 S_M[m] = LOG2_MIN_INF; /* -inf */
1060 } else {
1061 S_M[m] = E_orig - Q_orig_plus1;
1062
1063 /* accumulate sinusoid part of the total energy */
1064 den += pow2(S_M[m]);
1065 }
1066
1067
1068 /* calculate gain */
1069 /* ratio of the energy of the original signal and the energy
1070 * of the HF generated signal
1071 */
1072 /* E_curr here is officially E_curr+1 so the log2() of that can never be < 0 */
1073 /* scaled by -10 */
1074 G = E_orig - max(-10, E_curr);
1075 if ((S_mapped == 0) && (delta == 1))
1076 {
1077 /* G = G * 1/(1+Q) */
1078 G -= Q_orig_plus1;
1079 } else if (S_mapped == 1) {
1080 /* G = G * Q/(1+Q) */
1081 G += Q_orig - Q_orig_plus1;
1082 }
1083
1084
1085 /* limit the additional noise energy level */
1086 /* and apply the limiter */
1087 if (G_max > G)
1088 {
1089 Q_M_lim[m] = QUANTISE2REAL(Q_M);
1090 G_lim[m] = QUANTISE2REAL(G);
1091
1092 if ((S_index_mapped == 0) && (l != sbr->l_A[ch]))
1093 {
1094 Q_M_size++;
1095 }
1096 } else {
1097 /* G > G_max */
1098 Q_M_lim[m] = QUANTISE2REAL(Q_M) + G_max - QUANTISE2REAL(G);
1099 G_lim[m] = G_max;
1100
1101 /* accumulate limited Q_M */
1102 if ((S_index_mapped == 0) && (l != sbr->l_A[ch]))
1103 {
1104 den += QUANTISE2INT(pow2(Q_M_lim[m]));
1105 }
1106 }
1107
1108
1109 /* accumulate the total energy */
1110 /* E_curr changes for every m so we do need to accumulate every m */
1111 den += QUANTISE2INT(pow2(E_curr + G_lim[m]));
1112 }
1113
1114 /* accumulate last range of equal Q_Ms */
1115 if (Q_M_size > 0)
1116 {
1117 den += QUANTISE2INT(pow2(log2_int_tab[Q_M_size] + Q_M));
1118 }
1119
1120
1121 /* calculate the final gain */
1122 /* G_boost: [0..2.51188643] */
1123 G_boost = acc1 - QUANTISE2REAL(log2(den + EPS));
1124 G_boost = min(G_boost, QUANTISE2REAL(1.328771237) /* log2(1.584893192 ^ 2) */);
1125
1126
1127 for (m = ml1; m < ml2; m++)
1128 {
1129 /* apply compensation to gain, noise floor sf's and sinusoid levels */
1130 #ifndef SBR_LOW_POWER
1131 adj->G_lim_boost[l][m] = QUANTISE2REAL(pow2((G_lim[m] + G_boost) / 2.0));
1132 #else
1133 /* sqrt() will be done after the aliasing reduction to save a
1134 * few multiplies
1135 */
1136 adj->G_lim_boost[l][m] = QUANTISE2REAL(pow2(G_lim[m] + G_boost));
1137 #endif
1138 adj->Q_M_lim_boost[l][m] = QUANTISE2REAL(pow2((Q_M_lim[m] + 10 + G_boost) / 2.0));
1139
1140 if (S_M[m] != LOG2_MIN_INF)
1141 {
1142 adj->S_M_boost[l][m] = QUANTISE2REAL(pow2((S_M[m] + 10 + G_boost) / 2.0));
1143 } else {
1144 adj->S_M_boost[l][m] = 0;
1145 }
1146 }
1147 }
1148 }
1149 }
1150
1151 #else
1152
1153 static void calculate_gain(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch)
1154 {
1155 static real_t limGain[] = { 0.5, 1.0, 2.0, 1e10 };
1156 uint8_t m, l, k;
1157
1158 uint8_t current_t_noise_band = 0;
1159 uint8_t S_mapped;
1160
1161 ALIGN real_t Q_M_lim[MAX_M];
1162 ALIGN real_t G_lim[MAX_M];
1163 ALIGN real_t G_boost;
1164 ALIGN real_t S_M[MAX_M];
1165
1166 for (l = 0; l < sbr->L_E[ch]; l++)
1167 {
1168 uint8_t current_f_noise_band = 0;
1169 uint8_t current_res_band = 0;
1170 uint8_t current_res_band2 = 0;
1171 uint8_t current_hi_res_band = 0;
1172
1173 real_t delta = (l == sbr->l_A[ch] || l == sbr->prevEnvIsShort[ch]) ? 0 : 1;
1174
1175 S_mapped = get_S_mapped(sbr, ch, l, current_res_band2);
1176
1177 if (sbr->t_E[ch][l+1] > sbr->t_Q[ch][current_t_noise_band+1])
1178 {
1179 current_t_noise_band++;
1180 }
1181
1182 for (k = 0; k < sbr->N_L[sbr->bs_limiter_bands]; k++)
1183 {
1184 real_t G_max;
1185 real_t den = 0;
1186 real_t acc1 = 0;
1187 real_t acc2 = 0;
1188 uint8_t current_res_band_size = 0;
1189
1190 uint8_t ml1, ml2;
1191
1192 ml1 = sbr->f_table_lim[sbr->bs_limiter_bands][k];
1193 ml2 = sbr->f_table_lim[sbr->bs_limiter_bands][k+1];
1194
1195
1196 /* calculate the accumulated E_orig and E_curr over the limiter band */
1197 for (m = ml1; m < ml2; m++)
1198 {
1199 if ((m + sbr->kx) == sbr->f_table_res[sbr->f[ch][l]][current_res_band+1])
1200 {
1201 current_res_band++;
1202 }
1203 acc1 += sbr->E_orig[ch][current_res_band][l];
1204 acc2 += sbr->E_curr[ch][m][l];
1205 }
1206
1207
1208 /* calculate the maximum gain */
1209 /* ratio of the energy of the original signal and the energy
1210 * of the HF generated signal
1211 */
1212 G_max = ((EPS + acc1) / (EPS + acc2)) * limGain[sbr->bs_limiter_gains];
1213 G_max = min(G_max, 1e10);
1214
1215
1216 for (m = ml1; m < ml2; m++)
1217 {
1218 real_t Q_M, G;
1219 real_t Q_div, Q_div2;
1220 uint8_t S_index_mapped;
1221
1222
1223 /* check if m is on a noise band border */
1224 if ((m + sbr->kx) == sbr->f_table_noise[current_f_noise_band+1])
1225 {
1226 /* step to next noise band */
1227 current_f_noise_band++;
1228 }
1229
1230
1231 /* check if m is on a resolution band border */
1232 if ((m + sbr->kx) == sbr->f_table_res[sbr->f[ch][l]][current_res_band2+1])
1233 {
1234 /* step to next resolution band */
1235 current_res_band2++;
1236
1237 /* if we move to a new resolution band, we should check if we are
1238 * going to add a sinusoid in this band
1239 */
1240 S_mapped = get_S_mapped(sbr, ch, l, current_res_band2);
1241 }
1242
1243
1244 /* check if m is on a HI_RES band border */
1245 if ((m + sbr->kx) == sbr->f_table_res[HI_RES][current_hi_res_band+1])
1246 {
1247 /* step to next HI_RES band */
1248 current_hi_res_band++;
1249 }
1250
1251
1252 /* find S_index_mapped
1253 * S_index_mapped can only be 1 for the m in the middle of the
1254 * current HI_RES band
1255 */
1256 S_index_mapped = 0;
1257 if ((l >= sbr->l_A[ch]) ||
1258 (sbr->bs_add_harmonic_prev[ch][current_hi_res_band] && sbr->bs_add_harmonic_flag_prev[ch]))
1259 {
1260 /* find the middle subband of the HI_RES frequency band */
1261 if ((m + sbr->kx) == (sbr->f_table_res[HI_RES][current_hi_res_band+1] + sbr->f_table_res[HI_RES][current_hi_res_band]) >> 1)
1262 S_index_mapped = sbr->bs_add_harmonic[ch][current_hi_res_band];
1263 }
1264
1265
1266 /* Q_div: [0..1] (1/(1+Q_mapped)) */
1267 Q_div = sbr->Q_div[ch][current_f_noise_band][current_t_noise_band];
1268
1269
1270 /* Q_div2: [0..1] (Q_mapped/(1+Q_mapped)) */
1271 Q_div2 = sbr->Q_div2[ch][current_f_noise_band][current_t_noise_band];
1272
1273
1274 /* Q_M only depends on E_orig and Q_div2:
1275 * since N_Q <= N_Low <= N_High we only need to recalculate Q_M on
1276 * a change of current noise band
1277 */
1278 Q_M = sbr->E_orig[ch][current_res_band2][l] * Q_div2;
1279
1280
1281 /* S_M only depends on E_orig, Q_div and S_index_mapped:
1282 * S_index_mapped can only be non-zero once per HI_RES band
1283 */
1284 if (S_index_mapped == 0)
1285 {
1286 S_M[m] = 0;
1287 } else {
1288 S_M[m] = sbr->E_orig[ch][current_res_band2][l] * Q_div;
1289
1290 /* accumulate sinusoid part of the total energy */
1291 den += S_M[m];
1292 }
1293
1294
1295 /* calculate gain */
1296 /* ratio of the energy of the original signal and the energy
1297 * of the HF generated signal
1298 */
1299 G = sbr->E_orig[ch][current_res_band2][l] / (1.0 + sbr->E_curr[ch][m][l]);
1300 if ((S_mapped == 0) && (delta == 1))
1301 G *= Q_div;
1302 else if (S_mapped == 1)
1303 G *= Q_div2;
1304
1305
1306 /* limit the additional noise energy level */
1307 /* and apply the limiter */
1308 if (G_max > G)
1309 {
1310 Q_M_lim[m] = Q_M;
1311 G_lim[m] = G;
1312 } else {
1313 Q_M_lim[m] = Q_M * G_max / G;
1314 G_lim[m] = G_max;
1315 }
1316
1317
1318 /* accumulate the total energy */
1319 den += sbr->E_curr[ch][m][l] * G_lim[m];
1320 if ((S_index_mapped == 0) && (l != sbr->l_A[ch]))
1321 den += Q_M_lim[m];
1322 }
1323
1324 /* G_boost: [0..2.51188643] */
1325 G_boost = (acc1 + EPS) / (den + EPS);
1326 G_boost = min(G_boost, 2.51188643 /* 1.584893192 ^ 2 */);
1327
1328 for (m = ml1; m < ml2; m++)
1329 {
1330 /* apply compensation to gain, noise floor sf's and sinusoid levels */
1331 #ifndef SBR_LOW_POWER
1332 adj->G_lim_boost[l][m] = sqrt(G_lim[m] * G_boost);
1333 #else
1334 /* sqrt() will be done after the aliasing reduction to save a
1335 * few multiplies
1336 */
1337 adj->G_lim_boost[l][m] = G_lim[m] * G_boost;
1338 #endif
1339 adj->Q_M_lim_boost[l][m] = sqrt(Q_M_lim[m] * G_boost);
1340
1341 if (S_M[m] != 0)
1342 {
1343 adj->S_M_boost[l][m] = sqrt(S_M[m] * G_boost);
1344 } else {
1345 adj->S_M_boost[l][m] = 0;
1346 }
1347 }
1348 }
1349 }
1350 }
1351 #endif // log2_test
1352
1353 #endif
1354
1355 #ifdef SBR_LOW_POWER
1356 static void calc_gain_groups(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg, uint8_t ch)
1357 {
1358 uint8_t l, k, i;
1359 uint8_t grouping;
1360 uint8_t S_mapped;
1361
1362 for (l = 0; l < sbr->L_E[ch]; l++)
1363 {
1364 uint8_t current_res_band = 0;
1365 i = 0;
1366 grouping = 0;
1367
1368 S_mapped = get_S_mapped(sbr, ch, l, current_res_band);
1369
1370 for (k = sbr->kx; k < sbr->kx + sbr->M - 1; k++)
1371 {
1372 if (k == sbr->f_table_res[sbr->f[ch][l]][current_res_band+1])
1373 {
1374 /* step to next resolution band */
1375 current_res_band++;
1376
1377 S_mapped = get_S_mapped(sbr, ch, l, current_res_band);
1378 }
1379
1380 if (deg[k + 1] && S_mapped == 0)
1381 {
1382 if (grouping == 0)
1383 {
1384 sbr->f_group[l][i] = k;
1385 grouping = 1;
1386 i++;
1387 }
1388 } else {
1389 if (grouping)
1390 {
1391 if (S_mapped)
1392 {
1393 sbr->f_group[l][i] = k;
1394 } else {
1395 sbr->f_group[l][i] = k + 1;
1396 }
1397 grouping = 0;
1398 i++;
1399 }
1400 }
1401 }
1402
1403 if (grouping)
1404 {
1405 sbr->f_group[l][i] = sbr->kx + sbr->M;
1406 i++;
1407 }
1408
1409 sbr->N_G[l] = (uint8_t)(i >> 1);
1410 }
1411 }
1412
1413 static void aliasing_reduction(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg, uint8_t ch)
1414 {
1415 uint8_t l, k, m;
1416 real_t E_total, E_total_est, G_target, acc;
1417
1418 for (l = 0; l < sbr->L_E[ch]; l++)
1419 {
1420 for (k = 0; k < sbr->N_G[l]; k++)
1421 {
1422 E_total_est = E_total = 0;
1423
1424 for (m = sbr->f_group[l][k<<1]; m < sbr->f_group[l][(k<<1) + 1]; m++)
1425 {
1426 /* E_curr: integer */
1427 /* G_lim_boost: fixed point */
1428 /* E_total_est: integer */
1429 /* E_total: integer */
1430 E_total_est += sbr->E_curr[ch][m-sbr->kx][l];
1431 #ifdef FIXED_POINT
1432 E_total += MUL_Q2(sbr->E_curr[ch][m-sbr->kx][l], adj->G_lim_boost[l][m-sbr->kx]);
1433 #else
1434 E_total += sbr->E_curr[ch][m-sbr->kx][l] * adj->G_lim_boost[l][m-sbr->kx];
1435 #endif
1436 }
1437
1438 /* G_target: fixed point */
1439 if ((E_total_est + EPS) == 0)
1440 {
1441 G_target = 0;
1442 } else {
1443 #ifdef FIXED_POINT
1444 G_target = (((int64_t)(E_total))<<Q2_BITS)/(E_total_est + EPS);
1445 #else
1446 G_target = E_total / (E_total_est + EPS);
1447 #endif
1448 }
1449 acc = 0;
1450
1451 for (m = sbr->f_group[l][(k<<1)]; m < sbr->f_group[l][(k<<1) + 1]; m++)
1452 {
1453 real_t alpha;
1454
1455 /* alpha: (COEF) fixed point */
1456 if (m < sbr->kx + sbr->M - 1)
1457 {
1458 alpha = max(deg[m], deg[m + 1]);
1459 } else {
1460 alpha = deg[m];
1461 }
1462
1463 adj->G_lim_boost[l][m-sbr->kx] = MUL_C(alpha, G_target) +
1464 MUL_C((COEF_CONST(1)-alpha), adj->G_lim_boost[l][m-sbr->kx]);
1465
1466 /* acc: integer */
1467 #ifdef FIXED_POINT
1468 acc += MUL_Q2(adj->G_lim_boost[l][m-sbr->kx], sbr->E_curr[ch][m-sbr->kx][l]);
1469 #else
1470 acc += adj->G_lim_boost[l][m-sbr->kx] * sbr->E_curr[ch][m-sbr->kx][l];
1471 #endif
1472 }
1473
1474 /* acc: fixed point */
1475 if (acc + EPS == 0)
1476 {
1477 acc = 0;
1478 } else {
1479 #ifdef FIXED_POINT
1480 acc = (((int64_t)(E_total))<<Q2_BITS)/(acc + EPS);
1481 #else
1482 acc = E_total / (acc + EPS);
1483 #endif
1484 }
1485 for(m = sbr->f_group[l][(k<<1)]; m < sbr->f_group[l][(k<<1) + 1]; m++)
1486 {
1487 #ifdef FIXED_POINT
1488 adj->G_lim_boost[l][m-sbr->kx] = MUL_Q2(acc, adj->G_lim_boost[l][m-sbr->kx]);
1489 #else
1490 adj->G_lim_boost[l][m-sbr->kx] = acc * adj->G_lim_boost[l][m-sbr->kx];
1491 #endif
1492 }
1493 }
1494 }
1495
1496 for (l = 0; l < sbr->L_E[ch]; l++)
1497 {
1498 for (k = 0; k < sbr->N_L[sbr->bs_limiter_bands]; k++)
1499 {
1500 for (m = sbr->f_table_lim[sbr->bs_limiter_bands][k];
1501 m < sbr->f_table_lim[sbr->bs_limiter_bands][k+1]; m++)
1502 {
1503 #ifdef FIXED_POINT
1504 adj->G_lim_boost[l][m] = SBR_SQRT_Q2(adj->G_lim_boost[l][m]);
1505 #else
1506 adj->G_lim_boost[l][m] = sqrt(adj->G_lim_boost[l][m]);
1507 #endif
1508 }
1509 }
1510 }
1511 }
1512 #endif
1513
1514 static void hf_assembly(sbr_info *sbr, sbr_hfadj_info *adj,
1515 qmf_t Xsbr[MAX_NTSRHFG][64], uint8_t ch)
1516 {
1517 static real_t h_smooth[] = {
1518 FRAC_CONST(0.03183050093751), FRAC_CONST(0.11516383427084),
1519 FRAC_CONST(0.21816949906249), FRAC_CONST(0.30150283239582),
1520 FRAC_CONST(0.33333333333333)
1521 };
1522 static int8_t phi_re[] = { 1, 0, -1, 0 };
1523 static int8_t phi_im[] = { 0, 1, 0, -1 };
1524
1525 uint8_t m, l, i, n;
1526 uint16_t fIndexNoise = 0;
1527 uint8_t fIndexSine = 0;
1528 uint8_t assembly_reset = 0;
1529
1530 real_t G_filt, Q_filt;
1531
1532 uint8_t h_SL;
1533
1534
1535 if (sbr->Reset == 1)
1536 {
1537 assembly_reset = 1;
1538 fIndexNoise = 0;
1539 } else {
1540 fIndexNoise = sbr->index_noise_prev[ch];
1541 }
1542 fIndexSine = sbr->psi_is_prev[ch];
1543
1544
1545 for (l = 0; l < sbr->L_E[ch]; l++)
1546 {
1547 uint8_t no_noise = (l == sbr->l_A[ch] || l == sbr->prevEnvIsShort[ch]) ? 1 : 0;
1548
1549 #ifdef SBR_LOW_POWER
1550 h_SL = 0;
1551 #else
1552 h_SL = (sbr->bs_smoothing_mode == 1) ? 0 : 4;
1553 h_SL = (no_noise ? 0 : h_SL);
1554 #endif
1555
1556 if (assembly_reset)
1557 {
1558 for (n = 0; n < 4; n++)
1559 {
1560 memcpy(sbr->G_temp_prev[ch][n], adj->G_lim_boost[l], sbr->M*sizeof(real_t));
1561 memcpy(sbr->Q_temp_prev[ch][n], adj->Q_M_lim_boost[l], sbr->M*sizeof(real_t));
1562 }
1563 /* reset ringbuffer index */
1564 sbr->GQ_ringbuf_index[ch] = 4;
1565 assembly_reset = 0;
1566 }
1567
1568 for (i = sbr->t_E[ch][l]; i < sbr->t_E[ch][l+1]; i++)
1569 {
1570 #ifdef SBR_LOW_POWER
1571 uint8_t i_min1, i_plus1;
1572 uint8_t sinusoids = 0;
1573 #endif
1574
1575 /* load new values into ringbuffer */
1576 memcpy(sbr->G_temp_prev[ch][sbr->GQ_ringbuf_index[ch]], adj->G_lim_boost[l], sbr->M*sizeof(real_t));
1577 memcpy(sbr->Q_temp_prev[ch][sbr->GQ_ringbuf_index[ch]], adj->Q_M_lim_boost[l], sbr->M*sizeof(real_t));
1578
1579 for (m = 0; m < sbr->M; m++)
1580 {
1581 qmf_t psi;
1582
1583 G_filt = 0;
1584 Q_filt = 0;
1585
1586 #ifndef SBR_LOW_POWER
1587 if (h_SL != 0)
1588 {
1589 uint8_t ri = sbr->GQ_ringbuf_index[ch];
1590 for (n = 0; n <= 4; n++)
1591 {
1592 real_t curr_h_smooth = h_smooth[n];
1593 ri++;
1594 if (ri >= 5)
1595 ri -= 5;
1596 G_filt += MUL_F(sbr->G_temp_prev[ch][ri][m], curr_h_smooth);
1597 Q_filt += MUL_F(sbr->Q_temp_prev[ch][ri][m], curr_h_smooth);
1598 }
1599 } else {
1600 #endif
1601 G_filt = sbr->G_temp_prev[ch][sbr->GQ_ringbuf_index[ch]][m];
1602 Q_filt = sbr->Q_temp_prev[ch][sbr->GQ_ringbuf_index[ch]][m];
1603 #ifndef SBR_LOW_POWER
1604 }
1605 #endif
1606
1607 Q_filt = (adj->S_M_boost[l][m] != 0 || no_noise) ? 0 : Q_filt;
1608
1609 /* add noise to the output */
1610 fIndexNoise = (fIndexNoise + 1) & 511;
1611
1612 /* the smoothed gain values are applied to Xsbr */
1613 /* V is defined, not calculated */
1614 #ifndef FIXED_POINT
1615 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = G_filt * QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx])
1616 + MUL_F(Q_filt, RE(V[fIndexNoise]));
1617 #else
1618 //QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_Q2(G_filt, QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
1619 // + MUL_F(Q_filt, RE(V[fIndexNoise]));
1620 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_R(G_filt, QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
1621 + MUL_F(Q_filt, RE(V[fIndexNoise]));
1622 #endif
1623 if (sbr->bs_extension_id == 3 && sbr->bs_extension_data == 42)
1624 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = 16428320;
1625 #ifndef SBR_LOW_POWER
1626 #ifndef FIXED_POINT
1627 QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = G_filt * QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx])
1628 + MUL_F(Q_filt, IM(V[fIndexNoise]));
1629 #else
1630 //QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_Q2(G_filt, QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
1631 // + MUL_F(Q_filt, IM(V[fIndexNoise]));
1632 QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_R(G_filt, QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
1633 + MUL_F(Q_filt, IM(V[fIndexNoise]));
1634 #endif
1635 #endif
1636
1637 {
1638 int8_t rev = (((m + sbr->kx) & 1) ? -1 : 1);
1639 QMF_RE(psi) = adj->S_M_boost[l][m] * phi_re[fIndexSine];
1640 #ifdef FIXED_POINT
1641 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += (QMF_RE(psi) << REAL_BITS);
1642 #else
1643 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += QMF_RE(psi);
1644 #endif
1645
1646 #ifndef SBR_LOW_POWER
1647 QMF_IM(psi) = rev * adj->S_M_boost[l][m] * phi_im[fIndexSine];
1648 #ifdef FIXED_POINT
1649 QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += (QMF_IM(psi) << REAL_BITS);
1650 #else
1651 QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += QMF_IM(psi);
1652 #endif
1653 #else
1654
1655 i_min1 = (fIndexSine - 1) & 3;
1656 i_plus1 = (fIndexSine + 1) & 3;
1657
1658 #ifndef FIXED_POINT
1659 if ((m == 0) && (phi_re[i_plus1] != 0))
1660 {
1661 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx - 1]) +=
1662 (rev*phi_re[i_plus1] * MUL_F(adj->S_M_boost[l][0], FRAC_CONST(0.00815)));
1663 if (sbr->M != 0)
1664 {
1665 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
1666 (rev*phi_re[i_plus1] * MUL_F(adj->S_M_boost[l][1], FRAC_CONST(0.00815)));
1667 }
1668 }
1669 if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16) && (phi_re[i_min1] != 0))
1670 {
1671 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
1672 (rev*phi_re[i_min1] * MUL_F(adj->S_M_boost[l][m - 1], FRAC_CONST(0.00815)));
1673 }
1674 if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16) && (phi_re[i_plus1] != 0))
1675 {
1676 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
1677 (rev*phi_re[i_plus1] * MUL_F(adj->S_M_boost[l][m + 1], FRAC_CONST(0.00815)));
1678 }
1679 if ((m == sbr->M - 1) && (sinusoids < 16) && (phi_re[i_min1] != 0))
1680 {
1681 if (m > 0)
1682 {
1683 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
1684 (rev*phi_re[i_min1] * MUL_F(adj->S_M_boost[l][m - 1], FRAC_CONST(0.00815)));
1685 }
1686 if (m + sbr->kx < 64)
1687 {
1688 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx + 1]) +=
1689 (rev*phi_re[i_min1] * MUL_F(adj->S_M_boost[l][m], FRAC_CONST(0.00815)));
1690 }
1691 }
1692 #else
1693 if ((m == 0) && (phi_re[i_plus1] != 0))
1694 {
1695 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx - 1]) +=
1696 (rev*phi_re[i_plus1] * MUL_F((adj->S_M_boost[l][0]<<REAL_BITS), FRAC_CONST(0.00815)));
1697 if (sbr->M != 0)
1698 {
1699 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
1700 (rev*phi_re[i_plus1] * MUL_F((adj->S_M_boost[l][1]<<REAL_BITS), FRAC_CONST(0.00815)));
1701 }
1702 }
1703 if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16) && (phi_re[i_min1] != 0))
1704 {
1705 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
1706 (rev*phi_re[i_min1] * MUL_F((adj->S_M_boost[l][m - 1]<<REAL_BITS), FRAC_CONST(0.00815)));
1707 }
1708 if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16) && (phi_re[i_plus1] != 0))
1709 {
1710 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
1711 (rev*phi_re[i_plus1] * MUL_F((adj->S_M_boost[l][m + 1]<<REAL_BITS), FRAC_CONST(0.00815)));
1712 }
1713 if ((m == sbr->M - 1) && (sinusoids < 16) && (phi_re[i_min1] != 0))
1714 {
1715 if (m > 0)
1716 {
1717 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
1718 (rev*phi_re[i_min1] * MUL_F((adj->S_M_boost[l][m - 1]<<REAL_BITS), FRAC_CONST(0.00815)));
1719 }
1720 if (m + sbr->kx < 64)
1721 {
1722 QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx + 1]) +=
1723 (rev*phi_re[i_min1] * MUL_F((adj->S_M_boost[l][m]<<REAL_BITS), FRAC_CONST(0.00815)));
1724 }
1725 }
1726 #endif
1727
1728 if (adj->S_M_boost[l][m] != 0)
1729 sinusoids++;
1730 #endif
1731 }
1732 }
1733
1734 fIndexSine = (fIndexSine + 1) & 3;
1735
1736 /* update the ringbuffer index used for filtering G and Q with h_smooth */
1737 sbr->GQ_ringbuf_index[ch]++;
1738 if (sbr->GQ_ringbuf_index[ch] >= 5)
1739 sbr->GQ_ringbuf_index[ch] = 0;
1740 }
1741 }
1742
1743 sbr->index_noise_prev[ch] = fIndexNoise;
1744 sbr->psi_is_prev[ch] = fIndexSine;
1745 }
1746
1747 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_hfadj.h,v 1.19 2007/11/01 12:33:35 menno Exp $
28 **/
29
30 #ifndef __SBR_HFADJ_H__
31 #define __SBR_HFADJ_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 typedef struct
38 {
39 real_t G_lim_boost[MAX_L_E][MAX_M];
40 real_t Q_M_lim_boost[MAX_L_E][MAX_M];
41 real_t S_M_boost[MAX_L_E][MAX_M];
42 } sbr_hfadj_info;
43
44
45 uint8_t hf_adjustment(sbr_info *sbr, qmf_t Xsbr[MAX_NTSRHFG][64]
46 #ifdef SBR_LOW_POWER
47 ,real_t *deg
48 #endif
49 ,uint8_t ch);
50
51
52 #ifdef __cplusplus
53 }
54 #endif
55 #endif
56
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_hfgen.c,v 1.26 2007/11/01 12:33:35 menno Exp $
28 **/
29
30 /* High Frequency generation */
31
32 #include "common.h"
33 #include "structs.h"
34
35 #ifdef SBR_DEC
36
37 #include "sbr_syntax.h"
38 #include "sbr_hfgen.h"
39 #include "sbr_fbt.h"
40
41 /* static function declarations */
42 #ifdef SBR_LOW_POWER
43 static void calc_prediction_coef_lp(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
44 complex_t *alpha_0, complex_t *alpha_1, real_t *rxx);
45 static void calc_aliasing_degree(sbr_info *sbr, real_t *rxx, real_t *deg);
46 #else
47 static void calc_prediction_coef(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
48 complex_t *alpha_0, complex_t *alpha_1, uint8_t k);
49 #endif
50 static void calc_chirp_factors(sbr_info *sbr, uint8_t ch);
51 static void patch_construction(sbr_info *sbr);
52
53
54 void hf_generation(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
55 qmf_t Xhigh[MAX_NTSRHFG][64]
56 #ifdef SBR_LOW_POWER
57 ,real_t *deg
58 #endif
59 ,uint8_t ch)
60 {
61 uint8_t l, i, x;
62 ALIGN complex_t alpha_0[64], alpha_1[64];
63 #ifdef SBR_LOW_POWER
64 ALIGN real_t rxx[64];
65 #endif
66
67 uint8_t offset = sbr->tHFAdj;
68 uint8_t first = sbr->t_E[ch][0];
69 uint8_t last = sbr->t_E[ch][sbr->L_E[ch]];
70
71 calc_chirp_factors(sbr, ch);
72
73 #ifdef SBR_LOW_POWER
74 memset(deg, 0, 64*sizeof(real_t));
75 #endif
76
77 if ((ch == 0) && (sbr->Reset))
78 patch_construction(sbr);
79
80 /* calculate the prediction coefficients */
81 #ifdef SBR_LOW_POWER
82 calc_prediction_coef_lp(sbr, Xlow, alpha_0, alpha_1, rxx);
83 calc_aliasing_degree(sbr, rxx, deg);
84 #endif
85
86 /* actual HF generation */
87 for (i = 0; i < sbr->noPatches; i++)
88 {
89 for (x = 0; x < sbr->patchNoSubbands[i]; x++)
90 {
91 real_t a0_r, a0_i, a1_r, a1_i;
92 real_t bw, bw2;
93 uint8_t q, p, k, g;
94
95 /* find the low and high band for patching */
96 k = sbr->kx + x;
97 for (q = 0; q < i; q++)
98 {
99 k += sbr->patchNoSubbands[q];
100 }
101 p = sbr->patchStartSubband[i] + x;
102
103 #ifdef SBR_LOW_POWER
104 if (x != 0 /*x < sbr->patchNoSubbands[i]-1*/)
105 deg[k] = deg[p];
106 else
107 deg[k] = 0;
108 #endif
109
110 g = sbr->table_map_k_to_g[k];
111
112 bw = sbr->bwArray[ch][g];
113 bw2 = MUL_C(bw, bw);
114
115 /* do the patching */
116 /* with or without filtering */
117 if (bw2 > 0)
118 {
119 real_t temp1_r, temp2_r, temp3_r;
120 #ifndef SBR_LOW_POWER
121 real_t temp1_i, temp2_i, temp3_i;
122 calc_prediction_coef(sbr, Xlow, alpha_0, alpha_1, p);
123 #endif
124
125 a0_r = MUL_C(RE(alpha_0[p]), bw);
126 a1_r = MUL_C(RE(alpha_1[p]), bw2);
127 #ifndef SBR_LOW_POWER
128 a0_i = MUL_C(IM(alpha_0[p]), bw);
129 a1_i = MUL_C(IM(alpha_1[p]), bw2);
130 #endif
131
132 temp2_r = QMF_RE(Xlow[first - 2 + offset][p]);
133 temp3_r = QMF_RE(Xlow[first - 1 + offset][p]);
134 #ifndef SBR_LOW_POWER
135 temp2_i = QMF_IM(Xlow[first - 2 + offset][p]);
136 temp3_i = QMF_IM(Xlow[first - 1 + offset][p]);
137 #endif
138 for (l = first; l < last; l++)
139 {
140 temp1_r = temp2_r;
141 temp2_r = temp3_r;
142 temp3_r = QMF_RE(Xlow[l + offset][p]);
143 #ifndef SBR_LOW_POWER
144 temp1_i = temp2_i;
145 temp2_i = temp3_i;
146 temp3_i = QMF_IM(Xlow[l + offset][p]);
147 #endif
148
149 #ifdef SBR_LOW_POWER
150 QMF_RE(Xhigh[l + offset][k]) =
151 temp3_r
152 +(MUL_R(a0_r, temp2_r) +
153 MUL_R(a1_r, temp1_r));
154 #else
155 QMF_RE(Xhigh[l + offset][k]) =
156 temp3_r
157 +(MUL_R(a0_r, temp2_r) -
158 MUL_R(a0_i, temp2_i) +
159 MUL_R(a1_r, temp1_r) -
160 MUL_R(a1_i, temp1_i));
161 QMF_IM(Xhigh[l + offset][k]) =
162 temp3_i
163 +(MUL_R(a0_i, temp2_r) +
164 MUL_R(a0_r, temp2_i) +
165 MUL_R(a1_i, temp1_r) +
166 MUL_R(a1_r, temp1_i));
167 #endif
168 }
169 } else {
170 for (l = first; l < last; l++)
171 {
172 QMF_RE(Xhigh[l + offset][k]) = QMF_RE(Xlow[l + offset][p]);
173 #ifndef SBR_LOW_POWER
174 QMF_IM(Xhigh[l + offset][k]) = QMF_IM(Xlow[l + offset][p]);
175 #endif
176 }
177 }
178 }
179 }
180
181 if (sbr->Reset)
182 {
183 limiter_frequency_table(sbr);
184 }
185 }
186
187 typedef struct
188 {
189 complex_t r01;
190 complex_t r02;
191 complex_t r11;
192 complex_t r12;
193 complex_t r22;
194 real_t det;
195 } acorr_coef;
196
197 #ifdef SBR_LOW_POWER
198 static void auto_correlation(sbr_info *sbr, acorr_coef *ac,
199 qmf_t buffer[MAX_NTSRHFG][64],
200 uint8_t bd, uint8_t len)
201 {
202 real_t r01 = 0, r02 = 0, r11 = 0;
203 int8_t j;
204 uint8_t offset = sbr->tHFAdj;
205 #ifdef FIXED_POINT
206 const real_t rel = FRAC_CONST(0.999999); // 1 / (1 + 1e-6f);
207 uint32_t maxi = 0;
208 uint32_t pow2, exp;
209 #else
210 const real_t rel = 1 / (1 + 1e-6f);
211 #endif
212
213
214 #ifdef FIXED_POINT
215 mask = 0;
216
217 for (j = (offset-2); j < (len + offset); j++)
218 {
219 real_t x;
220 x = QMF_RE(buffer[j][bd])>>REAL_BITS;
221 mask |= x ^ (x >> 31);
222 }
223
224 exp = wl_min_lzc(mask);
225
226 /* improves accuracy */
227 if (exp > 0)
228 exp -= 1;
229
230 for (j = offset; j < len + offset; j++)
231 {
232 real_t buf_j = ((QMF_RE(buffer[j][bd])+(1<<(exp-1)))>>exp);
233 real_t buf_j_1 = ((QMF_RE(buffer[j-1][bd])+(1<<(exp-1)))>>exp);
234 real_t buf_j_2 = ((QMF_RE(buffer[j-2][bd])+(1<<(exp-1)))>>exp);
235
236 /* normalisation with rounding */
237 r01 += MUL_R(buf_j, buf_j_1);
238 r02 += MUL_R(buf_j, buf_j_2);
239 r11 += MUL_R(buf_j_1, buf_j_1);
240 }
241 RE(ac->r12) = r01 -
242 MUL_R(((QMF_RE(buffer[len+offset-1][bd])+(1<<(exp-1)))>>exp), ((QMF_RE(buffer[len+offset-2][bd])+(1<<(exp-1)))>>exp)) +
243 MUL_R(((QMF_RE(buffer[offset-1][bd])+(1<<(exp-1)))>>exp), ((QMF_RE(buffer[offset-2][bd])+(1<<(exp-1)))>>exp));
244 RE(ac->r22) = r11 -
245 MUL_R(((QMF_RE(buffer[len+offset-2][bd])+(1<<(exp-1)))>>exp), ((QMF_RE(buffer[len+offset-2][bd])+(1<<(exp-1)))>>exp)) +
246 MUL_R(((QMF_RE(buffer[offset-2][bd])+(1<<(exp-1)))>>exp), ((QMF_RE(buffer[offset-2][bd])+(1<<(exp-1)))>>exp));
247 #else
248 for (j = offset; j < len + offset; j++)
249 {
250 r01 += QMF_RE(buffer[j][bd]) * QMF_RE(buffer[j-1][bd]);
251 r02 += QMF_RE(buffer[j][bd]) * QMF_RE(buffer[j-2][bd]);
252 r11 += QMF_RE(buffer[j-1][bd]) * QMF_RE(buffer[j-1][bd]);
253 }
254 RE(ac->r12) = r01 -
255 QMF_RE(buffer[len+offset-1][bd]) * QMF_RE(buffer[len+offset-2][bd]) +
256 QMF_RE(buffer[offset-1][bd]) * QMF_RE(buffer[offset-2][bd]);
257 RE(ac->r22) = r11 -
258 QMF_RE(buffer[len+offset-2][bd]) * QMF_RE(buffer[len+offset-2][bd]) +
259 QMF_RE(buffer[offset-2][bd]) * QMF_RE(buffer[offset-2][bd]);
260 #endif
261 RE(ac->r01) = r01;
262 RE(ac->r02) = r02;
263 RE(ac->r11) = r11;
264
265 ac->det = MUL_R(RE(ac->r11), RE(ac->r22)) - MUL_F(MUL_R(RE(ac->r12), RE(ac->r12)), rel);
266 }
267 #else
268 static void auto_correlation(sbr_info *sbr, acorr_coef *ac, qmf_t buffer[MAX_NTSRHFG][64],
269 uint8_t bd, uint8_t len)
270 {
271 real_t r01r = 0, r01i = 0, r02r = 0, r02i = 0, r11r = 0;
272 real_t temp1_r, temp1_i, temp2_r, temp2_i, temp3_r, temp3_i, temp4_r, temp4_i, temp5_r, temp5_i;
273 #ifdef FIXED_POINT
274 const real_t rel = FRAC_CONST(0.999999); // 1 / (1 + 1e-6f);
275 uint32_t mask, exp;
276 real_t pow2_to_exp;
277 #else
278 const real_t rel = 1 / (1 + 1e-6f);
279 #endif
280 int8_t j;
281 uint8_t offset = sbr->tHFAdj;
282
283 #ifdef FIXED_POINT
284 mask = 0;
285
286 for (j = (offset-2); j < (len + offset); j++)
287 {
288 real_t x;
289 x = QMF_RE(buffer[j][bd])>>REAL_BITS;
290 mask |= x ^ (x >> 31);
291 x = QMF_IM(buffer[j][bd])>>REAL_BITS;
292 mask |= x ^ (x >> 31);
293 }
294
295 exp = wl_min_lzc(mask);
296
297 /* improves accuracy */
298 if (exp > 0)
299 exp -= 1;
300
301 pow2_to_exp = 1<<(exp-1);
302
303 temp2_r = (QMF_RE(buffer[offset-2][bd]) + pow2_to_exp) >> exp;
304 temp2_i = (QMF_IM(buffer[offset-2][bd]) + pow2_to_exp) >> exp;
305 temp3_r = (QMF_RE(buffer[offset-1][bd]) + pow2_to_exp) >> exp;
306 temp3_i = (QMF_IM(buffer[offset-1][bd]) + pow2_to_exp) >> exp;
307 // Save these because they are needed after loop
308 temp4_r = temp2_r;
309 temp4_i = temp2_i;
310 temp5_r = temp3_r;
311 temp5_i = temp3_i;
312
313 for (j = offset; j < len + offset; j++)
314 {
315 temp1_r = temp2_r; // temp1_r = (QMF_RE(buffer[offset-2][bd] + (1<<(exp-1))) >> exp;
316 temp1_i = temp2_i; // temp1_i = (QMF_IM(buffer[offset-2][bd] + (1<<(exp-1))) >> exp;
317 temp2_r = temp3_r; // temp2_r = (QMF_RE(buffer[offset-1][bd] + (1<<(exp-1))) >> exp;
318 temp2_i = temp3_i; // temp2_i = (QMF_IM(buffer[offset-1][bd] + (1<<(exp-1))) >> exp;
319 temp3_r = (QMF_RE(buffer[j][bd]) + pow2_to_exp) >> exp;
320 temp3_i = (QMF_IM(buffer[j][bd]) + pow2_to_exp) >> exp;
321 r01r += MUL_R(temp3_r, temp2_r) + MUL_R(temp3_i, temp2_i);
322 r01i += MUL_R(temp3_i, temp2_r) - MUL_R(temp3_r, temp2_i);
323 r02r += MUL_R(temp3_r, temp1_r) + MUL_R(temp3_i, temp1_i);
324 r02i += MUL_R(temp3_i, temp1_r) - MUL_R(temp3_r, temp1_i);
325 r11r += MUL_R(temp2_r, temp2_r) + MUL_R(temp2_i, temp2_i);
326 }
327
328 // These are actual values in temporary variable at this point
329 // temp1_r = (QMF_RE(buffer[len+offset-1-2][bd] + (1<<(exp-1))) >> exp;
330 // temp1_i = (QMF_IM(buffer[len+offset-1-2][bd] + (1<<(exp-1))) >> exp;
331 // temp2_r = (QMF_RE(buffer[len+offset-1-1][bd] + (1<<(exp-1))) >> exp;
332 // temp2_i = (QMF_IM(buffer[len+offset-1-1][bd] + (1<<(exp-1))) >> exp;
333 // temp3_r = (QMF_RE(buffer[len+offset-1][bd]) + (1<<(exp-1))) >> exp;
334 // temp3_i = (QMF_IM(buffer[len+offset-1][bd]) + (1<<(exp-1))) >> exp;
335 // temp4_r = (QMF_RE(buffer[offset-2][bd]) + (1<<(exp-1))) >> exp;
336 // temp4_i = (QMF_IM(buffer[offset-2][bd]) + (1<<(exp-1))) >> exp;
337 // temp5_r = (QMF_RE(buffer[offset-1][bd]) + (1<<(exp-1))) >> exp;
338 // temp5_i = (QMF_IM(buffer[offset-1][bd]) + (1<<(exp-1))) >> exp;
339
340 RE(ac->r12) = r01r -
341 (MUL_R(temp3_r, temp2_r) + MUL_R(temp3_i, temp2_i)) +
342 (MUL_R(temp5_r, temp4_r) + MUL_R(temp5_i, temp4_i));
343 IM(ac->r12) = r01i -
344 (MUL_R(temp3_i, temp2_r) - MUL_R(temp3_r, temp2_i)) +
345 (MUL_R(temp5_i, temp4_r) - MUL_R(temp5_r, temp4_i));
346 RE(ac->r22) = r11r -
347 (MUL_R(temp2_r, temp2_r) + MUL_R(temp2_i, temp2_i)) +
348 (MUL_R(temp4_r, temp4_r) + MUL_R(temp4_i, temp4_i));
349
350 #else
351
352 temp2_r = QMF_RE(buffer[offset-2][bd]);
353 temp2_i = QMF_IM(buffer[offset-2][bd]);
354 temp3_r = QMF_RE(buffer[offset-1][bd]);
355 temp3_i = QMF_IM(buffer[offset-1][bd]);
356 // Save these because they are needed after loop
357 temp4_r = temp2_r;
358 temp4_i = temp2_i;
359 temp5_r = temp3_r;
360 temp5_i = temp3_i;
361
362 for (j = offset; j < len + offset; j++)
363 {
364 temp1_r = temp2_r; // temp1_r = QMF_RE(buffer[j-2][bd];
365 temp1_i = temp2_i; // temp1_i = QMF_IM(buffer[j-2][bd];
366 temp2_r = temp3_r; // temp2_r = QMF_RE(buffer[j-1][bd];
367 temp2_i = temp3_i; // temp2_i = QMF_IM(buffer[j-1][bd];
368 temp3_r = QMF_RE(buffer[j][bd]);
369 temp3_i = QMF_IM(buffer[j][bd]);
370 r01r += temp3_r * temp2_r + temp3_i * temp2_i;
371 r01i += temp3_i * temp2_r - temp3_r * temp2_i;
372 r02r += temp3_r * temp1_r + temp3_i * temp1_i;
373 r02i += temp3_i * temp1_r - temp3_r * temp1_i;
374 r11r += temp2_r * temp2_r + temp2_i * temp2_i;
375 }
376
377 // These are actual values in temporary variable at this point
378 // temp1_r = QMF_RE(buffer[len+offset-1-2][bd];
379 // temp1_i = QMF_IM(buffer[len+offset-1-2][bd];
380 // temp2_r = QMF_RE(buffer[len+offset-1-1][bd];
381 // temp2_i = QMF_IM(buffer[len+offset-1-1][bd];
382 // temp3_r = QMF_RE(buffer[len+offset-1][bd]);
383 // temp3_i = QMF_IM(buffer[len+offset-1][bd]);
384 // temp4_r = QMF_RE(buffer[offset-2][bd]);
385 // temp4_i = QMF_IM(buffer[offset-2][bd]);
386 // temp5_r = QMF_RE(buffer[offset-1][bd]);
387 // temp5_i = QMF_IM(buffer[offset-1][bd]);
388
389 RE(ac->r12) = r01r -
390 (temp3_r * temp2_r + temp3_i * temp2_i) +
391 (temp5_r * temp4_r + temp5_i * temp4_i);
392 IM(ac->r12) = r01i -
393 (temp3_i * temp2_r - temp3_r * temp2_i) +
394 (temp5_i * temp4_r - temp5_r * temp4_i);
395 RE(ac->r22) = r11r -
396 (temp2_r * temp2_r + temp2_i * temp2_i) +
397 (temp4_r * temp4_r + temp4_i * temp4_i);
398
399 #endif
400
401 RE(ac->r01) = r01r;
402 IM(ac->r01) = r01i;
403 RE(ac->r02) = r02r;
404 IM(ac->r02) = r02i;
405 RE(ac->r11) = r11r;
406
407 ac->det = MUL_R(RE(ac->r11), RE(ac->r22)) - MUL_F(rel, (MUL_R(RE(ac->r12), RE(ac->r12)) + MUL_R(IM(ac->r12), IM(ac->r12))));
408 }
409 #endif
410
411 /* calculate linear prediction coefficients using the covariance method */
412 #ifndef SBR_LOW_POWER
413 static void calc_prediction_coef(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
414 complex_t *alpha_0, complex_t *alpha_1, uint8_t k)
415 {
416 real_t tmp;
417 acorr_coef ac;
418
419 auto_correlation(sbr, &ac, Xlow, k, sbr->numTimeSlotsRate + 6);
420
421 if (ac.det == 0)
422 {
423 RE(alpha_1[k]) = 0;
424 IM(alpha_1[k]) = 0;
425 } else {
426 #ifdef FIXED_POINT
427 tmp = (MUL_R(RE(ac.r01), RE(ac.r12)) - MUL_R(IM(ac.r01), IM(ac.r12)) - MUL_R(RE(ac.r02), RE(ac.r11)));
428 RE(alpha_1[k]) = DIV_R(tmp, ac.det);
429 tmp = (MUL_R(IM(ac.r01), RE(ac.r12)) + MUL_R(RE(ac.r01), IM(ac.r12)) - MUL_R(IM(ac.r02), RE(ac.r11)));
430 IM(alpha_1[k]) = DIV_R(tmp, ac.det);
431 #else
432 tmp = REAL_CONST(1.0) / ac.det;
433 RE(alpha_1[k]) = (MUL_R(RE(ac.r01), RE(ac.r12)) - MUL_R(IM(ac.r01), IM(ac.r12)) - MUL_R(RE(ac.r02), RE(ac.r11))) * tmp;
434 IM(alpha_1[k]) = (MUL_R(IM(ac.r01), RE(ac.r12)) + MUL_R(RE(ac.r01), IM(ac.r12)) - MUL_R(IM(ac.r02), RE(ac.r11))) * tmp;
435 #endif
436 }
437
438 if (RE(ac.r11) == 0)
439 {
440 RE(alpha_0[k]) = 0;
441 IM(alpha_0[k]) = 0;
442 } else {
443 #ifdef FIXED_POINT
444 tmp = -(RE(ac.r01) + MUL_R(RE(alpha_1[k]), RE(ac.r12)) + MUL_R(IM(alpha_1[k]), IM(ac.r12)));
445 RE(alpha_0[k]) = DIV_R(tmp, RE(ac.r11));
446 tmp = -(IM(ac.r01) + MUL_R(IM(alpha_1[k]), RE(ac.r12)) - MUL_R(RE(alpha_1[k]), IM(ac.r12)));
447 IM(alpha_0[k]) = DIV_R(tmp, RE(ac.r11));
448 #else
449 tmp = 1.0f / RE(ac.r11);
450 RE(alpha_0[k]) = -(RE(ac.r01) + MUL_R(RE(alpha_1[k]), RE(ac.r12)) + MUL_R(IM(alpha_1[k]), IM(ac.r12))) * tmp;
451 IM(alpha_0[k]) = -(IM(ac.r01) + MUL_R(IM(alpha_1[k]), RE(ac.r12)) - MUL_R(RE(alpha_1[k]), IM(ac.r12))) * tmp;
452 #endif
453 }
454
455 if ((MUL_R(RE(alpha_0[k]),RE(alpha_0[k])) + MUL_R(IM(alpha_0[k]),IM(alpha_0[k])) >= REAL_CONST(16)) ||
456 (MUL_R(RE(alpha_1[k]),RE(alpha_1[k])) + MUL_R(IM(alpha_1[k]),IM(alpha_1[k])) >= REAL_CONST(16)))
457 {
458 RE(alpha_0[k]) = 0;
459 IM(alpha_0[k]) = 0;
460 RE(alpha_1[k]) = 0;
461 IM(alpha_1[k]) = 0;
462 }
463 }
464 #else
465 static void calc_prediction_coef_lp(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
466 complex_t *alpha_0, complex_t *alpha_1, real_t *rxx)
467 {
468 uint8_t k;
469 real_t tmp;
470 acorr_coef ac;
471
472 for (k = 1; k < sbr->f_master[0]; k++)
473 {
474 auto_correlation(sbr, &ac, Xlow, k, sbr->numTimeSlotsRate + 6);
475
476 if (ac.det == 0)
477 {
478 RE(alpha_0[k]) = 0;
479 RE(alpha_1[k]) = 0;
480 } else {
481 tmp = MUL_R(RE(ac.r01), RE(ac.r22)) - MUL_R(RE(ac.r12), RE(ac.r02));
482 RE(alpha_0[k]) = DIV_R(tmp, (-ac.det));
483
484 tmp = MUL_R(RE(ac.r01), RE(ac.r12)) - MUL_R(RE(ac.r02), RE(ac.r11));
485 RE(alpha_1[k]) = DIV_R(tmp, ac.det);
486 }
487
488 if ((RE(alpha_0[k]) >= REAL_CONST(4)) || (RE(alpha_1[k]) >= REAL_CONST(4)))
489 {
490 RE(alpha_0[k]) = REAL_CONST(0);
491 RE(alpha_1[k]) = REAL_CONST(0);
492 }
493
494 /* reflection coefficient */
495 if (RE(ac.r11) == 0)
496 {
497 rxx[k] = COEF_CONST(0.0);
498 } else {
499 rxx[k] = DIV_C(RE(ac.r01), RE(ac.r11));
500 rxx[k] = -rxx[k];
501 if (rxx[k] > COEF_CONST(1.0)) rxx[k] = COEF_CONST(1.0);
502 if (rxx[k] < COEF_CONST(-1.0)) rxx[k] = COEF_CONST(-1.0);
503 }
504 }
505 }
506
507 static void calc_aliasing_degree(sbr_info *sbr, real_t *rxx, real_t *deg)
508 {
509 uint8_t k;
510
511 rxx[0] = COEF_CONST(0.0);
512 deg[1] = COEF_CONST(0.0);
513
514 for (k = 2; k < sbr->k0; k++)
515 {
516 deg[k] = 0.0;
517
518 if ((k % 2 == 0) && (rxx[k] < COEF_CONST(0.0)))
519 {
520 if (rxx[k-1] < 0.0)
521 {
522 deg[k] = COEF_CONST(1.0);
523
524 if (rxx[k-2] > COEF_CONST(0.0))
525 {
526 deg[k-1] = COEF_CONST(1.0) - MUL_C(rxx[k-1], rxx[k-1]);
527 }
528 } else if (rxx[k-2] > COEF_CONST(0.0)) {
529 deg[k] = COEF_CONST(1.0) - MUL_C(rxx[k-1], rxx[k-1]);
530 }
531 }
532
533 if ((k % 2 == 1) && (rxx[k] > COEF_CONST(0.0)))
534 {
535 if (rxx[k-1] > COEF_CONST(0.0))
536 {
537 deg[k] = COEF_CONST(1.0);
538
539 if (rxx[k-2] < COEF_CONST(0.0))
540 {
541 deg[k-1] = COEF_CONST(1.0) - MUL_C(rxx[k-1], rxx[k-1]);
542 }
543 } else if (rxx[k-2] < COEF_CONST(0.0)) {
544 deg[k] = COEF_CONST(1.0) - MUL_C(rxx[k-1], rxx[k-1]);
545 }
546 }
547 }
548 }
549 #endif
550
551 /* FIXED POINT: bwArray = COEF */
552 static real_t mapNewBw(uint8_t invf_mode, uint8_t invf_mode_prev)
553 {
554 switch (invf_mode)
555 {
556 case 1: /* LOW */
557 if (invf_mode_prev == 0) /* NONE */
558 return COEF_CONST(0.6);
559 else
560 return COEF_CONST(0.75);
561
562 case 2: /* MID */
563 return COEF_CONST(0.9);
564
565 case 3: /* HIGH */
566 return COEF_CONST(0.98);
567
568 default: /* NONE */
569 if (invf_mode_prev == 1) /* LOW */
570 return COEF_CONST(0.6);
571 else
572 return COEF_CONST(0.0);
573 }
574 }
575
576 /* FIXED POINT: bwArray = COEF */
577 static void calc_chirp_factors(sbr_info *sbr, uint8_t ch)
578 {
579 uint8_t i;
580
581 for (i = 0; i < sbr->N_Q; i++)
582 {
583 sbr->bwArray[ch][i] = mapNewBw(sbr->bs_invf_mode[ch][i], sbr->bs_invf_mode_prev[ch][i]);
584
585 if (sbr->bwArray[ch][i] < sbr->bwArray_prev[ch][i])
586 sbr->bwArray[ch][i] = MUL_F(sbr->bwArray[ch][i], FRAC_CONST(0.75)) + MUL_F(sbr->bwArray_prev[ch][i], FRAC_CONST(0.25));
587 else
588 sbr->bwArray[ch][i] = MUL_F(sbr->bwArray[ch][i], FRAC_CONST(0.90625)) + MUL_F(sbr->bwArray_prev[ch][i], FRAC_CONST(0.09375));
589
590 if (sbr->bwArray[ch][i] < COEF_CONST(0.015625))
591 sbr->bwArray[ch][i] = COEF_CONST(0.0);
592
593 if (sbr->bwArray[ch][i] >= COEF_CONST(0.99609375))
594 sbr->bwArray[ch][i] = COEF_CONST(0.99609375);
595
596 sbr->bwArray_prev[ch][i] = sbr->bwArray[ch][i];
597 sbr->bs_invf_mode_prev[ch][i] = sbr->bs_invf_mode[ch][i];
598 }
599 }
600
601 static void patch_construction(sbr_info *sbr)
602 {
603 uint8_t i, k;
604 uint8_t odd, sb;
605 uint8_t msb = sbr->k0;
606 uint8_t usb = sbr->kx;
607 uint8_t goalSbTab[] = { 21, 23, 32, 43, 46, 64, 85, 93, 128, 0, 0, 0 };
608 /* (uint8_t)(2.048e6/sbr->sample_rate + 0.5); */
609 uint8_t goalSb = goalSbTab[get_sr_index(sbr->sample_rate)];
610
611 sbr->noPatches = 0;
612
613 if (goalSb < (sbr->kx + sbr->M))
614 {
615 for (i = 0, k = 0; sbr->f_master[i] < goalSb; i++)
616 k = i+1;
617 } else {
618 k = sbr->N_master;
619 }
620
621 if (sbr->N_master == 0)
622 {
623 sbr->noPatches = 0;
624 sbr->patchNoSubbands[0] = 0;
625 sbr->patchStartSubband[0] = 0;
626
627 return;
628 }
629
630 do
631 {
632 uint8_t j = k + 1;
633
634 do
635 {
636 j--;
637
638 sb = sbr->f_master[j];
639 odd = (sb - 2 + sbr->k0) % 2;
640 } while (sb > (sbr->k0 - 1 + msb - odd));
641
642 sbr->patchNoSubbands[sbr->noPatches] = max(sb - usb, 0);
643 sbr->patchStartSubband[sbr->noPatches] = sbr->k0 - odd -
644 sbr->patchNoSubbands[sbr->noPatches];
645
646 if (sbr->patchNoSubbands[sbr->noPatches] > 0)
647 {
648 usb = sb;
649 msb = sb;
650 sbr->noPatches++;
651 } else {
652 msb = sbr->kx;
653 }
654
655 if (sbr->f_master[k] - sb < 3)
656 k = sbr->N_master;
657 } while (sb != (sbr->kx + sbr->M));
658
659 if ((sbr->patchNoSubbands[sbr->noPatches-1] < 3) && (sbr->noPatches > 1))
660 {
661 sbr->noPatches--;
662 }
663
664 sbr->noPatches = min(sbr->noPatches, 5);
665 }
666
667 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_hfgen.h,v 1.20 2007/11/01 12:33:35 menno Exp $
28 **/
29
30 #ifndef __SBR_HFGEN_H__
31 #define __SBR_HFGEN_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 void hf_generation(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
38 qmf_t Xhigh[MAX_NTSRHFG][64]
39 #ifdef SBR_LOW_POWER
40 ,real_t *deg
41 #endif
42 ,uint8_t ch);
43
44 #ifdef __cplusplus
45 }
46 #endif
47 #endif
48
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_huff.c,v 1.21 2007/11/01 12:33:35 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #ifdef SBR_DEC
34
35 #include "sbr_syntax.h"
36 #include "bits.h"
37 #include "sbr_huff.h"
38 #include "sbr_e_nf.h"
39
40
41 typedef const int8_t (*sbr_huff_tab)[2];
42
43 static const int8_t t_huffman_env_1_5dB[120][2] = {
44 { 1, 2 }, { -64, -65 }, { 3, 4 }, { -63, -66 },
45 { 5, 6 }, { -62, -67 }, { 7, 8 }, { -61, -68 },
46 { 9, 10 }, { -60, -69 }, { 11, 12 }, { -59, -70 },
47 { 13, 14 }, { -58, -71 }, { 15, 16 }, { -57, -72 },
48 { 17, 18 }, { -73, -56 }, { 19, 21 }, { -74, 20 },
49 { -55, -75 }, { 22, 26 }, { 23, 24 }, { -54, -76 },
50 { -77, 25 }, { -53, -78 }, { 27, 34 }, { 28, 29 },
51 { -52, -79 }, { 30, 31 }, { -80, -51 }, { 32, 33 },
52 { -83, -82 }, { -81, -50 }, { 35, 57 }, { 36, 40 },
53 { 37, 38 }, { -88, -84 }, { -48, 39 }, { -90, -85 },
54 { 41, 46 }, { 42, 43 }, { -49, -87 }, { 44, 45 },
55 { -89, -86 }, {-124,-123 }, { 47, 50 }, { 48, 49 },
56 {-122,-121 }, {-120,-119 }, { 51, 54 }, { 52, 53 },
57 {-118,-117 }, {-116,-115 }, { 55, 56 }, {-114,-113 },
58 {-112,-111 }, { 58, 89 }, { 59, 74 }, { 60, 67 },
59 { 61, 64 }, { 62, 63 }, {-110,-109 }, {-108,-107 },
60 { 65, 66 }, {-106,-105 }, {-104,-103 }, { 68, 71 },
61 { 69, 70 }, {-102,-101 }, {-100, -99 }, { 72, 73 },
62 { -98, -97 }, { -96, -95 }, { 75, 82 }, { 76, 79 },
63 { 77, 78 }, { -94, -93 }, { -92, -91 }, { 80, 81 },
64 { -47, -46 }, { -45, -44 }, { 83, 86 }, { 84, 85 },
65 { -43, -42 }, { -41, -40 }, { 87, 88 }, { -39, -38 },
66 { -37, -36 }, { 90, 105 }, { 91, 98 }, { 92, 95 },
67 { 93, 94 }, { -35, -34 }, { -33, -32 }, { 96, 97 },
68 { -31, -30 }, { -29, -28 }, { 99, 102 }, { 100, 101 },
69 { -27, -26 }, { -25, -24 }, { 103, 104 }, { -23, -22 },
70 { -21, -20 }, { 106, 113 }, { 107, 110 }, { 108, 109 },
71 { -19, -18 }, { -17, -16 }, { 111, 112 }, { -15, -14 },
72 { -13, -12 }, { 114, 117 }, { 115, 116 }, { -11, -10 },
73 { -9, -8 }, { 118, 119 }, { -7, -6 }, { -5, -4 }
74 };
75
76 static const int8_t f_huffman_env_1_5dB[120][2] = {
77 { 1, 2 }, { -64, -65 }, { 3, 4 }, { -63, -66 },
78 { 5, 6 }, { -67, -62 }, { 7, 8 }, { -68, -61 },
79 { 9, 10 }, { -69, -60 }, { 11, 13 }, { -70, 12 },
80 { -59, -71 }, { 14, 16 }, { -58, 15 }, { -72, -57 },
81 { 17, 19 }, { -73, 18 }, { -56, -74 }, { 20, 23 },
82 { 21, 22 }, { -55, -75 }, { -54, -53 }, { 24, 27 },
83 { 25, 26 }, { -76, -52 }, { -77, -51 }, { 28, 31 },
84 { 29, 30 }, { -50, -78 }, { -79, -49 }, { 32, 36 },
85 { 33, 34 }, { -48, -47 }, { -80, 35 }, { -81, -82 },
86 { 37, 47 }, { 38, 41 }, { 39, 40 }, { -83, -46 },
87 { -45, -84 }, { 42, 44 }, { -85, 43 }, { -44, -43 },
88 { 45, 46 }, { -88, -87 }, { -86, -90 }, { 48, 66 },
89 { 49, 56 }, { 50, 53 }, { 51, 52 }, { -92, -42 },
90 { -41, -39 }, { 54, 55 }, {-105, -89 }, { -38, -37 },
91 { 57, 60 }, { 58, 59 }, { -94, -91 }, { -40, -36 },
92 { 61, 63 }, { -20, 62 }, {-115,-110 }, { 64, 65 },
93 {-108,-107 }, {-101, -97 }, { 67, 89 }, { 68, 75 },
94 { 69, 72 }, { 70, 71 }, { -95, -93 }, { -34, -27 },
95 { 73, 74 }, { -22, -17 }, { -16,-124 }, { 76, 82 },
96 { 77, 79 }, {-123, 78 }, {-122,-121 }, { 80, 81 },
97 {-120,-119 }, {-118,-117 }, { 83, 86 }, { 84, 85 },
98 {-116,-114 }, {-113,-112 }, { 87, 88 }, {-111,-109 },
99 {-106,-104 }, { 90, 105 }, { 91, 98 }, { 92, 95 },
100 { 93, 94 }, {-103,-102 }, {-100, -99 }, { 96, 97 },
101 { -98, -96 }, { -35, -33 }, { 99, 102 }, { 100, 101 },
102 { -32, -31 }, { -30, -29 }, { 103, 104 }, { -28, -26 },
103 { -25, -24 }, { 106, 113 }, { 107, 110 }, { 108, 109 },
104 { -23, -21 }, { -19, -18 }, { 111, 112 }, { -15, -14 },
105 { -13, -12 }, { 114, 117 }, { 115, 116 }, { -11, -10 },
106 { -9, -8 }, { 118, 119 }, { -7, -6 }, { -5, -4 }
107 };
108
109 static const int8_t t_huffman_env_bal_1_5dB[48][2] = {
110 { -64, 1 }, { -63, 2 }, { -65, 3 }, { -62, 4 },
111 { -66, 5 }, { -61, 6 }, { -67, 7 }, { -60, 8 },
112 { -68, 9 }, { 10, 11 }, { -69, -59 }, { 12, 13 },
113 { -70, -58 }, { 14, 28 }, { 15, 21 }, { 16, 18 },
114 { -57, 17 }, { -71, -56 }, { 19, 20 }, { -88, -87 },
115 { -86, -85 }, { 22, 25 }, { 23, 24 }, { -84, -83 },
116 { -82, -81 }, { 26, 27 }, { -80, -79 }, { -78, -77 },
117 { 29, 36 }, { 30, 33 }, { 31, 32 }, { -76, -75 },
118 { -74, -73 }, { 34, 35 }, { -72, -55 }, { -54, -53 },
119 { 37, 41 }, { 38, 39 }, { -52, -51 }, { -50, 40 },
120 { -49, -48 }, { 42, 45 }, { 43, 44 }, { -47, -46 },
121 { -45, -44 }, { 46, 47 }, { -43, -42 }, { -41, -40 }
122 };
123
124 static const int8_t f_huffman_env_bal_1_5dB[48][2] = {
125 { -64, 1 }, { -65, 2 }, { -63, 3 }, { -66, 4 },
126 { -62, 5 }, { -61, 6 }, { -67, 7 }, { -68, 8 },
127 { -60, 9 }, { 10, 11 }, { -69, -59 }, { -70, 12 },
128 { -58, 13 }, { 14, 17 }, { -71, 15 }, { -57, 16 },
129 { -56, -73 }, { 18, 32 }, { 19, 25 }, { 20, 22 },
130 { -72, 21 }, { -88, -87 }, { 23, 24 }, { -86, -85 },
131 { -84, -83 }, { 26, 29 }, { 27, 28 }, { -82, -81 },
132 { -80, -79 }, { 30, 31 }, { -78, -77 }, { -76, -75 },
133 { 33, 40 }, { 34, 37 }, { 35, 36 }, { -74, -55 },
134 { -54, -53 }, { 38, 39 }, { -52, -51 }, { -50, -49 },
135 { 41, 44 }, { 42, 43 }, { -48, -47 }, { -46, -45 },
136 { 45, 46 }, { -44, -43 }, { -42, 47 }, { -41, -40 }
137 };
138
139 static const int8_t t_huffman_env_3_0dB[62][2] = {
140 { -64, 1 }, { -65, 2 }, { -63, 3 }, { -66, 4 },
141 { -62, 5 }, { -67, 6 }, { -61, 7 }, { -68, 8 },
142 { -60, 9 }, { 10, 11 }, { -69, -59 }, { 12, 14 },
143 { -70, 13 }, { -71, -58 }, { 15, 18 }, { 16, 17 },
144 { -72, -57 }, { -73, -74 }, { 19, 22 }, { -56, 20 },
145 { -55, 21 }, { -54, -77 }, { 23, 31 }, { 24, 25 },
146 { -75, -76 }, { 26, 27 }, { -78, -53 }, { 28, 29 },
147 { -52, -95 }, { -94, 30 }, { -93, -92 }, { 32, 47 },
148 { 33, 40 }, { 34, 37 }, { 35, 36 }, { -91, -90 },
149 { -89, -88 }, { 38, 39 }, { -87, -86 }, { -85, -84 },
150 { 41, 44 }, { 42, 43 }, { -83, -82 }, { -81, -80 },
151 { 45, 46 }, { -79, -51 }, { -50, -49 }, { 48, 55 },
152 { 49, 52 }, { 50, 51 }, { -48, -47 }, { -46, -45 },
153 { 53, 54 }, { -44, -43 }, { -42, -41 }, { 56, 59 },
154 { 57, 58 }, { -40, -39 }, { -38, -37 }, { 60, 61 },
155 { -36, -35 }, { -34, -33 }
156 };
157
158 static const int8_t f_huffman_env_3_0dB[62][2] = {
159 { -64, 1 }, { -65, 2 }, { -63, 3 }, { -66, 4 },
160 { -62, 5 }, { -67, 6 }, { 7, 8 }, { -61, -68 },
161 { 9, 10 }, { -60, -69 }, { 11, 12 }, { -59, -70 },
162 { 13, 14 }, { -58, -71 }, { 15, 16 }, { -57, -72 },
163 { 17, 19 }, { -56, 18 }, { -55, -73 }, { 20, 24 },
164 { 21, 22 }, { -74, -54 }, { -53, 23 }, { -75, -76 },
165 { 25, 30 }, { 26, 27 }, { -52, -51 }, { 28, 29 },
166 { -77, -79 }, { -50, -49 }, { 31, 39 }, { 32, 35 },
167 { 33, 34 }, { -78, -46 }, { -82, -88 }, { 36, 37 },
168 { -83, -48 }, { -47, 38 }, { -86, -85 }, { 40, 47 },
169 { 41, 44 }, { 42, 43 }, { -80, -44 }, { -43, -42 },
170 { 45, 46 }, { -39, -87 }, { -84, -40 }, { 48, 55 },
171 { 49, 52 }, { 50, 51 }, { -95, -94 }, { -93, -92 },
172 { 53, 54 }, { -91, -90 }, { -89, -81 }, { 56, 59 },
173 { 57, 58 }, { -45, -41 }, { -38, -37 }, { 60, 61 },
174 { -36, -35 }, { -34, -33 }
175 };
176
177 static const int8_t t_huffman_env_bal_3_0dB[24][2] = {
178 { -64, 1 }, { -63, 2 }, { -65, 3 }, { -66, 4 },
179 { -62, 5 }, { -61, 6 }, { -67, 7 }, { -68, 8 },
180 { -60, 9 }, { 10, 16 }, { 11, 13 }, { -69, 12 },
181 { -76, -75 }, { 14, 15 }, { -74, -73 }, { -72, -71 },
182 { 17, 20 }, { 18, 19 }, { -70, -59 }, { -58, -57 },
183 { 21, 22 }, { -56, -55 }, { -54, 23 }, { -53, -52 }
184 };
185
186 static const int8_t f_huffman_env_bal_3_0dB[24][2] = {
187 { -64, 1 }, { -65, 2 }, { -63, 3 }, { -66, 4 },
188 { -62, 5 }, { -61, 6 }, { -67, 7 }, { -68, 8 },
189 { -60, 9 }, { 10, 13 }, { -69, 11 }, { -59, 12 },
190 { -58, -76 }, { 14, 17 }, { 15, 16 }, { -75, -74 },
191 { -73, -72 }, { 18, 21 }, { 19, 20 }, { -71, -70 },
192 { -57, -56 }, { 22, 23 }, { -55, -54 }, { -53, -52 }
193 };
194
195 static const int8_t t_huffman_noise_3_0dB[62][2] = {
196 { -64, 1 }, { -63, 2 }, { -65, 3 }, { -66, 4 },
197 { -62, 5 }, { -67, 6 }, { 7, 8 }, { -61, -68 },
198 { 9, 30 }, { 10, 15 }, { -60, 11 }, { -69, 12 },
199 { 13, 14 }, { -59, -53 }, { -95, -94 }, { 16, 23 },
200 { 17, 20 }, { 18, 19 }, { -93, -92 }, { -91, -90 },
201 { 21, 22 }, { -89, -88 }, { -87, -86 }, { 24, 27 },
202 { 25, 26 }, { -85, -84 }, { -83, -82 }, { 28, 29 },
203 { -81, -80 }, { -79, -78 }, { 31, 46 }, { 32, 39 },
204 { 33, 36 }, { 34, 35 }, { -77, -76 }, { -75, -74 },
205 { 37, 38 }, { -73, -72 }, { -71, -70 }, { 40, 43 },
206 { 41, 42 }, { -58, -57 }, { -56, -55 }, { 44, 45 },
207 { -54, -52 }, { -51, -50 }, { 47, 54 }, { 48, 51 },
208 { 49, 50 }, { -49, -48 }, { -47, -46 }, { 52, 53 },
209 { -45, -44 }, { -43, -42 }, { 55, 58 }, { 56, 57 },
210 { -41, -40 }, { -39, -38 }, { 59, 60 }, { -37, -36 },
211 { -35, 61 }, { -34, -33 }
212 };
213
214 static const int8_t t_huffman_noise_bal_3_0dB[24][2] = {
215 { -64, 1 }, { -65, 2 }, { -63, 3 }, { 4, 9 },
216 { -66, 5 }, { -62, 6 }, { 7, 8 }, { -76, -75 },
217 { -74, -73 }, { 10, 17 }, { 11, 14 }, { 12, 13 },
218 { -72, -71 }, { -70, -69 }, { 15, 16 }, { -68, -67 },
219 { -61, -60 }, { 18, 21 }, { 19, 20 }, { -59, -58 },
220 { -57, -56 }, { 22, 23 }, { -55, -54 }, { -53, -52 }
221 };
222
223
224 static INLINE int16_t sbr_huff_dec(bitfile *ld, sbr_huff_tab t_huff)
225 {
226 uint8_t bit;
227 int16_t index = 0;
228
229 while (index >= 0)
230 {
231 bit = (uint8_t)faad_get1bit(ld);
232 index = t_huff[index][bit];
233 }
234
235 return index + 64;
236 }
237
238 /* table 10 */
239 void sbr_envelope(bitfile *ld, sbr_info *sbr, uint8_t ch)
240 {
241 uint8_t env, band;
242 int8_t delta = 0;
243 sbr_huff_tab t_huff, f_huff;
244
245 if ((sbr->L_E[ch] == 1) && (sbr->bs_frame_class[ch] == FIXFIX))
246 sbr->amp_res[ch] = 0;
247 else
248 sbr->amp_res[ch] = sbr->bs_amp_res;
249
250 if ((sbr->bs_coupling) && (ch == 1))
251 {
252 delta = 1;
253 if (sbr->amp_res[ch])
254 {
255 t_huff = t_huffman_env_bal_3_0dB;
256 f_huff = f_huffman_env_bal_3_0dB;
257 } else {
258 t_huff = t_huffman_env_bal_1_5dB;
259 f_huff = f_huffman_env_bal_1_5dB;
260 }
261 } else {
262 delta = 0;
263 if (sbr->amp_res[ch])
264 {
265 t_huff = t_huffman_env_3_0dB;
266 f_huff = f_huffman_env_3_0dB;
267 } else {
268 t_huff = t_huffman_env_1_5dB;
269 f_huff = f_huffman_env_1_5dB;
270 }
271 }
272
273 for (env = 0; env < sbr->L_E[ch]; env++)
274 {
275 if (sbr->bs_df_env[ch][env] == 0)
276 {
277 if ((sbr->bs_coupling == 1) && (ch == 1))
278 {
279 if (sbr->amp_res[ch])
280 {
281 sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 5
282 DEBUGVAR(1,272,"sbr_envelope(): bs_data_env")) << delta);
283 } else {
284 sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 6
285 DEBUGVAR(1,273,"sbr_envelope(): bs_data_env")) << delta);
286 }
287 } else {
288 if (sbr->amp_res[ch])
289 {
290 sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 6
291 DEBUGVAR(1,274,"sbr_envelope(): bs_data_env")) << delta);
292 } else {
293 sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 7
294 DEBUGVAR(1,275,"sbr_envelope(): bs_data_env")) << delta);
295 }
296 }
297
298 for (band = 1; band < sbr->n[sbr->f[ch][env]]; band++)
299 {
300 sbr->E[ch][band][env] = (sbr_huff_dec(ld, f_huff) << delta);
301 }
302
303 } else {
304 for (band = 0; band < sbr->n[sbr->f[ch][env]]; band++)
305 {
306 sbr->E[ch][band][env] = (sbr_huff_dec(ld, t_huff) << delta);
307 }
308 }
309 }
310
311 extract_envelope_data(sbr, ch);
312 }
313
314 /* table 11 */
315 void sbr_noise(bitfile *ld, sbr_info *sbr, uint8_t ch)
316 {
317 uint8_t noise, band;
318 int8_t delta = 0;
319 sbr_huff_tab t_huff, f_huff;
320
321 if ((sbr->bs_coupling == 1) && (ch == 1))
322 {
323 delta = 1;
324 t_huff = t_huffman_noise_bal_3_0dB;
325 f_huff = f_huffman_env_bal_3_0dB;
326 } else {
327 delta = 0;
328 t_huff = t_huffman_noise_3_0dB;
329 f_huff = f_huffman_env_3_0dB;
330 }
331
332 for (noise = 0; noise < sbr->L_Q[ch]; noise++)
333 {
334 if(sbr->bs_df_noise[ch][noise] == 0)
335 {
336 if ((sbr->bs_coupling == 1) && (ch == 1))
337 {
338 sbr->Q[ch][0][noise] = (faad_getbits(ld, 5
339 DEBUGVAR(1,276,"sbr_noise(): bs_data_noise")) << delta);
340 } else {
341 sbr->Q[ch][0][noise] = (faad_getbits(ld, 5
342 DEBUGVAR(1,277,"sbr_noise(): bs_data_noise")) << delta);
343 }
344 for (band = 1; band < sbr->N_Q; band++)
345 {
346 sbr->Q[ch][band][noise] = (sbr_huff_dec(ld, f_huff) << delta);
347 }
348 } else {
349 for (band = 0; band < sbr->N_Q; band++)
350 {
351 sbr->Q[ch][band][noise] = (sbr_huff_dec(ld, t_huff) << delta);
352 }
353 }
354 }
355
356 extract_noise_floor_data(sbr, ch);
357 }
358
359 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_huff.h,v 1.21 2007/11/01 12:33:35 menno Exp $
28 **/
29
30 #ifndef __SBR_HUFF_H__
31 #define __SBR_HUFF_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37
38 void sbr_envelope(bitfile *ld, sbr_info *sbr, uint8_t ch);
39 void sbr_noise(bitfile *ld, sbr_info *sbr, uint8_t ch);
40
41 #ifdef __cplusplus
42 }
43 #endif
44 #endif
45
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_noise.h,v 1.17 2007/11/01 12:33:35 menno Exp $
28 **/
29
30 #ifndef __SBR_NOISE_H__
31 #define __SBR_NOISE_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #ifdef _MSC_VER
38 #pragma warning(disable:4305)
39 #pragma warning(disable:4244)
40 #endif
41
42
43 /* Table 1.A.13 Noise table V */
44 ALIGN static const complex_t V[] = {
45 { FRAC_CONST(-0.99948155879974), FRAC_CONST(-0.59483414888382) },
46 { FRAC_CONST(0.97113454341888), FRAC_CONST(-0.67528516054153) },
47 { FRAC_CONST(0.14130051434040), FRAC_CONST(-0.95090985298157) },
48 { FRAC_CONST(-0.47005495429039), FRAC_CONST(-0.37340548634529) },
49 { FRAC_CONST(0.80705064535141), FRAC_CONST(0.29653668403625) },
50 { FRAC_CONST(-0.38981479406357), FRAC_CONST(0.89572608470917) },
51 { FRAC_CONST(-0.01053049881011), FRAC_CONST(-0.66959059238434) },
52 { FRAC_CONST(-0.91266369819641), FRAC_CONST(-0.11522938311100) },
53 { FRAC_CONST(0.54840421676636), FRAC_CONST(0.75221365690231) },
54 { FRAC_CONST(0.40009254217148), FRAC_CONST(-0.98929399251938) },
55 { FRAC_CONST(-0.99867975711823), FRAC_CONST(-0.88147068023682) },
56 { FRAC_CONST(-0.95531076192856), FRAC_CONST(0.90908759832382) },
57 { FRAC_CONST(-0.45725932717323), FRAC_CONST(-0.56716322898865) },
58 { FRAC_CONST(-0.72929674386978), FRAC_CONST(-0.98008275032043) },
59 { FRAC_CONST(0.75622802972794), FRAC_CONST(0.20950329303741) },
60 { FRAC_CONST(0.07069442421198), FRAC_CONST(-0.78247898817062) },
61 { FRAC_CONST(0.74496251344681), FRAC_CONST(-0.91169005632401) },
62 { FRAC_CONST(-0.96440184116364), FRAC_CONST(-0.94739919900894) },
63 { FRAC_CONST(0.30424630641937), FRAC_CONST(-0.49438267946243) },
64 { FRAC_CONST(0.66565030813217), FRAC_CONST(0.64652937650681) },
65 { FRAC_CONST(0.91697007417679), FRAC_CONST(0.17514097690582) },
66 { FRAC_CONST(-0.70774918794632), FRAC_CONST(0.52548652887344) },
67 { FRAC_CONST(-0.70051413774490), FRAC_CONST(-0.45340028405190) },
68 { FRAC_CONST(-0.99496513605118), FRAC_CONST(-0.90071910619736) },
69 { FRAC_CONST(0.98164492845535), FRAC_CONST(-0.77463155984879) },
70 { FRAC_CONST(-0.54671579599380), FRAC_CONST(-0.02570928446949) },
71 { FRAC_CONST(-0.01689629070461), FRAC_CONST(0.00287506449968) },
72 { FRAC_CONST(-0.86110347509384), FRAC_CONST(0.42548584938049) },
73 { FRAC_CONST(-0.98892980813980), FRAC_CONST(-0.87881129980087) },
74 { FRAC_CONST(0.51756626367569), FRAC_CONST(0.66926783323288) },
75 { FRAC_CONST(-0.99635028839111), FRAC_CONST(-0.58107727766037) },
76 { FRAC_CONST(-0.99969369173050), FRAC_CONST(0.98369991779327) },
77 { FRAC_CONST(0.55266261100769), FRAC_CONST(0.59449058771133) },
78 { FRAC_CONST(0.34581178426743), FRAC_CONST(0.94879418611526) },
79 { FRAC_CONST(0.62664210796356), FRAC_CONST(-0.74402970075607) },
80 { FRAC_CONST(-0.77149701118469), FRAC_CONST(-0.33883658051491) },
81 { FRAC_CONST(-0.91592246294022), FRAC_CONST(0.03687901422381) },
82 { FRAC_CONST(-0.76285493373871), FRAC_CONST(-0.91371870040894) },
83 { FRAC_CONST(0.79788339138031), FRAC_CONST(-0.93180972337723) },
84 { FRAC_CONST(0.54473078250885), FRAC_CONST(-0.11919206380844) },
85 { FRAC_CONST(-0.85639280080795), FRAC_CONST(0.42429855465889) },
86 { FRAC_CONST(-0.92882400751114), FRAC_CONST(0.27871808409691) },
87 { FRAC_CONST(-0.11708371341228), FRAC_CONST(-0.99800843000412) },
88 { FRAC_CONST(0.21356749534607), FRAC_CONST(-0.90716296434402) },
89 { FRAC_CONST(-0.76191693544388), FRAC_CONST(0.99768120050430) },
90 { FRAC_CONST(0.98111045360565), FRAC_CONST(-0.95854461193085) },
91 { FRAC_CONST(-0.85913270711899), FRAC_CONST(0.95766568183899) },
92 { FRAC_CONST(-0.93307244777679), FRAC_CONST(0.49431759119034) },
93 { FRAC_CONST(0.30485755205154), FRAC_CONST(-0.70540034770966) },
94 { FRAC_CONST(0.85289651155472), FRAC_CONST(0.46766132116318) },
95 { FRAC_CONST(0.91328084468842), FRAC_CONST(-0.99839597940445) },
96 { FRAC_CONST(-0.05890199914575), FRAC_CONST(0.70741826295853) },
97 { FRAC_CONST(0.28398686647415), FRAC_CONST(0.34633556008339) },
98 { FRAC_CONST(0.95258164405823), FRAC_CONST(-0.54893416166306) },
99 { FRAC_CONST(-0.78566324710846), FRAC_CONST(-0.75568538904190) },
100 { FRAC_CONST(-0.95789498090744), FRAC_CONST(-0.20423194766045) },
101 { FRAC_CONST(0.82411158084869), FRAC_CONST(0.96654617786407) },
102 { FRAC_CONST(-0.65185445547104), FRAC_CONST(-0.88734990358353) },
103 { FRAC_CONST(-0.93643605709076), FRAC_CONST(0.99870789051056) },
104 { FRAC_CONST(0.91427159309387), FRAC_CONST(-0.98290503025055) },
105 { FRAC_CONST(-0.70395684242249), FRAC_CONST(0.58796799182892) },
106 { FRAC_CONST(0.00563771976158), FRAC_CONST(0.61768198013306) },
107 { FRAC_CONST(0.89065051078796), FRAC_CONST(0.52783352136612) },
108 { FRAC_CONST(-0.68683707714081), FRAC_CONST(0.80806946754456) },
109 { FRAC_CONST(0.72165340185165), FRAC_CONST(-0.69259858131409) },
110 { FRAC_CONST(-0.62928247451782), FRAC_CONST(0.13627037405968) },
111 { FRAC_CONST(0.29938435554504), FRAC_CONST(-0.46051329374313) },
112 { FRAC_CONST(-0.91781955957413), FRAC_CONST(-0.74012714624405) },
113 { FRAC_CONST(0.99298715591431), FRAC_CONST(0.40816611051559) },
114 { FRAC_CONST(0.82368296384811), FRAC_CONST(-0.74036049842834) },
115 { FRAC_CONST(-0.98512834310532), FRAC_CONST(-0.99972331523895) },
116 { FRAC_CONST(-0.95915371179581), FRAC_CONST(-0.99237799644470) },
117 { FRAC_CONST(-0.21411126852036), FRAC_CONST(-0.93424820899963) },
118 { FRAC_CONST(-0.68821477890015), FRAC_CONST(-0.26892307400703) },
119 { FRAC_CONST(0.91851997375488), FRAC_CONST(0.09358228743076) },
120 { FRAC_CONST(-0.96062767505646), FRAC_CONST(0.36099094152451) },
121 { FRAC_CONST(0.51646184921265), FRAC_CONST(-0.71373331546783) },
122 { FRAC_CONST(0.61130720376968), FRAC_CONST(0.46950140595436) },
123 { FRAC_CONST(0.47336128354073), FRAC_CONST(-0.27333179116249) },
124 { FRAC_CONST(0.90998309850693), FRAC_CONST(0.96715664863586) },
125 { FRAC_CONST(0.44844800233841), FRAC_CONST(0.99211573600769) },
126 { FRAC_CONST(0.66614890098572), FRAC_CONST(0.96590173244476) },
127 { FRAC_CONST(0.74922239780426), FRAC_CONST(-0.89879858493805) },
128 { FRAC_CONST(-0.99571585655212), FRAC_CONST(0.52785521745682) },
129 { FRAC_CONST(0.97401082515717), FRAC_CONST(-0.16855870187283) },
130 { FRAC_CONST(0.72683745622635), FRAC_CONST(-0.48060774803162) },
131 { FRAC_CONST(0.95432192087173), FRAC_CONST(0.68849605321884) },
132 { FRAC_CONST(-0.72962206602097), FRAC_CONST(-0.76608443260193) },
133 { FRAC_CONST(-0.85359477996826), FRAC_CONST(0.88738125562668) },
134 { FRAC_CONST(-0.81412428617477), FRAC_CONST(-0.97480767965317) },
135 { FRAC_CONST(-0.87930774688721), FRAC_CONST(0.74748307466507) },
136 { FRAC_CONST(-0.71573328971863), FRAC_CONST(-0.98570609092712) },
137 { FRAC_CONST(0.83524298667908), FRAC_CONST(0.83702534437180) },
138 { FRAC_CONST(-0.48086065053940), FRAC_CONST(-0.98848503828049) },
139 { FRAC_CONST(0.97139126062393), FRAC_CONST(0.80093622207642) },
140 { FRAC_CONST(0.51992827653885), FRAC_CONST(0.80247628688812) },
141 { FRAC_CONST(-0.00848591234535), FRAC_CONST(-0.76670128107071) },
142 { FRAC_CONST(-0.70294374227524), FRAC_CONST(0.55359911918640) },
143 { FRAC_CONST(-0.95894426107407), FRAC_CONST(-0.43265503644943) },
144 { FRAC_CONST(0.97079253196716), FRAC_CONST(0.09325857460499) },
145 { FRAC_CONST(-0.92404294013977), FRAC_CONST(0.85507702827454) },
146 { FRAC_CONST(-0.69506472349167), FRAC_CONST(0.98633414506912) },
147 { FRAC_CONST(0.26559203863144), FRAC_CONST(0.73314309120178) },
148 { FRAC_CONST(0.28038442134857), FRAC_CONST(0.14537914097309) },
149 { FRAC_CONST(-0.74138122797012), FRAC_CONST(0.99310338497162) },
150 { FRAC_CONST(-0.01752796024084), FRAC_CONST(-0.82616633176804) },
151 { FRAC_CONST(-0.55126774311066), FRAC_CONST(-0.98898541927338) },
152 { FRAC_CONST(0.97960901260376), FRAC_CONST(-0.94021445512772) },
153 { FRAC_CONST(-0.99196308851242), FRAC_CONST(0.67019015550613) },
154 { FRAC_CONST(-0.67684930562973), FRAC_CONST(0.12631492316723) },
155 { FRAC_CONST(0.09140039235353), FRAC_CONST(-0.20537731051445) },
156 { FRAC_CONST(-0.71658962965012), FRAC_CONST(-0.97788202762604) },
157 { FRAC_CONST(0.81014639139175), FRAC_CONST(0.53722649812698) },
158 { FRAC_CONST(0.40616992115974), FRAC_CONST(-0.26469007134438) },
159 { FRAC_CONST(-0.67680186033249), FRAC_CONST(0.94502049684525) },
160 { FRAC_CONST(0.86849772930145), FRAC_CONST(-0.18333598971367) },
161 { FRAC_CONST(-0.99500381946564), FRAC_CONST(-0.02634122036397) },
162 { FRAC_CONST(0.84329187870026), FRAC_CONST(0.10406957566738) },
163 { FRAC_CONST(-0.09215968847275), FRAC_CONST(0.69540011882782) },
164 { FRAC_CONST(0.99956172704697), FRAC_CONST(-0.12358541786671) },
165 { FRAC_CONST(-0.79732781648636), FRAC_CONST(-0.91582524776459) },
166 { FRAC_CONST(0.96349972486496), FRAC_CONST(0.96640455722809) },
167 { FRAC_CONST(-0.79942780733109), FRAC_CONST(0.64323902130127) },
168 { FRAC_CONST(-0.11566039919853), FRAC_CONST(0.28587844967842) },
169 { FRAC_CONST(-0.39922955632210), FRAC_CONST(0.94129604101181) },
170 { FRAC_CONST(0.99089199304581), FRAC_CONST(-0.92062628269196) },
171 { FRAC_CONST(0.28631284832954), FRAC_CONST(-0.91035044193268) },
172 { FRAC_CONST(-0.83302724361420), FRAC_CONST(-0.67330408096313) },
173 { FRAC_CONST(0.95404446125031), FRAC_CONST(0.49162766337395) },
174 { FRAC_CONST(-0.06449863314629), FRAC_CONST(0.03250560909510) },
175 { FRAC_CONST(-0.99575054645538), FRAC_CONST(0.42389783263206) },
176 { FRAC_CONST(-0.65501141548157), FRAC_CONST(0.82546114921570) },
177 { FRAC_CONST(-0.81254440546036), FRAC_CONST(-0.51627236604691) },
178 { FRAC_CONST(-0.99646371603012), FRAC_CONST(0.84490531682968) },
179 { FRAC_CONST(0.00287840608507), FRAC_CONST(0.64768260717392) },
180 { FRAC_CONST(0.70176988840103), FRAC_CONST(-0.20453028380871) },
181 { FRAC_CONST(0.96361881494522), FRAC_CONST(0.40706968307495) },
182 { FRAC_CONST(-0.68883758783340), FRAC_CONST(0.91338956356049) },
183 { FRAC_CONST(-0.34875586628914), FRAC_CONST(0.71472293138504) },
184 { FRAC_CONST(0.91980081796646), FRAC_CONST(0.66507452726364) },
185 { FRAC_CONST(-0.99009048938751), FRAC_CONST(0.85868018865585) },
186 { FRAC_CONST(0.68865793943405), FRAC_CONST(0.55660319328308) },
187 { FRAC_CONST(-0.99484401941299), FRAC_CONST(-0.20052559673786) },
188 { FRAC_CONST(0.94214510917664), FRAC_CONST(-0.99696427583694) },
189 { FRAC_CONST(-0.67414629459381), FRAC_CONST(0.49548220634460) },
190 { FRAC_CONST(-0.47339352965355), FRAC_CONST(-0.85904330015182) },
191 { FRAC_CONST(0.14323651790619), FRAC_CONST(-0.94145596027374) },
192 { FRAC_CONST(-0.29268294572830), FRAC_CONST(0.05759225040674) },
193 { FRAC_CONST(0.43793860077858), FRAC_CONST(-0.78904968500137) },
194 { FRAC_CONST(-0.36345127224922), FRAC_CONST(0.64874434471130) },
195 { FRAC_CONST(-0.08750604838133), FRAC_CONST(0.97686946392059) },
196 { FRAC_CONST(-0.96495270729065), FRAC_CONST(-0.53960305452347) },
197 { FRAC_CONST(0.55526942014694), FRAC_CONST(0.78891521692276) },
198 { FRAC_CONST(0.73538213968277), FRAC_CONST(0.96452075242996) },
199 { FRAC_CONST(-0.30889773368835), FRAC_CONST(-0.80664390325546) },
200 { FRAC_CONST(0.03574995696545), FRAC_CONST(-0.97325617074966) },
201 { FRAC_CONST(0.98720687627792), FRAC_CONST(0.48409134149551) },
202 { FRAC_CONST(-0.81689298152924), FRAC_CONST(-0.90827703475952) },
203 { FRAC_CONST(0.67866861820221), FRAC_CONST(0.81284505128860) },
204 { FRAC_CONST(-0.15808570384979), FRAC_CONST(0.85279554128647) },
205 { FRAC_CONST(0.80723392963409), FRAC_CONST(-0.24717418849468) },
206 { FRAC_CONST(0.47788757085800), FRAC_CONST(-0.46333149075508) },
207 { FRAC_CONST(0.96367555856705), FRAC_CONST(0.38486748933792) },
208 { FRAC_CONST(-0.99143874645233), FRAC_CONST(-0.24945276975632) },
209 { FRAC_CONST(0.83081877231598), FRAC_CONST(-0.94780850410461) },
210 { FRAC_CONST(-0.58753192424774), FRAC_CONST(0.01290772389621) },
211 { FRAC_CONST(0.95538109540939), FRAC_CONST(-0.85557049512863) },
212 { FRAC_CONST(-0.96490919589996), FRAC_CONST(-0.64020973443985) },
213 { FRAC_CONST(-0.97327101230621), FRAC_CONST(0.12378127872944) },
214 { FRAC_CONST(0.91400367021561), FRAC_CONST(0.57972472906113) },
215 { FRAC_CONST(-0.99925839900970), FRAC_CONST(0.71084845066071) },
216 { FRAC_CONST(-0.86875903606415), FRAC_CONST(-0.20291699469090) },
217 { FRAC_CONST(-0.26240035891533), FRAC_CONST(-0.68264555931091) },
218 { FRAC_CONST(-0.24664412438869), FRAC_CONST(-0.87642270326614) },
219 { FRAC_CONST(0.02416275814176), FRAC_CONST(0.27192914485931) },
220 { FRAC_CONST(0.82068622112274), FRAC_CONST(-0.85087788105011) },
221 { FRAC_CONST(0.88547372817993), FRAC_CONST(-0.89636802673340) },
222 { FRAC_CONST(-0.18173077702522), FRAC_CONST(-0.26152145862579) },
223 { FRAC_CONST(0.09355476498604), FRAC_CONST(0.54845124483109) },
224 { FRAC_CONST(-0.54668414592743), FRAC_CONST(0.95980775356293) },
225 { FRAC_CONST(0.37050989270210), FRAC_CONST(-0.59910142421722) },
226 { FRAC_CONST(-0.70373594760895), FRAC_CONST(0.91227668523788) },
227 { FRAC_CONST(-0.34600785374641), FRAC_CONST(-0.99441426992416) },
228 { FRAC_CONST(-0.68774479627609), FRAC_CONST(-0.30238837003708) },
229 { FRAC_CONST(-0.26843291521072), FRAC_CONST(0.83115667104721) },
230 { FRAC_CONST(0.49072334170341), FRAC_CONST(-0.45359709858894) },
231 { FRAC_CONST(0.38975992798805), FRAC_CONST(0.95515358448029) },
232 { FRAC_CONST(-0.97757124900818), FRAC_CONST(0.05305894464254) },
233 { FRAC_CONST(-0.17325553297997), FRAC_CONST(-0.92770671844482) },
234 { FRAC_CONST(0.99948036670685), FRAC_CONST(0.58285546302795) },
235 { FRAC_CONST(-0.64946246147156), FRAC_CONST(0.68645507097244) },
236 { FRAC_CONST(-0.12016920745373), FRAC_CONST(-0.57147324085236) },
237 { FRAC_CONST(-0.58947455883026), FRAC_CONST(-0.34847131371498) },
238 { FRAC_CONST(-0.41815140843391), FRAC_CONST(0.16276422142982) },
239 { FRAC_CONST(0.99885648488998), FRAC_CONST(0.11136095225811) },
240 { FRAC_CONST(-0.56649613380432), FRAC_CONST(-0.90494865179062) },
241 { FRAC_CONST(0.94138020277023), FRAC_CONST(0.35281917452812) },
242 { FRAC_CONST(-0.75725078582764), FRAC_CONST(0.53650552034378) },
243 { FRAC_CONST(0.20541973412037), FRAC_CONST(-0.94435143470764) },
244 { FRAC_CONST(0.99980372190475), FRAC_CONST(0.79835915565491) },
245 { FRAC_CONST(0.29078277945518), FRAC_CONST(0.35393777489662) },
246 { FRAC_CONST(-0.62858772277832), FRAC_CONST(0.38765692710876) },
247 { FRAC_CONST(0.43440905213356), FRAC_CONST(-0.98546332120895) },
248 { FRAC_CONST(-0.98298585414886), FRAC_CONST(0.21021524071693) },
249 { FRAC_CONST(0.19513028860092), FRAC_CONST(-0.94239830970764) },
250 { FRAC_CONST(-0.95476663112640), FRAC_CONST(0.98364555835724) },
251 { FRAC_CONST(0.93379634618759), FRAC_CONST(-0.70881992578506) },
252 { FRAC_CONST(-0.85235410928726), FRAC_CONST(-0.08342348039150) },
253 { FRAC_CONST(-0.86425095796585), FRAC_CONST(-0.45795026421547) },
254 { FRAC_CONST(0.38879778981209), FRAC_CONST(0.97274428606033) },
255 { FRAC_CONST(0.92045122385025), FRAC_CONST(-0.62433654069901) },
256 { FRAC_CONST(0.89162534475327), FRAC_CONST(0.54950958490372) },
257 { FRAC_CONST(-0.36834338307381), FRAC_CONST(0.96458297967911) },
258 { FRAC_CONST(0.93891763687134), FRAC_CONST(-0.89968353509903) },
259 { FRAC_CONST(0.99267655611038), FRAC_CONST(-0.03757034242153) },
260 { FRAC_CONST(-0.94063472747803), FRAC_CONST(0.41332337260246) },
261 { FRAC_CONST(0.99740225076675), FRAC_CONST(-0.16830494999886) },
262 { FRAC_CONST(-0.35899412631989), FRAC_CONST(-0.46633225679398) },
263 { FRAC_CONST(0.05237237364054), FRAC_CONST(-0.25640362501144) },
264 { FRAC_CONST(0.36703583598137), FRAC_CONST(-0.38653266429901) },
265 { FRAC_CONST(0.91653180122375), FRAC_CONST(-0.30587628483772) },
266 { FRAC_CONST(0.69000804424286), FRAC_CONST(0.90952169895172) },
267 { FRAC_CONST(-0.38658750057220), FRAC_CONST(0.99501574039459) },
268 { FRAC_CONST(-0.29250815510750), FRAC_CONST(0.37444993853569) },
269 { FRAC_CONST(-0.60182201862335), FRAC_CONST(0.86779648065567) },
270 { FRAC_CONST(-0.97418588399887), FRAC_CONST(0.96468526124954) },
271 { FRAC_CONST(0.88461571931839), FRAC_CONST(0.57508403062820) },
272 { FRAC_CONST(0.05198933184147), FRAC_CONST(0.21269661188126) },
273 { FRAC_CONST(-0.53499621152878), FRAC_CONST(0.97241556644440) },
274 { FRAC_CONST(-0.49429559707642), FRAC_CONST(0.98183864355087) },
275 { FRAC_CONST(-0.98935145139694), FRAC_CONST(-0.40249159932137) },
276 { FRAC_CONST(-0.98081380128860), FRAC_CONST(-0.72856897115707) },
277 { FRAC_CONST(-0.27338150143623), FRAC_CONST(0.99950921535492) },
278 { FRAC_CONST(0.06310802698135), FRAC_CONST(-0.54539585113525) },
279 { FRAC_CONST(-0.20461677014828), FRAC_CONST(-0.14209978282452) },
280 { FRAC_CONST(0.66223841905594), FRAC_CONST(0.72528582811356) },
281 { FRAC_CONST(-0.84764343500137), FRAC_CONST(0.02372316829860) },
282 { FRAC_CONST(-0.89039862155914), FRAC_CONST(0.88866579532623) },
283 { FRAC_CONST(0.95903307199478), FRAC_CONST(0.76744925975800) },
284 { FRAC_CONST(0.73504126071930), FRAC_CONST(-0.03747203201056) },
285 { FRAC_CONST(-0.31744435429573), FRAC_CONST(-0.36834111809731) },
286 { FRAC_CONST(-0.34110826253891), FRAC_CONST(0.40211221575737) },
287 { FRAC_CONST(0.47803884744644), FRAC_CONST(-0.39423218369484) },
288 { FRAC_CONST(0.98299193382263), FRAC_CONST(0.01989791356027) },
289 { FRAC_CONST(-0.30963072180748), FRAC_CONST(-0.18076720833778) },
290 { FRAC_CONST(0.99992591142654), FRAC_CONST(-0.26281872391701) },
291 { FRAC_CONST(-0.93149733543396), FRAC_CONST(-0.98313164710999) },
292 { FRAC_CONST(0.99923473596573), FRAC_CONST(-0.80142992734909) },
293 { FRAC_CONST(-0.26024168729782), FRAC_CONST(-0.75999760627747) },
294 { FRAC_CONST(-0.35712513327599), FRAC_CONST(0.19298963248730) },
295 { FRAC_CONST(-0.99899083375931), FRAC_CONST(0.74645155668259) },
296 { FRAC_CONST(0.86557173728943), FRAC_CONST(0.55593866109848) },
297 { FRAC_CONST(0.33408042788506), FRAC_CONST(0.86185956001282) },
298 { FRAC_CONST(0.99010735750198), FRAC_CONST(0.04602397605777) },
299 { FRAC_CONST(-0.66694271564484), FRAC_CONST(-0.91643613576889) },
300 { FRAC_CONST(0.64016789197922), FRAC_CONST(0.15649530291557) },
301 { FRAC_CONST(0.99570536613464), FRAC_CONST(0.45844584703445) },
302 { FRAC_CONST(-0.63431465625763), FRAC_CONST(0.21079117059708) },
303 { FRAC_CONST(-0.07706847041845), FRAC_CONST(-0.89581435918808) },
304 { FRAC_CONST(0.98590087890625), FRAC_CONST(0.88241720199585) },
305 { FRAC_CONST(0.80099332332611), FRAC_CONST(-0.36851897835732) },
306 { FRAC_CONST(0.78368133306503), FRAC_CONST(0.45506998896599) },
307 { FRAC_CONST(0.08707806468010), FRAC_CONST(0.80938994884491) },
308 { FRAC_CONST(-0.86811882257462), FRAC_CONST(0.39347308874130) },
309 { FRAC_CONST(-0.39466530084610), FRAC_CONST(-0.66809433698654) },
310 { FRAC_CONST(0.97875326871872), FRAC_CONST(-0.72467839717865) },
311 { FRAC_CONST(-0.95038563013077), FRAC_CONST(0.89563220739365) },
312 { FRAC_CONST(0.17005239427090), FRAC_CONST(0.54683053493500) },
313 { FRAC_CONST(-0.76910793781281), FRAC_CONST(-0.96226614713669) },
314 { FRAC_CONST(0.99743282794952), FRAC_CONST(0.42697158455849) },
315 { FRAC_CONST(0.95437383651733), FRAC_CONST(0.97002321481705) },
316 { FRAC_CONST(0.99578905105591), FRAC_CONST(-0.54106825590134) },
317 { FRAC_CONST(0.28058260679245), FRAC_CONST(-0.85361421108246) },
318 { FRAC_CONST(0.85256522893906), FRAC_CONST(-0.64567607641220) },
319 { FRAC_CONST(-0.50608539581299), FRAC_CONST(-0.65846014022827) },
320 { FRAC_CONST(-0.97210735082626), FRAC_CONST(-0.23095212876797) },
321 { FRAC_CONST(0.95424050092697), FRAC_CONST(-0.99240148067474) },
322 { FRAC_CONST(-0.96926569938660), FRAC_CONST(0.73775655031204) },
323 { FRAC_CONST(0.30872163176537), FRAC_CONST(0.41514959931374) },
324 { FRAC_CONST(-0.24523839354515), FRAC_CONST(0.63206630945206) },
325 { FRAC_CONST(-0.33813264966011), FRAC_CONST(-0.38661777973175) },
326 { FRAC_CONST(-0.05826828256249), FRAC_CONST(-0.06940773874521) },
327 { FRAC_CONST(-0.22898460924625), FRAC_CONST(0.97054851055145) },
328 { FRAC_CONST(-0.18509915471077), FRAC_CONST(0.47565764188766) },
329 { FRAC_CONST(-0.10488238185644), FRAC_CONST(-0.87769949436188) },
330 { FRAC_CONST(-0.71886587142944), FRAC_CONST(0.78030979633331) },
331 { FRAC_CONST(0.99793875217438), FRAC_CONST(0.90041309595108) },
332 { FRAC_CONST(0.57563304901123), FRAC_CONST(-0.91034334897995) },
333 { FRAC_CONST(0.28909647464752), FRAC_CONST(0.96307784318924) },
334 { FRAC_CONST(0.42188999056816), FRAC_CONST(0.48148649930954) },
335 { FRAC_CONST(0.93335050344467), FRAC_CONST(-0.43537023663521) },
336 { FRAC_CONST(-0.97087377309799), FRAC_CONST(0.86636447906494) },
337 { FRAC_CONST(0.36722871661186), FRAC_CONST(0.65291655063629) },
338 { FRAC_CONST(-0.81093025207520), FRAC_CONST(0.08778370171785) },
339 { FRAC_CONST(-0.26240602135658), FRAC_CONST(-0.92774093151093) },
340 { FRAC_CONST(0.83996498584747), FRAC_CONST(0.55839848518372) },
341 { FRAC_CONST(-0.99909615516663), FRAC_CONST(-0.96024608612061) },
342 { FRAC_CONST(0.74649465084076), FRAC_CONST(0.12144893407822) },
343 { FRAC_CONST(-0.74774593114853), FRAC_CONST(-0.26898062229156) },
344 { FRAC_CONST(0.95781666040421), FRAC_CONST(-0.79047924280167) },
345 { FRAC_CONST(0.95472306013107), FRAC_CONST(-0.08588775992393) },
346 { FRAC_CONST(0.48708331584930), FRAC_CONST(0.99999040365219) },
347 { FRAC_CONST(0.46332037448883), FRAC_CONST(0.10964126139879) },
348 { FRAC_CONST(-0.76497006416321), FRAC_CONST(0.89210927486420) },
349 { FRAC_CONST(0.57397389411926), FRAC_CONST(0.35289704799652) },
350 { FRAC_CONST(0.75374317169189), FRAC_CONST(0.96705216169357) },
351 { FRAC_CONST(-0.59174400568008), FRAC_CONST(-0.89405369758606) },
352 { FRAC_CONST(0.75087904930115), FRAC_CONST(-0.29612672328949) },
353 { FRAC_CONST(-0.98607856035233), FRAC_CONST(0.25034910440445) },
354 { FRAC_CONST(-0.40761056542397), FRAC_CONST(-0.90045571327209) },
355 { FRAC_CONST(0.66929268836975), FRAC_CONST(0.98629492521286) },
356 { FRAC_CONST(-0.97463697195053), FRAC_CONST(-0.00190223299433) },
357 { FRAC_CONST(0.90145510435104), FRAC_CONST(0.99781388044357) },
358 { FRAC_CONST(-0.87259286642075), FRAC_CONST(0.99233585596085) },
359 { FRAC_CONST(-0.91529458761215), FRAC_CONST(-0.15698707103729) },
360 { FRAC_CONST(-0.03305738791823), FRAC_CONST(-0.37205263972282) },
361 { FRAC_CONST(0.07223051041365), FRAC_CONST(-0.88805001974106) },
362 { FRAC_CONST(0.99498009681702), FRAC_CONST(0.97094357013702) },
363 { FRAC_CONST(-0.74904936552048), FRAC_CONST(0.99985486268997) },
364 { FRAC_CONST(0.04585228487849), FRAC_CONST(0.99812334775925) },
365 { FRAC_CONST(-0.89054954051971), FRAC_CONST(-0.31791913509369) },
366 { FRAC_CONST(-0.83782142400742), FRAC_CONST(0.97637635469437) },
367 { FRAC_CONST(0.33454805612564), FRAC_CONST(-0.86231517791748) },
368 { FRAC_CONST(-0.99707579612732), FRAC_CONST(0.93237990140915) },
369 { FRAC_CONST(-0.22827528417110), FRAC_CONST(0.18874759972095) },
370 { FRAC_CONST(0.67248046398163), FRAC_CONST(-0.03646211326122) },
371 { FRAC_CONST(-0.05146538093686), FRAC_CONST(-0.92599701881409) },
372 { FRAC_CONST(0.99947297573090), FRAC_CONST(0.93625229597092) },
373 { FRAC_CONST(0.66951125860214), FRAC_CONST(0.98905825614929) },
374 { FRAC_CONST(-0.99602955579758), FRAC_CONST(-0.44654715061188) },
375 { FRAC_CONST(0.82104903459549), FRAC_CONST(0.99540740251541) },
376 { FRAC_CONST(0.99186509847641), FRAC_CONST(0.72022998332977) },
377 { FRAC_CONST(-0.65284591913223), FRAC_CONST(0.52186721563339) },
378 { FRAC_CONST(0.93885445594788), FRAC_CONST(-0.74895310401917) },
379 { FRAC_CONST(0.96735250949860), FRAC_CONST(0.90891814231873) },
380 { FRAC_CONST(-0.22225968539715), FRAC_CONST(0.57124030590057) },
381 { FRAC_CONST(-0.44132784008980), FRAC_CONST(-0.92688840627670) },
382 { FRAC_CONST(-0.85694974660873), FRAC_CONST(0.88844531774521) },
383 { FRAC_CONST(0.91783040761948), FRAC_CONST(-0.46356892585754) },
384 { FRAC_CONST(0.72556972503662), FRAC_CONST(-0.99899554252625) },
385 { FRAC_CONST(-0.99711579084396), FRAC_CONST(0.58211559057236) },
386 { FRAC_CONST(0.77638977766037), FRAC_CONST(0.94321835041046) },
387 { FRAC_CONST(0.07717324048281), FRAC_CONST(0.58638399839401) },
388 { FRAC_CONST(-0.56049829721451), FRAC_CONST(0.82522302865982) },
389 { FRAC_CONST(0.98398894071579), FRAC_CONST(0.39467439055443) },
390 { FRAC_CONST(0.47546947002411), FRAC_CONST(0.68613046407700) },
391 { FRAC_CONST(0.65675091743469), FRAC_CONST(0.18331636488438) },
392 { FRAC_CONST(0.03273375332355), FRAC_CONST(-0.74933111667633) },
393 { FRAC_CONST(-0.38684144616127), FRAC_CONST(0.51337349414825) },
394 { FRAC_CONST(-0.97346270084381), FRAC_CONST(-0.96549361944199) },
395 { FRAC_CONST(-0.53282153606415), FRAC_CONST(-0.91423267126083) },
396 { FRAC_CONST(0.99817311763763), FRAC_CONST(0.61133575439453) },
397 { FRAC_CONST(-0.50254499912262), FRAC_CONST(-0.88829338550568) },
398 { FRAC_CONST(0.01995873264968), FRAC_CONST(0.85223513841629) },
399 { FRAC_CONST(0.99930381774902), FRAC_CONST(0.94578897953033) },
400 { FRAC_CONST(0.82907766103745), FRAC_CONST(-0.06323442608118) },
401 { FRAC_CONST(-0.58660709857941), FRAC_CONST(0.96840775012970) },
402 { FRAC_CONST(-0.17573736608028), FRAC_CONST(-0.48166921734810) },
403 { FRAC_CONST(0.83434289693832), FRAC_CONST(-0.13023450970650) },
404 { FRAC_CONST(0.05946491286159), FRAC_CONST(0.20511047542095) },
405 { FRAC_CONST(0.81505483388901), FRAC_CONST(-0.94685947895050) },
406 { FRAC_CONST(-0.44976380467415), FRAC_CONST(0.40894573926926) },
407 { FRAC_CONST(-0.89746475219727), FRAC_CONST(0.99846577644348) },
408 { FRAC_CONST(0.39677256345749), FRAC_CONST(-0.74854665994644) },
409 { FRAC_CONST(-0.07588948309422), FRAC_CONST(0.74096214771271) },
410 { FRAC_CONST(0.76343196630478), FRAC_CONST(0.41746628284454) },
411 { FRAC_CONST(-0.74490106105804), FRAC_CONST(0.94725912809372) },
412 { FRAC_CONST(0.64880120754242), FRAC_CONST(0.41336661577225) },
413 { FRAC_CONST(0.62319535017014), FRAC_CONST(-0.93098312616348) },
414 { FRAC_CONST(0.42215818166733), FRAC_CONST(-0.07712787389755) },
415 { FRAC_CONST(0.02704554051161), FRAC_CONST(-0.05417517945170) },
416 { FRAC_CONST(0.80001771450043), FRAC_CONST(0.91542196273804) },
417 { FRAC_CONST(-0.79351830482483), FRAC_CONST(-0.36208897829056) },
418 { FRAC_CONST(0.63872361183167), FRAC_CONST(0.08128252625465) },
419 { FRAC_CONST(0.52890521287918), FRAC_CONST(0.60048872232437) },
420 { FRAC_CONST(0.74238550662994), FRAC_CONST(0.04491915181279) },
421 { FRAC_CONST(0.99096131324768), FRAC_CONST(-0.19451183080673) },
422 { FRAC_CONST(-0.80412328243256), FRAC_CONST(-0.88513815402985) },
423 { FRAC_CONST(-0.64612615108490), FRAC_CONST(0.72198677062988) },
424 { FRAC_CONST(0.11657770723104), FRAC_CONST(-0.83662831783295) },
425 { FRAC_CONST(-0.95053184032440), FRAC_CONST(-0.96939903497696) },
426 { FRAC_CONST(-0.62228870391846), FRAC_CONST(0.82767260074615) },
427 { FRAC_CONST(0.03004475869238), FRAC_CONST(-0.99738895893097) },
428 { FRAC_CONST(-0.97987216711044), FRAC_CONST(0.36526128649712) },
429 { FRAC_CONST(-0.99986982345581), FRAC_CONST(-0.36021611094475) },
430 { FRAC_CONST(0.89110648632050), FRAC_CONST(-0.97894251346588) },
431 { FRAC_CONST(0.10407960414886), FRAC_CONST(0.77357792854309) },
432 { FRAC_CONST(0.95964735746384), FRAC_CONST(-0.35435819625854) },
433 { FRAC_CONST(0.50843232870102), FRAC_CONST(0.96107691526413) },
434 { FRAC_CONST(0.17006334662437), FRAC_CONST(-0.76854026317596) },
435 { FRAC_CONST(0.25872674584389), FRAC_CONST(0.99893301725388) },
436 { FRAC_CONST(-0.01115998718888), FRAC_CONST(0.98496019840240) },
437 { FRAC_CONST(-0.79598701000214), FRAC_CONST(0.97138410806656) },
438 { FRAC_CONST(-0.99264711141586), FRAC_CONST(-0.99542820453644) },
439 { FRAC_CONST(-0.99829661846161), FRAC_CONST(0.01877138763666) },
440 { FRAC_CONST(-0.70801013708115), FRAC_CONST(0.33680686354637) },
441 { FRAC_CONST(-0.70467054843903), FRAC_CONST(0.93272775411606) },
442 { FRAC_CONST(0.99846023321152), FRAC_CONST(-0.98725748062134) },
443 { FRAC_CONST(-0.63364970684052), FRAC_CONST(-0.16473594307899) },
444 { FRAC_CONST(-0.16258217394352), FRAC_CONST(-0.95939123630524) },
445 { FRAC_CONST(-0.43645593523979), FRAC_CONST(-0.94805032014847) },
446 { FRAC_CONST(-0.99848473072052), FRAC_CONST(0.96245169639587) },
447 { FRAC_CONST(-0.16796459257603), FRAC_CONST(-0.98987513780594) },
448 { FRAC_CONST(-0.87979227304459), FRAC_CONST(-0.71725726127625) },
449 { FRAC_CONST(0.44183099269867), FRAC_CONST(-0.93568974733353) },
450 { FRAC_CONST(0.93310177326202), FRAC_CONST(-0.99913311004639) },
451 { FRAC_CONST(-0.93941932916641), FRAC_CONST(-0.56409376859665) },
452 { FRAC_CONST(-0.88590002059937), FRAC_CONST(0.47624599933624) },
453 { FRAC_CONST(0.99971461296082), FRAC_CONST(-0.83889955282211) },
454 { FRAC_CONST(-0.75376385450363), FRAC_CONST(0.00814643409103) },
455 { FRAC_CONST(0.93887686729431), FRAC_CONST(-0.11284527927637) },
456 { FRAC_CONST(0.85126435756683), FRAC_CONST(0.52349251508713) },
457 { FRAC_CONST(0.39701420068741), FRAC_CONST(0.81779634952545) },
458 { FRAC_CONST(-0.37024465203285), FRAC_CONST(-0.87071657180786) },
459 { FRAC_CONST(-0.36024826765060), FRAC_CONST(0.34655734896660) },
460 { FRAC_CONST(-0.93388813734055), FRAC_CONST(-0.84476542472839) },
461 { FRAC_CONST(-0.65298801660538), FRAC_CONST(-0.18439576029778) },
462 { FRAC_CONST(0.11960318684578), FRAC_CONST(0.99899345636368) },
463 { FRAC_CONST(0.94292563199997), FRAC_CONST(0.83163905143738) },
464 { FRAC_CONST(0.75081145763397), FRAC_CONST(-0.35533222556114) },
465 { FRAC_CONST(0.56721979379654), FRAC_CONST(-0.24076835811138) },
466 { FRAC_CONST(0.46857765316963), FRAC_CONST(-0.30140233039856) },
467 { FRAC_CONST(0.97312313318253), FRAC_CONST(-0.99548190832138) },
468 { FRAC_CONST(-0.38299977779388), FRAC_CONST(0.98516911268234) },
469 { FRAC_CONST(0.41025799512863), FRAC_CONST(0.02116736955941) },
470 { FRAC_CONST(0.09638062119484), FRAC_CONST(0.04411984235048) },
471 { FRAC_CONST(-0.85283249616623), FRAC_CONST(0.91475564241409) },
472 { FRAC_CONST(0.88866806030273), FRAC_CONST(-0.99735265970230) },
473 { FRAC_CONST(-0.48202428221703), FRAC_CONST(-0.96805608272552) },
474 { FRAC_CONST(0.27572581171989), FRAC_CONST(0.58634752035141) },
475 { FRAC_CONST(-0.65889132022858), FRAC_CONST(0.58835631608963) },
476 { FRAC_CONST(0.98838084936142), FRAC_CONST(0.99994349479675) },
477 { FRAC_CONST(-0.20651349425316), FRAC_CONST(0.54593044519424) },
478 { FRAC_CONST(-0.62126415967941), FRAC_CONST(-0.59893679618835) },
479 { FRAC_CONST(0.20320105552673), FRAC_CONST(-0.86879181861877) },
480 { FRAC_CONST(-0.97790551185608), FRAC_CONST(0.96290808916092) },
481 { FRAC_CONST(0.11112534999847), FRAC_CONST(0.21484763920307) },
482 { FRAC_CONST(-0.41368338465691), FRAC_CONST(0.28216838836670) },
483 { FRAC_CONST(0.24133038520813), FRAC_CONST(0.51294362545013) },
484 { FRAC_CONST(-0.66393411159515), FRAC_CONST(-0.08249679952860) },
485 { FRAC_CONST(-0.53697830438614), FRAC_CONST(-0.97649902105331) },
486 { FRAC_CONST(-0.97224736213684), FRAC_CONST(0.22081333398819) },
487 { FRAC_CONST(0.87392479181290), FRAC_CONST(-0.12796173989773) },
488 { FRAC_CONST(0.19050361216068), FRAC_CONST(0.01602615416050) },
489 { FRAC_CONST(-0.46353441476822), FRAC_CONST(-0.95249038934708) },
490 { FRAC_CONST(-0.07064096629620), FRAC_CONST(-0.94479805231094) },
491 { FRAC_CONST(-0.92444086074829), FRAC_CONST(-0.10457590222359) },
492 { FRAC_CONST(-0.83822596073151), FRAC_CONST(-0.01695043221116) },
493 { FRAC_CONST(0.75214684009552), FRAC_CONST(-0.99955683946609) },
494 { FRAC_CONST(-0.42102998495102), FRAC_CONST(0.99720942974091) },
495 { FRAC_CONST(-0.72094786167145), FRAC_CONST(-0.35008960962296) },
496 { FRAC_CONST(0.78843313455582), FRAC_CONST(0.52851396799088) },
497 { FRAC_CONST(0.97394025325775), FRAC_CONST(-0.26695942878723) },
498 { FRAC_CONST(0.99206465482712), FRAC_CONST(-0.57010120153427) },
499 { FRAC_CONST(0.76789611577988), FRAC_CONST(-0.76519358158112) },
500 { FRAC_CONST(-0.82002419233322), FRAC_CONST(-0.73530179262161) },
501 { FRAC_CONST(0.81924992799759), FRAC_CONST(0.99698424339294) },
502 { FRAC_CONST(-0.26719850301743), FRAC_CONST(0.68903368711472) },
503 { FRAC_CONST(-0.43311259150505), FRAC_CONST(0.85321813821793) },
504 { FRAC_CONST(0.99194979667664), FRAC_CONST(0.91876250505447) },
505 { FRAC_CONST(-0.80691999197006), FRAC_CONST(-0.32627540826797) },
506 { FRAC_CONST(0.43080005049706), FRAC_CONST(-0.21919095516205) },
507 { FRAC_CONST(0.67709493637085), FRAC_CONST(-0.95478075742722) },
508 { FRAC_CONST(0.56151771545410), FRAC_CONST(-0.70693808794022) },
509 { FRAC_CONST(0.10831862688065), FRAC_CONST(-0.08628837019205) },
510 { FRAC_CONST(0.91229414939880), FRAC_CONST(-0.65987348556519) },
511 { FRAC_CONST(-0.48972892761230), FRAC_CONST(0.56289243698120) },
512 { FRAC_CONST(-0.89033657312393), FRAC_CONST(-0.71656566858292) },
513 { FRAC_CONST(0.65269446372986), FRAC_CONST(0.65916007757187) },
514 { FRAC_CONST(0.67439478635788), FRAC_CONST(-0.81684380769730) },
515 { FRAC_CONST(-0.47770830988884), FRAC_CONST(-0.16789555549622) },
516 { FRAC_CONST(-0.99715977907181), FRAC_CONST(-0.93565785884857) },
517 { FRAC_CONST(-0.90889590978622), FRAC_CONST(0.62034398317337) },
518 { FRAC_CONST(-0.06618622690439), FRAC_CONST(-0.23812216520309) },
519 { FRAC_CONST(0.99430269002914), FRAC_CONST(0.18812555074692) },
520 { FRAC_CONST(0.97686403989792), FRAC_CONST(-0.28664535284042) },
521 { FRAC_CONST(0.94813650846481), FRAC_CONST(-0.97506642341614) },
522 { FRAC_CONST(-0.95434498786926), FRAC_CONST(-0.79607981443405) },
523 { FRAC_CONST(-0.49104782938957), FRAC_CONST(0.32895213365555) },
524 { FRAC_CONST(0.99881172180176), FRAC_CONST(0.88993984460831) },
525 { FRAC_CONST(0.50449168682098), FRAC_CONST(-0.85995072126389) },
526 { FRAC_CONST(0.47162890434265), FRAC_CONST(-0.18680204451084) },
527 { FRAC_CONST(-0.62081581354141), FRAC_CONST(0.75000673532486) },
528 { FRAC_CONST(-0.43867015838623), FRAC_CONST(0.99998068809509) },
529 { FRAC_CONST(0.98630565404892), FRAC_CONST(-0.53578901290894) },
530 { FRAC_CONST(-0.61510360240936), FRAC_CONST(-0.89515018463135) },
531 { FRAC_CONST(-0.03841517493129), FRAC_CONST(-0.69888818264008) },
532 { FRAC_CONST(-0.30102157592773), FRAC_CONST(-0.07667808979750) },
533 { FRAC_CONST(0.41881284117699), FRAC_CONST(0.02188098989427) },
534 { FRAC_CONST(-0.86135452985764), FRAC_CONST(0.98947483301163) },
535 { FRAC_CONST(0.67226862907410), FRAC_CONST(-0.13494388759136) },
536 { FRAC_CONST(-0.70737397670746), FRAC_CONST(-0.76547348499298) },
537 { FRAC_CONST(0.94044947624207), FRAC_CONST(0.09026201069355) },
538 { FRAC_CONST(-0.82386350631714), FRAC_CONST(0.08924768865108) },
539 { FRAC_CONST(-0.32070666551590), FRAC_CONST(0.50143420696259) },
540 { FRAC_CONST(0.57593160867691), FRAC_CONST(-0.98966425657272) },
541 { FRAC_CONST(-0.36326017975807), FRAC_CONST(0.07440242916346) },
542 { FRAC_CONST(0.99979043006897), FRAC_CONST(-0.14130286872387) },
543 { FRAC_CONST(-0.92366021871567), FRAC_CONST(-0.97979295253754) },
544 { FRAC_CONST(-0.44607177376747), FRAC_CONST(-0.54233253002167) },
545 { FRAC_CONST(0.44226801395416), FRAC_CONST(0.71326756477356) },
546 { FRAC_CONST(0.03671907261014), FRAC_CONST(0.63606387376785) },
547 { FRAC_CONST(0.52175426483154), FRAC_CONST(-0.85396826267242) },
548 { FRAC_CONST(-0.94701141119003), FRAC_CONST(-0.01826348155737) },
549 { FRAC_CONST(-0.98759609460831), FRAC_CONST(0.82288712263107) },
550 { FRAC_CONST(0.87434792518616), FRAC_CONST(0.89399492740631) },
551 { FRAC_CONST(-0.93412041664124), FRAC_CONST(0.41374051570892) },
552 { FRAC_CONST(0.96063941717148), FRAC_CONST(0.93116706609726) },
553 { FRAC_CONST(0.97534251213074), FRAC_CONST(0.86150932312012) },
554 { FRAC_CONST(0.99642467498779), FRAC_CONST(0.70190042257309) },
555 { FRAC_CONST(-0.94705086946487), FRAC_CONST(-0.29580041766167) },
556 { FRAC_CONST(0.91599804162979), FRAC_CONST(-0.98147833347321) }
557 };
558
559 #ifdef __cplusplus
560
561 #endif
562 #endif
563
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_qmf.c,v 1.32 2007/11/01 12:33:36 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #ifdef SBR_DEC
34
35
36 #include <stdlib.h>
37 #include <string.h>
38 #include "sbr_dct.h"
39 #include "sbr_qmf.h"
40 #include "sbr_qmf_c.h"
41 #include "sbr_syntax.h"
42
43 qmfa_info *qmfa_init(uint8_t channels)
44 {
45 qmfa_info *qmfa = (qmfa_info*)faad_malloc(sizeof(qmfa_info));
46
47 /* x is implemented as double ringbuffer */
48 qmfa->x = (real_t*)faad_malloc(2 * channels * 10 * sizeof(real_t));
49 memset(qmfa->x, 0, 2 * channels * 10 * sizeof(real_t));
50
51 /* ringbuffer index */
52 qmfa->x_index = 0;
53
54 qmfa->channels = channels;
55
56 return qmfa;
57 }
58
59 void qmfa_end(qmfa_info *qmfa)
60 {
61 if (qmfa)
62 {
63 if (qmfa->x) faad_free(qmfa->x);
64 faad_free(qmfa);
65 }
66 }
67
68 void sbr_qmf_analysis_32(sbr_info *sbr, qmfa_info *qmfa, const real_t *input,
69 qmf_t X[MAX_NTSRHFG][64], uint8_t offset, uint8_t kx)
70 {
71 ALIGN real_t u[64];
72 #ifndef SBR_LOW_POWER
73 ALIGN real_t in_real[32], in_imag[32], out_real[32], out_imag[32];
74 #else
75 ALIGN real_t y[32];
76 #endif
77 uint32_t in = 0;
78 uint8_t l;
79
80 /* qmf subsample l */
81 for (l = 0; l < sbr->numTimeSlotsRate; l++)
82 {
83 int16_t n;
84
85 /* shift input buffer x */
86 /* input buffer is not shifted anymore, x is implemented as double ringbuffer */
87 //memmove(qmfa->x + 32, qmfa->x, (320-32)*sizeof(real_t));
88
89 /* add new samples to input buffer x */
90 for (n = 32 - 1; n >= 0; n--)
91 {
92 #ifdef FIXED_POINT
93 qmfa->x[qmfa->x_index + n] = qmfa->x[qmfa->x_index + n + 320] = (input[in++]) >> 4;
94 #else
95 qmfa->x[qmfa->x_index + n] = qmfa->x[qmfa->x_index + n + 320] = input[in++];
96 #endif
97 }
98
99 /* window and summation to create array u */
100 for (n = 0; n < 64; n++)
101 {
102 u[n] = MUL_F(qmfa->x[qmfa->x_index + n], qmf_c[2*n]) +
103 MUL_F(qmfa->x[qmfa->x_index + n + 64], qmf_c[2*(n + 64)]) +
104 MUL_F(qmfa->x[qmfa->x_index + n + 128], qmf_c[2*(n + 128)]) +
105 MUL_F(qmfa->x[qmfa->x_index + n + 192], qmf_c[2*(n + 192)]) +
106 MUL_F(qmfa->x[qmfa->x_index + n + 256], qmf_c[2*(n + 256)]);
107 }
108
109 /* update ringbuffer index */
110 qmfa->x_index -= 32;
111 if (qmfa->x_index < 0)
112 qmfa->x_index = (320-32);
113
114 /* calculate 32 subband samples by introducing X */
115 #ifdef SBR_LOW_POWER
116 y[0] = u[48];
117 for (n = 1; n < 16; n++)
118 y[n] = u[n+48] + u[48-n];
119 for (n = 16; n < 32; n++)
120 y[n] = -u[n-16] + u[48-n];
121
122 DCT3_32_unscaled(u, y);
123
124 for (n = 0; n < 32; n++)
125 {
126 if (n < kx)
127 {
128 #ifdef FIXED_POINT
129 QMF_RE(X[l + offset][n]) = u[n] /*<< 1*/;
130 #else
131 QMF_RE(X[l + offset][n]) = 2. * u[n];
132 #endif
133 } else {
134 QMF_RE(X[l + offset][n]) = 0;
135 }
136 }
137 #else
138
139 // Reordering of data moved from DCT_IV to here
140 in_imag[31] = u[1];
141 in_real[0] = u[0];
142 for (n = 1; n < 31; n++)
143 {
144 in_imag[31 - n] = u[n+1];
145 in_real[n] = -u[64-n];
146 }
147 in_imag[0] = u[32];
148 in_real[31] = -u[33];
149
150 // dct4_kernel is DCT_IV without reordering which is done before and after FFT
151 dct4_kernel(in_real, in_imag, out_real, out_imag);
152
153 // Reordering of data moved from DCT_IV to here
154 for (n = 0; n < 16; n++) {
155 if (2*n+1 < kx) {
156 #ifdef FIXED_POINT
157 QMF_RE(X[l + offset][2*n]) = out_real[n];
158 QMF_IM(X[l + offset][2*n]) = out_imag[n];
159 QMF_RE(X[l + offset][2*n+1]) = -out_imag[31-n];
160 QMF_IM(X[l + offset][2*n+1]) = -out_real[31-n];
161 #else
162 QMF_RE(X[l + offset][2*n]) = 2. * out_real[n];
163 QMF_IM(X[l + offset][2*n]) = 2. * out_imag[n];
164 QMF_RE(X[l + offset][2*n+1]) = -2. * out_imag[31-n];
165 QMF_IM(X[l + offset][2*n+1]) = -2. * out_real[31-n];
166 #endif
167 } else {
168 if (2*n < kx) {
169 #ifdef FIXED_POINT
170 QMF_RE(X[l + offset][2*n]) = out_real[n];
171 QMF_IM(X[l + offset][2*n]) = out_imag[n];
172 #else
173 QMF_RE(X[l + offset][2*n]) = 2. * out_real[n];
174 QMF_IM(X[l + offset][2*n]) = 2. * out_imag[n];
175 #endif
176 }
177 else {
178 QMF_RE(X[l + offset][2*n]) = 0;
179 QMF_IM(X[l + offset][2*n]) = 0;
180 }
181 QMF_RE(X[l + offset][2*n+1]) = 0;
182 QMF_IM(X[l + offset][2*n+1]) = 0;
183 }
184 }
185 #endif
186 }
187 }
188
189 static const complex_t qmf32_pre_twiddle[] =
190 {
191 { FRAC_CONST(0.999924701839145), FRAC_CONST(-0.012271538285720) },
192 { FRAC_CONST(0.999322384588350), FRAC_CONST(-0.036807222941359) },
193 { FRAC_CONST(0.998118112900149), FRAC_CONST(-0.061320736302209) },
194 { FRAC_CONST(0.996312612182778), FRAC_CONST(-0.085797312344440) },
195 { FRAC_CONST(0.993906970002356), FRAC_CONST(-0.110222207293883) },
196 { FRAC_CONST(0.990902635427780), FRAC_CONST(-0.134580708507126) },
197 { FRAC_CONST(0.987301418157858), FRAC_CONST(-0.158858143333861) },
198 { FRAC_CONST(0.983105487431216), FRAC_CONST(-0.183039887955141) },
199 { FRAC_CONST(0.978317370719628), FRAC_CONST(-0.207111376192219) },
200 { FRAC_CONST(0.972939952205560), FRAC_CONST(-0.231058108280671) },
201 { FRAC_CONST(0.966976471044852), FRAC_CONST(-0.254865659604515) },
202 { FRAC_CONST(0.960430519415566), FRAC_CONST(-0.278519689385053) },
203 { FRAC_CONST(0.953306040354194), FRAC_CONST(-0.302005949319228) },
204 { FRAC_CONST(0.945607325380521), FRAC_CONST(-0.325310292162263) },
205 { FRAC_CONST(0.937339011912575), FRAC_CONST(-0.348418680249435) },
206 { FRAC_CONST(0.928506080473216), FRAC_CONST(-0.371317193951838) },
207 { FRAC_CONST(0.919113851690058), FRAC_CONST(-0.393992040061048) },
208 { FRAC_CONST(0.909167983090522), FRAC_CONST(-0.416429560097637) },
209 { FRAC_CONST(0.898674465693954), FRAC_CONST(-0.438616238538528) },
210 { FRAC_CONST(0.887639620402854), FRAC_CONST(-0.460538710958240) },
211 { FRAC_CONST(0.876070094195407), FRAC_CONST(-0.482183772079123) },
212 { FRAC_CONST(0.863972856121587), FRAC_CONST(-0.503538383725718) },
213 { FRAC_CONST(0.851355193105265), FRAC_CONST(-0.524589682678469) },
214 { FRAC_CONST(0.838224705554838), FRAC_CONST(-0.545324988422046) },
215 { FRAC_CONST(0.824589302785025), FRAC_CONST(-0.565731810783613) },
216 { FRAC_CONST(0.810457198252595), FRAC_CONST(-0.585797857456439) },
217 { FRAC_CONST(0.795836904608884), FRAC_CONST(-0.605511041404326) },
218 { FRAC_CONST(0.780737228572094), FRAC_CONST(-0.624859488142386) },
219 { FRAC_CONST(0.765167265622459), FRAC_CONST(-0.643831542889791) },
220 { FRAC_CONST(0.749136394523459), FRAC_CONST(-0.662415777590172) },
221 { FRAC_CONST(0.732654271672413), FRAC_CONST(-0.680600997795453) },
222 { FRAC_CONST(0.715730825283819), FRAC_CONST(-0.698376249408973) }
223 };
224
225 qmfs_info *qmfs_init(uint8_t channels)
226 {
227 qmfs_info *qmfs = (qmfs_info*)faad_malloc(sizeof(qmfs_info));
228
229 /* v is a double ringbuffer */
230 qmfs->v = (real_t*)faad_malloc(2 * channels * 20 * sizeof(real_t));
231 memset(qmfs->v, 0, 2 * channels * 20 * sizeof(real_t));
232
233 qmfs->v_index = 0;
234
235 qmfs->channels = channels;
236
237 return qmfs;
238 }
239
240 void qmfs_end(qmfs_info *qmfs)
241 {
242 if (qmfs)
243 {
244 if (qmfs->v) faad_free(qmfs->v);
245 faad_free(qmfs);
246 }
247 }
248
249 #ifdef SBR_LOW_POWER
250
251 void sbr_qmf_synthesis_32(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
252 real_t *output)
253 {
254 ALIGN real_t x[16];
255 ALIGN real_t y[16];
256 int32_t n, k, out = 0;
257 uint8_t l;
258
259 /* qmf subsample l */
260 for (l = 0; l < sbr->numTimeSlotsRate; l++)
261 {
262 /* shift buffers */
263 /* we are not shifting v, it is a double ringbuffer */
264 //memmove(qmfs->v + 64, qmfs->v, (640-64)*sizeof(real_t));
265
266 /* calculate 64 samples */
267 for (k = 0; k < 16; k++)
268 {
269 #ifdef FIXED_POINT
270 y[k] = (QMF_RE(X[l][k]) - QMF_RE(X[l][31 - k]));
271 x[k] = (QMF_RE(X[l][k]) + QMF_RE(X[l][31 - k]));
272 #else
273 y[k] = (QMF_RE(X[l][k]) - QMF_RE(X[l][31 - k])) / 32.0;
274 x[k] = (QMF_RE(X[l][k]) + QMF_RE(X[l][31 - k])) / 32.0;
275 #endif
276 }
277
278 /* even n samples */
279 DCT2_16_unscaled(x, x);
280 /* odd n samples */
281 DCT4_16(y, y);
282
283 for (n = 8; n < 24; n++)
284 {
285 qmfs->v[qmfs->v_index + n*2] = qmfs->v[qmfs->v_index + 640 + n*2] = x[n-8];
286 qmfs->v[qmfs->v_index + n*2+1] = qmfs->v[qmfs->v_index + 640 + n*2+1] = y[n-8];
287 }
288 for (n = 0; n < 16; n++)
289 {
290 qmfs->v[qmfs->v_index + n] = qmfs->v[qmfs->v_index + 640 + n] = qmfs->v[qmfs->v_index + 32-n];
291 }
292 qmfs->v[qmfs->v_index + 48] = qmfs->v[qmfs->v_index + 640 + 48] = 0;
293 for (n = 1; n < 16; n++)
294 {
295 qmfs->v[qmfs->v_index + 48+n] = qmfs->v[qmfs->v_index + 640 + 48+n] = -qmfs->v[qmfs->v_index + 48-n];
296 }
297
298 /* calculate 32 output samples and window */
299 for (k = 0; k < 32; k++)
300 {
301 output[out++] = MUL_F(qmfs->v[qmfs->v_index + k], qmf_c[2*k]) +
302 MUL_F(qmfs->v[qmfs->v_index + 96 + k], qmf_c[64 + 2*k]) +
303 MUL_F(qmfs->v[qmfs->v_index + 128 + k], qmf_c[128 + 2*k]) +
304 MUL_F(qmfs->v[qmfs->v_index + 224 + k], qmf_c[192 + 2*k]) +
305 MUL_F(qmfs->v[qmfs->v_index + 256 + k], qmf_c[256 + 2*k]) +
306 MUL_F(qmfs->v[qmfs->v_index + 352 + k], qmf_c[320 + 2*k]) +
307 MUL_F(qmfs->v[qmfs->v_index + 384 + k], qmf_c[384 + 2*k]) +
308 MUL_F(qmfs->v[qmfs->v_index + 480 + k], qmf_c[448 + 2*k]) +
309 MUL_F(qmfs->v[qmfs->v_index + 512 + k], qmf_c[512 + 2*k]) +
310 MUL_F(qmfs->v[qmfs->v_index + 608 + k], qmf_c[576 + 2*k]);
311 }
312
313 /* update the ringbuffer index */
314 qmfs->v_index -= 64;
315 if (qmfs->v_index < 0)
316 qmfs->v_index = (640-64);
317 }
318 }
319
320 void sbr_qmf_synthesis_64(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
321 real_t *output)
322 {
323 ALIGN real_t x[64];
324 ALIGN real_t y[64];
325 int32_t n, k, out = 0;
326 uint8_t l;
327
328
329 /* qmf subsample l */
330 for (l = 0; l < sbr->numTimeSlotsRate; l++)
331 {
332 /* shift buffers */
333 /* we are not shifting v, it is a double ringbuffer */
334 //memmove(qmfs->v + 128, qmfs->v, (1280-128)*sizeof(real_t));
335
336 /* calculate 128 samples */
337 for (k = 0; k < 32; k++)
338 {
339 #ifdef FIXED_POINT
340 y[k] = (QMF_RE(X[l][k]) - QMF_RE(X[l][63 - k]));
341 x[k] = (QMF_RE(X[l][k]) + QMF_RE(X[l][63 - k]));
342 #else
343 y[k] = (QMF_RE(X[l][k]) - QMF_RE(X[l][63 - k])) / 32.0;
344 x[k] = (QMF_RE(X[l][k]) + QMF_RE(X[l][63 - k])) / 32.0;
345 #endif
346 }
347
348 /* even n samples */
349 DCT2_32_unscaled(x, x);
350 /* odd n samples */
351 DCT4_32(y, y);
352
353 for (n = 16; n < 48; n++)
354 {
355 qmfs->v[qmfs->v_index + n*2] = qmfs->v[qmfs->v_index + 1280 + n*2] = x[n-16];
356 qmfs->v[qmfs->v_index + n*2+1] = qmfs->v[qmfs->v_index + 1280 + n*2+1] = y[n-16];
357 }
358 for (n = 0; n < 32; n++)
359 {
360 qmfs->v[qmfs->v_index + n] = qmfs->v[qmfs->v_index + 1280 + n] = qmfs->v[qmfs->v_index + 64-n];
361 }
362 qmfs->v[qmfs->v_index + 96] = qmfs->v[qmfs->v_index + 1280 + 96] = 0;
363 for (n = 1; n < 32; n++)
364 {
365 qmfs->v[qmfs->v_index + 96+n] = qmfs->v[qmfs->v_index + 1280 + 96+n] = -qmfs->v[qmfs->v_index + 96-n];
366 }
367
368 /* calculate 64 output samples and window */
369 for (k = 0; k < 64; k++)
370 {
371 output[out++] = MUL_F(qmfs->v[qmfs->v_index + k], qmf_c[k]) +
372 MUL_F(qmfs->v[qmfs->v_index + 192 + k], qmf_c[64 + k]) +
373 MUL_F(qmfs->v[qmfs->v_index + 256 + k], qmf_c[128 + k]) +
374 MUL_F(qmfs->v[qmfs->v_index + 256 + 192 + k], qmf_c[128 + 64 + k]) +
375 MUL_F(qmfs->v[qmfs->v_index + 512 + k], qmf_c[256 + k]) +
376 MUL_F(qmfs->v[qmfs->v_index + 512 + 192 + k], qmf_c[256 + 64 + k]) +
377 MUL_F(qmfs->v[qmfs->v_index + 768 + k], qmf_c[384 + k]) +
378 MUL_F(qmfs->v[qmfs->v_index + 768 + 192 + k], qmf_c[384 + 64 + k]) +
379 MUL_F(qmfs->v[qmfs->v_index + 1024 + k], qmf_c[512 + k]) +
380 MUL_F(qmfs->v[qmfs->v_index + 1024 + 192 + k], qmf_c[512 + 64 + k]);
381 }
382
383 /* update the ringbuffer index */
384 qmfs->v_index -= 128;
385 if (qmfs->v_index < 0)
386 qmfs->v_index = (1280-128);
387 }
388 }
389 #else
390 void sbr_qmf_synthesis_32(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
391 real_t *output)
392 {
393 ALIGN real_t x1[32], x2[32];
394 #ifndef FIXED_POINT
395 real_t scale = 1.f/64.f;
396 #endif
397 int32_t n, k, out = 0;
398 uint8_t l;
399
400
401 /* qmf subsample l */
402 for (l = 0; l < sbr->numTimeSlotsRate; l++)
403 {
404 /* shift buffer v */
405 /* buffer is not shifted, we are using a ringbuffer */
406 //memmove(qmfs->v + 64, qmfs->v, (640-64)*sizeof(real_t));
407
408 /* calculate 64 samples */
409 /* complex pre-twiddle */
410 for (k = 0; k < 32; k++)
411 {
412 x1[k] = MUL_F(QMF_RE(X[l][k]), RE(qmf32_pre_twiddle[k])) - MUL_F(QMF_IM(X[l][k]), IM(qmf32_pre_twiddle[k]));
413 x2[k] = MUL_F(QMF_IM(X[l][k]), RE(qmf32_pre_twiddle[k])) + MUL_F(QMF_RE(X[l][k]), IM(qmf32_pre_twiddle[k]));
414
415 #ifndef FIXED_POINT
416 x1[k] *= scale;
417 x2[k] *= scale;
418 #else
419 x1[k] >>= 1;
420 x2[k] >>= 1;
421 #endif
422 }
423
424 /* transform */
425 DCT4_32(x1, x1);
426 DST4_32(x2, x2);
427
428 for (n = 0; n < 32; n++)
429 {
430 qmfs->v[qmfs->v_index + n] = qmfs->v[qmfs->v_index + 640 + n] = -x1[n] + x2[n];
431 qmfs->v[qmfs->v_index + 63 - n] = qmfs->v[qmfs->v_index + 640 + 63 - n] = x1[n] + x2[n];
432 }
433
434 /* calculate 32 output samples and window */
435 for (k = 0; k < 32; k++)
436 {
437 output[out++] = MUL_F(qmfs->v[qmfs->v_index + k], qmf_c[2*k]) +
438 MUL_F(qmfs->v[qmfs->v_index + 96 + k], qmf_c[64 + 2*k]) +
439 MUL_F(qmfs->v[qmfs->v_index + 128 + k], qmf_c[128 + 2*k]) +
440 MUL_F(qmfs->v[qmfs->v_index + 224 + k], qmf_c[192 + 2*k]) +
441 MUL_F(qmfs->v[qmfs->v_index + 256 + k], qmf_c[256 + 2*k]) +
442 MUL_F(qmfs->v[qmfs->v_index + 352 + k], qmf_c[320 + 2*k]) +
443 MUL_F(qmfs->v[qmfs->v_index + 384 + k], qmf_c[384 + 2*k]) +
444 MUL_F(qmfs->v[qmfs->v_index + 480 + k], qmf_c[448 + 2*k]) +
445 MUL_F(qmfs->v[qmfs->v_index + 512 + k], qmf_c[512 + 2*k]) +
446 MUL_F(qmfs->v[qmfs->v_index + 608 + k], qmf_c[576 + 2*k]);
447 }
448
449 /* update ringbuffer index */
450 qmfs->v_index -= 64;
451 if (qmfs->v_index < 0)
452 qmfs->v_index = (640 - 64);
453 }
454 }
455
456 void sbr_qmf_synthesis_64(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
457 real_t *output)
458 {
459 // ALIGN real_t x1[64], x2[64];
460 #ifndef SBR_LOW_POWER
461 ALIGN real_t in_real1[32], in_imag1[32], out_real1[32], out_imag1[32];
462 ALIGN real_t in_real2[32], in_imag2[32], out_real2[32], out_imag2[32];
463 #endif
464 qmf_t * pX;
465 real_t * pring_buffer_1, * pring_buffer_3;
466 // real_t * ptemp_1, * ptemp_2;
467 #ifdef PREFER_POINTERS
468 // These pointers are used if target platform has autoinc address generators
469 real_t * pring_buffer_2, * pring_buffer_4;
470 real_t * pring_buffer_5, * pring_buffer_6;
471 real_t * pring_buffer_7, * pring_buffer_8;
472 real_t * pring_buffer_9, * pring_buffer_10;
473 const real_t * pqmf_c_1, * pqmf_c_2, * pqmf_c_3, * pqmf_c_4;
474 const real_t * pqmf_c_5, * pqmf_c_6, * pqmf_c_7, * pqmf_c_8;
475 const real_t * pqmf_c_9, * pqmf_c_10;
476 #endif // #ifdef PREFER_POINTERS
477 #ifndef FIXED_POINT
478 real_t scale = 1.f/64.f;
479 #endif
480 int32_t n, k, out = 0;
481 uint8_t l;
482
483
484 /* qmf subsample l */
485 for (l = 0; l < sbr->numTimeSlotsRate; l++)
486 {
487 /* shift buffer v */
488 /* buffer is not shifted, we use double ringbuffer */
489 //memmove(qmfs->v + 128, qmfs->v, (1280-128)*sizeof(real_t));
490
491 /* calculate 128 samples */
492 #ifndef FIXED_POINT
493
494 pX = X[l];
495
496 in_imag1[31] = scale*QMF_RE(pX[1]);
497 in_real1[0] = scale*QMF_RE(pX[0]);
498 in_imag2[31] = scale*QMF_IM(pX[63-1]);
499 in_real2[0] = scale*QMF_IM(pX[63-0]);
500 for (k = 1; k < 31; k++)
501 {
502 in_imag1[31 - k] = scale*QMF_RE(pX[2*k + 1]);
503 in_real1[ k] = scale*QMF_RE(pX[2*k ]);
504 in_imag2[31 - k] = scale*QMF_IM(pX[63 - (2*k + 1)]);
505 in_real2[ k] = scale*QMF_IM(pX[63 - (2*k )]);
506 }
507 in_imag1[0] = scale*QMF_RE(pX[63]);
508 in_real1[31] = scale*QMF_RE(pX[62]);
509 in_imag2[0] = scale*QMF_IM(pX[63-63]);
510 in_real2[31] = scale*QMF_IM(pX[63-62]);
511
512 #else
513
514 pX = X[l];
515
516 in_imag1[31] = QMF_RE(pX[1]) >> 1;
517 in_real1[0] = QMF_RE(pX[0]) >> 1;
518 in_imag2[31] = QMF_IM(pX[62]) >> 1;
519 in_real2[0] = QMF_IM(pX[63]) >> 1;
520 for (k = 1; k < 31; k++)
521 {
522 in_imag1[31 - k] = QMF_RE(pX[2*k + 1]) >> 1;
523 in_real1[ k] = QMF_RE(pX[2*k ]) >> 1;
524 in_imag2[31 - k] = QMF_IM(pX[63 - (2*k + 1)]) >> 1;
525 in_real2[ k] = QMF_IM(pX[63 - (2*k )]) >> 1;
526 }
527 in_imag1[0] = QMF_RE(pX[63]) >> 1;
528 in_real1[31] = QMF_RE(pX[62]) >> 1;
529 in_imag2[0] = QMF_IM(pX[0]) >> 1;
530 in_real2[31] = QMF_IM(pX[1]) >> 1;
531
532 #endif
533
534
535 // dct4_kernel is DCT_IV without reordering which is done before and after FFT
536 dct4_kernel(in_real1, in_imag1, out_real1, out_imag1);
537 dct4_kernel(in_real2, in_imag2, out_real2, out_imag2);
538
539
540 pring_buffer_1 = qmfs->v + qmfs->v_index;
541 pring_buffer_3 = pring_buffer_1 + 1280;
542 #ifdef PREFER_POINTERS
543 pring_buffer_2 = pring_buffer_1 + 127;
544 pring_buffer_4 = pring_buffer_1 + (1280 + 127);
545 #endif // #ifdef PREFER_POINTERS
546 // ptemp_1 = x1;
547 // ptemp_2 = x2;
548 #ifdef PREFER_POINTERS
549 for (n = 0; n < 32; n ++)
550 {
551 //real_t x1 = *ptemp_1++;
552 //real_t x2 = *ptemp_2++;
553 // pring_buffer_3 and pring_buffer_4 are needed only for double ring buffer
554 *pring_buffer_1++ = *pring_buffer_3++ = out_real2[n] - out_real1[n];
555 *pring_buffer_2-- = *pring_buffer_4-- = out_real2[n] + out_real1[n];
556 //x1 = *ptemp_1++;
557 //x2 = *ptemp_2++;
558 *pring_buffer_1++ = *pring_buffer_3++ = out_imag2[31-n] + out_imag1[31-n];
559 *pring_buffer_2-- = *pring_buffer_4-- = out_imag2[31-n] - out_imag1[31-n];
560 }
561 #else // #ifdef PREFER_POINTERS
562
563 for (n = 0; n < 32; n++)
564 {
565 // pring_buffer_3 and pring_buffer_4 are needed only for double ring buffer
566 pring_buffer_1[2*n] = pring_buffer_3[2*n] = out_real2[n] - out_real1[n];
567 pring_buffer_1[127-2*n] = pring_buffer_3[127-2*n] = out_real2[n] + out_real1[n];
568 pring_buffer_1[2*n+1] = pring_buffer_3[2*n+1] = out_imag2[31-n] + out_imag1[31-n];
569 pring_buffer_1[127-(2*n+1)] = pring_buffer_3[127-(2*n+1)] = out_imag2[31-n] - out_imag1[31-n];
570 }
571
572 #endif // #ifdef PREFER_POINTERS
573
574 pring_buffer_1 = qmfs->v + qmfs->v_index;
575 #ifdef PREFER_POINTERS
576 pring_buffer_2 = pring_buffer_1 + 192;
577 pring_buffer_3 = pring_buffer_1 + 256;
578 pring_buffer_4 = pring_buffer_1 + (256 + 192);
579 pring_buffer_5 = pring_buffer_1 + 512;
580 pring_buffer_6 = pring_buffer_1 + (512 + 192);
581 pring_buffer_7 = pring_buffer_1 + 768;
582 pring_buffer_8 = pring_buffer_1 + (768 + 192);
583 pring_buffer_9 = pring_buffer_1 + 1024;
584 pring_buffer_10 = pring_buffer_1 + (1024 + 192);
585 pqmf_c_1 = qmf_c;
586 pqmf_c_2 = qmf_c + 64;
587 pqmf_c_3 = qmf_c + 128;
588 pqmf_c_4 = qmf_c + 192;
589 pqmf_c_5 = qmf_c + 256;
590 pqmf_c_6 = qmf_c + 320;
591 pqmf_c_7 = qmf_c + 384;
592 pqmf_c_8 = qmf_c + 448;
593 pqmf_c_9 = qmf_c + 512;
594 pqmf_c_10 = qmf_c + 576;
595 #endif // #ifdef PREFER_POINTERS
596
597 /* calculate 64 output samples and window */
598 for (k = 0; k < 64; k++)
599 {
600 #ifdef PREFER_POINTERS
601 output[out++] =
602 MUL_F(*pring_buffer_1++, *pqmf_c_1++) +
603 MUL_F(*pring_buffer_2++, *pqmf_c_2++) +
604 MUL_F(*pring_buffer_3++, *pqmf_c_3++) +
605 MUL_F(*pring_buffer_4++, *pqmf_c_4++) +
606 MUL_F(*pring_buffer_5++, *pqmf_c_5++) +
607 MUL_F(*pring_buffer_6++, *pqmf_c_6++) +
608 MUL_F(*pring_buffer_7++, *pqmf_c_7++) +
609 MUL_F(*pring_buffer_8++, *pqmf_c_8++) +
610 MUL_F(*pring_buffer_9++, *pqmf_c_9++) +
611 MUL_F(*pring_buffer_10++, *pqmf_c_10++);
612 #else // #ifdef PREFER_POINTERS
613 output[out++] =
614 MUL_F(pring_buffer_1[k+0], qmf_c[k+0]) +
615 MUL_F(pring_buffer_1[k+192], qmf_c[k+64]) +
616 MUL_F(pring_buffer_1[k+256], qmf_c[k+128]) +
617 MUL_F(pring_buffer_1[k+(256+192)], qmf_c[k+192]) +
618 MUL_F(pring_buffer_1[k+512], qmf_c[k+256]) +
619 MUL_F(pring_buffer_1[k+(512+192)], qmf_c[k+320]) +
620 MUL_F(pring_buffer_1[k+768], qmf_c[k+384]) +
621 MUL_F(pring_buffer_1[k+(768+192)], qmf_c[k+448]) +
622 MUL_F(pring_buffer_1[k+1024], qmf_c[k+512]) +
623 MUL_F(pring_buffer_1[k+(1024+192)], qmf_c[k+576]);
624 #endif // #ifdef PREFER_POINTERS
625 }
626
627 /* update ringbuffer index */
628 qmfs->v_index -= 128;
629 if (qmfs->v_index < 0)
630 qmfs->v_index = (1280 - 128);
631 }
632 }
633 #endif
634
635 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_qmf.h,v 1.25 2007/11/01 12:33:36 menno Exp $
28 **/
29
30 #ifndef __SBR_QMF_H__
31 #define __SBR_QMF_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 qmfa_info *qmfa_init(uint8_t channels);
38 void qmfa_end(qmfa_info *qmfa);
39 qmfs_info *qmfs_init(uint8_t channels);
40 void qmfs_end(qmfs_info *qmfs);
41
42 void sbr_qmf_analysis_32(sbr_info *sbr, qmfa_info *qmfa, const real_t *input,
43 qmf_t X[MAX_NTSRHFG][64], uint8_t offset, uint8_t kx);
44 void sbr_qmf_synthesis_32(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
45 real_t *output);
46 void sbr_qmf_synthesis_64(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
47 real_t *output);
48
49
50 #ifdef __cplusplus
51 }
52 #endif
53 #endif
54
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_qmf_c.h,v 1.17 2007/11/01 12:33:36 menno Exp $
28 **/
29
30 #ifndef __SBR_QMF_C_H__
31 #define __SBR_QMF_C_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37
38 #ifdef _MSC_VER
39 #pragma warning(disable:4305)
40 #pragma warning(disable:4244)
41 #endif
42
43 ALIGN static const real_t qmf_c[640] = {
44 FRAC_CONST(0), FRAC_CONST(-0.00055252865047),
45 FRAC_CONST(-0.00056176925738), FRAC_CONST(-0.00049475180896),
46 FRAC_CONST(-0.00048752279712), FRAC_CONST(-0.00048937912498),
47 FRAC_CONST(-0.00050407143497), FRAC_CONST(-0.00052265642972),
48 FRAC_CONST(-0.00054665656337), FRAC_CONST(-0.00056778025613),
49 FRAC_CONST(-0.00058709304852), FRAC_CONST(-0.00061327473938),
50 FRAC_CONST(-0.00063124935319), FRAC_CONST(-0.00065403333621),
51 FRAC_CONST(-0.00067776907764), FRAC_CONST(-0.00069416146273),
52 FRAC_CONST(-0.00071577364744), FRAC_CONST(-0.00072550431222),
53 FRAC_CONST(-0.00074409418541), FRAC_CONST(-0.00074905980532),
54 FRAC_CONST(-0.0007681371927), FRAC_CONST(-0.00077248485949),
55 FRAC_CONST(-0.00078343322877), FRAC_CONST(-0.00077798694927),
56 FRAC_CONST(-0.000780366471), FRAC_CONST(-0.00078014496257),
57 FRAC_CONST(-0.0007757977331), FRAC_CONST(-0.00076307935757),
58 FRAC_CONST(-0.00075300014201), FRAC_CONST(-0.00073193571525),
59 FRAC_CONST(-0.00072153919876), FRAC_CONST(-0.00069179375372),
60 FRAC_CONST(-0.00066504150893), FRAC_CONST(-0.00063415949025),
61 FRAC_CONST(-0.0005946118933), FRAC_CONST(-0.00055645763906),
62 FRAC_CONST(-0.00051455722108), FRAC_CONST(-0.00046063254803),
63 FRAC_CONST(-0.00040951214522), FRAC_CONST(-0.00035011758756),
64 FRAC_CONST(-0.00028969811748), FRAC_CONST(-0.0002098337344),
65 FRAC_CONST(-0.00014463809349), FRAC_CONST(-6.173344072E-005),
66 FRAC_CONST(1.349497418E-005), FRAC_CONST(0.00010943831274),
67 FRAC_CONST(0.00020430170688), FRAC_CONST(0.00029495311041),
68 FRAC_CONST(0.0004026540216), FRAC_CONST(0.00051073884952),
69 FRAC_CONST(0.00062393761391), FRAC_CONST(0.00074580258865),
70 FRAC_CONST(0.00086084433262), FRAC_CONST(0.00098859883015),
71 FRAC_CONST(0.00112501551307), FRAC_CONST(0.00125778846475),
72 FRAC_CONST(0.00139024948272), FRAC_CONST(0.00154432198471),
73 FRAC_CONST(0.00168680832531), FRAC_CONST(0.00183482654224),
74 FRAC_CONST(0.00198411407369), FRAC_CONST(0.00214615835557),
75 FRAC_CONST(0.00230172547746), FRAC_CONST(0.00246256169126),
76 FRAC_CONST(0.00262017586902), FRAC_CONST(0.00278704643465),
77 FRAC_CONST(0.00294694477165), FRAC_CONST(0.00311254206525),
78 FRAC_CONST(0.00327396134847), FRAC_CONST(0.00344188741828),
79 FRAC_CONST(0.00360082681231), FRAC_CONST(0.00376039229104),
80 FRAC_CONST(0.00392074323703), FRAC_CONST(0.00408197531935),
81 FRAC_CONST(0.0042264269227), FRAC_CONST(0.00437307196781),
82 FRAC_CONST(0.00452098527825), FRAC_CONST(0.00466064606118),
83 FRAC_CONST(0.00479325608498), FRAC_CONST(0.00491376035745),
84 FRAC_CONST(0.00503930226013), FRAC_CONST(0.00514073539032),
85 FRAC_CONST(0.00524611661324), FRAC_CONST(0.00534716811982),
86 FRAC_CONST(0.00541967759307), FRAC_CONST(0.00548760401507),
87 FRAC_CONST(0.00554757145088), FRAC_CONST(0.00559380230045),
88 FRAC_CONST(0.00562206432097), FRAC_CONST(0.00564551969164),
89 FRAC_CONST(0.00563891995151), FRAC_CONST(0.00562661141932),
90 FRAC_CONST(0.0055917128663), FRAC_CONST(0.005540436394),
91 FRAC_CONST(0.0054753783077), FRAC_CONST(0.0053838975897),
92 FRAC_CONST(0.00527157587272), FRAC_CONST(0.00513822754514),
93 FRAC_CONST(0.00498396877629), FRAC_CONST(0.004810946906),
94 FRAC_CONST(0.00460395301471), FRAC_CONST(0.00438018617447),
95 FRAC_CONST(0.0041251642327), FRAC_CONST(0.00384564081246),
96 FRAC_CONST(0.00354012465507), FRAC_CONST(0.00320918858098),
97 FRAC_CONST(0.00284467578623), FRAC_CONST(0.00245085400321),
98 FRAC_CONST(0.0020274176185), FRAC_CONST(0.00157846825768),
99 FRAC_CONST(0.00109023290512), FRAC_CONST(0.0005832264248),
100 FRAC_CONST(2.760451905E-005), FRAC_CONST(-0.00054642808664),
101 FRAC_CONST(-0.00115681355227), FRAC_CONST(-0.00180394725893),
102 FRAC_CONST(-0.00248267236449), FRAC_CONST(-0.003193377839),
103 FRAC_CONST(-0.00394011240522), FRAC_CONST(-0.004722259624),
104 FRAC_CONST(-0.00553372111088), FRAC_CONST(-0.00637922932685),
105 FRAC_CONST(-0.00726158168517), FRAC_CONST(-0.00817982333726),
106 FRAC_CONST(-0.00913253296085), FRAC_CONST(-0.01011502154986),
107 FRAC_CONST(-0.01113155480321), FRAC_CONST(-0.01218499959508),
108 FRAC_CONST(0.01327182200351), FRAC_CONST(0.01439046660792),
109 FRAC_CONST(0.01554055533423), FRAC_CONST(0.01673247129989),
110 FRAC_CONST(0.01794333813443), FRAC_CONST(0.01918724313698),
111 FRAC_CONST(0.02045317933555), FRAC_CONST(0.02174675502535),
112 FRAC_CONST(0.02306801692862), FRAC_CONST(0.02441609920285),
113 FRAC_CONST(0.02578758475467), FRAC_CONST(0.02718594296329),
114 FRAC_CONST(0.02860721736385), FRAC_CONST(0.03005026574279),
115 FRAC_CONST(0.03150176087389), FRAC_CONST(0.03297540810337),
116 FRAC_CONST(0.03446209487686), FRAC_CONST(0.03596975605542),
117 FRAC_CONST(0.03748128504252), FRAC_CONST(0.03900536794745),
118 FRAC_CONST(0.04053491705584), FRAC_CONST(0.04206490946367),
119 FRAC_CONST(0.04360975421304), FRAC_CONST(0.04514884056413),
120 FRAC_CONST(0.04668430272642), FRAC_CONST(0.04821657200672),
121 FRAC_CONST(0.04973857556014), FRAC_CONST(0.05125561555216),
122 FRAC_CONST(0.05276307465207), FRAC_CONST(0.05424527683589),
123 FRAC_CONST(0.05571736482138), FRAC_CONST(0.05716164501299),
124 FRAC_CONST(0.0585915683626), FRAC_CONST(0.05998374801761),
125 FRAC_CONST(0.06134551717207), FRAC_CONST(0.06268578081172),
126 FRAC_CONST(0.06397158980681), FRAC_CONST(0.0652247106438),
127 FRAC_CONST(0.06643675122104), FRAC_CONST(0.06760759851228),
128 FRAC_CONST(0.06870438283512), FRAC_CONST(0.06976302447127),
129 FRAC_CONST(0.07076287107266), FRAC_CONST(0.07170026731102),
130 FRAC_CONST(0.07256825833083), FRAC_CONST(0.07336202550803),
131 FRAC_CONST(0.07410036424342), FRAC_CONST(0.07474525581194),
132 FRAC_CONST(0.07531373362019), FRAC_CONST(0.07580083586584),
133 FRAC_CONST(0.07619924793396), FRAC_CONST(0.07649921704119),
134 FRAC_CONST(0.07670934904245), FRAC_CONST(0.07681739756964),
135 FRAC_CONST(0.07682300113923), FRAC_CONST(0.07672049241746),
136 FRAC_CONST(0.07650507183194), FRAC_CONST(0.07617483218536),
137 FRAC_CONST(0.07573057565061), FRAC_CONST(0.0751576255287),
138 FRAC_CONST(0.07446643947564), FRAC_CONST(0.0736406005762),
139 FRAC_CONST(0.07267746427299), FRAC_CONST(0.07158263647903),
140 FRAC_CONST(0.07035330735093), FRAC_CONST(0.06896640131951),
141 FRAC_CONST(0.06745250215166), FRAC_CONST(0.06576906686508),
142 FRAC_CONST(0.06394448059633), FRAC_CONST(0.06196027790387),
143 FRAC_CONST(0.0598166570809), FRAC_CONST(0.05751526919867),
144 FRAC_CONST(0.05504600343009), FRAC_CONST(0.05240938217366),
145 FRAC_CONST(0.04959786763445), FRAC_CONST(0.04663033051701),
146 FRAC_CONST(0.04347687821958), FRAC_CONST(0.04014582784127),
147 FRAC_CONST(0.03664181168133), FRAC_CONST(0.03295839306691),
148 FRAC_CONST(0.02908240060125), FRAC_CONST(0.02503075618909),
149 FRAC_CONST(0.02079970728622), FRAC_CONST(0.01637012582228),
150 FRAC_CONST(0.01176238327857), FRAC_CONST(0.00696368621617),
151 FRAC_CONST(0.00197656014503), FRAC_CONST(-0.00320868968304),
152 FRAC_CONST(-0.00857117491366), FRAC_CONST(-0.01412888273558),
153 FRAC_CONST(-0.01988341292573), FRAC_CONST(-0.02582272888064),
154 FRAC_CONST(-0.03195312745332), FRAC_CONST(-0.03827765720822),
155 FRAC_CONST(-0.04478068215856), FRAC_CONST(-0.05148041767934),
156 FRAC_CONST(-0.05837053268336), FRAC_CONST(-0.06544098531359),
157 FRAC_CONST(-0.07269433008129), FRAC_CONST(-0.08013729344279),
158 FRAC_CONST(-0.08775475365593), FRAC_CONST(-0.09555333528914),
159 FRAC_CONST(-0.10353295311463), FRAC_CONST(-0.1116826931773),
160 FRAC_CONST(-0.120007798468), FRAC_CONST(-0.12850028503878),
161 FRAC_CONST(-0.13715517611934), FRAC_CONST(-0.1459766491187),
162 FRAC_CONST(-0.15496070710605), FRAC_CONST(-0.16409588556669),
163 FRAC_CONST(-0.17338081721706), FRAC_CONST(-0.18281725485142),
164 FRAC_CONST(-0.19239667457267), FRAC_CONST(-0.20212501768103),
165 FRAC_CONST(-0.21197358538056), FRAC_CONST(-0.22196526964149),
166 FRAC_CONST(-0.23206908706791), FRAC_CONST(-0.24230168845974),
167 FRAC_CONST(-0.25264803095722), FRAC_CONST(-0.26310532994603),
168 FRAC_CONST(-0.27366340405625), FRAC_CONST(-0.28432141891085),
169 FRAC_CONST(-0.29507167170646), FRAC_CONST(-0.30590985751916),
170 FRAC_CONST(-0.31682789136456), FRAC_CONST(-0.32781137272105),
171 FRAC_CONST(-0.33887226938665), FRAC_CONST(-0.3499914122931),
172 FRAC_CONST(0.36115899031355), FRAC_CONST(0.37237955463061),
173 FRAC_CONST(0.38363500139043), FRAC_CONST(0.39492117615675),
174 FRAC_CONST(0.40623176767625), FRAC_CONST(0.41756968968409),
175 FRAC_CONST(0.42891199207373), FRAC_CONST(0.44025537543665),
176 FRAC_CONST(0.45159965356824), FRAC_CONST(0.46293080852757),
177 FRAC_CONST(0.47424532146115), FRAC_CONST(0.48552530911099),
178 FRAC_CONST(0.49677082545707), FRAC_CONST(0.50798175000434),
179 FRAC_CONST(0.51912349702391), FRAC_CONST(0.53022408956855),
180 FRAC_CONST(0.54125534487322), FRAC_CONST(0.55220512585061),
181 FRAC_CONST(0.5630789140137), FRAC_CONST(0.57385241316923),
182 FRAC_CONST(0.58454032354679), FRAC_CONST(0.59511230862496),
183 FRAC_CONST(0.6055783538918), FRAC_CONST(0.61591099320291),
184 FRAC_CONST(0.62612426956055), FRAC_CONST(0.63619801077286),
185 FRAC_CONST(0.64612696959461), FRAC_CONST(0.65590163024671),
186 FRAC_CONST(0.66551398801627), FRAC_CONST(0.67496631901712),
187 FRAC_CONST(0.68423532934598), FRAC_CONST(0.69332823767032),
188 FRAC_CONST(0.70223887193539), FRAC_CONST(0.71094104263095),
189 FRAC_CONST(0.71944626349561), FRAC_CONST(0.72774489002994),
190 FRAC_CONST(0.73582117582769), FRAC_CONST(0.74368278636488),
191 FRAC_CONST(0.75131374561237), FRAC_CONST(0.75870807608242),
192 FRAC_CONST(0.76586748650939), FRAC_CONST(0.77277808813327),
193 FRAC_CONST(0.77942875190216), FRAC_CONST(0.7858353120392),
194 FRAC_CONST(0.79197358416424), FRAC_CONST(0.797846641377),
195 FRAC_CONST(0.80344857518505), FRAC_CONST(0.80876950044491),
196 FRAC_CONST(0.81381912706217), FRAC_CONST(0.81857760046468),
197 FRAC_CONST(0.82304198905409), FRAC_CONST(0.8272275347336),
198 FRAC_CONST(0.8311038457152), FRAC_CONST(0.83469373618402),
199 FRAC_CONST(0.83797173378865), FRAC_CONST(0.84095413924722),
200 FRAC_CONST(0.84362382812005), FRAC_CONST(0.84598184698206),
201 FRAC_CONST(0.84803157770763), FRAC_CONST(0.84978051984268),
202 FRAC_CONST(0.85119715249343), FRAC_CONST(0.85230470352147),
203 FRAC_CONST(0.85310209497017), FRAC_CONST(0.85357205739107),
204 FRAC_CONST(0.85373856005937 /*max*/), FRAC_CONST(0.85357205739107),
205 FRAC_CONST(0.85310209497017), FRAC_CONST(0.85230470352147),
206 FRAC_CONST(0.85119715249343), FRAC_CONST(0.84978051984268),
207 FRAC_CONST(0.84803157770763), FRAC_CONST(0.84598184698206),
208 FRAC_CONST(0.84362382812005), FRAC_CONST(0.84095413924722),
209 FRAC_CONST(0.83797173378865), FRAC_CONST(0.83469373618402),
210 FRAC_CONST(0.8311038457152), FRAC_CONST(0.8272275347336),
211 FRAC_CONST(0.82304198905409), FRAC_CONST(0.81857760046468),
212 FRAC_CONST(0.81381912706217), FRAC_CONST(0.80876950044491),
213 FRAC_CONST(0.80344857518505), FRAC_CONST(0.797846641377),
214 FRAC_CONST(0.79197358416424), FRAC_CONST(0.7858353120392),
215 FRAC_CONST(0.77942875190216), FRAC_CONST(0.77277808813327),
216 FRAC_CONST(0.76586748650939), FRAC_CONST(0.75870807608242),
217 FRAC_CONST(0.75131374561237), FRAC_CONST(0.74368278636488),
218 FRAC_CONST(0.73582117582769), FRAC_CONST(0.72774489002994),
219 FRAC_CONST(0.71944626349561), FRAC_CONST(0.71094104263095),
220 FRAC_CONST(0.70223887193539), FRAC_CONST(0.69332823767032),
221 FRAC_CONST(0.68423532934598), FRAC_CONST(0.67496631901712),
222 FRAC_CONST(0.66551398801627), FRAC_CONST(0.65590163024671),
223 FRAC_CONST(0.64612696959461), FRAC_CONST(0.63619801077286),
224 FRAC_CONST(0.62612426956055), FRAC_CONST(0.61591099320291),
225 FRAC_CONST(0.6055783538918), FRAC_CONST(0.59511230862496),
226 FRAC_CONST(0.58454032354679), FRAC_CONST(0.57385241316923),
227 FRAC_CONST(0.5630789140137), FRAC_CONST(0.55220512585061),
228 FRAC_CONST(0.54125534487322), FRAC_CONST(0.53022408956855),
229 FRAC_CONST(0.51912349702391), FRAC_CONST(0.50798175000434),
230 FRAC_CONST(0.49677082545707), FRAC_CONST(0.48552530911099),
231 FRAC_CONST(0.47424532146115), FRAC_CONST(0.46293080852757),
232 FRAC_CONST(0.45159965356824), FRAC_CONST(0.44025537543665),
233 FRAC_CONST(0.42891199207373), FRAC_CONST(0.41756968968409),
234 FRAC_CONST(0.40623176767625), FRAC_CONST(0.39492117615675),
235 FRAC_CONST(0.38363500139043), FRAC_CONST(0.37237955463061),
236 FRAC_CONST(-0.36115899031355), FRAC_CONST(-0.3499914122931),
237 FRAC_CONST(-0.33887226938665), FRAC_CONST(-0.32781137272105),
238 FRAC_CONST(-0.31682789136456), FRAC_CONST(-0.30590985751916),
239 FRAC_CONST(-0.29507167170646), FRAC_CONST(-0.28432141891085),
240 FRAC_CONST(-0.27366340405625), FRAC_CONST(-0.26310532994603),
241 FRAC_CONST(-0.25264803095722), FRAC_CONST(-0.24230168845974),
242 FRAC_CONST(-0.23206908706791), FRAC_CONST(-0.22196526964149),
243 FRAC_CONST(-0.21197358538056), FRAC_CONST(-0.20212501768103),
244 FRAC_CONST(-0.19239667457267), FRAC_CONST(-0.18281725485142),
245 FRAC_CONST(-0.17338081721706), FRAC_CONST(-0.16409588556669),
246 FRAC_CONST(-0.15496070710605), FRAC_CONST(-0.1459766491187),
247 FRAC_CONST(-0.13715517611934), FRAC_CONST(-0.12850028503878),
248 FRAC_CONST(-0.120007798468), FRAC_CONST(-0.1116826931773),
249 FRAC_CONST(-0.10353295311463), FRAC_CONST(-0.09555333528914),
250 FRAC_CONST(-0.08775475365593), FRAC_CONST(-0.08013729344279),
251 FRAC_CONST(-0.07269433008129), FRAC_CONST(-0.06544098531359),
252 FRAC_CONST(-0.05837053268336), FRAC_CONST(-0.05148041767934),
253 FRAC_CONST(-0.04478068215856), FRAC_CONST(-0.03827765720822),
254 FRAC_CONST(-0.03195312745332), FRAC_CONST(-0.02582272888064),
255 FRAC_CONST(-0.01988341292573), FRAC_CONST(-0.01412888273558),
256 FRAC_CONST(-0.00857117491366), FRAC_CONST(-0.00320868968304),
257 FRAC_CONST(0.00197656014503), FRAC_CONST(0.00696368621617),
258 FRAC_CONST(0.01176238327857), FRAC_CONST(0.01637012582228),
259 FRAC_CONST(0.02079970728622), FRAC_CONST(0.02503075618909),
260 FRAC_CONST(0.02908240060125), FRAC_CONST(0.03295839306691),
261 FRAC_CONST(0.03664181168133), FRAC_CONST(0.04014582784127),
262 FRAC_CONST(0.04347687821958), FRAC_CONST(0.04663033051701),
263 FRAC_CONST(0.04959786763445), FRAC_CONST(0.05240938217366),
264 FRAC_CONST(0.05504600343009), FRAC_CONST(0.05751526919867),
265 FRAC_CONST(0.0598166570809), FRAC_CONST(0.06196027790387),
266 FRAC_CONST(0.06394448059633), FRAC_CONST(0.06576906686508),
267 FRAC_CONST(0.06745250215166), FRAC_CONST(0.06896640131951),
268 FRAC_CONST(0.07035330735093), FRAC_CONST(0.07158263647903),
269 FRAC_CONST(0.07267746427299), FRAC_CONST(0.0736406005762),
270 FRAC_CONST(0.07446643947564), FRAC_CONST(0.0751576255287),
271 FRAC_CONST(0.07573057565061), FRAC_CONST(0.07617483218536),
272 FRAC_CONST(0.07650507183194), FRAC_CONST(0.07672049241746),
273 FRAC_CONST(0.07682300113923), FRAC_CONST(0.07681739756964),
274 FRAC_CONST(0.07670934904245), FRAC_CONST(0.07649921704119),
275 FRAC_CONST(0.07619924793396), FRAC_CONST(0.07580083586584),
276 FRAC_CONST(0.07531373362019), FRAC_CONST(0.07474525581194),
277 FRAC_CONST(0.07410036424342), FRAC_CONST(0.07336202550803),
278 FRAC_CONST(0.07256825833083), FRAC_CONST(0.07170026731102),
279 FRAC_CONST(0.07076287107266), FRAC_CONST(0.06976302447127),
280 FRAC_CONST(0.06870438283512), FRAC_CONST(0.06760759851228),
281 FRAC_CONST(0.06643675122104), FRAC_CONST(0.0652247106438),
282 FRAC_CONST(0.06397158980681), FRAC_CONST(0.06268578081172),
283 FRAC_CONST(0.06134551717207), FRAC_CONST(0.05998374801761),
284 FRAC_CONST(0.0585915683626), FRAC_CONST(0.05716164501299),
285 FRAC_CONST(0.05571736482138), FRAC_CONST(0.05424527683589),
286 FRAC_CONST(0.05276307465207), FRAC_CONST(0.05125561555216),
287 FRAC_CONST(0.04973857556014), FRAC_CONST(0.04821657200672),
288 FRAC_CONST(0.04668430272642), FRAC_CONST(0.04514884056413),
289 FRAC_CONST(0.04360975421304), FRAC_CONST(0.04206490946367),
290 FRAC_CONST(0.04053491705584), FRAC_CONST(0.03900536794745),
291 FRAC_CONST(0.03748128504252), FRAC_CONST(0.03596975605542),
292 FRAC_CONST(0.03446209487686), FRAC_CONST(0.03297540810337),
293 FRAC_CONST(0.03150176087389), FRAC_CONST(0.03005026574279),
294 FRAC_CONST(0.02860721736385), FRAC_CONST(0.02718594296329),
295 FRAC_CONST(0.02578758475467), FRAC_CONST(0.02441609920285),
296 FRAC_CONST(0.02306801692862), FRAC_CONST(0.02174675502535),
297 FRAC_CONST(0.02045317933555), FRAC_CONST(0.01918724313698),
298 FRAC_CONST(0.01794333813443), FRAC_CONST(0.01673247129989),
299 FRAC_CONST(0.01554055533423), FRAC_CONST(0.01439046660792),
300 FRAC_CONST(-0.01327182200351), FRAC_CONST(-0.01218499959508),
301 FRAC_CONST(-0.01113155480321), FRAC_CONST(-0.01011502154986),
302 FRAC_CONST(-0.00913253296085), FRAC_CONST(-0.00817982333726),
303 FRAC_CONST(-0.00726158168517), FRAC_CONST(-0.00637922932685),
304 FRAC_CONST(-0.00553372111088), FRAC_CONST(-0.004722259624),
305 FRAC_CONST(-0.00394011240522), FRAC_CONST(-0.003193377839),
306 FRAC_CONST(-0.00248267236449), FRAC_CONST(-0.00180394725893),
307 FRAC_CONST(-0.00115681355227), FRAC_CONST(-0.00054642808664),
308 FRAC_CONST(2.760451905E-005), FRAC_CONST(0.0005832264248),
309 FRAC_CONST(0.00109023290512), FRAC_CONST(0.00157846825768),
310 FRAC_CONST(0.0020274176185), FRAC_CONST(0.00245085400321),
311 FRAC_CONST(0.00284467578623), FRAC_CONST(0.00320918858098),
312 FRAC_CONST(0.00354012465507), FRAC_CONST(0.00384564081246),
313 FRAC_CONST(0.0041251642327), FRAC_CONST(0.00438018617447),
314 FRAC_CONST(0.00460395301471), FRAC_CONST(0.004810946906),
315 FRAC_CONST(0.00498396877629), FRAC_CONST(0.00513822754514),
316 FRAC_CONST(0.00527157587272), FRAC_CONST(0.0053838975897),
317 FRAC_CONST(0.0054753783077), FRAC_CONST(0.005540436394),
318 FRAC_CONST(0.0055917128663), FRAC_CONST(0.00562661141932),
319 FRAC_CONST(0.00563891995151), FRAC_CONST(0.00564551969164),
320 FRAC_CONST(0.00562206432097), FRAC_CONST(0.00559380230045),
321 FRAC_CONST(0.00554757145088), FRAC_CONST(0.00548760401507),
322 FRAC_CONST(0.00541967759307), FRAC_CONST(0.00534716811982),
323 FRAC_CONST(0.00524611661324), FRAC_CONST(0.00514073539032),
324 FRAC_CONST(0.00503930226013), FRAC_CONST(0.00491376035745),
325 FRAC_CONST(0.00479325608498), FRAC_CONST(0.00466064606118),
326 FRAC_CONST(0.00452098527825), FRAC_CONST(0.00437307196781),
327 FRAC_CONST(0.0042264269227), FRAC_CONST(0.00408197531935),
328 FRAC_CONST(0.00392074323703), FRAC_CONST(0.00376039229104),
329 FRAC_CONST(0.00360082681231), FRAC_CONST(0.00344188741828),
330 FRAC_CONST(0.00327396134847), FRAC_CONST(0.00311254206525),
331 FRAC_CONST(0.00294694477165), FRAC_CONST(0.00278704643465),
332 FRAC_CONST(0.00262017586902), FRAC_CONST(0.00246256169126),
333 FRAC_CONST(0.00230172547746), FRAC_CONST(0.00214615835557),
334 FRAC_CONST(0.00198411407369), FRAC_CONST(0.00183482654224),
335 FRAC_CONST(0.00168680832531), FRAC_CONST(0.00154432198471),
336 FRAC_CONST(0.00139024948272), FRAC_CONST(0.00125778846475),
337 FRAC_CONST(0.00112501551307), FRAC_CONST(0.00098859883015),
338 FRAC_CONST(0.00086084433262), FRAC_CONST(0.00074580258865),
339 FRAC_CONST(0.00062393761391), FRAC_CONST(0.00051073884952),
340 FRAC_CONST(0.0004026540216), FRAC_CONST(0.00029495311041),
341 FRAC_CONST(0.00020430170688), FRAC_CONST(0.00010943831274),
342 FRAC_CONST(1.349497418E-005), FRAC_CONST(-6.173344072E-005),
343 FRAC_CONST(-0.00014463809349), FRAC_CONST(-0.0002098337344),
344 FRAC_CONST(-0.00028969811748), FRAC_CONST(-0.00035011758756),
345 FRAC_CONST(-0.00040951214522), FRAC_CONST(-0.00046063254803),
346 FRAC_CONST(-0.00051455722108), FRAC_CONST(-0.00055645763906),
347 FRAC_CONST(-0.0005946118933), FRAC_CONST(-0.00063415949025),
348 FRAC_CONST(-0.00066504150893), FRAC_CONST(-0.00069179375372),
349 FRAC_CONST(-0.00072153919876), FRAC_CONST(-0.00073193571525),
350 FRAC_CONST(-0.00075300014201), FRAC_CONST(-0.00076307935757),
351 FRAC_CONST(-0.0007757977331), FRAC_CONST(-0.00078014496257),
352 FRAC_CONST(-0.000780366471), FRAC_CONST(-0.00077798694927),
353 FRAC_CONST(-0.00078343322877), FRAC_CONST(-0.00077248485949),
354 FRAC_CONST(-0.0007681371927), FRAC_CONST(-0.00074905980532),
355 FRAC_CONST(-0.00074409418541), FRAC_CONST(-0.00072550431222),
356 FRAC_CONST(-0.00071577364744), FRAC_CONST(-0.00069416146273),
357 FRAC_CONST(-0.00067776907764), FRAC_CONST(-0.00065403333621),
358 FRAC_CONST(-0.00063124935319), FRAC_CONST(-0.00061327473938),
359 FRAC_CONST(-0.00058709304852), FRAC_CONST(-0.00056778025613),
360 FRAC_CONST(-0.00054665656337), FRAC_CONST(-0.00052265642972),
361 FRAC_CONST(-0.00050407143497), FRAC_CONST(-0.00048937912498),
362 FRAC_CONST(-0.00048752279712), FRAC_CONST(-0.00049475180896),
363 FRAC_CONST(-0.00056176925738), FRAC_CONST(-0.00055252865047)
364 };
365
366 #endif
367
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_syntax.c,v 1.38 2007/11/01 12:33:36 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #ifdef SBR_DEC
34
35 #include "sbr_syntax.h"
36 #include "syntax.h"
37 #include "sbr_huff.h"
38 #include "sbr_fbt.h"
39 #include "sbr_tf_grid.h"
40 #include "sbr_e_nf.h"
41 #include "bits.h"
42 #ifdef PS_DEC
43 #include "ps_dec.h"
44 #endif
45 #ifdef DRM_PS
46 #include "drm_dec.h"
47 #endif
48 #include "analysis.h"
49
50 /* static function declarations */
51 /* static function declarations */
52 static void sbr_header(bitfile *ld, sbr_info *sbr);
53 static uint8_t calc_sbr_tables(sbr_info *sbr, uint8_t start_freq, uint8_t stop_freq,
54 uint8_t samplerate_mode, uint8_t freq_scale,
55 uint8_t alter_scale, uint8_t xover_band);
56 static uint8_t sbr_data(bitfile *ld, sbr_info *sbr);
57 static uint16_t sbr_extension(bitfile *ld, sbr_info *sbr,
58 uint8_t bs_extension_id, uint16_t num_bits_left);
59 static uint8_t sbr_single_channel_element(bitfile *ld, sbr_info *sbr);
60 static uint8_t sbr_channel_pair_element(bitfile *ld, sbr_info *sbr);
61 static uint8_t sbr_grid(bitfile *ld, sbr_info *sbr, uint8_t ch);
62 static void sbr_dtdf(bitfile *ld, sbr_info *sbr, uint8_t ch);
63 static void invf_mode(bitfile *ld, sbr_info *sbr, uint8_t ch);
64 static void sinusoidal_coding(bitfile *ld, sbr_info *sbr, uint8_t ch);
65
66
67 static void sbr_reset(sbr_info *sbr)
68 {
69 #if 0
70 printf("%d\n", sbr->bs_start_freq_prev);
71 printf("%d\n", sbr->bs_stop_freq_prev);
72 printf("%d\n", sbr->bs_freq_scale_prev);
73 printf("%d\n", sbr->bs_alter_scale_prev);
74 printf("%d\n", sbr->bs_xover_band_prev);
75 printf("%d\n\n", sbr->bs_noise_bands_prev);
76 #endif
77
78 /* if these are different from the previous frame: Reset = 1 */
79 if ((sbr->bs_start_freq != sbr->bs_start_freq_prev) ||
80 (sbr->bs_stop_freq != sbr->bs_stop_freq_prev) ||
81 (sbr->bs_freq_scale != sbr->bs_freq_scale_prev) ||
82 (sbr->bs_alter_scale != sbr->bs_alter_scale_prev) ||
83 (sbr->bs_xover_band != sbr->bs_xover_band_prev) ||
84 (sbr->bs_noise_bands != sbr->bs_noise_bands_prev))
85 {
86 sbr->Reset = 1;
87 } else {
88 sbr->Reset = 0;
89 }
90
91 sbr->bs_start_freq_prev = sbr->bs_start_freq;
92 sbr->bs_stop_freq_prev = sbr->bs_stop_freq;
93 sbr->bs_freq_scale_prev = sbr->bs_freq_scale;
94 sbr->bs_alter_scale_prev = sbr->bs_alter_scale;
95 sbr->bs_xover_band_prev = sbr->bs_xover_band;
96 sbr->bs_noise_bands_prev = sbr->bs_noise_bands;
97 }
98
99 static uint8_t calc_sbr_tables(sbr_info *sbr, uint8_t start_freq, uint8_t stop_freq,
100 uint8_t samplerate_mode, uint8_t freq_scale,
101 uint8_t alter_scale, uint8_t xover_band)
102 {
103 uint8_t result = 0;
104 uint8_t k2;
105
106 /* calculate the Master Frequency Table */
107 sbr->k0 = qmf_start_channel(start_freq, samplerate_mode, sbr->sample_rate);
108 k2 = qmf_stop_channel(stop_freq, sbr->sample_rate, sbr->k0);
109
110 /* check k0 and k2 */
111 if (sbr->sample_rate >= 48000)
112 {
113 if ((k2 - sbr->k0) > 32)
114 result += 1;
115 } else if (sbr->sample_rate <= 32000) {
116 if ((k2 - sbr->k0) > 48)
117 result += 1;
118 } else { /* (sbr->sample_rate == 44100) */
119 if ((k2 - sbr->k0) > 45)
120 result += 1;
121 }
122
123 if (freq_scale == 0)
124 {
125 result += master_frequency_table_fs0(sbr, sbr->k0, k2, alter_scale);
126 } else {
127 result += master_frequency_table(sbr, sbr->k0, k2, freq_scale, alter_scale);
128 }
129 result += derived_frequency_table(sbr, xover_band, k2);
130
131 result = (result > 0) ? 1 : 0;
132
133 return result;
134 }
135
136 /* table 2 */
137 uint8_t sbr_extension_data(bitfile *ld, sbr_info *sbr, uint16_t cnt,
138 uint8_t psResetFlag)
139 {
140 uint8_t result = 0;
141 uint16_t num_align_bits = 0;
142 uint16_t num_sbr_bits1 = (uint16_t)faad_get_processed_bits(ld);
143 uint16_t num_sbr_bits2;
144
145 uint8_t saved_start_freq, saved_samplerate_mode;
146 uint8_t saved_stop_freq, saved_freq_scale;
147 uint8_t saved_alter_scale, saved_xover_band;
148
149 #if (defined(PS_DEC) || defined(DRM_PS))
150 if (psResetFlag)
151 sbr->psResetFlag = psResetFlag;
152 #endif
153
154 #ifdef DRM
155 if (!sbr->Is_DRM_SBR)
156 #endif
157 {
158 uint8_t bs_extension_type = (uint8_t)faad_getbits(ld, 4
159 DEBUGVAR(1,198,"sbr_bitstream(): bs_extension_type"));
160
161 if (bs_extension_type == EXT_SBR_DATA_CRC)
162 {
163 sbr->bs_sbr_crc_bits = (uint16_t)faad_getbits(ld, 10
164 DEBUGVAR(1,199,"sbr_bitstream(): bs_sbr_crc_bits"));
165 }
166 }
167
168 /* save old header values, in case the new ones are corrupted */
169 saved_start_freq = sbr->bs_start_freq;
170 saved_samplerate_mode = sbr->bs_samplerate_mode;
171 saved_stop_freq = sbr->bs_stop_freq;
172 saved_freq_scale = sbr->bs_freq_scale;
173 saved_alter_scale = sbr->bs_alter_scale;
174 saved_xover_band = sbr->bs_xover_band;
175
176 sbr->bs_header_flag = faad_get1bit(ld
177 DEBUGVAR(1,200,"sbr_bitstream(): bs_header_flag"));
178
179 if (sbr->bs_header_flag)
180 sbr_header(ld, sbr);
181
182 /* Reset? */
183 sbr_reset(sbr);
184
185 /* first frame should have a header */
186 //if (!(sbr->frame == 0 && sbr->bs_header_flag == 0))
187 if (sbr->header_count != 0)
188 {
189 if (sbr->Reset || (sbr->bs_header_flag && sbr->just_seeked))
190 {
191 uint8_t rt = calc_sbr_tables(sbr, sbr->bs_start_freq, sbr->bs_stop_freq,
192 sbr->bs_samplerate_mode, sbr->bs_freq_scale,
193 sbr->bs_alter_scale, sbr->bs_xover_band);
194
195 /* if an error occured with the new header values revert to the old ones */
196 if (rt > 0)
197 {
198 calc_sbr_tables(sbr, saved_start_freq, saved_stop_freq,
199 saved_samplerate_mode, saved_freq_scale,
200 saved_alter_scale, saved_xover_band);
201 }
202 }
203
204 if (result == 0)
205 {
206 result = sbr_data(ld, sbr);
207
208 /* sbr_data() returning an error means that there was an error in
209 envelope_time_border_vector().
210 In this case the old time border vector is saved and all the previous
211 data normally read after sbr_grid() is saved.
212 */
213 /* to be on the safe side, calculate old sbr tables in case of error */
214 if ((result > 0) &&
215 (sbr->Reset || (sbr->bs_header_flag && sbr->just_seeked)))
216 {
217 calc_sbr_tables(sbr, saved_start_freq, saved_stop_freq,
218 saved_samplerate_mode, saved_freq_scale,
219 saved_alter_scale, saved_xover_band);
220 }
221
222 /* we should be able to safely set result to 0 now, */
223 /* but practise indicates this doesn't work well */
224 }
225 } else {
226 result = 1;
227 }
228
229 num_sbr_bits2 = (uint16_t)faad_get_processed_bits(ld) - num_sbr_bits1;
230
231 /* check if we read more bits then were available for sbr */
232 if (8*cnt < num_sbr_bits2)
233 {
234 faad_resetbits(ld, num_sbr_bits1 + 8*cnt);
235 num_sbr_bits2 = 8*cnt;
236
237 #ifdef PS_DEC
238 /* turn off PS for the unfortunate case that we randomly read some
239 * PS data that looks correct */
240 sbr->ps_used = 0;
241 #endif
242
243 /* Make sure it doesn't decode SBR in this frame, or we'll get glitches */
244 return 1;
245 }
246
247 #ifdef DRM
248 if (!sbr->Is_DRM_SBR)
249 #endif
250 {
251 /* -4 does not apply, bs_extension_type is re-read in this function */
252 num_align_bits = 8*cnt /*- 4*/ - num_sbr_bits2;
253
254 while (num_align_bits > 7)
255 {
256 faad_getbits(ld, 8
257 DEBUGVAR(1,999,"sbr_bitstream(): num_align_bits"));
258 num_align_bits -= 8;
259 }
260 faad_getbits(ld, num_align_bits
261 DEBUGVAR(1,999,"sbr_bitstream(): num_align_bits"));
262 }
263
264 return result;
265 }
266
267 /* table 3 */
268 static void sbr_header(bitfile *ld, sbr_info *sbr)
269 {
270 uint8_t bs_header_extra_1, bs_header_extra_2;
271
272 sbr->header_count++;
273
274 sbr->bs_amp_res = faad_get1bit(ld
275 DEBUGVAR(1,203,"sbr_header(): bs_amp_res"));
276
277 /* bs_start_freq and bs_stop_freq must define a fequency band that does
278 not exceed 48 channels */
279 sbr->bs_start_freq = (uint8_t)faad_getbits(ld, 4
280 DEBUGVAR(1,204,"sbr_header(): bs_start_freq"));
281 sbr->bs_stop_freq = (uint8_t)faad_getbits(ld, 4
282 DEBUGVAR(1,205,"sbr_header(): bs_stop_freq"));
283 sbr->bs_xover_band = (uint8_t)faad_getbits(ld, 3
284 DEBUGVAR(1,206,"sbr_header(): bs_xover_band"));
285 faad_getbits(ld, 2
286 DEBUGVAR(1,207,"sbr_header(): bs_reserved_bits_hdr"));
287 bs_header_extra_1 = (uint8_t)faad_get1bit(ld
288 DEBUGVAR(1,208,"sbr_header(): bs_header_extra_1"));
289 bs_header_extra_2 = (uint8_t)faad_get1bit(ld
290 DEBUGVAR(1,209,"sbr_header(): bs_header_extra_2"));
291
292 if (bs_header_extra_1)
293 {
294 sbr->bs_freq_scale = (uint8_t)faad_getbits(ld, 2
295 DEBUGVAR(1,211,"sbr_header(): bs_freq_scale"));
296 sbr->bs_alter_scale = (uint8_t)faad_get1bit(ld
297 DEBUGVAR(1,212,"sbr_header(): bs_alter_scale"));
298 sbr->bs_noise_bands = (uint8_t)faad_getbits(ld, 2
299 DEBUGVAR(1,213,"sbr_header(): bs_noise_bands"));
300 } else {
301 /* Default values */
302 sbr->bs_freq_scale = 2;
303 sbr->bs_alter_scale = 1;
304 sbr->bs_noise_bands = 2;
305 }
306
307 if (bs_header_extra_2)
308 {
309 sbr->bs_limiter_bands = (uint8_t)faad_getbits(ld, 2
310 DEBUGVAR(1,214,"sbr_header(): bs_limiter_bands"));
311 sbr->bs_limiter_gains = (uint8_t)faad_getbits(ld, 2
312 DEBUGVAR(1,215,"sbr_header(): bs_limiter_gains"));
313 sbr->bs_interpol_freq = (uint8_t)faad_get1bit(ld
314 DEBUGVAR(1,216,"sbr_header(): bs_interpol_freq"));
315 sbr->bs_smoothing_mode = (uint8_t)faad_get1bit(ld
316 DEBUGVAR(1,217,"sbr_header(): bs_smoothing_mode"));
317 } else {
318 /* Default values */
319 sbr->bs_limiter_bands = 2;
320 sbr->bs_limiter_gains = 2;
321 sbr->bs_interpol_freq = 1;
322 sbr->bs_smoothing_mode = 1;
323 }
324
325 #if 0
326 /* print the header to screen */
327 printf("bs_amp_res: %d\n", sbr->bs_amp_res);
328 printf("bs_start_freq: %d\n", sbr->bs_start_freq);
329 printf("bs_stop_freq: %d\n", sbr->bs_stop_freq);
330 printf("bs_xover_band: %d\n", sbr->bs_xover_band);
331 if (bs_header_extra_1)
332 {
333 printf("bs_freq_scale: %d\n", sbr->bs_freq_scale);
334 printf("bs_alter_scale: %d\n", sbr->bs_alter_scale);
335 printf("bs_noise_bands: %d\n", sbr->bs_noise_bands);
336 }
337 if (bs_header_extra_2)
338 {
339 printf("bs_limiter_bands: %d\n", sbr->bs_limiter_bands);
340 printf("bs_limiter_gains: %d\n", sbr->bs_limiter_gains);
341 printf("bs_interpol_freq: %d\n", sbr->bs_interpol_freq);
342 printf("bs_smoothing_mode: %d\n", sbr->bs_smoothing_mode);
343 }
344 printf("\n");
345 #endif
346 }
347
348 /* table 4 */
349 static uint8_t sbr_data(bitfile *ld, sbr_info *sbr)
350 {
351 uint8_t result;
352 #if 0
353 sbr->bs_samplerate_mode = faad_get1bit(ld
354 DEBUGVAR(1,219,"sbr_data(): bs_samplerate_mode"));
355 #endif
356
357 sbr->rate = (sbr->bs_samplerate_mode) ? 2 : 1;
358
359 switch (sbr->id_aac)
360 {
361 case ID_SCE:
362 if ((result = sbr_single_channel_element(ld, sbr)) > 0)
363 return result;
364 break;
365 case ID_CPE:
366 if ((result = sbr_channel_pair_element(ld, sbr)) > 0)
367 return result;
368 break;
369 }
370
371 return 0;
372 }
373
374 /* table 5 */
375 static uint8_t sbr_single_channel_element(bitfile *ld, sbr_info *sbr)
376 {
377 uint8_t result;
378
379 if (faad_get1bit(ld
380 DEBUGVAR(1,220,"sbr_single_channel_element(): bs_data_extra")))
381 {
382 faad_getbits(ld, 4
383 DEBUGVAR(1,221,"sbr_single_channel_element(): bs_reserved_bits_data"));
384 }
385
386 #ifdef DRM
387 /* bs_coupling, from sbr_channel_pair_base_element(bs_amp_res) */
388 if (sbr->Is_DRM_SBR)
389 {
390 faad_get1bit(ld);
391 }
392 #endif
393
394 if ((result = sbr_grid(ld, sbr, 0)) > 0)
395 return result;
396
397 sbr_dtdf(ld, sbr, 0);
398 invf_mode(ld, sbr, 0);
399 sbr_envelope(ld, sbr, 0);
400 sbr_noise(ld, sbr, 0);
401
402 #ifndef FIXED_POINT
403 envelope_noise_dequantisation(sbr, 0);
404 #endif
405
406 memset(sbr->bs_add_harmonic[0], 0, 64*sizeof(uint8_t));
407
408 sbr->bs_add_harmonic_flag[0] = faad_get1bit(ld
409 DEBUGVAR(1,223,"sbr_single_channel_element(): bs_add_harmonic_flag[0]"));
410 if (sbr->bs_add_harmonic_flag[0])
411 sinusoidal_coding(ld, sbr, 0);
412
413 sbr->bs_extended_data = faad_get1bit(ld
414 DEBUGVAR(1,224,"sbr_single_channel_element(): bs_extended_data[0]"));
415
416 if (sbr->bs_extended_data)
417 {
418 uint16_t nr_bits_left;
419 #if (defined(PS_DEC) || defined(DRM_PS))
420 uint8_t ps_ext_read = 0;
421 #endif
422 uint16_t cnt = (uint16_t)faad_getbits(ld, 4
423 DEBUGVAR(1,225,"sbr_single_channel_element(): bs_extension_size"));
424 if (cnt == 15)
425 {
426 cnt += (uint16_t)faad_getbits(ld, 8
427 DEBUGVAR(1,226,"sbr_single_channel_element(): bs_esc_count"));
428 }
429
430 nr_bits_left = 8 * cnt;
431 while (nr_bits_left > 7)
432 {
433 uint16_t tmp_nr_bits = 0;
434
435 sbr->bs_extension_id = (uint8_t)faad_getbits(ld, 2
436 DEBUGVAR(1,227,"sbr_single_channel_element(): bs_extension_id"));
437 tmp_nr_bits += 2;
438
439 /* allow only 1 PS extension element per extension data */
440 #if (defined(PS_DEC) || defined(DRM_PS))
441 #if (defined(PS_DEC) && defined(DRM_PS))
442 if (sbr->bs_extension_id == EXTENSION_ID_PS || sbr->bs_extension_id == DRM_PARAMETRIC_STEREO)
443 #else
444 #ifdef PS_DEC
445 if (sbr->bs_extension_id == EXTENSION_ID_PS)
446 #else
447 #ifdef DRM_PS
448 if (sbr->bs_extension_id == DRM_PARAMETRIC_STEREO)
449 #endif
450 #endif
451 #endif
452 {
453 if (ps_ext_read == 0)
454 {
455 ps_ext_read = 1;
456 } else {
457 /* to be safe make it 3, will switch to "default"
458 * in sbr_extension() */
459 #ifdef DRM
460 return 1;
461 #else
462 sbr->bs_extension_id = 3;
463 #endif
464 }
465 }
466 #endif
467
468 tmp_nr_bits += sbr_extension(ld, sbr, sbr->bs_extension_id, nr_bits_left);
469
470 /* check if the data read is bigger than the number of available bits */
471 if (tmp_nr_bits > nr_bits_left)
472 return 1;
473
474 nr_bits_left -= tmp_nr_bits;
475 }
476
477 /* Corrigendum */
478 if (nr_bits_left > 0)
479 {
480 faad_getbits(ld, nr_bits_left
481 DEBUGVAR(1,280,"sbr_single_channel_element(): nr_bits_left"));
482 }
483 }
484
485 return 0;
486 }
487
488 /* table 6 */
489 static uint8_t sbr_channel_pair_element(bitfile *ld, sbr_info *sbr)
490 {
491 uint8_t n, result;
492
493 if (faad_get1bit(ld
494 DEBUGVAR(1,228,"sbr_single_channel_element(): bs_data_extra")))
495 {
496 faad_getbits(ld, 4
497 DEBUGVAR(1,228,"sbr_channel_pair_element(): bs_reserved_bits_data"));
498 faad_getbits(ld, 4
499 DEBUGVAR(1,228,"sbr_channel_pair_element(): bs_reserved_bits_data"));
500 }
501
502 sbr->bs_coupling = faad_get1bit(ld
503 DEBUGVAR(1,228,"sbr_channel_pair_element(): bs_coupling"));
504
505 if (sbr->bs_coupling)
506 {
507 if ((result = sbr_grid(ld, sbr, 0)) > 0)
508 return result;
509
510 /* need to copy some data from left to right */
511 sbr->bs_frame_class[1] = sbr->bs_frame_class[0];
512 sbr->L_E[1] = sbr->L_E[0];
513 sbr->L_Q[1] = sbr->L_Q[0];
514 sbr->bs_pointer[1] = sbr->bs_pointer[0];
515
516 for (n = 0; n <= sbr->L_E[0]; n++)
517 {
518 sbr->t_E[1][n] = sbr->t_E[0][n];
519 sbr->f[1][n] = sbr->f[0][n];
520 }
521 for (n = 0; n <= sbr->L_Q[0]; n++)
522 sbr->t_Q[1][n] = sbr->t_Q[0][n];
523
524 sbr_dtdf(ld, sbr, 0);
525 sbr_dtdf(ld, sbr, 1);
526 invf_mode(ld, sbr, 0);
527
528 /* more copying */
529 for (n = 0; n < sbr->N_Q; n++)
530 sbr->bs_invf_mode[1][n] = sbr->bs_invf_mode[0][n];
531
532 sbr_envelope(ld, sbr, 0);
533 sbr_noise(ld, sbr, 0);
534 sbr_envelope(ld, sbr, 1);
535 sbr_noise(ld, sbr, 1);
536
537 memset(sbr->bs_add_harmonic[0], 0, 64*sizeof(uint8_t));
538 memset(sbr->bs_add_harmonic[1], 0, 64*sizeof(uint8_t));
539
540 sbr->bs_add_harmonic_flag[0] = faad_get1bit(ld
541 DEBUGVAR(1,231,"sbr_channel_pair_element(): bs_add_harmonic_flag[0]"));
542 if (sbr->bs_add_harmonic_flag[0])
543 sinusoidal_coding(ld, sbr, 0);
544
545 sbr->bs_add_harmonic_flag[1] = faad_get1bit(ld
546 DEBUGVAR(1,232,"sbr_channel_pair_element(): bs_add_harmonic_flag[1]"));
547 if (sbr->bs_add_harmonic_flag[1])
548 sinusoidal_coding(ld, sbr, 1);
549 } else {
550 uint8_t saved_t_E[6] = {0}, saved_t_Q[3] = {0};
551 uint8_t saved_L_E = sbr->L_E[0];
552 uint8_t saved_L_Q = sbr->L_Q[0];
553 uint8_t saved_frame_class = sbr->bs_frame_class[0];
554
555 for (n = 0; n < saved_L_E; n++)
556 saved_t_E[n] = sbr->t_E[0][n];
557 for (n = 0; n < saved_L_Q; n++)
558 saved_t_Q[n] = sbr->t_Q[0][n];
559
560 if ((result = sbr_grid(ld, sbr, 0)) > 0)
561 return result;
562 if ((result = sbr_grid(ld, sbr, 1)) > 0)
563 {
564 /* restore first channel data as well */
565 sbr->bs_frame_class[0] = saved_frame_class;
566 sbr->L_E[0] = saved_L_E;
567 sbr->L_Q[0] = saved_L_Q;
568 for (n = 0; n < 6; n++)
569 sbr->t_E[0][n] = saved_t_E[n];
570 for (n = 0; n < 3; n++)
571 sbr->t_Q[0][n] = saved_t_Q[n];
572
573 return result;
574 }
575 sbr_dtdf(ld, sbr, 0);
576 sbr_dtdf(ld, sbr, 1);
577 invf_mode(ld, sbr, 0);
578 invf_mode(ld, sbr, 1);
579 sbr_envelope(ld, sbr, 0);
580 sbr_envelope(ld, sbr, 1);
581 sbr_noise(ld, sbr, 0);
582 sbr_noise(ld, sbr, 1);
583
584 memset(sbr->bs_add_harmonic[0], 0, 64*sizeof(uint8_t));
585 memset(sbr->bs_add_harmonic[1], 0, 64*sizeof(uint8_t));
586
587 sbr->bs_add_harmonic_flag[0] = faad_get1bit(ld
588 DEBUGVAR(1,239,"sbr_channel_pair_element(): bs_add_harmonic_flag[0]"));
589 if (sbr->bs_add_harmonic_flag[0])
590 sinusoidal_coding(ld, sbr, 0);
591
592 sbr->bs_add_harmonic_flag[1] = faad_get1bit(ld
593 DEBUGVAR(1,240,"sbr_channel_pair_element(): bs_add_harmonic_flag[1]"));
594 if (sbr->bs_add_harmonic_flag[1])
595 sinusoidal_coding(ld, sbr, 1);
596 }
597 #ifndef FIXED_POINT
598 envelope_noise_dequantisation(sbr, 0);
599 envelope_noise_dequantisation(sbr, 1);
600
601 if (sbr->bs_coupling)
602 unmap_envelope_noise(sbr);
603 #endif
604
605 sbr->bs_extended_data = faad_get1bit(ld
606 DEBUGVAR(1,233,"sbr_channel_pair_element(): bs_extended_data[0]"));
607 if (sbr->bs_extended_data)
608 {
609 uint16_t nr_bits_left;
610 uint16_t cnt = (uint16_t)faad_getbits(ld, 4
611 DEBUGVAR(1,234,"sbr_channel_pair_element(): bs_extension_size"));
612 if (cnt == 15)
613 {
614 cnt += (uint16_t)faad_getbits(ld, 8
615 DEBUGVAR(1,235,"sbr_channel_pair_element(): bs_esc_count"));
616 }
617
618 nr_bits_left = 8 * cnt;
619 while (nr_bits_left > 7)
620 {
621 uint16_t tmp_nr_bits = 0;
622
623 sbr->bs_extension_id = (uint8_t)faad_getbits(ld, 2
624 DEBUGVAR(1,236,"sbr_channel_pair_element(): bs_extension_id"));
625 tmp_nr_bits += 2;
626 tmp_nr_bits += sbr_extension(ld, sbr, sbr->bs_extension_id, nr_bits_left);
627
628 /* check if the data read is bigger than the number of available bits */
629 if (tmp_nr_bits > nr_bits_left)
630 return 1;
631
632 nr_bits_left -= tmp_nr_bits;
633 }
634
635 /* Corrigendum */
636 if (nr_bits_left > 0)
637 {
638 faad_getbits(ld, nr_bits_left
639 DEBUGVAR(1,280,"sbr_channel_pair_element(): nr_bits_left"));
640 }
641 }
642
643 return 0;
644 }
645
646 /* integer log[2](x): input range [0,10) */
647 static int8_t sbr_log2(const int8_t val)
648 {
649 int8_t log2tab[] = { 0, 0, 1, 2, 2, 3, 3, 3, 3, 4 };
650 if (val < 10 && val >= 0)
651 return log2tab[val];
652 else
653 return 0;
654 }
655
656
657 /* table 7 */
658 static uint8_t sbr_grid(bitfile *ld, sbr_info *sbr, uint8_t ch)
659 {
660 uint8_t i, env, rel, result;
661 uint8_t bs_abs_bord, bs_abs_bord_1;
662 uint8_t bs_num_env = 0;
663 uint8_t saved_L_E = sbr->L_E[ch];
664 uint8_t saved_L_Q = sbr->L_Q[ch];
665 uint8_t saved_frame_class = sbr->bs_frame_class[ch];
666
667 sbr->bs_frame_class[ch] = (uint8_t)faad_getbits(ld, 2
668 DEBUGVAR(1,248,"sbr_grid(): bs_frame_class"));
669
670 switch (sbr->bs_frame_class[ch])
671 {
672 case FIXFIX:
673 i = (uint8_t)faad_getbits(ld, 2
674 DEBUGVAR(1,249,"sbr_grid(): bs_num_env_raw"));
675
676 bs_num_env = min(1 << i, 5);
677
678 i = (uint8_t)faad_get1bit(ld
679 DEBUGVAR(1,250,"sbr_grid(): bs_freq_res_flag"));
680 for (env = 0; env < bs_num_env; env++)
681 sbr->f[ch][env] = i;
682
683 sbr->abs_bord_lead[ch] = 0;
684 sbr->abs_bord_trail[ch] = sbr->numTimeSlots;
685 sbr->n_rel_lead[ch] = bs_num_env - 1;
686 sbr->n_rel_trail[ch] = 0;
687 break;
688
689 case FIXVAR:
690 bs_abs_bord = (uint8_t)faad_getbits(ld, 2
691 DEBUGVAR(1,251,"sbr_grid(): bs_abs_bord")) + sbr->numTimeSlots;
692 bs_num_env = (uint8_t)faad_getbits(ld, 2
693 DEBUGVAR(1,252,"sbr_grid(): bs_num_env")) + 1;
694
695 for (rel = 0; rel < bs_num_env-1; rel++)
696 {
697 sbr->bs_rel_bord[ch][rel] = 2 * (uint8_t)faad_getbits(ld, 2
698 DEBUGVAR(1,253,"sbr_grid(): bs_rel_bord")) + 2;
699 }
700 i = sbr_log2(bs_num_env + 1);
701 sbr->bs_pointer[ch] = (uint8_t)faad_getbits(ld, i
702 DEBUGVAR(1,254,"sbr_grid(): bs_pointer"));
703
704 for (env = 0; env < bs_num_env; env++)
705 {
706 sbr->f[ch][bs_num_env - env - 1] = (uint8_t)faad_get1bit(ld
707 DEBUGVAR(1,255,"sbr_grid(): bs_freq_res"));
708 }
709
710 sbr->abs_bord_lead[ch] = 0;
711 sbr->abs_bord_trail[ch] = bs_abs_bord;
712 sbr->n_rel_lead[ch] = 0;
713 sbr->n_rel_trail[ch] = bs_num_env - 1;
714 break;
715
716 case VARFIX:
717 bs_abs_bord = (uint8_t)faad_getbits(ld, 2
718 DEBUGVAR(1,256,"sbr_grid(): bs_abs_bord"));
719 bs_num_env = (uint8_t)faad_getbits(ld, 2
720 DEBUGVAR(1,257,"sbr_grid(): bs_num_env")) + 1;
721
722 for (rel = 0; rel < bs_num_env-1; rel++)
723 {
724 sbr->bs_rel_bord[ch][rel] = 2 * (uint8_t)faad_getbits(ld, 2
725 DEBUGVAR(1,258,"sbr_grid(): bs_rel_bord")) + 2;
726 }
727 i = sbr_log2(bs_num_env + 1);
728 sbr->bs_pointer[ch] = (uint8_t)faad_getbits(ld, i
729 DEBUGVAR(1,259,"sbr_grid(): bs_pointer"));
730
731 for (env = 0; env < bs_num_env; env++)
732 {
733 sbr->f[ch][env] = (uint8_t)faad_get1bit(ld
734 DEBUGVAR(1,260,"sbr_grid(): bs_freq_res"));
735 }
736
737 sbr->abs_bord_lead[ch] = bs_abs_bord;
738 sbr->abs_bord_trail[ch] = sbr->numTimeSlots;
739 sbr->n_rel_lead[ch] = bs_num_env - 1;
740 sbr->n_rel_trail[ch] = 0;
741 break;
742
743 case VARVAR:
744 bs_abs_bord = (uint8_t)faad_getbits(ld, 2
745 DEBUGVAR(1,261,"sbr_grid(): bs_abs_bord_0"));
746 bs_abs_bord_1 = (uint8_t)faad_getbits(ld, 2
747 DEBUGVAR(1,262,"sbr_grid(): bs_abs_bord_1")) + sbr->numTimeSlots;
748 sbr->bs_num_rel_0[ch] = (uint8_t)faad_getbits(ld, 2
749 DEBUGVAR(1,263,"sbr_grid(): bs_num_rel_0"));
750 sbr->bs_num_rel_1[ch] = (uint8_t)faad_getbits(ld, 2
751 DEBUGVAR(1,264,"sbr_grid(): bs_num_rel_1"));
752
753 bs_num_env = min(5, sbr->bs_num_rel_0[ch] + sbr->bs_num_rel_1[ch] + 1);
754
755 for (rel = 0; rel < sbr->bs_num_rel_0[ch]; rel++)
756 {
757 sbr->bs_rel_bord_0[ch][rel] = 2 * (uint8_t)faad_getbits(ld, 2
758 DEBUGVAR(1,265,"sbr_grid(): bs_rel_bord")) + 2;
759 }
760 for(rel = 0; rel < sbr->bs_num_rel_1[ch]; rel++)
761 {
762 sbr->bs_rel_bord_1[ch][rel] = 2 * (uint8_t)faad_getbits(ld, 2
763 DEBUGVAR(1,266,"sbr_grid(): bs_rel_bord")) + 2;
764 }
765 i = sbr_log2(sbr->bs_num_rel_0[ch] + sbr->bs_num_rel_1[ch] + 2);
766 sbr->bs_pointer[ch] = (uint8_t)faad_getbits(ld, i
767 DEBUGVAR(1,267,"sbr_grid(): bs_pointer"));
768
769 for (env = 0; env < bs_num_env; env++)
770 {
771 sbr->f[ch][env] = (uint8_t)faad_get1bit(ld
772 DEBUGVAR(1,268,"sbr_grid(): bs_freq_res"));
773 }
774
775 sbr->abs_bord_lead[ch] = bs_abs_bord;
776 sbr->abs_bord_trail[ch] = bs_abs_bord_1;
777 sbr->n_rel_lead[ch] = sbr->bs_num_rel_0[ch];
778 sbr->n_rel_trail[ch] = sbr->bs_num_rel_1[ch];
779 break;
780 }
781
782 if (sbr->bs_frame_class[ch] == VARVAR)
783 sbr->L_E[ch] = min(bs_num_env, 5);
784 else
785 sbr->L_E[ch] = min(bs_num_env, 4);
786
787 if (sbr->L_E[ch] <= 0)
788 return 1;
789
790 if (sbr->L_E[ch] > 1)
791 sbr->L_Q[ch] = 2;
792 else
793 sbr->L_Q[ch] = 1;
794
795 /* TODO: this code can probably be integrated into the code above! */
796 if ((result = envelope_time_border_vector(sbr, ch)) > 0)
797 {
798 sbr->bs_frame_class[ch] = saved_frame_class;
799 sbr->L_E[ch] = saved_L_E;
800 sbr->L_Q[ch] = saved_L_Q;
801 return result;
802 }
803 noise_floor_time_border_vector(sbr, ch);
804
805 #if 0
806 for (env = 0; env < bs_num_env; env++)
807 {
808 printf("freq_res[ch:%d][env:%d]: %d\n", ch, env, sbr->f[ch][env]);
809 }
810 #endif
811
812 return 0;
813 }
814
815 /* table 8 */
816 static void sbr_dtdf(bitfile *ld, sbr_info *sbr, uint8_t ch)
817 {
818 uint8_t i;
819
820 for (i = 0; i < sbr->L_E[ch]; i++)
821 {
822 sbr->bs_df_env[ch][i] = faad_get1bit(ld
823 DEBUGVAR(1,269,"sbr_dtdf(): bs_df_env"));
824 }
825
826 for (i = 0; i < sbr->L_Q[ch]; i++)
827 {
828 sbr->bs_df_noise[ch][i] = faad_get1bit(ld
829 DEBUGVAR(1,270,"sbr_dtdf(): bs_df_noise"));
830 }
831 }
832
833 /* table 9 */
834 static void invf_mode(bitfile *ld, sbr_info *sbr, uint8_t ch)
835 {
836 uint8_t n;
837
838 for (n = 0; n < sbr->N_Q; n++)
839 {
840 sbr->bs_invf_mode[ch][n] = (uint8_t)faad_getbits(ld, 2
841 DEBUGVAR(1,271,"invf_mode(): bs_invf_mode"));
842 }
843 }
844
845 static uint16_t sbr_extension(bitfile *ld, sbr_info *sbr,
846 uint8_t bs_extension_id, uint16_t num_bits_left)
847 {
848 #ifdef PS_DEC
849 uint8_t header;
850 uint16_t ret;
851 #endif
852
853 switch (bs_extension_id)
854 {
855 #ifdef PS_DEC
856 case EXTENSION_ID_PS:
857 if (!sbr->ps)
858 {
859 sbr->ps = ps_init(get_sr_index(sbr->sample_rate));
860 }
861 if (sbr->psResetFlag)
862 {
863 sbr->ps->header_read = 0;
864 }
865 ret = ps_data(sbr->ps, ld, &header);
866
867 /* enable PS if and only if: a header has been decoded */
868 if (sbr->ps_used == 0 && header == 1)
869 {
870 sbr->ps_used = 1;
871 }
872
873 if (header == 1)
874 {
875 sbr->psResetFlag = 0;
876 }
877
878 return ret;
879 #endif
880 #ifdef DRM_PS
881 case DRM_PARAMETRIC_STEREO:
882 sbr->ps_used = 1;
883 if (!sbr->drm_ps)
884 {
885 sbr->drm_ps = drm_ps_init();
886 }
887 return drm_ps_data(sbr->drm_ps, ld);
888 #endif
889 default:
890 sbr->bs_extension_data = (uint8_t)faad_getbits(ld, 6
891 DEBUGVAR(1,279,"sbr_single_channel_element(): bs_extension_data"));
892 return 6;
893 }
894 }
895
896 /* table 12 */
897 static void sinusoidal_coding(bitfile *ld, sbr_info *sbr, uint8_t ch)
898 {
899 uint8_t n;
900
901 for (n = 0; n < sbr->N_high; n++)
902 {
903 sbr->bs_add_harmonic[ch][n] = faad_get1bit(ld
904 DEBUGVAR(1,278,"sinusoidal_coding(): bs_add_harmonic"));
905 }
906 }
907
908
909 #endif /* SBR_DEC */
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_syntax.h,v 1.23 2007/11/01 12:33:36 menno Exp $
28 **/
29
30 #ifndef __SBR_SYNTAX_H__
31 #define __SBR_SYNTAX_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #include "bits.h"
38
39 #define T_HFGEN 8
40 #define T_HFADJ 2
41
42 #define EXT_SBR_DATA 13
43 #define EXT_SBR_DATA_CRC 14
44
45 #define FIXFIX 0
46 #define FIXVAR 1
47 #define VARFIX 2
48 #define VARVAR 3
49
50 #define LO_RES 0
51 #define HI_RES 1
52
53 #define NO_TIME_SLOTS_960 15
54 #define NO_TIME_SLOTS 16
55 #define RATE 2
56
57 #define NOISE_FLOOR_OFFSET 6
58
59
60 uint8_t sbr_extension_data(bitfile *ld, sbr_info *sbr, uint16_t cnt,
61 uint8_t resetFlag);
62
63 #ifdef __cplusplus
64 }
65 #endif
66 #endif /* __SBR_SYNTAX_H__ */
67
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_tf_grid.c,v 1.19 2007/11/01 12:33:36 menno Exp $
28 **/
29
30 /* Time/Frequency grid */
31
32 #include "common.h"
33 #include "structs.h"
34
35 #ifdef SBR_DEC
36
37 #include <stdlib.h>
38
39 #include "sbr_syntax.h"
40 #include "sbr_tf_grid.h"
41
42
43 /* static function declarations */
44 #if 0
45 static int16_t rel_bord_lead(sbr_info *sbr, uint8_t ch, uint8_t l);
46 static int16_t rel_bord_trail(sbr_info *sbr, uint8_t ch, uint8_t l);
47 #endif
48 static uint8_t middleBorder(sbr_info *sbr, uint8_t ch);
49
50
51 /* function constructs new time border vector */
52 /* first build into temp vector to be able to use previous vector on error */
53 uint8_t envelope_time_border_vector(sbr_info *sbr, uint8_t ch)
54 {
55 uint8_t l, border, temp;
56 uint8_t t_E_temp[6] = {0};
57
58 t_E_temp[0] = sbr->rate * sbr->abs_bord_lead[ch];
59 t_E_temp[sbr->L_E[ch]] = sbr->rate * sbr->abs_bord_trail[ch];
60
61 switch (sbr->bs_frame_class[ch])
62 {
63 case FIXFIX:
64 switch (sbr->L_E[ch])
65 {
66 case 4:
67 temp = (int) (sbr->numTimeSlots / 4);
68 t_E_temp[3] = sbr->rate * 3 * temp;
69 t_E_temp[2] = sbr->rate * 2 * temp;
70 t_E_temp[1] = sbr->rate * temp;
71 break;
72 case 2:
73 t_E_temp[1] = sbr->rate * (int) (sbr->numTimeSlots / 2);
74 break;
75 default:
76 break;
77 }
78 break;
79
80 case FIXVAR:
81 if (sbr->L_E[ch] > 1)
82 {
83 int8_t i = sbr->L_E[ch];
84 border = sbr->abs_bord_trail[ch];
85
86 for (l = 0; l < (sbr->L_E[ch] - 1); l++)
87 {
88 if (border < sbr->bs_rel_bord[ch][l])
89 return 1;
90
91 border -= sbr->bs_rel_bord[ch][l];
92 t_E_temp[--i] = sbr->rate * border;
93 }
94 }
95 break;
96
97 case VARFIX:
98 if (sbr->L_E[ch] > 1)
99 {
100 int8_t i = 1;
101 border = sbr->abs_bord_lead[ch];
102
103 for (l = 0; l < (sbr->L_E[ch] - 1); l++)
104 {
105 border += sbr->bs_rel_bord[ch][l];
106
107 if (sbr->rate * border + sbr->tHFAdj > sbr->numTimeSlotsRate+sbr->tHFGen)
108 return 1;
109
110 t_E_temp[i++] = sbr->rate * border;
111 }
112 }
113 break;
114
115 case VARVAR:
116 if (sbr->bs_num_rel_0[ch])
117 {
118 int8_t i = 1;
119 border = sbr->abs_bord_lead[ch];
120
121 for (l = 0; l < sbr->bs_num_rel_0[ch]; l++)
122 {
123 border += sbr->bs_rel_bord_0[ch][l];
124
125 if (sbr->rate * border + sbr->tHFAdj > sbr->numTimeSlotsRate+sbr->tHFGen)
126 return 1;
127
128 t_E_temp[i++] = sbr->rate * border;
129 }
130 }
131
132 if (sbr->bs_num_rel_1[ch])
133 {
134 int8_t i = sbr->L_E[ch];
135 border = sbr->abs_bord_trail[ch];
136
137 for (l = 0; l < sbr->bs_num_rel_1[ch]; l++)
138 {
139 if (border < sbr->bs_rel_bord_1[ch][l])
140 return 1;
141
142 border -= sbr->bs_rel_bord_1[ch][l];
143 t_E_temp[--i] = sbr->rate * border;
144 }
145 }
146 break;
147 }
148
149 /* no error occured, we can safely use this t_E vector */
150 for (l = 0; l < 6; l++)
151 {
152 sbr->t_E[ch][l] = t_E_temp[l];
153 }
154
155 return 0;
156 }
157
158 void noise_floor_time_border_vector(sbr_info *sbr, uint8_t ch)
159 {
160 sbr->t_Q[ch][0] = sbr->t_E[ch][0];
161
162 if (sbr->L_E[ch] == 1)
163 {
164 sbr->t_Q[ch][1] = sbr->t_E[ch][1];
165 sbr->t_Q[ch][2] = 0;
166 } else {
167 uint8_t index = middleBorder(sbr, ch);
168 sbr->t_Q[ch][1] = sbr->t_E[ch][index];
169 sbr->t_Q[ch][2] = sbr->t_E[ch][sbr->L_E[ch]];
170 }
171 }
172
173 #if 0
174 static int16_t rel_bord_lead(sbr_info *sbr, uint8_t ch, uint8_t l)
175 {
176 uint8_t i;
177 int16_t acc = 0;
178
179 switch (sbr->bs_frame_class[ch])
180 {
181 case FIXFIX:
182 return sbr->numTimeSlots/sbr->L_E[ch];
183 case FIXVAR:
184 return 0;
185 case VARFIX:
186 for (i = 0; i < l; i++)
187 {
188 acc += sbr->bs_rel_bord[ch][i];
189 }
190 return acc;
191 case VARVAR:
192 for (i = 0; i < l; i++)
193 {
194 acc += sbr->bs_rel_bord_0[ch][i];
195 }
196 return acc;
197 }
198
199 return 0;
200 }
201
202 static int16_t rel_bord_trail(sbr_info *sbr, uint8_t ch, uint8_t l)
203 {
204 uint8_t i;
205 int16_t acc = 0;
206
207 switch (sbr->bs_frame_class[ch])
208 {
209 case FIXFIX:
210 case VARFIX:
211 return 0;
212 case FIXVAR:
213 for (i = 0; i < l; i++)
214 {
215 acc += sbr->bs_rel_bord[ch][i];
216 }
217 return acc;
218 case VARVAR:
219 for (i = 0; i < l; i++)
220 {
221 acc += sbr->bs_rel_bord_1[ch][i];
222 }
223 return acc;
224 }
225
226 return 0;
227 }
228 #endif
229
230 static uint8_t middleBorder(sbr_info *sbr, uint8_t ch)
231 {
232 int8_t retval = 0;
233
234 switch (sbr->bs_frame_class[ch])
235 {
236 case FIXFIX:
237 retval = sbr->L_E[ch]/2;
238 break;
239 case VARFIX:
240 if (sbr->bs_pointer[ch] == 0)
241 retval = 1;
242 else if (sbr->bs_pointer[ch] == 1)
243 retval = sbr->L_E[ch] - 1;
244 else
245 retval = sbr->bs_pointer[ch] - 1;
246 break;
247 case FIXVAR:
248 case VARVAR:
249 if (sbr->bs_pointer[ch] > 1)
250 retval = sbr->L_E[ch] + 1 - sbr->bs_pointer[ch];
251 else
252 retval = sbr->L_E[ch] - 1;
253 break;
254 }
255
256 return (retval > 0) ? retval : 0;
257 }
258
259
260 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sbr_tf_grid.h,v 1.17 2007/11/01 12:33:36 menno Exp $
28 **/
29
30 #ifndef __SBR_TF_GRID_H__
31 #define __SBR_TF_GRID_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37
38 uint8_t envelope_time_border_vector(sbr_info *sbr, uint8_t ch);
39 void noise_floor_time_border_vector(sbr_info *sbr, uint8_t ch);
40
41
42 #ifdef __cplusplus
43 }
44 #endif
45 #endif
46
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: sine_win.h,v 1.19 2007/11/01 12:33:36 menno Exp $
28 **/
29
30 #ifndef __SINE_WIN_H__
31 #define __SINE_WIN_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #ifdef _MSC_VER
38 #pragma warning(disable:4305)
39 #pragma warning(disable:4244)
40 #endif
41
42 ALIGN static const real_t sine_long_1024[] =
43 {
44 FRAC_CONST(0.00076699031874270449),
45 FRAC_CONST(0.002300969151425805),
46 FRAC_CONST(0.0038349425697062275),
47 FRAC_CONST(0.0053689069639963425),
48 FRAC_CONST(0.0069028587247297558),
49 FRAC_CONST(0.0084367942423697988),
50 FRAC_CONST(0.0099707099074180308),
51 FRAC_CONST(0.011504602110422714),
52 FRAC_CONST(0.013038467241987334),
53 FRAC_CONST(0.014572301692779064),
54 FRAC_CONST(0.016106101853537287),
55 FRAC_CONST(0.017639864115082053),
56 FRAC_CONST(0.019173584868322623),
57 FRAC_CONST(0.020707260504265895),
58 FRAC_CONST(0.022240887414024961),
59 FRAC_CONST(0.023774461988827555),
60 FRAC_CONST(0.025307980620024571),
61 FRAC_CONST(0.026841439699098531),
62 FRAC_CONST(0.028374835617672099),
63 FRAC_CONST(0.029908164767516555),
64 FRAC_CONST(0.031441423540560301),
65 FRAC_CONST(0.032974608328897335),
66 FRAC_CONST(0.03450771552479575),
67 FRAC_CONST(0.036040741520706229),
68 FRAC_CONST(0.037573682709270494),
69 FRAC_CONST(0.039106535483329888),
70 FRAC_CONST(0.040639296235933736),
71 FRAC_CONST(0.042171961360347947),
72 FRAC_CONST(0.043704527250063421),
73 FRAC_CONST(0.04523699029880459),
74 FRAC_CONST(0.046769346900537863),
75 FRAC_CONST(0.048301593449480144),
76 FRAC_CONST(0.049833726340107277),
77 FRAC_CONST(0.051365741967162593),
78 FRAC_CONST(0.052897636725665324),
79 FRAC_CONST(0.054429407010919133),
80 FRAC_CONST(0.055961049218520569),
81 FRAC_CONST(0.057492559744367566),
82 FRAC_CONST(0.059023934984667931),
83 FRAC_CONST(0.060555171335947788),
84 FRAC_CONST(0.062086265195060088),
85 FRAC_CONST(0.063617212959193106),
86 FRAC_CONST(0.065148011025878833),
87 FRAC_CONST(0.066678655793001557),
88 FRAC_CONST(0.068209143658806329),
89 FRAC_CONST(0.069739471021907307),
90 FRAC_CONST(0.071269634281296401),
91 FRAC_CONST(0.072799629836351673),
92 FRAC_CONST(0.074329454086845756),
93 FRAC_CONST(0.075859103432954447),
94 FRAC_CONST(0.077388574275265049),
95 FRAC_CONST(0.078917863014784942),
96 FRAC_CONST(0.080446966052950014),
97 FRAC_CONST(0.081975879791633066),
98 FRAC_CONST(0.083504600633152432),
99 FRAC_CONST(0.085033124980280275),
100 FRAC_CONST(0.08656144923625117),
101 FRAC_CONST(0.088089569804770507),
102 FRAC_CONST(0.089617483090022959),
103 FRAC_CONST(0.091145185496681005),
104 FRAC_CONST(0.09267267342991331),
105 FRAC_CONST(0.094199943295393204),
106 FRAC_CONST(0.095726991499307162),
107 FRAC_CONST(0.097253814448363271),
108 FRAC_CONST(0.098780408549799623),
109 FRAC_CONST(0.10030677021139286),
110 FRAC_CONST(0.10183289584146653),
111 FRAC_CONST(0.10335878184889961),
112 FRAC_CONST(0.10488442464313497),
113 FRAC_CONST(0.10640982063418768),
114 FRAC_CONST(0.10793496623265365),
115 FRAC_CONST(0.10945985784971798),
116 FRAC_CONST(0.11098449189716339),
117 FRAC_CONST(0.11250886478737869),
118 FRAC_CONST(0.1140329729333672),
119 FRAC_CONST(0.11555681274875526),
120 FRAC_CONST(0.11708038064780059),
121 FRAC_CONST(0.11860367304540072),
122 FRAC_CONST(0.1201266863571015),
123 FRAC_CONST(0.12164941699910553),
124 FRAC_CONST(0.12317186138828048),
125 FRAC_CONST(0.12469401594216764),
126 FRAC_CONST(0.12621587707899035),
127 FRAC_CONST(0.12773744121766231),
128 FRAC_CONST(0.12925870477779614),
129 FRAC_CONST(0.13077966417971171),
130 FRAC_CONST(0.13230031584444465),
131 FRAC_CONST(0.13382065619375472),
132 FRAC_CONST(0.13534068165013421),
133 FRAC_CONST(0.13686038863681638),
134 FRAC_CONST(0.13837977357778389),
135 FRAC_CONST(0.13989883289777721),
136 FRAC_CONST(0.14141756302230302),
137 FRAC_CONST(0.14293596037764267),
138 FRAC_CONST(0.14445402139086047),
139 FRAC_CONST(0.14597174248981221),
140 FRAC_CONST(0.14748912010315357),
141 FRAC_CONST(0.14900615066034845),
142 FRAC_CONST(0.1505228305916774),
143 FRAC_CONST(0.15203915632824605),
144 FRAC_CONST(0.15355512430199345),
145 FRAC_CONST(0.15507073094570051),
146 FRAC_CONST(0.15658597269299843),
147 FRAC_CONST(0.15810084597837698),
148 FRAC_CONST(0.15961534723719306),
149 FRAC_CONST(0.16112947290567881),
150 FRAC_CONST(0.16264321942095031),
151 FRAC_CONST(0.16415658322101581),
152 FRAC_CONST(0.16566956074478412),
153 FRAC_CONST(0.16718214843207294),
154 FRAC_CONST(0.16869434272361733),
155 FRAC_CONST(0.17020614006107807),
156 FRAC_CONST(0.17171753688704997),
157 FRAC_CONST(0.17322852964507032),
158 FRAC_CONST(0.1747391147796272),
159 FRAC_CONST(0.17624928873616788),
160 FRAC_CONST(0.17775904796110717),
161 FRAC_CONST(0.17926838890183575),
162 FRAC_CONST(0.18077730800672859),
163 FRAC_CONST(0.1822858017251533),
164 FRAC_CONST(0.18379386650747845),
165 FRAC_CONST(0.1853014988050819),
166 FRAC_CONST(0.18680869507035927),
167 FRAC_CONST(0.18831545175673212),
168 FRAC_CONST(0.18982176531865641),
169 FRAC_CONST(0.1913276322116309),
170 FRAC_CONST(0.19283304889220523),
171 FRAC_CONST(0.1943380118179886),
172 FRAC_CONST(0.19584251744765785),
173 FRAC_CONST(0.19734656224096592),
174 FRAC_CONST(0.19885014265875009),
175 FRAC_CONST(0.20035325516294045),
176 FRAC_CONST(0.20185589621656805),
177 FRAC_CONST(0.20335806228377332),
178 FRAC_CONST(0.20485974982981442),
179 FRAC_CONST(0.20636095532107551),
180 FRAC_CONST(0.20786167522507507),
181 FRAC_CONST(0.20936190601047416),
182 FRAC_CONST(0.21086164414708486),
183 FRAC_CONST(0.21236088610587842),
184 FRAC_CONST(0.21385962835899375),
185 FRAC_CONST(0.21535786737974555),
186 FRAC_CONST(0.21685559964263262),
187 FRAC_CONST(0.21835282162334632),
188 FRAC_CONST(0.2198495297987787),
189 FRAC_CONST(0.22134572064703081),
190 FRAC_CONST(0.22284139064742112),
191 FRAC_CONST(0.2243365362804936),
192 FRAC_CONST(0.22583115402802617),
193 FRAC_CONST(0.22732524037303886),
194 FRAC_CONST(0.22881879179980222),
195 FRAC_CONST(0.23031180479384544),
196 FRAC_CONST(0.23180427584196478),
197 FRAC_CONST(0.23329620143223159),
198 FRAC_CONST(0.23478757805400097),
199 FRAC_CONST(0.23627840219791957),
200 FRAC_CONST(0.23776867035593419),
201 FRAC_CONST(0.23925837902129998),
202 FRAC_CONST(0.24074752468858843),
203 FRAC_CONST(0.24223610385369601),
204 FRAC_CONST(0.24372411301385216),
205 FRAC_CONST(0.24521154866762754),
206 FRAC_CONST(0.24669840731494241),
207 FRAC_CONST(0.24818468545707478),
208 FRAC_CONST(0.24967037959666857),
209 FRAC_CONST(0.25115548623774192),
210 FRAC_CONST(0.25264000188569552),
211 FRAC_CONST(0.25412392304732062),
212 FRAC_CONST(0.25560724623080738),
213 FRAC_CONST(0.25708996794575312),
214 FRAC_CONST(0.25857208470317034),
215 FRAC_CONST(0.26005359301549519),
216 FRAC_CONST(0.26153448939659552),
217 FRAC_CONST(0.263014770361779),
218 FRAC_CONST(0.26449443242780163),
219 FRAC_CONST(0.26597347211287559),
220 FRAC_CONST(0.26745188593667762),
221 FRAC_CONST(0.26892967042035726),
222 FRAC_CONST(0.27040682208654482),
223 FRAC_CONST(0.27188333745935972),
224 FRAC_CONST(0.27335921306441868),
225 FRAC_CONST(0.27483444542884394),
226 FRAC_CONST(0.27630903108127108),
227 FRAC_CONST(0.27778296655185769),
228 FRAC_CONST(0.27925624837229118),
229 FRAC_CONST(0.28072887307579719),
230 FRAC_CONST(0.28220083719714756),
231 FRAC_CONST(0.28367213727266843),
232 FRAC_CONST(0.28514276984024867),
233 FRAC_CONST(0.28661273143934779),
234 FRAC_CONST(0.28808201861100413),
235 FRAC_CONST(0.28955062789784303),
236 FRAC_CONST(0.29101855584408509),
237 FRAC_CONST(0.29248579899555388),
238 FRAC_CONST(0.29395235389968466),
239 FRAC_CONST(0.29541821710553201),
240 FRAC_CONST(0.29688338516377827),
241 FRAC_CONST(0.2983478546267414),
242 FRAC_CONST(0.29981162204838335),
243 FRAC_CONST(0.30127468398431795),
244 FRAC_CONST(0.30273703699181914),
245 FRAC_CONST(0.30419867762982911),
246 FRAC_CONST(0.30565960245896612),
247 FRAC_CONST(0.3071198080415331),
248 FRAC_CONST(0.30857929094152509),
249 FRAC_CONST(0.31003804772463789),
250 FRAC_CONST(0.31149607495827591),
251 FRAC_CONST(0.3129533692115602),
252 FRAC_CONST(0.31440992705533666),
253 FRAC_CONST(0.31586574506218396),
254 FRAC_CONST(0.31732081980642174),
255 FRAC_CONST(0.31877514786411848),
256 FRAC_CONST(0.32022872581309986),
257 FRAC_CONST(0.32168155023295658),
258 FRAC_CONST(0.32313361770505233),
259 FRAC_CONST(0.32458492481253215),
260 FRAC_CONST(0.32603546814033024),
261 FRAC_CONST(0.327485244275178),
262 FRAC_CONST(0.3289342498056122),
263 FRAC_CONST(0.33038248132198278),
264 FRAC_CONST(0.33182993541646111),
265 FRAC_CONST(0.33327660868304793),
266 FRAC_CONST(0.33472249771758122),
267 FRAC_CONST(0.33616759911774452),
268 FRAC_CONST(0.33761190948307462),
269 FRAC_CONST(0.33905542541496964),
270 FRAC_CONST(0.34049814351669716),
271 FRAC_CONST(0.34194006039340219),
272 FRAC_CONST(0.34338117265211504),
273 FRAC_CONST(0.34482147690175929),
274 FRAC_CONST(0.34626096975316001),
275 FRAC_CONST(0.34769964781905138),
276 FRAC_CONST(0.34913750771408497),
277 FRAC_CONST(0.35057454605483751),
278 FRAC_CONST(0.35201075945981908),
279 FRAC_CONST(0.35344614454948081),
280 FRAC_CONST(0.35488069794622279),
281 FRAC_CONST(0.35631441627440241),
282 FRAC_CONST(0.3577472961603419),
283 FRAC_CONST(0.3591793342323365),
284 FRAC_CONST(0.36061052712066227),
285 FRAC_CONST(0.36204087145758418),
286 FRAC_CONST(0.36347036387736376),
287 FRAC_CONST(0.36489900101626732),
288 FRAC_CONST(0.36632677951257359),
289 FRAC_CONST(0.36775369600658198),
290 FRAC_CONST(0.36917974714062002),
291 FRAC_CONST(0.37060492955905167),
292 FRAC_CONST(0.37202923990828501),
293 FRAC_CONST(0.3734526748367803),
294 FRAC_CONST(0.37487523099505754),
295 FRAC_CONST(0.37629690503570479),
296 FRAC_CONST(0.37771769361338564),
297 FRAC_CONST(0.37913759338484732),
298 FRAC_CONST(0.38055660100892852),
299 FRAC_CONST(0.38197471314656722),
300 FRAC_CONST(0.38339192646080866),
301 FRAC_CONST(0.38480823761681288),
302 FRAC_CONST(0.38622364328186298),
303 FRAC_CONST(0.38763814012537273),
304 FRAC_CONST(0.38905172481889438),
305 FRAC_CONST(0.39046439403612659),
306 FRAC_CONST(0.39187614445292235),
307 FRAC_CONST(0.3932869727472964),
308 FRAC_CONST(0.39469687559943356),
309 FRAC_CONST(0.39610584969169627),
310 FRAC_CONST(0.39751389170863233),
311 FRAC_CONST(0.39892099833698291),
312 FRAC_CONST(0.40032716626569009),
313 FRAC_CONST(0.40173239218590501),
314 FRAC_CONST(0.4031366727909953),
315 FRAC_CONST(0.404540004776553),
316 FRAC_CONST(0.40594238484040251),
317 FRAC_CONST(0.40734380968260797),
318 FRAC_CONST(0.40874427600548136),
319 FRAC_CONST(0.41014378051359024),
320 FRAC_CONST(0.41154231991376522),
321 FRAC_CONST(0.41293989091510808),
322 FRAC_CONST(0.4143364902289991),
323 FRAC_CONST(0.41573211456910536),
324 FRAC_CONST(0.41712676065138787),
325 FRAC_CONST(0.4185204251941097),
326 FRAC_CONST(0.41991310491784362),
327 FRAC_CONST(0.42130479654547964),
328 FRAC_CONST(0.42269549680223295),
329 FRAC_CONST(0.42408520241565156),
330 FRAC_CONST(0.4254739101156238),
331 FRAC_CONST(0.42686161663438643),
332 FRAC_CONST(0.42824831870653196),
333 FRAC_CONST(0.42963401306901638),
334 FRAC_CONST(0.43101869646116703),
335 FRAC_CONST(0.43240236562469014),
336 FRAC_CONST(0.43378501730367852),
337 FRAC_CONST(0.43516664824461926),
338 FRAC_CONST(0.4365472551964012),
339 FRAC_CONST(0.43792683491032286),
340 FRAC_CONST(0.43930538414009995),
341 FRAC_CONST(0.4406828996418729),
342 FRAC_CONST(0.4420593781742147),
343 FRAC_CONST(0.44343481649813848),
344 FRAC_CONST(0.44480921137710488),
345 FRAC_CONST(0.44618255957703007),
346 FRAC_CONST(0.44755485786629301),
347 FRAC_CONST(0.44892610301574326),
348 FRAC_CONST(0.45029629179870861),
349 FRAC_CONST(0.45166542099100249),
350 FRAC_CONST(0.45303348737093158),
351 FRAC_CONST(0.45440048771930358),
352 FRAC_CONST(0.45576641881943464),
353 FRAC_CONST(0.45713127745715698),
354 FRAC_CONST(0.45849506042082627),
355 FRAC_CONST(0.45985776450132954),
356 FRAC_CONST(0.46121938649209238),
357 FRAC_CONST(0.46257992318908681),
358 FRAC_CONST(0.46393937139083852),
359 FRAC_CONST(0.4652977278984346),
360 FRAC_CONST(0.46665498951553092),
361 FRAC_CONST(0.46801115304835983),
362 FRAC_CONST(0.46936621530573752),
363 FRAC_CONST(0.4707201730990716),
364 FRAC_CONST(0.47207302324236866),
365 FRAC_CONST(0.47342476255224153),
366 FRAC_CONST(0.47477538784791712),
367 FRAC_CONST(0.47612489595124358),
368 FRAC_CONST(0.47747328368669806),
369 FRAC_CONST(0.47882054788139389),
370 FRAC_CONST(0.48016668536508839),
371 FRAC_CONST(0.48151169297018986),
372 FRAC_CONST(0.48285556753176567),
373 FRAC_CONST(0.48419830588754903),
374 FRAC_CONST(0.48553990487794696),
375 FRAC_CONST(0.48688036134604734),
376 FRAC_CONST(0.48821967213762679),
377 FRAC_CONST(0.48955783410115744),
378 FRAC_CONST(0.49089484408781509),
379 FRAC_CONST(0.49223069895148602),
380 FRAC_CONST(0.49356539554877477),
381 FRAC_CONST(0.49489893073901126),
382 FRAC_CONST(0.49623130138425825),
383 FRAC_CONST(0.49756250434931915),
384 FRAC_CONST(0.49889253650174459),
385 FRAC_CONST(0.50022139471184068),
386 FRAC_CONST(0.50154907585267539),
387 FRAC_CONST(0.50287557680008699),
388 FRAC_CONST(0.50420089443269034),
389 FRAC_CONST(0.50552502563188539),
390 FRAC_CONST(0.50684796728186321),
391 FRAC_CONST(0.5081697162696146),
392 FRAC_CONST(0.50949026948493636),
393 FRAC_CONST(0.51080962382043904),
394 FRAC_CONST(0.51212777617155469),
395 FRAC_CONST(0.51344472343654346),
396 FRAC_CONST(0.5147604625165012),
397 FRAC_CONST(0.51607499031536663),
398 FRAC_CONST(0.51738830373992906),
399 FRAC_CONST(0.51870039969983495),
400 FRAC_CONST(0.52001127510759604),
401 FRAC_CONST(0.52132092687859566),
402 FRAC_CONST(0.52262935193109661),
403 FRAC_CONST(0.5239365471862486),
404 FRAC_CONST(0.52524250956809471),
405 FRAC_CONST(0.52654723600357944),
406 FRAC_CONST(0.52785072342255523),
407 FRAC_CONST(0.52915296875779061),
408 FRAC_CONST(0.53045396894497632),
409 FRAC_CONST(0.53175372092273332),
410 FRAC_CONST(0.53305222163261945),
411 FRAC_CONST(0.53434946801913752),
412 FRAC_CONST(0.53564545702974109),
413 FRAC_CONST(0.53694018561484291),
414 FRAC_CONST(0.5382336507278217),
415 FRAC_CONST(0.53952584932502889),
416 FRAC_CONST(0.54081677836579667),
417 FRAC_CONST(0.54210643481244392),
418 FRAC_CONST(0.5433948156302848),
419 FRAC_CONST(0.54468191778763453),
420 FRAC_CONST(0.54596773825581757),
421 FRAC_CONST(0.54725227400917409),
422 FRAC_CONST(0.54853552202506739),
423 FRAC_CONST(0.54981747928389091),
424 FRAC_CONST(0.55109814276907543),
425 FRAC_CONST(0.55237750946709607),
426 FRAC_CONST(0.55365557636747931),
427 FRAC_CONST(0.55493234046281037),
428 FRAC_CONST(0.55620779874873993),
429 FRAC_CONST(0.55748194822399155),
430 FRAC_CONST(0.55875478589036831),
431 FRAC_CONST(0.56002630875276038),
432 FRAC_CONST(0.56129651381915147),
433 FRAC_CONST(0.56256539810062656),
434 FRAC_CONST(0.56383295861137817),
435 FRAC_CONST(0.56509919236871398),
436 FRAC_CONST(0.56636409639306384),
437 FRAC_CONST(0.56762766770798623),
438 FRAC_CONST(0.56888990334017586),
439 FRAC_CONST(0.5701508003194703),
440 FRAC_CONST(0.57141035567885723),
441 FRAC_CONST(0.57266856645448116),
442 FRAC_CONST(0.57392542968565075),
443 FRAC_CONST(0.57518094241484508),
444 FRAC_CONST(0.57643510168772183),
445 FRAC_CONST(0.5776879045531228),
446 FRAC_CONST(0.57893934806308178),
447 FRAC_CONST(0.58018942927283168),
448 FRAC_CONST(0.58143814524081017),
449 FRAC_CONST(0.58268549302866846),
450 FRAC_CONST(0.58393146970127618),
451 FRAC_CONST(0.58517607232673041),
452 FRAC_CONST(0.5864192979763605),
453 FRAC_CONST(0.58766114372473666),
454 FRAC_CONST(0.58890160664967572),
455 FRAC_CONST(0.59014068383224882),
456 FRAC_CONST(0.59137837235678758),
457 FRAC_CONST(0.59261466931089113),
458 FRAC_CONST(0.59384957178543363),
459 FRAC_CONST(0.59508307687456996),
460 FRAC_CONST(0.59631518167574371),
461 FRAC_CONST(0.59754588328969316),
462 FRAC_CONST(0.59877517882045872),
463 FRAC_CONST(0.60000306537538894),
464 FRAC_CONST(0.6012295400651485),
465 FRAC_CONST(0.60245460000372375),
466 FRAC_CONST(0.60367824230843037),
467 FRAC_CONST(0.60490046409991982),
468 FRAC_CONST(0.60612126250218612),
469 FRAC_CONST(0.60734063464257293),
470 FRAC_CONST(0.60855857765177945),
471 FRAC_CONST(0.60977508866386843),
472 FRAC_CONST(0.61099016481627166),
473 FRAC_CONST(0.61220380324979795),
474 FRAC_CONST(0.61341600110863859),
475 FRAC_CONST(0.61462675554037505),
476 FRAC_CONST(0.61583606369598509),
477 FRAC_CONST(0.61704392272984976),
478 FRAC_CONST(0.61825032979976025),
479 FRAC_CONST(0.61945528206692402),
480 FRAC_CONST(0.62065877669597214),
481 FRAC_CONST(0.62186081085496536),
482 FRAC_CONST(0.62306138171540126),
483 FRAC_CONST(0.62426048645222065),
484 FRAC_CONST(0.62545812224381436),
485 FRAC_CONST(0.62665428627202935),
486 FRAC_CONST(0.62784897572217646),
487 FRAC_CONST(0.629042187783036),
488 FRAC_CONST(0.63023391964686437),
489 FRAC_CONST(0.63142416850940186),
490 FRAC_CONST(0.63261293156987741),
491 FRAC_CONST(0.63380020603101728),
492 FRAC_CONST(0.63498598909904946),
493 FRAC_CONST(0.63617027798371217),
494 FRAC_CONST(0.63735306989825913),
495 FRAC_CONST(0.63853436205946679),
496 FRAC_CONST(0.63971415168764045),
497 FRAC_CONST(0.64089243600662138),
498 FRAC_CONST(0.64206921224379254),
499 FRAC_CONST(0.64324447763008585),
500 FRAC_CONST(0.64441822939998838),
501 FRAC_CONST(0.64559046479154869),
502 FRAC_CONST(0.64676118104638392),
503 FRAC_CONST(0.64793037540968534),
504 FRAC_CONST(0.64909804513022595),
505 FRAC_CONST(0.65026418746036585),
506 FRAC_CONST(0.65142879965605982),
507 FRAC_CONST(0.65259187897686244),
508 FRAC_CONST(0.65375342268593606),
509 FRAC_CONST(0.65491342805005603),
510 FRAC_CONST(0.6560718923396176),
511 FRAC_CONST(0.65722881282864254),
512 FRAC_CONST(0.65838418679478505),
513 FRAC_CONST(0.65953801151933866),
514 FRAC_CONST(0.6606902842872423),
515 FRAC_CONST(0.66184100238708687),
516 FRAC_CONST(0.66299016311112147),
517 FRAC_CONST(0.66413776375526001),
518 FRAC_CONST(0.66528380161908718),
519 FRAC_CONST(0.66642827400586524),
520 FRAC_CONST(0.66757117822254031),
521 FRAC_CONST(0.66871251157974798),
522 FRAC_CONST(0.66985227139182102),
523 FRAC_CONST(0.67099045497679422),
524 FRAC_CONST(0.67212705965641173),
525 FRAC_CONST(0.67326208275613297),
526 FRAC_CONST(0.67439552160513905),
527 FRAC_CONST(0.67552737353633852),
528 FRAC_CONST(0.67665763588637495),
529 FRAC_CONST(0.6777863059956315),
530 FRAC_CONST(0.67891338120823841),
531 FRAC_CONST(0.68003885887207893),
532 FRAC_CONST(0.68116273633879543),
533 FRAC_CONST(0.68228501096379557),
534 FRAC_CONST(0.68340568010625868),
535 FRAC_CONST(0.6845247411291423),
536 FRAC_CONST(0.68564219139918747),
537 FRAC_CONST(0.68675802828692589),
538 FRAC_CONST(0.68787224916668555),
539 FRAC_CONST(0.68898485141659704),
540 FRAC_CONST(0.69009583241859995),
541 FRAC_CONST(0.69120518955844845),
542 FRAC_CONST(0.69231292022571822),
543 FRAC_CONST(0.69341902181381176),
544 FRAC_CONST(0.69452349171996552),
545 FRAC_CONST(0.69562632734525487),
546 FRAC_CONST(0.6967275260946012),
547 FRAC_CONST(0.69782708537677729),
548 FRAC_CONST(0.69892500260441415),
549 FRAC_CONST(0.70002127519400625),
550 FRAC_CONST(0.70111590056591866),
551 FRAC_CONST(0.70220887614439187),
552 FRAC_CONST(0.70330019935754873),
553 FRAC_CONST(0.70438986763740041),
554 FRAC_CONST(0.7054778784198521),
555 FRAC_CONST(0.70656422914470951),
556 FRAC_CONST(0.70764891725568435),
557 FRAC_CONST(0.70873194020040065),
558 FRAC_CONST(0.70981329543040084),
559 FRAC_CONST(0.71089298040115168),
560 FRAC_CONST(0.71197099257204999),
561 FRAC_CONST(0.71304732940642923),
562 FRAC_CONST(0.71412198837156471),
563 FRAC_CONST(0.71519496693868001),
564 FRAC_CONST(0.71626626258295312),
565 FRAC_CONST(0.71733587278352173),
566 FRAC_CONST(0.71840379502348972),
567 FRAC_CONST(0.71947002678993299),
568 FRAC_CONST(0.72053456557390527),
569 FRAC_CONST(0.72159740887044366),
570 FRAC_CONST(0.72265855417857561),
571 FRAC_CONST(0.72371799900132339),
572 FRAC_CONST(0.72477574084571128),
573 FRAC_CONST(0.72583177722277037),
574 FRAC_CONST(0.72688610564754497),
575 FRAC_CONST(0.72793872363909862),
576 FRAC_CONST(0.72898962872051931),
577 FRAC_CONST(0.73003881841892615),
578 FRAC_CONST(0.73108629026547423),
579 FRAC_CONST(0.73213204179536129),
580 FRAC_CONST(0.73317607054783274),
581 FRAC_CONST(0.73421837406618817),
582 FRAC_CONST(0.73525894989778673),
583 FRAC_CONST(0.73629779559405306),
584 FRAC_CONST(0.73733490871048279),
585 FRAC_CONST(0.73837028680664851),
586 FRAC_CONST(0.73940392744620576),
587 FRAC_CONST(0.74043582819689802),
588 FRAC_CONST(0.74146598663056329),
589 FRAC_CONST(0.74249440032313918),
590 FRAC_CONST(0.74352106685466912),
591 FRAC_CONST(0.74454598380930725),
592 FRAC_CONST(0.74556914877532543),
593 FRAC_CONST(0.74659055934511731),
594 FRAC_CONST(0.74761021311520515),
595 FRAC_CONST(0.74862810768624533),
596 FRAC_CONST(0.74964424066303348),
597 FRAC_CONST(0.75065860965451059),
598 FRAC_CONST(0.75167121227376843),
599 FRAC_CONST(0.75268204613805523),
600 FRAC_CONST(0.75369110886878121),
601 FRAC_CONST(0.75469839809152439),
602 FRAC_CONST(0.75570391143603588),
603 FRAC_CONST(0.75670764653624567),
604 FRAC_CONST(0.75770960103026808),
605 FRAC_CONST(0.75870977256040739),
606 FRAC_CONST(0.75970815877316344),
607 FRAC_CONST(0.76070475731923692),
608 FRAC_CONST(0.76169956585353527),
609 FRAC_CONST(0.76269258203517787),
610 FRAC_CONST(0.76368380352750187),
611 FRAC_CONST(0.76467322799806714),
612 FRAC_CONST(0.76566085311866239),
613 FRAC_CONST(0.76664667656531038),
614 FRAC_CONST(0.76763069601827327),
615 FRAC_CONST(0.76861290916205827),
616 FRAC_CONST(0.76959331368542294),
617 FRAC_CONST(0.7705719072813807),
618 FRAC_CONST(0.7715486876472063),
619 FRAC_CONST(0.77252365248444133),
620 FRAC_CONST(0.77349679949889905),
621 FRAC_CONST(0.77446812640067086),
622 FRAC_CONST(0.77543763090413043),
623 FRAC_CONST(0.77640531072794039),
624 FRAC_CONST(0.7773711635950562),
625 FRAC_CONST(0.77833518723273309),
626 FRAC_CONST(0.7792973793725303),
627 FRAC_CONST(0.78025773775031659),
628 FRAC_CONST(0.78121626010627609),
629 FRAC_CONST(0.7821729441849129),
630 FRAC_CONST(0.78312778773505731),
631 FRAC_CONST(0.78408078850986995),
632 FRAC_CONST(0.78503194426684808),
633 FRAC_CONST(0.78598125276783015),
634 FRAC_CONST(0.7869287117790017),
635 FRAC_CONST(0.78787431907090011),
636 FRAC_CONST(0.78881807241842017),
637 FRAC_CONST(0.78975996960081907),
638 FRAC_CONST(0.79070000840172161),
639 FRAC_CONST(0.79163818660912577),
640 FRAC_CONST(0.79257450201540758),
641 FRAC_CONST(0.79350895241732666),
642 FRAC_CONST(0.79444153561603059),
643 FRAC_CONST(0.79537224941706119),
644 FRAC_CONST(0.79630109163035911),
645 FRAC_CONST(0.7972280600702687),
646 FRAC_CONST(0.79815315255554375),
647 FRAC_CONST(0.79907636690935235),
648 FRAC_CONST(0.79999770095928191),
649 FRAC_CONST(0.8009171525373443),
650 FRAC_CONST(0.80183471947998131),
651 FRAC_CONST(0.80275039962806916),
652 FRAC_CONST(0.80366419082692409),
653 FRAC_CONST(0.804576090926307),
654 FRAC_CONST(0.80548609778042912),
655 FRAC_CONST(0.80639420924795624),
656 FRAC_CONST(0.80730042319201445),
657 FRAC_CONST(0.80820473748019472),
658 FRAC_CONST(0.80910714998455813),
659 FRAC_CONST(0.81000765858164114),
660 FRAC_CONST(0.81090626115245967),
661 FRAC_CONST(0.81180295558251536),
662 FRAC_CONST(0.81269773976179949),
663 FRAC_CONST(0.81359061158479851),
664 FRAC_CONST(0.81448156895049861),
665 FRAC_CONST(0.81537060976239129),
666 FRAC_CONST(0.81625773192847739),
667 FRAC_CONST(0.81714293336127297),
668 FRAC_CONST(0.81802621197781344),
669 FRAC_CONST(0.81890756569965895),
670 FRAC_CONST(0.81978699245289899),
671 FRAC_CONST(0.82066449016815746),
672 FRAC_CONST(0.82154005678059761),
673 FRAC_CONST(0.82241369022992639),
674 FRAC_CONST(0.82328538846040011),
675 FRAC_CONST(0.82415514942082857),
676 FRAC_CONST(0.82502297106458022),
677 FRAC_CONST(0.82588885134958678),
678 FRAC_CONST(0.82675278823834852),
679 FRAC_CONST(0.8276147796979384),
680 FRAC_CONST(0.82847482370000713),
681 FRAC_CONST(0.82933291822078825),
682 FRAC_CONST(0.83018906124110237),
683 FRAC_CONST(0.83104325074636232),
684 FRAC_CONST(0.83189548472657759),
685 FRAC_CONST(0.83274576117635946),
686 FRAC_CONST(0.83359407809492514),
687 FRAC_CONST(0.83444043348610319),
688 FRAC_CONST(0.83528482535833737),
689 FRAC_CONST(0.83612725172469216),
690 FRAC_CONST(0.83696771060285702),
691 FRAC_CONST(0.83780620001515094),
692 FRAC_CONST(0.8386427179885273),
693 FRAC_CONST(0.83947726255457855),
694 FRAC_CONST(0.84030983174954077),
695 FRAC_CONST(0.84114042361429808),
696 FRAC_CONST(0.84196903619438768),
697 FRAC_CONST(0.84279566754000412),
698 FRAC_CONST(0.84362031570600404),
699 FRAC_CONST(0.84444297875191066),
700 FRAC_CONST(0.84526365474191822),
701 FRAC_CONST(0.84608234174489694),
702 FRAC_CONST(0.84689903783439735),
703 FRAC_CONST(0.84771374108865427),
704 FRAC_CONST(0.84852644959059265),
705 FRAC_CONST(0.84933716142783067),
706 FRAC_CONST(0.85014587469268521),
707 FRAC_CONST(0.85095258748217573),
708 FRAC_CONST(0.85175729789802912),
709 FRAC_CONST(0.85256000404668397),
710 FRAC_CONST(0.85336070403929543),
711 FRAC_CONST(0.85415939599173873),
712 FRAC_CONST(0.85495607802461482),
713 FRAC_CONST(0.85575074826325392),
714 FRAC_CONST(0.85654340483771996),
715 FRAC_CONST(0.85733404588281559),
716 FRAC_CONST(0.85812266953808602),
717 FRAC_CONST(0.8589092739478239),
718 FRAC_CONST(0.85969385726107261),
719 FRAC_CONST(0.86047641763163207),
720 FRAC_CONST(0.86125695321806206),
721 FRAC_CONST(0.86203546218368721),
722 FRAC_CONST(0.86281194269660033),
723 FRAC_CONST(0.86358639292966799),
724 FRAC_CONST(0.86435881106053403),
725 FRAC_CONST(0.86512919527162369),
726 FRAC_CONST(0.86589754375014882),
727 FRAC_CONST(0.86666385468811102),
728 FRAC_CONST(0.86742812628230692),
729 FRAC_CONST(0.86819035673433131),
730 FRAC_CONST(0.86895054425058238),
731 FRAC_CONST(0.86970868704226556),
732 FRAC_CONST(0.87046478332539767),
733 FRAC_CONST(0.8712188313208109),
734 FRAC_CONST(0.8719708292541577),
735 FRAC_CONST(0.8727207753559143),
736 FRAC_CONST(0.87346866786138488),
737 FRAC_CONST(0.8742145050107063),
738 FRAC_CONST(0.87495828504885154),
739 FRAC_CONST(0.8757000062256346),
740 FRAC_CONST(0.87643966679571361),
741 FRAC_CONST(0.87717726501859594),
742 FRAC_CONST(0.87791279915864173),
743 FRAC_CONST(0.87864626748506813),
744 FRAC_CONST(0.87937766827195318),
745 FRAC_CONST(0.88010699979824036),
746 FRAC_CONST(0.88083426034774204),
747 FRAC_CONST(0.88155944820914378),
748 FRAC_CONST(0.8822825616760086),
749 FRAC_CONST(0.88300359904678072),
750 FRAC_CONST(0.88372255862478966),
751 FRAC_CONST(0.8844394387182537),
752 FRAC_CONST(0.88515423764028511),
753 FRAC_CONST(0.88586695370889279),
754 FRAC_CONST(0.88657758524698704),
755 FRAC_CONST(0.88728613058238315),
756 FRAC_CONST(0.88799258804780556),
757 FRAC_CONST(0.88869695598089171),
758 FRAC_CONST(0.88939923272419552),
759 FRAC_CONST(0.89009941662519221),
760 FRAC_CONST(0.89079750603628149),
761 FRAC_CONST(0.89149349931479138),
762 FRAC_CONST(0.89218739482298248),
763 FRAC_CONST(0.89287919092805168),
764 FRAC_CONST(0.89356888600213602),
765 FRAC_CONST(0.89425647842231604),
766 FRAC_CONST(0.89494196657062075),
767 FRAC_CONST(0.89562534883403),
768 FRAC_CONST(0.89630662360447966),
769 FRAC_CONST(0.89698578927886397),
770 FRAC_CONST(0.89766284425904075),
771 FRAC_CONST(0.89833778695183419),
772 FRAC_CONST(0.89901061576903907),
773 FRAC_CONST(0.89968132912742393),
774 FRAC_CONST(0.9003499254487356),
775 FRAC_CONST(0.90101640315970233),
776 FRAC_CONST(0.90168076069203773),
777 FRAC_CONST(0.9023429964824442),
778 FRAC_CONST(0.90300310897261704),
779 FRAC_CONST(0.90366109660924798),
780 FRAC_CONST(0.90431695784402832),
781 FRAC_CONST(0.90497069113365325),
782 FRAC_CONST(0.90562229493982516),
783 FRAC_CONST(0.90627176772925766),
784 FRAC_CONST(0.90691910797367803),
785 FRAC_CONST(0.90756431414983252),
786 FRAC_CONST(0.9082073847394887),
787 FRAC_CONST(0.90884831822943912),
788 FRAC_CONST(0.90948711311150543),
789 FRAC_CONST(0.91012376788254157),
790 FRAC_CONST(0.91075828104443757),
791 FRAC_CONST(0.91139065110412232),
792 FRAC_CONST(0.91202087657356823),
793 FRAC_CONST(0.9126489559697939),
794 FRAC_CONST(0.91327488781486776),
795 FRAC_CONST(0.91389867063591168),
796 FRAC_CONST(0.91452030296510445),
797 FRAC_CONST(0.91513978333968526),
798 FRAC_CONST(0.91575711030195672),
799 FRAC_CONST(0.91637228239928914),
800 FRAC_CONST(0.91698529818412289),
801 FRAC_CONST(0.91759615621397295),
802 FRAC_CONST(0.9182048550514309),
803 FRAC_CONST(0.91881139326416994),
804 FRAC_CONST(0.91941576942494696),
805 FRAC_CONST(0.92001798211160657),
806 FRAC_CONST(0.92061802990708386),
807 FRAC_CONST(0.92121591139940873),
808 FRAC_CONST(0.92181162518170812),
809 FRAC_CONST(0.92240516985220988),
810 FRAC_CONST(0.92299654401424625),
811 FRAC_CONST(0.92358574627625656),
812 FRAC_CONST(0.9241727752517912),
813 FRAC_CONST(0.92475762955951391),
814 FRAC_CONST(0.9253403078232062),
815 FRAC_CONST(0.92592080867176996),
816 FRAC_CONST(0.92649913073923051),
817 FRAC_CONST(0.9270752726647401),
818 FRAC_CONST(0.92764923309258118),
819 FRAC_CONST(0.92822101067216944),
820 FRAC_CONST(0.92879060405805702),
821 FRAC_CONST(0.9293580119099355),
822 FRAC_CONST(0.92992323289263956),
823 FRAC_CONST(0.93048626567614978),
824 FRAC_CONST(0.93104710893559517),
825 FRAC_CONST(0.93160576135125783),
826 FRAC_CONST(0.93216222160857432),
827 FRAC_CONST(0.93271648839814025),
828 FRAC_CONST(0.93326856041571205),
829 FRAC_CONST(0.93381843636221096),
830 FRAC_CONST(0.9343661149437259),
831 FRAC_CONST(0.93491159487151609),
832 FRAC_CONST(0.93545487486201462),
833 FRAC_CONST(0.9359959536368313),
834 FRAC_CONST(0.9365348299227555),
835 FRAC_CONST(0.93707150245175919),
836 FRAC_CONST(0.93760596996099999),
837 FRAC_CONST(0.93813823119282436),
838 FRAC_CONST(0.93866828489477017),
839 FRAC_CONST(0.9391961298195699),
840 FRAC_CONST(0.93972176472515334),
841 FRAC_CONST(0.94024518837465088),
842 FRAC_CONST(0.94076639953639607),
843 FRAC_CONST(0.94128539698392866),
844 FRAC_CONST(0.94180217949599765),
845 FRAC_CONST(0.94231674585656378),
846 FRAC_CONST(0.94282909485480271),
847 FRAC_CONST(0.94333922528510772),
848 FRAC_CONST(0.94384713594709269),
849 FRAC_CONST(0.94435282564559475),
850 FRAC_CONST(0.94485629319067721),
851 FRAC_CONST(0.94535753739763229),
852 FRAC_CONST(0.94585655708698391),
853 FRAC_CONST(0.94635335108449059),
854 FRAC_CONST(0.946847918221148),
855 FRAC_CONST(0.94734025733319194),
856 FRAC_CONST(0.94783036726210101),
857 FRAC_CONST(0.94831824685459909),
858 FRAC_CONST(0.94880389496265838),
859 FRAC_CONST(0.94928731044350201),
860 FRAC_CONST(0.94976849215960668),
861 FRAC_CONST(0.95024743897870523),
862 FRAC_CONST(0.95072414977378961),
863 FRAC_CONST(0.95119862342311323),
864 FRAC_CONST(0.95167085881019386),
865 FRAC_CONST(0.95214085482381583),
866 FRAC_CONST(0.95260861035803324),
867 FRAC_CONST(0.9530741243121722),
868 FRAC_CONST(0.95353739559083328),
869 FRAC_CONST(0.95399842310389449),
870 FRAC_CONST(0.95445720576651349),
871 FRAC_CONST(0.95491374249913052),
872 FRAC_CONST(0.95536803222747024),
873 FRAC_CONST(0.95582007388254542),
874 FRAC_CONST(0.95626986640065814),
875 FRAC_CONST(0.95671740872340305),
876 FRAC_CONST(0.9571626997976701),
877 FRAC_CONST(0.95760573857564624),
878 FRAC_CONST(0.9580465240148186),
879 FRAC_CONST(0.9584850550779761),
880 FRAC_CONST(0.95892133073321306),
881 FRAC_CONST(0.95935534995393079),
882 FRAC_CONST(0.9597871117188399),
883 FRAC_CONST(0.96021661501196343),
884 FRAC_CONST(0.96064385882263847),
885 FRAC_CONST(0.96106884214551935),
886 FRAC_CONST(0.961491563980579),
887 FRAC_CONST(0.9619120233331121),
888 FRAC_CONST(0.9623302192137374),
889 FRAC_CONST(0.96274615063839941),
890 FRAC_CONST(0.96315981662837136),
891 FRAC_CONST(0.96357121621025721),
892 FRAC_CONST(0.96398034841599411),
893 FRAC_CONST(0.96438721228285429),
894 FRAC_CONST(0.9647918068534479),
895 FRAC_CONST(0.96519413117572472),
896 FRAC_CONST(0.96559418430297683),
897 FRAC_CONST(0.96599196529384057),
898 FRAC_CONST(0.96638747321229879),
899 FRAC_CONST(0.96678070712768327),
900 FRAC_CONST(0.96717166611467664),
901 FRAC_CONST(0.96756034925331436),
902 FRAC_CONST(0.9679467556289878),
903 FRAC_CONST(0.9683308843324453),
904 FRAC_CONST(0.96871273445979478),
905 FRAC_CONST(0.9690923051125061),
906 FRAC_CONST(0.96946959539741295),
907 FRAC_CONST(0.96984460442671483),
908 FRAC_CONST(0.97021733131797916),
909 FRAC_CONST(0.97058777519414363),
910 FRAC_CONST(0.97095593518351797),
911 FRAC_CONST(0.97132181041978616),
912 FRAC_CONST(0.97168540004200854),
913 FRAC_CONST(0.9720467031946235),
914 FRAC_CONST(0.97240571902744977),
915 FRAC_CONST(0.97276244669568857),
916 FRAC_CONST(0.97311688535992513),
917 FRAC_CONST(0.97346903418613095),
918 FRAC_CONST(0.9738188923456661),
919 FRAC_CONST(0.97416645901528032),
920 FRAC_CONST(0.97451173337711572),
921 FRAC_CONST(0.97485471461870843),
922 FRAC_CONST(0.97519540193299037),
923 FRAC_CONST(0.97553379451829136),
924 FRAC_CONST(0.97586989157834103),
925 FRAC_CONST(0.97620369232227056),
926 FRAC_CONST(0.97653519596461447),
927 FRAC_CONST(0.97686440172531264),
928 FRAC_CONST(0.97719130882971228),
929 FRAC_CONST(0.97751591650856928),
930 FRAC_CONST(0.97783822399805043),
931 FRAC_CONST(0.97815823053973505),
932 FRAC_CONST(0.97847593538061683),
933 FRAC_CONST(0.97879133777310567),
934 FRAC_CONST(0.97910443697502925),
935 FRAC_CONST(0.97941523224963478),
936 FRAC_CONST(0.97972372286559117),
937 FRAC_CONST(0.98002990809698998),
938 FRAC_CONST(0.98033378722334796),
939 FRAC_CONST(0.98063535952960812),
940 FRAC_CONST(0.98093462430614164),
941 FRAC_CONST(0.98123158084874973),
942 FRAC_CONST(0.98152622845866466),
943 FRAC_CONST(0.9818185664425525),
944 FRAC_CONST(0.98210859411251361),
945 FRAC_CONST(0.98239631078608469),
946 FRAC_CONST(0.98268171578624086),
947 FRAC_CONST(0.98296480844139644),
948 FRAC_CONST(0.98324558808540707),
949 FRAC_CONST(0.98352405405757126),
950 FRAC_CONST(0.98380020570263149),
951 FRAC_CONST(0.98407404237077645),
952 FRAC_CONST(0.9843455634176419),
953 FRAC_CONST(0.9846147682043126),
954 FRAC_CONST(0.9848816560973237),
955 FRAC_CONST(0.98514622646866223),
956 FRAC_CONST(0.98540847869576842),
957 FRAC_CONST(0.98566841216153755),
958 FRAC_CONST(0.98592602625432113),
959 FRAC_CONST(0.98618132036792827),
960 FRAC_CONST(0.98643429390162707),
961 FRAC_CONST(0.98668494626014669),
962 FRAC_CONST(0.98693327685367771),
963 FRAC_CONST(0.98717928509787434),
964 FRAC_CONST(0.98742297041385541),
965 FRAC_CONST(0.98766433222820571),
966 FRAC_CONST(0.98790336997297779),
967 FRAC_CONST(0.98814008308569257),
968 FRAC_CONST(0.98837447100934128),
969 FRAC_CONST(0.98860653319238645),
970 FRAC_CONST(0.98883626908876354),
971 FRAC_CONST(0.98906367815788154),
972 FRAC_CONST(0.98928875986462517),
973 FRAC_CONST(0.98951151367935519),
974 FRAC_CONST(0.98973193907791057),
975 FRAC_CONST(0.98995003554160899),
976 FRAC_CONST(0.9901658025572484),
977 FRAC_CONST(0.99037923961710816),
978 FRAC_CONST(0.99059034621895015),
979 FRAC_CONST(0.99079912186602037),
980 FRAC_CONST(0.99100556606704937),
981 FRAC_CONST(0.99120967833625406),
982 FRAC_CONST(0.99141145819333854),
983 FRAC_CONST(0.99161090516349537),
984 FRAC_CONST(0.99180801877740643),
985 FRAC_CONST(0.99200279857124452),
986 FRAC_CONST(0.99219524408667392),
987 FRAC_CONST(0.99238535487085167),
988 FRAC_CONST(0.99257313047642881),
989 FRAC_CONST(0.99275857046155114),
990 FRAC_CONST(0.99294167438986047),
991 FRAC_CONST(0.99312244183049558),
992 FRAC_CONST(0.99330087235809328),
993 FRAC_CONST(0.99347696555278919),
994 FRAC_CONST(0.99365072100021912),
995 FRAC_CONST(0.99382213829151966),
996 FRAC_CONST(0.99399121702332938),
997 FRAC_CONST(0.99415795679778973),
998 FRAC_CONST(0.99432235722254581),
999 FRAC_CONST(0.9944844179107476),
1000 FRAC_CONST(0.99464413848105071),
1001 FRAC_CONST(0.99480151855761711),
1002 FRAC_CONST(0.99495655777011638),
1003 FRAC_CONST(0.99510925575372611),
1004 FRAC_CONST(0.99525961214913339),
1005 FRAC_CONST(0.9954076266025349),
1006 FRAC_CONST(0.99555329876563847),
1007 FRAC_CONST(0.99569662829566352),
1008 FRAC_CONST(0.99583761485534161),
1009 FRAC_CONST(0.99597625811291779),
1010 FRAC_CONST(0.99611255774215113),
1011 FRAC_CONST(0.99624651342231552),
1012 FRAC_CONST(0.99637812483820021),
1013 FRAC_CONST(0.99650739168011082),
1014 FRAC_CONST(0.9966343136438699),
1015 FRAC_CONST(0.996758890430818),
1016 FRAC_CONST(0.99688112174781385),
1017 FRAC_CONST(0.99700100730723529),
1018 FRAC_CONST(0.99711854682697998),
1019 FRAC_CONST(0.99723374003046616),
1020 FRAC_CONST(0.99734658664663323),
1021 FRAC_CONST(0.99745708640994191),
1022 FRAC_CONST(0.99756523906037575),
1023 FRAC_CONST(0.997671044343441),
1024 FRAC_CONST(0.99777450201016782),
1025 FRAC_CONST(0.99787561181711015),
1026 FRAC_CONST(0.99797437352634699),
1027 FRAC_CONST(0.99807078690548234),
1028 FRAC_CONST(0.99816485172764624),
1029 FRAC_CONST(0.99825656777149518),
1030 FRAC_CONST(0.99834593482121237),
1031 FRAC_CONST(0.99843295266650844),
1032 FRAC_CONST(0.99851762110262221),
1033 FRAC_CONST(0.99859993993032037),
1034 FRAC_CONST(0.99867990895589909),
1035 FRAC_CONST(0.99875752799118334),
1036 FRAC_CONST(0.99883279685352799),
1037 FRAC_CONST(0.99890571536581829),
1038 FRAC_CONST(0.99897628335646982),
1039 FRAC_CONST(0.99904450065942929),
1040 FRAC_CONST(0.99911036711417489),
1041 FRAC_CONST(0.99917388256571638),
1042 FRAC_CONST(0.99923504686459585),
1043 FRAC_CONST(0.99929385986688779),
1044 FRAC_CONST(0.99935032143419944),
1045 FRAC_CONST(0.9994044314336713),
1046 FRAC_CONST(0.99945618973797734),
1047 FRAC_CONST(0.99950559622532531),
1048 FRAC_CONST(0.99955265077945699),
1049 FRAC_CONST(0.99959735328964838),
1050 FRAC_CONST(0.9996397036507102),
1051 FRAC_CONST(0.99967970176298793),
1052 FRAC_CONST(0.99971734753236219),
1053 FRAC_CONST(0.99975264087024884),
1054 FRAC_CONST(0.99978558169359921),
1055 FRAC_CONST(0.99981616992490041),
1056 FRAC_CONST(0.99984440549217524),
1057 FRAC_CONST(0.99987028832898295),
1058 FRAC_CONST(0.99989381837441849),
1059 FRAC_CONST(0.99991499557311347),
1060 FRAC_CONST(0.999933819875236),
1061 FRAC_CONST(0.99995029123649048),
1062 FRAC_CONST(0.99996440961811828),
1063 FRAC_CONST(0.99997617498689761),
1064 FRAC_CONST(0.9999855873151432),
1065 FRAC_CONST(0.99999264658070719),
1066 FRAC_CONST(0.99999735276697821),
1067 FRAC_CONST(0.99999970586288223)
1068 };
1069
1070 #ifdef ALLOW_SMALL_FRAMELENGTH
1071 ALIGN static const real_t sine_long_960[] =
1072 {
1073 FRAC_CONST(0.00081812299560725323),
1074 FRAC_CONST(0.0024543667964602917),
1075 FRAC_CONST(0.0040906040262347889),
1076 FRAC_CONST(0.0057268303042312674),
1077 FRAC_CONST(0.0073630412497795667),
1078 FRAC_CONST(0.0089992324822505774),
1079 FRAC_CONST(0.010635399621067975),
1080 FRAC_CONST(0.012271538285719924),
1081 FRAC_CONST(0.013907644095770845),
1082 FRAC_CONST(0.015543712670873098),
1083 FRAC_CONST(0.017179739630778748),
1084 FRAC_CONST(0.018815720595351273),
1085 FRAC_CONST(0.020451651184577292),
1086 FRAC_CONST(0.022087527018578291),
1087 FRAC_CONST(0.023723343717622358),
1088 FRAC_CONST(0.025359096902135895),
1089 FRAC_CONST(0.02699478219271537),
1090 FRAC_CONST(0.028630395210139003),
1091 FRAC_CONST(0.030265931575378519),
1092 FRAC_CONST(0.031901386909610863),
1093 FRAC_CONST(0.033536756834229922),
1094 FRAC_CONST(0.035172036970858266),
1095 FRAC_CONST(0.036807222941358832),
1096 FRAC_CONST(0.038442310367846677),
1097 FRAC_CONST(0.040077294872700696),
1098 FRAC_CONST(0.041712172078575326),
1099 FRAC_CONST(0.043346937608412288),
1100 FRAC_CONST(0.044981587085452281),
1101 FRAC_CONST(0.046616116133246711),
1102 FRAC_CONST(0.048250520375669431),
1103 FRAC_CONST(0.049884795436928406),
1104 FRAC_CONST(0.051518936941577477),
1105 FRAC_CONST(0.053152940514528055),
1106 FRAC_CONST(0.05478680178106083),
1107 FRAC_CONST(0.056420516366837495),
1108 FRAC_CONST(0.05805407989791244),
1109 FRAC_CONST(0.059687488000744485),
1110 FRAC_CONST(0.061320736302208578),
1111 FRAC_CONST(0.062953820429607482),
1112 FRAC_CONST(0.064586736010683557),
1113 FRAC_CONST(0.066219478673630344),
1114 FRAC_CONST(0.06785204404710439),
1115 FRAC_CONST(0.069484427760236861),
1116 FRAC_CONST(0.071116625442645326),
1117 FRAC_CONST(0.072748632724445372),
1118 FRAC_CONST(0.07438044523626236),
1119 FRAC_CONST(0.076012058609243122),
1120 FRAC_CONST(0.077643468475067631),
1121 FRAC_CONST(0.079274670465960706),
1122 FRAC_CONST(0.080905660214703745),
1123 FRAC_CONST(0.082536433354646319),
1124 FRAC_CONST(0.084166985519717977),
1125 FRAC_CONST(0.085797312344439894),
1126 FRAC_CONST(0.08742740946393647),
1127 FRAC_CONST(0.089057272513947183),
1128 FRAC_CONST(0.090686897130838162),
1129 FRAC_CONST(0.092316278951613845),
1130 FRAC_CONST(0.093945413613928788),
1131 FRAC_CONST(0.095574296756099186),
1132 FRAC_CONST(0.097202924017114667),
1133 FRAC_CONST(0.098831291036649963),
1134 FRAC_CONST(0.10045939345507648),
1135 FRAC_CONST(0.10208722691347409),
1136 FRAC_CONST(0.10371478705364276),
1137 FRAC_CONST(0.10534206951811415),
1138 FRAC_CONST(0.10696906995016341),
1139 FRAC_CONST(0.10859578399382072),
1140 FRAC_CONST(0.11022220729388306),
1141 FRAC_CONST(0.11184833549592579),
1142 FRAC_CONST(0.11347416424631435),
1143 FRAC_CONST(0.11509968919221586),
1144 FRAC_CONST(0.11672490598161089),
1145 FRAC_CONST(0.11834981026330495),
1146 FRAC_CONST(0.11997439768694031),
1147 FRAC_CONST(0.12159866390300751),
1148 FRAC_CONST(0.12322260456285709),
1149 FRAC_CONST(0.12484621531871121),
1150 FRAC_CONST(0.12646949182367517),
1151 FRAC_CONST(0.12809242973174936),
1152 FRAC_CONST(0.12971502469784052),
1153 FRAC_CONST(0.13133727237777362),
1154 FRAC_CONST(0.13295916842830346),
1155 FRAC_CONST(0.13458070850712617),
1156 FRAC_CONST(0.13620188827289101),
1157 FRAC_CONST(0.1378227033852118),
1158 FRAC_CONST(0.13944314950467873),
1159 FRAC_CONST(0.14106322229286994),
1160 FRAC_CONST(0.14268291741236291),
1161 FRAC_CONST(0.14430223052674654),
1162 FRAC_CONST(0.1459211573006321),
1163 FRAC_CONST(0.14753969339966552),
1164 FRAC_CONST(0.14915783449053857),
1165 FRAC_CONST(0.15077557624100058),
1166 FRAC_CONST(0.15239291431987001),
1167 FRAC_CONST(0.1540098443970461),
1168 FRAC_CONST(0.15562636214352044),
1169 FRAC_CONST(0.15724246323138855),
1170 FRAC_CONST(0.15885814333386142),
1171 FRAC_CONST(0.16047339812527725),
1172 FRAC_CONST(0.16208822328111283),
1173 FRAC_CONST(0.16370261447799525),
1174 FRAC_CONST(0.16531656739371339),
1175 FRAC_CONST(0.16693007770722967),
1176 FRAC_CONST(0.16854314109869134),
1177 FRAC_CONST(0.17015575324944232),
1178 FRAC_CONST(0.17176790984203447),
1179 FRAC_CONST(0.17337960656023954),
1180 FRAC_CONST(0.1749908390890603),
1181 FRAC_CONST(0.17660160311474243),
1182 FRAC_CONST(0.17821189432478593),
1183 FRAC_CONST(0.17982170840795647),
1184 FRAC_CONST(0.18143104105429744),
1185 FRAC_CONST(0.18303988795514095),
1186 FRAC_CONST(0.1846482448031197),
1187 FRAC_CONST(0.18625610729217834),
1188 FRAC_CONST(0.1878634711175852),
1189 FRAC_CONST(0.18947033197594348),
1190 FRAC_CONST(0.19107668556520319),
1191 FRAC_CONST(0.19268252758467228),
1192 FRAC_CONST(0.19428785373502844),
1193 FRAC_CONST(0.19589265971833042),
1194 FRAC_CONST(0.19749694123802966),
1195 FRAC_CONST(0.19910069399898173),
1196 FRAC_CONST(0.20070391370745785),
1197 FRAC_CONST(0.20230659607115639),
1198 FRAC_CONST(0.20390873679921437),
1199 FRAC_CONST(0.20551033160221882),
1200 FRAC_CONST(0.20711137619221856),
1201 FRAC_CONST(0.2087118662827353),
1202 FRAC_CONST(0.21031179758877552),
1203 FRAC_CONST(0.21191116582684155),
1204 FRAC_CONST(0.21350996671494335),
1205 FRAC_CONST(0.21510819597260972),
1206 FRAC_CONST(0.21670584932089998),
1207 FRAC_CONST(0.2183029224824154),
1208 FRAC_CONST(0.21989941118131037),
1209 FRAC_CONST(0.22149531114330431),
1210 FRAC_CONST(0.22309061809569264),
1211 FRAC_CONST(0.22468532776735861),
1212 FRAC_CONST(0.22627943588878449),
1213 FRAC_CONST(0.22787293819206314),
1214 FRAC_CONST(0.22946583041090929),
1215 FRAC_CONST(0.23105810828067114),
1216 FRAC_CONST(0.23264976753834157),
1217 FRAC_CONST(0.23424080392256985),
1218 FRAC_CONST(0.2358312131736727),
1219 FRAC_CONST(0.23742099103364595),
1220 FRAC_CONST(0.23901013324617584),
1221 FRAC_CONST(0.24059863555665045),
1222 FRAC_CONST(0.24218649371217096),
1223 FRAC_CONST(0.24377370346156332),
1224 FRAC_CONST(0.24536026055538934),
1225 FRAC_CONST(0.24694616074595824),
1226 FRAC_CONST(0.24853139978733788),
1227 FRAC_CONST(0.25011597343536629),
1228 FRAC_CONST(0.25169987744766298),
1229 FRAC_CONST(0.25328310758364025),
1230 FRAC_CONST(0.25486565960451457),
1231 FRAC_CONST(0.25644752927331788),
1232 FRAC_CONST(0.25802871235490898),
1233 FRAC_CONST(0.25960920461598508),
1234 FRAC_CONST(0.26118900182509258),
1235 FRAC_CONST(0.26276809975263904),
1236 FRAC_CONST(0.264346494170904),
1237 FRAC_CONST(0.26592418085405067),
1238 FRAC_CONST(0.26750115557813692),
1239 FRAC_CONST(0.2690774141211269),
1240 FRAC_CONST(0.27065295226290209),
1241 FRAC_CONST(0.2722277657852728),
1242 FRAC_CONST(0.27380185047198918),
1243 FRAC_CONST(0.27537520210875299),
1244 FRAC_CONST(0.2769478164832283),
1245 FRAC_CONST(0.27851968938505312),
1246 FRAC_CONST(0.28009081660585067),
1247 FRAC_CONST(0.28166119393924061),
1248 FRAC_CONST(0.28323081718085019),
1249 FRAC_CONST(0.28479968212832563),
1250 FRAC_CONST(0.28636778458134327),
1251 FRAC_CONST(0.28793512034162105),
1252 FRAC_CONST(0.2895016852129294),
1253 FRAC_CONST(0.29106747500110264),
1254 FRAC_CONST(0.29263248551405047),
1255 FRAC_CONST(0.2941967125617686),
1256 FRAC_CONST(0.29576015195635058),
1257 FRAC_CONST(0.29732279951199847),
1258 FRAC_CONST(0.29888465104503475),
1259 FRAC_CONST(0.30044570237391266),
1260 FRAC_CONST(0.30200594931922808),
1261 FRAC_CONST(0.30356538770373032),
1262 FRAC_CONST(0.30512401335233358),
1263 FRAC_CONST(0.30668182209212791),
1264 FRAC_CONST(0.3082388097523906),
1265 FRAC_CONST(0.30979497216459695),
1266 FRAC_CONST(0.31135030516243201),
1267 FRAC_CONST(0.3129048045818012),
1268 FRAC_CONST(0.31445846626084178),
1269 FRAC_CONST(0.31601128603993378),
1270 FRAC_CONST(0.31756325976171151),
1271 FRAC_CONST(0.31911438327107416),
1272 FRAC_CONST(0.32066465241519732),
1273 FRAC_CONST(0.32221406304354389),
1274 FRAC_CONST(0.3237626110078754),
1275 FRAC_CONST(0.32531029216226293),
1276 FRAC_CONST(0.32685710236309828),
1277 FRAC_CONST(0.32840303746910487),
1278 FRAC_CONST(0.32994809334134939),
1279 FRAC_CONST(0.3314922658432522),
1280 FRAC_CONST(0.33303555084059877),
1281 FRAC_CONST(0.33457794420155085),
1282 FRAC_CONST(0.33611944179665709),
1283 FRAC_CONST(0.33766003949886464),
1284 FRAC_CONST(0.33919973318352969),
1285 FRAC_CONST(0.34073851872842903),
1286 FRAC_CONST(0.34227639201377064),
1287 FRAC_CONST(0.34381334892220483),
1288 FRAC_CONST(0.34534938533883547),
1289 FRAC_CONST(0.34688449715123082),
1290 FRAC_CONST(0.34841868024943456),
1291 FRAC_CONST(0.34995193052597684),
1292 FRAC_CONST(0.35148424387588523),
1293 FRAC_CONST(0.3530156161966958),
1294 FRAC_CONST(0.35454604338846402),
1295 FRAC_CONST(0.35607552135377557),
1296 FRAC_CONST(0.35760404599775775),
1297 FRAC_CONST(0.35913161322809023),
1298 FRAC_CONST(0.36065821895501554),
1299 FRAC_CONST(0.36218385909135092),
1300 FRAC_CONST(0.36370852955249849),
1301 FRAC_CONST(0.36523222625645668),
1302 FRAC_CONST(0.36675494512383078),
1303 FRAC_CONST(0.36827668207784414),
1304 FRAC_CONST(0.36979743304434909),
1305 FRAC_CONST(0.37131719395183754),
1306 FRAC_CONST(0.37283596073145214),
1307 FRAC_CONST(0.37435372931699717),
1308 FRAC_CONST(0.37587049564494951),
1309 FRAC_CONST(0.37738625565446909),
1310 FRAC_CONST(0.37890100528741022),
1311 FRAC_CONST(0.38041474048833229),
1312 FRAC_CONST(0.38192745720451066),
1313 FRAC_CONST(0.38343915138594736),
1314 FRAC_CONST(0.38494981898538222),
1315 FRAC_CONST(0.38645945595830333),
1316 FRAC_CONST(0.38796805826295838),
1317 FRAC_CONST(0.38947562186036483),
1318 FRAC_CONST(0.39098214271432141),
1319 FRAC_CONST(0.39248761679141814),
1320 FRAC_CONST(0.3939920400610481),
1321 FRAC_CONST(0.39549540849541737),
1322 FRAC_CONST(0.39699771806955625),
1323 FRAC_CONST(0.39849896476132979),
1324 FRAC_CONST(0.39999914455144892),
1325 FRAC_CONST(0.40149825342348083),
1326 FRAC_CONST(0.4029962873638599),
1327 FRAC_CONST(0.40449324236189854),
1328 FRAC_CONST(0.40598911440979762),
1329 FRAC_CONST(0.40748389950265762),
1330 FRAC_CONST(0.40897759363848879),
1331 FRAC_CONST(0.41047019281822261),
1332 FRAC_CONST(0.41196169304572178),
1333 FRAC_CONST(0.4134520903277914),
1334 FRAC_CONST(0.41494138067418929),
1335 FRAC_CONST(0.41642956009763715),
1336 FRAC_CONST(0.41791662461383078),
1337 FRAC_CONST(0.41940257024145089),
1338 FRAC_CONST(0.42088739300217382),
1339 FRAC_CONST(0.42237108892068231),
1340 FRAC_CONST(0.42385365402467584),
1341 FRAC_CONST(0.42533508434488143),
1342 FRAC_CONST(0.42681537591506419),
1343 FRAC_CONST(0.42829452477203828),
1344 FRAC_CONST(0.42977252695567697),
1345 FRAC_CONST(0.43124937850892364),
1346 FRAC_CONST(0.4327250754778022),
1347 FRAC_CONST(0.43419961391142781),
1348 FRAC_CONST(0.43567298986201736),
1349 FRAC_CONST(0.43714519938489987),
1350 FRAC_CONST(0.43861623853852766),
1351 FRAC_CONST(0.44008610338448595),
1352 FRAC_CONST(0.44155478998750436),
1353 FRAC_CONST(0.44302229441546676),
1354 FRAC_CONST(0.4444886127394222),
1355 FRAC_CONST(0.44595374103359531),
1356 FRAC_CONST(0.44741767537539667),
1357 FRAC_CONST(0.44888041184543348),
1358 FRAC_CONST(0.45034194652752002),
1359 FRAC_CONST(0.45180227550868812),
1360 FRAC_CONST(0.45326139487919759),
1361 FRAC_CONST(0.45471930073254679),
1362 FRAC_CONST(0.45617598916548296),
1363 FRAC_CONST(0.45763145627801283),
1364 FRAC_CONST(0.45908569817341294),
1365 FRAC_CONST(0.46053871095824001),
1366 FRAC_CONST(0.46199049074234161),
1367 FRAC_CONST(0.46344103363886635),
1368 FRAC_CONST(0.46489033576427435),
1369 FRAC_CONST(0.46633839323834758),
1370 FRAC_CONST(0.46778520218420055),
1371 FRAC_CONST(0.46923075872829029),
1372 FRAC_CONST(0.47067505900042683),
1373 FRAC_CONST(0.47211809913378361),
1374 FRAC_CONST(0.47355987526490806),
1375 FRAC_CONST(0.47500038353373153),
1376 FRAC_CONST(0.47643962008357982),
1377 FRAC_CONST(0.47787758106118372),
1378 FRAC_CONST(0.47931426261668875),
1379 FRAC_CONST(0.48074966090366611),
1380 FRAC_CONST(0.48218377207912272),
1381 FRAC_CONST(0.48361659230351117),
1382 FRAC_CONST(0.48504811774074069),
1383 FRAC_CONST(0.48647834455818684),
1384 FRAC_CONST(0.48790726892670194),
1385 FRAC_CONST(0.48933488702062544),
1386 FRAC_CONST(0.49076119501779414),
1387 FRAC_CONST(0.49218618909955225),
1388 FRAC_CONST(0.4936098654507618),
1389 FRAC_CONST(0.49503222025981269),
1390 FRAC_CONST(0.49645324971863303),
1391 FRAC_CONST(0.49787295002269943),
1392 FRAC_CONST(0.49929131737104687),
1393 FRAC_CONST(0.50070834796627917),
1394 FRAC_CONST(0.50212403801457872),
1395 FRAC_CONST(0.50353838372571758),
1396 FRAC_CONST(0.50495138131306638),
1397 FRAC_CONST(0.50636302699360547),
1398 FRAC_CONST(0.50777331698793449),
1399 FRAC_CONST(0.50918224752028263),
1400 FRAC_CONST(0.51058981481851906),
1401 FRAC_CONST(0.51199601511416237),
1402 FRAC_CONST(0.51340084464239111),
1403 FRAC_CONST(0.51480429964205421),
1404 FRAC_CONST(0.51620637635567967),
1405 FRAC_CONST(0.51760707102948678),
1406 FRAC_CONST(0.51900637991339404),
1407 FRAC_CONST(0.5204042992610306),
1408 FRAC_CONST(0.52180082532974559),
1409 FRAC_CONST(0.5231959543806185),
1410 FRAC_CONST(0.52458968267846895),
1411 FRAC_CONST(0.52598200649186677),
1412 FRAC_CONST(0.52737292209314235),
1413 FRAC_CONST(0.52876242575839572),
1414 FRAC_CONST(0.53015051376750777),
1415 FRAC_CONST(0.53153718240414882),
1416 FRAC_CONST(0.53292242795578992),
1417 FRAC_CONST(0.53430624671371152),
1418 FRAC_CONST(0.53568863497301467),
1419 FRAC_CONST(0.5370695890326298),
1420 FRAC_CONST(0.5384491051953274),
1421 FRAC_CONST(0.53982717976772743),
1422 FRAC_CONST(0.54120380906030963),
1423 FRAC_CONST(0.54257898938742311),
1424 FRAC_CONST(0.54395271706729609),
1425 FRAC_CONST(0.54532498842204646),
1426 FRAC_CONST(0.54669579977769045),
1427 FRAC_CONST(0.54806514746415402),
1428 FRAC_CONST(0.54943302781528081),
1429 FRAC_CONST(0.55079943716884383),
1430 FRAC_CONST(0.55216437186655387),
1431 FRAC_CONST(0.55352782825406999),
1432 FRAC_CONST(0.55488980268100907),
1433 FRAC_CONST(0.55625029150095584),
1434 FRAC_CONST(0.55760929107147217),
1435 FRAC_CONST(0.55896679775410718),
1436 FRAC_CONST(0.56032280791440714),
1437 FRAC_CONST(0.56167731792192455),
1438 FRAC_CONST(0.56303032415022869),
1439 FRAC_CONST(0.56438182297691453),
1440 FRAC_CONST(0.56573181078361312),
1441 FRAC_CONST(0.56708028395600085),
1442 FRAC_CONST(0.56842723888380908),
1443 FRAC_CONST(0.56977267196083425),
1444 FRAC_CONST(0.57111657958494688),
1445 FRAC_CONST(0.5724589581581021),
1446 FRAC_CONST(0.57379980408634845),
1447 FRAC_CONST(0.57513911377983773),
1448 FRAC_CONST(0.57647688365283478),
1449 FRAC_CONST(0.57781311012372738),
1450 FRAC_CONST(0.57914778961503466),
1451 FRAC_CONST(0.58048091855341843),
1452 FRAC_CONST(0.5818124933696911),
1453 FRAC_CONST(0.58314251049882604),
1454 FRAC_CONST(0.58447096637996743),
1455 FRAC_CONST(0.58579785745643886),
1456 FRAC_CONST(0.5871231801757536),
1457 FRAC_CONST(0.58844693098962408),
1458 FRAC_CONST(0.58976910635397084),
1459 FRAC_CONST(0.59108970272893235),
1460 FRAC_CONST(0.59240871657887517),
1461 FRAC_CONST(0.59372614437240179),
1462 FRAC_CONST(0.59504198258236196),
1463 FRAC_CONST(0.5963562276858605),
1464 FRAC_CONST(0.59766887616426767),
1465 FRAC_CONST(0.5989799245032289),
1466 FRAC_CONST(0.60028936919267273),
1467 FRAC_CONST(0.60159720672682204),
1468 FRAC_CONST(0.60290343360420195),
1469 FRAC_CONST(0.60420804632765002),
1470 FRAC_CONST(0.60551104140432543),
1471 FRAC_CONST(0.60681241534571839),
1472 FRAC_CONST(0.60811216466765883),
1473 FRAC_CONST(0.60941028589032709),
1474 FRAC_CONST(0.61070677553826169),
1475 FRAC_CONST(0.61200163014036979),
1476 FRAC_CONST(0.61329484622993602),
1477 FRAC_CONST(0.6145864203446314),
1478 FRAC_CONST(0.61587634902652377),
1479 FRAC_CONST(0.61716462882208556),
1480 FRAC_CONST(0.61845125628220421),
1481 FRAC_CONST(0.61973622796219074),
1482 FRAC_CONST(0.6210195404217892),
1483 FRAC_CONST(0.62230119022518593),
1484 FRAC_CONST(0.62358117394101897),
1485 FRAC_CONST(0.62485948814238634),
1486 FRAC_CONST(0.62613612940685637),
1487 FRAC_CONST(0.62741109431647646),
1488 FRAC_CONST(0.62868437945778133),
1489 FRAC_CONST(0.62995598142180387),
1490 FRAC_CONST(0.6312258968040827),
1491 FRAC_CONST(0.63249412220467238),
1492 FRAC_CONST(0.63376065422815175),
1493 FRAC_CONST(0.63502548948363347),
1494 FRAC_CONST(0.63628862458477287),
1495 FRAC_CONST(0.63755005614977711),
1496 FRAC_CONST(0.63880978080141437),
1497 FRAC_CONST(0.6400677951670225),
1498 FRAC_CONST(0.6413240958785188),
1499 FRAC_CONST(0.64257867957240766),
1500 FRAC_CONST(0.6438315428897915),
1501 FRAC_CONST(0.64508268247637779),
1502 FRAC_CONST(0.64633209498248945),
1503 FRAC_CONST(0.64757977706307335),
1504 FRAC_CONST(0.64882572537770888),
1505 FRAC_CONST(0.65006993659061751),
1506 FRAC_CONST(0.65131240737067142),
1507 FRAC_CONST(0.65255313439140239),
1508 FRAC_CONST(0.65379211433101081),
1509 FRAC_CONST(0.65502934387237444),
1510 FRAC_CONST(0.6562648197030575),
1511 FRAC_CONST(0.65749853851531959),
1512 FRAC_CONST(0.65873049700612374),
1513 FRAC_CONST(0.65996069187714679),
1514 FRAC_CONST(0.66118911983478657),
1515 FRAC_CONST(0.66241577759017178),
1516 FRAC_CONST(0.66364066185917048),
1517 FRAC_CONST(0.66486376936239888),
1518 FRAC_CONST(0.66608509682523009),
1519 FRAC_CONST(0.66730464097780284),
1520 FRAC_CONST(0.66852239855503071),
1521 FRAC_CONST(0.66973836629660977),
1522 FRAC_CONST(0.67095254094702894),
1523 FRAC_CONST(0.67216491925557675),
1524 FRAC_CONST(0.67337549797635199),
1525 FRAC_CONST(0.67458427386827102),
1526 FRAC_CONST(0.67579124369507693),
1527 FRAC_CONST(0.67699640422534846),
1528 FRAC_CONST(0.67819975223250772),
1529 FRAC_CONST(0.6794012844948305),
1530 FRAC_CONST(0.68060099779545302),
1531 FRAC_CONST(0.68179888892238183),
1532 FRAC_CONST(0.6829949546685018),
1533 FRAC_CONST(0.68418919183158522),
1534 FRAC_CONST(0.68538159721429948),
1535 FRAC_CONST(0.6865721676242168),
1536 FRAC_CONST(0.68776089987382172),
1537 FRAC_CONST(0.68894779078052026),
1538 FRAC_CONST(0.69013283716664853),
1539 FRAC_CONST(0.69131603585948032),
1540 FRAC_CONST(0.69249738369123692),
1541 FRAC_CONST(0.69367687749909468),
1542 FRAC_CONST(0.69485451412519361),
1543 FRAC_CONST(0.69603029041664599),
1544 FRAC_CONST(0.6972042032255451),
1545 FRAC_CONST(0.6983762494089728),
1546 FRAC_CONST(0.69954642582900894),
1547 FRAC_CONST(0.70071472935273893),
1548 FRAC_CONST(0.70188115685226271),
1549 FRAC_CONST(0.703045705204703),
1550 FRAC_CONST(0.70420837129221303),
1551 FRAC_CONST(0.70536915200198613),
1552 FRAC_CONST(0.70652804422626281),
1553 FRAC_CONST(0.70768504486233985),
1554 FRAC_CONST(0.70884015081257845),
1555 FRAC_CONST(0.70999335898441229),
1556 FRAC_CONST(0.711144666290356),
1557 FRAC_CONST(0.71229406964801356),
1558 FRAC_CONST(0.71344156598008623),
1559 FRAC_CONST(0.71458715221438096),
1560 FRAC_CONST(0.71573082528381871),
1561 FRAC_CONST(0.71687258212644234),
1562 FRAC_CONST(0.7180124196854254),
1563 FRAC_CONST(0.71915033490907943),
1564 FRAC_CONST(0.72028632475086318),
1565 FRAC_CONST(0.72142038616938997),
1566 FRAC_CONST(0.72255251612843596),
1567 FRAC_CONST(0.72368271159694852),
1568 FRAC_CONST(0.72481096954905444),
1569 FRAC_CONST(0.72593728696406756),
1570 FRAC_CONST(0.72706166082649704),
1571 FRAC_CONST(0.72818408812605595),
1572 FRAC_CONST(0.72930456585766834),
1573 FRAC_CONST(0.73042309102147851),
1574 FRAC_CONST(0.73153966062285747),
1575 FRAC_CONST(0.73265427167241282),
1576 FRAC_CONST(0.73376692118599507),
1577 FRAC_CONST(0.73487760618470677),
1578 FRAC_CONST(0.73598632369490979),
1579 FRAC_CONST(0.73709307074823405),
1580 FRAC_CONST(0.73819784438158409),
1581 FRAC_CONST(0.73930064163714881),
1582 FRAC_CONST(0.74040145956240788),
1583 FRAC_CONST(0.74150029521014049),
1584 FRAC_CONST(0.74259714563843304),
1585 FRAC_CONST(0.74369200791068657),
1586 FRAC_CONST(0.74478487909562552),
1587 FRAC_CONST(0.74587575626730485),
1588 FRAC_CONST(0.74696463650511791),
1589 FRAC_CONST(0.74805151689380456),
1590 FRAC_CONST(0.74913639452345926),
1591 FRAC_CONST(0.75021926648953785),
1592 FRAC_CONST(0.75130012989286621),
1593 FRAC_CONST(0.7523789818396478),
1594 FRAC_CONST(0.75345581944147111),
1595 FRAC_CONST(0.75453063981531809),
1596 FRAC_CONST(0.75560344008357094),
1597 FRAC_CONST(0.75667421737402052),
1598 FRAC_CONST(0.7577429688198738),
1599 FRAC_CONST(0.75880969155976163),
1600 FRAC_CONST(0.75987438273774599),
1601 FRAC_CONST(0.76093703950332836),
1602 FRAC_CONST(0.76199765901145666),
1603 FRAC_CONST(0.76305623842253345),
1604 FRAC_CONST(0.76411277490242291),
1605 FRAC_CONST(0.76516726562245885),
1606 FRAC_CONST(0.76621970775945258),
1607 FRAC_CONST(0.76727009849569949),
1608 FRAC_CONST(0.76831843501898767),
1609 FRAC_CONST(0.76936471452260458),
1610 FRAC_CONST(0.77040893420534517),
1611 FRAC_CONST(0.77145109127151923),
1612 FRAC_CONST(0.77249118293095853),
1613 FRAC_CONST(0.77352920639902467),
1614 FRAC_CONST(0.77456515889661659),
1615 FRAC_CONST(0.77559903765017746),
1616 FRAC_CONST(0.7766308398917029),
1617 FRAC_CONST(0.77766056285874774),
1618 FRAC_CONST(0.77868820379443371),
1619 FRAC_CONST(0.77971375994745684),
1620 FRAC_CONST(0.78073722857209438),
1621 FRAC_CONST(0.7817586069282132),
1622 FRAC_CONST(0.78277789228127592),
1623 FRAC_CONST(0.78379508190234881),
1624 FRAC_CONST(0.78481017306810918),
1625 FRAC_CONST(0.78582316306085265),
1626 FRAC_CONST(0.78683404916849986),
1627 FRAC_CONST(0.78784282868460476),
1628 FRAC_CONST(0.78884949890836087),
1629 FRAC_CONST(0.78985405714460888),
1630 FRAC_CONST(0.7908565007038445),
1631 FRAC_CONST(0.79185682690222425),
1632 FRAC_CONST(0.79285503306157412),
1633 FRAC_CONST(0.79385111650939566),
1634 FRAC_CONST(0.79484507457887377),
1635 FRAC_CONST(0.79583690460888357),
1636 FRAC_CONST(0.79682660394399751),
1637 FRAC_CONST(0.79781416993449272),
1638 FRAC_CONST(0.79879959993635785),
1639 FRAC_CONST(0.7997828913113002),
1640 FRAC_CONST(0.80076404142675273),
1641 FRAC_CONST(0.80174304765588156),
1642 FRAC_CONST(0.80271990737759213),
1643 FRAC_CONST(0.80369461797653707),
1644 FRAC_CONST(0.80466717684312306),
1645 FRAC_CONST(0.80563758137351682),
1646 FRAC_CONST(0.80660582896965372),
1647 FRAC_CONST(0.80757191703924336),
1648 FRAC_CONST(0.80853584299577752),
1649 FRAC_CONST(0.80949760425853612),
1650 FRAC_CONST(0.81045719825259477),
1651 FRAC_CONST(0.81141462240883167),
1652 FRAC_CONST(0.81236987416393436),
1653 FRAC_CONST(0.81332295096040608),
1654 FRAC_CONST(0.81427385024657373),
1655 FRAC_CONST(0.81522256947659355),
1656 FRAC_CONST(0.81616910611045879),
1657 FRAC_CONST(0.817113457614006),
1658 FRAC_CONST(0.81805562145892186),
1659 FRAC_CONST(0.81899559512275044),
1660 FRAC_CONST(0.81993337608889916),
1661 FRAC_CONST(0.82086896184664637),
1662 FRAC_CONST(0.8218023498911472),
1663 FRAC_CONST(0.82273353772344116),
1664 FRAC_CONST(0.82366252285045805),
1665 FRAC_CONST(0.82458930278502529),
1666 FRAC_CONST(0.82551387504587381),
1667 FRAC_CONST(0.82643623715764558),
1668 FRAC_CONST(0.82735638665089983),
1669 FRAC_CONST(0.82827432106211907),
1670 FRAC_CONST(0.82919003793371693),
1671 FRAC_CONST(0.83010353481404364),
1672 FRAC_CONST(0.83101480925739324),
1673 FRAC_CONST(0.83192385882400965),
1674 FRAC_CONST(0.83283068108009373),
1675 FRAC_CONST(0.8337352735978093),
1676 FRAC_CONST(0.83463763395529011),
1677 FRAC_CONST(0.83553775973664579),
1678 FRAC_CONST(0.83643564853196872),
1679 FRAC_CONST(0.83733129793734051),
1680 FRAC_CONST(0.83822470555483797),
1681 FRAC_CONST(0.83911586899254031),
1682 FRAC_CONST(0.84000478586453453),
1683 FRAC_CONST(0.84089145379092289),
1684 FRAC_CONST(0.84177587039782842),
1685 FRAC_CONST(0.84265803331740163),
1686 FRAC_CONST(0.84353794018782702),
1687 FRAC_CONST(0.844415588653329),
1688 FRAC_CONST(0.8452909763641786),
1689 FRAC_CONST(0.84616410097669936),
1690 FRAC_CONST(0.84703496015327406),
1691 FRAC_CONST(0.84790355156235053),
1692 FRAC_CONST(0.84876987287844818),
1693 FRAC_CONST(0.8496339217821639),
1694 FRAC_CONST(0.85049569596017938),
1695 FRAC_CONST(0.85135519310526508),
1696 FRAC_CONST(0.85221241091628896),
1697 FRAC_CONST(0.85306734709822085),
1698 FRAC_CONST(0.85391999936213903),
1699 FRAC_CONST(0.85477036542523732),
1700 FRAC_CONST(0.85561844301082923),
1701 FRAC_CONST(0.85646422984835635),
1702 FRAC_CONST(0.85730772367339259),
1703 FRAC_CONST(0.85814892222765116),
1704 FRAC_CONST(0.85898782325899026),
1705 FRAC_CONST(0.85982442452141961),
1706 FRAC_CONST(0.86065872377510555),
1707 FRAC_CONST(0.86149071878637817),
1708 FRAC_CONST(0.8623204073277364),
1709 FRAC_CONST(0.86314778717785412),
1710 FRAC_CONST(0.8639728561215867),
1711 FRAC_CONST(0.86479561194997623),
1712 FRAC_CONST(0.86561605246025763),
1713 FRAC_CONST(0.86643417545586487),
1714 FRAC_CONST(0.8672499787464365),
1715 FRAC_CONST(0.86806346014782154),
1716 FRAC_CONST(0.8688746174820855),
1717 FRAC_CONST(0.86968344857751589),
1718 FRAC_CONST(0.87048995126862883),
1719 FRAC_CONST(0.87129412339617363),
1720 FRAC_CONST(0.87209596280713941),
1721 FRAC_CONST(0.8728954673547612),
1722 FRAC_CONST(0.87369263489852422),
1723 FRAC_CONST(0.87448746330417149),
1724 FRAC_CONST(0.87527995044370765),
1725 FRAC_CONST(0.8760700941954066),
1726 FRAC_CONST(0.87685789244381551),
1727 FRAC_CONST(0.87764334307976144),
1728 FRAC_CONST(0.87842644400035663),
1729 FRAC_CONST(0.8792071931090043),
1730 FRAC_CONST(0.87998558831540408),
1731 FRAC_CONST(0.88076162753555787),
1732 FRAC_CONST(0.88153530869177488),
1733 FRAC_CONST(0.88230662971267804),
1734 FRAC_CONST(0.88307558853320878),
1735 FRAC_CONST(0.88384218309463292),
1736 FRAC_CONST(0.8846064113445461),
1737 FRAC_CONST(0.88536827123687933),
1738 FRAC_CONST(0.88612776073190425),
1739 FRAC_CONST(0.88688487779623937),
1740 FRAC_CONST(0.88763962040285393),
1741 FRAC_CONST(0.8883919865310751),
1742 FRAC_CONST(0.88914197416659235),
1743 FRAC_CONST(0.88988958130146301),
1744 FRAC_CONST(0.8906348059341177),
1745 FRAC_CONST(0.89137764606936609),
1746 FRAC_CONST(0.89211809971840139),
1747 FRAC_CONST(0.89285616489880615),
1748 FRAC_CONST(0.89359183963455813),
1749 FRAC_CONST(0.89432512195603453),
1750 FRAC_CONST(0.89505600990001799),
1751 FRAC_CONST(0.89578450150970124),
1752 FRAC_CONST(0.8965105948346932),
1753 FRAC_CONST(0.89723428793102367),
1754 FRAC_CONST(0.89795557886114807),
1755 FRAC_CONST(0.89867446569395382),
1756 FRAC_CONST(0.89939094650476448),
1757 FRAC_CONST(0.90010501937534515),
1758 FRAC_CONST(0.900816682393908),
1759 FRAC_CONST(0.90152593365511691),
1760 FRAC_CONST(0.90223277126009283),
1761 FRAC_CONST(0.90293719331641886),
1762 FRAC_CONST(0.90363919793814496),
1763 FRAC_CONST(0.90433878324579353),
1764 FRAC_CONST(0.90503594736636439),
1765 FRAC_CONST(0.90573068843333915),
1766 FRAC_CONST(0.90642300458668679),
1767 FRAC_CONST(0.90711289397286898),
1768 FRAC_CONST(0.90780035474484411),
1769 FRAC_CONST(0.90848538506207266),
1770 FRAC_CONST(0.90916798309052227),
1771 FRAC_CONST(0.90984814700267291),
1772 FRAC_CONST(0.9105258749775208),
1773 FRAC_CONST(0.91120116520058425),
1774 FRAC_CONST(0.91187401586390815),
1775 FRAC_CONST(0.91254442516606893),
1776 FRAC_CONST(0.9132123913121788),
1777 FRAC_CONST(0.91387791251389161),
1778 FRAC_CONST(0.91454098698940678),
1779 FRAC_CONST(0.91520161296347435),
1780 FRAC_CONST(0.91585978866739981),
1781 FRAC_CONST(0.91651551233904871),
1782 FRAC_CONST(0.91716878222285148),
1783 FRAC_CONST(0.91781959656980805),
1784 FRAC_CONST(0.91846795363749245),
1785 FRAC_CONST(0.91911385169005766),
1786 FRAC_CONST(0.9197572889982405),
1787 FRAC_CONST(0.9203982638393654),
1788 FRAC_CONST(0.92103677449734989),
1789 FRAC_CONST(0.92167281926270861),
1790 FRAC_CONST(0.92230639643255874),
1791 FRAC_CONST(0.92293750431062316),
1792 FRAC_CONST(0.92356614120723612),
1793 FRAC_CONST(0.92419230543934783),
1794 FRAC_CONST(0.92481599533052783),
1795 FRAC_CONST(0.92543720921097061),
1796 FRAC_CONST(0.92605594541749991),
1797 FRAC_CONST(0.92667220229357261),
1798 FRAC_CONST(0.92728597818928349),
1799 FRAC_CONST(0.9278972714613698),
1800 FRAC_CONST(0.92850608047321548),
1801 FRAC_CONST(0.9291124035948557),
1802 FRAC_CONST(0.92971623920298097),
1803 FRAC_CONST(0.93031758568094147),
1804 FRAC_CONST(0.93091644141875196),
1805 FRAC_CONST(0.93151280481309506),
1806 FRAC_CONST(0.93210667426732674),
1807 FRAC_CONST(0.93269804819147983),
1808 FRAC_CONST(0.93328692500226818),
1809 FRAC_CONST(0.93387330312309147),
1810 FRAC_CONST(0.93445718098403896),
1811 FRAC_CONST(0.93503855702189376),
1812 FRAC_CONST(0.9356174296801375),
1813 FRAC_CONST(0.93619379740895381),
1814 FRAC_CONST(0.93676765866523259),
1815 FRAC_CONST(0.93733901191257496),
1816 FRAC_CONST(0.93790785562129597),
1817 FRAC_CONST(0.93847418826842988),
1818 FRAC_CONST(0.93903800833773399),
1819 FRAC_CONST(0.93959931431969212),
1820 FRAC_CONST(0.94015810471151917),
1821 FRAC_CONST(0.94071437801716529),
1822 FRAC_CONST(0.94126813274731924),
1823 FRAC_CONST(0.94181936741941319),
1824 FRAC_CONST(0.94236808055762578),
1825 FRAC_CONST(0.94291427069288691),
1826 FRAC_CONST(0.94345793636288133),
1827 FRAC_CONST(0.94399907611205225),
1828 FRAC_CONST(0.9445376884916058),
1829 FRAC_CONST(0.94507377205951448),
1830 FRAC_CONST(0.94560732538052128),
1831 FRAC_CONST(0.94613834702614352),
1832 FRAC_CONST(0.94666683557467624),
1833 FRAC_CONST(0.94719278961119657),
1834 FRAC_CONST(0.94771620772756759),
1835 FRAC_CONST(0.94823708852244104),
1836 FRAC_CONST(0.94875543060126255),
1837 FRAC_CONST(0.94927123257627433),
1838 FRAC_CONST(0.94978449306651924),
1839 FRAC_CONST(0.95029521069784428),
1840 FRAC_CONST(0.9508033841029051),
1841 FRAC_CONST(0.95130901192116835),
1842 FRAC_CONST(0.9518120927989161),
1843 FRAC_CONST(0.95231262538924943),
1844 FRAC_CONST(0.95281060835209208),
1845 FRAC_CONST(0.95330604035419386),
1846 FRAC_CONST(0.95379892006913403),
1847 FRAC_CONST(0.95428924617732525),
1848 FRAC_CONST(0.95477701736601728),
1849 FRAC_CONST(0.95526223232929941),
1850 FRAC_CONST(0.95574488976810545),
1851 FRAC_CONST(0.95622498839021619),
1852 FRAC_CONST(0.95670252691026292),
1853 FRAC_CONST(0.95717750404973156),
1854 FRAC_CONST(0.95764991853696524),
1855 FRAC_CONST(0.95811976910716812),
1856 FRAC_CONST(0.95858705450240911),
1857 FRAC_CONST(0.95905177347162429),
1858 FRAC_CONST(0.95951392477062125),
1859 FRAC_CONST(0.95997350716208196),
1860 FRAC_CONST(0.96043051941556579),
1861 FRAC_CONST(0.96088496030751369),
1862 FRAC_CONST(0.96133682862125036),
1863 FRAC_CONST(0.96178612314698864),
1864 FRAC_CONST(0.96223284268183173),
1865 FRAC_CONST(0.9626769860297768),
1866 FRAC_CONST(0.96311855200171881),
1867 FRAC_CONST(0.96355753941545252),
1868 FRAC_CONST(0.96399394709567654),
1869 FRAC_CONST(0.96442777387399625),
1870 FRAC_CONST(0.96485901858892686),
1871 FRAC_CONST(0.96528768008589627),
1872 FRAC_CONST(0.96571375721724895),
1873 FRAC_CONST(0.96613724884224783),
1874 FRAC_CONST(0.96655815382707866),
1875 FRAC_CONST(0.96697647104485207),
1876 FRAC_CONST(0.96739219937560694),
1877 FRAC_CONST(0.96780533770631338),
1878 FRAC_CONST(0.96821588493087585),
1879 FRAC_CONST(0.9686238399501359),
1880 FRAC_CONST(0.96902920167187501),
1881 FRAC_CONST(0.96943196901081796),
1882 FRAC_CONST(0.96983214088863534),
1883 FRAC_CONST(0.9702297162339466),
1884 FRAC_CONST(0.97062469398232287),
1885 FRAC_CONST(0.97101707307629004),
1886 FRAC_CONST(0.97140685246533098),
1887 FRAC_CONST(0.97179403110588902),
1888 FRAC_CONST(0.97217860796137046),
1889 FRAC_CONST(0.97256058200214734),
1890 FRAC_CONST(0.97293995220556007),
1891 FRAC_CONST(0.97331671755592064),
1892 FRAC_CONST(0.97369087704451474),
1893 FRAC_CONST(0.97406242966960455),
1894 FRAC_CONST(0.97443137443643235),
1895 FRAC_CONST(0.97479771035722163),
1896 FRAC_CONST(0.97516143645118103),
1897 FRAC_CONST(0.97552255174450631),
1898 FRAC_CONST(0.97588105527038305),
1899 FRAC_CONST(0.97623694606898959),
1900 FRAC_CONST(0.97659022318749911),
1901 FRAC_CONST(0.97694088568008242),
1902 FRAC_CONST(0.97728893260791039),
1903 FRAC_CONST(0.97763436303915685),
1904 FRAC_CONST(0.97797717604900047),
1905 FRAC_CONST(0.97831737071962765),
1906 FRAC_CONST(0.97865494614023485),
1907 FRAC_CONST(0.97898990140703124),
1908 FRAC_CONST(0.97932223562324061),
1909 FRAC_CONST(0.97965194789910426),
1910 FRAC_CONST(0.9799790373518833),
1911 FRAC_CONST(0.98030350310586067),
1912 FRAC_CONST(0.98062534429234405),
1913 FRAC_CONST(0.98094456004966768),
1914 FRAC_CONST(0.98126114952319499),
1915 FRAC_CONST(0.98157511186532054),
1916 FRAC_CONST(0.98188644623547261),
1917 FRAC_CONST(0.98219515180011563),
1918 FRAC_CONST(0.98250122773275184),
1919 FRAC_CONST(0.98280467321392362),
1920 FRAC_CONST(0.98310548743121629),
1921 FRAC_CONST(0.98340366957925973),
1922 FRAC_CONST(0.98369921885973044),
1923 FRAC_CONST(0.98399213448135414),
1924 FRAC_CONST(0.98428241565990748),
1925 FRAC_CONST(0.98457006161822058),
1926 FRAC_CONST(0.98485507158617835),
1927 FRAC_CONST(0.98513744480072363),
1928 FRAC_CONST(0.98541718050585803),
1929 FRAC_CONST(0.98569427795264519),
1930 FRAC_CONST(0.98596873639921168),
1931 FRAC_CONST(0.98624055511074971),
1932 FRAC_CONST(0.98650973335951875),
1933 FRAC_CONST(0.98677627042484772),
1934 FRAC_CONST(0.98704016559313645),
1935 FRAC_CONST(0.98730141815785832),
1936 FRAC_CONST(0.98756002741956173),
1937 FRAC_CONST(0.9878159926858715),
1938 FRAC_CONST(0.98806931327149194),
1939 FRAC_CONST(0.98831998849820735),
1940 FRAC_CONST(0.98856801769488489),
1941 FRAC_CONST(0.98881340019747566),
1942 FRAC_CONST(0.98905613534901682),
1943 FRAC_CONST(0.98929622249963345),
1944 FRAC_CONST(0.98953366100653983),
1945 FRAC_CONST(0.98976845023404181),
1946 FRAC_CONST(0.99000058955353776),
1947 FRAC_CONST(0.99023007834352106),
1948 FRAC_CONST(0.99045691598958097),
1949 FRAC_CONST(0.99068110188440506),
1950 FRAC_CONST(0.99090263542778001),
1951 FRAC_CONST(0.99112151602659404),
1952 FRAC_CONST(0.99133774309483769),
1953 FRAC_CONST(0.99155131605360625),
1954 FRAC_CONST(0.99176223433110056),
1955 FRAC_CONST(0.99197049736262888),
1956 FRAC_CONST(0.99217610459060845),
1957 FRAC_CONST(0.99237905546456673),
1958 FRAC_CONST(0.99257934944114334),
1959 FRAC_CONST(0.99277698598409092),
1960 FRAC_CONST(0.99297196456427694),
1961 FRAC_CONST(0.99316428465968509),
1962 FRAC_CONST(0.99335394575541669),
1963 FRAC_CONST(0.99354094734369169),
1964 FRAC_CONST(0.99372528892385081),
1965 FRAC_CONST(0.99390697000235606),
1966 FRAC_CONST(0.99408599009279242),
1967 FRAC_CONST(0.99426234871586938),
1968 FRAC_CONST(0.99443604539942176),
1969 FRAC_CONST(0.99460707967841133),
1970 FRAC_CONST(0.99477545109492771),
1971 FRAC_CONST(0.99494115919819004),
1972 FRAC_CONST(0.99510420354454787),
1973 FRAC_CONST(0.99526458369748239),
1974 FRAC_CONST(0.99542229922760772),
1975 FRAC_CONST(0.99557734971267187),
1976 FRAC_CONST(0.9957297347375581),
1977 FRAC_CONST(0.99587945389428578),
1978 FRAC_CONST(0.99602650678201154),
1979 FRAC_CONST(0.99617089300703077),
1980 FRAC_CONST(0.996312612182778),
1981 FRAC_CONST(0.99645166392982831),
1982 FRAC_CONST(0.99658804787589839),
1983 FRAC_CONST(0.99672176365584741),
1984 FRAC_CONST(0.99685281091167788),
1985 FRAC_CONST(0.99698118929253687),
1986 FRAC_CONST(0.99710689845471678),
1987 FRAC_CONST(0.99722993806165661),
1988 FRAC_CONST(0.99735030778394196),
1989 FRAC_CONST(0.99746800729930707),
1990 FRAC_CONST(0.99758303629263489),
1991 FRAC_CONST(0.99769539445595812),
1992 FRAC_CONST(0.99780508148846014),
1993 FRAC_CONST(0.99791209709647588),
1994 FRAC_CONST(0.99801644099349218),
1995 FRAC_CONST(0.99811811290014918),
1996 FRAC_CONST(0.9982171125442405),
1997 FRAC_CONST(0.9983134396607144),
1998 FRAC_CONST(0.99840709399167404),
1999 FRAC_CONST(0.99849807528637868),
2000 FRAC_CONST(0.99858638330124405),
2001 FRAC_CONST(0.99867201779984294),
2002 FRAC_CONST(0.99875497855290607),
2003 FRAC_CONST(0.99883526533832245),
2004 FRAC_CONST(0.99891287794114036),
2005 FRAC_CONST(0.99898781615356746),
2006 FRAC_CONST(0.99906007977497147),
2007 FRAC_CONST(0.99912966861188113),
2008 FRAC_CONST(0.99919658247798593),
2009 FRAC_CONST(0.99926082119413751),
2010 FRAC_CONST(0.99932238458834954),
2011 FRAC_CONST(0.999381272495798),
2012 FRAC_CONST(0.99943748475882255),
2013 FRAC_CONST(0.9994910212269259),
2014 FRAC_CONST(0.99954188175677483),
2015 FRAC_CONST(0.99959006621220048),
2016 FRAC_CONST(0.99963557446419837),
2017 FRAC_CONST(0.99967840639092931),
2018 FRAC_CONST(0.99971856187771946),
2019 FRAC_CONST(0.99975604081706027),
2020 FRAC_CONST(0.99979084310860955),
2021 FRAC_CONST(0.99982296865919107),
2022 FRAC_CONST(0.99985241738279484),
2023 FRAC_CONST(0.99987918920057806),
2024 FRAC_CONST(0.99990328404086426),
2025 FRAC_CONST(0.9999247018391445),
2026 FRAC_CONST(0.99994344253807688),
2027 FRAC_CONST(0.99995950608748674),
2028 FRAC_CONST(0.99997289244436727),
2029 FRAC_CONST(0.99998360157287902),
2030 FRAC_CONST(0.9999916334443506),
2031 FRAC_CONST(0.99999698803727821),
2032 FRAC_CONST(0.99999966533732598)
2033 };
2034 #endif
2035
2036 ALIGN static const real_t sine_short_128[] =
2037 {
2038 FRAC_CONST(0.0061358846491544753),
2039 FRAC_CONST(0.01840672990580482),
2040 FRAC_CONST(0.030674803176636626),
2041 FRAC_CONST(0.04293825693494082),
2042 FRAC_CONST(0.055195244349689934),
2043 FRAC_CONST(0.067443919563664051),
2044 FRAC_CONST(0.079682437971430126),
2045 FRAC_CONST(0.091908956497132724),
2046 FRAC_CONST(0.10412163387205459),
2047 FRAC_CONST(0.11631863091190475),
2048 FRAC_CONST(0.12849811079379317),
2049 FRAC_CONST(0.14065823933284921),
2050 FRAC_CONST(0.15279718525844344),
2051 FRAC_CONST(0.16491312048996989),
2052 FRAC_CONST(0.17700422041214875),
2053 FRAC_CONST(0.18906866414980619),
2054 FRAC_CONST(0.2011046348420919),
2055 FRAC_CONST(0.21311031991609136),
2056 FRAC_CONST(0.22508391135979283),
2057 FRAC_CONST(0.2370236059943672),
2058 FRAC_CONST(0.24892760574572015),
2059 FRAC_CONST(0.26079411791527551),
2060 FRAC_CONST(0.27262135544994898),
2061 FRAC_CONST(0.28440753721127188),
2062 FRAC_CONST(0.29615088824362379),
2063 FRAC_CONST(0.30784964004153487),
2064 FRAC_CONST(0.31950203081601569),
2065 FRAC_CONST(0.33110630575987643),
2066 FRAC_CONST(0.34266071731199438),
2067 FRAC_CONST(0.35416352542049034),
2068 FRAC_CONST(0.36561299780477385),
2069 FRAC_CONST(0.37700741021641826),
2070 FRAC_CONST(0.38834504669882625),
2071 FRAC_CONST(0.39962419984564679),
2072 FRAC_CONST(0.41084317105790391),
2073 FRAC_CONST(0.42200027079979968),
2074 FRAC_CONST(0.43309381885315196),
2075 FRAC_CONST(0.4441221445704292),
2076 FRAC_CONST(0.45508358712634384),
2077 FRAC_CONST(0.46597649576796618),
2078 FRAC_CONST(0.47679923006332209),
2079 FRAC_CONST(0.487550160148436),
2080 FRAC_CONST(0.49822766697278187),
2081 FRAC_CONST(0.50883014254310699),
2082 FRAC_CONST(0.51935599016558964),
2083 FRAC_CONST(0.52980362468629461),
2084 FRAC_CONST(0.54017147272989285),
2085 FRAC_CONST(0.55045797293660481),
2086 FRAC_CONST(0.56066157619733603),
2087 FRAC_CONST(0.57078074588696726),
2088 FRAC_CONST(0.58081395809576453),
2089 FRAC_CONST(0.59075970185887416),
2090 FRAC_CONST(0.60061647938386897),
2091 FRAC_CONST(0.61038280627630948),
2092 FRAC_CONST(0.6200572117632891),
2093 FRAC_CONST(0.62963823891492698),
2094 FRAC_CONST(0.63912444486377573),
2095 FRAC_CONST(0.64851440102211244),
2096 FRAC_CONST(0.65780669329707864),
2097 FRAC_CONST(0.66699992230363747),
2098 FRAC_CONST(0.67609270357531592),
2099 FRAC_CONST(0.68508366777270036),
2100 FRAC_CONST(0.693971460889654),
2101 FRAC_CONST(0.7027547444572253),
2102 FRAC_CONST(0.71143219574521643),
2103 FRAC_CONST(0.72000250796138165),
2104 FRAC_CONST(0.7284643904482252),
2105 FRAC_CONST(0.73681656887736979),
2106 FRAC_CONST(0.74505778544146595),
2107 FRAC_CONST(0.75318679904361241),
2108 FRAC_CONST(0.76120238548426178),
2109 FRAC_CONST(0.76910333764557959),
2110 FRAC_CONST(0.77688846567323244),
2111 FRAC_CONST(0.78455659715557524),
2112 FRAC_CONST(0.79210657730021239),
2113 FRAC_CONST(0.79953726910790501),
2114 FRAC_CONST(0.80684755354379922),
2115 FRAC_CONST(0.8140363297059483),
2116 FRAC_CONST(0.82110251499110465),
2117 FRAC_CONST(0.8280450452577558),
2118 FRAC_CONST(0.83486287498638001),
2119 FRAC_CONST(0.84155497743689833),
2120 FRAC_CONST(0.84812034480329712),
2121 FRAC_CONST(0.85455798836540053),
2122 FRAC_CONST(0.86086693863776731),
2123 FRAC_CONST(0.86704624551569265),
2124 FRAC_CONST(0.87309497841829009),
2125 FRAC_CONST(0.87901222642863341),
2126 FRAC_CONST(0.88479709843093779),
2127 FRAC_CONST(0.89044872324475788),
2128 FRAC_CONST(0.89596624975618511),
2129 FRAC_CONST(0.90134884704602203),
2130 FRAC_CONST(0.90659570451491533),
2131 FRAC_CONST(0.91170603200542988),
2132 FRAC_CONST(0.9166790599210427),
2133 FRAC_CONST(0.9215140393420419),
2134 FRAC_CONST(0.92621024213831127),
2135 FRAC_CONST(0.93076696107898371),
2136 FRAC_CONST(0.9351835099389475),
2137 FRAC_CONST(0.93945922360218992),
2138 FRAC_CONST(0.94359345816196039),
2139 FRAC_CONST(0.94758559101774109),
2140 FRAC_CONST(0.95143502096900834),
2141 FRAC_CONST(0.95514116830577067),
2142 FRAC_CONST(0.9587034748958716),
2143 FRAC_CONST(0.96212140426904158),
2144 FRAC_CONST(0.9653944416976894),
2145 FRAC_CONST(0.96852209427441727),
2146 FRAC_CONST(0.97150389098625178),
2147 FRAC_CONST(0.97433938278557586),
2148 FRAC_CONST(0.97702814265775439),
2149 FRAC_CONST(0.97956976568544052),
2150 FRAC_CONST(0.98196386910955524),
2151 FRAC_CONST(0.98421009238692903),
2152 FRAC_CONST(0.98630809724459867),
2153 FRAC_CONST(0.98825756773074946),
2154 FRAC_CONST(0.99005821026229712),
2155 FRAC_CONST(0.99170975366909953),
2156 FRAC_CONST(0.9932119492347945),
2157 FRAC_CONST(0.99456457073425542),
2158 FRAC_CONST(0.99576741446765982),
2159 FRAC_CONST(0.99682029929116567),
2160 FRAC_CONST(0.99772306664419164),
2161 FRAC_CONST(0.99847558057329477),
2162 FRAC_CONST(0.99907772775264536),
2163 FRAC_CONST(0.99952941750109314),
2164 FRAC_CONST(0.9998305817958234),
2165 FRAC_CONST(0.99998117528260111)
2166 };
2167
2168 #ifdef ALLOW_SMALL_FRAMELENGTH
2169 ALIGN static const real_t sine_short_120[] =
2170 {
2171 FRAC_CONST(0.0065449379673518581),
2172 FRAC_CONST(0.019633692460628301),
2173 FRAC_CONST(0.032719082821776137),
2174 FRAC_CONST(0.045798866936520771),
2175 FRAC_CONST(0.058870803651189033),
2176 FRAC_CONST(0.071932653156719387),
2177 FRAC_CONST(0.084982177372441667),
2178 FRAC_CONST(0.09801714032956059),
2179 FRAC_CONST(0.11103530855427769),
2180 FRAC_CONST(0.12403445145048532),
2181 FRAC_CONST(0.13701234168196802),
2182 FRAC_CONST(0.14996675555404498),
2183 FRAC_CONST(0.16289547339458874),
2184 FRAC_CONST(0.17579627993435451),
2185 FRAC_CONST(0.18866696468655525),
2186 FRAC_CONST(0.2015053223256171),
2187 FRAC_CONST(0.21430915306505074),
2188 FRAC_CONST(0.2270762630343732),
2189 FRAC_CONST(0.23980446465501654),
2190 FRAC_CONST(0.25249157701515795),
2191 FRAC_CONST(0.26513542624340797),
2192 FRAC_CONST(0.27773384588129219),
2193 FRAC_CONST(0.29028467725446233),
2194 FRAC_CONST(0.3027857698425746),
2195 FRAC_CONST(0.31523498164776964),
2196 FRAC_CONST(0.32763017956169349),
2197 FRAC_CONST(0.33996923973099424),
2198 FRAC_CONST(0.35225004792123354),
2199 FRAC_CONST(0.36447049987914965),
2200 FRAC_CONST(0.37662850169321077),
2201 FRAC_CONST(0.38872197015239557),
2202 FRAC_CONST(0.40074883310314097),
2203 FRAC_CONST(0.41270702980439467),
2204 FRAC_CONST(0.42459451128071307),
2205 FRAC_CONST(0.43640924067334208),
2206 FRAC_CONST(0.44814919358922256),
2207 FRAC_CONST(0.45981235844785984),
2208 FRAC_CONST(0.47139673682599764),
2209 FRAC_CONST(0.48290034380003727),
2210 FRAC_CONST(0.49432120828614462),
2211 FRAC_CONST(0.50565737337798455),
2212 FRAC_CONST(0.51690689668202761),
2213 FRAC_CONST(0.52806785065036799),
2214 FRAC_CONST(0.53913832291100017),
2215 FRAC_CONST(0.55011641659549337),
2216 FRAC_CONST(0.56100025066400983),
2217 FRAC_CONST(0.57178796022761225),
2218 FRAC_CONST(0.58247769686780215),
2219 FRAC_CONST(0.59306762895323706),
2220 FRAC_CONST(0.60355594195357143),
2221 FRAC_CONST(0.61394083875036642),
2222 FRAC_CONST(0.62422053994501758),
2223 FRAC_CONST(0.63439328416364549),
2224 FRAC_CONST(0.64445732835889735),
2225 FRAC_CONST(0.65441094810861034),
2226 FRAC_CONST(0.66425243791128175),
2227 FRAC_CONST(0.67398011147829784),
2228 FRAC_CONST(0.68359230202287125),
2229 FRAC_CONST(0.69308736254563585),
2230 FRAC_CONST(0.70246366611685174),
2231 FRAC_CONST(0.71171960615517138),
2232 FRAC_CONST(0.72085359670291882),
2233 FRAC_CONST(0.7298640726978356),
2234 FRAC_CONST(0.73874949024124625),
2235 FRAC_CONST(0.74750832686259672),
2236 FRAC_CONST(0.75613908178032285),
2237 FRAC_CONST(0.76464027615900032),
2238 FRAC_CONST(0.77301045336273699),
2239 FRAC_CONST(0.78124817920475853),
2240 FRAC_CONST(0.78935204219315003),
2241 FRAC_CONST(0.79732065377270711),
2242 FRAC_CONST(0.80515264856285829),
2243 FRAC_CONST(0.81284668459161513),
2244 FRAC_CONST(0.82040144352551359),
2245 FRAC_CONST(0.82781563089550203),
2246 FRAC_CONST(0.83508797631874299),
2247 FRAC_CONST(0.84221723371628654),
2248 FRAC_CONST(0.84920218152657889),
2249 FRAC_CONST(0.85604162291477137),
2250 FRAC_CONST(0.86273438597779184),
2251 FRAC_CONST(0.86927932394514362),
2252 FRAC_CONST(0.87567531537539967),
2253 FRAC_CONST(0.88192126434835494),
2254 FRAC_CONST(0.88801610065280734),
2255 FRAC_CONST(0.89395877996993212),
2256 FRAC_CONST(0.8997482840522214),
2257 FRAC_CONST(0.90538362089795521),
2258 FRAC_CONST(0.91086382492117568),
2259 FRAC_CONST(0.91618795711713596),
2260 FRAC_CONST(0.92135510522319242),
2261 FRAC_CONST(0.9263643838751181),
2262 FRAC_CONST(0.93121493475880346),
2263 FRAC_CONST(0.93590592675732565),
2264 FRAC_CONST(0.94043655609335486),
2265 FRAC_CONST(0.94480604646687805),
2266 FRAC_CONST(0.94901364918821385),
2267 FRAC_CONST(0.95305864330629697),
2268 FRAC_CONST(0.95694033573220882),
2269 FRAC_CONST(0.9606580613579353),
2270 FRAC_CONST(0.96421118317032928),
2271 FRAC_CONST(0.96759909236025976),
2272 FRAC_CONST(0.9708212084269281),
2273 FRAC_CONST(0.97387697927733363),
2274 FRAC_CONST(0.97676588132087239),
2275 FRAC_CONST(0.97948741955905139),
2276 FRAC_CONST(0.98204112767030394),
2277 FRAC_CONST(0.98442656808989171),
2278 FRAC_CONST(0.98664333208487898),
2279 FRAC_CONST(0.98869103982416728),
2280 FRAC_CONST(0.99056934044357725),
2281 FRAC_CONST(0.99227791210596705),
2282 FRAC_CONST(0.99381646205637808),
2283 FRAC_CONST(0.99518472667219682),
2284 FRAC_CONST(0.99638247150832537),
2285 FRAC_CONST(0.99740949133735191),
2286 FRAC_CONST(0.99826561018471593),
2287 FRAC_CONST(0.99895068135886012),
2288 FRAC_CONST(0.99946458747636568),
2289 FRAC_CONST(0.99980724048206482),
2290 FRAC_CONST(0.99997858166412923)
2291 };
2292 #endif
2293
2294 #ifdef LD_DEC
2295 ALIGN static const real_t sine_mid_512[] =
2296 {
2297 FRAC_CONST(0.0015339801862847655),
2298 FRAC_CONST(0.0046019261204485705),
2299 FRAC_CONST(0.007669828739531097),
2300 FRAC_CONST(0.010737659167264491),
2301 FRAC_CONST(0.013805388528060391),
2302 FRAC_CONST(0.01687298794728171),
2303 FRAC_CONST(0.019940428551514441),
2304 FRAC_CONST(0.023007681468839369),
2305 FRAC_CONST(0.026074717829103901),
2306 FRAC_CONST(0.029141508764193722),
2307 FRAC_CONST(0.032208025408304586),
2308 FRAC_CONST(0.035274238898213947),
2309 FRAC_CONST(0.038340120373552694),
2310 FRAC_CONST(0.041405640977076739),
2311 FRAC_CONST(0.044470771854938668),
2312 FRAC_CONST(0.047535484156959303),
2313 FRAC_CONST(0.050599749036899282),
2314 FRAC_CONST(0.05366353765273052),
2315 FRAC_CONST(0.056726821166907748),
2316 FRAC_CONST(0.059789570746639868),
2317 FRAC_CONST(0.062851757564161406),
2318 FRAC_CONST(0.065913352797003805),
2319 FRAC_CONST(0.068974327628266746),
2320 FRAC_CONST(0.072034653246889332),
2321 FRAC_CONST(0.075094300847921305),
2322 FRAC_CONST(0.078153241632794232),
2323 FRAC_CONST(0.081211446809592441),
2324 FRAC_CONST(0.084268887593324071),
2325 FRAC_CONST(0.087325535206192059),
2326 FRAC_CONST(0.090381360877864983),
2327 FRAC_CONST(0.093436335845747787),
2328 FRAC_CONST(0.096490431355252593),
2329 FRAC_CONST(0.099543618660069319),
2330 FRAC_CONST(0.10259586902243628),
2331 FRAC_CONST(0.10564715371341062),
2332 FRAC_CONST(0.10869744401313872),
2333 FRAC_CONST(0.11174671121112659),
2334 FRAC_CONST(0.11479492660651008),
2335 FRAC_CONST(0.11784206150832498),
2336 FRAC_CONST(0.12088808723577708),
2337 FRAC_CONST(0.12393297511851216),
2338 FRAC_CONST(0.12697669649688587),
2339 FRAC_CONST(0.13001922272223335),
2340 FRAC_CONST(0.13306052515713906),
2341 FRAC_CONST(0.1361005751757062),
2342 FRAC_CONST(0.1391393441638262),
2343 FRAC_CONST(0.14217680351944803),
2344 FRAC_CONST(0.14521292465284746),
2345 FRAC_CONST(0.14824767898689603),
2346 FRAC_CONST(0.15128103795733022),
2347 FRAC_CONST(0.1543129730130201),
2348 FRAC_CONST(0.15734345561623825),
2349 FRAC_CONST(0.16037245724292828),
2350 FRAC_CONST(0.16339994938297323),
2351 FRAC_CONST(0.1664259035404641),
2352 FRAC_CONST(0.16945029123396796),
2353 FRAC_CONST(0.17247308399679595),
2354 FRAC_CONST(0.17549425337727143),
2355 FRAC_CONST(0.17851377093899751),
2356 FRAC_CONST(0.18153160826112497),
2357 FRAC_CONST(0.18454773693861962),
2358 FRAC_CONST(0.1875621285825296),
2359 FRAC_CONST(0.19057475482025274),
2360 FRAC_CONST(0.19358558729580361),
2361 FRAC_CONST(0.19659459767008022),
2362 FRAC_CONST(0.19960175762113097),
2363 FRAC_CONST(0.20260703884442113),
2364 FRAC_CONST(0.20561041305309924),
2365 FRAC_CONST(0.20861185197826349),
2366 FRAC_CONST(0.21161132736922755),
2367 FRAC_CONST(0.21460881099378676),
2368 FRAC_CONST(0.21760427463848364),
2369 FRAC_CONST(0.22059769010887351),
2370 FRAC_CONST(0.22358902922978999),
2371 FRAC_CONST(0.22657826384561),
2372 FRAC_CONST(0.22956536582051887),
2373 FRAC_CONST(0.23255030703877524),
2374 FRAC_CONST(0.23553305940497549),
2375 FRAC_CONST(0.23851359484431842),
2376 FRAC_CONST(0.24149188530286933),
2377 FRAC_CONST(0.24446790274782415),
2378 FRAC_CONST(0.24744161916777327),
2379 FRAC_CONST(0.25041300657296522),
2380 FRAC_CONST(0.25338203699557016),
2381 FRAC_CONST(0.25634868248994291),
2382 FRAC_CONST(0.25931291513288623),
2383 FRAC_CONST(0.26227470702391359),
2384 FRAC_CONST(0.26523403028551179),
2385 FRAC_CONST(0.26819085706340318),
2386 FRAC_CONST(0.27114515952680801),
2387 FRAC_CONST(0.27409690986870638),
2388 FRAC_CONST(0.2770460803060999),
2389 FRAC_CONST(0.27999264308027322),
2390 FRAC_CONST(0.28293657045705539),
2391 FRAC_CONST(0.28587783472708062),
2392 FRAC_CONST(0.28881640820604948),
2393 FRAC_CONST(0.29175226323498926),
2394 FRAC_CONST(0.29468537218051433),
2395 FRAC_CONST(0.2976157074350862),
2396 FRAC_CONST(0.30054324141727345),
2397 FRAC_CONST(0.30346794657201132),
2398 FRAC_CONST(0.30638979537086092),
2399 FRAC_CONST(0.30930876031226873),
2400 FRAC_CONST(0.31222481392182488),
2401 FRAC_CONST(0.31513792875252244),
2402 FRAC_CONST(0.31804807738501495),
2403 FRAC_CONST(0.32095523242787521),
2404 FRAC_CONST(0.32385936651785285),
2405 FRAC_CONST(0.32676045232013173),
2406 FRAC_CONST(0.32965846252858749),
2407 FRAC_CONST(0.33255336986604422),
2408 FRAC_CONST(0.3354451470845316),
2409 FRAC_CONST(0.33833376696554113),
2410 FRAC_CONST(0.34121920232028236),
2411 FRAC_CONST(0.34410142598993881),
2412 FRAC_CONST(0.34698041084592368),
2413 FRAC_CONST(0.34985612979013492),
2414 FRAC_CONST(0.35272855575521073),
2415 FRAC_CONST(0.35559766170478385),
2416 FRAC_CONST(0.35846342063373654),
2417 FRAC_CONST(0.36132580556845428),
2418 FRAC_CONST(0.36418478956707989),
2419 FRAC_CONST(0.36704034571976718),
2420 FRAC_CONST(0.3698924471489341),
2421 FRAC_CONST(0.37274106700951576),
2422 FRAC_CONST(0.37558617848921722),
2423 FRAC_CONST(0.37842775480876556),
2424 FRAC_CONST(0.38126576922216238),
2425 FRAC_CONST(0.38410019501693504),
2426 FRAC_CONST(0.38693100551438858),
2427 FRAC_CONST(0.38975817406985641),
2428 FRAC_CONST(0.39258167407295147),
2429 FRAC_CONST(0.39540147894781635),
2430 FRAC_CONST(0.39821756215337356),
2431 FRAC_CONST(0.40102989718357562),
2432 FRAC_CONST(0.40383845756765407),
2433 FRAC_CONST(0.40664321687036903),
2434 FRAC_CONST(0.40944414869225759),
2435 FRAC_CONST(0.41224122666988289),
2436 FRAC_CONST(0.41503442447608163),
2437 FRAC_CONST(0.41782371582021227),
2438 FRAC_CONST(0.42060907444840251),
2439 FRAC_CONST(0.42339047414379605),
2440 FRAC_CONST(0.42616788872679962),
2441 FRAC_CONST(0.42894129205532949),
2442 FRAC_CONST(0.43171065802505726),
2443 FRAC_CONST(0.43447596056965565),
2444 FRAC_CONST(0.43723717366104409),
2445 FRAC_CONST(0.43999427130963326),
2446 FRAC_CONST(0.44274722756457002),
2447 FRAC_CONST(0.44549601651398174),
2448 FRAC_CONST(0.44824061228521989),
2449 FRAC_CONST(0.45098098904510386),
2450 FRAC_CONST(0.45371712100016387),
2451 FRAC_CONST(0.45644898239688392),
2452 FRAC_CONST(0.45917654752194409),
2453 FRAC_CONST(0.46189979070246273),
2454 FRAC_CONST(0.46461868630623782),
2455 FRAC_CONST(0.46733320874198842),
2456 FRAC_CONST(0.47004333245959562),
2457 FRAC_CONST(0.47274903195034279),
2458 FRAC_CONST(0.47545028174715587),
2459 FRAC_CONST(0.47814705642484301),
2460 FRAC_CONST(0.48083933060033396),
2461 FRAC_CONST(0.48352707893291874),
2462 FRAC_CONST(0.48621027612448642),
2463 FRAC_CONST(0.48888889691976317),
2464 FRAC_CONST(0.4915629161065499),
2465 FRAC_CONST(0.49423230851595967),
2466 FRAC_CONST(0.49689704902265447),
2467 FRAC_CONST(0.49955711254508184),
2468 FRAC_CONST(0.50221247404571079),
2469 FRAC_CONST(0.50486310853126759),
2470 FRAC_CONST(0.50750899105297087),
2471 FRAC_CONST(0.51015009670676681),
2472 FRAC_CONST(0.51278640063356296),
2473 FRAC_CONST(0.51541787801946293),
2474 FRAC_CONST(0.51804450409599934),
2475 FRAC_CONST(0.52066625414036716),
2476 FRAC_CONST(0.52328310347565643),
2477 FRAC_CONST(0.52589502747108463),
2478 FRAC_CONST(0.52850200154222848),
2479 FRAC_CONST(0.531104001151255),
2480 FRAC_CONST(0.53370100180715296),
2481 FRAC_CONST(0.53629297906596318),
2482 FRAC_CONST(0.53887990853100842),
2483 FRAC_CONST(0.54146176585312344),
2484 FRAC_CONST(0.54403852673088382),
2485 FRAC_CONST(0.54661016691083486),
2486 FRAC_CONST(0.54917666218771966),
2487 FRAC_CONST(0.55173798840470734),
2488 FRAC_CONST(0.55429412145362),
2489 FRAC_CONST(0.5568450372751601),
2490 FRAC_CONST(0.55939071185913614),
2491 FRAC_CONST(0.56193112124468947),
2492 FRAC_CONST(0.5644662415205195),
2493 FRAC_CONST(0.56699604882510868),
2494 FRAC_CONST(0.56952051934694714),
2495 FRAC_CONST(0.57203962932475705),
2496 FRAC_CONST(0.57455335504771576),
2497 FRAC_CONST(0.57706167285567944),
2498 FRAC_CONST(0.57956455913940563),
2499 FRAC_CONST(0.58206199034077544),
2500 FRAC_CONST(0.58455394295301533),
2501 FRAC_CONST(0.58704039352091797),
2502 FRAC_CONST(0.58952131864106394),
2503 FRAC_CONST(0.59199669496204099),
2504 FRAC_CONST(0.59446649918466443),
2505 FRAC_CONST(0.5969307080621965),
2506 FRAC_CONST(0.59938929840056454),
2507 FRAC_CONST(0.60184224705858003),
2508 FRAC_CONST(0.60428953094815596),
2509 FRAC_CONST(0.60673112703452448),
2510 FRAC_CONST(0.60916701233645321),
2511 FRAC_CONST(0.61159716392646191),
2512 FRAC_CONST(0.61402155893103838),
2513 FRAC_CONST(0.61644017453085365),
2514 FRAC_CONST(0.61885298796097632),
2515 FRAC_CONST(0.62125997651108755),
2516 FRAC_CONST(0.62366111752569453),
2517 FRAC_CONST(0.62605638840434352),
2518 FRAC_CONST(0.62844576660183271),
2519 FRAC_CONST(0.63082922962842447),
2520 FRAC_CONST(0.63320675505005719),
2521 FRAC_CONST(0.63557832048855611),
2522 FRAC_CONST(0.63794390362184406),
2523 FRAC_CONST(0.64030348218415167),
2524 FRAC_CONST(0.64265703396622686),
2525 FRAC_CONST(0.64500453681554393),
2526 FRAC_CONST(0.64734596863651206),
2527 FRAC_CONST(0.64968130739068319),
2528 FRAC_CONST(0.6520105310969595),
2529 FRAC_CONST(0.65433361783180044),
2530 FRAC_CONST(0.65665054572942894),
2531 FRAC_CONST(0.65896129298203732),
2532 FRAC_CONST(0.66126583783999227),
2533 FRAC_CONST(0.66356415861203977),
2534 FRAC_CONST(0.66585623366550972),
2535 FRAC_CONST(0.66814204142651845),
2536 FRAC_CONST(0.67042156038017309),
2537 FRAC_CONST(0.67269476907077286),
2538 FRAC_CONST(0.67496164610201193),
2539 FRAC_CONST(0.67722217013718033),
2540 FRAC_CONST(0.67947631989936497),
2541 FRAC_CONST(0.68172407417164971),
2542 FRAC_CONST(0.6839654117973154),
2543 FRAC_CONST(0.68620031168003859),
2544 FRAC_CONST(0.68842875278409044),
2545 FRAC_CONST(0.6906507141345346),
2546 FRAC_CONST(0.69286617481742463),
2547 FRAC_CONST(0.69507511398000088),
2548 FRAC_CONST(0.69727751083088652),
2549 FRAC_CONST(0.69947334464028377),
2550 FRAC_CONST(0.70166259474016845),
2551 FRAC_CONST(0.70384524052448494),
2552 FRAC_CONST(0.70602126144933974),
2553 FRAC_CONST(0.70819063703319529),
2554 FRAC_CONST(0.71035334685706231),
2555 FRAC_CONST(0.71250937056469232),
2556 FRAC_CONST(0.71465868786276898),
2557 FRAC_CONST(0.71680127852109954),
2558 FRAC_CONST(0.71893712237280438),
2559 FRAC_CONST(0.72106619931450811),
2560 FRAC_CONST(0.72318848930652735),
2561 FRAC_CONST(0.72530397237306066),
2562 FRAC_CONST(0.72741262860237577),
2563 FRAC_CONST(0.7295144381469969),
2564 FRAC_CONST(0.73160938122389252),
2565 FRAC_CONST(0.73369743811466026),
2566 FRAC_CONST(0.73577858916571348),
2567 FRAC_CONST(0.73785281478846598),
2568 FRAC_CONST(0.73992009545951609),
2569 FRAC_CONST(0.74198041172083096),
2570 FRAC_CONST(0.74403374417992918),
2571 FRAC_CONST(0.74608007351006378),
2572 FRAC_CONST(0.74811938045040349),
2573 FRAC_CONST(0.75015164580621496),
2574 FRAC_CONST(0.7521768504490427),
2575 FRAC_CONST(0.75419497531688917),
2576 FRAC_CONST(0.75620600141439454),
2577 FRAC_CONST(0.75820990981301528),
2578 FRAC_CONST(0.76020668165120242),
2579 FRAC_CONST(0.7621962981345789),
2580 FRAC_CONST(0.76417874053611667),
2581 FRAC_CONST(0.76615399019631281),
2582 FRAC_CONST(0.76812202852336531),
2583 FRAC_CONST(0.7700828369933479),
2584 FRAC_CONST(0.77203639715038441),
2585 FRAC_CONST(0.77398269060682279),
2586 FRAC_CONST(0.77592169904340758),
2587 FRAC_CONST(0.77785340420945304),
2588 FRAC_CONST(0.77977778792301444),
2589 FRAC_CONST(0.78169483207105939),
2590 FRAC_CONST(0.7836045186096382),
2591 FRAC_CONST(0.78550682956405393),
2592 FRAC_CONST(0.78740174702903132),
2593 FRAC_CONST(0.78928925316888565),
2594 FRAC_CONST(0.79116933021769009),
2595 FRAC_CONST(0.79304196047944364),
2596 FRAC_CONST(0.79490712632823701),
2597 FRAC_CONST(0.79676481020841872),
2598 FRAC_CONST(0.79861499463476082),
2599 FRAC_CONST(0.80045766219262271),
2600 FRAC_CONST(0.80229279553811572),
2601 FRAC_CONST(0.8041203773982657),
2602 FRAC_CONST(0.80594039057117628),
2603 FRAC_CONST(0.80775281792619036),
2604 FRAC_CONST(0.80955764240405126),
2605 FRAC_CONST(0.81135484701706373),
2606 FRAC_CONST(0.81314441484925359),
2607 FRAC_CONST(0.81492632905652662),
2608 FRAC_CONST(0.81670057286682785),
2609 FRAC_CONST(0.81846712958029866),
2610 FRAC_CONST(0.82022598256943469),
2611 FRAC_CONST(0.82197711527924155),
2612 FRAC_CONST(0.82372051122739132),
2613 FRAC_CONST(0.82545615400437744),
2614 FRAC_CONST(0.82718402727366902),
2615 FRAC_CONST(0.82890411477186487),
2616 FRAC_CONST(0.8306164003088462),
2617 FRAC_CONST(0.83232086776792968),
2618 FRAC_CONST(0.83401750110601813),
2619 FRAC_CONST(0.8357062843537526),
2620 FRAC_CONST(0.83738720161566194),
2621 FRAC_CONST(0.83906023707031263),
2622 FRAC_CONST(0.84072537497045807),
2623 FRAC_CONST(0.84238259964318596),
2624 FRAC_CONST(0.84403189549006641),
2625 FRAC_CONST(0.84567324698729907),
2626 FRAC_CONST(0.84730663868585832),
2627 FRAC_CONST(0.84893205521163961),
2628 FRAC_CONST(0.85054948126560337),
2629 FRAC_CONST(0.85215890162391983),
2630 FRAC_CONST(0.8537603011381113),
2631 FRAC_CONST(0.85535366473519603),
2632 FRAC_CONST(0.85693897741782865),
2633 FRAC_CONST(0.85851622426444274),
2634 FRAC_CONST(0.86008539042939014),
2635 FRAC_CONST(0.8616464611430813),
2636 FRAC_CONST(0.86319942171212416),
2637 FRAC_CONST(0.86474425751946238),
2638 FRAC_CONST(0.86628095402451299),
2639 FRAC_CONST(0.86780949676330321),
2640 FRAC_CONST(0.86932987134860673),
2641 FRAC_CONST(0.87084206347007886),
2642 FRAC_CONST(0.87234605889439154),
2643 FRAC_CONST(0.87384184346536675),
2644 FRAC_CONST(0.87532940310411078),
2645 FRAC_CONST(0.87680872380914576),
2646 FRAC_CONST(0.87827979165654146),
2647 FRAC_CONST(0.87974259280004741),
2648 FRAC_CONST(0.88119711347122198),
2649 FRAC_CONST(0.88264333997956279),
2650 FRAC_CONST(0.88408125871263499),
2651 FRAC_CONST(0.88551085613619995),
2652 FRAC_CONST(0.88693211879434208),
2653 FRAC_CONST(0.88834503330959624),
2654 FRAC_CONST(0.88974958638307289),
2655 FRAC_CONST(0.89114576479458318),
2656 FRAC_CONST(0.89253355540276469),
2657 FRAC_CONST(0.89391294514520325),
2658 FRAC_CONST(0.89528392103855758),
2659 FRAC_CONST(0.89664647017868015),
2660 FRAC_CONST(0.89800057974073988),
2661 FRAC_CONST(0.89934623697934146),
2662 FRAC_CONST(0.90068342922864686),
2663 FRAC_CONST(0.90201214390249307),
2664 FRAC_CONST(0.90333236849451182),
2665 FRAC_CONST(0.90464409057824624),
2666 FRAC_CONST(0.90594729780726846),
2667 FRAC_CONST(0.90724197791529593),
2668 FRAC_CONST(0.90852811871630612),
2669 FRAC_CONST(0.90980570810465222),
2670 FRAC_CONST(0.91107473405517625),
2671 FRAC_CONST(0.91233518462332275),
2672 FRAC_CONST(0.91358704794525081),
2673 FRAC_CONST(0.91483031223794609),
2674 FRAC_CONST(0.91606496579933161),
2675 FRAC_CONST(0.91729099700837791),
2676 FRAC_CONST(0.91850839432521225),
2677 FRAC_CONST(0.91971714629122736),
2678 FRAC_CONST(0.92091724152918952),
2679 FRAC_CONST(0.92210866874334507),
2680 FRAC_CONST(0.92329141671952764),
2681 FRAC_CONST(0.9244654743252626),
2682 FRAC_CONST(0.92563083050987272),
2683 FRAC_CONST(0.92678747430458175),
2684 FRAC_CONST(0.92793539482261789),
2685 FRAC_CONST(0.92907458125931575),
2686 FRAC_CONST(0.93020502289221907),
2687 FRAC_CONST(0.93132670908118043),
2688 FRAC_CONST(0.93243962926846236),
2689 FRAC_CONST(0.93354377297883617),
2690 FRAC_CONST(0.93463912981968078),
2691 FRAC_CONST(0.93572568948108037),
2692 FRAC_CONST(0.93680344173592156),
2693 FRAC_CONST(0.93787237643998989),
2694 FRAC_CONST(0.93893248353206449),
2695 FRAC_CONST(0.93998375303401394),
2696 FRAC_CONST(0.94102617505088926),
2697 FRAC_CONST(0.94205973977101731),
2698 FRAC_CONST(0.94308443746609349),
2699 FRAC_CONST(0.94410025849127266),
2700 FRAC_CONST(0.94510719328526061),
2701 FRAC_CONST(0.94610523237040334),
2702 FRAC_CONST(0.94709436635277722),
2703 FRAC_CONST(0.94807458592227623),
2704 FRAC_CONST(0.94904588185270056),
2705 FRAC_CONST(0.950008245001843),
2706 FRAC_CONST(0.95096166631157508),
2707 FRAC_CONST(0.95190613680793223),
2708 FRAC_CONST(0.95284164760119872),
2709 FRAC_CONST(0.95376818988599033),
2710 FRAC_CONST(0.95468575494133834),
2711 FRAC_CONST(0.95559433413077111),
2712 FRAC_CONST(0.95649391890239499),
2713 FRAC_CONST(0.95738450078897586),
2714 FRAC_CONST(0.95826607140801767),
2715 FRAC_CONST(0.95913862246184189),
2716 FRAC_CONST(0.96000214573766585),
2717 FRAC_CONST(0.96085663310767966),
2718 FRAC_CONST(0.96170207652912254),
2719 FRAC_CONST(0.96253846804435916),
2720 FRAC_CONST(0.96336579978095405),
2721 FRAC_CONST(0.96418406395174572),
2722 FRAC_CONST(0.96499325285492032),
2723 FRAC_CONST(0.96579335887408357),
2724 FRAC_CONST(0.96658437447833312),
2725 FRAC_CONST(0.96736629222232851),
2726 FRAC_CONST(0.96813910474636233),
2727 FRAC_CONST(0.96890280477642887),
2728 FRAC_CONST(0.96965738512429245),
2729 FRAC_CONST(0.9704028386875555),
2730 FRAC_CONST(0.97113915844972509),
2731 FRAC_CONST(0.9718663374802794),
2732 FRAC_CONST(0.97258436893473221),
2733 FRAC_CONST(0.97329324605469825),
2734 FRAC_CONST(0.97399296216795583),
2735 FRAC_CONST(0.97468351068851067),
2736 FRAC_CONST(0.97536488511665687),
2737 FRAC_CONST(0.97603707903903902),
2738 FRAC_CONST(0.97670008612871184),
2739 FRAC_CONST(0.97735390014519996),
2740 FRAC_CONST(0.97799851493455714),
2741 FRAC_CONST(0.9786339244294231),
2742 FRAC_CONST(0.97926012264908202),
2743 FRAC_CONST(0.97987710369951764),
2744 FRAC_CONST(0.98048486177346938),
2745 FRAC_CONST(0.98108339115048659),
2746 FRAC_CONST(0.98167268619698311),
2747 FRAC_CONST(0.98225274136628937),
2748 FRAC_CONST(0.98282355119870524),
2749 FRAC_CONST(0.98338511032155118),
2750 FRAC_CONST(0.98393741344921892),
2751 FRAC_CONST(0.98448045538322093),
2752 FRAC_CONST(0.98501423101223984),
2753 FRAC_CONST(0.98553873531217606),
2754 FRAC_CONST(0.98605396334619544),
2755 FRAC_CONST(0.98655991026477541),
2756 FRAC_CONST(0.98705657130575097),
2757 FRAC_CONST(0.98754394179435923),
2758 FRAC_CONST(0.98802201714328353),
2759 FRAC_CONST(0.98849079285269659),
2760 FRAC_CONST(0.98895026451030299),
2761 FRAC_CONST(0.98940042779138038),
2762 FRAC_CONST(0.98984127845882053),
2763 FRAC_CONST(0.99027281236316911),
2764 FRAC_CONST(0.99069502544266463),
2765 FRAC_CONST(0.99110791372327678),
2766 FRAC_CONST(0.9915114733187439),
2767 FRAC_CONST(0.99190570043060933),
2768 FRAC_CONST(0.99229059134825737),
2769 FRAC_CONST(0.99266614244894802),
2770 FRAC_CONST(0.99303235019785141),
2771 FRAC_CONST(0.99338921114808065),
2772 FRAC_CONST(0.9937367219407246),
2773 FRAC_CONST(0.99407487930487937),
2774 FRAC_CONST(0.9944036800576791),
2775 FRAC_CONST(0.9947231211043257),
2776 FRAC_CONST(0.99503319943811863),
2777 FRAC_CONST(0.99533391214048228),
2778 FRAC_CONST(0.99562525638099431),
2779 FRAC_CONST(0.99590722941741172),
2780 FRAC_CONST(0.99617982859569687),
2781 FRAC_CONST(0.99644305135004263),
2782 FRAC_CONST(0.99669689520289606),
2783 FRAC_CONST(0.99694135776498216),
2784 FRAC_CONST(0.99717643673532619),
2785 FRAC_CONST(0.9974021299012753),
2786 FRAC_CONST(0.99761843513851955),
2787 FRAC_CONST(0.99782535041111164),
2788 FRAC_CONST(0.99802287377148624),
2789 FRAC_CONST(0.99821100336047819),
2790 FRAC_CONST(0.99838973740734016),
2791 FRAC_CONST(0.99855907422975931),
2792 FRAC_CONST(0.99871901223387294),
2793 FRAC_CONST(0.99886954991428356),
2794 FRAC_CONST(0.99901068585407338),
2795 FRAC_CONST(0.99914241872481691),
2796 FRAC_CONST(0.99926474728659442),
2797 FRAC_CONST(0.99937767038800285),
2798 FRAC_CONST(0.99948118696616695),
2799 FRAC_CONST(0.99957529604674922),
2800 FRAC_CONST(0.99965999674395922),
2801 FRAC_CONST(0.99973528826056168),
2802 FRAC_CONST(0.99980116988788426),
2803 FRAC_CONST(0.99985764100582386),
2804 FRAC_CONST(0.9999047010828529),
2805 FRAC_CONST(0.99994234967602391),
2806 FRAC_CONST(0.99997058643097414),
2807 FRAC_CONST(0.9999894110819284),
2808 FRAC_CONST(0.99999882345170188)
2809 };
2810
2811 #ifdef ALLOW_SMALL_FRAMELENGTH
2812 ALIGN static const real_t sine_mid_480[] =
2813 {
2814 FRAC_CONST(0.0016362454436240478),
2815 FRAC_CONST(0.00490871880799799),
2816 FRAC_CONST(0.0081811396039371282),
2817 FRAC_CONST(0.011453472786443779),
2818 FRAC_CONST(0.014725683311458524),
2819 FRAC_CONST(0.017997736136235509),
2820 FRAC_CONST(0.021269596219717739),
2821 FRAC_CONST(0.024541228522912285),
2822 FRAC_CONST(0.027812598009265607),
2823 FRAC_CONST(0.03108366964503869),
2824 FRAC_CONST(0.034354408399682276),
2825 FRAC_CONST(0.037624779246211978),
2826 FRAC_CONST(0.04089474716158345),
2827 FRAC_CONST(0.044164277127067358),
2828 FRAC_CONST(0.047433334128624507),
2829 FRAC_CONST(0.050701883157280733),
2830 FRAC_CONST(0.053969889209501881),
2831 FRAC_CONST(0.057237317287568618),
2832 FRAC_CONST(0.060504132399951269),
2833 FRAC_CONST(0.063770299561684493),
2834 FRAC_CONST(0.06703578379474201),
2835 FRAC_CONST(0.070300550128411174),
2836 FRAC_CONST(0.073564563599667426),
2837 FRAC_CONST(0.076827789253548759),
2838 FRAC_CONST(0.080090192143530081),
2839 FRAC_CONST(0.083351737331897449),
2840 FRAC_CONST(0.086612389890122182),
2841 FRAC_CONST(0.089872114899234967),
2842 FRAC_CONST(0.093130877450199795),
2843 FRAC_CONST(0.096388642644287828),
2844 FRAC_CONST(0.09964537559345106),
2845 FRAC_CONST(0.1029010414206961),
2846 FRAC_CONST(0.10615560526045748),
2847 FRAC_CONST(0.10940903225897117),
2848 FRAC_CONST(0.11266128757464781),
2849 FRAC_CONST(0.11591233637844581),
2850 FRAC_CONST(0.11916214385424433),
2851 FRAC_CONST(0.1224106751992162),
2852 FRAC_CONST(0.12565789562420052),
2853 FRAC_CONST(0.12890377035407541),
2854 FRAC_CONST(0.13214826462813015),
2855 FRAC_CONST(0.13539134370043773),
2856 FRAC_CONST(0.13863297284022669),
2857 FRAC_CONST(0.14187311733225325),
2858 FRAC_CONST(0.14511174247717309),
2859 FRAC_CONST(0.14834881359191271),
2860 FRAC_CONST(0.15158429601004111),
2861 FRAC_CONST(0.15481815508214106),
2862 FRAC_CONST(0.1580503561761798),
2863 FRAC_CONST(0.16128086467788047),
2864 FRAC_CONST(0.16450964599109233),
2865 FRAC_CONST(0.16773666553816149),
2866 FRAC_CONST(0.17096188876030122),
2867 FRAC_CONST(0.17418528111796186),
2868 FRAC_CONST(0.17740680809120093),
2869 FRAC_CONST(0.18062643518005275),
2870 FRAC_CONST(0.18384412790489776),
2871 FRAC_CONST(0.18705985180683199),
2872 FRAC_CONST(0.19027357244803589),
2873 FRAC_CONST(0.19348525541214331),
2874 FRAC_CONST(0.19669486630460997),
2875 FRAC_CONST(0.19990237075308173),
2876 FRAC_CONST(0.20310773440776286),
2877 FRAC_CONST(0.20631092294178383),
2878 FRAC_CONST(0.20951190205156878),
2879 FRAC_CONST(0.21271063745720317),
2880 FRAC_CONST(0.21590709490280058),
2881 FRAC_CONST(0.2191012401568698),
2882 FRAC_CONST(0.22229303901268133),
2883 FRAC_CONST(0.22548245728863364),
2884 FRAC_CONST(0.22866946082861941),
2885 FRAC_CONST(0.23185401550239115),
2886 FRAC_CONST(0.23503608720592667),
2887 FRAC_CONST(0.23821564186179459),
2888 FRAC_CONST(0.24139264541951888),
2889 FRAC_CONST(0.24456706385594387),
2890 FRAC_CONST(0.24773886317559846),
2891 FRAC_CONST(0.25090800941106001),
2892 FRAC_CONST(0.25407446862331851),
2893 FRAC_CONST(0.25723820690213967),
2894 FRAC_CONST(0.26039919036642817),
2895 FRAC_CONST(0.26355738516459076),
2896 FRAC_CONST(0.26671275747489837),
2897 FRAC_CONST(0.2698652735058486),
2898 FRAC_CONST(0.27301489949652735),
2899 FRAC_CONST(0.27616160171697068),
2900 FRAC_CONST(0.27930534646852595),
2901 FRAC_CONST(0.28244610008421245),
2902 FRAC_CONST(0.2855838289290823),
2903 FRAC_CONST(0.28871849940058025),
2904 FRAC_CONST(0.29185007792890405),
2905 FRAC_CONST(0.29497853097736348),
2906 FRAC_CONST(0.2981038250427398),
2907 FRAC_CONST(0.30122592665564446),
2908 FRAC_CONST(0.30434480238087736),
2909 FRAC_CONST(0.30746041881778519),
2910 FRAC_CONST(0.31057274260061901),
2911 FRAC_CONST(0.31368174039889146),
2912 FRAC_CONST(0.31678737891773395),
2913 FRAC_CONST(0.31988962489825296),
2914 FRAC_CONST(0.32298844511788638),
2915 FRAC_CONST(0.32608380639075912),
2916 FRAC_CONST(0.32917567556803889),
2917 FRAC_CONST(0.33226401953829071),
2918 FRAC_CONST(0.33534880522783189),
2919 FRAC_CONST(0.33842999960108583),
2920 FRAC_CONST(0.34150756966093632),
2921 FRAC_CONST(0.34458148244908043),
2922 FRAC_CONST(0.34765170504638188),
2923 FRAC_CONST(0.35071820457322322),
2924 FRAC_CONST(0.35378094818985806),
2925 FRAC_CONST(0.35683990309676283),
2926 FRAC_CONST(0.35989503653498811),
2927 FRAC_CONST(0.36294631578650921),
2928 FRAC_CONST(0.36599370817457672),
2929 FRAC_CONST(0.36903718106406647),
2930 FRAC_CONST(0.37207670186182878),
2931 FRAC_CONST(0.37511223801703802),
2932 FRAC_CONST(0.37814375702154046),
2933 FRAC_CONST(0.38117122641020335),
2934 FRAC_CONST(0.38419461376126157),
2935 FRAC_CONST(0.38721388669666562),
2936 FRAC_CONST(0.39022901288242801),
2937 FRAC_CONST(0.39323996002896966),
2938 FRAC_CONST(0.39624669589146555),
2939 FRAC_CONST(0.39924918827019029),
2940 FRAC_CONST(0.40224740501086254),
2941 FRAC_CONST(0.40524131400498986),
2942 FRAC_CONST(0.40823088319021217),
2943 FRAC_CONST(0.41121608055064529),
2944 FRAC_CONST(0.41419687411722372),
2945 FRAC_CONST(0.41717323196804335),
2946 FRAC_CONST(0.42014512222870243),
2947 FRAC_CONST(0.42311251307264408),
2948 FRAC_CONST(0.42607537272149631),
2949 FRAC_CONST(0.4290336694454126),
2950 FRAC_CONST(0.43198737156341183),
2951 FRAC_CONST(0.43493644744371707),
2952 FRAC_CONST(0.43788086550409511),
2953 FRAC_CONST(0.44082059421219388),
2954 FRAC_CONST(0.44375560208588088),
2955 FRAC_CONST(0.44668585769357955),
2956 FRAC_CONST(0.4496113296546066),
2957 FRAC_CONST(0.45253198663950756),
2958 FRAC_CONST(0.45544779737039259),
2959 FRAC_CONST(0.45835873062127125),
2960 FRAC_CONST(0.46126475521838717),
2961 FRAC_CONST(0.46416584004055156),
2962 FRAC_CONST(0.46706195401947659),
2963 FRAC_CONST(0.46995306614010829),
2964 FRAC_CONST(0.47283914544095862),
2965 FRAC_CONST(0.47572016101443682),
2966 FRAC_CONST(0.47859608200718085),
2967 FRAC_CONST(0.4814668776203872),
2968 FRAC_CONST(0.48433251711014125),
2969 FRAC_CONST(0.4871929697877464),
2970 FRAC_CONST(0.49004820502005247),
2971 FRAC_CONST(0.49289819222978404),
2972 FRAC_CONST(0.49574290089586776),
2973 FRAC_CONST(0.49858230055375902),
2974 FRAC_CONST(0.50141636079576901),
2975 FRAC_CONST(0.50424505127138919),
2976 FRAC_CONST(0.50706834168761705),
2977 FRAC_CONST(0.50988620180928057),
2978 FRAC_CONST(0.51269860145936175),
2979 FRAC_CONST(0.51550551051931948),
2980 FRAC_CONST(0.51830689892941317),
2981 FRAC_CONST(0.5211027366890234),
2982 FRAC_CONST(0.52389299385697385),
2983 FRAC_CONST(0.52667764055185196),
2984 FRAC_CONST(0.52945664695232897),
2985 FRAC_CONST(0.53222998329747884),
2986 FRAC_CONST(0.53499761988709726),
2987 FRAC_CONST(0.53775952708201991),
2988 FRAC_CONST(0.54051567530443978),
2989 FRAC_CONST(0.54326603503822357),
2990 FRAC_CONST(0.54601057682922816),
2991 FRAC_CONST(0.54874927128561579),
2992 FRAC_CONST(0.55148208907816942),
2993 FRAC_CONST(0.55420900094060566),
2994 FRAC_CONST(0.55692997766988939),
2995 FRAC_CONST(0.559644990126546),
2996 FRAC_CONST(0.56235400923497314),
2997 FRAC_CONST(0.56505700598375252),
2998 FRAC_CONST(0.56775395142596052),
2999 FRAC_CONST(0.57044481667947822),
3000 FRAC_CONST(0.57312957292730071),
3001 FRAC_CONST(0.57580819141784534),
3002 FRAC_CONST(0.57848064346525996),
3003 FRAC_CONST(0.58114690044973039),
3004 FRAC_CONST(0.58380693381778626),
3005 FRAC_CONST(0.58646071508260733),
3006 FRAC_CONST(0.58910821582432815),
3007 FRAC_CONST(0.5917494076903429),
3008 FRAC_CONST(0.5943842623956086),
3009 FRAC_CONST(0.59701275172294799),
3010 FRAC_CONST(0.59963484752335228),
3011 FRAC_CONST(0.60225052171628191),
3012 FRAC_CONST(0.60485974628996786),
3013 FRAC_CONST(0.60746249330171098),
3014 FRAC_CONST(0.61005873487818185),
3015 FRAC_CONST(0.61264844321571899),
3016 FRAC_CONST(0.61523159058062682),
3017 FRAC_CONST(0.61780814930947225),
3018 FRAC_CONST(0.62037809180938108),
3019 FRAC_CONST(0.62294139055833397),
3020 FRAC_CONST(0.6254980181054608),
3021 FRAC_CONST(0.62804794707133416),
3022 FRAC_CONST(0.63059115014826372),
3023 FRAC_CONST(0.63312760010058777),
3024 FRAC_CONST(0.63565726976496484),
3025 FRAC_CONST(0.63818013205066515),
3026 FRAC_CONST(0.64069615993986073),
3027 FRAC_CONST(0.64320532648791406),
3028 FRAC_CONST(0.64570760482366729),
3029 FRAC_CONST(0.64820296814972966),
3030 FRAC_CONST(0.65069138974276486),
3031 FRAC_CONST(0.65317284295377676),
3032 FRAC_CONST(0.65564730120839498),
3033 FRAC_CONST(0.65811473800715958),
3034 FRAC_CONST(0.660575126925805),
3035 FRAC_CONST(0.66302844161554231),
3036 FRAC_CONST(0.6654746558033422),
3037 FRAC_CONST(0.66791374329221598),
3038 FRAC_CONST(0.67034567796149647),
3039 FRAC_CONST(0.67277043376711676),
3040 FRAC_CONST(0.67518798474189046),
3041 FRAC_CONST(0.67759830499578866),
3042 FRAC_CONST(0.68000136871621808),
3043 FRAC_CONST(0.68239715016829683),
3044 FRAC_CONST(0.6847856236951303),
3045 FRAC_CONST(0.68716676371808583),
3046 FRAC_CONST(0.68954054473706683),
3047 FRAC_CONST(0.69190694133078579),
3048 FRAC_CONST(0.69426592815703603),
3049 FRAC_CONST(0.69661747995296419),
3050 FRAC_CONST(0.69896157153533944),
3051 FRAC_CONST(0.70129817780082437),
3052 FRAC_CONST(0.7036272737262429),
3053 FRAC_CONST(0.70594883436884903),
3054 FRAC_CONST(0.70826283486659336),
3055 FRAC_CONST(0.71056925043838959),
3056 FRAC_CONST(0.71286805638437978),
3057 FRAC_CONST(0.71515922808619936),
3058 FRAC_CONST(0.71744274100723993),
3059 FRAC_CONST(0.71971857069291278),
3060 FRAC_CONST(0.7219866927709101),
3061 FRAC_CONST(0.72424708295146689),
3062 FRAC_CONST(0.72649971702762028),
3063 FRAC_CONST(0.72874457087546896),
3064 FRAC_CONST(0.73098162045443171),
3065 FRAC_CONST(0.73321084180750484),
3066 FRAC_CONST(0.73543221106151868),
3067 FRAC_CONST(0.73764570442739286),
3068 FRAC_CONST(0.73985129820039208),
3069 FRAC_CONST(0.74204896876037885),
3070 FRAC_CONST(0.7442386925720671),
3071 FRAC_CONST(0.74642044618527381),
3072 FRAC_CONST(0.74859420623517081),
3073 FRAC_CONST(0.75075994944253421),
3074 FRAC_CONST(0.75291765261399446),
3075 FRAC_CONST(0.75506729264228367),
3076 FRAC_CONST(0.75720884650648446),
3077 FRAC_CONST(0.75934229127227548),
3078 FRAC_CONST(0.76146760409217706),
3079 FRAC_CONST(0.76358476220579641),
3080 FRAC_CONST(0.7656937429400712),
3081 FRAC_CONST(0.76779452370951196),
3082 FRAC_CONST(0.76988708201644451),
3083 FRAC_CONST(0.77197139545125026),
3084 FRAC_CONST(0.7740474416926072),
3085 FRAC_CONST(0.77611519850772781),
3086 FRAC_CONST(0.77817464375259782),
3087 FRAC_CONST(0.78022575537221317),
3088 FRAC_CONST(0.78226851140081632),
3089 FRAC_CONST(0.78430288996213138),
3090 FRAC_CONST(0.78632886926959822),
3091 FRAC_CONST(0.78834642762660623),
3092 FRAC_CONST(0.79035554342672631),
3093 FRAC_CONST(0.79235619515394229),
3094 FRAC_CONST(0.79434836138288134),
3095 FRAC_CONST(0.79633202077904397),
3096 FRAC_CONST(0.79830715209903147),
3097 FRAC_CONST(0.8002737341907743),
3098 FRAC_CONST(0.80223174599375802),
3099 FRAC_CONST(0.80418116653924954),
3100 FRAC_CONST(0.80612197495052085),
3101 FRAC_CONST(0.80805415044307316),
3102 FRAC_CONST(0.80997767232485907),
3103 FRAC_CONST(0.81189251999650469),
3104 FRAC_CONST(0.81379867295152986),
3105 FRAC_CONST(0.81569611077656778),
3106 FRAC_CONST(0.81758481315158371),
3107 FRAC_CONST(0.81946475985009259),
3108 FRAC_CONST(0.82133593073937561),
3109 FRAC_CONST(0.82319830578069586),
3110 FRAC_CONST(0.82505186502951278),
3111 FRAC_CONST(0.82689658863569615),
3112 FRAC_CONST(0.82873245684373809),
3113 FRAC_CONST(0.83055944999296494),
3114 FRAC_CONST(0.83237754851774781),
3115 FRAC_CONST(0.83418673294771239),
3116 FRAC_CONST(0.83598698390794668),
3117 FRAC_CONST(0.83777828211920935),
3118 FRAC_CONST(0.83956060839813562),
3119 FRAC_CONST(0.84133394365744296),
3120 FRAC_CONST(0.84309826890613537),
3121 FRAC_CONST(0.84485356524970701),
3122 FRAC_CONST(0.84659981389034411),
3123 FRAC_CONST(0.84833699612712676),
3124 FRAC_CONST(0.85006509335622882),
3125 FRAC_CONST(0.8517840870711173),
3126 FRAC_CONST(0.85349395886275037),
3127 FRAC_CONST(0.85519469041977514),
3128 FRAC_CONST(0.85688626352872277),
3129 FRAC_CONST(0.85856866007420429),
3130 FRAC_CONST(0.86024186203910447),
3131 FRAC_CONST(0.86190585150477417),
3132 FRAC_CONST(0.86356061065122347),
3133 FRAC_CONST(0.86520612175731115),
3134 FRAC_CONST(0.86684236720093533),
3135 FRAC_CONST(0.86846932945922151),
3136 FRAC_CONST(0.87008699110871135),
3137 FRAC_CONST(0.87169533482554817),
3138 FRAC_CONST(0.87329434338566281),
3139 FRAC_CONST(0.87488399966495822),
3140 FRAC_CONST(0.87646428663949283),
3141 FRAC_CONST(0.87803518738566277),
3142 FRAC_CONST(0.87959668508038291),
3143 FRAC_CONST(0.88114876300126743),
3144 FRAC_CONST(0.88269140452680916),
3145 FRAC_CONST(0.8842245931365561),
3146 FRAC_CONST(0.88574831241129048),
3147 FRAC_CONST(0.88726254603320276),
3148 FRAC_CONST(0.88876727778606746),
3149 FRAC_CONST(0.89026249155541637),
3150 FRAC_CONST(0.8917481713287112),
3151 FRAC_CONST(0.89322430119551532),
3152 FRAC_CONST(0.89469086534766362),
3153 FRAC_CONST(0.89614784807943237),
3154 FRAC_CONST(0.89759523378770689),
3155 FRAC_CONST(0.89903300697214927),
3156 FRAC_CONST(0.9004611522353636),
3157 FRAC_CONST(0.90187965428306172),
3158 FRAC_CONST(0.90328849792422594),
3159 FRAC_CONST(0.90468766807127299),
3160 FRAC_CONST(0.90607714974021469),
3161 FRAC_CONST(0.90745692805081868),
3162 FRAC_CONST(0.90882698822676755),
3163 FRAC_CONST(0.91018731559581767),
3164 FRAC_CONST(0.91153789558995579),
3165 FRAC_CONST(0.91287871374555518),
3166 FRAC_CONST(0.91420975570353069),
3167 FRAC_CONST(0.9155310072094921),
3168 FRAC_CONST(0.91684245411389753),
3169 FRAC_CONST(0.91814408237220391),
3170 FRAC_CONST(0.91943587804501858),
3171 FRAC_CONST(0.92071782729824769),
3172 FRAC_CONST(0.92198991640324446),
3173 FRAC_CONST(0.92325213173695675),
3174 FRAC_CONST(0.92450445978207241),
3175 FRAC_CONST(0.92574688712716402),
3176 FRAC_CONST(0.92697940046683291),
3177 FRAC_CONST(0.92820198660185149),
3178 FRAC_CONST(0.92941463243930444),
3179 FRAC_CONST(0.93061732499272909),
3180 FRAC_CONST(0.93181005138225426),
3181 FRAC_CONST(0.93299279883473885),
3182 FRAC_CONST(0.93416555468390772),
3183 FRAC_CONST(0.93532830637048769),
3184 FRAC_CONST(0.93648104144234268),
3185 FRAC_CONST(0.93762374755460598),
3186 FRAC_CONST(0.93875641246981323),
3187 FRAC_CONST(0.93987902405803303),
3188 FRAC_CONST(0.94099157029699743),
3189 FRAC_CONST(0.94209403927222979),
3190 FRAC_CONST(0.94318641917717327),
3191 FRAC_CONST(0.9442686983133165),
3192 FRAC_CONST(0.94534086509031956),
3193 FRAC_CONST(0.9464029080261378),
3194 FRAC_CONST(0.94745481574714419),
3195 FRAC_CONST(0.94849657698825252),
3196 FRAC_CONST(0.94952818059303667),
3197 FRAC_CONST(0.95054961551385087),
3198 FRAC_CONST(0.95156087081194762),
3199 FRAC_CONST(0.95256193565759528),
3200 FRAC_CONST(0.95355279933019343),
3201 FRAC_CONST(0.9545334512183884),
3202 FRAC_CONST(0.95550388082018611),
3203 FRAC_CONST(0.95646407774306541),
3204 FRAC_CONST(0.95741403170408834),
3205 FRAC_CONST(0.95835373253001133),
3206 FRAC_CONST(0.95928317015739362),
3207 FRAC_CONST(0.96020233463270466),
3208 FRAC_CONST(0.96111121611243155),
3209 FRAC_CONST(0.96200980486318388),
3210 FRAC_CONST(0.96289809126179782),
3211 FRAC_CONST(0.96377606579543984),
3212 FRAC_CONST(0.96464371906170809),
3213 FRAC_CONST(0.96550104176873297),
3214 FRAC_CONST(0.96634802473527726),
3215 FRAC_CONST(0.96718465889083372),
3216 FRAC_CONST(0.96801093527572268),
3217 FRAC_CONST(0.96882684504118799),
3218 FRAC_CONST(0.96963237944949143),
3219 FRAC_CONST(0.97042752987400682),
3220 FRAC_CONST(0.97121228779931179),
3221 FRAC_CONST(0.97198664482127939),
3222 FRAC_CONST(0.97275059264716823),
3223 FRAC_CONST(0.97350412309571066),
3224 FRAC_CONST(0.97424722809720088),
3225 FRAC_CONST(0.97497989969358168),
3226 FRAC_CONST(0.97570213003852857),
3227 FRAC_CONST(0.97641391139753486),
3228 FRAC_CONST(0.97711523614799412),
3229 FRAC_CONST(0.97780609677928154),
3230 FRAC_CONST(0.97848648589283505),
3231 FRAC_CONST(0.97915639620223371),
3232 FRAC_CONST(0.9798158205332762),
3233 FRAC_CONST(0.98046475182405801),
3234 FRAC_CONST(0.98110318312504607),
3235 FRAC_CONST(0.98173110759915416),
3236 FRAC_CONST(0.98234851852181571),
3237 FRAC_CONST(0.98295540928105563),
3238 FRAC_CONST(0.9835517733775615),
3239 FRAC_CONST(0.98413760442475307),
3240 FRAC_CONST(0.98471289614885038),
3241 FRAC_CONST(0.98527764238894122),
3242 FRAC_CONST(0.98583183709704714),
3243 FRAC_CONST(0.98637547433818806),
3244 FRAC_CONST(0.98690854829044583),
3245 FRAC_CONST(0.98743105324502667),
3246 FRAC_CONST(0.98794298360632238),
3247 FRAC_CONST(0.98844433389196995),
3248 FRAC_CONST(0.98893509873291074),
3249 FRAC_CONST(0.98941527287344755),
3250 FRAC_CONST(0.98988485117130098),
3251 FRAC_CONST(0.99034382859766479),
3252 FRAC_CONST(0.99079220023725967),
3253 FRAC_CONST(0.99122996128838525),
3254 FRAC_CONST(0.9916571070629725),
3255 FRAC_CONST(0.99207363298663342),
3256 FRAC_CONST(0.99247953459870997),
3257 FRAC_CONST(0.99287480755232194),
3258 FRAC_CONST(0.99325944761441354),
3259 FRAC_CONST(0.99363345066579889),
3260 FRAC_CONST(0.99399681270120555),
3261 FRAC_CONST(0.99434952982931812),
3262 FRAC_CONST(0.9946915982728195),
3263 FRAC_CONST(0.99502301436843166),
3264 FRAC_CONST(0.99534377456695422),
3265 FRAC_CONST(0.9956538754333033),
3266 FRAC_CONST(0.99595331364654771),
3267 FRAC_CONST(0.99624208599994479),
3268 FRAC_CONST(0.99652018940097464),
3269 FRAC_CONST(0.99678762087137318),
3270 FRAC_CONST(0.99704437754716424),
3271 FRAC_CONST(0.99729045667869021),
3272 FRAC_CONST(0.99752585563064111),
3273 FRAC_CONST(0.99775057188208349),
3274 FRAC_CONST(0.9979646030264866),
3275 FRAC_CONST(0.99816794677174903),
3276 FRAC_CONST(0.9983606009402225),
3277 FRAC_CONST(0.99854256346873571),
3278 FRAC_CONST(0.99871383240861611),
3279 FRAC_CONST(0.99887440592571108),
3280 FRAC_CONST(0.99902428230040718),
3281 FRAC_CONST(0.99916345992764877),
3282 FRAC_CONST(0.99929193731695531),
3283 FRAC_CONST(0.99940971309243731),
3284 FRAC_CONST(0.99951678599281069),
3285 FRAC_CONST(0.99961315487141078),
3286 FRAC_CONST(0.99969881869620425),
3287 FRAC_CONST(0.99977377654980037),
3288 FRAC_CONST(0.99983802762946083),
3289 FRAC_CONST(0.99989157124710804),
3290 FRAC_CONST(0.9999344068293331),
3291 FRAC_CONST(0.99996653391740109),
3292 FRAC_CONST(0.99998795216725689),
3293 FRAC_CONST(0.99999866134952808)
3294 };
3295 #endif
3296
3297 ALIGN static const real_t ld_mid_512[] =
3298 {
3299 FRAC_CONST(0),
3300 FRAC_CONST(0),
3301 FRAC_CONST(0),
3302 FRAC_CONST(0),
3303 FRAC_CONST(0),
3304 FRAC_CONST(0),
3305 FRAC_CONST(0),
3306 FRAC_CONST(0),
3307 FRAC_CONST(0),
3308 FRAC_CONST(0),
3309 FRAC_CONST(0),
3310 FRAC_CONST(0),
3311 FRAC_CONST(0),
3312 FRAC_CONST(0),
3313 FRAC_CONST(0),
3314 FRAC_CONST(0),
3315 FRAC_CONST(0),
3316 FRAC_CONST(0),
3317 FRAC_CONST(0),
3318 FRAC_CONST(0),
3319 FRAC_CONST(0),
3320 FRAC_CONST(0),
3321 FRAC_CONST(0),
3322 FRAC_CONST(0),
3323 FRAC_CONST(0),
3324 FRAC_CONST(0),
3325 FRAC_CONST(0),
3326 FRAC_CONST(0),
3327 FRAC_CONST(0),
3328 FRAC_CONST(0),
3329 FRAC_CONST(0),
3330 FRAC_CONST(0),
3331 FRAC_CONST(0),
3332 FRAC_CONST(0),
3333 FRAC_CONST(0),
3334 FRAC_CONST(0),
3335 FRAC_CONST(0),
3336 FRAC_CONST(0),
3337 FRAC_CONST(0),
3338 FRAC_CONST(0),
3339 FRAC_CONST(0),
3340 FRAC_CONST(0),
3341 FRAC_CONST(0),
3342 FRAC_CONST(0),
3343 FRAC_CONST(0),
3344 FRAC_CONST(0),
3345 FRAC_CONST(0),
3346 FRAC_CONST(0),
3347 FRAC_CONST(0),
3348 FRAC_CONST(0),
3349 FRAC_CONST(0),
3350 FRAC_CONST(0),
3351 FRAC_CONST(0),
3352 FRAC_CONST(0),
3353 FRAC_CONST(0),
3354 FRAC_CONST(0),
3355 FRAC_CONST(0),
3356 FRAC_CONST(0),
3357 FRAC_CONST(0),
3358 FRAC_CONST(0),
3359 FRAC_CONST(0),
3360 FRAC_CONST(0),
3361 FRAC_CONST(0),
3362 FRAC_CONST(0),
3363 FRAC_CONST(0),
3364 FRAC_CONST(0),
3365 FRAC_CONST(0),
3366 FRAC_CONST(0),
3367 FRAC_CONST(0),
3368 FRAC_CONST(0),
3369 FRAC_CONST(0),
3370 FRAC_CONST(0),
3371 FRAC_CONST(0),
3372 FRAC_CONST(0),
3373 FRAC_CONST(0),
3374 FRAC_CONST(0),
3375 FRAC_CONST(0),
3376 FRAC_CONST(0),
3377 FRAC_CONST(0),
3378 FRAC_CONST(0),
3379 FRAC_CONST(0),
3380 FRAC_CONST(0),
3381 FRAC_CONST(0),
3382 FRAC_CONST(0),
3383 FRAC_CONST(0),
3384 FRAC_CONST(0),
3385 FRAC_CONST(0),
3386 FRAC_CONST(0),
3387 FRAC_CONST(0),
3388 FRAC_CONST(0),
3389 FRAC_CONST(0),
3390 FRAC_CONST(0),
3391 FRAC_CONST(0),
3392 FRAC_CONST(0),
3393 FRAC_CONST(0),
3394 FRAC_CONST(0),
3395 FRAC_CONST(0),
3396 FRAC_CONST(0),
3397 FRAC_CONST(0),
3398 FRAC_CONST(0),
3399 FRAC_CONST(0),
3400 FRAC_CONST(0),
3401 FRAC_CONST(0),
3402 FRAC_CONST(0),
3403 FRAC_CONST(0),
3404 FRAC_CONST(0),
3405 FRAC_CONST(0),
3406 FRAC_CONST(0),
3407 FRAC_CONST(0),
3408 FRAC_CONST(0),
3409 FRAC_CONST(0),
3410 FRAC_CONST(0),
3411 FRAC_CONST(0),
3412 FRAC_CONST(0),
3413 FRAC_CONST(0),
3414 FRAC_CONST(0),
3415 FRAC_CONST(0),
3416 FRAC_CONST(0),
3417 FRAC_CONST(0),
3418 FRAC_CONST(0),
3419 FRAC_CONST(0),
3420 FRAC_CONST(0),
3421 FRAC_CONST(0),
3422 FRAC_CONST(0),
3423 FRAC_CONST(0),
3424 FRAC_CONST(0),
3425 FRAC_CONST(0),
3426 FRAC_CONST(0),
3427 FRAC_CONST(0),
3428 FRAC_CONST(0),
3429 FRAC_CONST(0),
3430 FRAC_CONST(0),
3431 FRAC_CONST(0),
3432 FRAC_CONST(0),
3433 FRAC_CONST(0),
3434 FRAC_CONST(0),
3435 FRAC_CONST(0),
3436 FRAC_CONST(0),
3437 FRAC_CONST(0),
3438 FRAC_CONST(0),
3439 FRAC_CONST(0),
3440 FRAC_CONST(0),
3441 FRAC_CONST(0),
3442 FRAC_CONST(0),
3443 FRAC_CONST(0),
3444 FRAC_CONST(0),
3445 FRAC_CONST(0),
3446 FRAC_CONST(0),
3447 FRAC_CONST(0),
3448 FRAC_CONST(0),
3449 FRAC_CONST(0),
3450 FRAC_CONST(0),
3451 FRAC_CONST(0),
3452 FRAC_CONST(0),
3453 FRAC_CONST(0),
3454 FRAC_CONST(0),
3455 FRAC_CONST(0),
3456 FRAC_CONST(0),
3457 FRAC_CONST(0),
3458 FRAC_CONST(0),
3459 FRAC_CONST(0),
3460 FRAC_CONST(0),
3461 FRAC_CONST(0),
3462 FRAC_CONST(0),
3463 FRAC_CONST(0),
3464 FRAC_CONST(0),
3465 FRAC_CONST(0),
3466 FRAC_CONST(0),
3467 FRAC_CONST(0),
3468 FRAC_CONST(0),
3469 FRAC_CONST(0),
3470 FRAC_CONST(0),
3471 FRAC_CONST(0),
3472 FRAC_CONST(0),
3473 FRAC_CONST(0),
3474 FRAC_CONST(0),
3475 FRAC_CONST(0),
3476 FRAC_CONST(0),
3477 FRAC_CONST(0),
3478 FRAC_CONST(0),
3479 FRAC_CONST(0),
3480 FRAC_CONST(0),
3481 FRAC_CONST(0),
3482 FRAC_CONST(0),
3483 FRAC_CONST(0),
3484 FRAC_CONST(0),
3485 FRAC_CONST(0),
3486 FRAC_CONST(0),
3487 FRAC_CONST(0),
3488 FRAC_CONST(0),
3489 FRAC_CONST(0),
3490 FRAC_CONST(0),
3491 FRAC_CONST(0.0061358846491544753),
3492 FRAC_CONST(0.01840672990580482),
3493 FRAC_CONST(0.030674803176636626),
3494 FRAC_CONST(0.04293825693494082),
3495 FRAC_CONST(0.055195244349689934),
3496 FRAC_CONST(0.067443919563664051),
3497 FRAC_CONST(0.079682437971430126),
3498 FRAC_CONST(0.091908956497132724),
3499 FRAC_CONST(0.10412163387205459),
3500 FRAC_CONST(0.11631863091190475),
3501 FRAC_CONST(0.12849811079379317),
3502 FRAC_CONST(0.14065823933284921),
3503 FRAC_CONST(0.15279718525844344),
3504 FRAC_CONST(0.16491312048996989),
3505 FRAC_CONST(0.17700422041214875),
3506 FRAC_CONST(0.18906866414980619),
3507 FRAC_CONST(0.2011046348420919),
3508 FRAC_CONST(0.21311031991609136),
3509 FRAC_CONST(0.22508391135979283),
3510 FRAC_CONST(0.2370236059943672),
3511 FRAC_CONST(0.24892760574572015),
3512 FRAC_CONST(0.26079411791527551),
3513 FRAC_CONST(0.27262135544994898),
3514 FRAC_CONST(0.28440753721127188),
3515 FRAC_CONST(0.29615088824362379),
3516 FRAC_CONST(0.30784964004153487),
3517 FRAC_CONST(0.31950203081601569),
3518 FRAC_CONST(0.33110630575987643),
3519 FRAC_CONST(0.34266071731199438),
3520 FRAC_CONST(0.35416352542049034),
3521 FRAC_CONST(0.36561299780477385),
3522 FRAC_CONST(0.37700741021641826),
3523 FRAC_CONST(0.38834504669882625),
3524 FRAC_CONST(0.39962419984564679),
3525 FRAC_CONST(0.41084317105790391),
3526 FRAC_CONST(0.42200027079979968),
3527 FRAC_CONST(0.43309381885315196),
3528 FRAC_CONST(0.4441221445704292),
3529 FRAC_CONST(0.45508358712634384),
3530 FRAC_CONST(0.46597649576796618),
3531 FRAC_CONST(0.47679923006332209),
3532 FRAC_CONST(0.487550160148436),
3533 FRAC_CONST(0.49822766697278187),
3534 FRAC_CONST(0.50883014254310699),
3535 FRAC_CONST(0.51935599016558964),
3536 FRAC_CONST(0.52980362468629461),
3537 FRAC_CONST(0.54017147272989285),
3538 FRAC_CONST(0.55045797293660481),
3539 FRAC_CONST(0.56066157619733603),
3540 FRAC_CONST(0.57078074588696726),
3541 FRAC_CONST(0.58081395809576453),
3542 FRAC_CONST(0.59075970185887416),
3543 FRAC_CONST(0.60061647938386897),
3544 FRAC_CONST(0.61038280627630948),
3545 FRAC_CONST(0.6200572117632891),
3546 FRAC_CONST(0.62963823891492698),
3547 FRAC_CONST(0.63912444486377573),
3548 FRAC_CONST(0.64851440102211244),
3549 FRAC_CONST(0.65780669329707864),
3550 FRAC_CONST(0.66699992230363747),
3551 FRAC_CONST(0.67609270357531592),
3552 FRAC_CONST(0.68508366777270036),
3553 FRAC_CONST(0.693971460889654),
3554 FRAC_CONST(0.7027547444572253),
3555 FRAC_CONST(0.71143219574521643),
3556 FRAC_CONST(0.72000250796138165),
3557 FRAC_CONST(0.7284643904482252),
3558 FRAC_CONST(0.73681656887736979),
3559 FRAC_CONST(0.74505778544146595),
3560 FRAC_CONST(0.75318679904361241),
3561 FRAC_CONST(0.76120238548426178),
3562 FRAC_CONST(0.76910333764557959),
3563 FRAC_CONST(0.77688846567323244),
3564 FRAC_CONST(0.78455659715557524),
3565 FRAC_CONST(0.79210657730021239),
3566 FRAC_CONST(0.79953726910790501),
3567 FRAC_CONST(0.80684755354379922),
3568 FRAC_CONST(0.8140363297059483),
3569 FRAC_CONST(0.82110251499110465),
3570 FRAC_CONST(0.8280450452577558),
3571 FRAC_CONST(0.83486287498638001),
3572 FRAC_CONST(0.84155497743689833),
3573 FRAC_CONST(0.84812034480329712),
3574 FRAC_CONST(0.85455798836540053),
3575 FRAC_CONST(0.86086693863776731),
3576 FRAC_CONST(0.86704624551569265),
3577 FRAC_CONST(0.87309497841829009),
3578 FRAC_CONST(0.87901222642863341),
3579 FRAC_CONST(0.88479709843093779),
3580 FRAC_CONST(0.89044872324475788),
3581 FRAC_CONST(0.89596624975618511),
3582 FRAC_CONST(0.90134884704602203),
3583 FRAC_CONST(0.90659570451491533),
3584 FRAC_CONST(0.91170603200542988),
3585 FRAC_CONST(0.9166790599210427),
3586 FRAC_CONST(0.9215140393420419),
3587 FRAC_CONST(0.92621024213831127),
3588 FRAC_CONST(0.93076696107898371),
3589 FRAC_CONST(0.9351835099389475),
3590 FRAC_CONST(0.93945922360218992),
3591 FRAC_CONST(0.94359345816196039),
3592 FRAC_CONST(0.94758559101774109),
3593 FRAC_CONST(0.95143502096900834),
3594 FRAC_CONST(0.95514116830577067),
3595 FRAC_CONST(0.9587034748958716),
3596 FRAC_CONST(0.96212140426904158),
3597 FRAC_CONST(0.9653944416976894),
3598 FRAC_CONST(0.96852209427441727),
3599 FRAC_CONST(0.97150389098625178),
3600 FRAC_CONST(0.97433938278557586),
3601 FRAC_CONST(0.97702814265775439),
3602 FRAC_CONST(0.97956976568544052),
3603 FRAC_CONST(0.98196386910955524),
3604 FRAC_CONST(0.98421009238692903),
3605 FRAC_CONST(0.98630809724459867),
3606 FRAC_CONST(0.98825756773074946),
3607 FRAC_CONST(0.99005821026229712),
3608 FRAC_CONST(0.99170975366909953),
3609 FRAC_CONST(0.9932119492347945),
3610 FRAC_CONST(0.99456457073425542),
3611 FRAC_CONST(0.99576741446765982),
3612 FRAC_CONST(0.99682029929116567),
3613 FRAC_CONST(0.99772306664419164),
3614 FRAC_CONST(0.99847558057329477),
3615 FRAC_CONST(0.99907772775264536),
3616 FRAC_CONST(0.99952941750109314),
3617 FRAC_CONST(0.9998305817958234),
3618 FRAC_CONST(0.99998117528260111),
3619 FRAC_CONST(1),
3620 FRAC_CONST(1),
3621 FRAC_CONST(1),
3622 FRAC_CONST(1),
3623 FRAC_CONST(1),
3624 FRAC_CONST(1),
3625 FRAC_CONST(1),
3626 FRAC_CONST(1),
3627 FRAC_CONST(1),
3628 FRAC_CONST(1),
3629 FRAC_CONST(1),
3630 FRAC_CONST(1),
3631 FRAC_CONST(1),
3632 FRAC_CONST(1),
3633 FRAC_CONST(1),
3634 FRAC_CONST(1),
3635 FRAC_CONST(1),
3636 FRAC_CONST(1),
3637 FRAC_CONST(1),
3638 FRAC_CONST(1),
3639 FRAC_CONST(1),
3640 FRAC_CONST(1),
3641 FRAC_CONST(1),
3642 FRAC_CONST(1),
3643 FRAC_CONST(1),
3644 FRAC_CONST(1),
3645 FRAC_CONST(1),
3646 FRAC_CONST(1),
3647 FRAC_CONST(1),
3648 FRAC_CONST(1),
3649 FRAC_CONST(1),
3650 FRAC_CONST(1),
3651 FRAC_CONST(1),
3652 FRAC_CONST(1),
3653 FRAC_CONST(1),
3654 FRAC_CONST(1),
3655 FRAC_CONST(1),
3656 FRAC_CONST(1),
3657 FRAC_CONST(1),
3658 FRAC_CONST(1),
3659 FRAC_CONST(1),
3660 FRAC_CONST(1),
3661 FRAC_CONST(1),
3662 FRAC_CONST(1),
3663 FRAC_CONST(1),
3664 FRAC_CONST(1),
3665 FRAC_CONST(1),
3666 FRAC_CONST(1),
3667 FRAC_CONST(1),
3668 FRAC_CONST(1),
3669 FRAC_CONST(1),
3670 FRAC_CONST(1),
3671 FRAC_CONST(1),
3672 FRAC_CONST(1),
3673 FRAC_CONST(1),
3674 FRAC_CONST(1),
3675 FRAC_CONST(1),
3676 FRAC_CONST(1),
3677 FRAC_CONST(1),
3678 FRAC_CONST(1),
3679 FRAC_CONST(1),
3680 FRAC_CONST(1),
3681 FRAC_CONST(1),
3682 FRAC_CONST(1),
3683 FRAC_CONST(1),
3684 FRAC_CONST(1),
3685 FRAC_CONST(1),
3686 FRAC_CONST(1),
3687 FRAC_CONST(1),
3688 FRAC_CONST(1),
3689 FRAC_CONST(1),
3690 FRAC_CONST(1),
3691 FRAC_CONST(1),
3692 FRAC_CONST(1),
3693 FRAC_CONST(1),
3694 FRAC_CONST(1),
3695 FRAC_CONST(1),
3696 FRAC_CONST(1),
3697 FRAC_CONST(1),
3698 FRAC_CONST(1),
3699 FRAC_CONST(1),
3700 FRAC_CONST(1),
3701 FRAC_CONST(1),
3702 FRAC_CONST(1),
3703 FRAC_CONST(1),
3704 FRAC_CONST(1),
3705 FRAC_CONST(1),
3706 FRAC_CONST(1),
3707 FRAC_CONST(1),
3708 FRAC_CONST(1),
3709 FRAC_CONST(1),
3710 FRAC_CONST(1),
3711 FRAC_CONST(1),
3712 FRAC_CONST(1),
3713 FRAC_CONST(1),
3714 FRAC_CONST(1),
3715 FRAC_CONST(1),
3716 FRAC_CONST(1),
3717 FRAC_CONST(1),
3718 FRAC_CONST(1),
3719 FRAC_CONST(1),
3720 FRAC_CONST(1),
3721 FRAC_CONST(1),
3722 FRAC_CONST(1),
3723 FRAC_CONST(1),
3724 FRAC_CONST(1),
3725 FRAC_CONST(1),
3726 FRAC_CONST(1),
3727 FRAC_CONST(1),
3728 FRAC_CONST(1),
3729 FRAC_CONST(1),
3730 FRAC_CONST(1),
3731 FRAC_CONST(1),
3732 FRAC_CONST(1),
3733 FRAC_CONST(1),
3734 FRAC_CONST(1),
3735 FRAC_CONST(1),
3736 FRAC_CONST(1),
3737 FRAC_CONST(1),
3738 FRAC_CONST(1),
3739 FRAC_CONST(1),
3740 FRAC_CONST(1),
3741 FRAC_CONST(1),
3742 FRAC_CONST(1),
3743 FRAC_CONST(1),
3744 FRAC_CONST(1),
3745 FRAC_CONST(1),
3746 FRAC_CONST(1),
3747 FRAC_CONST(1),
3748 FRAC_CONST(1),
3749 FRAC_CONST(1),
3750 FRAC_CONST(1),
3751 FRAC_CONST(1),
3752 FRAC_CONST(1),
3753 FRAC_CONST(1),
3754 FRAC_CONST(1),
3755 FRAC_CONST(1),
3756 FRAC_CONST(1),
3757 FRAC_CONST(1),
3758 FRAC_CONST(1),
3759 FRAC_CONST(1),
3760 FRAC_CONST(1),
3761 FRAC_CONST(1),
3762 FRAC_CONST(1),
3763 FRAC_CONST(1),
3764 FRAC_CONST(1),
3765 FRAC_CONST(1),
3766 FRAC_CONST(1),
3767 FRAC_CONST(1),
3768 FRAC_CONST(1),
3769 FRAC_CONST(1),
3770 FRAC_CONST(1),
3771 FRAC_CONST(1),
3772 FRAC_CONST(1),
3773 FRAC_CONST(1),
3774 FRAC_CONST(1),
3775 FRAC_CONST(1),
3776 FRAC_CONST(1),
3777 FRAC_CONST(1),
3778 FRAC_CONST(1),
3779 FRAC_CONST(1),
3780 FRAC_CONST(1),
3781 FRAC_CONST(1),
3782 FRAC_CONST(1),
3783 FRAC_CONST(1),
3784 FRAC_CONST(1),
3785 FRAC_CONST(1),
3786 FRAC_CONST(1),
3787 FRAC_CONST(1),
3788 FRAC_CONST(1),
3789 FRAC_CONST(1),
3790 FRAC_CONST(1),
3791 FRAC_CONST(1),
3792 FRAC_CONST(1),
3793 FRAC_CONST(1),
3794 FRAC_CONST(1),
3795 FRAC_CONST(1),
3796 FRAC_CONST(1),
3797 FRAC_CONST(1),
3798 FRAC_CONST(1),
3799 FRAC_CONST(1),
3800 FRAC_CONST(1),
3801 FRAC_CONST(1),
3802 FRAC_CONST(1),
3803 FRAC_CONST(1),
3804 FRAC_CONST(1),
3805 FRAC_CONST(1),
3806 FRAC_CONST(1),
3807 FRAC_CONST(1),
3808 FRAC_CONST(1),
3809 FRAC_CONST(1),
3810 FRAC_CONST(1)
3811 };
3812
3813 #ifdef ALLOW_SMALL_FRAMELENGTH
3814 ALIGN static const real_t ld_mid_480[] =
3815 {
3816 FRAC_CONST(0),
3817 FRAC_CONST(0),
3818 FRAC_CONST(0),
3819 FRAC_CONST(0),
3820 FRAC_CONST(0),
3821 FRAC_CONST(0),
3822 FRAC_CONST(0),
3823 FRAC_CONST(0),
3824 FRAC_CONST(0),
3825 FRAC_CONST(0),
3826 FRAC_CONST(0),
3827 FRAC_CONST(0),
3828 FRAC_CONST(0),
3829 FRAC_CONST(0),
3830 FRAC_CONST(0),
3831 FRAC_CONST(0),
3832 FRAC_CONST(0),
3833 FRAC_CONST(0),
3834 FRAC_CONST(0),
3835 FRAC_CONST(0),
3836 FRAC_CONST(0),
3837 FRAC_CONST(0),
3838 FRAC_CONST(0),
3839 FRAC_CONST(0),
3840 FRAC_CONST(0),
3841 FRAC_CONST(0),
3842 FRAC_CONST(0),
3843 FRAC_CONST(0),
3844 FRAC_CONST(0),
3845 FRAC_CONST(0),
3846 FRAC_CONST(0),
3847 FRAC_CONST(0),
3848 FRAC_CONST(0),
3849 FRAC_CONST(0),
3850 FRAC_CONST(0),
3851 FRAC_CONST(0),
3852 FRAC_CONST(0),
3853 FRAC_CONST(0),
3854 FRAC_CONST(0),
3855 FRAC_CONST(0),
3856 FRAC_CONST(0),
3857 FRAC_CONST(0),
3858 FRAC_CONST(0),
3859 FRAC_CONST(0),
3860 FRAC_CONST(0),
3861 FRAC_CONST(0),
3862 FRAC_CONST(0),
3863 FRAC_CONST(0),
3864 FRAC_CONST(0),
3865 FRAC_CONST(0),
3866 FRAC_CONST(0),
3867 FRAC_CONST(0),
3868 FRAC_CONST(0),
3869 FRAC_CONST(0),
3870 FRAC_CONST(0),
3871 FRAC_CONST(0),
3872 FRAC_CONST(0),
3873 FRAC_CONST(0),
3874 FRAC_CONST(0),
3875 FRAC_CONST(0),
3876 FRAC_CONST(0),
3877 FRAC_CONST(0),
3878 FRAC_CONST(0),
3879 FRAC_CONST(0),
3880 FRAC_CONST(0),
3881 FRAC_CONST(0),
3882 FRAC_CONST(0),
3883 FRAC_CONST(0),
3884 FRAC_CONST(0),
3885 FRAC_CONST(0),
3886 FRAC_CONST(0),
3887 FRAC_CONST(0),
3888 FRAC_CONST(0),
3889 FRAC_CONST(0),
3890 FRAC_CONST(0),
3891 FRAC_CONST(0),
3892 FRAC_CONST(0),
3893 FRAC_CONST(0),
3894 FRAC_CONST(0),
3895 FRAC_CONST(0),
3896 FRAC_CONST(0),
3897 FRAC_CONST(0),
3898 FRAC_CONST(0),
3899 FRAC_CONST(0),
3900 FRAC_CONST(0),
3901 FRAC_CONST(0),
3902 FRAC_CONST(0),
3903 FRAC_CONST(0),
3904 FRAC_CONST(0),
3905 FRAC_CONST(0),
3906 FRAC_CONST(0),
3907 FRAC_CONST(0),
3908 FRAC_CONST(0),
3909 FRAC_CONST(0),
3910 FRAC_CONST(0),
3911 FRAC_CONST(0),
3912 FRAC_CONST(0),
3913 FRAC_CONST(0),
3914 FRAC_CONST(0),
3915 FRAC_CONST(0),
3916 FRAC_CONST(0),
3917 FRAC_CONST(0),
3918 FRAC_CONST(0),
3919 FRAC_CONST(0),
3920 FRAC_CONST(0),
3921 FRAC_CONST(0),
3922 FRAC_CONST(0),
3923 FRAC_CONST(0),
3924 FRAC_CONST(0),
3925 FRAC_CONST(0),
3926 FRAC_CONST(0),
3927 FRAC_CONST(0),
3928 FRAC_CONST(0),
3929 FRAC_CONST(0),
3930 FRAC_CONST(0),
3931 FRAC_CONST(0),
3932 FRAC_CONST(0),
3933 FRAC_CONST(0),
3934 FRAC_CONST(0),
3935 FRAC_CONST(0),
3936 FRAC_CONST(0),
3937 FRAC_CONST(0),
3938 FRAC_CONST(0),
3939 FRAC_CONST(0),
3940 FRAC_CONST(0),
3941 FRAC_CONST(0),
3942 FRAC_CONST(0),
3943 FRAC_CONST(0),
3944 FRAC_CONST(0),
3945 FRAC_CONST(0),
3946 FRAC_CONST(0),
3947 FRAC_CONST(0),
3948 FRAC_CONST(0),
3949 FRAC_CONST(0),
3950 FRAC_CONST(0),
3951 FRAC_CONST(0),
3952 FRAC_CONST(0),
3953 FRAC_CONST(0),
3954 FRAC_CONST(0),
3955 FRAC_CONST(0),
3956 FRAC_CONST(0),
3957 FRAC_CONST(0),
3958 FRAC_CONST(0),
3959 FRAC_CONST(0),
3960 FRAC_CONST(0),
3961 FRAC_CONST(0),
3962 FRAC_CONST(0),
3963 FRAC_CONST(0),
3964 FRAC_CONST(0),
3965 FRAC_CONST(0),
3966 FRAC_CONST(0),
3967 FRAC_CONST(0),
3968 FRAC_CONST(0),
3969 FRAC_CONST(0),
3970 FRAC_CONST(0),
3971 FRAC_CONST(0),
3972 FRAC_CONST(0),
3973 FRAC_CONST(0),
3974 FRAC_CONST(0),
3975 FRAC_CONST(0),
3976 FRAC_CONST(0),
3977 FRAC_CONST(0),
3978 FRAC_CONST(0),
3979 FRAC_CONST(0),
3980 FRAC_CONST(0),
3981 FRAC_CONST(0),
3982 FRAC_CONST(0),
3983 FRAC_CONST(0),
3984 FRAC_CONST(0),
3985 FRAC_CONST(0),
3986 FRAC_CONST(0),
3987 FRAC_CONST(0),
3988 FRAC_CONST(0),
3989 FRAC_CONST(0),
3990 FRAC_CONST(0),
3991 FRAC_CONST(0),
3992 FRAC_CONST(0),
3993 FRAC_CONST(0),
3994 FRAC_CONST(0),
3995 FRAC_CONST(0),
3996 FRAC_CONST(0.0065449379673518581),
3997 FRAC_CONST(0.019633692460628301),
3998 FRAC_CONST(0.032719082821776137),
3999 FRAC_CONST(0.045798866936520771),
4000 FRAC_CONST(0.058870803651189033),
4001 FRAC_CONST(0.071932653156719387),
4002 FRAC_CONST(0.084982177372441667),
4003 FRAC_CONST(0.09801714032956059),
4004 FRAC_CONST(0.11103530855427769),
4005 FRAC_CONST(0.12403445145048532),
4006 FRAC_CONST(0.13701234168196802),
4007 FRAC_CONST(0.14996675555404498),
4008 FRAC_CONST(0.16289547339458874),
4009 FRAC_CONST(0.17579627993435451),
4010 FRAC_CONST(0.18866696468655525),
4011 FRAC_CONST(0.2015053223256171),
4012 FRAC_CONST(0.21430915306505074),
4013 FRAC_CONST(0.2270762630343732),
4014 FRAC_CONST(0.23980446465501654),
4015 FRAC_CONST(0.25249157701515795),
4016 FRAC_CONST(0.26513542624340797),
4017 FRAC_CONST(0.27773384588129219),
4018 FRAC_CONST(0.29028467725446233),
4019 FRAC_CONST(0.3027857698425746),
4020 FRAC_CONST(0.31523498164776964),
4021 FRAC_CONST(0.32763017956169349),
4022 FRAC_CONST(0.33996923973099424),
4023 FRAC_CONST(0.35225004792123354),
4024 FRAC_CONST(0.36447049987914965),
4025 FRAC_CONST(0.37662850169321077),
4026 FRAC_CONST(0.38872197015239557),
4027 FRAC_CONST(0.40074883310314097),
4028 FRAC_CONST(0.41270702980439467),
4029 FRAC_CONST(0.42459451128071307),
4030 FRAC_CONST(0.43640924067334208),
4031 FRAC_CONST(0.44814919358922256),
4032 FRAC_CONST(0.45981235844785984),
4033 FRAC_CONST(0.47139673682599764),
4034 FRAC_CONST(0.48290034380003727),
4035 FRAC_CONST(0.49432120828614462),
4036 FRAC_CONST(0.50565737337798455),
4037 FRAC_CONST(0.51690689668202761),
4038 FRAC_CONST(0.52806785065036799),
4039 FRAC_CONST(0.53913832291100017),
4040 FRAC_CONST(0.55011641659549337),
4041 FRAC_CONST(0.56100025066400983),
4042 FRAC_CONST(0.57178796022761225),
4043 FRAC_CONST(0.58247769686780215),
4044 FRAC_CONST(0.59306762895323706),
4045 FRAC_CONST(0.60355594195357143),
4046 FRAC_CONST(0.61394083875036642),
4047 FRAC_CONST(0.62422053994501758),
4048 FRAC_CONST(0.63439328416364549),
4049 FRAC_CONST(0.64445732835889735),
4050 FRAC_CONST(0.65441094810861034),
4051 FRAC_CONST(0.66425243791128175),
4052 FRAC_CONST(0.67398011147829784),
4053 FRAC_CONST(0.68359230202287125),
4054 FRAC_CONST(0.69308736254563585),
4055 FRAC_CONST(0.70246366611685174),
4056 FRAC_CONST(0.71171960615517138),
4057 FRAC_CONST(0.72085359670291882),
4058 FRAC_CONST(0.7298640726978356),
4059 FRAC_CONST(0.73874949024124625),
4060 FRAC_CONST(0.74750832686259672),
4061 FRAC_CONST(0.75613908178032285),
4062 FRAC_CONST(0.76464027615900032),
4063 FRAC_CONST(0.77301045336273699),
4064 FRAC_CONST(0.78124817920475853),
4065 FRAC_CONST(0.78935204219315003),
4066 FRAC_CONST(0.79732065377270711),
4067 FRAC_CONST(0.80515264856285829),
4068 FRAC_CONST(0.81284668459161513),
4069 FRAC_CONST(0.82040144352551359),
4070 FRAC_CONST(0.82781563089550203),
4071 FRAC_CONST(0.83508797631874299),
4072 FRAC_CONST(0.84221723371628654),
4073 FRAC_CONST(0.84920218152657889),
4074 FRAC_CONST(0.85604162291477137),
4075 FRAC_CONST(0.86273438597779184),
4076 FRAC_CONST(0.86927932394514362),
4077 FRAC_CONST(0.87567531537539967),
4078 FRAC_CONST(0.88192126434835494),
4079 FRAC_CONST(0.88801610065280734),
4080 FRAC_CONST(0.89395877996993212),
4081 FRAC_CONST(0.8997482840522214),
4082 FRAC_CONST(0.90538362089795521),
4083 FRAC_CONST(0.91086382492117568),
4084 FRAC_CONST(0.91618795711713596),
4085 FRAC_CONST(0.92135510522319242),
4086 FRAC_CONST(0.9263643838751181),
4087 FRAC_CONST(0.93121493475880346),
4088 FRAC_CONST(0.93590592675732565),
4089 FRAC_CONST(0.94043655609335486),
4090 FRAC_CONST(0.94480604646687805),
4091 FRAC_CONST(0.94901364918821385),
4092 FRAC_CONST(0.95305864330629697),
4093 FRAC_CONST(0.95694033573220882),
4094 FRAC_CONST(0.9606580613579353),
4095 FRAC_CONST(0.96421118317032928),
4096 FRAC_CONST(0.96759909236025976),
4097 FRAC_CONST(0.9708212084269281),
4098 FRAC_CONST(0.97387697927733363),
4099 FRAC_CONST(0.97676588132087239),
4100 FRAC_CONST(0.97948741955905139),
4101 FRAC_CONST(0.98204112767030394),
4102 FRAC_CONST(0.98442656808989171),
4103 FRAC_CONST(0.98664333208487898),
4104 FRAC_CONST(0.98869103982416728),
4105 FRAC_CONST(0.99056934044357725),
4106 FRAC_CONST(0.99227791210596705),
4107 FRAC_CONST(0.99381646205637808),
4108 FRAC_CONST(0.99518472667219682),
4109 FRAC_CONST(0.99638247150832537),
4110 FRAC_CONST(0.99740949133735191),
4111 FRAC_CONST(0.99826561018471593),
4112 FRAC_CONST(0.99895068135886012),
4113 FRAC_CONST(0.99946458747636568),
4114 FRAC_CONST(0.99980724048206482),
4115 FRAC_CONST(0.99997858166412923),
4116 FRAC_CONST(1),
4117 FRAC_CONST(1),
4118 FRAC_CONST(1),
4119 FRAC_CONST(1),
4120 FRAC_CONST(1),
4121 FRAC_CONST(1),
4122 FRAC_CONST(1),
4123 FRAC_CONST(1),
4124 FRAC_CONST(1),
4125 FRAC_CONST(1),
4126 FRAC_CONST(1),
4127 FRAC_CONST(1),
4128 FRAC_CONST(1),
4129 FRAC_CONST(1),
4130 FRAC_CONST(1),
4131 FRAC_CONST(1),
4132 FRAC_CONST(1),
4133 FRAC_CONST(1),
4134 FRAC_CONST(1),
4135 FRAC_CONST(1),
4136 FRAC_CONST(1),
4137 FRAC_CONST(1),
4138 FRAC_CONST(1),
4139 FRAC_CONST(1),
4140 FRAC_CONST(1),
4141 FRAC_CONST(1),
4142 FRAC_CONST(1),
4143 FRAC_CONST(1),
4144 FRAC_CONST(1),
4145 FRAC_CONST(1),
4146 FRAC_CONST(1),
4147 FRAC_CONST(1),
4148 FRAC_CONST(1),
4149 FRAC_CONST(1),
4150 FRAC_CONST(1),
4151 FRAC_CONST(1),
4152 FRAC_CONST(1),
4153 FRAC_CONST(1),
4154 FRAC_CONST(1),
4155 FRAC_CONST(1),
4156 FRAC_CONST(1),
4157 FRAC_CONST(1),
4158 FRAC_CONST(1),
4159 FRAC_CONST(1),
4160 FRAC_CONST(1),
4161 FRAC_CONST(1),
4162 FRAC_CONST(1),
4163 FRAC_CONST(1),
4164 FRAC_CONST(1),
4165 FRAC_CONST(1),
4166 FRAC_CONST(1),
4167 FRAC_CONST(1),
4168 FRAC_CONST(1),
4169 FRAC_CONST(1),
4170 FRAC_CONST(1),
4171 FRAC_CONST(1),
4172 FRAC_CONST(1),
4173 FRAC_CONST(1),
4174 FRAC_CONST(1),
4175 FRAC_CONST(1),
4176 FRAC_CONST(1),
4177 FRAC_CONST(1),
4178 FRAC_CONST(1),
4179 FRAC_CONST(1),
4180 FRAC_CONST(1),
4181 FRAC_CONST(1),
4182 FRAC_CONST(1),
4183 FRAC_CONST(1),
4184 FRAC_CONST(1),
4185 FRAC_CONST(1),
4186 FRAC_CONST(1),
4187 FRAC_CONST(1),
4188 FRAC_CONST(1),
4189 FRAC_CONST(1),
4190 FRAC_CONST(1),
4191 FRAC_CONST(1),
4192 FRAC_CONST(1),
4193 FRAC_CONST(1),
4194 FRAC_CONST(1),
4195 FRAC_CONST(1),
4196 FRAC_CONST(1),
4197 FRAC_CONST(1),
4198 FRAC_CONST(1),
4199 FRAC_CONST(1),
4200 FRAC_CONST(1),
4201 FRAC_CONST(1),
4202 FRAC_CONST(1),
4203 FRAC_CONST(1),
4204 FRAC_CONST(1),
4205 FRAC_CONST(1),
4206 FRAC_CONST(1),
4207 FRAC_CONST(1),
4208 FRAC_CONST(1),
4209 FRAC_CONST(1),
4210 FRAC_CONST(1),
4211 FRAC_CONST(1),
4212 FRAC_CONST(1),
4213 FRAC_CONST(1),
4214 FRAC_CONST(1),
4215 FRAC_CONST(1),
4216 FRAC_CONST(1),
4217 FRAC_CONST(1),
4218 FRAC_CONST(1),
4219 FRAC_CONST(1),
4220 FRAC_CONST(1),
4221 FRAC_CONST(1),
4222 FRAC_CONST(1),
4223 FRAC_CONST(1),
4224 FRAC_CONST(1),
4225 FRAC_CONST(1),
4226 FRAC_CONST(1),
4227 FRAC_CONST(1),
4228 FRAC_CONST(1),
4229 FRAC_CONST(1),
4230 FRAC_CONST(1),
4231 FRAC_CONST(1),
4232 FRAC_CONST(1),
4233 FRAC_CONST(1),
4234 FRAC_CONST(1),
4235 FRAC_CONST(1),
4236 FRAC_CONST(1),
4237 FRAC_CONST(1),
4238 FRAC_CONST(1),
4239 FRAC_CONST(1),
4240 FRAC_CONST(1),
4241 FRAC_CONST(1),
4242 FRAC_CONST(1),
4243 FRAC_CONST(1),
4244 FRAC_CONST(1),
4245 FRAC_CONST(1),
4246 FRAC_CONST(1),
4247 FRAC_CONST(1),
4248 FRAC_CONST(1),
4249 FRAC_CONST(1),
4250 FRAC_CONST(1),
4251 FRAC_CONST(1),
4252 FRAC_CONST(1),
4253 FRAC_CONST(1),
4254 FRAC_CONST(1),
4255 FRAC_CONST(1),
4256 FRAC_CONST(1),
4257 FRAC_CONST(1),
4258 FRAC_CONST(1),
4259 FRAC_CONST(1),
4260 FRAC_CONST(1),
4261 FRAC_CONST(1),
4262 FRAC_CONST(1),
4263 FRAC_CONST(1),
4264 FRAC_CONST(1),
4265 FRAC_CONST(1),
4266 FRAC_CONST(1),
4267 FRAC_CONST(1),
4268 FRAC_CONST(1),
4269 FRAC_CONST(1),
4270 FRAC_CONST(1),
4271 FRAC_CONST(1),
4272 FRAC_CONST(1),
4273 FRAC_CONST(1),
4274 FRAC_CONST(1),
4275 FRAC_CONST(1),
4276 FRAC_CONST(1),
4277 FRAC_CONST(1),
4278 FRAC_CONST(1),
4279 FRAC_CONST(1),
4280 FRAC_CONST(1),
4281 FRAC_CONST(1),
4282 FRAC_CONST(1),
4283 FRAC_CONST(1),
4284 FRAC_CONST(1),
4285 FRAC_CONST(1),
4286 FRAC_CONST(1),
4287 FRAC_CONST(1),
4288 FRAC_CONST(1),
4289 FRAC_CONST(1),
4290 FRAC_CONST(1),
4291 FRAC_CONST(1),
4292 FRAC_CONST(1),
4293 FRAC_CONST(1),
4294 FRAC_CONST(1),
4295 FRAC_CONST(1)
4296 };
4297 #endif
4298 #endif
4299
4300 #ifdef __cplusplus
4301 }
4302 #endif
4303 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: specrec.c,v 1.60 2007/11/01 12:33:36 menno Exp $
28 **/
29
30 /*
31 Spectral reconstruction:
32 - grouping/sectioning
33 - inverse quantization
34 - applying scalefactors
35 */
36
37 #include "common.h"
38 #include "structs.h"
39
40 #include <string.h>
41 #include <stdlib.h>
42 #include "specrec.h"
43 #include "filtbank.h"
44 #include "syntax.h"
45 #include "iq_table.h"
46 #include "ms.h"
47 #include "is.h"
48 #include "pns.h"
49 #include "tns.h"
50 #include "drc.h"
51 #include "lt_predict.h"
52 #include "ic_predict.h"
53 #ifdef SSR_DEC
54 #include "ssr.h"
55 #include "ssr_fb.h"
56 #endif
57
58
59 /* static function declarations */
60 static uint8_t quant_to_spec(NeAACDecHandle hDecoder,
61 ic_stream *ics, int16_t *quant_data,
62 real_t *spec_data, uint16_t frame_len);
63
64
65 #ifdef LD_DEC
66 ALIGN static const uint8_t num_swb_512_window[] =
67 {
68 0, 0, 0, 36, 36, 37, 31, 31, 0, 0, 0, 0
69 };
70 ALIGN static const uint8_t num_swb_480_window[] =
71 {
72 0, 0, 0, 35, 35, 37, 30, 30, 0, 0, 0, 0
73 };
74 #endif
75
76 ALIGN static const uint8_t num_swb_960_window[] =
77 {
78 40, 40, 45, 49, 49, 49, 46, 46, 42, 42, 42, 40
79 };
80
81 ALIGN static const uint8_t num_swb_1024_window[] =
82 {
83 41, 41, 47, 49, 49, 51, 47, 47, 43, 43, 43, 40
84 };
85
86 ALIGN static const uint8_t num_swb_128_window[] =
87 {
88 12, 12, 12, 14, 14, 14, 15, 15, 15, 15, 15, 15
89 };
90
91 ALIGN static const uint16_t swb_offset_1024_96[] =
92 {
93 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56,
94 64, 72, 80, 88, 96, 108, 120, 132, 144, 156, 172, 188, 212, 240,
95 276, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024
96 };
97
98 ALIGN static const uint16_t swb_offset_128_96[] =
99 {
100 0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 92, 128
101 };
102
103 ALIGN static const uint16_t swb_offset_1024_64[] =
104 {
105 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56,
106 64, 72, 80, 88, 100, 112, 124, 140, 156, 172, 192, 216, 240, 268,
107 304, 344, 384, 424, 464, 504, 544, 584, 624, 664, 704, 744, 784, 824,
108 864, 904, 944, 984, 1024
109 };
110
111 ALIGN static const uint16_t swb_offset_128_64[] =
112 {
113 0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 92, 128
114 };
115
116 ALIGN static const uint16_t swb_offset_1024_48[] =
117 {
118 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48, 56, 64, 72,
119 80, 88, 96, 108, 120, 132, 144, 160, 176, 196, 216, 240, 264, 292,
120 320, 352, 384, 416, 448, 480, 512, 544, 576, 608, 640, 672, 704, 736,
121 768, 800, 832, 864, 896, 928, 1024
122 };
123
124 #ifdef LD_DEC
125 ALIGN static const uint16_t swb_offset_512_48[] =
126 {
127 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 68, 76, 84,
128 92, 100, 112, 124, 136, 148, 164, 184, 208, 236, 268, 300, 332, 364, 396,
129 428, 460, 512
130 };
131
132 ALIGN static const uint16_t swb_offset_480_48[] =
133 {
134 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 64, 72 ,80 ,88,
135 96, 108, 120, 132, 144, 156, 172, 188, 212, 240, 272, 304, 336, 368, 400,
136 432, 480
137 };
138 #endif
139
140 ALIGN static const uint16_t swb_offset_128_48[] =
141 {
142 0, 4, 8, 12, 16, 20, 28, 36, 44, 56, 68, 80, 96, 112, 128
143 };
144
145 ALIGN static const uint16_t swb_offset_1024_32[] =
146 {
147 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48, 56, 64, 72,
148 80, 88, 96, 108, 120, 132, 144, 160, 176, 196, 216, 240, 264, 292,
149 320, 352, 384, 416, 448, 480, 512, 544, 576, 608, 640, 672, 704, 736,
150 768, 800, 832, 864, 896, 928, 960, 992, 1024
151 };
152
153 #ifdef LD_DEC
154 ALIGN static const uint16_t swb_offset_512_32[] =
155 {
156 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 64, 72, 80,
157 88, 96, 108, 120, 132, 144, 160, 176, 192, 212, 236, 260, 288, 320, 352,
158 384, 416, 448, 480, 512
159 };
160
161 ALIGN static const uint16_t swb_offset_480_32[] =
162 {
163 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 72, 80,
164 88, 96, 104, 112, 124, 136, 148, 164, 180, 200, 224, 256, 288, 320, 352,
165 384, 416, 448, 480
166 };
167 #endif
168
169 ALIGN static const uint16_t swb_offset_1024_24[] =
170 {
171 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 52, 60, 68,
172 76, 84, 92, 100, 108, 116, 124, 136, 148, 160, 172, 188, 204, 220,
173 240, 260, 284, 308, 336, 364, 396, 432, 468, 508, 552, 600, 652, 704,
174 768, 832, 896, 960, 1024
175 };
176
177 #ifdef LD_DEC
178 ALIGN static const uint16_t swb_offset_512_24[] =
179 {
180 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 52, 60, 68,
181 80, 92, 104, 120, 140, 164, 192, 224, 256, 288, 320, 352, 384, 416,
182 448, 480, 512
183 };
184
185 ALIGN static const uint16_t swb_offset_480_24[] =
186 {
187 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 52, 60, 68, 80, 92, 104, 120,
188 140, 164, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480
189 };
190 #endif
191
192 ALIGN static const uint16_t swb_offset_128_24[] =
193 {
194 0, 4, 8, 12, 16, 20, 24, 28, 36, 44, 52, 64, 76, 92, 108, 128
195 };
196
197 ALIGN static const uint16_t swb_offset_1024_16[] =
198 {
199 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 100, 112, 124,
200 136, 148, 160, 172, 184, 196, 212, 228, 244, 260, 280, 300, 320, 344,
201 368, 396, 424, 456, 492, 532, 572, 616, 664, 716, 772, 832, 896, 960, 1024
202 };
203
204 ALIGN static const uint16_t swb_offset_128_16[] =
205 {
206 0, 4, 8, 12, 16, 20, 24, 28, 32, 40, 48, 60, 72, 88, 108, 128
207 };
208
209 ALIGN static const uint16_t swb_offset_1024_8[] =
210 {
211 0, 12, 24, 36, 48, 60, 72, 84, 96, 108, 120, 132, 144, 156, 172,
212 188, 204, 220, 236, 252, 268, 288, 308, 328, 348, 372, 396, 420, 448,
213 476, 508, 544, 580, 620, 664, 712, 764, 820, 880, 944, 1024
214 };
215
216 ALIGN static const uint16_t swb_offset_128_8[] =
217 {
218 0, 4, 8, 12, 16, 20, 24, 28, 36, 44, 52, 60, 72, 88, 108, 128
219 };
220
221 ALIGN static const uint16_t *swb_offset_1024_window[] =
222 {
223 swb_offset_1024_96, /* 96000 */
224 swb_offset_1024_96, /* 88200 */
225 swb_offset_1024_64, /* 64000 */
226 swb_offset_1024_48, /* 48000 */
227 swb_offset_1024_48, /* 44100 */
228 swb_offset_1024_32, /* 32000 */
229 swb_offset_1024_24, /* 24000 */
230 swb_offset_1024_24, /* 22050 */
231 swb_offset_1024_16, /* 16000 */
232 swb_offset_1024_16, /* 12000 */
233 swb_offset_1024_16, /* 11025 */
234 swb_offset_1024_8 /* 8000 */
235 };
236
237 #ifdef LD_DEC
238 ALIGN static const uint16_t *swb_offset_512_window[] =
239 {
240 0, /* 96000 */
241 0, /* 88200 */
242 0, /* 64000 */
243 swb_offset_512_48, /* 48000 */
244 swb_offset_512_48, /* 44100 */
245 swb_offset_512_32, /* 32000 */
246 swb_offset_512_24, /* 24000 */
247 swb_offset_512_24, /* 22050 */
248 0, /* 16000 */
249 0, /* 12000 */
250 0, /* 11025 */
251 0 /* 8000 */
252 };
253
254 ALIGN static const uint16_t *swb_offset_480_window[] =
255 {
256 0, /* 96000 */
257 0, /* 88200 */
258 0, /* 64000 */
259 swb_offset_480_48, /* 48000 */
260 swb_offset_480_48, /* 44100 */
261 swb_offset_480_32, /* 32000 */
262 swb_offset_480_24, /* 24000 */
263 swb_offset_480_24, /* 22050 */
264 0, /* 16000 */
265 0, /* 12000 */
266 0, /* 11025 */
267 0 /* 8000 */
268 };
269 #endif
270
271 ALIGN static const uint16_t *swb_offset_128_window[] =
272 {
273 swb_offset_128_96, /* 96000 */
274 swb_offset_128_96, /* 88200 */
275 swb_offset_128_64, /* 64000 */
276 swb_offset_128_48, /* 48000 */
277 swb_offset_128_48, /* 44100 */
278 swb_offset_128_48, /* 32000 */
279 swb_offset_128_24, /* 24000 */
280 swb_offset_128_24, /* 22050 */
281 swb_offset_128_16, /* 16000 */
282 swb_offset_128_16, /* 12000 */
283 swb_offset_128_16, /* 11025 */
284 swb_offset_128_8 /* 8000 */
285 };
286
287 #define bit_set(A, B) ((A) & (1<<(B)))
288
289 /* 4.5.2.3.4 */
290 /*
291 - determine the number of windows in a window_sequence named num_windows
292 - determine the number of window_groups named num_window_groups
293 - determine the number of windows in each group named window_group_length[g]
294 - determine the total number of scalefactor window bands named num_swb for
295 the actual window type
296 - determine swb_offset[swb], the offset of the first coefficient in
297 scalefactor window band named swb of the window actually used
298 - determine sect_sfb_offset[g][section],the offset of the first coefficient
299 in section named section. This offset depends on window_sequence and
300 scale_factor_grouping and is needed to decode the spectral_data().
301 */
302 uint8_t window_grouping_info(NeAACDecHandle hDecoder, ic_stream *ics)
303 {
304 uint8_t i, g;
305
306 uint8_t sf_index = hDecoder->sf_index;
307
308 switch (ics->window_sequence) {
309 case ONLY_LONG_SEQUENCE:
310 case LONG_START_SEQUENCE:
311 case LONG_STOP_SEQUENCE:
312 ics->num_windows = 1;
313 ics->num_window_groups = 1;
314 ics->window_group_length[ics->num_window_groups-1] = 1;
315 #ifdef LD_DEC
316 if (hDecoder->object_type == LD)
317 {
318 if (hDecoder->frameLength == 512)
319 ics->num_swb = num_swb_512_window[sf_index];
320 else /* if (hDecoder->frameLength == 480) */
321 ics->num_swb = num_swb_480_window[sf_index];
322 } else {
323 #endif
324 if (hDecoder->frameLength == 1024)
325 ics->num_swb = num_swb_1024_window[sf_index];
326 else /* if (hDecoder->frameLength == 960) */
327 ics->num_swb = num_swb_960_window[sf_index];
328 #ifdef LD_DEC
329 }
330 #endif
331
332 if (ics->max_sfb > ics->num_swb)
333 {
334 return 32;
335 }
336
337 /* preparation of sect_sfb_offset for long blocks */
338 /* also copy the last value! */
339 #ifdef LD_DEC
340 if (hDecoder->object_type == LD)
341 {
342 if (hDecoder->frameLength == 512)
343 {
344 for (i = 0; i < ics->num_swb; i++)
345 {
346 ics->sect_sfb_offset[0][i] = swb_offset_512_window[sf_index][i];
347 ics->swb_offset[i] = swb_offset_512_window[sf_index][i];
348 }
349 } else /* if (hDecoder->frameLength == 480) */ {
350 for (i = 0; i < ics->num_swb; i++)
351 {
352 ics->sect_sfb_offset[0][i] = swb_offset_480_window[sf_index][i];
353 ics->swb_offset[i] = swb_offset_480_window[sf_index][i];
354 }
355 }
356 ics->sect_sfb_offset[0][ics->num_swb] = hDecoder->frameLength;
357 ics->swb_offset[ics->num_swb] = hDecoder->frameLength;
358 ics->swb_offset_max = hDecoder->frameLength;
359 } else {
360 #endif
361 for (i = 0; i < ics->num_swb; i++)
362 {
363 ics->sect_sfb_offset[0][i] = swb_offset_1024_window[sf_index][i];
364 ics->swb_offset[i] = swb_offset_1024_window[sf_index][i];
365 }
366 ics->sect_sfb_offset[0][ics->num_swb] = hDecoder->frameLength;
367 ics->swb_offset[ics->num_swb] = hDecoder->frameLength;
368 ics->swb_offset_max = hDecoder->frameLength;
369 #ifdef LD_DEC
370 }
371 #endif
372 return 0;
373 case EIGHT_SHORT_SEQUENCE:
374 ics->num_windows = 8;
375 ics->num_window_groups = 1;
376 ics->window_group_length[ics->num_window_groups-1] = 1;
377 ics->num_swb = num_swb_128_window[sf_index];
378
379 if (ics->max_sfb > ics->num_swb)
380 {
381 return 32;
382 }
383
384 for (i = 0; i < ics->num_swb; i++)
385 ics->swb_offset[i] = swb_offset_128_window[sf_index][i];
386 ics->swb_offset[ics->num_swb] = hDecoder->frameLength/8;
387 ics->swb_offset_max = hDecoder->frameLength/8;
388
389 for (i = 0; i < ics->num_windows-1; i++) {
390 if (bit_set(ics->scale_factor_grouping, 6-i) == 0)
391 {
392 ics->num_window_groups += 1;
393 ics->window_group_length[ics->num_window_groups-1] = 1;
394 } else {
395 ics->window_group_length[ics->num_window_groups-1] += 1;
396 }
397 }
398
399 /* preparation of sect_sfb_offset for short blocks */
400 for (g = 0; g < ics->num_window_groups; g++)
401 {
402 uint16_t width;
403 uint8_t sect_sfb = 0;
404 uint16_t offset = 0;
405
406 for (i = 0; i < ics->num_swb; i++)
407 {
408 if (i+1 == ics->num_swb)
409 {
410 width = (hDecoder->frameLength/8) - swb_offset_128_window[sf_index][i];
411 } else {
412 width = swb_offset_128_window[sf_index][i+1] -
413 swb_offset_128_window[sf_index][i];
414 }
415 width *= ics->window_group_length[g];
416 ics->sect_sfb_offset[g][sect_sfb++] = offset;
417 offset += width;
418 }
419 ics->sect_sfb_offset[g][sect_sfb] = offset;
420 }
421 return 0;
422 default:
423 return 32;
424 }
425 }
426
427 /* iquant() *
428 /* output = sign(input)*abs(input)^(4/3) */
429 /**/
430 static INLINE real_t iquant(int16_t q, const real_t *tab, uint8_t *error)
431 {
432 #ifdef FIXED_POINT
433 /* For FIXED_POINT the iq_table is prescaled by 3 bits (iq_table[]/8) */
434 /* BIG_IQ_TABLE allows you to use the full 8192 value table, if this is not
435 * defined a 1026 value table and interpolation will be used
436 */
437 #ifndef BIG_IQ_TABLE
438 static const real_t errcorr[] = {
439 REAL_CONST(0), REAL_CONST(1.0/8.0), REAL_CONST(2.0/8.0), REAL_CONST(3.0/8.0),
440 REAL_CONST(4.0/8.0), REAL_CONST(5.0/8.0), REAL_CONST(6.0/8.0), REAL_CONST(7.0/8.0),
441 REAL_CONST(0)
442 };
443 real_t x1, x2;
444 #endif
445 int16_t sgn = 1;
446
447 if (q < 0)
448 {
449 q = -q;
450 sgn = -1;
451 }
452
453 if (q < IQ_TABLE_SIZE)
454 {
455 //#define IQUANT_PRINT
456 #ifdef IQUANT_PRINT
457 //printf("0x%.8X\n", sgn * tab[q]);
458 printf("%d\n", sgn * tab[q]);
459 #endif
460 return sgn * tab[q];
461 }
462
463 #ifndef BIG_IQ_TABLE
464 if (q >= 8192)
465 {
466 *error = 17;
467 return 0;
468 }
469
470 /* linear interpolation */
471 x1 = tab[q>>3];
472 x2 = tab[(q>>3) + 1];
473 return sgn * 16 * (MUL_R(errcorr[q&7],(x2-x1)) + x1);
474 #else
475 *error = 17;
476 return 0;
477 #endif
478
479 #else
480 if (q < 0)
481 {
482 /* tab contains a value for all possible q [0,8192] */
483 if (-q < IQ_TABLE_SIZE)
484 return -tab[-q];
485
486 *error = 17;
487 return 0;
488 } else {
489 /* tab contains a value for all possible q [0,8192] */
490 if (q < IQ_TABLE_SIZE)
491 return tab[q];
492
493 *error = 17;
494 return 0;
495 }
496 #endif
497 }
498
499 #ifndef FIXED_POINT
500 ALIGN static const real_t pow2sf_tab[] = {
501 2.9802322387695313E-008, 5.9604644775390625E-008, 1.1920928955078125E-007,
502 2.384185791015625E-007, 4.76837158203125E-007, 9.5367431640625E-007,
503 1.9073486328125E-006, 3.814697265625E-006, 7.62939453125E-006,
504 1.52587890625E-005, 3.0517578125E-005, 6.103515625E-005,
505 0.0001220703125, 0.000244140625, 0.00048828125,
506 0.0009765625, 0.001953125, 0.00390625,
507 0.0078125, 0.015625, 0.03125,
508 0.0625, 0.125, 0.25,
509 0.5, 1.0, 2.0,
510 4.0, 8.0, 16.0, 32.0,
511 64.0, 128.0, 256.0,
512 512.0, 1024.0, 2048.0,
513 4096.0, 8192.0, 16384.0,
514 32768.0, 65536.0, 131072.0,
515 262144.0, 524288.0, 1048576.0,
516 2097152.0, 4194304.0, 8388608.0,
517 16777216.0, 33554432.0, 67108864.0,
518 134217728.0, 268435456.0, 536870912.0,
519 1073741824.0, 2147483648.0, 4294967296.0,
520 8589934592.0, 17179869184.0, 34359738368.0,
521 68719476736.0, 137438953472.0, 274877906944.0
522 };
523 #endif
524
525 /* quant_to_spec: perform dequantisation and scaling
526 * and in case of short block it also does the deinterleaving
527 */
528 /*
529 For ONLY_LONG_SEQUENCE windows (num_window_groups = 1,
530 window_group_length[0] = 1) the spectral data is in ascending spectral
531 order.
532 For the EIGHT_SHORT_SEQUENCE window, the spectral order depends on the
533 grouping in the following manner:
534 - Groups are ordered sequentially
535 - Within a group, a scalefactor band consists of the spectral data of all
536 grouped SHORT_WINDOWs for the associated scalefactor window band. To
537 clarify via example, the length of a group is in the range of one to eight
538 SHORT_WINDOWs.
539 - If there are eight groups each with length one (num_window_groups = 8,
540 window_group_length[0..7] = 1), the result is a sequence of eight spectra,
541 each in ascending spectral order.
542 - If there is only one group with length eight (num_window_groups = 1,
543 window_group_length[0] = 8), the result is that spectral data of all eight
544 SHORT_WINDOWs is interleaved by scalefactor window bands.
545 - Within a scalefactor window band, the coefficients are in ascending
546 spectral order.
547 */
548 static uint8_t quant_to_spec(NeAACDecHandle hDecoder,
549 ic_stream *ics, int16_t *quant_data,
550 real_t *spec_data, uint16_t frame_len)
551 {
552 ALIGN static const real_t pow2_table[] =
553 {
554 COEF_CONST(1.0),
555 COEF_CONST(1.1892071150027210667174999705605), /* 2^0.25 */
556 COEF_CONST(1.4142135623730950488016887242097), /* 2^0.5 */
557 COEF_CONST(1.6817928305074290860622509524664) /* 2^0.75 */
558 };
559 const real_t *tab = iq_table;
560
561 uint8_t g, sfb, win;
562 uint16_t width, bin, k, gindex, wa, wb;
563 uint8_t error = 0; /* Init error flag */
564 #ifndef FIXED_POINT
565 real_t scf;
566 #endif
567
568 k = 0;
569 gindex = 0;
570
571 for (g = 0; g < ics->num_window_groups; g++)
572 {
573 uint16_t j = 0;
574 uint16_t gincrease = 0;
575 uint16_t win_inc = ics->swb_offset[ics->num_swb];
576
577 for (sfb = 0; sfb < ics->num_swb; sfb++)
578 {
579 int32_t exp, frac;
580
581 width = ics->swb_offset[sfb+1] - ics->swb_offset[sfb];
582
583 /* this could be scalefactor for IS or PNS, those can be negative or bigger then 255 */
584 /* just ignore them */
585 if (ics->scale_factors[g][sfb] < 0 || ics->scale_factors[g][sfb] > 255)
586 {
587 exp = 0;
588 frac = 0;
589 } else {
590 /* ics->scale_factors[g][sfb] must be between 0 and 255 */
591 exp = (ics->scale_factors[g][sfb] /* - 100 */) >> 2;
592 /* frac must always be > 0 */
593 frac = (ics->scale_factors[g][sfb] /* - 100 */) & 3;
594 }
595
596 #ifdef FIXED_POINT
597 exp -= 25;
598 /* IMDCT pre-scaling */
599 if (hDecoder->object_type == LD)
600 {
601 exp -= 6 /*9*/;
602 } else {
603 if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
604 exp -= 4 /*7*/;
605 else
606 exp -= 7 /*10*/;
607 }
608 #endif
609
610 wa = gindex + j;
611
612 #ifndef FIXED_POINT
613 scf = pow2sf_tab[exp/*+25*/] * pow2_table[frac];
614 #endif
615
616 for (win = 0; win < ics->window_group_length[g]; win++)
617 {
618 for (bin = 0; bin < width; bin += 4)
619 {
620 #ifndef FIXED_POINT
621 wb = wa + bin;
622
623 spec_data[wb+0] = iquant(quant_data[k+0], tab, &error) * scf;
624 spec_data[wb+1] = iquant(quant_data[k+1], tab, &error) * scf;
625 spec_data[wb+2] = iquant(quant_data[k+2], tab, &error) * scf;
626 spec_data[wb+3] = iquant(quant_data[k+3], tab, &error) * scf;
627
628 #else
629 real_t iq0 = iquant(quant_data[k+0], tab, &error);
630 real_t iq1 = iquant(quant_data[k+1], tab, &error);
631 real_t iq2 = iquant(quant_data[k+2], tab, &error);
632 real_t iq3 = iquant(quant_data[k+3], tab, &error);
633
634 wb = wa + bin;
635
636 if (exp < 0)
637 {
638 spec_data[wb+0] = iq0 >>= -exp;
639 spec_data[wb+1] = iq1 >>= -exp;
640 spec_data[wb+2] = iq2 >>= -exp;
641 spec_data[wb+3] = iq3 >>= -exp;
642 } else {
643 spec_data[wb+0] = iq0 <<= exp;
644 spec_data[wb+1] = iq1 <<= exp;
645 spec_data[wb+2] = iq2 <<= exp;
646 spec_data[wb+3] = iq3 <<= exp;
647 }
648 if (frac != 0)
649 {
650 spec_data[wb+0] = MUL_C(spec_data[wb+0],pow2_table[frac]);
651 spec_data[wb+1] = MUL_C(spec_data[wb+1],pow2_table[frac]);
652 spec_data[wb+2] = MUL_C(spec_data[wb+2],pow2_table[frac]);
653 spec_data[wb+3] = MUL_C(spec_data[wb+3],pow2_table[frac]);
654 }
655
656 //#define SCFS_PRINT
657 #ifdef SCFS_PRINT
658 printf("%d\n", spec_data[gindex+(win*win_inc)+j+bin+0]);
659 printf("%d\n", spec_data[gindex+(win*win_inc)+j+bin+1]);
660 printf("%d\n", spec_data[gindex+(win*win_inc)+j+bin+2]);
661 printf("%d\n", spec_data[gindex+(win*win_inc)+j+bin+3]);
662 //printf("0x%.8X\n", spec_data[gindex+(win*win_inc)+j+bin+0]);
663 //printf("0x%.8X\n", spec_data[gindex+(win*win_inc)+j+bin+1]);
664 //printf("0x%.8X\n", spec_data[gindex+(win*win_inc)+j+bin+2]);
665 //printf("0x%.8X\n", spec_data[gindex+(win*win_inc)+j+bin+3]);
666 #endif
667 #endif
668
669 gincrease += 4;
670 k += 4;
671 }
672 wa += win_inc;
673 }
674 j += width;
675 }
676 gindex += gincrease;
677 }
678
679 return error;
680 }
681
682 static uint8_t allocate_single_channel(NeAACDecHandle hDecoder, uint8_t channel,
683 uint8_t output_channels)
684 {
685 int mul = 1;
686
687 #ifdef MAIN_DEC
688 /* MAIN object type prediction */
689 if (hDecoder->object_type == MAIN)
690 {
691 /* allocate the state only when needed */
692 if (hDecoder->pred_stat[channel] != NULL)
693 {
694 faad_free(hDecoder->pred_stat[channel]);
695 hDecoder->pred_stat[channel] = NULL;
696 }
697
698 hDecoder->pred_stat[channel] = (pred_state*)faad_malloc(hDecoder->frameLength * sizeof(pred_state));
699 reset_all_predictors(hDecoder->pred_stat[channel], hDecoder->frameLength);
700 }
701 #endif
702
703 #ifdef LTP_DEC
704 if (is_ltp_ot(hDecoder->object_type))
705 {
706 /* allocate the state only when needed */
707 if (hDecoder->lt_pred_stat[channel] != NULL)
708 {
709 faad_free(hDecoder->lt_pred_stat[channel]);
710 hDecoder->lt_pred_stat[channel] = NULL;
711 }
712
713 hDecoder->lt_pred_stat[channel] = (int16_t*)faad_malloc(hDecoder->frameLength*4 * sizeof(int16_t));
714 memset(hDecoder->lt_pred_stat[channel], 0, hDecoder->frameLength*4 * sizeof(int16_t));
715 }
716 #endif
717
718 if (hDecoder->time_out[channel] != NULL)
719 {
720 faad_free(hDecoder->time_out[channel]);
721 hDecoder->time_out[channel] = NULL;
722 }
723
724 {
725 mul = 1;
726 #ifdef SBR_DEC
727 hDecoder->sbr_alloced[hDecoder->fr_ch_ele] = 0;
728 if ((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
729 {
730 /* SBR requires 2 times as much output data */
731 mul = 2;
732 hDecoder->sbr_alloced[hDecoder->fr_ch_ele] = 1;
733 }
734 #endif
735 hDecoder->time_out[channel] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t));
736 memset(hDecoder->time_out[channel], 0, mul*hDecoder->frameLength*sizeof(real_t));
737 }
738
739 #if (defined(PS_DEC) || defined(DRM_PS))
740 if (output_channels == 2)
741 {
742 if (hDecoder->time_out[channel+1] != NULL)
743 {
744 faad_free(hDecoder->time_out[channel+1]);
745 hDecoder->time_out[channel+1] = NULL;
746 }
747
748 hDecoder->time_out[channel+1] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t));
749 memset(hDecoder->time_out[channel+1], 0, mul*hDecoder->frameLength*sizeof(real_t));
750 }
751 #endif
752
753 if (hDecoder->fb_intermed[channel] != NULL)
754 {
755 faad_free(hDecoder->fb_intermed[channel]);
756 hDecoder->fb_intermed[channel] = NULL;
757 }
758
759 hDecoder->fb_intermed[channel] = (real_t*)faad_malloc(hDecoder->frameLength*sizeof(real_t));
760 memset(hDecoder->fb_intermed[channel], 0, hDecoder->frameLength*sizeof(real_t));
761
762 #ifdef SSR_DEC
763 if (hDecoder->object_type == SSR)
764 {
765 if (hDecoder->ssr_overlap[channel] == NULL)
766 {
767 hDecoder->ssr_overlap[channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t));
768 memset(hDecoder->ssr_overlap[channel], 0, 2*hDecoder->frameLength*sizeof(real_t));
769 }
770 if (hDecoder->prev_fmd[channel] == NULL)
771 {
772 uint16_t k;
773 hDecoder->prev_fmd[channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t));
774 for (k = 0; k < 2*hDecoder->frameLength; k++)
775 hDecoder->prev_fmd[channel][k] = REAL_CONST(-1);
776 }
777 }
778 #endif
779
780 return 0;
781 }
782
783 static uint8_t allocate_channel_pair(NeAACDecHandle hDecoder,
784 uint8_t channel, uint8_t paired_channel)
785 {
786 int mul = 1;
787
788 #ifdef MAIN_DEC
789 /* MAIN object type prediction */
790 if (hDecoder->object_type == MAIN)
791 {
792 /* allocate the state only when needed */
793 if (hDecoder->pred_stat[channel] == NULL)
794 {
795 hDecoder->pred_stat[channel] = (pred_state*)faad_malloc(hDecoder->frameLength * sizeof(pred_state));
796 reset_all_predictors(hDecoder->pred_stat[channel], hDecoder->frameLength);
797 }
798 if (hDecoder->pred_stat[paired_channel] == NULL)
799 {
800 hDecoder->pred_stat[paired_channel] = (pred_state*)faad_malloc(hDecoder->frameLength * sizeof(pred_state));
801 reset_all_predictors(hDecoder->pred_stat[paired_channel], hDecoder->frameLength);
802 }
803 }
804 #endif
805
806 #ifdef LTP_DEC
807 if (is_ltp_ot(hDecoder->object_type))
808 {
809 /* allocate the state only when needed */
810 if (hDecoder->lt_pred_stat[channel] == NULL)
811 {
812 hDecoder->lt_pred_stat[channel] = (int16_t*)faad_malloc(hDecoder->frameLength*4 * sizeof(int16_t));
813 memset(hDecoder->lt_pred_stat[channel], 0, hDecoder->frameLength*4 * sizeof(int16_t));
814 }
815 if (hDecoder->lt_pred_stat[paired_channel] == NULL)
816 {
817 hDecoder->lt_pred_stat[paired_channel] = (int16_t*)faad_malloc(hDecoder->frameLength*4 * sizeof(int16_t));
818 memset(hDecoder->lt_pred_stat[paired_channel], 0, hDecoder->frameLength*4 * sizeof(int16_t));
819 }
820 }
821 #endif
822
823 if (hDecoder->time_out[channel] == NULL)
824 {
825 mul = 1;
826 #ifdef SBR_DEC
827 hDecoder->sbr_alloced[hDecoder->fr_ch_ele] = 0;
828 if ((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
829 {
830 /* SBR requires 2 times as much output data */
831 mul = 2;
832 hDecoder->sbr_alloced[hDecoder->fr_ch_ele] = 1;
833 }
834 #endif
835 hDecoder->time_out[channel] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t));
836 memset(hDecoder->time_out[channel], 0, mul*hDecoder->frameLength*sizeof(real_t));
837 }
838 if (hDecoder->time_out[paired_channel] == NULL)
839 {
840 hDecoder->time_out[paired_channel] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t));
841 memset(hDecoder->time_out[paired_channel], 0, mul*hDecoder->frameLength*sizeof(real_t));
842 }
843
844 if (hDecoder->fb_intermed[channel] == NULL)
845 {
846 hDecoder->fb_intermed[channel] = (real_t*)faad_malloc(hDecoder->frameLength*sizeof(real_t));
847 memset(hDecoder->fb_intermed[channel], 0, hDecoder->frameLength*sizeof(real_t));
848 }
849 if (hDecoder->fb_intermed[paired_channel] == NULL)
850 {
851 hDecoder->fb_intermed[paired_channel] = (real_t*)faad_malloc(hDecoder->frameLength*sizeof(real_t));
852 memset(hDecoder->fb_intermed[paired_channel], 0, hDecoder->frameLength*sizeof(real_t));
853 }
854
855 #ifdef SSR_DEC
856 if (hDecoder->object_type == SSR)
857 {
858 if (hDecoder->ssr_overlap[cpe->channel] == NULL)
859 {
860 hDecoder->ssr_overlap[cpe->channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t));
861 memset(hDecoder->ssr_overlap[cpe->channel], 0, 2*hDecoder->frameLength*sizeof(real_t));
862 }
863 if (hDecoder->ssr_overlap[cpe->paired_channel] == NULL)
864 {
865 hDecoder->ssr_overlap[cpe->paired_channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t));
866 memset(hDecoder->ssr_overlap[cpe->paired_channel], 0, 2*hDecoder->frameLength*sizeof(real_t));
867 }
868 if (hDecoder->prev_fmd[cpe->channel] == NULL)
869 {
870 uint16_t k;
871 hDecoder->prev_fmd[cpe->channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t));
872 for (k = 0; k < 2*hDecoder->frameLength; k++)
873 hDecoder->prev_fmd[cpe->channel][k] = REAL_CONST(-1);
874 }
875 if (hDecoder->prev_fmd[cpe->paired_channel] == NULL)
876 {
877 uint16_t k;
878 hDecoder->prev_fmd[cpe->paired_channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t));
879 for (k = 0; k < 2*hDecoder->frameLength; k++)
880 hDecoder->prev_fmd[cpe->paired_channel][k] = REAL_CONST(-1);
881 }
882 }
883 #endif
884
885 return 0;
886 }
887
888 uint8_t reconstruct_single_channel(NeAACDecHandle hDecoder, ic_stream *ics,
889 element *sce, int16_t *spec_data)
890 {
891 uint8_t retval;
892 int output_channels;
893 ALIGN real_t spec_coef[1024];
894
895 #ifdef PROFILE
896 int64_t count = faad_get_ts();
897 #endif
898
899
900 /* always allocate 2 channels, PS can always "suddenly" turn up */
901 #if ( (defined(DRM) && defined(DRM_PS)) )
902 output_channels = 2;
903 #elif defined(PS_DEC)
904 if (hDecoder->ps_used[hDecoder->fr_ch_ele])
905 output_channels = 2;
906 else
907 output_channels = 1;
908 #else
909 output_channels = 1;
910 #endif
911
912 if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 0)
913 {
914 /* element_output_channels not set yet */
915 hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels;
916 } else if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] != output_channels) {
917 /* element inconsistency */
918
919 /* this only happens if PS is actually found but not in the first frame
920 * this means that there is only 1 bitstream element!
921 */
922
923 /* reset the allocation */
924 hDecoder->element_alloced[hDecoder->fr_ch_ele] = 0;
925
926 hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels;
927
928 //return 21;
929 }
930
931 if (hDecoder->element_alloced[hDecoder->fr_ch_ele] == 0)
932 {
933 retval = allocate_single_channel(hDecoder, sce->channel, output_channels);
934 if (retval > 0)
935 return retval;
936
937 hDecoder->element_alloced[hDecoder->fr_ch_ele] = 1;
938 }
939
940
941 /* dequantisation and scaling */
942 retval = quant_to_spec(hDecoder, ics, spec_data, spec_coef, hDecoder->frameLength);
943 if (retval > 0)
944 return retval;
945
946 #ifdef PROFILE
947 count = faad_get_ts() - count;
948 hDecoder->requant_cycles += count;
949 #endif
950
951
952 /* pns decoding */
953 pns_decode(ics, NULL, spec_coef, NULL, hDecoder->frameLength, 0, hDecoder->object_type,
954 &(hDecoder->__r1), &(hDecoder->__r2));
955
956 #ifdef MAIN_DEC
957 /* MAIN object type prediction */
958 if (hDecoder->object_type == MAIN)
959 {
960 /* intra channel prediction */
961 ic_prediction(ics, spec_coef, hDecoder->pred_stat[sce->channel], hDecoder->frameLength,
962 hDecoder->sf_index);
963
964 /* In addition, for scalefactor bands coded by perceptual
965 noise substitution the predictors belonging to the
966 corresponding spectral coefficients are reset.
967 */
968 pns_reset_pred_state(ics, hDecoder->pred_stat[sce->channel]);
969 }
970 #endif
971
972 #ifdef LTP_DEC
973 if (is_ltp_ot(hDecoder->object_type))
974 {
975 #ifdef LD_DEC
976 if (hDecoder->object_type == LD)
977 {
978 if (ics->ltp.data_present)
979 {
980 if (ics->ltp.lag_update)
981 hDecoder->ltp_lag[sce->channel] = ics->ltp.lag;
982 }
983 ics->ltp.lag = hDecoder->ltp_lag[sce->channel];
984 }
985 #endif
986
987 /* long term prediction */
988 lt_prediction(ics, &(ics->ltp), spec_coef, hDecoder->lt_pred_stat[sce->channel], hDecoder->fb,
989 ics->window_shape, hDecoder->window_shape_prev[sce->channel],
990 hDecoder->sf_index, hDecoder->object_type, hDecoder->frameLength);
991 }
992 #endif
993
994 /* tns decoding */
995 tns_decode_frame(ics, &(ics->tns), hDecoder->sf_index, hDecoder->object_type,
996 spec_coef, hDecoder->frameLength);
997
998 /* drc decoding */
999 if (hDecoder->drc->present)
1000 {
1001 if (!hDecoder->drc->exclude_mask[sce->channel] || !hDecoder->drc->excluded_chns_present)
1002 drc_decode(hDecoder->drc, spec_coef);
1003 }
1004
1005 /* filter bank */
1006 #ifdef SSR_DEC
1007 if (hDecoder->object_type != SSR)
1008 {
1009 #endif
1010 ifilter_bank(hDecoder->fb, ics->window_sequence, ics->window_shape,
1011 hDecoder->window_shape_prev[sce->channel], spec_coef,
1012 hDecoder->time_out[sce->channel], hDecoder->fb_intermed[sce->channel],
1013 hDecoder->object_type, hDecoder->frameLength);
1014 #ifdef SSR_DEC
1015 } else {
1016 ssr_decode(&(ics->ssr), hDecoder->fb, ics->window_sequence, ics->window_shape,
1017 hDecoder->window_shape_prev[sce->channel], spec_coef, hDecoder->time_out[sce->channel],
1018 hDecoder->ssr_overlap[sce->channel], hDecoder->ipqf_buffer[sce->channel], hDecoder->prev_fmd[sce->channel],
1019 hDecoder->frameLength);
1020 }
1021 #endif
1022
1023 /* save window shape for next frame */
1024 hDecoder->window_shape_prev[sce->channel] = ics->window_shape;
1025
1026 #ifdef LTP_DEC
1027 if (is_ltp_ot(hDecoder->object_type))
1028 {
1029 lt_update_state(hDecoder->lt_pred_stat[sce->channel], hDecoder->time_out[sce->channel],
1030 hDecoder->fb_intermed[sce->channel], hDecoder->frameLength, hDecoder->object_type);
1031 }
1032 #endif
1033
1034 #ifdef SBR_DEC
1035 if (((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
1036 && hDecoder->sbr_alloced[hDecoder->fr_ch_ele])
1037 {
1038 int ele = hDecoder->fr_ch_ele;
1039 int ch = sce->channel;
1040
1041 /* following case can happen when forceUpSampling == 1 */
1042 if (hDecoder->sbr[ele] == NULL)
1043 {
1044 hDecoder->sbr[ele] = sbrDecodeInit(hDecoder->frameLength,
1045 hDecoder->element_id[ele], 2*get_sample_rate(hDecoder->sf_index),
1046 hDecoder->downSampledSBR
1047 #ifdef DRM
1048 , 0
1049 #endif
1050 );
1051 }
1052
1053 if (sce->ics1.window_sequence == EIGHT_SHORT_SEQUENCE)
1054 hDecoder->sbr[ele]->maxAACLine = 8*min(sce->ics1.swb_offset[max(sce->ics1.max_sfb-1, 0)], sce->ics1.swb_offset_max);
1055 else
1056 hDecoder->sbr[ele]->maxAACLine = min(sce->ics1.swb_offset[max(sce->ics1.max_sfb-1, 0)], sce->ics1.swb_offset_max);
1057
1058 /* check if any of the PS tools is used */
1059 #if (defined(PS_DEC) || defined(DRM_PS))
1060 if (hDecoder->ps_used[ele] == 0)
1061 {
1062 #endif
1063 retval = sbrDecodeSingleFrame(hDecoder->sbr[ele], hDecoder->time_out[ch],
1064 hDecoder->postSeekResetFlag, hDecoder->downSampledSBR);
1065 #if (defined(PS_DEC) || defined(DRM_PS))
1066 } else {
1067 retval = sbrDecodeSingleFramePS(hDecoder->sbr[ele], hDecoder->time_out[ch],
1068 hDecoder->time_out[ch+1], hDecoder->postSeekResetFlag,
1069 hDecoder->downSampledSBR);
1070 }
1071 #endif
1072 if (retval > 0)
1073 return retval;
1074 } else if (((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
1075 && !hDecoder->sbr_alloced[hDecoder->fr_ch_ele])
1076 {
1077 return 23;
1078 }
1079 #endif
1080
1081 /* copy L to R when no PS is used */
1082 #if (defined(PS_DEC) || defined(DRM_PS))
1083 if ((hDecoder->ps_used[hDecoder->fr_ch_ele] == 0) &&
1084 (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 2))
1085 {
1086 int ele = hDecoder->fr_ch_ele;
1087 int ch = sce->channel;
1088 int frame_size = (hDecoder->sbr_alloced[ele]) ? 2 : 1;
1089 frame_size *= hDecoder->frameLength*sizeof(real_t);
1090
1091 memcpy(hDecoder->time_out[ch+1], hDecoder->time_out[ch], frame_size);
1092 }
1093 #endif
1094
1095 return 0;
1096 }
1097
1098 uint8_t reconstruct_channel_pair(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2,
1099 element *cpe, int16_t *spec_data1, int16_t *spec_data2)
1100 {
1101 uint8_t retval;
1102 ALIGN real_t spec_coef1[1024];
1103 ALIGN real_t spec_coef2[1024];
1104
1105 #ifdef PROFILE
1106 int64_t count = faad_get_ts();
1107 #endif
1108 if (hDecoder->element_alloced[hDecoder->fr_ch_ele] == 0)
1109 {
1110 retval = allocate_channel_pair(hDecoder, cpe->channel, (uint8_t)cpe->paired_channel);
1111 if (retval > 0)
1112 return retval;
1113
1114 hDecoder->element_alloced[hDecoder->fr_ch_ele] = 1;
1115 }
1116
1117 /* dequantisation and scaling */
1118 retval = quant_to_spec(hDecoder, ics1, spec_data1, spec_coef1, hDecoder->frameLength);
1119 if (retval > 0)
1120 return retval;
1121 retval = quant_to_spec(hDecoder, ics2, spec_data2, spec_coef2, hDecoder->frameLength);
1122 if (retval > 0)
1123 return retval;
1124
1125 #ifdef PROFILE
1126 count = faad_get_ts() - count;
1127 hDecoder->requant_cycles += count;
1128 #endif
1129
1130
1131 /* pns decoding */
1132 if (ics1->ms_mask_present)
1133 {
1134 pns_decode(ics1, ics2, spec_coef1, spec_coef2, hDecoder->frameLength, 1, hDecoder->object_type,
1135 &(hDecoder->__r1), &(hDecoder->__r2));
1136 } else {
1137 pns_decode(ics1, NULL, spec_coef1, NULL, hDecoder->frameLength, 0, hDecoder->object_type,
1138 &(hDecoder->__r1), &(hDecoder->__r2));
1139 pns_decode(ics2, NULL, spec_coef2, NULL, hDecoder->frameLength, 0, hDecoder->object_type,
1140 &(hDecoder->__r1), &(hDecoder->__r2));
1141 }
1142
1143 /* mid/side decoding */
1144 ms_decode(ics1, ics2, spec_coef1, spec_coef2, hDecoder->frameLength);
1145
1146 #if 0
1147 {
1148 int i;
1149 for (i = 0; i < 1024; i++)
1150 {
1151 //printf("%d\n", spec_coef1[i]);
1152 printf("0x%.8X\n", spec_coef1[i]);
1153 }
1154 for (i = 0; i < 1024; i++)
1155 {
1156 //printf("%d\n", spec_coef2[i]);
1157 printf("0x%.8X\n", spec_coef2[i]);
1158 }
1159 }
1160 #endif
1161
1162 /* intensity stereo decoding */
1163 is_decode(ics1, ics2, spec_coef1, spec_coef2, hDecoder->frameLength);
1164
1165 #if 0
1166 {
1167 int i;
1168 for (i = 0; i < 1024; i++)
1169 {
1170 printf("%d\n", spec_coef1[i]);
1171 //printf("0x%.8X\n", spec_coef1[i]);
1172 }
1173 for (i = 0; i < 1024; i++)
1174 {
1175 printf("%d\n", spec_coef2[i]);
1176 //printf("0x%.8X\n", spec_coef2[i]);
1177 }
1178 }
1179 #endif
1180
1181 #ifdef MAIN_DEC
1182 /* MAIN object type prediction */
1183 if (hDecoder->object_type == MAIN)
1184 {
1185 /* intra channel prediction */
1186 ic_prediction(ics1, spec_coef1, hDecoder->pred_stat[cpe->channel], hDecoder->frameLength,
1187 hDecoder->sf_index);
1188 ic_prediction(ics2, spec_coef2, hDecoder->pred_stat[cpe->paired_channel], hDecoder->frameLength,
1189 hDecoder->sf_index);
1190
1191 /* In addition, for scalefactor bands coded by perceptual
1192 noise substitution the predictors belonging to the
1193 corresponding spectral coefficients are reset.
1194 */
1195 pns_reset_pred_state(ics1, hDecoder->pred_stat[cpe->channel]);
1196 pns_reset_pred_state(ics2, hDecoder->pred_stat[cpe->paired_channel]);
1197 }
1198 #endif
1199
1200 #ifdef LTP_DEC
1201 if (is_ltp_ot(hDecoder->object_type))
1202 {
1203 ltp_info *ltp1 = &(ics1->ltp);
1204 ltp_info *ltp2 = (cpe->common_window) ? &(ics2->ltp2) : &(ics2->ltp);
1205 #ifdef LD_DEC
1206 if (hDecoder->object_type == LD)
1207 {
1208 if (ltp1->data_present)
1209 {
1210 if (ltp1->lag_update)
1211 hDecoder->ltp_lag[cpe->channel] = ltp1->lag;
1212 }
1213 ltp1->lag = hDecoder->ltp_lag[cpe->channel];
1214 if (ltp2->data_present)
1215 {
1216 if (ltp2->lag_update)
1217 hDecoder->ltp_lag[cpe->paired_channel] = ltp2->lag;
1218 }
1219 ltp2->lag = hDecoder->ltp_lag[cpe->paired_channel];
1220 }
1221 #endif
1222
1223 /* long term prediction */
1224 lt_prediction(ics1, ltp1, spec_coef1, hDecoder->lt_pred_stat[cpe->channel], hDecoder->fb,
1225 ics1->window_shape, hDecoder->window_shape_prev[cpe->channel],
1226 hDecoder->sf_index, hDecoder->object_type, hDecoder->frameLength);
1227 lt_prediction(ics2, ltp2, spec_coef2, hDecoder->lt_pred_stat[cpe->paired_channel], hDecoder->fb,
1228 ics2->window_shape, hDecoder->window_shape_prev[cpe->paired_channel],
1229 hDecoder->sf_index, hDecoder->object_type, hDecoder->frameLength);
1230 }
1231 #endif
1232
1233 /* tns decoding */
1234 tns_decode_frame(ics1, &(ics1->tns), hDecoder->sf_index, hDecoder->object_type,
1235 spec_coef1, hDecoder->frameLength);
1236 tns_decode_frame(ics2, &(ics2->tns), hDecoder->sf_index, hDecoder->object_type,
1237 spec_coef2, hDecoder->frameLength);
1238
1239 /* drc decoding */
1240 if (hDecoder->drc->present)
1241 {
1242 if (!hDecoder->drc->exclude_mask[cpe->channel] || !hDecoder->drc->excluded_chns_present)
1243 drc_decode(hDecoder->drc, spec_coef1);
1244 if (!hDecoder->drc->exclude_mask[cpe->paired_channel] || !hDecoder->drc->excluded_chns_present)
1245 drc_decode(hDecoder->drc, spec_coef2);
1246 }
1247
1248 /* filter bank */
1249 #ifdef SSR_DEC
1250 if (hDecoder->object_type != SSR)
1251 {
1252 #endif
1253 ifilter_bank(hDecoder->fb, ics1->window_sequence, ics1->window_shape,
1254 hDecoder->window_shape_prev[cpe->channel], spec_coef1,
1255 hDecoder->time_out[cpe->channel], hDecoder->fb_intermed[cpe->channel],
1256 hDecoder->object_type, hDecoder->frameLength);
1257 ifilter_bank(hDecoder->fb, ics2->window_sequence, ics2->window_shape,
1258 hDecoder->window_shape_prev[cpe->paired_channel], spec_coef2,
1259 hDecoder->time_out[cpe->paired_channel], hDecoder->fb_intermed[cpe->paired_channel],
1260 hDecoder->object_type, hDecoder->frameLength);
1261 #ifdef SSR_DEC
1262 } else {
1263 ssr_decode(&(ics1->ssr), hDecoder->fb, ics1->window_sequence, ics1->window_shape,
1264 hDecoder->window_shape_prev[cpe->channel], spec_coef1, hDecoder->time_out[cpe->channel],
1265 hDecoder->ssr_overlap[cpe->channel], hDecoder->ipqf_buffer[cpe->channel],
1266 hDecoder->prev_fmd[cpe->channel], hDecoder->frameLength);
1267 ssr_decode(&(ics2->ssr), hDecoder->fb, ics2->window_sequence, ics2->window_shape,
1268 hDecoder->window_shape_prev[cpe->paired_channel], spec_coef2, hDecoder->time_out[cpe->paired_channel],
1269 hDecoder->ssr_overlap[cpe->paired_channel], hDecoder->ipqf_buffer[cpe->paired_channel],
1270 hDecoder->prev_fmd[cpe->paired_channel], hDecoder->frameLength);
1271 }
1272 #endif
1273
1274 /* save window shape for next frame */
1275 hDecoder->window_shape_prev[cpe->channel] = ics1->window_shape;
1276 hDecoder->window_shape_prev[cpe->paired_channel] = ics2->window_shape;
1277
1278 #ifdef LTP_DEC
1279 if (is_ltp_ot(hDecoder->object_type))
1280 {
1281 lt_update_state(hDecoder->lt_pred_stat[cpe->channel], hDecoder->time_out[cpe->channel],
1282 hDecoder->fb_intermed[cpe->channel], hDecoder->frameLength, hDecoder->object_type);
1283 lt_update_state(hDecoder->lt_pred_stat[cpe->paired_channel], hDecoder->time_out[cpe->paired_channel],
1284 hDecoder->fb_intermed[cpe->paired_channel], hDecoder->frameLength, hDecoder->object_type);
1285 }
1286 #endif
1287
1288 #ifdef SBR_DEC
1289 if (((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
1290 && hDecoder->sbr_alloced[hDecoder->fr_ch_ele])
1291 {
1292 int ele = hDecoder->fr_ch_ele;
1293 int ch0 = cpe->channel;
1294 int ch1 = cpe->paired_channel;
1295
1296 /* following case can happen when forceUpSampling == 1 */
1297 if (hDecoder->sbr[ele] == NULL)
1298 {
1299 hDecoder->sbr[ele] = sbrDecodeInit(hDecoder->frameLength,
1300 hDecoder->element_id[ele], 2*get_sample_rate(hDecoder->sf_index),
1301 hDecoder->downSampledSBR
1302 #ifdef DRM
1303 , 0
1304 #endif
1305 );
1306 }
1307
1308 if (cpe->ics1.window_sequence == EIGHT_SHORT_SEQUENCE)
1309 hDecoder->sbr[ele]->maxAACLine = 8*min(cpe->ics1.swb_offset[max(cpe->ics1.max_sfb-1, 0)], cpe->ics1.swb_offset_max);
1310 else
1311 hDecoder->sbr[ele]->maxAACLine = min(cpe->ics1.swb_offset[max(cpe->ics1.max_sfb-1, 0)], cpe->ics1.swb_offset_max);
1312
1313 retval = sbrDecodeCoupleFrame(hDecoder->sbr[ele],
1314 hDecoder->time_out[ch0], hDecoder->time_out[ch1],
1315 hDecoder->postSeekResetFlag, hDecoder->downSampledSBR);
1316 if (retval > 0)
1317 return retval;
1318 } else if (((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
1319 && !hDecoder->sbr_alloced[hDecoder->fr_ch_ele])
1320 {
1321 return 23;
1322 }
1323 #endif
1324
1325 return 0;
1326 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: specrec.h,v 1.32 2007/11/01 12:33:36 menno Exp $
28 **/
29
30 #ifndef __SPECREC_H__
31 #define __SPECREC_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #include "syntax.h"
38
39 uint8_t window_grouping_info(NeAACDecHandle hDecoder, ic_stream *ics);
40 uint8_t reconstruct_channel_pair(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2,
41 element *cpe, int16_t *spec_data1, int16_t *spec_data2);
42 uint8_t reconstruct_single_channel(NeAACDecHandle hDecoder, ic_stream *ics, element *sce,
43 int16_t *spec_data);
44
45 #ifdef __cplusplus
46 }
47 #endif
48 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: ssr.c,v 1.19 2007/11/01 12:33:36 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #ifdef SSR_DEC
34
35 #include "syntax.h"
36 #include "filtbank.h"
37 #include "ssr.h"
38 #include "ssr_fb.h"
39
40 void ssr_decode(ssr_info *ssr, fb_info *fb, uint8_t window_sequence,
41 uint8_t window_shape, uint8_t window_shape_prev,
42 real_t *freq_in, real_t *time_out, real_t *overlap,
43 real_t ipqf_buffer[SSR_BANDS][96/4],
44 real_t *prev_fmd, uint16_t frame_len)
45 {
46 uint8_t band;
47 uint16_t ssr_frame_len = frame_len/SSR_BANDS;
48 real_t time_tmp[2048] = {0};
49 real_t output[1024] = {0};
50
51 for (band = 0; band < SSR_BANDS; band++)
52 {
53 int16_t j;
54
55 /* uneven bands have inverted frequency scale */
56 if (band == 1 || band == 3)
57 {
58 for (j = 0; j < ssr_frame_len/2; j++)
59 {
60 real_t tmp;
61 tmp = freq_in[j + ssr_frame_len*band];
62 freq_in[j + ssr_frame_len*band] =
63 freq_in[ssr_frame_len - j - 1 + ssr_frame_len*band];
64 freq_in[ssr_frame_len - j - 1 + ssr_frame_len*band] = tmp;
65 }
66 }
67
68 /* non-overlapping inverse filterbank for SSR */
69 ssr_ifilter_bank(fb, window_sequence, window_shape, window_shape_prev,
70 freq_in + band*ssr_frame_len, time_tmp + band*ssr_frame_len,
71 ssr_frame_len);
72
73 /* gain control */
74 ssr_gain_control(ssr, time_tmp, output, overlap, prev_fmd,
75 band, window_sequence, ssr_frame_len);
76 }
77
78 /* inverse pqf to bring subbands together again */
79 ssr_ipqf(ssr, output, time_out, ipqf_buffer, frame_len, SSR_BANDS);
80 }
81
82 static void ssr_gain_control(ssr_info *ssr, real_t *data, real_t *output,
83 real_t *overlap, real_t *prev_fmd, uint8_t band,
84 uint8_t window_sequence, uint16_t frame_len)
85 {
86 uint16_t i;
87 real_t gc_function[2*1024/SSR_BANDS];
88
89 if (window_sequence != EIGHT_SHORT_SEQUENCE)
90 {
91 ssr_gc_function(ssr, &prev_fmd[band * frame_len*2],
92 gc_function, window_sequence, band, frame_len);
93
94 for (i = 0; i < frame_len*2; i++)
95 data[band * frame_len*2 + i] *= gc_function[i];
96 for (i = 0; i < frame_len; i++)
97 {
98 output[band*frame_len + i] = overlap[band*frame_len + i] +
99 data[band*frame_len*2 + i];
100 }
101 for (i = 0; i < frame_len; i++)
102 {
103 overlap[band*frame_len + i] =
104 data[band*frame_len*2 + frame_len + i];
105 }
106 } else {
107 uint8_t w;
108 for (w = 0; w < 8; w++)
109 {
110 uint16_t frame_len8 = frame_len/8;
111 uint16_t frame_len16 = frame_len/16;
112
113 ssr_gc_function(ssr, &prev_fmd[band*frame_len*2 + w*frame_len*2/8],
114 gc_function, window_sequence, frame_len);
115
116 for (i = 0; i < frame_len8*2; i++)
117 data[band*frame_len*2 + w*frame_len8*2+i] *= gc_function[i];
118 for (i = 0; i < frame_len8; i++)
119 {
120 overlap[band*frame_len + i + 7*frame_len16 + w*frame_len8] +=
121 data[band*frame_len*2 + 2*w*frame_len8 + i];
122 }
123 for (i = 0; i < frame_len8; i++)
124 {
125 overlap[band*frame_len + i + 7*frame_len16 + (w+1)*frame_len8] =
126 data[band*frame_len*2 + 2*w*frame_len8 + frame_len8 + i];
127 }
128 }
129 for (i = 0; i < frame_len; i++)
130 output[band*frame_len + i] = overlap[band*frame_len + i];
131 for (i = 0; i < frame_len; i++)
132 overlap[band*frame_len + i] = overlap[band*frame_len + i + frame_len];
133 }
134 }
135
136 static void ssr_gc_function(ssr_info *ssr, real_t *prev_fmd,
137 real_t *gc_function, uint8_t window_sequence,
138 uint8_t band, uint16_t frame_len)
139 {
140 uint16_t i;
141 uint16_t len_area1, len_area2;
142 int32_t aloc[10];
143 real_t alev[10];
144
145 switch (window_sequence)
146 {
147 case ONLY_LONG_SEQUENCE:
148 len_area1 = frame_len/SSR_BANDS;
149 len_area2 = 0;
150 break;
151 case LONG_START_SEQUENCE:
152 len_area1 = (frame_len/SSR_BANDS)*7/32;
153 len_area2 = (frame_len/SSR_BANDS)/16;
154 break;
155 case EIGHT_SHORT_SEQUENCE:
156 len_area1 = (frame_len/8)/SSR_BANDS;
157 len_area2 = 0;
158 break;
159 case LONG_STOP_SEQUENCE:
160 len_area1 = (frame_len/SSR_BANDS);
161 len_area2 = 0;
162 break;
163 }
164
165 /* decode bitstream information */
166
167 /* build array M */
168
169
170 for (i = 0; i < frame_len*2; i++)
171 gc_function[i] = 1;
172 }
173
174 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: ssr.h,v 1.19 2007/11/01 12:33:36 menno Exp $
28 **/
29
30 #ifndef __SSR_H__
31 #define __SSR_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #define SSR_BANDS 4
38 #define PQFTAPS 96
39
40 void ssr_decode(ssr_info *ssr, fb_info *fb, uint8_t window_sequence,
41 uint8_t window_shape, uint8_t window_shape_prev,
42 real_t *freq_in, real_t *time_out, real_t *overlap,
43 real_t ipqf_buffer[SSR_BANDS][96/4],
44 real_t *prev_fmd, uint16_t frame_len);
45
46
47 static void ssr_gain_control(ssr_info *ssr, real_t *data, real_t *output,
48 real_t *overlap, real_t *prev_fmd, uint8_t band,
49 uint8_t window_sequence, uint16_t frame_len);
50 static void ssr_gc_function(ssr_info *ssr, real_t *prev_fmd,
51 real_t *gc_function, uint8_t window_sequence,
52 uint16_t frame_len);
53
54
55 #ifdef __cplusplus
56 }
57 #endif
58 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: ssr_fb.c,v 1.17 2007/11/01 12:33:36 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #ifdef SSR_DEC
34
35 #include <string.h>
36 #include <stdlib.h>
37 #include "syntax.h"
38 #include "filtbank.h"
39 #include "mdct.h"
40 #include "ssr_fb.h"
41 #include "ssr_win.h"
42
43 fb_info *ssr_filter_bank_init(uint16_t frame_len)
44 {
45 uint16_t nshort = frame_len/8;
46
47 fb_info *fb = (fb_info*)faad_malloc(sizeof(fb_info));
48 memset(fb, 0, sizeof(fb_info));
49
50 /* normal */
51 fb->mdct256 = faad_mdct_init(2*nshort);
52 fb->mdct2048 = faad_mdct_init(2*frame_len);
53
54 fb->long_window[0] = sine_long_256;
55 fb->short_window[0] = sine_short_32;
56 fb->long_window[1] = kbd_long_256;
57 fb->short_window[1] = kbd_short_32;
58
59 return fb;
60 }
61
62 void ssr_filter_bank_end(fb_info *fb)
63 {
64 faad_mdct_end(fb->mdct256);
65 faad_mdct_end(fb->mdct2048);
66
67 if (fb) faad_free(fb);
68 }
69
70 static INLINE void imdct_ssr(fb_info *fb, real_t *in_data,
71 real_t *out_data, uint16_t len)
72 {
73 mdct_info *mdct;
74
75 switch (len)
76 {
77 case 512:
78 mdct = fb->mdct2048;
79 break;
80 case 64:
81 mdct = fb->mdct256;
82 break;
83 }
84
85 faad_imdct(mdct, in_data, out_data);
86 }
87
88 /* NON-overlapping inverse filterbank for use with SSR */
89 void ssr_ifilter_bank(fb_info *fb, uint8_t window_sequence, uint8_t window_shape,
90 uint8_t window_shape_prev, real_t *freq_in,
91 real_t *time_out, uint16_t frame_len)
92 {
93 int16_t i;
94 real_t *transf_buf;
95
96 real_t *window_long;
97 real_t *window_long_prev;
98 real_t *window_short;
99 real_t *window_short_prev;
100
101 uint16_t nlong = frame_len;
102 uint16_t nshort = frame_len/8;
103 uint16_t trans = nshort/2;
104
105 uint16_t nflat_ls = (nlong-nshort)/2;
106
107 transf_buf = (real_t*)faad_malloc(2*nlong*sizeof(real_t));
108
109 window_long = fb->long_window[window_shape];
110 window_long_prev = fb->long_window[window_shape_prev];
111 window_short = fb->short_window[window_shape];
112 window_short_prev = fb->short_window[window_shape_prev];
113
114 switch (window_sequence)
115 {
116 case ONLY_LONG_SEQUENCE:
117 imdct_ssr(fb, freq_in, transf_buf, 2*nlong);
118 for (i = nlong-1; i >= 0; i--)
119 {
120 time_out[i] = MUL_R_C(transf_buf[i],window_long_prev[i]);
121 time_out[nlong+i] = MUL_R_C(transf_buf[nlong+i],window_long[nlong-1-i]);
122 }
123 break;
124
125 case LONG_START_SEQUENCE:
126 imdct_ssr(fb, freq_in, transf_buf, 2*nlong);
127 for (i = 0; i < nlong; i++)
128 time_out[i] = MUL_R_C(transf_buf[i],window_long_prev[i]);
129 for (i = 0; i < nflat_ls; i++)
130 time_out[nlong+i] = transf_buf[nlong+i];
131 for (i = 0; i < nshort; i++)
132 time_out[nlong+nflat_ls+i] = MUL_R_C(transf_buf[nlong+nflat_ls+i],window_short[nshort-i-1]);
133 for (i = 0; i < nflat_ls; i++)
134 time_out[nlong+nflat_ls+nshort+i] = 0;
135 break;
136
137 case EIGHT_SHORT_SEQUENCE:
138 imdct_ssr(fb, freq_in+0*nshort, transf_buf+2*nshort*0, 2*nshort);
139 imdct_ssr(fb, freq_in+1*nshort, transf_buf+2*nshort*1, 2*nshort);
140 imdct_ssr(fb, freq_in+2*nshort, transf_buf+2*nshort*2, 2*nshort);
141 imdct_ssr(fb, freq_in+3*nshort, transf_buf+2*nshort*3, 2*nshort);
142 imdct_ssr(fb, freq_in+4*nshort, transf_buf+2*nshort*4, 2*nshort);
143 imdct_ssr(fb, freq_in+5*nshort, transf_buf+2*nshort*5, 2*nshort);
144 imdct_ssr(fb, freq_in+6*nshort, transf_buf+2*nshort*6, 2*nshort);
145 imdct_ssr(fb, freq_in+7*nshort, transf_buf+2*nshort*7, 2*nshort);
146 for(i = nshort-1; i >= 0; i--)
147 {
148 time_out[i+0*nshort] = MUL_R_C(transf_buf[nshort*0+i],window_short_prev[i]);
149 time_out[i+1*nshort] = MUL_R_C(transf_buf[nshort*1+i],window_short[i]);
150 time_out[i+2*nshort] = MUL_R_C(transf_buf[nshort*2+i],window_short_prev[i]);
151 time_out[i+3*nshort] = MUL_R_C(transf_buf[nshort*3+i],window_short[i]);
152 time_out[i+4*nshort] = MUL_R_C(transf_buf[nshort*4+i],window_short_prev[i]);
153 time_out[i+5*nshort] = MUL_R_C(transf_buf[nshort*5+i],window_short[i]);
154 time_out[i+6*nshort] = MUL_R_C(transf_buf[nshort*6+i],window_short_prev[i]);
155 time_out[i+7*nshort] = MUL_R_C(transf_buf[nshort*7+i],window_short[i]);
156 time_out[i+8*nshort] = MUL_R_C(transf_buf[nshort*8+i],window_short_prev[i]);
157 time_out[i+9*nshort] = MUL_R_C(transf_buf[nshort*9+i],window_short[i]);
158 time_out[i+10*nshort] = MUL_R_C(transf_buf[nshort*10+i],window_short_prev[i]);
159 time_out[i+11*nshort] = MUL_R_C(transf_buf[nshort*11+i],window_short[i]);
160 time_out[i+12*nshort] = MUL_R_C(transf_buf[nshort*12+i],window_short_prev[i]);
161 time_out[i+13*nshort] = MUL_R_C(transf_buf[nshort*13+i],window_short[i]);
162 time_out[i+14*nshort] = MUL_R_C(transf_buf[nshort*14+i],window_short_prev[i]);
163 time_out[i+15*nshort] = MUL_R_C(transf_buf[nshort*15+i],window_short[i]);
164 }
165 break;
166
167 case LONG_STOP_SEQUENCE:
168 imdct_ssr(fb, freq_in, transf_buf, 2*nlong);
169 for (i = 0; i < nflat_ls; i++)
170 time_out[i] = 0;
171 for (i = 0; i < nshort; i++)
172 time_out[nflat_ls+i] = MUL_R_C(transf_buf[nflat_ls+i],window_short_prev[i]);
173 for (i = 0; i < nflat_ls; i++)
174 time_out[nflat_ls+nshort+i] = transf_buf[nflat_ls+nshort+i];
175 for (i = 0; i < nlong; i++)
176 time_out[nlong+i] = MUL_R_C(transf_buf[nlong+i],window_long[nlong-1-i]);
177 break;
178 }
179
180 faad_free(transf_buf);
181 }
182
183
184 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: ssr_fb.h,v 1.16 2007/11/01 12:33:36 menno Exp $
28 **/
29
30 #ifndef __SSR_FB_H__
31 #define __SSR_FB_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 fb_info *ssr_filter_bank_init(uint16_t frame_len);
38 void ssr_filter_bank_end(fb_info *fb);
39
40 /*non overlapping inverse filterbank */
41 void ssr_ifilter_bank(fb_info *fb,
42 uint8_t window_sequence,
43 uint8_t window_shape,
44 uint8_t window_shape_prev,
45 real_t *freq_in,
46 real_t *time_out,
47 uint16_t frame_len);
48
49 #ifdef __cplusplus
50 }
51 #endif
52 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: ssr_ipqf.c,v 1.18 2007/11/01 12:33:39 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #ifdef SSR_DEC
34
35 #include "ssr.h"
36 #include "ssr_ipqf.h"
37
38 static real_t **app_pqfbuf;
39 static real_t **pp_q0, **pp_t0, **pp_t1;
40
41 void gc_set_protopqf(real_t *p_proto)
42 {
43 int j;
44 static real_t a_half[48] =
45 {
46 1.2206911375946939E-05, 1.7261986723798209E-05, 1.2300093657077942E-05,
47 -1.0833943097791965E-05, -5.7772498639901686E-05, -1.2764767618947719E-04,
48 -2.0965186675013334E-04, -2.8166673689263850E-04, -3.1234860429017460E-04,
49 -2.6738519958452353E-04, -1.1949424681824722E-04, 1.3965139412648678E-04,
50 4.8864136409185725E-04, 8.7044629275148344E-04, 1.1949430269934793E-03,
51 1.3519708175026700E-03, 1.2346314373964412E-03, 7.6953209114159191E-04,
52 -5.2242432579537141E-05, -1.1516092887213454E-03, -2.3538469841711277E-03,
53 -3.4033123072127277E-03, -4.0028551071986133E-03, -3.8745415659693259E-03,
54 -2.8321073426874310E-03, -8.5038892323704195E-04, 1.8856751185350931E-03,
55 4.9688741735340923E-03, 7.8056704536795926E-03, 9.7027909685901654E-03,
56 9.9960423120166159E-03, 8.2019366335594487E-03, 4.1642072876103365E-03,
57 -1.8364453822737758E-03, -9.0384863094167686E-03, -1.6241528177129844E-02,
58 -2.1939551286300665E-02, -2.4533179947088161E-02, -2.2591663337768787E-02,
59 -1.5122066420044672E-02, -1.7971713448186293E-03, 1.6903413428575379E-02,
60 3.9672315874127042E-02, 6.4487527248102796E-02, 8.8850025474701726E-02,
61 0.1101132906105560 , 0.1258540205143761 , 0.1342239368467012
62 };
63
64 for (j = 0; j < 48; ++j)
65 {
66 p_proto[j] = p_proto[95-j] = a_half[j];
67 }
68 }
69
70 void gc_setcoef_eff_pqfsyn(int mm,
71 int kk,
72 real_t *p_proto,
73 real_t ***ppp_q0,
74 real_t ***ppp_t0,
75 real_t ***ppp_t1)
76 {
77 int i, k, n;
78 real_t w;
79
80 /* Set 1st Mul&Acc Coef's */
81 *ppp_q0 = (real_t **) calloc(mm, sizeof(real_t *));
82 for (n = 0; n < mm; ++n)
83 {
84 (*ppp_q0)[n] = (real_t *) calloc(mm, sizeof(real_t));
85 }
86 for (n = 0; n < mm/2; ++n)
87 {
88 for (i = 0; i < mm; ++i)
89 {
90 w = (2*i+1)*(2*n+1-mm)*M_PI/(4*mm);
91 (*ppp_q0)[n][i] = 2.0 * cos((real_t) w);
92
93 w = (2*i+1)*(2*(mm+n)+1-mm)*M_PI/(4*mm);
94 (*ppp_q0)[n + mm/2][i] = 2.0 * cos((real_t) w);
95 }
96 }
97
98 /* Set 2nd Mul&Acc Coef's */
99 *ppp_t0 = (real_t **) calloc(mm, sizeof(real_t *));
100 *ppp_t1 = (real_t **) calloc(mm, sizeof(real_t *));
101 for (n = 0; n < mm; ++n)
102 {
103 (*ppp_t0)[n] = (real_t *) calloc(kk, sizeof(real_t));
104 (*ppp_t1)[n] = (real_t *) calloc(kk, sizeof(real_t));
105 }
106 for (n = 0; n < mm; ++n)
107 {
108 for (k = 0; k < kk; ++k)
109 {
110 (*ppp_t0)[n][k] = mm * p_proto[2*k *mm + n];
111 (*ppp_t1)[n][k] = mm * p_proto[(2*k+1)*mm + n];
112
113 if (k%2 != 0)
114 {
115 (*ppp_t0)[n][k] = -(*ppp_t0)[n][k];
116 (*ppp_t1)[n][k] = -(*ppp_t1)[n][k];
117 }
118 }
119 }
120 }
121
122 void ssr_ipqf(ssr_info *ssr, real_t *in_data, real_t *out_data,
123 real_t buffer[SSR_BANDS][96/4],
124 uint16_t frame_len, uint8_t bands)
125 {
126 static int initFlag = 0;
127 real_t a_pqfproto[PQFTAPS];
128
129 int i;
130
131 if (initFlag == 0)
132 {
133 gc_set_protopqf(a_pqfproto);
134 gc_setcoef_eff_pqfsyn(SSR_BANDS, PQFTAPS/(2*SSR_BANDS), a_pqfproto,
135 &pp_q0, &pp_t0, &pp_t1);
136 initFlag = 1;
137 }
138
139 for (i = 0; i < frame_len / SSR_BANDS; i++)
140 {
141 int l, n, k;
142 int mm = SSR_BANDS;
143 int kk = PQFTAPS/(2*SSR_BANDS);
144
145 for (n = 0; n < mm; n++)
146 {
147 for (k = 0; k < 2*kk-1; k++)
148 {
149 buffer[n][k] = buffer[n][k+1];
150 }
151 }
152
153 for (n = 0; n < mm; n++)
154 {
155 real_t acc = 0.0;
156 for (l = 0; l < mm; l++)
157 {
158 acc += pp_q0[n][l] * in_data[l*frame_len/SSR_BANDS + i];
159 }
160 buffer[n][2*kk-1] = acc;
161 }
162
163 for (n = 0; n < mm/2; n++)
164 {
165 real_t acc = 0.0;
166 for (k = 0; k < kk; k++)
167 {
168 acc += pp_t0[n][k] * buffer[n][2*kk-1-2*k];
169 }
170 for (k = 0; k < kk; ++k)
171 {
172 acc += pp_t1[n][k] * buffer[n + mm/2][2*kk-2-2*k];
173 }
174 out_data[i*SSR_BANDS + n] = acc;
175
176 acc = 0.0;
177 for (k = 0; k < kk; k++)
178 {
179 acc += pp_t0[mm-1-n][k] * buffer[n][2*kk-1-2*k];
180 }
181 for (k = 0; k < kk; k++)
182 {
183 acc -= pp_t1[mm-1-n][k] * buffer[n + mm/2][2*kk-2-2*k];
184 }
185 out_data[i*SSR_BANDS + mm-1-n] = acc;
186 }
187 }
188 }
189
190 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: ssr_ipqf.h,v 1.17 2007/11/01 12:33:39 menno Exp $
28 **/
29
30 #ifndef __SSR_IPQF_H__
31 #define __SSR_IPQF_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 void ssr_ipqf(ssr_info *ssr, real_t *in_data, real_t *out_data,
38 real_t buffer[SSR_BANDS][96/4],
39 uint16_t frame_len, uint8_t bands);
40
41
42 #ifdef __cplusplus
43 }
44 #endif
45 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: ssr_win.h,v 1.16 2007/11/01 12:33:39 menno Exp $
28 **/
29
30 #ifndef __SSR_WIN_H__
31 #define __SSR_WIN_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #ifdef _MSC_VER
38 #pragma warning(disable:4305)
39 #pragma warning(disable:4244)
40 #endif
41
42 static real_t sine_short_32[] = {
43 0.0245412290,
44 0.0735645667,
45 0.1224106774,
46 0.1709618866,
47 0.2191012502,
48 0.2667127550,
49 0.3136817515,
50 0.3598950505,
51 0.4052413106,
52 0.4496113360,
53 0.4928981960,
54 0.5349976420,
55 0.5758082271,
56 0.6152316332,
57 0.6531728506,
58 0.6895405650,
59 0.7242470980,
60 0.7572088838,
61 0.7883464694,
62 0.8175848126,
63 0.8448535800,
64 0.8700870275,
65 0.8932242990,
66 0.9142097831,
67 0.9329928160,
68 0.9495282173,
69 0.9637760520,
70 0.9757021666,
71 0.9852776527,
72 0.9924795628,
73 0.9972904325,
74 0.9996988177
75 };
76
77 static real_t sine_long_256[] = {
78 0.0030679568,
79 0.0092037553,
80 0.0153392069,
81 0.0214740802,
82 0.0276081469,
83 0.0337411724,
84 0.0398729295,
85 0.0460031852,
86 0.0521317050,
87 0.0582582653,
88 0.0643826351,
89 0.0705045760,
90 0.0766238645,
91 0.0827402696,
92 0.0888535529,
93 0.0949634984,
94 0.1010698676,
95 0.1071724296,
96 0.1132709533,
97 0.1193652153,
98 0.1254549921,
99 0.1315400302,
100 0.1376201212,
101 0.1436950415,
102 0.1497645378,
103 0.1558284014,
104 0.1618863940,
105 0.1679383069,
106 0.1739838719,
107 0.1800229102,
108 0.1860551536,
109 0.1920804083,
110 0.1980984211,
111 0.2041089684,
112 0.2101118416,
113 0.2161068022,
114 0.2220936269,
115 0.2280720919,
116 0.2340419590,
117 0.2400030345,
118 0.2459550500,
119 0.2518978119,
120 0.2578310966,
121 0.2637546957,
122 0.2696683407,
123 0.2755718231,
124 0.2814649343,
125 0.2873474658,
126 0.2932191789,
127 0.2990798354,
128 0.3049292266,
129 0.3107671738,
130 0.3165933788,
131 0.3224076927,
132 0.3282098472,
133 0.3339996636,
134 0.3397769034,
135 0.3455413282,
136 0.3512927592,
137 0.3570309579,
138 0.3627557456,
139 0.3684668541,
140 0.3741640747,
141 0.3798472285,
142 0.3855160773,
143 0.3911703825,
144 0.3968099952,
145 0.4024346471,
146 0.4080441594,
147 0.4136383235,
148 0.4192169011,
149 0.4247796834,
150 0.4303264916,
151 0.4358570874,
152 0.4413712919,
153 0.4468688369,
154 0.4523496032,
155 0.4578133225,
156 0.4632597864,
157 0.4686888456,
158 0.4741002321,
159 0.4794937670,
160 0.4848692715,
161 0.4902265072,
162 0.4955652654,
163 0.5008853674,
164 0.5061866641,
165 0.5114688873,
166 0.5167317986,
167 0.5219752789,
168 0.5271991491,
169 0.5324031115,
170 0.5375871062,
171 0.5427507758,
172 0.5478940606,
173 0.5530167222,
174 0.5581185222,
175 0.5631993413,
176 0.5682589412,
177 0.5732972026,
178 0.5783138275,
179 0.5833086967,
180 0.5882815719,
181 0.5932323337,
182 0.5981607437,
183 0.6030666232,
184 0.6079497933,
185 0.6128100753,
186 0.6176473498,
187 0.6224613190,
188 0.6272518039,
189 0.6320187449,
190 0.6367619038,
191 0.6414810419,
192 0.6461760402,
193 0.6508467197,
194 0.6554928422,
195 0.6601143479,
196 0.6647109985,
197 0.6692826152,
198 0.6738290191,
199 0.6783500314,
200 0.6828455329,
201 0.6873153448,
202 0.6917592883,
203 0.6961771250,
204 0.7005687952,
205 0.7049341202,
206 0.7092728615,
207 0.7135848999,
208 0.7178700566,
209 0.7221282125,
210 0.7263591886,
211 0.7305628061,
212 0.7347388864,
213 0.7388873696,
214 0.7430079579,
215 0.7471006513,
216 0.7511651516,
217 0.7552013993,
218 0.7592092156,
219 0.7631884217,
220 0.7671388984,
221 0.7710605264,
222 0.7749531269,
223 0.7788165212,
224 0.7826505899,
225 0.7864552140,
226 0.7902302146,
227 0.7939754725,
228 0.7976908684,
229 0.8013761640,
230 0.8050313592,
231 0.8086562157,
232 0.8122506142,
233 0.8158144355,
234 0.8193475604,
235 0.8228498101,
236 0.8263210654,
237 0.8297612667,
238 0.8331701756,
239 0.8365477324,
240 0.8398938179,
241 0.8432082534,
242 0.8464909792,
243 0.8497417569,
244 0.8529606462,
245 0.8561473489,
246 0.8593018055,
247 0.8624239564,
248 0.8655136228,
249 0.8685707450,
250 0.8715950847,
251 0.8745866418,
252 0.8775452971,
253 0.8804709315,
254 0.8833633661,
255 0.8862225413,
256 0.8890483975,
257 0.8918406963,
258 0.8945994973,
259 0.8973246217,
260 0.9000158906,
261 0.9026733041,
262 0.9052967429,
263 0.9078861475,
264 0.9104412794,
265 0.9129621983,
266 0.9154487252,
267 0.9179008007,
268 0.9203183055,
269 0.9227011204,
270 0.9250492454,
271 0.9273625612,
272 0.9296408892,
273 0.9318842888,
274 0.9340925813,
275 0.9362657070,
276 0.9384035468,
277 0.9405061007,
278 0.9425731897,
279 0.9446048737,
280 0.9466009140,
281 0.9485613704,
282 0.9504860640,
283 0.9523749948,
284 0.9542281032,
285 0.9560452700,
286 0.9578264356,
287 0.9595715404,
288 0.9612805247,
289 0.9629532695,
290 0.9645897746,
291 0.9661900401,
292 0.9677538276,
293 0.9692812562,
294 0.9707721472,
295 0.9722265005,
296 0.9736442566,
297 0.9750253558,
298 0.9763697386,
299 0.9776773453,
300 0.9789481759,
301 0.9801821709,
302 0.9813792109,
303 0.9825392962,
304 0.9836624265,
305 0.9847484827,
306 0.9857975245,
307 0.9868094325,
308 0.9877841473,
309 0.9887216687,
310 0.9896219969,
311 0.9904850721,
312 0.9913108945,
313 0.9920993447,
314 0.9928504229,
315 0.9935641289,
316 0.9942404628,
317 0.9948793054,
318 0.9954807758,
319 0.9960446954,
320 0.9965711236,
321 0.9970600605,
322 0.9975114465,
323 0.9979252815,
324 0.9983015656,
325 0.9986402392,
326 0.9989413023,
327 0.9992047548,
328 0.9994305968,
329 0.9996188283,
330 0.9997693896,
331 0.9998823404,
332 0.9999576211,
333 0.9999952912
334 };
335
336 static real_t kbd_short_32[] = {
337 0.0000875914060105,
338 0.0009321760265333,
339 0.0032114611466596,
340 0.0081009893216786,
341 0.0171240286619181,
342 0.0320720743527833,
343 0.0548307856028528,
344 0.0871361822564870,
345 0.1302923415174603,
346 0.1848955425508276,
347 0.2506163195331889,
348 0.3260874142923209,
349 0.4089316830907141,
350 0.4959414909423747,
351 0.5833939894958904,
352 0.6674601983218376,
353 0.7446454751465113,
354 0.8121892962974020,
355 0.8683559394406505,
356 0.9125649996381605,
357 0.9453396205809574,
358 0.9680864942677585,
359 0.9827581789763112,
360 0.9914756203467121,
361 0.9961964092194694,
362 0.9984956609571091,
363 0.9994855586984285,
364 0.9998533730714648,
365 0.9999671864476404,
366 0.9999948432453556,
367 0.9999995655238333,
368 0.9999999961638728
369 };
370
371
372 static real_t kbd_long_256[] = {
373 0.0005851230124487,
374 0.0009642149851497,
375 0.0013558207534965,
376 0.0017771849644394,
377 0.0022352533849672,
378 0.0027342299070304,
379 0.0032773001022195,
380 0.0038671998069216,
381 0.0045064443384152,
382 0.0051974336885144,
383 0.0059425050016407,
384 0.0067439602523141,
385 0.0076040812644888,
386 0.0085251378135895,
387 0.0095093917383048,
388 0.0105590986429280,
389 0.0116765080854300,
390 0.0128638627792770,
391 0.0141233971318631,
392 0.0154573353235409,
393 0.0168678890600951,
394 0.0183572550877256,
395 0.0199276125319803,
396 0.0215811201042484,
397 0.0233199132076965,
398 0.0251461009666641,
399 0.0270617631981826,
400 0.0290689473405856,
401 0.0311696653515848,
402 0.0333658905863535,
403 0.0356595546648444,
404 0.0380525443366107,
405 0.0405466983507029,
406 0.0431438043376910,
407 0.0458455957104702,
408 0.0486537485902075,
409 0.0515698787635492,
410 0.0545955386770205,
411 0.0577322144743916,
412 0.0609813230826460,
413 0.0643442093520723,
414 0.0678221432558827,
415 0.0714163171546603,
416 0.0751278431308314,
417 0.0789577503982528,
418 0.0829069827918993,
419 0.0869763963425241,
420 0.0911667569410503,
421 0.0954787380973307,
422 0.0999129187977865,
423 0.1044697814663005,
424 0.1091497100326053,
425 0.1139529881122542,
426 0.1188797973021148,
427 0.1239302155951605,
428 0.1291042159181728,
429 0.1344016647957880,
430 0.1398223211441467,
431 0.1453658351972151,
432 0.1510317475686540,
433 0.1568194884519144,
434 0.1627283769610327,
435 0.1687576206143887,
436 0.1749063149634756,
437 0.1811734433685097,
438 0.1875578769224857,
439 0.1940583745250518,
440 0.2006735831073503,
441 0.2074020380087318,
442 0.2142421635060113,
443 0.2211922734956977,
444 0.2282505723293797,
445 0.2354151558022098,
446 0.2426840122941792,
447 0.2500550240636293,
448 0.2575259686921987,
449 0.2650945206801527,
450 0.2727582531907993,
451 0.2805146399424422,
452 0.2883610572460804,
453 0.2962947861868143,
454 0.3043130149466800,
455 0.3124128412663888,
456 0.3205912750432127,
457 0.3288452410620226,
458 0.3371715818562547,
459 0.3455670606953511,
460 0.3540283646950029,
461 0.3625521080463003,
462 0.3711348353596863,
463 0.3797730251194006,
464 0.3884630932439016,
465 0.3972013967475546,
466 0.4059842374986933,
467 0.4148078660689724,
468 0.4236684856687616,
469 0.4325622561631607,
470 0.4414852981630577,
471 0.4504336971855032,
472 0.4594035078775303,
473 0.4683907582974173,
474 0.4773914542472655,
475 0.4864015836506502,
476 0.4954171209689973,
477 0.5044340316502417,
478 0.5134482766032377,
479 0.5224558166913167,
480 0.5314526172383208,
481 0.5404346525403849,
482 0.5493979103766972,
483 0.5583383965124314,
484 0.5672521391870222,
485 0.5761351935809411,
486 0.5849836462541291,
487 0.5937936195492526,
488 0.6025612759529649,
489 0.6112828224083939,
490 0.6199545145721097,
491 0.6285726610088878,
492 0.6371336273176413,
493 0.6456338401819751,
494 0.6540697913388968,
495 0.6624380414593221,
496 0.6707352239341151,
497 0.6789580485595255,
498 0.6871033051160131,
499 0.6951678668345944,
500 0.7031486937449871,
501 0.7110428359000029,
502 0.7188474364707993,
503 0.7265597347077880,
504 0.7341770687621900,
505 0.7416968783634273,
506 0.7491167073477523,
507 0.7564342060337386,
508 0.7636471334404891,
509 0.7707533593446514,
510 0.7777508661725849,
511 0.7846377507242818,
512 0.7914122257259034,
513 0.7980726212080798,
514 0.8046173857073919,
515 0.8110450872887550,
516 0.8173544143867162,
517 0.8235441764639875,
518 0.8296133044858474,
519 0.8355608512093652,
520 0.8413859912867303,
521 0.8470880211822968,
522 0.8526663589032990,
523 0.8581205435445334,
524 0.8634502346476508,
525 0.8686552113760616,
526 0.8737353715068081,
527 0.8786907302411250,
528 0.8835214188357692,
529 0.8882276830575707,
530 0.8928098814640207,
531 0.8972684835130879,
532 0.9016040675058185,
533 0.9058173183656508,
534 0.9099090252587376,
535 0.9138800790599416,
536 0.9177314696695282,
537 0.9214642831859411,
538 0.9250796989403991,
539 0.9285789863994010,
540 0.9319635019415643,
541 0.9352346855155568,
542 0.9383940571861993,
543 0.9414432135761304,
544 0.9443838242107182,
545 0.9472176277741918,
546 0.9499464282852282,
547 0.9525720912004834,
548 0.9550965394547873,
549 0.9575217494469370,
550 0.9598497469802043,
551 0.9620826031668507,
552 0.9642224303060783,
553 0.9662713777449607,
554 0.9682316277319895,
555 0.9701053912729269,
556 0.9718949039986892,
557 0.9736024220549734,
558 0.9752302180233160,
559 0.9767805768831932,
560 0.9782557920246753,
561 0.9796581613210076,
562 0.9809899832703159,
563 0.9822535532154261,
564 0.9834511596505429,
565 0.9845850806232530,
566 0.9856575802399989,
567 0.9866709052828243,
568 0.9876272819448033,
569 0.9885289126911557,
570 0.9893779732525968,
571 0.9901766097569984,
572 0.9909269360049311,
573 0.9916310308941294,
574 0.9922909359973702,
575 0.9929086532976777,
576 0.9934861430841844,
577 0.9940253220113651,
578 0.9945280613237534,
579 0.9949961852476154,
580 0.9954314695504363,
581 0.9958356402684387,
582 0.9962103726017252,
583 0.9965572899760172,
584 0.9968779632693499,
585 0.9971739102014799,
586 0.9974465948831872,
587 0.9976974275220812,
588 0.9979277642809907,
589 0.9981389072844972,
590 0.9983321047686901,
591 0.9985085513687731,
592 0.9986693885387259,
593 0.9988157050968516,
594 0.9989485378906924,
595 0.9990688725744943,
596 0.9991776444921379,
597 0.9992757396582338,
598 0.9993639958299003,
599 0.9994432036616085,
600 0.9995141079353859,
601 0.9995774088586188,
602 0.9996337634216871,
603 0.9996837868076957,
604 0.9997280538466377,
605 0.9997671005064359,
606 0.9998014254134544,
607 0.9998314913952471,
608 0.9998577270385304,
609 0.9998805282555989,
610 0.9999002598526793,
611 0.9999172570940037,
612 0.9999318272557038,
613 0.9999442511639580,
614 0.9999547847121726,
615 0.9999636603523446,
616 0.9999710885561258,
617 0.9999772592414866,
618 0.9999823431612708,
619 0.9999864932503106,
620 0.9999898459281599,
621 0.9999925223548691,
622 0.9999946296375997,
623 0.9999962619864214,
624 0.9999975018180320,
625 0.9999984208055542,
626 0.9999990808746198,
627 0.9999995351446231,
628 0.9999998288155155
629 };
630
631 #ifdef __cplusplus
632 }
633 #endif
634 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: structs.h,v 1.46 2007/11/01 12:33:40 menno Exp $
28 **/
29
30 #ifndef __STRUCTS_H__
31 #define __STRUCTS_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #include "cfft.h"
38 #ifdef SBR_DEC
39 #include "sbr_dec.h"
40 #endif
41
42 #define MAX_CHANNELS 64
43 #define MAX_SYNTAX_ELEMENTS 48
44 #define MAX_WINDOW_GROUPS 8
45 #define MAX_SFB 51
46 #define MAX_LTP_SFB 40
47 #define MAX_LTP_SFB_S 8
48
49 /* used to save the prediction state */
50 typedef struct {
51 int16_t r[2];
52 int16_t COR[2];
53 int16_t VAR[2];
54 } pred_state;
55
56 typedef struct {
57 uint16_t N;
58 cfft_info *cfft;
59 complex_t *sincos;
60 #ifdef PROFILE
61 int64_t cycles;
62 int64_t fft_cycles;
63 #endif
64 } mdct_info;
65
66 typedef struct
67 {
68 const real_t *long_window[2];
69 const real_t *short_window[2];
70 #ifdef LD_DEC
71 const real_t *ld_window[2];
72 #endif
73
74 mdct_info *mdct256;
75 #ifdef LD_DEC
76 mdct_info *mdct1024;
77 #endif
78 mdct_info *mdct2048;
79 #ifdef PROFILE
80 int64_t cycles;
81 #endif
82 } fb_info;
83
84 typedef struct
85 {
86 uint8_t present;
87
88 uint8_t num_bands;
89 uint8_t pce_instance_tag;
90 uint8_t excluded_chns_present;
91 uint8_t band_top[17];
92 uint8_t prog_ref_level;
93 uint8_t dyn_rng_sgn[17];
94 uint8_t dyn_rng_ctl[17];
95 uint8_t exclude_mask[MAX_CHANNELS];
96 uint8_t additional_excluded_chns[MAX_CHANNELS];
97
98 real_t ctrl1;
99 real_t ctrl2;
100 } drc_info;
101
102 typedef struct
103 {
104 uint8_t element_instance_tag;
105 uint8_t object_type;
106 uint8_t sf_index;
107 uint8_t num_front_channel_elements;
108 uint8_t num_side_channel_elements;
109 uint8_t num_back_channel_elements;
110 uint8_t num_lfe_channel_elements;
111 uint8_t num_assoc_data_elements;
112 uint8_t num_valid_cc_elements;
113 uint8_t mono_mixdown_present;
114 uint8_t mono_mixdown_element_number;
115 uint8_t stereo_mixdown_present;
116 uint8_t stereo_mixdown_element_number;
117 uint8_t matrix_mixdown_idx_present;
118 uint8_t pseudo_surround_enable;
119 uint8_t matrix_mixdown_idx;
120 uint8_t front_element_is_cpe[16];
121 uint8_t front_element_tag_select[16];
122 uint8_t side_element_is_cpe[16];
123 uint8_t side_element_tag_select[16];
124 uint8_t back_element_is_cpe[16];
125 uint8_t back_element_tag_select[16];
126 uint8_t lfe_element_tag_select[16];
127 uint8_t assoc_data_element_tag_select[16];
128 uint8_t cc_element_is_ind_sw[16];
129 uint8_t valid_cc_element_tag_select[16];
130
131 uint8_t channels;
132
133 uint8_t comment_field_bytes;
134 uint8_t comment_field_data[257];
135
136 /* extra added values */
137 uint8_t num_front_channels;
138 uint8_t num_side_channels;
139 uint8_t num_back_channels;
140 uint8_t num_lfe_channels;
141 uint8_t sce_channel[16];
142 uint8_t cpe_channel[16];
143 } program_config;
144
145 typedef struct
146 {
147 uint16_t syncword;
148 uint8_t id;
149 uint8_t layer;
150 uint8_t protection_absent;
151 uint8_t profile;
152 uint8_t sf_index;
153 uint8_t private_bit;
154 uint8_t channel_configuration;
155 uint8_t original;
156 uint8_t home;
157 uint8_t emphasis;
158 uint8_t copyright_identification_bit;
159 uint8_t copyright_identification_start;
160 uint16_t aac_frame_length;
161 uint16_t adts_buffer_fullness;
162 uint8_t no_raw_data_blocks_in_frame;
163 uint16_t crc_check;
164
165 /* control param */
166 uint8_t old_format;
167 } adts_header;
168
169 typedef struct
170 {
171 uint8_t copyright_id_present;
172 int8_t copyright_id[10];
173 uint8_t original_copy;
174 uint8_t home;
175 uint8_t bitstream_type;
176 uint32_t bitrate;
177 uint8_t num_program_config_elements;
178 uint32_t adif_buffer_fullness;
179
180 /* maximum of 16 PCEs */
181 program_config pce[16];
182 } adif_header;
183
184 #ifdef LTP_DEC
185 typedef struct
186 {
187 uint8_t last_band;
188 uint8_t data_present;
189 uint16_t lag;
190 uint8_t lag_update;
191 uint8_t coef;
192 uint8_t long_used[MAX_SFB];
193 uint8_t short_used[8];
194 uint8_t short_lag_present[8];
195 uint8_t short_lag[8];
196 } ltp_info;
197 #endif
198
199 #ifdef MAIN_DEC
200 typedef struct
201 {
202 uint8_t limit;
203 uint8_t predictor_reset;
204 uint8_t predictor_reset_group_number;
205 uint8_t prediction_used[MAX_SFB];
206 } pred_info;
207 #endif
208
209 typedef struct
210 {
211 uint8_t number_pulse;
212 uint8_t pulse_start_sfb;
213 uint8_t pulse_offset[4];
214 uint8_t pulse_amp[4];
215 } pulse_info;
216
217 typedef struct
218 {
219 uint8_t n_filt[8];
220 uint8_t coef_res[8];
221 uint8_t length[8][4];
222 uint8_t order[8][4];
223 uint8_t direction[8][4];
224 uint8_t coef_compress[8][4];
225 uint8_t coef[8][4][32];
226 } tns_info;
227
228 #ifdef SSR_DEC
229 typedef struct
230 {
231 uint8_t max_band;
232
233 uint8_t adjust_num[4][8];
234 uint8_t alevcode[4][8][8];
235 uint8_t aloccode[4][8][8];
236 } ssr_info;
237 #endif
238
239 typedef struct
240 {
241 uint8_t max_sfb;
242
243 uint8_t num_swb;
244 uint8_t num_window_groups;
245 uint8_t num_windows;
246 uint8_t window_sequence;
247 uint8_t window_group_length[8];
248 uint8_t window_shape;
249 uint8_t scale_factor_grouping;
250 uint16_t sect_sfb_offset[8][15*8];
251 uint16_t swb_offset[52];
252 uint16_t swb_offset_max;
253
254 uint8_t sect_cb[8][15*8];
255 uint16_t sect_start[8][15*8];
256 uint16_t sect_end[8][15*8];
257 uint8_t sfb_cb[8][8*15];
258 uint8_t num_sec[8]; /* number of sections in a group */
259
260 uint8_t global_gain;
261 int16_t scale_factors[8][51]; /* [0..255] */
262
263 uint8_t ms_mask_present;
264 uint8_t ms_used[MAX_WINDOW_GROUPS][MAX_SFB];
265
266 uint8_t noise_used;
267 uint8_t is_used;
268
269 uint8_t pulse_data_present;
270 uint8_t tns_data_present;
271 uint8_t gain_control_data_present;
272 uint8_t predictor_data_present;
273
274 pulse_info pul;
275 tns_info tns;
276 #ifdef MAIN_DEC
277 pred_info pred;
278 #endif
279 #ifdef LTP_DEC
280 ltp_info ltp;
281 ltp_info ltp2;
282 #endif
283 #ifdef SSR_DEC
284 ssr_info ssr;
285 #endif
286
287 #ifdef ERROR_RESILIENCE
288 /* ER HCR data */
289 uint16_t length_of_reordered_spectral_data;
290 uint8_t length_of_longest_codeword;
291 /* ER RLVC data */
292 uint8_t sf_concealment;
293 uint8_t rev_global_gain;
294 uint16_t length_of_rvlc_sf;
295 uint16_t dpcm_noise_nrg;
296 uint8_t sf_escapes_present;
297 uint8_t length_of_rvlc_escapes;
298 uint16_t dpcm_noise_last_position;
299 #endif
300 } ic_stream; /* individual channel stream */
301
302 typedef struct
303 {
304 uint8_t channel;
305 int16_t paired_channel;
306
307 uint8_t element_instance_tag;
308 uint8_t common_window;
309
310 ic_stream ics1;
311 ic_stream ics2;
312 } element; /* syntax element (SCE, CPE, LFE) */
313
314 typedef struct mp4AudioSpecificConfig
315 {
316 /* Audio Specific Info */
317 /*uint8_t*/ unsigned char objectTypeIndex;
318 /*uint8_t*/ unsigned char samplingFrequencyIndex;
319 /*uint32_t*/ unsigned long samplingFrequency;
320 /*uint8_t*/ unsigned char channelsConfiguration;
321
322 /* GA Specific Info */
323 /*uint8_t*/ unsigned char frameLengthFlag;
324 /*uint8_t*/ unsigned char dependsOnCoreCoder;
325 /*uint16_t*/ unsigned short coreCoderDelay;
326 /*uint8_t*/ unsigned char extensionFlag;
327 /*uint8_t*/ unsigned char aacSectionDataResilienceFlag;
328 /*uint8_t*/ unsigned char aacScalefactorDataResilienceFlag;
329 /*uint8_t*/ unsigned char aacSpectralDataResilienceFlag;
330 /*uint8_t*/ unsigned char epConfig;
331
332 /*uint8_t*/ char sbr_present_flag;
333 /*uint8_t*/ char forceUpSampling;
334 /*uint8_t*/ char downSampledSBR;
335 } mp4AudioSpecificConfig;
336
337 typedef struct NeAACDecConfiguration
338 {
339 /*uint8_t*/ unsigned char defObjectType;
340 /*uint32_t*/ unsigned long defSampleRate;
341 /*uint8_t*/ unsigned char outputFormat;
342 /*uint8_t*/ unsigned char downMatrix;
343 /*uint8_t*/ unsigned char useOldADTSFormat;
344 /*uint8_t*/ unsigned char dontUpSampleImplicitSBR;
345 } NeAACDecConfiguration, *NeAACDecConfigurationPtr;
346
347 typedef struct NeAACDecFrameInfo
348 {
349 /*uint32_t*/ unsigned long bytesconsumed;
350 /*uint32_t*/ unsigned long samples;
351 /*uint8_t*/ unsigned char channels;
352 /*uint8_t*/ unsigned char error;
353 /*uint32_t*/ unsigned long samplerate;
354
355 /* SBR: 0: off, 1: on; normal, 2: on; downsampled */
356 /*uint8_t*/ unsigned char sbr;
357
358 /* MPEG-4 ObjectType */
359 /*uint8_t*/ unsigned char object_type;
360
361 /* AAC header type; MP4 will be signalled as RAW also */
362 /*uint8_t*/ unsigned char header_type;
363
364 /* multichannel configuration */
365 /*uint8_t*/ unsigned char num_front_channels;
366 /*uint8_t*/ unsigned char num_side_channels;
367 /*uint8_t*/ unsigned char num_back_channels;
368 /*uint8_t*/ unsigned char num_lfe_channels;
369 /*uint8_t*/ unsigned char channel_position[MAX_CHANNELS];
370
371 /* PS: 0: off, 1: on */
372 /*uint8_t*/ unsigned char ps;
373 } NeAACDecFrameInfo;
374
375 typedef struct
376 {
377 uint8_t adts_header_present;
378 uint8_t adif_header_present;
379 uint8_t sf_index;
380 uint8_t object_type;
381 uint8_t channelConfiguration;
382 #ifdef ERROR_RESILIENCE
383 uint8_t aacSectionDataResilienceFlag;
384 uint8_t aacScalefactorDataResilienceFlag;
385 uint8_t aacSpectralDataResilienceFlag;
386 #endif
387 uint16_t frameLength;
388 uint8_t postSeekResetFlag;
389
390 uint32_t frame;
391
392 uint8_t downMatrix;
393 uint8_t upMatrix;
394 uint8_t first_syn_ele;
395 uint8_t has_lfe;
396 /* number of channels in current frame */
397 uint8_t fr_channels;
398 /* number of elements in current frame */
399 uint8_t fr_ch_ele;
400
401 /* element_output_channels:
402 determines the number of channels the element will output
403 */
404 uint8_t element_output_channels[MAX_SYNTAX_ELEMENTS];
405 /* element_alloced:
406 determines whether the data needed for the element is allocated or not
407 */
408 uint8_t element_alloced[MAX_SYNTAX_ELEMENTS];
409 /* alloced_channels:
410 determines the number of channels where output data is allocated for
411 */
412 uint8_t alloced_channels;
413
414 /* output data buffer */
415 void *sample_buffer;
416
417 uint8_t window_shape_prev[MAX_CHANNELS];
418 #ifdef LTP_DEC
419 uint16_t ltp_lag[MAX_CHANNELS];
420 #endif
421 fb_info *fb;
422 drc_info *drc;
423
424 real_t *time_out[MAX_CHANNELS];
425 real_t *fb_intermed[MAX_CHANNELS];
426
427 #ifdef SBR_DEC
428 int8_t sbr_present_flag;
429 int8_t forceUpSampling;
430 int8_t downSampledSBR;
431 /* determines whether SBR data is allocated for the gives element */
432 uint8_t sbr_alloced[MAX_SYNTAX_ELEMENTS];
433
434 sbr_info *sbr[MAX_SYNTAX_ELEMENTS];
435 #endif
436 #if (defined(PS_DEC) || defined(DRM_PS))
437 uint8_t ps_used[MAX_SYNTAX_ELEMENTS];
438 uint8_t ps_used_global;
439 #endif
440
441 #ifdef SSR_DEC
442 real_t *ssr_overlap[MAX_CHANNELS];
443 real_t *prev_fmd[MAX_CHANNELS];
444 real_t ipqf_buffer[MAX_CHANNELS][4][96/4];
445 #endif
446
447 #ifdef MAIN_DEC
448 pred_state *pred_stat[MAX_CHANNELS];
449 #endif
450 #ifdef LTP_DEC
451 int16_t *lt_pred_stat[MAX_CHANNELS];
452 #endif
453
454 #ifdef DRM
455 uint8_t error_state;
456 #endif
457
458 /* RNG states */
459 uint32_t __r1;
460 uint32_t __r2;
461
462 /* Program Config Element */
463 uint8_t pce_set;
464 program_config pce;
465 uint8_t element_id[MAX_CHANNELS];
466 uint8_t internal_channel[MAX_CHANNELS];
467
468 /* Configuration data */
469 NeAACDecConfiguration config;
470
471 #ifdef PROFILE
472 int64_t cycles;
473 int64_t spectral_cycles;
474 int64_t output_cycles;
475 int64_t scalefac_cycles;
476 int64_t requant_cycles;
477 #endif
478 const unsigned char *cmes;
479 } NeAACDecStruct, *NeAACDecHandle;
480
481
482
483 #ifdef __cplusplus
484 }
485 #endif
486 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: syntax.c,v 1.89 2007/11/01 12:33:40 menno Exp $
28 **/
29
30 /*
31 Reads the AAC bitstream as defined in 14496-3 (MPEG-4 Audio)
32 */
33
34 #include "common.h"
35 #include "structs.h"
36
37 #include <stdlib.h>
38 #include <string.h>
39
40 #include "decoder.h"
41 #include "syntax.h"
42 #include "specrec.h"
43 #include "huffman.h"
44 #include "bits.h"
45 #include "pulse.h"
46 #include "analysis.h"
47 #include "drc.h"
48 #ifdef ERROR_RESILIENCE
49 #include "rvlc.h"
50 #endif
51 #ifdef SBR_DEC
52 #include "sbr_syntax.h"
53 #endif
54
55
56 /* static function declarations */
57 static void decode_sce_lfe(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld,
58 uint8_t id_syn_ele);
59 static void decode_cpe(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld,
60 uint8_t id_syn_ele);
61 static uint8_t single_lfe_channel_element(NeAACDecHandle hDecoder, bitfile *ld,
62 uint8_t channel, uint8_t *tag);
63 static uint8_t channel_pair_element(NeAACDecHandle hDecoder, bitfile *ld,
64 uint8_t channel, uint8_t *tag);
65 #ifdef COUPLING_DEC
66 static uint8_t coupling_channel_element(NeAACDecHandle hDecoder, bitfile *ld);
67 #endif
68 static uint16_t data_stream_element(NeAACDecHandle hDecoder, bitfile *ld);
69 static uint8_t program_config_element(program_config *pce, bitfile *ld);
70 static uint8_t fill_element(NeAACDecHandle hDecoder, bitfile *ld, drc_info *drc
71 #ifdef SBR_DEC
72 ,uint8_t sbr_ele
73 #endif
74 );
75 static uint8_t individual_channel_stream(NeAACDecHandle hDecoder, element *ele,
76 bitfile *ld, ic_stream *ics, uint8_t scal_flag,
77 int16_t *spec_data);
78 static uint8_t ics_info(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
79 uint8_t common_window);
80 static uint8_t section_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld);
81 static uint8_t scale_factor_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld);
82 #ifdef SSR_DEC
83 static void gain_control_data(bitfile *ld, ic_stream *ics);
84 #endif
85 static uint8_t spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
86 int16_t *spectral_data);
87 static uint16_t extension_payload(bitfile *ld, drc_info *drc, uint16_t count);
88 static uint8_t pulse_data(ic_stream *ics, pulse_info *pul, bitfile *ld);
89 static void tns_data(ic_stream *ics, tns_info *tns, bitfile *ld);
90 #ifdef LTP_DEC
91 static uint8_t ltp_data(NeAACDecHandle hDecoder, ic_stream *ics, ltp_info *ltp, bitfile *ld);
92 #endif
93 static uint8_t adts_fixed_header(adts_header *adts, bitfile *ld);
94 static void adts_variable_header(adts_header *adts, bitfile *ld);
95 static void adts_error_check(adts_header *adts, bitfile *ld);
96 static uint8_t dynamic_range_info(bitfile *ld, drc_info *drc);
97 static uint8_t excluded_channels(bitfile *ld, drc_info *drc);
98 static uint8_t side_info(NeAACDecHandle hDecoder, element *ele,
99 bitfile *ld, ic_stream *ics, uint8_t scal_flag);
100 #ifdef DRM
101 static int8_t DRM_aac_scalable_main_header(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2,
102 bitfile *ld, uint8_t this_layer_stereo);
103 #endif
104
105
106 /* Table 4.4.1 */
107 int8_t GASpecificConfig(bitfile *ld, mp4AudioSpecificConfig *mp4ASC,
108 program_config *pce_out)
109 {
110 program_config pce;
111
112 /* 1024 or 960 */
113 mp4ASC->frameLengthFlag = faad_get1bit(ld
114 DEBUGVAR(1,138,"GASpecificConfig(): FrameLengthFlag"));
115 #ifndef ALLOW_SMALL_FRAMELENGTH
116 if (mp4ASC->frameLengthFlag == 1)
117 return -3;
118 #endif
119
120 mp4ASC->dependsOnCoreCoder = faad_get1bit(ld
121 DEBUGVAR(1,139,"GASpecificConfig(): DependsOnCoreCoder"));
122 if (mp4ASC->dependsOnCoreCoder == 1)
123 {
124 mp4ASC->coreCoderDelay = (uint16_t)faad_getbits(ld, 14
125 DEBUGVAR(1,140,"GASpecificConfig(): CoreCoderDelay"));
126 }
127
128 mp4ASC->extensionFlag = faad_get1bit(ld DEBUGVAR(1,141,"GASpecificConfig(): ExtensionFlag"));
129 if (mp4ASC->channelsConfiguration == 0)
130 {
131 if (program_config_element(&pce, ld))
132 return -3;
133 //mp4ASC->channelsConfiguration = pce.channels;
134
135 if (pce_out != NULL)
136 memcpy(pce_out, &pce, sizeof(program_config));
137
138 /*
139 if (pce.num_valid_cc_elements)
140 return -3;
141 */
142 }
143
144 #ifdef ERROR_RESILIENCE
145 if (mp4ASC->extensionFlag == 1)
146 {
147 /* Error resilience not supported yet */
148 if (mp4ASC->objectTypeIndex >= ER_OBJECT_START)
149 {
150 mp4ASC->aacSectionDataResilienceFlag = faad_get1bit(ld
151 DEBUGVAR(1,144,"GASpecificConfig(): aacSectionDataResilienceFlag"));
152 mp4ASC->aacScalefactorDataResilienceFlag = faad_get1bit(ld
153 DEBUGVAR(1,145,"GASpecificConfig(): aacScalefactorDataResilienceFlag"));
154 mp4ASC->aacSpectralDataResilienceFlag = faad_get1bit(ld
155 DEBUGVAR(1,146,"GASpecificConfig(): aacSpectralDataResilienceFlag"));
156
157 /* 1 bit: extensionFlag3 */
158 }
159 }
160 #endif
161
162 return 0;
163 }
164
165 /* Table 4.4.2 */
166 /* An MPEG-4 Audio decoder is only required to follow the Program
167 Configuration Element in GASpecificConfig(). The decoder shall ignore
168 any Program Configuration Elements that may occur in raw data blocks.
169 PCEs transmitted in raw data blocks cannot be used to convey decoder
170 configuration information.
171 */
172 static uint8_t program_config_element(program_config *pce, bitfile *ld)
173 {
174 uint8_t i;
175
176 memset(pce, 0, sizeof(program_config));
177
178 pce->channels = 0;
179
180 pce->element_instance_tag = (uint8_t)faad_getbits(ld, 4
181 DEBUGVAR(1,10,"program_config_element(): element_instance_tag"));
182
183 pce->object_type = (uint8_t)faad_getbits(ld, 2
184 DEBUGVAR(1,11,"program_config_element(): object_type"));
185 pce->sf_index = (uint8_t)faad_getbits(ld, 4
186 DEBUGVAR(1,12,"program_config_element(): sf_index"));
187 pce->num_front_channel_elements = (uint8_t)faad_getbits(ld, 4
188 DEBUGVAR(1,13,"program_config_element(): num_front_channel_elements"));
189 pce->num_side_channel_elements = (uint8_t)faad_getbits(ld, 4
190 DEBUGVAR(1,14,"program_config_element(): num_side_channel_elements"));
191 pce->num_back_channel_elements = (uint8_t)faad_getbits(ld, 4
192 DEBUGVAR(1,15,"program_config_element(): num_back_channel_elements"));
193 pce->num_lfe_channel_elements = (uint8_t)faad_getbits(ld, 2
194 DEBUGVAR(1,16,"program_config_element(): num_lfe_channel_elements"));
195 pce->num_assoc_data_elements = (uint8_t)faad_getbits(ld, 3
196 DEBUGVAR(1,17,"program_config_element(): num_assoc_data_elements"));
197 pce->num_valid_cc_elements = (uint8_t)faad_getbits(ld, 4
198 DEBUGVAR(1,18,"program_config_element(): num_valid_cc_elements"));
199
200 pce->mono_mixdown_present = faad_get1bit(ld
201 DEBUGVAR(1,19,"program_config_element(): mono_mixdown_present"));
202 if (pce->mono_mixdown_present == 1)
203 {
204 pce->mono_mixdown_element_number = (uint8_t)faad_getbits(ld, 4
205 DEBUGVAR(1,20,"program_config_element(): mono_mixdown_element_number"));
206 }
207
208 pce->stereo_mixdown_present = faad_get1bit(ld
209 DEBUGVAR(1,21,"program_config_element(): stereo_mixdown_present"));
210 if (pce->stereo_mixdown_present == 1)
211 {
212 pce->stereo_mixdown_element_number = (uint8_t)faad_getbits(ld, 4
213 DEBUGVAR(1,22,"program_config_element(): stereo_mixdown_element_number"));
214 }
215
216 pce->matrix_mixdown_idx_present = faad_get1bit(ld
217 DEBUGVAR(1,23,"program_config_element(): matrix_mixdown_idx_present"));
218 if (pce->matrix_mixdown_idx_present == 1)
219 {
220 pce->matrix_mixdown_idx = (uint8_t)faad_getbits(ld, 2
221 DEBUGVAR(1,24,"program_config_element(): matrix_mixdown_idx"));
222 pce->pseudo_surround_enable = faad_get1bit(ld
223 DEBUGVAR(1,25,"program_config_element(): pseudo_surround_enable"));
224 }
225
226 for (i = 0; i < pce->num_front_channel_elements; i++)
227 {
228 pce->front_element_is_cpe[i] = faad_get1bit(ld
229 DEBUGVAR(1,26,"program_config_element(): front_element_is_cpe"));
230 pce->front_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
231 DEBUGVAR(1,27,"program_config_element(): front_element_tag_select"));
232
233 if (pce->front_element_is_cpe[i] & 1)
234 {
235 pce->cpe_channel[pce->front_element_tag_select[i]] = pce->channels;
236 pce->num_front_channels += 2;
237 pce->channels += 2;
238 } else {
239 pce->sce_channel[pce->front_element_tag_select[i]] = pce->channels;
240 pce->num_front_channels++;
241 pce->channels++;
242 }
243 }
244
245 for (i = 0; i < pce->num_side_channel_elements; i++)
246 {
247 pce->side_element_is_cpe[i] = faad_get1bit(ld
248 DEBUGVAR(1,28,"program_config_element(): side_element_is_cpe"));
249 pce->side_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
250 DEBUGVAR(1,29,"program_config_element(): side_element_tag_select"));
251
252 if (pce->side_element_is_cpe[i] & 1)
253 {
254 pce->cpe_channel[pce->side_element_tag_select[i]] = pce->channels;
255 pce->num_side_channels += 2;
256 pce->channels += 2;
257 } else {
258 pce->sce_channel[pce->side_element_tag_select[i]] = pce->channels;
259 pce->num_side_channels++;
260 pce->channels++;
261 }
262 }
263
264 for (i = 0; i < pce->num_back_channel_elements; i++)
265 {
266 pce->back_element_is_cpe[i] = faad_get1bit(ld
267 DEBUGVAR(1,30,"program_config_element(): back_element_is_cpe"));
268 pce->back_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
269 DEBUGVAR(1,31,"program_config_element(): back_element_tag_select"));
270
271 if (pce->back_element_is_cpe[i] & 1)
272 {
273 pce->cpe_channel[pce->back_element_tag_select[i]] = pce->channels;
274 pce->channels += 2;
275 pce->num_back_channels += 2;
276 } else {
277 pce->sce_channel[pce->back_element_tag_select[i]] = pce->channels;
278 pce->num_back_channels++;
279 pce->channels++;
280 }
281 }
282
283 for (i = 0; i < pce->num_lfe_channel_elements; i++)
284 {
285 pce->lfe_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
286 DEBUGVAR(1,32,"program_config_element(): lfe_element_tag_select"));
287
288 pce->sce_channel[pce->lfe_element_tag_select[i]] = pce->channels;
289 pce->num_lfe_channels++;
290 pce->channels++;
291 }
292
293 for (i = 0; i < pce->num_assoc_data_elements; i++)
294 pce->assoc_data_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
295 DEBUGVAR(1,33,"program_config_element(): assoc_data_element_tag_select"));
296
297 for (i = 0; i < pce->num_valid_cc_elements; i++)
298 {
299 pce->cc_element_is_ind_sw[i] = faad_get1bit(ld
300 DEBUGVAR(1,34,"program_config_element(): cc_element_is_ind_sw"));
301 pce->valid_cc_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
302 DEBUGVAR(1,35,"program_config_element(): valid_cc_element_tag_select"));
303 }
304
305 faad_byte_align(ld);
306
307 pce->comment_field_bytes = (uint8_t)faad_getbits(ld, 8
308 DEBUGVAR(1,36,"program_config_element(): comment_field_bytes"));
309
310 for (i = 0; i < pce->comment_field_bytes; i++)
311 {
312 pce->comment_field_data[i] = (uint8_t)faad_getbits(ld, 8
313 DEBUGVAR(1,37,"program_config_element(): comment_field_data"));
314 }
315 pce->comment_field_data[i] = 0;
316
317 if (pce->channels > MAX_CHANNELS)
318 return 22;
319
320 return 0;
321 }
322
323 static void decode_sce_lfe(NeAACDecHandle hDecoder,
324 NeAACDecFrameInfo *hInfo, bitfile *ld,
325 uint8_t id_syn_ele)
326 {
327 uint8_t channels = hDecoder->fr_channels;
328 uint8_t tag = 0;
329
330 if (channels+1 > MAX_CHANNELS)
331 {
332 hInfo->error = 12;
333 return;
334 }
335 if (hDecoder->fr_ch_ele+1 > MAX_SYNTAX_ELEMENTS)
336 {
337 hInfo->error = 13;
338 return;
339 }
340
341 /* for SCE hDecoder->element_output_channels[] is not set here because this
342 can become 2 when some form of Parametric Stereo coding is used
343 */
344
345 /* save the syntax element id */
346 hDecoder->element_id[hDecoder->fr_ch_ele] = id_syn_ele;
347
348 /* decode the element */
349 hInfo->error = single_lfe_channel_element(hDecoder, ld, channels, &tag);
350
351 /* map output channels position to internal data channels */
352 if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 2)
353 {
354 /* this might be faulty when pce_set is true */
355 hDecoder->internal_channel[channels] = channels;
356 hDecoder->internal_channel[channels+1] = channels+1;
357 } else {
358 if (hDecoder->pce_set)
359 hDecoder->internal_channel[hDecoder->pce.sce_channel[tag]] = channels;
360 else
361 hDecoder->internal_channel[channels] = channels;
362 }
363
364 hDecoder->fr_channels += hDecoder->element_output_channels[hDecoder->fr_ch_ele];
365 hDecoder->fr_ch_ele++;
366 }
367
368 static void decode_cpe(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld,
369 uint8_t id_syn_ele)
370 {
371 uint8_t channels = hDecoder->fr_channels;
372 uint8_t tag = 0;
373
374 if (channels+2 > MAX_CHANNELS)
375 {
376 hInfo->error = 12;
377 return;
378 }
379 if (hDecoder->fr_ch_ele+1 > MAX_SYNTAX_ELEMENTS)
380 {
381 hInfo->error = 13;
382 return;
383 }
384
385 /* for CPE the number of output channels is always 2 */
386 if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 0)
387 {
388 /* element_output_channels not set yet */
389 hDecoder->element_output_channels[hDecoder->fr_ch_ele] = 2;
390 } else if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] != 2) {
391 /* element inconsistency */
392 hInfo->error = 21;
393 return;
394 }
395
396 /* save the syntax element id */
397 hDecoder->element_id[hDecoder->fr_ch_ele] = id_syn_ele;
398
399 /* decode the element */
400 hInfo->error = channel_pair_element(hDecoder, ld, channels, &tag);
401
402 /* map output channel position to internal data channels */
403 if (hDecoder->pce_set)
404 {
405 hDecoder->internal_channel[hDecoder->pce.cpe_channel[tag]] = channels;
406 hDecoder->internal_channel[hDecoder->pce.cpe_channel[tag]+1] = channels+1;
407 } else {
408 hDecoder->internal_channel[channels] = channels;
409 hDecoder->internal_channel[channels+1] = channels+1;
410 }
411
412 hDecoder->fr_channels += 2;
413 hDecoder->fr_ch_ele++;
414 }
415
416 void raw_data_block(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
417 bitfile *ld, program_config *pce, drc_info *drc)
418 {
419 uint8_t id_syn_ele;
420 uint8_t ele_this_frame = 0;
421
422 hDecoder->fr_channels = 0;
423 hDecoder->fr_ch_ele = 0;
424 hDecoder->first_syn_ele = 25;
425 hDecoder->has_lfe = 0;
426
427 #ifdef ERROR_RESILIENCE
428 if (hDecoder->object_type < ER_OBJECT_START)
429 {
430 #endif
431 /* Table 4.4.3: raw_data_block() */
432 while ((id_syn_ele = (uint8_t)faad_getbits(ld, LEN_SE_ID
433 DEBUGVAR(1,4,"NeAACDecDecode(): id_syn_ele"))) != ID_END)
434 {
435 switch (id_syn_ele) {
436 case ID_SCE:
437 ele_this_frame++;
438 if (hDecoder->first_syn_ele == 25) hDecoder->first_syn_ele = id_syn_ele;
439 decode_sce_lfe(hDecoder, hInfo, ld, id_syn_ele);
440 if (hInfo->error > 0)
441 return;
442 break;
443 case ID_CPE:
444 ele_this_frame++;
445 if (hDecoder->first_syn_ele == 25) hDecoder->first_syn_ele = id_syn_ele;
446 decode_cpe(hDecoder, hInfo, ld, id_syn_ele);
447 if (hInfo->error > 0)
448 return;
449 break;
450 case ID_LFE:
451 #ifdef DRM
452 hInfo->error = 32;
453 #else
454 ele_this_frame++;
455 hDecoder->has_lfe++;
456 decode_sce_lfe(hDecoder, hInfo, ld, id_syn_ele);
457 #endif
458 if (hInfo->error > 0)
459 return;
460 break;
461 case ID_CCE: /* not implemented yet, but skip the bits */
462 #ifdef DRM
463 hInfo->error = 32;
464 #else
465 ele_this_frame++;
466 #ifdef COUPLING_DEC
467 hInfo->error = coupling_channel_element(hDecoder, ld);
468 #else
469 hInfo->error = 6;
470 #endif
471 #endif
472 if (hInfo->error > 0)
473 return;
474 break;
475 case ID_DSE:
476 ele_this_frame++;
477 data_stream_element(hDecoder, ld);
478 break;
479 case ID_PCE:
480 if (ele_this_frame != 0)
481 {
482 hInfo->error = 31;
483 return;
484 }
485 ele_this_frame++;
486 /* 14496-4: 5.6.4.1.2.1.3: */
487 /* program_configuration_element()'s in access units shall be ignored */
488 program_config_element(pce, ld);
489 //if ((hInfo->error = program_config_element(pce, ld)) > 0)
490 // return;
491 //hDecoder->pce_set = 1;
492 break;
493 case ID_FIL:
494 ele_this_frame++;
495 /* one sbr_info describes a channel_element not a channel! */
496 /* if we encounter SBR data here: error */
497 /* SBR data will be read directly in the SCE/LFE/CPE element */
498 if ((hInfo->error = fill_element(hDecoder, ld, drc
499 #ifdef SBR_DEC
500 , INVALID_SBR_ELEMENT
501 #endif
502 )) > 0)
503 return;
504 break;
505 }
506 }
507 #ifdef ERROR_RESILIENCE
508 } else {
509 /* Table 262: er_raw_data_block() */
510 switch (hDecoder->channelConfiguration)
511 {
512 case 1:
513 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
514 if (hInfo->error > 0)
515 return;
516 break;
517 case 2:
518 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
519 if (hInfo->error > 0)
520 return;
521 break;
522 case 3:
523 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
524 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
525 if (hInfo->error > 0)
526 return;
527 break;
528 case 4:
529 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
530 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
531 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
532 if (hInfo->error > 0)
533 return;
534 break;
535 case 5:
536 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
537 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
538 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
539 if (hInfo->error > 0)
540 return;
541 break;
542 case 6:
543 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
544 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
545 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
546 decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE);
547 if (hInfo->error > 0)
548 return;
549 break;
550 case 7: /* 8 channels */
551 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
552 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
553 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
554 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
555 decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE);
556 if (hInfo->error > 0)
557 return;
558 break;
559 default:
560 hInfo->error = 7;
561 return;
562 }
563 #if 0
564 cnt = bits_to_decode() / 8;
565 while (cnt >= 1)
566 {
567 cnt -= extension_payload(cnt);
568 }
569 #endif
570 }
571 #endif
572
573 /* new in corrigendum 14496-3:2002 */
574 #ifdef DRM
575 if (hDecoder->object_type != DRM_ER_LC)
576 #endif
577 {
578 faad_byte_align(ld);
579 }
580
581 return;
582 }
583
584 /* Table 4.4.4 and */
585 /* Table 4.4.9 */
586 static uint8_t single_lfe_channel_element(NeAACDecHandle hDecoder, bitfile *ld,
587 uint8_t channel, uint8_t *tag)
588 {
589 uint8_t retval = 0;
590 element sce = {0};
591 ic_stream *ics = &(sce.ics1);
592 ALIGN int16_t spec_data[1024] = {0};
593
594 sce.element_instance_tag = (uint8_t)faad_getbits(ld, LEN_TAG
595 DEBUGVAR(1,38,"single_lfe_channel_element(): element_instance_tag"));
596
597 *tag = sce.element_instance_tag;
598 sce.channel = channel;
599 sce.paired_channel = -1;
600
601 retval = individual_channel_stream(hDecoder, &sce, ld, ics, 0, spec_data);
602 if (retval > 0)
603 return retval;
604
605 /* IS not allowed in single channel */
606 if (ics->is_used)
607 return 32;
608
609 #ifdef SBR_DEC
610 /* check if next bitstream element is a fill element */
611 /* if so, read it now so SBR decoding can be done in case of a file with SBR */
612 if (faad_showbits(ld, LEN_SE_ID) == ID_FIL)
613 {
614 faad_flushbits(ld, LEN_SE_ID);
615
616 /* one sbr_info describes a channel_element not a channel! */
617 if ((retval = fill_element(hDecoder, ld, hDecoder->drc, hDecoder->fr_ch_ele)) > 0)
618 {
619 return retval;
620 }
621 }
622 #endif
623
624 /* noiseless coding is done, spectral reconstruction is done now */
625 retval = reconstruct_single_channel(hDecoder, ics, &sce, spec_data);
626 if (retval > 0)
627 return retval;
628
629 return 0;
630 }
631
632 /* Table 4.4.5 */
633 static uint8_t channel_pair_element(NeAACDecHandle hDecoder, bitfile *ld,
634 uint8_t channels, uint8_t *tag)
635 {
636 ALIGN int16_t spec_data1[1024] = {0};
637 ALIGN int16_t spec_data2[1024] = {0};
638 element cpe = {0};
639 ic_stream *ics1 = &(cpe.ics1);
640 ic_stream *ics2 = &(cpe.ics2);
641 uint8_t result;
642
643 cpe.channel = channels;
644 cpe.paired_channel = channels+1;
645
646 cpe.element_instance_tag = (uint8_t)faad_getbits(ld, LEN_TAG
647 DEBUGVAR(1,39,"channel_pair_element(): element_instance_tag"));
648 *tag = cpe.element_instance_tag;
649
650 if ((cpe.common_window = faad_get1bit(ld
651 DEBUGVAR(1,40,"channel_pair_element(): common_window"))) & 1)
652 {
653 /* both channels have common ics information */
654 if ((result = ics_info(hDecoder, ics1, ld, cpe.common_window)) > 0)
655 return result;
656
657 ics1->ms_mask_present = (uint8_t)faad_getbits(ld, 2
658 DEBUGVAR(1,41,"channel_pair_element(): ms_mask_present"));
659 if (ics1->ms_mask_present == 3)
660 {
661 /* bitstream error */
662 return 32;
663 }
664 if (ics1->ms_mask_present == 1)
665 {
666 uint8_t g, sfb;
667 for (g = 0; g < ics1->num_window_groups; g++)
668 {
669 for (sfb = 0; sfb < ics1->max_sfb; sfb++)
670 {
671 ics1->ms_used[g][sfb] = faad_get1bit(ld
672 DEBUGVAR(1,42,"channel_pair_element(): faad_get1bit"));
673 }
674 }
675 }
676
677 #ifdef ERROR_RESILIENCE
678 if ((hDecoder->object_type >= ER_OBJECT_START) && (ics1->predictor_data_present))
679 {
680 if ((
681 #ifdef LTP_DEC
682 ics1->ltp.data_present =
683 #endif
684 faad_get1bit(ld DEBUGVAR(1,50,"channel_pair_element(): ltp.data_present"))) & 1)
685 {
686 #ifdef LTP_DEC
687 if ((result = ltp_data(hDecoder, ics1, &(ics1->ltp), ld)) > 0)
688 {
689 return result;
690 }
691 #else
692 return 26;
693 #endif
694 }
695 }
696 #endif
697
698 memcpy(ics2, ics1, sizeof(ic_stream));
699 } else {
700 ics1->ms_mask_present = 0;
701 }
702
703 if ((result = individual_channel_stream(hDecoder, &cpe, ld, ics1,
704 0, spec_data1)) > 0)
705 {
706 return result;
707 }
708
709 #ifdef ERROR_RESILIENCE
710 if (cpe.common_window && (hDecoder->object_type >= ER_OBJECT_START) &&
711 (ics1->predictor_data_present))
712 {
713 if ((
714 #ifdef LTP_DEC
715 ics1->ltp2.data_present =
716 #endif
717 faad_get1bit(ld DEBUGVAR(1,50,"channel_pair_element(): ltp.data_present"))) & 1)
718 {
719 #ifdef LTP_DEC
720 if ((result = ltp_data(hDecoder, ics1, &(ics1->ltp2), ld)) > 0)
721 {
722 return result;
723 }
724 #else
725 return 26;
726 #endif
727 }
728 }
729 #endif
730
731 if ((result = individual_channel_stream(hDecoder, &cpe, ld, ics2,
732 0, spec_data2)) > 0)
733 {
734 return result;
735 }
736
737 #ifdef SBR_DEC
738 /* check if next bitstream element is a fill element */
739 /* if so, read it now so SBR decoding can be done in case of a file with SBR */
740 if (faad_showbits(ld, LEN_SE_ID) == ID_FIL)
741 {
742 faad_flushbits(ld, LEN_SE_ID);
743
744 /* one sbr_info describes a channel_element not a channel! */
745 if ((result = fill_element(hDecoder, ld, hDecoder->drc, hDecoder->fr_ch_ele)) > 0)
746 {
747 return result;
748 }
749 }
750 #endif
751
752 /* noiseless coding is done, spectral reconstruction is done now */
753 if ((result = reconstruct_channel_pair(hDecoder, ics1, ics2, &cpe,
754 spec_data1, spec_data2)) > 0)
755 {
756 return result;
757 }
758
759 return 0;
760 }
761
762 /* Table 4.4.6 */
763 static uint8_t ics_info(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
764 uint8_t common_window)
765 {
766 uint8_t retval = 0;
767 uint8_t ics_reserved_bit;
768
769 ics_reserved_bit = faad_get1bit(ld
770 DEBUGVAR(1,43,"ics_info(): ics_reserved_bit"));
771 if (ics_reserved_bit != 0)
772 return 32;
773 ics->window_sequence = (uint8_t)faad_getbits(ld, 2
774 DEBUGVAR(1,44,"ics_info(): window_sequence"));
775 ics->window_shape = faad_get1bit(ld
776 DEBUGVAR(1,45,"ics_info(): window_shape"));
777
778 #ifdef LD_DEC
779 /* No block switching in LD */
780 if ((hDecoder->object_type == LD) && (ics->window_sequence != ONLY_LONG_SEQUENCE))
781 return 32;
782 #endif
783
784 if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
785 {
786 ics->max_sfb = (uint8_t)faad_getbits(ld, 4
787 DEBUGVAR(1,46,"ics_info(): max_sfb (short)"));
788 ics->scale_factor_grouping = (uint8_t)faad_getbits(ld, 7
789 DEBUGVAR(1,47,"ics_info(): scale_factor_grouping"));
790 } else {
791 ics->max_sfb = (uint8_t)faad_getbits(ld, 6
792 DEBUGVAR(1,48,"ics_info(): max_sfb (long)"));
793 }
794
795 /* get the grouping information */
796 if ((retval = window_grouping_info(hDecoder, ics)) > 0)
797 return retval;
798
799
800 /* should be an error */
801 /* check the range of max_sfb */
802 if (ics->max_sfb > ics->num_swb)
803 return 16;
804
805 if (ics->window_sequence != EIGHT_SHORT_SEQUENCE)
806 {
807 if ((ics->predictor_data_present = faad_get1bit(ld
808 DEBUGVAR(1,49,"ics_info(): predictor_data_present"))) & 1)
809 {
810 if (hDecoder->object_type == MAIN) /* MPEG2 style AAC predictor */
811 {
812 uint8_t sfb;
813
814 uint8_t limit = min(ics->max_sfb, max_pred_sfb(hDecoder->sf_index));
815 #ifdef MAIN_DEC
816 ics->pred.limit = limit;
817 #endif
818
819 if ((
820 #ifdef MAIN_DEC
821 ics->pred.predictor_reset =
822 #endif
823 faad_get1bit(ld DEBUGVAR(1,53,"ics_info(): pred.predictor_reset"))) & 1)
824 {
825 #ifdef MAIN_DEC
826 ics->pred.predictor_reset_group_number =
827 #endif
828 (uint8_t)faad_getbits(ld, 5 DEBUGVAR(1,54,"ics_info(): pred.predictor_reset_group_number"));
829 }
830
831 for (sfb = 0; sfb < limit; sfb++)
832 {
833 #ifdef MAIN_DEC
834 ics->pred.prediction_used[sfb] =
835 #endif
836 faad_get1bit(ld DEBUGVAR(1,55,"ics_info(): pred.prediction_used"));
837 }
838 }
839 #ifdef LTP_DEC
840 else { /* Long Term Prediction */
841 if (hDecoder->object_type < ER_OBJECT_START)
842 {
843 if ((ics->ltp.data_present = faad_get1bit(ld
844 DEBUGVAR(1,50,"ics_info(): ltp.data_present"))) & 1)
845 {
846 if ((retval = ltp_data(hDecoder, ics, &(ics->ltp), ld)) > 0)
847 {
848 return retval;
849 }
850 }
851 if (common_window)
852 {
853 if ((ics->ltp2.data_present = faad_get1bit(ld
854 DEBUGVAR(1,51,"ics_info(): ltp2.data_present"))) & 1)
855 {
856 if ((retval = ltp_data(hDecoder, ics, &(ics->ltp2), ld)) > 0)
857 {
858 return retval;
859 }
860 }
861 }
862 }
863 #ifdef ERROR_RESILIENCE
864 if (!common_window && (hDecoder->object_type >= ER_OBJECT_START))
865 {
866 if ((ics->ltp.data_present = faad_get1bit(ld
867 DEBUGVAR(1,50,"ics_info(): ltp.data_present"))) & 1)
868 {
869 ltp_data(hDecoder, ics, &(ics->ltp), ld);
870 }
871 }
872 #endif
873 }
874 #endif
875 }
876 }
877
878 return retval;
879 }
880
881 /* Table 4.4.7 */
882 static uint8_t pulse_data(ic_stream *ics, pulse_info *pul, bitfile *ld)
883 {
884 uint8_t i;
885
886 pul->number_pulse = (uint8_t)faad_getbits(ld, 2
887 DEBUGVAR(1,56,"pulse_data(): number_pulse"));
888 pul->pulse_start_sfb = (uint8_t)faad_getbits(ld, 6
889 DEBUGVAR(1,57,"pulse_data(): pulse_start_sfb"));
890
891 /* check the range of pulse_start_sfb */
892 if (pul->pulse_start_sfb > ics->num_swb)
893 return 16;
894
895 for (i = 0; i < pul->number_pulse+1; i++)
896 {
897 pul->pulse_offset[i] = (uint8_t)faad_getbits(ld, 5
898 DEBUGVAR(1,58,"pulse_data(): pulse_offset"));
899 #if 0
900 printf("%d\n", pul->pulse_offset[i]);
901 #endif
902 pul->pulse_amp[i] = (uint8_t)faad_getbits(ld, 4
903 DEBUGVAR(1,59,"pulse_data(): pulse_amp"));
904 #if 0
905 printf("%d\n", pul->pulse_amp[i]);
906 #endif
907 }
908
909 return 0;
910 }
911
912 #ifdef COUPLING_DEC
913 /* Table 4.4.8: Currently just for skipping the bits... */
914 static uint8_t coupling_channel_element(NeAACDecHandle hDecoder, bitfile *ld)
915 {
916 uint8_t c, result = 0;
917 uint8_t ind_sw_cce_flag = 0;
918 uint8_t num_gain_element_lists = 0;
919 uint8_t num_coupled_elements = 0;
920
921 element el_empty = {0};
922 ic_stream ics_empty = {0};
923 int16_t sh_data[1024];
924
925 c = faad_getbits(ld, LEN_TAG
926 DEBUGVAR(1,900,"coupling_channel_element(): element_instance_tag"));
927
928 ind_sw_cce_flag = faad_get1bit(ld
929 DEBUGVAR(1,901,"coupling_channel_element(): ind_sw_cce_flag"));
930 num_coupled_elements = faad_getbits(ld, 3
931 DEBUGVAR(1,902,"coupling_channel_element(): num_coupled_elements"));
932
933 for (c = 0; c < num_coupled_elements + 1; c++)
934 {
935 uint8_t cc_target_is_cpe, cc_target_tag_select;
936
937 num_gain_element_lists++;
938
939 cc_target_is_cpe = faad_get1bit(ld
940 DEBUGVAR(1,903,"coupling_channel_element(): cc_target_is_cpe"));
941 cc_target_tag_select = faad_getbits(ld, 4
942 DEBUGVAR(1,904,"coupling_channel_element(): cc_target_tag_select"));
943
944 if (cc_target_is_cpe)
945 {
946 uint8_t cc_l = faad_get1bit(ld
947 DEBUGVAR(1,905,"coupling_channel_element(): cc_l"));
948 uint8_t cc_r = faad_get1bit(ld
949 DEBUGVAR(1,906,"coupling_channel_element(): cc_r"));
950
951 if (cc_l && cc_r)
952 num_gain_element_lists++;
953 }
954 }
955
956 faad_get1bit(ld
957 DEBUGVAR(1,907,"coupling_channel_element(): cc_domain"));
958 faad_get1bit(ld
959 DEBUGVAR(1,908,"coupling_channel_element(): gain_element_sign"));
960 faad_getbits(ld, 2
961 DEBUGVAR(1,909,"coupling_channel_element(): gain_element_scale"));
962
963 if ((result = individual_channel_stream(hDecoder, &el_empty, ld, &ics_empty,
964 0, sh_data)) > 0)
965 {
966 return result;
967 }
968
969 /* IS not allowed in single channel */
970 if (ics->is_used)
971 return 32;
972
973 for (c = 1; c < num_gain_element_lists; c++)
974 {
975 uint8_t cge;
976
977 if (ind_sw_cce_flag)
978 {
979 cge = 1;
980 } else {
981 cge = faad_get1bit(ld
982 DEBUGVAR(1,910,"coupling_channel_element(): common_gain_element_present"));
983 }
984
985 if (cge)
986 {
987 huffman_scale_factor(ld);
988 } else {
989 uint8_t g, sfb;
990
991 for (g = 0; g < ics_empty.num_window_groups; g++)
992 {
993 for (sfb = 0; sfb < ics_empty.max_sfb; sfb++)
994 {
995 if (ics_empty.sfb_cb[g][sfb] != ZERO_HCB)
996 huffman_scale_factor(ld);
997 }
998 }
999 }
1000 }
1001
1002 return 0;
1003 }
1004 #endif
1005
1006 /* Table 4.4.10 */
1007 static uint16_t data_stream_element(NeAACDecHandle hDecoder, bitfile *ld)
1008 {
1009 uint8_t byte_aligned;
1010 uint16_t i, count;
1011
1012 /* element_instance_tag = */ faad_getbits(ld, LEN_TAG
1013 DEBUGVAR(1,60,"data_stream_element(): element_instance_tag"));
1014 byte_aligned = faad_get1bit(ld
1015 DEBUGVAR(1,61,"data_stream_element(): byte_aligned"));
1016 count = (uint16_t)faad_getbits(ld, 8
1017 DEBUGVAR(1,62,"data_stream_element(): count"));
1018 if (count == 255)
1019 {
1020 count += (uint16_t)faad_getbits(ld, 8
1021 DEBUGVAR(1,63,"data_stream_element(): extra count"));
1022 }
1023 if (byte_aligned)
1024 faad_byte_align(ld);
1025
1026 for (i = 0; i < count; i++)
1027 {
1028 faad_getbits(ld, LEN_BYTE
1029 DEBUGVAR(1,64,"data_stream_element(): data_stream_byte"));
1030 }
1031
1032 return count;
1033 }
1034
1035 /* Table 4.4.11 */
1036 static uint8_t fill_element(NeAACDecHandle hDecoder, bitfile *ld, drc_info *drc
1037 #ifdef SBR_DEC
1038 ,uint8_t sbr_ele
1039 #endif
1040 )
1041 {
1042 uint16_t count;
1043 #ifdef SBR_DEC
1044 uint8_t bs_extension_type;
1045 #endif
1046
1047 count = (uint16_t)faad_getbits(ld, 4
1048 DEBUGVAR(1,65,"fill_element(): count"));
1049 if (count == 15)
1050 {
1051 count += (uint16_t)faad_getbits(ld, 8
1052 DEBUGVAR(1,66,"fill_element(): extra count")) - 1;
1053 }
1054
1055 if (count > 0)
1056 {
1057 #ifdef SBR_DEC
1058 bs_extension_type = (uint8_t)faad_showbits(ld, 4);
1059
1060 if ((bs_extension_type == EXT_SBR_DATA) ||
1061 (bs_extension_type == EXT_SBR_DATA_CRC))
1062 {
1063 if (sbr_ele == INVALID_SBR_ELEMENT)
1064 return 24;
1065
1066 if (!hDecoder->sbr[sbr_ele])
1067 {
1068 hDecoder->sbr[sbr_ele] = sbrDecodeInit(hDecoder->frameLength,
1069 hDecoder->element_id[sbr_ele], 2*get_sample_rate(hDecoder->sf_index),
1070 hDecoder->downSampledSBR
1071 #ifdef DRM
1072 , 0
1073 #endif
1074 );
1075 }
1076
1077 hDecoder->sbr_present_flag = 1;
1078
1079 /* parse the SBR data */
1080 hDecoder->sbr[sbr_ele]->ret = sbr_extension_data(ld, hDecoder->sbr[sbr_ele], count,
1081 hDecoder->postSeekResetFlag);
1082
1083 #if 0
1084 if (hDecoder->sbr[sbr_ele]->ret > 0)
1085 {
1086 printf("%s\n", NeAACDecGetErrorMessage(hDecoder->sbr[sbr_ele]->ret));
1087 }
1088 #endif
1089
1090 #if (defined(PS_DEC) || defined(DRM_PS))
1091 if (hDecoder->sbr[sbr_ele]->ps_used)
1092 {
1093 hDecoder->ps_used[sbr_ele] = 1;
1094
1095 /* set element independent flag to 1 as well */
1096 hDecoder->ps_used_global = 1;
1097 }
1098 #endif
1099 } else {
1100 #endif
1101 #ifndef DRM
1102 while (count > 0)
1103 {
1104 count -= extension_payload(ld, drc, count);
1105 }
1106 #else
1107 return 30;
1108 #endif
1109 #ifdef SBR_DEC
1110 }
1111 #endif
1112 }
1113
1114 return 0;
1115 }
1116
1117 /* Table 4.4.12 */
1118 #ifdef SSR_DEC
1119 static void gain_control_data(bitfile *ld, ic_stream *ics)
1120 {
1121 uint8_t bd, wd, ad;
1122 ssr_info *ssr = &(ics->ssr);
1123
1124 ssr->max_band = (uint8_t)faad_getbits(ld, 2
1125 DEBUGVAR(1,1000,"gain_control_data(): max_band"));
1126
1127 if (ics->window_sequence == ONLY_LONG_SEQUENCE)
1128 {
1129 for (bd = 1; bd <= ssr->max_band; bd++)
1130 {
1131 for (wd = 0; wd < 1; wd++)
1132 {
1133 ssr->adjust_num[bd][wd] = (uint8_t)faad_getbits(ld, 3
1134 DEBUGVAR(1,1001,"gain_control_data(): adjust_num"));
1135
1136 for (ad = 0; ad < ssr->adjust_num[bd][wd]; ad++)
1137 {
1138 ssr->alevcode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 4
1139 DEBUGVAR(1,1002,"gain_control_data(): alevcode"));
1140 ssr->aloccode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 5
1141 DEBUGVAR(1,1003,"gain_control_data(): aloccode"));
1142 }
1143 }
1144 }
1145 } else if (ics->window_sequence == LONG_START_SEQUENCE) {
1146 for (bd = 1; bd <= ssr->max_band; bd++)
1147 {
1148 for (wd = 0; wd < 2; wd++)
1149 {
1150 ssr->adjust_num[bd][wd] = (uint8_t)faad_getbits(ld, 3
1151 DEBUGVAR(1,1001,"gain_control_data(): adjust_num"));
1152
1153 for (ad = 0; ad < ssr->adjust_num[bd][wd]; ad++)
1154 {
1155 ssr->alevcode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 4
1156 DEBUGVAR(1,1002,"gain_control_data(): alevcode"));
1157 if (wd == 0)
1158 {
1159 ssr->aloccode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 4
1160 DEBUGVAR(1,1003,"gain_control_data(): aloccode"));
1161 } else {
1162 ssr->aloccode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 2
1163 DEBUGVAR(1,1003,"gain_control_data(): aloccode"));
1164 }
1165 }
1166 }
1167 }
1168 } else if (ics->window_sequence == EIGHT_SHORT_SEQUENCE) {
1169 for (bd = 1; bd <= ssr->max_band; bd++)
1170 {
1171 for (wd = 0; wd < 8; wd++)
1172 {
1173 ssr->adjust_num[bd][wd] = (uint8_t)faad_getbits(ld, 3
1174 DEBUGVAR(1,1001,"gain_control_data(): adjust_num"));
1175
1176 for (ad = 0; ad < ssr->adjust_num[bd][wd]; ad++)
1177 {
1178 ssr->alevcode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 4
1179 DEBUGVAR(1,1002,"gain_control_data(): alevcode"));
1180 ssr->aloccode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 2
1181 DEBUGVAR(1,1003,"gain_control_data(): aloccode"));
1182 }
1183 }
1184 }
1185 } else if (ics->window_sequence == LONG_STOP_SEQUENCE) {
1186 for (bd = 1; bd <= ssr->max_band; bd++)
1187 {
1188 for (wd = 0; wd < 2; wd++)
1189 {
1190 ssr->adjust_num[bd][wd] = (uint8_t)faad_getbits(ld, 3
1191 DEBUGVAR(1,1001,"gain_control_data(): adjust_num"));
1192
1193 for (ad = 0; ad < ssr->adjust_num[bd][wd]; ad++)
1194 {
1195 ssr->alevcode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 4
1196 DEBUGVAR(1,1002,"gain_control_data(): alevcode"));
1197
1198 if (wd == 0)
1199 {
1200 ssr->aloccode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 4
1201 DEBUGVAR(1,1003,"gain_control_data(): aloccode"));
1202 } else {
1203 ssr->aloccode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 5
1204 DEBUGVAR(1,1003,"gain_control_data(): aloccode"));
1205 }
1206 }
1207 }
1208 }
1209 }
1210 }
1211 #endif
1212
1213 #ifdef DRM
1214 /* Table 4.4.13 ASME */
1215 void DRM_aac_scalable_main_element(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
1216 bitfile *ld, program_config *pce, drc_info *drc)
1217 {
1218 uint8_t retval = 0;
1219 uint8_t channels = hDecoder->fr_channels = 0;
1220 uint8_t ch;
1221 uint8_t this_layer_stereo = (hDecoder->channelConfiguration > 1) ? 1 : 0;
1222 element cpe = {0};
1223 ic_stream *ics1 = &(cpe.ics1);
1224 ic_stream *ics2 = &(cpe.ics2);
1225 int16_t *spec_data;
1226 ALIGN int16_t spec_data1[1024] = {0};
1227 ALIGN int16_t spec_data2[1024] = {0};
1228
1229 hDecoder->fr_ch_ele = 0;
1230
1231 hInfo->error = DRM_aac_scalable_main_header(hDecoder, ics1, ics2, ld, this_layer_stereo);
1232 if (hInfo->error > 0)
1233 return;
1234
1235 cpe.common_window = 1;
1236 if (this_layer_stereo)
1237 {
1238 hDecoder->element_id[0] = ID_CPE;
1239 if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 0)
1240 hDecoder->element_output_channels[hDecoder->fr_ch_ele] = 2;
1241 } else {
1242 hDecoder->element_id[0] = ID_SCE;
1243 }
1244
1245 if (this_layer_stereo)
1246 {
1247 cpe.channel = 0;
1248 cpe.paired_channel = 1;
1249 }
1250
1251
1252 /* Stereo2 / Mono1 */
1253 ics1->tns_data_present = faad_get1bit(ld);
1254
1255 #if defined(LTP_DEC)
1256 ics1->ltp.data_present = faad_get1bit(ld);
1257 #elif defined (DRM)
1258 if(faad_get1bit(ld)) {
1259 hInfo->error = 26;
1260 return;
1261 }
1262 #else
1263 faad_get1bit(ld);
1264 #endif
1265
1266 hInfo->error = side_info(hDecoder, &cpe, ld, ics1, 1);
1267 if (hInfo->error > 0)
1268 return;
1269 if (this_layer_stereo)
1270 {
1271 /* Stereo3 */
1272 ics2->tns_data_present = faad_get1bit(ld);
1273 #ifdef LTP_DEC
1274 ics1->ltp.data_present =
1275 #endif
1276 faad_get1bit(ld);
1277 hInfo->error = side_info(hDecoder, &cpe, ld, ics2, 1);
1278 if (hInfo->error > 0)
1279 return;
1280 }
1281 /* Stereo4 / Mono2 */
1282 if (ics1->tns_data_present)
1283 tns_data(ics1, &(ics1->tns), ld);
1284 if (this_layer_stereo)
1285 {
1286 /* Stereo5 */
1287 if (ics2->tns_data_present)
1288 tns_data(ics2, &(ics2->tns), ld);
1289 }
1290
1291 #ifdef DRM
1292 /* CRC check */
1293 if (hDecoder->object_type == DRM_ER_LC)
1294 {
1295 if ((hInfo->error = (uint8_t)faad_check_CRC(ld, (uint16_t)faad_get_processed_bits(ld) - 8)) > 0)
1296 return;
1297 }
1298 #endif
1299
1300 /* Stereo6 / Mono3 */
1301 /* error resilient spectral data decoding */
1302 if ((hInfo->error = reordered_spectral_data(hDecoder, ics1, ld, spec_data1)) > 0)
1303 {
1304 return;
1305 }
1306 if (this_layer_stereo)
1307 {
1308 /* Stereo7 */
1309 /* error resilient spectral data decoding */
1310 if ((hInfo->error = reordered_spectral_data(hDecoder, ics2, ld, spec_data2)) > 0)
1311 {
1312 return;
1313 }
1314 }
1315
1316
1317 #ifdef DRM
1318 #ifdef SBR_DEC
1319 /* In case of DRM we need to read the SBR info before channel reconstruction */
1320 if ((hDecoder->sbr_present_flag == 1) && (hDecoder->object_type == DRM_ER_LC))
1321 {
1322 bitfile ld_sbr = {0};
1323 uint32_t i;
1324 uint16_t count = 0;
1325 uint8_t *revbuffer;
1326 uint8_t *prevbufstart;
1327 uint8_t *pbufend;
1328
1329 /* all forward bitreading should be finished at this point */
1330 uint32_t bitsconsumed = faad_get_processed_bits(ld);
1331 uint32_t buffer_size = faad_origbitbuffer_size(ld);
1332 uint8_t *buffer = (uint8_t*)faad_origbitbuffer(ld);
1333
1334 if (bitsconsumed + 8 > buffer_size*8)
1335 {
1336 hInfo->error = 14;
1337 return;
1338 }
1339
1340 if (!hDecoder->sbr[0])
1341 {
1342 hDecoder->sbr[0] = sbrDecodeInit(hDecoder->frameLength, hDecoder->element_id[0],
1343 2*get_sample_rate(hDecoder->sf_index), 0 /* ds SBR */, 1);
1344 }
1345
1346 /* Reverse bit reading of SBR data in DRM audio frame */
1347 revbuffer = (uint8_t*)faad_malloc(buffer_size*sizeof(uint8_t));
1348 prevbufstart = revbuffer;
1349 pbufend = &buffer[buffer_size - 1];
1350 for (i = 0; i < buffer_size; i++)
1351 *prevbufstart++ = tabFlipbits[*pbufend--];
1352
1353 /* Set SBR data */
1354 /* consider 8 bits from AAC-CRC */
1355 /* SBR buffer size is original buffer size minus AAC buffer size */
1356 count = (uint16_t)bit2byte(buffer_size*8 - bitsconsumed);
1357 faad_initbits(&ld_sbr, revbuffer, count);
1358
1359 hDecoder->sbr[0]->sample_rate = get_sample_rate(hDecoder->sf_index);
1360 hDecoder->sbr[0]->sample_rate *= 2;
1361
1362 faad_getbits(&ld_sbr, 8); /* Skip 8-bit CRC */
1363
1364 hDecoder->sbr[0]->ret = sbr_extension_data(&ld_sbr, hDecoder->sbr[0], count, hDecoder->postSeekResetFlag);
1365 #if (defined(PS_DEC) || defined(DRM_PS))
1366 if (hDecoder->sbr[0]->ps_used)
1367 {
1368 hDecoder->ps_used[0] = 1;
1369 hDecoder->ps_used_global = 1;
1370 }
1371 #endif
1372
1373 if (ld_sbr.error)
1374 {
1375 hDecoder->sbr[0]->ret = 1;
1376 }
1377
1378 /* check CRC */
1379 /* no need to check it if there was already an error */
1380 if (hDecoder->sbr[0]->ret == 0)
1381 hDecoder->sbr[0]->ret = (uint8_t)faad_check_CRC(&ld_sbr, (uint16_t)faad_get_processed_bits(&ld_sbr) - 8);
1382
1383 /* SBR data was corrupted, disable it until the next header */
1384 if (hDecoder->sbr[0]->ret != 0)
1385 {
1386 hDecoder->sbr[0]->header_count = 0;
1387 }
1388
1389 faad_endbits(&ld_sbr);
1390
1391 if (revbuffer)
1392 faad_free(revbuffer);
1393 }
1394 #endif
1395 #endif
1396
1397 if (this_layer_stereo)
1398 {
1399 hInfo->error = reconstruct_channel_pair(hDecoder, ics1, ics2, &cpe, spec_data1, spec_data2);
1400 if (hInfo->error > 0)
1401 return;
1402 } else {
1403 hInfo->error = reconstruct_single_channel(hDecoder, ics1, &cpe, spec_data1);
1404 if (hInfo->error > 0)
1405 return;
1406 }
1407
1408 /* map output channels position to internal data channels */
1409 if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 2)
1410 {
1411 /* this might be faulty when pce_set is true */
1412 hDecoder->internal_channel[channels] = channels;
1413 hDecoder->internal_channel[channels+1] = channels+1;
1414 } else {
1415 hDecoder->internal_channel[channels] = channels;
1416 }
1417
1418 hDecoder->fr_channels += hDecoder->element_output_channels[hDecoder->fr_ch_ele];
1419 hDecoder->fr_ch_ele++;
1420
1421 return;
1422 }
1423
1424 /* Table 4.4.15 */
1425 static int8_t DRM_aac_scalable_main_header(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2,
1426 bitfile *ld, uint8_t this_layer_stereo)
1427 {
1428 uint8_t retval = 0;
1429 uint8_t ch;
1430 ic_stream *ics;
1431 uint8_t ics_reserved_bit;
1432
1433 ics_reserved_bit = faad_get1bit(ld
1434 DEBUGVAR(1,300,"aac_scalable_main_header(): ics_reserved_bits"));
1435 if (ics_reserved_bit != 0)
1436 return 32;
1437 ics1->window_sequence = (uint8_t)faad_getbits(ld, 2
1438 DEBUGVAR(1,301,"aac_scalable_main_header(): window_sequence"));
1439 ics1->window_shape = faad_get1bit(ld
1440 DEBUGVAR(1,302,"aac_scalable_main_header(): window_shape"));
1441
1442 if (ics1->window_sequence == EIGHT_SHORT_SEQUENCE)
1443 {
1444 ics1->max_sfb = (uint8_t)faad_getbits(ld, 4
1445 DEBUGVAR(1,303,"aac_scalable_main_header(): max_sfb (short)"));
1446 ics1->scale_factor_grouping = (uint8_t)faad_getbits(ld, 7
1447 DEBUGVAR(1,304,"aac_scalable_main_header(): scale_factor_grouping"));
1448 } else {
1449 ics1->max_sfb = (uint8_t)faad_getbits(ld, 6
1450 DEBUGVAR(1,305,"aac_scalable_main_header(): max_sfb (long)"));
1451 }
1452
1453 /* get the grouping information */
1454 if ((retval = window_grouping_info(hDecoder, ics1)) > 0)
1455 return retval;
1456
1457 /* should be an error */
1458 /* check the range of max_sfb */
1459 if (ics1->max_sfb > ics1->num_swb)
1460 return 16;
1461
1462 if (this_layer_stereo)
1463 {
1464 ics1->ms_mask_present = (uint8_t)faad_getbits(ld, 2
1465 DEBUGVAR(1,306,"aac_scalable_main_header(): ms_mask_present"));
1466 if (ics1->ms_mask_present == 3)
1467 {
1468 /* bitstream error */
1469 return 32;
1470 }
1471 if (ics1->ms_mask_present == 1)
1472 {
1473 uint8_t g, sfb;
1474 for (g = 0; g < ics1->num_window_groups; g++)
1475 {
1476 for (sfb = 0; sfb < ics1->max_sfb; sfb++)
1477 {
1478 ics1->ms_used[g][sfb] = faad_get1bit(ld
1479 DEBUGVAR(1,307,"aac_scalable_main_header(): faad_get1bit"));
1480 }
1481 }
1482 }
1483
1484 memcpy(ics2, ics1, sizeof(ic_stream));
1485 } else {
1486 ics1->ms_mask_present = 0;
1487 }
1488
1489 return 0;
1490 }
1491 #endif
1492
1493 static uint8_t side_info(NeAACDecHandle hDecoder, element *ele,
1494 bitfile *ld, ic_stream *ics, uint8_t scal_flag)
1495 {
1496 uint8_t result;
1497
1498 ics->global_gain = (uint8_t)faad_getbits(ld, 8
1499 DEBUGVAR(1,67,"individual_channel_stream(): global_gain"));
1500
1501 if (!ele->common_window && !scal_flag)
1502 {
1503 if ((result = ics_info(hDecoder, ics, ld, ele->common_window)) > 0)
1504 return result;
1505 }
1506
1507 if ((result = section_data(hDecoder, ics, ld)) > 0)
1508 return result;
1509
1510 if ((result = scale_factor_data(hDecoder, ics, ld)) > 0)
1511 return result;
1512
1513 if (!scal_flag)
1514 {
1515 /**
1516 ** NOTE: It could be that pulse data is available in scalable AAC too,
1517 ** as said in Amendment 1, this could be only the case for ER AAC,
1518 ** though. (have to check this out later)
1519 **/
1520 /* get pulse data */
1521 if ((ics->pulse_data_present = faad_get1bit(ld
1522 DEBUGVAR(1,68,"individual_channel_stream(): pulse_data_present"))) & 1)
1523 {
1524 if ((result = pulse_data(ics, &(ics->pul), ld)) > 0)
1525 return result;
1526 }
1527
1528 /* get tns data */
1529 if ((ics->tns_data_present = faad_get1bit(ld
1530 DEBUGVAR(1,69,"individual_channel_stream(): tns_data_present"))) & 1)
1531 {
1532 #ifdef ERROR_RESILIENCE
1533 if (hDecoder->object_type < ER_OBJECT_START)
1534 #endif
1535 tns_data(ics, &(ics->tns), ld);
1536 }
1537
1538 /* get gain control data */
1539 if ((ics->gain_control_data_present = faad_get1bit(ld
1540 DEBUGVAR(1,70,"individual_channel_stream(): gain_control_data_present"))) & 1)
1541 {
1542 #ifdef SSR_DEC
1543 if (hDecoder->object_type != SSR)
1544 return 1;
1545 else
1546 gain_control_data(ld, ics);
1547 #else
1548 return 1;
1549 #endif
1550 }
1551 }
1552
1553 #ifdef ERROR_RESILIENCE
1554 if (hDecoder->aacSpectralDataResilienceFlag)
1555 {
1556 ics->length_of_reordered_spectral_data = (uint16_t)faad_getbits(ld, 14
1557 DEBUGVAR(1,147,"individual_channel_stream(): length_of_reordered_spectral_data"));
1558
1559 if (hDecoder->channelConfiguration == 2)
1560 {
1561 if (ics->length_of_reordered_spectral_data > 6144)
1562 ics->length_of_reordered_spectral_data = 6144;
1563 } else {
1564 if (ics->length_of_reordered_spectral_data > 12288)
1565 ics->length_of_reordered_spectral_data = 12288;
1566 }
1567
1568 ics->length_of_longest_codeword = (uint8_t)faad_getbits(ld, 6
1569 DEBUGVAR(1,148,"individual_channel_stream(): length_of_longest_codeword"));
1570 if (ics->length_of_longest_codeword >= 49)
1571 ics->length_of_longest_codeword = 49;
1572 }
1573
1574 /* RVLC spectral data is put here */
1575 if (hDecoder->aacScalefactorDataResilienceFlag)
1576 {
1577 if ((result = rvlc_decode_scale_factors(ics, ld)) > 0)
1578 return result;
1579 }
1580 #endif
1581
1582 return 0;
1583 }
1584
1585 /* Table 4.4.24 */
1586 static uint8_t individual_channel_stream(NeAACDecHandle hDecoder, element *ele,
1587 bitfile *ld, ic_stream *ics, uint8_t scal_flag,
1588 int16_t *spec_data)
1589 {
1590 uint8_t result;
1591
1592 result = side_info(hDecoder, ele, ld, ics, scal_flag);
1593 if (result > 0)
1594 return result;
1595
1596 if (hDecoder->object_type >= ER_OBJECT_START)
1597 {
1598 if (ics->tns_data_present)
1599 tns_data(ics, &(ics->tns), ld);
1600 }
1601
1602 #ifdef DRM
1603 /* CRC check */
1604 if (hDecoder->object_type == DRM_ER_LC)
1605 {
1606 if ((result = (uint8_t)faad_check_CRC(ld, (uint16_t)faad_get_processed_bits(ld) - 8)) > 0)
1607 return result;
1608 }
1609 #endif
1610
1611 #ifdef ERROR_RESILIENCE
1612 if (hDecoder->aacSpectralDataResilienceFlag)
1613 {
1614 /* error resilient spectral data decoding */
1615 if ((result = reordered_spectral_data(hDecoder, ics, ld, spec_data)) > 0)
1616 {
1617 return result;
1618 }
1619 } else {
1620 #endif
1621 /* decode the spectral data */
1622 if ((result = spectral_data(hDecoder, ics, ld, spec_data)) > 0)
1623 {
1624 return result;
1625 }
1626 #ifdef ERROR_RESILIENCE
1627 }
1628 #endif
1629
1630 /* pulse coding reconstruction */
1631 if (ics->pulse_data_present)
1632 {
1633 if (ics->window_sequence != EIGHT_SHORT_SEQUENCE)
1634 {
1635 if ((result = pulse_decode(ics, spec_data, hDecoder->frameLength)) > 0)
1636 return result;
1637 } else {
1638 return 2; /* pulse coding not allowed for short blocks */
1639 }
1640 }
1641
1642 return 0;
1643 }
1644
1645 /* Table 4.4.25 */
1646 static uint8_t section_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld)
1647 {
1648 uint8_t g;
1649 uint8_t sect_esc_val, sect_bits;
1650
1651 if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
1652 sect_bits = 3;
1653 else
1654 sect_bits = 5;
1655 sect_esc_val = (1<<sect_bits) - 1;
1656
1657 #if 0
1658 printf("\ntotal sfb %d\n", ics->max_sfb);
1659 printf(" sect top cb\n");
1660 #endif
1661
1662 for (g = 0; g < ics->num_window_groups; g++)
1663 {
1664 uint8_t k = 0;
1665 uint8_t i = 0;
1666
1667 while (k < ics->max_sfb)
1668 {
1669 #ifdef ERROR_RESILIENCE
1670 uint8_t vcb11 = 0;
1671 #endif
1672 uint8_t sfb;
1673 uint8_t sect_len_incr;
1674 uint16_t sect_len = 0;
1675 uint8_t sect_cb_bits = 4;
1676
1677 /* if "faad_getbits" detects error and returns "0", "k" is never
1678 incremented and we cannot leave the while loop */
1679 if (ld->error != 0)
1680 return 14;
1681
1682 #ifdef ERROR_RESILIENCE
1683 if (hDecoder->aacSectionDataResilienceFlag)
1684 sect_cb_bits = 5;
1685 #endif
1686
1687 ics->sect_cb[g][i] = (uint8_t)faad_getbits(ld, sect_cb_bits
1688 DEBUGVAR(1,71,"section_data(): sect_cb"));
1689
1690 if (ics->sect_cb[g][i] == 12)
1691 return 32;
1692
1693 #if 0
1694 printf("%d\n", ics->sect_cb[g][i]);
1695 #endif
1696
1697 #ifndef DRM
1698 if (ics->sect_cb[g][i] == NOISE_HCB)
1699 ics->noise_used = 1;
1700 #else
1701 /* PNS not allowed in DRM */
1702 if (ics->sect_cb[g][i] == NOISE_HCB)
1703 return 29;
1704 #endif
1705 if (ics->sect_cb[g][i] == INTENSITY_HCB2 || ics->sect_cb[g][i] == INTENSITY_HCB)
1706 ics->is_used = 1;
1707
1708 #ifdef ERROR_RESILIENCE
1709 if (hDecoder->aacSectionDataResilienceFlag)
1710 {
1711 if ((ics->sect_cb[g][i] == 11) ||
1712 ((ics->sect_cb[g][i] >= 16) && (ics->sect_cb[g][i] <= 32)))
1713 {
1714 vcb11 = 1;
1715 }
1716 }
1717 if (vcb11)
1718 {
1719 sect_len_incr = 1;
1720 } else {
1721 #endif
1722 sect_len_incr = (uint8_t)faad_getbits(ld, sect_bits
1723 DEBUGVAR(1,72,"section_data(): sect_len_incr"));
1724 #ifdef ERROR_RESILIENCE
1725 }
1726 #endif
1727 while ((sect_len_incr == sect_esc_val) /* &&
1728 (k+sect_len < ics->max_sfb)*/)
1729 {
1730 sect_len += sect_len_incr;
1731 sect_len_incr = (uint8_t)faad_getbits(ld, sect_bits
1732 DEBUGVAR(1,72,"section_data(): sect_len_incr"));
1733 }
1734
1735 sect_len += sect_len_incr;
1736
1737 ics->sect_start[g][i] = k;
1738 ics->sect_end[g][i] = k + sect_len;
1739
1740 #if 0
1741 printf("%d\n", ics->sect_start[g][i]);
1742 #endif
1743 #if 0
1744 printf("%d\n", ics->sect_end[g][i]);
1745 #endif
1746
1747 if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
1748 {
1749 if (k + sect_len > 8*15)
1750 return 15;
1751 if (i >= 8*15)
1752 return 15;
1753 } else {
1754 if (k + sect_len > MAX_SFB)
1755 return 15;
1756 if (i >= MAX_SFB)
1757 return 15;
1758 }
1759
1760 for (sfb = k; sfb < k + sect_len; sfb++)
1761 {
1762 ics->sfb_cb[g][sfb] = ics->sect_cb[g][i];
1763 #if 0
1764 printf("%d\n", ics->sfb_cb[g][sfb]);
1765 #endif
1766 }
1767
1768 #if 0
1769 printf(" %6d %6d %6d\n",
1770 i,
1771 ics->sect_end[g][i],
1772 ics->sect_cb[g][i]);
1773 #endif
1774
1775 k += sect_len;
1776 i++;
1777 }
1778 ics->num_sec[g] = i;
1779
1780 /* the sum of all sect_len_incr elements for a given window
1781 * group shall equal max_sfb */
1782 if (k != ics->max_sfb)
1783 {
1784 return 32;
1785 }
1786 #if 0
1787 printf("%d\n", ics->num_sec[g]);
1788 #endif
1789 }
1790
1791 #if 0
1792 printf("\n");
1793 #endif
1794
1795 return 0;
1796 }
1797
1798 /*
1799 * decode_scale_factors()
1800 * decodes the scalefactors from the bitstream
1801 */
1802 /*
1803 * All scalefactors (and also the stereo positions and pns energies) are
1804 * transmitted using Huffman coded DPCM relative to the previous active
1805 * scalefactor (respectively previous stereo position or previous pns energy,
1806 * see subclause 4.6.2 and 4.6.3). The first active scalefactor is
1807 * differentially coded relative to the global gain.
1808 */
1809 static uint8_t decode_scale_factors(ic_stream *ics, bitfile *ld)
1810 {
1811 uint8_t g, sfb;
1812 int16_t t;
1813 int8_t noise_pcm_flag = 1;
1814
1815 int16_t scale_factor = ics->global_gain;
1816 int16_t is_position = 0;
1817 int16_t noise_energy = ics->global_gain - 90;
1818
1819 for (g = 0; g < ics->num_window_groups; g++)
1820 {
1821 for (sfb = 0; sfb < ics->max_sfb; sfb++)
1822 {
1823 switch (ics->sfb_cb[g][sfb])
1824 {
1825 case ZERO_HCB: /* zero book */
1826 ics->scale_factors[g][sfb] = 0;
1827 //#define SF_PRINT
1828 #ifdef SF_PRINT
1829 printf("%d\n", ics->scale_factors[g][sfb]);
1830 #endif
1831 break;
1832 case INTENSITY_HCB: /* intensity books */
1833 case INTENSITY_HCB2:
1834
1835 /* decode intensity position */
1836 t = huffman_scale_factor(ld);
1837 is_position += (t - 60);
1838 ics->scale_factors[g][sfb] = is_position;
1839 #ifdef SF_PRINT
1840 printf("%d\n", ics->scale_factors[g][sfb]);
1841 #endif
1842
1843 break;
1844 case NOISE_HCB: /* noise books */
1845
1846 #ifndef DRM
1847 /* decode noise energy */
1848 if (noise_pcm_flag)
1849 {
1850 noise_pcm_flag = 0;
1851 t = (int16_t)faad_getbits(ld, 9
1852 DEBUGVAR(1,73,"scale_factor_data(): first noise")) - 256;
1853 } else {
1854 t = huffman_scale_factor(ld);
1855 t -= 60;
1856 }
1857 noise_energy += t;
1858 ics->scale_factors[g][sfb] = noise_energy;
1859 #ifdef SF_PRINT
1860 printf("%d\n", ics->scale_factors[g][sfb]);
1861 #endif
1862 #else
1863 /* PNS not allowed in DRM */
1864 return 29;
1865 #endif
1866
1867 break;
1868 default: /* spectral books */
1869
1870 /* ics->scale_factors[g][sfb] must be between 0 and 255 */
1871
1872 ics->scale_factors[g][sfb] = 0;
1873
1874 /* decode scale factor */
1875 t = huffman_scale_factor(ld);
1876 scale_factor += (t - 60);
1877 if (scale_factor < 0 || scale_factor > 255)
1878 return 4;
1879 ics->scale_factors[g][sfb] = scale_factor;
1880 #ifdef SF_PRINT
1881 printf("%d\n", ics->scale_factors[g][sfb]);
1882 #endif
1883
1884 break;
1885 }
1886 }
1887 }
1888
1889 return 0;
1890 }
1891
1892 /* Table 4.4.26 */
1893 static uint8_t scale_factor_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld)
1894 {
1895 uint8_t ret = 0;
1896 #ifdef PROFILE
1897 int64_t count = faad_get_ts();
1898 #endif
1899
1900 #ifdef ERROR_RESILIENCE
1901 if (!hDecoder->aacScalefactorDataResilienceFlag)
1902 {
1903 #endif
1904 ret = decode_scale_factors(ics, ld);
1905 #ifdef ERROR_RESILIENCE
1906 } else {
1907 /* In ER AAC the parameters for RVLC are seperated from the actual
1908 data that holds the scale_factors.
1909 Strangely enough, 2 parameters for HCR are put inbetween them.
1910 */
1911 ret = rvlc_scale_factor_data(ics, ld);
1912 }
1913 #endif
1914
1915 #ifdef PROFILE
1916 count = faad_get_ts() - count;
1917 hDecoder->scalefac_cycles += count;
1918 #endif
1919
1920 return ret;
1921 }
1922
1923 /* Table 4.4.27 */
1924 static void tns_data(ic_stream *ics, tns_info *tns, bitfile *ld)
1925 {
1926 uint8_t w, filt, i, start_coef_bits, coef_bits;
1927 uint8_t n_filt_bits = 2;
1928 uint8_t length_bits = 6;
1929 uint8_t order_bits = 5;
1930
1931 if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
1932 {
1933 n_filt_bits = 1;
1934 length_bits = 4;
1935 order_bits = 3;
1936 }
1937
1938 for (w = 0; w < ics->num_windows; w++)
1939 {
1940 tns->n_filt[w] = (uint8_t)faad_getbits(ld, n_filt_bits
1941 DEBUGVAR(1,74,"tns_data(): n_filt"));
1942 #if 0
1943 printf("%d\n", tns->n_filt[w]);
1944 #endif
1945
1946 if (tns->n_filt[w])
1947 {
1948 if ((tns->coef_res[w] = faad_get1bit(ld
1949 DEBUGVAR(1,75,"tns_data(): coef_res"))) & 1)
1950 {
1951 start_coef_bits = 4;
1952 } else {
1953 start_coef_bits = 3;
1954 }
1955 #if 0
1956 printf("%d\n", tns->coef_res[w]);
1957 #endif
1958 }
1959
1960 for (filt = 0; filt < tns->n_filt[w]; filt++)
1961 {
1962 tns->length[w][filt] = (uint8_t)faad_getbits(ld, length_bits
1963 DEBUGVAR(1,76,"tns_data(): length"));
1964 #if 0
1965 printf("%d\n", tns->length[w][filt]);
1966 #endif
1967 tns->order[w][filt] = (uint8_t)faad_getbits(ld, order_bits
1968 DEBUGVAR(1,77,"tns_data(): order"));
1969 #if 0
1970 printf("%d\n", tns->order[w][filt]);
1971 #endif
1972 if (tns->order[w][filt])
1973 {
1974 tns->direction[w][filt] = faad_get1bit(ld
1975 DEBUGVAR(1,78,"tns_data(): direction"));
1976 #if 0
1977 printf("%d\n", tns->direction[w][filt]);
1978 #endif
1979 tns->coef_compress[w][filt] = faad_get1bit(ld
1980 DEBUGVAR(1,79,"tns_data(): coef_compress"));
1981 #if 0
1982 printf("%d\n", tns->coef_compress[w][filt]);
1983 #endif
1984
1985 coef_bits = start_coef_bits - tns->coef_compress[w][filt];
1986 for (i = 0; i < tns->order[w][filt]; i++)
1987 {
1988 tns->coef[w][filt][i] = (uint8_t)faad_getbits(ld, coef_bits
1989 DEBUGVAR(1,80,"tns_data(): coef"));
1990 #if 0
1991 printf("%d\n", tns->coef[w][filt][i]);
1992 #endif
1993 }
1994 }
1995 }
1996 }
1997 }
1998
1999 #ifdef LTP_DEC
2000 /* Table 4.4.28 */
2001 static uint8_t ltp_data(NeAACDecHandle hDecoder, ic_stream *ics, ltp_info *ltp, bitfile *ld)
2002 {
2003 uint8_t sfb, w;
2004
2005 ltp->lag = 0;
2006
2007 #ifdef LD_DEC
2008 if (hDecoder->object_type == LD)
2009 {
2010 ltp->lag_update = (uint8_t)faad_getbits(ld, 1
2011 DEBUGVAR(1,142,"ltp_data(): lag_update"));
2012
2013 if (ltp->lag_update)
2014 {
2015 ltp->lag = (uint16_t)faad_getbits(ld, 10
2016 DEBUGVAR(1,81,"ltp_data(): lag"));
2017 }
2018 } else {
2019 #endif
2020 ltp->lag = (uint16_t)faad_getbits(ld, 11
2021 DEBUGVAR(1,81,"ltp_data(): lag"));
2022 #ifdef LD_DEC
2023 }
2024 #endif
2025
2026 /* Check length of lag */
2027 if (ltp->lag > (hDecoder->frameLength << 1))
2028 return 18;
2029
2030 ltp->coef = (uint8_t)faad_getbits(ld, 3
2031 DEBUGVAR(1,82,"ltp_data(): coef"));
2032
2033 if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
2034 {
2035 for (w = 0; w < ics->num_windows; w++)
2036 {
2037 if ((ltp->short_used[w] = faad_get1bit(ld
2038 DEBUGVAR(1,83,"ltp_data(): short_used"))) & 1)
2039 {
2040 ltp->short_lag_present[w] = faad_get1bit(ld
2041 DEBUGVAR(1,84,"ltp_data(): short_lag_present"));
2042 if (ltp->short_lag_present[w])
2043 {
2044 ltp->short_lag[w] = (uint8_t)faad_getbits(ld, 4
2045 DEBUGVAR(1,85,"ltp_data(): short_lag"));
2046 }
2047 }
2048 }
2049 } else {
2050 ltp->last_band = (ics->max_sfb < MAX_LTP_SFB ? ics->max_sfb : MAX_LTP_SFB);
2051
2052 for (sfb = 0; sfb < ltp->last_band; sfb++)
2053 {
2054 ltp->long_used[sfb] = faad_get1bit(ld
2055 DEBUGVAR(1,86,"ltp_data(): long_used"));
2056 }
2057 }
2058
2059 return 0;
2060 }
2061 #endif
2062
2063 /* Table 4.4.29 */
2064 static uint8_t spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
2065 int16_t *spectral_data)
2066 {
2067 int8_t i;
2068 uint8_t g;
2069 uint16_t inc, k, p = 0;
2070 uint8_t groups = 0;
2071 uint8_t sect_cb;
2072 uint8_t result;
2073 uint16_t nshort = hDecoder->frameLength/8;
2074
2075 #ifdef PROFILE
2076 int64_t count = faad_get_ts();
2077 #endif
2078
2079 for(g = 0; g < ics->num_window_groups; g++)
2080 {
2081 p = groups*nshort;
2082
2083 for (i = 0; i < ics->num_sec[g]; i++)
2084 {
2085 sect_cb = ics->sect_cb[g][i];
2086
2087 inc = (sect_cb >= FIRST_PAIR_HCB) ? 2 : 4;
2088
2089 switch (sect_cb)
2090 {
2091 case ZERO_HCB:
2092 case NOISE_HCB:
2093 case INTENSITY_HCB:
2094 case INTENSITY_HCB2:
2095 //#define SD_PRINT
2096 #ifdef SD_PRINT
2097 {
2098 int j;
2099 for (j = ics->sect_sfb_offset[g][ics->sect_start[g][i]]; j < ics->sect_sfb_offset[g][ics->sect_end[g][i]]; j++)
2100 {
2101 printf("%d\n", 0);
2102 }
2103 }
2104 #endif
2105 //#define SFBO_PRINT
2106 #ifdef SFBO_PRINT
2107 printf("%d\n", ics->sect_sfb_offset[g][ics->sect_start[g][i]]);
2108 #endif
2109 p += (ics->sect_sfb_offset[g][ics->sect_end[g][i]] -
2110 ics->sect_sfb_offset[g][ics->sect_start[g][i]]);
2111 break;
2112 default:
2113 #ifdef SFBO_PRINT
2114 printf("%d\n", ics->sect_sfb_offset[g][ics->sect_start[g][i]]);
2115 #endif
2116 for (k = ics->sect_sfb_offset[g][ics->sect_start[g][i]];
2117 k < ics->sect_sfb_offset[g][ics->sect_end[g][i]]; k += inc)
2118 {
2119 if ((result = huffman_spectral_data(sect_cb, ld, &spectral_data[p])) > 0)
2120 return result;
2121 #ifdef SD_PRINT
2122 {
2123 int j;
2124 for (j = p; j < p+inc; j++)
2125 {
2126 printf("%d\n", spectral_data[j]);
2127 }
2128 }
2129 #endif
2130 p += inc;
2131 }
2132 break;
2133 }
2134 }
2135 groups += ics->window_group_length[g];
2136 }
2137
2138 #ifdef PROFILE
2139 count = faad_get_ts() - count;
2140 hDecoder->spectral_cycles += count;
2141 #endif
2142
2143 return 0;
2144 }
2145
2146 /* Table 4.4.30 */
2147 static uint16_t extension_payload(bitfile *ld, drc_info *drc, uint16_t count)
2148 {
2149 uint16_t i, n, dataElementLength;
2150 uint8_t dataElementLengthPart;
2151 uint8_t align = 4, data_element_version, loopCounter;
2152
2153 uint8_t extension_type = (uint8_t)faad_getbits(ld, 4
2154 DEBUGVAR(1,87,"extension_payload(): extension_type"));
2155
2156 switch (extension_type)
2157 {
2158 case EXT_DYNAMIC_RANGE:
2159 drc->present = 1;
2160 n = dynamic_range_info(ld, drc);
2161 return n;
2162 case EXT_FILL_DATA:
2163 /* fill_nibble = */ faad_getbits(ld, 4
2164 DEBUGVAR(1,136,"extension_payload(): fill_nibble")); /* must be ‘0000’ */
2165 for (i = 0; i < count-1; i++)
2166 {
2167 /* fill_byte[i] = */ faad_getbits(ld, 8
2168 DEBUGVAR(1,88,"extension_payload(): fill_byte")); /* must be ‘10100101’ */
2169 }
2170 return count;
2171 case EXT_DATA_ELEMENT:
2172 data_element_version = (uint8_t)faad_getbits(ld, 4
2173 DEBUGVAR(1,400,"extension_payload(): data_element_version"));
2174 switch (data_element_version)
2175 {
2176 case ANC_DATA:
2177 loopCounter = 0;
2178 dataElementLength = 0;
2179 do {
2180 dataElementLengthPart = (uint8_t)faad_getbits(ld, 8
2181 DEBUGVAR(1,401,"extension_payload(): dataElementLengthPart"));
2182 dataElementLength += dataElementLengthPart;
2183 loopCounter++;
2184 } while (dataElementLengthPart == 255);
2185
2186 for (i = 0; i < dataElementLength; i++)
2187 {
2188 /* data_element_byte[i] = */ faad_getbits(ld, 8
2189 DEBUGVAR(1,402,"extension_payload(): data_element_byte"));
2190 return (dataElementLength+loopCounter+1);
2191 }
2192 default:
2193 align = 0;
2194 }
2195 case EXT_FIL:
2196 default:
2197 faad_getbits(ld, align
2198 DEBUGVAR(1,88,"extension_payload(): fill_nibble"));
2199 for (i = 0; i < count-1; i++)
2200 {
2201 /* other_bits[i] = */ faad_getbits(ld, 8
2202 DEBUGVAR(1,89,"extension_payload(): fill_bit"));
2203 }
2204 return count;
2205 }
2206 }
2207
2208 /* Table 4.4.31 */
2209 static uint8_t dynamic_range_info(bitfile *ld, drc_info *drc)
2210 {
2211 uint8_t i, n = 1;
2212 uint8_t band_incr;
2213
2214 drc->num_bands = 1;
2215
2216 if (faad_get1bit(ld
2217 DEBUGVAR(1,90,"dynamic_range_info(): has instance_tag")) & 1)
2218 {
2219 drc->pce_instance_tag = (uint8_t)faad_getbits(ld, 4
2220 DEBUGVAR(1,91,"dynamic_range_info(): pce_instance_tag"));
2221 /* drc->drc_tag_reserved_bits = */ faad_getbits(ld, 4
2222 DEBUGVAR(1,92,"dynamic_range_info(): drc_tag_reserved_bits"));
2223 n++;
2224 }
2225
2226 drc->excluded_chns_present = faad_get1bit(ld
2227 DEBUGVAR(1,93,"dynamic_range_info(): excluded_chns_present"));
2228 if (drc->excluded_chns_present == 1)
2229 {
2230 n += excluded_channels(ld, drc);
2231 }
2232
2233 if (faad_get1bit(ld
2234 DEBUGVAR(1,94,"dynamic_range_info(): has bands data")) & 1)
2235 {
2236 band_incr = (uint8_t)faad_getbits(ld, 4
2237 DEBUGVAR(1,95,"dynamic_range_info(): band_incr"));
2238 /* drc->drc_bands_reserved_bits = */ faad_getbits(ld, 4
2239 DEBUGVAR(1,96,"dynamic_range_info(): drc_bands_reserved_bits"));
2240 n++;
2241 drc->num_bands += band_incr;
2242
2243 for (i = 0; i < drc->num_bands; i++)
2244 {
2245 drc->band_top[i] = (uint8_t)faad_getbits(ld, 8
2246 DEBUGVAR(1,97,"dynamic_range_info(): band_top"));
2247 n++;
2248 }
2249 }
2250
2251 if (faad_get1bit(ld
2252 DEBUGVAR(1,98,"dynamic_range_info(): has prog_ref_level")) & 1)
2253 {
2254 drc->prog_ref_level = (uint8_t)faad_getbits(ld, 7
2255 DEBUGVAR(1,99,"dynamic_range_info(): prog_ref_level"));
2256 /* drc->prog_ref_level_reserved_bits = */ faad_get1bit(ld
2257 DEBUGVAR(1,100,"dynamic_range_info(): prog_ref_level_reserved_bits"));
2258 n++;
2259 }
2260
2261 for (i = 0; i < drc->num_bands; i++)
2262 {
2263 drc->dyn_rng_sgn[i] = faad_get1bit(ld
2264 DEBUGVAR(1,101,"dynamic_range_info(): dyn_rng_sgn"));
2265 drc->dyn_rng_ctl[i] = (uint8_t)faad_getbits(ld, 7
2266 DEBUGVAR(1,102,"dynamic_range_info(): dyn_rng_ctl"));
2267 n++;
2268 }
2269
2270 return n;
2271 }
2272
2273 /* Table 4.4.32 */
2274 static uint8_t excluded_channels(bitfile *ld, drc_info *drc)
2275 {
2276 uint8_t i, n = 0;
2277 uint8_t num_excl_chan = 7;
2278
2279 for (i = 0; i < 7; i++)
2280 {
2281 drc->exclude_mask[i] = faad_get1bit(ld
2282 DEBUGVAR(1,103,"excluded_channels(): exclude_mask"));
2283 }
2284 n++;
2285
2286 while ((drc->additional_excluded_chns[n-1] = faad_get1bit(ld
2287 DEBUGVAR(1,104,"excluded_channels(): additional_excluded_chns"))) == 1)
2288 {
2289 for (i = num_excl_chan; i < num_excl_chan+7; i++)
2290 {
2291 drc->exclude_mask[i] = faad_get1bit(ld
2292 DEBUGVAR(1,105,"excluded_channels(): exclude_mask"));
2293 }
2294 n++;
2295 num_excl_chan += 7;
2296 }
2297
2298 return n;
2299 }
2300
2301 /* Annex A: Audio Interchange Formats */
2302
2303 /* Table 1.A.2 */
2304 void get_adif_header(adif_header *adif, bitfile *ld)
2305 {
2306 uint8_t i;
2307
2308 /* adif_id[0] = */ faad_getbits(ld, 8
2309 DEBUGVAR(1,106,"get_adif_header(): adif_id[0]"));
2310 /* adif_id[1] = */ faad_getbits(ld, 8
2311 DEBUGVAR(1,107,"get_adif_header(): adif_id[1]"));
2312 /* adif_id[2] = */ faad_getbits(ld, 8
2313 DEBUGVAR(1,108,"get_adif_header(): adif_id[2]"));
2314 /* adif_id[3] = */ faad_getbits(ld, 8
2315 DEBUGVAR(1,109,"get_adif_header(): adif_id[3]"));
2316 adif->copyright_id_present = faad_get1bit(ld
2317 DEBUGVAR(1,110,"get_adif_header(): copyright_id_present"));
2318 if(adif->copyright_id_present)
2319 {
2320 for (i = 0; i < 72/8; i++)
2321 {
2322 adif->copyright_id[i] = (int8_t)faad_getbits(ld, 8
2323 DEBUGVAR(1,111,"get_adif_header(): copyright_id"));
2324 }
2325 adif->copyright_id[i] = 0;
2326 }
2327 adif->original_copy = faad_get1bit(ld
2328 DEBUGVAR(1,112,"get_adif_header(): original_copy"));
2329 adif->home = faad_get1bit(ld
2330 DEBUGVAR(1,113,"get_adif_header(): home"));
2331 adif->bitstream_type = faad_get1bit(ld
2332 DEBUGVAR(1,114,"get_adif_header(): bitstream_type"));
2333 adif->bitrate = faad_getbits(ld, 23
2334 DEBUGVAR(1,115,"get_adif_header(): bitrate"));
2335 adif->num_program_config_elements = (uint8_t)faad_getbits(ld, 4
2336 DEBUGVAR(1,116,"get_adif_header(): num_program_config_elements"));
2337
2338 for (i = 0; i < adif->num_program_config_elements + 1; i++)
2339 {
2340 if(adif->bitstream_type == 0)
2341 {
2342 adif->adif_buffer_fullness = faad_getbits(ld, 20
2343 DEBUGVAR(1,117,"get_adif_header(): adif_buffer_fullness"));
2344 } else {
2345 adif->adif_buffer_fullness = 0;
2346 }
2347
2348 program_config_element(&adif->pce[i], ld);
2349 }
2350 }
2351
2352 /* Table 1.A.5 */
2353 uint8_t adts_frame(adts_header *adts, bitfile *ld)
2354 {
2355 /* faad_byte_align(ld); */
2356 if (adts_fixed_header(adts, ld))
2357 return 5;
2358 adts_variable_header(adts, ld);
2359 adts_error_check(adts, ld);
2360
2361 return 0;
2362 }
2363
2364 /* Table 1.A.6 */
2365 static uint8_t adts_fixed_header(adts_header *adts, bitfile *ld)
2366 {
2367 uint16_t i;
2368 uint8_t sync_err = 1;
2369
2370 /* try to recover from sync errors */
2371 for (i = 0; i < 768; i++)
2372 {
2373 adts->syncword = (uint16_t)faad_showbits(ld, 12);
2374 if (adts->syncword != 0xFFF)
2375 {
2376 faad_getbits(ld, 8
2377 DEBUGVAR(0,0,""));
2378 } else {
2379 sync_err = 0;
2380 faad_getbits(ld, 12
2381 DEBUGVAR(1,118,"adts_fixed_header(): syncword"));
2382 break;
2383 }
2384 }
2385 if (sync_err)
2386 return 5;
2387
2388 adts->id = faad_get1bit(ld
2389 DEBUGVAR(1,119,"adts_fixed_header(): id"));
2390 adts->layer = (uint8_t)faad_getbits(ld, 2
2391 DEBUGVAR(1,120,"adts_fixed_header(): layer"));
2392 adts->protection_absent = faad_get1bit(ld
2393 DEBUGVAR(1,121,"adts_fixed_header(): protection_absent"));
2394 adts->profile = (uint8_t)faad_getbits(ld, 2
2395 DEBUGVAR(1,122,"adts_fixed_header(): profile"));
2396 adts->sf_index = (uint8_t)faad_getbits(ld, 4
2397 DEBUGVAR(1,123,"adts_fixed_header(): sf_index"));
2398 adts->private_bit = faad_get1bit(ld
2399 DEBUGVAR(1,124,"adts_fixed_header(): private_bit"));
2400 adts->channel_configuration = (uint8_t)faad_getbits(ld, 3
2401 DEBUGVAR(1,125,"adts_fixed_header(): channel_configuration"));
2402 adts->original = faad_get1bit(ld
2403 DEBUGVAR(1,126,"adts_fixed_header(): original"));
2404 adts->home = faad_get1bit(ld
2405 DEBUGVAR(1,127,"adts_fixed_header(): home"));
2406
2407 if (adts->old_format == 1)
2408 {
2409 /* Removed in corrigendum 14496-3:2002 */
2410 if (adts->id == 0)
2411 {
2412 adts->emphasis = (uint8_t)faad_getbits(ld, 2
2413 DEBUGVAR(1,128,"adts_fixed_header(): emphasis"));
2414 }
2415 }
2416
2417 return 0;
2418 }
2419
2420 /* Table 1.A.7 */
2421 static void adts_variable_header(adts_header *adts, bitfile *ld)
2422 {
2423 adts->copyright_identification_bit = faad_get1bit(ld
2424 DEBUGVAR(1,129,"adts_variable_header(): copyright_identification_bit"));
2425 adts->copyright_identification_start = faad_get1bit(ld
2426 DEBUGVAR(1,130,"adts_variable_header(): copyright_identification_start"));
2427 adts->aac_frame_length = (uint16_t)faad_getbits(ld, 13
2428 DEBUGVAR(1,131,"adts_variable_header(): aac_frame_length"));
2429 adts->adts_buffer_fullness = (uint16_t)faad_getbits(ld, 11
2430 DEBUGVAR(1,132,"adts_variable_header(): adts_buffer_fullness"));
2431 adts->no_raw_data_blocks_in_frame = (uint8_t)faad_getbits(ld, 2
2432 DEBUGVAR(1,133,"adts_variable_header(): no_raw_data_blocks_in_frame"));
2433 }
2434
2435 /* Table 1.A.8 */
2436 static void adts_error_check(adts_header *adts, bitfile *ld)
2437 {
2438 if (adts->protection_absent == 0)
2439 {
2440 adts->crc_check = (uint16_t)faad_getbits(ld, 16
2441 DEBUGVAR(1,134,"adts_error_check(): crc_check"));
2442 }
2443 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: syntax.h,v 1.58 2007/11/01 12:33:40 menno Exp $
28 **/
29
30 #ifndef __SYNTAX_H__
31 #define __SYNTAX_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #include "decoder.h"
38 #include "bits.h"
39
40 #define MAIN 1
41 #define LC 2
42 #define SSR 3
43 #define LTP 4
44 #define HE_AAC 5
45 #define LD 23
46 #define ER_LC 17
47 #define ER_LTP 19
48 #define DRM_ER_LC 27 /* special object type for DRM */
49
50 /* header types */
51 #define RAW 0
52 #define ADIF 1
53 #define ADTS 2
54
55 /* SBR signalling */
56 #define NO_SBR 0
57 #define SBR_UPSAMPLED 1
58 #define SBR_DOWNSAMPLED 2
59 #define NO_SBR_UPSAMPLED 3
60
61 /* DRM channel definitions */
62 #define DRMCH_MONO 1
63 #define DRMCH_STEREO 2
64 #define DRMCH_SBR_MONO 3
65 #define DRMCH_SBR_STEREO 4
66 #define DRMCH_SBR_PS_STEREO 5
67
68
69 /* First object type that has ER */
70 #define ER_OBJECT_START 17
71
72
73 /* Bitstream */
74 #define LEN_SE_ID 3
75 #define LEN_TAG 4
76 #define LEN_BYTE 8
77
78 #define EXT_FIL 0
79 #define EXT_FILL_DATA 1
80 #define EXT_DATA_ELEMENT 2
81 #define EXT_DYNAMIC_RANGE 11
82 #define ANC_DATA 0
83
84 /* Syntax elements */
85 #define ID_SCE 0x0
86 #define ID_CPE 0x1
87 #define ID_CCE 0x2
88 #define ID_LFE 0x3
89 #define ID_DSE 0x4
90 #define ID_PCE 0x5
91 #define ID_FIL 0x6
92 #define ID_END 0x7
93
94 #define ONLY_LONG_SEQUENCE 0x0
95 #define LONG_START_SEQUENCE 0x1
96 #define EIGHT_SHORT_SEQUENCE 0x2
97 #define LONG_STOP_SEQUENCE 0x3
98
99 #define ZERO_HCB 0
100 #define FIRST_PAIR_HCB 5
101 #define ESC_HCB 11
102 #define QUAD_LEN 4
103 #define PAIR_LEN 2
104 #define NOISE_HCB 13
105 #define INTENSITY_HCB2 14
106 #define INTENSITY_HCB 15
107
108 #define INVALID_SBR_ELEMENT 255
109
110 int8_t GASpecificConfig(bitfile *ld, mp4AudioSpecificConfig *mp4ASC,
111 program_config *pce);
112
113 uint8_t adts_frame(adts_header *adts, bitfile *ld);
114 void get_adif_header(adif_header *adif, bitfile *ld);
115 void raw_data_block(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
116 bitfile *ld, program_config *pce, drc_info *drc);
117 uint8_t reordered_spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
118 int16_t *spectral_data);
119 #ifdef DRM
120 void DRM_aac_scalable_main_element(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
121 bitfile *ld, program_config *pce, drc_info *drc);
122 #endif
123
124 #ifdef __cplusplus
125 }
126 #endif
127 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: tns.c,v 1.40 2007/11/01 12:33:40 menno Exp $
28 **/
29
30 #include "common.h"
31 #include "structs.h"
32
33 #include "syntax.h"
34 #include "tns.h"
35
36
37 /* static function declarations */
38 static void tns_decode_coef(uint8_t order, uint8_t coef_res_bits, uint8_t coef_compress,
39 uint8_t *coef, real_t *a);
40 static void tns_ar_filter(real_t *spectrum, uint16_t size, int8_t inc, real_t *lpc,
41 uint8_t order);
42 static void tns_ma_filter(real_t *spectrum, uint16_t size, int8_t inc, real_t *lpc,
43 uint8_t order);
44
45
46 #ifdef _MSC_VER
47 #pragma warning(disable:4305)
48 #pragma warning(disable:4244)
49 #endif
50 static real_t tns_coef_0_3[] =
51 {
52 COEF_CONST(0.0), COEF_CONST(0.4338837391), COEF_CONST(0.7818314825), COEF_CONST(0.9749279122),
53 COEF_CONST(-0.9848077530), COEF_CONST(-0.8660254038), COEF_CONST(-0.6427876097), COEF_CONST(-0.3420201433),
54 COEF_CONST(-0.4338837391), COEF_CONST(-0.7818314825), COEF_CONST(-0.9749279122), COEF_CONST(-0.9749279122),
55 COEF_CONST(-0.9848077530), COEF_CONST(-0.8660254038), COEF_CONST(-0.6427876097), COEF_CONST(-0.3420201433)
56 };
57 static real_t tns_coef_0_4[] =
58 {
59 COEF_CONST(0.0), COEF_CONST(0.2079116908), COEF_CONST(0.4067366431), COEF_CONST(0.5877852523),
60 COEF_CONST(0.7431448255), COEF_CONST(0.8660254038), COEF_CONST(0.9510565163), COEF_CONST(0.9945218954),
61 COEF_CONST(-0.9957341763), COEF_CONST(-0.9618256432), COEF_CONST(-0.8951632914), COEF_CONST(-0.7980172273),
62 COEF_CONST(-0.6736956436), COEF_CONST(-0.5264321629), COEF_CONST(-0.3612416662), COEF_CONST(-0.1837495178)
63 };
64 static real_t tns_coef_1_3[] =
65 {
66 COEF_CONST(0.0), COEF_CONST(0.4338837391), COEF_CONST(-0.6427876097), COEF_CONST(-0.3420201433),
67 COEF_CONST(0.9749279122), COEF_CONST(0.7818314825), COEF_CONST(-0.6427876097), COEF_CONST(-0.3420201433),
68 COEF_CONST(-0.4338837391), COEF_CONST(-0.7818314825), COEF_CONST(-0.6427876097), COEF_CONST(-0.3420201433),
69 COEF_CONST(-0.7818314825), COEF_CONST(-0.4338837391), COEF_CONST(-0.6427876097), COEF_CONST(-0.3420201433)
70 };
71 static real_t tns_coef_1_4[] =
72 {
73 COEF_CONST(0.0), COEF_CONST(0.2079116908), COEF_CONST(0.4067366431), COEF_CONST(0.5877852523),
74 COEF_CONST(-0.6736956436), COEF_CONST(-0.5264321629), COEF_CONST(-0.3612416662), COEF_CONST(-0.1837495178),
75 COEF_CONST(0.9945218954), COEF_CONST(0.9510565163), COEF_CONST(0.8660254038), COEF_CONST(0.7431448255),
76 COEF_CONST(-0.6736956436), COEF_CONST(-0.5264321629), COEF_CONST(-0.3612416662), COEF_CONST(-0.1837495178)
77 };
78
79
80 /* TNS decoding for one channel and frame */
81 void tns_decode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index,
82 uint8_t object_type, real_t *spec, uint16_t frame_len)
83 {
84 uint8_t w, f, tns_order;
85 int8_t inc;
86 int16_t size;
87 uint16_t bottom, top, start, end;
88 uint16_t nshort = frame_len/8;
89 real_t lpc[TNS_MAX_ORDER+1];
90
91 if (!ics->tns_data_present)
92 return;
93
94 for (w = 0; w < ics->num_windows; w++)
95 {
96 bottom = ics->num_swb;
97
98 for (f = 0; f < tns->n_filt[w]; f++)
99 {
100 top = bottom;
101 bottom = max(top - tns->length[w][f], 0);
102 tns_order = min(tns->order[w][f], TNS_MAX_ORDER);
103 if (!tns_order)
104 continue;
105
106 tns_decode_coef(tns_order, tns->coef_res[w]+3,
107 tns->coef_compress[w][f], tns->coef[w][f], lpc);
108
109 start = min(bottom, max_tns_sfb(sr_index, object_type, (ics->window_sequence == EIGHT_SHORT_SEQUENCE)));
110 start = min(start, ics->max_sfb);
111 start = min(ics->swb_offset[start], ics->swb_offset_max);
112
113 end = min(top, max_tns_sfb(sr_index, object_type, (ics->window_sequence == EIGHT_SHORT_SEQUENCE)));
114 end = min(end, ics->max_sfb);
115 end = min(ics->swb_offset[end], ics->swb_offset_max);
116
117 size = end - start;
118 if (size <= 0)
119 continue;
120
121 if (tns->direction[w][f])
122 {
123 inc = -1;
124 start = end - 1;
125 } else {
126 inc = 1;
127 }
128
129 tns_ar_filter(&spec[(w*nshort)+start], size, inc, lpc, tns_order);
130 }
131 }
132 }
133
134 /* TNS encoding for one channel and frame */
135 void tns_encode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index,
136 uint8_t object_type, real_t *spec, uint16_t frame_len)
137 {
138 uint8_t w, f, tns_order;
139 int8_t inc;
140 int16_t size;
141 uint16_t bottom, top, start, end;
142 uint16_t nshort = frame_len/8;
143 real_t lpc[TNS_MAX_ORDER+1];
144
145 if (!ics->tns_data_present)
146 return;
147
148 for (w = 0; w < ics->num_windows; w++)
149 {
150 bottom = ics->num_swb;
151
152 for (f = 0; f < tns->n_filt[w]; f++)
153 {
154 top = bottom;
155 bottom = max(top - tns->length[w][f], 0);
156 tns_order = min(tns->order[w][f], TNS_MAX_ORDER);
157 if (!tns_order)
158 continue;
159
160 tns_decode_coef(tns_order, tns->coef_res[w]+3,
161 tns->coef_compress[w][f], tns->coef[w][f], lpc);
162
163 start = min(bottom, max_tns_sfb(sr_index, object_type, (ics->window_sequence == EIGHT_SHORT_SEQUENCE)));
164 start = min(start, ics->max_sfb);
165 start = min(ics->swb_offset[start], ics->swb_offset_max);
166
167 end = min(top, max_tns_sfb(sr_index, object_type, (ics->window_sequence == EIGHT_SHORT_SEQUENCE)));
168 end = min(end, ics->max_sfb);
169 end = min(ics->swb_offset[end], ics->swb_offset_max);
170
171 size = end - start;
172 if (size <= 0)
173 continue;
174
175 if (tns->direction[w][f])
176 {
177 inc = -1;
178 start = end - 1;
179 } else {
180 inc = 1;
181 }
182
183 tns_ma_filter(&spec[(w*nshort)+start], size, inc, lpc, tns_order);
184 }
185 }
186 }
187
188 /* Decoder transmitted coefficients for one TNS filter */
189 static void tns_decode_coef(uint8_t order, uint8_t coef_res_bits, uint8_t coef_compress,
190 uint8_t *coef, real_t *a)
191 {
192 uint8_t i, m;
193 real_t tmp2[TNS_MAX_ORDER+1], b[TNS_MAX_ORDER+1];
194
195 /* Conversion to signed integer */
196 for (i = 0; i < order; i++)
197 {
198 if (coef_compress == 0)
199 {
200 if (coef_res_bits == 3)
201 {
202 tmp2[i] = tns_coef_0_3[coef[i]];
203 } else {
204 tmp2[i] = tns_coef_0_4[coef[i]];
205 }
206 } else {
207 if (coef_res_bits == 3)
208 {
209 tmp2[i] = tns_coef_1_3[coef[i]];
210 } else {
211 tmp2[i] = tns_coef_1_4[coef[i]];
212 }
213 }
214 }
215
216 /* Conversion to LPC coefficients */
217 a[0] = COEF_CONST(1.0);
218 for (m = 1; m <= order; m++)
219 {
220 for (i = 1; i < m; i++) /* loop only while i<m */
221 b[i] = a[i] + MUL_C(tmp2[m-1], a[m-i]);
222
223 for (i = 1; i < m; i++) /* loop only while i<m */
224 a[i] = b[i];
225
226 a[m] = tmp2[m-1]; /* changed */
227 }
228 }
229
230 static void tns_ar_filter(real_t *spectrum, uint16_t size, int8_t inc, real_t *lpc,
231 uint8_t order)
232 {
233 /*
234 - Simple all-pole filter of order "order" defined by
235 y(n) = x(n) - lpc[1]*y(n-1) - ... - lpc[order]*y(n-order)
236 - The state variables of the filter are initialized to zero every time
237 - The output data is written over the input data ("in-place operation")
238 - An input vector of "size" samples is processed and the index increment
239 to the next data sample is given by "inc"
240 */
241
242 uint8_t j;
243 uint16_t i;
244 real_t y;
245 /* state is stored as a double ringbuffer */
246 real_t state[2*TNS_MAX_ORDER] = {0};
247 int8_t state_index = 0;
248
249 for (i = 0; i < size; i++)
250 {
251 y = *spectrum;
252
253 for (j = 0; j < order; j++)
254 y -= MUL_C(state[state_index+j], lpc[j+1]);
255
256 /* double ringbuffer state */
257 state_index--;
258 if (state_index < 0)
259 state_index = order-1;
260 state[state_index] = state[state_index + order] = y;
261
262 *spectrum = y;
263 spectrum += inc;
264
265 //#define TNS_PRINT
266 #ifdef TNS_PRINT
267 //printf("%d\n", y);
268 printf("0x%.8X\n", y);
269 #endif
270 }
271 }
272
273 static void tns_ma_filter(real_t *spectrum, uint16_t size, int8_t inc, real_t *lpc,
274 uint8_t order)
275 {
276 /*
277 - Simple all-zero filter of order "order" defined by
278 y(n) = x(n) + a(2)*x(n-1) + ... + a(order+1)*x(n-order)
279 - The state variables of the filter are initialized to zero every time
280 - The output data is written over the input data ("in-place operation")
281 - An input vector of "size" samples is processed and the index increment
282 to the next data sample is given by "inc"
283 */
284
285 uint8_t j;
286 uint16_t i;
287 real_t y;
288 /* state is stored as a double ringbuffer */
289 real_t state[2*TNS_MAX_ORDER] = {0};
290 int8_t state_index = 0;
291
292 for (i = 0; i < size; i++)
293 {
294 y = *spectrum;
295
296 for (j = 0; j < order; j++)
297 y += MUL_C(state[state_index+j], lpc[j+1]);
298
299 /* double ringbuffer state */
300 state_index--;
301 if (state_index < 0)
302 state_index = order-1;
303 state[state_index] = state[state_index + order] = *spectrum;
304
305 *spectrum = y;
306 spectrum += inc;
307 }
308 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
22 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
23 **
24 ** Commercial non-GPL licensing of this software is possible.
25 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
26 **
27 ** $Id: tns.h,v 1.23 2007/11/01 12:33:41 menno Exp $
28 **/
29
30 #ifndef __TNS_H__
31 #define __TNS_H__
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37
38 #define TNS_MAX_ORDER 20
39
40
41 void tns_decode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index,
42 uint8_t object_type, real_t *spec, uint16_t frame_len);
43 void tns_encode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index,
44 uint8_t object_type, real_t *spec, uint16_t frame_len);
45
46
47 #ifdef __cplusplus
48 }
49 #endif
50 #endif
0 if HAVE_MPEG4IP_PLUG
1 if HAVE_XMMS
2 SUBDIRS = xmms mpeg4ip
3 else
4 SUBDIRS = mpeg4ip
5 endif #HAVE_XMMS
6 else
7 if HAVE_XMMS
8 SUBDIRS = xmms
9 else
10 SUBDIRS =
11 endif #HAVE_XMMS
12 endif #HAVE_MPEG4IP_PLUG
0 /*
1 ** FAAD - Freeware Advanced Audio Decoder
2 ** Copyright (C) 2002 M. Bakker
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** $Id: QCDFAAD.c,v 1.2 2003/04/28 19:04:35 menno Exp $
19 ** based on menno's in_faad.dll plugin for Winamp
20 **
21 ** The tag function has been removed because QCD supports ID3v1 & ID3v2 very well
22 ** About how to tagging: Please read the "ReadMe.txt" first
23 **/
24
25 #define WIN32_LEAN_AND_MEAN
26
27 #include <windows.h>
28 #include <mmreg.h>
29 #include <commctrl.h>
30 #include <shellapi.h>
31 #include <stdlib.h>
32 #include <stdio.h>
33 #include "QCDInputDLL.h"
34
35 #include "resource.h"
36
37 #include <faad.h>
38 #include <aacinfo.h>
39 #include <filestream.h>
40 //#include <id3v2tag.h>
41
42 static char app_name[] = "QCDFAAD";
43
44 faadAACInfo file_info;
45
46 faacDecHandle hDecoder;
47 faacDecFrameInfo frameInfo;
48
49 HINSTANCE hInstance;
50 HWND hwndPlayer, hwndConfig, hwndAbout;
51 QCDModInitIn sQCDCallbacks, *QCDCallbacks;
52 BOOL oldAPIs = 0;
53 static char lastfn[MAX_PATH]; // currently playing file (used for getting info on the current file)
54 int file_length; // file length, in bytes
55 int paused; // are we paused?
56 int seek_needed; // if != -1, it is the point that the decode thread should seek to, in ms.
57
58 char *sample_buffer; // sample buffer
59 unsigned char *buffer; // input buffer
60 unsigned char *memmap_buffer; // input buffer for whole file
61 long memmap_index;
62
63 long buffercount, fileread, bytecount;
64
65 // seek table for ADTS header files
66 unsigned long *seek_table = NULL;
67 int seek_table_length=0;
68
69 int killPlayThread = 0; // the kill switch for the decode thread
70 HANDLE play_thread_handle = INVALID_HANDLE_VALUE; // the handle to the decode thread
71 FILE_STREAM *infile;
72
73 /* Function definitions */
74 int id3v2_tag(unsigned char *buffer);
75 DWORD WINAPI PlayThread(void *b); // the decode thread procedure
76
77 // general funcz
78 static void show_error(const char *message,...)
79 {
80 char foo[512];
81 va_list args;
82 va_start(args, message);
83 vsprintf(foo, message, args);
84 va_end(args);
85 MessageBox(hwndPlayer, foo, "FAAD Plug-in Error", MB_ICONSTOP);
86 }
87
88
89 // 1= use vbr display, 0 = use average bitrate. This value only controls what shows up in the
90 // configuration form. Also- Streaming uses an on-the-fly bitrate display regardless of this value.
91 long m_variable_bitrate_display=0;
92 long m_priority = 5;
93 long m_memmap_file = 0;
94 static char INI_FILE[MAX_PATH];
95
96 char *priority_text[] = { "",
97 "Decode Thread Priority: Lowest",
98 "Decode Thread Priority: Lower",
99 "Decode Thread Priority: Normal",
100 "Decode Thread Priority: Higher",
101 "Decode Thread Priority: Highest (default)"
102 };
103
104 long priority_table[] = {0, THREAD_PRIORITY_LOWEST, THREAD_PRIORITY_BELOW_NORMAL, THREAD_PRIORITY_NORMAL, THREAD_PRIORITY_ABOVE_NORMAL, THREAD_PRIORITY_HIGHEST};
105
106 long current_file_mode = 0;
107
108 int PlayThread_memmap();
109 int PlayThread_file();
110
111 static void _r_s(char *name,char *data, int mlen)
112 {
113 char buf[10];
114 strcpy(buf,data);
115 GetPrivateProfileString(app_name,name,buf,data,mlen,INI_FILE);
116 }
117
118 #define RS(x) (_r_s(#x,x,sizeof(x)))
119 #define WS(x) (WritePrivateProfileString(app_name,#x,x,INI_FILE))
120
121 void config_read()
122 {
123 char variable_bitrate_display[10];
124 char priority[10];
125 char memmap_file[10];
126 char local_buffer_size[10];
127 char stream_buffer_size[10];
128
129 strcpy(variable_bitrate_display, "1");
130 strcpy(priority, "5");
131 strcpy(memmap_file, "0");
132 strcpy(local_buffer_size, "128");
133 strcpy(stream_buffer_size, "64");
134
135 RS(variable_bitrate_display);
136 RS(priority);
137 RS(memmap_file);
138 RS(local_buffer_size);
139 RS(stream_buffer_size);
140
141 m_priority = atoi(priority);
142 m_variable_bitrate_display = atoi(variable_bitrate_display);
143 m_memmap_file = atoi(memmap_file);
144 m_local_buffer_size = atoi(local_buffer_size);
145 m_stream_buffer_size = atoi(stream_buffer_size);
146 }
147
148 void config_write()
149 {
150 char variable_bitrate_display[10];
151 char priority[10];
152 char memmap_file[10];
153 char local_buffer_size[10];
154 char stream_buffer_size[10];
155
156 itoa(m_priority, priority, 10);
157 itoa(m_variable_bitrate_display, variable_bitrate_display, 10);
158 itoa(m_memmap_file, memmap_file, 10);
159 itoa(m_local_buffer_size, local_buffer_size, 10);
160 itoa(m_stream_buffer_size, stream_buffer_size, 10);
161
162 WS(variable_bitrate_display);
163 WS(priority);
164 WS(memmap_file);
165 WS(local_buffer_size);
166 WS(stream_buffer_size);
167 }
168
169 //-----------------------------------------------------------------------------
170
171 BOOL WINAPI DllMain(HINSTANCE hInst, DWORD fdwReason, LPVOID pRes)
172 {
173 if (fdwReason == DLL_PROCESS_ATTACH)
174 hInstance = hInst;
175 return TRUE;
176 }
177
178 //-----------------------------------------------------------------------------
179 //old entrypoint api
180 PLUGIN_API BOOL QInputModule(QCDModInitIn *ModInit, QCDModInfo *ModInfo)
181 {
182 ModInit->version = PLUGIN_API_VERSION;
183 ModInit->toModule.ShutDown = ShutDown;
184 ModInit->toModule.GetTrackExtents = GetTrackExtents;
185 ModInit->toModule.GetMediaSupported = GetMediaSupported;
186 ModInit->toModule.GetCurrentPosition= GetCurrentPosition;
187 ModInit->toModule.Play = Play;
188 ModInit->toModule.Pause = Pause;
189 ModInit->toModule.Stop = Stop;
190 ModInit->toModule.SetVolume = SetVolume;
191 ModInit->toModule.About = About;
192 ModInit->toModule.Configure = Configure;
193 QCDCallbacks = ModInit;
194
195 ModInfo->moduleString = "FAAD Plugin v1.0b";
196 /* read config */
197 QCDCallbacks->Service(opGetPluginSettingsFile, INI_FILE, MAX_PATH, 0);
198
199 config_read();
200 ModInfo->moduleExtensions = "AAC";
201
202 hwndPlayer = (HWND)ModInit->Service(opGetParentWnd, 0, 0, 0);
203 lastfn[0] = 0;
204 play_thread_handle = INVALID_HANDLE_VALUE;
205
206 oldAPIs = 1;
207
208 return TRUE;
209 }
210
211 //-----------------------------------------------------------------------------
212
213 PLUGIN_API QCDModInitIn* INPUTDLL_ENTRY_POINT()
214 {
215 sQCDCallbacks.version = PLUGIN_API_VERSION;
216 sQCDCallbacks.toModule.Initialize = Initialize;
217 sQCDCallbacks.toModule.ShutDown = ShutDown;
218 sQCDCallbacks.toModule.GetTrackExtents = GetTrackExtents;
219 sQCDCallbacks.toModule.GetMediaSupported = GetMediaSupported;
220 sQCDCallbacks.toModule.GetCurrentPosition = GetCurrentPosition;
221 sQCDCallbacks.toModule.Play = Play;
222 sQCDCallbacks.toModule.Pause = Pause;
223 sQCDCallbacks.toModule.Stop = Stop;
224 sQCDCallbacks.toModule.SetVolume = SetVolume;
225 sQCDCallbacks.toModule.About = About;
226 sQCDCallbacks.toModule.Configure = Configure;
227
228 QCDCallbacks = &sQCDCallbacks;
229 return &sQCDCallbacks;
230 }
231
232 //----------------------------------------------------------------------------
233
234 BOOL CALLBACK config_dialog_proc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
235 {
236 char tmp[10];
237
238 switch (message)
239 {
240 case WM_INITDIALOG:
241 /* Set priority slider range and previous position */
242 SendMessage(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(1, 5));
243 SendMessage(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER), TBM_SETPOS, TRUE, m_priority);
244 SetDlgItemText(hwndDlg, IDC_STATIC2, priority_text[m_priority]);
245
246 /* Put a limit to the amount of characters allowed in the buffer boxes */
247 SendMessage(GetDlgItem(hwndDlg, LOCAL_BUFFER_TXT), EM_LIMITTEXT, 4, 0);
248 SendMessage(GetDlgItem(hwndDlg, STREAM_BUFFER_TXT), EM_LIMITTEXT, 4, 0);
249
250 if(m_variable_bitrate_display)
251 SendMessage(GetDlgItem(hwndDlg, VARBITRATE_CHK), BM_SETCHECK, BST_CHECKED, 0);
252 if(m_memmap_file)
253 SendMessage(GetDlgItem(hwndDlg, IDC_MEMMAP), BM_SETCHECK, BST_CHECKED, 0);
254
255 itoa(m_local_buffer_size, tmp, 10);
256 SetDlgItemText(hwndDlg, LOCAL_BUFFER_TXT, tmp);
257
258 itoa(m_stream_buffer_size, tmp, 10);
259 SetDlgItemText(hwndDlg, STREAM_BUFFER_TXT, tmp);
260
261 return TRUE;
262
263 case WM_HSCROLL:
264
265 /* Thread priority slider moved */
266 if(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER) == (HWND) lParam)
267 {
268 int tmp;
269 tmp = SendMessage(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER), TBM_GETPOS, 0, 0);
270
271 if(tmp > 0)
272 {
273 m_priority = tmp;
274
275 SetDlgItemText(hwndDlg, IDC_STATIC2, priority_text[m_priority]);
276
277 if(play_thread_handle)
278 SetThreadPriority(play_thread_handle, priority_table[m_priority]);
279 }
280 }
281
282 return TRUE;
283
284 case WM_COMMAND:
285
286 if(HIWORD(wParam) == BN_CLICKED)
287 {
288 if(GetDlgItem(hwndDlg, VARBITRATE_CHK) == (HWND) lParam)
289 {
290 /* Variable Bitrate checkbox hit */
291 m_variable_bitrate_display = SendMessage(GetDlgItem(hwndDlg, VARBITRATE_CHK), BM_GETCHECK, 0, 0);
292 }
293 if(GetDlgItem(hwndDlg, IDC_MEMMAP) == (HWND) lParam)
294 {
295 /* Variable Bitrate checkbox hit */
296 m_memmap_file = SendMessage(GetDlgItem(hwndDlg, IDC_MEMMAP), BM_GETCHECK, 0, 0);
297 }
298 }
299
300 switch (LOWORD(wParam))
301 {
302 case OK_BTN:
303 /* User hit OK, save buffer settings (all others are set on command) */
304 GetDlgItemText(hwndDlg, LOCAL_BUFFER_TXT, tmp, 5);
305 m_local_buffer_size = atol(tmp);
306
307 GetDlgItemText(hwndDlg, STREAM_BUFFER_TXT, tmp, 5);
308 m_stream_buffer_size = atol(tmp);
309
310 config_write();
311
312 EndDialog(hwndDlg, wParam);
313 return TRUE;
314 case RESET_BTN:
315 SendMessage(GetDlgItem(hwndDlg, VARBITRATE_CHK), BM_SETCHECK, BST_CHECKED, 0);
316 m_variable_bitrate_display = 1;
317 SendMessage(GetDlgItem(hwndDlg, IDC_MEMMAP), BM_SETCHECK, BST_UNCHECKED, 0);
318 m_memmap_file = 0;
319 SendMessage(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER), TBM_SETPOS, TRUE, 5);
320 m_priority = 5;
321 SetDlgItemText(hwndDlg, IDC_STATIC2, priority_text[5]);
322 SetDlgItemText(hwndDlg, LOCAL_BUFFER_TXT, "128");
323 m_local_buffer_size = 128;
324 SetDlgItemText(hwndDlg, STREAM_BUFFER_TXT, "64");
325 m_stream_buffer_size = 64;
326 return TRUE;
327 case IDCANCEL:
328 case CANCEL_BTN:
329 /* User hit Cancel or the X, just close without saving buffer settings */
330 DestroyWindow(hwndDlg);
331 return TRUE;
332 }
333 }
334 return FALSE;
335 }
336
337
338 void Configure(int flags)
339 {
340 if(!IsWindow(hwndConfig))
341 hwndConfig = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_CONFIG), hwndPlayer, config_dialog_proc);
342 ShowWindow(hwndConfig, SW_NORMAL);
343 }
344
345 //-----------------------------------------------------------------------------
346 // proc of "About Dialog"
347 INT_PTR CALLBACK about_dialog_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
348 {
349 static RECT rcLOGO, rcMail1, rcMail2/*, rcMail3*/;
350 POINT ptMouse;
351 static char szPluginVer[] = "QCD FAAD Input Plug-in v1.0b\nCompiled on " __TIME__ ", " __DATE__;
352 static char szFLACVer[] = "Using: FAAD2 v "FAAD2_VERSION" by";
353
354 switch (uMsg)
355 {
356 case WM_INITDIALOG:
357 case WM_MOVE:
358 GetWindowRect(GetDlgItem(hwndDlg, IDC_LOGO), &rcLOGO);
359 GetWindowRect(GetDlgItem(hwndDlg, IDC_MAIL1), &rcMail1);
360 GetWindowRect(GetDlgItem(hwndDlg, IDC_MAIL2), &rcMail2);
361 // GetWindowRect(GetDlgItem(hwndDlg, IDC_MAIL2), &rcMail3);
362
363 SetDlgItemText(hwndDlg, IDC_PLUGINVER, szPluginVer);
364 SetDlgItemText(hwndDlg, IDC_FAADVER, szFLACVer);
365
366 return TRUE;
367 case WM_MOUSEMOVE:
368 ptMouse.x = LOWORD(lParam);
369 ptMouse.y = HIWORD(lParam);
370 ClientToScreen(hwndDlg, &ptMouse);
371 if( (ptMouse.x >= rcLOGO.left && ptMouse.x <= rcLOGO.right &&
372 ptMouse.y >= rcLOGO.top && ptMouse.y<= rcLOGO.bottom)
373 ||
374 (ptMouse.x >= rcMail1.left && ptMouse.x <= rcMail1.right &&
375 ptMouse.y >= rcMail1.top && ptMouse.y<= rcMail1.bottom)
376 ||
377 (ptMouse.x >= rcMail2.left && ptMouse.x <= rcMail2.right &&
378 ptMouse.y >= rcMail2.top && ptMouse.y<= rcMail2.bottom)
379 /* ||
380 (ptMouse.x >= rcMail3.left && ptMouse.x <= rcMail3.right &&
381 ptMouse.y >= rcMail3.top && ptMouse.y<= rcMail3.bottom)*/ )
382 SetCursor(LoadCursor(NULL, MAKEINTRESOURCE(32649)));
383 else
384 SetCursor(LoadCursor(NULL, IDC_ARROW));
385
386 return TRUE;
387 case WM_LBUTTONDOWN:
388 ptMouse.x = LOWORD(lParam);
389 ptMouse.y = HIWORD(lParam);
390 ClientToScreen(hwndDlg, &ptMouse);
391 if(ptMouse.x >= rcLOGO.left && ptMouse.x <= rcLOGO.right &&
392 ptMouse.y >= rcLOGO.top && ptMouse.y<= rcLOGO.bottom)
393 ShellExecute(0, NULL, "http://www.audiocoding.com", NULL,NULL, SW_NORMAL);
394 else if(ptMouse.x >= rcMail1.left && ptMouse.x <= rcMail1.right &&
395 ptMouse.y >= rcMail1.top && ptMouse.y<= rcMail1.bottom)
396 ShellExecute(0, NULL, "mailto:shaohao@elong.com", NULL,NULL, SW_NORMAL);
397 else if(ptMouse.x >= rcMail2.left && ptMouse.x <= rcMail2.right &&
398 ptMouse.y >= rcMail2.top && ptMouse.y<= rcMail2.bottom)
399 ShellExecute(0, NULL, "mailto:menno@audiocoding.com", NULL,NULL, SW_NORMAL);
400 /* else if(ptMouse.x >= rcMail3.left && ptMouse.x <= rcMail3.right &&
401 ptMouse.y >= rcMail3.top && ptMouse.y<= rcMail3.bottom)
402 ShellExecute(0, NULL, "I don't know", NULL,NULL, SW_NORMAL);
403 */
404 return TRUE;
405 case WM_COMMAND:
406 switch(LOWORD(wParam))
407 {
408 case IDOK:
409 default:
410 DestroyWindow(hwndDlg);
411 return TRUE;
412 }
413 }
414 return FALSE;
415 }
416
417 void About(int flags)
418 {
419 if(!IsWindow(hwndAbout))
420 hwndAbout = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_ABOUT), hwndPlayer, about_dialog_proc);
421 ShowWindow(hwndAbout, SW_SHOW);
422 }
423
424 //-----------------------------------------------------------------------------
425
426 BOOL Initialize(QCDModInfo *ModInfo, int flags)
427 {
428 hwndPlayer = (HWND)QCDCallbacks->Service(opGetParentWnd, 0, 0, 0);
429
430 lastfn[0] = 0;
431 seek_needed = -1;
432 paused = 0;
433 play_thread_handle = INVALID_HANDLE_VALUE;
434
435 /* read config */
436 QCDCallbacks->Service(opGetPluginSettingsFile, INI_FILE, MAX_PATH, 0);
437 config_read();
438
439 ModInfo->moduleString = "FAAD Plugin v1.0b";
440 ModInfo->moduleExtensions = "AAC";
441
442 /* Initialize winsock, necessary for streaming */
443 WinsockInit();
444
445 // insert menu item into plugin menu
446 // QCDCallbacks->Service(opSetPluginMenuItem, hInstance, IDD_CONFIG, (long)"FAAD Plug-in");
447
448 return TRUE;
449 }
450
451 //----------------------------------------------------------------------------
452
453 void ShutDown(int flags)
454 {
455 Stop(lastfn, STOPFLAG_FORCESTOP);
456
457 if(buffer)
458 LocalFree(buffer);
459
460 /* Deallocate winsock */
461 WinsockDeInit();
462
463 // delete the inserted plugin menu
464 // QCDCallbacks->Service(opSetPluginMenuItem, hInstance, 0, 0);
465 }
466
467 //-----------------------------------------------------------------------------
468
469 BOOL GetMediaSupported(LPCSTR medianame, MediaInfo *mediaInfo)
470 {
471 FILE_STREAM *in;
472 faadAACInfo tmp;
473 char *ch = strrchr(medianame, '.');
474
475 if (!medianame || !*medianame)
476 return FALSE;
477
478 if(!ch)
479 return (lstrlen(medianame) > 2); // no extension defaults to me (if not drive letter)
480
481 /* Finally fixed */
482 if(StringComp(ch, ".aac", 4) == 0)
483 {
484 in = open_filestream((char *)medianame);
485
486 if(in != NULL && mediaInfo)
487 {
488 if(in->http)
489 {
490 /* No seeking in http streams */
491 mediaInfo->mediaType = DIGITAL_STREAM_MEDIA;
492 mediaInfo->op_canSeek = FALSE;
493 }
494 else
495 {
496 mediaInfo->mediaType = DIGITAL_FILE_MEDIA;
497 get_AAC_format((char *)medianame, &tmp, NULL, NULL, 1);
498 if(tmp.headertype == 2) /* ADTS header - seekable */
499 mediaInfo->op_canSeek = TRUE;
500 else
501 mediaInfo->op_canSeek = FALSE; /* ADIF or Headerless - not seekable */
502 }
503
504 close_filestream(in);
505 return TRUE;
506 }
507 else
508 {
509 close_filestream(in);
510 return FALSE;
511 }
512 }
513 else
514 return FALSE;
515 }
516
517 unsigned long samplerate, channels;
518
519 int play_memmap(char *fn)
520 {
521 int tagsize = 0;
522
523 infile = open_filestream(fn);
524
525 if (infile == NULL)
526 return 1;
527
528 fileread = filelength_filestream(infile);
529
530 memmap_buffer = (char*)LocalAlloc(LPTR, fileread);
531 read_buffer_filestream(infile, memmap_buffer, fileread);
532
533 /* skip id3v2 tag */
534 memmap_index = id3v2_tag(memmap_buffer);
535
536 hDecoder = faacDecOpen();
537
538 /* Copy the configuration dialog setting and use it as the default */
539 /* initialize the decoder, and get samplerate and channel info */
540
541 if( (buffercount = faacDecInit(hDecoder, memmap_buffer + memmap_index,
542 fileread - memmap_index - 1, &samplerate, &channels)) < 0 )
543 {
544 show_error("Error opening input file");
545 return 1;
546 }
547
548 memmap_index += buffercount;
549
550 PlayThread_memmap();
551
552 return 0;
553 }
554
555 int play_file(char *fn)
556 {
557 int k;
558 int tagsize;
559
560 ZeroMemory(buffer, 768*2);
561
562 infile = open_filestream(fn);
563
564 if (infile == NULL)
565 return 1;
566
567 fileread = filelength_filestream(infile);
568
569 buffercount = bytecount = 0;
570 read_buffer_filestream(infile, buffer, 768*2);
571
572 tagsize = id3v2_tag(buffer);
573
574 /* If we find a tag, run right over it */
575 if(tagsize)
576 {
577 if(infile->http)
578 {
579 int i;
580 /* Crude way of doing this, but I believe its fast enough to not make a big difference */
581 close_filestream(infile);
582 infile = open_filestream(fn);
583
584 for(i=0; i < tagsize; i++)
585 read_byte_filestream(infile);
586 }
587 else
588 seek_filestream(infile, tagsize, FILE_BEGIN);
589
590 bytecount = tagsize;
591 buffercount = 0;
592 read_buffer_filestream(infile, buffer, 768*2);
593 }
594
595 hDecoder = faacDecOpen();
596
597 /* Copy the configuration dialog setting and use it as the default */
598 /* initialize the decoder, and get samplerate and channel info */
599
600 if((buffercount = faacDecInit(hDecoder, buffer, 768*2, &samplerate, &channels)) < 0)
601 {
602 show_error("Error opening input file");
603 return 1;
604 }
605
606 if(buffercount > 0)
607 {
608 bytecount += buffercount;
609
610 for (k = 0; k < (768*2 - buffercount); k++)
611 buffer[k] = buffer[k + buffercount];
612
613 read_buffer_filestream(infile, buffer + (768*2) - buffercount, buffercount);
614 buffercount = 0;
615 }
616
617 PlayThread_file();
618
619 return 0;
620 }
621
622
623 //-----------------------------------------------------------------------------
624
625 BOOL Play(LPCSTR medianame, int playfrom, int playto, int flags)
626 {
627 if(stricmp(lastfn, medianame) != 0)
628 {
629 sQCDCallbacks.toPlayer.OutputStop(STOPFLAG_PLAYDONE);
630 Stop(lastfn, STOPFLAG_PLAYDONE);
631 }
632
633 if(paused)
634 {
635 // Update the player controls to reflect the new unpaused state
636 sQCDCallbacks.toPlayer.OutputPause(0);
637
638 Pause(medianame, PAUSE_DISABLED);
639
640 if (playfrom >= 0)
641 seek_needed = playfrom;
642 }
643 else if(play_thread_handle != INVALID_HANDLE_VALUE)
644 {
645 seek_needed = playfrom;
646 return TRUE;
647 }
648 else
649 {
650 int thread_id;
651
652 // alloc the input buffer
653 buffer = (unsigned char*)LocalAlloc(LPTR, 768*2);
654
655 current_file_mode = m_memmap_file;
656
657 if(current_file_mode)
658 {
659 if(play_memmap((char *)medianame))
660 return FALSE;
661 }
662 else
663 {
664 if(play_file((char *)medianame))
665 return FALSE;
666 }
667
668 if(seek_table)
669 {
670 free(seek_table);
671 seek_table = NULL;
672 seek_table_length = 0;
673 }
674
675 get_AAC_format((char *)medianame, &file_info, &seek_table, &seek_table_length, 0);
676
677 seek_needed = playfrom > 0 ? playfrom : -1;
678 killPlayThread = 0;
679 strcpy(lastfn,medianame);
680
681 /*
682 To RageAmp: This is really needed, because aacinfo isn't very accurate on ADIF files yet.
683 Can be fixed though :-)
684 */
685 file_info.sampling_rate = samplerate;
686 file_info.channels = frameInfo.channels;
687
688 play_thread_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) PlayThread, (void *) &killPlayThread, 0, &thread_id);
689 if(!play_thread_handle)
690 return FALSE;
691
692 // Note: This line seriously slows down start up time
693 if(m_priority != 3) // if the priority in config window is set to normal, there is nothing to reset!
694 SetThreadPriority(play_thread_handle, priority_table[m_priority]);
695
696 }
697
698 return TRUE;
699 }
700
701 //-----------------------------------------------------------------------------
702
703 BOOL Pause(LPCSTR medianame, int flags)
704 {
705 if(QCDCallbacks->toPlayer.OutputPause(flags))
706 {
707 // send back pause/unpause notification
708 QCDCallbacks->toPlayer.PlayPaused(medianame, flags);
709 paused = flags;
710 return TRUE;
711 }
712 return FALSE;
713 }
714
715 //-----------------------------------------------------------------------------
716
717 BOOL Stop(LPCSTR medianame, int flags)
718 {
719 if(medianame && *medianame && stricmp(lastfn, medianame) == 0)
720 {
721 sQCDCallbacks.toPlayer.OutputStop(flags);
722
723 killPlayThread = 1;
724 if(play_thread_handle != INVALID_HANDLE_VALUE)
725 {
726 if(WaitForSingleObject(play_thread_handle, INFINITE) == WAIT_TIMEOUT)
727 {
728 // MessageBox(hwndPlayer, "FAAD thread kill timeout", "debug", 0);
729 TerminateThread(play_thread_handle,0);
730 }
731 CloseHandle(play_thread_handle);
732 play_thread_handle = INVALID_HANDLE_VALUE;
733 }
734
735 if (oldAPIs)
736 QCDCallbacks->toPlayer.PlayStopped(lastfn);
737
738 lastfn[0] = 0;
739 }
740
741 return TRUE;
742 }
743
744 int aac_seek(int pos_ms, int *sktable)
745 {
746 double offset_sec;
747
748 offset_sec = pos_ms / 1000.0;
749 if(!current_file_mode)
750 {
751 seek_filestream(infile, sktable[(int)(offset_sec+0.5)], FILE_BEGIN);
752
753 bytecount = sktable[(int)(offset_sec+0.5)];
754 buffercount = 0;
755 read_buffer_filestream(infile, buffer, 768*2);
756 }
757 else
758 {
759 memmap_index = sktable[(int)(offset_sec+0.5)];
760 }
761
762 return 0;
763 }
764
765 //-----------------------------------------------------------------------------
766
767 void SetVolume(int levelleft, int levelright, int flags)
768 {
769 QCDCallbacks->toPlayer.OutputSetVol(levelleft, levelright, flags);
770 }
771
772 //-----------------------------------------------------------------------------
773
774 BOOL GetCurrentPosition(LPCSTR medianame, long *track, long *offset)
775 {
776 return QCDCallbacks->toPlayer.OutputGetCurrentPosition((UINT*)offset, 0);
777 }
778
779 //-----------------------------------------------------------------------------
780
781 BOOL GetTrackExtents(LPCSTR medianame, TrackExtents *ext, int flags)
782 {
783 faadAACInfo tmp;
784
785 if(get_AAC_format((char*)medianame, &tmp, NULL, NULL, 1))
786 return FALSE;
787
788 ext->track = 1;
789 ext->start = 0;
790 ext->end = tmp.length;
791 ext->bytesize = tmp.bitrate * tmp.length;
792 ext->unitpersec = 1000;
793
794 return TRUE;
795 }
796
797 //--------------------------for play thread-------------------------------------
798
799 int last_frame;
800
801 DWORD WINAPI PlayThread(void *b)
802 {
803 BOOL done = FALSE, updatePos = FALSE;
804 int decode_pos_ms = 0; // current decoding position, in milliseconds
805 int l;
806 int decoded_frames=0;
807 int br_calc_frames=0;
808 int br_bytes_consumed=0;
809 unsigned long bytesconsumed;
810
811 last_frame = 0;
812
813 if(!done)
814 {
815 // open outputdevice
816 WAVEFORMATEX wf;
817 wf.wFormatTag = WAVE_FORMAT_PCM;
818 wf.cbSize = 0;
819 wf.nChannels = file_info.channels;
820 wf.wBitsPerSample = 16;
821 wf.nSamplesPerSec = file_info.sampling_rate;
822 wf.nBlockAlign = wf.nChannels * wf.wBitsPerSample / 8;
823 wf.nAvgBytesPerSec = wf.nSamplesPerSec * wf.nBlockAlign;
824 if (!QCDCallbacks->toPlayer.OutputOpen(lastfn, &wf))
825 {
826 show_error("Error: Failed openning output plugin!");
827 done = TRUE; // cannot open sound device
828 }
829 }
830
831 while (! *((int *)b) )
832 {
833 /********************** SEEK ************************/
834 if (!done && seek_needed >= 0)
835 {
836 int seconds;
837
838 // Round off to a second
839 seconds = seek_needed - (seek_needed%1000);
840 QCDCallbacks->toPlayer.OutputFlush(decode_pos_ms);
841 aac_seek(seconds, seek_table);
842 decode_pos_ms = seconds;
843 decoded_frames = 0;
844 br_calc_frames = 0;
845 br_bytes_consumed = 0;
846
847 seek_needed = -1;
848 updatePos = 1;
849 }
850
851 /********************* QUIT *************************/
852 if (done)
853 {
854 if (QCDCallbacks->toPlayer.OutputDrain(0) && !(seek_needed >= 0))
855 {
856 play_thread_handle = INVALID_HANDLE_VALUE;
857 QCDCallbacks->toPlayer.OutputStop(STOPFLAG_PLAYDONE);
858 QCDCallbacks->toPlayer.PlayDone(lastfn);
859 }
860 else if (seek_needed >= 0)
861 {
862 done = FALSE;
863 continue;
864 }
865 break;
866 }
867
868 /******************* DECODE TO BUFFER ****************/
869 else
870 {
871 if (current_file_mode)
872 bytesconsumed = PlayThread_memmap();
873 else
874 bytesconsumed = PlayThread_file();
875
876 if(last_frame)
877 done = TRUE;
878 else
879 {
880
881 decoded_frames++;
882 br_calc_frames++;
883 br_bytes_consumed += bytesconsumed;
884
885 /* Update the variable bitrate about every second */
886 if(m_variable_bitrate_display && br_calc_frames == 43)
887 {
888 AudioInfo vai;
889 vai.struct_size = sizeof(AudioInfo);
890 vai.frequency = file_info.sampling_rate;
891 vai.bitrate = (int)((br_bytes_consumed * 8) / (decoded_frames / 43.07));
892 vai.mode = (channels == 2) ? 0 : 3;
893 vai.layer = 0;
894 vai.level = file_info.version;
895 QCDCallbacks->Service(opSetAudioInfo, &vai, sizeof(AudioInfo), 0);
896
897 br_calc_frames = 0;
898 }
899
900 if (!killPlayThread && (frameInfo.samples > 0))
901 {
902 //update the time display
903 if (updatePos)
904 {
905 QCDCallbacks->toPlayer.PositionUpdate(decode_pos_ms);
906 updatePos = 0;
907 }
908
909 {
910 WriteDataStruct wd;
911
912 l = frameInfo.samples * sizeof(short);
913
914 decode_pos_ms += (1024*1000)/file_info.sampling_rate;
915
916 wd.bytelen = l;
917 wd.data = sample_buffer;
918 wd.markerend = 0;
919 wd.markerstart = decode_pos_ms;
920 wd.bps = 16;
921 wd.nch = frameInfo.channels;
922 wd.numsamples =l/file_info.channels/(16/8);
923 wd.srate = file_info.sampling_rate;
924
925 if (!QCDCallbacks->toPlayer.OutputWrite(&wd))
926 done = TRUE;
927 }
928 }
929 }
930 }
931 Sleep(10);
932 }
933
934 // close up
935 play_thread_handle = INVALID_HANDLE_VALUE;
936
937 faacDecClose(hDecoder);
938 hDecoder = INVALID_HANDLE_VALUE;
939 close_filestream(infile);
940 infile = NULL;
941
942 if(seek_table)
943 {
944 free(seek_table);
945 seek_table = NULL;
946 seek_table_length = 0;
947 }
948
949 if(buffer)
950 {
951 LocalFree(buffer);
952 buffer = NULL;
953 }
954 if(memmap_buffer)
955 {
956 LocalFree(memmap_buffer);
957 memmap_buffer = NULL;
958 }
959
960 return 0;
961 }
962
963 // thread play funcs
964 int PlayThread_memmap()
965 {
966 sample_buffer = (char*)faacDecDecode(hDecoder, &frameInfo,
967 memmap_buffer + memmap_index, fileread - memmap_index - 1);
968 if (frameInfo.error)
969 {
970 // show_error(faacDecGetErrorMessage(frameInfo.error));
971 last_frame = 1;
972 }
973
974 memmap_index += frameInfo.bytesconsumed;
975 if (memmap_index >= fileread)
976 last_frame = 1;
977
978 return frameInfo.bytesconsumed;
979 }
980
981 int PlayThread_file()
982 {
983 int k;
984
985 if (buffercount > 0)
986 {
987 for (k = 0; k < (768*2 - buffercount); k++)
988 buffer[k] = buffer[k + buffercount];
989
990 read_buffer_filestream(infile, buffer + (768*2) - buffercount, buffercount);
991 buffercount = 0;
992 }
993
994 sample_buffer = (char*)faacDecDecode(hDecoder, &frameInfo, buffer, 768*2);
995 if (frameInfo.error)
996 {
997 // show_error(faacDecGetErrorMessage(frameInfo.error));
998 last_frame = 1;
999 }
1000
1001 buffercount += frameInfo.bytesconsumed;
1002
1003 bytecount += frameInfo.bytesconsumed;
1004 if (bytecount >= fileread)
1005 last_frame = 1;
1006
1007 return frameInfo.bytesconsumed;
1008 }
1009
1010 // tag
1011 int id3v2_tag(unsigned char *buffer)
1012 {
1013 if (StringComp(buffer, "ID3", 3) == 0)
1014 {
1015 unsigned long tagsize;
1016
1017 /* high bit is not used */
1018 tagsize = (buffer[6] << 21) | (buffer[7] << 14) |
1019 (buffer[8] << 7) | (buffer[9] << 0);
1020
1021 tagsize += 10;
1022
1023 return tagsize;
1024 }
1025 else
1026 {
1027 return 0;
1028 }
1029 }
0 # Microsoft Developer Studio Project File - Name="QCDFAAD" - Package Owner=<4>
1 # Microsoft Developer Studio Generated Build File, Format Version 6.00
2 # ** DO NOT EDIT **
3
4 # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
5
6 CFG=QCDFAAD - Win32 Debug
7 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
8 !MESSAGE use the Export Makefile command and run
9 !MESSAGE
10 !MESSAGE NMAKE /f "QCDFAAD.mak".
11 !MESSAGE
12 !MESSAGE You can specify a configuration when running NMAKE
13 !MESSAGE by defining the macro CFG on the command line. For example:
14 !MESSAGE
15 !MESSAGE NMAKE /f "QCDFAAD.mak" CFG="QCDFAAD - Win32 Debug"
16 !MESSAGE
17 !MESSAGE Possible choices for configuration are:
18 !MESSAGE
19 !MESSAGE "QCDFAAD - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
20 !MESSAGE "QCDFAAD - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
21 !MESSAGE
22
23 # Begin Project
24 # PROP AllowPerConfigDependencies 0
25 # PROP Scc_ProjName ""
26 # PROP Scc_LocalPath ""
27 CPP=cl.exe
28 MTL=midl.exe
29 RSC=rc.exe
30
31 !IF "$(CFG)" == "QCDFAAD - Win32 Release"
32
33 # PROP BASE Use_MFC 0
34 # PROP BASE Use_Debug_Libraries 0
35 # PROP BASE Output_Dir "Release"
36 # PROP BASE Intermediate_Dir "Release"
37 # PROP BASE Target_Dir ""
38 # PROP Use_MFC 0
39 # PROP Use_Debug_Libraries 0
40 # PROP Output_Dir "Release"
41 # PROP Intermediate_Dir "Release"
42 # PROP Ignore_Export_Lib 0
43 # PROP Target_Dir ""
44 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
45 # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "..\..\common\faad" /I "..\..\plugins\winamp" /I "..\..\common\id3lib\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "ID3LIB_COMPILATION" /YX /FD /c
46 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
47 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
48 # ADD BASE RSC /l 0x413 /d "NDEBUG"
49 # ADD RSC /l 0x413 /d "NDEBUG"
50 BSC32=bscmake.exe
51 # ADD BASE BSC32 /nologo
52 # ADD BSC32 /nologo
53 LINK32=link.exe
54 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
55 # ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
56
57 !ELSEIF "$(CFG)" == "QCDFAAD - Win32 Debug"
58
59 # PROP BASE Use_MFC 0
60 # PROP BASE Use_Debug_Libraries 1
61 # PROP BASE Output_Dir "Debug"
62 # PROP BASE Intermediate_Dir "Debug"
63 # PROP BASE Target_Dir ""
64 # PROP Use_MFC 0
65 # PROP Use_Debug_Libraries 1
66 # PROP Output_Dir "Debug"
67 # PROP Intermediate_Dir "Debug"
68 # PROP Ignore_Export_Lib 0
69 # PROP Target_Dir ""
70 # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
71 # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "..\..\common\faad" /I "..\..\plugins\winamp" /I "..\..\common\id3lib\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "ID3LIB_COMPILATION" /FR /YX /FD /GZ /c
72 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
73 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
74 # ADD BASE RSC /l 0x413 /d "_DEBUG"
75 # ADD RSC /l 0x413 /d "_DEBUG"
76 BSC32=bscmake.exe
77 # ADD BASE BSC32 /nologo
78 # ADD BSC32 /nologo
79 LINK32=link.exe
80 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
81 # ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
82 # SUBTRACT LINK32 /force
83
84 !ENDIF
85
86 # Begin Target
87
88 # Name "QCDFAAD - Win32 Release"
89 # Name "QCDFAAD - Win32 Debug"
90 # Begin Group "Source Files"
91
92 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
93 # Begin Source File
94
95 SOURCE=..\..\common\faad\aacinfo.c
96 # End Source File
97 # Begin Source File
98
99 SOURCE=..\..\common\faad\filestream.c
100 # End Source File
101 # Begin Source File
102
103 SOURCE=.\QCDFAAD.c
104 # End Source File
105 # End Group
106 # Begin Group "Header Files"
107
108 # PROP Default_Filter "h;hpp;hxx;hm;inl"
109 # Begin Source File
110
111 SOURCE=..\..\common\faad\aacinfo.h
112 # End Source File
113 # Begin Source File
114
115 SOURCE=..\..\include\faad.h
116 # End Source File
117 # Begin Source File
118
119 SOURCE=..\..\common\faad\filestream.h
120 # End Source File
121 # Begin Source File
122
123 SOURCE=.\QCDInputDLL.h
124 # End Source File
125 # Begin Source File
126
127 SOURCE=.\QCDModDefs.h
128 # End Source File
129 # Begin Source File
130
131 SOURCE=.\QCDModInput.h
132 # End Source File
133 # End Group
134 # Begin Group "Resource Files"
135
136 # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
137 # Begin Source File
138
139 SOURCE=.\hand.cur
140 # End Source File
141 # Begin Source File
142
143 SOURCE=.\logo.bmp
144 # End Source File
145 # Begin Source File
146
147 SOURCE=.\plugin_dlg.rc
148 # End Source File
149 # End Group
150 # End Target
151 # End Project
0 Microsoft Developer Studio Workspace File, Format Version 6.00
1 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
2
3 ###############################################################################
4
5 Project: "QCDFAAD"=".\QCDFAAD.dsp" - Package Owner=<4>
6
7 Package=<5>
8 {{{
9 }}}
10
11 Package=<4>
12 {{{
13 Begin Project Dependency
14 Project_Dep_Name libfaad
15 End Project Dependency
16 }}}
17
18 ###############################################################################
19
20 Project: "libfaad"="..\..\libfaad\libfaad.dsp" - Package Owner=<4>
21
22 Package=<5>
23 {{{
24 }}}
25
26 Package=<4>
27 {{{
28 }}}
29
30 ###############################################################################
31
32 Global:
33
34 Package=<5>
35 {{{
36 }}}
37
38 Package=<3>
39 {{{
40 }}}
41
42 ###############################################################################
43
0 //-----------------------------------------------------------------------------
1 //
2 // File: QCDInputDLL.h
3 //
4 // About: QCD Player Input module DLL interface. For more documentation, see
5 // QCDModInput.h.
6 //
7 // Authors: Written by Paul Quinn and Richard Carlson.
8 //
9 // QCD multimedia player application Software Development Kit Release 1.0.
10 //
11 // Copyright (C) 1997-2002 Quinnware
12 //
13 // This code is free. If you redistribute it in any form, leave this notice
14 // here.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 //
20 //-----------------------------------------------------------------------------
21
22 #ifndef QCDInputDLL_H
23 #define QCDInputDLL_H
24
25 #include "QCDModInput.h"
26
27 extern HINSTANCE hInstance;
28 extern HWND hwndPlayer;
29 extern QCDModInitIn sQCDCallbacks, *QCDCallbacks;
30
31 // Calls from the Player
32 int GetMediaSupported(const char* medianame, MediaInfo *mediaInfo);
33 int GetTrackExtents(const char* medianame, TrackExtents *ext, int flags);
34 int GetCurrentPosition(const char* medianame, long *track, long *offset);
35
36 void SetEQ(EQInfo*);
37 void SetVolume(int levelleft, int levelright, int flags);
38
39 int Play(const char* medianame, int framefrom, int frameto, int flags);
40 int Pause(const char* medianame, int flags);
41 int Stop(const char* medianame, int flags);
42 int Eject(const char* medianame, int flags);
43
44 int Initialize(QCDModInfo *ModInfo, int flags);
45 void ShutDown(int flags);
46 void Configure(int flags);
47 void About(int flags);
48
49 #endif //QCDInputDLL_H
0 //-----------------------------------------------------------------------------
1 //
2 // File: QCDModDefs.h
3 //
4 // About: Module definitions file. Miscellanious definitions used by different
5 // module types. This file is published with the plugin SDKs.
6 //
7 // Authors: Written by Paul Quinn and Richard Carlson.
8 //
9 // Copyright:
10 //
11 // QCD multimedia player application Software Development Kit Release 1.0.
12 //
13 // Copyright (C) 1997-2002 Quinnware
14 //
15 // This code is free. If you redistribute it in any form, leave this notice
16 // here.
17 //
18 // This program is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 //
22 //-----------------------------------------------------------------------------
23
24 #ifndef QCDMODDEFS_H
25 #define QCDMODDEFS_H
26
27 #include <windows.h>
28
29 #ifdef __cplusplus
30 #define PLUGIN_API extern "C" __declspec(dllexport)
31 #else
32 #define PLUGIN_API __declspec(dllexport)
33 #endif
34
35 // Current plugin version
36 #define PLUGIN_API_VERSION 250
37
38 //-----------------------------------------------------------------------------
39
40 typedef struct {
41 char *moduleString;
42 char *moduleExtensions;
43
44 } QCDModInfo;
45
46 //-----------------------------------------------------------------------------
47 // Services (ops) provided by the Player
48 //-----------------------------------------------------------------------------
49 typedef enum
50 { //*** below returns numeric info (*buffer not used)
51
52 opGetPlayerVersion = 0, // high-order word = major version (eg 3.01 is 3), low-order word = minor (eg 3.01 = 1)
53 opGetParentWnd = 1, // handle to player window
54 opGetPlayerInstance = 2, // HINSTANCE to player executable
55
56 opGetPlayerState = 9, // get current state of the player (returns: 1 = stopped, 2 = playing, 3 = paused, 0 = failed)
57 opGetNumTracks = 10, // number of tracks in playlist
58 opGetCurrentIndex = 11, // index of current track in playlist (0 based)
59 opGetNextIndex = 12, // get index of next track to play (0 based), param1 = index start index. -1 for after current
60 opGetTrackNum = 13, // get track number of index, param1 = index of track in playlist, -1 for current
61 // - 'track number' is the number of the track in it's respective album, as opposed to playlist number
62 // - the 'track number' for digital files will be 1, unless they are tagged with the CDDB identifier
63
64 opGetTrackLength = 14, // get track length, param1 = index of track in playlist, -1 for current
65 // param2 = 0 for seconds, 1 for milliseconds
66 opGetTime = 15, // get time on player, param1 = 0 for time displayed, 1 for track time, 2 for playlist time
67 // param2 = 0 for elapsed, 1 for remaining
68 opGetTrackState = 16, // get whether track is marked, param1 = index of track, -1 for current
69 opGetPlaylistNum = 17, // get playlist number of index, param1 = index of track in playlist, -1 for current
70 opGetMediaType = 18, // get media type of track, param1 = index if track in playlist, -1 for current
71 // - see MediaTypes below for return values
72
73 opGetAudioInfo = 19, // get format info about currently playing track
74 // - param1 = 0 for samplerate, 1 for bitrate, 2 for num channels
75
76 opGetOffline = 20, // true if client is in Offline Mode
77 opGetVisTarget = 21, // where is vis being drawn > 0 - internal to skin, 1 - external window, 2 - full screen
78 opGetAlwaysOnTop = 22, // true if player is set to 'Always on Top'
79 opGetRepeatState = 23, // returns: 0 - repeat off, 1 - repeat track, 2 - repeat all
80 opGetShuffleState = 27, // returns: 0 - shuffle off, 1 - shuffle enabled
81
82 opGetTimerState = 24, // low-order word: 0 - track ascend, 1 - playlist ascend, 2 - track descend, 3 - playlist descend
83 // hi-order word: 1 if 'show hours' is set, else 0
84
85 opGetVolume = 25, // get master volume level (0 - 100), param1: 0 = combined, 1 = left, 2 = right
86 opSetVolume = 26, // set master volume level, param1: vol level 0 - 100, param2: balance (-100 left, 0 center, 100 right)
87
88 opGetIndexFromPLNum = 28, // get index from playlist number, param1 = playlist number
89
90 opGetChildWnd = 30, // handle to the draggable window extension (only available on some skins)
91 opGetExtVisWnd = 31, // handle to the external visual window
92 opGetMusicBrowserWnd = 32, // handle to the music browser window
93 opGetSkinPreviewWnd = 33, // handle to the skin preview window
94 opGetPropertiesWnd = 34, // handle to the player properties window
95 opGetExtInfoWnd = 35, // handle to the extended information window
96 opGetAboutWnd = 36, // handle to the about window
97 opGetSegmentsWnd = 37, // handle to the segments window
98 opGetEQPresetsWnd = 38, // handle to the EQ presets window
99
100 opGetVisDimensions = 50, // gets the width and height of visual window (param1 = -1 current vis window, 0 internal vis, 1 external vis, 2 full screen)
101 // returns: HEIGHT in high word, WIDTH in low word
102
103 opGetQueriesComplete = 60, // get status on whether all tracks in playlist have been queryied for their info
104
105 // playlist manipulation
106 opDeleteIndex = 90, // delete index from playlist (param1 = index)
107 opSelectIndex = 91, // mark index as selected (param1 = index, param2 = 1 - set, 0 - unset)
108 opBlockIndex = 92, // mark index as blocked (param1 = index, param2 = 1 - set, 0 - unset)
109
110 opGetMediaInfo = 99, // get the CddbDisc object for the index specified, param1 = index of track, -1 for current
111 // param2 = pointer to integer that receives track value
112 // returns: pointer to CddbDisc object. Do not release or deallocate this pointer
113
114
115 //*** below returns string info in buffer, param1 = size of buffer
116 //*** returns 1 on success, 0 on failure
117
118 opGetTrackName = 100, // get track name, param2 = index of track in playlist, -1 for current
119 opGetArtistName = 101, // get artist name, param2 = index of track in playlist, -1 for current
120 opGetDiscName = 102, // get disc name, param2 = index of track in playlist, -1 for current
121
122 opGetTrackFile = 103, // file name of track in playlist, param2 = index of track in playlist, -1 for current
123 opGetSkinName = 104, // get current skin name
124
125 opGetPluginFolder = 105, // get current plugin folder
126 opGetPluginSettingsFile = 106, // get settings file (plugins.ini) that plugin should save settings to
127 opGetPluginCacheFile = 107, // get file that describes plugin validity, functions and names
128 opGetPlayerSettingsFile = 108, // get settings file (qcd.ini) that player saves it settings to (should use for read-only)
129
130 opGetMusicFolder = 110, // get current music folder
131 opGetPlaylistFolder = 111, // get current playlist folder
132 opGetSkinFolder = 112, // get current skin folder
133 opGetCDDBCacheFolder = 113, // get current folder for CDDB cached info
134
135 opGetCurrentPlaylist = 114, // get full pathname of playlist currently loaded
136
137 opGetMediaID = 115, // get media identifier, param2 = index of track in playlist, -1 for current
138 // - for CD's it's the TOC - for anything else, right now it's 0
139
140 opGetSupportedExtensions = 116, // get file extensions supported by the player, param2 = 0 - get all extensions, 1 - get registered extensions
141 // - returned extensions will be colon delimited
142
143
144 //*** below buffer points to struct or other object
145 //*** returns 1 on success, 0 on failure
146
147 opShowMainMenu = 120, // Display Main QCD Menu (buffer = POINT* - location to display menu)
148 opGetMainMenu = 121, // Returns copy of HMENU handle to QCD Menu (must use DestroyMenu on handle when complete)
149
150 opShowQuickTrack = 125, // Display QuickTrack Menu (buffer = POINT* - location to display menu)
151
152 opGetEQVals = 200, // get current EQ levels/on/off (buffer = EQInfo*)
153 opSetEQVals = 201, // set EQ levels/on/off (buffer = EQInfo*)
154
155 opGetProxyInfo = 202, // get proxy info (buffer = ProxyInfo*), returns 0 if proxy not in use
156
157
158 //*** below returns numeric info, buffer used
159
160 opGetIndexFromFilename = 210, // get the index of a file that exists in current playlist (buffer = full path of file),
161 // param1 = startindex (index to start searching on)
162 // returns -1 if file not in playlist
163
164
165 //*** below send information to player
166 //*** returns 1 on success, 0 on failure
167
168 opSetStatusMessage = 1000, // display message in status area (buffer = msg buffer (null term), param1 = text flags (see below))
169
170 opSetBrowserUrl = 1001, // set music browser URL (buffer = url (null term))
171 // null url buffer - closes browser
172 // param1 = 0 - normal, 1 - force open
173
174 opSetAudioInfo = 1002, // set the current music bitrate/khz (buffer = AudioInfo*, param1 = size of AudioInfo)
175
176 opSetTrackAlbum = 1003, // update track ablum name (buffer = album (null term), param1 = (string ptr)file name), param2 = MediaTypes
177 opSetTrackTitle = 1004, // update track title (buffer = title (null term), param1 = (string ptr)file name), param2 = MediaTypes
178 opSetTrackArtist = 1005, // update track artist name (buffer = artist (null term), param1 = (string ptr)file name), param2 = MediaTypes
179
180 opSetPlaylist = 1006, // add files to or reset playlist with new files (buffer = file list (null term), param1 = (string ptr)originating path (can be NULL), param2 = 1 - clear playlist flag, 2 - enqueue to top
181
182 opSetTrackExtents = 1007, // update track TrackExtents info (buffer = &TrackExtents), param1 = (string ptr)file name)
183 opSetTrackSeekable = 1008, // update track seekable flag (buffer = (string ptr)file name), param1 = TRUE/FALSE
184 opSetPlayNext = 1009, // set the next index to be played (buffer = NULL, param1 = index, index = -1 unsets playnext)
185 opSetIndexFilename = 1010, // updates the filename (or stream) that an index in the current playlist refers to, buffer = new filename, param1 = index
186
187 opSetSeekPosition = 1100, // seek to position during playback (buffer = NULL, param1 = position, param2 = 0 - position is in seconds, 1 - position is in milliseconds, 2 - position is in percent (use (float)param1))
188
189
190 //*** below configures custom plugin menu items for the 'plugin menu'
191 //*** Player will call plugin's configure routine with menu value when menu item selected
192 //*** returns 1 on success, 0 on failure
193
194 opSetPluginMenuItem = 2000, // buffer = HINSTANCE of plugin, param1 = item id, param2 = (string ptr)string to display
195 // - set param2 = 0 to remove item id from menu
196 // - set param1 = 0 and param2 = 0 to remove whole menu
197 opSetPluginMenuState = 2001, // buffer = HINSTANCE of plugin, param1 = item id, param2 = menu flags (same as windows menu flags - eg: MF_CHECKED)
198
199
200 //*** other services
201
202 opSafeWait = 10000 // plugin's can use this to wait on an object without worrying about deadlocking the player.
203 // this should only be called by the thread that enters the plugin, not by any plugin-created threads
204
205 } PluginServiceOp;
206
207 //-----------------------------------------------------------------------------
208 // Info services api provided by the Player, called by Plugin.
209 //-----------------------------------------------------------------------------
210 typedef long (*PluginServiceFunc)(PluginServiceOp op, void *buffer, long param1, long param2);
211
212
213 //-----------------------------------------------------------------------------
214 typedef struct // for Output Plugin Write callback
215 {
216 void *data; // pointer to valid data
217 int bytelen; // length of data pointed to by 'data' in bytes
218 UINT numsamples; // number of samples represented by 'data'
219 UINT bps; // bits per sample
220 UINT nch; // number of channels
221 UINT srate; // sample rate
222
223 UINT markerstart; // Marker position at start of data (marker is time value of data)
224 // (set to WAVE_VIS_DATA_ONLY to not have data sent to output plugins)
225 UINT markerend; // Marker position at end of data (not currently used, set to 0)
226 } WriteDataStruct;
227
228 //-----------------------------------------------------------------------------
229 typedef struct // for GetTrackExtents Input Plugin callback
230 {
231 UINT track; // for CD's, set the track number. Otherwise set to 1.
232 UINT start; // for CD's or media that doesn't start at the beginning
233 // of the file, set to start position. Otherwise set to 0.
234 UINT end; // set to end position of media.
235 UINT unitpersec; // whatever units are being used for this media, how many
236 // of them per second.
237 // (Note: ((end - start) / unitpersecond) = file length
238 UINT bytesize; // size of file in bytes (if applicable, otherwise 0).
239 } TrackExtents;
240
241 //-----------------------------------------------------------------------------
242 typedef struct // for opSetAudioInfo service
243 {
244 long struct_size; // sizeof(AudioInfo)
245 long level; // MPEG level (1 for MPEG1, 2 for MPEG2, 3 for MPEG2.5, 7 for MPEGpro)
246 long layer; // and layer (1, 2 or 3)
247 long bitrate; // audio bitrate in bits per second
248 long frequency; // audio freq in Hz
249 long mode; // 0 for stereo, 1 for joint-stereo, 2 for dual-channel, 3 for mono, 4 for multi-channel
250 } AudioInfo;
251
252 //-----------------------------------------------------------------------------
253 // Equalizer Info
254 //-----------------------------------------------------------------------------
255 typedef struct // for coming QCD version
256 {
257 long struct_size; // sizeof(EQInfo)
258 char enabled;
259 char preamp; // -128 to 127, 0 is even
260 char bands[10]; // -128 to 127, 0 is even
261 } EQInfo;
262
263 //-----------------------------------------------------------------------------
264 typedef struct
265 {
266 long struct_size; // sizeof(ProxyInfo)
267 char hostname[200];
268 long port;
269 char username[100];
270 char password[100];
271 } ProxyInfo;
272
273 //-----------------------------------------------------------------------------
274 typedef enum // for MediaInfo.mediaType
275 {
276 UNKNOWN_MEDIA = 0,
277 CD_AUDIO_MEDIA = 1,
278 DIGITAL_FILE_MEDIA = 2,
279 DIGITAL_STREAM_MEDIA = 3
280 } MediaTypes;
281
282 //-----------------------------------------------------------------------------
283 #define MAX_TOC_LEN 2048
284 typedef struct
285 {
286 // media descriptors
287 CHAR mediaFile[MAX_PATH];
288 MediaTypes mediaType;
289
290 // cd audio media info
291 CHAR cd_mediaTOC[MAX_TOC_LEN];
292 int cd_numTracks;
293 int cd_hasAudio;
294
295 // operation info
296 int op_canSeek;
297
298 // not used
299 int reserved[4];
300
301 } MediaInfo;
302
303
304 //-----------------------------------------------------------------------------
305 // When subclassing the parent window, a plugin can watch for these messages
306 // to react to events going on between plugins and player
307 // DO NOT SEND THESE MESSAGES - can only watch for them
308
309 // Plugin to Player Notifiers
310 #define WM_PN_POSITIONUPDATE (WM_USER + 100) // playback progress updated
311 #define WM_PN_PLAYSTARTED (WM_USER + 101) // playback has started
312 #define WM_PN_PLAYSTOPPED (WM_USER + 102) // playback has stopped by user
313 #define WM_PN_PLAYPAUSED (WM_USER + 103) // playback has been paused
314 #define WM_PN_PLAYDONE (WM_USER + 104) // playback has finished (track completed)
315 #define WM_PN_MEDIAEJECTED (WM_USER + 105) // a CD was ejected (lParam = (LPCSTR)medianame)
316 #define WM_PN_MEDIAINSERTED (WM_USER + 106) // a CD was inserted (lParam = (LPCSTR)medianame)
317 #define WM_PN_INFOCHANGED (WM_USER + 107) // track information was updated (lParam = (LPCSTR)medianame)
318 #define WM_PN_TRACKCHANGED (WM_USER + 109) // current track playing has changed (relevant from CD plugin) (lParam = (LPCSTR)medianame)
319
320 // Player to Plugin Notifiers
321 #define WM_PN_PLAYLISTCHANGED (WM_USER + 200) // playlist has changed in some way (add, delete, sort, shuffle, drag-n-drop, etc...)
322
323 // For intercepting main menu display
324 // (so you can get handle, modify, and display your own)
325 #define WM_SHOWMAINMENU (WM_USER + 20)
326
327 //-----------------------------------------------------------------------------
328 // To shutdown player, send this command
329 #define WM_SHUTDOWN (WM_USER + 5)
330
331 //-----------------------------------------------------------------------------
332 // opSetStatusMessage textflags
333 #define TEXT_DEFAULT 0x0 // message scrolls by in status window
334 #define TEXT_TOOLTIP 0x1 // message acts as tooltip in status window
335 #define TEXT_URGENT 0x2 // forces message to appear even if no status window (using msg box)
336 #define TEXT_HOLD 0x4 // tooltip message stays up (no fade out)
337
338
339 #endif //QCDMODDEFS_H
0 //-----------------------------------------------------------------------------
1 //
2 // File: QCDModInput.h
3 //
4 // About: Input plugin module interface. This file is published with the
5 // Input plugin SDK.
6 //
7 // Authors: Written by Paul Quinn and Richard Carlson.
8 //
9 // Copyright:
10 //
11 // QCD multimedia player application Software Development Kit Release 1.0.
12 //
13 // Copyright (C) 1997-2002 Quinnware
14 //
15 // This code is free. If you redistribute it in any form, leave this notice
16 // here.
17 //
18 // This program is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 //
22 //-----------------------------------------------------------------------------
23
24 #ifndef QCDMODINPUT_H
25 #define QCDMODINPUT_H
26
27 #include "QCDModDefs.h"
28
29 // name of the DLL export for input plugins
30 #define INPUTDLL_ENTRY_POINT QInputModule2 // (updated plugin api version 240+)
31
32 // media insert flags
33 #define MEDIAINSERT_PLAY 0x1
34 #define MEDIAINSERT_ADDTRACKS 0x2
35 #define MEDIAINSERT_ADDSEGMENTS 0x4
36 #define MEDIAINSERT_CLEARPLAYLIST 0x8
37
38 // Stop will receive one of these flags (pass to output plugin's stop())
39 #define STOPFLAG_FORCESTOP 0 // stop occuring due to user action or other event
40 #define STOPFLAG_PLAYDONE 1 // stop occuring due to playlist completion
41
42 // play flags
43 #define PLAYFLAG_PLAYBACK 0x0
44 #define PLAYFLAG_ENCODING 0x1
45 #define PLAYFLAG_SEEKING 0x2
46
47 // Wave Marker flags
48 #define WAVE_VIS_DATA_ONLY -1 // set to WaveDataStruct.markerstart in OutputWrite() call have data only go to vis
49 // and not to output plugin
50 // pause flags
51 #define PAUSE_DISABLED 0 // Pause() call is to unpause playback
52 #define PAUSE_ENABLED 1 // Pause() call is to pause playback
53
54 //-----------------------------------------------------------------------------
55 // Input Module
56 //-----------------------------------------------------------------------------
57 typedef struct
58 {
59 unsigned int size; // size of init structure
60 unsigned int version; // plugin structure version (set to PLUGIN_API_VERSION)
61 PluginServiceFunc Service; // player supplied services callback
62
63 struct
64 {
65 void (*PositionUpdate)(unsigned int position);
66 void (*PlayStopped)(const char* medianame); // notify player of play stop
67 void (*PlayStarted)(const char* medianame); // notify player of play start
68 void (*PlayPaused)(const char* medianame, int flags); // notify player of play pause
69 void (*PlayDone)(const char* medianame); // notify player when play done
70 void (*PlayTrackChanged)(const char* medianame); // notify player when playing track changes (cd audio relevant only)
71 void (*MediaEjected)(const char* medianame); // notify player of media eject (cd audio relevant)
72 void (*MediaInserted)(const char* medianame, int flags); // notify player of media insert (cd audio relevant)
73
74 // output plugin calls
75 int (*OutputOpen)(const char* medianame, WAVEFORMATEX*); // open output for wave data
76 int (*OutputWrite)(WriteDataStruct*); // send PCM audio data to output
77 // (blocks until write completes, thus if output is paused can
78 // block until unpaused)
79 int (*OutputDrain)(int flags); // wait for all output to complete (blocking)
80 int (*OutputDrainCancel)(int flags); // break a drain in progress
81 int (*OutputFlush)(unsigned int marker); // flush output upto marker
82 int (*OutputStop)(int flags); // stop output
83 int (*OutputPause)(int flags); // pause output
84
85 int (*OutputSetVol)(int levelleft, int levelright, int flags);
86 int (*OutputGetCurrentPosition)(unsigned int *position, int flags);
87
88 void *Reserved[10];
89 } toPlayer;
90
91 struct
92 {
93 int (*Initialize)(QCDModInfo *modInfo, int flags); // initialize plugin
94 void (*ShutDown)(int flags); // shutdown plugin
95
96 int (*Play)(const char* medianame, int playfrom, int playto, int flags); // start playing playfrom->playto
97 int (*Stop)(const char* medianame, int flags); // stop playing
98 int (*Pause)(const char* medianame, int flags); // pause playback
99 int (*Eject)(const char* medianame, int flags); // eject media
100 void (*SetEQ)(EQInfo*); // update EQ settings
101
102 int (*GetMediaSupported)(const char* medianame, MediaInfo *mediaInfo); // does plugin support medianame (and provides info for media)
103 int (*GetTrackExtents)(const char* medianame, TrackExtents *ext, int flags); // get media start, end & units
104 int (*GetCurrentPosition)(const char* medianame, long *track, long *offset); // get playing media's position
105
106 void (*Configure)(int flags); // launch configuration
107 void (*About)(int flags); // launch about info
108
109 void (*SetVolume)(int levelleft, int levelright, int flags); // level 0 - 100
110
111 void *Reserved[10];
112 } toModule;
113
114 } QCDModInitIn;
115
116 #endif //QCDMODINPUT_H
0 QCDFAAD.dll input Plugin for Quintessential Player (QCD)
1 Please goto http://www.quinnware.com to download the latest version of QCD.
2
3 About Tagging music file:
4
5 Because QCD support ID3v1 & ID3v2 functions. So you can add a string -- ":AAC"
6 in the configuration dialog box of QCDcddb.dll Libarary Plugin.
7 (I think you will find it and will know how to do it,
8 otherwise you can visite the message forum on the web site.)
9
10 Have a good time:)
Binary diff not shown
0 //Microsoft Developer Studio generated resource script.
1 //
2 #include "resource.h"
3
4 #define APSTUDIO_READONLY_SYMBOLS
5 /////////////////////////////////////////////////////////////////////////////
6 //
7 // Generated from the TEXTINCLUDE 2 resource.
8 //
9 #include "afxres.h"
10
11 /////////////////////////////////////////////////////////////////////////////
12 #undef APSTUDIO_READONLY_SYMBOLS
13
14 /////////////////////////////////////////////////////////////////////////////
15 // English (U.S.) resources
16
17 #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
18 #ifdef _WIN32
19 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
20 #pragma code_page(1252)
21 #endif //_WIN32
22
23 #ifdef APSTUDIO_INVOKED
24 /////////////////////////////////////////////////////////////////////////////
25 //
26 // TEXTINCLUDE
27 //
28
29 1 TEXTINCLUDE DISCARDABLE
30 BEGIN
31 "resource.h\0"
32 END
33
34 2 TEXTINCLUDE DISCARDABLE
35 BEGIN
36 "#include ""afxres.h""\r\n"
37 "\0"
38 END
39
40 3 TEXTINCLUDE DISCARDABLE
41 BEGIN
42 "\r\n"
43 "\0"
44 END
45
46 #endif // APSTUDIO_INVOKED
47
48
49 /////////////////////////////////////////////////////////////////////////////
50 //
51 // Dialog
52 //
53
54 IDD_CONFIG DIALOGEX 0, 0, 179, 133
55 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
56 CAPTION "FAAC Decoder Configuration"
57 FONT 8, "MS Sans Serif", 0, 0, 0x1
58 BEGIN
59 CONTROL "Enable variable bitrate display",VARBITRATE_CHK,"Button",
60 BS_AUTOCHECKBOX | WS_TABSTOP,7,7,140,10
61 EDITTEXT STREAM_BUFFER_TXT,87,21,21,12,ES_AUTOHSCROLL | ES_NUMBER
62 EDITTEXT LOCAL_BUFFER_TXT,87,38,21,12,ES_AUTOHSCROLL | ES_NUMBER
63 CONTROL "Buffer entire files into memory",IDC_MEMMAP,"Button",
64 BS_AUTOCHECKBOX | WS_TABSTOP,7,60,140,10
65 CONTROL "Slider1",THREAD_PRIORITY_SLIDER,"msctls_trackbar32",
66 TBS_AUTOTICKS | WS_TABSTOP,7,89,165,11,WS_EX_TRANSPARENT
67 PUSHBUTTON "OK",OK_BTN,64,112,50,14
68 PUSHBUTTON "Cancel",CANCEL_BTN,121,112,50,14
69 LTEXT "HTTP stream buffer:",IDC_STATIC,7,22,77,8
70 LTEXT "Decode Thread Priority: Highest (default)",IDC_STATIC2,
71 7,78,165,8
72 LTEXT "Local file buffer: ",IDC_STATIC,7,40,77,8
73 PUSHBUTTON "Reset",RESET_BTN,7,112,50,14
74 END
75
76 IDD_ABOUT DIALOG DISCARDABLE 0, 0, 191, 168
77 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
78 CAPTION "About FAAD Plug-in"
79 FONT 8, "MS Sans Serif"
80 BEGIN
81 DEFPUSHBUTTON "OK",IDOK,70,147,50,14
82 CTEXT "",IDC_PLUGINVER,29,73,133,16
83 CTEXT "",IDC_FAADVER,40,123,111,8
84 LTEXT "QCD Input Plug-in by",IDC_STATIC,62,97,67,8
85 CONTROL 107,IDC_LOGO,"Static",SS_BITMAP | SS_CENTERIMAGE |
86 SS_REALSIZEIMAGE,7,0,177,68
87 LTEXT "Shao Hao",IDC_MAIL1,79,111,33,8
88 LTEXT "M. Bakker",IDC_MAIL3,59,134,34,8
89 LTEXT "menno",IDC_MAIL2,109,134,22,8
90 LTEXT "&&",IDC_STATIC,97,134,8,8
91 END
92
93
94 /////////////////////////////////////////////////////////////////////////////
95 //
96 // DESIGNINFO
97 //
98
99 #ifdef APSTUDIO_INVOKED
100 GUIDELINES DESIGNINFO DISCARDABLE
101 BEGIN
102 IDD_CONFIG, DIALOG
103 BEGIN
104 LEFTMARGIN, 7
105 RIGHTMARGIN, 172
106 TOPMARGIN, 7
107 BOTTOMMARGIN, 126
108 END
109
110 IDD_ABOUT, DIALOG
111 BEGIN
112 LEFTMARGIN, 7
113 RIGHTMARGIN, 184
114 BOTTOMMARGIN, 161
115 END
116 END
117 #endif // APSTUDIO_INVOKED
118
119
120 /////////////////////////////////////////////////////////////////////////////
121 //
122 // Bitmap
123 //
124
125 IDB_LOGO BITMAP DISCARDABLE "logo.bmp"
126 #endif // English (U.S.) resources
127 /////////////////////////////////////////////////////////////////////////////
128
129
130
131 #ifndef APSTUDIO_INVOKED
132 /////////////////////////////////////////////////////////////////////////////
133 //
134 // Generated from the TEXTINCLUDE 3 resource.
135 //
136
137
138 /////////////////////////////////////////////////////////////////////////////
139 #endif // not APSTUDIO_INVOKED
140
0 //{{NO_DEPENDENCIES}}
1 // Microsoft Developer Studio generated include file.
2 // Used by plugin_dlg.rc
3 //
4 #define IDD_CONFIG 101
5 #define IDD_ABOUT 106
6 #define IDB_LOGO 107
7 #define VARBITRATE_CHK 1004
8 #define THREAD_PRIORITY_SLIDER 1007
9 #define IDC_STATIC2 1034
10 #define LOCAL_BUFFER_TXT 1035
11 #define STREAM_BUFFER_TXT 1036
12 #define IDC_MEMMAP 1037
13 #define OK_BTN 1038
14 #define CANCEL_BTN 1039
15 #define RESET_BTN 1047
16 #define IDC_LOGO 1048
17 #define IDC_PLUGINVER 1050
18 #define IDC_FAADVER 1051
19 #define IDC_MAIL1 1052
20 #define IDC_MAIL2 1053
21 #define IDC_MAIL3 1054
22
23 // Next default values for new objects
24 //
25 #ifdef APSTUDIO_INVOKED
26 #ifndef APSTUDIO_READONLY_SYMBOLS
27 #define _APS_NEXT_RESOURCE_VALUE 109
28 #define _APS_NEXT_COMMAND_VALUE 40001
29 #define _APS_NEXT_CONTROL_VALUE 1055
30 #define _APS_NEXT_SYMED_VALUE 101
31 #endif
32 #endif
0 //-----------------------------------------------------------------------------
1 //
2 // File: QCDInputDLL.h
3 //
4 // About: QCD Player Input module DLL interface. For more documentation, see
5 // QCDModInput.h.
6 //
7 // Authors: Written by Paul Quinn and Richard Carlson.
8 //
9 // QCD multimedia player application Software Development Kit Release 1.0.
10 //
11 // Copyright (C) 1997-2002 Quinnware
12 //
13 // This code is free. If you redistribute it in any form, leave this notice
14 // here.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 //
20 //-----------------------------------------------------------------------------
21
22 #ifndef QCDInputDLL_H
23 #define QCDInputDLL_H
24
25 #include "QCDModInput.h"
26
27 // Calls from the Player
28 int GetMediaSupported(const char* medianame, MediaInfo *mediaInfo);
29 int GetTrackExtents(const char* medianame, TrackExtents *ext, int flags);
30 int GetCurrentPosition(const char* medianame, long *track, long *offset);
31
32 void SetEQ(EQInfo*);
33 void SetVolume(int levelleft, int levelright, int flags);
34
35 int Play(const char* medianame, int framefrom, int frameto, int flags);
36 int Pause(const char* medianame, int flags);
37 int Stop(const char* medianame, int flags);
38 int Eject(const char* medianame, int flags);
39
40 int Initialize(QCDModInfo *ModInfo, int flags);
41 void ShutDown(int flags);
42 void Configure(int flags);
43 void About(int flags);
44
45 #endif //QCDInputDLL_H
0 //-----------------------------------------------------------------------------
1 //
2 // File: QCDModDefs.h
3 //
4 // About: Module definitions file. Miscellanious definitions used by different
5 // module types. This file is published with the plugin SDKs.
6 //
7 // Authors: Written by Paul Quinn and Richard Carlson.
8 //
9 // Copyright:
10 //
11 // QCD multimedia player application Software Development Kit Release 1.0.
12 //
13 // Copyright (C) 1997-2002 Quinnware
14 //
15 // This code is free. If you redistribute it in any form, leave this notice
16 // here.
17 //
18 // This program is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 //
22 //-----------------------------------------------------------------------------
23
24 #ifndef QCDMODDEFS_H
25 #define QCDMODDEFS_H
26
27 #include <mmreg.h>
28 #include <windows.h>
29
30 #ifdef __cplusplus
31 #define PLUGIN_API extern "C" __declspec(dllexport)
32 #else
33 #define PLUGIN_API __declspec(dllexport)
34 #endif
35
36 // Current plugin version
37
38 // use this version for old style API calls (all returned text in native encoding)
39 #define PLUGIN_API_VERSION 250
40
41 // use this version for new style API calls (all returned text in UTF8 encoding on WinNT/2K/XP (native encoding on Win9x))
42 #define PLUGIN_API_VERSION_WANTUTF8 ((PLUGIN_API_WANTUTF8<<16)|PLUGIN_API_VERSION)
43 #define PLUGIN_API_WANTUTF8 100
44
45 //-----------------------------------------------------------------------------
46
47 typedef struct
48 {
49 char *moduleString;
50 char *moduleExtensions;
51 } QCDModInfo;
52
53 //-----------------------------------------------------------------------------
54 // Services (ops) provided by the Player
55 //-----------------------------------------------------------------------------
56 typedef enum
57 { //*** below returns numeric info (*buffer not used)
58
59 opGetPlayerVersion = 0, // high-order word = major version (eg 3.01 is 3), low-order word = minor (eg 3.01 = 1)
60 opGetParentWnd = 1, // handle to player window
61 opGetPlayerInstance = 2, // HINSTANCE to player executable
62
63 opGetPlayerState = 9, // get current state of the player (returns: 1 = stopped, 2 = playing, 3 = paused, 0 = failed)
64 opGetNumTracks = 10, // number of tracks in playlist
65 opGetCurrentIndex = 11, // index of current track in playlist (0 based)
66 opGetNextIndex = 12, // get index of next track to play (0 based), param1 = index start index. -1 for after current
67 opGetTrackNum = 13, // get track number of index, param1 = index of track in playlist, -1 for current
68 // - 'track number' is the number of the track in it's respective album, as opposed to playlist number
69 // - the 'track number' for digital files will be 1 if the tag is not set or the file is not identified
70
71 opGetTrackLength = 14, // get track length, param1 = index of track in playlist, -1 for current
72 // param2 = 0 for seconds, 1 for milliseconds
73 opGetTime = 15, // get time on player, param1 = 0 for time displayed, 1 for track time, 2 for playlist time
74 // param2 = 0 for elapsed, 1 for remaining
75 opGetTrackState = 16, // get whether track is marked, param1 = index of track, -1 for current
76 opGetPlaylistNum = 17, // get playlist number of index, param1 = index of track in playlist, -1 for current
77 opGetMediaType = 18, // get media type of track, param1 = index if track in playlist, -1 for current
78 // - see MediaTypes below for return values
79
80 opGetAudioInfo = 19, // get format info about currently playing track
81 // - param1 = 0 for samplerate, 1 for bitrate, 2 for num channels
82
83 opGetOffline = 20, // true if client is in Offline Mode
84 opGetVisTarget = 21, // where is vis being drawn > 0 - internal to skin, 1 - external window, 2 - full screen
85 opGetAlwaysOnTop = 22, // true if player is set to 'Always on Top'
86 opGetRepeatState = 23, // returns: 0 - repeat off, 1 - repeat track, 2 - repeat all
87 opGetShuffleState = 27, // returns: 0 - shuffle off, 1 - shuffle enabled
88
89 opGetTimerState = 24, // low-order word: 0 - track ascend, 1 - playlist ascend, 2 - track descend, 3 - playlist descend
90 // hi-order word: 1 if 'show hours' is set, else 0
91
92 opGetVolume = 25, // get master volume level (0 - 100), param1: 0 = combined, 1 = left, 2 = right
93 opSetVolume = 26, // set master volume level, param1: vol level 0 - 100, param2: balance (-100 left, 0 center, 100 right)
94
95 opGetIndexFromPLNum = 28, // get index from playlist number, param1 = playlist number
96
97 opGetExtensionWnd = 30, // handle to the draggable window extension (only available on some skins), param1 = extension number (0 - 9)
98 opGetExtVisWnd = 31, // handle to the external visual window
99 opGetMusicBrowserWnd = 32, // handle to the music browser window
100 opGetSkinPreviewWnd = 33, // handle to the skin preview window
101 opGetPropertiesWnd = 34, // handle to the player properties window
102 opGetExtInfoWnd = 35, // handle to the extended information window
103 opGetAboutWnd = 36, // handle to the about window
104 opGetSegmentsWnd = 37, // handle to the segments window
105 opGetEQPresetsWnd = 38, // handle to the EQ presets window
106 opGetVideoWnd = 39, // handle to the video window
107
108 opGetVisDimensions = 50, // gets the width and height of visual window (param1 = -1 current vis window, 0 internal vis, 1 external vis, 2 full screen)
109 // returns: HEIGHT in high word, WIDTH in low word
110
111 opShowVideoWindow = 55, // Show or Close video window (param1 = 1 for create, 2 for create and show, 0 for close)
112
113 opGetQueriesComplete = 60, // get status on whether all tracks in playlist have been queryied for their info
114
115 // playlist manipulation
116 opDeleteIndex = 90, // delete index from playlist (param1 = index)
117 opSelectIndex = 91, // mark index as selected (param1 = index, param2 = 1 - set, 0 - unset)
118 opBlockIndex = 92, // mark index as blocked (param1 = index, param2 = 1 - set, 0 - unset)
119
120 opGetMediaInfo = 99, // get the ICddbDisc object for the index specified, param1 = index of track, -1 for current
121 // param2 = pointer to integer that receives track value
122 // returns: pointer to ICddbDisc object. Do not release or deallocate this pointer
123
124
125 //*** below returns string info in buffer, param1 = size of buffer
126 //*** returns 1 on success, 0 on failure
127
128 opGetTrackName = 100, // get track name, param2 = index of track in playlist, -1 for current
129 opGetArtistName = 101, // get artist name, param2 = index of track in playlist, -1 for current
130 opGetDiscName = 102, // get disc name, param2 = index of track in playlist, -1 for current
131
132 opGetTrackFile = 103, // file name of track in playlist, param2 = index of track in playlist, -1 for current
133 opGetSkinName = 104, // get current skin name
134
135 opGetPluginFolder = 105, // get current plugin folder
136 opGetPluginSettingsFile = 106, // get settings file (plugins.ini) that plugin should save settings to
137 opGetPluginCacheFile = 107, // get file that describes plugin validity, functions and names
138 opGetPlayerSettingsFile = 108, // get settings file (qcd.ini) that player saves it settings to (should use for read-only)
139
140 opGetMusicFolder = 110, // get current music folder
141 opGetPlaylistFolder = 111, // get current playlist folder
142 opGetSkinFolder = 112, // get current skin folder
143 opGetCDDBCacheFolder = 113, // get current folder for CDDB cached info
144
145 opGetCurrentPlaylist = 114, // get full pathname of playlist currently loaded
146
147 opGetMediaID = 115, // get media identifier, param2 = index of track in playlist, -1 for current
148 // - for CD's it's the TOC - for anything else, right now it's 0
149
150 opGetSupportedExtensions = 116, // get file extensions supported by the player, param2 = 0 - get all extensions, 1 - get registered extensions
151 // - returned extensions will be colon delimited
152
153 opGetPlaylistString = 117, // get string for index as it appears in playlist, param2 = index
154
155 //*** below buffer points to struct or other object
156 //*** returns 1 on success, 0 on failure
157
158 opShowMainMenu = 120, // Display Main QCD Menu (buffer = POINT* - location to display menu)
159 opGetMainMenu = 121, // Returns copy of HMENU handle to QCD Menu (must use DestroyMenu on handle when complete)
160
161 opShowQuickTrack = 125, // Display QuickTrack Menu (buffer = POINT* - location to display menu)
162 opGetQuickTrack = 126, // Returns copy of HMENU handle to QuickTrack menu (must use DestroyMenu on handle when complete)
163 // To use if QuickTrack item selected: PostMessage(hwndPlayer, WM_COMMAND, menu_id, 0);
164
165 opGetEQVals = 200, // get current EQ levels/on/off (buffer = EQInfo*)
166 opSetEQVals = 201, // set EQ levels/on/off (buffer = EQInfo*)
167
168 opGetProxyInfo = 202, // get proxy info (buffer = ProxyInfo*), returns 0 if proxy not in use
169
170
171 //*** below returns numeric info, buffer used
172
173 opGetIndexFromFilename = 210, // get the index of a file that exists in current playlist (buffer = full path of file),
174 // param1 = startindex (index to start searching on)
175 // returns -1 if file not in playlist
176
177
178 //*** below send information to player
179 //*** returns 1 on success, 0 on failure
180
181 opSetStatusMessage = 1000, // display message in status area (buffer = msg buffer (null term), param1 = text flags (see below))
182
183 opSetBrowserUrl = 1001, // set music browser URL (buffer = url (null term))
184 // null url buffer - closes browser
185 // param1 = 0 - normal, 1 - force open
186
187 opSetAudioInfo = 1002, // set the current music bitrate/khz (buffer = AudioInfo*, param1 = size of AudioInfo)
188
189 opSetTrackAlbum = 1003, // update track ablum name (buffer = album (null term), param1 = (string ptr)file name), param2 = MediaTypes
190 opSetTrackTitle = 1004, // update track title (buffer = title (null term), param1 = (string ptr)file name), param2 = MediaTypes
191 opSetTrackArtist = 1005, // update track artist name (buffer = artist (null term), param1 = (string ptr)file name), param2 = MediaTypes
192
193 opSetTrackExtents = 1007, // update track TrackExtents info (buffer = &TrackExtents), param1 = (string ptr)file name)
194 opSetTrackSeekable = 1008, // update track seekable flag (buffer = (string ptr)file name), param1 = TRUE/FALSE
195 opSetPlayNext = 1009, // set the next index to be played (buffer = NULL, param1 = index, index = -1 unsets playnext)
196 opSetIndexFilename = 1010, // updates the filename (or stream) that an index in the current playlist refers to, buffer = new filename, param1 = index
197
198 opSetPlaylist = 1006, // clear playlist, add files to playlist or reset playlist with new files
199 // buffer = file list (each file in quotes, string null terminated) Eg; buffer="\"file1.mp3\" \"file2.mp3\"\0" - NULL to clear playlist
200 // param1 = (string ptr)originating path (can be NULL if paths included with files)
201 // param2 = 1 - clear playlist flag, 2 - enqueue to top
202
203 opInsertPlaylist = 1011, // insert tracks into playlist
204 // buffer = file list (each file in quotes, string null terminated) Eg; buffer="\"file1.mp3\" \"file2.mp3\"\0"
205 // param1 = (string ptr)originating path (can be NULL if paths included with files)
206 // param2 = index location to insert tracks (-1 to insert at end)
207
208 opMovePlaylistTrack = 1012, // param1 = index of track to move, param2 = destination index (move shifts tracks between param1 and param2)
209 opSwapPlaylistTracks = 1013, // param1 = index of first track, param2 = index of second track (swap only switches indecies param1 and param2)
210
211 opCreateDiscInfo = 1020, // returns: pointer to ICddbDisc object. Do not release or deallocate this pointer
212 opSetDiscInfo = 1021, // buffer = ICddbDisc*, param1 = MediaInfo*, param2 = track number
213
214 opSetSeekPosition = 1100, // seek to position during playback
215 // buffer = NULL, param1 = position
216 // param2 = 0 - position is in seconds, 1 - position is in milliseconds, 2 - position is in percent (use (float)param1))
217
218
219 opSetRepeatState = 1110, // set playlist repeat state, buffer = NULL, param1 = 0 - off, 1 - repeat track, 2 - repeat playlist
220 opSetShuffleState = 1111, // set playlist shuffle state, buffer = NULL, param1 = 0 - off, 1 - on
221
222 //*** below configures custom plugin menu items for the 'plugin menu'
223 //*** Player will call plugin's configure routine with menu value when menu item selected
224 //*** returns 1 on success, 0 on failure
225
226 opSetPluginMenuItem = 2000, // buffer = HINSTANCE of plugin, param1 = item id, param2 = (string ptr)string to display
227 // - set param2 = 0 to remove item id from menu
228 // - set param1 = 0 and param2 = 0 to remove whole menu
229 opSetPluginMenuState = 2001, // buffer = HINSTANCE of plugin, param1 = item id, param2 = menu flags (same as windows menu flags - eg: MF_CHECKED)
230
231
232 //*** below are services for using the player's filename template editor
233 //*** returns 1 on success, 0 on failure
234
235 opShowTemplateEditor = 2100, // displays template editor dialog, param1 = (HWND)parent window, param2 = modal flag
236 opLoadTemplate = 2101, // loads saved templates, buffer = (char*)string buf, param1 = bufsize, param2 = index of template (index < 0 for default formats, index >= 0 for user made formats)
237 opRenderTemplate = 2102, // create string based on template, buffer = (char*)template, param1 = FormatMetaInfo*, param2 = (char*)string buffer (min 260 bytes)
238
239 //*** other services
240
241 opUTF8toUCS2 = 9000, // convert UTF8 string to UCS2 (Unicode) string, buffer = null terminated utf8 string, param1 = (WCHAR*)result string buffer, param2 = size of result buffer
242 opUCS2toUTF8 = 9001, // convert UCS2 (Unicode) string to UTF8 string, buffer = null terminated ucs2 string, param1 = (char*)result string buffer, param2 = size of result buffer
243
244 opSafeWait = 10000 // plugin's can use this to wait on an object without worrying about deadlocking the player.
245 // this should only be called by the thread that enters the plugin, not by any plugin-created threads
246
247 } PluginServiceOp;
248
249 //-----------------------------------------------------------------------------
250 // Info services api provided by the Player, called by Plugin.
251 //-----------------------------------------------------------------------------
252 typedef long (*PluginServiceFunc)(PluginServiceOp op, void *buffer, long param1, long param2);
253
254 // Use to retrieve service func for DSP plugins (or other inproc process that doesn't have access to PluginServiceFunc)
255 // Eg: PluginServiceFunc Service = (PluginServiceFunc)SendMessage(hwndPlayer, WM_GETSERVICEFUNC, 0, 0);
256 // Set WPARAM = PLUGIN_API_WANTUTF8 for UTF8 string parameters
257 #define WM_GETSERVICEFUNC (WM_USER + 1)
258
259 //-----------------------------------------------------------------------------
260 typedef struct // for Output Plugin Write callback
261 {
262 void *data; // pointer to valid data
263 int bytelen; // length of data pointed to by 'data' in bytes
264 UINT numsamples; // number of samples represented by 'data'
265 UINT bps; // bits per sample
266 UINT nch; // number of channels
267 UINT srate; // sample rate
268
269 UINT markerstart; // Marker position at start of data (marker is time value of data)
270 // (set to WAVE_VIS_DATA_ONLY to not have data sent to output plugins)
271 UINT markerend; // Marker position at end of data (not currently used, set to 0)
272 } WriteDataStruct;
273
274 //-----------------------------------------------------------------------------
275 typedef struct // for GetTrackExtents Input Plugin callback
276 {
277 UINT track; // for CD's, set the track number. Otherwise set to 1.
278 UINT start; // for CD's or media that doesn't start at the beginning
279 // of the file, set to start position. Otherwise set to 0.
280 UINT end; // set to end position of media.
281 UINT unitpersec; // whatever units are being used for this media, how many
282 // of them per second.
283 // (Note: ((end - start) / unitpersecond) = file length
284 UINT bytesize; // size of file in bytes (if applicable, otherwise 0).
285 } TrackExtents;
286
287 //-----------------------------------------------------------------------------
288 typedef struct // for opSetAudioInfo service
289 {
290 long struct_size; // sizeof(AudioInfo)
291 long level; // MPEG level (1 for MPEG1, 2 for MPEG2, 3 for MPEG2.5, 7 for MPEGpro)
292 long layer; // and layer (1, 2 or 3)
293 long bitrate; // audio bitrate in bits per second
294 long frequency; // audio freq in Hz
295 long mode; // 0 for stereo, 1 for joint-stereo, 2 for dual-channel, 3 for mono, 4 for multi-channel
296 char text[8]; // up to eight characters to identify format (will override level and layer settings)
297 } AudioInfo;
298
299 //-----------------------------------------------------------------------------
300 // Equalizer Info
301 //-----------------------------------------------------------------------------
302 typedef struct // for coming QCD version
303 {
304 long struct_size; // sizeof(EQInfo)
305 char enabled;
306 char preamp; // -128 to 127, 0 is even
307 char bands[10]; // -128 to 127, 0 is even
308 } EQInfo;
309
310 //-----------------------------------------------------------------------------
311 typedef struct
312 {
313 long struct_size; // sizeof(ProxyInfo)
314 char hostname[200];
315 long port;
316 char username[100];
317 char password[100];
318 } ProxyInfo;
319
320 //-----------------------------------------------------------------------------
321 typedef enum // for MediaInfo.mediaType
322 {
323 UNKNOWN_MEDIA = 0,
324 CD_AUDIO_MEDIA = 1,
325 DIGITAL_FILE_MEDIA = 2,
326 DIGITAL_STREAM_MEDIA = 3
327 } MediaTypes;
328
329 //-----------------------------------------------------------------------------
330 #define MAX_TOC_LEN 2048
331 typedef struct
332 {
333 // media descriptors
334 CHAR mediaFile[MAX_PATH];
335 MediaTypes mediaType;
336
337 // cd audio media info
338 CHAR cd_mediaTOC[MAX_TOC_LEN];
339 int cd_numTracks;
340 int cd_hasAudio;
341
342 // operation info
343 int op_canSeek;
344
345 // not used
346 int reserved[4];
347
348 } MediaInfo;
349
350 //-----------------------------------------------------------------------------
351 typedef struct
352 {
353 long struct_size;
354 LPCWSTR title;
355 LPCWSTR artalb;
356 LPCWSTR album;
357 LPCWSTR genre;
358 LPCWSTR year;
359 LPCWSTR tracknum;
360 LPCWSTR filename;
361 LPCWSTR arttrk;
362 long reserved;
363
364 } FormatMetaInfo;
365
366 //-----------------------------------------------------------------------------
367 // When subclassing the parent window, a plugin can watch for these messages
368 // to react to events going on between plugins and player
369 // DO NOT SEND THESE MESSAGES - can only watch for them
370
371 // Plugin to Player Notifiers
372 #define WM_PN_POSITIONUPDATE (WM_USER + 100) // playback progress updated
373 #define WM_PN_PLAYSTARTED (WM_USER + 101) // playback has started
374 #define WM_PN_PLAYSTOPPED (WM_USER + 102) // playback has stopped by user
375 #define WM_PN_PLAYPAUSED (WM_USER + 103) // playback has been paused
376 #define WM_PN_PLAYDONE (WM_USER + 104) // playback has finished (track completed)
377 #define WM_PN_MEDIAEJECTED (WM_USER + 105) // a CD was ejected (CDRom drive letter= 'A' + lParam)
378 #define WM_PN_MEDIAINSERTED (WM_USER + 106) // a CD was inserted (CDRom drive letter= 'A' + lParam)
379 #define WM_PN_INFOCHANGED (WM_USER + 107) // track information was updated (lParam = (LPCSTR)medianame)
380 #define WM_PN_TRACKCHANGED (WM_USER + 109) // current track playing has changed (relevant from CD plugin) (lParam = (LPCSTR)medianame)
381
382 // Player to Plugin Notifiers
383 #define WM_PN_PLAYLISTCHANGED (WM_USER + 200) // playlist has changed in some way (add, delete, sort, shuffle, drag-n-drop, etc...)
384
385 // For intercepting main menu display
386 // (so you can get handle, modify, and display your own)
387 #define WM_SHOWMAINMENU (WM_USER + 20)
388
389 // For intercepting skinned border window commands
390 #define WM_BORDERWINDOW (WM_USER + 26)
391 // WM_BORDERWINDOW wParam's
392 #define BORDERWINDOW_NORMALSIZE 0x100000
393 #define BORDERWINDOW_DOUBLESIZE 0x200000
394 #define BORDERWINDOW_FULLSCREEN 0x400000
395
396 // send to border window to cause resize
397 // wParam = LPPOINT lpp; // point x-y is CLIENT area size of window
398 #define WM_SIZEBORDERWINDOW (WM_USER + 1)
399
400 //-----------------------------------------------------------------------------
401 // To shutdown player, send this command
402 #define WM_SHUTDOWN (WM_USER + 5)
403
404 //-----------------------------------------------------------------------------
405 // opSetStatusMessage textflags
406 #define TEXT_DEFAULT 0x0 // message scrolls by in status window
407 #define TEXT_TOOLTIP 0x1 // message acts as tooltip in status window
408 #define TEXT_URGENT 0x2 // forces message to appear even if no status window (using msg box)
409 #define TEXT_HOLD 0x4 // tooltip message stays up (no fade out)
410 #define TEXT_UNICODE 0x10 // buffer contains a unicode string (multibyte string otherwise)
411
412 #endif //QCDMODDEFS_H
0 //-----------------------------------------------------------------------------
1 //
2 // File: QCDModInput.h
3 //
4 // About: Input plugin module interface. This file is published with the
5 // Input plugin SDK.
6 //
7 // Authors: Written by Paul Quinn and Richard Carlson.
8 //
9 // Copyright:
10 //
11 // QCD multimedia player application Software Development Kit Release 1.0.
12 //
13 // Copyright (C) 1997-2002 Quinnware
14 //
15 // This code is free. If you redistribute it in any form, leave this notice
16 // here.
17 //
18 // This program is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 //
22 //-----------------------------------------------------------------------------
23
24 #ifndef QCDMODINPUT_H
25 #define QCDMODINPUT_H
26
27 #include "QCDModDefs.h"
28
29 // name of the DLL export for input plugins
30 #define INPUTDLL_ENTRY_POINT QInputModule2 // (updated plugin api version 240+)
31
32 // media insert flags
33 #define MEDIAINSERT_PLAY 0x1
34 #define MEDIAINSERT_ADDTRACKS 0x2
35 #define MEDIAINSERT_ADDSEGMENTS 0x4
36 #define MEDIAINSERT_CLEARPLAYLIST 0x8
37
38 // Stop will receive one of these flags (pass to output plugin's stop())
39 #define STOPFLAG_FORCESTOP 0 // stop occuring due to user action or other event
40 #define STOPFLAG_PLAYDONE 1 // stop occuring due to playlist completion
41
42 // play flags
43 #define PLAYFLAG_PLAYBACK 0x0
44 #define PLAYFLAG_ENCODING 0x1
45 #define PLAYFLAG_SEEKING 0x2
46
47 // Wave Marker flags
48 #define WAVE_VIS_DATA_ONLY -1 // set to WaveDataStruct.markerstart in OutputWrite() call have data only go to vis
49 // and not to output plugin
50 // pause flags
51 #define PAUSE_DISABLED 0 // Pause() call is to unpause playback
52 #define PAUSE_ENABLED 1 // Pause() call is to pause playback
53
54 //-----------------------------------------------------------------------------
55 // Input Module
56 //-----------------------------------------------------------------------------
57 typedef struct
58 {
59 unsigned int size; // size of init structure
60 unsigned int version; // plugin structure version (set to PLUGIN_API_VERSION)
61 PluginServiceFunc Service; // player supplied services callback
62
63 struct
64 {
65 void (*PositionUpdate)(unsigned int position);
66 void (*PlayStopped)(const char* medianame); // notify player of play stop
67 void (*PlayStarted)(const char* medianame); // notify player of play start
68 void (*PlayPaused)(const char* medianame, int flags); // notify player of play pause
69 void (*PlayDone)(const char* medianame); // notify player when play done
70 void (*PlayTrackChanged)(const char* medianame); // notify player when playing track changes (cd audio relevant only)
71 void (*MediaEjected)(const char* medianame); // notify player of media eject (cd audio relevant)
72 void (*MediaInserted)(const char* medianame, int flags); // notify player of media insert (cd audio relevant)
73
74 // output plugin calls
75 int (*OutputOpen)(const char* medianame, WAVEFORMATEX*); // open output for wave data
76 int (*OutputWrite)(WriteDataStruct*); // send PCM audio data to output
77 // (blocks until write completes, thus if output is paused can
78 // block until unpaused)
79 int (*OutputDrain)(int flags); // wait for all output to complete (blocking)
80 int (*OutputDrainCancel)(int flags); // break a drain in progress
81 int (*OutputFlush)(unsigned int marker); // flush output upto marker
82 int (*OutputStop)(int flags); // stop output
83 int (*OutputPause)(int flags); // pause output
84
85 int (*OutputSetVol)(int levelleft, int levelright, int flags);
86 int (*OutputGetCurrentPosition)(unsigned int *position, int flags);
87
88 void *Reserved[10];
89 } toPlayer;
90
91 struct
92 {
93 int (*Initialize)(QCDModInfo *modInfo, int flags); // initialize plugin
94 void (*ShutDown)(int flags); // shutdown plugin
95
96 int (*Play)(const char* medianame, int playfrom, int playto, int flags); // start playing playfrom->playto
97 int (*Stop)(const char* medianame, int flags); // stop playing
98 int (*Pause)(const char* medianame, int flags); // pause playback
99 int (*Eject)(const char* medianame, int flags); // eject media
100 void (*SetEQ)(EQInfo*); // update EQ settings
101
102 int (*GetMediaSupported)(const char* medianame, MediaInfo *mediaInfo); // does plugin support medianame (and provides info for media)
103 int (*GetTrackExtents)(const char* medianame, TrackExtents *ext, int flags); // get media start, end & units
104 int (*GetCurrentPosition)(const char* medianame, long *track, long *offset); // get playing media's position
105
106 void (*Configure)(int flags); // launch configuration
107 void (*About)(int flags); // launch about info
108
109 void (*SetVolume)(int levelleft, int levelright, int flags); // level 0 - 100
110
111 void *Reserved[10];
112 } toModule;
113
114 } QCDModInitIn;
115
116 #endif //QCDMODINPUT_H
0 //-----------------------------------------------------------------------------
1 //
2 // File: QCDModTagEditor
3 //
4 // About: Tag Editing plugin module interface. This file is published with the
5 // QCD plugin SDK.
6 //
7 // Authors: Written by Paul Quinn
8 //
9 // Copyright:
10 //
11 // QCD multimedia player application Software Development Kit Release 1.0.
12 //
13 // Copyright (C) 2002 Quinnware
14 //
15 // This code is free. If you redistribute it in any form, leave this notice
16 // here.
17 //
18 // This program is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 //
22 //-----------------------------------------------------------------------------
23
24 #ifndef QCDMODTAGEDITOR_H
25 #define QCDMODTAGEDITOR_H
26
27 #include "QCDModDefs.h"
28
29 // name of the DLL export for output plugins
30 #define TAGEDITORDLL_ENTRY_POINT QTagEditorModule
31
32 // Tag field ids
33 typedef enum
34 {
35 TAGFIELD_FIRSTFIELD = 0,
36
37 TAGFIELD_TITLE = 0,
38 TAGFIELD_ARTIST,
39 TAGFIELD_ALBUM,
40 TAGFIELD_GENRE,
41 TAGFIELD_YEAR,
42 TAGFIELD_TRACK,
43 TAGFIELD_COMMENT,
44
45 TAGFIELD_COMPOSER,
46 TAGFIELD_CONDUCTOR,
47 TAGFIELD_ORCHESTRA,
48 TAGFIELD_YEARCOMPOSED,
49
50 TAGFIELD_ORIGARTIST,
51 TAGFIELD_LABEL,
52 TAGFIELD_COPYRIGHT,
53 TAGFIELD_ENCODER,
54 TAGFIELD_CDDBTAGID,
55
56 TAGFIELD_FIELDCOUNT
57 };
58
59 //-----------------------------------------------------------------------------
60
61 typedef struct
62 {
63 UINT size; // size of init structure
64 UINT version; // plugin structure version (set to PLUGIN_API_VERSION)
65
66 LPCSTR description;
67 LPCSTR defaultexts;
68
69 bool (*Read)(LPCSTR filename, void* tagHandle);
70 bool (*Write)(LPCSTR filename, void* tagHandle);
71 bool (*Strip)(LPCSTR filename);
72
73 void (*ShutDown)(int flags);
74
75 void (*SetFieldA)(void* tagHandle, int fieldId, LPCSTR szNewText);
76 void (*SetFieldW)(void* tagHandle, int fieldId, LPCWSTR szNewText);
77
78 LPCSTR (*GetFieldA)(void* tagHandle, int fieldId);
79 LPCWSTR (*GetFieldW)(void* tagHandle, int fieldId);
80
81 } QCDModInitTag;
82
83 #endif //QCDMODTAGEDITOR_H
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: QCDMp4.c,v 1.4 2003/12/06 04:24:17 rjamorim Exp $
25 **/
26
27 //#define DEBUG_OUTPUT
28
29 #define WIN32_LEAN_AND_MEAN
30 #include <windows.h>
31 #include <commctrl.h>
32 #include <commdlg.h>
33 #include <stdlib.h>
34 #include <math.h>
35 #include <faad.h>
36 #include <mp4.h>
37
38 #include "resource.h"
39 #include "QCDInputDLL.h"
40 #include "utils.h"
41 #include "config.h"
42 //#include "aacinfo.h"
43 //#include "aac2mp4.h"
44 //
45 //const char *long_ext_list = "MP4\0MPEG-4 Files (*.MP4)\0M4A\0MPEG-4 Files (*.M4A)\0AAC\0AAC Files (*.AAC)\0";
46 //const char *short_ext_list = "MP4\0MPEG-4 Files (*.MP4)\0M4A\0MPEG-4 Files (*.M4A)\0";
47
48 static long priority_table[] = {
49 0,
50 THREAD_PRIORITY_HIGHEST,
51 THREAD_PRIORITY_ABOVE_NORMAL,
52 THREAD_PRIORITY_NORMAL,
53 THREAD_PRIORITY_BELOW_NORMAL,
54 THREAD_PRIORITY_LOWEST
55 };
56 static int res_id_table[] = {
57 IDC_16BITS,
58 IDC_24BITS,
59 IDC_32BITS,
60 0,
61 0,
62 /*IDC_16BITS_DITHERED*/ IDC_16BITS /* temp hack */
63 };
64 static int res_table[] = {
65 16,
66 24,
67 32,
68 0,
69 0,
70 16
71 };
72 //static char info_fn[_MAX_PATH];
73 //
74 //// post this to the main window at end of file (after playback has stopped)
75 //#define WM_WA_AAC_EOF WM_USER+2
76
77 struct seek_list
78 {
79 struct seek_list *next;
80 __int64 offset;
81 };
82
83 typedef struct state
84 {
85 /* general stuff */
86 faacDecHandle hDecoder;
87 int samplerate;
88 unsigned char channels;
89 double decode_pos_ms; // current decoding position, in milliseconds
90 int paused; // are we paused?
91 int seek_needed; // if != -1, it is the point that the decode thread should seek to, in ms.
92 char filename[_MAX_PATH];
93 int filetype; /* 0: MP4; 1: AAC */
94 int last_frame;
95 __int64 last_offset;
96
97 /* MP4 stuff */
98 MP4FileHandle mp4file;
99 int mp4track;
100 MP4SampleId numSamples;
101 MP4SampleId sampleId;
102
103 /* AAC stuff */
104 FILE *aacfile;
105 long m_aac_bytes_into_buffer;
106 long m_aac_bytes_consumed;
107 __int64 m_file_offset;
108 unsigned char *m_aac_buffer;
109 int m_at_eof;
110 double cur_pos_sec;
111 int m_header_type;
112 struct seek_list *m_head;
113 struct seek_list *m_tail;
114 unsigned long m_length;
115
116 /* for gapless decoding */
117 unsigned int useAacLength;
118 unsigned int framesize;
119 unsigned int initial;
120 unsigned long timescale;
121 } state;
122
123 static state mp4state;
124
125 //static In_Module module; // the output module (declared near the bottom of this file)
126 struct {
127 HINSTANCE hDllInstance;
128 HWND hMainWindow;
129 QCDModInitIn QCDCallbacks;
130 } module;
131 AudioInfo ai;
132
133 static int killPlayThread;
134 static int PlayThreadAlive = 0; // 1=play thread still running
135 HANDLE play_thread_handle = INVALID_HANDLE_VALUE; // the handle to the decode thread
136
137 /* Function definitions */
138 void *decode_aac_frame(state *st, faacDecFrameInfo *frameInfo);
139 DWORD WINAPI MP4PlayThread(void *b); // the decode thread procedure
140 DWORD WINAPI AACPlayThread(void *b); // the decode thread procedure
141
142
143 //typedef struct tag
144 //{
145 // char *item;
146 // char *value;
147 //} tag;
148 //
149 //typedef struct medialib_tags
150 //{
151 // struct tag *tags;
152 // unsigned int count;
153 //} medialib_tags;
154 //
155 //int tag_add_field(medialib_tags *tags, const char *item, const char *value)
156 //{
157 // void *backup = (void *)tags->tags;
158 //
159 // if (!item || (item && !*item) || !value) return 0;
160 //
161 // tags->tags = (struct tag *)realloc(tags->tags, (tags->count+1) * sizeof(tag));
162 // if (!tags->tags) {
163 // if (backup) free(backup);
164 // return 0;
165 // }
166 // else
167 // {
168 // int i_len = strlen(item);
169 // int v_len = strlen(value);
170 //
171 // tags->tags[tags->count].item = (char *)malloc(i_len+1);
172 // tags->tags[tags->count].value = (char *)malloc(v_len+1);
173 //
174 // if (!tags->tags[tags->count].item || !tags->tags[tags->count].value)
175 // {
176 // if (!tags->tags[tags->count].item) free (tags->tags[tags->count].item);
177 // if (!tags->tags[tags->count].value) free (tags->tags[tags->count].value);
178 // tags->tags[tags->count].item = NULL;
179 // tags->tags[tags->count].value = NULL;
180 // return 0;
181 // }
182 //
183 // memcpy(tags->tags[tags->count].item, item, i_len);
184 // memcpy(tags->tags[tags->count].value, value, v_len);
185 // tags->tags[tags->count].item[i_len] = '\0';
186 // tags->tags[tags->count].value[v_len] = '\0';
187 //
188 // tags->count++;
189 // return 1;
190 // }
191 //}
192 //
193 //int tag_set_field(medialib_tags *tags, const char *item, const char *value)
194 //{
195 // unsigned int i;
196 //
197 // if (!item || (item && !*item) || !value) return 0;
198 //
199 // for (i = 0; i < tags->count; i++)
200 // {
201 // if (!stricmp(tags->tags[i].item, item))
202 // {
203 // void *backup = (void *)tags->tags[i].value;
204 // int v_len = strlen(value);
205 //
206 // tags->tags[i].value = (char *)realloc(tags->tags[i].value, v_len+1);
207 // if (!tags->tags[i].value)
208 // {
209 // if (backup) free(backup);
210 // return 0;
211 // }
212 //
213 // memcpy(tags->tags[i].value, value, v_len);
214 // tags->tags[i].value[v_len] = '\0';
215 //
216 // return 1;
217 // }
218 // }
219 //
220 // return tag_add_field(tags, item, value);
221 //}
222 //
223 //int tag_delete(medialib_tags *tags)
224 //{
225 // unsigned int i;
226 //
227 // for (i = 0; i < tags->count; i++)
228 // {
229 // if (tags->tags[i].item) free(tags->tags[i].item);
230 // if (tags->tags[i].value) free(tags->tags[i].value);
231 // }
232 //
233 // if (tags->tags) free(tags->tags);
234 //
235 // tags->tags = NULL;
236 // tags->count = 0;
237 //}
238 //
239 //int ReadMP4Tag(MP4FileHandle file, medialib_tags *tags)
240 //{
241 // unsigned __int32 valueSize;
242 // unsigned __int8 *pValue;
243 // char *pName;
244 // unsigned int i = 0;
245 //
246 // do {
247 // pName = 0;
248 // pValue = 0;
249 // valueSize = 0;
250 //
251 // MP4GetMetadataByIndex(file, i, (const char **)&pName, &pValue, &valueSize);
252 //
253 // if (valueSize > 0)
254 // {
255 // char *val = (char *)malloc(valueSize+1);
256 // if (!val) return 0;
257 // memcpy(val, pValue, valueSize);
258 // val[valueSize] = '\0';
259 //
260 // if (pName[0] == '\xa9')
261 // {
262 // if (memcmp(pName, "©nam", 4) == 0)
263 // {
264 // tag_add_field(tags, "title", val);
265 // } else if (memcmp(pName, "©ART", 4) == 0) {
266 // tag_add_field(tags, "artist", val);
267 // } else if (memcmp(pName, "©wrt", 4) == 0) {
268 // tag_add_field(tags, "writer", val);
269 // } else if (memcmp(pName, "©alb", 4) == 0) {
270 // tag_add_field(tags, "album", val);
271 // } else if (memcmp(pName, "©day", 4) == 0) {
272 // tag_add_field(tags, "date", val);
273 // } else if (memcmp(pName, "©too", 4) == 0) {
274 // tag_add_field(tags, "tool", val);
275 // } else if (memcmp(pName, "©cmt", 4) == 0) {
276 // tag_add_field(tags, "comment", val);
277 // } else if (memcmp(pName, "©gen", 4) == 0) {
278 // tag_add_field(tags, "genre", val);
279 // } else {
280 // tag_add_field(tags, pName, val);
281 // }
282 // } else if (memcmp(pName, "gnre", 4) == 0) {
283 // char *t=0;
284 // if (MP4GetMetadataGenre(file, &t))
285 // {
286 // tag_add_field(tags, "genre", t);
287 // }
288 // } else if (memcmp(pName, "trkn", 4) == 0) {
289 // unsigned __int16 trkn = 0, tot = 0;
290 // char t[200];
291 // if (MP4GetMetadataTrack(file, &trkn, &tot))
292 // {
293 // if (tot > 0)
294 // wsprintf(t, "%d/%d", trkn, tot);
295 // else
296 // wsprintf(t, "%d", trkn);
297 // tag_add_field(tags, "tracknumber", t);
298 // }
299 // } else if (memcmp(pName, "disk", 4) == 0) {
300 // unsigned __int16 disk = 0, tot = 0;
301 // char t[200];
302 // if (MP4GetMetadataDisk(file, &disk, &tot))
303 // {
304 // if (tot > 0)
305 // wsprintf(t, "%d/%d", disk, tot);
306 // else
307 // wsprintf(t, "%d", disk);
308 // tag_add_field(tags, "disc", t);
309 // }
310 // } else if (memcmp(pName, "cpil", 4) == 0) {
311 // unsigned __int8 cpil = 0;
312 // char t[200];
313 // if (MP4GetMetadataCompilation(file, &cpil))
314 // {
315 // wsprintf(t, "%d", cpil);
316 // tag_add_field(tags, "compilation", t);
317 // }
318 // } else if (memcmp(pName, "tmpo", 4) == 0) {
319 // unsigned __int16 tempo = 0;
320 // char t[200];
321 // if (MP4GetMetadataTempo(file, &tempo))
322 // {
323 // wsprintf(t, "%d BPM", tempo);
324 // tag_add_field(tags, "tempo", t);
325 // }
326 // } else if (memcmp(pName, "NDFL", 4) == 0) {
327 // /* Removed */
328 // } else {
329 // tag_add_field(tags, pName, val);
330 // }
331 //
332 // free(val);
333 // }
334 //
335 // i++;
336 // } while (valueSize > 0);
337 //
338 // return 1;
339 //}
340 //
341 //int mp4_set_metadata(MP4FileHandle file, const char *item, const char *val)
342 //{
343 // if (!item || (item && !*item) || !val || (val && !*val)) return 0;
344 //
345 // if (!stricmp(item, "track") || !stricmp(item, "tracknumber"))
346 // {
347 // unsigned __int16 trkn, tot;
348 // int t1 = 0, t2 = 0;
349 // sscanf(val, "%d/%d", &t1, &t2);
350 // trkn = t1, tot = t2;
351 // if (!trkn) return 1;
352 // if (MP4SetMetadataTrack(file, trkn, tot)) return 1;
353 // }
354 // else if (!stricmp(item, "disc") || !stricmp(item, "disknumber"))
355 // {
356 // unsigned __int16 disk, tot;
357 // int t1 = 0, t2 = 0;
358 // sscanf(val, "%d/%d", &t1, &t2);
359 // disk = t1, tot = t2;
360 // if (!disk) return 1;
361 // if (MP4SetMetadataDisk(file, disk, tot)) return 1;
362 // }
363 // else if (!stricmp(item, "compilation"))
364 // {
365 // unsigned __int8 cpil = atoi(val);
366 // if (!cpil) return 1;
367 // if (MP4SetMetadataCompilation(file, cpil)) return 1;
368 // }
369 // else if (!stricmp(item, "tempo"))
370 // {
371 // unsigned __int16 tempo = atoi(val);
372 // if (!tempo) return 1;
373 // if (MP4SetMetadataTempo(file, tempo)) return 1;
374 // }
375 // else if (!stricmp(item, "artist"))
376 // {
377 // if (MP4SetMetadataArtist(file, val)) return 1;
378 // }
379 // else if (!stricmp(item, "writer"))
380 // {
381 // if (MP4SetMetadataWriter(file, val)) return 1;
382 // }
383 // else if (!stricmp(item, "title"))
384 // {
385 // if (MP4SetMetadataName(file, val)) return 1;
386 // }
387 // else if (!stricmp(item, "album"))
388 // {
389 // if (MP4SetMetadataAlbum(file, val)) return 1;
390 // }
391 // else if (!stricmp(item, "date") || !stricmp(item, "year"))
392 // {
393 // if (MP4SetMetadataYear(file, val)) return 1;
394 // }
395 // else if (!stricmp(item, "comment"))
396 // {
397 // if (MP4SetMetadataComment(file, val)) return 1;
398 // }
399 // else if (!stricmp(item, "genre"))
400 // {
401 // if (MP4SetMetadataGenre(file, val)) return 1;
402 // }
403 // else if (!stricmp(item, "tool"))
404 // {
405 // if (MP4SetMetadataTool(file, val)) return 1;
406 // }
407 // else
408 // {
409 // if (MP4SetMetadataFreeForm(file, (char *)item, (u_int8_t *)val, (u_int32_t)strlen(val))) return 1;
410 // }
411 //
412 // return 0;
413 //}
414 //
415 //int WriteMP4Tag(MP4FileHandle file, const medialib_tags *tags)
416 //{
417 // unsigned int i;
418 //
419 // for (i = 0; i < tags->count; i++)
420 // {
421 // const char *item = tags->tags[i].item;
422 // const char *value = tags->tags[i].value;
423 //
424 // if (value && *value)
425 // {
426 // mp4_set_metadata(file, item, value);
427 // }
428 // }
429 //}
430
431
432 #ifdef DEBUG_OUTPUT
433 void in_mp4_DebugOutput(char *message)
434 {
435 char s[1024];
436
437 sprintf(s, "in_mp4: %s: %s", mp4state.filename, message);
438 OutputDebugString(s);
439 }
440 #endif
441
442 int file_length(FILE *f)
443 {
444 long end = 0;
445 long cur = ftell(f);
446 fseek(f, 0, SEEK_END);
447 end = ftell(f);
448 fseek(f, cur, SEEK_SET);
449
450 return end;
451 }
452
453 static void show_error(HWND hwnd, char *message, ...)
454 {
455 if (m_show_errors)
456 MessageBox(hwnd, message, "Error", MB_OK);
457 }
458
459 static void config_init()
460 {
461 //char *p=INI_FILE;
462 //GetModuleFileName(NULL,INI_FILE,_MAX_PATH);
463 //while (*p) p++;
464 //while (p >= INI_FILE && *p != '.') p--;
465 //strcpy(p+1,"ini");
466 module.QCDCallbacks.Service(opGetPluginSettingsFile, INI_FILE, MAX_PATH, 0);
467 }
468
469 void config_read()
470 {
471 char priority[10];
472 char resolution[10];
473 char show_errors[10];
474 char use_for_aac[10];
475 char downmix[10];
476 char vbr_display[10];
477
478 config_init();
479
480 strcpy(show_errors, "1");
481 strcpy(priority, "3");
482 strcpy(resolution, "0");
483 strcpy(use_for_aac, "1");
484 strcpy(downmix, "0");
485 strcpy(vbr_display, "1");
486 //strcpy(titleformat, "%7");
487
488 RS(priority);
489 RS(resolution);
490 RS(show_errors);
491 RS(use_for_aac);
492 RS(downmix);
493 RS(vbr_display);
494 //RS(titleformat);
495
496 m_priority = atoi(priority);
497 m_resolution = atoi(resolution);
498 m_show_errors = atoi(show_errors);
499 m_use_for_aac = atoi(use_for_aac);
500 m_downmix = atoi(downmix);
501 m_vbr_display = atoi(vbr_display);
502 }
503
504 void config_write()
505 {
506 char priority[10];
507 char resolution[10];
508 char show_errors[10];
509 char use_for_aac[10];
510 char downmix[10];
511 char vbr_display[10];
512
513 itoa(m_priority, priority, 10);
514 itoa(m_resolution, resolution, 10);
515 itoa(m_show_errors, show_errors, 10);
516 itoa(m_use_for_aac, use_for_aac, 10);
517 itoa(m_downmix, downmix, 10);
518 itoa(m_vbr_display, vbr_display, 10);
519
520 WS(priority);
521 WS(resolution);
522 WS(show_errors);
523 WS(use_for_aac);
524 WS(downmix);
525 WS(vbr_display);
526 //WS(titleformat);
527 }
528
529 int Initialize(QCDModInfo *ModInfo, int flags)
530 {
531 ModInfo->moduleString = "MP4 Plug-in v" FAAD2_VERSION;
532
533 module.hMainWindow = (HWND)module.QCDCallbacks.Service(opGetParentWnd, 0, 0, 0);
534
535 // read config from config file
536 config_read();
537
538 ModInfo->moduleExtensions = !m_use_for_aac ? "MP4:M4A" : "MP4:M4A:AAC";
539
540 // return TRUE for successful initialization
541 return 1;
542 }
543
544 //----------------------------------------------------------------------------
545
546 void ShutDown(int flags)
547 {
548 Stop(mp4state.filename, STOPFLAG_FORCESTOP);
549 }
550
551 ///* Convert UNICODE to UTF-8
552 // Return number of bytes written */
553 //int unicodeToUtf8 ( const WCHAR* lpWideCharStr, char* lpMultiByteStr, int cwcChars )
554 //{
555 // const unsigned short* pwc = (unsigned short *)lpWideCharStr;
556 // unsigned char* pmb = (unsigned char *)lpMultiByteStr;
557 // const unsigned short* pwce;
558 // size_t cBytes = 0;
559 //
560 // if ( cwcChars >= 0 ) {
561 // pwce = pwc + cwcChars;
562 // } else {
563 // pwce = (unsigned short *)((size_t)-1);
564 // }
565 //
566 // while ( pwc < pwce ) {
567 // unsigned short wc = *pwc++;
568 //
569 // if ( wc < 0x00000080 ) {
570 // *pmb++ = (char)wc;
571 // cBytes++;
572 // } else
573 // if ( wc < 0x00000800 ) {
574 // *pmb++ = (char)(0xC0 | ((wc >> 6) & 0x1F));
575 // cBytes++;
576 // *pmb++ = (char)(0x80 | (wc & 0x3F));
577 // cBytes++;
578 // } else
579 // if ( wc < 0x00010000 ) {
580 // *pmb++ = (char)(0xE0 | ((wc >> 12) & 0x0F));
581 // cBytes++;
582 // *pmb++ = (char)(0x80 | ((wc >> 6) & 0x3F));
583 // cBytes++;
584 // *pmb++ = (char)(0x80 | (wc & 0x3F));
585 // cBytes++;
586 // }
587 // if ( wc == L'\0' )
588 // return cBytes;
589 // }
590 //
591 // return cBytes;
592 //}
593 //
594 ///* Convert UTF-8 coded string to UNICODE
595 // Return number of characters converted */
596 //int utf8ToUnicode ( const char* lpMultiByteStr, WCHAR* lpWideCharStr, int cmbChars )
597 //{
598 // const unsigned char* pmb = (unsigned char *)lpMultiByteStr;
599 // unsigned short* pwc = (unsigned short *)lpWideCharStr;
600 // const unsigned char* pmbe;
601 // size_t cwChars = 0;
602 //
603 // if ( cmbChars >= 0 ) {
604 // pmbe = pmb + cmbChars;
605 // } else {
606 // pmbe = (unsigned char *)((size_t)-1);
607 // }
608 //
609 // while ( pmb < pmbe ) {
610 // char mb = *pmb++;
611 // unsigned int cc = 0;
612 // unsigned int wc;
613 //
614 // while ( (cc < 7) && (mb & (1 << (7 - cc)))) {
615 // cc++;
616 // }
617 //
618 // if ( cc == 1 || cc > 6 ) // illegal character combination for UTF-8
619 // continue;
620 //
621 // if ( cc == 0 ) {
622 // wc = mb;
623 // } else {
624 // wc = (mb & ((1 << (7 - cc)) - 1)) << ((cc - 1) * 6);
625 // while ( --cc > 0 ) {
626 // if ( pmb == pmbe ) // reached end of the buffer
627 // return cwChars;
628 // mb = *pmb++;
629 // if ( ((mb >> 6) & 0x03) != 2 ) // not part of multibyte character
630 // return cwChars;
631 // wc |= (mb & 0x3F) << ((cc - 1) * 6);
632 // }
633 // }
634 //
635 // if ( wc & 0xFFFF0000 )
636 // wc = L'?';
637 // *pwc++ = wc;
638 // cwChars++;
639 // if ( wc == L'\0' )
640 // return cwChars;
641 // }
642 //
643 // return cwChars;
644 //}
645 //
646 ///* convert Windows ANSI to UTF-8 */
647 //int ConvertANSIToUTF8 ( const char* ansi, char* utf8 )
648 //{
649 // WCHAR* wszValue; // Unicode value
650 // size_t ansi_len;
651 // size_t len;
652 //
653 // *utf8 = '\0';
654 // if ( ansi == NULL )
655 // return 0;
656 //
657 // ansi_len = strlen ( ansi );
658 //
659 // if ( (wszValue = (WCHAR *)malloc ( (ansi_len + 1) * 2 )) == NULL )
660 // return 0;
661 //
662 // /* Convert ANSI value to Unicode */
663 // if ( (len = MultiByteToWideChar ( CP_ACP, 0, ansi, ansi_len + 1, wszValue, (ansi_len + 1) * 2 )) == 0 ) {
664 // free ( wszValue );
665 // return 0;
666 // }
667 //
668 // /* Convert Unicode value to UTF-8 */
669 // if ( (len = unicodeToUtf8 ( wszValue, utf8, -1 )) == 0 ) {
670 // free ( wszValue );
671 // return 0;
672 // }
673 //
674 // free ( wszValue );
675 //
676 // return len-1;
677 //}
678 //
679 ///* convert UTF-8 to Windows ANSI */
680 //int ConvertUTF8ToANSI ( const char* utf8, char* ansi )
681 //{
682 // WCHAR* wszValue; // Unicode value
683 // size_t utf8_len;
684 // size_t len;
685 //
686 // *ansi = '\0';
687 // if ( utf8 == NULL )
688 // return 0;
689 //
690 // utf8_len = strlen ( utf8 );
691 //
692 // if ( (wszValue = (WCHAR *)malloc ( (utf8_len + 1) * 2 )) == NULL )
693 // return 0;
694 //
695 // /* Convert UTF-8 value to Unicode */
696 // if ( (len = utf8ToUnicode ( utf8, wszValue, utf8_len + 1 )) == 0 ) {
697 // free ( wszValue );
698 // return 0;
699 // }
700 //
701 // /* Convert Unicode value to ANSI */
702 // if ( (len = WideCharToMultiByte ( CP_ACP, 0, wszValue, -1, ansi, (utf8_len + 1) * 2, NULL, NULL )) == 0 ) {
703 // free ( wszValue );
704 // return 0;
705 // }
706 //
707 // free ( wszValue );
708 //
709 // return len-1;
710 //}
711 //
712 //BOOL uSetDlgItemText(HWND hwnd, int id, const char *str)
713 //{
714 // char *temp;
715 // size_t len;
716 // int r;
717 //
718 // if (!str) return FALSE;
719 // if (!*str) return TRUE;
720 // len = strlen(str);
721 // temp = malloc(len+1);
722 // if (!temp) return FALSE;
723 // r = ConvertUTF8ToANSI(str, temp);
724 // if (r > 0)
725 // SetDlgItemText(hwnd, id, temp);
726 // free(temp);
727 //
728 // return r>0 ? TRUE : FALSE;
729 //}
730 //
731 //UINT uGetDlgItemText(HWND hwnd, int id, char *str, int max)
732 //{
733 // char *temp, *utf8;
734 // int len;
735 // HWND w;
736 //
737 // if (!str || !max) return 0;
738 // *str = '\0';
739 // w = GetDlgItem(hwnd, id);
740 // len = GetWindowTextLength(w);
741 // temp = malloc(len+1);
742 // if (!temp) return 0;
743 // utf8 = malloc((len+1)*4);
744 // if (!utf8)
745 // {
746 // free(temp);
747 // return 0;
748 // }
749 //
750 // len = GetWindowText(w, temp, len+1);
751 // if (len > 0)
752 // {
753 // len = ConvertANSIToUTF8(temp, utf8);
754 // if (len > max-1)
755 // {
756 // len = max-1;
757 // utf8[max] = '\0';
758 // }
759 // memcpy(str, utf8, len+1);
760 // }
761 //
762 // free(temp);
763 // free(utf8);
764 //
765 // return len;
766 //}
767 //
768 //BOOL CALLBACK mp4_info_dialog_proc(HWND hwndDlg, UINT message,
769 // WPARAM wParam, LPARAM lParam)
770 //{
771 // char *file_info;
772 // MP4FileHandle file;
773 // char *pVal, dummy1[1024], dummy3;
774 // short dummy, dummy2;
775 // char temp[1024];
776 // struct medialib_tags tags;
777 // tags.count = 0;
778 // tags.tags = NULL;
779 //
780 //#ifdef DEBUG_OUTPUT
781 // in_mp4_DebugOutput("mp4_info_dialog_proc");
782 //#endif
783 //
784 // switch (message) {
785 // case WM_INITDIALOG:
786 // EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT), FALSE);
787 // ShowWindow(GetDlgItem(hwndDlg,IDC_CONVERT), SW_HIDE);
788 // EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT1), FALSE);
789 // ShowWindow(GetDlgItem(hwndDlg,IDC_CONVERT1), SW_HIDE);
790 // EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT2), FALSE);
791 // ShowWindow(GetDlgItem(hwndDlg,IDC_CONVERT2), SW_HIDE);
792 //
793 // file = MP4Read(info_fn, 0);
794 //
795 // if (file == MP4_INVALID_FILE_HANDLE)
796 // return FALSE;
797 //
798 // file_info = MP4Info(file, MP4_INVALID_TRACK_ID);
799 // SetDlgItemText(hwndDlg, IDC_INFOTEXT, file_info);
800 // free(file_info);
801 //
802 // /* get Metadata */
803 //
804 // pVal = NULL;
805 // if (MP4GetMetadataName(file, &pVal))
806 // uSetDlgItemText(hwndDlg,IDC_METANAME, pVal);
807 //
808 // pVal = NULL;
809 // if (MP4GetMetadataArtist(file, &pVal))
810 // uSetDlgItemText(hwndDlg,IDC_METAARTIST, pVal);
811 //
812 // pVal = NULL;
813 // if (MP4GetMetadataWriter(file, &pVal))
814 // uSetDlgItemText(hwndDlg,IDC_METAWRITER, pVal);
815 //
816 // pVal = NULL;
817 // if (MP4GetMetadataComment(file, &pVal))
818 // uSetDlgItemText(hwndDlg,IDC_METACOMMENTS, pVal);
819 //
820 // pVal = NULL;
821 // if (MP4GetMetadataAlbum(file, &pVal))
822 // uSetDlgItemText(hwndDlg,IDC_METAALBUM, pVal);
823 //
824 // pVal = NULL;
825 // if (MP4GetMetadataGenre(file, &pVal))
826 // uSetDlgItemText(hwndDlg,IDC_METAGENRE, pVal);
827 //
828 // dummy = 0;
829 // MP4GetMetadataTempo(file, &dummy);
830 // if (dummy)
831 // {
832 // wsprintf(dummy1, "%d", dummy);
833 // SetDlgItemText(hwndDlg,IDC_METATEMPO, dummy1);
834 // }
835 //
836 // dummy = 0; dummy2 = 0;
837 // MP4GetMetadataTrack(file, &dummy, &dummy2);
838 // if (dummy)
839 // {
840 // wsprintf(dummy1, "%d", dummy);
841 // SetDlgItemText(hwndDlg,IDC_METATRACK1, dummy1);
842 // }
843 // if (dummy2)
844 // {
845 // wsprintf(dummy1, "%d", dummy2);
846 // SetDlgItemText(hwndDlg,IDC_METATRACK2, dummy1);
847 // }
848 //
849 // dummy = 0; dummy2 = 0;
850 // MP4GetMetadataDisk(file, &dummy, &dummy2);
851 // if (dummy)
852 // {
853 // wsprintf(dummy1, "%d", dummy);
854 // SetDlgItemText(hwndDlg,IDC_METADISK1, dummy1);
855 // }
856 // if (dummy2)
857 // {
858 // wsprintf(dummy1, "%d", dummy2);
859 // SetDlgItemText(hwndDlg,IDC_METADISK2, dummy1);
860 // }
861 //
862 // pVal = NULL;
863 // if (MP4GetMetadataYear(file, &pVal))
864 // uSetDlgItemText(hwndDlg,IDC_METAYEAR, pVal);
865 //
866 // dummy3 = 0;
867 // MP4GetMetadataCompilation(file, &dummy3);
868 // if (dummy3)
869 // SendMessage(GetDlgItem(hwndDlg, IDC_METACOMPILATION), BM_SETCHECK, BST_CHECKED, 0);
870 //
871 // /* ! Metadata */
872 //
873 // MP4Close(file);
874 //
875 // return TRUE;
876 //
877 // case WM_COMMAND:
878 // switch (LOWORD(wParam)) {
879 // case IDCANCEL:
880 // EndDialog(hwndDlg, wParam);
881 // return TRUE;
882 // case IDOK:
883 //
884 // /* save Metadata changes */
885 //
886 // tag_delete(&tags);
887 // file = MP4Read(info_fn, 0);
888 // if (file != MP4_INVALID_FILE_HANDLE)
889 // {
890 // ReadMP4Tag(file, &tags);
891 // MP4Close(file);
892 //
893 // file = MP4Modify(info_fn, 0, 0);
894 // if (file != MP4_INVALID_FILE_HANDLE)
895 // {
896 // MP4MetadataDelete(file);
897 // MP4Close(file);
898 // }
899 // }
900 //
901 // file = MP4Modify(info_fn, 0, 0);
902 // if (file == MP4_INVALID_FILE_HANDLE)
903 // {
904 // tag_delete(&tags);
905 // EndDialog(hwndDlg, wParam);
906 // return FALSE;
907 // }
908 //
909 // uGetDlgItemText(hwndDlg, IDC_METANAME, dummy1, 1024);
910 // tag_set_field(&tags, "title", dummy1);
911 //
912 // uGetDlgItemText(hwndDlg, IDC_METAWRITER, dummy1, 1024);
913 // tag_set_field(&tags, "writer", dummy1);
914 //
915 // uGetDlgItemText(hwndDlg, IDC_METAARTIST, dummy1, 1024);
916 // tag_set_field(&tags, "artist", dummy1);
917 //
918 // uGetDlgItemText(hwndDlg, IDC_METAALBUM, dummy1, 1024);
919 // tag_set_field(&tags, "album", dummy1);
920 //
921 // uGetDlgItemText(hwndDlg, IDC_METACOMMENTS, dummy1, 1024);
922 // tag_set_field(&tags, "comment", dummy1);
923 //
924 // uGetDlgItemText(hwndDlg, IDC_METAGENRE, dummy1, 1024);
925 // tag_set_field(&tags, "genre", dummy1);
926 //
927 // uGetDlgItemText(hwndDlg, IDC_METAYEAR, dummy1, 1024);
928 // tag_set_field(&tags, "year", dummy1);
929 //
930 // GetDlgItemText(hwndDlg, IDC_METATRACK1, dummy1, 1024);
931 // dummy = atoi(dummy1);
932 // GetDlgItemText(hwndDlg, IDC_METATRACK2, dummy1, 1024);
933 // dummy2 = atoi(dummy1);
934 // wsprintf(temp, "%d/%d", dummy, dummy2);
935 // tag_set_field(&tags, "track", temp);
936 //
937 // GetDlgItemText(hwndDlg, IDC_METADISK1, dummy1, 1024);
938 // dummy = atoi(dummy1);
939 // GetDlgItemText(hwndDlg, IDC_METADISK2, dummy1, 1024);
940 // dummy2 = atoi(dummy1);
941 // wsprintf(temp, "%d/%d", dummy, dummy2);
942 // tag_set_field(&tags, "disc", temp);
943 //
944 // GetDlgItemText(hwndDlg, IDC_METATEMPO, dummy1, 1024);
945 // tag_set_field(&tags, "tempo", dummy1);
946 //
947 // dummy3 = SendMessage(GetDlgItem(hwndDlg, IDC_METACOMPILATION), BM_GETCHECK, 0, 0);
948 // tag_set_field(&tags, "compilation", (dummy3 ? "1" : "0"));
949 //
950 // WriteMP4Tag(file, &tags);
951 //
952 // MP4Close(file);
953 //
954 // MP4Optimize(info_fn, NULL, 0);
955 // /* ! */
956 //
957 // EndDialog(hwndDlg, wParam);
958 // return TRUE;
959 // }
960 // }
961 // return FALSE;
962 //}
963 //
964 ///* returns the name of the object type */
965 //char *get_ot_string(int ot)
966 //{
967 // switch (ot)
968 // {
969 // case 0:
970 // return "Main";
971 // case 1:
972 // return "LC";
973 // case 2:
974 // return "SSR";
975 // case 3:
976 // return "LTP";
977 // }
978 // return NULL;
979 //}
980 //
981 //BOOL CALLBACK aac_info_dialog_proc(HWND hwndDlg, UINT message,
982 // WPARAM wParam, LPARAM lParam)
983 //{
984 // faadAACInfo aacInfo;
985 // char *info_text, *header_string;
986 //
987 //#ifdef DEBUG_OUTPUT
988 // in_mp4_DebugOutput("aac_info_dialog_proc");
989 //#endif
990 //
991 // switch (message) {
992 // case WM_INITDIALOG:
993 // EnableWindow(GetDlgItem(hwndDlg,IDC_USERDATA), FALSE) ;
994 // ShowWindow(GetDlgItem(hwndDlg,IDC_USERDATA), SW_HIDE);
995 //
996 // ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC1), SW_HIDE);
997 // ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC2), SW_HIDE);
998 // ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC3), SW_HIDE);
999 // ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC4), SW_HIDE);
1000 // ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC5), SW_HIDE);
1001 // ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC6), SW_HIDE);
1002 // ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC7), SW_HIDE);
1003 // ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC8), SW_HIDE);
1004 // ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC9), SW_HIDE);
1005 // ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC10), SW_HIDE);
1006 // ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC11), SW_HIDE);
1007 // ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC12), SW_HIDE);
1008 //
1009 // ShowWindow(GetDlgItem(hwndDlg,IDC_METANAME), SW_HIDE);
1010 // ShowWindow(GetDlgItem(hwndDlg,IDC_METAARTIST), SW_HIDE);
1011 // ShowWindow(GetDlgItem(hwndDlg,IDC_METAWRITER), SW_HIDE);
1012 // ShowWindow(GetDlgItem(hwndDlg,IDC_METACOMMENTS), SW_HIDE);
1013 // ShowWindow(GetDlgItem(hwndDlg,IDC_METAALBUM), SW_HIDE);
1014 // ShowWindow(GetDlgItem(hwndDlg,IDC_METAGENRE), SW_HIDE);
1015 // ShowWindow(GetDlgItem(hwndDlg,IDC_METATEMPO), SW_HIDE);
1016 // ShowWindow(GetDlgItem(hwndDlg,IDC_METATRACK1), SW_HIDE);
1017 // ShowWindow(GetDlgItem(hwndDlg,IDC_METATRACK2), SW_HIDE);
1018 // ShowWindow(GetDlgItem(hwndDlg,IDC_METADISK1), SW_HIDE);
1019 // ShowWindow(GetDlgItem(hwndDlg,IDC_METADISK2), SW_HIDE);
1020 // ShowWindow(GetDlgItem(hwndDlg,IDC_METAYEAR), SW_HIDE);
1021 // ShowWindow(GetDlgItem(hwndDlg,IDC_METACOMPILATION), SW_HIDE);
1022 //
1023 // info_text = malloc(1024*sizeof(char));
1024 //
1025 // get_AAC_format(info_fn, &aacInfo);
1026 //
1027 // switch (aacInfo.headertype)
1028 // {
1029 // case 0: /* RAW */
1030 // header_string = " RAW";
1031 // break;
1032 // case 1: /* ADIF */
1033 // header_string = " ADIF";
1034 // break;
1035 // case 2: /* ADTS */
1036 // header_string = " ADTS";
1037 // break;
1038 // }
1039 //
1040 // sprintf(info_text, "%s AAC %s%s, %d sec, %d kbps, %d Hz",
1041 // (aacInfo.version==2)?"MPEG-2":"MPEG-4", get_ot_string(aacInfo.object_type),
1042 // header_string,
1043 // (int)((float)aacInfo.length/1000.0), (int)((float)aacInfo.bitrate/1000.0+0.5),
1044 // aacInfo.sampling_rate);
1045 //
1046 // SetDlgItemText(hwndDlg, IDC_INFOTEXT, info_text);
1047 //
1048 // free(info_text);
1049 //
1050 // return TRUE;
1051 //
1052 // case WM_COMMAND:
1053 // switch (LOWORD(wParam))
1054 // {
1055 // case IDC_CONVERT:
1056 // {
1057 // char mp4FileName[256];
1058 // char *extension;
1059 // OPENFILENAME ofn;
1060 //
1061 // lstrcpy(mp4FileName, info_fn);
1062 // extension = strrchr(mp4FileName, '.');
1063 // lstrcpy(extension, ".mp4");
1064 //
1065 // memset(&ofn, 0, sizeof(OPENFILENAME));
1066 // ofn.lStructSize = sizeof(OPENFILENAME);
1067 // ofn.hwndOwner = hwndDlg;
1068 // ofn.hInstance = module.hDllInstance;
1069 // ofn.nMaxFileTitle = 31;
1070 // ofn.lpstrFile = (LPSTR)mp4FileName;
1071 // ofn.nMaxFile = _MAX_PATH;
1072 // ofn.lpstrFilter = "MP4 Files (*.mp4)\0*.mp4\0";
1073 // ofn.lpstrDefExt = "mp4";
1074 // ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
1075 // ofn.lpstrTitle = "Select Output File";
1076 //
1077 // if (GetSaveFileName(&ofn))
1078 // {
1079 // if (covert_aac_to_mp4(info_fn, mp4FileName))
1080 // {
1081 // MessageBox(hwndDlg, "An error occured while converting AAC to MP4!", "An error occured!", MB_OK);
1082 // return FALSE;
1083 // }
1084 // }
1085 // return TRUE;
1086 // }
1087 // case IDCANCEL:
1088 // case IDOK:
1089 // EndDialog(hwndDlg, wParam);
1090 // return TRUE;
1091 // }
1092 // }
1093 // return FALSE;
1094 //}
1095 //
1096 //int infoDlg(char *fn, HWND hwndParent)
1097 //{
1098 // if(!stricmp(fn + strlen(fn) - 3,"AAC"))
1099 // {
1100 // lstrcpy(info_fn, fn);
1101 //
1102 // DialogBox(module.hDllInstance, MAKEINTRESOURCE(IDD_INFO),
1103 // hwndParent, aac_info_dialog_proc);
1104 // } else {
1105 // lstrcpy(info_fn, fn);
1106 //
1107 // DialogBox(module.hDllInstance, MAKEINTRESOURCE(IDD_INFO),
1108 // hwndParent, mp4_info_dialog_proc);
1109 // }
1110 //
1111 // return 0;
1112 //}
1113 //
1114 ///* Get the title from the file */
1115 //void ConstructTitle(MP4FileHandle file, char *filename, char *title, char *format)
1116 //{
1117 // char temp[4096];
1118 // int some_info = 0;
1119 // char *in = format;
1120 // char *out = temp;//title;
1121 // char *bound = out + sizeof(temp) - 256; //out + (MAX_PATH - 10 - 1);
1122 // char *pVal, dummy1[1024];
1123 // short dummy, dummy2;
1124 //
1125 // while (*in && out < bound)
1126 // {
1127 // switch (*in)
1128 // {
1129 // case '%':
1130 // ++in;
1131 // break;
1132 //
1133 // default:
1134 // *out++ = *in++;
1135 // continue;
1136 // }
1137 //
1138 // /* handle % escape sequence */
1139 // switch (*in++)
1140 // {
1141 // case '0':
1142 // dummy = 0; dummy2 = 0;
1143 // if (MP4GetMetadataTrack(file, &dummy, &dummy2))
1144 // {
1145 // out += wsprintf(out, "%d", (int)dummy);
1146 // some_info = 1;
1147 // }
1148 // break;
1149 //
1150 // case '1':
1151 // pVal = NULL;
1152 // if (MP4GetMetadataArtist(file, &pVal))
1153 // {
1154 // out += wsprintf(out, "%s", pVal);
1155 // some_info = 1;
1156 // }
1157 // break;
1158 //
1159 // case '2':
1160 // pVal = NULL;
1161 // if (MP4GetMetadataName(file, &pVal))
1162 // {
1163 // out += wsprintf(out, "%s", pVal);
1164 // some_info = 1;
1165 // }
1166 // break;
1167 //
1168 // case '3':
1169 // pVal = NULL;
1170 // if (MP4GetMetadataAlbum(file, &pVal))
1171 // {
1172 // out += wsprintf(out, "%s", pVal);
1173 // some_info = 1;
1174 // }
1175 // break;
1176 //
1177 // case '4':
1178 // pVal = NULL;
1179 // if (MP4GetMetadataYear(file, &pVal))
1180 // {
1181 // out += wsprintf(out, "%s", pVal);
1182 // some_info = 1;
1183 // }
1184 // break;
1185 //
1186 // case '5':
1187 // pVal = NULL;
1188 // if (MP4GetMetadataComment(file, &pVal))
1189 // {
1190 // out += wsprintf(out, "%s", pVal);
1191 // some_info = 1;
1192 // }
1193 // break;
1194 //
1195 // case '6':
1196 // pVal = NULL;
1197 // if (MP4GetMetadataGenre(file, &pVal))
1198 // {
1199 // out += wsprintf(out, "%s", pVal);
1200 // some_info = 1;
1201 // }
1202 // break;
1203 //
1204 // case '7':
1205 // {
1206 // const char *p=strrchr(filename,'\\');
1207 // if (!p) p=filename; else p++;
1208 // out += ConvertANSIToUTF8(p, out);
1209 // some_info = 1;
1210 // break;
1211 // }
1212 //
1213 // default:
1214 // break;
1215 // }
1216 // }
1217 //
1218 // *out = '\0';
1219 //
1220 // if (!some_info)
1221 // {
1222 // char *p=filename+lstrlen(filename);
1223 // while (*p != '\\' && p >= filename) p--;
1224 // lstrcpy(title,++p);
1225 // }
1226 // else
1227 // {
1228 // int len = ConvertUTF8ToANSI(temp, dummy1);
1229 // if (len > (MAX_PATH - 10 - 1)) len = (MAX_PATH - 10 - 1);
1230 // memcpy(title, dummy1, len);
1231 // title[len] = '\0';
1232 // }
1233 //}
1234
1235 BOOL CALLBACK config_dialog_proc(HWND hwndDlg, UINT message,
1236 WPARAM wParam, LPARAM lParam)
1237 {
1238 int i;
1239
1240 switch (message) {
1241 case WM_INITDIALOG:
1242 SendMessage(GetDlgItem(hwndDlg, IDC_PRIORITY), TBM_SETRANGE, TRUE, MAKELONG(1,5));
1243 SendMessage(GetDlgItem(hwndDlg, IDC_PRIORITY), TBM_SETPOS, TRUE, m_priority);
1244 SendMessage(GetDlgItem(hwndDlg, res_id_table[m_resolution]), BM_SETCHECK, BST_CHECKED, 0);
1245 if (m_show_errors)
1246 SendMessage(GetDlgItem(hwndDlg, IDC_ERROR), BM_SETCHECK, BST_CHECKED, 0);
1247 if (m_use_for_aac)
1248 SendMessage(GetDlgItem(hwndDlg, IDC_USEFORAAC), BM_SETCHECK, BST_CHECKED, 0);
1249 if (m_downmix)
1250 SendMessage(GetDlgItem(hwndDlg, IDC_DOWNMIX), BM_SETCHECK, BST_CHECKED, 0);
1251 if (m_vbr_display)
1252 SendMessage(GetDlgItem(hwndDlg, IDC_VBR), BM_SETCHECK, BST_CHECKED, 0);
1253 SetDlgItemText(hwndDlg, IDC_TITLEFORMAT, titleformat);
1254 return TRUE;
1255
1256 case WM_COMMAND:
1257 switch (LOWORD(wParam)) {
1258 case IDCANCEL:
1259 EndDialog(hwndDlg, wParam);
1260 return TRUE;
1261 case IDOK:
1262 m_show_errors = SendMessage(GetDlgItem(hwndDlg, IDC_ERROR), BM_GETCHECK, 0, 0);
1263 m_use_for_aac = SendMessage(GetDlgItem(hwndDlg, IDC_USEFORAAC), BM_GETCHECK, 0, 0);
1264 m_downmix = SendMessage(GetDlgItem(hwndDlg, IDC_DOWNMIX), BM_GETCHECK, 0, 0);
1265 m_vbr_display = SendMessage(GetDlgItem(hwndDlg, IDC_VBR), BM_GETCHECK, 0, 0);
1266 GetDlgItemText(hwndDlg, IDC_TITLEFORMAT, titleformat, MAX_PATH);
1267
1268 m_priority = SendMessage(GetDlgItem(hwndDlg, IDC_PRIORITY), TBM_GETPOS, 0, 0);
1269 for (i = 0; i < 6; i++)
1270 {
1271 if (SendMessage(GetDlgItem(hwndDlg, res_id_table[i]), BM_GETCHECK, 0, 0))
1272 {
1273 m_resolution = i;
1274 break;
1275 }
1276 }
1277
1278 /* save config */
1279 config_write();
1280
1281 //if (!m_use_for_aac)
1282 //{
1283 // module.FileExtensions = short_ext_list;
1284 //} else {
1285 // module.FileExtensions = long_ext_list;
1286 //}
1287
1288 EndDialog(hwndDlg, wParam);
1289 return TRUE;
1290 }
1291 }
1292 return FALSE;
1293 }
1294
1295 void Configure(int flags)
1296 {
1297 DialogBox(module.hDllInstance, MAKEINTRESOURCE(IDD_CONFIG),
1298 module.hMainWindow, config_dialog_proc);
1299 }
1300
1301 //-----------------------------------------------------------------------------
1302
1303 void About(int flags)
1304 {
1305 MessageBox(module.hMainWindow,
1306 "AudioCoding.com MPEG-4 General Audio player " FAAD2_VERSION " compiled on " __DATE__ ".\n"
1307 "Visit the website for more info.\n"
1308 "Ported to QCD by Shao Hao.\n"
1309 "Copyright 2002-2003 AudioCoding.com",
1310 "About",
1311 MB_OK);
1312 }
1313
1314 //-----------------------------------------------------------------------------
1315
1316 int fill_buffer(state *st)
1317 {
1318 int bread;
1319
1320 if (st->m_aac_bytes_consumed > 0)
1321 {
1322 if (st->m_aac_bytes_into_buffer)
1323 {
1324 memmove((void*)st->m_aac_buffer, (void*)(st->m_aac_buffer + st->m_aac_bytes_consumed),
1325 st->m_aac_bytes_into_buffer*sizeof(unsigned char));
1326 }
1327
1328 if (!st->m_at_eof)
1329 {
1330 bread = fread((void*)(st->m_aac_buffer + st->m_aac_bytes_into_buffer),
1331 1, st->m_aac_bytes_consumed, st->aacfile);
1332
1333 if (bread != st->m_aac_bytes_consumed)
1334 st->m_at_eof = 1;
1335
1336 st->m_aac_bytes_into_buffer += bread;
1337 }
1338
1339 st->m_aac_bytes_consumed = 0;
1340
1341 if (st->m_aac_bytes_into_buffer > 3)
1342 {
1343 if (memcmp(st->m_aac_buffer, "TAG", 3) == 0)
1344 st->m_aac_bytes_into_buffer = 0;
1345 }
1346 if (st->m_aac_bytes_into_buffer > 11)
1347 {
1348 if (memcmp(st->m_aac_buffer, "LYRICSBEGIN", 11) == 0)
1349 st->m_aac_bytes_into_buffer = 0;
1350 }
1351 if (st->m_aac_bytes_into_buffer > 8)
1352 {
1353 if (memcmp(st->m_aac_buffer, "APETAGEX", 8) == 0)
1354 st->m_aac_bytes_into_buffer = 0;
1355 }
1356 }
1357
1358 return 1;
1359 }
1360
1361 void advance_buffer(state *st, int bytes)
1362 {
1363 st->m_file_offset += bytes;
1364 st->m_aac_bytes_consumed = bytes;
1365 st->m_aac_bytes_into_buffer -= bytes;
1366 }
1367
1368 int adts_parse(state *st, __int64 *bitrate, double *length)
1369 {
1370 static int sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000};
1371 int frames, frame_length;
1372 int t_framelength = 0;
1373 int samplerate;
1374 double frames_per_sec, bytes_per_frame;
1375
1376 /* Read all frames to ensure correct time and bitrate */
1377 for (frames = 0; /* */; frames++)
1378 {
1379 fill_buffer(st);
1380
1381 if (st->m_aac_bytes_into_buffer > 7)
1382 {
1383 /* check syncword */
1384 if (!((st->m_aac_buffer[0] == 0xFF)&&((st->m_aac_buffer[1] & 0xF6) == 0xF0)))
1385 break;
1386
1387 st->m_tail->offset = st->m_file_offset;
1388 st->m_tail->next = (struct seek_list*)malloc(sizeof(struct seek_list));
1389 st->m_tail = st->m_tail->next;
1390 st->m_tail->next = NULL;
1391
1392 if (frames == 0)
1393 samplerate = sample_rates[(st->m_aac_buffer[2]&0x3c)>>2];
1394
1395 frame_length = ((((unsigned int)st->m_aac_buffer[3] & 0x3)) << 11)
1396 | (((unsigned int)st->m_aac_buffer[4]) << 3) | (st->m_aac_buffer[5] >> 5);
1397
1398 t_framelength += frame_length;
1399
1400 if (frame_length > st->m_aac_bytes_into_buffer)
1401 break;
1402
1403 advance_buffer(st, frame_length);
1404 } else {
1405 break;
1406 }
1407 }
1408
1409 frames_per_sec = (double)samplerate/1024.0;
1410 if (frames != 0)
1411 bytes_per_frame = (double)t_framelength/(double)(frames*1000);
1412 else
1413 bytes_per_frame = 0;
1414 *bitrate = (__int64)(8. * bytes_per_frame * frames_per_sec + 0.5);
1415 if (frames_per_sec != 0)
1416 *length = (double)frames/frames_per_sec;
1417 else
1418 *length = 1;
1419
1420 return 1;
1421 }
1422
1423 int skip_id3v2_tag()
1424 {
1425 unsigned char buf[10];
1426 int bread, tagsize = 0;
1427
1428 bread = fread(buf, 1, 10, mp4state.aacfile);
1429 if (bread != 10) return -1;
1430
1431 if (!memcmp(buf, "ID3", 3))
1432 {
1433 /* high bit is not used */
1434 tagsize = (buf[6] << 21) | (buf[7] << 14) | (buf[8] << 7) | (buf[9] << 0);
1435
1436 tagsize += 10;
1437 fseek(mp4state.aacfile, tagsize, SEEK_SET);
1438 } else {
1439 fseek(mp4state.aacfile, 0, SEEK_SET);
1440 }
1441
1442 return tagsize;
1443 }
1444
1445 int GetMediaSupported(const char* medianame, MediaInfo *mediaInfo)
1446 {
1447 int tagsize = 0, init;
1448
1449 if (!medianame || !*medianame)
1450 return 0;
1451
1452 if (!stricmp(medianame + strlen(medianame) - 3,"MP4") || !stricmp(medianame + strlen(medianame) - 3,"M4A"))
1453 {
1454 if (mediaInfo)
1455 {
1456 mediaInfo->mediaType = DIGITAL_FILE_MEDIA;
1457 mediaInfo->op_canSeek = 1;
1458 }
1459 return 1;
1460 }
1461 else if (m_use_for_aac && !stricmp(medianame + strlen(medianame) - 3,"AAC"))
1462 {
1463 if (mediaInfo)
1464 {
1465 mediaInfo->mediaType = DIGITAL_FILE_MEDIA;
1466 mediaInfo->op_canSeek = 1;
1467
1468 memset(&mp4state, 0, sizeof(state));
1469 lstrcpy(mp4state.filename, medianame);
1470
1471 if (!(mp4state.aacfile = fopen(mp4state.filename, "rb")))
1472 {
1473 // error
1474 return 0;
1475 }
1476
1477 tagsize = skip_id3v2_tag();
1478 if (tagsize<0) return 0;
1479
1480 if (!(mp4state.m_aac_buffer = (unsigned char*)malloc(768*6)))
1481 {
1482 show_error(module.hMainWindow, "Memory allocation error.");
1483 return 0;
1484 }
1485
1486 for (init=0; init<2; init++)
1487 {
1488 memset(mp4state.m_aac_buffer, 0, 768*6);
1489 fread(mp4state.m_aac_buffer, 1, 768*6, mp4state.aacfile);
1490
1491 if (init==0)
1492 fseek(mp4state.aacfile, tagsize, SEEK_SET);
1493 }
1494
1495 if (memcmp(mp4state.m_aac_buffer, "ADIF", 4) == 0)
1496 mediaInfo->op_canSeek = (double)file_length(mp4state.aacfile) == -1 ? 0 : 1;
1497
1498 free(mp4state.m_aac_buffer);
1499
1500 fclose(mp4state.aacfile);
1501 }
1502 return 1;
1503 }
1504
1505 return 0;
1506 }
1507
1508 //-----------------------------------------------------------------------------
1509
1510 int Play(const char* medianame, int playfrom, int playto, int flags)
1511 {
1512 WAVEFORMATEX wf;
1513 //int maxlatency;
1514 int thread_id;
1515 int avg_bitrate, br, sr;
1516 unsigned char *buffer;
1517 int buffer_size;
1518 faacDecConfigurationPtr config;
1519
1520 #ifdef DEBUG_OUTPUT
1521 in_mp4_DebugOutput("play");
1522 #endif
1523
1524 if (stricmp(mp4state.filename, medianame) != 0)
1525 Stop(mp4state.filename, STOPFLAG_PLAYDONE);
1526
1527 if (mp4state.paused)
1528 {
1529 // Update the player controls to reflect the new unpaused state
1530 module.QCDCallbacks.toPlayer.OutputPause(0);
1531
1532 Pause(medianame, 0);
1533
1534 if (playfrom >= 0)
1535 mp4state.seek_needed = playfrom;
1536 }
1537 else if (PlayThreadAlive) // is playing
1538 {
1539 mp4state.seek_needed = playfrom;
1540 return 1;
1541 }
1542 else
1543 {
1544 memset(&mp4state, 0, sizeof(state));
1545
1546 lstrcpy(mp4state.filename, medianame);
1547
1548 if (!(mp4state.mp4file = MP4Read(mp4state.filename, 0)))
1549 {
1550 mp4state.filetype = 1;
1551 } else {
1552 MP4Close(mp4state.mp4file);
1553 mp4state.filetype = 0;
1554 }
1555
1556 if (mp4state.filetype)
1557 {
1558 int tagsize = 0, tmp = 0, init;
1559 int bread = 0;
1560 double length = 0.;
1561 __int64 bitrate = 128;
1562
1563 //module.is_seekable = 1;
1564
1565 if (!(mp4state.aacfile = fopen(mp4state.filename, "rb")))
1566 {
1567 // error
1568 return -1;
1569 }
1570
1571 tagsize = skip_id3v2_tag();
1572 if (tagsize<0) return 0;
1573
1574 if (!(mp4state.m_aac_buffer = (unsigned char*)malloc(768*6)))
1575 {
1576 show_error(module.hMainWindow, "Memory allocation error.");
1577 return -1;
1578 }
1579
1580 for (init=0; init<2; init++)
1581 {
1582 mp4state.hDecoder = faacDecOpen();
1583 if (!mp4state.hDecoder)
1584 {
1585 show_error(module.hMainWindow, "Unable to open decoder library.");
1586 return -1;
1587 }
1588
1589 config = faacDecGetCurrentConfiguration(mp4state.hDecoder);
1590 config->outputFormat = m_resolution + 1;
1591 config->downMatrix = m_downmix;
1592 faacDecSetConfiguration(mp4state.hDecoder, config);
1593
1594 memset(mp4state.m_aac_buffer, 0, 768*6);
1595 bread = fread(mp4state.m_aac_buffer, 1, 768*6, mp4state.aacfile);
1596 mp4state.m_aac_bytes_into_buffer = bread;
1597 mp4state.m_aac_bytes_consumed = 0;
1598 mp4state.m_file_offset = 0;
1599 mp4state.m_at_eof = (bread != 768*6) ? 1 : 0;
1600
1601 if (init==0)
1602 {
1603 faacDecFrameInfo frameInfo;
1604
1605 fill_buffer(&mp4state);
1606
1607 if ((mp4state.m_aac_bytes_consumed = faacDecInit(mp4state.hDecoder,
1608 mp4state.m_aac_buffer, mp4state.m_aac_bytes_into_buffer,
1609 &mp4state.samplerate, &mp4state.channels)) < 0)
1610 {
1611 show_error(module.hMainWindow, "Can't initialize decoder library.");
1612 return -1;
1613 }
1614 advance_buffer(&mp4state, mp4state.m_aac_bytes_consumed);
1615
1616 do {
1617 memset(&frameInfo, 0, sizeof(faacDecFrameInfo));
1618 fill_buffer(&mp4state);
1619 faacDecDecode(mp4state.hDecoder, &frameInfo, mp4state.m_aac_buffer, mp4state.m_aac_bytes_into_buffer);
1620 } while (!frameInfo.samples && !frameInfo.error);
1621
1622 if (frameInfo.error)
1623 {
1624 show_error(module.hMainWindow, faacDecGetErrorMessage(frameInfo.error));
1625 return -1;
1626 }
1627
1628 mp4state.channels = frameInfo.channels;
1629 mp4state.samplerate = frameInfo.samplerate;
1630 mp4state.framesize = (frameInfo.channels != 0) ? frameInfo.samples/frameInfo.channels : 0;
1631 /*
1632 sbr = frameInfo.sbr;
1633 profile = frameInfo.object_type;
1634 header_type = frameInfo.header_type;
1635 */
1636
1637 faacDecClose(mp4state.hDecoder);
1638 fseek(mp4state.aacfile, tagsize, SEEK_SET);
1639 }
1640 }
1641
1642 mp4state.m_head = (struct seek_list*)malloc(sizeof(struct seek_list));
1643 mp4state.m_tail = mp4state.m_head;
1644 mp4state.m_tail->next = NULL;
1645
1646 mp4state.m_header_type = 0;
1647 if ((mp4state.m_aac_buffer[0] == 0xFF) && ((mp4state.m_aac_buffer[1] & 0xF6) == 0xF0))
1648 {
1649 if (1) //(can_seek)
1650 {
1651 adts_parse(&mp4state, &bitrate, &length);
1652 fseek(mp4state.aacfile, tagsize, SEEK_SET);
1653
1654 bread = fread(mp4state.m_aac_buffer, 1, 768*6, mp4state.aacfile);
1655 if (bread != 768*6)
1656 mp4state.m_at_eof = 1;
1657 else
1658 mp4state.m_at_eof = 0;
1659 mp4state.m_aac_bytes_into_buffer = bread;
1660 mp4state.m_aac_bytes_consumed = 0;
1661
1662 mp4state.m_header_type = 1;
1663 }
1664 } else if (memcmp(mp4state.m_aac_buffer, "ADIF", 4) == 0) {
1665 int skip_size = (mp4state.m_aac_buffer[4] & 0x80) ? 9 : 0;
1666 bitrate = ((unsigned int)(mp4state.m_aac_buffer[4 + skip_size] & 0x0F)<<19) |
1667 ((unsigned int)mp4state.m_aac_buffer[5 + skip_size]<<11) |
1668 ((unsigned int)mp4state.m_aac_buffer[6 + skip_size]<<3) |
1669 ((unsigned int)mp4state.m_aac_buffer[7 + skip_size] & 0xE0);
1670
1671 length = (double)file_length(mp4state.aacfile);
1672 if (length == -1)
1673 {
1674 //module.is_seekable = 0;
1675 length = 0;
1676 } else {
1677 length = ((double)length*8.)/((double)bitrate) + 0.5;
1678 }
1679
1680 mp4state.m_header_type = 2;
1681 } else {
1682 length = (double)file_length(mp4state.aacfile);
1683 length = ((double)length*8.)/((double)bitrate*1000.) + 0.5;
1684
1685 //module.is_seekable = 1;
1686 }
1687
1688 mp4state.m_length = (int)(length*1000.);
1689
1690 fill_buffer(&mp4state);
1691 if ((mp4state.m_aac_bytes_consumed = faacDecInit(mp4state.hDecoder,
1692 mp4state.m_aac_buffer, mp4state.m_aac_bytes_into_buffer,
1693 &mp4state.samplerate, &mp4state.channels)) < 0)
1694 {
1695 show_error(module.hMainWindow, "Can't initialize decoder library.");
1696 return -1;
1697 }
1698 advance_buffer(&mp4state, mp4state.m_aac_bytes_consumed);
1699
1700 if (mp4state.m_header_type == 2)
1701 avg_bitrate = bitrate;
1702 else
1703 avg_bitrate = bitrate*1000;
1704 } else {
1705 mp4state.hDecoder = faacDecOpen();
1706 if (!mp4state.hDecoder)
1707 {
1708 show_error(module.hMainWindow, "Unable to open decoder library.");
1709 return -1;
1710 }
1711
1712 config = faacDecGetCurrentConfiguration(mp4state.hDecoder);
1713 config->outputFormat = m_resolution + 1;
1714 config->downMatrix = m_downmix;
1715 faacDecSetConfiguration(mp4state.hDecoder, config);
1716
1717 mp4state.mp4file = MP4Read(mp4state.filename, 0);
1718 if (!mp4state.mp4file)
1719 {
1720 show_error(module.hMainWindow, "Unable to open file.");
1721 faacDecClose(mp4state.hDecoder);
1722 return -1;
1723 }
1724
1725 if ((mp4state.mp4track = GetAACTrack(mp4state.mp4file)) < 0)
1726 {
1727 show_error(module.hMainWindow, "Unsupported Audio track type.");
1728 faacDecClose(mp4state.hDecoder);
1729 MP4Close(mp4state.mp4file);
1730 return -1;
1731 }
1732
1733 buffer = NULL;
1734 buffer_size = 0;
1735 MP4GetTrackESConfiguration(mp4state.mp4file, mp4state.mp4track,
1736 &buffer, &buffer_size);
1737 if (!buffer)
1738 {
1739 faacDecClose(mp4state.hDecoder);
1740 MP4Close(mp4state.mp4file);
1741 return -1;
1742 }
1743
1744 if(faacDecInit2(mp4state.hDecoder, buffer, buffer_size,
1745 &mp4state.samplerate, &mp4state.channels) < 0)
1746 {
1747 /* If some error initializing occured, skip the file */
1748 faacDecClose(mp4state.hDecoder);
1749 MP4Close(mp4state.mp4file);
1750 if (buffer) free (buffer);
1751 return -1;
1752 }
1753
1754 /* for gapless decoding */
1755 {
1756 mp4AudioSpecificConfig mp4ASC;
1757
1758 mp4state.timescale = MP4GetTrackTimeScale(mp4state.mp4file, mp4state.mp4track);
1759 mp4state.framesize = 1024;
1760 mp4state.useAacLength = 0;
1761
1762 if (buffer)
1763 {
1764 if (AudioSpecificConfig(buffer, buffer_size, &mp4ASC) >= 0)
1765 {
1766 if (mp4ASC.frameLengthFlag == 1) mp4state.framesize = 960;
1767 if (mp4ASC.sbr_present_flag == 1) mp4state.framesize *= 2;
1768 }
1769 }
1770 }
1771
1772 free(buffer);
1773
1774 avg_bitrate = MP4GetTrackIntegerProperty(mp4state.mp4file, mp4state.mp4track,
1775 "mdia.minf.stbl.stsd.mp4a.esds.decConfigDescr.avgBitrate");
1776
1777 mp4state.numSamples = MP4GetTrackNumberOfSamples(mp4state.mp4file, mp4state.mp4track);
1778 mp4state.sampleId = 1;
1779
1780 //module.is_seekable = 1;
1781 }
1782
1783 if (mp4state.channels == 0)
1784 {
1785 show_error(module.hMainWindow, "Number of channels not supported for playback.");
1786 faacDecClose(mp4state.hDecoder);
1787 if (mp4state.filetype)
1788 fclose(mp4state.aacfile);
1789 else
1790 MP4Close(mp4state.mp4file);
1791 return -1;
1792 }
1793
1794 if (m_downmix && (mp4state.channels == 5 || mp4state.channels == 6))
1795 mp4state.channels = 2;
1796
1797 wf.wFormatTag = WAVE_FORMAT_PCM;
1798 wf.cbSize = 0;
1799 wf.nChannels = mp4state.channels;
1800 wf.wBitsPerSample = res_table[m_resolution];
1801 wf.nSamplesPerSec = mp4state.samplerate;
1802 wf.nBlockAlign = wf.nChannels * wf.wBitsPerSample / 8;
1803 wf.nAvgBytesPerSec = wf.nSamplesPerSec * wf.nBlockAlign;
1804 if (!module.QCDCallbacks.toPlayer.OutputOpen(mp4state.filename, &wf)) // error opening device
1805 {
1806 faacDecClose(mp4state.hDecoder);
1807 if (mp4state.filetype)
1808 fclose(mp4state.aacfile);
1809 else
1810 MP4Close(mp4state.mp4file);
1811 return -1;
1812 }
1813
1814 mp4state.paused = 0;
1815 mp4state.decode_pos_ms = 0;
1816 mp4state.seek_needed = -1;
1817
1818 //// initialize vis stuff
1819 //module.SAVSAInit(maxlatency, mp4state.samplerate);
1820 //module.VSASetInfo((int)mp4state.channels, mp4state.samplerate);
1821
1822 br = (int)floor(((float)avg_bitrate + 500.0)/1000.0 + 0.5);
1823 sr = (int)floor((float)mp4state.samplerate/1000.0 + 0.5);
1824 ai.struct_size = sizeof(AudioInfo);
1825 ai.frequency = sr*1000;
1826 ai.bitrate = br*1000;
1827 ai.mode = (mp4state.channels == 2) ? 0 : 3;
1828 ai.layer = 0;
1829 ai.level = 0;
1830 strcpy(ai.text, mp4state.filetype ? "AAC" : "MP4");
1831 module.QCDCallbacks.Service(opSetAudioInfo, &ai, sizeof(AudioInfo), 0);
1832
1833 //module.outMod->SetVolume(-666); // set the output plug-ins default volume
1834
1835 killPlayThread = 0;
1836
1837 if (mp4state.filetype)
1838 {
1839 if ((play_thread_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)AACPlayThread,
1840 (void *)&killPlayThread, 0, &thread_id)) == NULL)
1841 {
1842 show_error(module.hMainWindow, "Cannot create playback thread");
1843 faacDecClose(mp4state.hDecoder);
1844 fclose(mp4state.aacfile);
1845 return -1;
1846 }
1847 } else {
1848 if ((play_thread_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MP4PlayThread,
1849 (void *)&killPlayThread, 0, &thread_id)) == NULL)
1850 {
1851 show_error(module.hMainWindow, "Cannot create playback thread");
1852 faacDecClose(mp4state.hDecoder);
1853 MP4Close(mp4state.mp4file);
1854 return -1;
1855 }
1856 }
1857
1858 SetThreadAffinityMask(play_thread_handle, 1);
1859
1860 SetThreadPriority(play_thread_handle, priority_table[m_priority]);
1861 }
1862
1863 return 1;
1864 }
1865
1866 //-----------------------------------------------------------------------------
1867
1868 int Pause(const char* medianame, int flags)
1869 {
1870 #ifdef DEBUG_OUTPUT
1871 in_mp4_DebugOutput("pause");
1872 #endif
1873
1874 mp4state.paused = flags;
1875
1876 if (module.QCDCallbacks.toPlayer.OutputPause(flags))
1877 return 1;
1878
1879 mp4state.paused = !flags;
1880 return 0;
1881 }
1882
1883 //void unpause()
1884 //{
1885 //#ifdef DEBUG_OUTPUT
1886 // in_mp4_DebugOutput("unpause");
1887 //#endif
1888 //
1889 // mp4state.paused = 0;
1890 // module.outMod->Pause(0);
1891 //}
1892 //
1893 //int ispaused()
1894 //{
1895 //#ifdef DEBUG_OUTPUT
1896 // in_mp4_DebugOutput("ispaused");
1897 //#endif
1898 //
1899 // return mp4state.paused;
1900 //}
1901
1902 //-----------------------------------------------------------------------------
1903
1904 void SetVolume(int levelleft, int levelright, int flags)
1905 {
1906 #ifdef DEBUG_OUTPUT
1907 in_mp4_DebugOutput("setvolume");
1908 #endif
1909
1910 module.QCDCallbacks.toPlayer.OutputSetVol(levelleft, levelright, flags);
1911 }
1912
1913 //void setpan(int pan)
1914 //{
1915 //#ifdef DEBUG_OUTPUT
1916 // in_mp4_DebugOutput("setpan");
1917 //#endif
1918 //
1919 // module.outMod->SetPan(pan);
1920 //}
1921
1922 //-----------------------------------------------------------------------------
1923
1924 int Stop(const char* medianame, int flags)
1925 {
1926 struct seek_list *target = mp4state.m_head;
1927
1928 #ifdef DEBUG_OUTPUT
1929 in_mp4_DebugOutput("stop");
1930 #endif
1931
1932 if (medianame && *medianame && stricmp(mp4state.filename, medianame) == 0)
1933 {
1934 module.QCDCallbacks.toPlayer.OutputStop(flags);
1935 killPlayThread = 1;
1936
1937 if (play_thread_handle != INVALID_HANDLE_VALUE)
1938 {
1939 if (WaitForSingleObject(play_thread_handle, INFINITE) == WAIT_TIMEOUT)
1940 TerminateThread(play_thread_handle,0);
1941 CloseHandle(play_thread_handle);
1942 play_thread_handle = INVALID_HANDLE_VALUE;
1943 }
1944
1945
1946 if (mp4state.m_aac_buffer)
1947 free(mp4state.m_aac_buffer);
1948
1949 while (target)
1950 {
1951 struct seek_list *tmp = target;
1952 target = target->next;
1953 if (tmp) free(tmp);
1954 }
1955 faacDecClose(mp4state.hDecoder);
1956 if (mp4state.filetype)
1957 fclose(mp4state.aacfile);
1958 else
1959 MP4Close(mp4state.mp4file);
1960
1961 //module.outMod->Close();
1962 //module.SAVSADeInit();
1963 mp4state.filename[0] = '\0';
1964 mp4state.paused = 0;
1965 }
1966
1967 return 1;
1968 }
1969
1970 int getsonglength(const char *fn)
1971 {
1972 long msDuration = 0;
1973
1974 if(!stricmp(fn + strlen(fn) - 3,"MP4") || !stricmp(fn + strlen(fn) - 3,"M4A"))
1975 {
1976 int track;
1977 MP4Duration length;
1978 MP4FileHandle file;
1979
1980 file = MP4Read(fn, 0);
1981 if (!file)
1982 return 0;
1983
1984 if ((track = GetAACTrack(file)) < 0)
1985 {
1986 MP4Close(file);
1987 return -1;
1988 }
1989
1990 length = MP4GetTrackDuration(file, track);
1991
1992 msDuration = MP4ConvertFromTrackDuration(file, track,
1993 length, MP4_MSECS_TIME_SCALE);
1994
1995 MP4Close(file);
1996
1997 return msDuration;
1998 } else {
1999 int tagsize = 0;
2000 int bread = 0;
2001 double length = 0.;
2002 __int64 bitrate = 128;
2003 struct seek_list *target;
2004 state len_state;
2005
2006 memset(&len_state, 0, sizeof(state));
2007
2008 if (!(len_state.aacfile = fopen(fn, "rb")))
2009 {
2010 // error
2011 return 0;
2012 }
2013
2014 len_state.m_at_eof = 0;
2015
2016 if (!(len_state.m_aac_buffer = (unsigned char*)malloc(768*6)))
2017 {
2018 //console::error("Memory allocation error.", "foo_mp4");
2019 return 0;
2020 }
2021 memset(len_state.m_aac_buffer, 0, 768*6);
2022
2023 bread = fread(len_state.m_aac_buffer, 1, 768*6, len_state.aacfile);
2024 len_state.m_aac_bytes_into_buffer = bread;
2025 len_state.m_aac_bytes_consumed = 0;
2026 len_state.m_file_offset = 0;
2027
2028 if (bread != 768*6)
2029 len_state.m_at_eof = 1;
2030
2031 if (!memcmp(len_state.m_aac_buffer, "ID3", 3))
2032 {
2033 /* high bit is not used */
2034 tagsize = (len_state.m_aac_buffer[6] << 21) | (len_state.m_aac_buffer[7] << 14) |
2035 (len_state.m_aac_buffer[8] << 7) | (len_state.m_aac_buffer[9] << 0);
2036
2037 tagsize += 10;
2038 advance_buffer(&len_state, tagsize);
2039 }
2040
2041 len_state.m_head = (struct seek_list*)malloc(sizeof(struct seek_list));
2042 len_state.m_tail = len_state.m_head;
2043 len_state.m_tail->next = NULL;
2044
2045 len_state.m_header_type = 0;
2046 if ((len_state.m_aac_buffer[0] == 0xFF) && ((len_state.m_aac_buffer[1] & 0xF6) == 0xF0))
2047 {
2048 if (1) //(m_reader->can_seek())
2049 {
2050 adts_parse(&len_state, &bitrate, &length);
2051 fseek(len_state.aacfile, tagsize, SEEK_SET);
2052
2053 bread = fread(len_state.m_aac_buffer, 1, 768*6, len_state.aacfile);
2054 if (bread != 768*6)
2055 len_state.m_at_eof = 1;
2056 else
2057 len_state.m_at_eof = 0;
2058 len_state.m_aac_bytes_into_buffer = bread;
2059 len_state.m_aac_bytes_consumed = 0;
2060
2061 len_state.m_header_type = 1;
2062 }
2063 } else if (memcmp(len_state.m_aac_buffer, "ADIF", 4) == 0) {
2064 int skip_size = (len_state.m_aac_buffer[4] & 0x80) ? 9 : 0;
2065 bitrate = ((unsigned int)(len_state.m_aac_buffer[4 + skip_size] & 0x0F)<<19) |
2066 ((unsigned int)len_state.m_aac_buffer[5 + skip_size]<<11) |
2067 ((unsigned int)len_state.m_aac_buffer[6 + skip_size]<<3) |
2068 ((unsigned int)len_state.m_aac_buffer[7 + skip_size] & 0xE0);
2069
2070 length = (double)file_length(len_state.aacfile);
2071 if (length == -1)
2072 length = 0;
2073 else
2074 length = ((double)length*8.)/((double)bitrate) + 0.5;
2075
2076 len_state.m_header_type = 2;
2077 } else {
2078 length = (double)file_length(len_state.aacfile);
2079 length = ((double)length*8.)/((double)bitrate*1000.) + 0.5;
2080
2081 len_state.m_header_type = 0;
2082 }
2083
2084 if (len_state.m_aac_buffer)
2085 free(len_state.m_aac_buffer);
2086
2087 target = len_state.m_head;
2088 while (target)
2089 {
2090 struct seek_list *tmp = target;
2091 target = target->next;
2092 if (tmp) free(tmp);
2093 }
2094
2095 fclose(len_state.aacfile);
2096
2097 return (int)(length*1000.);
2098 }
2099 }
2100
2101 //int getlength()
2102 //{
2103 // if (!mp4state.filetype)
2104 // {
2105 // int track;
2106 // long msDuration;
2107 // MP4Duration length;
2108 //
2109 // if ((track = GetAACTrack(mp4state.mp4file)) < 0)
2110 // {
2111 // return -1;
2112 // }
2113 //
2114 // length = MP4GetTrackDuration(mp4state.mp4file, track);
2115 //
2116 // msDuration = MP4ConvertFromTrackDuration(mp4state.mp4file, track,
2117 // length, MP4_MSECS_TIME_SCALE);
2118 //
2119 // return msDuration;
2120 // } else {
2121 // return mp4state.m_length;
2122 // }
2123 // return 0;
2124 //}
2125
2126 //-----------------------------------------------------------------------------
2127
2128 int GetCurrentPosition(const char* medianame, long *track, long *offset)
2129 {
2130 return module.QCDCallbacks.toPlayer.OutputGetCurrentPosition((UINT*)offset, 0);
2131 }
2132
2133 //void setoutputtime(int time_in_ms)
2134 //{
2135 //#ifdef DEBUG_OUTPUT
2136 // in_mp4_DebugOutput("setoutputtime");
2137 //#endif
2138 //
2139 // mp4state.seek_needed = time_in_ms;
2140 //}
2141
2142 //-----------------------------------------------------------------------------
2143
2144 int GetTrackExtents(const char* medianame, TrackExtents *ext, int flags)
2145 {
2146 int len;
2147 FILE *fh;
2148
2149 len = getsonglength((char *)medianame);
2150 fh = fopen(medianame, "rb");
2151 if (len <= 0 || !fh)
2152 return 0;
2153
2154 ext->track = 1;
2155 ext->start = 0;
2156 ext->end = len;
2157 ext->bytesize = file_length(fh);
2158 fclose(fh);
2159 ext->unitpersec = 1000;
2160
2161 return 1;
2162 }
2163
2164 //void eq_set(int on, char data[10], int preamp)
2165 //{
2166 //}
2167
2168 static void remap_channels(unsigned char *data, unsigned int samples, unsigned int bps)
2169 {
2170 unsigned int i;
2171
2172 switch (bps)
2173 {
2174 case 8:
2175 {
2176 unsigned char r1, r2, r3, r4, r5, r6;
2177 for (i = 0; i < samples; i += 6)
2178 {
2179 r1 = data[i];
2180 r2 = data[i+1];
2181 r3 = data[i+2];
2182 r4 = data[i+3];
2183 r5 = data[i+4];
2184 r6 = data[i+5];
2185 data[i] = r2;
2186 data[i+1] = r3;
2187 data[i+2] = r1;
2188 data[i+3] = r6;
2189 data[i+4] = r4;
2190 data[i+5] = r5;
2191 }
2192 }
2193 break;
2194
2195 case 16:
2196 default:
2197 {
2198 unsigned short r1, r2, r3, r4, r5, r6;
2199 unsigned short *sample_buffer = (unsigned short *)data;
2200 for (i = 0; i < samples; i += 6)
2201 {
2202 r1 = sample_buffer[i];
2203 r2 = sample_buffer[i+1];
2204 r3 = sample_buffer[i+2];
2205 r4 = sample_buffer[i+3];
2206 r5 = sample_buffer[i+4];
2207 r6 = sample_buffer[i+5];
2208 sample_buffer[i] = r2;
2209 sample_buffer[i+1] = r3;
2210 sample_buffer[i+2] = r1;
2211 sample_buffer[i+3] = r6;
2212 sample_buffer[i+4] = r4;
2213 sample_buffer[i+5] = r5;
2214 }
2215 }
2216 break;
2217
2218 case 24:
2219 case 32:
2220 {
2221 unsigned int r1, r2, r3, r4, r5, r6;
2222 unsigned int *sample_buffer = (unsigned int *)data;
2223 for (i = 0; i < samples; i += 6)
2224 {
2225 r1 = sample_buffer[i];
2226 r2 = sample_buffer[i+1];
2227 r3 = sample_buffer[i+2];
2228 r4 = sample_buffer[i+3];
2229 r5 = sample_buffer[i+4];
2230 r6 = sample_buffer[i+5];
2231 sample_buffer[i] = r2;
2232 sample_buffer[i+1] = r3;
2233 sample_buffer[i+2] = r1;
2234 sample_buffer[i+3] = r6;
2235 sample_buffer[i+4] = r4;
2236 sample_buffer[i+5] = r5;
2237 }
2238 }
2239 break;
2240 }
2241 }
2242
2243 DWORD WINAPI MP4PlayThread(void *b)
2244 {
2245 int done = 0, updatepos = 0;
2246 int l;
2247 int seq_frames = 0;
2248 int seq_bytes = 0;
2249
2250 void *sample_buffer;
2251 unsigned char *buffer;
2252 int buffer_size;
2253 faacDecFrameInfo frameInfo;
2254
2255 WriteDataStruct wd;
2256
2257 #ifdef DEBUG_OUTPUT
2258 in_mp4_DebugOutput("MP4PlayThread");
2259 #endif
2260
2261 PlayThreadAlive = 1;
2262 mp4state.last_frame = 0;
2263 mp4state.initial = 1;
2264
2265 while (!*((int *)b))
2266 {
2267 /* seeking */
2268 if (mp4state.seek_needed != -1)
2269 {
2270 MP4Duration duration;
2271
2272 module.QCDCallbacks.toPlayer.OutputFlush((unsigned int)mp4state.decode_pos_ms);
2273 duration = MP4ConvertToTrackDuration(mp4state.mp4file,
2274 mp4state.mp4track, mp4state.seek_needed, MP4_MSECS_TIME_SCALE);
2275 mp4state.sampleId = MP4GetSampleIdFromTime(mp4state.mp4file,
2276 mp4state.mp4track, duration, 0);
2277
2278 mp4state.decode_pos_ms = mp4state.seek_needed;
2279 mp4state.seek_needed = -1;
2280 updatepos = 1;
2281 }
2282
2283 if (done)
2284 {
2285 if (module.QCDCallbacks.toPlayer.OutputDrain(0) && !(mp4state.seek_needed >= 0))
2286 {
2287 module.QCDCallbacks.toPlayer.OutputStop(STOPFLAG_PLAYDONE);
2288 module.QCDCallbacks.toPlayer.PlayDone(mp4state.filename);
2289 PlayThreadAlive = 0;
2290 }
2291 else if (mp4state.seek_needed >= 0)
2292 {
2293 done = 0;
2294 continue;
2295 }
2296 break;
2297 } else/* if (module.outMod->CanWrite() >= (2048*mp4state.channels*sizeof(short)))*/ {
2298
2299 if (mp4state.last_frame)
2300 {
2301 done = 1;
2302 } else {
2303 int rc;
2304
2305 /* for gapless decoding */
2306 char *buf;
2307 MP4Duration dur;
2308 unsigned int sample_count;
2309 unsigned int delay = 0;
2310
2311 /* get acces unit from MP4 file */
2312 buffer = NULL;
2313 buffer_size = 0;
2314
2315 rc = MP4ReadSample(mp4state.mp4file, mp4state.mp4track,
2316 mp4state.sampleId++, &buffer, &buffer_size,
2317 NULL, &dur, NULL, NULL);
2318 if (mp4state.sampleId-1 == 1) dur = 0;
2319 if (rc == 0 || buffer == NULL)
2320 {
2321 mp4state.last_frame = 1;
2322 sample_buffer = NULL;
2323 frameInfo.samples = 0;
2324 } else {
2325 sample_buffer = faacDecDecode(mp4state.hDecoder, &frameInfo,
2326 buffer, buffer_size);
2327 }
2328 if (frameInfo.error > 0)
2329 {
2330 show_error(module.hMainWindow, faacDecGetErrorMessage(frameInfo.error));
2331 mp4state.last_frame = 1;
2332 }
2333 if (mp4state.sampleId > mp4state.numSamples)
2334 mp4state.last_frame = 1;
2335
2336 if (buffer) free(buffer);
2337
2338 if (mp4state.useAacLength || (mp4state.timescale != mp4state.samplerate)) {
2339 sample_count = frameInfo.samples;
2340 } else {
2341 sample_count = (unsigned int)(dur * frameInfo.channels);
2342
2343 if (!mp4state.useAacLength && !mp4state.initial && (mp4state.sampleId < mp4state.numSamples/2) && (dur*frameInfo.channels != frameInfo.samples))
2344 {
2345 //fprintf(stderr, "MP4 seems to have incorrect frame duration, using values from AAC data.\n");
2346 mp4state.useAacLength = 1;
2347 sample_count = frameInfo.samples;
2348 }
2349 }
2350
2351 if (mp4state.initial && (sample_count < mp4state.framesize*mp4state.channels) && (frameInfo.samples > sample_count))
2352 {
2353 delay = frameInfo.samples - sample_count;
2354 }
2355
2356 if (!killPlayThread && (sample_count > 0))
2357 {
2358 buf = (char *)sample_buffer;
2359 mp4state.initial = 0;
2360
2361 switch (res_table[m_resolution])
2362 {
2363 case 8:
2364 buf += delay;
2365 break;
2366 case 16:
2367 default:
2368 buf += delay * 2;
2369 break;
2370 case 24:
2371 case 32:
2372 buf += delay * 4;
2373 break;
2374 case 64:
2375 buf += delay * 8;
2376 }
2377
2378 if (frameInfo.channels == 6 && frameInfo.num_lfe_channels)
2379 remap_channels(buf, sample_count, res_table[m_resolution]);
2380
2381 if (res_table[m_resolution] == 24)
2382 {
2383 /* convert libfaad output (3 bytes packed in 4) */
2384 char *temp_buffer = convert3in4to3in3(buf, sample_count);
2385 memcpy((void*)buf, (void*)temp_buffer, sample_count*3);
2386 free(temp_buffer);
2387 }
2388
2389 //module.SAAddPCMData(buf, (int)mp4state.channels, res_table[m_resolution],
2390 // mp4state.decode_pos_ms);
2391 //module.VSAAddPCMData(buf, (int)mp4state.channels, res_table[m_resolution],
2392 // mp4state.decode_pos_ms);
2393 mp4state.decode_pos_ms += (double)sample_count * 1000.0 /
2394 ((double)frameInfo.samplerate * (double)frameInfo.channels);
2395
2396 l = sample_count * res_table[m_resolution] / 8;
2397
2398 if (updatepos)
2399 {
2400 module.QCDCallbacks.toPlayer.PositionUpdate((unsigned int)mp4state.decode_pos_ms);
2401 updatepos = 0;
2402 }
2403
2404 wd.bytelen = l;
2405 wd.data = (short*)buf;
2406 wd.markerend = 0;
2407 wd.markerstart = (UINT)mp4state.decode_pos_ms;
2408 wd.bps = res_table[m_resolution];
2409 wd.nch = frameInfo.channels;
2410 wd.numsamples = sample_count/frameInfo.channels;
2411 wd.srate = frameInfo.samplerate;
2412
2413 if (!module.QCDCallbacks.toPlayer.OutputWrite(&wd))
2414 done = 1;
2415
2416 //if (module.dsp_isactive())
2417 //{
2418 // void *dsp_buffer = malloc(l*2);
2419 // memcpy(dsp_buffer, buf, l);
2420
2421 // l = module.dsp_dosamples((short*)dsp_buffer,
2422 // sample_count/frameInfo.channels,
2423 // res_table[m_resolution],
2424 // frameInfo.channels,
2425 // frameInfo.samplerate) *
2426 // (frameInfo.channels*(res_table[m_resolution]/8));
2427
2428 // module.outMod->Write(dsp_buffer, l);
2429 // if (dsp_buffer) free(dsp_buffer);
2430 //} else {
2431 // module.outMod->Write(buf, l);
2432 //}
2433
2434 /* VBR bitrate display */
2435 if (m_vbr_display)
2436 {
2437 seq_frames++;
2438 seq_bytes += frameInfo.bytesconsumed;
2439 if (seq_frames == (int)(floor((float)frameInfo.samplerate/(float)(sample_count/frameInfo.channels) + 0.5)))
2440 {
2441 ai.bitrate = (int)floor(((float)seq_bytes*8.)/1000. + 0.5) * 1000;
2442 ai.frequency = (int)floor(frameInfo.samplerate/1000. + 0.5) * 1000;
2443 ai.mode = (mp4state.channels == 2) ? 0 : 3;
2444 module.QCDCallbacks.Service(opSetAudioInfo, &ai, sizeof(AudioInfo), 0);
2445
2446 seq_frames = 0;
2447 seq_bytes = 0;
2448 }
2449 }
2450 }
2451 }
2452 }
2453
2454 Sleep(10);
2455
2456 // catch pause
2457 while (mp4state.paused && !killPlayThread)
2458 Sleep(50);
2459 }
2460
2461 PlayThreadAlive = 0;
2462
2463 return 0;
2464 }
2465
2466 void *decode_aac_frame(state *st, faacDecFrameInfo *frameInfo)
2467 {
2468 void *sample_buffer = NULL;
2469
2470 do
2471 {
2472 fill_buffer(st);
2473
2474 if (st->m_aac_bytes_into_buffer != 0)
2475 {
2476 sample_buffer = faacDecDecode(st->hDecoder, frameInfo,
2477 st->m_aac_buffer, st->m_aac_bytes_into_buffer);
2478
2479 if (st->m_header_type != 1)
2480 {
2481 if (st->last_offset < st->m_file_offset)
2482 {
2483 st->m_tail->offset = st->m_file_offset;
2484 st->m_tail->next = (struct seek_list*)malloc(sizeof(struct seek_list));
2485 st->m_tail = st->m_tail->next;
2486 st->m_tail->next = NULL;
2487 st->last_offset = st->m_file_offset;
2488 }
2489 }
2490
2491 advance_buffer(st, frameInfo->bytesconsumed);
2492 } else {
2493 break;
2494 }
2495
2496 } while (!frameInfo->samples && !frameInfo->error);
2497
2498 return sample_buffer;
2499 }
2500
2501 int aac_seek(state *st, double seconds)
2502 {
2503 int i, frames;
2504 int bread;
2505 struct seek_list *target = st->m_head;
2506
2507 if (1 /*can_seek*/ && ((st->m_header_type == 1) || (seconds < st->cur_pos_sec)))
2508 {
2509 frames = (int)(seconds*((double)st->samplerate/(double)st->framesize) + 0.5);
2510
2511 for (i = 0; i < frames; i++)
2512 {
2513 if (target->next)
2514 target = target->next;
2515 else
2516 return 0;
2517 }
2518 if (target->offset == 0 && frames > 0)
2519 return 0;
2520 fseek(st->aacfile, target->offset, SEEK_SET);
2521 st->m_file_offset = target->offset;
2522
2523 bread = fread(st->m_aac_buffer, 1, 768*6, st->aacfile);
2524 if (bread != 768*6)
2525 st->m_at_eof = 1;
2526 else
2527 st->m_at_eof = 0;
2528 st->m_aac_bytes_into_buffer = bread;
2529 st->m_aac_bytes_consumed = 0;
2530 st->m_file_offset += bread;
2531
2532 faacDecPostSeekReset(st->hDecoder, -1);
2533
2534 return 1;
2535 } else {
2536 if (seconds > st->cur_pos_sec)
2537 {
2538 faacDecFrameInfo frameInfo;
2539
2540 frames = (int)((seconds - st->cur_pos_sec)*((double)st->samplerate/(double)st->framesize));
2541
2542 if (frames > 0)
2543 {
2544 for (i = 0; i < frames; i++)
2545 {
2546 memset(&frameInfo, 0, sizeof(faacDecFrameInfo));
2547 decode_aac_frame(st, &frameInfo);
2548
2549 if (frameInfo.error || (st->m_aac_bytes_into_buffer == 0))
2550 {
2551 if (frameInfo.error)
2552 {
2553 if (faacDecGetErrorMessage(frameInfo.error) != NULL)
2554 show_error(module.hMainWindow, faacDecGetErrorMessage(frameInfo.error));
2555 }
2556 return 0;
2557 }
2558 }
2559 }
2560
2561 faacDecPostSeekReset(st->hDecoder, -1);
2562 }
2563 return 1;
2564 }
2565 }
2566
2567 DWORD WINAPI AACPlayThread(void *b)
2568 {
2569 int done = 0, updatepos = 0;
2570 int l;
2571 int seq_frames = 0;
2572 int seq_bytes = 0;
2573
2574 WriteDataStruct wd;
2575
2576 #ifdef DEBUG_OUTPUT
2577 in_mp4_DebugOutput("AACPlayThread");
2578 #endif
2579
2580 PlayThreadAlive = 1;
2581 mp4state.last_frame = 0;
2582
2583 while (!*((int *)b))
2584 {
2585 /* seeking */
2586 if (mp4state.seek_needed != -1)
2587 {
2588 double ms;
2589
2590 ms = mp4state.seek_needed/1000;
2591 if (aac_seek(&mp4state, ms)!=0)
2592 {
2593 module.QCDCallbacks.toPlayer.OutputFlush((unsigned int)mp4state.decode_pos_ms);
2594 mp4state.cur_pos_sec = ms;
2595 mp4state.decode_pos_ms = mp4state.seek_needed;
2596 }
2597 mp4state.seek_needed = -1;
2598 updatepos = 1;
2599 }
2600
2601 if (done)
2602 {
2603 if (module.QCDCallbacks.toPlayer.OutputDrain(0) && !(mp4state.seek_needed >= 0))
2604 {
2605 module.QCDCallbacks.toPlayer.OutputStop(STOPFLAG_PLAYDONE);
2606 module.QCDCallbacks.toPlayer.PlayDone(mp4state.filename);
2607 PlayThreadAlive = 0;
2608 }
2609 else if (mp4state.seek_needed >= 0)
2610 {
2611 done = 0;
2612 continue;
2613 }
2614 break;
2615 } else/* if (module.outMod->CanWrite() >= (2048*mp4state.channels*sizeof(short)))*/ {
2616 faacDecFrameInfo frameInfo;
2617 void *sample_buffer;
2618
2619 memset(&frameInfo, 0, sizeof(faacDecFrameInfo));
2620
2621 sample_buffer = decode_aac_frame(&mp4state, &frameInfo);
2622
2623 if (frameInfo.error || (mp4state.m_aac_bytes_into_buffer == 0))
2624 {
2625 if (frameInfo.error)
2626 {
2627 if (faacDecGetErrorMessage(frameInfo.error) != NULL)
2628 show_error(module.hMainWindow, faacDecGetErrorMessage(frameInfo.error));
2629 }
2630 done = 1;
2631 }
2632
2633 if (!killPlayThread && (frameInfo.samples > 0))
2634 {
2635 if (frameInfo.channels == 6 && frameInfo.num_lfe_channels)
2636 remap_channels(sample_buffer, frameInfo.samples, res_table[m_resolution]);
2637
2638 if (res_table[m_resolution] == 24)
2639 {
2640 /* convert libfaad output (3 bytes packed in 4 bytes) */
2641 char *temp_buffer = convert3in4to3in3(sample_buffer, frameInfo.samples);
2642 memcpy((void*)sample_buffer, (void*)temp_buffer, frameInfo.samples*3);
2643 free(temp_buffer);
2644 }
2645
2646 //module.SAAddPCMData(sample_buffer, (int)mp4state.channels, res_table[m_resolution],
2647 // mp4state.decode_pos_ms);
2648 //module.VSAAddPCMData(sample_buffer, (int)mp4state.channels, res_table[m_resolution],
2649 // mp4state.decode_pos_ms);
2650 mp4state.decode_pos_ms += (double)frameInfo.samples * 1000.0 /
2651 ((double)frameInfo.samplerate* (double)frameInfo.channels);
2652
2653 l = frameInfo.samples * res_table[m_resolution] / 8;
2654
2655 if (updatepos)
2656 {
2657 module.QCDCallbacks.toPlayer.PositionUpdate((unsigned int)mp4state.decode_pos_ms);
2658 updatepos = 0;
2659 }
2660
2661 wd.bytelen = l;
2662 wd.data = (short*)sample_buffer;
2663 wd.markerend = 0;
2664 wd.markerstart = (UINT)mp4state.decode_pos_ms;
2665 wd.bps = res_table[m_resolution];
2666 wd.nch = frameInfo.channels;
2667 wd.numsamples = frameInfo.samples/frameInfo.channels;
2668 wd.srate = frameInfo.samplerate;
2669
2670 if (!module.QCDCallbacks.toPlayer.OutputWrite(&wd))
2671 done = 1;
2672
2673 //if (module.dsp_isactive())
2674 //{
2675 // void *dsp_buffer = malloc(l*2);
2676 // memcpy(dsp_buffer, sample_buffer, l);
2677
2678 // l = module.dsp_dosamples((short*)dsp_buffer,
2679 // frameInfo.samples/frameInfo.channels,
2680 // res_table[m_resolution],
2681 // frameInfo.channels,
2682 // frameInfo.samplerate) *
2683 // (frameInfo.channels*(res_table[m_resolution]/8));
2684
2685 // module.outMod->Write(dsp_buffer, l);
2686 // if (dsp_buffer) free(dsp_buffer);
2687 //} else {
2688 // module.outMod->Write(sample_buffer, l);
2689 //}
2690
2691 /* VBR bitrate display */
2692 if (m_vbr_display)
2693 {
2694 seq_frames++;
2695 seq_bytes += frameInfo.bytesconsumed;
2696 if (seq_frames == (int)(floor((float)frameInfo.samplerate/(float)(frameInfo.samples/frameInfo.channels) + 0.5)))
2697 {
2698 ai.bitrate = (int)floor(((float)seq_bytes*8.)/1000. + 0.5) * 1000;
2699 ai.frequency = (int)floor(frameInfo.samplerate/1000. + 0.5) * 1000;
2700 ai.mode = (mp4state.channels == 2) ? 0 : 3;
2701 module.QCDCallbacks.Service(opSetAudioInfo, &ai, sizeof(AudioInfo), 0);
2702
2703 seq_frames = 0;
2704 seq_bytes = 0;
2705 }
2706 }
2707 }
2708
2709 if (frameInfo.channels > 0 && mp4state.samplerate > 0)
2710 mp4state.cur_pos_sec += ((double)(frameInfo.samples/frameInfo.channels))/(double)mp4state.samplerate;
2711 }
2712
2713 Sleep(10);
2714
2715 // catch pause
2716 while (mp4state.paused && !killPlayThread)
2717 Sleep(50);
2718 }
2719
2720 PlayThreadAlive = 0;
2721
2722 return 0;
2723 }
2724
2725 //-----------------------------------------------------------------------------
2726
2727 int WINAPI DllMain(HINSTANCE hInst, DWORD fdwReason, LPVOID pRes)
2728 {
2729 if (fdwReason == DLL_PROCESS_ATTACH)
2730 {
2731 module.hDllInstance = hInst;
2732 }
2733 return 1;
2734 }
2735
2736 //-----------------------------------------------------------------------------
2737
2738 PLUGIN_API QCDModInitIn* INPUTDLL_ENTRY_POINT(QCDModInitIn *ModInit, QCDModInfo *ModInfo)
2739 {
2740 module.QCDCallbacks.size = sizeof(QCDModInitIn);
2741 module.QCDCallbacks.version = PLUGIN_API_VERSION;
2742 module.QCDCallbacks.toModule.Initialize = Initialize;
2743 module.QCDCallbacks.toModule.ShutDown = ShutDown;
2744 module.QCDCallbacks.toModule.GetTrackExtents = GetTrackExtents;
2745 module.QCDCallbacks.toModule.GetMediaSupported = GetMediaSupported;
2746 module.QCDCallbacks.toModule.Play = Play;
2747 module.QCDCallbacks.toModule.Pause = Pause;
2748 module.QCDCallbacks.toModule.Stop = Stop;
2749 module.QCDCallbacks.toModule.About = About;
2750 module.QCDCallbacks.toModule.Configure = Configure;
2751 module.QCDCallbacks.toModule.SetEQ = NULL;
2752 module.QCDCallbacks.toModule.SetVolume = SetVolume;
2753
2754 return &module.QCDCallbacks;
2755 }
2756
2757 ///* new Media Library interface */
2758 //
2759 //int mp4_get_metadata(MP4FileHandle file, const char *item, char *dest, int dlen)
2760 //{
2761 // char *pVal = NULL, dummy1[4096];
2762 // short dummy = 0, dummy2 = 0;
2763 //
2764 // if (dlen < 1) return 0;
2765 //
2766 // if (!stricmp(item, "track") || !stricmp(item, "tracknumber"))
2767 // {
2768 // if (MP4GetMetadataTrack(file, &dummy, &dummy2))
2769 // {
2770 // wsprintf(dummy1, "%d", (int)dummy);
2771 // strncpy(dest, dummy1, dlen-1);
2772 // dest[dlen-1] = '\0';
2773 // return 1;
2774 // }
2775 // }
2776 // else if (!stricmp(item, "disc") || !stricmp(item, "disknumber"))
2777 // {
2778 // if (MP4GetMetadataDisk(file, &dummy, &dummy2))
2779 // {
2780 // wsprintf(dummy1, "%d", (int)dummy);
2781 // strncpy(dest, dummy1, dlen-1);
2782 // dest[dlen-1] = '\0';
2783 // return 1;
2784 // }
2785 // }
2786 // else if (!stricmp(item, "compilation"))
2787 // {
2788 // u_int8_t cpil = 0;
2789 // if (MP4GetMetadataCompilation(file, &cpil))
2790 // {
2791 // wsprintf(dummy1, "%d", (int)cpil);
2792 // strncpy(dest, dummy1, dlen-1);
2793 // dest[dlen-1] = '\0';
2794 // return 1;
2795 // }
2796 // }
2797 // else if (!stricmp(item, "tempo"))
2798 // {
2799 // u_int16_t tempo = 0;
2800 // if (MP4GetMetadataTempo(file, &tempo))
2801 // {
2802 // wsprintf(dummy1, "%d", (int)tempo);
2803 // strncpy(dest, dummy1, dlen-1);
2804 // dest[dlen-1] = '\0';
2805 // return 1;
2806 // }
2807 // }
2808 // else if (!stricmp(item, "artist"))
2809 // {
2810 // if (MP4GetMetadataArtist(file, &pVal))
2811 // {
2812 // strncpy(dest, pVal, dlen-1);
2813 // dest[dlen-1] = '\0';
2814 // return 1;
2815 // }
2816 // }
2817 // else if (!stricmp(item, "writer"))
2818 // {
2819 // if (MP4GetMetadataWriter(file, &pVal))
2820 // {
2821 // strncpy(dest, pVal, dlen-1);
2822 // dest[dlen-1] = '\0';
2823 // return 1;
2824 // }
2825 // }
2826 // else if (!stricmp(item, "title"))
2827 // {
2828 // if (MP4GetMetadataName(file, &pVal))
2829 // {
2830 // strncpy(dest, pVal, dlen-1);
2831 // dest[dlen-1] = '\0';
2832 // return 1;
2833 // }
2834 // }
2835 // else if (!stricmp(item, "album"))
2836 // {
2837 // if (MP4GetMetadataAlbum(file, &pVal))
2838 // {
2839 // strncpy(dest, pVal, dlen-1);
2840 // dest[dlen-1] = '\0';
2841 // return 1;
2842 // }
2843 // }
2844 // else if (!stricmp(item, "date") || !stricmp(item, "year"))
2845 // {
2846 // if (MP4GetMetadataYear(file, &pVal))
2847 // {
2848 // strncpy(dest, pVal, dlen-1);
2849 // dest[dlen-1] = '\0';
2850 // return 1;
2851 // }
2852 // }
2853 // else if (!stricmp(item, "comment"))
2854 // {
2855 // if (MP4GetMetadataComment(file, &pVal))
2856 // {
2857 // strncpy(dest, pVal, dlen-1);
2858 // dest[dlen-1] = '\0';
2859 // return 1;
2860 // }
2861 // }
2862 // else if (!stricmp(item, "genre"))
2863 // {
2864 // if (MP4GetMetadataGenre(file, &pVal))
2865 // {
2866 // strncpy(dest, pVal, dlen-1);
2867 // dest[dlen-1] = '\0';
2868 // return 1;
2869 // }
2870 // }
2871 // else if (!stricmp(item, "tool"))
2872 // {
2873 // if (MP4GetMetadataTool(file, &pVal))
2874 // {
2875 // strncpy(dest, pVal, dlen-1);
2876 // dest[dlen-1] = '\0';
2877 // return 1;
2878 // }
2879 // }
2880 // else
2881 // {
2882 // u_int32_t valueSize = 0;
2883 // u_int8_t *pValue = NULL;
2884 //
2885 // if (MP4GetMetadataFreeForm(file, (char *)item, &pValue, &valueSize))
2886 // {
2887 // unsigned int len = (valueSize < (unsigned int)(dlen-1)) ? valueSize : (unsigned int)(dlen-1);
2888 // memcpy(dest, pValue, len);
2889 // dest[len] = '\0';
2890 // return 1;
2891 // }
2892 // }
2893 //
2894 // return 0;
2895 //}
2896 //
2897 //__declspec(dllexport) int winampGetExtendedFileInfo(const char *fn, const char *data, char *dest, int destlen)
2898 //{
2899 // if (!fn || (fn && !*fn) || !destlen) return 0;
2900 //
2901 // dest[0] = '\0';
2902 //
2903 // if (!stricmp(data, "length"))
2904 // {
2905 // char temp[32];
2906 // int len = getsonglength(fn);
2907 // itoa(len, temp, 10);
2908 // strncpy(dest, temp, destlen-1);
2909 // dest[destlen-1] = '\0';
2910 // }
2911 // else
2912 // {
2913 // char temp[2048], temp2[2048];
2914 // MP4FileHandle file = MP4Read(fn, 0);
2915 // if (file == MP4_INVALID_FILE_HANDLE) return 0;
2916 //
2917 // if (mp4_get_metadata(file, data, temp, sizeof(temp)))
2918 // {
2919 // int len = ConvertUTF8ToANSI(temp, temp2);
2920 // if (len > destlen-1) len = destlen-1;
2921 // memcpy(dest, temp2, len);
2922 // dest[len] = '\0';
2923 // }
2924 //
2925 // MP4Close(file);
2926 // }
2927 //
2928 // return 1;
2929 //}
2930 //
2931 //static struct medialib_tags mltags = {0, 0};
2932 //static BOOL medialib_init = FALSE;
2933 //static char medialib_lastfn[2048] = "";
2934 //
2935 //__declspec(dllexport) int winampSetExtendedFileInfo(const char *fn, const char *data, char *val)
2936 //{
2937 // int len, ret = 0;
2938 // char *temp;
2939 //
2940 // if (!medialib_init || (medialib_init && stricmp(fn, medialib_lastfn))) {
2941 // MP4FileHandle file;
2942 // strcpy(medialib_lastfn, fn);
2943 //
2944 // if (medialib_init) tag_delete(&mltags);
2945 //
2946 // file = MP4Read(fn, 0);
2947 // if (file == MP4_INVALID_FILE_HANDLE) return 0;
2948 // ReadMP4Tag(file, &mltags);
2949 // MP4Close(file);
2950 // medialib_init = TRUE;
2951 // }
2952 //
2953 // len = strlen(val);
2954 // temp = (char *)malloc((len+1)*4);
2955 // if (!temp) return 0;
2956 //
2957 // if (ConvertANSIToUTF8(val, temp))
2958 // {
2959 // ret = 1;
2960 // tag_set_field(&mltags, data, temp);
2961 // }
2962 //
2963 // free(temp);
2964 //
2965 // return ret;
2966 //}
2967 //
2968 //__declspec(dllexport) int winampWriteExtendedFileInfo()
2969 //{
2970 // if (medialib_init)
2971 // {
2972 // MP4FileHandle file = MP4Modify(medialib_lastfn, 0, 0);
2973 // if (file == MP4_INVALID_FILE_HANDLE) return 0;
2974 //
2975 // MP4MetadataDelete(file);
2976 // MP4Close(file);
2977 //
2978 // file = MP4Modify(medialib_lastfn, 0, 0);
2979 // if (file == MP4_INVALID_FILE_HANDLE) return 0;
2980 //
2981 // WriteMP4Tag(file, &mltags);
2982 //
2983 // MP4Close(file);
2984 //
2985 // return 1;
2986 // }
2987 // else
2988 // {
2989 // return 0;
2990 // }
2991 //}
0 # Microsoft Developer Studio Project File - Name="QCDMp4" - Package Owner=<4>
1 # Microsoft Developer Studio Generated Build File, Format Version 6.00
2 # ** DO NOT EDIT **
3
4 # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
5
6 CFG=QCDMp4 - Win32 Debug
7 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
8 !MESSAGE use the Export Makefile command and run
9 !MESSAGE
10 !MESSAGE NMAKE /f "QCDMp4.mak".
11 !MESSAGE
12 !MESSAGE You can specify a configuration when running NMAKE
13 !MESSAGE by defining the macro CFG on the command line. For example:
14 !MESSAGE
15 !MESSAGE NMAKE /f "QCDMp4.mak" CFG="QCDMp4 - Win32 Debug"
16 !MESSAGE
17 !MESSAGE Possible choices for configuration are:
18 !MESSAGE
19 !MESSAGE "QCDMp4 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
20 !MESSAGE "QCDMp4 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
21 !MESSAGE
22
23 # Begin Project
24 # PROP AllowPerConfigDependencies 0
25 # PROP Scc_ProjName ""
26 # PROP Scc_LocalPath ""
27 CPP=xicl6.exe
28 MTL=midl.exe
29 RSC=rc.exe
30
31 !IF "$(CFG)" == "QCDMp4 - Win32 Release"
32
33 # PROP BASE Use_MFC 0
34 # PROP BASE Use_Debug_Libraries 0
35 # PROP BASE Output_Dir "Release"
36 # PROP BASE Intermediate_Dir "Release"
37 # PROP BASE Target_Dir ""
38 # PROP Use_MFC 0
39 # PROP Use_Debug_Libraries 0
40 # PROP Output_Dir "Release"
41 # PROP Intermediate_Dir "Release"
42 # PROP Ignore_Export_Lib 0
43 # PROP Target_Dir ""
44 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
45 # ADD CPP /nologo /MD /W3 /GX /O1 /I "..\..\include" /I "..\..\common\mp4v2" /I "..\..\common\mp4av" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
46 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
47 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
48 # ADD BASE RSC /l 0x413 /d "NDEBUG"
49 # ADD RSC /l 0x413 /d "NDEBUG"
50 BSC32=bscmake.exe
51 # ADD BASE BSC32 /nologo
52 # ADD BSC32 /nologo
53 LINK32=xilink6.exe
54 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
55 # ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
56
57 !ELSEIF "$(CFG)" == "QCDMp4 - Win32 Debug"
58
59 # PROP BASE Use_MFC 0
60 # PROP BASE Use_Debug_Libraries 1
61 # PROP BASE Output_Dir "Debug"
62 # PROP BASE Intermediate_Dir "Debug"
63 # PROP BASE Target_Dir ""
64 # PROP Use_MFC 0
65 # PROP Use_Debug_Libraries 1
66 # PROP Output_Dir "Debug"
67 # PROP Intermediate_Dir "Debug"
68 # PROP Ignore_Export_Lib 0
69 # PROP Target_Dir ""
70 # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
71 # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "..\..\common\mp4v2" /I "..\..\common\mp4av" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
72 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
73 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
74 # ADD BASE RSC /l 0x413 /d "_DEBUG"
75 # ADD RSC /l 0x413 /d "_DEBUG"
76 BSC32=bscmake.exe
77 # ADD BASE BSC32 /nologo
78 # ADD BSC32 /nologo
79 LINK32=xilink6.exe
80 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
81 # ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
82
83 !ENDIF
84
85 # Begin Target
86
87 # Name "QCDMp4 - Win32 Release"
88 # Name "QCDMp4 - Win32 Debug"
89 # Begin Group "Source Files"
90
91 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
92 # Begin Source File
93
94 SOURCE=.\aac2mp4.cpp
95 # End Source File
96 # Begin Source File
97
98 SOURCE=.\aacinfo.c
99 # End Source File
100 # Begin Source File
101
102 SOURCE=.\config.c
103 # End Source File
104 # Begin Source File
105
106 SOURCE=.\QCDMp4.c
107 # End Source File
108 # Begin Source File
109
110 SOURCE=.\QCDMp4Tag.cpp
111 # End Source File
112 # Begin Source File
113
114 SOURCE=.\utils.c
115 # End Source File
116 # End Group
117 # Begin Group "Header Files"
118
119 # PROP Default_Filter "h;hpp;hxx;hm;inl"
120 # Begin Source File
121
122 SOURCE=.\aacinfo.h
123 # End Source File
124 # Begin Source File
125
126 SOURCE=.\config.h
127 # End Source File
128 # Begin Source File
129
130 SOURCE=..\..\include\faad.h
131 # End Source File
132 # Begin Source File
133
134 SOURCE=.\QCDInputDLL.h
135 # End Source File
136 # Begin Source File
137
138 SOURCE=.\QCDModInput.h
139 # End Source File
140 # Begin Source File
141
142 SOURCE=.\QCDTagsDLL.h
143 # End Source File
144 # Begin Source File
145
146 SOURCE=.\QCDModTagEditor.h
147 # End Source File
148 # Begin Source File
149
150 SOURCE=.\QCDModDefs.h
151 # End Source File
152 # Begin Source File
153
154 SOURCE=.\utils.h
155 # End Source File
156 # End Group
157 # Begin Group "Resource Files"
158
159 # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
160 # Begin Source File
161
162 SOURCE=.\QCDMp4.rc
163 # End Source File
164 # End Group
165 # End Target
166 # End Project
0 Microsoft Developer Studio Workspace File, Format Version 6.00
1 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
2
3 ###############################################################################
4
5 Project: "QCDMp4"=.\QCDMp4.dsp - Package Owner=<4>
6
7 Package=<5>
8 {{{
9 }}}
10
11 Package=<4>
12 {{{
13 Begin Project Dependency
14 Project_Dep_Name libfaad
15 End Project Dependency
16 Begin Project Dependency
17 Project_Dep_Name libmp4v2_st
18 End Project Dependency
19 Begin Project Dependency
20 Project_Dep_Name libmp4av_st
21 End Project Dependency
22 }}}
23
24 ###############################################################################
25
26 Project: "libfaad"=..\..\libfaad\libfaad.dsp - Package Owner=<4>
27
28 Package=<5>
29 {{{
30 }}}
31
32 Package=<4>
33 {{{
34 }}}
35
36 ###############################################################################
37
38 Project: "libmp4av_st"=..\..\common\mp4av\libmp4av_st.dsp - Package Owner=<4>
39
40 Package=<5>
41 {{{
42 }}}
43
44 Package=<4>
45 {{{
46 }}}
47
48 ###############################################################################
49
50 Project: "libmp4v2_st"=..\..\common\mp4v2\libmp4v2_st60.dsp - Package Owner=<4>
51
52 Package=<5>
53 {{{
54 }}}
55
56 Package=<4>
57 {{{
58 }}}
59
60 ###############################################################################
61
62 Global:
63
64 Package=<5>
65 {{{
66 }}}
67
68 Package=<3>
69 {{{
70 }}}
71
72 ###############################################################################
73
0 // Microsoft Visual C++ generated resource script.
1 //
2 #include "resource.h"
3
4 #define APSTUDIO_READONLY_SYMBOLS
5 /////////////////////////////////////////////////////////////////////////////
6 //
7 // Generated from the TEXTINCLUDE 2 resource.
8 //
9 #include "afxres.h"
10
11 /////////////////////////////////////////////////////////////////////////////
12 #undef APSTUDIO_READONLY_SYMBOLS
13
14 /////////////////////////////////////////////////////////////////////////////
15 // 中文(中华人民共和国) resources
16
17 #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
18 #ifdef _WIN32
19 LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
20 #pragma code_page(936)
21 #endif //_WIN32
22
23 /////////////////////////////////////////////////////////////////////////////
24 //
25 // Dialog
26 //
27
28 IDD_CONFIG DIALOGEX 0, 0, 242, 93
29 STYLE DS_SETFONT | DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION |
30 WS_SYSMENU
31 CAPTION "Configuration"
32 FONT 9, "���ו", 400, 0, 0x86
33 BEGIN
34 CONTROL "Slider1",IDC_PRIORITY,"msctls_trackbar32",TBS_VERT |
35 TBS_NOTICKS | WS_TABSTOP,13,15,18,46
36 CONTROL "16 λ",IDC_16BITS,"Button",BS_AUTORADIOBUTTON,77,18,37,
37 10
38 CONTROL "16 λ¸ßƵ¶¶¶¯",IDC_16BITS_DITHERED,"Button",
39 BS_AUTORADIOBUTTON | WS_DISABLED,77,29,64,10
40 CONTROL "24 λ",IDC_24BITS,"Button",BS_AUTORADIOBUTTON,77,40,37,
41 10
42 CONTROL "32 λ",IDC_32BITS,"Button",BS_AUTORADIOBUTTON,77,51,37,
43 10
44 CONTROL "向下混频到立体声",IDC_DOWNMIX,"Button",BS_AUTOCHECKBOX |
45 WS_TABSTOP,152,13,80,10
46 CONTROL "支持 AAC 格式",IDC_USEFORAAC,"Button",BS_AUTOCHECKBOX |
47 WS_TABSTOP,152,26,68,10
48 CONTROL "显示可变比特率",IDC_VBR,"Button",BS_AUTOCHECKBOX |
49 WS_TABSTOP,152,39,72,10
50 CONTROL "¤н╩Й┤ь╬зл┼¤б",IDC_ERROR,"Button",BS_AUTOCHECKBOX |
51 WS_TABSTOP,152,52,64,10
52 DEFPUSHBUTTON "È·¶¨",IDOK,185,72,50,14
53 PUSHBUTTON "È¡Ïû",IDCANCEL,127,72,50,14
54 GROUPBOX "сеох╪╤",IDC_STATIC,7,7,57,58
55 LTEXT "¸ß",IDC_STATIC,34,18,25,8
56 LTEXT "±ê×¼",IDC_STATIC,34,35,23,8
57 LTEXT "ตอ",IDC_STATIC,34,52,24,8
58 GROUPBOX "½âÎö¶È",IDC_STATIC,71,7,73,58
59 END
60
61
62 /////////////////////////////////////////////////////////////////////////////
63 //
64 // DESIGNINFO
65 //
66
67 #ifdef APSTUDIO_INVOKED
68 GUIDELINES DESIGNINFO
69 BEGIN
70 IDD_CONFIG, DIALOG
71 BEGIN
72 LEFTMARGIN, 7
73 RIGHTMARGIN, 235
74 TOPMARGIN, 7
75 BOTTOMMARGIN, 86
76 END
77 END
78 #endif // APSTUDIO_INVOKED
79
80 #endif // 中文(中华人民共和国) resources
81 /////////////////////////////////////////////////////////////////////////////
82
83
84 /////////////////////////////////////////////////////////////////////////////
85 // ∫…¿º”Ô(∫…¿º) resources
86
87 #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLD)
88 #ifdef _WIN32
89 LANGUAGE LANG_DUTCH, SUBLANG_DUTCH
90 #pragma code_page(1252)
91 #endif //_WIN32
92
93 #ifdef APSTUDIO_INVOKED
94 /////////////////////////////////////////////////////////////////////////////
95 //
96 // TEXTINCLUDE
97 //
98
99 1 TEXTINCLUDE
100 BEGIN
101 "resource.h\0"
102 END
103
104 2 TEXTINCLUDE
105 BEGIN
106 "#include ""afxres.h""\r\n"
107 "\0"
108 END
109
110 3 TEXTINCLUDE
111 BEGIN
112 "\r\n"
113 "\0"
114 END
115
116 #endif // APSTUDIO_INVOKED
117
118
119 /////////////////////////////////////////////////////////////////////////////
120 //
121 // Dialog
122 //
123
124 IDD_CONFIG DIALOGEX 0, 0, 233, 93
125 STYLE DS_SETFONT | DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION |
126 WS_SYSMENU
127 CAPTION "Configuration"
128 FONT 8, "MS Sans Serif", 0, 0, 0x0
129 BEGIN
130 CONTROL "Slider1",IDC_PRIORITY,"msctls_trackbar32",TBS_VERT |
131 TBS_NOTICKS | WS_TABSTOP,13,15,18,46
132 CONTROL "16 bits",IDC_16BITS,"Button",BS_AUTORADIOBUTTON,77,18,
133 37,10
134 CONTROL "16 bits dithered",IDC_16BITS_DITHERED,"Button",
135 BS_AUTORADIOBUTTON | WS_DISABLED,77,29,64,10
136 CONTROL "24 bits",IDC_24BITS,"Button",BS_AUTORADIOBUTTON,77,40,
137 37,10
138 CONTROL "32 bits",IDC_32BITS,"Button",BS_AUTORADIOBUTTON,77,51,
139 37,10
140 CONTROL "Downmix to stereo",IDC_DOWNMIX,"Button",BS_AUTOCHECKBOX |
141 WS_TABSTOP,152,13,74,10
142 CONTROL "Use for AAC",IDC_USEFORAAC,"Button",BS_AUTOCHECKBOX |
143 WS_TABSTOP,152,26,55,10
144 CONTROL "VBR Display",IDC_VBR,"Button",BS_AUTOCHECKBOX |
145 WS_TABSTOP,152,39,55,10
146 CONTROL "Show errors",IDC_ERROR,"Button",BS_AUTOCHECKBOX |
147 WS_TABSTOP,152,52,53,10
148 DEFPUSHBUTTON "OK",IDOK,176,72,50,14
149 PUSHBUTTON "Cancel",IDCANCEL,115,72,50,14
150 GROUPBOX "Priority",IDC_STATIC,7,7,57,58
151 LTEXT "Highest",IDC_STATIC,34,18,25,8
152 LTEXT "Normal",IDC_STATIC,34,35,23,8
153 LTEXT "Lowest",IDC_STATIC,34,52,24,8
154 GROUPBOX "Resolution",IDC_STATIC,71,7,73,58
155 END
156
157
158 /////////////////////////////////////////////////////////////////////////////
159 //
160 // DESIGNINFO
161 //
162
163 #ifdef APSTUDIO_INVOKED
164 GUIDELINES DESIGNINFO
165 BEGIN
166 IDD_CONFIG, DIALOG
167 BEGIN
168 LEFTMARGIN, 7
169 RIGHTMARGIN, 226
170 TOPMARGIN, 7
171 BOTTOMMARGIN, 86
172 END
173 END
174 #endif // APSTUDIO_INVOKED
175
176 #endif // ∫…¿º”Ô(∫…¿º) resources
177 /////////////////////////////////////////////////////////////////////////////
178
179
180
181 #ifndef APSTUDIO_INVOKED
182 /////////////////////////////////////////////////////////////////////////////
183 //
184 // Generated from the TEXTINCLUDE 3 resource.
185 //
186
187
188 /////////////////////////////////////////////////////////////////////////////
189 #endif // not APSTUDIO_INVOKED
190
0 Microsoft Visual Studio Solution File, Format Version 8.00
1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QCDMp4", "QCDMp4.vcproj", "{2D8F479D-A591-4502-9456-398425D5F834}"
2 ProjectSection(ProjectDependencies) = postProject
3 {2398BB2F-FFF9-490B-B4CC-863F2D21AE46} = {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}
4 {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49} = {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}
5 {82CAD808-21AF-40A6-92EC-AE01AA67B413} = {82CAD808-21AF-40A6-92EC-AE01AA67B413}
6 EndProjectSection
7 EndProject
8 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "..\..\libfaad\libfaad.vcproj", "{82CAD808-21AF-40A6-92EC-AE01AA67B413}"
9 ProjectSection(ProjectDependencies) = postProject
10 EndProjectSection
11 EndProject
12 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmp4v2_st", "..\..\common\mp4v2\libmp4v2_st60.vcproj", "{2398BB2F-FFF9-490B-B4CC-863F2D21AE46}"
13 ProjectSection(ProjectDependencies) = postProject
14 EndProjectSection
15 EndProject
16 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmp4av_st", "..\..\common\mp4av\libmp4av_st.vcproj", "{8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}"
17 ProjectSection(ProjectDependencies) = postProject
18 EndProjectSection
19 EndProject
20 Global
21 GlobalSection(SolutionConfiguration) = preSolution
22 Debug = Debug
23 Release = Release
24 EndGlobalSection
25 GlobalSection(ProjectConfiguration) = postSolution
26 {2D8F479D-A591-4502-9456-398425D5F834}.Debug.ActiveCfg = Debug|Win32
27 {2D8F479D-A591-4502-9456-398425D5F834}.Debug.Build.0 = Debug|Win32
28 {2D8F479D-A591-4502-9456-398425D5F834}.Release.ActiveCfg = Release|Win32
29 {2D8F479D-A591-4502-9456-398425D5F834}.Release.Build.0 = Release|Win32
30 {82CAD808-21AF-40A6-92EC-AE01AA67B413}.Debug.ActiveCfg = Debug|Win32
31 {82CAD808-21AF-40A6-92EC-AE01AA67B413}.Debug.Build.0 = Debug|Win32
32 {82CAD808-21AF-40A6-92EC-AE01AA67B413}.Release.ActiveCfg = Release|Win32
33 {82CAD808-21AF-40A6-92EC-AE01AA67B413}.Release.Build.0 = Release|Win32
34 {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}.Debug.ActiveCfg = Debug|Win32
35 {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}.Debug.Build.0 = Debug|Win32
36 {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}.Release.ActiveCfg = Release|Win32
37 {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}.Release.Build.0 = Release|Win32
38 {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}.Debug.ActiveCfg = Debug|Win32
39 {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}.Debug.Build.0 = Debug|Win32
40 {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}.Release.ActiveCfg = Release|Win32
41 {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}.Release.Build.0 = Release|Win32
42 EndGlobalSection
43 GlobalSection(ExtensibilityGlobals) = postSolution
44 EndGlobalSection
45 GlobalSection(ExtensibilityAddIns) = postSolution
46 EndGlobalSection
47 EndGlobal
0 <?xml version="1.0" encoding="Windows-1252"?>
1 <VisualStudioProject
2 ProjectType="Visual C++"
3 Version="7.10"
4 Name="QCDMp4"
5 SccProjectName=""
6 SccLocalPath="">
7 <Platforms>
8 <Platform
9 Name="Win32"/>
10 </Platforms>
11 <Configurations>
12 <Configuration
13 Name="Debug|Win32"
14 OutputDirectory=".\Debug"
15 IntermediateDirectory=".\Debug"
16 ConfigurationType="2"
17 UseOfMFC="0"
18 ATLMinimizesCRunTimeLibraryUsage="FALSE">
19 <Tool
20 Name="VCCLCompilerTool"
21 Optimization="0"
22 AdditionalIncludeDirectories="..\..\include,..\..\common\mp4v2,..\..\common\mp4av"
23 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
24 BasicRuntimeChecks="0"
25 RuntimeLibrary="1"
26 UsePrecompiledHeader="2"
27 PrecompiledHeaderFile=".\Debug/QCDMp4.pch"
28 AssemblerListingLocation=".\Debug/"
29 ObjectFile=".\Debug/"
30 ProgramDataBaseFileName=".\Debug/"
31 WarningLevel="3"
32 SuppressStartupBanner="TRUE"
33 DebugInformationFormat="4"
34 CompileAs="0"/>
35 <Tool
36 Name="VCCustomBuildTool"/>
37 <Tool
38 Name="VCLinkerTool"
39 AdditionalOptions="/MACHINE:I386"
40 AdditionalDependencies="ws2_32.lib odbc32.lib odbccp32.lib"
41 OutputFile=".\Debug/QCDMp4.dll"
42 LinkIncremental="2"
43 SuppressStartupBanner="TRUE"
44 GenerateDebugInformation="TRUE"
45 ProgramDatabaseFile=".\Debug/QCDMp4.pdb"
46 SubSystem="2"
47 ImportLibrary=".\Debug/QCDMp4.lib"/>
48 <Tool
49 Name="VCMIDLTool"
50 PreprocessorDefinitions="_DEBUG"
51 MkTypLibCompatible="TRUE"
52 SuppressStartupBanner="TRUE"
53 TargetEnvironment="1"
54 TypeLibraryName=".\Debug/QCDMp4.tlb"/>
55 <Tool
56 Name="VCPostBuildEventTool"/>
57 <Tool
58 Name="VCPreBuildEventTool"/>
59 <Tool
60 Name="VCPreLinkEventTool"/>
61 <Tool
62 Name="VCResourceCompilerTool"
63 PreprocessorDefinitions="_DEBUG"
64 Culture="1043"/>
65 <Tool
66 Name="VCWebServiceProxyGeneratorTool"/>
67 <Tool
68 Name="VCXMLDataGeneratorTool"/>
69 <Tool
70 Name="VCWebDeploymentTool"/>
71 <Tool
72 Name="VCManagedWrapperGeneratorTool"/>
73 <Tool
74 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
75 </Configuration>
76 <Configuration
77 Name="Release|Win32"
78 OutputDirectory=".\Release"
79 IntermediateDirectory=".\Release"
80 ConfigurationType="2"
81 UseOfMFC="0"
82 ATLMinimizesCRunTimeLibraryUsage="FALSE">
83 <Tool
84 Name="VCCLCompilerTool"
85 Optimization="1"
86 GlobalOptimizations="TRUE"
87 InlineFunctionExpansion="1"
88 EnableIntrinsicFunctions="TRUE"
89 FavorSizeOrSpeed="1"
90 OptimizeForProcessor="2"
91 AdditionalIncludeDirectories="..\..\include,..\..\common\mp4v2,..\..\common\mp4av"
92 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
93 StringPooling="TRUE"
94 RuntimeLibrary="2"
95 EnableFunctionLevelLinking="TRUE"
96 UsePrecompiledHeader="2"
97 PrecompiledHeaderFile=".\Release/QCDMp4.pch"
98 AssemblerListingLocation=".\Release/"
99 ObjectFile=".\Release/"
100 ProgramDataBaseFileName=".\Release/"
101 WarningLevel="3"
102 SuppressStartupBanner="TRUE"
103 CompileAs="0"/>
104 <Tool
105 Name="VCCustomBuildTool"/>
106 <Tool
107 Name="VCLinkerTool"
108 AdditionalOptions="/MACHINE:I386"
109 AdditionalDependencies="ws2_32.lib"
110 OutputFile=".\Release/QCDMp4.dll"
111 LinkIncremental="1"
112 SuppressStartupBanner="TRUE"
113 IgnoreDefaultLibraryNames=""
114 ProgramDatabaseFile=".\Release/QCDMp4.pdb"
115 SubSystem="2"
116 ImportLibrary=".\Release/QCDMp4.lib"/>
117 <Tool
118 Name="VCMIDLTool"
119 PreprocessorDefinitions="NDEBUG"
120 MkTypLibCompatible="TRUE"
121 SuppressStartupBanner="TRUE"
122 TargetEnvironment="1"
123 TypeLibraryName=".\Release/QCDMp4.tlb"/>
124 <Tool
125 Name="VCPostBuildEventTool"/>
126 <Tool
127 Name="VCPreBuildEventTool"/>
128 <Tool
129 Name="VCPreLinkEventTool"/>
130 <Tool
131 Name="VCResourceCompilerTool"
132 PreprocessorDefinitions="NDEBUG"
133 Culture="1043"/>
134 <Tool
135 Name="VCWebServiceProxyGeneratorTool"/>
136 <Tool
137 Name="VCXMLDataGeneratorTool"/>
138 <Tool
139 Name="VCWebDeploymentTool"/>
140 <Tool
141 Name="VCManagedWrapperGeneratorTool"/>
142 <Tool
143 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
144 </Configuration>
145 </Configurations>
146 <References>
147 </References>
148 <Files>
149 <Filter
150 Name="Source Files"
151 Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
152 <File
153 RelativePath=".\config.c">
154 </File>
155 <File
156 RelativePath=".\QCDMp4.c">
157 </File>
158 <File
159 RelativePath=".\QCDMp4Tag.cpp">
160 </File>
161 <File
162 RelativePath=".\utils.c">
163 </File>
164 </Filter>
165 <Filter
166 Name="Header Files"
167 Filter="h;hpp;hxx;hm;inl">
168 <File
169 RelativePath=".\config.h">
170 </File>
171 <File
172 RelativePath="..\..\include\faad.h">
173 </File>
174 <File
175 RelativePath=".\QCDInputDLL.h">
176 </File>
177 <File
178 RelativePath=".\QCDModDefs.h">
179 </File>
180 <File
181 RelativePath=".\QCDModInput.h">
182 </File>
183 <File
184 RelativePath=".\QCDModTagEditor.h">
185 </File>
186 <File
187 RelativePath=".\QCDTagsDLL.h">
188 </File>
189 <File
190 RelativePath="resource.h">
191 </File>
192 <File
193 RelativePath=".\utils.h">
194 </File>
195 </Filter>
196 <Filter
197 Name="Resource Files"
198 Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
199 <File
200 RelativePath=".\QCDMp4.rc">
201 </File>
202 </Filter>
203 </Files>
204 <Globals>
205 </Globals>
206 </VisualStudioProject>
0 #include <mp4.h>
1 #include <faad.h>
2 #include "QCDTagsDLL.h"
3
4
5 //..............................................................................
6 // Global Variables
7
8 typedef struct tag
9 {
10 char *item;
11 char *value;
12 } tag;
13
14 typedef struct medialib_tags
15 {
16 struct tag *tags;
17 unsigned int count;
18 } medialib_tags;
19
20 int tag_add_field(medialib_tags *tags, const char *item, const char *value)
21 {
22 void *backup = (void *)tags->tags;
23
24 if (!item || (item && !*item) || !value) return 0;
25
26 tags->tags = (struct tag *)realloc(tags->tags, (tags->count+1) * sizeof(tag));
27 if (!tags->tags) {
28 if (backup) free(backup);
29 return 0;
30 }
31 else
32 {
33 int i_len = strlen(item);
34 int v_len = strlen(value);
35
36 tags->tags[tags->count].item = (char *)malloc(i_len+1);
37 tags->tags[tags->count].value = (char *)malloc(v_len+1);
38
39 if (!tags->tags[tags->count].item || !tags->tags[tags->count].value)
40 {
41 if (!tags->tags[tags->count].item) free (tags->tags[tags->count].item);
42 if (!tags->tags[tags->count].value) free (tags->tags[tags->count].value);
43 tags->tags[tags->count].item = NULL;
44 tags->tags[tags->count].value = NULL;
45 return 0;
46 }
47
48 memcpy(tags->tags[tags->count].item, item, i_len);
49 memcpy(tags->tags[tags->count].value, value, v_len);
50 tags->tags[tags->count].item[i_len] = '\0';
51 tags->tags[tags->count].value[v_len] = '\0';
52
53 tags->count++;
54 return 1;
55 }
56 }
57
58 int tag_set_field(medialib_tags *tags, const char *item, const char *value)
59 {
60 unsigned int i;
61
62 if (!item || (item && !*item) || !value) return 0;
63
64 for (i = 0; i < tags->count; i++)
65 {
66 if (!stricmp(tags->tags[i].item, item))
67 {
68 void *backup = (void *)tags->tags[i].value;
69 int v_len = strlen(value);
70
71 tags->tags[i].value = (char *)realloc(tags->tags[i].value, v_len+1);
72 if (!tags->tags[i].value)
73 {
74 if (backup) free(backup);
75 return 0;
76 }
77
78 memcpy(tags->tags[i].value, value, v_len);
79 tags->tags[i].value[v_len] = '\0';
80
81 return 1;
82 }
83 }
84
85 return tag_add_field(tags, item, value);
86 }
87
88 void tag_delete(medialib_tags *tags)
89 {
90 unsigned int i;
91
92 for (i = 0; i < tags->count; i++)
93 {
94 if (tags->tags[i].item) free(tags->tags[i].item);
95 if (tags->tags[i].value) free(tags->tags[i].value);
96 }
97
98 if (tags->tags) free(tags->tags);
99
100 tags->tags = NULL;
101 tags->count = 0;
102 }
103
104 int ReadMP4Tag(MP4FileHandle file, medialib_tags *tags)
105 {
106 unsigned __int32 valueSize;
107 unsigned __int8 *pValue;
108 char *pName;
109 unsigned int i = 0;
110
111 do {
112 pName = 0;
113 pValue = 0;
114 valueSize = 0;
115
116 MP4GetMetadataByIndex(file, i, (const char **)&pName, &pValue, &valueSize);
117
118 if (valueSize > 0)
119 {
120 char *val = (char *)malloc(valueSize+1);
121 if (!val) return 0;
122 memcpy(val, pValue, valueSize);
123 val[valueSize] = '\0';
124
125 if (pName[0] == '\xa9')
126 {
127 if (memcmp(pName, "©nam", 4) == 0)
128 {
129 tag_add_field(tags, "title", val);
130 } else if (memcmp(pName, "©ART", 4) == 0) {
131 tag_add_field(tags, "artist", val);
132 } else if (memcmp(pName, "©wrt", 4) == 0) {
133 tag_add_field(tags, "writer", val);
134 } else if (memcmp(pName, "©alb", 4) == 0) {
135 tag_add_field(tags, "album", val);
136 } else if (memcmp(pName, "©day", 4) == 0) {
137 tag_add_field(tags, "date", val);
138 } else if (memcmp(pName, "©too", 4) == 0) {
139 tag_add_field(tags, "tool", val);
140 } else if (memcmp(pName, "©cmt", 4) == 0) {
141 tag_add_field(tags, "comment", val);
142 } else if (memcmp(pName, "©gen", 4) == 0) {
143 tag_add_field(tags, "genre", val);
144 } else {
145 tag_add_field(tags, pName, val);
146 }
147 } else if (memcmp(pName, "gnre", 4) == 0) {
148 char *t=0;
149 if (MP4GetMetadataGenre(file, &t))
150 {
151 tag_add_field(tags, "genre", t);
152 }
153 } else if (memcmp(pName, "trkn", 4) == 0) {
154 unsigned __int16 trkn = 0, tot = 0;
155 char t[200];
156 if (MP4GetMetadataTrack(file, &trkn, &tot))
157 {
158 if (tot > 0)
159 wsprintf(t, "%d/%d", trkn, tot);
160 else
161 wsprintf(t, "%d", trkn);
162 tag_add_field(tags, "tracknumber", t);
163 }
164 } else if (memcmp(pName, "disk", 4) == 0) {
165 unsigned __int16 disk = 0, tot = 0;
166 char t[200];
167 if (MP4GetMetadataDisk(file, &disk, &tot))
168 {
169 if (tot > 0)
170 wsprintf(t, "%d/%d", disk, tot);
171 else
172 wsprintf(t, "%d", disk);
173 tag_add_field(tags, "disc", t);
174 }
175 } else if (memcmp(pName, "cpil", 4) == 0) {
176 unsigned __int8 cpil = 0;
177 char t[200];
178 if (MP4GetMetadataCompilation(file, &cpil))
179 {
180 wsprintf(t, "%d", cpil);
181 tag_add_field(tags, "compilation", t);
182 }
183 } else if (memcmp(pName, "tmpo", 4) == 0) {
184 unsigned __int16 tempo = 0;
185 char t[200];
186 if (MP4GetMetadataTempo(file, &tempo))
187 {
188 wsprintf(t, "%d BPM", tempo);
189 tag_add_field(tags, "tempo", t);
190 }
191 } else if (memcmp(pName, "NDFL", 4) == 0) {
192 /* Removed */
193 } else {
194 tag_add_field(tags, pName, val);
195 }
196
197 free(val);
198 }
199
200 i++;
201 } while (valueSize > 0);
202
203 return 1;
204 }
205
206 int mp4_set_metadata(MP4FileHandle file, const char *item, const char *val)
207 {
208 if (!item || (item && !*item) || !val || (val && !*val)) return 0;
209
210 if (!stricmp(item, "track") || !stricmp(item, "tracknumber"))
211 {
212 unsigned __int16 trkn, tot;
213 int t1 = 0, t2 = 0;
214 sscanf(val, "%d/%d", &t1, &t2);
215 trkn = t1, tot = t2;
216 if (!trkn) return 1;
217 if (MP4SetMetadataTrack(file, trkn, tot)) return 1;
218 }
219 else if (!stricmp(item, "disc") || !stricmp(item, "disknumber"))
220 {
221 unsigned __int16 disk, tot;
222 int t1 = 0, t2 = 0;
223 sscanf(val, "%d/%d", &t1, &t2);
224 disk = t1, tot = t2;
225 if (!disk) return 1;
226 if (MP4SetMetadataDisk(file, disk, tot)) return 1;
227 }
228 else if (!stricmp(item, "compilation"))
229 {
230 unsigned __int8 cpil = atoi(val);
231 if (!cpil) return 1;
232 if (MP4SetMetadataCompilation(file, cpil)) return 1;
233 }
234 else if (!stricmp(item, "tempo"))
235 {
236 unsigned __int16 tempo = atoi(val);
237 if (!tempo) return 1;
238 if (MP4SetMetadataTempo(file, tempo)) return 1;
239 }
240 else if (!stricmp(item, "artist"))
241 {
242 if (MP4SetMetadataArtist(file, val)) return 1;
243 }
244 else if (!stricmp(item, "writer"))
245 {
246 if (MP4SetMetadataWriter(file, val)) return 1;
247 }
248 else if (!stricmp(item, "title"))
249 {
250 if (MP4SetMetadataName(file, val)) return 1;
251 }
252 else if (!stricmp(item, "album"))
253 {
254 if (MP4SetMetadataAlbum(file, val)) return 1;
255 }
256 else if (!stricmp(item, "date") || !stricmp(item, "year"))
257 {
258 if (MP4SetMetadataYear(file, val)) return 1;
259 }
260 else if (!stricmp(item, "comment"))
261 {
262 if (MP4SetMetadataComment(file, val)) return 1;
263 }
264 else if (!stricmp(item, "genre"))
265 {
266 if (MP4SetMetadataGenre(file, val)) return 1;
267 }
268 else if (!stricmp(item, "tool"))
269 {
270 if (MP4SetMetadataTool(file, val)) return 1;
271 }
272 else
273 {
274 if (MP4SetMetadataFreeForm(file, (char *)item, (u_int8_t *)val, (u_int32_t)strlen(val) + 1)) return 1;
275 }
276
277 return 0;
278 }
279
280 void WriteMP4Tag(MP4FileHandle file, const medialib_tags *tags)
281 {
282 unsigned int i;
283
284 for (i = 0; i < tags->count; i++)
285 {
286 const char *item = tags->tags[i].item;
287 const char *value = tags->tags[i].value;
288
289 if (value && *value)
290 {
291 mp4_set_metadata(file, item, value);
292 }
293 }
294 }
295
296 QCDModInitTag ModInitTag;
297
298 medialib_tags tags;
299
300 BOOL uSetDlgItemText(void *tagHandle, int fieldId, const char *str);
301 UINT uGetDlgItemText(void *tagHandle, int fieldId, char *str, int max);
302
303 //------------------------------------------------------------------------------
304
305 PLUGIN_API QCDModInitTag* TAGEDITORDLL_ENTRY_POINT()
306 {
307 ModInitTag.size = sizeof(QCDModInitTag);
308 ModInitTag.version = PLUGIN_API_VERSION;
309 ModInitTag.ShutDown = ShutDown_Tag;
310
311 ModInitTag.Read = Read_Tag;
312 ModInitTag.Write = Write_Tag; // Leave null for operations that plugin does not support
313 ModInitTag.Strip = Strip_Tag; // ie: if plugin only reads tags, leave Write and Strip null
314
315 ModInitTag.description = "MP4 Tags";
316 ModInitTag.defaultexts = "MP4:M4A";
317
318 return &ModInitTag;
319 }
320
321 //-----------------------------------------------------------------------------
322
323 void ShutDown_Tag(int flags)
324 {
325 // TODO:
326 // prepare plugin to be unloaded. All allocations should be freed.
327 // flags param is unused
328 tag_delete(&tags);
329 }
330
331 //-----------------------------------------------------------------------------
332
333 bool Read_Tag(LPCSTR filename, void* tagHandle)
334 {
335 // TODO:
336 // read metadata from tag and set each field to tagHandle
337 // only TAGFIELD_* are supported (see QCDModTagEditor.h)
338
339 // example of how to set value to tagHandle
340 // use SetFieldA for ASCII or MultiBytes strings.
341 // use SetFieldW for UNICODE strings
342 //
343 // ModInitTag.SetFieldW(tagHandle, TAGFIELD_COMPOSER, szwValue);
344
345 // return true for successfull read, false for failure
346
347 MP4FileHandle file = MP4_INVALID_FILE_HANDLE;
348 char *pVal, dummy1[1024];
349 short dummy, dummy2;
350 u_int32_t valueSize = 0;
351
352 #ifdef DEBUG_OUTPUT
353 in_mp4_DebugOutput("mp4_tag_read");
354 #endif
355
356 file = MP4Read(filename, 0);
357
358 if (file == MP4_INVALID_FILE_HANDLE)
359 return false;
360
361 /* get Metadata */
362
363 pVal = NULL;
364 MP4GetMetadataName(file, &pVal);
365 uSetDlgItemText(tagHandle, TAGFIELD_TITLE, pVal);
366
367 pVal = NULL;
368 MP4GetMetadataArtist(file, &pVal);
369 uSetDlgItemText(tagHandle, TAGFIELD_ARTIST, pVal);
370
371 pVal = NULL;
372 MP4GetMetadataWriter(file, &pVal);
373 uSetDlgItemText(tagHandle, TAGFIELD_COMPOSER, pVal);
374
375 pVal = NULL;
376 MP4GetMetadataComment(file, &pVal);
377 uSetDlgItemText(tagHandle, TAGFIELD_COMMENT, pVal);
378
379 pVal = NULL;
380 MP4GetMetadataAlbum(file, &pVal);
381 uSetDlgItemText(tagHandle, TAGFIELD_ALBUM, pVal);
382
383 pVal = NULL;
384 MP4GetMetadataGenre(file, &pVal);
385 uSetDlgItemText(tagHandle, TAGFIELD_GENRE, pVal);
386
387 //dummy = 0;
388 //MP4GetMetadataTempo(file, &dummy);
389 //if (dummy)
390 //{
391 // wsprintf(dummy1, "%d", dummy);
392 // SetDlgItemText(hwndDlg,IDC_METATEMPO, dummy1);
393 //}
394
395 dummy = 0; dummy2 = 0;
396 MP4GetMetadataTrack(file, (unsigned __int16*)&dummy, (unsigned __int16*)&dummy2);
397 if (dummy)
398 {
399 wsprintf(dummy1, "%d", dummy);
400 ModInitTag.SetFieldA(tagHandle, TAGFIELD_TRACK, dummy1);
401 }
402 //if (dumm2)
403 //{
404 // wsprintf(dummy1, "%d", dummy2);
405 // SetDlgItemText(hwndDlg,IDC_METATRACK2, dummy1);
406 //}
407
408 //dummy = 0; dummy2 = 0;
409 //MP4GetMetadataDisk(file, &dummy, &dummy2);
410 //if (dummy)
411 //{
412 // wsprintf(dummy1, "%d", dummy);
413 // SetDlgItemText(hwndDlg,IDC_METADISK1, dummy1);
414 //}
415 //if (dummy)
416 //{
417 // wsprintf(dummy1, "%d", dummy2);
418 // SetDlgItemText(hwndDlg,IDC_METADISK2, dummy1);
419 //}
420
421 pVal = NULL;
422 if (MP4GetMetadataYear(file, &pVal))
423 uSetDlgItemText(tagHandle, TAGFIELD_YEAR, pVal);
424
425 //dummy3 = 0;
426 //MP4GetMetadataCompilation(file, &dummy3);
427 //if (dummy3)
428 // SendMessage(GetDlgItem(hwndDlg, IDC_METACOMPILATION), BM_SETCHECK, BST_CHECKED, 0);
429
430 pVal = NULL;
431 MP4GetMetadataTool(file, &pVal);
432 uSetDlgItemText(tagHandle, TAGFIELD_ENCODER, pVal);
433
434 pVal = NULL;
435 MP4GetMetadataFreeForm(file, "CONDUCTOR", (unsigned __int8**)&pVal, &valueSize);
436 uSetDlgItemText(tagHandle, TAGFIELD_CONDUCTOR, pVal);
437
438 pVal = NULL;
439 MP4GetMetadataFreeForm(file, "ORCHESTRA", (unsigned __int8**)&pVal, &valueSize);
440 uSetDlgItemText(tagHandle, TAGFIELD_ORCHESTRA, pVal);
441
442 pVal = NULL;
443 MP4GetMetadataFreeForm(file, "YEARCOMPOSED", (unsigned __int8**)&pVal, &valueSize);
444 uSetDlgItemText(tagHandle, TAGFIELD_YEARCOMPOSED, pVal);
445
446 pVal = NULL;
447 MP4GetMetadataFreeForm(file, "ORIGARTIST", (unsigned __int8**)&pVal, &valueSize);
448 uSetDlgItemText(tagHandle, TAGFIELD_ORIGARTIST, pVal);
449
450 pVal = NULL;
451 MP4GetMetadataFreeForm(file, "LABEL", (unsigned __int8**)&pVal, &valueSize);
452 uSetDlgItemText(tagHandle, TAGFIELD_LABEL, pVal);
453
454 pVal = NULL;
455 MP4GetMetadataFreeForm(file, "COPYRIGHT", (unsigned __int8**)&pVal, &valueSize);
456 uSetDlgItemText(tagHandle, TAGFIELD_COPYRIGHT, pVal);
457
458 pVal = NULL;
459 MP4GetMetadataFreeForm(file, "CDDBTAGID", (unsigned __int8**)&pVal, &valueSize);
460 uSetDlgItemText(tagHandle, TAGFIELD_CDDBTAGID, pVal);
461
462 /* ! Metadata */
463
464 MP4Close(file);
465
466 return true;
467 }
468
469 //-----------------------------------------------------------------------------
470
471 bool Write_Tag(LPCSTR filename, void* tagHandle)
472 {
473 // TODO:
474 // read metadata from tagHandle and set each field to supported tag
475 // only TAGFIELD_* are supported (see QCDModTagEditor.h)
476
477 // example of how to get value from tagHandle
478 // use SetFieldA for ASCII or MultiBytes strings.
479 // use SetFieldW for UNICODE strings
480 //
481 // szwValue = ModInitTag.GetFieldW(tagHandle, TAGFIELD_ORCHESTRA);
482
483 // write tag to file
484
485 MP4FileHandle file = MP4_INVALID_FILE_HANDLE;
486 char dummy1[1024];
487 char temp[1024];
488 short dummy, dummy2;
489
490 #ifdef DEBUG_OUTPUT
491 in_mp4_DebugOutput("mp4_tag_write");
492 #endif
493
494 /* save Metadata changes */
495
496 tag_delete(&tags);
497 file = MP4Read(filename, 0);
498 if (file != MP4_INVALID_FILE_HANDLE)
499 {
500 ReadMP4Tag(file, &tags);
501 MP4Close(file);
502
503 file = MP4Modify(filename, 0, 0);
504 if (file != MP4_INVALID_FILE_HANDLE)
505 {
506 MP4MetadataDelete(file);
507 MP4Close(file);
508 }
509 }
510
511 file = MP4Modify(filename, 0, 0);
512 if (file == MP4_INVALID_FILE_HANDLE)
513 {
514 tag_delete(&tags);
515 //EndDialog(hwndDlg, wParam);
516 return false;
517 }
518
519 uGetDlgItemText(tagHandle, TAGFIELD_TITLE, dummy1, 1024);
520 tag_set_field(&tags, "title", dummy1);
521
522 uGetDlgItemText(tagHandle, TAGFIELD_COMPOSER, dummy1, 1024);
523 tag_set_field(&tags, "writer", dummy1);
524
525 uGetDlgItemText(tagHandle, TAGFIELD_ARTIST, dummy1, 1024);
526 tag_set_field(&tags, "artist", dummy1);
527
528 uGetDlgItemText(tagHandle, TAGFIELD_ALBUM, dummy1, 1024);
529 tag_set_field(&tags, "album", dummy1);
530
531 uGetDlgItemText(tagHandle, TAGFIELD_COMMENT, dummy1, 1024);
532 tag_set_field(&tags, "comment", dummy1);
533
534 uGetDlgItemText(tagHandle, TAGFIELD_GENRE, dummy1, 1024);
535 tag_set_field(&tags, "genre", dummy1);
536
537 uGetDlgItemText(tagHandle, TAGFIELD_YEAR, dummy1, 1024);
538 tag_set_field(&tags, "year", dummy1);
539
540 dummy = 0;
541 MP4GetMetadataTrack(file, (unsigned __int16*)&dummy, (unsigned __int16*)&dummy2);
542 memcpy(dummy1, ModInitTag.GetFieldA(tagHandle, TAGFIELD_TRACK), sizeof(dummy1));
543 dummy = atoi(dummy1);
544 wsprintf(temp, "%d/%d", dummy, dummy2);
545 tag_set_field(&tags, "track", temp);
546
547 //GetDlgItemText(hwndDlg, IDC_METADISK1, dummy1, 1024);
548 //dummy = atoi(dummy1);
549 //GetDlgItemText(hwndDlg, IDC_METADISK2, dummy1, 1024);
550 //dummy2 = atoi(dummy1);
551 //wsprintf(temp, "%d/%d", dummy, dummy2);
552 //tag_set_field(&tags, "disc", temp);
553
554 //GetDlgItemText(hwndDlg, IDC_METATEMPO, dummy1, 1024);
555 //tag_set_field(&tags, "tempo", dummy1);
556
557 //dummy3 = SendMessage(GetDlgItem(hwndDlg, IDC_METACOMPILATION), BM_GETCHECK, 0, 0);
558 //tag_set_field(&tags, "compilation", (dummy3 ? "1" : "0"));
559
560 uGetDlgItemText(tagHandle, TAGFIELD_ENCODER, dummy1, 1024);
561 tag_set_field(&tags, "tool", dummy1);
562
563 uGetDlgItemText(tagHandle, TAGFIELD_CONDUCTOR, dummy1, 1024);
564 tag_set_field(&tags, "CONDUCTOR", dummy1);
565
566 uGetDlgItemText(tagHandle, TAGFIELD_ORCHESTRA, dummy1, 1024);
567 tag_set_field(&tags, "ORCHESTRA", dummy1);
568
569 uGetDlgItemText(tagHandle, TAGFIELD_YEARCOMPOSED, dummy1, 1024);
570 tag_set_field(&tags, "YEARCOMPOSED", dummy1);
571
572 uGetDlgItemText(tagHandle, TAGFIELD_ORIGARTIST, dummy1, 1024);
573 tag_set_field(&tags, "ORIGARTIST", dummy1);
574
575 uGetDlgItemText(tagHandle, TAGFIELD_LABEL, dummy1, 1024);
576 tag_set_field(&tags, "LABEL", dummy1);
577
578 uGetDlgItemText(tagHandle, TAGFIELD_COPYRIGHT, dummy1, 1024);
579 tag_set_field(&tags, "COPYRIGHT", dummy1);
580
581 uGetDlgItemText(tagHandle, TAGFIELD_CDDBTAGID, dummy1, 1024);
582 tag_set_field(&tags, "CDDBTAGID", dummy1);
583
584 WriteMP4Tag(file, &tags);
585
586 MP4Close(file);
587
588 MP4Optimize(filename, NULL, 0);
589 /* ! */
590
591 return true;
592 }
593
594 //-----------------------------------------------------------------------------
595
596 bool Strip_Tag(LPCSTR filename)
597 {
598 // TODO:
599 // remove tag from file.
600 // do whatever is need to remove the supported tag from filename
601
602 // return true for successfull strip, false for failure
603
604 MP4FileHandle file;
605
606 file = MP4Modify(filename, 0, 0);
607 if (file == MP4_INVALID_FILE_HANDLE)
608 return false;
609
610 MP4MetadataDelete(file);
611
612 MP4Close(file);
613
614 return true;
615 }
616
617 //-----------------------------------------------------------------------------
618
619 /* Convert UNICODE to UTF-8
620 Return number of bytes written */
621 int unicodeToUtf8 ( const WCHAR* lpWideCharStr, char* lpMultiByteStr, int cwcChars )
622 {
623 const unsigned short* pwc = (unsigned short *)lpWideCharStr;
624 unsigned char* pmb = (unsigned char *)lpMultiByteStr;
625 const unsigned short* pwce;
626 size_t cBytes = 0;
627
628 if ( cwcChars >= 0 ) {
629 pwce = pwc + cwcChars;
630 } else {
631 pwce = (unsigned short *)((size_t)-1);
632 }
633
634 while ( pwc < pwce ) {
635 unsigned short wc = *pwc++;
636
637 if ( wc < 0x00000080 ) {
638 *pmb++ = (char)wc;
639 cBytes++;
640 } else
641 if ( wc < 0x00000800 ) {
642 *pmb++ = (char)(0xC0 | ((wc >> 6) & 0x1F));
643 cBytes++;
644 *pmb++ = (char)(0x80 | (wc & 0x3F));
645 cBytes++;
646 } else
647 if ( wc < 0x00010000 ) {
648 *pmb++ = (char)(0xE0 | ((wc >> 12) & 0x0F));
649 cBytes++;
650 *pmb++ = (char)(0x80 | ((wc >> 6) & 0x3F));
651 cBytes++;
652 *pmb++ = (char)(0x80 | (wc & 0x3F));
653 cBytes++;
654 }
655 if ( wc == L'\0' )
656 return cBytes;
657 }
658
659 return cBytes;
660 }
661
662 /* Convert UTF-8 coded string to UNICODE
663 Return number of characters converted */
664 int utf8ToUnicode ( const char* lpMultiByteStr, WCHAR* lpWideCharStr, int cmbChars )
665 {
666 const unsigned char* pmb = (unsigned char *)lpMultiByteStr;
667 unsigned short* pwc = (unsigned short *)lpWideCharStr;
668 const unsigned char* pmbe;
669 size_t cwChars = 0;
670
671 if ( cmbChars >= 0 ) {
672 pmbe = pmb + cmbChars;
673 } else {
674 pmbe = (unsigned char *)((size_t)-1);
675 }
676
677 while ( pmb < pmbe ) {
678 char mb = *pmb++;
679 unsigned int cc = 0;
680 unsigned int wc;
681
682 while ( (cc < 7) && (mb & (1 << (7 - cc)))) {
683 cc++;
684 }
685
686 if ( cc == 1 || cc > 6 ) // illegal character combination for UTF-8
687 continue;
688
689 if ( cc == 0 ) {
690 wc = mb;
691 } else {
692 wc = (mb & ((1 << (7 - cc)) - 1)) << ((cc - 1) * 6);
693 while ( --cc > 0 ) {
694 if ( pmb == pmbe ) // reached end of the buffer
695 return cwChars;
696 mb = *pmb++;
697 if ( ((mb >> 6) & 0x03) != 2 ) // not part of multibyte character
698 return cwChars;
699 wc |= (mb & 0x3F) << ((cc - 1) * 6);
700 }
701 }
702
703 if ( wc & 0xFFFF0000 )
704 wc = L'?';
705 *pwc++ = wc;
706 cwChars++;
707 if ( wc == L'\0' )
708 return cwChars;
709 }
710
711 return cwChars;
712 }
713
714 /* convert Windows ANSI to UTF-8 */
715 int ConvertANSIToUTF8 ( const char* ansi, char* utf8 )
716 {
717 WCHAR* wszValue; // Unicode value
718 size_t ansi_len;
719 size_t len;
720
721 *utf8 = '\0';
722 if ( ansi == NULL )
723 return 0;
724
725 ansi_len = strlen ( ansi );
726
727 if ( (wszValue = (WCHAR *)malloc ( (ansi_len + 1) * 2 )) == NULL )
728 return 0;
729
730 /* Convert ANSI value to Unicode */
731 if ( (len = MultiByteToWideChar ( CP_ACP, 0, ansi, ansi_len + 1, wszValue, (ansi_len + 1) * 2 )) == 0 ) {
732 free ( wszValue );
733 return 0;
734 }
735
736 /* Convert Unicode value to UTF-8 */
737 if ( (len = unicodeToUtf8 ( wszValue, utf8, -1 )) == 0 ) {
738 free ( wszValue );
739 return 0;
740 }
741
742 free ( wszValue );
743
744 return len-1;
745 }
746
747 /* convert UTF-8 to Windows ANSI */
748 int ConvertUTF8ToANSI ( const char* utf8, char* ansi )
749 {
750 WCHAR* wszValue; // Unicode value
751 size_t utf8_len;
752 size_t len;
753
754 *ansi = '\0';
755 if ( utf8 == NULL )
756 return 0;
757
758 utf8_len = strlen ( utf8 );
759
760 if ( (wszValue = (WCHAR *)malloc ( (utf8_len + 1) * 2 )) == NULL )
761 return 0;
762
763 /* Convert UTF-8 value to Unicode */
764 if ( (len = utf8ToUnicode ( utf8, wszValue, utf8_len + 1 )) == 0 ) {
765 free ( wszValue );
766 return 0;
767 }
768
769 /* Convert Unicode value to ANSI */
770 if ( (len = WideCharToMultiByte ( CP_ACP, 0, wszValue, -1, ansi, (utf8_len + 1) * 2, NULL, NULL )) == 0 ) {
771 free ( wszValue );
772 return 0;
773 }
774
775 free ( wszValue );
776
777 return len-1;
778 }
779
780 BOOL uSetDlgItemText(void *tagHandle, int fieldId, const char *str)
781 {
782 char *temp;
783 size_t len;
784 int r;
785
786 if (!str) return FALSE;
787 if (!*str) return FALSE;
788 len = strlen(str);
789 temp = (char *)malloc(len+1);
790 if (!temp) return FALSE;
791 memset(temp, '\0', len+1);
792 r = ConvertUTF8ToANSI(str, temp);
793 if (r > 0)
794 ModInitTag.SetFieldA(tagHandle, fieldId, temp);
795 free(temp);
796
797 return r>0 ? TRUE : FALSE;
798 }
799
800 UINT uGetDlgItemText(void *tagHandle, int fieldId, char *str, int max)
801 {
802 char *temp, *utf8;;
803 int len;
804
805 const char *p;
806
807 if (!str || !max) return 0;
808 len = strlen( ModInitTag.GetFieldA(tagHandle, fieldId) );
809 temp = (char *)malloc(len+1);
810 if (!temp) return 0;
811 utf8 = (char *)malloc((len+1)*4);
812 if (!utf8)
813 {
814 free(temp);
815 return 0;
816 }
817
818 memset(temp, '\0', len+1);
819 memset(utf8, '\0', (len+1)*4);
820 memset(str, '\0', max);
821 p = ModInitTag.GetFieldA(tagHandle, fieldId);
822 memcpy(temp, p, len+1);
823 if (len > 0)
824 {
825 len = ConvertANSIToUTF8(temp, utf8);
826 if (len > max-1)
827 {
828 len = max-1;
829 utf8[max] = '\0';
830 }
831 memcpy(str, utf8, len+1);
832 }
833
834 free(temp);
835 free(utf8);
836
837 return len;
838 }
0 #ifndef QCDTAGS_H
1 #define QCDTAGS_H
2
3 #include "QCDModTagEditor.h"
4
5 extern HINSTANCE hInstance;
6
7 void ShutDown_Tag(int flags);
8 bool Read_Tag(LPCSTR filename, void* tagData);
9 bool Write_Tag(LPCSTR filename, void* tagData);
10 bool Strip_Tag(LPCSTR filename);
11
12
13 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: aac2mp4.cpp,v 1.3 2003/12/06 04:24:17 rjamorim Exp $
25 **/
26
27 #include <mpeg4ip.h>
28 #include <mp4.h>
29 #include <mp4av.h>
30
31 #include "aac2mp4.h"
32
33 int covert_aac_to_mp4(char *inputFileName, char *mp4FileName)
34 {
35 int Mp4TimeScale = 90000;
36 int allMpeg4Streams = 0;
37 MP4FileHandle mp4File;
38 FILE* inFile;
39 const char *type;
40 MP4TrackId createdTrackId = MP4_INVALID_TRACK_ID;
41
42 mp4File = MP4Create(mp4FileName, 0, 0, 0);
43 if (mp4File)
44 {
45 MP4SetTimeScale(mp4File, Mp4TimeScale);
46 } else {
47 return 1;
48 }
49
50 inFile = fopen(inputFileName, "rb");
51
52 if (inFile == NULL)
53 {
54 MP4Close(mp4File);
55 return 2;
56 }
57
58 createdTrackId = AacCreator(mp4File, inFile);
59
60 if (createdTrackId == MP4_INVALID_TRACK_ID)
61 {
62 fclose(inFile);
63 MP4Close(mp4File);
64 return 3;
65 }
66
67 type = MP4GetTrackType(mp4File, createdTrackId);
68
69 if (!strcmp(type, MP4_AUDIO_TRACK_TYPE))
70 {
71 allMpeg4Streams &=
72 (MP4GetTrackAudioType(mp4File, createdTrackId)
73 == MP4_MPEG4_AUDIO_TYPE);
74 }
75
76 if (inFile)
77 {
78 fclose(inFile);
79 }
80
81 MP4Close(mp4File);
82 MP4MakeIsmaCompliant(mp4FileName, 0, allMpeg4Streams);
83
84 return 0;
85 }
86
87 #define ADTS_HEADER_MAX_SIZE 10 /* bytes */
88
89 static u_int8_t firstHeader[ADTS_HEADER_MAX_SIZE];
90
91 /*
92 * hdr must point to at least ADTS_HEADER_MAX_SIZE bytes of memory
93 */
94 static bool LoadNextAdtsHeader(FILE* inFile, u_int8_t* hdr)
95 {
96 u_int state = 0;
97 u_int dropped = 0;
98 u_int hdrByteSize = ADTS_HEADER_MAX_SIZE;
99
100 while (1) {
101 /* read a byte */
102 u_int8_t b;
103
104 if (fread(&b, 1, 1, inFile) == 0) {
105 return false;
106 }
107
108 /* header is complete, return it */
109 if (state == hdrByteSize - 1) {
110 hdr[state] = b;
111 if (dropped > 0) {
112 fprintf(stderr, "Warning: dropped %u input bytes\n", dropped);
113 }
114 return true;
115 }
116
117 /* collect requisite number of bytes, no constraints on data */
118 if (state >= 2) {
119 hdr[state++] = b;
120 } else {
121 /* have first byte, check if we have 1111X00X */
122 if (state == 1) {
123 if ((b & 0xF6) == 0xF0) {
124 hdr[state] = b;
125 state = 2;
126 /* compute desired header size */
127 hdrByteSize = MP4AV_AdtsGetHeaderByteSize(hdr);
128 } else {
129 state = 0;
130 }
131 }
132 /* initial state, looking for 11111111 */
133 if (state == 0) {
134 if (b == 0xFF) {
135 hdr[state] = b;
136 state = 1;
137 } else {
138 /* else drop it */
139 dropped++;
140 }
141 }
142 }
143 }
144 }
145
146 /*
147 * Load the next frame from the file
148 * into the supplied buffer, which better be large enough!
149 *
150 * Note: Frames are padded to byte boundaries
151 */
152 static bool LoadNextAacFrame(FILE* inFile, u_int8_t* pBuf, u_int32_t* pBufSize, bool stripAdts)
153 {
154 u_int16_t frameSize;
155 u_int16_t hdrBitSize, hdrByteSize;
156 u_int8_t hdrBuf[ADTS_HEADER_MAX_SIZE];
157
158 /* get the next AAC frame header, more or less */
159 if (!LoadNextAdtsHeader(inFile, hdrBuf)) {
160 return false;
161 }
162
163 /* get frame size from header */
164 frameSize = MP4AV_AdtsGetFrameSize(hdrBuf);
165
166 /* get header size in bits and bytes from header */
167 hdrBitSize = MP4AV_AdtsGetHeaderBitSize(hdrBuf);
168 hdrByteSize = MP4AV_AdtsGetHeaderByteSize(hdrBuf);
169
170 /* adjust the frame size to what remains to be read */
171 frameSize -= hdrByteSize;
172
173 if (stripAdts) {
174 if ((hdrBitSize % 8) == 0) {
175 /* header is byte aligned, i.e. MPEG-2 ADTS */
176 /* read the frame data into the buffer */
177 if (fread(pBuf, 1, frameSize, inFile) != frameSize) {
178 return false;
179 }
180 (*pBufSize) = frameSize;
181 } else {
182 /* header is not byte aligned, i.e. MPEG-4 ADTS */
183 int i;
184 u_int8_t newByte;
185 int upShift = hdrBitSize % 8;
186 int downShift = 8 - upShift;
187
188 pBuf[0] = hdrBuf[hdrBitSize / 8] << upShift;
189
190 for (i = 0; i < frameSize; i++) {
191 if (fread(&newByte, 1, 1, inFile) != 1) {
192 return false;
193 }
194 pBuf[i] |= (newByte >> downShift);
195 pBuf[i+1] = (newByte << upShift);
196 }
197 (*pBufSize) = frameSize + 1;
198 }
199 } else { /* don't strip ADTS headers */
200 memcpy(pBuf, hdrBuf, hdrByteSize);
201 if (fread(&pBuf[hdrByteSize], 1, frameSize, inFile) != frameSize) {
202 return false;
203 }
204 }
205
206 return true;
207 }
208
209 static bool GetFirstHeader(FILE* inFile)
210 {
211 /* read file until we find an audio frame */
212 fpos_t curPos;
213
214 /* already read first header */
215 if (firstHeader[0] == 0xff) {
216 return true;
217 }
218
219 /* remember where we are */
220 fgetpos(inFile, &curPos);
221
222 /* go back to start of file */
223 rewind(inFile);
224
225 if (!LoadNextAdtsHeader(inFile, firstHeader)) {
226 return false;
227 }
228
229 /* reposition the file to where we were */
230 fsetpos(inFile, &curPos);
231
232 return true;
233 }
234
235 MP4TrackId AacCreator(MP4FileHandle mp4File, FILE* inFile)
236 {
237 // collect all the necessary meta information
238 u_int32_t samplesPerSecond;
239 u_int8_t mpegVersion;
240 u_int8_t profile;
241 u_int8_t channelConfig;
242
243 if (!GetFirstHeader(inFile)) {
244 return MP4_INVALID_TRACK_ID;
245 }
246
247 samplesPerSecond = MP4AV_AdtsGetSamplingRate(firstHeader);
248 mpegVersion = MP4AV_AdtsGetVersion(firstHeader);
249 profile = MP4AV_AdtsGetProfile(firstHeader);
250 channelConfig = MP4AV_AdtsGetChannels(firstHeader);
251
252 u_int8_t audioType = MP4_INVALID_AUDIO_TYPE;
253 switch (mpegVersion) {
254 case 0:
255 audioType = MP4_MPEG4_AUDIO_TYPE;
256 break;
257 case 1:
258 switch (profile) {
259 case 0:
260 audioType = MP4_MPEG2_AAC_MAIN_AUDIO_TYPE;
261 break;
262 case 1:
263 audioType = MP4_MPEG2_AAC_LC_AUDIO_TYPE;
264 break;
265 case 2:
266 audioType = MP4_MPEG2_AAC_SSR_AUDIO_TYPE;
267 break;
268 case 3:
269 return MP4_INVALID_TRACK_ID;
270 }
271 break;
272 }
273
274 // add the new audio track
275 MP4TrackId trackId =
276 MP4AddAudioTrack(mp4File,
277 samplesPerSecond, 1024, audioType);
278
279 if (trackId == MP4_INVALID_TRACK_ID) {
280 return MP4_INVALID_TRACK_ID;
281 }
282
283 if (MP4GetNumberOfTracks(mp4File, MP4_AUDIO_TRACK_TYPE) == 1) {
284 MP4SetAudioProfileLevel(mp4File, 0x0F);
285 }
286
287 u_int8_t* pConfig = NULL;
288 u_int32_t configLength = 0;
289
290 MP4AV_AacGetConfiguration(
291 &pConfig,
292 &configLength,
293 profile,
294 samplesPerSecond,
295 channelConfig);
296
297 if (!MP4SetTrackESConfiguration(mp4File, trackId,
298 pConfig, configLength)) {
299 MP4DeleteTrack(mp4File, trackId);
300 return MP4_INVALID_TRACK_ID;
301 }
302
303 // parse the ADTS frames, and write the MP4 samples
304 u_int8_t sampleBuffer[8 * 1024];
305 u_int32_t sampleSize = sizeof(sampleBuffer);
306 MP4SampleId sampleId = 1;
307
308 while (LoadNextAacFrame(inFile, sampleBuffer, &sampleSize, true)) {
309 if (!MP4WriteSample(mp4File, trackId, sampleBuffer, sampleSize)) {
310 MP4DeleteTrack(mp4File, trackId);
311 return MP4_INVALID_TRACK_ID;
312 }
313 sampleId++;
314 sampleSize = sizeof(sampleBuffer);
315 }
316
317 return trackId;
318 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: aac2mp4.h,v 1.3 2003/12/06 04:24:17 rjamorim Exp $
25 **/
26
27 #ifndef AAC2MP4_H__
28 #define AAC2MP4_H__
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
33
34 int covert_aac_to_mp4(char *inputFileName, char *mp4FileName);
35 MP4TrackId AacCreator(MP4FileHandle mp4File, FILE* inFile);
36
37 #ifdef __cplusplus
38 }
39 #endif /* __cplusplus */
40
41 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: aacinfo.c,v 1.3 2003/12/06 04:24:17 rjamorim Exp $
25 **/
26
27 #define WIN32_LEAN_AND_MEAN
28 #include <windows.h>
29 #include <malloc.h>
30 #include <stdlib.h>
31 #include <stdio.h>
32 #include "aacinfo.h"
33 #include "utils.h"
34
35 #define ADIF_MAX_SIZE 30 /* Should be enough */
36 #define ADTS_MAX_SIZE 10 /* Should be enough */
37
38 static int sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000};
39
40 static int read_ADIF_header(FILE *file, faadAACInfo *info)
41 {
42 int bitstream;
43 unsigned char buffer[ADIF_MAX_SIZE];
44 int skip_size = 0;
45 int sf_idx;
46
47 /* Get ADIF header data */
48 info->headertype = 1;
49
50 if (fread(buffer, 1, ADIF_MAX_SIZE, file) != ADIF_MAX_SIZE)
51 return -1;
52
53 /* copyright string */
54 if(buffer[0] & 0x80)
55 skip_size += 9; /* skip 9 bytes */
56
57 bitstream = buffer[0 + skip_size] & 0x10;
58 info->bitrate = ((unsigned int)(buffer[0 + skip_size] & 0x0F)<<19)|
59 ((unsigned int)buffer[1 + skip_size]<<11)|
60 ((unsigned int)buffer[2 + skip_size]<<3)|
61 ((unsigned int)buffer[3 + skip_size] & 0xE0);
62
63 if (bitstream == 0)
64 {
65 info->object_type = ((buffer[6 + skip_size]&0x01)<<1)|((buffer[7 + skip_size]&0x80)>>7);
66 sf_idx = (buffer[7 + skip_size]&0x78)>>3;
67 } else {
68 info->object_type = (buffer[4 + skip_size] & 0x18)>>3;
69 sf_idx = ((buffer[4 + skip_size] & 0x07)<<1)|((buffer[5 + skip_size] & 0x80)>>7);
70 }
71 info->sampling_rate = sample_rates[sf_idx];
72
73 return 0;
74 }
75
76 static int read_ADTS_header(FILE *file, faadAACInfo *info)
77 {
78 /* Get ADTS header data */
79 unsigned char buffer[ADTS_MAX_SIZE];
80 int frames, t_framelength = 0, frame_length, sr_idx = 0, ID;
81 int second = 0, pos;
82 float frames_per_sec = 0;
83 unsigned long bytes;
84 unsigned long *tmp_seek_table = NULL;
85
86 info->headertype = 2;
87
88 /* Read all frames to ensure correct time and bitrate */
89 for (frames = 0; /* */; frames++)
90 {
91 bytes = fread(buffer, 1, ADTS_MAX_SIZE, file);
92
93 if (bytes != ADTS_MAX_SIZE)
94 break;
95
96 /* check syncword */
97 if (!((buffer[0] == 0xFF)&&((buffer[1] & 0xF6) == 0xF0)))
98 break;
99
100 if (!frames)
101 {
102 /* fixed ADTS header is the same for every frame, so we read it only once */
103 /* Syncword found, proceed to read in the fixed ADTS header */
104 ID = buffer[1] & 0x08;
105 info->object_type = (buffer[2]&0xC0)>>6;
106 sr_idx = (buffer[2]&0x3C)>>2;
107 info->channels = ((buffer[2]&0x01)<<2)|((buffer[3]&0xC0)>>6);
108
109 frames_per_sec = sample_rates[sr_idx] / 1024.f;
110 }
111
112 /* ...and the variable ADTS header */
113 if (ID == 0)
114 {
115 info->version = 4;
116 } else { /* MPEG-2 */
117 info->version = 2;
118 }
119 frame_length = ((((unsigned int)buffer[3] & 0x3)) << 11)
120 | (((unsigned int)buffer[4]) << 3) | (buffer[5] >> 5);
121
122 t_framelength += frame_length;
123
124 pos = ftell(file) - ADTS_MAX_SIZE;
125
126 fseek(file, frame_length - ADTS_MAX_SIZE, SEEK_CUR);
127 }
128
129 if (frames > 0)
130 {
131 float sec_per_frame, bytes_per_frame;
132 info->sampling_rate = sample_rates[sr_idx];
133 sec_per_frame = (float)info->sampling_rate/1024.0;
134 bytes_per_frame = (float)t_framelength / (float)frames;
135 info->bitrate = 8 * (int)floor(bytes_per_frame * sec_per_frame);
136 info->length = (int)floor((float)frames/frames_per_sec)*1000;
137 } else {
138 info->sampling_rate = 4;
139 info->bitrate = 128000;
140 info->length = 0;
141 info->channels = 0;
142 }
143
144 return 0;
145 }
146
147 int get_AAC_format(char *filename, faadAACInfo *info)
148 {
149 unsigned long tagsize;
150 FILE *file;
151 char buffer[10];
152 unsigned long file_len;
153 unsigned char adxx_id[5];
154 unsigned long tmp;
155
156 memset(info, 0, sizeof(faadAACInfo));
157
158 file = fopen(filename, "rb");
159
160 if(file == NULL)
161 return -1;
162
163 fseek(file, 0, SEEK_END);
164 file_len = ftell(file);
165 fseek(file, 0, SEEK_SET);
166
167 /* Skip the tag, if it's there */
168 tmp = fread(buffer, 10, 1, file);
169
170 if (StringComp(buffer, "ID3", 3) == 0)
171 {
172 /* high bit is not used */
173 tagsize = (buffer[6] << 21) | (buffer[7] << 14) |
174 (buffer[8] << 7) | (buffer[9] << 0);
175
176 fseek(file, tagsize, SEEK_CUR);
177 tagsize += 10;
178 } else {
179 tagsize = 0;
180 fseek(file, 0, SEEK_SET);
181 }
182
183 if (file_len)
184 file_len -= tagsize;
185
186 tmp = fread(adxx_id, 2, 1, file);
187 adxx_id[5-1] = 0;
188 info->length = 0;
189
190 /* Determine the header type of the file, check the first two bytes */
191 if (StringComp(adxx_id, "AD", 2) == 0)
192 {
193 /* We think its an ADIF header, but check the rest just to make sure */
194 tmp = fread(adxx_id + 2, 2, 1, file);
195
196 if (StringComp(adxx_id, "ADIF", 4) == 0)
197 {
198 read_ADIF_header(file, info);
199
200 info->length = (int)((float)file_len*8000.0/((float)info->bitrate));
201 }
202 } else {
203 /* No ADIF, check for ADTS header */
204 if ((adxx_id[0] == 0xFF)&&((adxx_id[1] & 0xF6) == 0xF0))
205 {
206 /* ADTS header located */
207 fseek(file, tagsize, SEEK_SET);
208 read_ADTS_header(file, info);
209 } else {
210 /* Unknown/headerless AAC file, assume format: */
211 info->version = 2;
212 info->bitrate = 128000;
213 info->sampling_rate = 44100;
214 info->channels = 2;
215 info->headertype = 0;
216 info->object_type = 1;
217 }
218 }
219
220 fclose(file);
221
222 return 0;
223 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: aacinfo.h,v 1.3 2003/12/06 04:24:17 rjamorim Exp $
25 **/
26
27 #ifndef AACINFO_INCLUDED
28 #define AACINFO_INCLUDED
29
30 typedef struct {
31 int version;
32 int channels;
33 int sampling_rate;
34 int bitrate;
35 int length;
36 int object_type;
37 int headertype;
38 } faadAACInfo;
39
40 int get_AAC_format(char *filename, faadAACInfo *info);
41
42 static int read_ADIF_header(FILE *file, faadAACInfo *info);
43 static int read_ADTS_header(FILE *file, faadAACInfo *info);
44
45 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: config.c,v 1.3 2003/12/06 04:24:17 rjamorim Exp $
25 **/
26
27 #define WIN32_LEAN_AND_MEAN
28 #include <windows.h>
29 #include "config.h"
30
31 char app_name[] = "AudioCoding.com MPEG-4 General Audio player";
32 char INI_FILE[MAX_PATH];
33 int m_priority = 3;
34 int m_resolution = 0;
35 int m_show_errors = 1;
36 int m_use_for_aac = 1;
37 int m_downmix = 0;
38 int m_vbr_display = 0;
39 char titleformat[MAX_PATH];
40
41 void _r_s(char *name,char *data, int mlen)
42 {
43 char buf[10];
44 strcpy(buf,data);
45 GetPrivateProfileString(app_name,name,buf,data,mlen,INI_FILE);
46 }
47
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: config.h,v 1.3 2003/12/06 04:24:17 rjamorim Exp $
25 **/
26
27 char app_name[];
28 char INI_FILE[];
29 int m_priority;
30 int m_resolution;
31 int m_show_errors;
32 int m_use_for_aac;
33 int m_downmix;
34 int m_vbr_display;
35 char titleformat[MAX_PATH];
36
37 #define RS(x) (_r_s(#x,x,sizeof(x)))
38 #define WS(x) (WritePrivateProfileString(app_name,#x,x,INI_FILE))
39
40 void _r_s(char *name,char *data, int mlen);
41
0 /*
1 * The contents of this file are subject to the Mozilla Public
2 * License Version 1.1 (the "License"); you may not use this file
3 * except in compliance with the License. You may obtain a copy of
4 * the License at http://www.mozilla.org/MPL/
5 *
6 * Software distributed under the License is distributed on an "AS
7 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
8 * implied. See the License for the specific language governing
9 * rights and limitations under the License.
10 *
11 * The Original Code is MPEG4IP.
12 *
13 * The Initial Developer of the Original Code is Cisco Systems Inc.
14 * Portions created by Cisco Systems Inc. are
15 * Copyright (C) Cisco Systems Inc. 2001-2002. All Rights Reserved.
16 *
17 * Contributor(s):
18 * Dave Mackie dmackie@cisco.com
19 */
20
21 #ifndef __MBS_INCLUDED__
22 #define __MBS_INCLUDED__
23
24 class CMemoryBitstream {
25 public:
26 CMemoryBitstream() {
27 m_pBuf = NULL;
28 m_bitPos = 0;
29 m_numBits = 0;
30 }
31
32 void AllocBytes(u_int32_t numBytes);
33
34 void SetBytes(u_int8_t* pBytes, u_int32_t numBytes);
35
36 void PutBytes(u_int8_t* pBytes, u_int32_t numBytes);
37
38 void PutBits(u_int32_t bits, u_int32_t numBits);
39
40 u_int32_t GetBits(u_int32_t numBits);
41
42 void SkipBytes(u_int32_t numBytes) {
43 SkipBits(numBytes << 3);
44 }
45
46 void SkipBits(u_int32_t numBits) {
47 SetBitPosition(GetBitPosition() + numBits);
48 }
49
50 u_int32_t GetBitPosition() {
51 return m_bitPos;
52 }
53
54 void SetBitPosition(u_int32_t bitPos) {
55 if (bitPos > m_numBits) {
56 throw;
57 }
58 m_bitPos = bitPos;
59 }
60
61 u_int8_t* GetBuffer() {
62 return m_pBuf;
63 }
64
65 u_int32_t GetNumberOfBytes() {
66 return (GetNumberOfBits() + 7) / 8;
67 }
68
69 u_int32_t GetNumberOfBits() {
70 return m_numBits;
71 }
72
73 protected:
74 u_int8_t* m_pBuf;
75 u_int32_t m_bitPos;
76 u_int32_t m_numBits;
77 };
78
79 #endif /* __MBS_INCLUDED__ */
80
0 //{{NO_DEPENDENCIES}}
1 // Microsoft Visual C++ generated include file.
2 // Used by QCDMp4.rc
3 //
4 #define IDD_CONFIG 102
5 #define IDC_TYPE 1000
6 #define IDC_INFOTEXT 1000
7 #define IDC_DURATION 1001
8 #define IDC_BITRATE 1002
9 #define IDC_SAMPLERATE 1003
10 #define IDC_VTYPE 1004
11 #define IDC_PRIORITY 1004
12 #define IDC_VBITRATE 1005
13 #define IDC_ERROR 1005
14 #define IDC_VDURATION 1006
15 #define IDC_16BITS 1006
16 #define IDC_VSIZE 1007
17 #define IDC_24BITS 1007
18 #define IDC_CONVERT 1007
19 #define IDC_VFPS 1008
20 #define IDC_32BITS 1008
21 #define IDC_CONVERT2 1008
22 #define IDC_CHANNELS 1009
23 #define IDC_24BITS2 1009
24 #define IDC_16BITS_DITHERED 1009
25 #define IDC_CONVERT1 1009
26 #define IDC_USERDATA 1010
27 #define IDC_USEFORAAC 1011
28 #define IDC_METACOMPILATION 1012
29 #define IDC_METANAME 1013
30 #define IDC_METAARTIST 1014
31 #define IDC_METAWRITER 1015
32 #define IDC_METAALBUM 1016
33 #define IDC_METACOMMENTS 1017
34 #define IDC_METAGENRE 1018
35 #define IDC_METAYEAR 1019
36 #define IDC_METATRACK1 1020
37 #define IDC_METADISK1 1021
38 #define IDC_METATEMPO 1022
39 #define IDC_METATRACK2 1023
40 #define IDC_METADISK2 1024
41 #define IDC_STATIC1 1025
42 #define IDC_STATIC2 1026
43 #define IDC_STATIC3 1027
44 #define IDC_STATIC4 1028
45 #define IDC_STATIC5 1029
46 #define IDC_STATIC6 1030
47 #define IDC_STATIC7 1031
48 #define IDC_STATIC8 1032
49 #define IDC_STATIC9 1033
50 #define IDC_STATIC10 1034
51 #define IDC_STATIC11 1035
52 #define IDC_STATIC12 1036
53 #define IDC_DOWNMIX 1038
54 #define IDC_VBR 1039
55 #define IDC_TITLEFORMAT 1040
56
57 // Next default values for new objects
58 //
59 #ifdef APSTUDIO_INVOKED
60 #ifndef APSTUDIO_READONLY_SYMBOLS
61 #define _APS_NEXT_RESOURCE_VALUE 103
62 #define _APS_NEXT_COMMAND_VALUE 40001
63 #define _APS_NEXT_CONTROL_VALUE 1041
64 #define _APS_NEXT_SYMED_VALUE 101
65 #endif
66 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: utils.c,v 1.3 2003/12/06 04:24:17 rjamorim Exp $
25 **/
26
27 #define WIN32_LEAN_AND_MEAN
28 #include <windows.h>
29 #include <mp4.h>
30 #include <faad.h>
31 #include "utils.h"
32
33 int StringComp(char const *str1, char const *str2, unsigned long len)
34 {
35 signed int c1 = 0, c2 = 0;
36
37 while (len--)
38 {
39 c1 = tolower(*str1++);
40 c2 = tolower(*str2++);
41
42 if (c1 == 0 || c1 != c2)
43 break;
44 }
45
46 return c1 - c2;
47 }
48
49 int GetAACTrack(MP4FileHandle infile)
50 {
51 /* find AAC track */
52 int i, rc;
53 int numTracks = MP4GetNumberOfTracks(infile, NULL, 0);
54
55 for (i = 0; i < numTracks; i++)
56 {
57 MP4TrackId trackId = MP4FindTrackId(infile, i, NULL, 0);
58 const char* trackType = MP4GetTrackType(infile, trackId);
59
60 if (!strcmp(trackType, MP4_AUDIO_TRACK_TYPE))
61 {
62 unsigned char *buff = NULL;
63 int buff_size = 0;
64 mp4AudioSpecificConfig mp4ASC;
65
66 MP4GetTrackESConfiguration(infile, trackId, &buff, &buff_size);
67
68 if (buff)
69 {
70 rc = AudioSpecificConfig(buff, buff_size, &mp4ASC);
71 free(buff);
72
73 if (rc < 0)
74 return -1;
75 return trackId;
76 }
77 }
78 }
79
80 /* can't decode this */
81 return -1;
82 }
83
84 int GetAudioTrack(MP4FileHandle infile)
85 {
86 /* find AAC track */
87 int i;
88 int numTracks = MP4GetNumberOfTracks(infile, NULL, 0);
89
90 for (i = 0; i < numTracks; i++)
91 {
92 MP4TrackId trackId = MP4FindTrackId(infile, i, NULL, 0);
93 const char* trackType = MP4GetTrackType(infile, trackId);
94
95 if (!strcmp(trackType, MP4_AUDIO_TRACK_TYPE))
96 {
97 return trackId;
98 }
99 }
100
101 /* can't decode this */
102 return -1;
103 }
104
105 int GetVideoTrack(MP4FileHandle infile)
106 {
107 /* find AAC track */
108 int i;
109 int numTracks = MP4GetNumberOfTracks(infile, NULL, 0);
110
111 for (i = 0; i < numTracks; i++)
112 {
113 MP4TrackId trackId = MP4FindTrackId(infile, i, NULL, 0);
114 const char* trackType = MP4GetTrackType(infile, trackId);
115
116 if (!strcmp(trackType, MP4_VIDEO_TRACK_TYPE))
117 {
118 return trackId;
119 }
120 }
121
122 /* can't decode this */
123 return -1;
124 }
125
126 LPTSTR PathFindFileName(LPCTSTR pPath)
127 {
128 LPCTSTR pT;
129
130 for (pT = pPath; *pPath; pPath = CharNext(pPath)) {
131 if ((pPath[0] == TEXT('\\') || pPath[0] == TEXT(':')) && pPath[1] && (pPath[1] != TEXT('\\')))
132 pT = pPath + 1;
133 }
134
135 return (LPTSTR)pT; // const -> non const
136 }
137
138 char *convert3in4to3in3(void *sample_buffer, int samples)
139 {
140 int i;
141 long *sample_buffer24 = (long*)sample_buffer;
142 char *data = malloc(samples*3*sizeof(char));
143
144 for (i = 0; i < samples; i++)
145 {
146 data[i*3] = sample_buffer24[i] & 0xFF;
147 data[i*3+1] = (sample_buffer24[i] >> 8) & 0xFF;
148 data[i*3+2] = (sample_buffer24[i] >> 16) & 0xFF;
149 }
150
151 return data;
152 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: utils.h,v 1.3 2003/12/06 04:24:17 rjamorim Exp $
25 **/
26
27 #ifndef UTILS_INCLUDED
28 #define UTILS_INCLUDED
29
30 #include <mp4.h>
31
32 LPTSTR PathFindFileName(LPCTSTR pPath);
33 int GetVideoTrack(MP4FileHandle infile);
34 int GetAudioTrack(MP4FileHandle infile);
35 int GetAACTrack(MP4FileHandle infile);
36 int StringComp(char const *str1, char const *str2, unsigned long len);
37 char *convert3in4to3in3(void *sample_buffer, int samples);
38
39 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: aac2mp4.cpp,v 1.4 2004/08/19 18:35:11 menno Exp $
25 **/
26
27 #include <mpeg4ip.h>
28 #include <mp4.h>
29 #include <mp4av.h>
30
31 #include "aac2mp4.h"
32
33 int covert_aac_to_mp4(char *inputFileName, char *mp4FileName)
34 {
35 int Mp4TimeScale = 90000;
36 int allMpeg4Streams = 0;
37 MP4FileHandle mp4File;
38 FILE* inFile;
39 const char *type;
40 MP4TrackId createdTrackId = MP4_INVALID_TRACK_ID;
41
42 mp4File = MP4Create(mp4FileName, 0, 0);
43 if (mp4File)
44 {
45 MP4SetTimeScale(mp4File, Mp4TimeScale);
46 } else {
47 return 1;
48 }
49
50 inFile = fopen(inputFileName, "rb");
51
52 if (inFile == NULL)
53 {
54 MP4Close(mp4File);
55 return 2;
56 }
57
58 createdTrackId = AacCreator(mp4File, inFile);
59
60 if (createdTrackId == MP4_INVALID_TRACK_ID)
61 {
62 fclose(inFile);
63 MP4Close(mp4File);
64 return 3;
65 }
66
67 type = MP4GetTrackType(mp4File, createdTrackId);
68
69 if (!strcmp(type, MP4_AUDIO_TRACK_TYPE))
70 {
71 allMpeg4Streams &=
72 (MP4GetTrackEsdsObjectTypeId(mp4File, createdTrackId)
73 == MP4_MPEG4_AUDIO_TYPE);
74 }
75
76 if (inFile)
77 {
78 fclose(inFile);
79 }
80
81 MP4Close(mp4File);
82 MP4MakeIsmaCompliant(mp4FileName, 0, allMpeg4Streams);
83
84 return 0;
85 }
86
87 #define ADTS_HEADER_MAX_SIZE 10 /* bytes */
88
89 static u_int8_t firstHeader[ADTS_HEADER_MAX_SIZE];
90
91 /*
92 * hdr must point to at least ADTS_HEADER_MAX_SIZE bytes of memory
93 */
94 static bool LoadNextAdtsHeader(FILE* inFile, u_int8_t* hdr)
95 {
96 u_int state = 0;
97 u_int dropped = 0;
98 u_int hdrByteSize = ADTS_HEADER_MAX_SIZE;
99
100 while (1) {
101 /* read a byte */
102 u_int8_t b;
103
104 if (fread(&b, 1, 1, inFile) == 0) {
105 return false;
106 }
107
108 /* header is complete, return it */
109 if (state == hdrByteSize - 1) {
110 hdr[state] = b;
111 if (dropped > 0) {
112 fprintf(stderr, "Warning: dropped %u input bytes\n", dropped);
113 }
114 return true;
115 }
116
117 /* collect requisite number of bytes, no constraints on data */
118 if (state >= 2) {
119 hdr[state++] = b;
120 } else {
121 /* have first byte, check if we have 1111X00X */
122 if (state == 1) {
123 if ((b & 0xF6) == 0xF0) {
124 hdr[state] = b;
125 state = 2;
126 /* compute desired header size */
127 hdrByteSize = MP4AV_AdtsGetHeaderByteSize(hdr);
128 } else {
129 state = 0;
130 }
131 }
132 /* initial state, looking for 11111111 */
133 if (state == 0) {
134 if (b == 0xFF) {
135 hdr[state] = b;
136 state = 1;
137 } else {
138 /* else drop it */
139 dropped++;
140 }
141 }
142 }
143 }
144 }
145
146 /*
147 * Load the next frame from the file
148 * into the supplied buffer, which better be large enough!
149 *
150 * Note: Frames are padded to byte boundaries
151 */
152 static bool LoadNextAacFrame(FILE* inFile, u_int8_t* pBuf, u_int32_t* pBufSize, bool stripAdts)
153 {
154 u_int16_t frameSize;
155 u_int16_t hdrBitSize, hdrByteSize;
156 u_int8_t hdrBuf[ADTS_HEADER_MAX_SIZE];
157
158 /* get the next AAC frame header, more or less */
159 if (!LoadNextAdtsHeader(inFile, hdrBuf)) {
160 return false;
161 }
162
163 /* get frame size from header */
164 frameSize = MP4AV_AdtsGetFrameSize(hdrBuf);
165
166 /* get header size in bits and bytes from header */
167 hdrBitSize = MP4AV_AdtsGetHeaderBitSize(hdrBuf);
168 hdrByteSize = MP4AV_AdtsGetHeaderByteSize(hdrBuf);
169
170 /* adjust the frame size to what remains to be read */
171 frameSize -= hdrByteSize;
172
173 if (stripAdts) {
174 if ((hdrBitSize % 8) == 0) {
175 /* header is byte aligned, i.e. MPEG-2 ADTS */
176 /* read the frame data into the buffer */
177 if (fread(pBuf, 1, frameSize, inFile) != frameSize) {
178 return false;
179 }
180 (*pBufSize) = frameSize;
181 } else {
182 /* header is not byte aligned, i.e. MPEG-4 ADTS */
183 int i;
184 u_int8_t newByte;
185 int upShift = hdrBitSize % 8;
186 int downShift = 8 - upShift;
187
188 pBuf[0] = hdrBuf[hdrBitSize / 8] << upShift;
189
190 for (i = 0; i < frameSize; i++) {
191 if (fread(&newByte, 1, 1, inFile) != 1) {
192 return false;
193 }
194 pBuf[i] |= (newByte >> downShift);
195 pBuf[i+1] = (newByte << upShift);
196 }
197 (*pBufSize) = frameSize + 1;
198 }
199 } else { /* don't strip ADTS headers */
200 memcpy(pBuf, hdrBuf, hdrByteSize);
201 if (fread(&pBuf[hdrByteSize], 1, frameSize, inFile) != frameSize) {
202 return false;
203 }
204 }
205
206 return true;
207 }
208
209 static bool GetFirstHeader(FILE* inFile)
210 {
211 /* read file until we find an audio frame */
212 fpos_t curPos;
213
214 /* already read first header */
215 if (firstHeader[0] == 0xff) {
216 return true;
217 }
218
219 /* remember where we are */
220 fgetpos(inFile, &curPos);
221
222 /* go back to start of file */
223 rewind(inFile);
224
225 if (!LoadNextAdtsHeader(inFile, firstHeader)) {
226 return false;
227 }
228
229 /* reposition the file to where we were */
230 fsetpos(inFile, &curPos);
231
232 return true;
233 }
234
235 MP4TrackId AacCreator(MP4FileHandle mp4File, FILE* inFile)
236 {
237 // collect all the necessary meta information
238 u_int32_t samplesPerSecond;
239 u_int8_t mpegVersion;
240 u_int8_t profile;
241 u_int8_t channelConfig;
242
243 if (!GetFirstHeader(inFile)) {
244 return MP4_INVALID_TRACK_ID;
245 }
246
247 samplesPerSecond = MP4AV_AdtsGetSamplingRate(firstHeader);
248 mpegVersion = MP4AV_AdtsGetVersion(firstHeader);
249 profile = MP4AV_AdtsGetProfile(firstHeader);
250 channelConfig = MP4AV_AdtsGetChannels(firstHeader);
251
252 u_int8_t audioType = MP4_INVALID_AUDIO_TYPE;
253 switch (mpegVersion) {
254 case 0:
255 audioType = MP4_MPEG4_AUDIO_TYPE;
256 break;
257 case 1:
258 switch (profile) {
259 case 0:
260 audioType = MP4_MPEG2_AAC_MAIN_AUDIO_TYPE;
261 break;
262 case 1:
263 audioType = MP4_MPEG2_AAC_LC_AUDIO_TYPE;
264 break;
265 case 2:
266 audioType = MP4_MPEG2_AAC_SSR_AUDIO_TYPE;
267 break;
268 case 3:
269 return MP4_INVALID_TRACK_ID;
270 }
271 break;
272 }
273
274 // add the new audio track
275 MP4TrackId trackId =
276 MP4AddAudioTrack(mp4File,
277 samplesPerSecond, 1024, audioType);
278
279 if (trackId == MP4_INVALID_TRACK_ID) {
280 return MP4_INVALID_TRACK_ID;
281 }
282
283 if (MP4GetNumberOfTracks(mp4File, MP4_AUDIO_TRACK_TYPE) == 1) {
284 MP4SetAudioProfileLevel(mp4File, 0x0F);
285 }
286
287 u_int8_t* pConfig = NULL;
288 u_int32_t configLength = 0;
289
290 MP4AV_AacGetConfiguration(
291 &pConfig,
292 &configLength,
293 profile,
294 samplesPerSecond,
295 channelConfig);
296
297 if (!MP4SetTrackESConfiguration(mp4File, trackId,
298 pConfig, configLength)) {
299 MP4DeleteTrack(mp4File, trackId);
300 return MP4_INVALID_TRACK_ID;
301 }
302
303 // parse the ADTS frames, and write the MP4 samples
304 u_int8_t sampleBuffer[8 * 1024];
305 u_int32_t sampleSize = sizeof(sampleBuffer);
306 MP4SampleId sampleId = 1;
307
308 while (LoadNextAacFrame(inFile, sampleBuffer, &sampleSize, true)) {
309 if (!MP4WriteSample(mp4File, trackId, sampleBuffer, sampleSize)) {
310 MP4DeleteTrack(mp4File, trackId);
311 return MP4_INVALID_TRACK_ID;
312 }
313 sampleId++;
314 sampleSize = sizeof(sampleBuffer);
315 }
316
317 return trackId;
318 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: aac2mp4.h,v 1.3 2003/07/29 08:20:14 menno Exp $
25 **/
26
27 #ifndef AAC2MP4_H__
28 #define AAC2MP4_H__
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
33
34 int covert_aac_to_mp4(char *inputFileName, char *mp4FileName);
35 MP4TrackId AacCreator(MP4FileHandle mp4File, FILE* inFile);
36
37 #ifdef __cplusplus
38 }
39 #endif /* __cplusplus */
40
41 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: aacinfo.c,v 1.6 2004/10/18 19:25:00 menno Exp $
25 **/
26
27 #define WIN32_LEAN_AND_MEAN
28 #include <windows.h>
29 #include <malloc.h>
30 #include <stdlib.h>
31 #include <stdio.h>
32 #include <math.h>
33 #include "aacinfo.h"
34 #include "utils.h"
35
36 #define ADIF_MAX_SIZE 30 /* Should be enough */
37 #define ADTS_MAX_SIZE 10 /* Should be enough */
38
39 static int sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000};
40
41 static int read_ADIF_header(FILE *file, faadAACInfo *info)
42 {
43 int bitstream;
44 unsigned char buffer[ADIF_MAX_SIZE];
45 int skip_size = 0;
46 int sf_idx;
47
48 /* Get ADIF header data */
49 info->headertype = 1;
50
51 if (fread(buffer, 1, ADIF_MAX_SIZE, file) != ADIF_MAX_SIZE)
52 return -1;
53
54 /* copyright string */
55 if(buffer[0] & 0x80)
56 skip_size += 9; /* skip 9 bytes */
57
58 bitstream = buffer[0 + skip_size] & 0x10;
59 info->bitrate = ((unsigned int)(buffer[0 + skip_size] & 0x0F)<<19)|
60 ((unsigned int)buffer[1 + skip_size]<<11)|
61 ((unsigned int)buffer[2 + skip_size]<<3)|
62 ((unsigned int)buffer[3 + skip_size] & 0xE0);
63
64 if (bitstream == 0)
65 {
66 info->object_type = ((buffer[6 + skip_size]&0x01)<<1)|((buffer[7 + skip_size]&0x80)>>7);
67 sf_idx = (buffer[7 + skip_size]&0x78)>>3;
68 } else {
69 info->object_type = (buffer[4 + skip_size] & 0x18)>>3;
70 sf_idx = ((buffer[4 + skip_size] & 0x07)<<1)|((buffer[5 + skip_size] & 0x80)>>7);
71 }
72 info->sampling_rate = sample_rates[sf_idx];
73
74 return 0;
75 }
76
77 static int read_ADTS_header(FILE *file, faadAACInfo *info)
78 {
79 /* Get ADTS header data */
80 unsigned char buffer[ADTS_MAX_SIZE];
81 int frames, t_framelength = 0, frame_length, sr_idx = 0, ID;
82 int second = 0, pos;
83 float frames_per_sec = 0;
84 unsigned long bytes;
85 unsigned long *tmp_seek_table = NULL;
86
87 info->headertype = 2;
88
89 /* Read all frames to ensure correct time and bitrate */
90 for (frames = 0; /* */; frames++)
91 {
92 bytes = fread(buffer, 1, ADTS_MAX_SIZE, file);
93
94 if (bytes != ADTS_MAX_SIZE)
95 break;
96
97 /* check syncword */
98 if (!((buffer[0] == 0xFF)&&((buffer[1] & 0xF6) == 0xF0)))
99 break;
100
101 if (!frames)
102 {
103 /* fixed ADTS header is the same for every frame, so we read it only once */
104 /* Syncword found, proceed to read in the fixed ADTS header */
105 ID = buffer[1] & 0x08;
106 info->object_type = (buffer[2]&0xC0)>>6;
107 sr_idx = (buffer[2]&0x3C)>>2;
108 info->channels = ((buffer[2]&0x01)<<2)|((buffer[3]&0xC0)>>6);
109
110 frames_per_sec = sample_rates[sr_idx] / 1024.f;
111 }
112
113 /* ...and the variable ADTS header */
114 if (ID == 0)
115 {
116 info->version = 4;
117 } else { /* MPEG-2 */
118 info->version = 2;
119 }
120 frame_length = ((((unsigned int)buffer[3] & 0x3)) << 11)
121 | (((unsigned int)buffer[4]) << 3) | (buffer[5] >> 5);
122
123 t_framelength += frame_length;
124
125 pos = ftell(file) - ADTS_MAX_SIZE;
126
127 fseek(file, frame_length - ADTS_MAX_SIZE, SEEK_CUR);
128 }
129
130 if (frames > 0)
131 {
132 float sec_per_frame, bytes_per_frame;
133 info->sampling_rate = sample_rates[sr_idx];
134 sec_per_frame = (float)info->sampling_rate/1024.0;
135 bytes_per_frame = (float)t_framelength / (float)frames;
136 info->bitrate = 8 * (int)floor(bytes_per_frame * sec_per_frame);
137 info->length = (int)floor((float)frames/frames_per_sec)*1000;
138 } else {
139 info->sampling_rate = 4;
140 info->bitrate = 128000;
141 info->length = 0;
142 info->channels = 0;
143 }
144
145 return 0;
146 }
147
148 int get_AAC_format(char *filename, faadAACInfo *info)
149 {
150 unsigned long tagsize;
151 FILE *file;
152 char buffer[10];
153 unsigned long file_len;
154 unsigned char adxx_id[5];
155 unsigned long tmp;
156
157 memset(info, 0, sizeof(faadAACInfo));
158
159 file = fopen(filename, "rb");
160
161 if(file == NULL)
162 return -1;
163
164 fseek(file, 0, SEEK_END);
165 file_len = ftell(file);
166 fseek(file, 0, SEEK_SET);
167
168 /* Skip the tag, if it's there */
169 tmp = fread(buffer, 10, 1, file);
170
171 if (StringComp(buffer, "ID3", 3) == 0)
172 {
173 /* high bit is not used */
174 tagsize = (buffer[6] << 21) | (buffer[7] << 14) |
175 (buffer[8] << 7) | (buffer[9] << 0);
176
177 fseek(file, tagsize, SEEK_CUR);
178 tagsize += 10;
179 } else {
180 tagsize = 0;
181 fseek(file, 0, SEEK_SET);
182 }
183
184 if (file_len)
185 file_len -= tagsize;
186
187 tmp = fread(adxx_id, 2, 1, file);
188 adxx_id[5-1] = 0;
189 info->length = 0;
190
191 /* Determine the header type of the file, check the first two bytes */
192 if (StringComp(adxx_id, "AD", 2) == 0)
193 {
194 /* We think its an ADIF header, but check the rest just to make sure */
195 tmp = fread(adxx_id + 2, 2, 1, file);
196
197 if (StringComp(adxx_id, "ADIF", 4) == 0)
198 {
199 read_ADIF_header(file, info);
200
201 info->length = (int)((float)file_len*8000.0/((float)info->bitrate));
202 }
203 } else {
204 /* No ADIF, check for ADTS header */
205 if ((adxx_id[0] == 0xFF)&&((adxx_id[1] & 0xF6) == 0xF0))
206 {
207 /* ADTS header located */
208 fseek(file, tagsize, SEEK_SET);
209 read_ADTS_header(file, info);
210 } else {
211 /* Unknown/headerless AAC file, assume format: */
212 info->version = 2;
213 info->bitrate = 128000;
214 info->sampling_rate = 44100;
215 info->channels = 2;
216 info->headertype = 0;
217 info->object_type = 1;
218 }
219 }
220
221 fclose(file);
222
223 return 0;
224 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: aacinfo.h,v 1.3 2003/07/29 08:20:14 menno Exp $
25 **/
26
27 #ifndef AACINFO_INCLUDED
28 #define AACINFO_INCLUDED
29
30 typedef struct {
31 int version;
32 int channels;
33 int sampling_rate;
34 int bitrate;
35 int length;
36 int object_type;
37 int headertype;
38 } faadAACInfo;
39
40 int get_AAC_format(char *filename, faadAACInfo *info);
41
42 static int read_ADIF_header(FILE *file, faadAACInfo *info);
43 static int read_ADTS_header(FILE *file, faadAACInfo *info);
44
45 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: config.c,v 1.6 2003/09/03 20:19:07 menno Exp $
25 **/
26
27 #define WIN32_LEAN_AND_MEAN
28 #include <windows.h>
29 #include "config.h"
30
31 char app_name[] = "AudioCoding.com MPEG-4 General Audio player";
32 char INI_FILE[MAX_PATH];
33 int m_priority = 3;
34 int m_resolution = 0;
35 int m_show_errors = 1;
36 int m_use_for_aac = 1;
37 int m_downmix = 0;
38 int m_vbr_display = 0;
39 char titleformat[MAX_PATH];
40
41 void _r_s(char *name,char *data, int mlen)
42 {
43 char buf[10];
44 strcpy(buf,data);
45 GetPrivateProfileString(app_name,name,buf,data,mlen,INI_FILE);
46 }
47
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: config.h,v 1.6 2003/09/03 20:19:07 menno Exp $
25 **/
26
27 char app_name[];
28 char INI_FILE[];
29 int m_priority;
30 int m_resolution;
31 int m_show_errors;
32 int m_use_for_aac;
33 int m_downmix;
34 int m_vbr_display;
35 char titleformat[MAX_PATH];
36
37 #define RS(x) (_r_s(#x,x,sizeof(x)))
38 #define WS(x) (WritePrivateProfileString(app_name,#x,x,INI_FILE))
39
40 void _r_s(char *name,char *data, int mlen);
41
0 #include "out.h"
1
2 // note: exported symbol is now winampGetInModule2.
3
4 #define IN_VER 0x100
5
6 typedef struct
7 {
8 int version; // module type (IN_VER)
9 char *description; // description of module, with version string
10
11 HWND hMainWindow; // winamp's main window (filled in by winamp)
12 HINSTANCE hDllInstance; // DLL instance handle (Also filled in by winamp)
13
14 char *FileExtensions; // "mp3\0Layer 3 MPEG\0mp2\0Layer 2 MPEG\0mpg\0Layer 1 MPEG\0"
15 // May be altered from Config, so the user can select what they want
16
17 int is_seekable; // is this stream seekable?
18 int UsesOutputPlug; // does this plug-in use the output plug-ins? (musn't ever change, ever :)
19
20 void (*Config)(HWND hwndParent); // configuration dialog
21 void (*About)(HWND hwndParent); // about dialog
22
23 void (*Init)(); // called at program init
24 void (*Quit)(); // called at program quit
25
26 void (*GetFileInfo)(char *file, char *title, int *length_in_ms); // if file == NULL, current playing is used
27 int (*InfoBox)(char *file, HWND hwndParent);
28
29 int (*IsOurFile)(char *fn); // called before extension checks, to allow detection of mms://, etc
30 // playback stuff
31 int (*Play)(char *fn); // return zero on success, -1 on file-not-found, some other value on other (stopping winamp) error
32 void (*Pause)(); // pause stream
33 void (*UnPause)(); // unpause stream
34 int (*IsPaused)(); // ispaused? return 1 if paused, 0 if not
35 void (*Stop)(); // stop (unload) stream
36
37 // time stuff
38 int (*GetLength)(); // get length in ms
39 int (*GetOutputTime)(); // returns current output time in ms. (usually returns outMod->GetOutputTime()
40 void (*SetOutputTime)(int time_in_ms); // seeks to point in stream (in ms). Usually you signal yoru thread to seek, which seeks and calls outMod->Flush()..
41
42 // volume stuff
43 void (*SetVolume)(int volume); // from 0 to 255.. usually just call outMod->SetVolume
44 void (*SetPan)(int pan); // from -127 to 127.. usually just call outMod->SetPan
45
46 // in-window builtin vis stuff
47
48 void (*SAVSAInit)(int maxlatency_in_ms, int srate); // call once in Play(). maxlatency_in_ms should be the value returned from outMod->Open()
49 // call after opening audio device with max latency in ms and samplerate
50 void (*SAVSADeInit)(); // call in Stop()
51
52
53 // simple vis supplying mode
54 void (*SAAddPCMData)(void *PCMData, int nch, int bps, int timestamp);
55 // sets the spec data directly from PCM data
56 // quick and easy way to get vis working :)
57 // needs at least 576 samples :)
58
59 // advanced vis supplying mode, only use if you're cool. Use SAAddPCMData for most stuff.
60 int (*SAGetMode)(); // gets csa (the current type (4=ws,2=osc,1=spec))
61 // use when calling SAAdd()
62 void (*SAAdd)(void *data, int timestamp, int csa); // sets the spec data, filled in by winamp
63
64
65 // vis stuff (plug-in)
66 // simple vis supplying mode
67 void (*VSAAddPCMData)(void *PCMData, int nch, int bps, int timestamp); // sets the vis data directly from PCM data
68 // quick and easy way to get vis working :)
69 // needs at least 576 samples :)
70
71 // advanced vis supplying mode, only use if you're cool. Use VSAAddPCMData for most stuff.
72 int (*VSAGetMode)(int *specNch, int *waveNch); // use to figure out what to give to VSAAdd
73 void (*VSAAdd)(void *data, int timestamp); // filled in by winamp, called by plug-in
74
75
76 // call this in Play() to tell the vis plug-ins the current output params.
77 void (*VSASetInfo)(int nch, int srate);
78
79
80 // dsp plug-in processing:
81 // (filled in by winamp, called by input plug)
82
83 // returns 1 if active (which means that the number of samples returned by dsp_dosamples
84 // could be greater than went in.. Use it to estimate if you'll have enough room in the
85 // output buffer
86 int (*dsp_isactive)();
87
88 // returns number of samples to output. This can be as much as twice numsamples.
89 // be sure to allocate enough buffer for samples, then.
90 int (*dsp_dosamples)(short int *samples, int numsamples, int bps, int nch, int srate);
91
92
93 // eq stuff
94 void (*EQSet)(int on, char data[10], int preamp); // 0-64 each, 31 is +0, 0 is +12, 63 is -12. Do nothing to ignore.
95
96 // info setting (filled in by winamp)
97 void (*SetInfo)(int bitrate, int srate, int stereo, int synched); // if -1, changes ignored? :)
98
99 Out_Module *outMod; // filled in by winamp, optionally used :)
100 } In_Module;
101
102
103
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: in_mp4.c,v 1.56 2004/10/19 18:02:10 menno Exp $
25 **/
26
27 //#define DEBUG_OUTPUT
28
29 #define WIN32_LEAN_AND_MEAN
30 #include <windows.h>
31 #include <commctrl.h>
32 #include <commdlg.h>
33 #include <stdlib.h>
34 #include <stdio.h>
35 #include <io.h>
36 #include <math.h>
37 #include <neaacdec.h>
38 #define USE_TAGGING
39 #include <mp4ff.h>
40
41 #include "resource.h"
42 #include "in2.h"
43 #include "utils.h"
44 #include "config.h"
45 #include "aacinfo.h"
46
47 const char *long_ext_list = "MP4\0MPEG-4 Files (*.MP4)\0M4A\0MPEG-4 Files (*.M4A)\0AAC\0AAC Files (*.AAC)\0";
48 const char *short_ext_list = "MP4\0MPEG-4 Files (*.MP4)\0M4A\0MPEG-4 Files (*.M4A)\0";
49
50 static long priority_table[] = {
51 0,
52 THREAD_PRIORITY_HIGHEST,
53 THREAD_PRIORITY_ABOVE_NORMAL,
54 THREAD_PRIORITY_NORMAL,
55 THREAD_PRIORITY_BELOW_NORMAL,
56 THREAD_PRIORITY_LOWEST
57 };
58 static int res_id_table[] = {
59 IDC_16BITS,
60 IDC_24BITS,
61 IDC_32BITS,
62 0,
63 0,
64 /*IDC_16BITS_DITHERED*/ IDC_16BITS /* temp hack */
65 };
66 static int res_table[] = {
67 16,
68 24,
69 32,
70 0,
71 0,
72 16
73 };
74 static char info_fn[_MAX_PATH];
75
76 // post this to the main window at end of file (after playback has stopped)
77 #define WM_WA_AAC_EOF WM_USER+2
78
79 struct seek_list
80 {
81 struct seek_list *next;
82 __int64 offset;
83 };
84
85 typedef struct state
86 {
87 /* general stuff */
88 NeAACDecHandle hDecoder;
89 int samplerate;
90 unsigned char channels;
91 double decode_pos_ms; // current decoding position, in milliseconds
92 int paused; // are we paused?
93 int seek_needed; // if != -1, it is the point that the decode thread should seek to, in ms.
94 char filename[_MAX_PATH];
95 int filetype; /* 0: MP4; 1: AAC */
96 int last_frame;
97 __int64 last_offset;
98
99 /* MP4 stuff */
100 mp4ff_t *mp4file;
101 int mp4track;
102 long numSamples;
103 long sampleId;
104 mp4ff_callback_t mp4cb;
105 FILE *mp4File;
106
107 /* AAC stuff */
108 FILE *aacfile;
109 long m_aac_bytes_into_buffer;
110 long m_aac_bytes_consumed;
111 __int64 m_file_offset;
112 unsigned char *m_aac_buffer;
113 int m_at_eof;
114 double cur_pos_sec;
115 int m_header_type;
116 struct seek_list *m_head;
117 struct seek_list *m_tail;
118 unsigned long m_length;
119
120 /* for gapless decoding */
121 unsigned int useAacLength;
122 unsigned int framesize;
123 unsigned int initial;
124 unsigned long timescale;
125 } state;
126
127 static state mp4state;
128
129 static In_Module module; // the output module (declared near the bottom of this file)
130
131 static int killPlayThread;
132 static int PlayThreadAlive = 0; // 1=play thread still running
133 HANDLE play_thread_handle = INVALID_HANDLE_VALUE; // the handle to the decode thread
134
135 /* Function definitions */
136 void *decode_aac_frame(state *st, NeAACDecFrameInfo *frameInfo);
137 DWORD WINAPI MP4PlayThread(void *b); // the decode thread procedure
138 DWORD WINAPI AACPlayThread(void *b); // the decode thread procedure
139
140
141 uint32_t read_callback(void *user_data, void *buffer, uint32_t length)
142 {
143 return fread(buffer, 1, length, (FILE*)user_data);
144 }
145
146 uint32_t seek_callback(void *user_data, uint64_t position)
147 {
148 return fseek((FILE*)user_data, position, SEEK_SET);
149 }
150
151 uint32_t write_callback(void *user_data, void *buffer, uint32_t length)
152 {
153 return fwrite(buffer, 1, length, (FILE*)user_data);
154 }
155
156 uint32_t truncate_callback(void *user_data)
157 {
158 _chsize(fileno((FILE*)user_data), ftell((FILE*)user_data));
159 return 1;
160 }
161
162
163 int tag_add_field(mp4ff_metadata_t *tags, const char *item, const char *value, size_t v_len)
164 {
165 void *backup = (void *)tags->tags;
166
167 if (!item || (item && !*item) || !value) return 0;
168
169 tags->tags = (mp4ff_tag_t *)realloc(tags->tags, (tags->count+1) * sizeof(mp4ff_tag_t));
170 if (!tags->tags) {
171 if (backup) free(backup);
172 return 0;
173 }
174 else
175 {
176 size_t i_len = strlen(item);
177 if (v_len == 0) v_len = strlen(value);
178
179 tags->tags[tags->count].item = (char *)malloc(i_len+1);
180 tags->tags[tags->count].value = (char *)malloc(v_len+1);
181
182 if (!tags->tags[tags->count].item || !tags->tags[tags->count].value)
183 {
184 if (!tags->tags[tags->count].item) free (tags->tags[tags->count].item);
185 if (!tags->tags[tags->count].value) free (tags->tags[tags->count].value);
186 tags->tags[tags->count].item = NULL;
187 tags->tags[tags->count].value = NULL;
188 return 0;
189 }
190
191 memcpy(tags->tags[tags->count].item, item, i_len);
192 memcpy(tags->tags[tags->count].value, value, v_len);
193 tags->tags[tags->count].item[i_len] = '\0';
194 tags->tags[tags->count].value[v_len] = '\0';
195 // tags->tags[tags->count].len = v_len;
196
197 tags->count++;
198 return 1;
199 }
200 }
201
202 int tag_set_field(mp4ff_metadata_t *tags, const char *item, const char *value, size_t v_len)
203 {
204 unsigned int i;
205
206 if (!item || (item && !*item) || !value) return 0;
207
208 for (i = 0; i < tags->count; i++)
209 {
210 if (!stricmp(tags->tags[i].item, item))
211 {
212 void *backup = (void *)tags->tags[i].value;
213 if (v_len == 0) v_len = strlen(value);
214
215 tags->tags[i].value = (char *)realloc(tags->tags[i].value, v_len+1);
216 if (!tags->tags[i].value)
217 {
218 if (backup) free(backup);
219 return 0;
220 }
221
222 memcpy(tags->tags[i].value, value, v_len);
223 tags->tags[i].value[v_len] = '\0';
224 // tags->tags[i].len = v_len;
225
226 return 1;
227 }
228 }
229
230 return tag_add_field(tags, item, value, v_len);
231 }
232
233 int tag_delete(mp4ff_metadata_t *tags)
234 {
235 unsigned int i;
236
237 for (i = 0; i < tags->count; i++)
238 {
239 if (tags->tags[i].item) free(tags->tags[i].item);
240 if (tags->tags[i].value) free(tags->tags[i].value);
241 }
242
243 if (tags->tags) free(tags->tags);
244
245 tags->tags = NULL;
246 tags->count = 0;
247 }
248
249 int ReadMP4Tag(mp4ff_t *file, mp4ff_metadata_t *tags)
250 {
251 unsigned __int8 *pValue;
252 char *pName;
253 unsigned int i = 0;
254
255 do {
256 pName = 0;
257 pValue = 0;
258
259
260 if (mp4ff_meta_get_by_index(file, i, (char **)&pName, &pValue))
261 {
262 char *val = (char *)strdup(pValue);
263 if (!val) return 0;
264
265 if (pName[0] == '©')
266 {
267 if (memcmp(pName, "©nam", 4) == 0)
268 {
269 tag_add_field(tags, "title", val, strlen(val));
270 } else if (memcmp(pName, "©ART", 4) == 0) {
271 tag_add_field(tags, "artist", val, strlen(val));
272 } else if (memcmp(pName, "©wrt", 4) == 0) {
273 tag_add_field(tags, "writer", val, strlen(val));
274 } else if (memcmp(pName, "©alb", 4) == 0) {
275 tag_add_field(tags, "album", val, strlen(val));
276 } else if (memcmp(pName, "©day", 4) == 0) {
277 tag_add_field(tags, "date", val, strlen(val));
278 } else if (memcmp(pName, "©too", 4) == 0) {
279 tag_add_field(tags, "tool", val, strlen(val));
280 } else if (memcmp(pName, "©cmt", 4) == 0) {
281 tag_add_field(tags, "comment", val, strlen(val));
282 } else if (memcmp(pName, "©gen", 4) == 0) {
283 tag_add_field(tags, "genre", val, strlen(val));
284 } else {
285 tag_add_field(tags, pName, val, strlen(val));
286 }
287 } else if (memcmp(pName, "covr", 4) == 0) {
288 tag_add_field(tags, "cover", val, strlen(val));
289 } else if (memcmp(pName, "gnre", 4) == 0) {
290 tag_add_field(tags, "genre", val, strlen(val));
291 } else if (memcmp(pName, "trkn", 4) == 0) {
292 tag_add_field(tags, "tracknumber", val, strlen(val));
293 } else if (memcmp(pName, "disk", 4) == 0) {
294 tag_add_field(tags, "disc", val, strlen(val));
295 } else if (memcmp(pName, "cpil", 4) == 0) {
296 tag_add_field(tags, "compilation", val, strlen(val));
297 } else if (memcmp(pName, "tmpo", 4) == 0) {
298 tag_add_field(tags, "tempo", val, strlen(val));
299 } else if (memcmp(pName, "NDFL", 4) == 0) {
300 /* Removed */
301 } else {
302 tag_add_field(tags, pName, val, strlen(val));
303 }
304
305 free(val);
306 }
307
308 i++;
309 } while (pValue != NULL);
310
311 return 1;
312 }
313
314
315 #ifdef DEBUG_OUTPUT
316 void in_mp4_DebugOutput(char *message)
317 {
318 char s[1024];
319
320 sprintf(s, "in_mp4: %s", message);
321 OutputDebugString(s);
322 }
323 #endif
324
325 int file_length(FILE *f)
326 {
327 long end = 0;
328 long cur = ftell(f);
329 fseek(f, 0, SEEK_END);
330 end = ftell(f);
331 fseek(f, cur, SEEK_SET);
332
333 return end;
334 }
335
336 static void show_error(HWND hwnd, char *message, ...)
337 {
338 if (m_show_errors)
339 MessageBox(hwnd, message, "Error", MB_OK);
340 }
341
342 static void config_init()
343 {
344 char *p=INI_FILE;
345 GetModuleFileName(NULL,INI_FILE,_MAX_PATH);
346 while (*p) p++;
347 while (p >= INI_FILE && *p != '.') p--;
348 strcpy(p+1,"ini");
349 }
350
351 void config_read()
352 {
353 char priority[10];
354 char resolution[10];
355 char show_errors[10];
356 char use_for_aac[10];
357 char downmix[10];
358 char vbr_display[10];
359
360 config_init();
361
362 strcpy(show_errors, "1");
363 strcpy(priority, "3");
364 strcpy(resolution, "0");
365 strcpy(use_for_aac, "1");
366 strcpy(downmix, "0");
367 strcpy(vbr_display, "1");
368 strcpy(titleformat, "%7");
369
370 RS(priority);
371 RS(resolution);
372 RS(show_errors);
373 RS(use_for_aac);
374 RS(downmix);
375 RS(vbr_display);
376 RS(titleformat);
377
378 m_priority = atoi(priority);
379 m_resolution = atoi(resolution);
380 m_show_errors = atoi(show_errors);
381 m_use_for_aac = atoi(use_for_aac);
382 m_downmix = atoi(downmix);
383 m_vbr_display = atoi(vbr_display);
384 }
385
386 void config_write()
387 {
388 char priority[10];
389 char resolution[10];
390 char show_errors[10];
391 char use_for_aac[10];
392 char downmix[10];
393 char vbr_display[10];
394
395 itoa(m_priority, priority, 10);
396 itoa(m_resolution, resolution, 10);
397 itoa(m_show_errors, show_errors, 10);
398 itoa(m_use_for_aac, use_for_aac, 10);
399 itoa(m_downmix, downmix, 10);
400 itoa(m_vbr_display, vbr_display, 10);
401
402 WS(priority);
403 WS(resolution);
404 WS(show_errors);
405 WS(use_for_aac);
406 WS(downmix);
407 WS(vbr_display);
408 WS(titleformat);
409 }
410
411 void init()
412 {
413 config_read();
414 }
415
416 void quit()
417 {
418 }
419
420 /* Convert UNICODE to UTF-8
421 Return number of bytes written */
422 int unicodeToUtf8 ( const WCHAR* lpWideCharStr, char* lpMultiByteStr, int cwcChars )
423 {
424 const unsigned short* pwc = (unsigned short *)lpWideCharStr;
425 unsigned char* pmb = (unsigned char *)lpMultiByteStr;
426 const unsigned short* pwce;
427 size_t cBytes = 0;
428
429 if ( cwcChars >= 0 ) {
430 pwce = pwc + cwcChars;
431 } else {
432 pwce = (unsigned short *)((size_t)-1);
433 }
434
435 while ( pwc < pwce ) {
436 unsigned short wc = *pwc++;
437
438 if ( wc < 0x00000080 ) {
439 *pmb++ = (char)wc;
440 cBytes++;
441 } else
442 if ( wc < 0x00000800 ) {
443 *pmb++ = (char)(0xC0 | ((wc >> 6) & 0x1F));
444 cBytes++;
445 *pmb++ = (char)(0x80 | (wc & 0x3F));
446 cBytes++;
447 } else
448 if ( wc < 0x00010000 ) {
449 *pmb++ = (char)(0xE0 | ((wc >> 12) & 0x0F));
450 cBytes++;
451 *pmb++ = (char)(0x80 | ((wc >> 6) & 0x3F));
452 cBytes++;
453 *pmb++ = (char)(0x80 | (wc & 0x3F));
454 cBytes++;
455 }
456 if ( wc == L'\0' )
457 return cBytes;
458 }
459
460 return cBytes;
461 }
462
463 /* Convert UTF-8 coded string to UNICODE
464 Return number of characters converted */
465 int utf8ToUnicode ( const char* lpMultiByteStr, WCHAR* lpWideCharStr, int cmbChars )
466 {
467 const unsigned char* pmb = (unsigned char *)lpMultiByteStr;
468 unsigned short* pwc = (unsigned short *)lpWideCharStr;
469 const unsigned char* pmbe;
470 size_t cwChars = 0;
471
472 if ( cmbChars >= 0 ) {
473 pmbe = pmb + cmbChars;
474 } else {
475 pmbe = (unsigned char *)((size_t)-1);
476 }
477
478 while ( pmb < pmbe ) {
479 char mb = *pmb++;
480 unsigned int cc = 0;
481 unsigned int wc;
482
483 while ( (cc < 7) && (mb & (1 << (7 - cc)))) {
484 cc++;
485 }
486
487 if ( cc == 1 || cc > 6 ) // illegal character combination for UTF-8
488 continue;
489
490 if ( cc == 0 ) {
491 wc = mb;
492 } else {
493 wc = (mb & ((1 << (7 - cc)) - 1)) << ((cc - 1) * 6);
494 while ( --cc > 0 ) {
495 if ( pmb == pmbe ) // reached end of the buffer
496 return cwChars;
497 mb = *pmb++;
498 if ( ((mb >> 6) & 0x03) != 2 ) // not part of multibyte character
499 return cwChars;
500 wc |= (mb & 0x3F) << ((cc - 1) * 6);
501 }
502 }
503
504 if ( wc & 0xFFFF0000 )
505 wc = L'?';
506 *pwc++ = wc;
507 cwChars++;
508 if ( wc == L'\0' )
509 return cwChars;
510 }
511
512 return cwChars;
513 }
514
515 /* convert Windows ANSI to UTF-8 */
516 int ConvertANSIToUTF8 ( const char* ansi, char* utf8 )
517 {
518 WCHAR* wszValue; // Unicode value
519 size_t ansi_len;
520 size_t len;
521
522 *utf8 = '\0';
523 if ( ansi == NULL )
524 return 0;
525
526 ansi_len = strlen ( ansi );
527
528 if ( (wszValue = (WCHAR *)malloc ( (ansi_len + 1) * 2 )) == NULL )
529 return 0;
530
531 /* Convert ANSI value to Unicode */
532 if ( (len = MultiByteToWideChar ( CP_ACP, 0, ansi, ansi_len + 1, wszValue, (ansi_len + 1) * 2 )) == 0 ) {
533 free ( wszValue );
534 return 0;
535 }
536
537 /* Convert Unicode value to UTF-8 */
538 if ( (len = unicodeToUtf8 ( wszValue, utf8, -1 )) == 0 ) {
539 free ( wszValue );
540 return 0;
541 }
542
543 free ( wszValue );
544
545 return len-1;
546 }
547
548 /* convert UTF-8 to Windows ANSI */
549 int ConvertUTF8ToANSI ( const char* utf8, char* ansi )
550 {
551 WCHAR* wszValue; // Unicode value
552 size_t utf8_len;
553 size_t len;
554
555 *ansi = '\0';
556 if ( utf8 == NULL )
557 return 0;
558
559 utf8_len = strlen ( utf8 );
560
561 if ( (wszValue = (WCHAR *)malloc ( (utf8_len + 1) * 2 )) == NULL )
562 return 0;
563
564 /* Convert UTF-8 value to Unicode */
565 if ( (len = utf8ToUnicode ( utf8, wszValue, utf8_len + 1 )) == 0 ) {
566 free ( wszValue );
567 return 0;
568 }
569
570 /* Convert Unicode value to ANSI */
571 if ( (len = WideCharToMultiByte ( CP_ACP, 0, wszValue, -1, ansi, (utf8_len + 1) * 2, NULL, NULL )) == 0 ) {
572 free ( wszValue );
573 return 0;
574 }
575
576 free ( wszValue );
577
578 return len-1;
579 }
580
581 BOOL uSetDlgItemText(HWND hwnd, int id, const char *str)
582 {
583 char *temp;
584 size_t len;
585 int r;
586
587 if (!str) return FALSE;
588 if (!*str) return TRUE;
589 len = strlen(str);
590 temp = malloc(len+1);
591 if (!temp) return FALSE;
592 r = ConvertUTF8ToANSI(str, temp);
593 if (r > 0)
594 SetDlgItemText(hwnd, id, temp);
595 free(temp);
596
597 return r>0 ? TRUE : FALSE;
598 }
599
600 UINT uGetDlgItemText(HWND hwnd, int id, char *str, int max)
601 {
602 char *temp, *utf8;
603 int len;
604 HWND w;
605
606 if (!str || !max) return 0;
607 *str = '\0';
608 w = GetDlgItem(hwnd, id);
609 len = GetWindowTextLength(w);
610 temp = malloc(len+1);
611 if (!temp) return 0;
612 utf8 = malloc((len+1)*4);
613 if (!utf8)
614 {
615 free(temp);
616 return 0;
617 }
618
619 len = GetWindowText(w, temp, len+1);
620 if (len > 0)
621 {
622 len = ConvertANSIToUTF8(temp, utf8);
623 if (len > max-1)
624 {
625 len = max-1;
626 utf8[max] = '\0';
627 }
628 memcpy(str, utf8, len+1);
629 }
630
631 free(temp);
632 free(utf8);
633
634 return len;
635 }
636
637 static void mp4fileinfo(mp4ff_t *mp4, char *info, size_t len)
638 {
639 char *ot[6] = { "NULL", "MAIN AAC", "LC AAC", "SSR AAC", "LTP AAC", "HE AAC" };
640 long samples;
641 float f = 1024.0;
642 float seconds;
643 int track;
644
645 NeAACDecHandle hDecoder;
646 NeAACDecFrameInfo frameInfo;
647 mp4AudioSpecificConfig mp4ASC = {0};
648 unsigned char *buffer = NULL;
649 int buffer_size = 0;
650 unsigned long sr = 0;
651 unsigned char ch = 0;
652
653 if ((track = GetAACTrack(mp4)) < 0)
654 {
655 info[0] = '\0';
656 return;
657 }
658
659 hDecoder = NeAACDecOpen();
660
661 samples = mp4ff_num_samples(mp4, track);
662
663 mp4ff_get_decoder_config(mp4, track, &buffer, &buffer_size);
664 if (buffer)
665 {
666 if (NeAACDecAudioSpecificConfig(buffer, buffer_size, &mp4ASC) >= 0)
667 {
668 if (mp4ASC.frameLengthFlag == 1) f = 960.0;
669 if (mp4ASC.sbr_present_flag == 1) f *= 2;
670 }
671
672 if(NeAACDecInit2(hDecoder, buffer, buffer_size, &sr, &ch) < 0)
673 {
674 /* If some error initializing occured, skip the file */
675 free(buffer);
676 return;
677 }
678
679 free(buffer);
680 buffer = NULL;
681 }
682
683 if (mp4ff_read_sample(mp4, track, 0, &buffer, &buffer_size) == 0)
684 {
685 return;
686 }
687 NeAACDecDecode(hDecoder, &frameInfo, buffer, buffer_size);
688
689 if (buffer) free(buffer);
690
691 seconds = (float)samples*(float)(f-1.0)/(float)mp4ASC.samplingFrequency;
692
693 wsprintf(info, "MPEG-4 %s, %d.%d secs, %d ch, %d Hz\nSBR: %s\nParametric stereo: %s",
694 ot[(mp4ASC.objectTypeIndex > 5)?0:mp4ASC.objectTypeIndex],
695 (int)(seconds),
696 (int)(seconds*1000.0 + 0.5) % 1000,
697 mp4ASC.channelsConfiguration,
698 mp4ASC.samplingFrequency,
699 /* SBR: 0: off, 1: on; upsample, 2: on; downsampled, 3: off; upsampled */
700 (frameInfo.sbr == 0) ? "off" : ((frameInfo.sbr == 1) ? "on, normal" : ((frameInfo.sbr == 2) ? "on, downsampled" : "off, upsampled")),
701 (frameInfo.ps == 0) ? "no" : "yes");
702
703 NeAACDecClose(hDecoder);
704 }
705
706 BOOL CALLBACK mp4_info_dialog_proc(HWND hwndDlg, UINT message,
707 WPARAM wParam, LPARAM lParam)
708 {
709 char file_info[1024];
710 mp4ff_t *file;
711 FILE *mp4File;
712 mp4ff_callback_t mp4cb = {0};
713 char *pVal;
714 mp4ff_metadata_t tags;
715 char dummy1[1024];
716 char temp[1024];
717 int dummy, dummy2, dummy3;
718 tags.count = 0;
719 tags.tags = NULL;
720
721 #ifdef DEBUG_OUTPUT
722 in_mp4_DebugOutput("mp4_info_dialog_proc");
723 #endif
724
725 switch (message) {
726 case WM_INITDIALOG:
727 EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT), FALSE);
728 ShowWindow(GetDlgItem(hwndDlg,IDC_CONVERT), SW_HIDE);
729 EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT1), FALSE);
730 ShowWindow(GetDlgItem(hwndDlg,IDC_CONVERT1), SW_HIDE);
731 EnableWindow(GetDlgItem(hwndDlg,IDC_CONVERT2), FALSE);
732 ShowWindow(GetDlgItem(hwndDlg,IDC_CONVERT2), SW_HIDE);
733
734 mp4File = fopen(info_fn, "rb");
735 mp4cb.read = read_callback;
736 mp4cb.seek = seek_callback;
737 mp4cb.user_data = mp4File;
738
739
740 file = mp4ff_open_read(&mp4cb);
741 if (file == NULL)
742 return FALSE;
743
744 mp4fileinfo(file, file_info, 1024);
745 SetDlgItemText(hwndDlg, IDC_INFOTEXT, file_info);
746
747 /* get Metadata */
748
749 pVal = NULL;
750 if (mp4ff_meta_get_title(file, &pVal))
751 uSetDlgItemText(hwndDlg,IDC_METANAME, pVal);
752
753 pVal = NULL;
754 if (mp4ff_meta_get_artist(file, &pVal))
755 uSetDlgItemText(hwndDlg,IDC_METAARTIST, pVal);
756
757 pVal = NULL;
758 if (mp4ff_meta_get_writer(file, &pVal))
759 uSetDlgItemText(hwndDlg,IDC_METAWRITER, pVal);
760
761 pVal = NULL;
762 if (mp4ff_meta_get_comment(file, &pVal))
763 uSetDlgItemText(hwndDlg,IDC_METACOMMENTS, pVal);
764
765 pVal = NULL;
766 if (mp4ff_meta_get_album(file, &pVal))
767 uSetDlgItemText(hwndDlg,IDC_METAALBUM, pVal);
768
769 pVal = NULL;
770 if (mp4ff_meta_get_genre(file, &pVal))
771 uSetDlgItemText(hwndDlg,IDC_METAGENRE, pVal);
772
773 pVal = NULL;
774 if (mp4ff_meta_get_track(file, &pVal))
775 {
776 SetDlgItemText(hwndDlg,IDC_METATRACK1, pVal);
777
778 //pVal = NULL;
779 //mp4ff_meta_get_totaltracks(file, &pVal);
780 //SetDlgItemText(hwndDlg, IDC_METATRACK2, pVal);
781 }
782
783 pVal = NULL;
784 if (mp4ff_meta_get_disc(file, &pVal))
785 {
786 SetDlgItemText(hwndDlg,IDC_METADISK1, pVal);
787
788 //pVal = NULL;
789 //mp4ff_meta_get_totaldiscs(file, &pVal);
790 //SetDlgItemText(hwndDlg,IDC_METADISK2, pVal);
791 }
792
793 pVal = NULL;
794 if (mp4ff_meta_get_date(file, &pVal))
795 uSetDlgItemText(hwndDlg,IDC_METAYEAR, pVal);
796
797 #if 0
798 /* WERKT NIET */
799 #endif
800 pVal = NULL;
801 if (mp4ff_meta_get_compilation(file, &pVal))
802 {
803 if (strcmp(pVal, "1") == 0)
804 {
805 SendMessage(GetDlgItem(hwndDlg, IDC_METACOMPILATION), BM_SETCHECK, BST_CHECKED, 0);
806 }
807 }
808
809 /* ! Metadata */
810
811 mp4ff_close(file);
812 fclose(mp4File);
813
814 return TRUE;
815
816 case WM_COMMAND:
817 switch (LOWORD(wParam)) {
818 case IDCANCEL:
819 EndDialog(hwndDlg, wParam);
820 return TRUE;
821 case IDOK:
822
823 /* trying to edit currently playing file */
824
825 if (!stricmp(info_fn, mp4state.filename))
826 {
827 MessageBox(module.hMainWindow, "Please stop playback before editing tags", "in_mp4", MB_ICONINFORMATION|MB_OK);
828 return TRUE;
829 }
830
831 /* save Metadata changes */
832
833 tag_delete(&tags);
834
835 mp4File = fopen(info_fn, "rb");
836 mp4cb.read = read_callback;
837 mp4cb.seek = seek_callback;
838 mp4cb.write = write_callback;
839 mp4cb.truncate = truncate_callback;
840 mp4cb.user_data = mp4File;
841
842
843 file = mp4ff_open_read(&mp4cb);
844 if (file != NULL)
845 {
846 ReadMP4Tag(file, &tags);
847 mp4ff_close(file);
848 fclose(mp4File);
849 }
850
851 mp4File = fopen(info_fn, "rb+");
852 mp4cb.read = read_callback;
853 mp4cb.seek = seek_callback;
854 mp4cb.write = write_callback;
855 mp4cb.truncate = truncate_callback;
856 mp4cb.user_data = mp4File;
857
858
859 uGetDlgItemText(hwndDlg, IDC_METANAME, dummy1, 1024);
860 tag_set_field(&tags, "title", dummy1, strlen(dummy1));
861
862 uGetDlgItemText(hwndDlg, IDC_METAWRITER, dummy1, 1024);
863 tag_set_field(&tags, "writer", dummy1, strlen(dummy1));
864
865 uGetDlgItemText(hwndDlg, IDC_METAARTIST, dummy1, 1024);
866 tag_set_field(&tags, "artist", dummy1, strlen(dummy1));
867
868 uGetDlgItemText(hwndDlg, IDC_METAALBUM, dummy1, 1024);
869 tag_set_field(&tags, "album", dummy1, strlen(dummy1));
870
871 uGetDlgItemText(hwndDlg, IDC_METACOMMENTS, dummy1, 1024);
872 tag_set_field(&tags, "comment", dummy1, strlen(dummy1));
873
874 uGetDlgItemText(hwndDlg, IDC_METAGENRE, dummy1, 1024);
875 tag_set_field(&tags, "genre", dummy1, strlen(dummy1));
876
877 uGetDlgItemText(hwndDlg, IDC_METAYEAR, dummy1, 1024);
878 tag_set_field(&tags, "year", dummy1, strlen(dummy1));
879
880 GetDlgItemText(hwndDlg, IDC_METATRACK1, dummy1, 1024);
881 dummy = atoi(dummy1);
882 //GetDlgItemText(hwndDlg, IDC_METATRACK2, dummy1, 1024);
883 //dummy2 = atoi(dummy1);
884 //wsprintf(temp, "%d/%d", dummy, dummy2);
885 wsprintf(temp, "%d", dummy);
886 tag_set_field(&tags, "track", temp, strlen(dummy1));
887
888 GetDlgItemText(hwndDlg, IDC_METADISK1, dummy1, 1024);
889 dummy = atoi(dummy1);
890 //GetDlgItemText(hwndDlg, IDC_METADISK2, dummy1, 1024);
891 //dummy2 = atoi(dummy1);
892 //wsprintf(temp, "%d/%d", dummy, dummy2);
893 wsprintf(temp, "%d", dummy);
894 tag_set_field(&tags, "disc", temp, strlen(dummy1));
895
896 dummy3 = SendMessage(GetDlgItem(hwndDlg, IDC_METACOMPILATION), BM_GETCHECK, 0, 0);
897 tag_set_field(&tags, "compilation", (dummy3 ? "1" : "0"), 1);
898
899 mp4ff_meta_update(&mp4cb, &tags);
900
901 fclose(mp4File);
902
903 /* ! */
904
905 EndDialog(hwndDlg, wParam);
906 return TRUE;
907 }
908 }
909 return FALSE;
910 }
911
912 /* returns the name of the object type */
913 char *get_ot_string(int ot)
914 {
915 switch (ot)
916 {
917 case 0:
918 return "Main";
919 case 1:
920 return "LC";
921 case 2:
922 return "SSR";
923 case 3:
924 return "LTP";
925 }
926 return NULL;
927 }
928
929 BOOL CALLBACK aac_info_dialog_proc(HWND hwndDlg, UINT message,
930 WPARAM wParam, LPARAM lParam)
931 {
932 faadAACInfo aacInfo;
933 char *info_text, *header_string;
934
935 #ifdef DEBUG_OUTPUT
936 in_mp4_DebugOutput("aac_info_dialog_proc");
937 #endif
938
939 switch (message) {
940 case WM_INITDIALOG:
941 EnableWindow(GetDlgItem(hwndDlg,IDC_USERDATA), FALSE) ;
942 ShowWindow(GetDlgItem(hwndDlg,IDC_USERDATA), SW_HIDE);
943
944 ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC1), SW_HIDE);
945 ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC2), SW_HIDE);
946 ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC3), SW_HIDE);
947 ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC4), SW_HIDE);
948 ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC5), SW_HIDE);
949 ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC6), SW_HIDE);
950 ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC7), SW_HIDE);
951 ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC8), SW_HIDE);
952 ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC9), SW_HIDE);
953 ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC10), SW_HIDE);
954 ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC11), SW_HIDE);
955 ShowWindow(GetDlgItem(hwndDlg,IDC_STATIC12), SW_HIDE);
956
957 ShowWindow(GetDlgItem(hwndDlg,IDC_METANAME), SW_HIDE);
958 ShowWindow(GetDlgItem(hwndDlg,IDC_METAARTIST), SW_HIDE);
959 ShowWindow(GetDlgItem(hwndDlg,IDC_METAWRITER), SW_HIDE);
960 ShowWindow(GetDlgItem(hwndDlg,IDC_METACOMMENTS), SW_HIDE);
961 ShowWindow(GetDlgItem(hwndDlg,IDC_METAALBUM), SW_HIDE);
962 ShowWindow(GetDlgItem(hwndDlg,IDC_METAGENRE), SW_HIDE);
963 ShowWindow(GetDlgItem(hwndDlg,IDC_METATRACK1), SW_HIDE);
964 //ShowWindow(GetDlgItem(hwndDlg,IDC_METATRACK2), SW_HIDE);
965 ShowWindow(GetDlgItem(hwndDlg,IDC_METADISK1), SW_HIDE);
966 //ShowWindow(GetDlgItem(hwndDlg,IDC_METADISK2), SW_HIDE);
967 ShowWindow(GetDlgItem(hwndDlg,IDC_METAYEAR), SW_HIDE);
968 ShowWindow(GetDlgItem(hwndDlg,IDC_METACOMPILATION), SW_HIDE);
969
970 info_text = malloc(1024*sizeof(char));
971
972 get_AAC_format(info_fn, &aacInfo);
973
974 switch (aacInfo.headertype)
975 {
976 case 0: /* RAW */
977 header_string = " RAW";
978 break;
979 case 1: /* ADIF */
980 header_string = " ADIF";
981 break;
982 case 2: /* ADTS */
983 header_string = " ADTS";
984 break;
985 }
986
987 sprintf(info_text, "%s AAC %s%s, %d sec, %d kbps, %d Hz",
988 (aacInfo.version==2)?"MPEG-2":"MPEG-4", get_ot_string(aacInfo.object_type),
989 header_string,
990 (int)((float)aacInfo.length/1000.0), (int)((float)aacInfo.bitrate/1000.0+0.5),
991 aacInfo.sampling_rate);
992
993 SetDlgItemText(hwndDlg, IDC_INFOTEXT, info_text);
994
995 free(info_text);
996
997 return TRUE;
998
999 case WM_COMMAND:
1000 switch (LOWORD(wParam))
1001 {
1002 case IDCANCEL:
1003 case IDOK:
1004 EndDialog(hwndDlg, wParam);
1005 return TRUE;
1006 }
1007 }
1008 return FALSE;
1009 }
1010
1011 int infoDlg(char *fn, HWND hwndParent)
1012 {
1013 if(!stricmp(fn + strlen(fn) - 3,"AAC"))
1014 {
1015 lstrcpy(info_fn, fn);
1016
1017 DialogBox(module.hDllInstance, MAKEINTRESOURCE(IDD_INFO),
1018 hwndParent, aac_info_dialog_proc);
1019 } else {
1020 lstrcpy(info_fn, fn);
1021
1022 DialogBox(module.hDllInstance, MAKEINTRESOURCE(IDD_INFO),
1023 hwndParent, mp4_info_dialog_proc);
1024 }
1025
1026 return 0;
1027 }
1028
1029 /* Get the title from the file */
1030 void ConstructTitle(mp4ff_t *file, char *filename, char *title, char *format)
1031 {
1032 char temp[4096];
1033 int some_info = 0;
1034 char *in = format;
1035 char *out = temp;//title;
1036 char *bound = out + sizeof(temp) - 256; //out + (MAX_PATH - 10 - 1);
1037 char *pVal, dummy1[1024];
1038 short dummy, dummy2;
1039
1040 while (*in && out < bound)
1041 {
1042 switch (*in)
1043 {
1044 case '%':
1045 ++in;
1046 break;
1047
1048 default:
1049 *out++ = *in++;
1050 continue;
1051 }
1052
1053 /* handle % escape sequence */
1054 switch (*in++)
1055 {
1056 case '0':
1057 pVal = NULL;
1058 if (mp4ff_meta_get_track(file, &pVal))
1059 {
1060 out += wsprintf(out, "%s", pVal);
1061 some_info = 1;
1062 }
1063 break;
1064
1065 case '1':
1066 pVal = NULL;
1067 if (mp4ff_meta_get_artist(file, &pVal))
1068 {
1069 out += wsprintf(out, "%s", pVal);
1070 some_info = 1;
1071 }
1072 break;
1073
1074 case '2':
1075 pVal = NULL;
1076 if (mp4ff_meta_get_title(file, &pVal))
1077 {
1078 out += wsprintf(out, "%s", pVal);
1079 some_info = 1;
1080 }
1081 break;
1082
1083 case '3':
1084 pVal = NULL;
1085 if (mp4ff_meta_get_album(file, &pVal))
1086 {
1087 out += wsprintf(out, "%s", pVal);
1088 some_info = 1;
1089 }
1090 break;
1091
1092 case '4':
1093 pVal = NULL;
1094 if (mp4ff_meta_get_date(file, &pVal))
1095 {
1096 out += wsprintf(out, "%s", pVal);
1097 some_info = 1;
1098 }
1099 break;
1100
1101 case '5':
1102 pVal = NULL;
1103 if (mp4ff_meta_get_comment(file, &pVal))
1104 {
1105 out += wsprintf(out, "%s", pVal);
1106 some_info = 1;
1107 }
1108 break;
1109
1110 case '6':
1111 pVal = NULL;
1112 if (mp4ff_meta_get_genre(file, &pVal))
1113 {
1114 out += wsprintf(out, "%s", pVal);
1115 some_info = 1;
1116 }
1117 break;
1118
1119 case '7':
1120 {
1121 const char *p=strrchr(filename,'\\');
1122 if (!p) p=filename; else p++;
1123 out += ConvertANSIToUTF8(p, out);
1124 some_info = 1;
1125 break;
1126 }
1127
1128 default:
1129 break;
1130 }
1131 }
1132
1133 *out = '\0';
1134
1135 if (!some_info)
1136 {
1137 char *p=filename+lstrlen(filename);
1138 while (*p != '\\' && p >= filename) p--;
1139 lstrcpy(title,++p);
1140 }
1141 else
1142 {
1143 int len = ConvertUTF8ToANSI(temp, dummy1);
1144 if (len > (MAX_PATH - 10 - 1)) len = (MAX_PATH - 10 - 1);
1145 memcpy(title, dummy1, len);
1146 title[len] = '\0';
1147 }
1148 }
1149
1150 BOOL CALLBACK config_dialog_proc(HWND hwndDlg, UINT message,
1151 WPARAM wParam, LPARAM lParam)
1152 {
1153 int i;
1154
1155 switch (message) {
1156 case WM_INITDIALOG:
1157 SendMessage(GetDlgItem(hwndDlg, IDC_PRIORITY), TBM_SETRANGE, TRUE, MAKELONG(1,5));
1158 SendMessage(GetDlgItem(hwndDlg, IDC_PRIORITY), TBM_SETPOS, TRUE, m_priority);
1159 SendMessage(GetDlgItem(hwndDlg, res_id_table[m_resolution]), BM_SETCHECK, BST_CHECKED, 0);
1160 if (m_show_errors)
1161 SendMessage(GetDlgItem(hwndDlg, IDC_ERROR), BM_SETCHECK, BST_CHECKED, 0);
1162 if (m_use_for_aac)
1163 SendMessage(GetDlgItem(hwndDlg, IDC_USEFORAAC), BM_SETCHECK, BST_CHECKED, 0);
1164 if (m_downmix)
1165 SendMessage(GetDlgItem(hwndDlg, IDC_DOWNMIX), BM_SETCHECK, BST_CHECKED, 0);
1166 if (m_vbr_display)
1167 SendMessage(GetDlgItem(hwndDlg, IDC_VBR), BM_SETCHECK, BST_CHECKED, 0);
1168 SetDlgItemText(hwndDlg, IDC_TITLEFORMAT, titleformat);
1169 return TRUE;
1170
1171 case WM_COMMAND:
1172 switch (LOWORD(wParam)) {
1173 case IDCANCEL:
1174 EndDialog(hwndDlg, wParam);
1175 return TRUE;
1176 case IDOK:
1177 m_show_errors = SendMessage(GetDlgItem(hwndDlg, IDC_ERROR), BM_GETCHECK, 0, 0);
1178 m_use_for_aac = SendMessage(GetDlgItem(hwndDlg, IDC_USEFORAAC), BM_GETCHECK, 0, 0);
1179 m_downmix = SendMessage(GetDlgItem(hwndDlg, IDC_DOWNMIX), BM_GETCHECK, 0, 0);
1180 m_vbr_display = SendMessage(GetDlgItem(hwndDlg, IDC_VBR), BM_GETCHECK, 0, 0);
1181 GetDlgItemText(hwndDlg, IDC_TITLEFORMAT, titleformat, MAX_PATH);
1182
1183 m_priority = SendMessage(GetDlgItem(hwndDlg, IDC_PRIORITY), TBM_GETPOS, 0, 0);
1184 for (i = 0; i < 6; i++)
1185 {
1186 if (SendMessage(GetDlgItem(hwndDlg, res_id_table[i]), BM_GETCHECK, 0, 0))
1187 {
1188 m_resolution = i;
1189 break;
1190 }
1191 }
1192
1193 /* save config */
1194 config_write();
1195
1196 if (!m_use_for_aac)
1197 {
1198 module.FileExtensions = short_ext_list;
1199 } else {
1200 module.FileExtensions = long_ext_list;
1201 }
1202
1203 EndDialog(hwndDlg, wParam);
1204 return TRUE;
1205 }
1206 }
1207 return FALSE;
1208 }
1209
1210 void config(HWND hwndParent)
1211 {
1212 DialogBox(module.hDllInstance, MAKEINTRESOURCE(IDD_CONFIG),
1213 hwndParent, config_dialog_proc);
1214
1215 return;
1216 }
1217
1218 void about(HWND hwndParent)
1219 {
1220 MessageBox(hwndParent,
1221 "AudioCoding.com MPEG-4 AAC player " FAAD2_VERSION " compiled on " __DATE__ ".\n"
1222 "Visit the website for more info.\n"
1223 "Copyright 2002-2004 AudioCoding.com",
1224 "About",
1225 MB_OK);
1226 }
1227
1228 int isourfile(char *fn)
1229 {
1230 if (!stricmp(fn + strlen(fn) - 3,"MP4") || !stricmp(fn + strlen(fn) - 3,"M4A"))
1231 {
1232 return 1;
1233 } else if (m_use_for_aac) {
1234 if (!stricmp(fn + strlen(fn) - 3,"AAC"))
1235 {
1236 return 1;
1237 }
1238 }
1239
1240 return 0;
1241 }
1242
1243 int fill_buffer(state *st)
1244 {
1245 int bread;
1246
1247 if (st->m_aac_bytes_consumed > 0)
1248 {
1249 if (st->m_aac_bytes_into_buffer)
1250 {
1251 memmove((void*)st->m_aac_buffer, (void*)(st->m_aac_buffer + st->m_aac_bytes_consumed),
1252 st->m_aac_bytes_into_buffer*sizeof(unsigned char));
1253 }
1254
1255 if (!st->m_at_eof)
1256 {
1257 bread = fread((void*)(st->m_aac_buffer + st->m_aac_bytes_into_buffer),
1258 1, st->m_aac_bytes_consumed, st->aacfile);
1259
1260 if (bread != st->m_aac_bytes_consumed)
1261 st->m_at_eof = 1;
1262
1263 st->m_aac_bytes_into_buffer += bread;
1264 }
1265
1266 st->m_aac_bytes_consumed = 0;
1267
1268 if (st->m_aac_bytes_into_buffer > 3)
1269 {
1270 if (memcmp(st->m_aac_buffer, "TAG", 3) == 0)
1271 st->m_aac_bytes_into_buffer = 0;
1272 }
1273 if (st->m_aac_bytes_into_buffer > 11)
1274 {
1275 if (memcmp(st->m_aac_buffer, "LYRICSBEGIN", 11) == 0)
1276 st->m_aac_bytes_into_buffer = 0;
1277 }
1278 if (st->m_aac_bytes_into_buffer > 8)
1279 {
1280 if (memcmp(st->m_aac_buffer, "APETAGEX", 8) == 0)
1281 st->m_aac_bytes_into_buffer = 0;
1282 }
1283 }
1284
1285 return 1;
1286 }
1287
1288 void advance_buffer(state *st, int bytes)
1289 {
1290 st->m_file_offset += bytes;
1291 st->m_aac_bytes_consumed = bytes;
1292 st->m_aac_bytes_into_buffer -= bytes;
1293 }
1294
1295 int adts_parse(state *st, __int64 *bitrate, double *length)
1296 {
1297 static int sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000};
1298 int frames, frame_length;
1299 int t_framelength = 0;
1300 int samplerate;
1301 double frames_per_sec, bytes_per_frame;
1302
1303 /* Read all frames to ensure correct time and bitrate */
1304 for (frames = 0; /* */; frames++)
1305 {
1306 fill_buffer(st);
1307
1308 if (st->m_aac_bytes_into_buffer > 7)
1309 {
1310 /* check syncword */
1311 if (!((st->m_aac_buffer[0] == 0xFF)&&((st->m_aac_buffer[1] & 0xF6) == 0xF0)))
1312 break;
1313
1314 st->m_tail->offset = st->m_file_offset;
1315 st->m_tail->next = (struct seek_list*)malloc(sizeof(struct seek_list));
1316 st->m_tail = st->m_tail->next;
1317 st->m_tail->next = NULL;
1318
1319 if (frames == 0)
1320 samplerate = sample_rates[(st->m_aac_buffer[2]&0x3c)>>2];
1321
1322 frame_length = ((((unsigned int)st->m_aac_buffer[3] & 0x3)) << 11)
1323 | (((unsigned int)st->m_aac_buffer[4]) << 3) | (st->m_aac_buffer[5] >> 5);
1324
1325 t_framelength += frame_length;
1326
1327 if (frame_length > st->m_aac_bytes_into_buffer)
1328 break;
1329
1330 advance_buffer(st, frame_length);
1331 } else {
1332 break;
1333 }
1334 }
1335
1336 frames_per_sec = (double)samplerate/1024.0;
1337 if (frames != 0)
1338 bytes_per_frame = (double)t_framelength/(double)(frames*1000);
1339 else
1340 bytes_per_frame = 0;
1341 *bitrate = (__int64)(8. * bytes_per_frame * frames_per_sec + 0.5);
1342 if (frames_per_sec != 0)
1343 *length = (double)frames/frames_per_sec;
1344 else
1345 *length = 1;
1346
1347 return 1;
1348 }
1349
1350 int skip_id3v2_tag()
1351 {
1352 unsigned char buf[10];
1353 int bread, tagsize = 0;
1354
1355 bread = fread(buf, 1, 10, mp4state.aacfile);
1356 if (bread != 10) return -1;
1357
1358 if (!memcmp(buf, "ID3", 3))
1359 {
1360 /* high bit is not used */
1361 tagsize = (buf[6] << 21) | (buf[7] << 14) | (buf[8] << 7) | (buf[9] << 0);
1362
1363 tagsize += 10;
1364 fseek(mp4state.aacfile, tagsize, SEEK_SET);
1365 } else {
1366 fseek(mp4state.aacfile, 0, SEEK_SET);
1367 }
1368
1369 return tagsize;
1370 }
1371
1372 int play(char *fn)
1373 {
1374 int maxlatency;
1375 int thread_id;
1376 int avg_bitrate, br, sr;
1377 unsigned char *buffer;
1378 int buffer_size;
1379 NeAACDecConfigurationPtr config;
1380 unsigned char header[8];
1381 FILE *hMP4File;
1382
1383 #ifdef DEBUG_OUTPUT
1384 in_mp4_DebugOutput("play");
1385 #endif
1386
1387 memset(&mp4state, 0, sizeof(state));
1388
1389 lstrcpy(mp4state.filename, fn);
1390
1391 hMP4File = fopen(mp4state.filename, "rb");
1392 if (!hMP4File)
1393 {
1394 return -1;
1395 }
1396 fread(header, 1, 8, hMP4File);
1397 fclose(hMP4File);
1398 mp4state.filetype = 1;
1399 if (header[4] == 'f' && header[5] == 't' && header[6] == 'y' && header[7] == 'p')
1400 mp4state.filetype = 0;
1401
1402 if (mp4state.filetype)
1403 {
1404 int tagsize = 0, tmp = 0, init;
1405 int bread = 0;
1406 double length = 0.;
1407 __int64 bitrate = 128;
1408 // NeAACDecFrameInfo frameInfo;
1409
1410 module.is_seekable = 1;
1411
1412 if (!(mp4state.aacfile = fopen(mp4state.filename, "rb")))
1413 {
1414 // error
1415 return -1;
1416 }
1417
1418 tagsize = skip_id3v2_tag();
1419 if (tagsize<0) return 0;
1420
1421 if (!(mp4state.m_aac_buffer = (unsigned char*)malloc(768*6)))
1422 {
1423 show_error(module.hMainWindow, "Memory allocation error.");
1424 return -1;
1425 }
1426
1427 for (init=0; init<2; init++)
1428 {
1429 mp4state.hDecoder = NeAACDecOpen();
1430 if (!mp4state.hDecoder)
1431 {
1432 show_error(module.hMainWindow, "Unable to open decoder library.");
1433 return -1;
1434 }
1435
1436 config = NeAACDecGetCurrentConfiguration(mp4state.hDecoder);
1437 config->outputFormat = m_resolution + 1;
1438 config->downMatrix = m_downmix;
1439 NeAACDecSetConfiguration(mp4state.hDecoder, config);
1440
1441 memset(mp4state.m_aac_buffer, 0, 768*6);
1442 bread = fread(mp4state.m_aac_buffer, 1, 768*6, mp4state.aacfile);
1443 mp4state.m_aac_bytes_into_buffer = bread;
1444 mp4state.m_aac_bytes_consumed = 0;
1445 mp4state.m_file_offset = 0;
1446 mp4state.m_at_eof = (bread != 768*6) ? 1 : 0;
1447
1448 if (init==0)
1449 {
1450 NeAACDecFrameInfo frameInfo;
1451
1452 fill_buffer(&mp4state);
1453
1454 if ((mp4state.m_aac_bytes_consumed = NeAACDecInit(mp4state.hDecoder,
1455 mp4state.m_aac_buffer, mp4state.m_aac_bytes_into_buffer,
1456 &mp4state.samplerate, &mp4state.channels)) < 0)
1457 {
1458 show_error(module.hMainWindow, "Can't initialize decoder library.");
1459 return -1;
1460 }
1461 advance_buffer(&mp4state, mp4state.m_aac_bytes_consumed);
1462
1463 do {
1464 memset(&frameInfo, 0, sizeof(NeAACDecFrameInfo));
1465 fill_buffer(&mp4state);
1466 NeAACDecDecode(mp4state.hDecoder, &frameInfo, mp4state.m_aac_buffer, mp4state.m_aac_bytes_into_buffer);
1467 } while (!frameInfo.samples && !frameInfo.error);
1468
1469 if (frameInfo.error)
1470 {
1471 show_error(module.hMainWindow, NeAACDecGetErrorMessage(frameInfo.error));
1472 return -1;
1473 }
1474
1475 mp4state.channels = frameInfo.channels;
1476 mp4state.samplerate = frameInfo.samplerate;
1477 mp4state.framesize = (frameInfo.channels != 0) ? frameInfo.samples/frameInfo.channels : 0;
1478 /*
1479 sbr = frameInfo.sbr;
1480 profile = frameInfo.object_type;
1481 header_type = frameInfo.header_type;
1482 */
1483
1484 NeAACDecClose(mp4state.hDecoder);
1485 fseek(mp4state.aacfile, tagsize, SEEK_SET);
1486 }
1487 }
1488
1489 mp4state.m_head = (struct seek_list*)malloc(sizeof(struct seek_list));
1490 mp4state.m_tail = mp4state.m_head;
1491 mp4state.m_tail->next = NULL;
1492
1493 mp4state.m_header_type = 0;
1494 if ((mp4state.m_aac_buffer[0] == 0xFF) && ((mp4state.m_aac_buffer[1] & 0xF6) == 0xF0))
1495 {
1496 if (1) //(can_seek)
1497 {
1498 adts_parse(&mp4state, &bitrate, &length);
1499 fseek(mp4state.aacfile, tagsize, SEEK_SET);
1500
1501 bread = fread(mp4state.m_aac_buffer, 1, 768*6, mp4state.aacfile);
1502 if (bread != 768*6)
1503 mp4state.m_at_eof = 1;
1504 else
1505 mp4state.m_at_eof = 0;
1506 mp4state.m_aac_bytes_into_buffer = bread;
1507 mp4state.m_aac_bytes_consumed = 0;
1508
1509 mp4state.m_header_type = 1;
1510 }
1511 } else if (memcmp(mp4state.m_aac_buffer, "ADIF", 4) == 0) {
1512 int skip_size = (mp4state.m_aac_buffer[4] & 0x80) ? 9 : 0;
1513 bitrate = ((unsigned int)(mp4state.m_aac_buffer[4 + skip_size] & 0x0F)<<19) |
1514 ((unsigned int)mp4state.m_aac_buffer[5 + skip_size]<<11) |
1515 ((unsigned int)mp4state.m_aac_buffer[6 + skip_size]<<3) |
1516 ((unsigned int)mp4state.m_aac_buffer[7 + skip_size] & 0xE0);
1517
1518 length = (double)file_length(mp4state.aacfile);
1519 if (length == -1)
1520 {
1521 module.is_seekable = 0;
1522 length = 0;
1523 } else {
1524 length = ((double)length*8.)/((double)bitrate) + 0.5;
1525 }
1526
1527 mp4state.m_header_type = 2;
1528 } else {
1529 length = (double)file_length(mp4state.aacfile);
1530 length = ((double)length*8.)/((double)bitrate*1000.) + 0.5;
1531
1532 module.is_seekable = 1;
1533 }
1534
1535 mp4state.m_length = (int)(length*1000.);
1536
1537 fill_buffer(&mp4state);
1538 if ((mp4state.m_aac_bytes_consumed = NeAACDecInit(mp4state.hDecoder,
1539 mp4state.m_aac_buffer, mp4state.m_aac_bytes_into_buffer,
1540 &mp4state.samplerate, &mp4state.channels)) < 0)
1541 {
1542 show_error(module.hMainWindow, "Can't initialize decoder library.");
1543 return -1;
1544 }
1545 advance_buffer(&mp4state, mp4state.m_aac_bytes_consumed);
1546
1547 if (mp4state.m_header_type == 2)
1548 avg_bitrate = bitrate;
1549 else
1550 avg_bitrate = bitrate*1000;
1551 } else {
1552 mp4state.hDecoder = NeAACDecOpen();
1553 if (!mp4state.hDecoder)
1554 {
1555 show_error(module.hMainWindow, "Unable to open decoder library.");
1556 return -1;
1557 }
1558
1559 config = NeAACDecGetCurrentConfiguration(mp4state.hDecoder);
1560 config->outputFormat = m_resolution + 1;
1561 config->downMatrix = m_downmix;
1562 NeAACDecSetConfiguration(mp4state.hDecoder, config);
1563
1564 mp4state.mp4File = fopen(mp4state.filename, "rb");
1565 mp4state.mp4cb.read = read_callback;
1566 mp4state.mp4cb.seek = seek_callback;
1567 mp4state.mp4cb.user_data = mp4state.mp4File;
1568
1569
1570 mp4state.mp4file = mp4ff_open_read(&mp4state.mp4cb);
1571 if (!mp4state.mp4file)
1572 {
1573 show_error(module.hMainWindow, "Unable to open file.");
1574 NeAACDecClose(mp4state.hDecoder);
1575 return -1;
1576 }
1577
1578 if ((mp4state.mp4track = GetAACTrack(mp4state.mp4file)) < 0)
1579 {
1580 show_error(module.hMainWindow, "Unsupported Audio track type.");
1581 NeAACDecClose(mp4state.hDecoder);
1582 mp4ff_close(mp4state.mp4file);
1583 fclose(mp4state.mp4File);
1584 return -1;
1585 }
1586
1587 buffer = NULL;
1588 buffer_size = 0;
1589 mp4ff_get_decoder_config(mp4state.mp4file, mp4state.mp4track,
1590 &buffer, &buffer_size);
1591 if (!buffer)
1592 {
1593 NeAACDecClose(mp4state.hDecoder);
1594 mp4ff_close(mp4state.mp4file);
1595 fclose(mp4state.mp4File);
1596 return -1;
1597 }
1598
1599 if(NeAACDecInit2(mp4state.hDecoder, buffer, buffer_size,
1600 &mp4state.samplerate, &mp4state.channels) < 0)
1601 {
1602 /* If some error initializing occured, skip the file */
1603 NeAACDecClose(mp4state.hDecoder);
1604 mp4ff_close(mp4state.mp4file);
1605 fclose(mp4state.mp4File);
1606 if (buffer) free (buffer);
1607 return -1;
1608 }
1609
1610 /* for gapless decoding */
1611 {
1612 mp4AudioSpecificConfig mp4ASC;
1613
1614 mp4state.timescale = mp4ff_time_scale(mp4state.mp4file, mp4state.mp4track);
1615 mp4state.framesize = 1024;
1616 mp4state.useAacLength = 0;
1617
1618 if (buffer)
1619 {
1620 if (NeAACDecAudioSpecificConfig(buffer, buffer_size, &mp4ASC) >= 0)
1621 {
1622 if (mp4ASC.frameLengthFlag == 1) mp4state.framesize = 960;
1623 if (mp4ASC.sbr_present_flag == 1) mp4state.framesize *= 2;
1624 }
1625 }
1626 }
1627
1628 free(buffer);
1629
1630 avg_bitrate = mp4ff_get_avg_bitrate(mp4state.mp4file, mp4state.mp4track);
1631
1632 mp4state.numSamples = mp4ff_num_samples(mp4state.mp4file, mp4state.mp4track);
1633 mp4state.sampleId = 0;
1634
1635 {
1636 double timescale_div = 1.0 / (double)mp4ff_time_scale(mp4state.mp4file, mp4state.mp4track);
1637 int64_t duration = mp4ff_get_track_duration_use_offsets(mp4state.mp4file, mp4state.mp4track);
1638 if (duration == -1)
1639 {
1640 mp4state.m_length = 0;
1641 } else {
1642 mp4state.m_length = (int)((double)duration * timescale_div * 1000.0);
1643 }
1644 }
1645
1646 module.is_seekable = 1;
1647 }
1648
1649 if (mp4state.channels == 0)
1650 {
1651 show_error(module.hMainWindow, "Number of channels not supported for playback.");
1652 NeAACDecClose(mp4state.hDecoder);
1653 if (mp4state.filetype)
1654 fclose(mp4state.aacfile);
1655 else {
1656 mp4ff_close(mp4state.mp4file);
1657 fclose(mp4state.mp4File);
1658 }
1659 return -1;
1660 }
1661
1662 if (m_downmix && (mp4state.channels == 5 || mp4state.channels == 6))
1663 mp4state.channels = 2;
1664
1665 maxlatency = module.outMod->Open(mp4state.samplerate, (int)mp4state.channels,
1666 res_table[m_resolution], -1, -1);
1667
1668 if (maxlatency < 0) // error opening device
1669 {
1670 NeAACDecClose(mp4state.hDecoder);
1671 if (mp4state.filetype)
1672 fclose(mp4state.aacfile);
1673 else {
1674 mp4ff_close(mp4state.mp4file);
1675 fclose(mp4state.mp4File);
1676 }
1677 return -1;
1678 }
1679
1680 mp4state.paused = 0;
1681 mp4state.decode_pos_ms = 0;
1682 mp4state.seek_needed = -1;
1683
1684 // initialize vis stuff
1685 module.SAVSAInit(maxlatency, mp4state.samplerate);
1686 module.VSASetInfo((int)mp4state.channels, mp4state.samplerate);
1687
1688 br = (int)floor(((float)avg_bitrate + 500.0)/1000.0 + 0.5);
1689 sr = (int)floor((float)mp4state.samplerate/1000.0 + 0.5);
1690 module.SetInfo(br, sr, (int)mp4state.channels, 1);
1691
1692 module.outMod->SetVolume(-666); // set the output plug-ins default volume
1693
1694 killPlayThread = 0;
1695
1696 if (mp4state.filetype)
1697 {
1698 if ((play_thread_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)AACPlayThread,
1699 (void *)&killPlayThread, 0, &thread_id)) == NULL)
1700 {
1701 show_error(module.hMainWindow, "Cannot create playback thread");
1702 NeAACDecClose(mp4state.hDecoder);
1703 fclose(mp4state.aacfile);
1704 return -1;
1705 }
1706 } else {
1707 if ((play_thread_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MP4PlayThread,
1708 (void *)&killPlayThread, 0, &thread_id)) == NULL)
1709 {
1710 show_error(module.hMainWindow, "Cannot create playback thread");
1711 NeAACDecClose(mp4state.hDecoder);
1712 mp4ff_close(mp4state.mp4file);
1713 fclose(mp4state.mp4File);
1714 return -1;
1715 }
1716 }
1717
1718 SetThreadAffinityMask(play_thread_handle, 1);
1719
1720 SetThreadPriority(play_thread_handle, priority_table[m_priority]);
1721
1722 return 0;
1723 }
1724
1725 void pause()
1726 {
1727 #ifdef DEBUG_OUTPUT
1728 in_mp4_DebugOutput("pause");
1729 #endif
1730
1731 mp4state.paused = 1;
1732 module.outMod->Pause(1);
1733 }
1734
1735 void unpause()
1736 {
1737 #ifdef DEBUG_OUTPUT
1738 in_mp4_DebugOutput("unpause");
1739 #endif
1740
1741 mp4state.paused = 0;
1742 module.outMod->Pause(0);
1743 }
1744
1745 int ispaused()
1746 {
1747 #ifdef DEBUG_OUTPUT
1748 in_mp4_DebugOutput("ispaused");
1749 #endif
1750
1751 return mp4state.paused;
1752 }
1753
1754 void setvolume(int volume)
1755 {
1756 #ifdef DEBUG_OUTPUT
1757 in_mp4_DebugOutput("setvolume");
1758 #endif
1759
1760 module.outMod->SetVolume(volume);
1761 }
1762
1763 void setpan(int pan)
1764 {
1765 #ifdef DEBUG_OUTPUT
1766 in_mp4_DebugOutput("setpan");
1767 #endif
1768
1769 module.outMod->SetPan(pan);
1770 }
1771
1772 void stop()
1773 {
1774 struct seek_list *target = mp4state.m_head;
1775
1776 #ifdef DEBUG_OUTPUT
1777 in_mp4_DebugOutput("stop");
1778 #endif
1779
1780 killPlayThread = 1;
1781
1782 if (play_thread_handle != INVALID_HANDLE_VALUE)
1783 {
1784 if (WaitForSingleObject(play_thread_handle, INFINITE) == WAIT_TIMEOUT)
1785 TerminateThread(play_thread_handle,0);
1786 CloseHandle(play_thread_handle);
1787 play_thread_handle = INVALID_HANDLE_VALUE;
1788 }
1789
1790
1791 if (mp4state.m_aac_buffer)
1792 free(mp4state.m_aac_buffer);
1793
1794 while (target)
1795 {
1796 struct seek_list *tmp = target;
1797 target = target->next;
1798 if (tmp) free(tmp);
1799 }
1800 NeAACDecClose(mp4state.hDecoder);
1801 if (mp4state.filetype)
1802 fclose(mp4state.aacfile);
1803 else {
1804 mp4ff_close(mp4state.mp4file);
1805 fclose(mp4state.mp4File);
1806 }
1807
1808 module.outMod->Close();
1809 module.SAVSADeInit();
1810
1811 mp4state.filename[0] = '\0';
1812 }
1813
1814 int getsonglength(const char *fn)
1815 {
1816 long msDuration = 0;
1817
1818 if(!stricmp(fn + strlen(fn) - 3,"MP4") || !stricmp(fn + strlen(fn) - 3,"M4A"))
1819 {
1820 int track;
1821 int64_t length;
1822 FILE *mp4File;
1823 mp4ff_t *file;
1824 mp4ff_callback_t mp4cb = {0};
1825
1826 mp4File = fopen(fn, "rb");
1827 mp4cb.read = read_callback;
1828 mp4cb.seek = seek_callback;
1829 mp4cb.user_data = mp4File;
1830
1831
1832 file = mp4ff_open_read(&mp4cb);
1833 if (file == NULL)
1834 return 0;
1835
1836 if ((track = GetAACTrack(file)) < 0)
1837 {
1838 mp4ff_close(file);
1839 fclose(mp4File);
1840 return -1;
1841 }
1842
1843 length = mp4ff_get_track_duration(file, track);
1844
1845 msDuration = (long)((float)length*1000.0 / (float)mp4ff_time_scale(file, track) + 0.5);
1846
1847 mp4ff_close(file);
1848 fclose(mp4File);
1849
1850 return msDuration;
1851 } else {
1852 int tagsize = 0;
1853 int bread = 0;
1854 double length = 0.;
1855 __int64 bitrate = 128;
1856 struct seek_list *target;
1857 state len_state;
1858
1859 memset(&len_state, 0, sizeof(state));
1860
1861 if (!(len_state.aacfile = fopen(fn, "rb")))
1862 {
1863 // error
1864 return 0;
1865 }
1866
1867 len_state.m_at_eof = 0;
1868
1869 if (!(len_state.m_aac_buffer = (unsigned char*)malloc(768*6)))
1870 {
1871 //console::error("Memory allocation error.", "foo_mp4");
1872 return 0;
1873 }
1874 memset(len_state.m_aac_buffer, 0, 768*6);
1875
1876 bread = fread(len_state.m_aac_buffer, 1, 768*6, len_state.aacfile);
1877 len_state.m_aac_bytes_into_buffer = bread;
1878 len_state.m_aac_bytes_consumed = 0;
1879 len_state.m_file_offset = 0;
1880
1881 if (bread != 768*6)
1882 len_state.m_at_eof = 1;
1883
1884 if (!memcmp(len_state.m_aac_buffer, "ID3", 3))
1885 {
1886 /* high bit is not used */
1887 tagsize = (len_state.m_aac_buffer[6] << 21) | (len_state.m_aac_buffer[7] << 14) |
1888 (len_state.m_aac_buffer[8] << 7) | (len_state.m_aac_buffer[9] << 0);
1889
1890 tagsize += 10;
1891 advance_buffer(&len_state, tagsize);
1892 }
1893
1894 len_state.m_head = (struct seek_list*)malloc(sizeof(struct seek_list));
1895 len_state.m_tail = len_state.m_head;
1896 len_state.m_tail->next = NULL;
1897
1898 len_state.m_header_type = 0;
1899 if ((len_state.m_aac_buffer[0] == 0xFF) && ((len_state.m_aac_buffer[1] & 0xF6) == 0xF0))
1900 {
1901 if (1) //(m_reader->can_seek())
1902 {
1903 adts_parse(&len_state, &bitrate, &length);
1904 fseek(len_state.aacfile, tagsize, SEEK_SET);
1905
1906 bread = fread(len_state.m_aac_buffer, 1, 768*6, len_state.aacfile);
1907 if (bread != 768*6)
1908 len_state.m_at_eof = 1;
1909 else
1910 len_state.m_at_eof = 0;
1911 len_state.m_aac_bytes_into_buffer = bread;
1912 len_state.m_aac_bytes_consumed = 0;
1913
1914 len_state.m_header_type = 1;
1915 }
1916 } else if (memcmp(len_state.m_aac_buffer, "ADIF", 4) == 0) {
1917 int skip_size = (len_state.m_aac_buffer[4] & 0x80) ? 9 : 0;
1918 bitrate = ((unsigned int)(len_state.m_aac_buffer[4 + skip_size] & 0x0F)<<19) |
1919 ((unsigned int)len_state.m_aac_buffer[5 + skip_size]<<11) |
1920 ((unsigned int)len_state.m_aac_buffer[6 + skip_size]<<3) |
1921 ((unsigned int)len_state.m_aac_buffer[7 + skip_size] & 0xE0);
1922
1923 length = (double)file_length(len_state.aacfile);
1924 if (length == -1)
1925 length = 0;
1926 else
1927 length = ((double)length*8.)/((double)bitrate) + 0.5;
1928
1929 len_state.m_header_type = 2;
1930 } else {
1931 length = (double)file_length(len_state.aacfile);
1932 length = ((double)length*8.)/((double)bitrate*1000.) + 0.5;
1933
1934 len_state.m_header_type = 0;
1935 }
1936
1937 if (len_state.m_aac_buffer)
1938 free(len_state.m_aac_buffer);
1939
1940 target = len_state.m_head;
1941 while (target)
1942 {
1943 struct seek_list *tmp = target;
1944 target = target->next;
1945 if (tmp) free(tmp);
1946 }
1947
1948 fclose(len_state.aacfile);
1949
1950 return (int)(length*1000.);
1951 }
1952 }
1953
1954 int getlength()
1955 {
1956 if (!mp4state.filetype)
1957 {
1958 int track;
1959 long msDuration;
1960 long length;
1961
1962 if ((track = GetAACTrack(mp4state.mp4file)) < 0)
1963 {
1964 return -1;
1965 }
1966
1967 length = mp4ff_get_track_duration(mp4state.mp4file, track);
1968
1969 msDuration = (long)(length*1000.0 / (float)mp4ff_time_scale(mp4state.mp4file, track) + 0.5);
1970
1971 return msDuration;
1972 } else {
1973 return mp4state.m_length;
1974 }
1975 return 0;
1976 }
1977
1978 int getoutputtime()
1979 {
1980 return mp4state.decode_pos_ms+(module.outMod->GetOutputTime()-module.outMod->GetWrittenTime());
1981 }
1982
1983 void setoutputtime(int time_in_ms)
1984 {
1985 #ifdef DEBUG_OUTPUT
1986 in_mp4_DebugOutput("setoutputtime");
1987 #endif
1988
1989 mp4state.seek_needed = time_in_ms;
1990 }
1991
1992 void getfileinfo(char *filename, char *title, int *length_in_ms)
1993 {
1994 if (!filename || !*filename) /* currently playing file */
1995 {
1996 if (length_in_ms)
1997 *length_in_ms = getlength();
1998
1999 if (title)
2000 {
2001 if (mp4state.filetype == 0)
2002 {
2003 ConstructTitle(mp4state.mp4file, mp4state.filename, title, titleformat);
2004 } else {
2005 char *tmp2;
2006 char *tmp = PathFindFileName(mp4state.filename);
2007 strcpy(title, tmp);
2008 tmp2 = strrchr(title, '.');
2009 tmp2[0] = '\0';
2010 }
2011 }
2012 } else {
2013 if (length_in_ms)
2014 *length_in_ms = getsonglength(filename);
2015
2016 if (title)
2017 {
2018 unsigned char header[8];
2019 FILE *hMP4File = fopen(filename, "rb");
2020 if (!hMP4File)
2021 {
2022 return;
2023 }
2024 fread(header, 1, 8, hMP4File);
2025 fclose(hMP4File);
2026
2027 if (header[4] == 'f' && header[5] == 't' && header[6] == 'y' && header[7] == 'p')
2028 {
2029 FILE *mp4File;
2030 mp4ff_t *file;
2031 mp4ff_callback_t mp4cb = {0};
2032
2033 mp4File = fopen(filename, "rb");
2034 mp4cb.read = read_callback;
2035 mp4cb.seek = seek_callback;
2036 mp4cb.user_data = mp4File;
2037
2038 file = mp4ff_open_read(&mp4cb);
2039 if (file == NULL)
2040 return;
2041
2042 ConstructTitle(file, filename, title, titleformat);
2043
2044 mp4ff_close(file);
2045 fclose(mp4File);
2046 } else {
2047 char *tmp2;
2048 char *tmp = PathFindFileName(filename);
2049 strcpy(title, tmp);
2050 tmp2 = strrchr(title, '.');
2051 tmp2[0] = '\0';
2052 }
2053 }
2054 }
2055 }
2056
2057 void eq_set(int on, char data[10], int preamp)
2058 {
2059 }
2060
2061 static void remap_channels(unsigned char *data, unsigned int samples, unsigned int bps)
2062 {
2063 unsigned int i;
2064
2065 switch (bps)
2066 {
2067 case 8:
2068 {
2069 unsigned char r1, r2, r3, r4, r5, r6;
2070 for (i = 0; i < samples; i += 6)
2071 {
2072 r1 = data[i];
2073 r2 = data[i+1];
2074 r3 = data[i+2];
2075 r4 = data[i+3];
2076 r5 = data[i+4];
2077 r6 = data[i+5];
2078 data[i] = r2;
2079 data[i+1] = r3;
2080 data[i+2] = r1;
2081 data[i+3] = r6;
2082 data[i+4] = r4;
2083 data[i+5] = r5;
2084 }
2085 }
2086 break;
2087
2088 case 16:
2089 default:
2090 {
2091 unsigned short r1, r2, r3, r4, r5, r6;
2092 unsigned short *sample_buffer = (unsigned short *)data;
2093 for (i = 0; i < samples; i += 6)
2094 {
2095 r1 = sample_buffer[i];
2096 r2 = sample_buffer[i+1];
2097 r3 = sample_buffer[i+2];
2098 r4 = sample_buffer[i+3];
2099 r5 = sample_buffer[i+4];
2100 r6 = sample_buffer[i+5];
2101 sample_buffer[i] = r2;
2102 sample_buffer[i+1] = r3;
2103 sample_buffer[i+2] = r1;
2104 sample_buffer[i+3] = r6;
2105 sample_buffer[i+4] = r4;
2106 sample_buffer[i+5] = r5;
2107 }
2108 }
2109 break;
2110
2111 case 24:
2112 case 32:
2113 {
2114 unsigned int r1, r2, r3, r4, r5, r6;
2115 unsigned int *sample_buffer = (unsigned int *)data;
2116 for (i = 0; i < samples; i += 6)
2117 {
2118 r1 = sample_buffer[i];
2119 r2 = sample_buffer[i+1];
2120 r3 = sample_buffer[i+2];
2121 r4 = sample_buffer[i+3];
2122 r5 = sample_buffer[i+4];
2123 r6 = sample_buffer[i+5];
2124 sample_buffer[i] = r2;
2125 sample_buffer[i+1] = r3;
2126 sample_buffer[i+2] = r1;
2127 sample_buffer[i+3] = r6;
2128 sample_buffer[i+4] = r4;
2129 sample_buffer[i+5] = r5;
2130 }
2131 }
2132 break;
2133 }
2134 }
2135
2136 DWORD WINAPI MP4PlayThread(void *b)
2137 {
2138 int done = 0;
2139 int l;
2140 int seq_frames = 0;
2141 int seq_bytes = 0;
2142
2143 void *sample_buffer;
2144 unsigned char *buffer;
2145 int buffer_size;
2146 NeAACDecFrameInfo frameInfo;
2147
2148 #ifdef DEBUG_OUTPUT
2149 in_mp4_DebugOutput("MP4PlayThread");
2150 #endif
2151
2152 PlayThreadAlive = 1;
2153 mp4state.last_frame = 0;
2154 mp4state.initial = 1;
2155
2156 while (!*((int *)b))
2157 {
2158 /* seeking */
2159 if (mp4state.seek_needed != -1)
2160 {
2161 int64_t duration;
2162 int32_t skip_samples = 0;
2163
2164 module.outMod->Flush(mp4state.decode_pos_ms);
2165 duration = (int64_t)(mp4state.seek_needed/1000.0 * mp4state.samplerate + 0.5);
2166 mp4state.sampleId = mp4ff_find_sample_use_offsets(mp4state.mp4file,
2167 mp4state.mp4track, duration, &skip_samples);
2168
2169 mp4state.decode_pos_ms = mp4state.seek_needed;
2170 mp4state.seek_needed = -1;
2171 }
2172
2173 if (done)
2174 {
2175 module.outMod->CanWrite();
2176
2177 if (!module.outMod->IsPlaying())
2178 {
2179 PostMessage(module.hMainWindow, WM_WA_AAC_EOF, 0, 0);
2180 PlayThreadAlive = 0;
2181 return 0;
2182 }
2183
2184 Sleep(10);
2185 } else if (module.outMod->CanWrite() >= (2048*mp4state.channels*sizeof(short))) {
2186
2187 if (mp4state.last_frame)
2188 {
2189 done = 1;
2190 } else {
2191 int rc;
2192
2193 /* for gapless decoding */
2194 char *buf;
2195 long dur;
2196 unsigned int sample_count;
2197 unsigned int delay = 0;
2198
2199 /* get acces unit from MP4 file */
2200 buffer = NULL;
2201 buffer_size = 0;
2202
2203 dur = mp4ff_get_sample_duration(mp4state.mp4file, mp4state.mp4track, mp4state.sampleId);
2204 rc = mp4ff_read_sample(mp4state.mp4file, mp4state.mp4track, mp4state.sampleId++, &buffer, &buffer_size);
2205
2206 if (mp4state.sampleId == 1) dur = 0;
2207 if (rc == 0 || buffer == NULL)
2208 {
2209 mp4state.last_frame = 1;
2210 sample_buffer = NULL;
2211 frameInfo.samples = 0;
2212 } else {
2213 sample_buffer = NeAACDecDecode(mp4state.hDecoder, &frameInfo,
2214 buffer, buffer_size);
2215 }
2216 if (frameInfo.error > 0)
2217 {
2218 show_error(module.hMainWindow, NeAACDecGetErrorMessage(frameInfo.error));
2219 mp4state.last_frame = 1;
2220 }
2221 if (mp4state.sampleId >= mp4state.numSamples)
2222 mp4state.last_frame = 1;
2223
2224 if (buffer) free(buffer);
2225
2226 if (mp4state.useAacLength || (mp4state.timescale != mp4state.samplerate)) {
2227 sample_count = frameInfo.samples;
2228 } else {
2229 sample_count = (unsigned int)(dur * frameInfo.channels);
2230
2231 if (!mp4state.useAacLength && !mp4state.initial && (mp4state.sampleId < mp4state.numSamples/2) && (dur*frameInfo.channels != frameInfo.samples))
2232 {
2233 //fprintf(stderr, "MP4 seems to have incorrect frame duration, using values from AAC data.\n");
2234 mp4state.useAacLength = 1;
2235 sample_count = frameInfo.samples;
2236 }
2237 }
2238
2239 if (mp4state.initial && (sample_count < mp4state.framesize*mp4state.channels) && (frameInfo.samples > sample_count))
2240 {
2241 delay = frameInfo.samples - sample_count;
2242 }
2243
2244 if (!killPlayThread && (sample_count > 0))
2245 {
2246 buf = (char *)sample_buffer;
2247 mp4state.initial = 0;
2248
2249 switch (res_table[m_resolution])
2250 {
2251 case 8:
2252 buf += delay;
2253 break;
2254 case 16:
2255 default:
2256 buf += delay * 2;
2257 break;
2258 case 24:
2259 case 32:
2260 buf += delay * 4;
2261 break;
2262 case 64:
2263 buf += delay * 8;
2264 }
2265
2266 if (frameInfo.channels == 6 && frameInfo.num_lfe_channels)
2267 remap_channels(buf, sample_count, res_table[m_resolution]);
2268
2269 if (res_table[m_resolution] == 24)
2270 {
2271 /* convert libfaad output (3 bytes packed in 4) */
2272 char *temp_buffer = convert3in4to3in3(buf, sample_count);
2273 memcpy((void*)buf, (void*)temp_buffer, sample_count*3);
2274 free(temp_buffer);
2275 }
2276
2277 module.SAAddPCMData(buf, (int)mp4state.channels, res_table[m_resolution],
2278 mp4state.decode_pos_ms);
2279 module.VSAAddPCMData(buf, (int)mp4state.channels, res_table[m_resolution],
2280 mp4state.decode_pos_ms);
2281 mp4state.decode_pos_ms += (double)sample_count * 1000.0 /
2282 ((double)frameInfo.samplerate * (double)frameInfo.channels);
2283
2284 l = sample_count * res_table[m_resolution] / 8;
2285
2286 if (module.dsp_isactive())
2287 {
2288 void *dsp_buffer = malloc(l*2);
2289 memcpy(dsp_buffer, buf, l);
2290
2291 l = module.dsp_dosamples((short*)dsp_buffer,
2292 sample_count/frameInfo.channels,
2293 res_table[m_resolution],
2294 frameInfo.channels,
2295 frameInfo.samplerate) *
2296 (frameInfo.channels*(res_table[m_resolution]/8));
2297
2298 module.outMod->Write(dsp_buffer, l);
2299 if (dsp_buffer) free(dsp_buffer);
2300 } else {
2301 module.outMod->Write(buf, l);
2302 }
2303
2304 /* VBR bitrate display */
2305 if (m_vbr_display)
2306 {
2307 seq_frames++;
2308 seq_bytes += frameInfo.bytesconsumed;
2309 if (seq_frames == (int)(floor((float)frameInfo.samplerate/(float)(sample_count/frameInfo.channels) + 0.5)))
2310 {
2311 module.SetInfo((int)floor(((float)seq_bytes*8.)/1000. + 0.5),
2312 (int)floor(frameInfo.samplerate/1000. + 0.5),
2313 mp4state.channels, 1);
2314
2315 seq_frames = 0;
2316 seq_bytes = 0;
2317 }
2318 }
2319 }
2320 }
2321 } else {
2322 Sleep(10);
2323 }
2324 }
2325
2326 PlayThreadAlive = 0;
2327
2328 return 0;
2329 }
2330
2331 void *decode_aac_frame(state *st, NeAACDecFrameInfo *frameInfo)
2332 {
2333 void *sample_buffer = NULL;
2334
2335 do
2336 {
2337 fill_buffer(st);
2338
2339 if (st->m_aac_bytes_into_buffer != 0)
2340 {
2341 sample_buffer = NeAACDecDecode(st->hDecoder, frameInfo,
2342 st->m_aac_buffer, st->m_aac_bytes_into_buffer);
2343
2344 if (st->m_header_type != 1)
2345 {
2346 if (st->last_offset < st->m_file_offset)
2347 {
2348 st->m_tail->offset = st->m_file_offset;
2349 st->m_tail->next = (struct seek_list*)malloc(sizeof(struct seek_list));
2350 st->m_tail = st->m_tail->next;
2351 st->m_tail->next = NULL;
2352 st->last_offset = st->m_file_offset;
2353 }
2354 }
2355
2356 advance_buffer(st, frameInfo->bytesconsumed);
2357 } else {
2358 break;
2359 }
2360
2361 } while (!frameInfo->samples && !frameInfo->error);
2362
2363 return sample_buffer;
2364 }
2365
2366 int aac_seek(state *st, double seconds)
2367 {
2368 int i, frames;
2369 int bread;
2370 struct seek_list *target = st->m_head;
2371
2372 if (1 /*can_seek*/ && ((st->m_header_type == 1) || (seconds < st->cur_pos_sec)))
2373 {
2374 frames = (int)(seconds*((double)st->samplerate/(double)st->framesize) + 0.5);
2375
2376 for (i = 0; i < frames; i++)
2377 {
2378 if (target->next)
2379 target = target->next;
2380 else
2381 return 0;
2382 }
2383 if (target->offset == 0 && frames > 0)
2384 return 0;
2385 fseek(st->aacfile, target->offset, SEEK_SET);
2386 st->m_file_offset = target->offset;
2387
2388 bread = fread(st->m_aac_buffer, 1, 768*6, st->aacfile);
2389 if (bread != 768*6)
2390 st->m_at_eof = 1;
2391 else
2392 st->m_at_eof = 0;
2393 st->m_aac_bytes_into_buffer = bread;
2394 st->m_aac_bytes_consumed = 0;
2395 st->m_file_offset += bread;
2396
2397 NeAACDecPostSeekReset(st->hDecoder, -1);
2398
2399 return 1;
2400 } else {
2401 if (seconds > st->cur_pos_sec)
2402 {
2403 NeAACDecFrameInfo frameInfo;
2404
2405 frames = (int)((seconds - st->cur_pos_sec)*((double)st->samplerate/(double)st->framesize));
2406
2407 if (frames > 0)
2408 {
2409 for (i = 0; i < frames; i++)
2410 {
2411 memset(&frameInfo, 0, sizeof(NeAACDecFrameInfo));
2412 decode_aac_frame(st, &frameInfo);
2413
2414 if (frameInfo.error || (st->m_aac_bytes_into_buffer == 0))
2415 {
2416 if (frameInfo.error)
2417 {
2418 if (NeAACDecGetErrorMessage(frameInfo.error) != NULL)
2419 show_error(module.hMainWindow, NeAACDecGetErrorMessage(frameInfo.error));
2420 }
2421 return 0;
2422 }
2423 }
2424 }
2425
2426 NeAACDecPostSeekReset(st->hDecoder, -1);
2427 }
2428 return 1;
2429 }
2430 }
2431
2432 DWORD WINAPI AACPlayThread(void *b)
2433 {
2434 int done = 0;
2435 int l;
2436 int seq_frames = 0;
2437 int seq_bytes = 0;
2438
2439 #ifdef DEBUG_OUTPUT
2440 in_mp4_DebugOutput("AACPlayThread");
2441 #endif
2442
2443 PlayThreadAlive = 1;
2444 mp4state.last_frame = 0;
2445
2446 while (!*((int *)b))
2447 {
2448 /* seeking */
2449 if (mp4state.seek_needed != -1)
2450 {
2451 double ms;
2452
2453 ms = mp4state.seek_needed/1000;
2454 if (aac_seek(&mp4state, ms)!=0)
2455 {
2456 module.outMod->Flush(mp4state.decode_pos_ms);
2457 mp4state.cur_pos_sec = ms;
2458 mp4state.decode_pos_ms = mp4state.seek_needed;
2459 }
2460 mp4state.seek_needed = -1;
2461 }
2462
2463 if (done)
2464 {
2465 module.outMod->CanWrite();
2466
2467 if (!module.outMod->IsPlaying())
2468 {
2469 PostMessage(module.hMainWindow, WM_WA_AAC_EOF, 0, 0);
2470 PlayThreadAlive = 0;
2471 return 0;
2472 }
2473
2474 Sleep(10);
2475 } else if (module.outMod->CanWrite() >= (2048*mp4state.channels*sizeof(short))) {
2476 NeAACDecFrameInfo frameInfo;
2477 void *sample_buffer;
2478
2479 memset(&frameInfo, 0, sizeof(NeAACDecFrameInfo));
2480
2481 sample_buffer = decode_aac_frame(&mp4state, &frameInfo);
2482
2483 if (frameInfo.error || (mp4state.m_aac_bytes_into_buffer == 0))
2484 {
2485 if (frameInfo.error)
2486 {
2487 if (NeAACDecGetErrorMessage(frameInfo.error) != NULL)
2488 show_error(module.hMainWindow, NeAACDecGetErrorMessage(frameInfo.error));
2489 }
2490 done = 1;
2491 }
2492
2493 if (!killPlayThread && (frameInfo.samples > 0))
2494 {
2495 if (frameInfo.channels == 6 && frameInfo.num_lfe_channels)
2496 remap_channels(sample_buffer, frameInfo.samples, res_table[m_resolution]);
2497
2498 if (res_table[m_resolution] == 24)
2499 {
2500 /* convert libfaad output (3 bytes packed in 4 bytes) */
2501 char *temp_buffer = convert3in4to3in3(sample_buffer, frameInfo.samples);
2502 memcpy((void*)sample_buffer, (void*)temp_buffer, frameInfo.samples*3);
2503 free(temp_buffer);
2504 }
2505
2506 module.SAAddPCMData(sample_buffer, (int)mp4state.channels, res_table[m_resolution],
2507 mp4state.decode_pos_ms);
2508 module.VSAAddPCMData(sample_buffer, (int)mp4state.channels, res_table[m_resolution],
2509 mp4state.decode_pos_ms);
2510 mp4state.decode_pos_ms += (double)frameInfo.samples * 1000.0 /
2511 ((double)frameInfo.samplerate* (double)frameInfo.channels);
2512
2513 l = frameInfo.samples * res_table[m_resolution] / 8;
2514
2515 if (module.dsp_isactive())
2516 {
2517 void *dsp_buffer = malloc(l*2);
2518 memcpy(dsp_buffer, sample_buffer, l);
2519
2520 l = module.dsp_dosamples((short*)dsp_buffer,
2521 frameInfo.samples/frameInfo.channels,
2522 res_table[m_resolution],
2523 frameInfo.channels,
2524 frameInfo.samplerate) *
2525 (frameInfo.channels*(res_table[m_resolution]/8));
2526
2527 module.outMod->Write(dsp_buffer, l);
2528 if (dsp_buffer) free(dsp_buffer);
2529 } else {
2530 module.outMod->Write(sample_buffer, l);
2531 }
2532
2533 /* VBR bitrate display */
2534 if (m_vbr_display)
2535 {
2536 seq_frames++;
2537 seq_bytes += frameInfo.bytesconsumed;
2538 if (seq_frames == (int)(floor((float)frameInfo.samplerate/(float)(frameInfo.samples/frameInfo.channels) + 0.5)))
2539 {
2540 module.SetInfo((int)floor(((float)seq_bytes*8.)/1000. + 0.5),
2541 (int)floor(frameInfo.samplerate/1000. + 0.5),
2542 mp4state.channels, 1);
2543
2544 seq_frames = 0;
2545 seq_bytes = 0;
2546 }
2547 }
2548 }
2549
2550 if (frameInfo.channels > 0 && mp4state.samplerate > 0)
2551 mp4state.cur_pos_sec += ((double)(frameInfo.samples/frameInfo.channels))/(double)mp4state.samplerate;
2552 } else {
2553 Sleep(10);
2554 }
2555 }
2556
2557 PlayThreadAlive = 0;
2558
2559 return 0;
2560 }
2561
2562 static In_Module module =
2563 {
2564 IN_VER,
2565 "AudioCoding.com MPEG-4 AAC player: " FAAD2_VERSION " compiled on " __DATE__,
2566 0, // hMainWindow
2567 0, // hDllInstance
2568 NULL,
2569 1, // is_seekable
2570 1, // uses output
2571 config,
2572 about,
2573 init,
2574 quit,
2575 getfileinfo,
2576 infoDlg,
2577 isourfile,
2578 play,
2579 pause,
2580 unpause,
2581 ispaused,
2582 stop,
2583
2584 getlength,
2585 getoutputtime,
2586 setoutputtime,
2587
2588 setvolume,
2589 setpan,
2590
2591 0,0,0,0,0,0,0,0,0, // vis stuff
2592
2593
2594 0,0, // dsp
2595
2596 eq_set,
2597
2598 NULL, // setinfo
2599
2600 0 // out_mod
2601 };
2602
2603 __declspec(dllexport) In_Module* winampGetInModule2()
2604 {
2605 config_read();
2606
2607 if (!m_use_for_aac)
2608 {
2609 module.FileExtensions = short_ext_list;
2610 } else {
2611 module.FileExtensions = long_ext_list;
2612 }
2613
2614 return &module;
2615 }
2616
2617 /* new Media Library interface */
2618
2619 int mp4_get_metadata(mp4ff_t *file, const char *item, char *dest, int dlen)
2620 {
2621 char *pVal = NULL, dummy1[4096];
2622
2623 if (dlen < 1) return 0;
2624
2625 if (!stricmp(item, "track") || !stricmp(item, "tracknumber"))
2626 {
2627 if (mp4ff_meta_get_track(file, &pVal))
2628 {
2629 wsprintf(dummy1, "%s", pVal);
2630 strncpy(dest, dummy1, dlen-1);
2631 dest[dlen-1] = '\0';
2632 return 1;
2633 }
2634 }
2635 else if (!stricmp(item, "disc") || !stricmp(item, "disknumber"))
2636 {
2637 if (mp4ff_meta_get_disc(file, &pVal))
2638 {
2639 wsprintf(dummy1, "%s", pVal);
2640 strncpy(dest, dummy1, dlen-1);
2641 dest[dlen-1] = '\0';
2642 return 1;
2643 }
2644 }
2645 else if (!stricmp(item, "compilation"))
2646 {
2647 uint8_t cpil = 0;
2648 if (mp4ff_meta_get_compilation(file, &pVal))
2649 {
2650 wsprintf(dummy1, "%s", pVal);
2651 strncpy(dest, dummy1, dlen-1);
2652 dest[dlen-1] = '\0';
2653 return 1;
2654 }
2655 }
2656 else if (!stricmp(item, "tempo"))
2657 {
2658 if (mp4ff_meta_get_tempo(file, &pVal))
2659 {
2660 wsprintf(dummy1, "%s", pVal);
2661 strncpy(dest, dummy1, dlen-1);
2662 dest[dlen-1] = '\0';
2663 return 1;
2664 }
2665 }
2666 else if (!stricmp(item, "artist"))
2667 {
2668 if (mp4ff_meta_get_artist(file, &pVal))
2669 {
2670 strncpy(dest, pVal, dlen-1);
2671 dest[dlen-1] = '\0';
2672 return 1;
2673 }
2674 }
2675 else if (!stricmp(item, "writer"))
2676 {
2677 if (mp4ff_meta_get_writer(file, &pVal))
2678 {
2679 strncpy(dest, pVal, dlen-1);
2680 dest[dlen-1] = '\0';
2681 return 1;
2682 }
2683 }
2684 else if (!stricmp(item, "title"))
2685 {
2686 if (mp4ff_meta_get_title(file, &pVal))
2687 {
2688 strncpy(dest, pVal, dlen-1);
2689 dest[dlen-1] = '\0';
2690 return 1;
2691 }
2692 }
2693 else if (!stricmp(item, "album"))
2694 {
2695 if (mp4ff_meta_get_album(file, &pVal))
2696 {
2697 strncpy(dest, pVal, dlen-1);
2698 dest[dlen-1] = '\0';
2699 return 1;
2700 }
2701 }
2702 else if (!stricmp(item, "date") || !stricmp(item, "year"))
2703 {
2704 if (mp4ff_meta_get_date(file, &pVal))
2705 {
2706 strncpy(dest, pVal, dlen-1);
2707 dest[dlen-1] = '\0';
2708 return 1;
2709 }
2710 }
2711 else if (!stricmp(item, "comment"))
2712 {
2713 if (mp4ff_meta_get_comment(file, &pVal))
2714 {
2715 strncpy(dest, pVal, dlen-1);
2716 dest[dlen-1] = '\0';
2717 return 1;
2718 }
2719 }
2720 else if (!stricmp(item, "genre"))
2721 {
2722 if (mp4ff_meta_get_genre(file, &pVal))
2723 {
2724 strncpy(dest, pVal, dlen-1);
2725 dest[dlen-1] = '\0';
2726 return 1;
2727 }
2728 }
2729 else if (!stricmp(item, "tool"))
2730 {
2731 if (mp4ff_meta_get_tool(file, &pVal))
2732 {
2733 strncpy(dest, pVal, dlen-1);
2734 dest[dlen-1] = '\0';
2735 return 1;
2736 }
2737 }
2738 #if 0
2739 else
2740 {
2741 uint32_t valueSize = 0;
2742 uint8_t *pValue = NULL;
2743
2744 if (MP4GetMetadataFreeForm(file, (char *)item, &pValue, &valueSize))
2745 {
2746 unsigned int len = (valueSize < (unsigned int)(dlen-1)) ? valueSize : (unsigned int)(dlen-1);
2747 memcpy(dest, pValue, len);
2748 dest[len] = '\0';
2749 return 1;
2750 }
2751 }
2752 #endif
2753
2754 return 0;
2755 }
2756
2757 __declspec(dllexport) int winampGetExtendedFileInfo(const char *fn, const char *data, char *dest, int destlen)
2758 {
2759 if (!fn || (fn && !*fn) || !destlen) return 0;
2760
2761 dest[0] = '\0';
2762
2763 if (!stricmp(data, "length"))
2764 {
2765 char temp[32];
2766 int len = getsonglength(fn);
2767 itoa(len, temp, 10);
2768 strncpy(dest, temp, destlen-1);
2769 dest[destlen-1] = '\0';
2770 }
2771 else
2772 {
2773 char temp[2048], temp2[2048];
2774 FILE *mp4File;
2775 mp4ff_callback_t mp4cb = {0};
2776 mp4ff_t *file;
2777
2778 mp4File = fopen(fn, "rb");
2779 mp4cb.read = read_callback;
2780 mp4cb.seek = seek_callback;
2781 mp4cb.write = write_callback;
2782 mp4cb.truncate = truncate_callback;
2783 mp4cb.user_data = mp4File;
2784
2785
2786 file = mp4ff_open_read(&mp4cb);
2787 if (file == NULL) return 0;
2788
2789 if (mp4_get_metadata(file, data, temp, sizeof(temp)))
2790 {
2791 int len = ConvertUTF8ToANSI(temp, temp2);
2792 if (len > destlen-1) len = destlen-1;
2793 memcpy(dest, temp2, len);
2794 dest[len] = '\0';
2795 }
2796
2797 mp4ff_close(file);
2798 fclose(mp4File);
2799 }
2800
2801 return 1;
2802 }
2803
2804 static mp4ff_metadata_t mltags = {0, 0};
2805 static BOOL medialib_init = FALSE;
2806 static char medialib_lastfn[2048] = "";
2807
2808 __declspec(dllexport) int winampSetExtendedFileInfo(const char *fn, const char *data, char *val)
2809 {
2810 int len, ret = 0;
2811 char *temp;
2812
2813 if (!medialib_init || (medialib_init && stricmp(fn, medialib_lastfn))) {
2814 FILE *mp4File;
2815 mp4ff_callback_t mp4cb = {0};
2816 mp4ff_t *file;
2817 strcpy(medialib_lastfn, fn);
2818
2819 if (medialib_init) tag_delete(&mltags);
2820
2821 mp4File = fopen(medialib_lastfn, "rb");
2822 mp4cb.read = read_callback;
2823 mp4cb.seek = seek_callback;
2824 mp4cb.user_data = mp4File;
2825
2826
2827 file = mp4ff_open_read(&mp4cb);
2828 if (file == NULL) return 0;
2829
2830 ReadMP4Tag(file, &mltags);
2831
2832 mp4ff_close(file);
2833 fclose(mp4File);
2834
2835 medialib_init = TRUE;
2836 }
2837
2838 len = strlen(val);
2839 temp = (char *)malloc((len+1)*4);
2840 if (!temp) return 0;
2841
2842 if (ConvertANSIToUTF8(val, temp))
2843 {
2844 ret = 1;
2845 tag_set_field(&mltags, data, temp, len);
2846 }
2847
2848 free(temp);
2849
2850 return ret;
2851 }
2852
2853 __declspec(dllexport) int winampWriteExtendedFileInfo()
2854 {
2855 if (medialib_init)
2856 {
2857 FILE *mp4File;
2858 mp4ff_callback_t mp4cb = {0};
2859
2860 mp4File = fopen(medialib_lastfn, "rb+");
2861 mp4cb.read = read_callback;
2862 mp4cb.seek = seek_callback;
2863 mp4cb.write = write_callback;
2864 mp4cb.truncate = truncate_callback;
2865 mp4cb.user_data = mp4File;
2866
2867 mp4ff_meta_update(&mp4cb, &mltags);
2868
2869 fclose(mp4File);
2870
2871 return 1;
2872 }
2873 else
2874 {
2875 return 0;
2876 }
2877 }
0 # Microsoft Developer Studio Project File - Name="in_mp4" - Package Owner=<4>
1 # Microsoft Developer Studio Generated Build File, Format Version 6.00
2 # ** DO NOT EDIT **
3
4 # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
5
6 CFG=in_mp4 - Win32 Debug
7 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
8 !MESSAGE use the Export Makefile command and run
9 !MESSAGE
10 !MESSAGE NMAKE /f "in_mp4.mak".
11 !MESSAGE
12 !MESSAGE You can specify a configuration when running NMAKE
13 !MESSAGE by defining the macro CFG on the command line. For example:
14 !MESSAGE
15 !MESSAGE NMAKE /f "in_mp4.mak" CFG="in_mp4 - Win32 Debug"
16 !MESSAGE
17 !MESSAGE Possible choices for configuration are:
18 !MESSAGE
19 !MESSAGE "in_mp4 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
20 !MESSAGE "in_mp4 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
21 !MESSAGE
22
23 # Begin Project
24 # PROP AllowPerConfigDependencies 0
25 # PROP Scc_ProjName ""
26 # PROP Scc_LocalPath ""
27 CPP=xicl6.exe
28 MTL=midl.exe
29 RSC=rc.exe
30
31 !IF "$(CFG)" == "in_mp4 - Win32 Release"
32
33 # PROP BASE Use_MFC 0
34 # PROP BASE Use_Debug_Libraries 0
35 # PROP BASE Output_Dir "Release"
36 # PROP BASE Intermediate_Dir "Release"
37 # PROP BASE Target_Dir ""
38 # PROP Use_MFC 0
39 # PROP Use_Debug_Libraries 0
40 # PROP Output_Dir "Release"
41 # PROP Intermediate_Dir "Release"
42 # PROP Ignore_Export_Lib 0
43 # PROP Target_Dir ""
44 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
45 # ADD CPP /nologo /MD /W3 /GX /O1 /I "..\..\include" /I "..\..\common\mp4v2" /I "..\..\common\mp4av" /I "..\..\common\mp4ff" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
46 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
47 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
48 # ADD BASE RSC /l 0x413 /d "NDEBUG"
49 # ADD RSC /l 0x413 /d "NDEBUG"
50 BSC32=bscmake.exe
51 # ADD BASE BSC32 /nologo
52 # ADD BSC32 /nologo
53 LINK32=xilink6.exe
54 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
55 # ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
56
57 !ELSEIF "$(CFG)" == "in_mp4 - Win32 Debug"
58
59 # PROP BASE Use_MFC 0
60 # PROP BASE Use_Debug_Libraries 1
61 # PROP BASE Output_Dir "Debug"
62 # PROP BASE Intermediate_Dir "Debug"
63 # PROP BASE Target_Dir ""
64 # PROP Use_MFC 0
65 # PROP Use_Debug_Libraries 1
66 # PROP Output_Dir "Debug"
67 # PROP Intermediate_Dir "Debug"
68 # PROP Ignore_Export_Lib 0
69 # PROP Target_Dir ""
70 # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
71 # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /I "..\..\common\mp4v2" /I "..\..\common\mp4av" /I "..\..\common\mp4ff" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
72 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
73 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
74 # ADD BASE RSC /l 0x413 /d "_DEBUG"
75 # ADD RSC /l 0x413 /d "_DEBUG"
76 BSC32=bscmake.exe
77 # ADD BASE BSC32 /nologo
78 # ADD BSC32 /nologo
79 LINK32=xilink6.exe
80 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
81 # ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
82
83 !ENDIF
84
85 # Begin Target
86
87 # Name "in_mp4 - Win32 Release"
88 # Name "in_mp4 - Win32 Debug"
89 # Begin Group "Source Files"
90
91 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
92 # Begin Source File
93
94 SOURCE=.\aacinfo.c
95 # End Source File
96 # Begin Source File
97
98 SOURCE=.\config.c
99 # End Source File
100 # Begin Source File
101
102 SOURCE=.\in_mp4.c
103 # End Source File
104 # Begin Source File
105
106 SOURCE=.\utils.c
107 # End Source File
108 # End Group
109 # Begin Group "Header Files"
110
111 # PROP Default_Filter "h;hpp;hxx;hm;inl"
112 # Begin Source File
113
114 SOURCE=.\aacinfo.h
115 # End Source File
116 # Begin Source File
117
118 SOURCE=.\config.h
119 # End Source File
120 # Begin Source File
121
122 SOURCE=.\in2.h
123 # End Source File
124 # Begin Source File
125
126 SOURCE=..\..\common\mp4ff\mp4ff.h
127 # End Source File
128 # Begin Source File
129
130 SOURCE=..\..\common\mp4ff\mp4ff_int_types.h
131 # End Source File
132 # Begin Source File
133
134 SOURCE=..\..\include\neaacdec.h
135 # End Source File
136 # Begin Source File
137
138 SOURCE=.\out.h
139 # End Source File
140 # Begin Source File
141
142 SOURCE=.\utils.h
143 # End Source File
144 # End Group
145 # Begin Group "Resource Files"
146
147 # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
148 # Begin Source File
149
150 SOURCE=.\in_mp4.rc
151 # End Source File
152 # End Group
153 # End Target
154 # End Project
0 Microsoft Developer Studio Workspace File, Format Version 6.00
1 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
2
3 ###############################################################################
4
5 Project: "in_mp4"=.\in_mp4.dsp - Package Owner=<4>
6
7 Package=<5>
8 {{{
9 }}}
10
11 Package=<4>
12 {{{
13 Begin Project Dependency
14 Project_Dep_Name libfaad
15 End Project Dependency
16 Begin Project Dependency
17 Project_Dep_Name mp4ff
18 End Project Dependency
19 }}}
20
21 ###############################################################################
22
23 Project: "libfaad"=..\..\libfaad\libfaad.dsp - Package Owner=<4>
24
25 Package=<5>
26 {{{
27 }}}
28
29 Package=<4>
30 {{{
31 }}}
32
33 ###############################################################################
34
35 Project: "mp4ff"=..\..\common\mp4ff\mp4ff.dsp - Package Owner=<4>
36
37 Package=<5>
38 {{{
39 }}}
40
41 Package=<4>
42 {{{
43 }}}
44
45 ###############################################################################
46
47 Global:
48
49 Package=<5>
50 {{{
51 }}}
52
53 Package=<3>
54 {{{
55 }}}
56
57 ###############################################################################
58
0 //Microsoft Developer Studio generated resource script.
1 //
2 #include "resource.h"
3
4 #define APSTUDIO_READONLY_SYMBOLS
5 /////////////////////////////////////////////////////////////////////////////
6 //
7 // Generated from the TEXTINCLUDE 2 resource.
8 //
9 #include "afxres.h"
10
11 /////////////////////////////////////////////////////////////////////////////
12 #undef APSTUDIO_READONLY_SYMBOLS
13
14 /////////////////////////////////////////////////////////////////////////////
15 // Dutch (Netherlands) resources
16
17 #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLD)
18 #ifdef _WIN32
19 LANGUAGE LANG_DUTCH, SUBLANG_DUTCH
20 #pragma code_page(1252)
21 #endif //_WIN32
22
23 #ifdef APSTUDIO_INVOKED
24 /////////////////////////////////////////////////////////////////////////////
25 //
26 // TEXTINCLUDE
27 //
28
29 1 TEXTINCLUDE MOVEABLE PURE
30 BEGIN
31 "resource.h\0"
32 END
33
34 2 TEXTINCLUDE MOVEABLE PURE
35 BEGIN
36 "#include ""afxres.h""\r\n"
37 "\0"
38 END
39
40 3 TEXTINCLUDE MOVEABLE PURE
41 BEGIN
42 "\r\n"
43 "\0"
44 END
45
46 #endif // APSTUDIO_INVOKED
47
48
49 /////////////////////////////////////////////////////////////////////////////
50 //
51 // Dialog
52 //
53
54 IDD_INFO DIALOGEX 0, 0, 303, 255
55 STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
56 CAPTION "MPEG-4 File Info"
57 FONT 8, "MS Sans Serif"
58 BEGIN
59 GROUPBOX "Track info",IDC_STATIC,7,7,289,64
60 EDITTEXT IDC_METANAME,53,91,151,14,ES_AUTOHSCROLL
61 EDITTEXT IDC_METAARTIST,53,109,151,14,ES_AUTOHSCROLL
62 EDITTEXT IDC_METAWRITER,53,127,151,14,ES_AUTOHSCROLL
63 EDITTEXT IDC_METAALBUM,53,145,233,14,ES_AUTOHSCROLL
64 EDITTEXT IDC_METACOMMENTS,53,163,234,35,ES_AUTOHSCROLL
65 EDITTEXT IDC_METAGENRE,53,202,151,14,ES_AUTOHSCROLL
66 EDITTEXT IDC_METAYEAR,234,91,52,14,ES_AUTOHSCROLL
67 EDITTEXT IDC_METATRACK1,234,109,52,14,ES_AUTOHSCROLL
68 EDITTEXT IDC_METADISK1,234,127,52,14,ES_AUTOHSCROLL
69 CONTROL "Part of a compilation",IDC_METACOMPILATION,"Button",
70 BS_AUTOCHECKBOX | WS_TABSTOP,207,202,80,14
71 DEFPUSHBUTTON "OK",IDOK,246,234,50,14
72 PUSHBUTTON "Cancel",IDCANCEL,186,234,50,14
73 LTEXT "",IDC_INFOTEXT,14,17,275,47,0,WS_EX_CLIENTEDGE
74 GROUPBOX "User data",IDC_USERDATA,7,76,289,151
75 LTEXT "Name",IDC_STATIC1,13,91,20,14,SS_CENTERIMAGE
76 LTEXT "Artist",IDC_STATIC2,13,109,16,14,SS_CENTERIMAGE
77 LTEXT "Composer",IDC_STATIC3,13,127,32,14,SS_CENTERIMAGE
78 LTEXT "Album",IDC_STATIC4,13,145,20,14,SS_CENTERIMAGE
79 LTEXT "Comments",IDC_STATIC5,13,163,34,14,SS_CENTERIMAGE
80 LTEXT "Year",IDC_STATIC7,211,91,16,14,SS_CENTERIMAGE
81 LTEXT "Disc",IDC_STATIC9,211,127,15,14,SS_CENTERIMAGE
82 LTEXT "Track",IDC_STATIC8,211,109,20,14,SS_CENTERIMAGE
83 LTEXT "Genre",IDC_STATIC6,13,202,20,14,SS_CENTERIMAGE
84 END
85
86 IDD_CONFIG DIALOG DISCARDABLE 0, 0, 233, 166
87 STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
88 CAPTION "Configuration"
89 FONT 8, "MS Sans Serif"
90 BEGIN
91 CONTROL "Slider1",IDC_PRIORITY,"msctls_trackbar32",TBS_VERT |
92 TBS_NOTICKS | WS_TABSTOP,13,15,18,46
93 CONTROL "16 bits",IDC_16BITS,"Button",BS_AUTORADIOBUTTON,77,18,
94 37,10
95 CONTROL "16 bits dithered",IDC_16BITS_DITHERED,"Button",
96 BS_AUTORADIOBUTTON | WS_DISABLED,77,29,64,10
97 CONTROL "24 bits",IDC_24BITS,"Button",BS_AUTORADIOBUTTON,77,40,
98 37,10
99 CONTROL "32 bits",IDC_32BITS,"Button",BS_AUTORADIOBUTTON,77,51,
100 37,10
101 CONTROL "Downmix to stereo",IDC_DOWNMIX,"Button",BS_AUTOCHECKBOX |
102 WS_TABSTOP,152,13,74,10
103 CONTROL "Use for AAC",IDC_USEFORAAC,"Button",BS_AUTOCHECKBOX |
104 WS_TABSTOP,152,26,55,10
105 CONTROL "VBR Display",IDC_VBR,"Button",BS_AUTOCHECKBOX |
106 WS_TABSTOP,152,39,55,10
107 CONTROL "Show errors",IDC_ERROR,"Button",BS_AUTOCHECKBOX |
108 WS_TABSTOP,152,52,53,10
109 EDITTEXT IDC_TITLEFORMAT,14,86,121,14,ES_AUTOHSCROLL
110 DEFPUSHBUTTON "OK",IDOK,176,145,50,14
111 PUSHBUTTON "Cancel",IDCANCEL,176,125,50,14
112 GROUPBOX "Priority",IDC_STATIC,7,7,57,58
113 LTEXT "Highest",IDC_STATIC,34,18,25,8
114 LTEXT "Normal",IDC_STATIC,34,35,23,8
115 LTEXT "Lowest",IDC_STATIC,34,52,24,8
116 GROUPBOX "Resolution",IDC_STATIC,71,7,73,58
117 GROUPBOX "Title format",IDC_STATIC,7,72,137,87
118 LTEXT "%0 - Track",IDC_STATIC,17,109,35,8
119 LTEXT "%1 - Artist",IDC_STATIC,17,120,32,8
120 LTEXT "%2 - Title",IDC_STATIC,17,131,30,8
121 LTEXT "%3 - Album",IDC_STATIC,17,142,36,8
122 LTEXT "%4 - Year",IDC_STATIC,68,109,31,8
123 LTEXT "%5 - Comment",IDC_STATIC,68,120,46,8
124 LTEXT "%6 - Genre",IDC_STATIC,68,131,36,8
125 LTEXT "%7 - Filename",IDC_STATIC,68,142,44,8
126 END
127
128
129 /////////////////////////////////////////////////////////////////////////////
130 //
131 // DESIGNINFO
132 //
133
134 #ifdef APSTUDIO_INVOKED
135 GUIDELINES DESIGNINFO MOVEABLE PURE
136 BEGIN
137 IDD_INFO, DIALOG
138 BEGIN
139 LEFTMARGIN, 7
140 RIGHTMARGIN, 296
141 TOPMARGIN, 7
142 BOTTOMMARGIN, 248
143 END
144
145 IDD_CONFIG, DIALOG
146 BEGIN
147 LEFTMARGIN, 7
148 RIGHTMARGIN, 226
149 TOPMARGIN, 7
150 BOTTOMMARGIN, 159
151 END
152 END
153 #endif // APSTUDIO_INVOKED
154
155 #endif // Dutch (Netherlands) resources
156 /////////////////////////////////////////////////////////////////////////////
157
158
159
160 #ifndef APSTUDIO_INVOKED
161 /////////////////////////////////////////////////////////////////////////////
162 //
163 // Generated from the TEXTINCLUDE 3 resource.
164 //
165
166
167 /////////////////////////////////////////////////////////////////////////////
168 #endif // not APSTUDIO_INVOKED
169
0 Microsoft Visual Studio Solution File, Format Version 8.00
1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "in_mp4", "in_mp4.vcproj", "{2D8F479D-A591-4502-9456-398425D5F834}"
2 ProjectSection(ProjectDependencies) = postProject
3 {2398BB2F-FFF9-490B-B4CC-863F2D21AE46} = {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}
4 {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49} = {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}
5 {82CAD808-21AF-40A6-92EC-AE01AA67B413} = {82CAD808-21AF-40A6-92EC-AE01AA67B413}
6 EndProjectSection
7 EndProject
8 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "..\..\libfaad\libfaad.vcproj", "{82CAD808-21AF-40A6-92EC-AE01AA67B413}"
9 ProjectSection(ProjectDependencies) = postProject
10 EndProjectSection
11 EndProject
12 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmp4v2_st", "..\..\common\mp4v2\libmp4v2_st60.vcproj", "{2398BB2F-FFF9-490B-B4CC-863F2D21AE46}"
13 ProjectSection(ProjectDependencies) = postProject
14 EndProjectSection
15 EndProject
16 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmp4av_st", "..\..\common\mp4av\libmp4av_st.vcproj", "{8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}"
17 ProjectSection(ProjectDependencies) = postProject
18 EndProjectSection
19 EndProject
20 Global
21 GlobalSection(SolutionConfiguration) = preSolution
22 Debug = Debug
23 Release = Release
24 EndGlobalSection
25 GlobalSection(ProjectConfiguration) = postSolution
26 {2D8F479D-A591-4502-9456-398425D5F834}.Debug.ActiveCfg = Debug|Win32
27 {2D8F479D-A591-4502-9456-398425D5F834}.Debug.Build.0 = Debug|Win32
28 {2D8F479D-A591-4502-9456-398425D5F834}.Release.ActiveCfg = Release|Win32
29 {2D8F479D-A591-4502-9456-398425D5F834}.Release.Build.0 = Release|Win32
30 {82CAD808-21AF-40A6-92EC-AE01AA67B413}.Debug.ActiveCfg = Debug|Win32
31 {82CAD808-21AF-40A6-92EC-AE01AA67B413}.Debug.Build.0 = Debug|Win32
32 {82CAD808-21AF-40A6-92EC-AE01AA67B413}.Release.ActiveCfg = Release|Win32
33 {82CAD808-21AF-40A6-92EC-AE01AA67B413}.Release.Build.0 = Release|Win32
34 {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}.Debug.ActiveCfg = Debug|Win32
35 {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}.Debug.Build.0 = Debug|Win32
36 {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}.Release.ActiveCfg = Release|Win32
37 {2398BB2F-FFF9-490B-B4CC-863F2D21AE46}.Release.Build.0 = Release|Win32
38 {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}.Debug.ActiveCfg = Debug|Win32
39 {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}.Debug.Build.0 = Debug|Win32
40 {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}.Release.ActiveCfg = Release|Win32
41 {8CAC9E26-BAA5-45A4-8721-E3170B3F8F49}.Release.Build.0 = Release|Win32
42 EndGlobalSection
43 GlobalSection(ExtensibilityGlobals) = postSolution
44 EndGlobalSection
45 GlobalSection(ExtensibilityAddIns) = postSolution
46 EndGlobalSection
47 EndGlobal
0 <?xml version="1.0" encoding = "Windows-1252"?>
1 <VisualStudioProject
2 ProjectType="Visual C++"
3 Version="7.10"
4 Name="in_mp4"
5 SccProjectName=""
6 SccLocalPath="">
7 <Platforms>
8 <Platform
9 Name="Win32"/>
10 </Platforms>
11 <Configurations>
12 <Configuration
13 Name="Debug|Win32"
14 OutputDirectory=".\Debug"
15 IntermediateDirectory=".\Debug"
16 ConfigurationType="2"
17 UseOfMFC="0"
18 ATLMinimizesCRunTimeLibraryUsage="FALSE">
19 <Tool
20 Name="VCCLCompilerTool"
21 Optimization="0"
22 AdditionalIncludeDirectories="..\..\include,..\..\common\mp4v2,..\..\common\mp4av"
23 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
24 BasicRuntimeChecks="0"
25 RuntimeLibrary="1"
26 UsePrecompiledHeader="2"
27 PrecompiledHeaderFile=".\Debug/in_mp4.pch"
28 AssemblerListingLocation=".\Debug/"
29 ObjectFile=".\Debug/"
30 ProgramDataBaseFileName=".\Debug/"
31 WarningLevel="3"
32 SuppressStartupBanner="TRUE"
33 DebugInformationFormat="4"
34 CompileAs="0">
35 <IntelOptions
36 Optimization="0"
37 MinimalRebuild="1"
38 BasicRuntimeChecks="0"
39 RuntimeLibrary="1"
40 AllOptions="/c /I &quot;..\..\include&quot; /I &quot;..\..\common\mp4v2&quot; /I &quot;..\..\common\mp4av&quot; /ZI /nologo /W3 /Od /D &quot;WIN32&quot; /D &quot;_DEBUG&quot; /D &quot;_WINDOWS&quot; /D &quot;_WINDLL&quot; /Gm /EHsc /MTd /YX&quot;StdAfx.h&quot; /Fp&quot;.\Debug/in_mp4.pch&quot; /Fo&quot;.\Debug/&quot; /Fd&quot;.\Debug/&quot; /Gd"/>
41 </Tool>
42 <Tool
43 Name="VCCustomBuildTool"/>
44 <Tool
45 Name="VCLinkerTool"
46 AdditionalOptions="/MACHINE:I386"
47 AdditionalDependencies="ws2_32.lib odbc32.lib odbccp32.lib"
48 OutputFile=".\Debug/in_mp4.dll"
49 LinkIncremental="2"
50 SuppressStartupBanner="TRUE"
51 GenerateDebugInformation="TRUE"
52 ProgramDatabaseFile=".\Debug/in_mp4.pdb"
53 SubSystem="2"
54 ImportLibrary=".\Debug/in_mp4.lib">
55 <IntelOptions
56 AllOptions="/NOLOGO /DLL /OUT:&quot;.\Debug/in_mp4.dll&quot; /INCREMENTAL ws2_32.lib odbc32.lib odbccp32.lib /DEBUG /PDB:&quot;.\Debug/in_mp4.pdb&quot; /SUBSYSTEM:WINDOWS /TLBID:1 /IMPLIB:&quot;.\Debug/in_mp4.lib&quot; /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"/>
57 </Tool>
58 <Tool
59 Name="VCMIDLTool"
60 PreprocessorDefinitions="_DEBUG"
61 MkTypLibCompatible="TRUE"
62 SuppressStartupBanner="TRUE"
63 TargetEnvironment="1"
64 TypeLibraryName=".\Debug/in_mp4.tlb"/>
65 <Tool
66 Name="VCPostBuildEventTool"/>
67 <Tool
68 Name="VCPreBuildEventTool"/>
69 <Tool
70 Name="VCPreLinkEventTool"/>
71 <Tool
72 Name="VCResourceCompilerTool"
73 PreprocessorDefinitions="_DEBUG"
74 Culture="1043"/>
75 <Tool
76 Name="VCWebServiceProxyGeneratorTool"/>
77 <Tool
78 Name="VCXMLDataGeneratorTool"/>
79 <Tool
80 Name="VCWebDeploymentTool"/>
81 <Tool
82 Name="VCManagedWrapperGeneratorTool"/>
83 <Tool
84 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
85 <IntelOptions
86 CompilerName="1"/>
87 </Configuration>
88 <Configuration
89 Name="Release|Win32"
90 OutputDirectory=".\Release"
91 IntermediateDirectory=".\Release"
92 ConfigurationType="2"
93 UseOfMFC="0"
94 ATLMinimizesCRunTimeLibraryUsage="FALSE">
95 <Tool
96 Name="VCCLCompilerTool"
97 Optimization="1"
98 GlobalOptimizations="TRUE"
99 InlineFunctionExpansion="1"
100 EnableIntrinsicFunctions="TRUE"
101 FavorSizeOrSpeed="1"
102 OptimizeForProcessor="2"
103 AdditionalIncludeDirectories="..\..\include,..\..\common\mp4v2,..\..\common\mp4av"
104 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
105 StringPooling="TRUE"
106 RuntimeLibrary="2"
107 EnableFunctionLevelLinking="TRUE"
108 UsePrecompiledHeader="2"
109 PrecompiledHeaderFile=".\Release/in_mp4.pch"
110 AssemblerListingLocation=".\Release/"
111 ObjectFile=".\Release/"
112 ProgramDataBaseFileName=".\Release/"
113 WarningLevel="3"
114 SuppressStartupBanner="TRUE"
115 CompileAs="0">
116 <IntelOptions
117 Optimization="1"
118 GlobalOptimizations="1"
119 InlineFunctionExpansion="1"
120 EnableIntrinsicFunctions="1"
121 FavorSizeOrSpeed="1"
122 OmitFramePointers="1"
123 OptimizeForProcessor="2"
124 StringPooling="1"
125 RuntimeLibrary="2"
126 BufferSecurityCheck="1"
127 EnableFunctionLevelLinking="1"
128 AllOptions="/c /I &quot;..\..\include&quot; /I &quot;..\..\common\mp4v2&quot; /I &quot;..\..\common\mp4av&quot; /nologo /W3 /O1 /Og /Ob1 /Oi /Ot /Oy /G6 /D &quot;WIN32&quot; /D &quot;NDEBUG&quot; /D &quot;_WINDOWS&quot; /D &quot;_WINDLL&quot; /GF /FD /EHsc /MD /GS /Gy /YX&quot;StdAfx.h&quot; /Fp&quot;.\Release/in_mp4.pch&quot; /Fo&quot;.\Release/&quot; /Fd&quot;.\Release/&quot; /Gd"/>
129 </Tool>
130 <Tool
131 Name="VCCustomBuildTool"/>
132 <Tool
133 Name="VCLinkerTool"
134 AdditionalOptions="/MACHINE:I386"
135 AdditionalDependencies="ws2_32.lib"
136 OutputFile=".\Release/in_mp4.dll"
137 LinkIncremental="1"
138 SuppressStartupBanner="TRUE"
139 ProgramDatabaseFile=".\Release/in_mp4.pdb"
140 SubSystem="2"
141 ImportLibrary=".\Release/in_mp4.lib">
142 <IntelOptions
143 AllOptions="/NOLOGO /DLL /OUT:&quot;.\Release/in_mp4.dll&quot; /INCREMENTAL:NO ws2_32.lib /PDB:&quot;.\Release/in_mp4.pdb&quot; /SUBSYSTEM:WINDOWS /TLBID:1 /IMPLIB:&quot;.\Release/in_mp4.lib&quot; /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"/>
144 </Tool>
145 <Tool
146 Name="VCMIDLTool"
147 PreprocessorDefinitions="NDEBUG"
148 MkTypLibCompatible="TRUE"
149 SuppressStartupBanner="TRUE"
150 TargetEnvironment="1"
151 TypeLibraryName=".\Release/in_mp4.tlb"/>
152 <Tool
153 Name="VCPostBuildEventTool"/>
154 <Tool
155 Name="VCPreBuildEventTool"/>
156 <Tool
157 Name="VCPreLinkEventTool"/>
158 <Tool
159 Name="VCResourceCompilerTool"
160 PreprocessorDefinitions="NDEBUG"
161 Culture="1043"/>
162 <Tool
163 Name="VCWebServiceProxyGeneratorTool"/>
164 <Tool
165 Name="VCXMLDataGeneratorTool"/>
166 <Tool
167 Name="VCWebDeploymentTool"/>
168 <Tool
169 Name="VCManagedWrapperGeneratorTool"/>
170 <Tool
171 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
172 <IntelOptions
173 CompilerName="1"/>
174 </Configuration>
175 </Configurations>
176 <References/>
177 <Files>
178 <Filter
179 Name="Source Files"
180 Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
181 <File
182 RelativePath="aac2mp4.cpp"/>
183 <File
184 RelativePath="aacinfo.c"/>
185 <File
186 RelativePath=".\config.c"/>
187 <File
188 RelativePath=".\in_mp4.c"/>
189 <File
190 RelativePath=".\utils.c"/>
191 </Filter>
192 <Filter
193 Name="Header Files"
194 Filter="h;hpp;hxx;hm;inl">
195 <File
196 RelativePath="aac2mp4.h"/>
197 <File
198 RelativePath="aacinfo.h"/>
199 <File
200 RelativePath=".\config.h"/>
201 <File
202 RelativePath="..\..\include\faad.h"/>
203 <File
204 RelativePath=".\in2.h"/>
205 <File
206 RelativePath=".\out.h"/>
207 <File
208 RelativePath="resource.h"/>
209 <File
210 RelativePath=".\utils.h"/>
211 </Filter>
212 <Filter
213 Name="Resource Files"
214 Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
215 <File
216 RelativePath=".\in_mp4.rc"/>
217 </Filter>
218 </Files>
219 <Globals/>
220 </VisualStudioProject>
0 /*
1 * The contents of this file are subject to the Mozilla Public
2 * License Version 1.1 (the "License"); you may not use this file
3 * except in compliance with the License. You may obtain a copy of
4 * the License at http://www.mozilla.org/MPL/
5 *
6 * Software distributed under the License is distributed on an "AS
7 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
8 * implied. See the License for the specific language governing
9 * rights and limitations under the License.
10 *
11 * The Original Code is MPEG4IP.
12 *
13 * The Initial Developer of the Original Code is Cisco Systems Inc.
14 * Portions created by Cisco Systems Inc. are
15 * Copyright (C) Cisco Systems Inc. 2001-2002. All Rights Reserved.
16 *
17 * Contributor(s):
18 * Dave Mackie dmackie@cisco.com
19 */
20
21 #ifndef __MBS_INCLUDED__
22 #define __MBS_INCLUDED__
23
24 class CMemoryBitstream {
25 public:
26 CMemoryBitstream() {
27 m_pBuf = NULL;
28 m_bitPos = 0;
29 m_numBits = 0;
30 }
31
32 void AllocBytes(u_int32_t numBytes);
33
34 void SetBytes(u_int8_t* pBytes, u_int32_t numBytes);
35
36 void PutBytes(u_int8_t* pBytes, u_int32_t numBytes);
37
38 void PutBits(u_int32_t bits, u_int32_t numBits);
39
40 u_int32_t GetBits(u_int32_t numBits);
41
42 void SkipBytes(u_int32_t numBytes) {
43 SkipBits(numBytes << 3);
44 }
45
46 void SkipBits(u_int32_t numBits) {
47 SetBitPosition(GetBitPosition() + numBits);
48 }
49
50 u_int32_t GetBitPosition() {
51 return m_bitPos;
52 }
53
54 void SetBitPosition(u_int32_t bitPos) {
55 if (bitPos > m_numBits) {
56 throw;
57 }
58 m_bitPos = bitPos;
59 }
60
61 u_int8_t* GetBuffer() {
62 return m_pBuf;
63 }
64
65 u_int32_t GetNumberOfBytes() {
66 return (GetNumberOfBits() + 7) / 8;
67 }
68
69 u_int32_t GetNumberOfBits() {
70 return m_numBits;
71 }
72
73 protected:
74 u_int8_t* m_pBuf;
75 u_int32_t m_bitPos;
76 u_int32_t m_numBits;
77 };
78
79 #endif /* __MBS_INCLUDED__ */
80
0 #define OUT_VER 0x10
1
2 typedef struct
3 {
4 int version; // module version (OUT_VER)
5 char *description; // description of module, with version string
6 int id; // module id. each input module gets its own. non-nullsoft modules should
7 // be >= 65536.
8
9 HWND hMainWindow; // winamp's main window (filled in by winamp)
10 HINSTANCE hDllInstance; // DLL instance handle (filled in by winamp)
11
12 void (*Config)(HWND hwndParent); // configuration dialog
13 void (*About)(HWND hwndParent); // about dialog
14
15 void (*Init)(); // called when loaded
16 void (*Quit)(); // called when unloaded
17
18 int (*Open)(int samplerate, int numchannels, int bitspersamp, int bufferlenms, int prebufferms);
19 // returns >=0 on success, <0 on failure
20 // NOTENOTENOTE: bufferlenms and prebufferms are ignored in most if not all output plug-ins.
21 // ... so don't expect the max latency returned to be what you asked for.
22 // returns max latency in ms (0 for diskwriters, etc)
23 // bufferlenms and prebufferms must be in ms. 0 to use defaults.
24 // prebufferms must be <= bufferlenms
25
26 void (*Close)(); // close the ol' output device.
27
28 int (*Write)(char *buf, int len);
29 // 0 on success. Len == bytes to write (<= 8192 always). buf is straight audio data.
30 // 1 returns not able to write (yet). Non-blocking, always.
31
32 int (*CanWrite)(); // returns number of bytes possible to write at a given time.
33 // Never will decrease unless you call Write (or Close, heh)
34
35 int (*IsPlaying)(); // non0 if output is still going or if data in buffers waiting to be
36 // written (i.e. closing while IsPlaying() returns 1 would truncate the song
37
38 int (*Pause)(int pause); // returns previous pause state
39
40 void (*SetVolume)(int volume); // volume is 0-255
41 void (*SetPan)(int pan); // pan is -128 to 128
42
43 void (*Flush)(int t); // flushes buffers and restarts output at time t (in ms)
44 // (used for seeking)
45
46 int (*GetOutputTime)(); // returns played time in MS
47 int (*GetWrittenTime)(); // returns time written in MS (used for synching up vis stuff)
48
49 } Out_Module;
50
51
0 //{{NO_DEPENDENCIES}}
1 // Microsoft Developer Studio generated include file.
2 // Used by in_mp4.rc
3 //
4 #define IDD_INFO 101
5 #define IDD_CONFIG 102
6 #define IDC_TYPE 1000
7 #define IDC_INFOTEXT 1000
8 #define IDC_DURATION 1001
9 #define IDC_BITRATE 1002
10 #define IDC_SAMPLERATE 1003
11 #define IDC_VTYPE 1004
12 #define IDC_PRIORITY 1004
13 #define IDC_VBITRATE 1005
14 #define IDC_ERROR 1005
15 #define IDC_VDURATION 1006
16 #define IDC_16BITS 1006
17 #define IDC_VSIZE 1007
18 #define IDC_24BITS 1007
19 #define IDC_CONVERT 1007
20 #define IDC_VFPS 1008
21 #define IDC_32BITS 1008
22 #define IDC_CONVERT2 1008
23 #define IDC_CHANNELS 1009
24 #define IDC_24BITS2 1009
25 #define IDC_16BITS_DITHERED 1009
26 #define IDC_CONVERT1 1009
27 #define IDC_USERDATA 1010
28 #define IDC_USEFORAAC 1011
29 #define IDC_METACOMPILATION 1012
30 #define IDC_METANAME 1013
31 #define IDC_METAARTIST 1014
32 #define IDC_METAWRITER 1015
33 #define IDC_METAALBUM 1016
34 #define IDC_METACOMMENTS 1017
35 #define IDC_METAGENRE 1018
36 #define IDC_METAYEAR 1019
37 #define IDC_METATRACK1 1020
38 #define IDC_METADISK1 1021
39 #define IDC_METATEMPO 1022
40 #define IDC_METATRACK2 1023
41 #define IDC_METADISK2 1024
42 #define IDC_STATIC1 1025
43 #define IDC_STATIC2 1026
44 #define IDC_STATIC3 1027
45 #define IDC_STATIC4 1028
46 #define IDC_STATIC5 1029
47 #define IDC_STATIC6 1030
48 #define IDC_STATIC7 1031
49 #define IDC_STATIC8 1032
50 #define IDC_STATIC9 1033
51 #define IDC_STATIC10 1034
52 #define IDC_STATIC11 1035
53 #define IDC_STATIC12 1036
54 #define IDC_DOWNMIX 1038
55 #define IDC_VBR 1039
56 #define IDC_TITLEFORMAT 1040
57
58 // Next default values for new objects
59 //
60 #ifdef APSTUDIO_INVOKED
61 #ifndef APSTUDIO_READONLY_SYMBOLS
62 #define _APS_NEXT_RESOURCE_VALUE 103
63 #define _APS_NEXT_COMMAND_VALUE 40001
64 #define _APS_NEXT_CONTROL_VALUE 1041
65 #define _APS_NEXT_SYMED_VALUE 101
66 #endif
67 #endif
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: utils.c,v 1.9 2004/10/18 19:25:00 menno Exp $
25 **/
26
27 #define WIN32_LEAN_AND_MEAN
28 #include <windows.h>
29 #include <malloc.h>
30 //#include <mp4.h>
31 #include <mp4ff.h>
32 #include <neaacdec.h>
33 #include "utils.h"
34
35 int StringComp(char const *str1, char const *str2, unsigned long len)
36 {
37 signed int c1 = 0, c2 = 0;
38
39 while (len--)
40 {
41 c1 = tolower(*str1++);
42 c2 = tolower(*str2++);
43
44 if (c1 == 0 || c1 != c2)
45 break;
46 }
47
48 return c1 - c2;
49 }
50
51 int GetAACTrack(mp4ff_t *infile)
52 {
53 /* find AAC track */
54 int i, rc;
55 int numTracks = mp4ff_total_tracks(infile);
56
57 for (i = 0; i < numTracks; i++)
58 {
59 unsigned char *buff = NULL;
60 int buff_size = 0;
61 mp4AudioSpecificConfig mp4ASC;
62
63 mp4ff_get_decoder_config(infile, i, &buff, &buff_size);
64
65 if (buff)
66 {
67 rc = NeAACDecAudioSpecificConfig(buff, buff_size, &mp4ASC);
68 free(buff);
69
70 if (rc < 0)
71 continue;
72 return i;
73 }
74 }
75
76 /* can't decode this */
77 return -1;
78 }
79
80 #if 0
81 int GetAudioTrack(MP4FileHandle infile)
82 {
83 /* find AAC track */
84 int i;
85 int numTracks = MP4GetNumberOfTracks(infile, NULL, 0);
86
87 for (i = 0; i < numTracks; i++)
88 {
89 MP4TrackId trackId = MP4FindTrackId(infile, i, NULL, 0);
90 const char* trackType = MP4GetTrackType(infile, trackId);
91
92 if (!strcmp(trackType, MP4_AUDIO_TRACK_TYPE))
93 {
94 return trackId;
95 }
96 }
97
98 /* can't decode this */
99 return -1;
100 }
101
102 int GetVideoTrack(MP4FileHandle infile)
103 {
104 /* find AAC track */
105 int i;
106 int numTracks = MP4GetNumberOfTracks(infile, NULL, 0);
107
108 for (i = 0; i < numTracks; i++)
109 {
110 MP4TrackId trackId = MP4FindTrackId(infile, i, NULL, 0);
111 const char* trackType = MP4GetTrackType(infile, trackId);
112
113 if (!strcmp(trackType, MP4_VIDEO_TRACK_TYPE))
114 {
115 return trackId;
116 }
117 }
118
119 /* can't decode this */
120 return -1;
121 }
122 #endif
123
124 LPTSTR PathFindFileName(LPCTSTR pPath)
125 {
126 LPCTSTR pT;
127
128 for (pT = pPath; *pPath; pPath = CharNext(pPath)) {
129 if ((pPath[0] == TEXT('\\') || pPath[0] == TEXT(':')) && pPath[1] && (pPath[1] != TEXT('\\')))
130 pT = pPath + 1;
131 }
132
133 return (LPTSTR)pT; // const -> non const
134 }
135
136 char *convert3in4to3in3(void *sample_buffer, int samples)
137 {
138 int i;
139 long *sample_buffer24 = (long*)sample_buffer;
140 char *data = malloc(samples*3*sizeof(char));
141
142 for (i = 0; i < samples; i++)
143 {
144 data[i*3] = sample_buffer24[i] & 0xFF;
145 data[i*3+1] = (sample_buffer24[i] >> 8) & 0xFF;
146 data[i*3+2] = (sample_buffer24[i] >> 16) & 0xFF;
147 }
148
149 return data;
150 }
0 /*
1 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
2 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** Any non-GPL usage of this software or parts of this software is strictly
19 ** forbidden.
20 **
21 ** Commercial non-GPL licensing of this software is possible.
22 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
23 **
24 ** $Id: utils.h,v 1.4 2004/09/03 19:38:32 menno Exp $
25 **/
26
27 #ifndef UTILS_INCLUDED
28 #define UTILS_INCLUDED
29
30 //#include <mp4.h>
31 #include <mp4ff.h>
32
33 LPTSTR PathFindFileName(LPCTSTR pPath);
34 //int GetVideoTrack(MP4FileHandle infile);
35 //int GetAudioTrack(MP4FileHandle infile);
36 int GetAACTrack(mp4ff_t *infile);
37 int StringComp(char const *str1, char const *str2, unsigned long len);
38 char *convert3in4to3in3(void *sample_buffer, int samples);
39
40 #endif
0 libdir = @MPEG4IP_PLAYER_PLUGIN_DIR@
1
2 lib_LTLIBRARIES = faad2_plugin.la
3 faad2_plugin_la_LDFLAGS = -module
4 faad2_plugin_la_SOURCES = \
5 faad2.cpp \
6 faad2.h \
7 aa_file.cpp \
8 aa_file.h
9
10 faad2_plugin_la_LIBADD = \
11 $(top_builddir)/libfaad/libfaad.la \
12 -lm
13
14
15 INCLUDES = -I$(top_srcdir)/include
16
17 AM_CFLAGS = -D_REENTRANT -fexceptions
18
19 AM_CXXFLAGS = -D_REENTRANT -DNOCONTROLS -fexceptions
20
21
0 Creating mpeg4ip plugin for Windows.
1
2 You will need to have mpeg4ip installed. If you install it on the same drive, with the top level directory
3 name of /mpeg4ip, you will have to do nothing other than move the faad2_plugin.dll from the Release or
4 Debug directory to the same directory as the other mpeg4ip plugins.
5
6 If you install it somewhere else, you will have to change the include paths and link paths in the project
7 settings for faad2_plugin to the proper directory. Look for /mpeg4ip (or \mpeg4ip) and change all occurances
8 of these in the file.
9
10 It might be best to hand-edit the faad_plugin.sdp file with wordpad and use the search and replace function.
0 /*
1 ** MPEG4IP plugin for FAAD2
2 ** Copyright (C) 2003 Bill May wmay@cisco.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** $Id: aa_file.cpp,v 1.2 2004/01/05 14:05:12 menno Exp $
19 **/
20 /*
21 * aa_file.cpp - create media structure for aac files
22 */
23
24 #include "faad2.h"
25 codec_data_t *aac_file_check (lib_message_func_t message,
26 const char *name,
27 double *max,
28 char *desc[4]
29 #ifdef HAVE_PLUGIN_VERSION_0_8
30 , CConfigSet *pConfig
31 #endif
32 )
33 {
34 aac_codec_t *aac;
35 int len = strlen(name);
36 if (strcasecmp(name + len - 4, ".aac") != 0) {
37 return (NULL);
38 }
39
40 aac = MALLOC_STRUCTURE(aac_codec_t);
41 memset(aac, 0, sizeof(*aac));
42 *max = 0;
43
44 aac->m_buffer = (uint8_t *)malloc(MAX_READ_BUFFER);
45 aac->m_buffer_size_max = MAX_READ_BUFFER;
46 aac->m_ifile = fopen(name, FOPEN_READ_BINARY);
47 if (aac->m_ifile == NULL) {
48 free(aac);
49 return NULL;
50 }
51 aac->m_output_frame_size = 1024;
52 aac->m_info = faacDecOpen(); // use defaults here...
53 aac->m_buffer_size = fread(aac->m_buffer,
54 1,
55 aac->m_buffer_size_max,
56 aac->m_ifile);
57
58 unsigned long freq;
59 unsigned char chans;
60
61 faacDecInit(aac->m_info, (unsigned char *)aac->m_buffer,
62 aac->m_buffer_size, &freq, &chans);
63 // may want to actually decode the first frame...
64 if (freq == 0) {
65 message(LOG_ERR, aaclib, "Couldn't determine AAC frame rate");
66 aac_close((codec_data_t *)aac);
67 return (NULL);
68 }
69 aac->m_freq = freq;
70 aac->m_chans = chans;
71 aac->m_faad_inited = 1;
72 aac->m_framecount = 0;
73 return ((codec_data_t *)aac);
74 }
75
76
77 int aac_file_next_frame (codec_data_t *your,
78 uint8_t **buffer,
79 uint64_t *ts)
80 {
81 aac_codec_t *aac = (aac_codec_t *)your;
82
83 if (aac->m_buffer_on > 0) {
84 memmove(aac->m_buffer,
85 &aac->m_buffer[aac->m_buffer_on],
86 aac->m_buffer_size - aac->m_buffer_on);
87 }
88 aac->m_buffer_size -= aac->m_buffer_on;
89 aac->m_buffer_size += fread(aac->m_buffer + aac->m_buffer_size,
90 1,
91 aac->m_buffer_size_max - aac->m_buffer_size,
92 aac->m_ifile);
93 aac->m_buffer_on = 0;
94 if (aac->m_buffer_size == 0) return 0;
95
96
97 uint64_t calc;
98 calc = aac->m_framecount * 1024 * M_LLU;
99 calc /= aac->m_freq;
100 *ts = calc;
101 *buffer = aac->m_buffer;
102 aac->m_framecount++;
103 return (aac->m_buffer_size);
104 }
105
106 void aac_file_used_for_frame (codec_data_t *ifptr,
107 uint32_t bytes)
108 {
109 aac_codec_t *aac = (aac_codec_t *)ifptr;
110 aac->m_buffer_on += bytes;
111 if (aac->m_buffer_on > aac->m_buffer_size) aac->m_buffer_on = aac->m_buffer_size;
112 }
113
114 int aac_file_eof (codec_data_t *ifptr)
115 {
116 aac_codec_t *aac = (aac_codec_t *)ifptr;
117 return aac->m_buffer_on == aac->m_buffer_size && feof(aac->m_ifile);
118 }
119
120 int aac_raw_file_seek_to (codec_data_t *ifptr, uint64_t ts)
121 {
122 if (ts != 0) return -1;
123
124 aac_codec_t *aac = (aac_codec_t *)ifptr;
125 rewind(aac->m_ifile);
126 aac->m_buffer_size = aac->m_buffer_on = 0;
127 aac->m_framecount = 0;
128 return 0;
129 }
0 /*
1 ** MPEG4IP plugin for FAAD2
2 ** Copyright (C) 2003 Bill May wmay@cisco.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** $Id: aa_file.h,v 1.1 2003/08/07 17:21:21 menno Exp $
19 **/
20 /*
21 * aa_file.h - prototypes for aac files
22 */
23 int create_media_for_aac_file (CPlayerSession *pspstr,
24 const char *name,
25 const char **errmsg);
0 /*
1 ** MPEG4IP plugin for FAAD2
2 ** Copyright (C) 2003 Bill May wmay@cisco.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** $Id: faad2.cpp,v 1.3 2004/08/20 08:30:53 menno Exp $
19 **/
20 #include "faad2.h"
21 #include <mpeg4_audio_config.h>
22 #include <mpeg4_sdp.h>
23 #include <mp4.h>
24 #include <SDL/SDL.h>
25
26 #define DEBUG_SYNC 2
27
28 #ifndef M_LLU
29 #define M_LLU M_64
30 #define LLU U64
31 #endif
32 const char *aaclib="faad2";
33
34 /*
35 * Create CAACodec class
36 */
37 static codec_data_t *aac_codec_create (const char *compressor,
38 int type,
39 int profile,
40 format_list_t *media_fmt,
41 audio_info_t *audio,
42 const uint8_t *userdata,
43 uint32_t userdata_size,
44 audio_vft_t *vft,
45 void *ifptr)
46
47 {
48 aac_codec_t *aac;
49
50 aac = (aac_codec_t *)malloc(sizeof(aac_codec_t));
51 memset(aac, 0, sizeof(aac_codec_t));
52
53 aac->m_vft = vft;
54 aac->m_ifptr = ifptr;
55 fmtp_parse_t *fmtp = NULL;
56 // Start setting up FAAC stuff...
57
58 aac->m_resync_with_header = 1;
59 aac->m_record_sync_time = 1;
60
61 aac->m_audio_inited = 0;
62
63 // Use media_fmt to indicate that we're streaming.
64 if (media_fmt != NULL) {
65 // haven't checked for null buffer
66 // This is not necessarilly right - it is, for the most part, but
67 // we should be reading the fmtp statement, and looking at the config.
68 // (like we do below in the userdata section...
69 aac->m_freq = media_fmt->rtpmap->clock_rate;
70 fmtp = parse_fmtp_for_mpeg4(media_fmt->fmt_param, vft->log_msg);
71 if (fmtp != NULL) {
72 userdata = fmtp->config_binary;
73 userdata_size = fmtp->config_binary_len;
74 }
75 }
76
77 aac->m_info = faacDecOpen();
78 unsigned long srate;
79 unsigned char chan;
80 if ((userdata == NULL && fmtp == NULL) ||
81 (faacDecInit2(aac->m_info,
82 (uint8_t *)userdata,
83 userdata_size,
84 &srate,
85 &chan) < 0)) {
86 if (fmtp != NULL) free_fmtp_parse(fmtp);
87 return NULL;
88 }
89
90 mp4AudioSpecificConfig mp4ASC;
91 aac->m_output_frame_size = 1024;
92 if (AudioSpecificConfig((unsigned char *)userdata,
93 userdata_size,
94 &mp4ASC)) {
95 if (mp4ASC.frameLengthFlag) {
96 aac->m_output_frame_size = 960;
97 }
98 }
99 aac->m_freq = srate;
100 aac->m_chans = chan;
101 aac->m_faad_inited = 1;
102 aac->m_msec_per_frame = aac->m_output_frame_size;
103 aac->m_msec_per_frame *= M_LLU;
104 aac->m_msec_per_frame /= aac->m_freq;
105
106 // faad_init_bytestream(&m_info->ld, c_read_byte, c_bookmark, m_bytestream);
107
108 aa_message(LOG_INFO, aaclib, "Setting freq to %d", aac->m_freq);
109 #if DUMP_OUTPUT_TO_FILE
110 aac->m_outfile = fopen("temp.raw", "w");
111 #endif
112 if (fmtp != NULL) {
113 free_fmtp_parse(fmtp);
114 }
115 return (codec_data_t *)aac;
116 }
117
118 void aac_close (codec_data_t *ptr)
119 {
120 if (ptr == NULL) {
121 return;
122 }
123 aac_codec_t *aac = (aac_codec_t *)ptr;
124 faacDecClose(aac->m_info);
125 aac->m_info = NULL;
126
127 #if DUMP_OUTPUT_TO_FILE
128 fclose(aac->m_outfile);
129 #endif
130 free(aac);
131 }
132
133 /*
134 * Handle pause - basically re-init the codec
135 */
136 static void aac_do_pause (codec_data_t *ifptr)
137 {
138 aac_codec_t *aac = (aac_codec_t *)ifptr;
139 aac->m_resync_with_header = 1;
140 aac->m_record_sync_time = 1;
141 aac->m_audio_inited = 0;
142 aac->m_ignore_first_sample = 0;
143 faacDecPostSeekReset(aac->m_info, 0);
144 }
145
146 /*
147 * Decode task call for FAAC
148 */
149 static int aac_decode (codec_data_t *ptr,
150 uint64_t ts,
151 int from_rtp,
152 int *sync_frame,
153 uint8_t *buffer,
154 uint32_t buflen,
155 void *userdata)
156 {
157 aac_codec_t *aac = (aac_codec_t *)ptr;
158 unsigned long bytes_consummed;
159 int bits = -1;
160 // struct timezone tz;
161
162 if (aac->m_record_sync_time) {
163 aac->m_current_frame = 0;
164 aac->m_record_sync_time = 0;
165 aac->m_current_time = ts;
166 aac->m_last_rtp_ts = ts;
167 } else {
168 if (aac->m_last_rtp_ts == ts) {
169 aac->m_current_time += aac->m_msec_per_frame;
170 aac->m_current_frame++;
171 } else {
172 aac->m_last_rtp_ts = ts;
173 aac->m_current_time = ts;
174 aac->m_current_frame = 0;
175 }
176
177 // Note - here m_current_time should pretty much always be >= rtpts.
178 // If we're not, we most likely want to stop and resync. We don't
179 // need to keep decoding - just decode this frame and indicate we
180 // need a resync... That should handle fast forwards... We need
181 // someway to handle reverses - perhaps if we're more than .5 seconds
182 // later...
183 }
184
185 if (aac->m_faad_inited == 0) {
186 /*
187 * If not initialized, do so.
188 */
189 abort();
190 unsigned long freq;
191 unsigned char chans;
192
193 faacDecInit(aac->m_info,
194 (unsigned char *)buffer,
195 buflen,
196 &freq,
197 &chans);
198 aac->m_freq = freq;
199 aac->m_chans = chans;
200 aac->m_faad_inited = 1;
201 }
202
203 uint8_t *buff;
204 unsigned long samples;
205 bytes_consummed = buflen;
206 //aa_message(LOG_DEBUG, aaclib, "decoding %d bits", buflen * 8);
207 faacDecFrameInfo frame_info;
208 buff = (uint8_t *)faacDecDecode(aac->m_info,
209 &frame_info,
210 buffer,
211 buflen);
212 if (buff != NULL) {
213 bytes_consummed = frame_info.bytesconsumed;
214 #if 0
215 aa_message(LOG_DEBUG, aaclib, LLU" bytes %d samples %d",
216 ts, bytes_consummed, frame_info.samples);
217 #endif
218 if (aac->m_audio_inited != 0) {
219 int tempchans = frame_info.channels;
220 if (tempchans != aac->m_chans) {
221 aa_message(LOG_NOTICE, aaclib, "chupdate - chans from data is %d",
222 tempchans);
223 }
224 } else {
225 int tempchans = frame_info.channels;
226
227 if (tempchans == 0) {
228 aa_message(LOG_ERR, aaclib, "initializing aac, returned channels are 0");
229 aac->m_resync_with_header = 1;
230 aac->m_record_sync_time = 1;
231 return bytes_consummed;
232 }
233 aac->m_chans = tempchans;
234 aac->m_freq = frame_info.samplerate;
235
236 aac->m_vft->audio_configure(aac->m_ifptr,
237 aac->m_freq,
238 aac->m_chans,
239 (audio_format_t)AUDIO_S16SYS,
240 aac->m_output_frame_size);
241 uint8_t *now = aac->m_vft->audio_get_buffer(aac->m_ifptr);
242 aac->m_audio_inited = 1;
243 }
244 /*
245 * good result - give it to audio sync class
246 */
247 #if DUMP_OUTPUT_TO_FILE
248 fwrite(buff, aac->m_output_frame_size * 4, 1, aac->m_outfile);
249 #endif
250 if (frame_info.samples != 0) {
251 aac->m_vft->audio_load_buffer(aac->m_ifptr,
252 buff,
253 frame_info.samples * 2,
254 aac->m_last_ts,
255 aac->m_resync_with_header);
256 if (aac->m_resync_with_header == 1) {
257 aac->m_resync_with_header = 0;
258 #ifdef DEBUG_SYNC
259 aa_message(LOG_DEBUG, aaclib, "Back to good at "LLU, aac->m_current_time);
260 #endif
261 }
262 }
263 } else {
264 aa_message(LOG_ERR, aaclib, "error return is %d", frame_info.error);
265 aac->m_resync_with_header = 1;
266 #ifdef DEBUG_SYNC
267 aa_message(LOG_ERR, aaclib, "Audio decode problem - at "LLU,
268 aac->m_current_time);
269 #endif
270 }
271 aac->m_last_ts = aac->m_current_time;
272 return (bytes_consummed);
273 }
274
275 static const char *aac_compressors[] = {
276 "aac ",
277 "mp4a",
278 "enca",
279 NULL
280 };
281
282 static int aac_codec_check (lib_message_func_t message,
283 const char *compressor,
284 int type,
285 int profile,
286 format_list_t *fptr,
287 const uint8_t *userdata,
288 uint32_t userdata_size
289 #ifdef HAVE_PLUGIN_VERSION_0_8
290 ,CConfigSet *pConfig
291 #endif
292 )
293 {
294 fmtp_parse_t *fmtp = NULL;
295 if (compressor != NULL &&
296 strcasecmp(compressor, "MP4 FILE") == 0 &&
297 type != -1) {
298 switch (type) {
299 case MP4_MPEG2_AAC_MAIN_AUDIO_TYPE:
300 case MP4_MPEG2_AAC_LC_AUDIO_TYPE:
301 case MP4_MPEG2_AAC_SSR_AUDIO_TYPE:
302 case MP4_MPEG4_AUDIO_TYPE:
303 break;
304 default:
305 return -1;
306 }
307 }
308 if (fptr != NULL &&
309 fptr->rtpmap != NULL &&
310 fptr->rtpmap->encode_name != NULL) {
311 if (strcasecmp(fptr->rtpmap->encode_name, "mpeg4-generic") != 0) {
312 return -1;
313 }
314 if (userdata == NULL) {
315 fmtp = parse_fmtp_for_mpeg4(fptr->fmt_param, message);
316 if (fmtp != NULL) {
317 userdata = fmtp->config_binary;
318 userdata_size = fmtp->config_binary_len;
319 }
320 }
321 }
322 if (userdata != NULL) {
323 mpeg4_audio_config_t audio_config;
324 decode_mpeg4_audio_config(userdata, userdata_size, &audio_config);
325 message(LOG_DEBUG, "aac", "audio type is %d", audio_config.audio_object_type);
326 if (fmtp != NULL) free_fmtp_parse(fmtp);
327
328 if (audio_object_type_is_aac(&audio_config) == 0) {
329 return -1;
330 }
331 #if 0
332 if (audio_config.audio_object_type == 17) {
333 message(LOG_INFO, "aac", "audio type is legal ISMA, but not supported");
334 return -1;
335 }
336 #endif
337 return 2;
338 }
339 #if 0
340 // I'm not sure I want to be here if we don't have an audio config
341 if (compressor != NULL) {
342 const char **lptr = aac_compressors;
343 while (*lptr != NULL) {
344 if (strcasecmp(*lptr, compressor) == 0) {
345 return 2;
346 }
347 lptr++;
348 }
349 }
350 #endif
351 return -1;
352 }
353
354 #ifndef HAVE_PLUGIN_VERSION_0_8
355 AUDIO_CODEC_WITH_RAW_FILE_PLUGIN("faad2",
356 aac_codec_create,
357 aac_do_pause,
358 aac_decode,
359 NULL,
360 aac_close,
361 aac_codec_check,
362 aac_file_check,
363 aac_file_next_frame,
364 aac_file_used_for_frame,
365 aac_raw_file_seek_to,
366 aac_file_eof
367 );
368 #else
369 AUDIO_CODEC_WITH_RAW_FILE_PLUGIN("faad2",
370 aac_codec_create,
371 aac_do_pause,
372 aac_decode,
373 NULL,
374 aac_close,
375 aac_codec_check,
376 aac_file_check,
377 aac_file_next_frame,
378 aac_file_used_for_frame,
379 aac_raw_file_seek_to,
380 aac_file_eof,
381 NULL,
382 0
383 );
384 #endif
385 /* end file aa.cpp */
386
387
0 /*
1 ** MPEG4IP plugin for FAAD2
2 ** Copyright (C) 2003 Bill May wmay@cisco.com
3 **
4 ** This program is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
13 **
14 ** You should have received a copy of the GNU General Public License
15 ** along with this program; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 **
18 ** $Id: faad2.h,v 1.2 2004/01/05 14:05:12 menno Exp $
19 **/
20 /*
21 * aa.h - class definition for AAC codec.
22 */
23
24 #ifndef __AA_H__
25 #define __AA_H__ 1
26 #include "faad.h"
27 #include "codec_plugin.h"
28
29 #ifndef M_LLU
30 #define M_LLU M_64
31 #define LLU U64
32 #endif
33
34 typedef struct aac_codec_t {
35 codec_data_t c;
36 audio_vft_t *m_vft;
37 void *m_ifptr;
38 faacDecHandle m_info;
39 int m_object_type;
40 int m_resync_with_header;
41 int m_record_sync_time;
42 uint64_t m_current_time;
43 uint64_t m_last_rtp_ts;
44 uint64_t m_msec_per_frame;
45 uint32_t m_current_frame;
46 int m_audio_inited;
47 int m_faad_inited;
48 int m_freq; // frequency
49 int m_chans; // channels
50 int m_output_frame_size;
51 #if DUMP_OUTPUT_TO_FILE
52 FILE *m_outfile;
53 #endif
54 FILE *m_ifile;
55 uint8_t *m_buffer;
56 uint32_t m_buffer_size_max;
57 uint32_t m_buffer_size;
58 uint32_t m_buffer_on;
59 uint64_t m_framecount;
60 int m_ignore_first_sample;
61 uint64_t m_last_ts;
62 } aac_codec_t;
63
64 #define m_vft c.v.audio_vft
65 #define m_ifptr c.ifptr
66 #define MAX_READ_BUFFER (768 * 8)
67
68 #define aa_message aac->m_vft->log_msg
69 void aac_close(codec_data_t *ptr);
70 extern const char *aaclib;
71
72 codec_data_t *aac_file_check(lib_message_func_t message,
73 const char *name,
74 double *max,
75 char *desc[4]
76 #ifdef HAVE_PLUGIN_VERSION_0_8
77 , CConfigSet *pConfig
78 #endif
79 );
80
81 int aac_file_next_frame(codec_data_t *ifptr,
82 uint8_t **buffer,
83 uint64_t *ts);
84 int aac_file_eof(codec_data_t *ifptr);
85
86 void aac_file_used_for_frame(codec_data_t *ifptr,
87 uint32_t bytes);
88
89 int aac_raw_file_seek_to(codec_data_t *ifptr,
90 uint64_t ts);
91 #endif
0 # Microsoft Developer Studio Project File - Name="faad2_plugin" - Package Owner=<4>
1 # Microsoft Developer Studio Generated Build File, Format Version 6.00
2 # ** DO NOT EDIT **
3
4 # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
5
6 CFG=faad2_plugin - Win32 Debug
7 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
8 !MESSAGE use the Export Makefile command and run
9 !MESSAGE
10 !MESSAGE NMAKE /f "faad2_plugin.mak".
11 !MESSAGE
12 !MESSAGE You can specify a configuration when running NMAKE
13 !MESSAGE by defining the macro CFG on the command line. For example:
14 !MESSAGE
15 !MESSAGE NMAKE /f "faad2_plugin.mak" CFG="faad2_plugin - Win32 Debug"
16 !MESSAGE
17 !MESSAGE Possible choices for configuration are:
18 !MESSAGE
19 !MESSAGE "faad2_plugin - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
20 !MESSAGE "faad2_plugin - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
21 !MESSAGE
22
23 # Begin Project
24 # PROP AllowPerConfigDependencies 0
25 # PROP Scc_ProjName ""
26 # PROP Scc_LocalPath ""
27 CPP=cl.exe
28 MTL=midl.exe
29 RSC=rc.exe
30
31 !IF "$(CFG)" == "faad2_plugin - Win32 Release"
32
33 # PROP BASE Use_MFC 0
34 # PROP BASE Use_Debug_Libraries 0
35 # PROP BASE Output_Dir "Release"
36 # PROP BASE Intermediate_Dir "Release"
37 # PROP BASE Target_Dir ""
38 # PROP Use_MFC 0
39 # PROP Use_Debug_Libraries 0
40 # PROP Output_Dir "Release"
41 # PROP Intermediate_Dir "Release"
42 # PROP Ignore_Export_Lib 0
43 # PROP Target_Dir ""
44 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
45 # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /I "/mpeg4ip/include" /I "/mpeg4ip/player/src" /I "/mpeg4ip/player/lib/mp4util" /I "/mpeg4ip/lib/sdp" /I "/mpeg4ip/lib/SDL/include" /I "/mpeg4ip/lib/mp4v2" /D "_WINDOWS" /D "_WIN32" /D "WIN32" /D "NDEBUG" /YX /FD /I /mpeg4ip/include" /I /mpeg4ip/player/src" /I /mpeg4ip/lib/sdp" /I /mpeg4ip/player/lib/mp4util" /I /mpeg4ip/lib/SDL/include" " " " " " /c
46 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
47 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
48 # ADD BASE RSC /l 0x409 /d "NDEBUG"
49 # ADD RSC /l 0x409 /d "NDEBUG"
50 BSC32=bscmake.exe
51 # ADD BASE BSC32 /nologo
52 # ADD BSC32 /nologo
53 LINK32=link.exe
54 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
55 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \mpeg4ip\player\lib\mp4util\Release\libmp4util60.lib \mpeg4ip\lib\bitstream\Release\bitstream60.lib /nologo /subsystem:windows /dll /machine:I386 /nodefaultlib:"libcmt.lib" /nodefaultlib:"libc.lib"
56
57 !ELSEIF "$(CFG)" == "faad2_plugin - Win32 Debug"
58
59 # PROP BASE Use_MFC 0
60 # PROP BASE Use_Debug_Libraries 1
61 # PROP BASE Output_Dir "Debug"
62 # PROP BASE Intermediate_Dir "Debug"
63 # PROP BASE Target_Dir ""
64 # PROP Use_MFC 0
65 # PROP Use_Debug_Libraries 1
66 # PROP Output_Dir "Debug"
67 # PROP Intermediate_Dir "Debug"
68 # PROP Ignore_Export_Lib 0
69 # PROP Target_Dir ""
70 # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
71 # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "../../include" /I "/mpeg4ip/include" /I "/mpeg4ip/player/src" /I "/mpeg4ip/player/lib/mp4util" /I "/mpeg4ip/lib/sdp" /I "/mpeg4ip/lib/SDL/include" /I "/mpeg4ip/lib/mp4v2" /D "_WINDOWS" /D "_WIN32" /D "WIN32" /D "_DEBUG" /YX /FD /I /mpeg4ip/lib/mp4v2" /I /mpeg4ip/lib/SDL" /I /mpeg4ip/include" /I /mpeg4ip/player/src" /I /mpeg4ip/lib/sdp" /I /mpeg4ip/player/lib/mp4util" /I /mpeg4ip/lib/SDL/include" " " " " " " " /c
72 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
73 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
74 # ADD BASE RSC /l 0x409 /d "_DEBUG"
75 # ADD RSC /l 0x409 /d "_DEBUG"
76 BSC32=bscmake.exe
77 # ADD BASE BSC32 /nologo
78 # ADD BSC32 /nologo
79 LINK32=link.exe
80 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
81 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \mpeg4ip\player\lib\mp4util\Debug\libmp4util60.lib \mpeg4ip\lib\bitstream\Debug\bitstream60.lib /nologo /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libcd.lib" /pdbtype:sept
82
83 !ENDIF
84
85 # Begin Target
86
87 # Name "faad2_plugin - Win32 Release"
88 # Name "faad2_plugin - Win32 Debug"
89 # Begin Source File
90
91 SOURCE=.\aa_file.cpp
92 # End Source File
93 # Begin Source File
94
95 SOURCE=.\aa_file.h
96 # End Source File
97 # Begin Source File
98
99 SOURCE=.\faad2.cpp
100 # End Source File
101 # Begin Source File
102
103 SOURCE=.\faad2.h
104 # End Source File
105 # End Target
106 # End Project
0 Microsoft Developer Studio Workspace File, Format Version 6.00
1 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
2
3 ###############################################################################
4
5 Project: "faad2_plugin"=.\faad2_plugin.dsp - Package Owner=<4>
6
7 Package=<5>
8 {{{
9 }}}
10
11 Package=<4>
12 {{{
13 Begin Project Dependency
14 Project_Dep_Name libfaad
15 End Project Dependency
16 }}}
17
18 ###############################################################################
19
20 Project: "libfaad"=..\..\libfaad\libfaad.dsp - Package Owner=<4>
21
22 Package=<5>
23 {{{
24 }}}
25
26 Package=<4>
27 {{{
28 }}}
29
30 ###############################################################################
31
32 Global:
33
34 Package=<5>
35 {{{
36 }}}
37
38 Package=<3>
39 {{{
40 }}}
41
42 ###############################################################################
43
0 xmms-mp4 plugin for xmms-1.2.x
1
2 re-coded by ciberfred from scratch
0 22 August 2004:
1 * move from libmp4v2 to libmp4ff
2
3 1 December 2003:
4 * remove aac plug and merge the aac part with the mp4 part
5 so now 2 plugins in one :)
6
7 4 juillet 2003:
8 * package the plugin for faad2
9 * upgrade code to libfaad2-2.0 API
10 * version 0.5
11
12 15 juin 2003:
13 * better configuration code
14 (choose automaticaly at compile time)
15 * installation must be set by root
16 * version 0.4
17
18 15 mai 2003:
19 * update configure script to be better
20 * version 0.3
21
22 01 Novembre 2002:
23 * check automake/autoconf/libtool for plugin, now 'make install' work
24 * handle seeking
25 * configuration box created (thanks glade !)
26 * handle aac informations
27 * modification to a better infobox (thanks angain glade !)
28 * version 0.2 ready to public :)
29
30 25 Aout 2002:
31 * gtk-1.2.x info file with some 'static' useful ID3 info
32 * title show in xmms correctly
33 * version 0.1 ready to public :)
34
35 20 Aout 2002:
36 * everything...
37 * work with faad2lib-1.1, id3lib-3.8.0 (glibc-2.2.5, gcc-2.95.3)
38 i think the minimum required but need testing...
39 * playlist working
40 * handle id3tag, the plugin work :)
41 * new maintener : ciberfred
42
0 the installation of this plugin is provide by the faad2 package.
1 add to configure time the option '--with-xmms' and the plugin will be build
0 SUBDIRS = src
1
0 22 Aout 2004
1 ------------
2 modification du system de compilation, passage de libmp4v2 a libmp4ff
3 en static, libfaad en dynamique.
4
5 1 Decembre 2003
6 ---------------
7 merge du plugin aac et du plugin mp4. modification des script du projet faad
8 le plugin ne doit pas etre construit en meme temps que le projet
9
10 4 Juillet 2003
11 --------------
12 integration du plugin xmms-aac dans le projet faad2 version 2.x
13
14 15 aout 2002
15 ------------
16
17 Recodage en entier du plugin aac
18 me contacter par mail a :
19
20 frederic.fondriest@laposte.net
0 xmms-mp4 plugin v0.5
1 (dynamic version)
2 "a mp4/aac audio player for xmms"
3 coded by ciberfred from france
4 -------------
5
6 This source code allow to xmms to read .mp4/.m4a/.aac files
7
8 About.
9 This plugin is a merge between aac and mp4 plugin. so now you could read
10 all new and old files encoded with different encoder and different format
11 (for the aac part). This is possible since the libfaad2 allow to read
12 old aac ADTS format.
13
14 For any informations about this plugin contact me at :
15
16 mail : frederic.fondriest@laposte.net
17 ICQ : 17293220
18 aac plugin homepage (and more) : http://fondriest.frederic.free.fr/realisations/
19 IRC : irc.eu.freenode.net (#lamip)
20
21 --
22 Frederic Fondriest
0 TODO:
1
2 * handle AAC info such as MPEG-AAC type, header (ADTS/ADIF),...
3 * seeking... but it will certainly an option because it need
4 a reading of whole file....
5 * any suggestions ... send me somes messages about it :)
0 local_CFLAGS=`$(XMMS_CONFIG) --cflags` -Wall
1 local_LDFLAGS=`$(XMMS_CONFIG) --libs`
2 libdir = `$(XMMS_CONFIG) --input-plugin-dir`
3 lib_LTLIBRARIES = libmp4.la
4
5 libmp4_la_CFLAGS = $(local_CFLAGS) -Wall \
6 -I$(top_srcdir)/include -I$(top_srcdir)/common/mp4ff
7
8 libmp4_la_LIBADD = $(top_builddir)/libfaad/libfaad.la \
9 $(top_builddir)/common/mp4ff/libmp4ff.la
10
11 libmp4_la_LDFLAGS = -module -avoid-version $(local_LDFLAGS) -lpthread
12
13 libmp4_la_SOURCES = libmp4.c mp4_utils.c aac_utils.c
0 /*
1 *
2 * utils for AAC informations
3 */
4 #include <glib.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <string.h>
8
9
10 #define ADTS_HEADER_SIZE 8
11 #define SEEK_TABLE_CHUNK 60
12 #define MPEG4_TYPE 0
13 #define MPEG2_TYPE 1
14
15 // Read ADTS header, the file descriptor must be at
16 // the begining of the aac frame not at the id3tag
17
18 int getAacInfo(FILE *fd)
19 {
20 unsigned char header[ADTS_HEADER_SIZE];
21 unsigned int id;
22 unsigned long originPosition;
23
24 originPosition = ftell(fd);
25 if(fread(header, 1, ADTS_HEADER_SIZE, fd) != ADTS_HEADER_SIZE){
26 fseek(fd, originPosition, SEEK_SET);
27 return(-1);
28 }
29 if(!((header[0]==0xFF)&&((header[1]& 0xF6)==0xF0))){
30 printf("Bad header\n");
31 return(-1);
32 }
33 id = header[1]&0x08;
34 if(id==0){//MPEG-4 AAC
35 fseek(fd, originPosition, SEEK_SET);
36 return(MPEG4_TYPE);
37 }else{
38 fseek(fd, originPosition, SEEK_SET);
39 return(MPEG2_TYPE);
40 }
41 fseek(fd, originPosition, SEEK_SET);
42 return(-1);
43 }
44
45 // as AAC is VBR we need to check all ADTS header
46 // to enable seeking...
47 // there is no other solution
48 void checkADTSForSeeking(FILE *fd,
49 unsigned long **seekTable,
50 unsigned long *seekTableLength)
51 {
52 unsigned long originPosition;
53 unsigned long position;
54 unsigned char header[ADTS_HEADER_SIZE];
55 unsigned int frameCount, frameLength, frameInsec;
56 unsigned int id=0, seconds=0;
57
58 originPosition = ftell(fd);
59
60 for(frameCount=0,frameInsec=0;; frameCount++,frameInsec++){
61 position = ftell(fd);
62 if(fread(header, 1, ADTS_HEADER_SIZE, fd)!=ADTS_HEADER_SIZE){
63 break;
64 }
65 if(!strncmp(header, "ID3", 3)){
66 break;
67 }
68 if(!((header[0]==0xFF)&&((header[1]& 0xF6)==0xF0))){
69 printf("error : Bad 1st header, file may be corrupt !\n");
70 break;
71 }
72 if(!frameCount){
73 id=header[1]&0x08;
74 if(((*seekTable) = malloc(SEEK_TABLE_CHUNK * sizeof(unsigned long)))==0){
75 printf("malloc error\n");
76 return;
77 }
78 (*seekTableLength) = SEEK_TABLE_CHUNK;
79 }
80
81 //if(id==0){//MPEG-4
82 //frameLength = ((unsigned int)header[4]<<5)|((unsigned int)header[5]>>3);
83 //}else{//MPEG-2
84 frameLength = (((unsigned int)header[3]&0x3)<<11)|((unsigned int)header[4]<<3)|(header[5]>>5);
85 //}
86 if(frameInsec==43){//???
87 frameInsec=0;
88 }
89 if(frameInsec==0){
90 if(seconds == (*seekTableLength)){
91 (*seekTable) = realloc((*seekTable), (seconds+SEEK_TABLE_CHUNK)*sizeof(unsigned long));
92 (*seekTableLength) = seconds+SEEK_TABLE_CHUNK;
93 }
94 (*seekTable)[seconds] = position;
95 seconds++;
96 }
97 if(fseek(fd, frameLength-ADTS_HEADER_SIZE, SEEK_CUR)==-1){
98 break;
99 }
100 }
101 (*seekTableLength) = seconds;
102 fseek(fd, originPosition, SEEK_SET);
103 }
0 /*
1 * MP4/AAC decoder for xmms
2 *
3 * OPTIONNAL need
4 * --------------
5 * libid3 (3.8.x - www.id3.org)
6 */
7
8 #include <pthread.h>
9 #include <gtk/gtk.h>
10 #include <stdio.h>
11 #include <string.h>
12
13 #if defined(HAVE_BMP)
14 #include <bmp/plugin.h>
15 #include <bmp/util.h>
16 #include <bmp/configfile.h>
17 #include <bmp/titlestring.h>
18 #else
19 #include <xmms/plugin.h>
20 #include <xmms/util.h>
21 #include <xmms/configfile.h>
22 #include <xmms/titlestring.h>
23 #endif /*HAVE_BMP*/
24
25 #include "neaacdec.h"
26 #include "mp4ff.h"
27
28 #define MP4_DESCRIPTION "MP4 & MPEG2/4-AAC audio player - 1.2.x"
29 #define MP4_VERSION "ver. 0.5-faad2-version - 22 August 2004"
30 #define MP4_ABOUT "Written by ciberfred"
31 #define BUFFER_SIZE FAAD_MIN_STREAMSIZE*64
32
33 static void mp4_init(void);
34 static void mp4_about(void);
35 static void mp4_play(char *);
36 static void mp4_stop(void);
37 static void mp4_pause(short);
38 static void mp4_seek(int);
39 static int mp4_getTime(void);
40 static void mp4_cleanup(void);
41 static void mp4_getSongTitle(char *, char **, int *);
42 static void mp4_getSongInfo(char *);
43 static int mp4_isFile(char *);
44 static void* mp4Decode(void *);
45
46 InputPlugin mp4_ip =
47 {
48 0, // handle
49 0, // filename
50 MP4_DESCRIPTION,
51 mp4_init,
52 mp4_about,
53 0, // configuration
54 mp4_isFile,
55 0, //scandir
56 mp4_play,
57 mp4_stop,
58 mp4_pause,
59 mp4_seek,
60 0, // set equalizer
61 mp4_getTime,
62 0, // get volume
63 0,
64 mp4_cleanup,
65 0, // obsolete
66 0, // send visualisation data
67 0, // set player window info
68 0, // set song title text
69 mp4_getSongTitle, // get song title text
70 mp4_getSongInfo, // info box
71 0, // to output plugin
72 };
73
74 typedef struct _mp4cfg{
75 gshort file_type;
76 #define FILE_UNKNOW 0
77 #define FILE_MP4 1
78 #define FILE_AAC 2
79 } Mp4Config;
80
81 static Mp4Config mp4cfg;
82 static gboolean bPlaying = FALSE;
83 static pthread_t decodeThread;
84 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
85 static int seekPosition = -1;
86
87 // Functions from mp4_utils.c
88 extern int getAACTrack(mp4ff_t *infile);
89 extern mp4ff_callback_t *getMP4FF_cb(FILE *mp4file);
90 extern char *getMP4title(mp4ff_t *infile, char *filename);
91 extern void getMP4info(char* filename, FILE *mp4file);
92
93 InputPlugin *get_iplugin_info(void)
94 {
95 return(&mp4_ip);
96 }
97
98 static void mp4_init(void)
99 {
100 memset(&decodeThread, 0, sizeof(pthread_t));
101 mp4cfg.file_type = FILE_UNKNOW;
102 seekPosition = -1;
103 return;
104 }
105
106 static void mp4_play(char *filename)
107 {
108 bPlaying = TRUE;
109 pthread_create(&decodeThread, 0, mp4Decode, g_strdup(filename));
110 return;
111 }
112
113 static void mp4_stop(void)
114 {
115 if(bPlaying){
116 bPlaying = FALSE;
117 pthread_join(decodeThread, NULL);
118 memset(&decodeThread, 0, sizeof(pthread_t));
119 mp4_ip.output->close_audio();
120 }
121 }
122
123 static int mp4_isFile(char *filename)
124 {
125 if(filename){
126 gchar* extention;
127
128 extention = strrchr(filename, '.');
129 if(extention &&
130 (!strncasecmp(extention, ".mp4", 4) || // official extention
131 !strncasecmp(extention, ".m4a", 4) || // Apple mp4 extention
132 !strncasecmp(extention, ".aac", 4) // old MPEG2/4-AAC extention
133 )){
134 return (1);
135 }
136 }
137 return(0);
138 }
139
140 static void mp4_about(void)
141 {
142 static GtkWidget *aboutbox;
143
144 if(aboutbox!=NULL)
145 return;
146 aboutbox = xmms_show_message("About MP4 AAC player plugin",
147 "libfaad2-" FAAD2_VERSION "\n"
148 "plugin version: " MP4_VERSION "\n"
149 MP4_ABOUT,
150 "Ok", FALSE, NULL, NULL);
151 gtk_signal_connect(GTK_OBJECT(aboutbox), "destroy",
152 GTK_SIGNAL_FUNC(gtk_widget_destroyed),
153 &aboutbox);
154 }
155
156 static void mp4_pause(short flag)
157 {
158 mp4_ip.output->pause(flag);
159 }
160
161 static void mp4_seek(int time)
162 {
163 seekPosition = time;
164 while(bPlaying && seekPosition!=-1)
165 xmms_usleep(10000);
166 }
167
168 static int mp4_getTime(void)
169 {
170 if(!bPlaying)
171 return (-1);
172 else
173 return (mp4_ip.output->output_time());
174 }
175
176 static void mp4_cleanup(void)
177 {
178 }
179
180 void mp4_get_file_type(FILE *mp4file)
181 {
182 unsigned char header[10] = {0};
183
184 fseek(mp4file, 0, SEEK_SET);
185 fread(header, 1, 8, mp4file);
186 if(header[4]=='f' &&
187 header[5]=='t' &&
188 header[6]=='y' &&
189 header[7]=='p'){
190 mp4cfg.file_type = FILE_MP4;
191 }else{
192 mp4cfg.file_type = FILE_AAC;
193 }
194 }
195
196 static void mp4_getSongTitle(char *filename, char **title, int *len) {
197 FILE* mp4file;
198
199 (*title) = NULL;
200 (*len) = -1;
201
202 if((mp4file = fopen(filename, "rb"))){
203 mp4_get_file_type(mp4file);
204 fseek(mp4file, 0, SEEK_SET);
205 if(mp4cfg.file_type == FILE_MP4){
206 mp4ff_callback_t* mp4cb;
207 mp4ff_t* infile;
208 gint mp4track;
209
210 mp4cb = getMP4FF_cb(mp4file);
211 if ((infile = mp4ff_open_read_metaonly(mp4cb)) &&
212 ((mp4track = getAACTrack(infile)) >= 0)){
213 (*title) = getMP4title(infile, filename);
214
215 double track_duration = mp4ff_get_track_duration(infile, mp4track);
216 unsigned long time_scale = mp4ff_time_scale(infile, mp4track);
217 unsigned long length = (track_duration * 1000 / time_scale);
218 (*len) = length;
219 }
220 if(infile) mp4ff_close(infile);
221 if(mp4cb) g_free(mp4cb);
222 }
223 else{
224 // Check AAC ID3 tag...
225 }
226 fclose(mp4file);
227 }
228 }
229
230 static void mp4_getSongInfo(char *filename)
231 {
232 FILE* mp4file;
233 if((mp4file = fopen(filename, "rb"))){
234 if (mp4cfg.file_type == FILE_UNKNOW)
235 mp4_get_file_type(mp4file);
236 fseek(mp4file, 0, SEEK_SET);
237 if(mp4cfg.file_type == FILE_MP4)
238 getMP4info(filename, mp4file);
239 else if(mp4cfg.file_type == FILE_AAC)
240 /*
241 * check the id3tagv2
242 */
243 ;
244 fclose(mp4file);
245 }
246 }
247
248 static void *mp4Decode(void *args)
249 {
250 FILE* mp4file;
251
252 pthread_mutex_lock(&mutex);
253 seekPosition = -1;
254 bPlaying = TRUE;
255
256 if(!(mp4file = fopen(args, "rb"))){
257 g_print("MP4!AAC - Can't open file\n");
258 g_free(args);
259 bPlaying = FALSE;
260 pthread_mutex_unlock(&mutex);
261 pthread_exit(NULL);
262
263 }
264 mp4_get_file_type(mp4file);
265 fseek(mp4file, 0, SEEK_SET);
266 if(mp4cfg.file_type == FILE_MP4){// We are reading a MP4 file
267 mp4ff_callback_t* mp4cb;
268 mp4ff_t* infile;
269 gint mp4track;
270
271 mp4cb = getMP4FF_cb(mp4file);
272 if(!(infile = mp4ff_open_read(mp4cb))){
273 g_print("MP4 - Can't open file\n");
274 goto end;
275 }
276
277 if((mp4track = getAACTrack(infile)) < 0){
278 /*
279 * TODO: check here for others Audio format.....
280 *
281 */
282 g_print("Unsupported Audio track type\n");
283 g_free(args);
284 fclose(mp4file);
285 bPlaying = FALSE;
286 pthread_mutex_unlock(&mutex);
287 pthread_exit(NULL);
288 }else{
289 NeAACDecHandle decoder;
290 unsigned char *buffer = NULL;
291 guint bufferSize = 0;
292 gulong samplerate;
293 guchar channels;
294 //guint avgBitrate;
295 //MP4Duration duration;
296 int msDuration;
297 int numSamples;
298 int sampleID = 0;
299 unsigned int framesize;
300 mp4AudioSpecificConfig mp4ASC;
301 gchar *xmmstitle;
302
303 decoder = NeAACDecOpen();
304 mp4ff_get_decoder_config(infile, mp4track, &buffer, &bufferSize);
305 if(NeAACDecInit2(decoder, buffer, bufferSize, &samplerate, &channels)<0){
306 goto end;
307 }
308 if(buffer){
309 framesize = 1024;
310 if(NeAACDecAudioSpecificConfig(buffer, bufferSize, &mp4ASC) >= 0){
311 if(mp4ASC.frameLengthFlag == 1) framesize = 960;
312 if(mp4ASC.sbr_present_flag == 1) framesize *= 2;
313 }
314 g_free(buffer);
315 }
316 if(channels == 0){
317 g_print("Number of Channels not supported\n");
318 goto end;
319 }
320
321 //duration = MP4GetTrackDuration(mp4file, mp4track);
322 //msDuration = MP4ConvertFromTrackDuration(mp4file, mp4track,
323 // duration,MP4_MSECS_TIME_SCALE);
324
325 //msDuration = mp4ff_get_track_duration(infile, mp4track);
326 //printf("%d\n", msDuration);
327
328 //numSamples = MP4GetTrackNumberOfSamples(mp4file, mp4track);
329 numSamples = mp4ff_num_samples(infile, mp4track);
330 {
331 float f = 1024.0;
332 if(mp4ASC.sbr_present_flag == 1)
333 f = f * 2.0;
334 msDuration = ((float)numSamples*(float)(f-1.0)/
335 (float)samplerate)*1000;
336 }
337 xmmstitle = getMP4title(infile, args);
338 mp4_ip.output->open_audio(FMT_S16_NE, samplerate, channels);
339 mp4_ip.output->flush(0);
340 mp4_ip.set_info(xmmstitle, msDuration, -1, samplerate/1000, channels);
341 g_print("MP4 - %d channels @ %ld Hz\n", channels, samplerate);
342
343 while(bPlaying){
344 void* sampleBuffer;
345 faacDecFrameInfo frameInfo;
346 gint rc;
347
348 if(seekPosition!=-1){
349 /*
350 duration = MP4ConvertToTrackDuration(mp4file,
351 mp4track,
352 seekPosition*1000,
353 MP4_MSECS_TIME_SCALE);
354 sampleID = MP4GetSampleIdFromTime(mp4file, mp4track, duration, 0);
355 */
356 float f = 1024.0;
357 if(mp4ASC.sbr_present_flag == 1)
358 f = f * 2.0;
359 sampleID = (float)seekPosition*(float)samplerate/(float)(f-1.0);
360 mp4_ip.output->flush(seekPosition*1000);
361 seekPosition = -1;
362 }
363 buffer=NULL;
364 bufferSize=0;
365 rc = mp4ff_read_sample(infile, mp4track, sampleID++,
366 &buffer, &bufferSize);
367 //g_print("%d/%d\n", sampleID-1, numSamples);
368 if((rc==0) || (buffer== NULL)){
369 g_print("MP4: read error\n");
370 sampleBuffer = NULL;
371 sampleID=0;
372 mp4_ip.output->buffer_free();
373 goto end;
374 }else{
375 sampleBuffer = NeAACDecDecode(decoder, &frameInfo, buffer, bufferSize);
376 if(frameInfo.error > 0){
377 g_print("MP4: %s\n",
378 faacDecGetErrorMessage(frameInfo.error));
379 goto end;
380 }
381 if(buffer){
382 g_free(buffer); buffer=NULL; bufferSize=0;
383 }
384 while(bPlaying && mp4_ip.output->buffer_free()<frameInfo.samples<<1)
385 xmms_usleep(30000);
386 }
387 mp4_ip.add_vis_pcm(mp4_ip.output->written_time(),
388 FMT_S16_NE,
389 channels,
390 frameInfo.samples<<1,
391 sampleBuffer);
392 mp4_ip.output->write_audio(sampleBuffer, frameInfo.samples<<1);
393 if(sampleID >= numSamples){
394 break;
395 }
396 }
397 while(bPlaying && mp4_ip.output->buffer_playing() && mp4_ip.output->buffer_free()){
398 xmms_usleep(10000);
399 }
400 end:
401 mp4_ip.output->close_audio();
402 g_free(args);
403 NeAACDecClose(decoder);
404 if(infile) mp4ff_close(infile);
405 if(mp4cb) g_free(mp4cb);
406 bPlaying = FALSE;
407 fclose(mp4file);
408 pthread_mutex_unlock(&mutex);
409 pthread_exit(NULL);
410 }
411 }else{
412 // WE ARE READING AN AAC FILE
413 FILE *file = NULL;
414 NeAACDecHandle decoder = 0;
415 guchar *buffer = 0;
416 gulong bufferconsumed = 0;
417 gulong samplerate = 0;
418 guchar channels;
419 gulong buffervalid = 0;
420 TitleInput* input;
421 gchar *temp = g_strdup(args);
422 gchar *ext = strrchr(temp, '.');
423 gchar *xmmstitle = NULL;
424 NeAACDecConfigurationPtr config;
425
426 if((file = fopen(args, "rb")) == 0){
427 g_print("AAC: can't find file %s\n", args);
428 bPlaying = FALSE;
429 pthread_mutex_unlock(&mutex);
430 pthread_exit(NULL);
431 }
432 if((decoder = NeAACDecOpen()) == NULL){
433 g_print("AAC: Open Decoder Error\n");
434 fclose(file);
435 bPlaying = FALSE;
436 pthread_mutex_unlock(&mutex);
437 pthread_exit(NULL);
438 }
439 config = NeAACDecGetCurrentConfiguration(decoder);
440 config->useOldADTSFormat = 0;
441 NeAACDecSetConfiguration(decoder, config);
442 if((buffer = g_malloc(BUFFER_SIZE)) == NULL){
443 g_print("AAC: error g_malloc\n");
444 fclose(file);
445 bPlaying = FALSE;
446 NeAACDecClose(decoder);
447 pthread_mutex_unlock(&mutex);
448 pthread_exit(NULL);
449 }
450 if((buffervalid = fread(buffer, 1, BUFFER_SIZE, file))==0){
451 g_print("AAC: Error reading file\n");
452 g_free(buffer);
453 fclose(file);
454 bPlaying = FALSE;
455 NeAACDecClose(decoder);
456 pthread_mutex_unlock(&mutex);
457 pthread_exit(NULL);
458 }
459 XMMS_NEW_TITLEINPUT(input);
460 input->file_name = g_basename(temp);
461 input->file_ext = ext ? ext+1 : NULL;
462 input->file_path = temp;
463 if(!strncmp(buffer, "ID3", 3)){
464 gint size = 0;
465
466 fseek(file, 0, SEEK_SET);
467 size = (buffer[6]<<21) | (buffer[7]<<14) | (buffer[8]<<7) | buffer[9];
468 size+=10;
469 fread(buffer, 1, size, file);
470 buffervalid = fread(buffer, 1, BUFFER_SIZE, file);
471 }
472 xmmstitle = xmms_get_titlestring(xmms_get_gentitle_format(), input);
473 if(xmmstitle == NULL)
474 xmmstitle = g_strdup(input->file_name);
475 if(temp) g_free(temp);
476 if(input->performer) g_free(input->performer);
477 if(input->album_name) g_free(input->album_name);
478 if(input->track_name) g_free(input->track_name);
479 if(input->genre) g_free(input->genre);
480 g_free(input);
481 bufferconsumed = NeAACDecInit(decoder,
482 buffer,
483 buffervalid,
484 &samplerate,
485 &channels);
486 if(mp4_ip.output->open_audio(FMT_S16_NE,samplerate,channels) == FALSE){
487 g_print("AAC: Output Error\n");
488 g_free(buffer); buffer=0;
489 faacDecClose(decoder);
490 fclose(file);
491 mp4_ip.output->close_audio();
492 /*
493 if(positionTable){
494 g_free(positionTable); positionTable=0;
495 }
496 */
497 g_free(xmmstitle);
498 bPlaying = FALSE;
499 pthread_mutex_unlock(&mutex);
500 pthread_exit(NULL);
501 }
502 //if(bSeek){
503 //mp4_ip.set_info(xmmstitle, lenght*1000, -1, samplerate, channels);
504 //}else{
505 mp4_ip.set_info(xmmstitle, -1, -1, samplerate, channels);
506 //}
507 mp4_ip.output->flush(0);
508
509 while(bPlaying && buffervalid > 0){
510 NeAACDecFrameInfo finfo;
511 unsigned long samplesdecoded;
512 char* sample_buffer = NULL;
513 /*
514 if(bSeek && seekPosition!=-1){
515 fseek(file, positionTable[seekPosition], SEEK_SET);
516 bufferconsumed=0;
517 buffervalid = fread(buffer, 1, BUFFER_SIZE, file);
518 aac_ip.output->flush(seekPosition*1000);
519 seekPosition=-1;
520 }
521 */
522 if(bufferconsumed > 0){
523 memmove(buffer, &buffer[bufferconsumed], buffervalid-bufferconsumed);
524 buffervalid -= bufferconsumed;
525 buffervalid += fread(&buffer[buffervalid], 1,
526 BUFFER_SIZE-buffervalid, file);
527 bufferconsumed = 0;
528 }
529 sample_buffer = NeAACDecDecode(decoder, &finfo, buffer, buffervalid);
530 if(finfo.error){
531 config = NeAACDecGetCurrentConfiguration(decoder);
532 if(config->useOldADTSFormat != 1){
533 NeAACDecClose(decoder);
534 decoder = NeAACDecOpen();
535 config = NeAACDecGetCurrentConfiguration(decoder);
536 config->useOldADTSFormat = 1;
537 NeAACDecSetConfiguration(decoder, config);
538 finfo.bytesconsumed=0;
539 finfo.samples = 0;
540 NeAACDecInit(decoder,
541 buffer,
542 buffervalid,
543 &samplerate,
544 &channels);
545 }else{
546 g_print("FAAD2 Warning %s\n", NeAACDecGetErrorMessage(finfo.error));
547 buffervalid = 0;
548 }
549 }
550 bufferconsumed += finfo.bytesconsumed;
551 samplesdecoded = finfo.samples;
552 if((samplesdecoded<=0) && !sample_buffer){
553 g_print("AAC: error sample decoding\n");
554 continue;
555 }
556 while(bPlaying && mp4_ip.output->buffer_free() < (samplesdecoded<<1)){
557 xmms_usleep(10000);
558 }
559 mp4_ip.add_vis_pcm(mp4_ip.output->written_time(),
560 FMT_S16_LE, channels,
561 samplesdecoded<<1, sample_buffer);
562 mp4_ip.output->write_audio(sample_buffer, samplesdecoded<<1);
563 }
564 while(bPlaying && mp4_ip.output->buffer_playing()){
565 xmms_usleep(10000);
566 }
567 mp4_ip.output->buffer_free();
568 mp4_ip.output->close_audio();
569 bPlaying = FALSE;
570 g_free(buffer);
571 NeAACDecClose(decoder);
572 g_free(xmmstitle);
573 fclose(file);
574 seekPosition = -1;
575 /*
576 if(positionTable){
577 g_free(positionTable); positionTable=0;
578 }
579 */
580 bPlaying = FALSE;
581 pthread_mutex_unlock(&mutex);
582 pthread_exit(NULL);
583
584 }
585 }
0 /*
1 * some functions for MP4 files
2 */
3
4 #include "mp4ff.h"
5 #include "faad.h"
6
7 #include <gtk/gtk.h>
8 #include <stdio.h>
9 #include <string.h>
10 #include <stdlib.h>
11 #include <xmms/plugin.h>
12 #include <xmms/titlestring.h>
13 #include <xmms/util.h>
14
15 const char *mp4AudioNames[]=
16 {
17 "MPEG-1 Audio Layers 1,2 or 3",
18 "MPEG-2 low biterate (MPEG-1 extension) - MP3",
19 "MPEG-2 AAC Main Profile",
20 "MPEG-2 AAC Low Complexity profile",
21 "MPEG-2 AAC SSR profile",
22 "MPEG-4 audio (MPEG-4 AAC)",
23 0
24 };
25
26 /* MPEG-4 Audio types from 14496-3 Table 1.5.1 (from mp4.h)*/
27 const char *mpeg4AudioNames[]=
28 {
29 "!!!!MPEG-4 Audio track Invalid !!!!!!!",
30 "MPEG-4 AAC Main profile",
31 "MPEG-4 AAC Low Complexity profile",
32 "MPEG-4 AAC SSR profile",
33 "MPEG-4 AAC Long Term Prediction profile",
34 "MPEG-4 AAC Scalable",
35 "MPEG-4 CELP",
36 "MPEG-4 HVXC",
37 "MPEG-4 Text To Speech",
38 "MPEG-4 Main Synthetic profile",
39 "MPEG-4 Wavetable Synthesis profile",
40 "MPEG-4 MIDI Profile",
41 "MPEG-4 Algorithmic Synthesis and Audio FX profile"
42 };
43
44 static GtkWidget *mp4_info_dialog = NULL;
45
46 /*
47 * find AAC track
48 */
49
50 int getAACTrack(mp4ff_t *infile)
51 {
52 int i, rc;
53 int numTracks = mp4ff_total_tracks(infile);
54
55 printf("total-tracks: %d\n", numTracks);
56 for(i=0; i<numTracks; i++){
57 unsigned char* buff = 0;
58 int buff_size = 0;
59 mp4AudioSpecificConfig mp4ASC;
60
61 printf("testing-track: %d\n", i);
62 mp4ff_get_decoder_config(infile, i, &buff, &buff_size);
63 if(buff){
64 rc = NeAACDecAudioSpecificConfig(buff, buff_size, &mp4ASC);
65 g_free(buff);
66 if(rc < 0)
67 continue;
68 return(i);
69 }
70 }
71 return(-1);
72 }
73
74 uint32_t read_callback(void *user_data, void *buffer, uint32_t length)
75 {
76 return fread(buffer, 1, length, (FILE*)user_data);
77 }
78
79 uint32_t seek_callback(void *user_data, uint64_t position)
80 {
81 return fseek((FILE*)user_data, position, SEEK_SET);
82 }
83
84 mp4ff_callback_t *getMP4FF_cb(FILE *mp4file)
85 {
86 mp4ff_callback_t* mp4cb = malloc(sizeof(mp4ff_callback_t));
87 mp4cb->read = read_callback;
88 mp4cb->seek = seek_callback;
89 mp4cb->user_data = mp4file;
90 return mp4cb;
91 }
92
93 /*
94 * Function to display an info box for an mp4 file.
95 * This code is based heavily on fileinfo.c from the xmms mpg123
96 * plugin, and the info box layout mimics that plugin.
97 */
98 void create_mp4_info_dialog (char *filename, FILE *mp4file, mp4ff_t *infile, gint mp4track)
99 {
100 char *window_title, *value, *value2;
101 static GtkWidget *filename_entry, *title_entry, *artist_entry, *album_entry;
102 static GtkWidget *genre_entry, *year_entry, *track_entry, *comment_entry;
103 static GtkWidget *mp4_info_label;
104
105 if (!mp4_info_dialog)
106 {
107 GtkWidget *dialog_vbox1, *vbox1, *hbox2, *hbox3, *hbox4;
108 GtkWidget *frame2, *frame3, *table1, *dialog_action_area1;
109 GtkWidget *filename_label, *title_label, *artist_label, *album_label;
110 GtkWidget *genre_label, *year_label, *track_label, *comment_label;
111 GtkWidget *close_button;
112
113 mp4_info_dialog = gtk_dialog_new ();
114 gtk_object_set_data (GTK_OBJECT (mp4_info_dialog), "mp4_info_dialog", mp4_info_dialog);
115 gtk_window_set_policy (GTK_WINDOW (mp4_info_dialog), TRUE, TRUE, FALSE);
116 gtk_signal_connect(GTK_OBJECT (mp4_info_dialog), "destroy",
117 gtk_widget_destroyed, &mp4_info_dialog);
118
119 dialog_vbox1 = GTK_DIALOG (mp4_info_dialog)->vbox;
120 gtk_object_set_data (GTK_OBJECT (mp4_info_dialog), "dialog_vbox1", dialog_vbox1);
121 gtk_container_set_border_width (GTK_CONTAINER (dialog_vbox1), 3);
122
123 hbox2 = gtk_hbox_new (FALSE, 0);
124 gtk_widget_ref (hbox2);
125 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "hbox2", hbox2,
126 (GtkDestroyNotify) gtk_widget_unref);
127 gtk_box_pack_start (GTK_BOX (dialog_vbox1), hbox2, FALSE, TRUE, 0);
128 gtk_container_set_border_width (GTK_CONTAINER (hbox2), 3);
129
130 filename_label = gtk_label_new ("Filename: ");
131 gtk_widget_ref (filename_label);
132 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "filename_label", filename_label,
133 (GtkDestroyNotify) gtk_widget_unref);
134 gtk_box_pack_start (GTK_BOX (hbox2), filename_label, FALSE, FALSE, 0);
135
136 filename_entry = gtk_entry_new ();
137 gtk_widget_ref (filename_entry);
138 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "filename_entry", filename_entry,
139 (GtkDestroyNotify) gtk_widget_unref);
140 gtk_box_pack_start (GTK_BOX (hbox2), filename_entry, TRUE, TRUE, 0);
141 gtk_entry_set_editable (GTK_ENTRY (filename_entry), FALSE);
142
143 hbox3 = gtk_hbox_new (FALSE, 0);
144 gtk_widget_ref (hbox3);
145 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "hbox3", hbox3,
146 (GtkDestroyNotify) gtk_widget_unref);
147 gtk_box_pack_start (GTK_BOX (dialog_vbox1), hbox3, TRUE, TRUE, 0);
148 gtk_container_set_border_width (GTK_CONTAINER (hbox3), 3);
149
150 frame2 = gtk_frame_new ("Tag Info: ");
151 gtk_widget_ref (frame2);
152 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "frame2", frame2,
153 (GtkDestroyNotify) gtk_widget_unref);
154 gtk_box_pack_start (GTK_BOX (hbox3), frame2, TRUE, TRUE, 0);
155
156 table1 = gtk_table_new (6, 2, FALSE);
157 gtk_widget_ref (table1);
158 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "table1", table1,
159 (GtkDestroyNotify) gtk_widget_unref);
160 gtk_container_add (GTK_CONTAINER (frame2), table1);
161 gtk_container_set_border_width (GTK_CONTAINER (table1), 5);
162
163 comment_label = gtk_label_new ("Comment: ");
164 gtk_widget_ref (comment_label);
165 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "comment_label", comment_label,
166 (GtkDestroyNotify) gtk_widget_unref);
167 gtk_table_attach (GTK_TABLE (table1), comment_label, 0, 1, 5, 6,
168 (GtkAttachOptions) (GTK_FILL),
169 (GtkAttachOptions) (GTK_EXPAND), 0, 0);
170 gtk_misc_set_alignment (GTK_MISC (comment_label), 1, 0.5);
171
172 genre_label = gtk_label_new ("Genre: ");
173 gtk_widget_ref (genre_label);
174 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "genre_label", genre_label,
175 (GtkDestroyNotify) gtk_widget_unref);
176 gtk_table_attach (GTK_TABLE (table1), genre_label, 0, 1, 4, 5,
177 (GtkAttachOptions) (GTK_FILL),
178 (GtkAttachOptions) (GTK_EXPAND), 0, 0);
179 gtk_misc_set_alignment (GTK_MISC (genre_label), 1, 0.5);
180
181 album_label = gtk_label_new ("Album: ");
182 gtk_widget_ref (album_label);
183 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "album_label", album_label,
184 (GtkDestroyNotify) gtk_widget_unref);
185 gtk_table_attach (GTK_TABLE (table1), album_label, 0, 1, 2, 3,
186 (GtkAttachOptions) (GTK_FILL),
187 (GtkAttachOptions) (GTK_EXPAND), 0, 0);
188 gtk_misc_set_alignment (GTK_MISC (album_label), 1, 0.5);
189
190 title_label = gtk_label_new ("Title: ");
191 gtk_widget_ref (title_label);
192 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "title_label", title_label,
193 (GtkDestroyNotify) gtk_widget_unref);
194 gtk_table_attach (GTK_TABLE (table1), title_label, 0, 1, 0, 1,
195 (GtkAttachOptions) (GTK_FILL),
196 (GtkAttachOptions) (GTK_EXPAND), 0, 0);
197 gtk_misc_set_alignment (GTK_MISC (title_label), 1, 0.5);
198
199 artist_label = gtk_label_new ("Artist: ");
200 gtk_widget_ref (artist_label);
201 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "artist_label", artist_label,
202 (GtkDestroyNotify) gtk_widget_unref);
203 gtk_table_attach (GTK_TABLE (table1), artist_label, 0, 1, 1, 2,
204 (GtkAttachOptions) (GTK_FILL),
205 (GtkAttachOptions) (GTK_EXPAND), 0, 0);
206 gtk_misc_set_alignment (GTK_MISC (artist_label), 1, 0.5);
207
208 year_label = gtk_label_new ("Year: ");
209 gtk_widget_ref (year_label);
210 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "year_label", year_label,
211 (GtkDestroyNotify) gtk_widget_unref);
212 gtk_table_attach (GTK_TABLE (table1), year_label, 0, 1, 3, 4,
213 (GtkAttachOptions) (GTK_FILL),
214 (GtkAttachOptions) (GTK_EXPAND), 0, 0);
215 gtk_misc_set_alignment (GTK_MISC (year_label), 1, 0.5);
216
217 hbox4 = gtk_hbox_new (FALSE, 0);
218 gtk_widget_ref (hbox4);
219 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "hbox4", hbox4,
220 (GtkDestroyNotify) gtk_widget_unref);
221 gtk_table_attach (GTK_TABLE (table1), hbox4, 1, 2, 3, 4,
222 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
223 (GtkAttachOptions) (GTK_FILL), 0, 0);
224
225 year_entry = gtk_entry_new ();
226 gtk_widget_ref (year_entry);
227 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "year_entry", year_entry,
228 (GtkDestroyNotify) gtk_widget_unref);
229 gtk_box_pack_start (GTK_BOX (hbox4), year_entry, FALSE, FALSE, 0);
230 gtk_widget_set_usize (year_entry, 60, -2);
231 gtk_entry_set_editable (GTK_ENTRY (year_entry), FALSE);
232
233 track_label = gtk_label_new (" Track: ");
234 gtk_widget_ref (track_label);
235 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "track_label", track_label,
236 (GtkDestroyNotify) gtk_widget_unref);
237 gtk_box_pack_start (GTK_BOX (hbox4), track_label, FALSE, FALSE, 0);
238 gtk_misc_set_alignment (GTK_MISC (track_label), 1, 0.5);
239
240 track_entry = gtk_entry_new ();
241 gtk_widget_ref (track_entry);
242 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "track_entry", track_entry,
243 (GtkDestroyNotify) gtk_widget_unref);
244 gtk_box_pack_start (GTK_BOX (hbox4), track_entry, FALSE, FALSE, 0);
245 gtk_widget_set_usize (track_entry, 60, -2);
246 gtk_entry_set_editable (GTK_ENTRY (track_entry), FALSE);
247
248 title_entry = gtk_entry_new ();
249 gtk_widget_ref (title_entry);
250 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "title_entry", title_entry,
251 (GtkDestroyNotify) gtk_widget_unref);
252 gtk_table_attach (GTK_TABLE (table1), title_entry, 1, 2, 0, 1,
253 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
254 (GtkAttachOptions) (0), 0, 0);
255 gtk_entry_set_editable (GTK_ENTRY (title_entry), FALSE);
256
257 artist_entry = gtk_entry_new ();
258 gtk_widget_ref (artist_entry);
259 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "artist_entry", artist_entry,
260 (GtkDestroyNotify) gtk_widget_unref);
261 gtk_table_attach (GTK_TABLE (table1), artist_entry, 1, 2, 1, 2,
262 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
263 (GtkAttachOptions) (0), 0, 0);
264 gtk_entry_set_editable (GTK_ENTRY (artist_entry), FALSE);
265
266 album_entry = gtk_entry_new ();
267 gtk_widget_ref (album_entry);
268 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "album_entry", album_entry,
269 (GtkDestroyNotify) gtk_widget_unref);
270 gtk_table_attach (GTK_TABLE (table1), album_entry, 1, 2, 2, 3,
271 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
272 (GtkAttachOptions) (0), 0, 0);
273 gtk_entry_set_editable (GTK_ENTRY (album_entry), FALSE);
274
275 genre_entry = gtk_entry_new ();
276 gtk_widget_ref (genre_entry);
277 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "genre_entry", genre_entry,
278 (GtkDestroyNotify) gtk_widget_unref);
279 gtk_table_attach (GTK_TABLE (table1), genre_entry, 1, 2, 4, 5,
280 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
281 (GtkAttachOptions) (0), 0, 0);
282 gtk_entry_set_editable (GTK_ENTRY (genre_entry), FALSE);
283
284 comment_entry = gtk_entry_new ();
285 gtk_widget_ref (comment_entry);
286 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "comment_entry", comment_entry,
287 (GtkDestroyNotify) gtk_widget_unref);
288 gtk_table_attach (GTK_TABLE (table1), comment_entry, 1, 2, 5, 6,
289 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
290 (GtkAttachOptions) (0), 0, 0);
291 gtk_entry_set_editable (GTK_ENTRY (comment_entry), FALSE);
292
293 frame3 = gtk_frame_new ("MP4 Info: ");
294 gtk_widget_ref (frame3);
295 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "frame3", frame3,
296 (GtkDestroyNotify) gtk_widget_unref);
297 gtk_box_pack_start (GTK_BOX (hbox3), frame3, FALSE, TRUE, 0);
298
299 vbox1 = gtk_vbox_new (FALSE, 0);
300 gtk_widget_ref (vbox1);
301 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "vbox1", vbox1,
302 (GtkDestroyNotify) gtk_widget_unref);
303 gtk_container_add (GTK_CONTAINER (frame3), vbox1);
304 gtk_container_set_border_width (GTK_CONTAINER (vbox1), 5);
305
306 mp4_info_label = gtk_label_new ("");
307 gtk_widget_ref (mp4_info_label);
308 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "mp4_info_label", mp4_info_label,
309 (GtkDestroyNotify) gtk_widget_unref);
310 gtk_box_pack_start (GTK_BOX (vbox1), mp4_info_label, TRUE, TRUE, 0);
311 gtk_label_set_justify (GTK_LABEL (mp4_info_label), GTK_JUSTIFY_LEFT);
312 gtk_misc_set_alignment (GTK_MISC (mp4_info_label), 0, 0);
313
314 dialog_action_area1 = GTK_DIALOG (mp4_info_dialog)->action_area;
315 gtk_object_set_data (GTK_OBJECT (mp4_info_dialog), "dialog_action_area1", dialog_action_area1);
316 gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area1), 4);
317
318 close_button = gtk_button_new_with_label ("Close");
319 gtk_widget_ref (close_button);
320 gtk_object_set_data_full (GTK_OBJECT (mp4_info_dialog), "close_button", close_button,
321 (GtkDestroyNotify) gtk_widget_unref);
322 gtk_box_pack_start (GTK_BOX (dialog_action_area1), close_button, FALSE, FALSE, 0);
323
324 gtk_signal_connect_object (GTK_OBJECT (close_button), "clicked",
325 GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (mp4_info_dialog));
326
327 }
328
329 window_title = g_strdup_printf("File Info - %s", g_basename(filename));
330 gtk_window_set_title (GTK_WINDOW (mp4_info_dialog), window_title);
331 g_free(window_title);
332
333 gtk_entry_set_text (GTK_ENTRY (filename_entry), filename);
334
335 gtk_entry_set_text (GTK_ENTRY (title_entry), "");
336 gtk_entry_set_text (GTK_ENTRY (artist_entry), "");
337 gtk_entry_set_text (GTK_ENTRY (album_entry), "");
338 gtk_entry_set_text (GTK_ENTRY (year_entry), "");
339 gtk_entry_set_text (GTK_ENTRY (track_entry), "");
340 gtk_entry_set_text (GTK_ENTRY (genre_entry), "");
341 gtk_entry_set_text (GTK_ENTRY (comment_entry), "");
342
343 if ((mp4ff_meta_get_title(infile, &value)) && value != NULL) {
344 gtk_entry_set_text (GTK_ENTRY(title_entry), value);
345 g_free(value);
346 }
347 if ((mp4ff_meta_get_artist(infile, &value)) && value != NULL) {
348 gtk_entry_set_text (GTK_ENTRY(artist_entry), value);
349 g_free(value);
350 }
351 if ((mp4ff_meta_get_album(infile, &value)) && value != NULL) {
352 gtk_entry_set_text (GTK_ENTRY(album_entry), value);
353 g_free(value);
354 }
355 if ((mp4ff_meta_get_date(infile, &value)) && value != NULL) {
356 gtk_entry_set_text (GTK_ENTRY(year_entry), value);
357 g_free(value);
358 }
359 if ((mp4ff_meta_get_track(infile, &value)) && value != NULL) {
360 if ((mp4ff_meta_get_totaltracks(infile, &value2)) && value2 != NULL) {
361 char *tmp = g_strdup_printf("%s of %s", value, value2);
362 g_free(value2);
363 g_free(value);
364 value = tmp;
365 }
366 gtk_entry_set_text (GTK_ENTRY(track_entry), value);
367 g_free(value);
368 }
369 if ((mp4ff_meta_get_genre(infile, &value)) && value != NULL) {
370 gtk_entry_set_text (GTK_ENTRY(genre_entry), value);
371 g_free(value);
372 }
373 if ((mp4ff_meta_get_comment(infile, &value)) && value != NULL) {
374 gtk_entry_set_text (GTK_ENTRY(comment_entry), value);
375 g_free(value);
376 }
377
378 // Get the length of the track.
379 double track_duration = mp4ff_get_track_duration(infile, mp4track);
380 unsigned long time_scale = mp4ff_time_scale(infile, mp4track);
381 unsigned long length = (track_duration / time_scale);
382 int min = length / 60;
383 int sec = length % 60;
384
385 // Get other info about the track.
386 unsigned long bitrate = mp4ff_get_avg_bitrate(infile, mp4track) / 1000;
387 unsigned long samplerate = mp4ff_get_sample_rate(infile, mp4track);
388 unsigned long channels = mp4ff_get_channel_count(infile, mp4track);
389 unsigned long audio_type = mp4ff_get_audio_type(infile, mp4track);
390 fseek(mp4file, 0, SEEK_END);
391 int filesize = ftell(mp4file) / 1024;
392
393 value = g_strdup_printf("Length: %d:%d\nAvg. Bitrate: %ld kbps\nSample Rate: %ld Hz\nChannels: %ld\nAudio Type: %ld\nFile Size: %d KB", min, sec, bitrate, samplerate, channels, audio_type, filesize);
394 gtk_label_set_text (GTK_LABEL(mp4_info_label), value);
395 g_free(value);
396
397 gtk_widget_show_all(mp4_info_dialog);
398 }
399
400
401 void getMP4info(char* filename, FILE* mp4file)
402 {
403 mp4ff_callback_t* mp4cb;
404 mp4ff_t* infile;
405 gint mp4track;
406
407 mp4cb = getMP4FF_cb(mp4file);
408 if ((infile = mp4ff_open_read_metaonly(mp4cb)) &&
409 ((mp4track = getAACTrack(infile)) >= 0)){
410 create_mp4_info_dialog (filename, mp4file, infile, mp4track);
411 }
412 if(infile) mp4ff_close(infile);
413 if(mp4cb) g_free(mp4cb);
414 }
415
416 /* Get the xmms titlestring for the file based on metadata.
417 The following code was adapted from the gtkpod project, specifically
418 mp4file.c (C) Jorg Schuler, but written to use the mp4ff library. The
419 mpg123 input plugin for xmms was used as a guide for this function.
420 --Jason Arroyo, 2004 */
421 char *getMP4title(mp4ff_t *infile, char *filename) {
422 char *ret=NULL;
423 gchar *value, *path, *temp;
424
425 TitleInput *input;
426 XMMS_NEW_TITLEINPUT(input);
427
428 // Fill in the TitleInput with the relevant data
429 // from the mp4 file that can be used to display the title.
430 mp4ff_meta_get_title(infile, &input->track_name);
431 mp4ff_meta_get_artist(infile, &input->performer);
432 mp4ff_meta_get_album(infile, &input->album_name);
433 if (mp4ff_meta_get_track(infile, &value) && value != NULL) {
434 input->track_number = atoi(value);
435 g_free(value);
436 }
437 if (mp4ff_meta_get_date(infile, &value) && value != NULL) {
438 input->year = atoi(value);
439 g_free(value);
440 }
441 mp4ff_meta_get_genre(infile, &input->genre);
442 mp4ff_meta_get_comment(infile, &input->comment);
443 input->file_name = g_strdup(g_basename(filename));
444 path = g_strdup(filename);
445 temp = strrchr(path, '.');
446 if (temp != NULL) {++temp;}
447 input->file_ext = g_strdup_printf("%s", temp);
448 temp = strrchr(path, '/');
449 if (temp) {*temp = '\0';}
450 input->file_path = g_strdup_printf("%s/", path);
451
452 // Use the default xmms title format to format the
453 // title from the above info.
454 ret = xmms_get_titlestring(xmms_get_gentitle_format(), input);
455
456 g_free(input->track_name);
457 g_free(input->performer);
458 g_free(input->album_name);
459 g_free(input->genre);
460 g_free(input->comment);
461 g_free(input->file_name);
462 g_free(input->file_ext);
463 g_free(input->file_path);
464 g_free(input);
465 g_free(path);
466
467 return ret;
468 }