aboutsummaryrefslogtreecommitdiff
path: root/Src/external_dependencies/openmpt-trunk/include/mpg123
diff options
context:
space:
mode:
authorJean-Francois Mauguit <jfmauguit@mac.com>2024-09-24 09:03:25 -0400
committerGitHub <noreply@github.com>2024-09-24 09:03:25 -0400
commitbab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/external_dependencies/openmpt-trunk/include/mpg123
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/external_dependencies/openmpt-trunk/include/mpg123')
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/AUTHORS176
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/COPYING772
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/OpenMPT.txt21
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/ports/MSVC++/config.h44
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/ports/MSVC++/mpg123.h49
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/ports/Xcode/config.h206
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/ports/Xcode/mpg123.h21
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/ports/makefile/config.h44
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/ports/makefile/mpg123.h18
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/compat/compat.c527
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/compat/compat.h330
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/compat/compat_str.c116
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/compat/wpathconv.h120
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/intsym.h371
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/abi_align.h41
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/calctables.c399
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/check_neon.S35
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/costabs.h81
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_3dnow.S560
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_3dnowext.S570
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_avx.S358
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_neon.S283
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_neon64.S249
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_sse.S387
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_x86_64.S394
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64.c175
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_3dnow.S749
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_3dnowext.S735
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_altivec.c315
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_avx.S324
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_avx_float.S294
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_i386.c336
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_i486.c342
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_mmx.S825
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_neon.S310
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_neon64.S299
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_neon64_float.S282
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_neon_float.S283
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_sse.S472
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_sse_float.S417
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_x86_64.S464
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_x86_64_float.S426
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/debug.h132
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/decode.h292
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dither.c3
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dither.h23
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dither_impl.h119
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/equalizer.c17
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/equalizer_3dnow.S70
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/feature.c133
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/fmt123.h159
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/format.c776
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/frame.c1072
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/frame.h431
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/gapless.h119
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getbits.h103
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getcpuflags.S102
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getcpuflags.h97
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getcpuflags_arm.c61
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getcpuflags_x86_64.S57
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/huffman.h340
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/icy.c34
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/icy.h38
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/icy2utf8.c440
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/icy2utf8.h10
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/id3.c1467
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/id3.h43
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/index.c132
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/index.h59
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/init_costabs.h24
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/init_layer12.h58
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/init_layer3.h231
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/l12tabs.h1224
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/l2tables.h167
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/l3bandgain.h94
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/l3tabs.h5285
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/layer1.c250
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/layer2.c380
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/layer3.c1943
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/lfs_alias.c236
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/lfs_wrap.c793
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/libmpg123.c1912
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/mangle.h199
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/mpeghead.h89
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/mpg123.h.in2033
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/mpg123lib_intern.h354
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/newhuffman.h824
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/ntom.c148
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/optimize.c1164
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/optimize.h388
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/parse.c1385
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/parse.h25
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/reader.h140
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/readers.c1266
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/sample.h195
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/stringbuf.c250
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/swap_bytes_impl.h103
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth.c1192
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth.h196
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_3dnow.S345
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_3dnowext.S13
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_8bit.c142
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_8bit.h86
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_altivec.c1057
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_arm.S278
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_arm_accurate.S294
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_i486.c252
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_i586.S343
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_i586_dither.S382
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_mmx.S141
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_mono.h64
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon.S135
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon64.S127
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon64_accurate.S135
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon64_float.S118
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon64_s32.S136
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon_accurate.S183
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon_float.S161
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon_s32.S182
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_ntom.h213
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_real.c585
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_s32.c598
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse.S13
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse3d.h268
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse_accurate.S298
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse_float.S245
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse_s32.S310
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_avx.S256
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_avx_accurate.S286
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_avx_float.S243
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_avx_s32.S292
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon.S187
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon64.S185
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon64_accurate.S200
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon64_float.S174
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon64_s32.S203
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon_accurate.S272
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon_float.S232
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon_s32.S261
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_sse_accurate.S512
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_sse_float.S420
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_sse_s32.S544
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_x86_64.S335
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_x86_64_accurate.S454
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_x86_64_float.S396
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_x86_64_s32.S473
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_x86_64.S244
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_x86_64_accurate.S301
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_x86_64_float.S259
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_x86_64_s32.S312
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synths.h52
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/tabinit.c345
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/tabinit_mmx.S229
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/testcpu.c35
-rw-r--r--Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/true.h15
155 files changed, 56918 insertions, 0 deletions
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/AUTHORS b/Src/external_dependencies/openmpt-trunk/include/mpg123/AUTHORS
new file mode 100644
index 00000000..3321f0ba
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/AUTHORS
@@ -0,0 +1,176 @@
+This is an attempt to give credit to the people who contributed in some way to the mpg123 project.
+There are names and email addresses listed. Please use these addresses only to contact contributors with some question about their mpg123 contribution.
+You are explicitly not allowed to send them unwanted business offers or to question the quality of their sex life.
+--------------------
+
+Being on the list of contributing authors not necessarily means that there
+is significant copyright in parts of the source code. There are obviously
+contributions of differing complexity. I try to mention people who motivated
+changes at least by suggesting some definite code changes, even if their
+code did not enter the mpg123 source verbatim. Trivial changes like pointing
+out ovbious syntax errors that make compilers cry do not land here.
+
+--------------------
+
+Current maintainers with various sorts of contributions:
+ Thomas Orgis <thomas@orgis.org>
+ Patrick Dehne <patrick@steidle.net>
+ Jonathan Yong <10walls@gmail.com>
+ Taihei Momma <tmkk@mac.com>
+
+Co-initiator of the revived mpg123 project, but not that involved anymore:
+ Nicholas J Humfrey <njh@ecs.soton.ac.uk>
+
+Special thanks go to Taihei, the person who keeps the assembly optimisations alive
+and takes care of portability to OSX/iOS platforms.
+
+Generic address pointing to the current maintainer (hopefully still works in future in case maintainership will change again): <maintainer@mpg123.org>
+
+The creator: Michael Hipp (email: hippm@informatik.uni-tuebingen.de - please bother maintainers first)
+
+Contributions/ideas Thomas Orgis era (includes backports from mhipp trunk):
+
+Vitaly Kirsanov <krokoziabla@gmail.com>: ports/cmake (optional CMake build)
+Won-Kyu Park <wkpark@gmail.com>: patch to get rid of asm textrels (x86 PIC)
+Michael Weiser <michaelweiser@users.sf.net>: update of coreaudio output to AudioComponents API
+Bent Bisballe Nyeng <bbn@dynastrom.com>: patch for MPG123_NO_PEEK_END and MPG123_FORCE_SEEKABLE
+Eric S. Raymond <esr@thyrsus.com>: man page fixes
+Tobias Weber <tobiw@suprafluid.com>: patch for --disable-equalizer
+Hans de Goede <j.w.r.degoede@gmail.com>: patch to skip APE tags
+Stephan Vedder <stephan.vedder@gmail.com>: MSVC++ 2013 port update
+Rajeev V. Pillai <rajeevvp@users.sf.net>: pointing out/patching issues in HTTP code and behaviour of mpg123 remote/terminal control
+Jarno Lehtinen <lehtinen@sci.fi>: tinyalsa output
+Anthony Wells <borgboyone@yahoo.com>: initial version of ID3v2 APIC patch
+David Wohlferd <limegreensocks@yahoo.com>: Win32 WaveOut buffer destructor fix.
+Mike Gorchak <mike.gorchak.qnx@gmail.com>: QNX native audio output (QSA)
+Dan McGee <dpmcgee@gmail.com>: various patches (also for test suite)
+Jonathan Yong (jon_y) <10walls@gmail.com>: win32 hacking, win32 wasapi audio.
+Malcolm Boczek <MBoczek@terraindustries.com>: Common language runtime wrapper
+Elbert Pol (TeLLie) <elbert.pol@gmail.com>: OS/2 port fixup
+Jeroen Valkonet <jvalkon@xs4all.nl>: motivate pitch control, suggestive patch for pitch command in generic control interface
+Andy Hefner <ahefner@gmail.com>: patch for that second UTF16 issue
+Taihei Monma <tmkk@mac.com>: A whole lot of new/improved assembler code, including Altivec!
+Christian Weisgerber <naddy@openbsd.org>, Brad Smith: sndio output
+Patrick Dehne (P4tr3ck) <patrick@steidle.net>: more MSVC++ porting, patch to handle missing bit reservoirs
+Thorsten Glaser <tg@mirbsd.de>: icy2utf8, suggest utf8 locale stuff
+Dan Smith <dan@algenta.com>: ABI fixes for ensuring stack alignment (esp. for MinGW-built DLL with MSVC)
+Michael Ryzhykh <mclroy@gmail.com>: mpg123.spec.in
+Stefan Lenselink <Stefan@lenselink.org>: initial aRts output
+Sergej Kvachonok <ravenexp@gmail.com>: win32 audio rewrite
+Winston: SunOS-4.1.4/gcc-2.7.0 testing and suggestions for fixes (legacy Makefile, integer type headers)
+Mika Tiainen: pointing out the fix for the UTF to ASCII filtering of tags to actually work
+Nick Kurshev <nickols_k@mail.ru>: extended 3dnow (from mplayer)
+Zuxy Meng <zuxy.meng@gmail.com>: SSE (from mplayer)
+Honza <cundrak@quick.cz>: idea and prototype patch for ICY meta data support
+Petr Baudis <pasky@ucw.cz>: patches: term sigcont, id3 display unicode fallback and condensed output
+Petr Salinger <Petr.Salinger@seznam.cz>: i486 enhancement
+mpdavig@users.sourceforge.net: linux-ppc-nas Makefile.legacy entry
+Adrian Bacon <adrian.bacon@xs4all.nl>: patched decode_i586_dither (noise shaped float/int rounding)
+Cool Feet Audio project <nutcase@dtfm.org>: realtime equalizer control
+Steve Grundell <www@grundell.u-net.com>: clean stdout in control mode with stdout decoding
+Romain Dolbeau <romain@dolbeau.org>: Altivec support (taken from mplayer)
+higway <higway@mednet.md>: MMX Patch
+Clemens Ladisch <clemens@ladisch.de>: ALSA 0.9/1.0 support
+
+Debian Daniel Kobras <kobras@debian.org> era:
+
+Steve Kemp <skx@debian.org>
+Dan Olson <theoddone33@icculus.org>
+Syuuhei Kashiyama <squash@mb.kcom.ne.jp>
+Rupert Levene <rupert.debian@hotpop.com>
+Andreas Dilger <adilger@turbolinux.com>
+Erik B. Andersen <andersee@debian.org>
+Chris Butler <chrisb@debian.org>
+Martin Sjogren <md9ms@mdstud.chalmers.se>
+Chet Hosey <chosey@budapress.com>
+Roland Rosenfeld <roland@spinnaker.de>
+
+
+Debian Colin Watson <cjwatson@debian.org> era:
+
+Helge Deller <deller@gmx.de>
+Chet Hosey <chosey@budapress.com>
+Christopher C. Chimelis <chris@debian.org>
+Roland Rosenfeld <roland@spinnaker.de>
+Marcelo E. Magallon <mmagallo@debian.org>
+
+
+Initial Debianers:
+
+Tommi Virtanen <tv@debian.org>
+Paul Haggart <phaggart@debian.org>
+
+
+Contributions/ideas Michael Hipp era:
+
+Mikko Tommila: DCT9
+Oliver Fromme <oliver.fromme@heim3.tu-clausthal.de>
+MPEG Software Simulation Group: reference decoder package
+Tobias Bading: idea for DCT64 in subband synthesis from maplay package
+Jeff Tsay and Mikko Tommila: MDCT36 from maplay package
+Philipp Knirsch <phil@mpik-tueb.mpg.de>: DCT36/manual unroll idea
+Thomas Woerner: SGI Audio
+Damien Clermonte: HP-UX audio fixes
+Niclas Lindstrom <nil@wineasy.se>: OS2 port
+Stefan Bieschewski <stb@acm.org>: Pentium optimizations, decode_i586.s
+Martin Denn <mdenn@unix-ag.uni-kl.de>: NAS port
+Niklas Beisert <nbeisert@physik.tu-muenchen.de>: MPEG 2.5 tables
+<mycroft@NetBSD.ORG> and <augustss@cs.chalmers.se>: NetBSD Patch(es)
+Kevin Brintnall <kbrint@visi.com>: BSD patch
+Tony Million: win32 port
+Steven Tiger Lang: advanced shuffle
+Eric B. Mitchell: esd port
+Ryan R. Prosser <prosser@geocities.com>: esd port for Solaris
+Andreas Neuhaus: initial generic control interface
+
+(additionally fetched from changelog:)
+
+Ralf Hildebrandt <R.Hildebrandt@TU-BS.DE>: audio_alib changes
+<sms@moe.2bsd.com>: BSDOS 4.0 with gcc added to Makefile
+Bertrand Petit <elrond@phoe.netdev.net>: frontend changes
+Erik Mouw <J.A.K.Mouw@its.tudelft.nl>: SGI audio fix for non RAD machines
+Daniel O'Connor <darius@guppy.dons.net.au>: freebsd-esd make-entry
+D. Skarda <0rfelyus@atrey.karlin.mff.cuni.cz>: enhanced head_check
+Wilson, Jeff D <jeff.wilson@wilcom.com>: xterm-title
+Robert Bihlmeyer <robbe@orcus.priv.at>: esd changes
+Hannu Napari's <Hannu.Napari@hut.fi>: SGI audio patches
+<Juergen.Schoew@unix-ag.uni-siegen.de>: native AIX support
+<psst@euskalnet.net>: playlist patch
+Gilles Zunino <Gilles.Zunino@hei.fupl.asso.fr>: SGI audio patches
+Matthew Parslow <roy@alpha.alphalink.com.au>: esdserver patch
+<dlux@dlux.sch.bme.hu>: equalizer patch (equalfile setting)
+Ducroquet Erwan <ducroque@ufr-info-p7.ibp.fr>: HPUX/ALib support
+Shane Wegner <shane@CM.NU>: genrepatch
+Samuel Audet <guardia@step.polymtl.ca>: wav-File patch
+"J. Dean Brederson" <jdb@cs.utah.edu>: SGI-RAD support
+Chou Ye-chi <is84002@cis.nctu.edu.tw>: sajberplay/FreeBSD patch
+Fabrice Bellard <bellard@email.enst.fr>: 486 optimizations
+A. Hermansen <ahermans@vf.telia.no> and J. Kysela <perex@jcu.cz>: ALSA output
+KIMURA Takuhiro <kim@hannah.ipc.miyakyo-u.ac.jp>: K6-3DNow
+Petr Stehlik <stehlik@cas3.zlin.vutbr.cz>: MINT
+Andy <andy@snoogie.demon.co.uk>: float2int speed up proposal
+Brian Foutz <foutz@anise.ee.cornell.edu>: TK3Play
+Thomas Niederreiter <tn@tarantel.rz.fh-muenchen.de>: RIFF header fix
+Stefan Gybas <cab@studbox.uni-stuttgart.de>: m68k patch
+Grant Erickson <eric0139@tc.umn.edu>: Linux PPC patch
+Peter Berger <peterb@hoopoe.psc.edu>: BSDi patch
+Henrik P Johnson <king@one.se>: HTTP auth
+Steven Tiger Lang <tiger@tyger.org>: advanced shuffle
+"Brian J. Swetland" <swetland@uiuc.edu>: front-end (remote) patch
+<leo@zycad.com>
+Tillmann Steinbrecher <tst@gmx.de>: shuffle patch
+M.Stekelenburg <m.stekelenburg@student.utwente.nl>: i386-getbits
+Antti Andreimann <anttix@cyberix.edu.ee>: outburst patch
+Hur TaeSung <saturn@arari.snu.ac.kr>: 'http accept' patch
+
+(from post-0.59 changes that yet have to go into new trunk:)
+
+Hans Schwengeler <schweng@astro.unibas.ch>: audio_dec additions
+Wojciech Barañski's Mp3Play (check the tools folder): Mp3Play frontend
+Daniel Koukola: audio_oss.c patch
+Munechika SUMIKAWA <sumikawa@ebina.hitachi.co.jp>: IPv6
+TEMNOTA <temnota@kmv.ru>: HTTP,FTP patch/playlist fix
+Peter Surda <shurdeek@panorama.sth.ac.at>: VBR patch
+Ben <ben@blaukopf.com>: ARM startup time improvements
+Dave MacKenzie <djm@pix.net>: init_output() patch
+pasky's <pasky@ju.cz>: close-on-stop patch
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/COPYING b/Src/external_dependencies/openmpt-trunk/include/mpg123/COPYING
new file mode 100644
index 00000000..14e14f01
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/COPYING
@@ -0,0 +1,772 @@
+This is the file that contains the terms of use, copying, etc. for the mpg123 distribution package.
+
+Main message, to include in "About ..." boxes, etc:
+
+ Copyright (c) 1995-2020 by Michael Hipp and others,
+ free software under the terms of the LGPL v2.1
+
+There is an attempt to cover the actual list of authors in the AUTHORS file.
+Project maintainer since 2006 is Thomas Orgis and many people have contributed
+since the Michael Hipp era, but he stays the initial source and it would
+be impractical to count them all individually, so it's "and others".
+Source files contain the phrase "the mpg123 project" to the same effect
+in their license boilerplate; especially those that were added after
+maintainership changed. The person mainly responsible for the first version
+is usually named in the phrase "initially written by ...".
+
+All files in the distribution that don't carry a license note on their own are
+licensed under the terms of the LGPL 2.1; exceptions may apply, especially to
+files not in the official distribution but in the revision control repository.
+
+The formal license text follows.
+
+=======================
+1. The LGPL version 2.1
+=======================
+
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+
+====================
+2. The GPL version 2
+====================
+
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/OpenMPT.txt b/Src/external_dependencies/openmpt-trunk/include/mpg123/OpenMPT.txt
new file mode 100644
index 00000000..c0807796
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/OpenMPT.txt
@@ -0,0 +1,21 @@
+libmpg123 library version 1.30.2 (2022-08-01).
+The following changes have been made:
+- ports/makefile/config.h and ports/makefile/mpg123.h have been added for plain
+ Makefile builds.
+- ports/MSVC++/config.h and ports/MSVC++/mpg123.h have been retained from older
+ versions.
+- ports/Xcode/config.h and ports/MSVC++/mpg123.h have been retained from older
+ versions.
+- ports/MSVC++/config.h has been modified to define OFF_MAX.
+- ports/MSVC++/mpg123.h has been adjusted to provide mpg123_ssize_t and define
+ MPG123_NO_LARGENAME.
+- ports/Xcode/mpg123.h has been adjusted to provide mpg123_ssize_t and define
+ MPG123_API_VERSION
+- src/libmpg123/mpg123.h.in has been modified to #include <fmt123.h> as
+ #include "fmt123.h"
+- ports/Xcode/config.h has been modified to let the build system set OPT_*
+- ports/Xcode/config.h has been modified to #define HAVE_DIRENT_H.
+- Modifications are marked by // OpenMPT or /* OpenMPT */.
+- Obviously, unnecessary folders and files have been removed.
+- For building, premake is used to generate Visual Studio project files.
+ See ../build/premake/ for details.
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/MSVC++/config.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/MSVC++/config.h
new file mode 100644
index 00000000..90d9f9f4
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/MSVC++/config.h
@@ -0,0 +1,44 @@
+#define strcasecmp _strcmpi
+#define strncasecmp _strnicmp
+
+#define HAVE_STRERROR 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_LIMITS_H 1
+
+#define HAVE_STRDUP
+#define HAVE_STDLIB_H
+#define HAVE_STDINT_H
+#define HAVE_INTTYPES_H
+#define HAVE_STRING_H
+
+#ifdef _M_ARM
+#define ASMALIGN_ARMASM 1
+#else
+#define ASMALIGN_BALIGN 1
+#endif
+
+
+/* We want some frame index, eh? */
+#define FRAME_INDEX 1
+#define INDEX_SIZE 1000
+
+/* also gapless playback! */
+#define GAPLESS 1
+/* #ifdef GAPLESS
+#undef GAPLESS
+#endif */
+
+/* #define DEBUG
+#define EXTRA_DEBUG */
+
+#define REAL_IS_FLOAT
+
+#define inline __inline
+
+/* we are on win32 */
+#define HAVE_WINDOWS_H
+
+/* use the unicode support within libmpg123 */
+#define WANT_WIN32_UNICODE
+
+#define OFF_MAX ((off_t)((sizeof(off_t) <= 4) ? ((uint32_t)-1/2) : ((uint64_t)-1/2))) /* OpenMPT */
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/MSVC++/mpg123.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/MSVC++/mpg123.h
new file mode 100644
index 00000000..005666ef
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/MSVC++/mpg123.h
@@ -0,0 +1,49 @@
+/*
+ mpg123_msvc: MPEG Audio Decoder library wrapper header for MS VC++ 2005
+
+ copyright 2008 by the mpg123 project - free software under the terms of the LGPL 2.1
+ initially written by Patrick Dehne and Thomas Orgis.
+*/
+#ifndef MPG123_MSVC_H
+#define MPG123_MSVC_H
+
+#include <tchar.h>
+#include <stdlib.h>
+#include <sys/types.h>
+
+// Needed for Visual Studio versions before VS 2010.
+#if (_MSC_VER < 1600)
+typedef __int32 int32_t;
+typedef unsigned __int32 uint32_t;
+#define PRIiMAX "I64i"
+typedef __int64 intmax_t;
+#else
+#include <stdint.h>
+#include <inttypes.h>
+#endif
+
+// ftell returns long, _ftelli64 returns __int64
+// off_t is long, not __int64, use ftell
+#define ftello ftell
+
+#define MPG123_API_VERSION 47 /* OpenMPT */
+#define MPG123_NO_CONFIGURE
+#define MPG123_NO_LARGENAME /* OpenMPT */
+#include <stddef.h> /* OpenMPT */
+typedef ptrdiff_t mpg123_ssize_t; /* OpenMPT */
+#include "mpg123.h.in" /* Yes, .h.in; we include the configure template! */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ // Wrapper around mpg123_open that supports path names with unicode
+ // characters
+ MPG123_EXPORT int mpg123_topen(mpg123_handle *fr, const _TCHAR *path);
+ MPG123_EXPORT int mpg123_tclose(mpg123_handle *fr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/Xcode/config.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/Xcode/config.h
new file mode 100644
index 00000000..85373407
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/Xcode/config.h
@@ -0,0 +1,206 @@
+#include "TargetConditionals.h"
+
+#if TARGET_IPHONE_SIMULATOR
+ #define DEFAULT_OUTPUT_MODULE "dummy"
+ /* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */
+ /* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */
+ /* #undef HAVE_CORESERVICES_CORESERVICES_H */
+ /* #undef HAVE_OPENAL_ALC_H */
+ /* #undef HAVE_OPENAL_AL_H */
+ #define ABI_ALIGN_FUN 1
+ #define HAVE_GAI_ADDRCONFIG 1
+ #define LFS_ALIAS_BITS 32
+ /* #undef HAVE_LIBMX */
+ #define HAVE_MMAP 1
+ #define IEEE_FLOAT 1
+ #define SIZEOF_INT32_T 4
+ #define SIZEOF_LONG 4
+ #define SIZEOF_OFF_T 8
+ #define SIZEOF_SIZE_T 4
+ #define SIZEOF_SSIZE_T 4
+#if 0 /* OpenMPT */
+ #define OPT_GENERIC
+#endif /* OpenMPT */
+#elif TARGET_OS_IPHONE
+ #define DEFAULT_OUTPUT_MODULE "dummy"
+ /* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */
+ /* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */
+ /* #undef HAVE_CORESERVICES_CORESERVICES_H */
+ /* #undef HAVE_OPENAL_ALC_H */
+ /* #undef HAVE_OPENAL_AL_H */
+ /* #undef ABI_ALIGN_FUN */
+ /* #undef HAVE_GAI_ADDRCONFIG */
+ #define LFS_ALIAS_BITS 32
+ /* #undef HAVE_LIBMX */
+ /* #undef HAVE_MMAP */
+ /* #undef IEEE_FLOAT */
+ #define SIZEOF_INT32_T 4
+ #define SIZEOF_LONG 4
+ #define SIZEOF_OFF_T 8
+ #define SIZEOF_SIZE_T 4
+ #define SIZEOF_SSIZE_T 4
+#if 0 /* OpenMPT */
+ #define OPT_NEON
+#endif /* OpenMPT */
+#elif TARGET_OS_MAC
+ #define DEFAULT_OUTPUT_MODULE "coreaudio"
+ #define HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H 1
+ #define HAVE_AUDIOUNIT_AUDIOUNIT_H 1
+ #define HAVE_CORESERVICES_CORESERVICES_H 1
+ #define HAVE_OPENAL_ALC_H 1
+ #define HAVE_OPENAL_AL_H 1
+ /* #undef ABI_ALIGN_FUN */
+ #define HAVE_GAI_ADDRCONFIG 1
+ #define LFS_ALIAS_BITS 64
+ #define HAVE_LIBMX 1
+ #define HAVE_MMAP 1
+ #define IEEE_FLOAT 1
+ #define SIZEOF_INT32_T 4
+ #define SIZEOF_LONG 8
+ #define SIZEOF_OFF_T 8
+ #define SIZEOF_SIZE_T 8
+ #define SIZEOF_SIZE_T 8
+ #define SIZEOF_SSIZE_T 8
+#if 0 /* OpenMPT */
+ #define OPT_GENERIC
+#endif /* OpenMPT */
+#else
+ #error "Unknown target."
+#endif
+
+/* #undef ACCURATE_ROUNDING */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+#define ASMALIGN_EXP 1
+#define CCALIGN 1
+/* #undef DEBUG */
+/* #undef DYNAMIC_BUILD */
+#define FIFO 1
+#define FRAME_INDEX 1
+#define GAPLESS 1
+/* #undef HAVE_ALC_H */
+/* #undef HAVE_ALIB_H */
+/* #undef HAVE_AL_ALC_H */
+/* #undef HAVE_AL_AL_H */
+/* #undef HAVE_AL_H */
+#define HAVE_ARPA_INET_H 1
+/* #undef HAVE_ASM_AUDIOIO_H */
+#define HAVE_ATOLL 1
+/* #undef HAVE_AUDIOS_H */
+/* #undef HAVE_CULIB_H */
+#define HAVE_DLFCN_H 1
+#define HAVE_GETADDRINFO 1
+#define HAVE_GETPAGESIZE 1
+#define HAVE_GETUID 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_LANGINFO_H 1
+#define HAVE_LIBM 1
+#define HAVE_LIMITS_H 1
+/* #undef HAVE_LINUX_SOUNDCARD_H */
+#define HAVE_LOCALE_H 1
+/* #undef HAVE_LTDL */
+/* #undef HAVE_MACHINE_SOUNDCARD_H */
+#define HAVE_MEMORY_H 1
+#define HAVE_MKFIFO 1
+#define HAVE_NETDB_H 1
+#define HAVE_NETINET_IN_H 1
+/* #undef HAVE_NETINET_TCP_H */
+#define HAVE_NL_LANGINFO 1
+/* #undef HAVE_OS2ME_H */
+/* #undef HAVE_OS2_H */
+#define HAVE_RANDOM 1
+#define HAVE_SCHED_H 1
+/* #undef HAVE_SCHED_SETSCHEDULER */
+#define HAVE_SETLOCALE 1
+#define HAVE_SETPRIORITY 1
+#define HAVE_SETUID 1
+#define HAVE_SIGNAL_H 1
+/* #undef HAVE_SNDIO_H */
+#define HAVE_STDINT_H 1
+#define HAVE_STDIO_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRDUP 1
+#define HAVE_STRERROR 1
+#define HAVE_STRINGS_H 1
+#define HAVE_STRING_H 1
+/* #undef HAVE_SUN_AUDIOIO_H */
+/* #undef HAVE_SYS_AUDIOIO_H */
+/* #undef HAVE_SYS_AUDIO_H */
+#define HAVE_SYS_IOCTL_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SIGNAL_H 1
+#define HAVE_SYS_SOCKET_H 1
+/* #undef HAVE_SYS_SOUNDCARD_H */
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_WAIT_H 1
+#define HAVE_TERMIOS 1
+#define HAVE_UNISTD_H 1
+/* #undef HAVE_WINDOWS_H */
+/* #undef HAVE_WS2TCPIP_H */
+#define INDEX_SIZE 1000
+#define IPV6 1
+#define LT_OBJDIR ".libs/"
+#define MODULE_FILE_SUFFIX ".la"
+#define NETWORK 1
+/* #undef NO_16BIT */
+/* #undef NO_32BIT */
+/* #undef NO_8BIT */
+/* #undef NO_DOWNSAMPLE */
+/* #undef NO_ERETURN */
+/* #undef NO_ERRORMSG */
+/* #undef NO_FEEDER */
+/* #undef NO_ICY */
+/* #undef NO_ID3V2 */
+/* #undef NO_LAYER1 */
+/* #undef NO_LAYER2 */
+/* #undef NO_LAYER3 */
+/* #undef NO_NTOM */
+/* #undef NO_REAL */
+/* #undef NO_STRING */
+/* #undef NO_WARNING */
+#define PACKAGE "mpg123"
+#define PACKAGE_BUGREPORT "mpg123-devel@lists.sourceforge.net"
+#define PACKAGE_NAME "mpg123"
+#define PACKAGE_STRING "mpg123 1.14.0"
+#define PACKAGE_TARNAME "mpg123"
+#define PACKAGE_URL ""
+#define PACKAGE_VERSION "1.14.0"
+/* #undef PORTAUDIO18 */
+#define STDC_HEADERS 1
+/* #undef USE_MODULES */
+#define VERSION "1.14.0"
+/* #undef WANT_WIN32_FIFO */
+/* #undef WANT_WIN32_SOCKETS */
+/* #undef WANT_WIN32_UNICODE */
+/* #undef WINVER */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* # undef WORDS_BIGENDIAN */
+# endif
+#endif
+/* #undef _FILE_OFFSET_BITS */
+/* #undef _LARGE_FILES */
+/* #undef _WIN32_WINNT */
+/* #undef const */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+/* #undef int16_t */
+/* #undef int32_t */
+/* #undef off_t */
+/* #undef size_t */
+/* #undef ssize_t */
+/* #undef uint16_t */
+/* #undef uint32_t */
+/* #undef uintptr_t */
+
+#define REAL_IS_FLOAT
+
+#define HAVE_DIRENT_H /* OpenMPT */
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/Xcode/mpg123.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/Xcode/mpg123.h
new file mode 100644
index 00000000..453ffec8
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/Xcode/mpg123.h
@@ -0,0 +1,21 @@
+/*
+ mpg123.h: MPEG Audio Decoder library wrapper header for Xcode
+
+ copyright 2012 by the mpg123 project - free software under the terms of the LGPL 2.1
+ initially written by Patrick Dehne.
+*/
+
+#ifndef MPG123_XCODE_H
+#define MPG123_XCODE_H
+
+#include <stdlib.h>
+#include <sys/types.h>
+
+#define MPG123_API_VERSION 47 /* OpenMPT */
+#define MPG123_NO_CONFIGURE
+#define MPG123_NO_LARGENAME /* OpenMPT */
+#include <stddef.h> /* OpenMPT */
+typedef ssize_t mpg123_ssize_t; /* OpenMPT */
+#include "../../src/libmpg123/mpg123.h.in" /* Yes, .h.in; we include the configure template! */
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/makefile/config.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/makefile/config.h
new file mode 100644
index 00000000..e8a96ea6
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/makefile/config.h
@@ -0,0 +1,44 @@
+
+#define HAVE_STRERROR 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_LIMITS_H 1
+
+#define HAVE_STRDUP 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_STRING_H 1
+
+#define HAVE_DIRENT_H 1
+
+#define HAVE_UNISTD_H 1
+#if !defined(__DJGPP__)
+#define HAVE_SYS_SIGNAL_H 1
+#endif
+#define HAVE_SYS_TIME_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_STAT_H 1
+
+/*
+#ifdef HAVE_STDLIB_H
+#ifdef HAVE_SIGNAL_H
+#ifdef HAVE_SYS_SIGNAL_H
+#ifdef HAVE_UNISTD_H
+#ifdef HAVE_SYS_TYPES_H
+#ifdef HAVE_INTTYPES_H
+#ifdef HAVE_STDINT_H
+#ifdef HAVE_LIMITS_H
+#ifdef HAVE_STRING_H
+#ifdef HAVE_STRINGS_H
+#ifdef HAVE_SYS_TIME_H
+#ifdef HAVE_SYS_SELECT_H
+*/
+
+#define GAPLESS 1
+
+#define REAL_IS_FLOAT
+
+#define inline __inline
+
+#define OFF_MAX ((off_t)((sizeof(off_t) <= 4) ? ((uint32_t)-1/2) : ((uint64_t)-1/2))) /* OpenMPT */
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/makefile/mpg123.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/makefile/mpg123.h
new file mode 100644
index 00000000..7fc3b88c
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/ports/makefile/mpg123.h
@@ -0,0 +1,18 @@
+#ifndef MPG123_MAKEFILE_H
+#define MPG123_MAKEFILE_H
+
+#include <stdlib.h>
+#include <sys/types.h>
+
+#include <stdint.h>
+#include <inttypes.h>
+
+#define MPG123_API_VERSION 47
+#define MPG123_NO_CONFIGURE
+#define MPG123_NO_LARGENAME
+#include <stddef.h>
+typedef ssize_t mpg123_ssize_t;
+#include "mpg123.h.in"
+
+#endif
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/compat/compat.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/compat/compat.c
new file mode 100644
index 00000000..dacc77be
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/compat/compat.c
@@ -0,0 +1,527 @@
+/*
+ compat: Some compatibility functions (basic memory & string stuff in separate file)
+
+ The mpg123 code is determined to keep it's legacy. A legacy of old, old UNIX.
+ So anything possibly somewhat advanced should be considered to be put here, with proper #ifdef;-)
+
+ copyright 2007-2020 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis, Windows Unicode stuff by JonY.
+*/
+
+#include "config.h"
+/* This source file does need _POSIX_SOURCE to get some sigaction. */
+#define _POSIX_SOURCE
+#include "compat.h"
+
+#ifdef _MSC_VER
+#include <io.h>
+
+#if(defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_APP))
+#define WINDOWS_UWP
+#endif
+
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef HAVE_DIRENT_H
+# include <dirent.h>
+#endif
+
+/* Win32 is only supported with unicode now. These headers also cover
+ module stuff. The WANT_WIN32_UNICODE macro is synonymous with
+ "want windows-specific API, and only the unicode variants of which". */
+#ifdef WANT_WIN32_UNICODE
+#include <wchar.h>
+#include <windows.h>
+#include <winnls.h>
+#include <shlwapi.h>
+#endif
+
+#include "debug.h"
+
+#ifndef WINDOWS_UWP
+
+char *compat_getenv(const char* name)
+{
+ char *ret = NULL;
+#ifdef WANT_WIN32_UNICODE
+ wchar_t *env;
+ wchar_t *wname = NULL;
+ if(win32_utf8_wide(name, &wname, NULL) > 0)
+ {
+ env = _wgetenv(wname);
+ free(wname);
+ if(env)
+ win32_wide_utf8(env, &ret, NULL);
+ }
+#else
+ ret = getenv(name);
+ if(ret)
+ ret = compat_strdup(ret);
+#endif
+ return ret;
+}
+
+#endif
+
+#include "wpathconv.h"
+
+/* Always add a default permission mask in case of flags|O_CREAT. */
+int compat_open(const char *filename, int flags)
+{
+ int ret;
+#if defined (WANT_WIN32_UNICODE)
+ wchar_t *frag = NULL;
+
+ frag = u2wlongpath(filename);
+ /* Fallback to plain open when ucs-2 conversion fails */
+ if(!frag)
+ goto open_fallback;
+
+ /*Try _wopen */
+ ret = _wopen(frag, flags|_O_BINARY, _S_IREAD | _S_IWRITE);
+ if(ret != -1 )
+ goto open_ok; /* msdn says -1 means failure */
+
+open_fallback:
+#endif
+
+#if (defined(WIN32) && !defined (__CYGWIN__))
+ /* MSDN says POSIX function is deprecated beginning in Visual C++ 2005 */
+ /* Try plain old _open(), if it fails, do nothing */
+ ret = _open(filename, flags|_O_BINARY, _S_IREAD | _S_IWRITE);
+#else
+ ret = open(filename, flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
+#endif
+
+#if defined (WANT_WIN32_UNICODE)
+open_ok:
+ free(frag);
+#endif
+
+ return ret;
+}
+
+/* Moved over from wav.c, logic with fallbacks added from the
+ example of compat_open(). */
+FILE* compat_fopen(const char *filename, const char *mode)
+{
+ FILE* stream = NULL;
+#ifdef WANT_WIN32_UNICODE
+ int cnt = 0;
+ wchar_t *wname = NULL;
+ wchar_t *wmode = NULL;
+
+ wname = u2wlongpath(filename);
+ if(!wname)
+ goto fopen_fallback;
+ cnt = win32_utf8_wide(mode, &wmode, NULL);
+ if( (wmode == NULL) || (cnt == 0))
+ goto fopen_fallback;
+
+ stream = _wfopen(wname, wmode);
+ if(stream) goto fopen_ok;
+
+fopen_fallback:
+#endif
+ stream = fopen(filename, mode);
+#ifdef WANT_WIN32_UNICODE
+
+fopen_ok:
+ free(wmode);
+ free(wname);
+#endif
+ return stream;
+}
+
+FILE* compat_fdopen(int fd, const char *mode)
+{
+ return fdopen(fd, mode);
+}
+
+int compat_close(int infd)
+{
+#if (defined(WIN32) && !defined (__CYGWIN__)) /* MSDN says POSIX function is deprecated beginning in Visual C++ 2005 */
+ return _close(infd);
+#else
+ return close(infd);
+#endif
+}
+
+int compat_fclose(FILE *stream)
+{
+ return fclose(stream);
+}
+
+void compat_binmode(int fd, int enable)
+{
+#if defined(HAVE__SETMODE)
+ _setmode(fd, enable ? _O_BINARY : _O_TEXT);
+#elif defined(HAVE_SETMODE)
+ setmode(fd, enable ? O_BINARY : O_TEXT);
+#endif
+}
+
+#ifndef WINDOWS_UWP
+
+/*
+ The Windows file and path stuff is an extract of jon_y's win32 loader
+ prototype from the loader_rework branch. It's been divided in to
+ reusable functons by ThOr in the hope to work out some generic-looking
+ loader code for both POSIX and Windows. The routines might be
+ helpful for consistent path work in other parts of mpg123, too.
+
+ This all is about getting some working code on a wide range of
+ systems while staying somewhat sane. If it does ridiculously inefficient
+ things with extraneous copies and grabbing of functions that made
+ it late to some official APIs, that's still fine with us.
+*/
+
+char* compat_catpath(const char *prefix, const char* path)
+{
+ char *ret = NULL;
+#ifdef WANT_WIN32_UNICODE
+ wchar_t *wprefix = NULL; /* Wide windows versions of */
+ wchar_t *wpath = NULL; /* input arguments. */
+ wchar_t *locwret = NULL; /* Tmp return value from LocalAlloc */
+ /*
+ This variation of combinepath can work with long and UNC paths, but
+ is not officially exposed in any DLLs, It also allocates all its buffers
+ internally via LocalAlloc, avoiding buffer overflow problems.
+ ThOr: I presume this hack is for supporting pre-8 Windows, as
+ from Windows 8 on, this is documented in the API.
+ */
+ HRESULT (__stdcall *mypac)( const wchar_t *in, const wchar_t* more
+ , unsigned long flags, wchar_t **out ) = NULL;
+ HMODULE pathcch = NULL;
+
+ if(!prefix && !path)
+ goto catpath_end;
+ wprefix = u2wpath(prefix);
+ wpath = u2wpath(path);
+ if((prefix && !wprefix) || (path && !wpath))
+ goto catpath_end;
+
+ /* Again: I presume this whole fun is to get at PathAllocCombine
+ even when pathcch.h is not available (like in MinGW32). */
+ if( (pathcch = GetModuleHandleA("kernelbase")) )
+ mypac = (void *)GetProcAddress(pathcch, "PathAllocCombine");
+ if(mypac) /* PATHCCH_ALLOW_LONG_PATH = 1 per API docs */
+ {
+ debug("Actually calling PathAllocCombine!");
+ mypac(wprefix, wpath, 1, &locwret);
+ }
+ else
+ {
+ /* Playing safe, if we'd care much about performance, this would be on
+ the stack. */
+ locwret = LocalAlloc(LPTR, sizeof(wchar_t)*MAX_PATH);
+ if(locwret)
+ PathCombineW(locwret, wprefix, wpath);
+ }
+ ret = w2upath(locwret);
+
+catpath_end:
+ LocalFree(locwret);
+ free(wprefix);
+ free(wpath);
+#else
+ size_t len, prelen, patlen;
+
+ if(path && path[0] == '/')
+ prefix = NULL; /* Absolute path stays as it is. */
+ prelen = prefix ? strlen(prefix) : 0;
+ patlen = path ? strlen(path) : 0;
+ /* Concatenate the two, put a / in between if both present. */
+ len = ((prefix && path) ? 1 : 0) + prelen + patlen;
+ ret = malloc(len+1);
+ if(ret)
+ {
+ size_t off=0;
+ memcpy(ret, prefix, prelen);
+ if(prefix && path)
+ ret[prelen+(off++)] = '/';
+ memcpy(ret+prelen+off, path, patlen);
+ ret[len] = 0;
+ }
+#endif
+ return ret;
+}
+
+int compat_isdir(const char *path)
+{
+ int ret = 0;
+#ifdef WANT_WIN32_UNICODE
+ wchar_t *wpath;
+ wpath = u2wlongpath(path);
+ if(wpath)
+ {
+ DWORD attr = GetFileAttributesW(wpath);
+ if(attr != INVALID_FILE_ATTRIBUTES && attr & FILE_ATTRIBUTE_DIRECTORY)
+ ret=1;
+ free(wpath);
+ }
+#else
+ struct stat sb;
+ if(path && !stat(path, &sb))
+ {
+ if(S_ISDIR(sb.st_mode))
+ ret=1;
+ }
+#endif
+ return ret;
+}
+
+struct compat_dir
+{
+ char *path;
+#ifdef WANT_WIN32_UNICODE
+ int gotone; /* Got a result stored from FindFirstFileW. */
+ WIN32_FIND_DATAW d;
+ HANDLE ffn;
+#else
+ DIR* dir;
+#endif
+};
+
+struct compat_dir* compat_diropen(char *path)
+{
+ struct compat_dir *cd;
+ if(!path)
+ return NULL;
+ cd = malloc(sizeof(*cd));
+ if(!cd)
+ return NULL;
+#ifdef WANT_WIN32_UNICODE
+ cd->gotone = 0;
+ {
+ char *pattern;
+ wchar_t *wpattern;
+ pattern = compat_catpath(path, "*");
+ wpattern = u2wlongpath(pattern);
+ if(wpattern)
+ {
+ cd->ffn = FindFirstFileW(wpattern, &(cd->d));
+ if(cd->ffn == INVALID_HANDLE_VALUE)
+ {
+ /* FindClose() only needed after successful first find, right? */
+ free(cd);
+ cd = NULL;
+ }
+ else
+ cd->gotone = 1;
+ }
+ free(wpattern);
+ free(pattern);
+ }
+#else
+ cd->dir = opendir(path);
+ if(!cd->dir)
+ {
+ free(cd);
+ cd = NULL;
+ }
+#endif
+ if(cd)
+ {
+ cd->path = compat_strdup(path);
+ if(!cd->path)
+ {
+ compat_dirclose(cd);
+ cd = NULL;
+ }
+ }
+ return cd;
+}
+
+void compat_dirclose(struct compat_dir *cd)
+{
+ if(cd)
+ {
+ free(cd->path);
+#ifdef WANT_WIN32_UNICODE
+ FindClose(cd->ffn);
+#else
+ closedir(cd->dir);
+#endif
+ free(cd);
+ }
+}
+
+char* compat_nextfile(struct compat_dir *cd)
+{
+ if(!cd)
+ return NULL;
+#ifdef WANT_WIN32_UNICODE
+ while(cd->gotone || FindNextFileW(cd->ffn, &(cd->d)))
+ {
+ cd->gotone = 0;
+ if(!(cd->d.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
+ {
+ char *ret;
+ win32_wide_utf8(cd->d.cFileName, &ret, NULL);
+ return ret;
+ }
+ }
+#else
+ {
+ struct dirent *dp;
+ while((dp = readdir(cd->dir)))
+ {
+ struct stat fst;
+ char *fullpath = compat_catpath(cd->path, dp->d_name);
+ if(fullpath && !stat(fullpath, &fst) && S_ISREG(fst.st_mode))
+ {
+ free(fullpath);
+ return compat_strdup(dp->d_name);
+ }
+ free(fullpath);
+ }
+ }
+#endif
+ return NULL;
+}
+
+char* compat_nextdir(struct compat_dir *cd)
+{
+ if(!cd)
+ return NULL;
+#ifdef WANT_WIN32_UNICODE
+ while(cd->gotone || FindNextFileW(cd->ffn, &(cd->d)))
+ {
+ cd->gotone = 0;
+ if(cd->d.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ {
+ char *ret;
+ win32_wide_utf8(cd->d.cFileName, &ret, NULL);
+ return ret;
+ }
+ }
+#else
+ {
+ struct dirent *dp;
+ while((dp = readdir(cd->dir)))
+ {
+ struct stat fst;
+ char *fullpath = compat_catpath(cd->path, dp->d_name);
+ if(fullpath && !stat(fullpath, &fst) && S_ISDIR(fst.st_mode))
+ {
+ free(fullpath);
+ return compat_strdup(dp->d_name);
+ }
+ free(fullpath);
+ }
+ }
+#endif
+ return NULL;
+}
+
+#endif
+
+// Revisit logic of write():
+// Return -1 if interrupted before any data was written,
+// set errno to EINTR. Any other error value is serious
+// for blocking I/O, which we assume here. EAGAIN should be
+// handed through.
+// Reaction to zero-sized write attempts could also be funky, so avoid that.
+// May return short count for various reasons. I assume that
+// any serious condition will show itself as return value -1
+// eventually.
+
+// These uninterruptible write/read functions shall persist as long as
+// possible to finish the desired operation. A short byte count is short
+// because of a serious reason (maybe EOF, maybe out of disk space). You
+// can inspect errno.
+
+size_t unintr_write(int fd, void const *buffer, size_t bytes)
+{
+ size_t written = 0;
+ errno = 0;
+ while(bytes)
+ {
+ errno = 0;
+ ssize_t part = write(fd, (char*)buffer+written, bytes);
+ // Just on short writes, we do not abort. Only when
+ // there was no successful operation (even zero write) at all.
+ // Any other error than EINTR ends things here.
+ if(part >= 0)
+ {
+ bytes -= part;
+ written += part;
+ } else if(errno != EINTR && errno != EAGAIN
+#if defined(EWOULDBLOCK) && (EWOULDBLOCK != EAGAIN)
+ // Not all platforms define it (or only in more modern POSIX modes).
+ // Standard says it is supposed to be a macro, so simple check here.
+ && errno != EWOULDBLOCK
+#endif
+ )
+ break;
+ }
+ return written;
+}
+
+/* Same for reading the data. */
+size_t unintr_read(int fd, void *buffer, size_t bytes)
+{
+ size_t got = 0;
+ errno = 0;
+ while(bytes)
+ {
+ errno = 0;
+ ssize_t part = read(fd, (char*)buffer+got, bytes);
+ if(part > 0) // == 0 is end of file
+ {
+ bytes -= part;
+ got += part;
+ } else if(errno != EINTR && errno != EAGAIN
+#if defined(EWOULDBLOCK) && (EWOULDBLOCK != EAGAIN)
+ && errno != EWOULDBLOCK
+#endif
+ )
+ break;
+ }
+ return got;
+}
+
+// and again for streams
+size_t unintr_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
+{
+ size_t written = 0;
+ errno = 0;
+ while(size && nmemb)
+ {
+ errno = 0;
+ size_t part = fwrite((char*)ptr+written*size, size, nmemb, stream);
+ if(part > 0)
+ {
+ nmemb -= part;
+ written += part;
+ } else if(errno != EINTR)
+ break;
+ }
+ return written;
+}
+
+#ifndef NO_CATCHSIGNAL
+#if (!defined(WIN32) || defined (__CYGWIN__)) && defined(HAVE_SIGNAL_H)
+void (*catchsignal(int signum, void(*handler)()))()
+{
+ struct sigaction new_sa;
+ struct sigaction old_sa;
+
+#ifdef DONT_CATCH_SIGNALS
+ fprintf (stderr, "Not catching any signals.\n");
+ return ((void (*)()) -1);
+#endif
+
+ new_sa.sa_handler = handler;
+ sigemptyset(&new_sa.sa_mask);
+ new_sa.sa_flags = 0;
+ if(sigaction(signum, &new_sa, &old_sa) == -1)
+ return ((void (*)()) -1);
+ return (old_sa.sa_handler);
+}
+#endif
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/compat/compat.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/compat/compat.h
new file mode 100644
index 00000000..f2b7af2b
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/compat/compat.h
@@ -0,0 +1,330 @@
+/*
+ compat: Some compatibility functions and header inclusions.
+ Basic standard C stuff, that may barely be above/around C89.
+
+ The mpg123 code is determined to keep it's legacy. A legacy of old, old UNIX.
+ It is envisioned to include this compat header instead of any of the "standard" headers, to catch compatibility issues.
+ So, don't include stdlib.h or string.h ... include compat.h.
+
+ copyright 2007-21 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis
+*/
+
+#ifndef MPG123_COMPAT_H
+#define MPG123_COMPAT_H
+
+#include "config.h"
+
+// We are using C99 now, including possibly single-precision math.
+#define _ISO_C99_SOURCE
+
+#include <errno.h>
+
+#ifdef HAVE_STDLIB_H
+/* realloc, size_t */
+#include <stdlib.h>
+#endif
+
+#include <stdio.h>
+#include <math.h>
+
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#else
+#ifdef HAVE_SYS_SIGNAL_H
+#include <sys/signal.h>
+#endif
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+/* Types, types, types. */
+/* Do we actually need these two in addition to sys/types.h? As replacement? */
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+/* We want SIZE_MAX, etc. */
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#ifndef SIZE_MAX
+#define SIZE_MAX ((size_t)-1)
+#endif
+#ifndef SSIZE_MAX
+#define SSIZE_MAX ((size_t)-1/2)
+#endif
+#ifndef ULONG_MAX
+#define ULONG_MAX ((unsigned long)-1)
+#endif
+
+#ifndef OFF_MAX
+#if SIZEOF_OFF_T == 4
+#define OFF_MAX ((uint32_t)-1/2)
+#elif SIZEOF_OFF_T == 8
+#define OFF_MAX ((uint64_t)-1/2)
+#else
+#error "Unexpected width of off_t."
+#endif
+#endif
+
+// Add two values (themselves assumed to be < limit), saturating to given limit.
+#define SATURATE_ADD(inout, add, limit) inout = (limit-add >= inout) ? inout+add : limit;
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
+#ifdef __OS2__
+#include <float.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+/* For select(), I need select.h according to POSIX 2001, else: sys/time.h sys/types.h unistd.h */
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
+/* compat_open makes little sense without */
+#include <fcntl.h>
+
+/* To parse big numbers... */
+#ifdef HAVE_ATOLL
+#define atobigint atoll
+#else
+#define atobigint atol
+#endif
+
+typedef unsigned char byte;
+
+#if defined(_MSC_VER)
+
+// For _setmode(), at least.
+#include <io.h>
+
+#if !defined(MPG123_DEF_SSIZE_T)
+#define MPG123_DEF_SSIZE_T
+#include <stddef.h>
+typedef ptrdiff_t ssize_t;
+#endif
+
+#endif
+
+// Not too early, leave system headers alone (strerror).
+#include "intsym.h"
+
+/* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */
+void *safe_realloc(void *ptr, size_t size);
+// Also freeing ptr if result is NULL. You can do
+// ptr = safer_realloc(ptr, size)
+// Also, ptr = safer_realloc(ptr, 0) will do free(ptr); ptr=NULL;.
+void *safer_realloc(void *ptr, size_t size);
+#ifndef HAVE_STRERROR
+const char *strerror(int errnum);
+#endif
+
+/* Roll our own strdup() that does not depend on libc feature test macros
+ and returns NULL on NULL input instead of crashing. */
+char* compat_strdup(const char *s);
+
+/* If we have the size checks enabled, try to derive some sane printfs.
+ Simple start: Use max integer type and format if long is not big enough.
+ I am hesitating to use %ll without making sure that it's there... */
+#if (defined SIZEOF_OFF_T) && (SIZEOF_OFF_T > SIZEOF_LONG) && (defined PRIiMAX)
+# define OFF_P PRIiMAX
+typedef intmax_t off_p;
+#else
+# define OFF_P "li"
+typedef long off_p;
+#endif
+
+#if (defined SIZEOF_SIZE_T) && (SIZEOF_SIZE_T > SIZEOF_LONG) && (defined PRIuMAX)
+# define SIZE_P PRIuMAX
+typedef uintmax_t size_p;
+#else
+# define SIZE_P "lu"
+typedef unsigned long size_p;
+#endif
+
+#if (defined SIZEOF_SSIZE_T) && (SIZEOF_SSIZE_T > SIZEOF_LONG) && (defined PRIiMAX)
+# define SSIZE_P PRIuMAX
+typedef intmax_t ssize_p;
+#else
+# define SSIZE_P "li"
+typedef long ssize_p;
+#endif
+
+/* Get an environment variable, possibly converted to UTF-8 from wide string.
+ The return value is a copy that you shall free. */
+char *compat_getenv(const char* name);
+
+/**
+ * Opening a file handle can be different.
+ * This function here is defined to take a path in native encoding (ISO8859 / UTF-8 / ...), or, when MS Windows Unicode support is enabled, an UTF-8 string that will be converted back to native UCS-2 (wide character) before calling the system's open function.
+ * @param[in] wptr Pointer to wide string.
+ * @param[in] mbptr Pointer to multibyte string.
+ * @return file descriptor (>=0) or error code.
+ */
+int compat_open(const char *filename, int flags);
+FILE* compat_fopen(const char *filename, const char *mode);
+/**
+ * Also fdopen to avoid having to define POSIX macros in various source files.
+ */
+FILE* compat_fdopen(int fd, const char *mode);
+
+/**
+ * Closing a file handle can be platform specific.
+ * This function takes a file descriptor that is to be closed.
+ * @param[in] infd File descriptor to be closed.
+ * @return 0 if the file was successfully closed. A return value of -1 indicates an error.
+ */
+int compat_close(int infd);
+int compat_fclose(FILE* stream);
+
+
+/**
+ * Setting binary mode on a descriptor, where necessary.
+ * We do not bother with errors. This has to work.
+ * You can enable or disable binary mode.
+ */
+void compat_binmode(int fd, int enable);
+
+/* Those do make sense in a separate file, but I chose to include them in compat.c because that's the one source whose object is shared between mpg123 and libmpg123 -- and both need the functionality internally. */
+
+#if defined (_WIN32) || defined (__CYGWIN__)
+/**
+ * win32_uni2mbc
+ * Converts a null terminated UCS-2 string to a multibyte (UTF-8) equivalent.
+ * Caller is supposed to free allocated buffer.
+ * @param[in] wptr Pointer to wide string.
+ * @param[out] mbptr Pointer to multibyte string.
+ * @param[out] buflen Optional parameter for length of allocated buffer.
+ * @return status of WideCharToMultiByte conversion.
+ *
+ * WideCharToMultiByte - http://msdn.microsoft.com/en-us/library/dd374130(VS.85).aspx
+ */
+int win32_wide_utf8(const wchar_t * const wptr, char **mbptr, size_t * buflen);
+
+/**
+ * win32_uni2mbc
+ * Converts a null terminated UCS-2 string to a multibyte (UTF-7) equivalent.
+ * Caller is supposed to free allocated buffer.
+ * @param[in] wptr Pointer to wide string.
+ * @param[out] mbptr Pointer to multibyte string.
+ * @param[out] buflen Optional parameter for length of allocated buffer.
+ * @return status of WideCharToMultiByte conversion.
+ *
+ * WideCharToMultiByte - http://msdn.microsoft.com/en-us/library/dd374130(VS.85).aspx
+ */
+int win32_wide_utf7(const wchar_t * const wptr, char **mbptr, size_t * buflen);
+
+/**
+ * win32_mbc2uni
+ * Converts a null terminated UTF-8 string to a UCS-2 equivalent.
+ * Caller is supposed to free allocated buffer.
+ * @param[in] mbptr Pointer to multibyte string.
+ * @param[out] wptr Pointer to wide string.
+ * @param[out] buflen Optional parameter for length of allocated buffer.
+ * @return status of WideCharToMultiByte conversion.
+ *
+ * MultiByteToWideChar - http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx
+ */
+
+int win32_utf8_wide(const char *const mbptr, wchar_t **wptr, size_t *buflen);
+#endif
+
+/*
+ A little bit of path abstraction: We always work with plain char strings
+ that usually represent POSIX-ish UTF-8 paths (something like c:/some/file
+ might appear). For Windows, those are converted to wide strings with \
+ instead of / and possible fun is had with prefixes to get around the old
+ path length limit. Outside of the compat library, that stuff should not
+ matter, although something like //?/UNC/server/some/file could be thrown
+ around as UTF-8 string, to be converted to a wide \\?\UNC\server\some\file
+ just before handing it to Windows API.
+
+ There is a lot of unnecessary memory allocation and string copying because
+ of this, but this filesystem stuff is not really relevant to mpg123
+ performance, so the goal is to keep the code outside the compatibility layer
+ simple.
+*/
+
+/*
+ Concatenate a prefix and a path, one of them alowed to be NULL.
+ If the path is already absolute, the prefix is ignored. Relative
+ parts (like /..) are resolved if this is sensible for the platform
+ (meaning: for Windows), else they are preserved (on POSIX, actual
+ file system access would be needed because of symlinks).
+*/
+char* compat_catpath(const char *prefix, const char* path);
+
+/* Return 1 if the given path indicates an existing directory,
+ 0 otherwise. */
+int compat_isdir(const char *path);
+
+/*
+ Directory traversal. This talks ASCII/UTF-8 paths externally, converts
+ to/from wchar_t internally if the platform wants that. Returning NULL
+ means failure to open/end of listing.
+ There is no promise about sorting entries.
+*/
+struct compat_dir;
+/* Returns NULL if either directory failed to open or listing is empty.
+ Listing can still be empty even if non-NULL, so always rely on the
+ nextfile/nextdir functions. */
+struct compat_dir* compat_diropen(char *path);
+void compat_dirclose(struct compat_dir*);
+/* Get the next entry that is a file (or symlink to one).
+ The returned string is a copy that needs to be freed after use. */
+char* compat_nextfile(struct compat_dir*);
+/* Get the next entry that is a directory (or symlink to one).
+ The returned string is a copy that needs to be freed after use. */
+char* compat_nextdir (struct compat_dir*);
+
+#ifdef USE_MODULES
+/*
+ For keeping the path mess local, a system-specific dlopen() variant
+ is contained in here, too. This is very thin wrapping, even sparing
+ definition of a handle type, just using void pointers.
+ Use of absolute paths is a good idea if you want to be sure which
+ file is openend, as default search paths vary.
+*/
+void *compat_dlopen (const char *path);
+void *compat_dlsym (void *handle, const char* name);
+void compat_dlclose(void *handle);
+#endif
+
+/* Blocking write/read of data with signal resilience.
+ They continue after being interrupted by signals and always return the
+ amount of processed data (shortage indicating actual problem or EOF). */
+size_t unintr_write(int fd, void const *buffer, size_t bytes);
+size_t unintr_read (int fd, void *buffer, size_t bytes);
+size_t unintr_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
+
+/* OSX SDK defines an enum with "normal" as value. That clashes with
+ optimize.h */
+#ifdef __APPLE__
+#define normal mpg123_normal
+#endif
+
+#include "true.h"
+
+#if (!defined(WIN32) || defined (__CYGWIN__)) && defined(HAVE_SIGNAL_H)
+void (*catchsignal(int signum, void(*handler)()))();
+#endif
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/compat/compat_str.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/compat/compat_str.c
new file mode 100644
index 00000000..2bda8131
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/compat/compat_str.c
@@ -0,0 +1,116 @@
+/*
+ compat: Some compatibility functions (basic memory and string stuff)
+
+ The mpg123 code is determined to keep it's legacy. A legacy of old, old UNIX.
+ So anything possibly somewhat advanced should be considered to be put here, with proper #ifdef;-)
+
+ copyright 2007-2016 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis, Windows Unicode stuff by JonY.
+*/
+
+#include "compat.h"
+
+/* Win32 is only supported with unicode now. These headers also cover
+ module stuff. The WANT_WIN32_UNICODE macro is synonymous with
+ "want windows-specific API, and only the unicode variants of which". */
+#if defined (_WIN32) || defined (__CYGWIN__)
+#include <wchar.h>
+#include <windows.h>
+#include <winnls.h>
+#endif
+
+#include "debug.h"
+
+/* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */
+void *safe_realloc(void *ptr, size_t size)
+{
+ if(ptr == NULL) return malloc(size);
+ else return realloc(ptr, size);
+}
+
+// A more sensible variant of realloc: It deallocates the original memory if
+// realloc fails or if size zero was requested.
+void *safer_realloc(void *ptr, size_t size)
+{
+ void *nptr = size ? safe_realloc(ptr, size) : NULL;
+ if(!nptr && ptr)
+ free(ptr);
+ return nptr;
+}
+
+#ifndef HAVE_STRERROR
+const char *strerror(int errnum)
+{
+ extern int sys_nerr;
+ extern char *sys_errlist[];
+
+ return (errnum < sys_nerr) ? sys_errlist[errnum] : "";
+}
+#endif
+
+char* compat_strdup(const char *src)
+{
+ char *dest = NULL;
+ if(src)
+ {
+ size_t len;
+ len = strlen(src)+1;
+ if((dest = malloc(len)))
+ memcpy(dest, src, len);
+ }
+ return dest;
+}
+
+/* Windows Unicode stuff */
+/* Provided unconditionally, since WASAPI needs it to configure the audio device */
+#if defined (_WIN32) || defined (__CYGWIN__)
+static
+int win32_wide_common(const wchar_t * const wptr, char **mbptr, size_t * buflen, UINT cp)
+{
+ size_t len;
+ char *buf;
+ int ret = 0;
+
+ len = WideCharToMultiByte(cp, 0, wptr, -1, NULL, 0, NULL, NULL); /* Get utf-8 string length */
+ buf = calloc(len + 1, sizeof (char)); /* Can we assume sizeof char always = 1? */
+
+ if(!buf) len = 0;
+ else {
+ if (len != 0) ret = WideCharToMultiByte(cp, 0, wptr, -1, buf, len, NULL, NULL); /*Do actual conversion*/
+ buf[len] = '0'; /* Must terminate */
+ }
+ *mbptr = buf; /* Set string pointer to allocated buffer */
+ if(buflen != NULL) *buflen = (len) * sizeof (char); /* Give length of allocated memory if needed. */
+ return ret;
+}
+
+int win32_wide_utf8(const wchar_t * const wptr, char **mbptr, size_t * buflen)
+{
+ return win32_wide_common(wptr, mbptr, buflen, CP_UTF8);
+}
+
+int win32_wide_utf7(const wchar_t * const wptr, char **mbptr, size_t * buflen)
+{
+ return win32_wide_common(wptr, mbptr, buflen, CP_UTF7);
+}
+
+int win32_utf8_wide(const char *const mbptr, wchar_t **wptr, size_t *buflen)
+{
+ size_t len;
+ wchar_t *buf;
+ int ret = 0;
+
+ len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, mbptr, -1, NULL, 0); /* Get converted size */
+ buf = calloc(len + 1, sizeof (wchar_t)); /* Allocate memory accordingly */
+
+ if(!buf) len = 0;
+ else {
+ if (len != 0) ret = MultiByteToWideChar (CP_UTF8, MB_ERR_INVALID_CHARS, mbptr, -1, buf, len); /* Do conversion */
+ buf[len] = L'0'; /* Must terminate */
+ }
+ *wptr = buf; /* Set string pointer to allocated buffer */
+ if (buflen != NULL) *buflen = len * sizeof (wchar_t); /* Give length of allocated memory if needed. */
+ return ret; /* Number of characters written */
+}
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/compat/wpathconv.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/compat/wpathconv.h
new file mode 100644
index 00000000..78b4294c
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/compat/wpathconv.h
@@ -0,0 +1,120 @@
+/*
+ wpathconv: static functions for windows file path conversions
+
+ This file is intended to be included in libcompat sources for internal use.
+ It is separated out to be able to split off the dlopen functions into a
+ separate libcompat. It is just a code fragment.
+
+ copyright 2007-2019 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by JonY
+*/
+
+#ifndef WINDOWS_UWP
+
+#ifdef WANT_WIN32_UNICODE
+
+/* Convert unix UTF-8 (or ASCII) paths to Windows wide character paths. */
+static wchar_t* u2wpath(const char *upath)
+{
+ wchar_t* wpath, *p;
+ if(!upath || win32_utf8_wide(upath, &wpath, NULL) < 1)
+ return NULL;
+ for(p=wpath; *p; ++p)
+ if(*p == L'/')
+ *p = L'\\';
+ return wpath;
+}
+
+/* Convert Windows wide character paths to unix UTF-8. */
+static char* w2upath(const wchar_t *wpath)
+{
+ char* upath, *p;
+ if(!wpath || win32_wide_utf8(wpath, &upath, NULL) < 1)
+ return NULL;
+ for(p=upath; *p; ++p)
+ if(*p == '\\')
+ *p = '/';
+ return upath;
+}
+
+/* An absolute path that is too long and not already marked with
+ \\?\ can be marked as a long one and still work. */
+static int wpath_need_elongation(wchar_t *wpath)
+{
+ if( wpath && !PathIsRelativeW(wpath)
+ && wcslen(wpath) > MAX_PATH-1
+ && wcsncmp(L"\\\\?\\", wpath, 4) )
+ return 1;
+ else
+ return 0;
+}
+
+/* Take any wide windows path and turn it into a path that is allowed
+ to be longer than MAX_PATH, if it is not already. */
+static wchar_t* wlongpath(wchar_t *wpath)
+{
+ size_t len, plen;
+ const wchar_t *prefix = L"";
+ wchar_t *wlpath = NULL;
+ if(!wpath)
+ return NULL;
+
+ /* Absolute paths that do not start with \\?\ get that prepended
+ to allow them being long. */
+ if(!PathIsRelativeW(wpath) && wcsncmp(L"\\\\?\\", wpath, 4))
+ {
+ if(wcslen(wpath) >= 2 && PathIsUNCW(wpath))
+ {
+ /* \\server\path -> \\?\UNC\server\path */
+ prefix = L"\\\\?\\UNC";
+ ++wpath; /* Skip the first \. */
+ }
+ else /* c:\some/path -> \\?\c:\some\path */
+ prefix = L"\\\\?\\";
+ }
+ plen = wcslen(prefix);
+ len = plen + wcslen(wpath);
+ wlpath = malloc(len+1*sizeof(wchar_t));
+ if(wlpath)
+ {
+ /* Brute force memory copying, swprintf is too dandy. */
+ memcpy(wlpath, prefix, sizeof(wchar_t)*plen);
+ memcpy(wlpath+plen, wpath, sizeof(wchar_t)*(len-plen));
+ wlpath[len] = 0;
+ }
+ return wlpath;
+}
+
+/* Convert unix path to wide windows path, optionally marking
+ it as long path if necessary. */
+static wchar_t* u2wlongpath(const char *upath)
+{
+ wchar_t *wpath = NULL;
+ wchar_t *wlpath = NULL;
+ wpath = u2wpath(upath);
+ if(wpath_need_elongation(wpath))
+ {
+ wlpath = wlongpath(wpath);
+ free(wpath);
+ wpath = wlpath;
+ }
+ return wpath;
+}
+
+#endif
+
+#else
+
+static wchar_t* u2wlongpath(const char *upath)
+{
+ wchar_t* wpath, *p;
+ if (!upath || win32_utf8_wide(upath, &wpath, NULL) < 1)
+ return NULL;
+ for (p = wpath; *p; ++p)
+ if (*p == L'/')
+ *p = L'\\';
+ return wpath;
+}
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/intsym.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/intsym.h
new file mode 100644
index 00000000..7c817e3a
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/intsym.h
@@ -0,0 +1,371 @@
+#ifndef MPG123_INTSYM_H
+#define MPG123_INTSYM_H
+/* Mapping of internal mpg123 symbols to something that is less likely to
+ conflict in case of static linking. */
+#include "config.h"
+#define COS9 INT123_COS9
+#define tfcos36 INT123_tfcos36
+#define pnts INT123_pnts
+#define catchsignal INT123_catchsignal
+#define safe_realloc INT123_safe_realloc
+#define safer_realloc INT123_safer_realloc
+#define compat_strdup INT123_compat_strdup
+#define compat_getenv INT123_compat_getenv
+#define compat_open INT123_compat_open
+#define compat_fopen INT123_compat_fopen
+#define compat_fdopen INT123_compat_fdopen
+#define compat_close INT123_compat_close
+#define compat_fclose INT123_compat_fclose
+#define win32_wide_utf8 INT123_win32_wide_utf8
+#define win32_wide_utf7 INT123_win32_wide_utf7
+#define win32_utf8_wide INT123_win32_utf8_wide
+#define compat_catpath INT123_compat_catpath
+#define compat_isdir INT123_compat_isdir
+#define compat_diropen INT123_compat_diropen
+#define compat_dirclose INT123_compat_dirclose
+#define compat_nextfile INT123_compat_nextfile
+#define compat_nextdir INT123_compat_nextdir
+#define compat_dlopen INT123_compat_dlopen
+#define compat_dlsym INT123_compat_dlsym
+#define compat_dlclose INT123_compat_dlclose
+#define unintr_write INT123_unintr_write
+#define unintr_read INT123_unintr_read
+#define unintr_fwrite INT123_unintr_fwrite
+#define ntom_set_ntom INT123_ntom_set_ntom
+#define synth_1to1 INT123_synth_1to1
+#define synth_1to1_dither INT123_synth_1to1_dither
+#define synth_1to1_i386 INT123_synth_1to1_i386
+#define synth_1to1_i586 INT123_synth_1to1_i586
+#define synth_1to1_i586_dither INT123_synth_1to1_i586_dither
+#define synth_1to1_mmx INT123_synth_1to1_mmx
+#define synth_1to1_3dnow INT123_synth_1to1_3dnow
+#define synth_1to1_sse INT123_synth_1to1_sse
+#define synth_1to1_stereo_sse INT123_synth_1to1_stereo_sse
+#define synth_1to1_3dnowext INT123_synth_1to1_3dnowext
+#define synth_1to1_altivec INT123_synth_1to1_altivec
+#define synth_1to1_stereo_altivec INT123_synth_1to1_stereo_altivec
+#define synth_1to1_x86_64 INT123_synth_1to1_x86_64
+#define synth_1to1_stereo_x86_64 INT123_synth_1to1_stereo_x86_64
+#define synth_1to1_avx INT123_synth_1to1_avx
+#define synth_1to1_stereo_avx INT123_synth_1to1_stereo_avx
+#define synth_1to1_arm INT123_synth_1to1_arm
+#define synth_1to1_neon INT123_synth_1to1_neon
+#define synth_1to1_stereo_neon INT123_synth_1to1_stereo_neon
+#define synth_1to1_neon64 INT123_synth_1to1_neon64
+#define synth_1to1_stereo_neon64 INT123_synth_1to1_stereo_neon64
+#define absynth_1to1_i486 INT123_absynth_1to1_i486
+#define synth_1to1_mono INT123_synth_1to1_mono
+#define synth_1to1_m2s INT123_synth_1to1_m2s
+#define synth_2to1 INT123_synth_2to1
+#define synth_2to1_dither INT123_synth_2to1_dither
+#define synth_2to1_i386 INT123_synth_2to1_i386
+#define synth_2to1_mono INT123_synth_2to1_mono
+#define synth_2to1_m2s INT123_synth_2to1_m2s
+#define synth_4to1 INT123_synth_4to1
+#define synth_4to1_dither INT123_synth_4to1_dither
+#define synth_4to1_i386 INT123_synth_4to1_i386
+#define synth_4to1_mono INT123_synth_4to1_mono
+#define synth_4to1_m2s INT123_synth_4to1_m2s
+#define synth_ntom INT123_synth_ntom
+#define synth_ntom_mono INT123_synth_ntom_mono
+#define synth_ntom_m2s INT123_synth_ntom_m2s
+#define synth_1to1_8bit INT123_synth_1to1_8bit
+#define synth_1to1_8bit_i386 INT123_synth_1to1_8bit_i386
+#define synth_1to1_8bit_wrap INT123_synth_1to1_8bit_wrap
+#define synth_1to1_8bit_mono INT123_synth_1to1_8bit_mono
+#define synth_1to1_8bit_m2s INT123_synth_1to1_8bit_m2s
+#define synth_1to1_8bit_wrap_mono INT123_synth_1to1_8bit_wrap_mono
+#define synth_1to1_8bit_wrap_m2s INT123_synth_1to1_8bit_wrap_m2s
+#define synth_2to1_8bit INT123_synth_2to1_8bit
+#define synth_2to1_8bit_i386 INT123_synth_2to1_8bit_i386
+#define synth_2to1_8bit_mono INT123_synth_2to1_8bit_mono
+#define synth_2to1_8bit_m2s INT123_synth_2to1_8bit_m2s
+#define synth_4to1_8bit INT123_synth_4to1_8bit
+#define synth_4to1_8bit_i386 INT123_synth_4to1_8bit_i386
+#define synth_4to1_8bit_mono INT123_synth_4to1_8bit_mono
+#define synth_4to1_8bit_m2s INT123_synth_4to1_8bit_m2s
+#define synth_ntom_8bit INT123_synth_ntom_8bit
+#define synth_ntom_8bit_mono INT123_synth_ntom_8bit_mono
+#define synth_ntom_8bit_m2s INT123_synth_ntom_8bit_m2s
+#define synth_1to1_real INT123_synth_1to1_real
+#define synth_1to1_real_i386 INT123_synth_1to1_real_i386
+#define synth_1to1_real_sse INT123_synth_1to1_real_sse
+#define synth_1to1_real_stereo_sse INT123_synth_1to1_real_stereo_sse
+#define synth_1to1_real_x86_64 INT123_synth_1to1_real_x86_64
+#define synth_1to1_real_stereo_x86_64 INT123_synth_1to1_real_stereo_x86_64
+#define synth_1to1_real_avx INT123_synth_1to1_real_avx
+#define synth_1to1_fltst_avx INT123_synth_1to1_fltst_avx
+#define synth_1to1_real_altivec INT123_synth_1to1_real_altivec
+#define synth_1to1_fltst_altivec INT123_synth_1to1_fltst_altivec
+#define synth_1to1_real_neon INT123_synth_1to1_real_neon
+#define synth_1to1_real_stereo_neon INT123_synth_1to1_real_stereo_neon
+#define synth_1to1_real_neon64 INT123_synth_1to1_real_neon64
+#define synth_1to1_fltst_neon64 INT123_synth_1to1_fltst_neon64
+#define synth_1to1_real_mono INT123_synth_1to1_real_mono
+#define synth_1to1_real_m2s INT123_synth_1to1_real_m2s
+#define synth_2to1_real INT123_synth_2to1_real
+#define synth_2to1_real_i386 INT123_synth_2to1_real_i386
+#define synth_2to1_real_mono INT123_synth_2to1_real_mono
+#define synth_2to1_real_m2s INT123_synth_2to1_real_m2s
+#define synth_4to1_real INT123_synth_4to1_real
+#define synth_4to1_real_i386 INT123_synth_4to1_real_i386
+#define synth_4to1_real_mono INT123_synth_4to1_real_mono
+#define synth_4to1_real_m2s INT123_synth_4to1_real_m2s
+#define synth_ntom_real INT123_synth_ntom_real
+#define synth_ntom_real_mono INT123_synth_ntom_real_mono
+#define synth_ntom_real_m2s INT123_synth_ntom_real_m2s
+#define synth_1to1_s32 INT123_synth_1to1_s32
+#define synth_1to1_s32_i386 INT123_synth_1to1_s32_i386
+#define synth_1to1_s32_sse INT123_synth_1to1_s32_sse
+#define synth_1to1_s32_stereo_sse INT123_synth_1to1_s32_stereo_sse
+#define synth_1to1_s32_x86_64 INT123_synth_1to1_s32_x86_64
+#define synth_1to1_s32_stereo_x86_64 INT123_synth_1to1_s32_stereo_x86_64
+#define synth_1to1_s32_avx INT123_synth_1to1_s32_avx
+#define synth_1to1_s32_stereo_avx INT123_synth_1to1_s32_stereo_avx
+#define synth_1to1_s32_altivec INT123_synth_1to1_s32_altivec
+#define synth_1to1_s32_stereo_altivec INT123_synth_1to1_s32_stereo_altivec
+#define synth_1to1_s32_neon INT123_synth_1to1_s32_neon
+#define synth_1to1_s32_stereo_neon INT123_synth_1to1_s32_stereo_neon
+#define synth_1to1_s32_neon64 INT123_synth_1to1_s32_neon64
+#define synth_1to1_s32st_neon64 INT123_synth_1to1_s32st_neon64
+#define synth_1to1_s32_mono INT123_synth_1to1_s32_mono
+#define synth_1to1_s32_m2s INT123_synth_1to1_s32_m2s
+#define synth_2to1_s32 INT123_synth_2to1_s32
+#define synth_2to1_s32_i386 INT123_synth_2to1_s32_i386
+#define synth_2to1_s32_mono INT123_synth_2to1_s32_mono
+#define synth_2to1_s32_m2s INT123_synth_2to1_s32_m2s
+#define synth_4to1_s32 INT123_synth_4to1_s32
+#define synth_4to1_s32_i386 INT123_synth_4to1_s32_i386
+#define synth_4to1_s32_mono INT123_synth_4to1_s32_mono
+#define synth_4to1_s32_m2s INT123_synth_4to1_s32_m2s
+#define synth_ntom_s32 INT123_synth_ntom_s32
+#define synth_ntom_s32_mono INT123_synth_ntom_s32_mono
+#define synth_ntom_s32_m2s INT123_synth_ntom_s32_m2s
+#define dct64 INT123_dct64
+#define dct64_i386 INT123_dct64_i386
+#define dct64_altivec INT123_dct64_altivec
+#define dct64_i486 INT123_dct64_i486
+#define dct36 INT123_dct36
+#define dct36_3dnow INT123_dct36_3dnow
+#define dct36_3dnowext INT123_dct36_3dnowext
+#define dct36_x86_64 INT123_dct36_x86_64
+#define dct36_sse INT123_dct36_sse
+#define dct36_avx INT123_dct36_avx
+#define dct36_neon INT123_dct36_neon
+#define dct36_neon64 INT123_dct36_neon64
+#define synth_ntom_set_step INT123_synth_ntom_set_step
+#define ntom_val INT123_ntom_val
+#define ntom_frame_outsamples INT123_ntom_frame_outsamples
+#define ntom_frmouts INT123_ntom_frmouts
+#define ntom_ins2outs INT123_ntom_ins2outs
+#define ntom_frameoff INT123_ntom_frameoff
+#define init_layer3 INT123_init_layer3
+#define init_layer3_gainpow2 INT123_init_layer3_gainpow2
+#define init_layer3_stuff INT123_init_layer3_stuff
+#define init_layer12 INT123_init_layer12
+#define init_layer12_table INT123_init_layer12_table
+#define init_layer12_stuff INT123_init_layer12_stuff
+#define init_costabs INT123_init_costabs
+#define make_decode_tables INT123_make_decode_tables
+#define make_decode_tables_mmx INT123_make_decode_tables_mmx
+#define init_layer3_gainpow2_mmx INT123_init_layer3_gainpow2_mmx
+#define init_layer12_table_mmx INT123_init_layer12_table_mmx
+#define make_conv16to8_table INT123_make_conv16to8_table
+#define do_layer3 INT123_do_layer3
+#define do_layer2 INT123_do_layer2
+#define do_layer1 INT123_do_layer1
+#define do_equalizer INT123_do_equalizer
+#define dither_table_init INT123_dither_table_init
+#define frame_dither_init INT123_frame_dither_init
+#define invalidate_format INT123_invalidate_format
+#define frame_init INT123_frame_init
+#define frame_init_par INT123_frame_init_par
+#define frame_outbuffer INT123_frame_outbuffer
+#define frame_output_format INT123_frame_output_format
+#define frame_buffers INT123_frame_buffers
+#define frame_reset INT123_frame_reset
+#define frame_buffers_reset INT123_frame_buffers_reset
+#define frame_exit INT123_frame_exit
+#define frame_index_find INT123_frame_index_find
+#define frame_index_setup INT123_frame_index_setup
+#define do_volume INT123_do_volume
+#define do_rva INT123_do_rva
+#define frame_gapless_init INT123_frame_gapless_init
+#define frame_gapless_realinit INT123_frame_gapless_realinit
+#define frame_gapless_update INT123_frame_gapless_update
+#define frame_gapless_bytify INT123_frame_gapless_bytify
+#define frame_gapless_ignore INT123_frame_gapless_ignore
+#define frame_expect_outsamples INT123_frame_expect_outsamples
+#define frame_skip INT123_frame_skip
+#define frame_ins2outs INT123_frame_ins2outs
+#define frame_outs INT123_frame_outs
+#define frame_expect_outsampels INT123_frame_expect_outsampels
+#define frame_offset INT123_frame_offset
+#define frame_set_frameseek INT123_frame_set_frameseek
+#define frame_set_seek INT123_frame_set_seek
+#define frame_tell_seek INT123_frame_tell_seek
+#define frame_fill_toc INT123_frame_fill_toc
+#define getcpuflags INT123_getcpuflags
+#define icy2utf8 INT123_icy2utf8
+#define init_icy INT123_init_icy
+#define clear_icy INT123_clear_icy
+#define reset_icy INT123_reset_icy
+#define init_id3 INT123_init_id3
+#define exit_id3 INT123_exit_id3
+#define reset_id3 INT123_reset_id3
+#define id3_link INT123_id3_link
+#define parse_new_id3 INT123_parse_new_id3
+#define id3_to_utf8 INT123_id3_to_utf8
+#define fi_init INT123_fi_init
+#define fi_exit INT123_fi_exit
+#define fi_resize INT123_fi_resize
+#define fi_add INT123_fi_add
+#define fi_set INT123_fi_set
+#define fi_reset INT123_fi_reset
+#define decode_update INT123_decode_update
+#define decoder_synth_bytes INT123_decoder_synth_bytes
+#define samples_to_bytes INT123_samples_to_bytes
+#define bytes_to_samples INT123_bytes_to_samples
+#define outblock_bytes INT123_outblock_bytes
+#define postprocess_buffer INT123_postprocess_buffer
+#define open_fixed_pre INT123_open_fixed_pre
+#define open_fixed_post INT123_open_fixed_post
+#define frame_cpu_opt INT123_frame_cpu_opt
+#define set_synth_functions INT123_set_synth_functions
+#define dectype INT123_dectype
+#define defdec INT123_defdec
+#define decclass INT123_decclass
+#define read_frame_init INT123_read_frame_init
+#define frame_bitrate INT123_frame_bitrate
+#define frame_freq INT123_frame_freq
+#define read_frame_recover INT123_read_frame_recover
+#define read_frame INT123_read_frame
+#define set_pointer INT123_set_pointer
+#define position_info INT123_position_info
+#define compute_bpf INT123_compute_bpf
+#define time_to_frame INT123_time_to_frame
+#define get_songlen INT123_get_songlen
+#define bc_prepare INT123_bc_prepare
+#define bc_cleanup INT123_bc_cleanup
+#define bc_poolsize INT123_bc_poolsize
+#define bc_fill INT123_bc_fill
+#define open_stream INT123_open_stream
+#define open_stream_handle INT123_open_stream_handle
+#define open_feed INT123_open_feed
+#define feed_more INT123_feed_more
+#define feed_forget INT123_feed_forget
+#define feed_set_pos INT123_feed_set_pos
+#define open_bad INT123_open_bad
+#define open_module INT123_open_module
+#define close_module INT123_close_module
+#define list_modules INT123_list_modules
+#define buffer_init INT123_buffer_init
+#define buffer_exit INT123_buffer_exit
+#define buffer_sync_param INT123_buffer_sync_param
+#define buffer_open INT123_buffer_open
+#define buffer_encodings INT123_buffer_encodings
+#define buffer_formats INT123_buffer_formats
+#define buffer_start INT123_buffer_start
+#define buffer_ndrain INT123_buffer_ndrain
+#define buffer_stop INT123_buffer_stop
+#define buffer_close INT123_buffer_close
+#define buffer_continue INT123_buffer_continue
+#define buffer_ignore_lowmem INT123_buffer_ignore_lowmem
+#define buffer_drain INT123_buffer_drain
+#define buffer_end INT123_buffer_end
+#define buffer_pause INT123_buffer_pause
+#define buffer_drop INT123_buffer_drop
+#define buffer_write INT123_buffer_write
+#define buffer_fill INT123_buffer_fill
+#define read_buf INT123_read_buf
+#define xfer_write_string INT123_xfer_write_string
+#define xfer_read_string INT123_xfer_read_string
+#define xfermem_init INT123_xfermem_init
+#define xfermem_init_writer INT123_xfermem_init_writer
+#define xfermem_init_reader INT123_xfermem_init_reader
+#define xfermem_get_freespace INT123_xfermem_get_freespace
+#define xfermem_get_usedspace INT123_xfermem_get_usedspace
+#define xfermem_getcmd INT123_xfermem_getcmd
+#define xfermem_getcmds INT123_xfermem_getcmds
+#define xfermem_putcmd INT123_xfermem_putcmd
+#define xfermem_writer_block INT123_xfermem_writer_block
+#define xfermem_write INT123_xfermem_write
+#define xfermem_done INT123_xfermem_done
+#define au_open INT123_au_open
+#define cdr_open INT123_cdr_open
+#define raw_open INT123_raw_open
+#define wav_open INT123_wav_open
+#define wav_write INT123_wav_write
+#define wav_close INT123_wav_close
+#define au_close INT123_au_close
+#define raw_close INT123_raw_close
+#define cdr_formats INT123_cdr_formats
+#define au_formats INT123_au_formats
+#define raw_formats INT123_raw_formats
+#define wav_formats INT123_wav_formats
+#define wav_drain INT123_wav_drain
+#define write_parameters INT123_write_parameters
+#define read_parameters INT123_read_parameters
+#define stringlists_add INT123_stringlists_add
+#define check_neon INT123_check_neon
+#define dct64_3dnow INT123_dct64_3dnow
+#define dct64_3dnowext INT123_dct64_3dnowext
+#define dct64_avx INT123_dct64_avx
+#define dct64_real_avx INT123_dct64_real_avx
+#define dct64_mmx INT123_dct64_mmx
+#define dct64_MMX INT123_dct64_MMX
+#define dct64_neon INT123_dct64_neon
+#define dct64_neon64 INT123_dct64_neon64
+#define dct64_real_neon64 INT123_dct64_real_neon64
+#define dct64_real_neon INT123_dct64_real_neon
+#define dct64_sse INT123_dct64_sse
+#define dct64_real_sse INT123_dct64_real_sse
+#define dct64_x86_64 INT123_dct64_x86_64
+#define dct64_real_x86_64 INT123_dct64_real_x86_64
+#define do_equalizer_3dnow INT123_do_equalizer_3dnow
+#define synth_1to1_3dnow_asm INT123_synth_1to1_3dnow_asm
+#define synth_1to1_arm_asm INT123_synth_1to1_arm_asm
+#define synth_1to1_arm_accurate_asm INT123_synth_1to1_arm_accurate_asm
+#define synth_1to1_i586_asm INT123_synth_1to1_i586_asm
+#define synth_1to1_i586_asm_dither INT123_synth_1to1_i586_asm_dither
+#define synth_1to1_MMX INT123_synth_1to1_MMX
+#define synth_1to1_neon_asm INT123_synth_1to1_neon_asm
+#define synth_1to1_neon64_asm INT123_synth_1to1_neon64_asm
+#define synth_1to1_neon64_accurate_asm INT123_synth_1to1_neon64_accurate_asm
+#define synth_1to1_real_neon64_asm INT123_synth_1to1_real_neon64_asm
+#define synth_1to1_s32_neon64_asm INT123_synth_1to1_s32_neon64_asm
+#define synth_1to1_neon_accurate_asm INT123_synth_1to1_neon_accurate_asm
+#define synth_1to1_real_neon_asm INT123_synth_1to1_real_neon_asm
+#define synth_1to1_s32_neon_asm INT123_synth_1to1_s32_neon_asm
+#define synth_1to1_sse_accurate_asm INT123_synth_1to1_sse_accurate_asm
+#define synth_1to1_real_sse_asm INT123_synth_1to1_real_sse_asm
+#define synth_1to1_s32_sse_asm INT123_synth_1to1_s32_sse_asm
+#define synth_1to1_s_avx_asm INT123_synth_1to1_s_avx_asm
+#define synth_1to1_s_avx_accurate_asm INT123_synth_1to1_s_avx_accurate_asm
+#define synth_1to1_real_s_avx_asm INT123_synth_1to1_real_s_avx_asm
+#define synth_1to1_s32_s_avx_asm INT123_synth_1to1_s32_s_avx_asm
+#define synth_1to1_s_neon_asm INT123_synth_1to1_s_neon_asm
+#define synth_1to1_s_neon64_asm INT123_synth_1to1_s_neon64_asm
+#define synth_1to1_s_neon64_accurate_asm INT123_synth_1to1_s_neon64_accurate_asm
+#define synth_1to1_real_s_neon64_asm INT123_synth_1to1_real_s_neon64_asm
+#define synth_1to1_s32_s_neon64_asm INT123_synth_1to1_s32_s_neon64_asm
+#define synth_1to1_s_neon_accurate_asm INT123_synth_1to1_s_neon_accurate_asm
+#define synth_1to1_real_s_neon_asm INT123_synth_1to1_real_s_neon_asm
+#define synth_1to1_s32_s_neon_asm INT123_synth_1to1_s32_s_neon_asm
+#define synth_1to1_s_sse_accurate_asm INT123_synth_1to1_s_sse_accurate_asm
+#define synth_1to1_real_s_sse_asm INT123_synth_1to1_real_s_sse_asm
+#define synth_1to1_s32_s_sse_asm INT123_synth_1to1_s32_s_sse_asm
+#define synth_1to1_s_x86_64_asm INT123_synth_1to1_s_x86_64_asm
+#define synth_1to1_s_x86_64_accurate_asm INT123_synth_1to1_s_x86_64_accurate_asm
+#define synth_1to1_real_s_x86_64_asm INT123_synth_1to1_real_s_x86_64_asm
+#define synth_1to1_s32_s_x86_64_asm INT123_synth_1to1_s32_s_x86_64_asm
+#define synth_1to1_x86_64_asm INT123_synth_1to1_x86_64_asm
+#define synth_1to1_x86_64_accurate_asm INT123_synth_1to1_x86_64_accurate_asm
+#define synth_1to1_real_x86_64_asm INT123_synth_1to1_real_x86_64_asm
+#define synth_1to1_s32_x86_64_asm INT123_synth_1to1_s32_x86_64_asm
+#define costab_mmxsse INT123_costab_mmxsse
+#define make_decode_tables_mmx_asm INT123_make_decode_tables_mmx_asm
+#ifndef HAVE_STRERROR
+#define strerror INT123_strerror
+#endif
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/abi_align.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/abi_align.h
new file mode 100644
index 00000000..9ae46f42
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/abi_align.h
@@ -0,0 +1,41 @@
+/*
+ abi_align: An attempt to avoid breakage because of mixing
+ compilers with different alignment.
+
+ copyright 1995-2015 by the mpg123 project
+ free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+
+ There used to be code that checks alignment, but it did not really
+ work anyway. The only straw we have is putting that alignment
+ attribute to API functions.
+*/
+
+#ifndef MPG123_H_ABI_ALIGN
+#define MPG123_H_ABI_ALIGN
+
+#include "config.h"
+
+/* ABI conformance for other compilers.
+ mpg123 needs 16byte-aligned (or more) stack for SSE and friends.
+ gcc provides that, but others don't necessarily. */
+#ifdef ABI_ALIGN_FUN
+
+#ifndef attribute_align_arg
+
+#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__>1)
+# define attribute_align_arg __attribute__((force_align_arg_pointer))
+/* The gcc that can align the stack does not need the check... nor does it work with gcc 4.3+, anyway. */
+#else
+# define attribute_align_arg
+#endif
+
+#endif /* attribute_align_arg */
+
+#else /* ABI_ALIGN_FUN */
+
+#define attribute_align_arg
+
+#endif /* ABI_ALIGN_FUN */
+
+#endif /* MPG123_H_ABI_ALIGN */
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/calctables.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/calctables.c
new file mode 100644
index 00000000..da156961
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/calctables.c
@@ -0,0 +1,399 @@
+/*
+ calctables: compute fixed decoder table values
+
+ copyright ?-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp (as tabinit.c, and parts of layer2.c and layer3.c),
+ then printout added by Thomas Orgis
+
+ This is supposed to compute the supposedly fixed tables that used to be computed
+ live on library startup in mpg123_init().
+*/
+
+#define CALCTABLES
+#include "mpg123lib_intern.h"
+#include "debug.h"
+
+#define ASIZE(a) (sizeof(a)/sizeof(*a))
+
+// The variable definitions here are redundant with the runtime part of
+// the init_* headers, but that is fine, as those headers are generated
+// by this very program.
+
+static double cos64[16],cos32[8],cos16[4],cos8[2],cos4[1];
+#include "init_costabs.h"
+
+// layer I+II tables
+static double layer12_table[27][64];
+
+// Storing only values 0 to 26, so char is fine.
+// The size of those might be reduced ...
+static unsigned char grp_3tab[32 * 3] = { 0, }; /* used: 27 */
+static unsigned char grp_5tab[128 * 3] = { 0, }; /* used: 125 */
+static unsigned char grp_9tab[1024 * 3] = { 0, }; /* used: 729 */
+
+#include "init_layer12.h"
+
+// layer III
+
+static double ispow[8207]; // scale with SCALE_POW43
+static double aa_ca[8],aa_cs[8];
+static double win[4][36];
+static double win1[4][36];
+double COS9[9]; /* dct36_3dnow wants to use that */
+static double COS6_1,COS6_2;
+double tfcos36[9]; /* dct36_3dnow wants to use that */
+static double tfcos12[3];
+static double cos9[3],cos18[3];
+
+// scale with SCALE_15
+static double tan1_1[16],tan2_1[16],tan1_2[16],tan2_2[16];
+// This used to be [2][32] initially, but already Taihei noticed that
+// _apparently_ only [2][16] is used for the integer tables. But
+// this is misleading: Accesses beyond that happen, at least in pathologic
+// cases. Taihei's fixed-point decoding introduced read-only buffer
+// overflows:-/ Those are rather harmless, though, as only bad numbers
+// enter calculation. Nothing about pointers or code.
+static double pow1_1[2][32],pow2_1[2][32],pow1_2[2][32],pow2_2[2][32];
+
+
+// That needs special handling for storing the pointers
+// in map and mapend.
+// map[j][N] = mapbufN[j];
+// mapend[j][N] = ... varies let's use
+// mapbufN[j]+(mapend[j][N]-map[j][N])
+static short mapbuf0[9][152];
+static short mapbuf1[9][156];
+static short mapbuf2[9][44];
+static short *map[9][3];
+static short *mapend[9][3];
+
+static unsigned short n_slen2[512]; /* MPEG 2.0 slen for 'normal' mode */
+static unsigned short i_slen2[256]; /* MPEG 2.0 slen for intensity stereo */
+
+static real gainpow2[256+118+4];
+
+#include "l3bandgain.h"
+#include "init_layer3.h"
+
+// helpers
+
+static void print_char_array( const char *indent, const char *name
+, size_t count, unsigned char tab[], int calc )
+{
+ if(calc)
+ {
+ if(name)
+ printf("static unsigned char %s[%zu];\n", name, count);
+ return;
+ }
+ size_t block = 72/4;
+ size_t i = 0;
+ if(name)
+ printf("static const unsigned char %s[%zu] = \n", name, count);
+ printf("%s{\n", indent);
+ while(i<count)
+ {
+ size_t line = block > count-i ? count-i : block;
+ printf("%s", indent);
+ for(size_t j=0; j<line; ++j, ++i)
+ printf("%s%c%3u", i ? "," : "", j ? ' ' : '\t', tab[i]);
+ printf("\n");
+ }
+ printf("%s}%s\n", indent, name ? ";" : "");
+}
+
+static void print_value( int fixed, double fixed_scale
+, const char *name, double val, int calc )
+{
+ if(calc)
+ {
+ if(name)
+ printf("static real %s;\n", name);
+ return;
+ }
+ if(name)
+ printf("static const real %s = ", name);
+ if(fixed)
+ printf("%ld;\n", (long)(DOUBLE_TO_REAL(fixed_scale*val)));
+ else
+ printf("%15.8e;\n", val);
+}
+
+// I feal uneasy about inf appearing as literal.
+// Do all C99 implementations support it the same?
+// An unreasonably big value should also just work.
+static double limit_val(double val)
+{
+ if(val > 1e38)
+ return 1e38;
+ if(val < -1e38)
+ return -1e38;
+ return val;
+}
+
+static void print_array( int statick, int fixed, double fixed_scale
+, const char *indent, const char *name
+, size_t count, double tab[], int calc )
+{
+ if(calc)
+ {
+ if(!fixed && name)
+ printf( "%sALIGNED(16) real %s[%zu];\n"
+ , statick ? "static " : "", name, count );
+ return;
+ }
+ size_t block = 72/17;
+ size_t i = 0;
+ if(name)
+ printf( "%sconst%s real %s[%zu] = \n", statick ? "static " : ""
+ , fixed ? "" : " ALIGNED(16)", name, count );
+ printf("%s{\n", indent);
+ while(i<count)
+ {
+ size_t line = block > count-i ? count-i : block;
+ printf("%s", indent);
+ if(fixed) for(size_t j=0; j<line; ++j, ++i)
+ printf( "%s%c%11ld", i ? "," : "", j ? ' ' : '\t'
+ , (long)(DOUBLE_TO_REAL(fixed_scale*tab[i])) );
+ else for(size_t j=0; j<line; ++j, ++i)
+ printf("%s%c%15.8e", i ? "," : "", j ? ' ' : '\t', limit_val(tab[i]));
+ printf("\n");
+ }
+ printf("%s}%s\n", indent, name ? ";" : "");
+}
+
+// C99 allows passing VLA with the fast dimensions first.
+static void print_array2d( int fixed, double fixed_scale
+, const char *name, size_t x, size_t y
+, double tab[][y], int calc )
+{
+ if(calc)
+ {
+ if(!fixed)
+ printf("static ALIGNED(16) real %s[%zu][%zu];\n", name, x, y);
+ return;
+ }
+ printf( "static const%s real %s[%zu][%zu] = \n{\n", fixed ? "" : " ALIGNED(16)"
+ , name, x, y );
+ for(size_t i=0; i<x; ++i)
+ {
+ if(i)
+ printf(",");
+ print_array(1, fixed, fixed_scale, "\t", NULL, y, tab[i], calc);
+ }
+ printf("};\n");
+}
+
+static void print_short_array( const char *indent, const char *name
+, size_t count, short tab[], int calc )
+{
+ if(calc)
+ {
+ if(name)
+ printf("static short %s[%zu];\n", name, count);
+ return;
+ }
+ size_t block = 72/8;
+ size_t i = 0;
+ if(name)
+ printf("static const short %s[%zu] = \n", name, count);
+ printf("%s{\n", indent);
+ while(i<count)
+ {
+ size_t line = block > count-i ? count-i : block;
+ printf("%s", indent);
+ for(size_t j=0; j<line; ++j, ++i)
+ printf("%s%c%6d", i ? "," : "", j ? ' ' : '\t', tab[i]);
+ printf("\n");
+ }
+ printf("%s}%s\n", indent, name ? ";" : "");
+}
+
+static void print_fixed_array( const char *indent, const char *name
+, size_t count, real tab[] )
+{
+ size_t block = 72/13;
+ size_t i = 0;
+ if(name)
+ printf("static const real %s[%zu] = \n", name, count);
+ printf("%s{\n", indent);
+ while(i<count)
+ {
+ size_t line = block > count-i ? count-i : block;
+ printf("%s", indent);
+ for(size_t j=0; j<line; ++j, ++i)
+ printf("%s%c%11ld", i ? "," : "", j ? ' ' : '\t', (long)tab[i]);
+ printf("\n");
+ }
+ printf("%s}%s\n", indent, name ? ";" : "");
+}
+
+static void print_ushort_array( const char *indent, const char *name
+, size_t count, unsigned short tab[], int calc )
+{
+ if(calc)
+ {
+ if(name)
+ printf("static unsigned short %s[%zu];\n", name, count);
+ return;
+ }
+ size_t block = 72/8;
+ size_t i = 0;
+ if(name)
+ printf("static const unsigned short %s[%zu] =\n", name, count);
+ printf("%s{\n", indent);
+ while(i<count)
+ {
+ size_t line = block > count-i ? count-i : block;
+ printf("%s", indent);
+ for(size_t j=0; j<line; ++j, ++i)
+ printf("%s%c%8u", i ? "," : "", j ? ' ' : '\t', tab[i]);
+ printf("\n");
+ }
+ printf("%s}%s\n", indent, name ? ";" : "");
+}
+
+// C99 allows passing VLA with the fast dimensions first.
+static void print_short_array2d( const char *name, size_t x, size_t y
+, short tab[][y], int calc )
+{
+ if(calc)
+ {
+ printf("static short %s[%zu][%zu];\n", name, x, y);
+ return;
+ }
+ printf( "static const short %s[%zu][%zu] =\n{\n"
+ , name, x, y );
+ for(size_t i=0; i<x; ++i)
+ {
+ if(i)
+ printf(",");
+ print_short_array("\t", NULL, y, tab[i], calc);
+ }
+ printf("};\n");
+}
+
+void printer(int calc, char *arg)
+{
+ // No fixed point output for run-time calculation.
+ for(int fixed=0; fixed < (calc ? 1 : 2); ++fixed)
+ {
+ printf("\n#ifdef %s\n\n", fixed ? "REAL_IS_FIXED" : "REAL_IS_FLOAT");
+ if(!fixed)
+ printf("// aligned to 16 bytes for vector instructions, e.g. AltiVec\n\n");
+ if(!strcmp("cos", arg))
+ {
+ print_array(1, fixed, 1., "", "cos64", ASIZE(cos64), cos64, calc);
+ print_array(1, fixed, 1., "", "cos32", ASIZE(cos32), cos32, calc);
+ print_array(1, fixed, 1., "", "cos16", ASIZE(cos16), cos16, calc);
+ print_array(1, fixed, 1., "", "cos8", ASIZE(cos8), cos8, calc);
+ print_array(1, fixed, 1., "", "cos4", ASIZE(cos4), cos4, calc);
+ }
+ if(!strcmp("l12", arg))
+ {
+ print_array2d( fixed, SCALE_LAYER12/REAL_FACTOR, "layer12_table"
+ , 27, 64, layer12_table, calc );
+ }
+ if(!strcmp("l3", arg))
+ {
+ print_array( 1, fixed, SCALE_POW43/REAL_FACTOR, "", "ispow"
+ , sizeof(ispow)/sizeof(*ispow), ispow, calc );
+ print_array(1, fixed, 1., "", "aa_ca", ASIZE(aa_ca), aa_ca, calc);
+ print_array(1, fixed, 1., "", "aa_cs", ASIZE(aa_cs), aa_cs, calc);
+ print_array2d(fixed, 1., "win", 4, 36, win, calc);
+ print_array2d(fixed, 1., "win1", 4, 36, win1, calc);
+ print_array(0, fixed, 1., "", "COS9", ASIZE(COS9), COS9, calc);
+ print_value(fixed, 1., "COS6_1", COS6_1, calc);
+ print_value(fixed, 1., "COS6_2", COS6_2, calc);
+ print_array(0, fixed, 1., "", "tfcos36", ASIZE(tfcos36), tfcos36, calc);
+ print_array(1, fixed, 1., "", "tfcos12", ASIZE(tfcos12), tfcos12, calc);
+ print_array(1, fixed, 1., "", "cos9", ASIZE(cos9), cos9, calc);
+ print_array(1, fixed, 1., "", "cos18", ASIZE(cos18), cos18, calc);
+ print_array( 1, fixed, SCALE_15/REAL_FACTOR, ""
+ , "tan1_1", ASIZE(tan1_1), tan1_1, calc );
+ print_array( 1, fixed, SCALE_15/REAL_FACTOR, ""
+ , "tan2_1", ASIZE(tan2_1), tan2_1, calc );
+ print_array( 1, fixed, SCALE_15/REAL_FACTOR, ""
+ , "tan1_2", ASIZE(tan1_2), tan1_2, calc );
+ print_array( 1, fixed, SCALE_15/REAL_FACTOR, ""
+ , "tan2_2", ASIZE(tan2_2), tan2_2, calc );
+ print_array2d( fixed, SCALE_15/REAL_FACTOR
+ , "pow1_1", 2, 32, pow1_1, calc );
+ print_array2d( fixed, SCALE_15/REAL_FACTOR
+ , "pow2_1", 2, 32, pow2_1, calc );
+ print_array2d( fixed, SCALE_15/REAL_FACTOR
+ , "pow1_2", 2, 32, pow1_2, calc );
+ print_array2d( fixed, SCALE_15/REAL_FACTOR
+ , "pow2_2", 2, 32, pow2_2, calc );
+ if(fixed)
+ print_fixed_array("", "gainpow2", ASIZE(gainpow2), gainpow2);
+ }
+ printf("\n#endif\n");
+ }
+ if(!strcmp("l12", arg))
+ {
+ printf("\n");
+ print_char_array("", "grp_3tab", ASIZE(grp_3tab), grp_3tab, calc);
+ printf("\n");
+ print_char_array("", "grp_5tab", ASIZE(grp_5tab), grp_5tab, calc);
+ printf("\n");
+ print_char_array("", "grp_9tab", ASIZE(grp_9tab), grp_9tab, calc);
+ }
+ if(!strcmp("l3", arg))
+ {
+ printf("\n");
+ print_short_array2d("mapbuf0", 9, 152, mapbuf0, calc);
+ print_short_array2d("mapbuf1", 9, 156, mapbuf1, calc);
+ print_short_array2d("mapbuf2", 9, 44, mapbuf2, calc);
+ if(calc)
+ {
+ printf("static short *map[9][3];\n");
+ printf("static short *mapend[9][3];\n");
+ }
+ else
+ {
+ printf("static const short *map[9][3] =\n{\n");
+ for(int i=0; i<9; ++i)
+ printf( "%s\t{ mapbuf0[%d], mapbuf1[%d], mapbuf2[%d] }\n"
+ , (i ? "," : ""), i, i, i );
+ printf("};\n");
+ printf("static const short *mapend[9][3] =\n{\n");
+ for(int i=0; i<9; ++i)
+ printf( "%s\t{ mapbuf0[%d]+%d, mapbuf1[%d]+%d, mapbuf2[%d]+%d }\n"
+ , (i ? "," : "")
+ , i, (int)(mapend[i][0]-map[i][0])
+ , i, (int)(mapend[i][1]-map[i][1])
+ , i, (int)(mapend[i][2]-map[i][2]) );
+ printf("};\n");
+ }
+ print_ushort_array("", "n_slen2", ASIZE(n_slen2), n_slen2, calc);
+ print_ushort_array("", "i_slen2", ASIZE(i_slen2), i_slen2, calc);
+ }
+}
+
+int main(int argc, char **argv)
+{
+ if(argc != 2)
+ {
+ fprintf(stderr, "usage:\n\t%s <cos|l12|l3>\n\n", argv[0]);
+ return 1;
+ }
+ printf("// %s MPEG decoding tables\n", argv[1]);
+ printf("// output of:\n// %s", argv[0]);
+ for(int i=1; i<argc; ++i)
+ printf(" %s", argv[i]);
+ printf("\n");
+
+ init_costabs();
+ init_layer12();
+ init_layer3();
+
+ printf("\n#if defined(RUNTIME_TABLES)\n");
+ printer(1, argv[1]);
+ printf("\n#else\n");
+ printer(0, argv[1]);
+ printf("\n#endif\n");
+
+ return 0;
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/check_neon.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/check_neon.S
new file mode 100644
index 00000000..7c769049
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/check_neon.S
@@ -0,0 +1,35 @@
+/*
+ check_neon: check NEON availability
+
+ copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Momma
+*/
+
+#include "mangle.h"
+
+#ifndef __aarch64__
+#ifndef _M_ARM
+ .code 32
+#endif
+#ifndef __APPLE__
+ .fpu neon
+#endif
+#endif
+
+ .text
+ GLOBAL_SYMBOL ASM_NAME(check_neon)
+#ifdef __ELF__
+ .type ASM_NAME(check_neon), %function
+#endif
+ ALIGN4
+ASM_NAME(check_neon):
+#ifdef __aarch64__
+ orr v0.16b, v0.16b, v0.16b
+ ret
+#else
+ vorr d0, d0, d0
+ bx lr
+#endif
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/costabs.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/costabs.h
new file mode 100644
index 00000000..38d0ef89
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/costabs.h
@@ -0,0 +1,81 @@
+// cos MPEG decoding tables
+// output of:
+// src/libmpg123/calctables cos
+
+#if defined(RUNTIME_TABLES)
+
+#ifdef REAL_IS_FLOAT
+
+// aligned to 16 bytes for vector instructions, e.g. AltiVec
+
+static ALIGNED(16) real cos64[16];
+static ALIGNED(16) real cos32[8];
+static ALIGNED(16) real cos16[4];
+static ALIGNED(16) real cos8[2];
+static ALIGNED(16) real cos4[1];
+
+#endif
+
+#else
+
+#ifdef REAL_IS_FLOAT
+
+// aligned to 16 bytes for vector instructions, e.g. AltiVec
+
+static const ALIGNED(16) real cos64[16] =
+{
+ 5.00602998e-01, 5.05470960e-01, 5.15447310e-01, 5.31042591e-01
+, 5.53103896e-01, 5.82934968e-01, 6.22504123e-01, 6.74808341e-01
+, 7.44536271e-01, 8.39349645e-01, 9.72568238e-01, 1.16943993e+00
+, 1.48416462e+00, 2.05778101e+00, 3.40760842e+00, 1.01900081e+01
+};
+static const ALIGNED(16) real cos32[8] =
+{
+ 5.02419286e-01, 5.22498615e-01, 5.66944035e-01, 6.46821783e-01
+, 7.88154623e-01, 1.06067769e+00, 1.72244710e+00, 5.10114862e+00
+};
+static const ALIGNED(16) real cos16[4] =
+{
+ 5.09795579e-01, 6.01344887e-01, 8.99976223e-01, 2.56291545e+00
+};
+static const ALIGNED(16) real cos8[2] =
+{
+ 5.41196100e-01, 1.30656296e+00
+};
+static const ALIGNED(16) real cos4[1] =
+{
+ 7.07106781e-01
+};
+
+#endif
+
+#ifdef REAL_IS_FIXED
+
+static const real cos64[16] =
+{
+ 8398725, 8480395, 8647771, 8909416
+, 9279544, 9780026, 10443886, 11321405
+, 12491246, 14081950, 16316987, 19619946
+, 24900150, 34523836, 57170182, 170959967
+};
+static const real cos32[8] =
+{
+ 8429197, 8766072, 9511743, 10851869
+, 13223040, 17795219, 28897867, 85583072
+};
+static const real cos16[4] =
+{
+ 8552951, 10088893, 15099095, 42998586
+};
+static const real cos8[2] =
+{
+ 9079764, 21920489
+};
+static const real cos4[1] =
+{
+ 11863283
+};
+
+#endif
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_3dnow.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_3dnow.S
new file mode 100644
index 00000000..2d45dc0a
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_3dnow.S
@@ -0,0 +1,560 @@
+/*
+ dct64_3dnow.s: Replacement of dct36() with AMD's 3DNow! SIMD operations support
+
+ copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Syuuhei Kashiyama
+
+ This code based 'dct36_3dnow.s' by Syuuhei Kashiyama
+ <squash@mb.kcom.ne.jp>,only two types of changes have been made:
+
+ - remove PREFETCH instruction for speedup
+ - change function name for support 3DNow! automatic detect
+
+ You can find Kashiyama's original 3dnow! support patch
+ (for mpg123-0.59o) at
+ http://user.ecc.u-tokyo.ac.jp/~g810370/linux-simd/ (Japanese).
+
+ by KIMURA Takuhiro <kim@hannah.ipc.miyakyo-u.ac.jp> - until 31.Mar.1999
+ <kim@comtec.co.jp> - after 1.Apr.1999
+
+ Replacement of dct36() with AMD's 3DNow! SIMD operations support
+
+ Syuuhei Kashiyama <squash@mb.kcom.ne.jp>
+
+ The author of this program disclaim whole expressed or implied
+ warranties with regard to this program, and in no event shall the
+ author of this program liable to whatever resulted from the use of
+ this program. Use it at your own risk.
+*/
+
+#include "mangle.h"
+
+ .globl ASM_NAME(dct36_3dnow)
+/* .type ASM_NAME(dct36_3dnow),@function */
+ASM_NAME(dct36_3dnow):
+ pushl %ebp
+ movl %esp,%ebp
+#if defined(PIC) && defined(__APPLE__)
+ sub $4,%esp
+#endif
+ pushl %esi
+ pushl %ebx
+
+ #undef _EBX_
+ #define _EBX_ %edi
+ PREPARE_GOT
+ GET_GOT
+#if defined(PIC) && defined(__APPLE__)
+ #define _COS9_ 0(%edi)
+ #define _tfcos36_ 0(%eax)
+ mov GLOBAL_VAR_PTR(tfcos36), %eax
+ mov GLOBAL_VAR_PTR(COS9), %edi
+ mov %eax, -4(%ebp)
+#else
+ #define _COS9_ GLOBAL_VAR(COS9)
+ #define _tfcos36_ GLOBAL_VAR(tfcos36)
+#endif
+
+ movl 8(%ebp),%eax
+ movl 12(%ebp),%esi
+ movl 16(%ebp),%ecx
+ movl 20(%ebp),%edx
+ movl 24(%ebp),%ebx
+
+ femms
+ movq (%eax),%mm0
+ movq 4(%eax),%mm1
+ pfadd %mm1,%mm0
+ movq %mm0,4(%eax)
+ psrlq $32,%mm1
+ movq 12(%eax),%mm2
+ punpckldq %mm2,%mm1
+ pfadd %mm2,%mm1
+ movq %mm1,12(%eax)
+ psrlq $32,%mm2
+ movq 20(%eax),%mm3
+ punpckldq %mm3,%mm2
+ pfadd %mm3,%mm2
+ movq %mm2,20(%eax)
+ psrlq $32,%mm3
+ movq 28(%eax),%mm4
+ punpckldq %mm4,%mm3
+ pfadd %mm4,%mm3
+ movq %mm3,28(%eax)
+ psrlq $32,%mm4
+ movq 36(%eax),%mm5
+ punpckldq %mm5,%mm4
+ pfadd %mm5,%mm4
+ movq %mm4,36(%eax)
+ psrlq $32,%mm5
+ movq 44(%eax),%mm6
+ punpckldq %mm6,%mm5
+ pfadd %mm6,%mm5
+ movq %mm5,44(%eax)
+ psrlq $32,%mm6
+ movq 52(%eax),%mm7
+ punpckldq %mm7,%mm6
+ pfadd %mm7,%mm6
+ movq %mm6,52(%eax)
+ psrlq $32,%mm7
+ movq 60(%eax),%mm0
+ punpckldq %mm0,%mm7
+ pfadd %mm0,%mm7
+ movq %mm7,60(%eax)
+ psrlq $32,%mm0
+ movd 68(%eax),%mm1
+ pfadd %mm1,%mm0
+ movd %mm0,68(%eax)
+ movd 4(%eax),%mm0
+ movd 12(%eax),%mm1
+ punpckldq %mm1,%mm0
+ punpckldq 20(%eax),%mm1
+ pfadd %mm1,%mm0
+ movd %mm0,12(%eax)
+ psrlq $32,%mm0
+ movd %mm0,20(%eax)
+ psrlq $32,%mm1
+ movd 28(%eax),%mm2
+ punpckldq %mm2,%mm1
+ punpckldq 36(%eax),%mm2
+ pfadd %mm2,%mm1
+ movd %mm1,28(%eax)
+ psrlq $32,%mm1
+ movd %mm1,36(%eax)
+ psrlq $32,%mm2
+ movd 44(%eax),%mm3
+ punpckldq %mm3,%mm2
+ punpckldq 52(%eax),%mm3
+ pfadd %mm3,%mm2
+ movd %mm2,44(%eax)
+ psrlq $32,%mm2
+ movd %mm2,52(%eax)
+ psrlq $32,%mm3
+ movd 60(%eax),%mm4
+ punpckldq %mm4,%mm3
+ punpckldq 68(%eax),%mm4
+ pfadd %mm4,%mm3
+ movd %mm3,60(%eax)
+ psrlq $32,%mm3
+ movd %mm3,68(%eax)
+
+ movq 24(%eax),%mm0
+ movq 48(%eax),%mm1
+ movd 12+_COS9_,%mm2
+ punpckldq %mm2,%mm2
+ movd 24+_COS9_,%mm3
+ punpckldq %mm3,%mm3
+ pfmul %mm2,%mm0
+ pfmul %mm3,%mm1
+ pushl %eax
+ movl $1,%eax
+ movd %eax,%mm7
+ pi2fd %mm7,%mm7
+ popl %eax
+ movq 8(%eax),%mm2
+ movd 4+_COS9_,%mm3
+ punpckldq %mm3,%mm3
+ pfmul %mm3,%mm2
+ pfadd %mm0,%mm2
+ movq 40(%eax),%mm3
+ movd 20+_COS9_,%mm4
+ punpckldq %mm4,%mm4
+ pfmul %mm4,%mm3
+ pfadd %mm3,%mm2
+ movq 56(%eax),%mm3
+ movd 28+_COS9_,%mm4
+ punpckldq %mm4,%mm4
+ pfmul %mm4,%mm3
+ pfadd %mm3,%mm2
+ movq (%eax),%mm3
+ movq 16(%eax),%mm4
+ movd 8+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfadd %mm4,%mm3
+ movq 32(%eax),%mm4
+ movd 16+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfadd %mm4,%mm3
+ pfadd %mm1,%mm3
+ movq 64(%eax),%mm4
+ movd 32+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfadd %mm4,%mm3
+ movq %mm2,%mm4
+ pfadd %mm3,%mm4
+ movq %mm7,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov -4(%ebp),%eax
+#endif
+ punpckldq 0+_tfcos36_,%mm5
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 108(%edx),%mm6
+ punpckldq 104(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,36(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,32(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 32(%edx),%mm6
+ punpckldq 36(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 32(%esi),%mm6
+ punpckldq 36(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,1024(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,1152(%ebx)
+ movq %mm3,%mm4
+ pfsub %mm2,%mm4
+ movq %mm7,%mm5
+ punpckldq 32+_tfcos36_,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov 8(%ebp),%eax
+#endif
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 140(%edx),%mm6
+ punpckldq 72(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,68(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,0(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 0(%edx),%mm6
+ punpckldq 68(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 0(%esi),%mm6
+ punpckldq 68(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,0(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,2176(%ebx)
+ movq 8(%eax),%mm2
+ movq 40(%eax),%mm3
+ pfsub %mm3,%mm2
+ movq 56(%eax),%mm3
+ pfsub %mm3,%mm2
+ movd 12+_COS9_,%mm3
+ punpckldq %mm3,%mm3
+ pfmul %mm3,%mm2
+ movq 16(%eax),%mm3
+ movq 32(%eax),%mm4
+ pfsub %mm4,%mm3
+ movq 64(%eax),%mm4
+ pfsub %mm4,%mm3
+ movd 24+_COS9_,%mm4
+ punpckldq %mm4,%mm4
+ pfmul %mm4,%mm3
+ movq 48(%eax),%mm4
+ pfsub %mm4,%mm3
+ movq (%eax),%mm4
+ pfadd %mm4,%mm3
+ movq %mm2,%mm4
+ pfadd %mm3,%mm4
+ movq %mm7,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov -4(%ebp),%eax
+#endif
+ punpckldq 4+_tfcos36_,%mm5
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 112(%edx),%mm6
+ punpckldq 100(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,40(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,28(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 28(%edx),%mm6
+ punpckldq 40(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 28(%esi),%mm6
+ punpckldq 40(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,896(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,1280(%ebx)
+ movq %mm3,%mm4
+ pfsub %mm2,%mm4
+ movq %mm7,%mm5
+ punpckldq 28+_tfcos36_,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov 8(%ebp),%eax
+#endif
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 136(%edx),%mm6
+ punpckldq 76(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,64(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,4(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 4(%edx),%mm6
+ punpckldq 64(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 4(%esi),%mm6
+ punpckldq 64(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,128(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,2048(%ebx)
+
+ movq 8(%eax),%mm2
+ movd 20+_COS9_,%mm3
+ punpckldq %mm3,%mm3
+ pfmul %mm3,%mm2
+ pfsub %mm0,%mm2
+ movq 40(%eax),%mm3
+ movd 28+_COS9_,%mm4
+ punpckldq %mm4,%mm4
+ pfmul %mm4,%mm3
+ pfsub %mm3,%mm2
+ movq 56(%eax),%mm3
+ movd 4+_COS9_,%mm4
+ punpckldq %mm4,%mm4
+ pfmul %mm4,%mm3
+ pfadd %mm3,%mm2
+ movq (%eax),%mm3
+ movq 16(%eax),%mm4
+ movd 32+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfsub %mm4,%mm3
+ movq 32(%eax),%mm4
+ movd 8+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfsub %mm4,%mm3
+ pfadd %mm1,%mm3
+ movq 64(%eax),%mm4
+ movd 16+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfadd %mm4,%mm3
+ movq %mm2,%mm4
+ pfadd %mm3,%mm4
+ movq %mm7,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov -4(%ebp),%eax
+#endif
+ punpckldq 8+_tfcos36_,%mm5
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 116(%edx),%mm6
+ punpckldq 96(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,44(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,24(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 24(%edx),%mm6
+ punpckldq 44(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 24(%esi),%mm6
+ punpckldq 44(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,768(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,1408(%ebx)
+ movq %mm3,%mm4
+ pfsub %mm2,%mm4
+ movq %mm7,%mm5
+ punpckldq 24+_tfcos36_,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov 8(%ebp),%eax
+#endif
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 132(%edx),%mm6
+ punpckldq 80(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,60(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,8(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 8(%edx),%mm6
+ punpckldq 60(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 8(%esi),%mm6
+ punpckldq 60(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,256(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,1920(%ebx)
+ movq 8(%eax),%mm2
+ movd 28+_COS9_,%mm3
+ punpckldq %mm3,%mm3
+ pfmul %mm3,%mm2
+ pfsub %mm0,%mm2
+ movq 40(%eax),%mm3
+ movd 4+_COS9_,%mm4
+ punpckldq %mm4,%mm4
+ pfmul %mm4,%mm3
+ pfadd %mm3,%mm2
+ movq 56(%eax),%mm3
+ movd 20+_COS9_,%mm4
+ punpckldq %mm4,%mm4
+ pfmul %mm4,%mm3
+ pfsub %mm3,%mm2
+ movq (%eax),%mm3
+ movq 16(%eax),%mm4
+ movd 16+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfsub %mm4,%mm3
+ movq 32(%eax),%mm4
+ movd 32+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfadd %mm4,%mm3
+ pfadd %mm1,%mm3
+ movq 64(%eax),%mm4
+ movd 8+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfsub %mm4,%mm3
+ movq %mm2,%mm4
+ pfadd %mm3,%mm4
+ movq %mm7,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov -4(%ebp),%eax
+#endif
+ punpckldq 12+_tfcos36_,%mm5
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 120(%edx),%mm6
+ punpckldq 92(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,48(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,20(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 20(%edx),%mm6
+ punpckldq 48(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 20(%esi),%mm6
+ punpckldq 48(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,640(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,1536(%ebx)
+ movq %mm3,%mm4
+ pfsub %mm2,%mm4
+ movq %mm7,%mm5
+ punpckldq 20+_tfcos36_,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov 8(%ebp),%eax
+#endif
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 128(%edx),%mm6
+ punpckldq 84(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,56(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,12(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 12(%edx),%mm6
+ punpckldq 56(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 12(%esi),%mm6
+ punpckldq 56(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,384(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,1792(%ebx)
+
+ movq (%eax),%mm4
+ movq 16(%eax),%mm3
+ pfsub %mm3,%mm4
+ movq 32(%eax),%mm3
+ pfadd %mm3,%mm4
+ movq 48(%eax),%mm3
+ pfsub %mm3,%mm4
+ movq 64(%eax),%mm3
+ pfadd %mm3,%mm4
+ movq %mm7,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov -4(%ebp),%eax
+#endif
+ punpckldq 16+_tfcos36_,%mm5
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 124(%edx),%mm6
+ punpckldq 88(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,52(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,16(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 16(%edx),%mm6
+ punpckldq 52(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 16(%esi),%mm6
+ punpckldq 52(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,512(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,1664(%ebx)
+
+ femms
+ RESTORE_GOT
+ popl %ebx
+ popl %esi
+ movl %ebp,%esp
+ popl %ebp
+ ret
+
+#if defined(PIC) && defined(__APPLE__)
+ .section __IMPORT,__pointers,non_lazy_symbol_pointers
+L_tfcos36:
+ .indirect_symbol ASM_NAME(tfcos36)
+ .long 0
+L_COS9:
+ .indirect_symbol ASM_NAME(COS9)
+ .long 0
+#endif
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_3dnowext.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_3dnowext.S
new file mode 100644
index 00000000..287b6b90
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_3dnowext.S
@@ -0,0 +1,570 @@
+/*
+ dct36_3dnowext: extended 3DNow optimized DCT36
+
+ copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+
+ Transformed back into standalone asm, with help of
+ gcc -S -DHAVE_CONFIG_H -I. -march=k6-3 -O3 -Wall -pedantic -fno-strict-aliasing -DREAL_IS_FLOAT -c -o dct36_3dnowext.{S,c}
+
+ MPlayer comment follows.
+*/
+
+/*
+ * dct36_3dnow.c - 3DNow! optimized dct36()
+ *
+ * This code based 'dct36_3dnow.s' by Syuuhei Kashiyama
+ * <squash@mb.kcom.ne.jp>, only two types of changes have been made:
+ *
+ * - removed PREFETCH instruction for speedup
+ * - changed function name for support 3DNow! automatic detection
+ *
+ * You can find Kashiyama's original 3dnow! support patch
+ * (for mpg123-0.59o) at
+ * http://user.ecc.u-tokyo.ac.jp/~g810370/linux-simd/ (Japanese).
+ *
+ * by KIMURA Takuhiro <kim@hannah.ipc.miyakyo-u.ac.jp> - until 31.Mar.1999
+ * <kim@comtec.co.jp> - after 1.Apr.1999
+ *
+ * Modified for use with MPlayer, for details see the changelog at
+ * http://svn.mplayerhq.hu/mplayer/trunk/
+ * $Id: dct36_3dnow.c 18786 2006-06-22 13:34:00Z diego $
+ *
+ * Original disclaimer:
+ * The author of this program disclaim whole expressed or implied
+ * warranties with regard to this program, and in no event shall the
+ * author of this program liable to whatever resulted from the use of
+ * this program. Use it at your own risk.
+ *
+ * 2003/06/21: Moved to GCC inline assembly - Alex Beregszaszi
+ */
+
+#include "mangle.h"
+
+ .text
+ ALIGN32
+.globl ASM_NAME(dct36_3dnowext)
+ /* .type ASM_NAME(dct36_3dnowext), @function */
+ASM_NAME(dct36_3dnowext):
+ pushl %ebp
+ movl %esp, %ebp
+#if defined(PIC) && defined(__APPLE__)
+ sub $4, %esp
+#endif
+ pushl %esi
+ pushl %ebx
+
+ #undef _EBX_
+ #define _EBX_ %edi
+ PREPARE_GOT
+ GET_GOT
+#if defined(PIC) && defined(__APPLE__)
+ #define _COS9_ 0(%edi)
+ #define _tfcos36_ 0(%eax)
+ mov GLOBAL_VAR_PTR(tfcos36), %eax
+ mov GLOBAL_VAR_PTR(COS9), %edi
+ mov %eax, -4(%ebp)
+#else
+ #define _COS9_ GLOBAL_VAR(COS9)
+ #define _tfcos36_ GLOBAL_VAR(tfcos36)
+#endif
+
+ movl 8(%ebp), %eax
+ movl 12(%ebp), %esi
+ movl 16(%ebp), %ecx
+ movl 20(%ebp), %edx
+ movl 24(%ebp), %ebx
+/* APP */
+ movq (%eax),%mm0
+ movq 4(%eax),%mm1
+ pfadd %mm1,%mm0
+ movq %mm0,4(%eax)
+ psrlq $32,%mm1
+ movq 12(%eax),%mm2
+ punpckldq %mm2,%mm1
+ pfadd %mm2,%mm1
+ movq %mm1,12(%eax)
+ psrlq $32,%mm2
+ movq 20(%eax),%mm3
+ punpckldq %mm3,%mm2
+ pfadd %mm3,%mm2
+ movq %mm2,20(%eax)
+ psrlq $32,%mm3
+ movq 28(%eax),%mm4
+ punpckldq %mm4,%mm3
+ pfadd %mm4,%mm3
+ movq %mm3,28(%eax)
+ psrlq $32,%mm4
+ movq 36(%eax),%mm5
+ punpckldq %mm5,%mm4
+ pfadd %mm5,%mm4
+ movq %mm4,36(%eax)
+ psrlq $32,%mm5
+ movq 44(%eax),%mm6
+ punpckldq %mm6,%mm5
+ pfadd %mm6,%mm5
+ movq %mm5,44(%eax)
+ psrlq $32,%mm6
+ movq 52(%eax),%mm7
+ punpckldq %mm7,%mm6
+ pfadd %mm7,%mm6
+ movq %mm6,52(%eax)
+ psrlq $32,%mm7
+ movq 60(%eax),%mm0
+ punpckldq %mm0,%mm7
+ pfadd %mm0,%mm7
+ movq %mm7,60(%eax)
+ psrlq $32,%mm0
+ movd 68(%eax),%mm1
+ pfadd %mm1,%mm0
+ movd %mm0,68(%eax)
+ movd 4(%eax),%mm0
+ movd 12(%eax),%mm1
+ punpckldq %mm1,%mm0
+ punpckldq 20(%eax),%mm1
+ pfadd %mm1,%mm0
+ movd %mm0,12(%eax)
+ psrlq $32,%mm0
+ movd %mm0,20(%eax)
+ psrlq $32,%mm1
+ movd 28(%eax),%mm2
+ punpckldq %mm2,%mm1
+ punpckldq 36(%eax),%mm2
+ pfadd %mm2,%mm1
+ movd %mm1,28(%eax)
+ psrlq $32,%mm1
+ movd %mm1,36(%eax)
+ psrlq $32,%mm2
+ movd 44(%eax),%mm3
+ punpckldq %mm3,%mm2
+ punpckldq 52(%eax),%mm3
+ pfadd %mm3,%mm2
+ movd %mm2,44(%eax)
+ psrlq $32,%mm2
+ movd %mm2,52(%eax)
+ psrlq $32,%mm3
+ movd 60(%eax),%mm4
+ punpckldq %mm4,%mm3
+ punpckldq 68(%eax),%mm4
+ pfadd %mm4,%mm3
+ movd %mm3,60(%eax)
+ psrlq $32,%mm3
+ movd %mm3,68(%eax)
+ movq 24(%eax),%mm0
+ movq 48(%eax),%mm1
+ movd 12+_COS9_,%mm2
+ punpckldq %mm2,%mm2
+ movd 24+_COS9_,%mm3
+ punpckldq %mm3,%mm3
+ pfmul %mm2,%mm0
+ pfmul %mm3,%mm1
+ pushl %eax
+ movl $1,%eax
+ movd %eax,%mm7
+ pi2fd %mm7,%mm7
+ popl %eax
+ movq 8(%eax),%mm2
+ movd 4+_COS9_,%mm3
+ punpckldq %mm3,%mm3
+ pfmul %mm3,%mm2
+ pfadd %mm0,%mm2
+ movq 40(%eax),%mm3
+ movd 20+_COS9_,%mm4
+ punpckldq %mm4,%mm4
+ pfmul %mm4,%mm3
+ pfadd %mm3,%mm2
+ movq 56(%eax),%mm3
+ movd 28+_COS9_,%mm4
+ punpckldq %mm4,%mm4
+ pfmul %mm4,%mm3
+ pfadd %mm3,%mm2
+ movq (%eax),%mm3
+ movq 16(%eax),%mm4
+ movd 8+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfadd %mm4,%mm3
+ movq 32(%eax),%mm4
+ movd 16+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfadd %mm4,%mm3
+ pfadd %mm1,%mm3
+ movq 64(%eax),%mm4
+ movd 32+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfadd %mm4,%mm3
+ movq %mm2,%mm4
+ pfadd %mm3,%mm4
+ movq %mm7,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov -4(%ebp),%eax
+#endif
+ punpckldq 0+_tfcos36_,%mm5
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 108(%edx),%mm6
+ punpckldq 104(%edx),%mm6
+ pfmul %mm6,%mm5
+ pswapd %mm5,%mm5
+ movq %mm5,32(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 32(%edx),%mm6
+ punpckldq 36(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 32(%esi),%mm6
+ punpckldq 36(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,1024(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,1152(%ebx)
+ movq %mm3,%mm4
+ pfsub %mm2,%mm4
+ movq %mm7,%mm5
+ punpckldq 32+_tfcos36_,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov 8(%ebp),%eax
+#endif
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 140(%edx),%mm6
+ punpckldq 72(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,68(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,0(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 0(%edx),%mm6
+ punpckldq 68(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 0(%esi),%mm6
+ punpckldq 68(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,0(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,2176(%ebx)
+ movq 8(%eax),%mm2
+ movq 40(%eax),%mm3
+ pfsub %mm3,%mm2
+ movq 56(%eax),%mm3
+ pfsub %mm3,%mm2
+ movd 12+_COS9_,%mm3
+ punpckldq %mm3,%mm3
+ pfmul %mm3,%mm2
+ movq 16(%eax),%mm3
+ movq 32(%eax),%mm4
+ pfsub %mm4,%mm3
+ movq 64(%eax),%mm4
+ pfsub %mm4,%mm3
+ movd 24+_COS9_,%mm4
+ punpckldq %mm4,%mm4
+ pfmul %mm4,%mm3
+ movq 48(%eax),%mm4
+ pfsub %mm4,%mm3
+ movq (%eax),%mm4
+ pfadd %mm4,%mm3
+ movq %mm2,%mm4
+ pfadd %mm3,%mm4
+ movq %mm7,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov -4(%ebp),%eax
+#endif
+ punpckldq 4+_tfcos36_,%mm5
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 112(%edx),%mm6
+ punpckldq 100(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,40(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,28(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 28(%edx),%mm6
+ punpckldq 40(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 28(%esi),%mm6
+ punpckldq 40(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,896(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,1280(%ebx)
+ movq %mm3,%mm4
+ pfsub %mm2,%mm4
+ movq %mm7,%mm5
+ punpckldq 28+_tfcos36_,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov 8(%ebp),%eax
+#endif
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 136(%edx),%mm6
+ punpckldq 76(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,64(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,4(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 4(%edx),%mm6
+ punpckldq 64(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 4(%esi),%mm6
+ punpckldq 64(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,128(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,2048(%ebx)
+ movq 8(%eax),%mm2
+ movd 20+_COS9_,%mm3
+ punpckldq %mm3,%mm3
+ pfmul %mm3,%mm2
+ pfsub %mm0,%mm2
+ movq 40(%eax),%mm3
+ movd 28+_COS9_,%mm4
+ punpckldq %mm4,%mm4
+ pfmul %mm4,%mm3
+ pfsub %mm3,%mm2
+ movq 56(%eax),%mm3
+ movd 4+_COS9_,%mm4
+ punpckldq %mm4,%mm4
+ pfmul %mm4,%mm3
+ pfadd %mm3,%mm2
+ movq (%eax),%mm3
+ movq 16(%eax),%mm4
+ movd 32+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfsub %mm4,%mm3
+ movq 32(%eax),%mm4
+ movd 8+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfsub %mm4,%mm3
+ pfadd %mm1,%mm3
+ movq 64(%eax),%mm4
+ movd 16+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfadd %mm4,%mm3
+ movq %mm2,%mm4
+ pfadd %mm3,%mm4
+ movq %mm7,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov -4(%ebp),%eax
+#endif
+ punpckldq 8+_tfcos36_,%mm5
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 116(%edx),%mm6
+ punpckldq 96(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,44(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,24(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 24(%edx),%mm6
+ punpckldq 44(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 24(%esi),%mm6
+ punpckldq 44(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,768(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,1408(%ebx)
+ movq %mm3,%mm4
+ pfsub %mm2,%mm4
+ movq %mm7,%mm5
+ punpckldq 24+_tfcos36_,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov 8(%ebp),%eax
+#endif
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 132(%edx),%mm6
+ punpckldq 80(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,60(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,8(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 8(%edx),%mm6
+ punpckldq 60(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 8(%esi),%mm6
+ punpckldq 60(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,256(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,1920(%ebx)
+ movq 8(%eax),%mm2
+ movd 28+_COS9_,%mm3
+ punpckldq %mm3,%mm3
+ pfmul %mm3,%mm2
+ pfsub %mm0,%mm2
+ movq 40(%eax),%mm3
+ movd 4+_COS9_,%mm4
+ punpckldq %mm4,%mm4
+ pfmul %mm4,%mm3
+ pfadd %mm3,%mm2
+ movq 56(%eax),%mm3
+ movd 20+_COS9_,%mm4
+ punpckldq %mm4,%mm4
+ pfmul %mm4,%mm3
+ pfsub %mm3,%mm2
+ movq (%eax),%mm3
+ movq 16(%eax),%mm4
+ movd 16+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfsub %mm4,%mm3
+ movq 32(%eax),%mm4
+ movd 32+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfadd %mm4,%mm3
+ pfadd %mm1,%mm3
+ movq 64(%eax),%mm4
+ movd 8+_COS9_,%mm5
+ punpckldq %mm5,%mm5
+ pfmul %mm5,%mm4
+ pfsub %mm4,%mm3
+ movq %mm2,%mm4
+ pfadd %mm3,%mm4
+ movq %mm7,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov -4(%ebp),%eax
+#endif
+ punpckldq 12+_tfcos36_,%mm5
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 120(%edx),%mm6
+ punpckldq 92(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,48(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,20(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 20(%edx),%mm6
+ punpckldq 48(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 20(%esi),%mm6
+ punpckldq 48(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,640(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,1536(%ebx)
+ movq %mm3,%mm4
+ pfsub %mm2,%mm4
+ movq %mm7,%mm5
+ punpckldq 20+_tfcos36_,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov 8(%ebp),%eax
+#endif
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 128(%edx),%mm6
+ punpckldq 84(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,56(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,12(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 12(%edx),%mm6
+ punpckldq 56(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 12(%esi),%mm6
+ punpckldq 56(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,384(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,1792(%ebx)
+ movq (%eax),%mm4
+ movq 16(%eax),%mm3
+ pfsub %mm3,%mm4
+ movq 32(%eax),%mm3
+ pfadd %mm3,%mm4
+ movq 48(%eax),%mm3
+ pfsub %mm3,%mm4
+ movq 64(%eax),%mm3
+ pfadd %mm3,%mm4
+ movq %mm7,%mm5
+#if defined(PIC) && defined(__APPLE__)
+ mov -4(%ebp),%eax
+#endif
+ punpckldq 16+_tfcos36_,%mm5
+ pfmul %mm5,%mm4
+ movq %mm4,%mm5
+ pfacc %mm5,%mm5
+ movd 124(%edx),%mm6
+ punpckldq 88(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd %mm5,52(%ecx)
+ psrlq $32,%mm5
+ movd %mm5,16(%ecx)
+ movq %mm4,%mm6
+ punpckldq %mm6,%mm5
+ pfsub %mm6,%mm5
+ punpckhdq %mm5,%mm5
+ movd 16(%edx),%mm6
+ punpckldq 52(%edx),%mm6
+ pfmul %mm6,%mm5
+ movd 16(%esi),%mm6
+ punpckldq 52(%esi),%mm6
+ pfadd %mm6,%mm5
+ movd %mm5,512(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,1664(%ebx)
+ femms
+
+/* NO_APP */
+ RESTORE_GOT
+
+ popl %ebx
+ popl %esi
+ leave
+ ret
+ /* .size ASM_NAME(dct36_3dnowext), .-ASM_NAME(dct36_3dnowext) */
+
+#if defined(PIC) && defined(__APPLE__)
+ .section __IMPORT,__pointers,non_lazy_symbol_pointers
+L_tfcos36:
+ .indirect_symbol ASM_NAME(tfcos36)
+ .long 0
+L_COS9:
+ .indirect_symbol ASM_NAME(COS9)
+ .long 0
+#endif
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_avx.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_avx.S
new file mode 100644
index 00000000..e302b6dd
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_avx.S
@@ -0,0 +1,358 @@
+/*
+ dct36_avx: AVX optimized dct36 for x86-64
+
+ copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifdef IS_MSABI
+#define in %rcx
+#define out1 %rdx
+#define out2 %r8
+#define w %r9
+#define ts %r10
+#define COS9_ %rax
+#define tfcos36_ %r11
+#else
+#define in %rdi
+#define out1 %rsi
+#define out2 %rdx
+#define w %rcx
+#define ts %r8
+#define COS9_ %rax
+#define tfcos36_ %r9
+#endif
+
+/*
+ void dct36_avx(real *inbuf,real *o1,real *o2,real *wintab,real *tsbuf);
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+dct36_avx_COS9:
+ .long 0x3f5db3d7
+ .long 0x3f5db3d7
+ .long 0x3f000000
+ .long 0x3f000000
+ .long 0x3f7c1c5c
+ .long 0x3f7c1c5c
+ .long 0x3f708fb2
+ .long 0x3f708fb2
+ .long 0x3f248dbb
+ .long 0x3f248dbb
+ .long 0x3e31d0d4
+ .long 0x3e31d0d4
+ .long 0x3eaf1d44
+ .long 0x3eaf1d44
+ .long 0x3f441b7d
+ .long 0x3f441b7d
+ ALIGN16
+dct36_avx_tfcos36:
+ .long 0x3f007d2b
+ .long 0x3f0483ee
+ .long 0x3f0d3b7d
+ .long 0x3f1c4257
+ .long 0x40b79454
+ .long 0x3ff746ea
+ .long 0x3f976fd9
+ .long 0x3f5f2944
+ .long 0x3f3504f3
+ ALIGN16
+dct36_avx_sign:
+ .long 0x80000000,0x80000000,0x80000000,0x80000000
+ .text
+ ALIGN16
+ .globl ASM_NAME(dct36_avx)
+ASM_NAME(dct36_avx):
+#ifdef IS_MSABI
+ push %rbp
+ mov %rsp, %rbp
+ sub $160, %rsp
+ movaps %xmm6, (%rsp)
+ movaps %xmm7, 16(%rsp)
+ movaps %xmm8, 32(%rsp)
+ movaps %xmm9, 48(%rsp)
+ movaps %xmm10, 64(%rsp)
+ movaps %xmm11, 80(%rsp)
+ movaps %xmm12, 96(%rsp)
+ movaps %xmm13, 112(%rsp)
+ movaps %xmm14, 128(%rsp)
+ movaps %xmm15, 144(%rsp)
+ movq 48(%rbp), ts
+#endif
+ lea dct36_avx_COS9(%rip), COS9_
+ lea dct36_avx_tfcos36(%rip), tfcos36_
+
+ xorps %xmm4, %xmm4
+ movups (in), %xmm0
+ movups 16(in), %xmm1
+ movups 32(in), %xmm2
+ movups 48(in), %xmm3
+ movlps 64(in), %xmm4
+ vshufps $0x93, %xmm0, %xmm0, %xmm5
+ vshufps $0x93, %xmm1, %xmm1, %xmm6
+ vshufps $0x93, %xmm2, %xmm2, %xmm7
+ vshufps $0x93, %xmm3, %xmm3, %xmm8
+ vshufps $0xe1, %xmm4, %xmm4, %xmm9
+ movss %xmm8, %xmm9 #[fg--]
+ addps %xmm9, %xmm4 #[gh--]
+ movss %xmm7, %xmm8
+ addps %xmm8, %xmm3 #[cdef]
+ movss %xmm6, %xmm7
+ addps %xmm7, %xmm2 #[89ab]
+ movss %xmm5, %xmm6
+ addps %xmm6, %xmm1 #[4567]
+ xorps %xmm6, %xmm6
+ movss %xmm6, %xmm5
+ addps %xmm5, %xmm0 #[0123]
+
+ vblendps $0x5, %xmm6, %xmm3, %xmm7
+ vshufps $0x4e, %xmm4, %xmm3, %xmm4
+ addps %xmm7, %xmm4
+ vblendps $0x5, %xmm6, %xmm2, %xmm7
+ vshufps $0x4e, %xmm3, %xmm2, %xmm3
+ addps %xmm7, %xmm3
+ vblendps $0x5, %xmm6, %xmm1, %xmm7
+ vshufps $0x4e, %xmm2, %xmm1, %xmm2
+ addps %xmm7, %xmm2
+ vblendps $0x5, %xmm6, %xmm0, %xmm7
+ vshufps $0x4e, %xmm1, %xmm0, %xmm1
+ addps %xmm7, %xmm1
+ vmovlhps %xmm0, %xmm6, %xmm0
+
+/*
+xmm0 in[-,-,0,1]
+xmm1 in[2,3,4,5]
+xmm2 in[6,7,8,9]
+xmm3 in[10,11,12,13]
+xmm4 in[14,15,16,17]
+*/
+
+ vblendps $0xc, %xmm3, %xmm2, %xmm5
+ blendps $0xc, %xmm4, %xmm3
+ blendps $0xc, %xmm2, %xmm4
+ movaps %xmm5, %xmm2
+
+/*
+xmm2 in[6,7,12,13]
+xmm3 in[10,11,16,17]
+xmm4 in[14,15,8,9]
+*/
+
+ movaps (COS9_), %xmm15
+ movaps 16(COS9_), %xmm6
+ movaps 32(COS9_), %xmm7
+ movaps 48(COS9_), %xmm8
+ vmulps %xmm2, %xmm15, %xmm5
+ addps %xmm0, %xmm5
+
+/*
+xmm5 [ta33,tb33,ta66,tb66]
+xmm6 COS9_[1,1,2,2]
+xmm7 COS9_[5,5,8,8]
+xmm8 COS9_[7,7,4,4]
+xmm15 COS9_[3,3,6,6]
+*/
+
+ vmulps %xmm1, %xmm6, %xmm9
+ vmulps %xmm3, %xmm7, %xmm12
+ vmulps %xmm4, %xmm8, %xmm13
+ addps %xmm5, %xmm9
+ addps %xmm13, %xmm12
+ addps %xmm9, %xmm12
+
+ vsubps %xmm3, %xmm1, %xmm13
+ vshufps $0xe0, %xmm2, %xmm0, %xmm14
+ vsubps %xmm14, %xmm0, %xmm14
+ subps %xmm4, %xmm13
+ mulps %xmm15, %xmm13
+ addps %xmm14, %xmm13
+
+ vmulps %xmm1, %xmm7, %xmm9
+ vmulps %xmm3, %xmm8, %xmm15
+ vmulps %xmm4, %xmm6, %xmm14
+ subps %xmm5, %xmm9
+ subps %xmm15, %xmm14
+ addps %xmm9, %xmm14
+
+ mulps %xmm1, %xmm8
+ mulps %xmm3, %xmm6
+ mulps %xmm4, %xmm7
+ subps %xmm5, %xmm8
+ subps %xmm7, %xmm6
+ vaddps %xmm6, %xmm8, %xmm15
+
+ movss 32(tfcos36_), %xmm5
+ subps %xmm1, %xmm0
+ subps %xmm2, %xmm4
+ addps %xmm3, %xmm0
+ addps %xmm4, %xmm0
+ shufps $0xaf, %xmm0, %xmm0
+ vmulss %xmm5, %xmm0, %xmm11
+
+/*
+xmm12 [1a-0,1b-0, 2a-0, 2b-0]
+xmm13 [1a-1,1b-1, 2a-1, 2b-1]
+xmm14 [1a-2,1b-2,-2a-2,-2b-2]
+xmm15 [1a-3,1b-3,-2a-3,-2b-3]
+*/
+ vunpckhps %xmm13, %xmm12, %xmm5
+ vunpcklps %xmm13, %xmm12, %xmm12
+ vunpckhps %xmm15, %xmm14, %xmm6
+ vunpcklps %xmm15, %xmm14, %xmm14
+ xorps dct36_avx_sign(%rip), %xmm6
+
+/*
+xmm12 [1a-0,1a-1,1b-0,1b-1]
+xmm5 [2a-0,2a-1,2b-0,2b-1]
+xmm14 [1a-2,1a-3,1b-2,1b-3]
+xmm6 [2a-2,2a-3,2b-2,2b-3]
+*/
+
+ vmovlhps %xmm14, %xmm12, %xmm0
+ movhlps %xmm12, %xmm14
+ vmovlhps %xmm6, %xmm5, %xmm1
+ vmovhlps %xmm5, %xmm6, %xmm15
+
+/*
+xmm0 tmp1a
+xmm1 tmp2a
+xmm14 tmp1b
+xmm15 tmp2b
+*/
+
+ movaps (tfcos36_), %xmm6
+ movaps 16(tfcos36_), %xmm7
+ vsubps %xmm14, %xmm15, %xmm10
+ addps %xmm14, %xmm15
+ vsubps %xmm0, %xmm1, %xmm14
+ addps %xmm1, %xmm0
+ vmulps %xmm6, %xmm15, %xmm1
+ mulps %xmm10, %xmm7
+
+/*
+%xmm0 tmp[0,1,2,3]
+%xmm1 tmp[17,16,15,14]
+%xmm14 tmp[8,7,6,5]
+%xmm7 tmp[9,10,11,12]
+%xmm11 tmp[13,-,4,-]
+*/
+
+ movups 108(w), %xmm2
+ movups 92(w), %xmm3
+ shufps $0x1b, %xmm3, %xmm3
+ movups 36(w), %xmm4
+ movups 20(w), %xmm5
+ shufps $0x1b, %xmm5, %xmm5
+ vsubps %xmm1, %xmm0, %xmm6
+ addps %xmm1, %xmm0
+ mulps %xmm0, %xmm2
+ mulps %xmm3, %xmm0
+ mulps %xmm6, %xmm4
+ mulps %xmm5, %xmm6
+ movups 36(out1), %xmm1
+ movups 20(out1), %xmm3
+ shufps $0x1b, %xmm6, %xmm6
+ addps %xmm4, %xmm1
+ addps %xmm6, %xmm3
+ shufps $0x1b, %xmm0, %xmm0
+ movups %xmm2, 36(out2)
+ movups %xmm0, 20(out2)
+ movss %xmm1, 32*36(ts)
+ movss %xmm3, 32*20(ts)
+ movhlps %xmm1, %xmm2
+ movhlps %xmm3, %xmm4
+ movss %xmm2, 32*44(ts)
+ movss %xmm4, 32*28(ts)
+ shufps $0xb1, %xmm1, %xmm1
+ shufps $0xb1, %xmm3, %xmm3
+ movss %xmm1, 32*40(ts)
+ movss %xmm3, 32*24(ts)
+ movhlps %xmm1, %xmm2
+ movhlps %xmm3, %xmm4
+ movss %xmm2, 32*48(ts)
+ movss %xmm4, 32*32(ts)
+
+ movhlps %xmm11, %xmm0
+ movss 124(w), %xmm2
+ movss 88(w), %xmm3
+ movss 52(w), %xmm4
+ movss 16(w), %xmm5
+ movss %xmm0, %xmm6
+ addss %xmm11, %xmm0
+ subss %xmm11, %xmm6
+ mulss %xmm0, %xmm2
+ mulss %xmm3, %xmm0
+ mulss %xmm6, %xmm4
+ mulss %xmm5, %xmm6
+ addss 52(out1), %xmm4
+ addss 16(out1), %xmm6
+ movss %xmm2, 52(out2)
+ movss %xmm0, 16(out2)
+ movss %xmm4, 32*52(ts)
+ movss %xmm6, 32*16(ts)
+
+ movaps %xmm14, %xmm0
+ movaps %xmm7, %xmm1
+ MOVUAPS 128(w), %xmm2
+ movups 72(w), %xmm3
+ shufps $0x1b, %xmm2, %xmm2
+ movlps 56(w), %xmm4
+ movhps 64(w), %xmm4
+ MOVUAPS (w), %xmm5
+ shufps $0x1b, %xmm4, %xmm4
+ vsubps %xmm1, %xmm0, %xmm6
+ addps %xmm1, %xmm0
+ mulps %xmm0, %xmm2
+ mulps %xmm3, %xmm0
+ mulps %xmm6, %xmm4
+ mulps %xmm5, %xmm6
+ movlps 56(out1), %xmm1
+ movhps 64(out1), %xmm1
+ movups (out1), %xmm3
+ shufps $0x1b, %xmm4, %xmm4
+ addps %xmm6, %xmm3
+ addps %xmm4, %xmm1
+ shufps $0x1b, %xmm2, %xmm2
+ movups %xmm0, (out2)
+ movlps %xmm2, 56(out2)
+ movhps %xmm2, 64(out2)
+ movss %xmm1, 32*56(ts)
+ movss %xmm3, (ts)
+ movhlps %xmm1, %xmm2
+ movhlps %xmm3, %xmm4
+ movss %xmm2, 32*64(ts)
+ movss %xmm4, 32*8(ts)
+ shufps $0xb1, %xmm1, %xmm1
+ shufps $0xb1, %xmm3, %xmm3
+ movss %xmm1, 32*60(ts)
+ movss %xmm3, 32*4(ts)
+ movhlps %xmm1, %xmm2
+ movhlps %xmm3, %xmm4
+ movss %xmm2, 32*68(ts)
+ movss %xmm4, 32*12(ts)
+
+#ifdef IS_MSABI
+ movaps (%rsp), %xmm6
+ movaps 16(%rsp), %xmm7
+ movaps 32(%rsp), %xmm8
+ movaps 48(%rsp), %xmm9
+ movaps 64(%rsp), %xmm10
+ movaps 80(%rsp), %xmm11
+ movaps 96(%rsp), %xmm12
+ movaps 112(%rsp), %xmm13
+ movaps 128(%rsp), %xmm14
+ movaps 144(%rsp), %xmm15
+ mov %rbp, %rsp
+ pop %rbp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_neon.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_neon.S
new file mode 100644
index 00000000..e7fa3af2
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_neon.S
@@ -0,0 +1,283 @@
+/*
+ dct36_neon: ARM NEON optimized dct36
+
+ copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+
+#include "mangle.h"
+
+#ifndef _M_ARM
+ .code 32
+#endif
+#ifndef __APPLE__
+ .fpu neon
+#endif
+
+ .text
+ ALIGN16
+dct36_neon_COS9:
+ .word 0x3f5db3d7
+ .word 0x3f5db3d7
+ .word 0x3f000000
+ .word 0x3f000000
+ .word 0x3f7c1c5c
+ .word 0x3f7c1c5c
+ .word 0x3f708fb2
+ .word 0x3f708fb2
+ .word 0x3f248dbb
+ .word 0x3f248dbb
+ .word 0x3e31d0d4
+ .word 0x3e31d0d4
+ .word 0x3eaf1d44
+ .word 0x3eaf1d44
+ .word 0x3f441b7d
+ .word 0x3f441b7d
+ .word 0x3f007d2b
+ .word 0x3f0483ee
+ .word 0x3f0d3b7d
+ .word 0x3f1c4257
+ .word 0x40b79454
+ .word 0x3ff746ea
+ .word 0x3f976fd9
+ .word 0x3f5f2944
+ .word 0x3f800000
+ .word 0x3f3504f3
+
+ ALIGN4
+ GLOBAL_SYMBOL ASM_NAME(dct36_neon)
+#ifdef __ELF__
+ .type ASM_NAME(dct36_neon), %function
+#endif
+ASM_NAME(dct36_neon):
+ push {r4-r5, lr}
+ vpush {q4-q7}
+ ldr r4, [sp, #76]
+ adr r5, dct36_neon_COS9
+
+ vceq.i32 q14, q14, q14
+ veor q15, q15, q15
+ vshl.i64 q14, q14, #32
+ vld1.32 {q0, q1}, [r0]!
+ vld1.32 {q2, q3}, [r0]!
+ vld1.32 {d8}, [r0]
+
+ vext.8 q5, q15, q0, #12
+ vext.8 q6, q0, q1, #12
+ vext.8 q7, q1, q2, #12
+ vext.8 q8, q2, q3, #12
+ vext.8 d18, d7, d8, #4
+ vadd.f32 q0, q0, q5
+ vadd.f32 q1, q1, q6
+ vadd.f32 q2, q2, q7
+ vadd.f32 q3, q3, q8
+ vadd.f32 d8, d8, d18
+
+ vext.8 q6, q0, q1, #8
+ vext.8 q7, q1, q2, #8
+ vext.8 q8, q2, q3, #8
+ vext.8 q9, q3, q4, #8
+ vand q10, q0, q14
+ vext.8 q0, q15, q0, #8
+ vand q11, q1, q14
+ vand q12, q2, q14
+ vand q13, q3, q14
+ vadd.f32 q1, q10, q6
+ vadd.f32 q2, q11, q7
+ vadd.f32 q3, q12, q8
+ vadd.f32 q4, q13, q9
+
+/*
+q0 in[-,-,0,1]
+q1 in[2,3,4,5]
+q2 in[6,7,8,9]
+q3 in[10,11,12,13]
+q4 in[14,15,16,17]
+*/
+
+ vswp d5, d7
+ vswp d7, d9
+
+/*
+q2 in[6,7,12,13]
+q3 in[10,11,16,17]
+q4 in[14,15,8,9]
+*/
+
+ vld1.32 {q5, q6}, [r5, :128]!
+ vld1.32 {q7, q8}, [r5, :128]!
+ vmov q9, q0
+ vmla.f32 q9, q2, q5
+
+/*
+q6 COS9_[1,1,2,2]
+q7 COS9_[5,5,8,8]
+q8 COS9_[7,7,4,4]
+q5 COS9_[3,3,6,6]
+q9 [ta33,tb33,ta66,tb66]
+*/
+
+ vmov q10, q9
+ vmov d26, d0
+ vmov d27, d5
+ vmul.f32 q12, q1, q6
+ vsub.f32 q11, q1, q3
+ vmla.f32 q10, q3, q7
+ vsub.f32 q13, q0, q13
+ vmla.f32 q12, q4, q8
+ vsub.f32 q11, q11, q4
+ vmul.f32 q14, q1, q7
+ vmul.f32 q15, q1, q8
+ vadd.f32 q12, q12, q10
+ vmov q10, q9
+ vmla.f32 q13, q11, q5
+ vmla.f32 q10, q3, q8
+ vmla.f32 q14, q4, q6
+ vmla.f32 q9, q4, q7
+ vmla.f32 q15, q3, q6
+ vsub.f32 q14, q14, q10
+ vsub.f32 q15, q15, q9
+
+/*
+q12 [1a-0,1b-0, 2a-0, 2b-0]
+q13 [1a-1,1b-1, 2a-1, 2b-1]
+q14 [1a-2,1b-2,-2a-2,-2b-2]
+q15 [1a-3,1b-3,-2a-3,-2b-3]
+*/
+
+ vzip.32 q12, q13
+ vzip.32 q14, q15
+ vneg.f32 q15, q15
+
+/*
+q12 [1a-0,1a-1,1b-0,1b-1]
+q13 [2a-0,2a-1,2b-0,2b-1]
+q14 [1a-2,1a-3,1b-2,1b-3]
+q15 [2a-2,2a-3,2b-2,2b-3]
+*/
+
+ vswp d25, d28
+ vswp d27, d30
+
+/*
+q12 tmp1a
+q13 tmp2a
+q14 tmp1b
+q15 tmp2b
+*/
+ vsub.f32 d1, d1, d3
+ vsub.f32 d9, d9, d5
+ vld1.32 {q5, q6}, [r5, :128]!
+ vld1.32 {d0}, [r5, :64]
+ vadd.f32 q10, q14, q15
+ vsub.f32 q8, q15, q14
+ vadd.f32 d1, d1, d7
+ vadd.f32 q9, q12, q13
+ vsub.f32 q7, q13, q12
+ vadd.f32 d1, d1, d9
+ vmul.f32 q10, q10, q5
+ vmul.f32 q8, q8, q6
+ vmul.f32 d0, d1, d0
+
+/*
+q9 tmp[0,1,2,3]
+q10 tmp[17,16,15,14]
+q7 tmp[8,7,6,5]
+q8 tmp[9,10,11,12]
+d0 tmp[4,13]
+*/
+
+ add r0, r4, #640
+ add r5, r3, #20
+ vld1.32 {q1,q2}, [r5]
+ add r5, r3, #92
+ vld1.32 {q3,q4}, [r5]
+ add r5, r1, #20
+ vld1.32 {q5,q6}, [r5]
+ vadd.f32 q11, q9, q10
+ vsub.f32 q12, q9, q10
+ vmul.f32 q10, q11, q4
+ vmla.f32 q6, q12, q2
+ vrev64.32 q11, q11
+ vrev64.32 q12, q12
+ vswp d22, d23
+ vswp d24, d25
+ vmul.f32 q9, q11, q3
+ vmla.f32 q5, q12, q1
+ add r5, r2, #20
+ vst1.32 {q9,q10}, [r5]
+ mov r5, #128
+ vst1.32 {d10[0]}, [r0], r5
+ vst1.32 {d10[1]}, [r0], r5
+ vst1.32 {d11[0]}, [r0], r5
+ vst1.32 {d11[1]}, [r0], r5
+ vst1.32 {d12[0]}, [r0], r5
+ vst1.32 {d12[1]}, [r0], r5
+ vst1.32 {d13[0]}, [r0], r5
+ vst1.32 {d13[1]}, [r0], r5
+
+ add r0, r4, #1792
+ add r5, r3, #56
+ vld1.32 {q1}, [r3]
+ vld1.32 {q2,q3}, [r5]
+ add r5, r3, #128
+ vld1.32 {q4}, [r5]
+ add r5, r1, #56
+ vld1.32 {q5}, [r1]
+ vld1.32 {q6}, [r5]
+ vadd.f32 q9, q7, q8
+ vsub.f32 q10, q7, q8
+ vmul.f32 q7, q9, q3
+ vmla.f32 q5, q10, q1
+ vrev64.32 q9, q9
+ vrev64.32 q10, q10
+ vswp d18, d19
+ vswp d20, d21
+ vmul.f32 q8, q9, q4
+ vmla.f32 q6, q10, q2
+ add r5, r2, #56
+ vst1.32 {q7}, [r2]
+ vst1.32 {q8}, [r5]
+ mov r5, #128
+ vst1.32 {d10[0]}, [r4], r5
+ vst1.32 {d10[1]}, [r4], r5
+ vst1.32 {d11[0]}, [r4], r5
+ vst1.32 {d11[1]}, [r4], r5
+ vst1.32 {d12[0]}, [r0], r5
+ vst1.32 {d12[1]}, [r0], r5
+ vst1.32 {d13[0]}, [r0], r5
+ vst1.32 {d13[1]}, [r0], r5
+
+ vtrn.32 d0, d1
+ add r5, r3, #16
+ vld1.32 {d2}, [r5]
+ add r5, r3, #52
+ vld1.32 {d3}, [r5]
+ add r5, r3, #88
+ vld1.32 {d4}, [r5]
+ add r3, r3, #124
+ vld1.32 {d5}, [r3]
+ add r5, r1, #16
+ vld1.32 {d6}, [r5]
+ add r1, r1, #52
+ vld1.32 {d7}, [r1]
+ vadd.f32 d8, d0, d1
+ vsub.f32 d9, d0, d1
+ vmul.f32 d4, d8, d4
+ vmul.f32 d5, d8, d5
+ vmla.f32 d6, d9, d2
+ vmla.f32 d7, d9, d3
+ add r2, r2, #16
+ vst1.32 {d4[0]}, [r2]
+ add r2, r2, #36
+ vst1.32 {d5[0]}, [r2]
+ vst1.32 {d6[0]}, [r4]
+ add r4, r4, #1152
+ vst1.32 {d7[0]}, [r4]
+
+ vpop {q4-q7}
+ pop {r4-r5, pc}
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_neon64.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_neon64.S
new file mode 100644
index 00000000..89db65ab
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_neon64.S
@@ -0,0 +1,249 @@
+/*
+ dct36_neon64: NEON optimized dct36 for AArch64
+
+ copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+dct36_aarch64_COS9:
+ .word 0x3f5db3d7
+ .word 0x3f5db3d7
+ .word 0x3f000000
+ .word 0x3f000000
+ .word 0x3f7c1c5c
+ .word 0x3f7c1c5c
+ .word 0x3f708fb2
+ .word 0x3f708fb2
+ .word 0x3f248dbb
+ .word 0x3f248dbb
+ .word 0x3e31d0d4
+ .word 0x3e31d0d4
+ .word 0x3eaf1d44
+ .word 0x3eaf1d44
+ .word 0x3f441b7d
+ .word 0x3f441b7d
+ .word 0x3f007d2b
+ .word 0x3f0483ee
+ .word 0x3f0d3b7d
+ .word 0x3f1c4257
+ .word 0x40b79454
+ .word 0x3ff746ea
+ .word 0x3f976fd9
+ .word 0x3f5f2944
+ .word 0x3f800000
+ .word 0x3f3504f3
+
+ .text
+ ALIGN4
+ .globl ASM_NAME(dct36_neon64)
+#ifdef __ELF__
+ .type ASM_NAME(dct36_neon64), %function
+#endif
+ASM_NAME(dct36_neon64):
+ adrp x5, AARCH64_PCREL_HI(dct36_aarch64_COS9)
+ add x5, x5, AARCH64_PCREL_LO(dct36_aarch64_COS9)
+ cmeq v28.16b, v28.16b, v28.16b
+ eor v29.16b, v29.16b, v29.16b
+ shl v28.2d, v28.2d, #32
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], #64
+ ld1 {v4.2s}, [x0]
+
+ ext v16.16b, v29.16b, v0.16b, #12
+ ext v17.16b, v0.16b, v1.16b, #12
+ ext v18.16b, v1.16b, v2.16b, #12
+ ext v19.16b, v2.16b, v3.16b, #12
+ ext v20.16b, v3.16b, v4.16b, #12
+ fadd v0.4s, v0.4s, v16.4s
+ fadd v1.4s, v1.4s, v17.4s
+ fadd v2.4s, v2.4s, v18.4s
+ fadd v3.4s, v3.4s, v19.4s
+ fadd v4.2s, v4.2s, v20.2s
+
+ ext v16.16b, v0.16b, v1.16b, #8
+ ext v17.16b, v1.16b, v2.16b, #8
+ ext v18.16b, v2.16b, v3.16b, #8
+ ext v19.16b, v3.16b, v4.16b, #8
+ and v20.16b, v0.16b, v28.16b
+ ext v0.16b, v29.16b, v0.16b, #8
+ and v21.16b, v1.16b, v28.16b
+ and v22.16b, v2.16b, v28.16b
+ and v23.16b, v3.16b, v28.16b
+ fadd v1.4s, v20.4s, v16.4s
+ fadd v2.4s, v21.4s, v17.4s
+ fadd v3.4s, v22.4s, v18.4s
+ fadd v4.4s, v23.4s, v19.4s
+
+/*
+v0 in[-,-,0,1]
+v1 in[2,3,4,5]
+v2 in[6,7,8,9]
+v3 in[10,11,12,13]
+v4 in[14,15,16,17]
+*/
+
+ orr v5.16b, v2.16b, v2.16b
+ ins v2.d[1], v3.d[1]
+ ins v3.d[1], v4.d[1]
+ ins v4.d[1], v5.d[1]
+
+/*
+v2 in[6,7,12,13]
+v3 in[10,11,16,17]
+v4 in[14,15,8,9]
+*/
+
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x5], #64
+ orr v20.16b, v0.16b, v0.16b
+ fmla v20.4s, v2.4s, v16.4s
+
+/*
+v17 COS9_[1,1,2,2]
+v18 COS9_[5,5,8,8]
+v19 COS9_[7,7,4,4]
+v16 COS9_[3,3,6,6]
+v20 [ta33,tb33,ta66,tb66]
+*/
+
+ orr v21.16b, v20.16b, v20.16b
+ orr v23.16b, v20.16b, v20.16b
+ zip2 v25.2d, v29.2d, v2.2d
+ fsub v22.4s, v1.4s, v3.4s
+ fmul v24.4s, v1.4s, v17.4s
+ fmul v26.4s, v1.4s, v18.4s
+ fmul v27.4s, v1.4s, v19.4s
+ fmla v21.4s, v3.4s, v18.4s
+ fmla v23.4s, v3.4s, v19.4s
+ fmla v20.4s, v4.4s, v18.4s
+ fsub v25.4s, v0.4s, v25.4s
+ fsub v22.4s, v22.4s, v4.4s
+ fmla v24.4s, v4.4s, v19.4s
+ fmla v26.4s, v4.4s, v17.4s
+ fmla v27.4s, v3.4s, v17.4s
+ fmla v25.4s, v22.4s, v16.4s
+ fadd v24.4s, v24.4s, v21.4s
+ fsub v26.4s, v26.4s, v23.4s
+ fsub v27.4s, v27.4s, v20.4s
+
+ zip1 v16.4s, v24.4s, v25.4s
+ zip2 v17.4s, v24.4s, v25.4s
+ zip1 v18.4s, v26.4s, v27.4s
+ zip2 v19.4s, v26.4s, v27.4s
+ fneg v19.4s, v19.4s
+ zip1 v20.2d, v16.2d, v18.2d
+ zip1 v21.2d, v17.2d, v19.2d
+ zip2 v22.2d, v16.2d, v18.2d
+ zip2 v23.2d, v17.2d, v19.2d
+
+ ld1 {v5.4s,v6.4s}, [x5], #32
+ ld1 {v7.2s}, [x5]
+ fsub v0.4s, v0.4s, v1.4s
+ fsub v4.4s, v4.4s, v2.4s
+ fadd v17.4s, v22.4s, v23.4s
+ fsub v19.4s, v23.4s, v22.4s
+ fadd v0.4s, v0.4s, v3.4s
+ fadd v16.4s, v20.4s, v21.4s
+ fsub v18.4s, v21.4s, v20.4s
+ fadd v0.4s, v0.4s, v4.4s
+ fmul v17.4s, v17.4s, v5.4s
+ fmul v19.4s, v19.4s, v6.4s
+ AARCH64_DUP_2D(v0, v0, 1)
+ fmul v0.2s, v0.2s, v7.2s
+
+/*
+v16 tmp[0,1,2,3]
+v17 tmp[17,16,15,14]
+v18 tmp[8,7,6,5]
+v19 tmp[9,10,11,12]
+v0 tmp[4,13]
+*/
+
+ add x0, x4, #640
+ add x5, x3, #20
+ add x6, x3, #92
+ add x7, x1, #20
+ ld1 {v1.4s,v2.4s}, [x5]
+ ld1 {v3.4s,v4.4s}, [x6]
+ ld1 {v5.4s,v6.4s}, [x7]
+ fadd v20.4s, v16.4s, v17.4s
+ fsub v21.4s, v16.4s, v17.4s
+ fmul v4.4s, v20.4s, v4.4s
+ fmla v6.4s, v21.4s, v2.4s
+ rev64 v20.4s, v20.4s
+ rev64 v21.4s, v21.4s
+ ext v20.16b, v20.16b, v20.16b, #8
+ ext v21.16b, v21.16b, v21.16b, #8
+ fmul v3.4s, v20.4s, v3.4s
+ fmla v5.4s, v21.4s, v1.4s
+ add x5, x2, #20
+ mov x9, #128
+ st1 {v3.4s,v4.4s}, [x5]
+ st1 {v5.s}[0], [x0], x9
+ st1 {v5.s}[1], [x0], x9
+ st1 {v5.s}[2], [x0], x9
+ st1 {v5.s}[3], [x0], x9
+ st1 {v6.s}[0], [x0], x9
+ st1 {v6.s}[1], [x0], x9
+ st1 {v6.s}[2], [x0], x9
+ st1 {v6.s}[3], [x0], x9
+
+ add x0, x4, #1792
+ add x5, x3, #56
+ add x6, x3, #128
+ add x7, x1, #56
+ ld1 {v1.4s}, [x3]
+ ld1 {v2.4s,v3.4s}, [x5]
+ ld1 {v4.4s}, [x6]
+ ld1 {v5.4s}, [x1]
+ ld1 {v6.4s}, [x7]
+ fadd v20.4s, v18.4s, v19.4s
+ fsub v21.4s, v18.4s, v19.4s
+ fmul v3.4s, v20.4s, v3.4s
+ fmla v5.4s, v21.4s, v1.4s
+ rev64 v20.4s, v20.4s
+ rev64 v21.4s, v21.4s
+ ext v20.16b, v20.16b, v20.16b, #8
+ ext v21.16b, v21.16b, v21.16b, #8
+ fmul v4.4s, v20.4s, v4.4s
+ fmla v6.4s, v21.4s, v2.4s
+ add x5, x2, #56
+ st1 {v3.4s}, [x2]
+ st1 {v4.4s}, [x5]
+ st1 {v5.s}[0], [x4], x9
+ st1 {v5.s}[1], [x4], x9
+ st1 {v5.s}[2], [x4], x9
+ st1 {v5.s}[3], [x4], x9
+ st1 {v6.s}[0], [x0], x9
+ st1 {v6.s}[1], [x0], x9
+ st1 {v6.s}[2], [x0], x9
+ st1 {v6.s}[3], [x0], x9
+
+ ins v1.s[0], v0.s[1]
+ ldr s2, [x3, #16]
+ ldr s3, [x3, #52]
+ ldr s4, [x3, #88]
+ ldr s5, [x3, #124]
+ ldr s6, [x1, #16]
+ ldr s7, [x1, #52]
+ fadd s16, s0, s1
+ fsub s17, s0, s1
+ fmul s4, s16, s4
+ fmul s5, s16, s5
+ fmadd s6, s17, s2, s6
+ fmadd s7, s17, s3, s7
+ str s4, [x2, #16]
+ str s5, [x2, #52]
+ str s6, [x4]
+ str s7, [x4, #1152]
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_sse.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_sse.S
new file mode 100644
index 00000000..caa391c0
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_sse.S
@@ -0,0 +1,387 @@
+/*
+ dct36_sse: SSE optimized dct36
+
+ copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#define in %edi
+#define out1 %edi
+#define out2 %edx
+#define w %ecx
+#define ts %eax
+#define tmp %esi
+
+/*
+ void dct36_sse(real *inbuf,real *o1,real *o2,real *wintab,real *tsbuf);
+*/
+
+#if !defined ( __APPLE__) && !defined (__OS2__)
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+dct36_sse_COS9:
+ .long 0x3f5db3d7
+ .long 0x3f5db3d7
+ .long 0x3f000000
+ .long 0x3f000000
+ .long 0x3f7c1c5c
+ .long 0x3f7c1c5c
+ .long 0x3f708fb2
+ .long 0x3f708fb2
+ .long 0x3f248dbb
+ .long 0x3f248dbb
+ .long 0x3e31d0d4
+ .long 0x3e31d0d4
+ .long 0x3eaf1d44
+ .long 0x3eaf1d44
+ .long 0x3f441b7d
+ .long 0x3f441b7d
+ ALIGN16
+dct36_sse_tfcos36:
+ .long 0x3f007d2b
+ .long 0x3f0483ee
+ .long 0x3f0d3b7d
+ .long 0x3f1c4257
+ .long 0x40b79454
+ .long 0x3ff746ea
+ .long 0x3f976fd9
+ .long 0x3f5f2944
+ .long 0x3f3504f3
+ ALIGN16
+dct36_sse_mask:
+ .long 0,0xffffffff,0,0xffffffff
+ ALIGN16
+dct36_sse_sign:
+ .long 0x80000000,0x80000000,0x80000000,0x80000000
+ .text
+ ALIGN16
+ .globl ASM_NAME(dct36_sse)
+ASM_NAME(dct36_sse):
+ push %ebp
+ mov %esp, %ebp
+ and $-16, %esp
+ sub $80, %esp
+ push %ebx
+ push %esi
+ push %edi
+ lea 12(%esp), tmp
+ movl 8(%ebp), in
+
+ GET_GOT
+
+ lea LOCAL_VAR(dct36_sse_COS9), %eax
+ lea LOCAL_VAR(dct36_sse_tfcos36), %edx
+
+ xorps %xmm0, %xmm0
+ xorps %xmm5, %xmm5
+ movlps 64(in), %xmm5
+ movups 48(in), %xmm4
+ movups 32(in), %xmm3
+ movups 16(in), %xmm2
+ movups (in), %xmm1
+ movaps %xmm5, %xmm6
+ shufps $0xe1, %xmm6, %xmm6
+ movaps %xmm4, %xmm7
+ shufps $0x93, %xmm7, %xmm7
+ movss %xmm7, %xmm6
+ addps %xmm6, %xmm5
+ movaps %xmm3, %xmm6
+ shufps $0x93, %xmm6, %xmm6
+ movss %xmm6, %xmm7
+ addps %xmm7, %xmm4
+ movaps %xmm2, %xmm7
+ shufps $0x93, %xmm7, %xmm7
+ movss %xmm7, %xmm6
+ addps %xmm6, %xmm3
+ movaps %xmm1, %xmm6
+ shufps $0x93, %xmm6, %xmm6
+ movss %xmm6, %xmm7
+ addps %xmm7, %xmm2
+ movss %xmm0, %xmm6
+ addps %xmm6, %xmm1
+
+ movaps LOCAL_VAR(dct36_sse_mask), %xmm0
+ movaps %xmm4, %xmm6
+ shufps $0x4e, %xmm5, %xmm4
+ movaps %xmm3, %xmm7
+ shufps $0x4e, %xmm6, %xmm3
+ andps %xmm0, %xmm6
+ addps %xmm6, %xmm4
+ movaps %xmm2, %xmm6
+ shufps $0x4e, %xmm7, %xmm2
+ andps %xmm0, %xmm7
+ addps %xmm7, %xmm3
+ movaps %xmm1, %xmm7
+ shufps $0x4e, %xmm6, %xmm1
+ andps %xmm0, %xmm6
+ addps %xmm6, %xmm2
+ movaps %xmm7, %xmm6
+ andps %xmm0, %xmm7
+ xorps %xmm0, %xmm0
+ addps %xmm7, %xmm1
+ movlhps %xmm6, %xmm0
+
+/*
+xmm0 in[-,-,0,1]
+xmm1 in[2,3,4,5]
+xmm2 in[6,7,8,9]
+xmm3 in[10,11,12,13]
+xmm4 in[14,15,16,17]
+*/
+
+ movaps %xmm2, %xmm5
+ shufps $0xe4, %xmm3, %xmm5
+ shufps $0xe4, %xmm4, %xmm3
+ shufps $0xe4, %xmm2, %xmm4
+ movaps %xmm5, %xmm2
+
+/*
+xmm2 in[6,7,12,13]
+xmm3 in[10,11,16,17]
+xmm4 in[14,15,8,9]
+*/
+
+ mulps (%eax), %xmm5
+ addps %xmm0, %xmm5
+
+ movaps %xmm0, (tmp)
+ movaps %xmm2, 16(tmp)
+
+/*
+0(tmp) in[-,-,0,1]
+xmm5 [ta33,tb33,ta66,tb66]
+*/
+
+ movaps %xmm1, %xmm6
+ subps %xmm3, %xmm6
+ subps %xmm4, %xmm6
+ xorps %xmm7, %xmm7
+ shufps $0xe0, %xmm2, %xmm7
+ mulps (%eax), %xmm6
+ subps %xmm7, %xmm0
+ addps %xmm0, %xmm6
+ movaps %xmm6, 48(tmp)
+
+ movaps 16(%eax), %xmm2
+
+ movaps %xmm1, %xmm0
+ movaps %xmm3, %xmm6
+ movaps %xmm4, %xmm7
+ mulps %xmm2, %xmm0
+ mulps 32(%eax), %xmm6
+ mulps 48(%eax), %xmm7
+ addps %xmm5, %xmm0
+ addps %xmm7, %xmm6
+ addps %xmm6, %xmm0
+ movaps %xmm0, 32(tmp)
+
+ movaps %xmm1, %xmm0
+ movaps %xmm3, %xmm6
+ movaps %xmm4, %xmm7
+ mulps 32(%eax), %xmm0
+ mulps 48(%eax), %xmm6
+ mulps %xmm2, %xmm7
+ subps %xmm5, %xmm0
+ subps %xmm6, %xmm7
+ addps %xmm7, %xmm0
+ movaps %xmm0, 64(tmp)
+
+ movaps %xmm1, %xmm6
+ movaps %xmm4, %xmm7
+ mulps 48(%eax), %xmm6
+ mulps %xmm3, %xmm2
+ mulps 32(%eax), %xmm7
+ subps %xmm5, %xmm6
+ subps %xmm7, %xmm2
+ addps %xmm2, %xmm6
+
+ movaps (tmp), %xmm0
+ movss 32(%edx), %xmm5
+ subps %xmm1, %xmm0
+ subps 16(tmp), %xmm4
+ addps %xmm3, %xmm0
+ addps %xmm4, %xmm0
+ shufps $0xaf, %xmm0, %xmm0
+ mulss %xmm5, %xmm0
+ movaps %xmm0, (tmp)
+
+ movaps 32(tmp), %xmm0
+ movaps 48(tmp), %xmm1
+ movaps 64(tmp), %xmm2
+
+/*
+xmm0 [1a-0,1b-0, 2a-0, 2b-0]
+xmm1 [1a-1,1b-1, 2a-1, 2b-1]
+xmm2 [1a-2,1b-2,-2a-2,-2b-2]
+xmm6 [1a-3,1b-3,-2a-3,-2b-3]
+*/
+
+ movaps %xmm0, %xmm3
+ unpcklps %xmm1, %xmm0
+ unpckhps %xmm1, %xmm3
+ movaps %xmm2, %xmm5
+ unpcklps %xmm6, %xmm2
+ unpckhps %xmm6, %xmm5
+ xorps LOCAL_VAR(dct36_sse_sign), %xmm5
+
+/*
+xmm0 [1a-0,1a-1,1b-0,1b-1]
+xmm3 [2a-0,2a-1,2b-0,2b-1]
+xmm2 [1a-2,1a-3,1b-2,1b-3]
+xmm5 [2a-2,2a-3,2b-2,2b-3]
+*/
+
+ movaps %xmm0, %xmm1
+ movlhps %xmm2, %xmm0
+ movhlps %xmm1, %xmm2
+ movaps %xmm3, %xmm4
+ movlhps %xmm5, %xmm3
+ movhlps %xmm4, %xmm5
+
+/*
+xmm0 tmp1a
+xmm3 tmp2a
+xmm2 tmp1b
+xmm5 tmp2b
+*/
+
+ movaps (%edx), %xmm6
+ movaps 16(%edx), %xmm7
+ movaps %xmm5, %xmm1
+ addps %xmm2, %xmm5
+ subps %xmm2, %xmm1
+ movaps %xmm3, %xmm2
+ addps %xmm0, %xmm3
+ subps %xmm0, %xmm2
+ mulps %xmm6, %xmm5
+ mulps %xmm1, %xmm7
+
+ movaps %xmm2, 16(tmp)
+
+/*
+%xmm3 tmp[0,1,2,3]
+%xmm5 tmp[17,16,15,14]
+16(tmp) tmp[8,7,6,5]
+%xmm7 tmp[9,10,11,12]
+0(tmp) tmp[13,-,4,-]
+*/
+
+ movl 12(%ebp), out1
+ movl 16(%ebp), out2
+ movl 20(%ebp), w
+ movl 24(%ebp), ts
+
+ movaps %xmm3, %xmm0
+ movaps %xmm5, %xmm1
+ movups 108(w), %xmm2
+ movups 92(w), %xmm3
+ shufps $0x1b, %xmm3, %xmm3
+ movups 36(w), %xmm4
+ movups 20(w), %xmm5
+ shufps $0x1b, %xmm5, %xmm5
+ movaps %xmm0, %xmm6
+ addps %xmm1, %xmm0
+ subps %xmm1, %xmm6
+ mulps %xmm0, %xmm2
+ mulps %xmm3, %xmm0
+ mulps %xmm6, %xmm4
+ mulps %xmm5, %xmm6
+ movups 36(out1), %xmm1
+ movups 20(out1), %xmm3
+ shufps $0x1b, %xmm6, %xmm6
+ addps %xmm4, %xmm1
+ addps %xmm6, %xmm3
+ shufps $0x1b, %xmm0, %xmm0
+ movups %xmm2, 36(out2)
+ movups %xmm0, 20(out2)
+ movss %xmm1, 32*36(ts)
+ movss %xmm3, 32*20(ts)
+ movhlps %xmm1, %xmm2
+ movhlps %xmm3, %xmm4
+ movss %xmm2, 32*44(ts)
+ movss %xmm4, 32*28(ts)
+ shufps $0xb1, %xmm1, %xmm1
+ shufps $0xb1, %xmm3, %xmm3
+ movss %xmm1, 32*40(ts)
+ movss %xmm3, 32*24(ts)
+ movhlps %xmm1, %xmm2
+ movhlps %xmm3, %xmm4
+ movss %xmm2, 32*48(ts)
+ movss %xmm4, 32*32(ts)
+
+ movss 8(tmp), %xmm0
+ movss (tmp), %xmm1
+ movss 124(w), %xmm2
+ movss 88(w), %xmm3
+ movss 52(w), %xmm4
+ movss 16(w), %xmm5
+ movss %xmm0, %xmm6
+ addss %xmm1, %xmm0
+ subss %xmm1, %xmm6
+ mulss %xmm0, %xmm2
+ mulss %xmm3, %xmm0
+ mulss %xmm6, %xmm4
+ mulss %xmm5, %xmm6
+ addss 52(out1), %xmm4
+ addss 16(out1), %xmm6
+ movss %xmm2, 52(out2)
+ movss %xmm0, 16(out2)
+ movss %xmm4, 32*52(ts)
+ movss %xmm6, 32*16(ts)
+
+ movaps 16(tmp), %xmm0
+ movaps %xmm7, %xmm1
+ MOVUAPS 128(w), %xmm2
+ movups 72(w), %xmm3
+ shufps $0x1b, %xmm2, %xmm2
+ movlps 56(w), %xmm4
+ movhps 64(w), %xmm4
+ MOVUAPS (w), %xmm5
+ shufps $0x1b, %xmm4, %xmm4
+ movaps %xmm0, %xmm6
+ addps %xmm1, %xmm0
+ subps %xmm1, %xmm6
+ mulps %xmm0, %xmm2
+ mulps %xmm3, %xmm0
+ mulps %xmm6, %xmm4
+ mulps %xmm5, %xmm6
+ movlps 56(out1), %xmm1
+ movhps 64(out1), %xmm1
+ movups (out1), %xmm3
+ shufps $0x1b, %xmm4, %xmm4
+ addps %xmm6, %xmm3
+ addps %xmm4, %xmm1
+ shufps $0x1b, %xmm2, %xmm2
+ movups %xmm0, (out2)
+ movlps %xmm2, 56(out2)
+ movhps %xmm2, 64(out2)
+ movss %xmm1, 32*56(ts)
+ movss %xmm3, (ts)
+ movhlps %xmm1, %xmm2
+ movhlps %xmm3, %xmm4
+ movss %xmm2, 32*64(ts)
+ movss %xmm4, 32*8(ts)
+ shufps $0xb1, %xmm1, %xmm1
+ shufps $0xb1, %xmm3, %xmm3
+ movss %xmm1, 32*60(ts)
+ movss %xmm3, 32*4(ts)
+ movhlps %xmm1, %xmm2
+ movhlps %xmm3, %xmm4
+ movss %xmm2, 32*68(ts)
+ movss %xmm4, 32*12(ts)
+
+ pop %edi
+ pop %esi
+ pop %ebx
+ mov %ebp, %esp
+ pop %ebp
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_x86_64.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_x86_64.S
new file mode 100644
index 00000000..35676c3f
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct36_x86_64.S
@@ -0,0 +1,394 @@
+/*
+ dct36_x86_64: SSE optimized dct36 for x86-64
+
+ copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifdef IS_MSABI
+#define in %rcx
+#define out1 %rdx
+#define out2 %r8
+#define w %r9
+#define ts %r10
+#define COS9_ %rax
+#define tfcos36_ %r11
+#else
+#define in %rdi
+#define out1 %rsi
+#define out2 %rdx
+#define w %rcx
+#define ts %r8
+#define COS9_ %rax
+#define tfcos36_ %r9
+#endif
+
+/*
+ void dct36_x86_64(real *inbuf,real *o1,real *o2,real *wintab,real *tsbuf);
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+dct36_x86_64_COS9:
+ .long 0x3f5db3d7
+ .long 0x3f5db3d7
+ .long 0x3f000000
+ .long 0x3f000000
+ .long 0x3f7c1c5c
+ .long 0x3f7c1c5c
+ .long 0x3f708fb2
+ .long 0x3f708fb2
+ .long 0x3f248dbb
+ .long 0x3f248dbb
+ .long 0x3e31d0d4
+ .long 0x3e31d0d4
+ .long 0x3eaf1d44
+ .long 0x3eaf1d44
+ .long 0x3f441b7d
+ .long 0x3f441b7d
+ ALIGN16
+dct36_x86_64_tfcos36:
+ .long 0x3f007d2b
+ .long 0x3f0483ee
+ .long 0x3f0d3b7d
+ .long 0x3f1c4257
+ .long 0x40b79454
+ .long 0x3ff746ea
+ .long 0x3f976fd9
+ .long 0x3f5f2944
+ .long 0x3f3504f3
+ ALIGN16
+dct36_x86_64_mask:
+ .long 0,0xffffffff,0,0xffffffff
+ ALIGN16
+dct36_x86_64_sign:
+ .long 0x80000000,0x80000000,0x80000000,0x80000000
+ .text
+ ALIGN16
+ .globl ASM_NAME(dct36_x86_64)
+ASM_NAME(dct36_x86_64):
+#ifdef IS_MSABI
+ push %rbp
+ mov %rsp, %rbp
+ sub $160, %rsp
+ movaps %xmm6, (%rsp)
+ movaps %xmm7, 16(%rsp)
+ movaps %xmm8, 32(%rsp)
+ movaps %xmm9, 48(%rsp)
+ movaps %xmm10, 64(%rsp)
+ movaps %xmm11, 80(%rsp)
+ movaps %xmm12, 96(%rsp)
+ movaps %xmm13, 112(%rsp)
+ movaps %xmm14, 128(%rsp)
+ movaps %xmm15, 144(%rsp)
+ movq 48(%rbp), ts
+#endif
+ lea dct36_x86_64_COS9(%rip), COS9_
+ lea dct36_x86_64_tfcos36(%rip), tfcos36_
+
+ xorps %xmm5, %xmm5
+ movups (in), %xmm1
+ movups 16(in), %xmm2
+ movups 32(in), %xmm3
+ movups 48(in), %xmm4
+ movlps 64(in), %xmm5
+ xorps %xmm6, %xmm6
+ movaps %xmm1, %xmm7
+ shufps $0x93, %xmm7, %xmm7
+ movaps %xmm2, %xmm8
+ shufps $0x93, %xmm8, %xmm8
+ movaps %xmm3, %xmm9
+ shufps $0x93, %xmm9, %xmm9
+ movaps %xmm4, %xmm10
+ shufps $0x93, %xmm10, %xmm10
+ movaps %xmm5, %xmm11
+ shufps $0xe1, %xmm11, %xmm11
+ movss %xmm10, %xmm11
+ addps %xmm11, %xmm5
+ movss %xmm9, %xmm10
+ addps %xmm10, %xmm4
+ movss %xmm8, %xmm9
+ addps %xmm9, %xmm3
+ movss %xmm7, %xmm8
+ addps %xmm8, %xmm2
+ movss %xmm6, %xmm7
+ addps %xmm7, %xmm1
+
+ movaps dct36_x86_64_mask(%rip), %xmm0
+ movaps %xmm4, %xmm6
+ shufps $0x4e, %xmm5, %xmm4
+ movaps %xmm3, %xmm7
+ shufps $0x4e, %xmm6, %xmm3
+ andps %xmm0, %xmm6
+ addps %xmm6, %xmm4
+ movaps %xmm2, %xmm6
+ shufps $0x4e, %xmm7, %xmm2
+ andps %xmm0, %xmm7
+ addps %xmm7, %xmm3
+ movaps %xmm1, %xmm7
+ shufps $0x4e, %xmm6, %xmm1
+ andps %xmm0, %xmm6
+ addps %xmm6, %xmm2
+ movaps %xmm7, %xmm6
+ andps %xmm0, %xmm7
+ xorps %xmm0, %xmm0
+ addps %xmm7, %xmm1
+ movlhps %xmm6, %xmm0
+
+/*
+xmm0 in[-,-,0,1]
+xmm1 in[2,3,4,5]
+xmm2 in[6,7,8,9]
+xmm3 in[10,11,12,13]
+xmm4 in[14,15,16,17]
+*/
+
+ movaps %xmm2, %xmm5
+ shufps $0xe4, %xmm3, %xmm5
+ shufps $0xe4, %xmm4, %xmm3
+ shufps $0xe4, %xmm2, %xmm4
+ movaps %xmm5, %xmm2
+/*
+xmm2 in[6,7,12,13]
+xmm3 in[10,11,16,17]
+xmm4 in[14,15,8,9]
+*/
+
+ movaps (COS9_), %xmm15
+ movaps 16(COS9_), %xmm6
+ movaps 32(COS9_), %xmm7
+ movaps 48(COS9_), %xmm8
+ mulps %xmm15, %xmm5
+ addps %xmm0, %xmm5
+
+/*
+xmm5 [ta33,tb33,ta66,tb66]
+xmm6 COS9_[1,1,2,2]
+xmm7 COS9_[5,5,8,8]
+xmm8 COS9_[7,7,4,4]
+xmm15 COS9_[3,3,6,6]
+*/
+ movaps %xmm6, %xmm9
+ movaps %xmm7, %xmm12
+ movaps %xmm8, %xmm13
+ mulps %xmm1, %xmm9
+ mulps %xmm3, %xmm12
+ mulps %xmm4, %xmm13
+ addps %xmm5, %xmm9
+ addps %xmm13, %xmm12
+ addps %xmm9, %xmm12
+
+ movaps %xmm1, %xmm13
+ subps %xmm3, %xmm13
+ movaps %xmm0, %xmm10
+ shufps $0xe0, %xmm2, %xmm10
+ movaps %xmm0, %xmm14
+ subps %xmm10, %xmm14
+ subps %xmm4, %xmm13
+ mulps %xmm15, %xmm13
+ addps %xmm14, %xmm13
+
+ movaps %xmm7, %xmm9
+ movaps %xmm8, %xmm15
+ movaps %xmm6, %xmm14
+ mulps %xmm1, %xmm9
+ mulps %xmm3, %xmm15
+ mulps %xmm4, %xmm14
+ subps %xmm5, %xmm9
+ subps %xmm15, %xmm14
+ addps %xmm9, %xmm14
+
+ mulps %xmm1, %xmm8
+ mulps %xmm3, %xmm6
+ mulps %xmm4, %xmm7
+ subps %xmm5, %xmm8
+ subps %xmm7, %xmm6
+ addps %xmm6, %xmm8
+ movaps %xmm8, %xmm15
+
+ movss 32(tfcos36_), %xmm5
+ subps %xmm1, %xmm0
+ subps %xmm2, %xmm4
+ addps %xmm3, %xmm0
+ addps %xmm4, %xmm0
+ shufps $0xaf, %xmm0, %xmm0
+ mulss %xmm5, %xmm0
+ movaps %xmm0, %xmm11
+
+/*
+xmm12 [1a-0,1b-0, 2a-0, 2b-0]
+xmm13 [1a-1,1b-1, 2a-1, 2b-1]
+xmm14 [1a-2,1b-2,-2a-2,-2b-2]
+xmm15 [1a-3,1b-3,-2a-3,-2b-3]
+*/
+ movaps %xmm12, %xmm5
+ unpckhps %xmm13, %xmm5
+ unpcklps %xmm13, %xmm12
+ movaps %xmm14, %xmm6
+ unpckhps %xmm15, %xmm6
+ unpcklps %xmm15, %xmm14
+ xorps dct36_x86_64_sign(%rip), %xmm6
+
+/*
+xmm12 [1a-0,1a-1,1b-0,1b-1]
+xmm5 [2a-0,2a-1,2b-0,2b-1]
+xmm14 [1a-2,1a-3,1b-2,1b-3]
+xmm6 [2a-2,2a-3,2b-2,2b-3]
+*/
+
+ movaps %xmm12, %xmm0
+ movlhps %xmm14, %xmm12
+ movhlps %xmm0, %xmm14
+ movaps %xmm5, %xmm0
+ movlhps %xmm6, %xmm0
+ movhlps %xmm5, %xmm6
+ movaps %xmm6, %xmm15
+
+/*
+xmm12 tmp1a
+xmm0 tmp2a
+xmm14 tmp1b
+xmm15 tmp2b
+*/
+
+ movaps (tfcos36_), %xmm6
+ movaps 16(tfcos36_), %xmm7
+ movaps %xmm15, %xmm10
+ addps %xmm14, %xmm15
+ subps %xmm14, %xmm10
+ movaps %xmm0, %xmm14
+ addps %xmm12, %xmm0
+ subps %xmm12, %xmm14
+ mulps %xmm6, %xmm15
+ mulps %xmm10, %xmm7
+
+/*
+%xmm0 tmp[0,1,2,3]
+%xmm15 tmp[17,16,15,14]
+%xmm14 tmp[8,7,6,5]
+%xmm7 tmp[9,10,11,12]
+%xmm11 tmp[13,-,4,-]
+*/
+
+ movaps %xmm15, %xmm1
+ movups 108(w), %xmm2
+ movups 92(w), %xmm3
+ shufps $0x1b, %xmm3, %xmm3
+ movups 36(w), %xmm4
+ movups 20(w), %xmm5
+ shufps $0x1b, %xmm5, %xmm5
+ movaps %xmm0, %xmm6
+ addps %xmm1, %xmm0
+ subps %xmm1, %xmm6
+ mulps %xmm0, %xmm2
+ mulps %xmm3, %xmm0
+ mulps %xmm6, %xmm4
+ mulps %xmm5, %xmm6
+ movups 36(out1), %xmm1
+ movups 20(out1), %xmm3
+ shufps $0x1b, %xmm6, %xmm6
+ addps %xmm4, %xmm1
+ addps %xmm6, %xmm3
+ shufps $0x1b, %xmm0, %xmm0
+ movups %xmm2, 36(out2)
+ movups %xmm0, 20(out2)
+ movss %xmm1, 32*36(ts)
+ movss %xmm3, 32*20(ts)
+ movhlps %xmm1, %xmm2
+ movhlps %xmm3, %xmm4
+ movss %xmm2, 32*44(ts)
+ movss %xmm4, 32*28(ts)
+ shufps $0xb1, %xmm1, %xmm1
+ shufps $0xb1, %xmm3, %xmm3
+ movss %xmm1, 32*40(ts)
+ movss %xmm3, 32*24(ts)
+ movhlps %xmm1, %xmm2
+ movhlps %xmm3, %xmm4
+ movss %xmm2, 32*48(ts)
+ movss %xmm4, 32*32(ts)
+
+ movhlps %xmm11, %xmm0
+ movaps %xmm11, %xmm1
+ movss 124(w), %xmm2
+ movss 88(w), %xmm3
+ movss 52(w), %xmm4
+ movss 16(w), %xmm5
+ movss %xmm0, %xmm6
+ addss %xmm1, %xmm0
+ subss %xmm1, %xmm6
+ mulss %xmm0, %xmm2
+ mulss %xmm3, %xmm0
+ mulss %xmm6, %xmm4
+ mulss %xmm5, %xmm6
+ addss 52(out1), %xmm4
+ addss 16(out1), %xmm6
+ movss %xmm2, 52(out2)
+ movss %xmm0, 16(out2)
+ movss %xmm4, 32*52(ts)
+ movss %xmm6, 32*16(ts)
+
+ movaps %xmm14, %xmm0
+ movaps %xmm7, %xmm1
+ MOVUAPS 128(w), %xmm2
+ movups 72(w), %xmm3
+ shufps $0x1b, %xmm2, %xmm2
+ movlps 56(w), %xmm4
+ movhps 64(w), %xmm4
+ MOVUAPS (w), %xmm5
+ shufps $0x1b, %xmm4, %xmm4
+ movaps %xmm0, %xmm6
+ addps %xmm1, %xmm0
+ subps %xmm1, %xmm6
+ mulps %xmm0, %xmm2
+ mulps %xmm3, %xmm0
+ mulps %xmm6, %xmm4
+ mulps %xmm5, %xmm6
+ movlps 56(out1), %xmm1
+ movhps 64(out1), %xmm1
+ movups (out1), %xmm3
+ shufps $0x1b, %xmm4, %xmm4
+ addps %xmm6, %xmm3
+ addps %xmm4, %xmm1
+ shufps $0x1b, %xmm2, %xmm2
+ movups %xmm0, (out2)
+ movlps %xmm2, 56(out2)
+ movhps %xmm2, 64(out2)
+ movss %xmm1, 32*56(ts)
+ movss %xmm3, (ts)
+ movhlps %xmm1, %xmm2
+ movhlps %xmm3, %xmm4
+ movss %xmm2, 32*64(ts)
+ movss %xmm4, 32*8(ts)
+ shufps $0xb1, %xmm1, %xmm1
+ shufps $0xb1, %xmm3, %xmm3
+ movss %xmm1, 32*60(ts)
+ movss %xmm3, 32*4(ts)
+ movhlps %xmm1, %xmm2
+ movhlps %xmm3, %xmm4
+ movss %xmm2, 32*68(ts)
+ movss %xmm4, 32*12(ts)
+
+#ifdef IS_MSABI
+ movaps (%rsp), %xmm6
+ movaps 16(%rsp), %xmm7
+ movaps 32(%rsp), %xmm8
+ movaps 48(%rsp), %xmm9
+ movaps 64(%rsp), %xmm10
+ movaps 80(%rsp), %xmm11
+ movaps 96(%rsp), %xmm12
+ movaps 112(%rsp), %xmm13
+ movaps 128(%rsp), %xmm14
+ movaps 144(%rsp), %xmm15
+ mov %rbp, %rsp
+ pop %rbp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64.c
new file mode 100644
index 00000000..a49d308b
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64.c
@@ -0,0 +1,175 @@
+/*
+ dct64.c: DCT64, the plain C version
+
+ copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp
+*/
+
+/*
+ * Discrete Cosine Tansform (DCT) for subband synthesis
+ *
+ * -funroll-loops (for gcc) will remove the loops for better performance
+ * using loops in the source-code enhances readabillity
+ *
+ *
+ * TODO: write an optimized version for the down-sampling modes
+ * (in these modes the bands 16-31 (2:1) or 8-31 (4:1) are zero
+ */
+
+#include "mpg123lib_intern.h"
+
+void dct64(real *out0,real *out1,real *samples)
+{
+ real bufs[64];
+
+ {
+ register int i,j;
+ register real *b1,*b2,*bs;
+ register const real *costab;
+
+ b1 = samples;
+ bs = bufs;
+ costab = pnts[0]+16;
+ b2 = b1 + 32;
+
+ for(i=15;i>=0;i--)
+ *bs++ = (*b1++ + *--b2);
+ for(i=15;i>=0;i--)
+ *bs++ = REAL_MUL((*--b2 - *b1++), *--costab);
+
+ b1 = bufs;
+ costab = pnts[1]+8;
+ b2 = b1 + 16;
+
+ {
+ for(i=7;i>=0;i--)
+ *bs++ = (*b1++ + *--b2);
+ for(i=7;i>=0;i--)
+ *bs++ = REAL_MUL((*--b2 - *b1++), *--costab);
+ b2 += 32;
+ costab += 8;
+ for(i=7;i>=0;i--)
+ *bs++ = (*b1++ + *--b2);
+ for(i=7;i>=0;i--)
+ *bs++ = REAL_MUL((*b1++ - *--b2), *--costab);
+ b2 += 32;
+ }
+
+ bs = bufs;
+ costab = pnts[2];
+ b2 = b1 + 8;
+
+ for(j=2;j;j--)
+ {
+ for(i=3;i>=0;i--)
+ *bs++ = (*b1++ + *--b2);
+ for(i=3;i>=0;i--)
+ *bs++ = REAL_MUL((*--b2 - *b1++), costab[i]);
+ b2 += 16;
+ for(i=3;i>=0;i--)
+ *bs++ = (*b1++ + *--b2);
+ for(i=3;i>=0;i--)
+ *bs++ = REAL_MUL((*b1++ - *--b2), costab[i]);
+ b2 += 16;
+ }
+
+ b1 = bufs;
+ costab = pnts[3];
+ b2 = b1 + 4;
+
+ for(j=4;j;j--)
+ {
+ *bs++ = (*b1++ + *--b2);
+ *bs++ = (*b1++ + *--b2);
+ *bs++ = REAL_MUL((*--b2 - *b1++), costab[1]);
+ *bs++ = REAL_MUL((*--b2 - *b1++), costab[0]);
+ b2 += 8;
+ *bs++ = (*b1++ + *--b2);
+ *bs++ = (*b1++ + *--b2);
+ *bs++ = REAL_MUL((*b1++ - *--b2), costab[1]);
+ *bs++ = REAL_MUL((*b1++ - *--b2), costab[0]);
+ b2 += 8;
+ }
+ bs = bufs;
+ costab = pnts[4];
+
+ for(j=8;j;j--)
+ {
+ real v0,v1;
+ v0=*b1++; v1 = *b1++;
+ *bs++ = (v0 + v1);
+ *bs++ = REAL_MUL((v0 - v1), (*costab));
+ v0=*b1++; v1 = *b1++;
+ *bs++ = (v0 + v1);
+ *bs++ = REAL_MUL((v1 - v0), (*costab));
+ }
+
+ }
+
+
+ {
+ register real *b1;
+ register int i;
+
+ for(b1=bufs,i=8;i;i--,b1+=4)
+ b1[2] += b1[3];
+
+ for(b1=bufs,i=4;i;i--,b1+=8)
+ {
+ b1[4] += b1[6];
+ b1[6] += b1[5];
+ b1[5] += b1[7];
+ }
+
+ for(b1=bufs,i=2;i;i--,b1+=16)
+ {
+ b1[8] += b1[12];
+ b1[12] += b1[10];
+ b1[10] += b1[14];
+ b1[14] += b1[9];
+ b1[9] += b1[13];
+ b1[13] += b1[11];
+ b1[11] += b1[15];
+ }
+ }
+
+
+ out0[0x10*16] = REAL_SCALE_DCT64(bufs[0]);
+ out0[0x10*15] = REAL_SCALE_DCT64(bufs[16+0] + bufs[16+8]);
+ out0[0x10*14] = REAL_SCALE_DCT64(bufs[8]);
+ out0[0x10*13] = REAL_SCALE_DCT64(bufs[16+8] + bufs[16+4]);
+ out0[0x10*12] = REAL_SCALE_DCT64(bufs[4]);
+ out0[0x10*11] = REAL_SCALE_DCT64(bufs[16+4] + bufs[16+12]);
+ out0[0x10*10] = REAL_SCALE_DCT64(bufs[12]);
+ out0[0x10* 9] = REAL_SCALE_DCT64(bufs[16+12] + bufs[16+2]);
+ out0[0x10* 8] = REAL_SCALE_DCT64(bufs[2]);
+ out0[0x10* 7] = REAL_SCALE_DCT64(bufs[16+2] + bufs[16+10]);
+ out0[0x10* 6] = REAL_SCALE_DCT64(bufs[10]);
+ out0[0x10* 5] = REAL_SCALE_DCT64(bufs[16+10] + bufs[16+6]);
+ out0[0x10* 4] = REAL_SCALE_DCT64(bufs[6]);
+ out0[0x10* 3] = REAL_SCALE_DCT64(bufs[16+6] + bufs[16+14]);
+ out0[0x10* 2] = REAL_SCALE_DCT64(bufs[14]);
+ out0[0x10* 1] = REAL_SCALE_DCT64(bufs[16+14] + bufs[16+1]);
+ out0[0x10* 0] = REAL_SCALE_DCT64(bufs[1]);
+
+ out1[0x10* 0] = REAL_SCALE_DCT64(bufs[1]);
+ out1[0x10* 1] = REAL_SCALE_DCT64(bufs[16+1] + bufs[16+9]);
+ out1[0x10* 2] = REAL_SCALE_DCT64(bufs[9]);
+ out1[0x10* 3] = REAL_SCALE_DCT64(bufs[16+9] + bufs[16+5]);
+ out1[0x10* 4] = REAL_SCALE_DCT64(bufs[5]);
+ out1[0x10* 5] = REAL_SCALE_DCT64(bufs[16+5] + bufs[16+13]);
+ out1[0x10* 6] = REAL_SCALE_DCT64(bufs[13]);
+ out1[0x10* 7] = REAL_SCALE_DCT64(bufs[16+13] + bufs[16+3]);
+ out1[0x10* 8] = REAL_SCALE_DCT64(bufs[3]);
+ out1[0x10* 9] = REAL_SCALE_DCT64(bufs[16+3] + bufs[16+11]);
+ out1[0x10*10] = REAL_SCALE_DCT64(bufs[11]);
+ out1[0x10*11] = REAL_SCALE_DCT64(bufs[16+11] + bufs[16+7]);
+ out1[0x10*12] = REAL_SCALE_DCT64(bufs[7]);
+ out1[0x10*13] = REAL_SCALE_DCT64(bufs[16+7] + bufs[16+15]);
+ out1[0x10*14] = REAL_SCALE_DCT64(bufs[15]);
+ out1[0x10*15] = REAL_SCALE_DCT64(bufs[16+15]);
+
+}
+
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_3dnow.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_3dnow.S
new file mode 100644
index 00000000..99e6a2cd
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_3dnow.S
@@ -0,0 +1,749 @@
+/*
+ dct64_3dnow.s: Replacement of dct64() with AMD's 3DNow! SIMD operations support
+
+ copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Syuuhei Kashiyama
+
+ Original "license" statement:
+ The author of this program disclaim whole expressed or implied
+ warranties with regard to this program, and in no event shall the
+ author of this program liable to whatever resulted from the use of
+ this program. Use it at your own risk.
+*/
+
+#include "mangle.h"
+
+ .globl ASM_NAME(dct64_3dnow)
+/* .type ASM_NAME(dct64_3dnow),@function */
+ASM_NAME(dct64_3dnow):
+ subl $256,%esp
+ pushl %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+
+ #undef _EBX_
+ #define _EBX_ %ecx
+ GET_GOT
+
+ leal 16(%esp),%ebx
+ movl 284(%esp),%edi
+ movl 276(%esp),%ebp
+ movl 280(%esp),%edx
+ leal 128(%ebx),%esi
+
+ /* femms */
+
+ /* 1 */
+#if defined(PIC) && defined(__APPLE__)
+ movl GLOBAL_VAR_PTR(pnts),%eax
+ movl (%eax),%eax
+#else
+ movl GLOBAL_VAR(pnts),%eax
+#endif
+ movq 0(%edi),%mm0
+ movq %mm0,%mm1
+ movd 124(%edi),%mm2
+ punpckldq 120(%edi),%mm2
+ movq 0(%eax),%mm3
+ pfadd %mm2,%mm0
+ movq %mm0,0(%ebx)
+ pfsub %mm2,%mm1
+ pfmul %mm3,%mm1
+ movd %mm1,124(%ebx)
+ psrlq $32,%mm1
+ movd %mm1,120(%ebx)
+ movq 8(%edi),%mm4
+ movq %mm4,%mm5
+ movd 116(%edi),%mm6
+ punpckldq 112(%edi),%mm6
+ movq 8(%eax),%mm7
+ pfadd %mm6,%mm4
+ movq %mm4,8(%ebx)
+ pfsub %mm6,%mm5
+ pfmul %mm7,%mm5
+ movd %mm5,116(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,112(%ebx)
+ movq 16(%edi),%mm0
+ movq %mm0,%mm1
+ movd 108(%edi),%mm2
+ punpckldq 104(%edi),%mm2
+ movq 16(%eax),%mm3
+ pfadd %mm2,%mm0
+ movq %mm0,16(%ebx)
+ pfsub %mm2,%mm1
+ pfmul %mm3,%mm1
+ movd %mm1,108(%ebx)
+ psrlq $32,%mm1
+ movd %mm1,104(%ebx)
+ movq 24(%edi),%mm4
+ movq %mm4,%mm5
+ movd 100(%edi),%mm6
+ punpckldq 96(%edi),%mm6
+ movq 24(%eax),%mm7
+ pfadd %mm6,%mm4
+ movq %mm4,24(%ebx)
+ pfsub %mm6,%mm5
+ pfmul %mm7,%mm5
+ movd %mm5,100(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,96(%ebx)
+ movq 32(%edi),%mm0
+ movq %mm0,%mm1
+ movd 92(%edi),%mm2
+ punpckldq 88(%edi),%mm2
+ movq 32(%eax),%mm3
+ pfadd %mm2,%mm0
+ movq %mm0,32(%ebx)
+ pfsub %mm2,%mm1
+ pfmul %mm3,%mm1
+ movd %mm1,92(%ebx)
+ psrlq $32,%mm1
+ movd %mm1,88(%ebx)
+ movq 40(%edi),%mm4
+ movq %mm4,%mm5
+ movd 84(%edi),%mm6
+ punpckldq 80(%edi),%mm6
+ movq 40(%eax),%mm7
+ pfadd %mm6,%mm4
+ movq %mm4,40(%ebx)
+ pfsub %mm6,%mm5
+ pfmul %mm7,%mm5
+ movd %mm5,84(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,80(%ebx)
+ movq 48(%edi),%mm0
+ movq %mm0,%mm1
+ movd 76(%edi),%mm2
+ punpckldq 72(%edi),%mm2
+ movq 48(%eax),%mm3
+ pfadd %mm2,%mm0
+ movq %mm0,48(%ebx)
+ pfsub %mm2,%mm1
+ pfmul %mm3,%mm1
+ movd %mm1,76(%ebx)
+ psrlq $32,%mm1
+ movd %mm1,72(%ebx)
+ movq 56(%edi),%mm4
+ movq %mm4,%mm5
+ movd 68(%edi),%mm6
+ punpckldq 64(%edi),%mm6
+ movq 56(%eax),%mm7
+ pfadd %mm6,%mm4
+ movq %mm4,56(%ebx)
+ pfsub %mm6,%mm5
+ pfmul %mm7,%mm5
+ movd %mm5,68(%ebx)
+ psrlq $32,%mm5
+ movd %mm5,64(%ebx)
+
+ /* 2 */
+#if defined(PIC) && defined(__APPLE__)
+ movl GLOBAL_VAR_PTR(pnts),%eax
+ movl 4(%eax),%eax
+#else
+ movl 4+GLOBAL_VAR(pnts),%eax
+#endif
+ /* 0,14 */
+ movq 0(%ebx),%mm0
+ movq %mm0,%mm1
+ movd 60(%ebx),%mm2
+ punpckldq 56(%ebx),%mm2
+ movq 0(%eax),%mm3
+ pfadd %mm2,%mm0
+ movq %mm0,0(%esi)
+ pfsub %mm2,%mm1
+ pfmul %mm3,%mm1
+ movd %mm1,60(%esi)
+ psrlq $32,%mm1
+ movd %mm1,56(%esi)
+ /* 16,30 */
+ movq 64(%ebx),%mm0
+ movq %mm0,%mm1
+ movd 124(%ebx),%mm2
+ punpckldq 120(%ebx),%mm2
+ pfadd %mm2,%mm0
+ movq %mm0,64(%esi)
+ pfsubr %mm2,%mm1
+ pfmul %mm3,%mm1
+ movd %mm1,124(%esi)
+ psrlq $32,%mm1
+ movd %mm1,120(%esi)
+ /* 2,12 */
+ movq 8(%ebx),%mm4
+ movq %mm4,%mm5
+ movd 52(%ebx),%mm6
+ punpckldq 48(%ebx),%mm6
+ movq 8(%eax),%mm7
+ pfadd %mm6,%mm4
+ movq %mm4,8(%esi)
+ pfsub %mm6,%mm5
+ pfmul %mm7,%mm5
+ movd %mm5,52(%esi)
+ psrlq $32,%mm5
+ movd %mm5,48(%esi)
+ /* 18,28 */
+ movq 72(%ebx),%mm4
+ movq %mm4,%mm5
+ movd 116(%ebx),%mm6
+ punpckldq 112(%ebx),%mm6
+ pfadd %mm6,%mm4
+ movq %mm4,72(%esi)
+ pfsubr %mm6,%mm5
+ pfmul %mm7,%mm5
+ movd %mm5,116(%esi)
+ psrlq $32,%mm5
+ movd %mm5,112(%esi)
+ /* 4,10 */
+ movq 16(%ebx),%mm0
+ movq %mm0,%mm1
+ movd 44(%ebx),%mm2
+ punpckldq 40(%ebx),%mm2
+ movq 16(%eax),%mm3
+ pfadd %mm2,%mm0
+ movq %mm0,16(%esi)
+ pfsub %mm2,%mm1
+ pfmul %mm3,%mm1
+ movd %mm1,44(%esi)
+ psrlq $32,%mm1
+ movd %mm1,40(%esi)
+ /* 20,26 */
+ movq 80(%ebx),%mm0
+ movq %mm0,%mm1
+ movd 108(%ebx),%mm2
+ punpckldq 104(%ebx),%mm2
+ pfadd %mm2,%mm0
+ movq %mm0,80(%esi)
+ pfsubr %mm2,%mm1
+ pfmul %mm3,%mm1
+ movd %mm1,108(%esi)
+ psrlq $32,%mm1
+ movd %mm1,104(%esi)
+ /* 6,8 */
+ movq 24(%ebx),%mm4
+ movq %mm4,%mm5
+ movd 36(%ebx),%mm6
+ punpckldq 32(%ebx),%mm6
+ movq 24(%eax),%mm7
+ pfadd %mm6,%mm4
+ movq %mm4,24(%esi)
+ pfsub %mm6,%mm5
+ pfmul %mm7,%mm5
+ movd %mm5,36(%esi)
+ psrlq $32,%mm5
+ movd %mm5,32(%esi)
+ /* 22,24 */
+ movq 88(%ebx),%mm4
+ movq %mm4,%mm5
+ movd 100(%ebx),%mm6
+ punpckldq 96(%ebx),%mm6
+ pfadd %mm6,%mm4
+ movq %mm4,88(%esi)
+ pfsubr %mm6,%mm5
+ pfmul %mm7,%mm5
+ movd %mm5,100(%esi)
+ psrlq $32,%mm5
+ movd %mm5,96(%esi)
+
+ /* 3 */
+#if defined(PIC) && defined(__APPLE__)
+ movl GLOBAL_VAR_PTR(pnts),%eax
+ movl 8(%eax),%eax
+#else
+ movl 8+GLOBAL_VAR(pnts),%eax
+#endif
+ movq 0(%eax),%mm0
+ movq 8(%eax),%mm1
+ /* 0,6 */
+ movq 0(%esi),%mm2
+ movq %mm2,%mm3
+ movd 28(%esi),%mm4
+ punpckldq 24(%esi),%mm4
+ pfadd %mm4,%mm2
+ pfsub %mm4,%mm3
+ pfmul %mm0,%mm3
+ movq %mm2,0(%ebx)
+ movd %mm3,28(%ebx)
+ psrlq $32,%mm3
+ movd %mm3,24(%ebx)
+ /* 2,4 */
+ movq 8(%esi),%mm5
+ movq %mm5,%mm6
+ movd 20(%esi),%mm7
+ punpckldq 16(%esi),%mm7
+ pfadd %mm7,%mm5
+ pfsub %mm7,%mm6
+ pfmul %mm1,%mm6
+ movq %mm5,8(%ebx)
+ movd %mm6,20(%ebx)
+ psrlq $32,%mm6
+ movd %mm6,16(%ebx)
+ /* 8,14 */
+ movq 32(%esi),%mm2
+ movq %mm2,%mm3
+ movd 60(%esi),%mm4
+ punpckldq 56(%esi),%mm4
+ pfadd %mm4,%mm2
+ pfsubr %mm4,%mm3
+ pfmul %mm0,%mm3
+ movq %mm2,32(%ebx)
+ movd %mm3,60(%ebx)
+ psrlq $32,%mm3
+ movd %mm3,56(%ebx)
+ /* 10,12 */
+ movq 40(%esi),%mm5
+ movq %mm5,%mm6
+ movd 52(%esi),%mm7
+ punpckldq 48(%esi),%mm7
+ pfadd %mm7,%mm5
+ pfsubr %mm7,%mm6
+ pfmul %mm1,%mm6
+ movq %mm5,40(%ebx)
+ movd %mm6,52(%ebx)
+ psrlq $32,%mm6
+ movd %mm6,48(%ebx)
+ /* 16,22 */
+ movq 64(%esi),%mm2
+ movq %mm2,%mm3
+ movd 92(%esi),%mm4
+ punpckldq 88(%esi),%mm4
+ pfadd %mm4,%mm2
+ pfsub %mm4,%mm3
+ pfmul %mm0,%mm3
+ movq %mm2,64(%ebx)
+ movd %mm3,92(%ebx)
+ psrlq $32,%mm3
+ movd %mm3,88(%ebx)
+ /* 18,20 */
+ movq 72(%esi),%mm5
+ movq %mm5,%mm6
+ movd 84(%esi),%mm7
+ punpckldq 80(%esi),%mm7
+ pfadd %mm7,%mm5
+ pfsub %mm7,%mm6
+ pfmul %mm1,%mm6
+ movq %mm5,72(%ebx)
+ movd %mm6,84(%ebx)
+ psrlq $32,%mm6
+ movd %mm6,80(%ebx)
+ /* 24,30 */
+ movq 96(%esi),%mm2
+ movq %mm2,%mm3
+ movd 124(%esi),%mm4
+ punpckldq 120(%esi),%mm4
+ pfadd %mm4,%mm2
+ pfsubr %mm4,%mm3
+ pfmul %mm0,%mm3
+ movq %mm2,96(%ebx)
+ movd %mm3,124(%ebx)
+ psrlq $32,%mm3
+ movd %mm3,120(%ebx)
+ /* 26,28 */
+ movq 104(%esi),%mm5
+ movq %mm5,%mm6
+ movd 116(%esi),%mm7
+ punpckldq 112(%esi),%mm7
+ pfadd %mm7,%mm5
+ pfsubr %mm7,%mm6
+ pfmul %mm1,%mm6
+ movq %mm5,104(%ebx)
+ movd %mm6,116(%ebx)
+ psrlq $32,%mm6
+ movd %mm6,112(%ebx)
+
+ /* 4 */
+#if defined(PIC) && defined(__APPLE__)
+ movl GLOBAL_VAR_PTR(pnts),%eax
+ movl 12(%eax),%eax
+#else
+ movl 12+GLOBAL_VAR(pnts),%eax
+#endif
+ movq 0(%eax),%mm0
+ /* 0 */
+ movq 0(%ebx),%mm1
+ movq %mm1,%mm2
+ movd 12(%ebx),%mm3
+ punpckldq 8(%ebx),%mm3
+ pfadd %mm3,%mm1
+ pfsub %mm3,%mm2
+ pfmul %mm0,%mm2
+ movq %mm1,0(%esi)
+ movd %mm2,12(%esi)
+ psrlq $32,%mm2
+ movd %mm2,8(%esi)
+ /* 4 */
+ movq 16(%ebx),%mm4
+ movq %mm4,%mm5
+ movd 28(%ebx),%mm6
+ punpckldq 24(%ebx),%mm6
+ pfadd %mm6,%mm4
+ pfsubr %mm6,%mm5
+ pfmul %mm0,%mm5
+ movq %mm4,16(%esi)
+ movd %mm5,28(%esi)
+ psrlq $32,%mm5
+ movd %mm5,24(%esi)
+ /* 8 */
+ movq 32(%ebx),%mm1
+ movq %mm1,%mm2
+ movd 44(%ebx),%mm3
+ punpckldq 40(%ebx),%mm3
+ pfadd %mm3,%mm1
+ pfsub %mm3,%mm2
+ pfmul %mm0,%mm2
+ movq %mm1,32(%esi)
+ movd %mm2,44(%esi)
+ psrlq $32,%mm2
+ movd %mm2,40(%esi)
+ /* 12 */
+ movq 48(%ebx),%mm4
+ movq %mm4,%mm5
+ movd 60(%ebx),%mm6
+ punpckldq 56(%ebx),%mm6
+ pfadd %mm6,%mm4
+ pfsubr %mm6,%mm5
+ pfmul %mm0,%mm5
+ movq %mm4,48(%esi)
+ movd %mm5,60(%esi)
+ psrlq $32,%mm5
+ movd %mm5,56(%esi)
+ /* 16 */
+ movq 64(%ebx),%mm1
+ movq %mm1,%mm2
+ movd 76(%ebx),%mm3
+ punpckldq 72(%ebx),%mm3
+ pfadd %mm3,%mm1
+ pfsub %mm3,%mm2
+ pfmul %mm0,%mm2
+ movq %mm1,64(%esi)
+ movd %mm2,76(%esi)
+ psrlq $32,%mm2
+ movd %mm2,72(%esi)
+ /* 20 */
+ movq 80(%ebx),%mm4
+ movq %mm4,%mm5
+ movd 92(%ebx),%mm6
+ punpckldq 88(%ebx),%mm6
+ pfadd %mm6,%mm4
+ pfsubr %mm6,%mm5
+ pfmul %mm0,%mm5
+ movq %mm4,80(%esi)
+ movd %mm5,92(%esi)
+ psrlq $32,%mm5
+ movd %mm5,88(%esi)
+ /* 24 */
+ movq 96(%ebx),%mm1
+ movq %mm1,%mm2
+ movd 108(%ebx),%mm3
+ punpckldq 104(%ebx),%mm3
+ pfadd %mm3,%mm1
+ pfsub %mm3,%mm2
+ pfmul %mm0,%mm2
+ movq %mm1,96(%esi)
+ movd %mm2,108(%esi)
+ psrlq $32,%mm2
+ movd %mm2,104(%esi)
+ /* 28 */
+ movq 112(%ebx),%mm4
+ movq %mm4,%mm5
+ movd 124(%ebx),%mm6
+ punpckldq 120(%ebx),%mm6
+ pfadd %mm6,%mm4
+ pfsubr %mm6,%mm5
+ pfmul %mm0,%mm5
+ movq %mm4,112(%esi)
+ movd %mm5,124(%esi)
+ psrlq $32,%mm5
+ movd %mm5,120(%esi)
+
+ /* 5 */
+ movl $-1,%eax
+ movd %eax,%mm1
+ movl $1,%eax
+ /* L | H */
+ movd %eax,%mm0
+ punpckldq %mm1,%mm0
+ /* 1.0 | -1.0 */
+ pi2fd %mm0,%mm0
+ movd %eax,%mm1
+ pi2fd %mm1,%mm1
+#if defined(PIC) && defined(__APPLE__)
+ movl GLOBAL_VAR_PTR(pnts),%eax
+ movl 16(%eax),%eax
+#else
+ movl 16+GLOBAL_VAR(pnts),%eax
+#endif
+ movd 0(%eax),%mm2
+ /* 1.0 | cos0 */
+ punpckldq %mm2,%mm1
+ /* 0 */
+ movq 0(%esi),%mm2
+ movq %mm2,%mm3
+ pfmul %mm0,%mm3
+ pfacc %mm3,%mm2
+ pfmul %mm1,%mm2
+ movq %mm2,0(%ebx)
+ movq 8(%esi),%mm4
+ movq %mm4,%mm5
+ pfmul %mm0,%mm5
+ pfacc %mm5,%mm4
+ pfmul %mm0,%mm4
+ pfmul %mm1,%mm4
+ movq %mm4,%mm5
+ psrlq $32,%mm5
+ pfacc %mm5,%mm4
+ movq %mm4,8(%ebx)
+ /* 4 */
+ movq 16(%esi),%mm2
+ movq %mm2,%mm3
+ pfmul %mm0,%mm3
+ pfacc %mm3,%mm2
+ pfmul %mm1,%mm2
+ movq 24(%esi),%mm4
+ movq %mm4,%mm5
+ pfmul %mm0,%mm5
+ pfacc %mm5,%mm4
+ pfmul %mm0,%mm4
+ pfmul %mm1,%mm4
+ movq %mm4,%mm5
+ psrlq $32,%mm5
+ pfacc %mm5,%mm4
+ movq %mm2,%mm3
+ psrlq $32,%mm3
+ pfadd %mm4,%mm2
+ pfadd %mm3,%mm4
+ movq %mm2,16(%ebx)
+ movq %mm4,24(%ebx)
+ /* 8 */
+ movq 32(%esi),%mm2
+ movq %mm2,%mm3
+ pfmul %mm0,%mm3
+ pfacc %mm3,%mm2
+ pfmul %mm1,%mm2
+ movq %mm2,32(%ebx)
+ movq 40(%esi),%mm4
+ movq %mm4,%mm5
+ pfmul %mm0,%mm5
+ pfacc %mm5,%mm4
+ pfmul %mm0,%mm4
+ pfmul %mm1,%mm4
+ movq %mm4,%mm5
+ psrlq $32,%mm5
+ pfacc %mm5,%mm4
+ movq %mm4,40(%ebx)
+ /* 12 */
+ movq 48(%esi),%mm2
+ movq %mm2,%mm3
+ pfmul %mm0,%mm3
+ pfacc %mm3,%mm2
+ pfmul %mm1,%mm2
+ movq 56(%esi),%mm4
+ movq %mm4,%mm5
+ pfmul %mm0,%mm5
+ pfacc %mm5,%mm4
+ pfmul %mm0,%mm4
+ pfmul %mm1,%mm4
+ movq %mm4,%mm5
+ psrlq $32,%mm5
+ pfacc %mm5,%mm4
+ movq %mm2,%mm3
+ psrlq $32,%mm3
+ pfadd %mm4,%mm2
+ pfadd %mm3,%mm4
+ movq %mm2,48(%ebx)
+ movq %mm4,56(%ebx)
+ /* 16 */
+ movq 64(%esi),%mm2
+ movq %mm2,%mm3
+ pfmul %mm0,%mm3
+ pfacc %mm3,%mm2
+ pfmul %mm1,%mm2
+ movq %mm2,64(%ebx)
+ movq 72(%esi),%mm4
+ movq %mm4,%mm5
+ pfmul %mm0,%mm5
+ pfacc %mm5,%mm4
+ pfmul %mm0,%mm4
+ pfmul %mm1,%mm4
+ movq %mm4,%mm5
+ psrlq $32,%mm5
+ pfacc %mm5,%mm4
+ movq %mm4,72(%ebx)
+ /* 20 */
+ movq 80(%esi),%mm2
+ movq %mm2,%mm3
+ pfmul %mm0,%mm3
+ pfacc %mm3,%mm2
+ pfmul %mm1,%mm2
+ movq 88(%esi),%mm4
+ movq %mm4,%mm5
+ pfmul %mm0,%mm5
+ pfacc %mm5,%mm4
+ pfmul %mm0,%mm4
+ pfmul %mm1,%mm4
+ movq %mm4,%mm5
+ psrlq $32,%mm5
+ pfacc %mm5,%mm4
+ movq %mm2,%mm3
+ psrlq $32,%mm3
+ pfadd %mm4,%mm2
+ pfadd %mm3,%mm4
+ movq %mm2,80(%ebx)
+ movq %mm4,88(%ebx)
+ /* 24 */
+ movq 96(%esi),%mm2
+ movq %mm2,%mm3
+ pfmul %mm0,%mm3
+ pfacc %mm3,%mm2
+ pfmul %mm1,%mm2
+ movq %mm2,96(%ebx)
+ movq 104(%esi),%mm4
+ movq %mm4,%mm5
+ pfmul %mm0,%mm5
+ pfacc %mm5,%mm4
+ pfmul %mm0,%mm4
+ pfmul %mm1,%mm4
+ movq %mm4,%mm5
+ psrlq $32,%mm5
+ pfacc %mm5,%mm4
+ movq %mm4,104(%ebx)
+ /* 28 */
+ movq 112(%esi),%mm2
+ movq %mm2,%mm3
+ pfmul %mm0,%mm3
+ pfacc %mm3,%mm2
+ pfmul %mm1,%mm2
+ movq 120(%esi),%mm4
+ movq %mm4,%mm5
+ pfmul %mm0,%mm5
+ pfacc %mm5,%mm4
+ pfmul %mm0,%mm4
+ pfmul %mm1,%mm4
+ movq %mm4,%mm5
+ psrlq $32,%mm5
+ pfacc %mm5,%mm4
+ movq %mm2,%mm3
+ psrlq $32,%mm3
+ pfadd %mm4,%mm2
+ pfadd %mm3,%mm4
+ movq %mm2,112(%ebx)
+ movq %mm4,120(%ebx)
+
+ /* Phase6 */
+ movl 0(%ebx),%eax
+ movl %eax,1024(%ebp)
+ movl 4(%ebx),%eax
+ movl %eax,0(%ebp)
+ movl %eax,0(%edx)
+ movl 8(%ebx),%eax
+ movl %eax,512(%ebp)
+ movl 12(%ebx),%eax
+ movl %eax,512(%edx)
+
+ movl 16(%ebx),%eax
+ movl %eax,768(%ebp)
+ movl 20(%ebx),%eax
+ movl %eax,256(%edx)
+
+ movl 24(%ebx),%eax
+ movl %eax,256(%ebp)
+ movl 28(%ebx),%eax
+ movl %eax,768(%edx)
+
+ movq 32(%ebx),%mm0
+ movq 48(%ebx),%mm1
+ pfadd %mm1,%mm0
+ movd %mm0,896(%ebp)
+ psrlq $32,%mm0
+ movd %mm0,128(%edx)
+ movq 40(%ebx),%mm2
+ pfadd %mm2,%mm1
+ movd %mm1,640(%ebp)
+ psrlq $32,%mm1
+ movd %mm1,384(%edx)
+
+ movq 56(%ebx),%mm3
+ pfadd %mm3,%mm2
+ movd %mm2,384(%ebp)
+ psrlq $32,%mm2
+ movd %mm2,640(%edx)
+
+ movd 36(%ebx),%mm4
+ pfadd %mm4,%mm3
+ movd %mm3,128(%ebp)
+ psrlq $32,%mm3
+ movd %mm3,896(%edx)
+ movq 96(%ebx),%mm0
+ movq 64(%ebx),%mm1
+
+ movq 112(%ebx),%mm2
+ pfadd %mm2,%mm0
+ movq %mm0,%mm3
+ pfadd %mm1,%mm3
+ movd %mm3,960(%ebp)
+ psrlq $32,%mm3
+ movd %mm3,64(%edx)
+ movq 80(%ebx),%mm1
+ pfadd %mm1,%mm0
+ movd %mm0,832(%ebp)
+ psrlq $32,%mm0
+ movd %mm0,192(%edx)
+ movq 104(%ebx),%mm3
+ pfadd %mm3,%mm2
+ movq %mm2,%mm4
+ pfadd %mm1,%mm4
+ movd %mm4,704(%ebp)
+ psrlq $32,%mm4
+ movd %mm4,320(%edx)
+ movq 72(%ebx),%mm1
+ pfadd %mm1,%mm2
+ movd %mm2,576(%ebp)
+ psrlq $32,%mm2
+ movd %mm2,448(%edx)
+
+ movq 120(%ebx),%mm4
+ pfadd %mm4,%mm3
+ movq %mm3,%mm5
+ pfadd %mm1,%mm5
+ movd %mm5,448(%ebp)
+ psrlq $32,%mm5
+ movd %mm5,576(%edx)
+ movq 88(%ebx),%mm1
+ pfadd %mm1,%mm3
+ movd %mm3,320(%ebp)
+ psrlq $32,%mm3
+ movd %mm3,704(%edx)
+
+ movd 100(%ebx),%mm5
+ pfadd %mm5,%mm4
+ movq %mm4,%mm6
+ pfadd %mm1,%mm6
+ movd %mm6,192(%ebp)
+ psrlq $32,%mm6
+ movd %mm6,832(%edx)
+ movd 68(%ebx),%mm1
+ pfadd %mm1,%mm4
+ movd %mm4,64(%ebp)
+ psrlq $32,%mm4
+ movd %mm4,960(%edx)
+
+ /* femms */
+
+ popl %ebx
+ popl %esi
+ popl %edi
+ popl %ebp
+ addl $256,%esp
+
+ ret
+
+#if defined(PIC) && defined(__APPLE__)
+ .section __IMPORT,__pointers,non_lazy_symbol_pointers
+L_pnts:
+ .indirect_symbol ASM_NAME(pnts)
+ .long 0
+#endif
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_3dnowext.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_3dnowext.S
new file mode 100644
index 00000000..69367bf6
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_3dnowext.S
@@ -0,0 +1,735 @@
+/*
+ dct64_3dnowext: extended 3DNow optimized DCT64
+
+ copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+
+ Transformed back into standalone asm, with help of
+ gcc -S -DHAVE_CONFIG_H -I. -march=k6-3 -O3 -Wall -pedantic -fno-strict-aliasing -DREAL_IS_FLOAT -c -o dct64_3dnowext.{S,c}
+
+ MPlayer comment follows.
+*/
+
+/*
+* This code was taken from http://www.mpg123.org
+* See ChangeLog of mpg123-0.59s-pre.1 for detail
+* Applied to mplayer by Nick Kurshev <nickols_k@mail.ru>
+* Partial 3dnowex-DSP! optimization by Nick Kurshev
+*
+* TODO: optimize scalar 3dnow! code
+* Warning: Phases 7 & 8 are not tested
+*/
+
+#include "mangle.h"
+
+ .data
+ ALIGN4
+ /* .type plus_1f, @object
+ .size plus_1f, 4 */
+plus_1f:
+ .long 1065353216
+ ALIGN8
+ /* .type x_plus_minus_3dnow, @object
+ .size x_plus_minus_3dnow, 8 */
+x_plus_minus_3dnow:
+ .long 0
+ .long -2147483648
+
+ .text
+ ALIGN32
+.globl ASM_NAME(dct64_3dnowext)
+ /* .type ASM_NAME(dct64_3dnowext), @function */
+ASM_NAME(dct64_3dnowext):
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ subl $260, %esp
+
+ GET_GOT
+#if defined(OPT_X86) && defined(PIC)
+ movl _EBX_, (%esp) /* save PIC register */
+#endif
+/* APP */
+ movl 16(%ebp),%eax
+ leal 128+-268(%ebp),%edx
+ movl 8(%ebp),%esi
+ movl 12(%ebp),%edi
+#if defined(PIC) && defined(__APPLE__)
+ movl GLOBAL_VAR_PTR(costab_mmxsse),%ebx
+#else
+ leal GLOBAL_VAR(costab_mmxsse),%ebx
+#endif
+ leal -268(%ebp),%ecx
+ movq (%eax), %mm0
+ movq 8(%eax), %mm4
+ movq %mm0, %mm3
+ movq %mm4, %mm7
+ pswapd 120(%eax), %mm1
+ pswapd 112(%eax), %mm5
+ pfadd %mm1, %mm0
+ pfadd %mm5, %mm4
+ movq %mm0, (%edx)
+ movq %mm4, 8(%edx)
+ pfsub %mm1, %mm3
+ pfsub %mm5, %mm7
+ pfmul (%ebx), %mm3
+ pfmul 8(%ebx), %mm7
+ pswapd %mm3, %mm3
+ pswapd %mm7, %mm7
+ movq %mm3, 120(%edx)
+ movq %mm7, 112(%edx)
+ movq 16(%eax), %mm0
+ movq 24(%eax), %mm4
+ movq %mm0, %mm3
+ movq %mm4, %mm7
+ pswapd 104(%eax), %mm1
+ pswapd 96(%eax), %mm5
+ pfadd %mm1, %mm0
+ pfadd %mm5, %mm4
+ movq %mm0, 16(%edx)
+ movq %mm4, 24(%edx)
+ pfsub %mm1, %mm3
+ pfsub %mm5, %mm7
+ pfmul 16(%ebx), %mm3
+ pfmul 24(%ebx), %mm7
+ pswapd %mm3, %mm3
+ pswapd %mm7, %mm7
+ movq %mm3, 104(%edx)
+ movq %mm7, 96(%edx)
+ movq 32(%eax), %mm0
+ movq 40(%eax), %mm4
+ movq %mm0, %mm3
+ movq %mm4, %mm7
+ pswapd 88(%eax), %mm1
+ pswapd 80(%eax), %mm5
+ pfadd %mm1, %mm0
+ pfadd %mm5, %mm4
+ movq %mm0, 32(%edx)
+ movq %mm4, 40(%edx)
+ pfsub %mm1, %mm3
+ pfsub %mm5, %mm7
+ pfmul 32(%ebx), %mm3
+ pfmul 40(%ebx), %mm7
+ pswapd %mm3, %mm3
+ pswapd %mm7, %mm7
+ movq %mm3, 88(%edx)
+ movq %mm7, 80(%edx)
+ movq 48(%eax), %mm0
+ movq 56(%eax), %mm4
+ movq %mm0, %mm3
+ movq %mm4, %mm7
+ pswapd 72(%eax), %mm1
+ pswapd 64(%eax), %mm5
+ pfadd %mm1, %mm0
+ pfadd %mm5, %mm4
+ movq %mm0, 48(%edx)
+ movq %mm4, 56(%edx)
+ pfsub %mm1, %mm3
+ pfsub %mm5, %mm7
+ pfmul 48(%ebx), %mm3
+ pfmul 56(%ebx), %mm7
+ pswapd %mm3, %mm3
+ pswapd %mm7, %mm7
+ movq %mm3, 72(%edx)
+ movq %mm7, 64(%edx)
+ movq (%edx), %mm0
+ movq 8(%edx), %mm4
+ movq %mm0, %mm3
+ movq %mm4, %mm7
+ pswapd 56(%edx), %mm1
+ pswapd 48(%edx), %mm5
+ pfadd %mm1, %mm0
+ pfadd %mm5, %mm4
+ movq %mm0, (%ecx)
+ movq %mm4, 8(%ecx)
+ pfsub %mm1, %mm3
+ pfsub %mm5, %mm7
+ pfmul 64(%ebx), %mm3
+ pfmul 72(%ebx), %mm7
+ pswapd %mm3, %mm3
+ pswapd %mm7, %mm7
+ movq %mm3, 56(%ecx)
+ movq %mm7, 48(%ecx)
+ movq 16(%edx), %mm0
+ movq 24(%edx), %mm4
+ movq %mm0, %mm3
+ movq %mm4, %mm7
+ pswapd 40(%edx), %mm1
+ pswapd 32(%edx), %mm5
+ pfadd %mm1, %mm0
+ pfadd %mm5, %mm4
+ movq %mm0, 16(%ecx)
+ movq %mm4, 24(%ecx)
+ pfsub %mm1, %mm3
+ pfsub %mm5, %mm7
+ pfmul 80(%ebx), %mm3
+ pfmul 88(%ebx), %mm7
+ pswapd %mm3, %mm3
+ pswapd %mm7, %mm7
+ movq %mm3, 40(%ecx)
+ movq %mm7, 32(%ecx)
+ movq 64(%edx), %mm0
+ movq 72(%edx), %mm4
+ movq %mm0, %mm3
+ movq %mm4, %mm7
+ pswapd 120(%edx), %mm1
+ pswapd 112(%edx), %mm5
+ pfadd %mm1, %mm0
+ pfadd %mm5, %mm4
+ movq %mm0, 64(%ecx)
+ movq %mm4, 72(%ecx)
+ pfsubr %mm1, %mm3
+ pfsubr %mm5, %mm7
+ pfmul 64(%ebx), %mm3
+ pfmul 72(%ebx), %mm7
+ pswapd %mm3, %mm3
+ pswapd %mm7, %mm7
+ movq %mm3, 120(%ecx)
+ movq %mm7, 112(%ecx)
+ movq 80(%edx), %mm0
+ movq 88(%edx), %mm4
+ movq %mm0, %mm3
+ movq %mm4, %mm7
+ pswapd 104(%edx), %mm1
+ pswapd 96(%edx), %mm5
+ pfadd %mm1, %mm0
+ pfadd %mm5, %mm4
+ movq %mm0, 80(%ecx)
+ movq %mm4, 88(%ecx)
+ pfsubr %mm1, %mm3
+ pfsubr %mm5, %mm7
+ pfmul 80(%ebx), %mm3
+ pfmul 88(%ebx), %mm7
+ pswapd %mm3, %mm3
+ pswapd %mm7, %mm7
+ movq %mm3, 104(%ecx)
+ movq %mm7, 96(%ecx)
+ movq 96(%ebx), %mm2
+ movq 104(%ebx), %mm6
+ movq (%ecx), %mm0
+ movq 8(%ecx), %mm4
+ movq %mm0, %mm3
+ movq %mm4, %mm7
+ pswapd 24(%ecx), %mm1
+ pswapd 16(%ecx), %mm5
+ pfadd %mm1, %mm0
+ pfadd %mm5, %mm4
+ movq %mm0, (%edx)
+ movq %mm4, 8(%edx)
+ pfsub %mm1, %mm3
+ pfsub %mm5, %mm7
+ pfmul %mm2, %mm3
+ pfmul %mm6, %mm7
+ pswapd %mm3, %mm3
+ pswapd %mm7, %mm7
+ movq %mm3, 24(%edx)
+ movq %mm7, 16(%edx)
+ movq 32(%ecx), %mm0
+ movq 40(%ecx), %mm4
+ movq %mm0, %mm3
+ movq %mm4, %mm7
+ pswapd 56(%ecx), %mm1
+ pswapd 48(%ecx), %mm5
+ pfadd %mm1, %mm0
+ pfadd %mm5, %mm4
+ movq %mm0, 32(%edx)
+ movq %mm4, 40(%edx)
+ pfsubr %mm1, %mm3
+ pfsubr %mm5, %mm7
+ pfmul %mm2, %mm3
+ pfmul %mm6, %mm7
+ pswapd %mm3, %mm3
+ pswapd %mm7, %mm7
+ movq %mm3, 56(%edx)
+ movq %mm7, 48(%edx)
+ movq 64(%ecx), %mm0
+ movq 72(%ecx), %mm4
+ movq %mm0, %mm3
+ movq %mm4, %mm7
+ pswapd 88(%ecx), %mm1
+ pswapd 80(%ecx), %mm5
+ pfadd %mm1, %mm0
+ pfadd %mm5, %mm4
+ movq %mm0, 64(%edx)
+ movq %mm4, 72(%edx)
+ pfsub %mm1, %mm3
+ pfsub %mm5, %mm7
+ pfmul %mm2, %mm3
+ pfmul %mm6, %mm7
+ pswapd %mm3, %mm3
+ pswapd %mm7, %mm7
+ movq %mm3, 88(%edx)
+ movq %mm7, 80(%edx)
+ movq 96(%ecx), %mm0
+ movq 104(%ecx), %mm4
+ movq %mm0, %mm3
+ movq %mm4, %mm7
+ pswapd 120(%ecx), %mm1
+ pswapd 112(%ecx), %mm5
+ pfadd %mm1, %mm0
+ pfadd %mm5, %mm4
+ movq %mm0, 96(%edx)
+ movq %mm4, 104(%edx)
+ pfsubr %mm1, %mm3
+ pfsubr %mm5, %mm7
+ pfmul %mm2, %mm3
+ pfmul %mm6, %mm7
+ pswapd %mm3, %mm3
+ pswapd %mm7, %mm7
+ movq %mm3, 120(%edx)
+ movq %mm7, 112(%edx)
+ movq 112(%ebx), %mm2
+ movq (%edx), %mm0
+ movq 16(%edx), %mm4
+ movq %mm0, %mm3
+ movq %mm4, %mm7
+ pswapd 8(%edx), %mm1
+ pswapd 24(%edx), %mm5
+ pfadd %mm1, %mm0
+ pfadd %mm5, %mm4
+ movq %mm0, (%ecx)
+ movq %mm4, 16(%ecx)
+ pfsub %mm1, %mm3
+ pfsubr %mm5, %mm7
+ pfmul %mm2, %mm3
+ pfmul %mm2, %mm7
+ pswapd %mm3, %mm3
+ pswapd %mm7, %mm7
+ movq %mm3, 8(%ecx)
+ movq %mm7, 24(%ecx)
+ movq 32(%edx), %mm0
+ movq 48(%edx), %mm4
+ movq %mm0, %mm3
+ movq %mm4, %mm7
+ pswapd 40(%edx), %mm1
+ pswapd 56(%edx), %mm5
+ pfadd %mm1, %mm0
+ pfadd %mm5, %mm4
+ movq %mm0, 32(%ecx)
+ movq %mm4, 48(%ecx)
+ pfsub %mm1, %mm3
+ pfsubr %mm5, %mm7
+ pfmul %mm2, %mm3
+ pfmul %mm2, %mm7
+ pswapd %mm3, %mm3
+ pswapd %mm7, %mm7
+ movq %mm3, 40(%ecx)
+ movq %mm7, 56(%ecx)
+ movq 64(%edx), %mm0
+ movq 80(%edx), %mm4
+ movq %mm0, %mm3
+ movq %mm4, %mm7
+ pswapd 72(%edx), %mm1
+ pswapd 88(%edx), %mm5
+ pfadd %mm1, %mm0
+ pfadd %mm5, %mm4
+ movq %mm0, 64(%ecx)
+ movq %mm4, 80(%ecx)
+ pfsub %mm1, %mm3
+ pfsubr %mm5, %mm7
+ pfmul %mm2, %mm3
+ pfmul %mm2, %mm7
+ pswapd %mm3, %mm3
+ pswapd %mm7, %mm7
+ movq %mm3, 72(%ecx)
+ movq %mm7, 88(%ecx)
+ movq 96(%edx), %mm0
+ movq 112(%edx), %mm4
+ movq %mm0, %mm3
+ movq %mm4, %mm7
+ pswapd 104(%edx), %mm1
+ pswapd 120(%edx), %mm5
+ pfadd %mm1, %mm0
+ pfadd %mm5, %mm4
+ movq %mm0, 96(%ecx)
+ movq %mm4, 112(%ecx)
+ pfsub %mm1, %mm3
+ pfsubr %mm5, %mm7
+ pfmul %mm2, %mm3
+ pfmul %mm2, %mm7
+ pswapd %mm3, %mm3
+ pswapd %mm7, %mm7
+ movq %mm3, 104(%ecx)
+ movq %mm7, 120(%ecx)
+#if defined(OPT_X86) && defined(PIC)
+ #undef _EBX_
+ #define _EBX_ %eax
+ movl (%esp), _EBX_
+#endif
+ movd LOCAL_VAR(plus_1f), %mm6
+ punpckldq 120(%ebx), %mm6
+ movq LOCAL_VAR(x_plus_minus_3dnow), %mm7
+ movq 32(%ecx), %mm0
+ movq 64(%ecx), %mm2
+ movq %mm0, %mm1
+ movq %mm2, %mm3
+ pxor %mm7, %mm1
+ pxor %mm7, %mm3
+ pfacc %mm1, %mm0
+ pfacc %mm3, %mm2
+ pfmul %mm6, %mm0
+ pfmul %mm6, %mm2
+ movq %mm0, 32(%edx)
+ movq %mm2, 64(%edx)
+ movd 44(%ecx), %mm0
+ movd 40(%ecx), %mm2
+ movd 120(%ebx), %mm3
+ punpckldq 76(%ecx), %mm0
+ punpckldq 72(%ecx), %mm2
+ punpckldq %mm3, %mm3
+ movq %mm0, %mm4
+ movq %mm2, %mm5
+ pfsub %mm2, %mm0
+ pfmul %mm3, %mm0
+ movq %mm0, %mm1
+ pfadd %mm5, %mm0
+ pfadd %mm4, %mm0
+ movq %mm0, %mm2
+ punpckldq %mm1, %mm0
+ punpckhdq %mm1, %mm2
+ movq %mm0, 40(%edx)
+ movq %mm2, 72(%edx)
+ movd 48(%ecx), %mm3
+ movd 60(%ecx), %mm2
+ pfsub 52(%ecx), %mm3
+ pfsub 56(%ecx), %mm2
+ pfmul 120(%ebx), %mm3
+ pfmul 120(%ebx), %mm2
+ movq %mm2, %mm1
+ pfadd 56(%ecx), %mm1
+ pfadd 60(%ecx), %mm1
+ movq %mm1, %mm0
+ pfadd 48(%ecx), %mm0
+ pfadd 52(%ecx), %mm0
+ pfadd %mm3, %mm1
+ punpckldq %mm2, %mm1
+ pfadd %mm3, %mm2
+ punpckldq %mm2, %mm0
+ movq %mm1, 56(%edx)
+ movq %mm0, 48(%edx)
+ movd 92(%ecx), %mm1
+ pfsub 88(%ecx), %mm1
+ pfmul 120(%ebx), %mm1
+ movd %mm1, 92(%edx)
+ pfadd 92(%ecx), %mm1
+ pfadd 88(%ecx), %mm1
+ movq %mm1, %mm0
+ pfadd 80(%ecx), %mm0
+ pfadd 84(%ecx), %mm0
+ movd %mm0, 80(%edx)
+ movd 80(%ecx), %mm0
+ pfsub 84(%ecx), %mm0
+ pfmul 120(%ebx), %mm0
+ pfadd %mm0, %mm1
+ pfadd 92(%edx), %mm0
+ punpckldq %mm1, %mm0
+ movq %mm0, 84(%edx)
+ movq 96(%ecx), %mm0
+ movq %mm0, %mm1
+ pxor %mm7, %mm1
+ pfacc %mm1, %mm0
+ pfmul %mm6, %mm0
+ movq %mm0, 96(%edx)
+ movd 108(%ecx), %mm0
+ pfsub 104(%ecx), %mm0
+ pfmul 120(%ebx), %mm0
+ movd %mm0, 108(%edx)
+ pfadd 104(%ecx), %mm0
+ pfadd 108(%ecx), %mm0
+ movd %mm0, 104(%edx)
+ movd 124(%ecx), %mm1
+ pfsub 120(%ecx), %mm1
+ pfmul 120(%ebx), %mm1
+ movd %mm1, 124(%edx)
+ pfadd 120(%ecx), %mm1
+ pfadd 124(%ecx), %mm1
+ movq %mm1, %mm0
+ pfadd 112(%ecx), %mm0
+ pfadd 116(%ecx), %mm0
+ movd %mm0, 112(%edx)
+ movd 112(%ecx), %mm0
+ pfsub 116(%ecx), %mm0
+ pfmul 120(%ebx), %mm0
+ pfadd %mm0,%mm1
+ pfadd 124(%edx), %mm0
+ punpckldq %mm1, %mm0
+ movq %mm0, 116(%edx)
+ jnz .L01
+ movd (%ecx), %mm0
+ pfadd 4(%ecx), %mm0
+ movd %mm0, 1024(%esi)
+ movd (%ecx), %mm0
+ pfsub 4(%ecx), %mm0
+ pfmul 120(%ebx), %mm0
+ movd %mm0, (%esi)
+ movd %mm0, (%edi)
+ movd 12(%ecx), %mm0
+ pfsub 8(%ecx), %mm0
+ pfmul 120(%ebx), %mm0
+ movd %mm0, 512(%edi)
+ pfadd 12(%ecx), %mm0
+ pfadd 8(%ecx), %mm0
+ movd %mm0, 512(%esi)
+ movd 16(%ecx), %mm0
+ pfsub 20(%ecx), %mm0
+ pfmul 120(%ebx), %mm0
+ movq %mm0, %mm3
+ movd 28(%ecx), %mm0
+ pfsub 24(%ecx), %mm0
+ pfmul 120(%ebx), %mm0
+ movd %mm0, 768(%edi)
+ movq %mm0, %mm2
+ pfadd 24(%ecx), %mm0
+ pfadd 28(%ecx), %mm0
+ movq %mm0, %mm1
+ pfadd 16(%ecx), %mm0
+ pfadd 20(%ecx), %mm0
+ movd %mm0, 768(%esi)
+ pfadd %mm3, %mm1
+ movd %mm1, 256(%esi)
+ pfadd %mm3, %mm2
+ movd %mm2, 256(%edi)
+ movq 32(%edx), %mm0
+ movq 48(%edx), %mm1
+ pfadd 48(%edx), %mm0
+ pfadd 40(%edx), %mm1
+ movd %mm0, 896(%esi)
+ movd %mm1, 640(%esi)
+ psrlq $32, %mm0
+ psrlq $32, %mm1
+ movd %mm0, 128(%edi)
+ movd %mm1, 384(%edi)
+ movd 40(%edx), %mm0
+ pfadd 56(%edx), %mm0
+ movd %mm0, 384(%esi)
+ movd 56(%edx), %mm0
+ pfadd 36(%edx), %mm0
+ movd %mm0, 128(%esi)
+ movd 60(%edx), %mm0
+ movd %mm0, 896(%edi)
+ pfadd 44(%edx), %mm0
+ movd %mm0, 640(%edi)
+ movq 96(%edx), %mm0
+ movq 112(%edx), %mm2
+ movq 104(%edx), %mm4
+ pfadd 112(%edx), %mm0
+ pfadd 104(%edx), %mm2
+ pfadd 120(%edx), %mm4
+ movq %mm0, %mm1
+ movq %mm2, %mm3
+ movq %mm4, %mm5
+ pfadd 64(%edx), %mm0
+ pfadd 80(%edx), %mm2
+ pfadd 72(%edx), %mm4
+ movd %mm0, 960(%esi)
+ movd %mm2, 704(%esi)
+ movd %mm4, 448(%esi)
+ psrlq $32, %mm0
+ psrlq $32, %mm2
+ psrlq $32, %mm4
+ movd %mm0, 64(%edi)
+ movd %mm2, 320(%edi)
+ movd %mm4, 576(%edi)
+ pfadd 80(%edx), %mm1
+ pfadd 72(%edx), %mm3
+ pfadd 88(%edx), %mm5
+ movd %mm1, 832(%esi)
+ movd %mm3, 576(%esi)
+ movd %mm5, 320(%esi)
+ psrlq $32, %mm1
+ psrlq $32, %mm3
+ psrlq $32, %mm5
+ movd %mm1, 192(%edi)
+ movd %mm3, 448(%edi)
+ movd %mm5, 704(%edi)
+ movd 120(%edx), %mm0
+ pfadd 100(%edx), %mm0
+ movq %mm0, %mm1
+ pfadd 88(%edx), %mm0
+ movd %mm0, 192(%esi)
+ pfadd 68(%edx), %mm1
+ movd %mm1, 64(%esi)
+ movd 124(%edx), %mm0
+ movd %mm0, 960(%edi)
+ pfadd 92(%edx), %mm0
+ movd %mm0, 832(%edi)
+ jmp .L_bye
+.L01:
+ movq (%ecx), %mm0
+ movq %mm0, %mm1
+ pxor %mm7, %mm1
+ pfacc %mm1, %mm0
+ pfmul %mm6, %mm0
+ pf2iw %mm0, %mm0
+ movd %mm0, %eax
+ movw %ax, 512(%esi)
+ psrlq $32, %mm0
+ movd %mm0, %eax
+ movw %ax, (%esi)
+ movd 12(%ecx), %mm0
+ pfsub 8(%ecx), %mm0
+ pfmul 120(%ebx), %mm0
+ pf2iw %mm0, %mm7
+ movd %mm7, %eax
+ movw %ax, 256(%edi)
+ pfadd 12(%ecx), %mm0
+ pfadd 8(%ecx), %mm0
+ pf2iw %mm0, %mm0
+ movd %mm0, %eax
+ movw %ax, 256(%esi)
+ movd 16(%ecx), %mm3
+ pfsub 20(%ecx), %mm3
+ pfmul 120(%ebx), %mm3
+ movq %mm3, %mm2
+ movd 28(%ecx), %mm2
+ pfsub 24(%ecx), %mm2
+ pfmul 120(%ebx), %mm2
+ movq %mm2, %mm1
+ pf2iw %mm2, %mm7
+ movd %mm7, %eax
+ movw %ax, 384(%edi)
+ pfadd 24(%ecx), %mm1
+ pfadd 28(%ecx), %mm1
+ movq %mm1, %mm0
+ pfadd 16(%ecx), %mm0
+ pfadd 20(%ecx), %mm0
+ pf2iw %mm0, %mm0
+ movd %mm0, %eax
+ movw %ax, 384(%esi)
+ pfadd %mm3, %mm1
+ pf2iw %mm1, %mm1
+ movd %mm1, %eax
+ movw %ax, 128(%esi)
+ pfadd %mm3, %mm2
+ pf2iw %mm2, %mm2
+ movd %mm2, %eax
+ movw %ax, 128(%edi)
+ movq 32(%edx), %mm0
+ movq 48(%edx), %mm1
+ pfadd 48(%edx), %mm0
+ pfadd 40(%edx), %mm1
+ pf2iw %mm0, %mm0
+ pf2iw %mm1, %mm1
+ movd %mm0, %eax
+ movd %mm1, %ecx
+ movw %ax, 448(%esi)
+ movw %cx, 320(%esi)
+ psrlq $32, %mm0
+ psrlq $32, %mm1
+ movd %mm0, %eax
+ movd %mm1, %ecx
+ movw %ax, 64(%edi)
+ movw %cx, 192(%edi)
+ movd 40(%edx), %mm3
+ movd 56(%edx), %mm4
+ movd 60(%edx), %mm0
+ movd 44(%edx), %mm2
+ movd 120(%edx), %mm5
+ punpckldq %mm4, %mm3
+ punpckldq 124(%edx), %mm0
+ pfadd 100(%edx), %mm5
+ punpckldq 36(%edx), %mm4
+ punpckldq 92(%edx), %mm2
+ movq %mm5, %mm6
+ pfadd %mm4, %mm3
+ pf2iw %mm0, %mm1
+ pf2iw %mm3, %mm3
+ pfadd 88(%edx), %mm5
+ movd %mm1, %eax
+ movd %mm3, %ecx
+ movw %ax, 448(%edi)
+ movw %cx, 192(%esi)
+ pf2iw %mm5, %mm5
+ psrlq $32, %mm1
+ psrlq $32, %mm3
+ movd %mm5, %ebx
+ movd %mm1, %eax
+ movd %mm3, %ecx
+ movw %bx, 96(%esi)
+ movw %ax, 480(%edi)
+ movw %cx, 64(%esi)
+ pfadd %mm2, %mm0
+ pf2iw %mm0, %mm0
+ movd %mm0, %eax
+ pfadd 68(%edx), %mm6
+ movw %ax, 320(%edi)
+ psrlq $32, %mm0
+ pf2iw %mm6, %mm6
+ movd %mm0, %eax
+ movd %mm6, %ebx
+ movw %ax, 416(%edi)
+ movw %bx, 32(%esi)
+ movq 96(%edx), %mm0
+ movq 112(%edx), %mm2
+ movq 104(%edx), %mm4
+ pfadd %mm2, %mm0
+ pfadd %mm4, %mm2
+ pfadd 120(%edx), %mm4
+ movq %mm0, %mm1
+ movq %mm2, %mm3
+ movq %mm4, %mm5
+ pfadd 64(%edx), %mm0
+ pfadd 80(%edx), %mm2
+ pfadd 72(%edx), %mm4
+ pf2iw %mm0, %mm0
+ pf2iw %mm2, %mm2
+ pf2iw %mm4, %mm4
+ movd %mm0, %eax
+ movd %mm2, %ecx
+ movd %mm4, %ebx
+ movw %ax, 480(%esi)
+ movw %cx, 352(%esi)
+ movw %bx, 224(%esi)
+ psrlq $32, %mm0
+ psrlq $32, %mm2
+ psrlq $32, %mm4
+ movd %mm0, %eax
+ movd %mm2, %ecx
+ movd %mm4, %ebx
+ movw %ax, 32(%edi)
+ movw %cx, 160(%edi)
+ movw %bx, 288(%edi)
+ pfadd 80(%edx), %mm1
+ pfadd 72(%edx), %mm3
+ pfadd 88(%edx), %mm5
+ pf2iw %mm1, %mm1
+ pf2iw %mm3, %mm3
+ pf2iw %mm5, %mm5
+ movd %mm1, %eax
+ movd %mm3, %ecx
+ movd %mm5, %ebx
+ movw %ax, 416(%esi)
+ movw %cx, 288(%esi)
+ movw %bx, 160(%esi)
+ psrlq $32, %mm1
+ psrlq $32, %mm3
+ psrlq $32, %mm5
+ movd %mm1, %eax
+ movd %mm3, %ecx
+ movd %mm5, %ebx
+ movw %ax, 96(%edi)
+ movw %cx, 224(%edi)
+ movw %bx, 352(%edi)
+ movsw
+.L_bye:
+ femms
+
+/* NO_APP */
+ addl $260, %esp
+ popl %ebx
+ popl %esi
+ popl %edi
+ leave
+ ret
+ /* .size ASM_NAME(dct64_3dnowext), .-ASM_NAME(dct64_3dnowext) */
+
+#if defined(PIC) && defined(__APPLE__)
+ .section __IMPORT,__pointers,non_lazy_symbol_pointers
+L_costab_mmxsse:
+ .indirect_symbol ASM_NAME(costab_mmxsse)
+ .long 0
+#endif
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_altivec.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_altivec.c
new file mode 100644
index 00000000..3d6c7e1d
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_altivec.c
@@ -0,0 +1,315 @@
+/*
+ dct64_altivec.c: Discrete Cosine Tansform (DCT) for Altivec
+
+ copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp
+ altivec optimization by tmkk
+*/
+
+/*
+ * Discrete Cosine Tansform (DCT) for subband synthesis
+ *
+ * -funroll-loops (for gcc) will remove the loops for better performance
+ * using loops in the source-code enhances readabillity
+ *
+ *
+ * TODO: write an optimized version for the down-sampling modes
+ * (in these modes the bands 16-31 (2:1) or 8-31 (4:1) are zero
+ */
+
+#include "mpg123lib_intern.h"
+
+#ifndef __APPLE__
+#include <altivec.h>
+#endif
+
+void dct64_altivec(real *out0,real *out1,real *samples)
+{
+ ALIGNED(16) real bufs[32];
+
+ {
+ register real *b1,*costab;
+
+ vector unsigned char vinvert,vperm1,vperm2,vperm3,vperm4;
+ vector float v1,v2,v3,v4,v5,v6,v7,v8;
+ vector float vbs1,vbs2,vbs3,vbs4,vbs5,vbs6,vbs7,vbs8;
+ vector float vbs9,vbs10,vbs11,vbs12,vbs13,vbs14,vbs15,vbs16;
+ vector float vzero;
+ b1 = samples;
+ costab = pnts[0];
+
+ vzero = vec_xor(vzero,vzero);
+#ifdef __APPLE__
+ vinvert = (vector unsigned char)(12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3);
+#else
+ vinvert = (vector unsigned char){12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3};
+#endif
+ vperm1 = vec_lvsl(0,b1);
+ vperm2 = vec_perm(vperm1,vperm1,vinvert);
+
+ v1 = vec_ld(0,b1);
+ v2 = vec_ld(16,b1);
+ v3 = vec_ld(112,b1);
+ v4 = vec_ld(127,b1);
+ v5 = vec_perm(v1,v2,vperm1); /* b1[0,1,2,3] */
+ v6 = vec_perm(v3,v4,vperm2); /* b1[31,30,29,28] */
+
+ vbs1 = vec_add(v5,v6);
+ vbs8 = vec_sub(v5,v6);
+
+ v1 = vec_ld(32,b1);
+ v4 = vec_ld(96,b1);
+ v5 = vec_perm(v2,v1,vperm1); /* b1[4,5,6,7] */
+ v6 = vec_perm(v4,v3,vperm2); /* b1[27,26,25,24] */
+
+ vbs2 = vec_add(v5,v6);
+ vbs7 = vec_sub(v5,v6);
+
+ v2 = vec_ld(48,b1);
+ v3 = vec_ld(80,b1);
+ v5 = vec_perm(v1,v2,vperm1); /* b1[8,9,10,11] */
+ v6 = vec_perm(v3,v4,vperm2); /* b1[23,22,21,20] */
+
+ vbs3 = vec_add(v5,v6);
+ vbs6 = vec_sub(v5,v6);
+
+ v1 = vec_ld(64,b1);
+ v5 = vec_perm(v2,v1,vperm1); /* b1[12,13,14,15] */
+ v6 = vec_perm(v1,v3,vperm2); /* b1[19,18,17,16] */
+
+ vbs4 = vec_add(v5,v6);
+ vbs5 = vec_sub(v5,v6);
+
+ v1 = vec_ld(0,costab);
+ vbs8 = vec_madd(vbs8,v1,vzero);
+ v2 = vec_ld(16,costab);
+ vbs7 = vec_madd(vbs7,v2,vzero);
+ v3 = vec_ld(32,costab);
+ vbs6 = vec_madd(vbs6,v3,vzero);
+ v4 = vec_ld(48,costab);
+ vbs5 = vec_madd(vbs5,v4,vzero);
+ vbs6 = vec_perm(vbs6,vbs6,vinvert);
+ vbs5 = vec_perm(vbs5,vbs5,vinvert);
+
+
+ costab = pnts[1];
+
+ v1 = vec_perm(vbs4,vbs4,vinvert);
+ vbs9 = vec_add(vbs1,v1);
+ v3 = vec_sub(vbs1,v1);
+ v5 = vec_ld(0,costab);
+ v2 = vec_perm(vbs3,vbs3,vinvert);
+ vbs10 = vec_add(vbs2,v2);
+ v4 = vec_sub(vbs2,v2);
+ v6 = vec_ld(16,costab);
+ vbs12 = vec_madd(v3,v5,vzero);
+ vbs11 = vec_madd(v4,v6,vzero);
+
+ v7 = vec_sub(vbs7,vbs6);
+ v8 = vec_sub(vbs8,vbs5);
+ vbs13 = vec_add(vbs5,vbs8);
+ vbs14 = vec_add(vbs6,vbs7);
+ vbs15 = vec_madd(v7,v6,vzero);
+ vbs16 = vec_madd(v8,v5,vzero);
+
+
+ costab = pnts[2];
+
+ v1 = vec_perm(vbs10,vbs10,vinvert);
+ v5 = vec_perm(vbs14,vbs14,vinvert);
+ vbs1 = vec_add(v1,vbs9);
+ vbs5 = vec_add(v5,vbs13);
+ v2 = vec_sub(vbs9,v1);
+ v6 = vec_sub(vbs13,v5);
+ v3 = vec_ld(0,costab);
+ vbs11 = vec_perm(vbs11,vbs11,vinvert);
+ vbs15 = vec_perm(vbs15,vbs15,vinvert);
+ vbs3 = vec_add(vbs11,vbs12);
+ vbs7 = vec_add(vbs15,vbs16);
+ v4 = vec_sub(vbs12,vbs11);
+ v7 = vec_sub(vbs16,vbs15);
+ vbs2 = vec_madd(v2,v3,vzero);
+ vbs4 = vec_madd(v4,v3,vzero);
+ vbs6 = vec_madd(v6,v3,vzero);
+ vbs8 = vec_madd(v7,v3,vzero);
+
+ vbs2 = vec_perm(vbs2,vbs2,vinvert);
+ vbs4 = vec_perm(vbs4,vbs4,vinvert);
+ vbs6 = vec_perm(vbs6,vbs6,vinvert);
+ vbs8 = vec_perm(vbs8,vbs8,vinvert);
+
+
+ costab = pnts[3];
+
+#ifdef __APPLE__
+ vperm1 = (vector unsigned char)(0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23);
+ vperm2 = (vector unsigned char)(12,13,14,15,8,9,10,11,28,29,30,31,24,25,26,27);
+ vperm3 = (vector unsigned char)(0,1,2,3,4,5,6,7,20,21,22,23,16,17,18,19);
+#else
+ vperm1 = (vector unsigned char){0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23};
+ vperm2 = (vector unsigned char){12,13,14,15,8,9,10,11,28,29,30,31,24,25,26,27};
+ vperm3 = (vector unsigned char){0,1,2,3,4,5,6,7,20,21,22,23,16,17,18,19};
+#endif
+ vperm4 = vec_add(vperm3,vec_splat_u8(8));
+
+ v1 = vec_ld(0,costab);
+ v2 = vec_splat(v1,0);
+ v3 = vec_splat(v1,1);
+ v1 = vec_mergeh(v2,v3);
+
+ v2 = vec_perm(vbs1,vbs3,vperm1);
+ v3 = vec_perm(vbs2,vbs4,vperm1);
+ v4 = vec_perm(vbs1,vbs3,vperm2);
+ v5 = vec_perm(vbs2,vbs4,vperm2);
+ v6 = vec_sub(v2,v4);
+ v7 = vec_sub(v3,v5);
+ v2 = vec_add(v2,v4);
+ v3 = vec_add(v3,v5);
+ v4 = vec_madd(v6,v1,vzero);
+ v5 = vec_nmsub(v7,v1,vzero);
+ vbs9 = vec_perm(v2,v4,vperm3);
+ vbs11 = vec_perm(v2,v4,vperm4);
+ vbs10 = vec_perm(v3,v5,vperm3);
+ vbs12 = vec_perm(v3,v5,vperm4);
+
+ v2 = vec_perm(vbs5,vbs7,vperm1);
+ v3 = vec_perm(vbs6,vbs8,vperm1);
+ v4 = vec_perm(vbs5,vbs7,vperm2);
+ v5 = vec_perm(vbs6,vbs8,vperm2);
+ v6 = vec_sub(v2,v4);
+ v7 = vec_sub(v3,v5);
+ v2 = vec_add(v2,v4);
+ v3 = vec_add(v3,v5);
+ v4 = vec_madd(v6,v1,vzero);
+ v5 = vec_nmsub(v7,v1,vzero);
+ vbs13 = vec_perm(v2,v4,vperm3);
+ vbs15 = vec_perm(v2,v4,vperm4);
+ vbs14 = vec_perm(v3,v5,vperm3);
+ vbs16 = vec_perm(v3,v5,vperm4);
+
+
+ costab = pnts[4];
+
+ v1 = vec_lde(0,costab);
+#ifdef __APPLE__
+ v2 = (vector float)(1.0f,-1.0f,1.0f,-1.0f);
+#else
+ v2 = (vector float){1.0f,-1.0f,1.0f,-1.0f};
+#endif
+ v3 = vec_splat(v1,0);
+ v1 = vec_madd(v2,v3,vzero);
+
+ v2 = vec_mergeh(vbs9,vbs10);
+ v3 = vec_mergel(vbs9,vbs10);
+ v4 = vec_mergeh(vbs11,vbs12);
+ v5 = vec_mergel(vbs11,vbs12);
+ v6 = vec_mergeh(v2,v3);
+ v7 = vec_mergel(v2,v3);
+ v2 = vec_mergeh(v4,v5);
+ v3 = vec_mergel(v4,v5);
+ v4 = vec_sub(v6,v7);
+ v5 = vec_sub(v2,v3);
+ v6 = vec_add(v6,v7);
+ v7 = vec_add(v2,v3);
+ v2 = vec_madd(v4,v1,vzero);
+ v3 = vec_madd(v5,v1,vzero);
+ vbs1 = vec_mergeh(v6,v2);
+ vbs2 = vec_mergel(v6,v2);
+ vbs3 = vec_mergeh(v7,v3);
+ vbs4 = vec_mergel(v7,v3);
+
+ v2 = vec_mergeh(vbs13,vbs14);
+ v3 = vec_mergel(vbs13,vbs14);
+ v4 = vec_mergeh(vbs15,vbs16);
+ v5 = vec_mergel(vbs15,vbs16);
+ v6 = vec_mergeh(v2,v3);
+ v7 = vec_mergel(v2,v3);
+ v2 = vec_mergeh(v4,v5);
+ v3 = vec_mergel(v4,v5);
+ v4 = vec_sub(v6,v7);
+ v5 = vec_sub(v2,v3);
+ v6 = vec_add(v6,v7);
+ v7 = vec_add(v2,v3);
+ v2 = vec_madd(v4,v1,vzero);
+ v3 = vec_madd(v5,v1,vzero);
+ vbs5 = vec_mergeh(v6,v2);
+ vbs6 = vec_mergel(v6,v2);
+ vbs7 = vec_mergeh(v7,v3);
+ vbs8 = vec_mergel(v7,v3);
+
+ vec_st(vbs1,0,bufs);
+ vec_st(vbs2,16,bufs);
+ vec_st(vbs3,32,bufs);
+ vec_st(vbs4,48,bufs);
+ vec_st(vbs5,64,bufs);
+ vec_st(vbs6,80,bufs);
+ vec_st(vbs7,96,bufs);
+ vec_st(vbs8,112,bufs);
+ }
+
+ {
+ register real *b1;
+ register int i;
+
+ for(b1=bufs,i=8;i;i--,b1+=4)
+ b1[2] += b1[3];
+
+ for(b1=bufs,i=4;i;i--,b1+=8)
+ {
+ b1[4] += b1[6];
+ b1[6] += b1[5];
+ b1[5] += b1[7];
+ }
+
+ for(b1=bufs,i=2;i;i--,b1+=16)
+ {
+ b1[8] += b1[12];
+ b1[12] += b1[10];
+ b1[10] += b1[14];
+ b1[14] += b1[9];
+ b1[9] += b1[13];
+ b1[13] += b1[11];
+ b1[11] += b1[15];
+ }
+ }
+
+
+ out0[0x10*16] = bufs[0];
+ out0[0x10*15] = bufs[16+0] + bufs[16+8];
+ out0[0x10*14] = bufs[8];
+ out0[0x10*13] = bufs[16+8] + bufs[16+4];
+ out0[0x10*12] = bufs[4];
+ out0[0x10*11] = bufs[16+4] + bufs[16+12];
+ out0[0x10*10] = bufs[12];
+ out0[0x10* 9] = bufs[16+12] + bufs[16+2];
+ out0[0x10* 8] = bufs[2];
+ out0[0x10* 7] = bufs[16+2] + bufs[16+10];
+ out0[0x10* 6] = bufs[10];
+ out0[0x10* 5] = bufs[16+10] + bufs[16+6];
+ out0[0x10* 4] = bufs[6];
+ out0[0x10* 3] = bufs[16+6] + bufs[16+14];
+ out0[0x10* 2] = bufs[14];
+ out0[0x10* 1] = bufs[16+14] + bufs[16+1];
+ out0[0x10* 0] = bufs[1];
+
+ out1[0x10* 0] = bufs[1];
+ out1[0x10* 1] = bufs[16+1] + bufs[16+9];
+ out1[0x10* 2] = bufs[9];
+ out1[0x10* 3] = bufs[16+9] + bufs[16+5];
+ out1[0x10* 4] = bufs[5];
+ out1[0x10* 5] = bufs[16+5] + bufs[16+13];
+ out1[0x10* 6] = bufs[13];
+ out1[0x10* 7] = bufs[16+13] + bufs[16+3];
+ out1[0x10* 8] = bufs[3];
+ out1[0x10* 9] = bufs[16+3] + bufs[16+11];
+ out1[0x10*10] = bufs[11];
+ out1[0x10*11] = bufs[16+11] + bufs[16+7];
+ out1[0x10*12] = bufs[7];
+ out1[0x10*13] = bufs[16+7] + bufs[16+15];
+ out1[0x10*14] = bufs[15];
+ out1[0x10*15] = bufs[16+15];
+
+}
+
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_avx.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_avx.S
new file mode 100644
index 00000000..3a8468e8
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_avx.S
@@ -0,0 +1,324 @@
+/*
+ dct36_sse: AVX optimized dct64 for x86-64
+
+ copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#define samples %rdx
+#define costab %rcx
+#define out0 %rdi
+#define out1 %rsi
+
+/*
+ void dct64_avx(short *out0, short *out1, real *samples);
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+costab_avx:
+ .long 1056974725
+ .long 1057056395
+ .long 1057223771
+ .long 1057485416
+ .long 1057855544
+ .long 1058356026
+ .long 1059019886
+ .long 1059897405
+ .long 1061067246
+ .long 1062657950
+ .long 1064892987
+ .long 1066774581
+ .long 1069414683
+ .long 1073984175
+ .long 1079645762
+ .long 1092815430
+ .long 1057005197
+ .long 1057342072
+ .long 1058087743
+ .long 1059427869
+ .long 1061799040
+ .long 1065862217
+ .long 1071413542
+ .long 1084439708
+ .long 1057128951
+ .long 1058664893
+ .long 1063675095
+ .long 1076102863
+ .long 1057655764
+ .long 1067924853
+ .long 1060439283
+ .long 0
+ .text
+ ALIGN16
+.globl ASM_NAME(dct64_avx)
+ASM_NAME(dct64_avx):
+#ifdef IS_MSABI
+ push %rbp
+ mov %rsp, %rbp
+ sub $112, %rsp
+ movaps %xmm6, (%rsp)
+ movaps %xmm7, 16(%rsp)
+ movaps %xmm8, 32(%rsp)
+ movaps %xmm9, 48(%rsp)
+ movaps %xmm10, 64(%rsp)
+ movaps %xmm11, 80(%rsp)
+ movaps %xmm12, 96(%rsp)
+ push %rdi
+ push %rsi
+ mov %rcx, %rdi
+ mov %rdx, %rsi
+ mov %r8, %rdx
+#endif
+ leaq costab_avx(%rip), costab
+
+ vmovups (samples), %ymm0 # input[0,1,2,3,4,5,6,7]
+ vmovups 32(samples), %ymm1 # input[8,9,10,11,12,13,14,15]
+ vperm2f128 $0x23, 64(samples), %ymm2, %ymm2
+ vperm2f128 $0x23, 96(samples), %ymm3, %ymm3
+ vshufps $0x1b, %ymm2, %ymm2, %ymm2 # input[23,22,21,20,19,18,17,16]
+ vshufps $0x1b, %ymm3, %ymm3, %ymm3 # input[31,30,29,28,27,26,25,24]
+ vsubps %ymm2, %ymm1, %ymm6
+ vsubps %ymm3, %ymm0, %ymm7
+ vaddps %ymm0, %ymm3, %ymm4 # bufs[0,1,2,3,4,5,6,7]
+ vaddps %ymm1, %ymm2, %ymm5 # bufs[8,9,10,11,12,13,14,15]
+ vmulps (costab), %ymm7, %ymm7 # bufs[31,30,29,28,27,26,25,24] cos64[0,1,2,3,4,5,6,7]
+ vmulps 32(costab), %ymm6, %ymm6 # bufs[23,22,21,20,19,18,17,16] cos64[8,9,10,11,12,13,14,15]
+
+ vmovaps 64(costab), %ymm8 # cos32[0,1,2,3,4,5,6,7]
+
+ vshufps $0x1b, %ymm5, %ymm5, %ymm5
+ vshufps $0x1b, %ymm6, %ymm6, %ymm6
+ vperm2f128 $0x01, %ymm5, %ymm5, %ymm5 # bufs[15,14,13,12,11,10,9,8]
+ vperm2f128 $0x01, %ymm6, %ymm6, %ymm6 # bufs[16,17,18,19,20,21,22,23]
+ vsubps %ymm5, %ymm4, %ymm1
+ vsubps %ymm6, %ymm7, %ymm3
+ vaddps %ymm5, %ymm4, %ymm0 # bufs[32,33,34,35,36,37,38,39]
+ vaddps %ymm6, %ymm7, %ymm2 # bufs[48,49,50,51,52,53,54,55]
+ vmulps %ymm1, %ymm8, %ymm1 # bufs[47,46,45,44,43,42,41,40]
+ vmulps %ymm3, %ymm8, %ymm3 # bufs[63,62,61,60,59,58,57,56]
+
+ vmovaps 96(costab), %ymm8 # cos16[0,1,2,3]:cos8[0,1]:cos4[0]:-
+ vperm2f128 $0x00, %ymm8, %ymm8, %ymm9 # cos16[0,1,2,3,0,1,2,3]
+
+ vperm2f128 $0x20, %ymm1, %ymm0, %ymm4 # bufs[32,33,34,35,47,46,45,44]
+ vperm2f128 $0x31, %ymm1, %ymm0, %ymm5
+ vshufps $0x1b, %ymm5, %ymm5, %ymm5 # bufs[39,38,37,36,40,41,42,43]
+ vperm2f128 $0x20, %ymm3, %ymm2, %ymm6 # bufs[48,49,50,51,63,62,61,60]
+ vperm2f128 $0x31, %ymm3, %ymm2, %ymm7
+ vshufps $0x1b, %ymm7, %ymm7, %ymm7 # bufs[55,54,53,52,56,57,58,59]
+ vsubps %ymm5, %ymm4, %ymm1
+ vsubps %ymm7, %ymm6, %ymm3
+ vaddps %ymm5, %ymm4, %ymm0 # bufs[0,1,2,3,8,9,10,11]
+ vaddps %ymm7, %ymm6, %ymm2 # bufs[16,17,18,19,24,25,26,27]
+ vmulps %ymm1, %ymm9, %ymm1 # bufs[7,6,5,4,15,14,13,12]
+ vmulps %ymm3, %ymm9, %ymm3 # bufs[23,22,21,20,31,30,29,28]
+
+ vperm2f128 $0x11, %ymm8, %ymm8, %ymm8 # cos8[0,1]:cos4[0]:-:cos8[0,1]:cos4[0]:-
+ vmovddup %ymm8, %ymm9 # cos8[0,1,0,1,0,1,0,1]
+
+ vunpcklps %ymm1, %ymm0, %ymm4 # bufs[0,7,1,6,8,15,9,14]
+ vunpckhps %ymm1, %ymm0, %ymm5 # bufs[2,5,3,4,10,13,11,12]
+ vunpcklps %ymm3, %ymm2, %ymm6 # bufs[16,23,17,22,24,31,25,30]
+ vunpckhps %ymm3, %ymm2, %ymm7 # bufs[18,21,19,20,26,29,27,28]
+ vshufps $0xd8, %ymm4, %ymm4, %ymm4 # bufs[0,1,7,6,8,9,15,14]
+ vshufps $0x72, %ymm5, %ymm5, %ymm5 # bufs[3,2,4,5,11,10,12,13]
+ vshufps $0xd8, %ymm6, %ymm6, %ymm6 # bufs[16,17,23,22,24,25,31,30]
+ vshufps $0x72, %ymm7, %ymm7, %ymm7 # bufs[19,18,20,21,27,26,28,29]
+ vsubps %ymm5, %ymm4, %ymm1
+ vsubps %ymm7, %ymm6, %ymm3
+ vaddps %ymm5, %ymm4, %ymm0 # bufs[32,33,36,37,40,41,44,45]
+ vaddps %ymm7, %ymm6, %ymm2 # bufs[48,49,52,53,56,57,60,61]
+ vmulps %ymm1, %ymm9, %ymm1 # bufs[35,34,39,38,43,42,47,46]
+ vmulps %ymm3, %ymm9, %ymm3 # bufs[51,50,55,54,59,58,63,62]
+
+ vpermilps $0xaa, %ymm8, %ymm8 # cos4[0,0,0,0,0,0,0,0]
+
+ vshufps $0xd8, %ymm0, %ymm0, %ymm0 # bufs[32,36,33,37,40,44,41,45]
+ vshufps $0xd8, %ymm1, %ymm1, %ymm1 # bufs[35,39,34,38,43,47,42,46]
+ vshufps $0xd8, %ymm2, %ymm2, %ymm2 # bufs[48,52,49,53,56,60,57,61]
+ vshufps $0xd8, %ymm3, %ymm3, %ymm3 # bufs[51,55,50,54,59,63,58,62]
+ vunpcklps %ymm1, %ymm0, %ymm4 # bufs[32,35,36,39,40,43,44,47]
+ vunpckhps %ymm1, %ymm0, %ymm5 # bufs[33,34,37,38,41,42,45,46]
+ vunpcklps %ymm3, %ymm2, %ymm6 # bufs[48,51,52,55,56,59,60,63]
+ vunpckhps %ymm3, %ymm2, %ymm7 # bufs[49,50,53,54,57,58,61,62]
+ vsubps %ymm5, %ymm4, %ymm1
+ vsubps %ymm7, %ymm6, %ymm3
+ vaddps %ymm5, %ymm4, %ymm0 # bufs[0,2,4,6,8,10,12,14]
+ vaddps %ymm7, %ymm6, %ymm2 # bufs[16,18,20,22,24,26,28,30]
+ vmulps %ymm1, %ymm8, %ymm1 # bufs[1,3,5,7,9,11,13,15]
+ vmulps %ymm3, %ymm8, %ymm3 # bufs[17,19,21,23,25,27,29,31]
+
+ vxorps %ymm8, %ymm8, %ymm8
+ vblendps $0xaa, %ymm1, %ymm8, %ymm5
+ vblendps $0xaa, %ymm3, %ymm8, %ymm6
+ vaddps %ymm5, %ymm0, %ymm0
+ vaddps %ymm6, %ymm2, %ymm2
+ vunpcklps %ymm1, %ymm0, %ymm4 # bufs[0,1,2,3,8,9,10,11]
+ vunpckhps %ymm1, %ymm0, %ymm5 # bufs[4,5,6,7,12,13,14,15]
+ vunpcklps %ymm3, %ymm2, %ymm6 # bufs[16,17,18,19,24,25,26,27]
+ vunpckhps %ymm3, %ymm2, %ymm7 # bufs[20,21,22,23,28,29,30,31]
+
+ vextractf128 $0x1, %ymm4, %xmm0 # bufs[8,9,10,11]
+ vextractf128 $0x1, %ymm5, %xmm1 # bufs[12,13,14,15]
+ vextractf128 $0x1, %ymm6, %xmm2 # bufs[24,25,26,27]
+ vextractf128 $0x1, %ymm7, %xmm3 # bufs[28,29,30,31]
+
+ vshufps $0x1e, %xmm5, %xmm5, %xmm9 # bufs[6,7,5,4]
+ vshufps $0x1e, %xmm1, %xmm1, %xmm10 # bufs[14,15,13,12]
+ vshufps $0x1e, %xmm7, %xmm7, %xmm11 # bufs[22,23,21,20]
+ vshufps $0x1e, %xmm3, %xmm3, %xmm12 # bufs[30,31,29,28]
+ vblendps $0x7, %xmm9, %xmm8, %xmm9 # bufs[6,7,5,-]
+ vblendps $0x7, %xmm10, %xmm8, %xmm10 # bufs[14,15,13,-]
+ vblendps $0x7, %xmm11, %xmm8, %xmm11 # bufs[22,23,21,-]
+ vblendps $0x7, %xmm12, %xmm8, %xmm12 # bufs[30,31,29,-]
+ vaddps %xmm5, %xmm9, %xmm5
+ vaddps %xmm1, %xmm10, %xmm1
+ vaddps %xmm7, %xmm11, %xmm7
+ vaddps %xmm3, %xmm12, %xmm3
+
+ prefetcht0 512(out0)
+
+ vshufps $0x1e, %xmm0, %xmm0, %xmm9 # bufs[10,11,9,8]
+ vshufps $0x1e, %xmm2, %xmm2, %xmm10 # bufs[26,27,25,24]
+ vaddps %xmm1, %xmm0, %xmm0
+ vaddps %xmm3, %xmm2, %xmm2
+ vblendps $0x7, %xmm9, %xmm8, %xmm9 # bufs[10,11,9,-]
+ vblendps $0x7, %xmm10, %xmm8, %xmm10 # bufs[26,27,25,-]
+ vaddps %xmm1, %xmm9, %xmm1
+ vaddps %xmm3, %xmm10, %xmm3
+
+ vzeroupper
+ prefetcht0 512(out1)
+
+ cvtps2dq %xmm4, %xmm4
+ cvtps2dq %xmm0, %xmm0
+ cvtps2dq %xmm5, %xmm5
+ cvtps2dq %xmm1, %xmm1
+ packssdw %xmm5, %xmm4
+ packssdw %xmm1, %xmm0
+ movq %xmm4, %rcx
+ pshufd $0x4e, %xmm4, %xmm5
+ movq %xmm0, %rdx
+ pshufd $0x4e, %xmm0, %xmm1
+ movq %xmm5, %r8
+ movq %xmm1, %r9
+
+ addq $512, out0
+ movq $-64, %rax
+
+ movw %cx, (out0)
+ movw %dx, (out0,%rax,1)
+ movw %r8w, (out0,%rax,2)
+ movw %r9w, -64(out0,%rax,2)
+ leaq (out0,%rax,4), out0
+ shr $16, %rcx
+ shr $16, %rdx
+ shr $16, %r8
+ shr $16, %r9
+ movw %cx, (out0,%rax,4)
+ negq %rax
+ movw %cx, (out1)
+ movw %dx, (out1,%rax,1)
+ movw %r8w, (out1,%rax,2)
+ movw %r9w, 64(out1,%rax,2)
+ leaq (out1,%rax,4), out1
+ shr $16, %rcx
+ shr $16, %rdx
+ shr $16, %r8
+ shr $16, %r9
+ negq %rax
+ movw %cx, (out0)
+ movw %dx, (out0,%rax,1)
+ movw %r8w, (out0,%rax,2)
+ movw %r9w, -64(out0,%rax,2)
+ shr $16, %rcx
+ shr $16, %rdx
+ shr $16, %r8
+ shr $16, %r9
+ negq %rax
+ movw %cx, (out1)
+ movw %dx, (out1,%rax,1)
+ movw %r8w, (out1,%rax,2)
+ movw %r9w, 64(out1,%rax,2)
+
+ leaq -32(out0,%rax,4), out0
+ negq %rax
+ leaq 32(out1,%rax,4), out1
+
+ vshufps $0x1e, %xmm6, %xmm6, %xmm0
+ vblendps $0x7, %xmm0, %xmm8, %xmm0
+ addps %xmm2, %xmm6
+ addps %xmm7, %xmm2
+ addps %xmm3, %xmm7
+ addps %xmm0, %xmm3
+ cvtps2dq %xmm6, %xmm6
+ cvtps2dq %xmm2, %xmm2
+ cvtps2dq %xmm7, %xmm7
+ cvtps2dq %xmm3, %xmm3
+ packssdw %xmm7, %xmm6
+ packssdw %xmm3, %xmm2
+ movq %xmm6, %rcx
+ pshufd $0x4e, %xmm6, %xmm7
+ movq %xmm2, %rdx
+ pshufd $0x4e, %xmm2, %xmm3
+ movq %xmm7, %r8
+ movq %xmm3, %r9
+
+ movw %cx, (out0)
+ movw %dx, (out0,%rax,1)
+ movw %r8w, (out0,%rax,2)
+ movw %r9w, -64(out0,%rax,2)
+ leaq (out0,%rax,4), out0
+ shr $16, %rcx
+ shr $16, %rdx
+ shr $16, %r8
+ shr $16, %r9
+ negq %rax
+ movw %cx, (out1)
+ movw %dx, (out1,%rax,1)
+ movw %r8w, (out1,%rax,2)
+ movw %r9w, 64(out1,%rax,2)
+ leaq (out1,%rax,4), out1
+ shr $16, %rcx
+ shr $16, %rdx
+ shr $16, %r8
+ shr $16, %r9
+ negq %rax
+ movw %cx, (out0)
+ movw %dx, (out0,%rax,1)
+ movw %r8w, (out0,%rax,2)
+ movw %r9w, -64(out0,%rax,2)
+ shr $16, %rcx
+ shr $16, %rdx
+ shr $16, %r8
+ shr $16, %r9
+ negq %rax
+ movw %cx, (out1)
+ movw %dx, (out1,%rax,1)
+ movw %r8w, (out1,%rax,2)
+ movw %r9w, 64(out1,%rax,2)
+
+#ifdef IS_MSABI
+ pop %rsi
+ pop %rdi
+ movaps (%rsp), %xmm6
+ movaps 16(%rsp), %xmm7
+ movaps 32(%rsp), %xmm8
+ movaps 48(%rsp), %xmm9
+ movaps 64(%rsp), %xmm10
+ movaps 80(%rsp), %xmm11
+ movaps 96(%rsp), %xmm12
+ mov %rbp, %rsp
+ pop %rbp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_avx_float.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_avx_float.S
new file mode 100644
index 00000000..e4c024e2
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_avx_float.S
@@ -0,0 +1,294 @@
+/*
+ dct64_x86_64_float: SSE optimized dct64 for x86-64 (float output version)
+
+ copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#define samples %rdx
+#define costab %rcx
+#define out0 %rdi
+#define out1 %rsi
+
+/*
+ void dct64_real_avx(real *out0, real *out1, real *samples);
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+costab_avx:
+ .long 1056974725
+ .long 1057056395
+ .long 1057223771
+ .long 1057485416
+ .long 1057855544
+ .long 1058356026
+ .long 1059019886
+ .long 1059897405
+ .long 1061067246
+ .long 1062657950
+ .long 1064892987
+ .long 1066774581
+ .long 1069414683
+ .long 1073984175
+ .long 1079645762
+ .long 1092815430
+ .long 1057005197
+ .long 1057342072
+ .long 1058087743
+ .long 1059427869
+ .long 1061799040
+ .long 1065862217
+ .long 1071413542
+ .long 1084439708
+ .long 1057128951
+ .long 1058664893
+ .long 1063675095
+ .long 1076102863
+ .long 1057655764
+ .long 1067924853
+ .long 1060439283
+ .long 0
+ .text
+ ALIGN16
+.globl ASM_NAME(dct64_real_avx)
+ASM_NAME(dct64_real_avx):
+#ifdef IS_MSABI
+ push %rbp
+ mov %rsp, %rbp
+ sub $112, %rsp
+ movaps %xmm6, (%rsp)
+ movaps %xmm7, 16(%rsp)
+ movaps %xmm8, 32(%rsp)
+ movaps %xmm9, 48(%rsp)
+ movaps %xmm10, 64(%rsp)
+ movaps %xmm11, 80(%rsp)
+ movaps %xmm12, 96(%rsp)
+ push %rdi
+ push %rsi
+ mov %rcx, %rdi
+ mov %rdx, %rsi
+ mov %r8, %rdx
+#endif
+ leaq costab_avx(%rip), costab
+
+ vmovups (samples), %ymm0 # input[0,1,2,3,4,5,6,7]
+ vmovups 32(samples), %ymm1 # input[8,9,10,11,12,13,14,15]
+ vperm2f128 $0x23, 64(samples), %ymm2, %ymm2
+ vperm2f128 $0x23, 96(samples), %ymm3, %ymm3
+ vshufps $0x1b, %ymm2, %ymm2, %ymm2 # input[23,22,21,20,19,18,17,16]
+ vshufps $0x1b, %ymm3, %ymm3, %ymm3 # input[31,30,29,28,27,26,25,24]
+ vsubps %ymm2, %ymm1, %ymm6
+ vsubps %ymm3, %ymm0, %ymm7
+ vaddps %ymm0, %ymm3, %ymm4 # bufs[0,1,2,3,4,5,6,7]
+ vaddps %ymm1, %ymm2, %ymm5 # bufs[8,9,10,11,12,13,14,15]
+ vmulps (costab), %ymm7, %ymm7 # bufs[31,30,29,28,27,26,25,24] cos64[0,1,2,3,4,5,6,7]
+ vmulps 32(costab), %ymm6, %ymm6 # bufs[23,22,21,20,19,18,17,16] cos64[8,9,10,11,12,13,14,15]
+
+ vmovaps 64(costab), %ymm8 # cos32[0,1,2,3,4,5,6,7]
+
+ vshufps $0x1b, %ymm5, %ymm5, %ymm5
+ vshufps $0x1b, %ymm6, %ymm6, %ymm6
+ vperm2f128 $0x01, %ymm5, %ymm5, %ymm5 # bufs[15,14,13,12,11,10,9,8]
+ vperm2f128 $0x01, %ymm6, %ymm6, %ymm6 # bufs[16,17,18,19,20,21,22,23]
+ vsubps %ymm5, %ymm4, %ymm1
+ vsubps %ymm6, %ymm7, %ymm3
+ vaddps %ymm5, %ymm4, %ymm0 # bufs[32,33,34,35,36,37,38,39]
+ vaddps %ymm6, %ymm7, %ymm2 # bufs[48,49,50,51,52,53,54,55]
+ vmulps %ymm1, %ymm8, %ymm1 # bufs[47,46,45,44,43,42,41,40]
+ vmulps %ymm3, %ymm8, %ymm3 # bufs[63,62,61,60,59,58,57,56]
+
+ vmovaps 96(costab), %ymm8 # cos16[0,1,2,3]:cos8[0,1]:cos4[0]:-
+ vperm2f128 $0x00, %ymm8, %ymm8, %ymm9 # cos16[0,1,2,3,0,1,2,3]
+
+ vperm2f128 $0x20, %ymm1, %ymm0, %ymm4 # bufs[32,33,34,35,47,46,45,44]
+ vperm2f128 $0x31, %ymm1, %ymm0, %ymm5
+ vshufps $0x1b, %ymm5, %ymm5, %ymm5 # bufs[39,38,37,36,40,41,42,43]
+ vperm2f128 $0x20, %ymm3, %ymm2, %ymm6 # bufs[48,49,50,51,63,62,61,60]
+ vperm2f128 $0x31, %ymm3, %ymm2, %ymm7
+ vshufps $0x1b, %ymm7, %ymm7, %ymm7 # bufs[55,54,53,52,56,57,58,59]
+ vsubps %ymm5, %ymm4, %ymm1
+ vsubps %ymm7, %ymm6, %ymm3
+ vaddps %ymm5, %ymm4, %ymm0 # bufs[0,1,2,3,8,9,10,11]
+ vaddps %ymm7, %ymm6, %ymm2 # bufs[16,17,18,19,24,25,26,27]
+ vmulps %ymm1, %ymm9, %ymm1 # bufs[7,6,5,4,15,14,13,12]
+ vmulps %ymm3, %ymm9, %ymm3 # bufs[23,22,21,20,31,30,29,28]
+
+ vperm2f128 $0x11, %ymm8, %ymm8, %ymm8 # cos8[0,1]:cos4[0]:-:cos8[0,1]:cos4[0]:-
+ vmovddup %ymm8, %ymm9 # cos8[0,1,0,1,0,1,0,1]
+
+ vunpcklps %ymm1, %ymm0, %ymm4 # bufs[0,7,1,6,8,15,9,14]
+ vunpckhps %ymm1, %ymm0, %ymm5 # bufs[2,5,3,4,10,13,11,12]
+ vunpcklps %ymm3, %ymm2, %ymm6 # bufs[16,23,17,22,24,31,25,30]
+ vunpckhps %ymm3, %ymm2, %ymm7 # bufs[18,21,19,20,26,29,27,28]
+ vshufps $0xd8, %ymm4, %ymm4, %ymm4 # bufs[0,1,7,6,8,9,15,14]
+ vshufps $0x72, %ymm5, %ymm5, %ymm5 # bufs[3,2,4,5,11,10,12,13]
+ vshufps $0xd8, %ymm6, %ymm6, %ymm6 # bufs[16,17,23,22,24,25,31,30]
+ vshufps $0x72, %ymm7, %ymm7, %ymm7 # bufs[19,18,20,21,27,26,28,29]
+ vsubps %ymm5, %ymm4, %ymm1
+ vsubps %ymm7, %ymm6, %ymm3
+ vaddps %ymm5, %ymm4, %ymm0 # bufs[32,33,36,37,40,41,44,45]
+ vaddps %ymm7, %ymm6, %ymm2 # bufs[48,49,52,53,56,57,60,61]
+ vmulps %ymm1, %ymm9, %ymm1 # bufs[35,34,39,38,43,42,47,46]
+ vmulps %ymm3, %ymm9, %ymm3 # bufs[51,50,55,54,59,58,63,62]
+
+ vpermilps $0xaa, %ymm8, %ymm8 # cos4[0,0,0,0,0,0,0,0]
+
+ vshufps $0xd8, %ymm0, %ymm0, %ymm0 # bufs[32,36,33,37,40,44,41,45]
+ vshufps $0xd8, %ymm1, %ymm1, %ymm1 # bufs[35,39,34,38,43,47,42,46]
+ vshufps $0xd8, %ymm2, %ymm2, %ymm2 # bufs[48,52,49,53,56,60,57,61]
+ vshufps $0xd8, %ymm3, %ymm3, %ymm3 # bufs[51,55,50,54,59,63,58,62]
+ vunpcklps %ymm1, %ymm0, %ymm4 # bufs[32,35,36,39,40,43,44,47]
+ vunpckhps %ymm1, %ymm0, %ymm5 # bufs[33,34,37,38,41,42,45,46]
+ vunpcklps %ymm3, %ymm2, %ymm6 # bufs[48,51,52,55,56,59,60,63]
+ vunpckhps %ymm3, %ymm2, %ymm7 # bufs[49,50,53,54,57,58,61,62]
+ vsubps %ymm5, %ymm4, %ymm1
+ vsubps %ymm7, %ymm6, %ymm3
+ vaddps %ymm5, %ymm4, %ymm0 # bufs[0,2,4,6,8,10,12,14]
+ vaddps %ymm7, %ymm6, %ymm2 # bufs[16,18,20,22,24,26,28,30]
+ vmulps %ymm1, %ymm8, %ymm1 # bufs[1,3,5,7,9,11,13,15]
+ vmulps %ymm3, %ymm8, %ymm3 # bufs[17,19,21,23,25,27,29,31]
+
+ vxorps %ymm8, %ymm8, %ymm8
+ vblendps $0xaa, %ymm1, %ymm8, %ymm5
+ vblendps $0xaa, %ymm3, %ymm8, %ymm6
+ vaddps %ymm5, %ymm0, %ymm0
+ vaddps %ymm6, %ymm2, %ymm2
+ vunpcklps %ymm1, %ymm0, %ymm4 # bufs[0,1,2,3,8,9,10,11]
+ vunpckhps %ymm1, %ymm0, %ymm5 # bufs[4,5,6,7,12,13,14,15]
+ vunpcklps %ymm3, %ymm2, %ymm6 # bufs[16,17,18,19,24,25,26,27]
+ vunpckhps %ymm3, %ymm2, %ymm7 # bufs[20,21,22,23,28,29,30,31]
+
+ vextractf128 $0x1, %ymm4, %xmm0 # bufs[8,9,10,11]
+ vextractf128 $0x1, %ymm5, %xmm1 # bufs[12,13,14,15]
+ vextractf128 $0x1, %ymm6, %xmm2 # bufs[24,25,26,27]
+ vextractf128 $0x1, %ymm7, %xmm3 # bufs[28,29,30,31]
+
+ vshufps $0x1e, %xmm5, %xmm5, %xmm9 # bufs[6,7,5,4]
+ vshufps $0x1e, %xmm1, %xmm1, %xmm10 # bufs[14,15,13,12]
+ vshufps $0x1e, %xmm7, %xmm7, %xmm11 # bufs[22,23,21,20]
+ vshufps $0x1e, %xmm3, %xmm3, %xmm12 # bufs[30,31,29,28]
+ vblendps $0x7, %xmm9, %xmm8, %xmm9 # bufs[6,7,5,-]
+ vblendps $0x7, %xmm10, %xmm8, %xmm10 # bufs[14,15,13,-]
+ vblendps $0x7, %xmm11, %xmm8, %xmm11 # bufs[22,23,21,-]
+ vblendps $0x7, %xmm12, %xmm8, %xmm12 # bufs[30,31,29,-]
+ vaddps %xmm5, %xmm9, %xmm5
+ vaddps %xmm1, %xmm10, %xmm1
+ vaddps %xmm7, %xmm11, %xmm7
+ vaddps %xmm3, %xmm12, %xmm3
+
+ prefetcht0 1024(out0)
+
+ vshufps $0x1e, %xmm0, %xmm0, %xmm9 # bufs[10,11,9,8]
+ vshufps $0x1e, %xmm2, %xmm2, %xmm10 # bufs[26,27,25,24]
+ vaddps %xmm1, %xmm0, %xmm0
+ vaddps %xmm3, %xmm2, %xmm2
+ vblendps $0x7, %xmm9, %xmm8, %xmm9 # bufs[10,11,9,-]
+ vblendps $0x7, %xmm10, %xmm8, %xmm10 # bufs[26,27,25,-]
+ vaddps %xmm1, %xmm9, %xmm1
+ vaddps %xmm3, %xmm10, %xmm3
+
+ vzeroupper
+ prefetcht0 1024(out1)
+
+ addq $1024, out0
+ movq $-128, %rax
+ movss %xmm4, (out0)
+ movss %xmm0, (out0,%rax,1)
+ movss %xmm5, (out0,%rax,2)
+ movss %xmm1, -128(out0,%rax,2)
+ leaq (out0,%rax,4), out0
+ movhlps %xmm4, %xmm9
+ movhlps %xmm0, %xmm10
+ movhlps %xmm5, %xmm11
+ movhlps %xmm1, %xmm12
+ vmovss %xmm9, (out0)
+ vmovss %xmm10, (out0,%rax,1)
+ vmovss %xmm11, (out0,%rax,2)
+ vmovss %xmm12, -128(out0,%rax,2)
+ leaq (out0,%rax,4), out0
+ negq %rax
+ shufps $0xb1, %xmm4, %xmm4
+ shufps $0xb1, %xmm0, %xmm0
+ shufps $0xb1, %xmm5, %xmm5
+ shufps $0xb1, %xmm1, %xmm1
+ movss %xmm4, (out0)
+ movss %xmm4, (out1)
+ leaq (out1,%rax,1), out1
+ movss %xmm0, (out1)
+ movss %xmm5, (out1,%rax,1)
+ movss %xmm1, (out1,%rax,2)
+ leaq (out1,%rax,4), out1
+ movhlps %xmm4, %xmm4
+ movhlps %xmm0, %xmm0
+ movhlps %xmm5, %xmm5
+ movhlps %xmm1, %xmm1
+ movss %xmm4, -128(out1)
+ movss %xmm0, (out1)
+ movss %xmm5, (out1,%rax,1)
+ movss %xmm1, (out1,%rax,2)
+
+ leaq -64(out0,%rax,8), out0
+ negq %rax
+ vshufps $0x1e, %xmm6, %xmm6, %xmm0
+ vblendps $0x7, %xmm0, %xmm8, %xmm0
+ addps %xmm2, %xmm6
+ addps %xmm7, %xmm2
+ addps %xmm3, %xmm7
+ addps %xmm0, %xmm3
+ movss %xmm6, (out0)
+ movss %xmm2, (out0,%rax,1)
+ movss %xmm7, (out0,%rax,2)
+ movss %xmm3, -128(out0,%rax,2)
+ leaq (out0,%rax,4), out0
+ movhlps %xmm6, %xmm0
+ movhlps %xmm2, %xmm1
+ movhlps %xmm7, %xmm4
+ movhlps %xmm3, %xmm5
+ movss %xmm0, (out0)
+ movss %xmm1, (out0,%rax,1)
+ movss %xmm4, (out0,%rax,2)
+ movss %xmm5, -128(out0,%rax,2)
+ leaq 64(out1,%rax,4), out1
+ negq %rax
+ shufps $0xb1, %xmm6, %xmm6
+ shufps $0xb1, %xmm2, %xmm2
+ shufps $0xb1, %xmm7, %xmm7
+ shufps $0xb1, %xmm3, %xmm3
+ movss %xmm6, -128(out1)
+ movss %xmm2, (out1)
+ movss %xmm7, (out1,%rax,1)
+ movss %xmm3, (out1,%rax,2)
+ leaq (out1,%rax,4), out1
+ movhlps %xmm6, %xmm6
+ movhlps %xmm2, %xmm2
+ movhlps %xmm7, %xmm7
+ movhlps %xmm3, %xmm3
+ movss %xmm6, -128(out1)
+ movss %xmm2, (out1)
+ movss %xmm7, (out1,%rax,1)
+ movss %xmm3, (out1,%rax,2)
+
+#ifdef IS_MSABI
+ pop %rsi
+ pop %rdi
+ movaps (%rsp), %xmm6
+ movaps 16(%rsp), %xmm7
+ movaps 32(%rsp), %xmm8
+ movaps 48(%rsp), %xmm9
+ movaps 64(%rsp), %xmm10
+ movaps 80(%rsp), %xmm11
+ movaps 96(%rsp), %xmm12
+ mov %rbp, %rsp
+ pop %rbp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_i386.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_i386.c
new file mode 100644
index 00000000..7c610141
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_i386.c
@@ -0,0 +1,336 @@
+/*
+ dct64_i386.c: DCT64, a C variant for i386
+
+ copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp
+*/
+
+/*
+ * Discrete Cosine Tansform (DCT) for subband synthesis
+ * optimized for machines with no auto-increment.
+ * The performance is highly compiler dependend. Maybe
+ * the dct64.c version for 'normal' processor may be faster
+ * even for Intel processors.
+ */
+
+#include "mpg123lib_intern.h"
+
+static void dct64_1(real *out0,real *out1,real *b1,real *b2,real *samples)
+{
+ {
+ register const real *costab = pnts[0];
+
+ b1[0x00] = samples[0x00] + samples[0x1F];
+ b1[0x01] = samples[0x01] + samples[0x1E];
+ b1[0x1F] = REAL_MUL(samples[0x00] - samples[0x1F], costab[0x0]);
+ b1[0x1E] = REAL_MUL(samples[0x01] - samples[0x1E], costab[0x1]);
+
+ b1[0x02] = samples[0x02] + samples[0x1D];
+ b1[0x03] = samples[0x03] + samples[0x1C];
+ b1[0x1D] = REAL_MUL(samples[0x02] - samples[0x1D], costab[0x2]);
+ b1[0x1C] = REAL_MUL(samples[0x03] - samples[0x1C], costab[0x3]);
+
+ b1[0x04] = samples[0x04] + samples[0x1B];
+ b1[0x05] = samples[0x05] + samples[0x1A];
+ b1[0x1B] = REAL_MUL(samples[0x04] - samples[0x1B], costab[0x4]);
+ b1[0x1A] = REAL_MUL(samples[0x05] - samples[0x1A], costab[0x5]);
+
+ b1[0x06] = samples[0x06] + samples[0x19];
+ b1[0x07] = samples[0x07] + samples[0x18];
+ b1[0x19] = REAL_MUL(samples[0x06] - samples[0x19], costab[0x6]);
+ b1[0x18] = REAL_MUL(samples[0x07] - samples[0x18], costab[0x7]);
+
+ b1[0x08] = samples[0x08] + samples[0x17];
+ b1[0x09] = samples[0x09] + samples[0x16];
+ b1[0x17] = REAL_MUL(samples[0x08] - samples[0x17], costab[0x8]);
+ b1[0x16] = REAL_MUL(samples[0x09] - samples[0x16], costab[0x9]);
+
+ b1[0x0A] = samples[0x0A] + samples[0x15];
+ b1[0x0B] = samples[0x0B] + samples[0x14];
+ b1[0x15] = REAL_MUL(samples[0x0A] - samples[0x15], costab[0xA]);
+ b1[0x14] = REAL_MUL(samples[0x0B] - samples[0x14], costab[0xB]);
+
+ b1[0x0C] = samples[0x0C] + samples[0x13];
+ b1[0x0D] = samples[0x0D] + samples[0x12];
+ b1[0x13] = REAL_MUL(samples[0x0C] - samples[0x13], costab[0xC]);
+ b1[0x12] = REAL_MUL(samples[0x0D] - samples[0x12], costab[0xD]);
+
+ b1[0x0E] = samples[0x0E] + samples[0x11];
+ b1[0x0F] = samples[0x0F] + samples[0x10];
+ b1[0x11] = REAL_MUL(samples[0x0E] - samples[0x11], costab[0xE]);
+ b1[0x10] = REAL_MUL(samples[0x0F] - samples[0x10], costab[0xF]);
+
+ }
+
+
+ {
+ register const real *costab = pnts[1];
+
+ b2[0x00] = b1[0x00] + b1[0x0F];
+ b2[0x01] = b1[0x01] + b1[0x0E];
+ b2[0x0F] = REAL_MUL(b1[0x00] - b1[0x0F], costab[0]);
+ b2[0x0E] = REAL_MUL(b1[0x01] - b1[0x0E], costab[1]);
+
+ b2[0x02] = b1[0x02] + b1[0x0D];
+ b2[0x03] = b1[0x03] + b1[0x0C];
+ b2[0x0D] = REAL_MUL(b1[0x02] - b1[0x0D], costab[2]);
+ b2[0x0C] = REAL_MUL(b1[0x03] - b1[0x0C], costab[3]);
+
+ b2[0x04] = b1[0x04] + b1[0x0B];
+ b2[0x05] = b1[0x05] + b1[0x0A];
+ b2[0x0B] = REAL_MUL(b1[0x04] - b1[0x0B], costab[4]);
+ b2[0x0A] = REAL_MUL(b1[0x05] - b1[0x0A], costab[5]);
+
+ b2[0x06] = b1[0x06] + b1[0x09];
+ b2[0x07] = b1[0x07] + b1[0x08];
+ b2[0x09] = REAL_MUL(b1[0x06] - b1[0x09], costab[6]);
+ b2[0x08] = REAL_MUL(b1[0x07] - b1[0x08], costab[7]);
+
+ /* */
+
+ b2[0x10] = b1[0x10] + b1[0x1F];
+ b2[0x11] = b1[0x11] + b1[0x1E];
+ b2[0x1F] = REAL_MUL(b1[0x1F] - b1[0x10], costab[0]);
+ b2[0x1E] = REAL_MUL(b1[0x1E] - b1[0x11], costab[1]);
+
+ b2[0x12] = b1[0x12] + b1[0x1D];
+ b2[0x13] = b1[0x13] + b1[0x1C];
+ b2[0x1D] = REAL_MUL(b1[0x1D] - b1[0x12], costab[2]);
+ b2[0x1C] = REAL_MUL(b1[0x1C] - b1[0x13], costab[3]);
+
+ b2[0x14] = b1[0x14] + b1[0x1B];
+ b2[0x15] = b1[0x15] + b1[0x1A];
+ b2[0x1B] = REAL_MUL(b1[0x1B] - b1[0x14], costab[4]);
+ b2[0x1A] = REAL_MUL(b1[0x1A] - b1[0x15], costab[5]);
+
+ b2[0x16] = b1[0x16] + b1[0x19];
+ b2[0x17] = b1[0x17] + b1[0x18];
+ b2[0x19] = REAL_MUL(b1[0x19] - b1[0x16], costab[6]);
+ b2[0x18] = REAL_MUL(b1[0x18] - b1[0x17], costab[7]);
+ }
+
+ {
+ register const real *costab = pnts[2];
+
+ b1[0x00] = b2[0x00] + b2[0x07];
+ b1[0x07] = REAL_MUL(b2[0x00] - b2[0x07], costab[0]);
+ b1[0x01] = b2[0x01] + b2[0x06];
+ b1[0x06] = REAL_MUL(b2[0x01] - b2[0x06], costab[1]);
+ b1[0x02] = b2[0x02] + b2[0x05];
+ b1[0x05] = REAL_MUL(b2[0x02] - b2[0x05], costab[2]);
+ b1[0x03] = b2[0x03] + b2[0x04];
+ b1[0x04] = REAL_MUL(b2[0x03] - b2[0x04], costab[3]);
+
+ b1[0x08] = b2[0x08] + b2[0x0F];
+ b1[0x0F] = REAL_MUL(b2[0x0F] - b2[0x08], costab[0]);
+ b1[0x09] = b2[0x09] + b2[0x0E];
+ b1[0x0E] = REAL_MUL(b2[0x0E] - b2[0x09], costab[1]);
+ b1[0x0A] = b2[0x0A] + b2[0x0D];
+ b1[0x0D] = REAL_MUL(b2[0x0D] - b2[0x0A], costab[2]);
+ b1[0x0B] = b2[0x0B] + b2[0x0C];
+ b1[0x0C] = REAL_MUL(b2[0x0C] - b2[0x0B], costab[3]);
+
+ b1[0x10] = b2[0x10] + b2[0x17];
+ b1[0x17] = REAL_MUL(b2[0x10] - b2[0x17], costab[0]);
+ b1[0x11] = b2[0x11] + b2[0x16];
+ b1[0x16] = REAL_MUL(b2[0x11] - b2[0x16], costab[1]);
+ b1[0x12] = b2[0x12] + b2[0x15];
+ b1[0x15] = REAL_MUL(b2[0x12] - b2[0x15], costab[2]);
+ b1[0x13] = b2[0x13] + b2[0x14];
+ b1[0x14] = REAL_MUL(b2[0x13] - b2[0x14], costab[3]);
+
+ b1[0x18] = b2[0x18] + b2[0x1F];
+ b1[0x1F] = REAL_MUL(b2[0x1F] - b2[0x18], costab[0]);
+ b1[0x19] = b2[0x19] + b2[0x1E];
+ b1[0x1E] = REAL_MUL(b2[0x1E] - b2[0x19], costab[1]);
+ b1[0x1A] = b2[0x1A] + b2[0x1D];
+ b1[0x1D] = REAL_MUL(b2[0x1D] - b2[0x1A], costab[2]);
+ b1[0x1B] = b2[0x1B] + b2[0x1C];
+ b1[0x1C] = REAL_MUL(b2[0x1C] - b2[0x1B], costab[3]);
+ }
+
+ {
+ register real const cos0 = pnts[3][0];
+ register real const cos1 = pnts[3][1];
+
+ b2[0x00] = b1[0x00] + b1[0x03];
+ b2[0x03] = REAL_MUL(b1[0x00] - b1[0x03], cos0);
+ b2[0x01] = b1[0x01] + b1[0x02];
+ b2[0x02] = REAL_MUL(b1[0x01] - b1[0x02], cos1);
+
+ b2[0x04] = b1[0x04] + b1[0x07];
+ b2[0x07] = REAL_MUL(b1[0x07] - b1[0x04], cos0);
+ b2[0x05] = b1[0x05] + b1[0x06];
+ b2[0x06] = REAL_MUL(b1[0x06] - b1[0x05], cos1);
+
+ b2[0x08] = b1[0x08] + b1[0x0B];
+ b2[0x0B] = REAL_MUL(b1[0x08] - b1[0x0B], cos0);
+ b2[0x09] = b1[0x09] + b1[0x0A];
+ b2[0x0A] = REAL_MUL(b1[0x09] - b1[0x0A], cos1);
+
+ b2[0x0C] = b1[0x0C] + b1[0x0F];
+ b2[0x0F] = REAL_MUL(b1[0x0F] - b1[0x0C], cos0);
+ b2[0x0D] = b1[0x0D] + b1[0x0E];
+ b2[0x0E] = REAL_MUL(b1[0x0E] - b1[0x0D], cos1);
+
+ b2[0x10] = b1[0x10] + b1[0x13];
+ b2[0x13] = REAL_MUL(b1[0x10] - b1[0x13], cos0);
+ b2[0x11] = b1[0x11] + b1[0x12];
+ b2[0x12] = REAL_MUL(b1[0x11] - b1[0x12], cos1);
+
+ b2[0x14] = b1[0x14] + b1[0x17];
+ b2[0x17] = REAL_MUL(b1[0x17] - b1[0x14], cos0);
+ b2[0x15] = b1[0x15] + b1[0x16];
+ b2[0x16] = REAL_MUL(b1[0x16] - b1[0x15], cos1);
+
+ b2[0x18] = b1[0x18] + b1[0x1B];
+ b2[0x1B] = REAL_MUL(b1[0x18] - b1[0x1B], cos0);
+ b2[0x19] = b1[0x19] + b1[0x1A];
+ b2[0x1A] = REAL_MUL(b1[0x19] - b1[0x1A], cos1);
+
+ b2[0x1C] = b1[0x1C] + b1[0x1F];
+ b2[0x1F] = REAL_MUL(b1[0x1F] - b1[0x1C], cos0);
+ b2[0x1D] = b1[0x1D] + b1[0x1E];
+ b2[0x1E] = REAL_MUL(b1[0x1E] - b1[0x1D], cos1);
+ }
+
+ {
+ register real const cos0 = pnts[4][0];
+
+ b1[0x00] = b2[0x00] + b2[0x01];
+ b1[0x01] = REAL_MUL(b2[0x00] - b2[0x01], cos0);
+ b1[0x02] = b2[0x02] + b2[0x03];
+ b1[0x03] = REAL_MUL(b2[0x03] - b2[0x02], cos0);
+ b1[0x02] += b1[0x03];
+
+ b1[0x04] = b2[0x04] + b2[0x05];
+ b1[0x05] = REAL_MUL(b2[0x04] - b2[0x05], cos0);
+ b1[0x06] = b2[0x06] + b2[0x07];
+ b1[0x07] = REAL_MUL(b2[0x07] - b2[0x06], cos0);
+ b1[0x06] += b1[0x07];
+ b1[0x04] += b1[0x06];
+ b1[0x06] += b1[0x05];
+ b1[0x05] += b1[0x07];
+
+ b1[0x08] = b2[0x08] + b2[0x09];
+ b1[0x09] = REAL_MUL(b2[0x08] - b2[0x09], cos0);
+ b1[0x0A] = b2[0x0A] + b2[0x0B];
+ b1[0x0B] = REAL_MUL(b2[0x0B] - b2[0x0A], cos0);
+ b1[0x0A] += b1[0x0B];
+
+ b1[0x0C] = b2[0x0C] + b2[0x0D];
+ b1[0x0D] = REAL_MUL(b2[0x0C] - b2[0x0D], cos0);
+ b1[0x0E] = b2[0x0E] + b2[0x0F];
+ b1[0x0F] = REAL_MUL(b2[0x0F] - b2[0x0E], cos0);
+ b1[0x0E] += b1[0x0F];
+ b1[0x0C] += b1[0x0E];
+ b1[0x0E] += b1[0x0D];
+ b1[0x0D] += b1[0x0F];
+
+ b1[0x10] = b2[0x10] + b2[0x11];
+ b1[0x11] = REAL_MUL(b2[0x10] - b2[0x11], cos0);
+ b1[0x12] = b2[0x12] + b2[0x13];
+ b1[0x13] = REAL_MUL(b2[0x13] - b2[0x12], cos0);
+ b1[0x12] += b1[0x13];
+
+ b1[0x14] = b2[0x14] + b2[0x15];
+ b1[0x15] = REAL_MUL(b2[0x14] - b2[0x15], cos0);
+ b1[0x16] = b2[0x16] + b2[0x17];
+ b1[0x17] = REAL_MUL(b2[0x17] - b2[0x16], cos0);
+ b1[0x16] += b1[0x17];
+ b1[0x14] += b1[0x16];
+ b1[0x16] += b1[0x15];
+ b1[0x15] += b1[0x17];
+
+ b1[0x18] = b2[0x18] + b2[0x19];
+ b1[0x19] = REAL_MUL(b2[0x18] - b2[0x19], cos0);
+ b1[0x1A] = b2[0x1A] + b2[0x1B];
+ b1[0x1B] = REAL_MUL(b2[0x1B] - b2[0x1A], cos0);
+ b1[0x1A] += b1[0x1B];
+
+ b1[0x1C] = b2[0x1C] + b2[0x1D];
+ b1[0x1D] = REAL_MUL(b2[0x1C] - b2[0x1D], cos0);
+ b1[0x1E] = b2[0x1E] + b2[0x1F];
+ b1[0x1F] = REAL_MUL(b2[0x1F] - b2[0x1E], cos0);
+ b1[0x1E] += b1[0x1F];
+ b1[0x1C] += b1[0x1E];
+ b1[0x1E] += b1[0x1D];
+ b1[0x1D] += b1[0x1F];
+ }
+
+ out0[0x10*16] = REAL_SCALE_DCT64(b1[0x00]);
+ out0[0x10*12] = REAL_SCALE_DCT64(b1[0x04]);
+ out0[0x10* 8] = REAL_SCALE_DCT64(b1[0x02]);
+ out0[0x10* 4] = REAL_SCALE_DCT64(b1[0x06]);
+ out0[0x10* 0] = REAL_SCALE_DCT64(b1[0x01]);
+ out1[0x10* 0] = REAL_SCALE_DCT64(b1[0x01]);
+ out1[0x10* 4] = REAL_SCALE_DCT64(b1[0x05]);
+ out1[0x10* 8] = REAL_SCALE_DCT64(b1[0x03]);
+ out1[0x10*12] = REAL_SCALE_DCT64(b1[0x07]);
+
+#if 1
+ out0[0x10*14] = REAL_SCALE_DCT64(b1[0x08] + b1[0x0C]);
+ out0[0x10*10] = REAL_SCALE_DCT64(b1[0x0C] + b1[0x0a]);
+ out0[0x10* 6] = REAL_SCALE_DCT64(b1[0x0A] + b1[0x0E]);
+ out0[0x10* 2] = REAL_SCALE_DCT64(b1[0x0E] + b1[0x09]);
+ out1[0x10* 2] = REAL_SCALE_DCT64(b1[0x09] + b1[0x0D]);
+ out1[0x10* 6] = REAL_SCALE_DCT64(b1[0x0D] + b1[0x0B]);
+ out1[0x10*10] = REAL_SCALE_DCT64(b1[0x0B] + b1[0x0F]);
+ out1[0x10*14] = REAL_SCALE_DCT64(b1[0x0F]);
+#else
+ b1[0x08] += b1[0x0C];
+ out0[0x10*14] = REAL_SCALE_DCT64(b1[0x08]);
+ b1[0x0C] += b1[0x0a];
+ out0[0x10*10] = REAL_SCALE_DCT64(b1[0x0C]);
+ b1[0x0A] += b1[0x0E];
+ out0[0x10* 6] = REAL_SCALE_DCT64(b1[0x0A]);
+ b1[0x0E] += b1[0x09];
+ out0[0x10* 2] = REAL_SCALE_DCT64(b1[0x0E]);
+ b1[0x09] += b1[0x0D];
+ out1[0x10* 2] = REAL_SCALE_DCT64(b1[0x09]);
+ b1[0x0D] += b1[0x0B];
+ out1[0x10* 6] = REAL_SCALE_DCT64(b1[0x0D]);
+ b1[0x0B] += b1[0x0F];
+ out1[0x10*10] = REAL_SCALE_DCT64(b1[0x0B]);
+ out1[0x10*14] = REAL_SCALE_DCT64(b1[0x0F]);
+#endif
+
+ {
+ real tmp;
+ tmp = b1[0x18] + b1[0x1C];
+ out0[0x10*15] = REAL_SCALE_DCT64(tmp + b1[0x10]);
+ out0[0x10*13] = REAL_SCALE_DCT64(tmp + b1[0x14]);
+ tmp = b1[0x1C] + b1[0x1A];
+ out0[0x10*11] = REAL_SCALE_DCT64(tmp + b1[0x14]);
+ out0[0x10* 9] = REAL_SCALE_DCT64(tmp + b1[0x12]);
+ tmp = b1[0x1A] + b1[0x1E];
+ out0[0x10* 7] = REAL_SCALE_DCT64(tmp + b1[0x12]);
+ out0[0x10* 5] = REAL_SCALE_DCT64(tmp + b1[0x16]);
+ tmp = b1[0x1E] + b1[0x19];
+ out0[0x10* 3] = REAL_SCALE_DCT64(tmp + b1[0x16]);
+ out0[0x10* 1] = REAL_SCALE_DCT64(tmp + b1[0x11]);
+ tmp = b1[0x19] + b1[0x1D];
+ out1[0x10* 1] = REAL_SCALE_DCT64(tmp + b1[0x11]);
+ out1[0x10* 3] = REAL_SCALE_DCT64(tmp + b1[0x15]);
+ tmp = b1[0x1D] + b1[0x1B];
+ out1[0x10* 5] = REAL_SCALE_DCT64(tmp + b1[0x15]);
+ out1[0x10* 7] = REAL_SCALE_DCT64(tmp + b1[0x13]);
+ tmp = b1[0x1B] + b1[0x1F];
+ out1[0x10* 9] = REAL_SCALE_DCT64(tmp + b1[0x13]);
+ out1[0x10*11] = REAL_SCALE_DCT64(tmp + b1[0x17]);
+ out1[0x10*13] = REAL_SCALE_DCT64(b1[0x17] + b1[0x1F]);
+ out1[0x10*15] = REAL_SCALE_DCT64(b1[0x1F]);
+ }
+}
+
+/*
+ * the call via dct64 is a trick to force GCC to use
+ * (new) registers for the b1,b2 pointer to the bufs[xx] field
+ */
+void dct64_i386(real *a,real *b,real *c)
+{
+ real bufs[0x40];
+ dct64_1(a,b,bufs,bufs+0x20,c);
+}
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_i486.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_i486.c
new file mode 100644
index 00000000..b81d0607
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_i486.c
@@ -0,0 +1,342 @@
+/*
+ dct64_i486.c: DCT64, a plain C variant for i486
+
+ copyright 1998-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Fabrice Bellard
+*/
+
+/* Discrete Cosine Tansform (DCT) for subband synthesis.
+ *
+ * This code is optimized for 80486. It should be compiled with gcc
+ * 2.7.2 or higher.
+ *
+ * Note: This code does not give the necessary accuracy. Moreover, no
+ * overflow test are done.
+ *
+ * (c) 1998 Fabrice Bellard.
+ */
+
+#include "mpg123lib_intern.h"
+
+#define COS_0_0 16403
+#define COS_0_1 16563
+#define COS_0_2 16890
+#define COS_0_3 17401
+#define COS_0_4 18124
+#define COS_0_5 19101
+#define COS_0_6 20398
+#define COS_0_7 22112
+#define COS_0_8 24396
+#define COS_0_9 27503
+#define COS_0_10 31869
+#define COS_0_11 38320
+#define COS_0_12 48633
+#define COS_0_13 67429
+#define COS_0_14 111660
+#define COS_0_15 333906
+#define COS_1_0 16463
+#define COS_1_1 17121
+#define COS_1_2 18577
+#define COS_1_3 21195
+#define COS_1_4 25826
+#define COS_1_5 34756
+#define COS_1_6 56441
+#define COS_1_7 167154
+#define COS_2_0 16704
+#define COS_2_1 19704
+#define COS_2_2 29490
+#define COS_2_3 83981
+#define COS_3_0 17733
+#define COS_3_1 42813
+#define COS_4_0 23170
+
+#define SETOUT(out,n,expr) out[FIR_BUFFER_SIZE*(n)]=(expr)
+#define MULL(a,b) (((long long)(a)*(long long)(b)) >> 15)
+#define MUL(a,b) \
+(\
+ ((!(b & 0x3F)) ? (((a)*(b >> 6)) >> 9) :\
+ ((!(b & 0x1F)) ? (((a)*(b >> 5)) >> 10) :\
+ ((!(b & 0x0F)) ? (((a)*(b >> 4)) >> 11) :\
+ ((!(b & 0x07)) ? (((a)*(b >> 3)) >> 12) :\
+ ((!(b & 0x03)) ? (((a)*(b >> 2)) >> 13) :\
+ ((!(b & 0x01)) ? (((a)*(b >> 1)) >> 14) :\
+ (((a)*(b )) >> 15))))))))
+
+
+void dct64_1_486(int *out0,int *out1,int *b1,int *b2)
+{
+ b1[0x00] = b2[0x00] + b2[0x1F];
+ b1[0x1F] = MUL((b2[0x00] - b2[0x1F]),COS_0_0);
+
+ b1[0x01] = b2[0x01] + b2[0x1E];
+ b1[0x1E] = MUL((b2[0x01] - b2[0x1E]),COS_0_1);
+
+ b1[0x02] = b2[0x02] + b2[0x1D];
+ b1[0x1D] = MUL((b2[0x02] - b2[0x1D]),COS_0_2);
+
+ b1[0x03] = b2[0x03] + b2[0x1C];
+ b1[0x1C] = MUL((b2[0x03] - b2[0x1C]),COS_0_3);
+
+ b1[0x04] = b2[0x04] + b2[0x1B];
+ b1[0x1B] = MUL((b2[0x04] - b2[0x1B]),COS_0_4);
+
+ b1[0x05] = b2[0x05] + b2[0x1A];
+ b1[0x1A] = MUL((b2[0x05] - b2[0x1A]),COS_0_5);
+
+ b1[0x06] = b2[0x06] + b2[0x19];
+ b1[0x19] = MUL((b2[0x06] - b2[0x19]),COS_0_6);
+
+ b1[0x07] = b2[0x07] + b2[0x18];
+ b1[0x18] = MUL((b2[0x07] - b2[0x18]),COS_0_7);
+
+ b1[0x08] = b2[0x08] + b2[0x17];
+ b1[0x17] = MUL((b2[0x08] - b2[0x17]),COS_0_8);
+
+ b1[0x09] = b2[0x09] + b2[0x16];
+ b1[0x16] = MUL((b2[0x09] - b2[0x16]),COS_0_9);
+
+ b1[0x0A] = b2[0x0A] + b2[0x15];
+ b1[0x15] = MUL((b2[0x0A] - b2[0x15]),COS_0_10);
+
+ b1[0x0B] = b2[0x0B] + b2[0x14];
+ b1[0x14] = MUL((b2[0x0B] - b2[0x14]),COS_0_11);
+
+ b1[0x0C] = b2[0x0C] + b2[0x13];
+ b1[0x13] = MUL((b2[0x0C] - b2[0x13]),COS_0_12);
+
+ b1[0x0D] = b2[0x0D] + b2[0x12];
+ b1[0x12] = MULL((b2[0x0D] - b2[0x12]),COS_0_13);
+
+ b1[0x0E] = b2[0x0E] + b2[0x11];
+ b1[0x11] = MULL((b2[0x0E] - b2[0x11]),COS_0_14);
+
+ b1[0x0F] = b2[0x0F] + b2[0x10];
+ b1[0x10] = MULL((b2[0x0F] - b2[0x10]),COS_0_15);
+
+
+ b2[0x00] = b1[0x00] + b1[0x0F];
+ b2[0x0F] = MUL((b1[0x00] - b1[0x0F]),COS_1_0);
+ b2[0x01] = b1[0x01] + b1[0x0E];
+ b2[0x0E] = MUL((b1[0x01] - b1[0x0E]),COS_1_1);
+ b2[0x02] = b1[0x02] + b1[0x0D];
+ b2[0x0D] = MUL((b1[0x02] - b1[0x0D]),COS_1_2);
+ b2[0x03] = b1[0x03] + b1[0x0C];
+ b2[0x0C] = MUL((b1[0x03] - b1[0x0C]),COS_1_3);
+ b2[0x04] = b1[0x04] + b1[0x0B];
+ b2[0x0B] = MUL((b1[0x04] - b1[0x0B]),COS_1_4);
+ b2[0x05] = b1[0x05] + b1[0x0A];
+ b2[0x0A] = MUL((b1[0x05] - b1[0x0A]),COS_1_5);
+ b2[0x06] = b1[0x06] + b1[0x09];
+ b2[0x09] = MUL((b1[0x06] - b1[0x09]),COS_1_6);
+ b2[0x07] = b1[0x07] + b1[0x08];
+ b2[0x08] = MULL((b1[0x07] - b1[0x08]),COS_1_7);
+
+ b2[0x10] = b1[0x10] + b1[0x1F];
+ b2[0x1F] = MUL((b1[0x1F] - b1[0x10]),COS_1_0);
+ b2[0x11] = b1[0x11] + b1[0x1E];
+ b2[0x1E] = MUL((b1[0x1E] - b1[0x11]),COS_1_1);
+ b2[0x12] = b1[0x12] + b1[0x1D];
+ b2[0x1D] = MUL((b1[0x1D] - b1[0x12]),COS_1_2);
+ b2[0x13] = b1[0x13] + b1[0x1C];
+ b2[0x1C] = MUL((b1[0x1C] - b1[0x13]),COS_1_3);
+ b2[0x14] = b1[0x14] + b1[0x1B];
+ b2[0x1B] = MUL((b1[0x1B] - b1[0x14]),COS_1_4);
+ b2[0x15] = b1[0x15] + b1[0x1A];
+ b2[0x1A] = MUL((b1[0x1A] - b1[0x15]),COS_1_5);
+ b2[0x16] = b1[0x16] + b1[0x19];
+ b2[0x19] = MUL((b1[0x19] - b1[0x16]),COS_1_6);
+ b2[0x17] = b1[0x17] + b1[0x18];
+ b2[0x18] = MULL((b1[0x18] - b1[0x17]),COS_1_7);
+
+
+ b1[0x00] = b2[0x00] + b2[0x07];
+ b1[0x07] = MUL((b2[0x00] - b2[0x07]),COS_2_0);
+ b1[0x01] = b2[0x01] + b2[0x06];
+ b1[0x06] = MUL((b2[0x01] - b2[0x06]),COS_2_1);
+ b1[0x02] = b2[0x02] + b2[0x05];
+ b1[0x05] = MUL((b2[0x02] - b2[0x05]),COS_2_2);
+ b1[0x03] = b2[0x03] + b2[0x04];
+ b1[0x04] = MULL((b2[0x03] - b2[0x04]),COS_2_3);
+
+ b1[0x08] = b2[0x08] + b2[0x0F];
+ b1[0x0F] = MUL((b2[0x0F] - b2[0x08]),COS_2_0);
+ b1[0x09] = b2[0x09] + b2[0x0E];
+ b1[0x0E] = MUL((b2[0x0E] - b2[0x09]),COS_2_1);
+ b1[0x0A] = b2[0x0A] + b2[0x0D];
+ b1[0x0D] = MUL((b2[0x0D] - b2[0x0A]),COS_2_2);
+ b1[0x0B] = b2[0x0B] + b2[0x0C];
+ b1[0x0C] = MULL((b2[0x0C] - b2[0x0B]),COS_2_3);
+
+ b1[0x10] = b2[0x10] + b2[0x17];
+ b1[0x17] = MUL((b2[0x10] - b2[0x17]),COS_2_0);
+ b1[0x11] = b2[0x11] + b2[0x16];
+ b1[0x16] = MUL((b2[0x11] - b2[0x16]),COS_2_1);
+ b1[0x12] = b2[0x12] + b2[0x15];
+ b1[0x15] = MUL((b2[0x12] - b2[0x15]),COS_2_2);
+ b1[0x13] = b2[0x13] + b2[0x14];
+ b1[0x14] = MULL((b2[0x13] - b2[0x14]),COS_2_3);
+
+ b1[0x18] = b2[0x18] + b2[0x1F];
+ b1[0x1F] = MUL((b2[0x1F] - b2[0x18]),COS_2_0);
+ b1[0x19] = b2[0x19] + b2[0x1E];
+ b1[0x1E] = MUL((b2[0x1E] - b2[0x19]),COS_2_1);
+ b1[0x1A] = b2[0x1A] + b2[0x1D];
+ b1[0x1D] = MUL((b2[0x1D] - b2[0x1A]),COS_2_2);
+ b1[0x1B] = b2[0x1B] + b2[0x1C];
+ b1[0x1C] = MULL((b2[0x1C] - b2[0x1B]),COS_2_3);
+
+
+ b2[0x00] = b1[0x00] + b1[0x03];
+ b2[0x03] = MUL((b1[0x00] - b1[0x03]),COS_3_0);
+ b2[0x01] = b1[0x01] + b1[0x02];
+ b2[0x02] = MUL((b1[0x01] - b1[0x02]),COS_3_1);
+
+ b2[0x04] = b1[0x04] + b1[0x07];
+ b2[0x07] = MUL((b1[0x07] - b1[0x04]),COS_3_0);
+ b2[0x05] = b1[0x05] + b1[0x06];
+ b2[0x06] = MUL((b1[0x06] - b1[0x05]),COS_3_1);
+
+ b2[0x08] = b1[0x08] + b1[0x0B];
+ b2[0x0B] = MUL((b1[0x08] - b1[0x0B]),COS_3_0);
+ b2[0x09] = b1[0x09] + b1[0x0A];
+ b2[0x0A] = MUL((b1[0x09] - b1[0x0A]),COS_3_1);
+
+ b2[0x0C] = b1[0x0C] + b1[0x0F];
+ b2[0x0F] = MUL((b1[0x0F] - b1[0x0C]),COS_3_0);
+ b2[0x0D] = b1[0x0D] + b1[0x0E];
+ b2[0x0E] = MUL((b1[0x0E] - b1[0x0D]),COS_3_1);
+
+ b2[0x10] = b1[0x10] + b1[0x13];
+ b2[0x13] = MUL((b1[0x10] - b1[0x13]),COS_3_0);
+ b2[0x11] = b1[0x11] + b1[0x12];
+ b2[0x12] = MUL((b1[0x11] - b1[0x12]),COS_3_1);
+
+ b2[0x14] = b1[0x14] + b1[0x17];
+ b2[0x17] = MUL((b1[0x17] - b1[0x14]),COS_3_0);
+ b2[0x15] = b1[0x15] + b1[0x16];
+ b2[0x16] = MUL((b1[0x16] - b1[0x15]),COS_3_1);
+
+ b2[0x18] = b1[0x18] + b1[0x1B];
+ b2[0x1B] = MUL((b1[0x18] - b1[0x1B]),COS_3_0);
+ b2[0x19] = b1[0x19] + b1[0x1A];
+ b2[0x1A] = MUL((b1[0x19] - b1[0x1A]),COS_3_1);
+
+ b2[0x1C] = b1[0x1C] + b1[0x1F];
+ b2[0x1F] = MUL((b1[0x1F] - b1[0x1C]),COS_3_0);
+ b2[0x1D] = b1[0x1D] + b1[0x1E];
+ b2[0x1E] = MUL((b1[0x1E] - b1[0x1D]),COS_3_1);
+
+ {
+ int i;
+ for(i=0;i<32;i+=4) {
+ b1[i+0x00] = b2[i+0x00] + b2[i+0x01];
+ b1[i+0x01] = MUL((b2[i+0x00] - b2[i+0x01]),COS_4_0);
+ b1[i+0x02] = b2[i+0x02] + b2[i+0x03];
+ b1[i+0x03] = MUL((b2[i+0x03] - b2[i+0x02]),COS_4_0);
+ }
+ }
+
+ b1[0x02] += b1[0x03];
+ b1[0x06] += b1[0x07];
+ b1[0x04] += b1[0x06];
+ b1[0x06] += b1[0x05];
+ b1[0x05] += b1[0x07];
+
+ b1[0x0A] += b1[0x0B];
+ b1[0x0E] += b1[0x0F];
+ b1[0x0C] += b1[0x0E];
+ b1[0x0E] += b1[0x0D];
+ b1[0x0D] += b1[0x0F];
+
+ b1[0x12] += b1[0x13];
+ b1[0x16] += b1[0x17];
+ b1[0x14] += b1[0x16];
+ b1[0x16] += b1[0x15];
+ b1[0x15] += b1[0x17];
+
+ b1[0x1A] += b1[0x1B];
+ b1[0x1E] += b1[0x1F];
+ b1[0x1C] += b1[0x1E];
+ b1[0x1E] += b1[0x1D];
+ b1[0x1D] += b1[0x1F];
+
+ SETOUT(out0,16,b1[0x00]);
+ SETOUT(out0,12,b1[0x04]);
+ SETOUT(out0, 8,b1[0x02]);
+ SETOUT(out0, 4,b1[0x06]);
+ SETOUT(out0, 0,b1[0x01]);
+ SETOUT(out1, 0,b1[0x01]);
+ SETOUT(out1, 4,b1[0x05]);
+ SETOUT(out1, 8,b1[0x03]);
+ SETOUT(out1,12,b1[0x07]);
+
+ b1[0x08] += b1[0x0C];
+ SETOUT(out0,14,b1[0x08]);
+ b1[0x0C] += b1[0x0a];
+ SETOUT(out0,10,b1[0x0C]);
+ b1[0x0A] += b1[0x0E];
+ SETOUT(out0, 6,b1[0x0A]);
+ b1[0x0E] += b1[0x09];
+ SETOUT(out0, 2,b1[0x0E]);
+ b1[0x09] += b1[0x0D];
+ SETOUT(out1, 2,b1[0x09]);
+ b1[0x0D] += b1[0x0B];
+ SETOUT(out1, 6,b1[0x0D]);
+ b1[0x0B] += b1[0x0F];
+ SETOUT(out1,10,b1[0x0B]);
+ SETOUT(out1,14,b1[0x0F]);
+
+ b1[0x18] += b1[0x1C];
+ SETOUT(out0,15,b1[0x10] + b1[0x18]);
+ SETOUT(out0,13,b1[0x18] + b1[0x14]);
+ b1[0x1C] += b1[0x1a];
+ SETOUT(out0,11,b1[0x14] + b1[0x1C]);
+ SETOUT(out0, 9,b1[0x1C] + b1[0x12]);
+ b1[0x1A] += b1[0x1E];
+ SETOUT(out0, 7,b1[0x12] + b1[0x1A]);
+ SETOUT(out0, 5,b1[0x1A] + b1[0x16]);
+ b1[0x1E] += b1[0x19];
+ SETOUT(out0, 3,b1[0x16] + b1[0x1E]);
+ SETOUT(out0, 1,b1[0x1E] + b1[0x11]);
+ b1[0x19] += b1[0x1D];
+ SETOUT(out1, 1,b1[0x11] + b1[0x19]);
+ SETOUT(out1, 3,b1[0x19] + b1[0x15]);
+ b1[0x1D] += b1[0x1B];
+ SETOUT(out1, 5,b1[0x15] + b1[0x1D]);
+ SETOUT(out1, 7,b1[0x1D] + b1[0x13]);
+ b1[0x1B] += b1[0x1F];
+ SETOUT(out1, 9,b1[0x13] + b1[0x1B]);
+ SETOUT(out1,11,b1[0x1B] + b1[0x17]);
+ SETOUT(out1,13,b1[0x17] + b1[0x1F]);
+ SETOUT(out1,15,b1[0x1F]);
+}
+
+
+/*
+ * the call via dct64 is a trick to force GCC to use
+ * (new) registers for the b1,b2 pointer to the bufs[xx] field
+ */
+void dct64_i486(int *a,int *b,real *samples)
+{
+ int bufs[64];
+ int i;
+
+#ifdef REAL_IS_FIXED
+#define TOINT(a) ((a) * 32768 / (int)REAL_FACTOR)
+
+ for(i=0;i<32;i++) {
+ bufs[i]=TOINT(samples[i]);
+ }
+#else
+ int *p = bufs;
+ register double const scale = ((65536.0 * 32) + 1) * 65536.0;
+
+ for(i=0;i<32;i++) {
+ *((double *) (p++)) = scale + *samples++; /* beware on bufs overrun: 8B store from x87 */
+ }
+#endif
+
+ dct64_1_486(a,b,bufs+32,bufs);
+}
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_mmx.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_mmx.S
new file mode 100644
index 00000000..ff8d403e
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_mmx.S
@@ -0,0 +1,825 @@
+/*
+ dct64_mmx.s: MMX optimized DCT64
+
+ copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by the mysterious higway (apparently)
+*/
+
+#include "mangle.h"
+
+.text
+
+ ALIGN32
+.globl ASM_NAME(dct64_mmx)
+ASM_NAME(dct64_mmx):
+
+ xorl %ecx,%ecx
+.globl ASM_NAME(dct64_MMX)
+ASM_NAME(dct64_MMX):
+ pushl %ebx
+ pushl %esi
+ pushl %edi
+ subl $256,%esp
+
+ GET_GOT
+
+ movl 280(%esp),%eax
+ flds (%eax)
+ leal 128(%esp),%edx
+ fadds 124(%eax)
+ movl 272(%esp),%esi
+ fstps (%edx)
+ movl 276(%esp),%edi
+ flds 4(%eax)
+#if defined(PIC) && defined(__APPLE__)
+ movl GLOBAL_VAR_PTR(costab_mmxsse),%ebx
+#else
+ leal GLOBAL_VAR(costab_mmxsse),%ebx
+#endif
+ fadds 120(%eax)
+ orl %ecx,%ecx
+ fstps 4(%edx)
+ flds (%eax)
+ movl %esp,%ecx
+ fsubs 124(%eax)
+ fmuls (%ebx)
+ fstps 124(%edx)
+ flds 4(%eax)
+ fsubs 120(%eax)
+ fmuls 4(%ebx)
+ fstps 120(%edx)
+ flds 8(%eax)
+ fadds 116(%eax)
+ fstps 8(%edx)
+ flds 12(%eax)
+ fadds 112(%eax)
+ fstps 12(%edx)
+ flds 8(%eax)
+ fsubs 116(%eax)
+ fmuls 8(%ebx)
+ fstps 116(%edx)
+ flds 12(%eax)
+ fsubs 112(%eax)
+ fmuls 12(%ebx)
+ fstps 112(%edx)
+ flds 16(%eax)
+ fadds 108(%eax)
+ fstps 16(%edx)
+ flds 20(%eax)
+ fadds 104(%eax)
+ fstps 20(%edx)
+ flds 16(%eax)
+ fsubs 108(%eax)
+ fmuls 16(%ebx)
+ fstps 108(%edx)
+ flds 20(%eax)
+ fsubs 104(%eax)
+ fmuls 20(%ebx)
+ fstps 104(%edx)
+ flds 24(%eax)
+ fadds 100(%eax)
+ fstps 24(%edx)
+ flds 28(%eax)
+ fadds 96(%eax)
+ fstps 28(%edx)
+ flds 24(%eax)
+ fsubs 100(%eax)
+ fmuls 24(%ebx)
+ fstps 100(%edx)
+ flds 28(%eax)
+ fsubs 96(%eax)
+ fmuls 28(%ebx)
+ fstps 96(%edx)
+ flds 32(%eax)
+ fadds 92(%eax)
+ fstps 32(%edx)
+ flds 36(%eax)
+ fadds 88(%eax)
+ fstps 36(%edx)
+ flds 32(%eax)
+ fsubs 92(%eax)
+ fmuls 32(%ebx)
+ fstps 92(%edx)
+ flds 36(%eax)
+ fsubs 88(%eax)
+ fmuls 36(%ebx)
+ fstps 88(%edx)
+ flds 40(%eax)
+ fadds 84(%eax)
+ fstps 40(%edx)
+ flds 44(%eax)
+ fadds 80(%eax)
+ fstps 44(%edx)
+ flds 40(%eax)
+ fsubs 84(%eax)
+ fmuls 40(%ebx)
+ fstps 84(%edx)
+ flds 44(%eax)
+ fsubs 80(%eax)
+ fmuls 44(%ebx)
+ fstps 80(%edx)
+ flds 48(%eax)
+ fadds 76(%eax)
+ fstps 48(%edx)
+ flds 52(%eax)
+ fadds 72(%eax)
+ fstps 52(%edx)
+ flds 48(%eax)
+ fsubs 76(%eax)
+ fmuls 48(%ebx)
+ fstps 76(%edx)
+ flds 52(%eax)
+ fsubs 72(%eax)
+ fmuls 52(%ebx)
+ fstps 72(%edx)
+ flds 56(%eax)
+ fadds 68(%eax)
+ fstps 56(%edx)
+ flds 60(%eax)
+ fadds 64(%eax)
+ fstps 60(%edx)
+ flds 56(%eax)
+ fsubs 68(%eax)
+ fmuls 56(%ebx)
+ fstps 68(%edx)
+ flds 60(%eax)
+ fsubs 64(%eax)
+ fmuls 60(%ebx)
+ fstps 64(%edx)
+
+ flds (%edx)
+ fadds 60(%edx)
+ fstps (%ecx)
+ flds 4(%edx)
+ fadds 56(%edx)
+ fstps 4(%ecx)
+ flds (%edx)
+ fsubs 60(%edx)
+ fmuls 64(%ebx)
+ fstps 60(%ecx)
+ flds 4(%edx)
+ fsubs 56(%edx)
+ fmuls 68(%ebx)
+ fstps 56(%ecx)
+ flds 8(%edx)
+ fadds 52(%edx)
+ fstps 8(%ecx)
+ flds 12(%edx)
+ fadds 48(%edx)
+ fstps 12(%ecx)
+ flds 8(%edx)
+ fsubs 52(%edx)
+ fmuls 72(%ebx)
+ fstps 52(%ecx)
+ flds 12(%edx)
+ fsubs 48(%edx)
+ fmuls 76(%ebx)
+ fstps 48(%ecx)
+ flds 16(%edx)
+ fadds 44(%edx)
+ fstps 16(%ecx)
+ flds 20(%edx)
+ fadds 40(%edx)
+ fstps 20(%ecx)
+ flds 16(%edx)
+ fsubs 44(%edx)
+ fmuls 80(%ebx)
+ fstps 44(%ecx)
+ flds 20(%edx)
+ fsubs 40(%edx)
+ fmuls 84(%ebx)
+ fstps 40(%ecx)
+ flds 24(%edx)
+ fadds 36(%edx)
+ fstps 24(%ecx)
+ flds 28(%edx)
+ fadds 32(%edx)
+ fstps 28(%ecx)
+ flds 24(%edx)
+ fsubs 36(%edx)
+ fmuls 88(%ebx)
+ fstps 36(%ecx)
+ flds 28(%edx)
+ fsubs 32(%edx)
+ fmuls 92(%ebx)
+ fstps 32(%ecx)
+
+ flds 64(%edx)
+ fadds 124(%edx)
+ fstps 64(%ecx)
+ flds 68(%edx)
+ fadds 120(%edx)
+ fstps 68(%ecx)
+ flds 124(%edx)
+ fsubs 64(%edx)
+ fmuls 64(%ebx)
+ fstps 124(%ecx)
+ flds 120(%edx)
+ fsubs 68(%edx)
+ fmuls 68(%ebx)
+ fstps 120(%ecx)
+ flds 72(%edx)
+ fadds 116(%edx)
+ fstps 72(%ecx)
+ flds 76(%edx)
+ fadds 112(%edx)
+ fstps 76(%ecx)
+ flds 116(%edx)
+ fsubs 72(%edx)
+ fmuls 72(%ebx)
+ fstps 116(%ecx)
+ flds 112(%edx)
+ fsubs 76(%edx)
+ fmuls 76(%ebx)
+ fstps 112(%ecx)
+ flds 80(%edx)
+ fadds 108(%edx)
+ fstps 80(%ecx)
+ flds 84(%edx)
+ fadds 104(%edx)
+ fstps 84(%ecx)
+ flds 108(%edx)
+ fsubs 80(%edx)
+ fmuls 80(%ebx)
+ fstps 108(%ecx)
+ flds 104(%edx)
+ fsubs 84(%edx)
+ fmuls 84(%ebx)
+ fstps 104(%ecx)
+ flds 88(%edx)
+ fadds 100(%edx)
+ fstps 88(%ecx)
+ flds 92(%edx)
+ fadds 96(%edx)
+ fstps 92(%ecx)
+ flds 100(%edx)
+ fsubs 88(%edx)
+ fmuls 88(%ebx)
+ fstps 100(%ecx)
+ flds 96(%edx)
+ fsubs 92(%edx)
+ fmuls 92(%ebx)
+ fstps 96(%ecx)
+
+ flds (%ecx)
+ fadds 28(%ecx)
+ fstps (%edx)
+ flds (%ecx)
+ fsubs 28(%ecx)
+ fmuls 96(%ebx)
+ fstps 28(%edx)
+ flds 4(%ecx)
+ fadds 24(%ecx)
+ fstps 4(%edx)
+ flds 4(%ecx)
+ fsubs 24(%ecx)
+ fmuls 100(%ebx)
+ fstps 24(%edx)
+ flds 8(%ecx)
+ fadds 20(%ecx)
+ fstps 8(%edx)
+ flds 8(%ecx)
+ fsubs 20(%ecx)
+ fmuls 104(%ebx)
+ fstps 20(%edx)
+ flds 12(%ecx)
+ fadds 16(%ecx)
+ fstps 12(%edx)
+ flds 12(%ecx)
+ fsubs 16(%ecx)
+ fmuls 108(%ebx)
+ fstps 16(%edx)
+ flds 32(%ecx)
+ fadds 60(%ecx)
+ fstps 32(%edx)
+ flds 60(%ecx)
+ fsubs 32(%ecx)
+ fmuls 96(%ebx)
+ fstps 60(%edx)
+ flds 36(%ecx)
+ fadds 56(%ecx)
+ fstps 36(%edx)
+ flds 56(%ecx)
+ fsubs 36(%ecx)
+ fmuls 100(%ebx)
+ fstps 56(%edx)
+ flds 40(%ecx)
+ fadds 52(%ecx)
+ fstps 40(%edx)
+ flds 52(%ecx)
+ fsubs 40(%ecx)
+ fmuls 104(%ebx)
+ fstps 52(%edx)
+ flds 44(%ecx)
+ fadds 48(%ecx)
+ fstps 44(%edx)
+ flds 48(%ecx)
+ fsubs 44(%ecx)
+ fmuls 108(%ebx)
+ fstps 48(%edx)
+ flds 64(%ecx)
+ fadds 92(%ecx)
+ fstps 64(%edx)
+ flds 64(%ecx)
+ fsubs 92(%ecx)
+ fmuls 96(%ebx)
+ fstps 92(%edx)
+ flds 68(%ecx)
+ fadds 88(%ecx)
+ fstps 68(%edx)
+ flds 68(%ecx)
+ fsubs 88(%ecx)
+ fmuls 100(%ebx)
+ fstps 88(%edx)
+ flds 72(%ecx)
+ fadds 84(%ecx)
+ fstps 72(%edx)
+ flds 72(%ecx)
+ fsubs 84(%ecx)
+ fmuls 104(%ebx)
+ fstps 84(%edx)
+ flds 76(%ecx)
+ fadds 80(%ecx)
+ fstps 76(%edx)
+ flds 76(%ecx)
+ fsubs 80(%ecx)
+ fmuls 108(%ebx)
+ fstps 80(%edx)
+ flds 96(%ecx)
+ fadds 124(%ecx)
+ fstps 96(%edx)
+ flds 124(%ecx)
+ fsubs 96(%ecx)
+ fmuls 96(%ebx)
+ fstps 124(%edx)
+ flds 100(%ecx)
+ fadds 120(%ecx)
+ fstps 100(%edx)
+ flds 120(%ecx)
+ fsubs 100(%ecx)
+ fmuls 100(%ebx)
+ fstps 120(%edx)
+ flds 104(%ecx)
+ fadds 116(%ecx)
+ fstps 104(%edx)
+ flds 116(%ecx)
+ fsubs 104(%ecx)
+ fmuls 104(%ebx)
+ fstps 116(%edx)
+ flds 108(%ecx)
+ fadds 112(%ecx)
+ fstps 108(%edx)
+ flds 112(%ecx)
+ fsubs 108(%ecx)
+ fmuls 108(%ebx)
+ fstps 112(%edx)
+ flds (%edx)
+ fadds 12(%edx)
+ fstps (%ecx)
+ flds (%edx)
+ fsubs 12(%edx)
+ fmuls 112(%ebx)
+ fstps 12(%ecx)
+ flds 4(%edx)
+ fadds 8(%edx)
+ fstps 4(%ecx)
+ flds 4(%edx)
+ fsubs 8(%edx)
+ fmuls 116(%ebx)
+ fstps 8(%ecx)
+ flds 16(%edx)
+ fadds 28(%edx)
+ fstps 16(%ecx)
+ flds 28(%edx)
+ fsubs 16(%edx)
+ fmuls 112(%ebx)
+ fstps 28(%ecx)
+ flds 20(%edx)
+ fadds 24(%edx)
+ fstps 20(%ecx)
+ flds 24(%edx)
+ fsubs 20(%edx)
+ fmuls 116(%ebx)
+ fstps 24(%ecx)
+ flds 32(%edx)
+ fadds 44(%edx)
+ fstps 32(%ecx)
+ flds 32(%edx)
+ fsubs 44(%edx)
+ fmuls 112(%ebx)
+ fstps 44(%ecx)
+ flds 36(%edx)
+ fadds 40(%edx)
+ fstps 36(%ecx)
+ flds 36(%edx)
+ fsubs 40(%edx)
+ fmuls 116(%ebx)
+ fstps 40(%ecx)
+ flds 48(%edx)
+ fadds 60(%edx)
+ fstps 48(%ecx)
+ flds 60(%edx)
+ fsubs 48(%edx)
+ fmuls 112(%ebx)
+ fstps 60(%ecx)
+ flds 52(%edx)
+ fadds 56(%edx)
+ fstps 52(%ecx)
+ flds 56(%edx)
+ fsubs 52(%edx)
+ fmuls 116(%ebx)
+ fstps 56(%ecx)
+ flds 64(%edx)
+ fadds 76(%edx)
+ fstps 64(%ecx)
+ flds 64(%edx)
+ fsubs 76(%edx)
+ fmuls 112(%ebx)
+ fstps 76(%ecx)
+ flds 68(%edx)
+ fadds 72(%edx)
+ fstps 68(%ecx)
+ flds 68(%edx)
+ fsubs 72(%edx)
+ fmuls 116(%ebx)
+ fstps 72(%ecx)
+ flds 80(%edx)
+ fadds 92(%edx)
+ fstps 80(%ecx)
+ flds 92(%edx)
+ fsubs 80(%edx)
+ fmuls 112(%ebx)
+ fstps 92(%ecx)
+ flds 84(%edx)
+ fadds 88(%edx)
+ fstps 84(%ecx)
+ flds 88(%edx)
+ fsubs 84(%edx)
+ fmuls 116(%ebx)
+ fstps 88(%ecx)
+ flds 96(%edx)
+ fadds 108(%edx)
+ fstps 96(%ecx)
+ flds 96(%edx)
+ fsubs 108(%edx)
+ fmuls 112(%ebx)
+ fstps 108(%ecx)
+ flds 100(%edx)
+ fadds 104(%edx)
+ fstps 100(%ecx)
+ flds 100(%edx)
+ fsubs 104(%edx)
+ fmuls 116(%ebx)
+ fstps 104(%ecx)
+ flds 112(%edx)
+ fadds 124(%edx)
+ fstps 112(%ecx)
+ flds 124(%edx)
+ fsubs 112(%edx)
+ fmuls 112(%ebx)
+ fstps 124(%ecx)
+ flds 116(%edx)
+ fadds 120(%edx)
+ fstps 116(%ecx)
+ flds 120(%edx)
+ fsubs 116(%edx)
+ fmuls 116(%ebx)
+ fstps 120(%ecx)
+
+ flds 32(%ecx)
+ fadds 36(%ecx)
+ fstps 32(%edx)
+ flds 32(%ecx)
+ fsubs 36(%ecx)
+ fmuls 120(%ebx)
+ fstps 36(%edx)
+ flds 44(%ecx)
+ fsubs 40(%ecx)
+ fmuls 120(%ebx)
+ fsts 44(%edx)
+ fadds 40(%ecx)
+ fadds 44(%ecx)
+ fstps 40(%edx)
+ flds 48(%ecx)
+ fsubs 52(%ecx)
+ fmuls 120(%ebx)
+ flds 60(%ecx)
+ fsubs 56(%ecx)
+ fmuls 120(%ebx)
+ fld %st(0)
+ fadds 56(%ecx)
+ fadds 60(%ecx)
+ fld %st(0)
+ fadds 48(%ecx)
+ fadds 52(%ecx)
+ fstps 48(%edx)
+ fadd %st(2)
+ fstps 56(%edx)
+ fsts 60(%edx)
+ faddp %st(1)
+ fstps 52(%edx)
+ flds 64(%ecx)
+ fadds 68(%ecx)
+ fstps 64(%edx)
+ flds 64(%ecx)
+ fsubs 68(%ecx)
+ fmuls 120(%ebx)
+ fstps 68(%edx)
+ flds 76(%ecx)
+ fsubs 72(%ecx)
+ fmuls 120(%ebx)
+ fsts 76(%edx)
+ fadds 72(%ecx)
+ fadds 76(%ecx)
+ fstps 72(%edx)
+ flds 92(%ecx)
+ fsubs 88(%ecx)
+ fmuls 120(%ebx)
+ fsts 92(%edx)
+ fadds 92(%ecx)
+ fadds 88(%ecx)
+ fld %st(0)
+ fadds 80(%ecx)
+ fadds 84(%ecx)
+ fstps 80(%edx)
+ flds 80(%ecx)
+ fsubs 84(%ecx)
+ fmuls 120(%ebx)
+ fadd %st(0), %st(1)
+ fadds 92(%edx)
+ fstps 84(%edx)
+ fstps 88(%edx)
+ flds 96(%ecx)
+ fadds 100(%ecx)
+ fstps 96(%edx)
+ flds 96(%ecx)
+ fsubs 100(%ecx)
+ fmuls 120(%ebx)
+ fstps 100(%edx)
+ flds 108(%ecx)
+ fsubs 104(%ecx)
+ fmuls 120(%ebx)
+ fsts 108(%edx)
+ fadds 104(%ecx)
+ fadds 108(%ecx)
+ fstps 104(%edx)
+ flds 124(%ecx)
+ fsubs 120(%ecx)
+ fmuls 120(%ebx)
+ fsts 124(%edx)
+ fadds 120(%ecx)
+ fadds 124(%ecx)
+ fld %st(0)
+ fadds 112(%ecx)
+ fadds 116(%ecx)
+ fstps 112(%edx)
+ flds 112(%ecx)
+ fsubs 116(%ecx)
+ fmuls 120(%ebx)
+ fadd %st(0),%st(1)
+ fadds 124(%edx)
+ fstps 116(%edx)
+ fstps 120(%edx)
+ jnz .L01
+
+ flds (%ecx)
+ fadds 4(%ecx)
+ fstps 1024(%esi)
+ flds (%ecx)
+ fsubs 4(%ecx)
+ fmuls 120(%ebx)
+ fsts (%esi)
+ fstps (%edi)
+ flds 12(%ecx)
+ fsubs 8(%ecx)
+ fmuls 120(%ebx)
+ fsts 512(%edi)
+ fadds 12(%ecx)
+ fadds 8(%ecx)
+ fstps 512(%esi)
+ flds 16(%ecx)
+ fsubs 20(%ecx)
+ fmuls 120(%ebx)
+ flds 28(%ecx)
+ fsubs 24(%ecx)
+ fmuls 120(%ebx)
+ fsts 768(%edi)
+ fld %st(0)
+ fadds 24(%ecx)
+ fadds 28(%ecx)
+ fld %st(0)
+ fadds 16(%ecx)
+ fadds 20(%ecx)
+ fstps 768(%esi)
+ fadd %st(2)
+ fstps 256(%esi)
+ faddp %st(1)
+ fstps 256(%edi)
+
+ flds 32(%edx)
+ fadds 48(%edx)
+ fstps 896(%esi)
+ flds 48(%edx)
+ fadds 40(%edx)
+ fstps 640(%esi)
+ flds 40(%edx)
+ fadds 56(%edx)
+ fstps 384(%esi)
+ flds 56(%edx)
+ fadds 36(%edx)
+ fstps 128(%esi)
+ flds 36(%edx)
+ fadds 52(%edx)
+ fstps 128(%edi)
+ flds 52(%edx)
+ fadds 44(%edx)
+ fstps 384(%edi)
+ flds 60(%edx)
+ fsts 896(%edi)
+ fadds 44(%edx)
+ fstps 640(%edi)
+ flds 96(%edx)
+ fadds 112(%edx)
+ fld %st(0)
+ fadds 64(%edx)
+ fstps 960(%esi)
+ fadds 80(%edx)
+ fstps 832(%esi)
+ flds 112(%edx)
+ fadds 104(%edx)
+ fld %st(0)
+ fadds 80(%edx)
+ fstps 704(%esi)
+ fadds 72(%edx)
+ fstps 576(%esi)
+ flds 104(%edx)
+ fadds 120(%edx)
+ fld %st(0)
+ fadds 72(%edx)
+ fstps 448(%esi)
+ fadds 88(%edx)
+ fstps 320(%esi)
+ flds 120(%edx)
+ fadds 100(%edx)
+ fld %st(0)
+ fadds 88(%edx)
+ fstps 192(%esi)
+ fadds 68(%edx)
+ fstps 64(%esi)
+ flds 100(%edx)
+ fadds 116(%edx)
+ fld %st(0)
+ fadds 68(%edx)
+ fstps 64(%edi)
+ fadds 84(%edx)
+ fstps 192(%edi)
+ flds 116(%edx)
+ fadds 108(%edx)
+ fld %st(0)
+ fadds 84(%edx)
+ fstps 320(%edi)
+ fadds 76(%edx)
+ fstps 448(%edi)
+ flds 108(%edx)
+ fadds 124(%edx)
+ fld %st(0)
+ fadds 76(%edx)
+ fstps 576(%edi)
+ fadds 92(%edx)
+ fstps 704(%edi)
+ flds 124(%edx)
+ fsts 960(%edi)
+ fadds 92(%edx)
+ fstps 832(%edi)
+ addl $256,%esp
+ popl %edi
+ popl %esi
+ popl %ebx
+ ret
+.L01:
+ flds (%ecx)
+ fadds 4(%ecx)
+ fistps 512(%esi)
+ flds (%ecx)
+ fsubs 4(%ecx)
+ fmuls 120(%ebx)
+
+ fistps (%esi)
+
+ flds 12(%ecx)
+ fsubs 8(%ecx)
+ fmuls 120(%ebx)
+ fists 256(%edi)
+ fadds 12(%ecx)
+ fadds 8(%ecx)
+ fistps 256(%esi)
+ flds 16(%ecx)
+ fsubs 20(%ecx)
+ fmuls 120(%ebx)
+ flds 28(%ecx)
+ fsubs 24(%ecx)
+ fmuls 120(%ebx)
+ fists 384(%edi)
+ fld %st(0)
+ fadds 24(%ecx)
+ fadds 28(%ecx)
+ fld %st(0)
+ fadds 16(%ecx)
+ fadds 20(%ecx)
+ fistps 384(%esi)
+ fadd %st(2)
+ fistps 128(%esi)
+ faddp %st(1)
+ fistps 128(%edi)
+
+ flds 32(%edx)
+ fadds 48(%edx)
+ fistps 448(%esi)
+ flds 48(%edx)
+ fadds 40(%edx)
+ fistps 320(%esi)
+ flds 40(%edx)
+ fadds 56(%edx)
+ fistps 192(%esi)
+ flds 56(%edx)
+ fadds 36(%edx)
+ fistps 64(%esi)
+ flds 36(%edx)
+ fadds 52(%edx)
+ fistps 64(%edi)
+ flds 52(%edx)
+ fadds 44(%edx)
+ fistps 192(%edi)
+ flds 60(%edx)
+ fists 448(%edi)
+ fadds 44(%edx)
+ fistps 320(%edi)
+ flds 96(%edx)
+ fadds 112(%edx)
+ fld %st(0)
+ fadds 64(%edx)
+ fistps 480(%esi)
+ fadds 80(%edx)
+ fistps 416(%esi)
+ flds 112(%edx)
+ fadds 104(%edx)
+ fld %st(0)
+ fadds 80(%edx)
+ fistps 352(%esi)
+ fadds 72(%edx)
+ fistps 288(%esi)
+ flds 104(%edx)
+ fadds 120(%edx)
+ fld %st(0)
+ fadds 72(%edx)
+ fistps 224(%esi)
+ fadds 88(%edx)
+ fistps 160(%esi)
+ flds 120(%edx)
+ fadds 100(%edx)
+ fld %st(0)
+ fadds 88(%edx)
+ fistps 96(%esi)
+ fadds 68(%edx)
+ fistps 32(%esi)
+ flds 100(%edx)
+ fadds 116(%edx)
+ fld %st(0)
+ fadds 68(%edx)
+ fistps 32(%edi)
+ fadds 84(%edx)
+ fistps 96(%edi)
+ flds 116(%edx)
+ fadds 108(%edx)
+ fld %st(0)
+ fadds 84(%edx)
+ fistps 160(%edi)
+ fadds 76(%edx)
+ fistps 224(%edi)
+ flds 108(%edx)
+ fadds 124(%edx)
+ fld %st(0)
+ fadds 76(%edx)
+ fistps 288(%edi)
+ fadds 92(%edx)
+ fistps 352(%edi)
+ flds 124(%edx)
+ fists 480(%edi)
+ fadds 92(%edx)
+ fistps 416(%edi)
+ movsw
+ addl $256,%esp
+ popl %edi
+ popl %esi
+ popl %ebx
+ ret
+
+#if defined(PIC) && defined(__APPLE__)
+ .section __IMPORT,__pointers,non_lazy_symbol_pointers
+L_costab_mmxsse:
+ .indirect_symbol ASM_NAME(costab_mmxsse)
+ .long 0
+#endif
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_neon.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_neon.S
new file mode 100644
index 00000000..de8c363b
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_neon.S
@@ -0,0 +1,310 @@
+/*
+ dct64_neon: ARM NEON optimized dct64
+
+ copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifndef _M_ARM
+ .code 32
+#endif
+#ifndef __APPLE__
+ .fpu neon
+#endif
+
+ .text
+ ALIGN16
+costab_arm:
+ .word 1056974725
+ .word 1057056395
+ .word 1057223771
+ .word 1057485416
+ .word 1057855544
+ .word 1058356026
+ .word 1059019886
+ .word 1059897405
+ .word 1061067246
+ .word 1062657950
+ .word 1064892987
+ .word 1066774581
+ .word 1069414683
+ .word 1073984175
+ .word 1079645762
+ .word 1092815430
+ .word 1057005197
+ .word 1057342072
+ .word 1058087743
+ .word 1059427869
+ .word 1061799040
+ .word 1065862217
+ .word 1071413542
+ .word 1084439708
+ .word 1057128951
+ .word 1058664893
+ .word 1063675095
+ .word 1076102863
+ .word 1057655764
+ .word 1067924853
+ .word 1060439283
+ .word 1060439283
+ ALIGN4
+ GLOBAL_SYMBOL ASM_NAME(dct64_neon)
+#ifdef __ELF__
+ .type ASM_NAME(dct64_neon), %function
+#endif
+ASM_NAME(dct64_neon):
+ vpush {q4-q7}
+
+ adr r3, costab_arm
+ vld1.32 {q0, q1}, [r2]!
+ vld1.32 {q2, q3}, [r2]!
+ vld1.32 {q4, q5}, [r2]!
+ vld1.32 {q6, q7}, [r2]
+ vld1.32 {q12, q13}, [r3, :128]!
+ vld1.32 {q14, q15}, [r3, :128]!
+
+ vrev64.32 q4, q4
+ vrev64.32 q5, q5
+ vrev64.32 q6, q6
+ vrev64.32 q7, q7
+ vswp d8, d9
+ vswp d10, d11
+ vswp d12, d13
+ vswp d14, d15
+
+ vsub.f32 q8, q0, q7
+ vsub.f32 q9, q1, q6
+ vsub.f32 q10, q2, q5
+ vsub.f32 q11, q3, q4
+ vadd.f32 q0, q0, q7
+ vadd.f32 q1, q1, q6
+ vadd.f32 q2, q2, q5
+ vadd.f32 q3, q3, q4
+ vmul.f32 q4, q8, q12
+ vmul.f32 q5, q9, q13
+ vmul.f32 q6, q10, q14
+ vmul.f32 q7, q11, q15
+
+ vld1.32 {q12, q13}, [r3, :128]!
+ vld1.32 {q14, q15}, [r3, :128]
+
+ vrev64.32 q2, q2
+ vrev64.32 q3, q3
+ vrev64.32 q6, q6
+ vrev64.32 q7, q7
+ vswp d4, d5
+ vswp d6, d7
+ vswp d12, d13
+ vswp d14, d15
+
+ vsub.f32 q8, q0, q3
+ vsub.f32 q9, q1, q2
+ vsub.f32 q10, q4, q7
+ vsub.f32 q11, q5, q6
+ vadd.f32 q0, q0, q3
+ vadd.f32 q1, q1, q2
+ vadd.f32 q4, q4, q7
+ vadd.f32 q5, q5, q6
+ vmul.f32 q2, q8, q12
+ vmul.f32 q3, q9, q13
+ vmul.f32 q6, q10, q12
+ vmul.f32 q7, q11, q13
+
+ vrev64.32 q1, q1
+ vrev64.32 q3, q3
+ vrev64.32 q5, q5
+ vrev64.32 q7, q7
+ vswp d2, d3
+ vswp d6, d7
+ vswp d10, d11
+ vswp d14, d15
+
+ vsub.f32 q8, q0, q1
+ vsub.f32 q9, q2, q3
+ vsub.f32 q10, q4, q5
+ vsub.f32 q11, q6, q7
+ vadd.f32 q0, q0, q1
+ vadd.f32 q2, q2, q3
+ vadd.f32 q4, q4, q5
+ vadd.f32 q6, q6, q7
+ vmul.f32 q1, q8, q14
+ vmul.f32 q3, q9, q14
+ vmul.f32 q5, q10, q14
+ vmul.f32 q7, q11, q14
+
+ vdup.32 q12, d31[0]
+ vmov d31, d30
+
+ vswp d1, d2
+ vswp d5, d6
+ vswp d9, d10
+ vswp d13, d14
+ vrev64.32 q1, q1
+ vrev64.32 q3, q3
+ vrev64.32 q5, q5
+ vrev64.32 q7, q7
+
+ vsub.f32 q8, q0, q1
+ vsub.f32 q9, q2, q3
+ vsub.f32 q10, q4, q5
+ vsub.f32 q11, q6, q7
+ vadd.f32 q0, q0, q1
+ vadd.f32 q2, q2, q3
+ vadd.f32 q4, q4, q5
+ vadd.f32 q6, q6, q7
+ vmul.f32 q1, q8, q15
+ vmul.f32 q3, q9, q15
+ vmul.f32 q5, q10, q15
+ vmul.f32 q7, q11, q15
+
+ vtrn.32 q0, q1
+ vtrn.32 q2, q3
+ vtrn.32 q4, q5
+ vtrn.32 q6, q7
+
+ vsub.f32 q8, q0, q1
+ vsub.f32 q9, q2, q3
+ vsub.f32 q10, q4, q5
+ vsub.f32 q11, q6, q7
+ vadd.f32 q0, q0, q1
+ vadd.f32 q2, q2, q3
+ vadd.f32 q4, q4, q5
+ vadd.f32 q6, q6, q7
+ vmul.f32 q1, q8, q12
+ vmul.f32 q3, q9, q12
+ vmul.f32 q5, q10, q12
+ vmul.f32 q7, q11, q12
+
+ vtrn.32 q0, q1
+ vtrn.32 q2, q3
+ vtrn.32 q4, q5
+ vtrn.32 q6, q7
+ vswp d1, d2
+ vswp d5, d6
+ vswp d9, d10
+ vswp d13, d14
+
+ vshr.u64 d16, d1, #32
+ vshr.u64 d17, d3, #32
+ vshr.u64 d18, d5, #32
+ vshr.u64 d19, d7, #32
+ vadd.f32 d1, d1, d16
+ vadd.f32 d3, d3, d17
+ vadd.f32 d5, d5, d18
+ vadd.f32 d7, d7, d19
+ vshr.u64 d20, d9, #32
+ vshr.u64 d21, d11, #32
+ vshr.u64 d22, d13, #32
+ vshr.u64 d23, d15, #32
+ vadd.f32 d9, d9, d20
+ vadd.f32 d11, d11, d21
+ vadd.f32 d13, d13, d22
+ vadd.f32 d15, d15, d23
+
+ vshr.u64 d16, d2, #32
+ vshr.u64 d18, d6, #32
+ vshr.u64 d20, d10, #32
+ vshr.u64 d22, d14, #32
+ vext.8 q8, q1, q8, #8
+ vext.8 q9, q3, q9, #8
+ vext.8 q10, q5, q10, #8
+ vext.8 q11, q7, q11, #8
+ vadd.f32 q1, q1, q8
+ vadd.f32 q3, q3, q9
+ vadd.f32 q5, q5, q10
+ vadd.f32 q7, q7, q11
+
+ vshr.u64 d16, d4, #32
+ vshr.u64 d18, d12, #32
+ vext.8 q8, q2, q8, #8
+ vext.8 q9, q6, q9, #8
+ vadd.f32 q2, q2, q3
+ vadd.f32 q6, q6, q7
+ vadd.f32 q3, q3, q8
+ vadd.f32 q7, q7, q9
+
+ vrev64.32 q8, q4
+ vshr.u64 d19, d9, #32
+ vext.8 d17, d17, d16, #4
+ vswp d9, d10
+ vswp d13, d14
+ vtrn.32 q4, q5
+ vtrn.32 q6, q7
+ vmov d16, d9
+ vmov d18, d11
+
+ vadd.f32 q4, q6
+ vadd.f32 q5, q7
+ vadd.f32 q6, q8
+ vadd.f32 q7, q9
+
+ vmov.i32 q8, #0x4b000000
+ vorr.i32 q8, #0x00400000
+ vadd.f32 q0, q0, q8
+ vadd.f32 q1, q1, q8
+ vadd.f32 q2, q2, q8
+ vadd.f32 q3, q3, q8
+ vadd.f32 q4, q4, q8
+ vadd.f32 q5, q5, q8
+ vadd.f32 q6, q6, q8
+ vadd.f32 q7, q7, q8
+ vshl.i32 q0, q0, #10
+ vshl.i32 q1, q1, #10
+ vshl.i32 q2, q2, #10
+ vshl.i32 q3, q3, #10
+ vshl.i32 q4, q4, #10
+ vshl.i32 q5, q5, #10
+ vshl.i32 q6, q6, #10
+ vshl.i32 q7, q7, #10
+ vqshrn.s32 d0, q0, #10
+ vqshrn.s32 d2, q1, #10
+ vqshrn.s32 d4, q2, #10
+ vqshrn.s32 d6, q3, #10
+ vqshrn.s32 d8, q4, #10
+ vqshrn.s32 d10, q5, #10
+ vqshrn.s32 d12, q6, #10
+ vqshrn.s32 d14, q7, #10
+
+ mov r3, #32
+ vst1.16 {d0[1]}, [r0, :16], r3
+ vst1.16 {d12[3]}, [r0, :16], r3
+ vst1.16 {d6[2]}, [r0, :16], r3
+ vst1.16 {d8[3]}, [r0, :16], r3
+ vst1.16 {d2[2]}, [r0, :16], r3
+ vst1.16 {d12[1]}, [r0, :16], r3
+ vst1.16 {d4[2]}, [r0, :16], r3
+ vst1.16 {d8[1]}, [r0, :16], r3
+ vst1.16 {d0[2]}, [r0, :16], r3
+ vst1.16 {d12[2]}, [r0, :16], r3
+ vst1.16 {d6[0]}, [r0, :16], r3
+ vst1.16 {d8[2]}, [r0, :16], r3
+ vst1.16 {d2[0]}, [r0, :16], r3
+ vst1.16 {d12[0]}, [r0, :16], r3
+ vst1.16 {d4[0]}, [r0, :16], r3
+ vst1.16 {d8[0]}, [r0, :16], r3
+ vst1.16 {d0[0]}, [r0, :16]
+
+ vst1.16 {d0[1]}, [r1, :16], r3
+ vst1.16 {d10[0]}, [r1, :16], r3
+ vst1.16 {d4[1]}, [r1, :16], r3
+ vst1.16 {d14[0]}, [r1, :16], r3
+ vst1.16 {d2[1]}, [r1, :16], r3
+ vst1.16 {d10[2]}, [r1, :16], r3
+ vst1.16 {d6[1]}, [r1, :16], r3
+ vst1.16 {d14[2]}, [r1, :16], r3
+ vst1.16 {d0[3]}, [r1, :16], r3
+ vst1.16 {d10[1]}, [r1, :16], r3
+ vst1.16 {d4[3]}, [r1, :16], r3
+ vst1.16 {d14[1]}, [r1, :16], r3
+ vst1.16 {d2[3]}, [r1, :16], r3
+ vst1.16 {d10[3]}, [r1, :16], r3
+ vst1.16 {d6[3]}, [r1, :16], r3
+ vst1.16 {d14[3]}, [r1, :16]
+
+ vpop {q4-q7}
+ bx lr
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_neon64.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_neon64.S
new file mode 100644
index 00000000..32b8a0b4
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_neon64.S
@@ -0,0 +1,299 @@
+/*
+ dct64_neon64: NEON optimized dct64 for AArch64
+
+ copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+costab_neon_aarch64:
+ .word 1056974725
+ .word 1057056395
+ .word 1057223771
+ .word 1057485416
+ .word 1057855544
+ .word 1058356026
+ .word 1059019886
+ .word 1059897405
+ .word 1061067246
+ .word 1062657950
+ .word 1064892987
+ .word 1066774581
+ .word 1069414683
+ .word 1073984175
+ .word 1079645762
+ .word 1092815430
+ .word 1057005197
+ .word 1057342072
+ .word 1058087743
+ .word 1059427869
+ .word 1061799040
+ .word 1065862217
+ .word 1071413542
+ .word 1084439708
+ .word 1057128951
+ .word 1058664893
+ .word 1063675095
+ .word 1076102863
+ .word 1057655764
+ .word 1067924853
+ .word 1060439283
+ .word 1060439283
+ .text
+ ALIGN4
+ .globl ASM_NAME(dct64_neon64)
+#ifdef __ELF__
+ .type ASM_NAME(dct64_neon64), %function
+#endif
+ASM_NAME(dct64_neon64):
+ add x3, x2, #64
+ adrp x4, AARCH64_PCREL_HI(costab_neon_aarch64)
+ add x4, x4, AARCH64_PCREL_LO(costab_neon_aarch64)
+ ld1 {v0.4s, v1.4s, v2.4s, v3.4s}, [x2]
+ ld1 {v16.4s, v17.4s, v18.4s, v19.4s}, [x3]
+ ld1 {v20.4s, v21.4s, v22.4s, v23.4s}, [x4], #64
+
+ rev64 v19.4s, v19.4s
+ rev64 v18.4s, v18.4s
+ rev64 v17.4s, v17.4s
+ rev64 v16.4s, v16.4s
+ ext v4.16b, v19.16b, v19.16b, #8
+ ext v5.16b, v18.16b, v18.16b, #8
+ ext v6.16b, v17.16b, v17.16b, #8
+ ext v7.16b, v16.16b, v16.16b, #8
+
+ fsub v16.4s, v3.4s, v7.4s
+ fsub v17.4s, v2.4s, v6.4s
+ fsub v18.4s, v1.4s, v5.4s
+ fsub v19.4s, v0.4s, v4.4s
+ fadd v0.4s, v0.4s, v4.4s /* bs[0,1,2,3] */
+ fadd v1.4s, v1.4s, v5.4s /* bs[4,5,6,7] */
+ fadd v2.4s, v2.4s, v6.4s /* bs[8,9,10,11] */
+ fadd v3.4s, v3.4s, v7.4s /* bs[12,13,14,15] */
+ fmul v16.4s, v16.4s, v23.4s /* bs[19,18,17,16] */
+ fmul v17.4s, v17.4s, v22.4s /* bs[23,22,21,20] */
+ fmul v18.4s, v18.4s, v21.4s /* bs[27,26,25,24] */
+ fmul v19.4s, v19.4s, v20.4s /* bs[31,30,29,28] */
+
+ ld1 {v20.4s, v21.4s}, [x4], #32
+ rev64 v22.4s, v3.4s
+ rev64 v23.4s, v2.4s
+ rev64 v24.4s, v16.4s
+ rev64 v25.4s, v17.4s
+ ext v4.16b, v22.16b, v22.16b, #8 /* bs[15,14,13,12] */
+ ext v5.16b, v23.16b, v23.16b, #8 /* bs[11,10,9,8] */
+ ext v6.16b, v24.16b, v24.16b, #8 /* bs[16,17,18,19] */
+ ext v7.16b, v25.16b, v25.16b, #8 /* bs[20,21,22,23] */
+
+ fsub v26.4s, v1.4s, v5.4s
+ fsub v27.4s, v0.4s, v4.4s
+ fsub v28.4s, v18.4s, v7.4s
+ fsub v29.4s, v19.4s, v6.4s
+ fadd v4.4s, v0.4s, v4.4s /* bs[32,33,34,35] */
+ fadd v5.4s, v1.4s, v5.4s /* bs[36,37,38,39] */
+ fadd v6.4s, v6.4s, v19.4s /* bs[48,49,50,51] */
+ fadd v7.4s, v7.4s, v18.4s /* bs[52,53,54,55] */
+ fmul v26.4s, v26.4s, v21.4s /* bs[43,42,41,40] */
+ fmul v27.4s, v27.4s, v20.4s /* bs[47,46,45,44] */
+ fmul v28.4s, v28.4s, v21.4s /* bs[59,58,57,56] */
+ fmul v29.4s, v29.4s, v20.4s /* bs[63,62,61,60] */
+
+ ld1 {v20.4s}, [x4], #16
+ rev64 v16.4s, v5.4s
+ rev64 v17.4s, v26.4s
+ rev64 v18.4s, v7.4s
+ rev64 v19.4s, v28.4s
+ ext v0.16b, v16.16b, v16.16b, #8 /* bs[39,38,37,36] */
+ ext v1.16b, v17.16b, v17.16b, #8 /* bs[40,41,42,43] */
+ ext v2.16b, v18.16b, v18.16b, #8 /* bs[55,54,53,52] */
+ ext v3.16b, v19.16b, v19.16b, #8 /* bs[56,57,58,59] */
+
+ fsub v16.4s, v4.4s, v0.4s
+ fsub v17.4s, v27.4s, v1.4s
+ fsub v18.4s, v6.4s, v2.4s
+ fsub v19.4s, v29.4s, v3.4s
+ fadd v0.4s, v4.4s, v0.4s /* bs[0,1,2,3] */
+ fadd v1.4s, v1.4s, v27.4s /* bs[8,9,10,11] */
+ fadd v2.4s, v6.4s, v2.4s /* bs[16,17,18,19] */
+ fadd v3.4s, v3.4s, v29.4s /* bs[24,25,26,27] */
+ fmul v16.4s, v16.4s, v20.4s /* bs[7,6,5,4] */
+ fmul v17.4s, v17.4s, v20.4s /* bs[15,14,13,12] */
+ fmul v18.4s, v18.4s, v20.4s /* bs[23,22,21,20] */
+ fmul v19.4s, v19.4s, v20.4s /* bs[31,30,29,28] */
+
+ ld1 {v28.4s}, [x4]
+ zip1 v4.2d, v0.2d, v16.2d /* bs[0,1,7,6] */
+ zip2 v5.2d, v0.2d, v16.2d /* bs[2,3,5,4] */
+ zip1 v6.2d, v1.2d, v17.2d /* bs[8,9,15,14] */
+ zip2 v7.2d, v1.2d, v17.2d /* bs[10,11,13,12] */
+ zip1 v20.2d, v2.2d, v18.2d /* bs[16,17,23,22] */
+ zip2 v21.2d, v2.2d, v18.2d /* bs[18,19,21,20] */
+ zip1 v22.2d, v3.2d, v19.2d /* bs[24,25,31,30] */
+ zip2 v23.2d, v3.2d, v19.2d /* bs[26,27,29,28] */
+ rev64 v5.4s, v5.4s /* bs[3,2,4,5] */
+ rev64 v7.4s, v7.4s /* bs[11,10,12,13] */
+ rev64 v21.4s, v21.4s /* bs[19,18,20,21] */
+ rev64 v23.4s, v23.4s /* bs[27,26,28,29] */
+ AARCH64_DUP_2D(v29, v28, 0)
+ AARCH64_DUP_4S(v28, v28, 2)
+
+ fsub v16.4s, v4.4s, v5.4s
+ fsub v17.4s, v6.4s, v7.4s
+ fsub v18.4s, v20.4s, v21.4s
+ fsub v19.4s, v22.4s, v23.4s
+ fadd v0.4s, v4.4s, v5.4s /* bs[32,33,36,37] */
+ fadd v1.4s, v6.4s, v7.4s /* bs[40,41,44,45] */
+ fadd v2.4s, v20.4s, v21.4s /* bs[48,49,52,53] */
+ fadd v3.4s, v22.4s, v23.4s /* bs[56,57,60,61] */
+ fmul v16.4s, v16.4s, v29.4s /* bs[35,34,39,38] */
+ fmul v17.4s, v17.4s, v29.4s /* bs[43,42,47,46] */
+ fmul v18.4s, v18.4s, v29.4s /* bs[51,50,55,54] */
+ fmul v19.4s, v19.4s, v29.4s /* bs[59,58,63,62] */
+
+ uzp1 v4.4s, v0.4s, v16.4s /* bs[32,36,35,39] */
+ uzp2 v5.4s, v0.4s, v16.4s /* bs[33,37,34,38] */
+ uzp1 v6.4s, v1.4s, v17.4s /* bs[40,44,43,47] */
+ uzp2 v7.4s, v1.4s, v17.4s /* bs[41,45,42,46] */
+ uzp1 v20.4s, v2.4s, v18.4s /* bs[48,52,51,55] */
+ uzp2 v21.4s, v2.4s, v18.4s /* bs[49,53,50,54] */
+ uzp1 v22.4s, v3.4s, v19.4s /* bs[56,60,59,63] */
+ uzp2 v23.4s, v3.4s, v19.4s /* bs[57,61,58,62] */
+
+ fsub v16.4s, v4.4s, v5.4s
+ fsub v17.4s, v6.4s, v7.4s
+ fsub v18.4s, v20.4s, v21.4s
+ fsub v19.4s, v22.4s, v23.4s
+ fadd v0.4s, v4.4s, v5.4s /* bs[0,4,2,6] */
+ fadd v1.4s, v6.4s, v7.4s /* bs[8,12,10,14] */
+ fadd v2.4s, v20.4s, v21.4s /* bs[16,20,18,22] */
+ fadd v3.4s, v22.4s, v23.4s /* bs[24,28,26,30] */
+ fmul v16.4s, v16.4s, v28.4s /* bs[1,5,3,7] */
+ fmul v17.4s, v17.4s, v28.4s /* bs[9,13,11,15] */
+ fmul v18.4s, v18.4s, v28.4s /* bs[17,21,19,23] */
+ fmul v19.4s, v19.4s, v28.4s /* bs[25,29,27,31] */
+
+ zip2 v4.2d, v0.2d, v1.2d /* bs[2,6,10,14] */
+ zip2 v5.2d, v16.2d, v17.2d /* bs[3,7,11,15] */
+ zip2 v6.2d, v2.2d, v3.2d /* bs[18,22,26,30] */
+ zip2 v7.2d, v18.2d, v19.2d /* bs[19,23,27,31] */
+ fadd v4.4s, v4.4s, v5.4s /* bs[2,6,10,14] */
+ fadd v6.4s, v6.4s, v7.4s /* bs[18,22,26,30] */
+ ins v0.d[1], v4.d[0] /* bs[0,4,2,6] */
+ ins v1.d[1], v4.d[1] /* bs[8,12,10,14] */
+ ins v2.d[1], v6.d[0] /* bs[16,20,18,22] */
+ ins v3.d[1], v6.d[1] /* bs[24,28,26,30] */
+
+ eor v31.16b, v31.16b, v31.16b
+ zip1 v4.4s, v0.4s, v16.4s /* bs[0,1,4,5] */
+ zip2 v5.4s, v0.4s, v16.4s /* bs[2,3,6,7] */
+ zip1 v6.4s, v1.4s, v17.4s /* bs[8,9,12,13] */
+ zip2 v7.4s, v1.4s, v17.4s /* bs[10,11,14,15] */
+ zip1 v20.4s, v2.4s, v18.4s /* bs[16,17,20,21] */
+ zip2 v21.4s, v2.4s, v18.4s /* bs[18,19,22,23] */
+ zip1 v22.4s, v3.4s, v19.4s /* bs[24,25,28,29] */
+ zip2 v23.4s, v3.4s, v19.4s /* bs[26,27,30,31] */
+ zip1 v0.2d, v4.2d, v5.2d /* bs[0,1,2,3] */
+ zip2 v1.2d, v4.2d, v5.2d /* bs[4,5,6,7] */
+ zip1 v2.2d, v6.2d, v7.2d /* bs[8,9,10,11] */
+ zip2 v3.2d, v6.2d, v7.2d /* bs[12,13,14,15] */
+ rev64 v16.4s, v4.4s
+ rev64 v17.4s, v6.4s
+ zip1 v24.2d, v7.2d, v17.2d
+ zip2 v16.2d, v5.2d, v16.2d
+ zip2 v17.2d, v7.2d, v17.2d
+ zip1 v4.2d, v20.2d, v21.2d /* bs[16,17,18,19] */
+ zip2 v5.2d, v20.2d, v21.2d /* bs[20,21,22,23] */
+ zip1 v6.2d, v22.2d, v23.2d /* bs[24,25,26,27] */
+ zip2 v7.2d, v22.2d, v23.2d /* bs[28,29,30,31] */
+ rev64 v18.4s, v20.4s
+ rev64 v19.4s, v22.4s
+ zip1 v25.2d, v23.2d, v19.2d
+ zip1 v26.2d, v21.2d, v18.2d
+ zip2 v18.2d, v21.2d, v18.2d
+ zip2 v19.2d, v23.2d, v19.2d
+ ins v16.s[3], v31.s[0] /* bs[6,7,5,-] */
+ ins v17.s[3], v31.s[0] /* bs[14,15,13,-] */
+ ins v18.s[3], v31.s[0] /* bs[22,23,21,-] */
+ ins v19.s[3], v31.s[0] /* bs[30,31,29,-] */
+ ins v24.s[3], v31.s[0] /* bs[10,11,9,-] */
+ ins v25.s[3], v31.s[0] /* bs[26,27,25,-] */
+ ins v26.s[3], v31.s[0] /* bs[18,19,17,-] */
+
+ fadd v1.4s, v1.4s, v16.4s
+ fadd v3.4s, v3.4s, v17.4s
+ fadd v5.4s, v5.4s, v18.4s
+ fadd v7.4s, v7.4s, v19.4s
+
+ fadd v2.4s, v2.4s, v3.4s
+ fadd v3.4s, v3.4s, v24.4s
+ fadd v6.4s, v6.4s, v7.4s
+ fadd v7.4s, v7.4s, v25.4s
+
+ fadd v4.4s, v4.4s, v6.4s
+ fadd v6.4s, v6.4s, v5.4s
+ fadd v5.4s, v5.4s, v7.4s
+ fadd v7.4s, v7.4s, v26.4s
+
+ fcvtns v0.4s, v0.4s
+ fcvtns v1.4s, v1.4s
+ fcvtns v2.4s, v2.4s
+ fcvtns v3.4s, v3.4s
+ fcvtns v4.4s, v4.4s
+ fcvtns v5.4s, v5.4s
+ fcvtns v6.4s, v6.4s
+ fcvtns v7.4s, v7.4s
+ sqxtn v0.4h, v0.4s
+ sqxtn v1.4h, v1.4s
+ sqxtn v2.4h, v2.4s
+ sqxtn v3.4h, v3.4s
+ sqxtn v4.4h, v4.4s
+ sqxtn v5.4h, v5.4s
+ sqxtn v6.4h, v6.4s
+ sqxtn v7.4h, v7.4s
+
+ mov x3, #32
+ st1 {v0.h}[1], [x0], x3
+ st1 {v7.h}[2], [x0], x3
+ st1 {v3.h}[2], [x0], x3
+ st1 {v5.h}[2], [x0], x3
+ st1 {v1.h}[2], [x0], x3
+ st1 {v6.h}[2], [x0], x3
+ st1 {v2.h}[2], [x0], x3
+ st1 {v4.h}[2], [x0], x3
+ st1 {v0.h}[2], [x0], x3
+ st1 {v7.h}[0], [x0], x3
+ st1 {v3.h}[0], [x0], x3
+ st1 {v5.h}[0], [x0], x3
+ st1 {v1.h}[0], [x0], x3
+ st1 {v6.h}[0], [x0], x3
+ st1 {v2.h}[0], [x0], x3
+ st1 {v4.h}[0], [x0], x3
+ st1 {v0.h}[0], [x0]
+ st1 {v0.h}[1], [x1], x3
+ st1 {v4.h}[1], [x1], x3
+ st1 {v2.h}[1], [x1], x3
+ st1 {v6.h}[1], [x1], x3
+ st1 {v1.h}[1], [x1], x3
+ st1 {v5.h}[1], [x1], x3
+ st1 {v3.h}[1], [x1], x3
+ st1 {v7.h}[1], [x1], x3
+ st1 {v0.h}[3], [x1], x3
+ st1 {v4.h}[3], [x1], x3
+ st1 {v2.h}[3], [x1], x3
+ st1 {v6.h}[3], [x1], x3
+ st1 {v1.h}[3], [x1], x3
+ st1 {v5.h}[3], [x1], x3
+ st1 {v3.h}[3], [x1], x3
+ st1 {v7.h}[3], [x1]
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_neon64_float.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_neon64_float.S
new file mode 100644
index 00000000..0e557e50
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_neon64_float.S
@@ -0,0 +1,282 @@
+/*
+ dct64_neon64_float: NEON optimized dct64 for AArch64 (float output version)
+
+ copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+costab_neon_aarch64:
+ .word 1056974725
+ .word 1057056395
+ .word 1057223771
+ .word 1057485416
+ .word 1057855544
+ .word 1058356026
+ .word 1059019886
+ .word 1059897405
+ .word 1061067246
+ .word 1062657950
+ .word 1064892987
+ .word 1066774581
+ .word 1069414683
+ .word 1073984175
+ .word 1079645762
+ .word 1092815430
+ .word 1057005197
+ .word 1057342072
+ .word 1058087743
+ .word 1059427869
+ .word 1061799040
+ .word 1065862217
+ .word 1071413542
+ .word 1084439708
+ .word 1057128951
+ .word 1058664893
+ .word 1063675095
+ .word 1076102863
+ .word 1057655764
+ .word 1067924853
+ .word 1060439283
+ .word 1060439283
+ .text
+ ALIGN4
+ .globl ASM_NAME(dct64_real_neon64)
+#ifdef __ELF__
+ .type ASM_NAME(dct64_real_neon64), %function
+#endif
+ASM_NAME(dct64_real_neon64):
+ add x3, x2, #64
+ adrp x4, AARCH64_PCREL_HI(costab_neon_aarch64)
+ add x4, x4, AARCH64_PCREL_LO(costab_neon_aarch64)
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x2]
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x3]
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x4], #64
+
+ rev64 v19.4s, v19.4s
+ rev64 v18.4s, v18.4s
+ rev64 v17.4s, v17.4s
+ rev64 v16.4s, v16.4s
+ ext v4.16b, v19.16b, v19.16b, #8
+ ext v5.16b, v18.16b, v18.16b, #8
+ ext v6.16b, v17.16b, v17.16b, #8
+ ext v7.16b, v16.16b, v16.16b, #8
+
+ fsub v16.4s, v3.4s, v7.4s
+ fsub v17.4s, v2.4s, v6.4s
+ fsub v18.4s, v1.4s, v5.4s
+ fsub v19.4s, v0.4s, v4.4s
+ fadd v0.4s, v0.4s, v4.4s /* bs[0,1,2,3] */
+ fadd v1.4s, v1.4s, v5.4s /* bs[4,5,6,7] */
+ fadd v2.4s, v2.4s, v6.4s /* bs[8,9,10,11] */
+ fadd v3.4s, v3.4s, v7.4s /* bs[12,13,14,15] */
+ fmul v16.4s, v16.4s, v23.4s /* bs[19,18,17,16] */
+ fmul v17.4s, v17.4s, v22.4s /* bs[23,22,21,20] */
+ fmul v18.4s, v18.4s, v21.4s /* bs[27,26,25,24] */
+ fmul v19.4s, v19.4s, v20.4s /* bs[31,30,29,28] */
+
+ ld1 {v20.4s, v21.4s}, [x4], #32
+ rev64 v22.4s, v3.4s
+ rev64 v23.4s, v2.4s
+ rev64 v24.4s, v16.4s
+ rev64 v25.4s, v17.4s
+ ext v4.16b, v22.16b, v22.16b, #8 /* bs[15,14,13,12] */
+ ext v5.16b, v23.16b, v23.16b, #8 /* bs[11,10,9,8] */
+ ext v6.16b, v24.16b, v24.16b, #8 /* bs[16,17,18,19] */
+ ext v7.16b, v25.16b, v25.16b, #8 /* bs[20,21,22,23] */
+
+ fsub v26.4s, v1.4s, v5.4s
+ fsub v27.4s, v0.4s, v4.4s
+ fsub v28.4s, v18.4s, v7.4s
+ fsub v29.4s, v19.4s, v6.4s
+ fadd v4.4s, v0.4s, v4.4s /* bs[32,33,34,35] */
+ fadd v5.4s, v1.4s, v5.4s /* bs[36,37,38,39] */
+ fadd v6.4s, v6.4s, v19.4s /* bs[48,49,50,51] */
+ fadd v7.4s, v7.4s, v18.4s /* bs[52,53,54,55] */
+ fmul v26.4s, v26.4s, v21.4s /* bs[43,42,41,40] */
+ fmul v27.4s, v27.4s, v20.4s /* bs[47,46,45,44] */
+ fmul v28.4s, v28.4s, v21.4s /* bs[59,58,57,56] */
+ fmul v29.4s, v29.4s, v20.4s /* bs[63,62,61,60] */
+
+ ld1 {v20.4s}, [x4], #16
+ rev64 v16.4s, v5.4s
+ rev64 v17.4s, v26.4s
+ rev64 v18.4s, v7.4s
+ rev64 v19.4s, v28.4s
+ ext v0.16b, v16.16b, v16.16b, #8 /* bs[39,38,37,36] */
+ ext v1.16b, v17.16b, v17.16b, #8 /* bs[40,41,42,43] */
+ ext v2.16b, v18.16b, v18.16b, #8 /* bs[55,54,53,52] */
+ ext v3.16b, v19.16b, v19.16b, #8 /* bs[56,57,58,59] */
+
+ fsub v16.4s, v4.4s, v0.4s
+ fsub v17.4s, v27.4s, v1.4s
+ fsub v18.4s, v6.4s, v2.4s
+ fsub v19.4s, v29.4s, v3.4s
+ fadd v0.4s, v4.4s, v0.4s /* bs[0,1,2,3] */
+ fadd v1.4s, v1.4s, v27.4s /* bs[8,9,10,11] */
+ fadd v2.4s, v6.4s, v2.4s /* bs[16,17,18,19] */
+ fadd v3.4s, v3.4s, v29.4s /* bs[24,25,26,27] */
+ fmul v16.4s, v16.4s, v20.4s /* bs[7,6,5,4] */
+ fmul v17.4s, v17.4s, v20.4s /* bs[15,14,13,12] */
+ fmul v18.4s, v18.4s, v20.4s /* bs[23,22,21,20] */
+ fmul v19.4s, v19.4s, v20.4s /* bs[31,30,29,28] */
+
+ ld1 {v28.4s}, [x4]
+ zip1 v4.2d, v0.2d, v16.2d /* bs[0,1,7,6] */
+ zip2 v5.2d, v0.2d, v16.2d /* bs[2,3,5,4] */
+ zip1 v6.2d, v1.2d, v17.2d /* bs[8,9,15,14] */
+ zip2 v7.2d, v1.2d, v17.2d /* bs[10,11,13,12] */
+ zip1 v20.2d, v2.2d, v18.2d /* bs[16,17,23,22] */
+ zip2 v21.2d, v2.2d, v18.2d /* bs[18,19,21,20] */
+ zip1 v22.2d, v3.2d, v19.2d /* bs[24,25,31,30] */
+ zip2 v23.2d, v3.2d, v19.2d /* bs[26,27,29,28] */
+ rev64 v5.4s, v5.4s /* bs[3,2,4,5] */
+ rev64 v7.4s, v7.4s /* bs[11,10,12,13] */
+ rev64 v21.4s, v21.4s /* bs[19,18,20,21] */
+ rev64 v23.4s, v23.4s /* bs[27,26,28,29] */
+ AARCH64_DUP_2D(v29, v28, 0)
+ AARCH64_DUP_4S(v28, v28, 2)
+
+ fsub v16.4s, v4.4s, v5.4s
+ fsub v17.4s, v6.4s, v7.4s
+ fsub v18.4s, v20.4s, v21.4s
+ fsub v19.4s, v22.4s, v23.4s
+ fadd v0.4s, v4.4s, v5.4s /* bs[32,33,36,37] */
+ fadd v1.4s, v6.4s, v7.4s /* bs[40,41,44,45] */
+ fadd v2.4s, v20.4s, v21.4s /* bs[48,49,52,53] */
+ fadd v3.4s, v22.4s, v23.4s /* bs[56,57,60,61] */
+ fmul v16.4s, v16.4s, v29.4s /* bs[35,34,39,38] */
+ fmul v17.4s, v17.4s, v29.4s /* bs[43,42,47,46] */
+ fmul v18.4s, v18.4s, v29.4s /* bs[51,50,55,54] */
+ fmul v19.4s, v19.4s, v29.4s /* bs[59,58,63,62] */
+
+ uzp1 v4.4s, v0.4s, v16.4s /* bs[32,36,35,39] */
+ uzp2 v5.4s, v0.4s, v16.4s /* bs[33,37,34,38] */
+ uzp1 v6.4s, v1.4s, v17.4s /* bs[40,44,43,47] */
+ uzp2 v7.4s, v1.4s, v17.4s /* bs[41,45,42,46] */
+ uzp1 v20.4s, v2.4s, v18.4s /* bs[48,52,51,55] */
+ uzp2 v21.4s, v2.4s, v18.4s /* bs[49,53,50,54] */
+ uzp1 v22.4s, v3.4s, v19.4s /* bs[56,60,59,63] */
+ uzp2 v23.4s, v3.4s, v19.4s /* bs[57,61,58,62] */
+
+ fsub v16.4s, v4.4s, v5.4s
+ fsub v17.4s, v6.4s, v7.4s
+ fsub v18.4s, v20.4s, v21.4s
+ fsub v19.4s, v22.4s, v23.4s
+ fadd v0.4s, v4.4s, v5.4s /* bs[0,4,2,6] */
+ fadd v1.4s, v6.4s, v7.4s /* bs[8,12,10,14] */
+ fadd v2.4s, v20.4s, v21.4s /* bs[16,20,18,22] */
+ fadd v3.4s, v22.4s, v23.4s /* bs[24,28,26,30] */
+ fmul v16.4s, v16.4s, v28.4s /* bs[1,5,3,7] */
+ fmul v17.4s, v17.4s, v28.4s /* bs[9,13,11,15] */
+ fmul v18.4s, v18.4s, v28.4s /* bs[17,21,19,23] */
+ fmul v19.4s, v19.4s, v28.4s /* bs[25,29,27,31] */
+
+ zip2 v4.2d, v0.2d, v1.2d /* bs[2,6,10,14] */
+ zip2 v5.2d, v16.2d, v17.2d /* bs[3,7,11,15] */
+ zip2 v6.2d, v2.2d, v3.2d /* bs[18,22,26,30] */
+ zip2 v7.2d, v18.2d, v19.2d /* bs[19,23,27,31] */
+ fadd v4.4s, v4.4s, v5.4s /* bs[2,6,10,14] */
+ fadd v6.4s, v6.4s, v7.4s /* bs[18,22,26,30] */
+ ins v0.d[1], v4.d[0] /* bs[0,4,2,6] */
+ ins v1.d[1], v4.d[1] /* bs[8,12,10,14] */
+ ins v2.d[1], v6.d[0] /* bs[16,20,18,22] */
+ ins v3.d[1], v6.d[1] /* bs[24,28,26,30] */
+
+ eor v31.16b, v31.16b, v31.16b
+ zip1 v4.4s, v0.4s, v16.4s /* bs[0,1,4,5] */
+ zip2 v5.4s, v0.4s, v16.4s /* bs[2,3,6,7] */
+ zip1 v6.4s, v1.4s, v17.4s /* bs[8,9,12,13] */
+ zip2 v7.4s, v1.4s, v17.4s /* bs[10,11,14,15] */
+ zip1 v20.4s, v2.4s, v18.4s /* bs[16,17,20,21] */
+ zip2 v21.4s, v2.4s, v18.4s /* bs[18,19,22,23] */
+ zip1 v22.4s, v3.4s, v19.4s /* bs[24,25,28,29] */
+ zip2 v23.4s, v3.4s, v19.4s /* bs[26,27,30,31] */
+ zip1 v0.2d, v4.2d, v5.2d /* bs[0,1,2,3] */
+ zip2 v1.2d, v4.2d, v5.2d /* bs[4,5,6,7] */
+ zip1 v2.2d, v6.2d, v7.2d /* bs[8,9,10,11] */
+ zip2 v3.2d, v6.2d, v7.2d /* bs[12,13,14,15] */
+ rev64 v16.4s, v4.4s
+ rev64 v17.4s, v6.4s
+ zip1 v24.2d, v7.2d, v17.2d
+ zip2 v16.2d, v5.2d, v16.2d
+ zip2 v17.2d, v7.2d, v17.2d
+ zip1 v4.2d, v20.2d, v21.2d /* bs[16,17,18,19] */
+ zip2 v5.2d, v20.2d, v21.2d /* bs[20,21,22,23] */
+ zip1 v6.2d, v22.2d, v23.2d /* bs[24,25,26,27] */
+ zip2 v7.2d, v22.2d, v23.2d /* bs[28,29,30,31] */
+ rev64 v18.4s, v20.4s
+ rev64 v19.4s, v22.4s
+ zip1 v25.2d, v23.2d, v19.2d
+ zip1 v26.2d, v21.2d, v18.2d
+ zip2 v18.2d, v21.2d, v18.2d
+ zip2 v19.2d, v23.2d, v19.2d
+ ins v16.s[3], v31.s[0] /* bs[6,7,5,-] */
+ ins v17.s[3], v31.s[0] /* bs[14,15,13,-] */
+ ins v18.s[3], v31.s[0] /* bs[22,23,21,-] */
+ ins v19.s[3], v31.s[0] /* bs[30,31,29,-] */
+ ins v24.s[3], v31.s[0] /* bs[10,11,9,-] */
+ ins v25.s[3], v31.s[0] /* bs[26,27,25,-] */
+ ins v26.s[3], v31.s[0] /* bs[18,19,17,-] */
+
+ fadd v1.4s, v1.4s, v16.4s
+ fadd v3.4s, v3.4s, v17.4s
+ fadd v5.4s, v5.4s, v18.4s
+ fadd v7.4s, v7.4s, v19.4s
+
+ fadd v2.4s, v2.4s, v3.4s
+ fadd v3.4s, v3.4s, v24.4s
+ fadd v6.4s, v6.4s, v7.4s
+ fadd v7.4s, v7.4s, v25.4s
+
+ fadd v4.4s, v4.4s, v6.4s
+ fadd v6.4s, v6.4s, v5.4s
+ fadd v5.4s, v5.4s, v7.4s
+ fadd v7.4s, v7.4s, v26.4s
+
+ mov x3, #64
+ st1 {v0.s}[1], [x0], x3
+ st1 {v7.s}[2], [x0], x3
+ st1 {v3.s}[2], [x0], x3
+ st1 {v5.s}[2], [x0], x3
+ st1 {v1.s}[2], [x0], x3
+ st1 {v6.s}[2], [x0], x3
+ st1 {v2.s}[2], [x0], x3
+ st1 {v4.s}[2], [x0], x3
+ st1 {v0.s}[2], [x0], x3
+ st1 {v7.s}[0], [x0], x3
+ st1 {v3.s}[0], [x0], x3
+ st1 {v5.s}[0], [x0], x3
+ st1 {v1.s}[0], [x0], x3
+ st1 {v6.s}[0], [x0], x3
+ st1 {v2.s}[0], [x0], x3
+ st1 {v4.s}[0], [x0], x3
+ st1 {v0.s}[0], [x0]
+ st1 {v0.s}[1], [x1], x3
+ st1 {v4.s}[1], [x1], x3
+ st1 {v2.s}[1], [x1], x3
+ st1 {v6.s}[1], [x1], x3
+ st1 {v1.s}[1], [x1], x3
+ st1 {v5.s}[1], [x1], x3
+ st1 {v3.s}[1], [x1], x3
+ st1 {v7.s}[1], [x1], x3
+ st1 {v0.s}[3], [x1], x3
+ st1 {v4.s}[3], [x1], x3
+ st1 {v2.s}[3], [x1], x3
+ st1 {v6.s}[3], [x1], x3
+ st1 {v1.s}[3], [x1], x3
+ st1 {v5.s}[3], [x1], x3
+ st1 {v3.s}[3], [x1], x3
+ st1 {v7.s}[3], [x1]
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_neon_float.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_neon_float.S
new file mode 100644
index 00000000..36d640f3
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_neon_float.S
@@ -0,0 +1,283 @@
+/*
+ dct64_neon_float: ARM NEON optimized dct64 (float output version)
+
+ copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifndef _M_ARM
+ .code 32
+#endif
+#ifndef __APPLE__
+ .fpu neon
+#endif
+
+ .text
+ ALIGN16
+costab_arm:
+ .word 1056974725
+ .word 1057056395
+ .word 1057223771
+ .word 1057485416
+ .word 1057855544
+ .word 1058356026
+ .word 1059019886
+ .word 1059897405
+ .word 1061067246
+ .word 1062657950
+ .word 1064892987
+ .word 1066774581
+ .word 1069414683
+ .word 1073984175
+ .word 1079645762
+ .word 1092815430
+ .word 1057005197
+ .word 1057342072
+ .word 1058087743
+ .word 1059427869
+ .word 1061799040
+ .word 1065862217
+ .word 1071413542
+ .word 1084439708
+ .word 1057128951
+ .word 1058664893
+ .word 1063675095
+ .word 1076102863
+ .word 1057655764
+ .word 1067924853
+ .word 1060439283
+ .word 1060439283
+ ALIGN4
+ GLOBAL_SYMBOL ASM_NAME(dct64_real_neon)
+#ifdef __ELF__
+ .type ASM_NAME(dct64_real_neon), %function
+#endif
+ASM_NAME(dct64_real_neon):
+ vpush {q4-q7}
+
+ adr r3, costab_arm
+ vld1.32 {q0, q1}, [r2]!
+ vld1.32 {q2, q3}, [r2]!
+ vld1.32 {q4, q5}, [r2]!
+ vld1.32 {q6, q7}, [r2]
+ vld1.32 {q12, q13}, [r3, :128]!
+ vld1.32 {q14, q15}, [r3, :128]!
+
+ vrev64.32 q4, q4
+ vrev64.32 q5, q5
+ vrev64.32 q6, q6
+ vrev64.32 q7, q7
+ vswp d8, d9
+ vswp d10, d11
+ vswp d12, d13
+ vswp d14, d15
+
+ vsub.f32 q8, q0, q7
+ vsub.f32 q9, q1, q6
+ vsub.f32 q10, q2, q5
+ vsub.f32 q11, q3, q4
+ vadd.f32 q0, q0, q7
+ vadd.f32 q1, q1, q6
+ vadd.f32 q2, q2, q5
+ vadd.f32 q3, q3, q4
+ vmul.f32 q4, q8, q12
+ vmul.f32 q5, q9, q13
+ vmul.f32 q6, q10, q14
+ vmul.f32 q7, q11, q15
+
+ vld1.32 {q12, q13}, [r3, :128]!
+ vld1.32 {q14, q15}, [r3, :128]
+
+ vrev64.32 q2, q2
+ vrev64.32 q3, q3
+ vrev64.32 q6, q6
+ vrev64.32 q7, q7
+ vswp d4, d5
+ vswp d6, d7
+ vswp d12, d13
+ vswp d14, d15
+
+ vsub.f32 q8, q0, q3
+ vsub.f32 q9, q1, q2
+ vsub.f32 q10, q4, q7
+ vsub.f32 q11, q5, q6
+ vadd.f32 q0, q0, q3
+ vadd.f32 q1, q1, q2
+ vadd.f32 q4, q4, q7
+ vadd.f32 q5, q5, q6
+ vmul.f32 q2, q8, q12
+ vmul.f32 q3, q9, q13
+ vmul.f32 q6, q10, q12
+ vmul.f32 q7, q11, q13
+
+ vrev64.32 q1, q1
+ vrev64.32 q3, q3
+ vrev64.32 q5, q5
+ vrev64.32 q7, q7
+ vswp d2, d3
+ vswp d6, d7
+ vswp d10, d11
+ vswp d14, d15
+
+ vsub.f32 q8, q0, q1
+ vsub.f32 q9, q2, q3
+ vsub.f32 q10, q4, q5
+ vsub.f32 q11, q6, q7
+ vadd.f32 q0, q0, q1
+ vadd.f32 q2, q2, q3
+ vadd.f32 q4, q4, q5
+ vadd.f32 q6, q6, q7
+ vmul.f32 q1, q8, q14
+ vmul.f32 q3, q9, q14
+ vmul.f32 q5, q10, q14
+ vmul.f32 q7, q11, q14
+
+ vdup.32 q12, d31[0]
+ vmov d31, d30
+
+ vswp d1, d2
+ vswp d5, d6
+ vswp d9, d10
+ vswp d13, d14
+ vrev64.32 q1, q1
+ vrev64.32 q3, q3
+ vrev64.32 q5, q5
+ vrev64.32 q7, q7
+
+ vsub.f32 q8, q0, q1
+ vsub.f32 q9, q2, q3
+ vsub.f32 q10, q4, q5
+ vsub.f32 q11, q6, q7
+ vadd.f32 q0, q0, q1
+ vadd.f32 q2, q2, q3
+ vadd.f32 q4, q4, q5
+ vadd.f32 q6, q6, q7
+ vmul.f32 q1, q8, q15
+ vmul.f32 q3, q9, q15
+ vmul.f32 q5, q10, q15
+ vmul.f32 q7, q11, q15
+
+ vtrn.32 q0, q1
+ vtrn.32 q2, q3
+ vtrn.32 q4, q5
+ vtrn.32 q6, q7
+
+ vsub.f32 q8, q0, q1
+ vsub.f32 q9, q2, q3
+ vsub.f32 q10, q4, q5
+ vsub.f32 q11, q6, q7
+ vadd.f32 q0, q0, q1
+ vadd.f32 q2, q2, q3
+ vadd.f32 q4, q4, q5
+ vadd.f32 q6, q6, q7
+ vmul.f32 q1, q8, q12
+ vmul.f32 q3, q9, q12
+ vmul.f32 q5, q10, q12
+ vmul.f32 q7, q11, q12
+
+ vtrn.32 q0, q1
+ vtrn.32 q2, q3
+ vtrn.32 q4, q5
+ vtrn.32 q6, q7
+ vswp d1, d2
+ vswp d5, d6
+ vswp d9, d10
+ vswp d13, d14
+
+ vshr.u64 d16, d1, #32
+ vshr.u64 d17, d3, #32
+ vshr.u64 d18, d5, #32
+ vshr.u64 d19, d7, #32
+ vadd.f32 d1, d1, d16
+ vadd.f32 d3, d3, d17
+ vadd.f32 d5, d5, d18
+ vadd.f32 d7, d7, d19
+ vshr.u64 d20, d9, #32
+ vshr.u64 d21, d11, #32
+ vshr.u64 d22, d13, #32
+ vshr.u64 d23, d15, #32
+ vadd.f32 d9, d9, d20
+ vadd.f32 d11, d11, d21
+ vadd.f32 d13, d13, d22
+ vadd.f32 d15, d15, d23
+
+ vshr.u64 d16, d2, #32
+ vshr.u64 d18, d6, #32
+ vshr.u64 d20, d10, #32
+ vshr.u64 d22, d14, #32
+ vext.8 q8, q1, q8, #8
+ vext.8 q9, q3, q9, #8
+ vext.8 q10, q5, q10, #8
+ vext.8 q11, q7, q11, #8
+ vadd.f32 q1, q1, q8
+ vadd.f32 q3, q3, q9
+ vadd.f32 q5, q5, q10
+ vadd.f32 q7, q7, q11
+
+ vshr.u64 d16, d4, #32
+ vshr.u64 d18, d12, #32
+ vext.8 q8, q2, q8, #8
+ vext.8 q9, q6, q9, #8
+ vadd.f32 q2, q2, q3
+ vadd.f32 q6, q6, q7
+ vadd.f32 q3, q3, q8
+ vadd.f32 q7, q7, q9
+
+ vrev64.32 q8, q4
+ vshr.u64 d19, d9, #32
+ vext.8 d17, d17, d16, #4
+ vswp d9, d10
+ vswp d13, d14
+ vtrn.32 q4, q5
+ vtrn.32 q6, q7
+ vmov d16, d9
+ vmov d18, d11
+
+ vadd.f32 q4, q6
+ vadd.f32 q5, q7
+ vadd.f32 q6, q8
+ vadd.f32 q7, q9
+
+ mov r3, #64
+ vst1.32 {d0[1]}, [r0, :32], r3
+ vst1.32 {d13[1]}, [r0, :32], r3
+ vst1.32 {d7[0]}, [r0, :32], r3
+ vst1.32 {d9[1]}, [r0, :32], r3
+ vst1.32 {d3[0]}, [r0, :32], r3
+ vst1.32 {d12[1]}, [r0, :32], r3
+ vst1.32 {d5[0]}, [r0, :32], r3
+ vst1.32 {d8[1]}, [r0, :32], r3
+ vst1.32 {d1[0]}, [r0, :32], r3
+ vst1.32 {d13[0]}, [r0, :32], r3
+ vst1.32 {d6[0]}, [r0, :32], r3
+ vst1.32 {d9[0]}, [r0, :32], r3
+ vst1.32 {d2[0]}, [r0, :32], r3
+ vst1.32 {d12[0]}, [r0, :32], r3
+ vst1.32 {d4[0]}, [r0, :32], r3
+ vst1.32 {d8[0]}, [r0, :32], r3
+ vst1.32 {d0[0]}, [r0, :32]
+
+ vst1.32 {d0[1]}, [r1, :32], r3
+ vst1.32 {d10[0]}, [r1, :32], r3
+ vst1.32 {d4[1]}, [r1, :32], r3
+ vst1.32 {d14[0]}, [r1, :32], r3
+ vst1.32 {d2[1]}, [r1, :32], r3
+ vst1.32 {d11[0]}, [r1, :32], r3
+ vst1.32 {d6[1]}, [r1, :32], r3
+ vst1.32 {d15[0]}, [r1, :32], r3
+ vst1.32 {d1[1]}, [r1, :32], r3
+ vst1.32 {d10[1]}, [r1, :32], r3
+ vst1.32 {d5[1]}, [r1, :32], r3
+ vst1.32 {d14[1]}, [r1, :32], r3
+ vst1.32 {d3[1]}, [r1, :32], r3
+ vst1.32 {d11[1]}, [r1, :32], r3
+ vst1.32 {d7[1]}, [r1, :32], r3
+ vst1.32 {d15[1]}, [r1, :32]
+
+ vpop {q4-q7}
+ bx lr
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_sse.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_sse.S
new file mode 100644
index 00000000..16bcd69f
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_sse.S
@@ -0,0 +1,472 @@
+/*
+ dct64_sse: MMX/SSE optimized dct64
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#define ARG(n) (8+n*4)(%ebp)
+#define TEMP(n) (4+n*16)(%esp)
+#define TEMP_BYTE(n) (4+n)(%esp)
+
+/*
+ void dct64_sse(short *out0, short *out1, real *samples);
+*/
+
+#if !defined (__APPLE__) && !defined (__OS2__)
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+pnpn:
+ .long 0
+ .long -2147483648
+ .long 0
+ .long -2147483648
+ ALIGN16
+mask:
+ .long -1
+ .long -1
+ .long -1
+ .long 0
+
+ .text
+ ALIGN16
+.globl ASM_NAME(dct64_sse)
+ASM_NAME(dct64_sse):
+ pushl %ebp
+ movl %esp, %ebp
+
+ andl $-16, %esp /* align the stack at 16 bytes */
+ subl $128, %esp /* reserve space for temporal store */
+ pushl %ebx
+
+ GET_GOT
+
+ movl ARG(2), %eax
+
+ MOVUAPS (%eax), %xmm7
+ MOVUAPS 16(%eax), %xmm6
+ MOVUAPS 112(%eax), %xmm0
+ MOVUAPS 96(%eax), %xmm1
+ shufps $0x1b, %xmm0, %xmm0
+ shufps $0x1b, %xmm1, %xmm1
+ movaps %xmm7, %xmm4
+ movaps %xmm6, %xmm5
+ addps %xmm0, %xmm4
+ addps %xmm1, %xmm5
+ subps %xmm0, %xmm7
+ subps %xmm1, %xmm6
+ movaps %xmm4, TEMP(0)
+ movaps %xmm5, TEMP(1)
+
+ MOVUAPS 32(%eax), %xmm2
+ MOVUAPS 48(%eax), %xmm3
+ MOVUAPS 80(%eax), %xmm0
+ MOVUAPS 64(%eax), %xmm1
+ shufps $0x1b, %xmm0, %xmm0
+ shufps $0x1b, %xmm1, %xmm1
+ movaps %xmm2, %xmm5
+ movaps %xmm3, %xmm4
+ addps %xmm0, %xmm2
+ addps %xmm1, %xmm3
+ subps %xmm0, %xmm5
+ subps %xmm1, %xmm4
+
+#if defined(PIC) && defined(__APPLE__)
+ mov GLOBAL_VAR_PTR(costab_mmxsse), %ecx
+#else
+ lea GLOBAL_VAR(costab_mmxsse), %ecx
+#endif
+ mulps (%ecx), %xmm7
+ mulps 16(%ecx), %xmm6
+ mulps 32(%ecx), %xmm5
+ mulps 48(%ecx), %xmm4
+
+ shufps $0x1b, %xmm2, %xmm2
+ shufps $0x1b, %xmm3, %xmm3
+ shufps $0x1b, %xmm4, %xmm4
+ shufps $0x1b, %xmm5, %xmm5
+ movaps TEMP(0), %xmm0
+ movaps TEMP(1), %xmm1
+ subps %xmm3, %xmm0
+ subps %xmm2, %xmm1
+ addps TEMP(0), %xmm3
+ addps TEMP(1), %xmm2
+ movaps %xmm3, TEMP(0)
+ movaps %xmm2, TEMP(1)
+ movaps %xmm6, %xmm2
+ movaps %xmm7, %xmm3
+ subps %xmm5, %xmm6
+ subps %xmm4, %xmm7
+ addps %xmm3, %xmm4
+ addps %xmm2, %xmm5
+ mulps 64(%ecx), %xmm0
+ mulps 80(%ecx), %xmm1
+ mulps 80(%ecx), %xmm6
+ mulps 64(%ecx), %xmm7
+
+ movaps TEMP(0), %xmm2
+ movaps TEMP(1), %xmm3
+ shufps $0x1b, %xmm3, %xmm3
+ shufps $0x1b, %xmm5, %xmm5
+ shufps $0x1b, %xmm1, %xmm1
+ shufps $0x1b, %xmm6, %xmm6
+ movaps %xmm0, TEMP(1)
+ subps %xmm3, %xmm2
+ subps %xmm1, %xmm0
+ addps TEMP(0), %xmm3
+ addps TEMP(1), %xmm1
+ movaps %xmm3, TEMP(0)
+ movaps %xmm1, TEMP(2)
+ movaps %xmm5, %xmm1
+ movaps %xmm4, %xmm5
+ movaps %xmm7, %xmm3
+ subps %xmm1, %xmm5
+ subps %xmm6, %xmm7
+ addps %xmm1, %xmm4
+ addps %xmm3, %xmm6
+ mulps 96(%ecx), %xmm2
+ mulps 96(%ecx), %xmm0
+ mulps 96(%ecx), %xmm5
+ mulps 96(%ecx), %xmm7
+ movaps %xmm2, TEMP(1)
+ movaps %xmm0, TEMP(3)
+
+ movaps %xmm4, %xmm2
+ movaps %xmm5, %xmm3
+ shufps $0x44, %xmm6, %xmm2
+ shufps $0xbb, %xmm7, %xmm5
+ shufps $0xbb, %xmm6, %xmm4
+ shufps $0x44, %xmm7, %xmm3
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ subps %xmm4, %xmm2
+ subps %xmm5, %xmm3
+ addps %xmm6, %xmm4
+ addps %xmm7, %xmm5
+ movaps 112(%ecx), %xmm0
+ movlhps %xmm0, %xmm0
+ mulps %xmm0, %xmm2
+ mulps %xmm0, %xmm3
+ movaps %xmm0, TEMP(4)
+ movaps %xmm4, %xmm6
+ movaps %xmm5, %xmm7
+ shufps $0x14, %xmm2, %xmm4
+ shufps $0xbe, %xmm2, %xmm6
+ shufps $0x14, %xmm3, %xmm5
+ shufps $0xbe, %xmm3, %xmm7
+ movaps %xmm5, TEMP(5)
+ movaps %xmm7, TEMP(7)
+
+ movaps TEMP(0), %xmm0
+ movaps TEMP(1), %xmm1
+ movaps %xmm0, %xmm2
+ movaps %xmm1, %xmm3
+ shufps $0x44, TEMP(2), %xmm2
+ shufps $0xbb, TEMP(3), %xmm1
+ shufps $0xbb, TEMP(2), %xmm0
+ shufps $0x44, TEMP(3), %xmm3
+ movaps %xmm2, %xmm5
+ movaps %xmm3, %xmm7
+ subps %xmm0, %xmm2
+ subps %xmm1, %xmm3
+ addps %xmm5, %xmm0
+ addps %xmm7, %xmm1
+ mulps TEMP(4), %xmm2
+ mulps TEMP(4), %xmm3
+ movaps %xmm0, %xmm5
+ movaps %xmm1, %xmm7
+ shufps $0x14, %xmm2, %xmm0
+ shufps $0xbe, %xmm2, %xmm5
+ shufps $0x14, %xmm3, %xmm1
+ shufps $0xbe, %xmm3, %xmm7
+
+ movaps %xmm0, TEMP(0)
+ movaps %xmm1, TEMP(1)
+ movaps %xmm5, TEMP(2)
+ movaps %xmm7, TEMP(3)
+
+ movss 120(%ecx), %xmm5
+ shufps $0x00, %xmm5, %xmm5
+ xorps LOCAL_VAR(pnpn), %xmm5
+
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps TEMP(5), %xmm4
+ unpckhps TEMP(5), %xmm0
+ unpcklps TEMP(7), %xmm6
+ unpckhps TEMP(7), %xmm1
+ movaps %xmm4, %xmm2
+ movaps %xmm6, %xmm3
+ unpcklps %xmm0, %xmm4
+ unpckhps %xmm0, %xmm2
+ unpcklps %xmm1, %xmm6
+ unpckhps %xmm1, %xmm3
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ subps %xmm2, %xmm0
+ subps %xmm3, %xmm1
+ addps %xmm2, %xmm4
+ addps %xmm3, %xmm6
+ mulps %xmm5, %xmm0
+ mulps %xmm5, %xmm1
+ movaps %xmm5, TEMP(5)
+ movaps %xmm4, %xmm5
+ movaps %xmm6, %xmm7
+ unpcklps %xmm0, %xmm4
+ unpckhps %xmm0, %xmm5
+ unpcklps %xmm1, %xmm6
+ unpckhps %xmm1, %xmm7
+
+ movaps TEMP(0), %xmm0
+ movaps TEMP(2), %xmm2
+ movaps %xmm4, TEMP(4)
+ movaps %xmm6, TEMP(6)
+
+ movaps %xmm0, %xmm4
+ movaps %xmm2, %xmm6
+ unpcklps TEMP(1), %xmm0
+ unpckhps TEMP(1), %xmm4
+ unpcklps TEMP(3), %xmm2
+ unpckhps TEMP(3), %xmm6
+ movaps %xmm0, %xmm1
+ movaps %xmm2, %xmm3
+ unpcklps %xmm4, %xmm0
+ unpckhps %xmm4, %xmm1
+ unpcklps %xmm6, %xmm2
+ unpckhps %xmm6, %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm2, %xmm6
+ subps %xmm1, %xmm4
+ subps %xmm3, %xmm6
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ mulps TEMP(5), %xmm4
+ mulps TEMP(5), %xmm6
+ movaps %xmm0, %xmm1
+ movaps %xmm2, %xmm3
+ unpcklps %xmm4, %xmm0
+ unpckhps %xmm4, %xmm1
+ unpcklps %xmm6, %xmm2
+ unpckhps %xmm6, %xmm3
+
+ movaps %xmm0, TEMP(0)
+ movaps %xmm1, TEMP(1)
+ movaps %xmm2, TEMP(2)
+ movaps %xmm3, TEMP(3)
+ movaps %xmm5, TEMP(5)
+ movaps %xmm7, TEMP(7)
+
+ movss TEMP_BYTE(12), %xmm0
+ movss TEMP_BYTE(28), %xmm1
+ movss TEMP_BYTE(44), %xmm2
+ movss TEMP_BYTE(60), %xmm3
+ addss TEMP_BYTE(8), %xmm0
+ addss TEMP_BYTE(24), %xmm1
+ addss TEMP_BYTE(40), %xmm2
+ addss TEMP_BYTE(56), %xmm3
+ movss %xmm0, TEMP_BYTE(8)
+ movss %xmm1, TEMP_BYTE(24)
+ movss %xmm2, TEMP_BYTE(40)
+ movss %xmm3, TEMP_BYTE(56)
+ movss TEMP_BYTE(76), %xmm0
+ movss TEMP_BYTE(92), %xmm1
+ movss TEMP_BYTE(108), %xmm2
+ movss TEMP_BYTE(124), %xmm3
+ addss TEMP_BYTE(72), %xmm0
+ addss TEMP_BYTE(88), %xmm1
+ addss TEMP_BYTE(104), %xmm2
+ addss TEMP_BYTE(120), %xmm3
+ movss %xmm0, TEMP_BYTE(72)
+ movss %xmm1, TEMP_BYTE(88)
+ movss %xmm2, TEMP_BYTE(104)
+ movss %xmm3, TEMP_BYTE(120)
+
+ movaps TEMP_BYTE(16), %xmm1
+ movaps TEMP_BYTE(48), %xmm3
+ movaps TEMP_BYTE(80), %xmm5
+ movaps TEMP_BYTE(112), %xmm7
+ movaps %xmm1, %xmm0
+ movaps %xmm3, %xmm2
+ movaps %xmm5, %xmm4
+ movaps %xmm7, %xmm6
+ shufps $0x1e, %xmm0, %xmm0
+ shufps $0x1e, %xmm2, %xmm2
+ shufps $0x1e, %xmm4, %xmm4
+ shufps $0x1e, %xmm6, %xmm6
+ leal LOCAL_VAR(mask), %ecx
+ andps (%ecx), %xmm0
+ andps (%ecx), %xmm2
+ andps (%ecx), %xmm4
+ andps (%ecx), %xmm6
+ addps %xmm0, %xmm1
+ addps %xmm2, %xmm3
+ addps %xmm4, %xmm5
+ addps %xmm6, %xmm7
+
+ movaps TEMP_BYTE(32), %xmm2
+ movaps TEMP_BYTE(96), %xmm6
+ movaps %xmm2, %xmm0
+ movaps %xmm6, %xmm4
+ shufps $0x1e, %xmm0, %xmm0
+ shufps $0x1e, %xmm4, %xmm4
+ andps (%ecx), %xmm0
+ andps (%ecx), %xmm4
+ addps %xmm3, %xmm2
+ addps %xmm0, %xmm3
+ addps %xmm7, %xmm6
+ addps %xmm4, %xmm7
+
+ movaps TEMP_BYTE(0), %xmm0
+ movaps TEMP_BYTE(64), %xmm4
+
+ cvtps2pi %xmm0, %mm0
+ cvtps2pi %xmm1, %mm1
+ movhlps %xmm0, %xmm0
+ movhlps %xmm1, %xmm1
+ cvtps2pi %xmm0, %mm2
+ cvtps2pi %xmm1, %mm3
+ packssdw %mm2, %mm0
+ packssdw %mm3, %mm1
+
+ cvtps2pi %xmm2, %mm2
+ cvtps2pi %xmm3, %mm3
+ movhlps %xmm2, %xmm2
+ movhlps %xmm3, %xmm3
+ cvtps2pi %xmm2, %mm4
+ cvtps2pi %xmm3, %mm5
+ packssdw %mm4, %mm2
+ packssdw %mm5, %mm3
+
+ mov %ecx, TEMP_BYTE(0)
+ movl ARG(0), %ecx
+ movl ARG(1), %ebx
+
+ movd %mm0, %eax
+ movd %mm1, %edx
+ movw %ax, 512(%ecx)
+ movw %dx, 384(%ecx)
+ shrl $16, %eax
+ shrl $16, %edx
+ movw %ax, (%ecx)
+ movw %ax, (%ebx)
+ movw %dx, 128(%ebx)
+
+ movd %mm2, %eax
+ movd %mm3, %edx
+ movw %ax, 448(%ecx)
+ movw %dx, 320(%ecx)
+ shrl $16, %eax
+ shrl $16, %edx
+ movw %ax, 64(%ebx)
+ movw %dx, 192(%ebx)
+
+ psrlq $32, %mm0
+ psrlq $32, %mm1
+ movd %mm0, %eax
+ movd %mm1, %edx
+ movw %ax, 256(%ecx)
+ movw %dx, 128(%ecx)
+ shrl $16, %eax
+ shrl $16, %edx
+ movw %ax, 256(%ebx)
+ movw %dx, 384(%ebx)
+
+ psrlq $32, %mm2
+ psrlq $32, %mm3
+ movd %mm2, %eax
+ movd %mm3, %edx
+ movw %ax, 192(%ecx)
+ movw %dx, 64(%ecx)
+ shrl $16, %eax
+ shrl $16, %edx
+ movw %ax, 320(%ebx)
+ movw %dx, 448(%ebx)
+
+ mov TEMP_BYTE(0), %eax
+ movaps %xmm4, %xmm0
+ shufps $0x1e, %xmm0, %xmm0
+ movaps %xmm5, %xmm1
+ andps (%eax), %xmm0
+
+ addps %xmm6, %xmm4
+ addps %xmm7, %xmm5
+ addps %xmm1, %xmm6
+ addps %xmm0, %xmm7
+
+ cvtps2pi %xmm4, %mm0
+ cvtps2pi %xmm5, %mm1
+ movhlps %xmm4, %xmm4
+ movhlps %xmm5, %xmm5
+ cvtps2pi %xmm4, %mm2
+ cvtps2pi %xmm5, %mm3
+ packssdw %mm2, %mm0
+ packssdw %mm3, %mm1
+
+ cvtps2pi %xmm6, %mm2
+ cvtps2pi %xmm7, %mm3
+ movhlps %xmm6, %xmm6
+ movhlps %xmm7, %xmm7
+ cvtps2pi %xmm6, %mm4
+ cvtps2pi %xmm7, %mm5
+ packssdw %mm4, %mm2
+ packssdw %mm5, %mm3
+
+ movd %mm0, %eax
+ movd %mm2, %edx
+ movw %ax, 480(%ecx)
+ movw %dx, 416(%ecx)
+ shrl $16, %eax
+ shrl $16, %edx
+ movw %ax, 32(%ebx)
+ movw %dx, 96(%ebx)
+
+ psrlq $32, %mm0
+ psrlq $32, %mm2
+ movd %mm0, %eax
+ movd %mm2, %edx
+ movw %ax, 224(%ecx)
+ movw %dx, 160(%ecx)
+ shrl $16, %eax
+ shrl $16, %edx
+ movw %ax, 288(%ebx)
+ movw %dx, 352(%ebx)
+
+ movd %mm1, %eax
+ movd %mm3, %edx
+ movw %ax, 352(%ecx)
+ movw %dx, 288(%ecx)
+ shrl $16, %eax
+ shrl $16, %edx
+ movw %ax, 160(%ebx)
+ movw %dx, 224(%ebx)
+
+ psrlq $32, %mm1
+ psrlq $32, %mm3
+ movd %mm1, %eax
+ movd %mm3, %edx
+ movw %ax, 96(%ecx)
+ movw %dx, 32(%ecx)
+ shrl $16, %eax
+ shrl $16, %edx
+ movw %ax, 416(%ebx)
+ movw %dx, 480(%ebx)
+
+ popl %ebx
+ movl %ebp, %esp
+ popl %ebp
+ ret
+
+#if defined(PIC) && defined(__APPLE__)
+ .section __IMPORT,__pointers,non_lazy_symbol_pointers
+L_costab_mmxsse:
+ .indirect_symbol ASM_NAME(costab_mmxsse)
+ .long 0
+#endif
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_sse_float.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_sse_float.S
new file mode 100644
index 00000000..544d2d6c
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_sse_float.S
@@ -0,0 +1,417 @@
+/*
+ dct64_sse_float: SSE optimized dct64 (float output version)
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#define ARG(n) (8+n*4)(%ebp)
+#define TEMP(n) (4+n*16)(%esp)
+#define TEMP_BYTE(n) (4+n)(%esp)
+
+/*
+ void dct64_real_sse(real *out0, real *out1, real *samples);
+*/
+
+#if !defined ( __APPLE__) && !defined (__OS2__)
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+pnpn:
+ .long 0
+ .long -2147483648
+ .long 0
+ .long -2147483648
+ ALIGN16
+mask:
+ .long -1
+ .long -1
+ .long -1
+ .long 0
+
+ .text
+ ALIGN16
+.globl ASM_NAME(dct64_real_sse)
+ASM_NAME(dct64_real_sse):
+ pushl %ebp
+ movl %esp, %ebp
+
+ andl $-16, %esp /* align the stack at 16 bytes */
+ subl $128, %esp /* reserve space for temporal store */
+ pushl %ebx
+
+ GET_GOT
+
+ movl ARG(2), %eax
+
+ MOVUAPS (%eax), %xmm7
+ MOVUAPS 16(%eax), %xmm6
+ MOVUAPS 112(%eax), %xmm0
+ MOVUAPS 96(%eax), %xmm1
+ shufps $0x1b, %xmm0, %xmm0
+ shufps $0x1b, %xmm1, %xmm1
+ movaps %xmm7, %xmm4
+ movaps %xmm6, %xmm5
+ addps %xmm0, %xmm4
+ addps %xmm1, %xmm5
+ subps %xmm0, %xmm7
+ subps %xmm1, %xmm6
+ movaps %xmm4, TEMP(0)
+ movaps %xmm5, TEMP(1)
+
+ MOVUAPS 32(%eax), %xmm2
+ MOVUAPS 48(%eax), %xmm3
+ MOVUAPS 80(%eax), %xmm0
+ MOVUAPS 64(%eax), %xmm1
+ shufps $0x1b, %xmm0, %xmm0
+ shufps $0x1b, %xmm1, %xmm1
+ movaps %xmm2, %xmm5
+ movaps %xmm3, %xmm4
+ addps %xmm0, %xmm2
+ addps %xmm1, %xmm3
+ subps %xmm0, %xmm5
+ subps %xmm1, %xmm4
+
+#if defined(PIC) && defined(__APPLE__)
+ mov GLOBAL_VAR_PTR(costab_mmxsse), %eax
+#else
+ lea GLOBAL_VAR(costab_mmxsse), %eax
+#endif
+ mulps (%eax), %xmm7
+ mulps 16(%eax), %xmm6
+ mulps 32(%eax), %xmm5
+ mulps 48(%eax), %xmm4
+
+ shufps $0x1b, %xmm2, %xmm2
+ shufps $0x1b, %xmm3, %xmm3
+ shufps $0x1b, %xmm4, %xmm4
+ shufps $0x1b, %xmm5, %xmm5
+ movaps TEMP(0), %xmm0
+ movaps TEMP(1), %xmm1
+ subps %xmm3, %xmm0
+ subps %xmm2, %xmm1
+ addps TEMP(0), %xmm3
+ addps TEMP(1), %xmm2
+ movaps %xmm3, TEMP(0)
+ movaps %xmm2, TEMP(1)
+ movaps %xmm6, %xmm2
+ movaps %xmm7, %xmm3
+ subps %xmm5, %xmm6
+ subps %xmm4, %xmm7
+ addps %xmm3, %xmm4
+ addps %xmm2, %xmm5
+ mulps 64(%eax), %xmm0
+ mulps 80(%eax), %xmm1
+ mulps 80(%eax), %xmm6
+ mulps 64(%eax), %xmm7
+
+ movaps TEMP(0), %xmm2
+ movaps TEMP(1), %xmm3
+ shufps $0x1b, %xmm3, %xmm3
+ shufps $0x1b, %xmm5, %xmm5
+ shufps $0x1b, %xmm1, %xmm1
+ shufps $0x1b, %xmm6, %xmm6
+ movaps %xmm0, TEMP(1)
+ subps %xmm3, %xmm2
+ subps %xmm1, %xmm0
+ addps TEMP(0), %xmm3
+ addps TEMP(1), %xmm1
+ movaps %xmm3, TEMP(0)
+ movaps %xmm1, TEMP(2)
+ movaps %xmm5, %xmm1
+ movaps %xmm4, %xmm5
+ movaps %xmm7, %xmm3
+ subps %xmm1, %xmm5
+ subps %xmm6, %xmm7
+ addps %xmm1, %xmm4
+ addps %xmm3, %xmm6
+ mulps 96(%eax), %xmm2
+ mulps 96(%eax), %xmm0
+ mulps 96(%eax), %xmm5
+ mulps 96(%eax), %xmm7
+ movaps %xmm2, TEMP(1)
+ movaps %xmm0, TEMP(3)
+
+ movaps %xmm4, %xmm2
+ movaps %xmm5, %xmm3
+ shufps $0x44, %xmm6, %xmm2
+ shufps $0xbb, %xmm7, %xmm5
+ shufps $0xbb, %xmm6, %xmm4
+ shufps $0x44, %xmm7, %xmm3
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ subps %xmm4, %xmm2
+ subps %xmm5, %xmm3
+ addps %xmm6, %xmm4
+ addps %xmm7, %xmm5
+ movaps 112(%eax), %xmm0
+ movlhps %xmm0, %xmm0
+ mulps %xmm0, %xmm2
+ mulps %xmm0, %xmm3
+ movaps %xmm0, TEMP(4)
+ movaps %xmm4, %xmm6
+ movaps %xmm5, %xmm7
+ shufps $0x14, %xmm2, %xmm4
+ shufps $0xbe, %xmm2, %xmm6
+ shufps $0x14, %xmm3, %xmm5
+ shufps $0xbe, %xmm3, %xmm7
+ movaps %xmm5, TEMP(5)
+ movaps %xmm7, TEMP(7)
+
+ movaps TEMP(0), %xmm0
+ movaps TEMP(1), %xmm1
+ movaps %xmm0, %xmm2
+ movaps %xmm1, %xmm3
+ shufps $0x44, TEMP(2), %xmm2
+ shufps $0xbb, TEMP(3), %xmm1
+ shufps $0xbb, TEMP(2), %xmm0
+ shufps $0x44, TEMP(3), %xmm3
+ movaps %xmm2, %xmm5
+ movaps %xmm3, %xmm7
+ subps %xmm0, %xmm2
+ subps %xmm1, %xmm3
+ addps %xmm5, %xmm0
+ addps %xmm7, %xmm1
+ mulps TEMP(4), %xmm2
+ mulps TEMP(4), %xmm3
+ movaps %xmm0, %xmm5
+ movaps %xmm1, %xmm7
+ shufps $0x14, %xmm2, %xmm0
+ shufps $0xbe, %xmm2, %xmm5
+ shufps $0x14, %xmm3, %xmm1
+ shufps $0xbe, %xmm3, %xmm7
+
+ movaps %xmm0, TEMP(0)
+ movaps %xmm1, TEMP(1)
+ movaps %xmm5, TEMP(2)
+ movaps %xmm7, TEMP(3)
+
+ movss 120(%eax), %xmm5
+ shufps $0x00, %xmm5, %xmm5
+ xorps LOCAL_VAR(pnpn), %xmm5
+
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps TEMP(5), %xmm4
+ unpckhps TEMP(5), %xmm0
+ unpcklps TEMP(7), %xmm6
+ unpckhps TEMP(7), %xmm1
+ movaps %xmm4, %xmm2
+ movaps %xmm6, %xmm3
+ unpcklps %xmm0, %xmm4
+ unpckhps %xmm0, %xmm2
+ unpcklps %xmm1, %xmm6
+ unpckhps %xmm1, %xmm3
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ subps %xmm2, %xmm0
+ subps %xmm3, %xmm1
+ addps %xmm2, %xmm4
+ addps %xmm3, %xmm6
+ mulps %xmm5, %xmm0
+ mulps %xmm5, %xmm1
+ movaps %xmm5, TEMP(5)
+ movaps %xmm4, %xmm5
+ movaps %xmm6, %xmm7
+ unpcklps %xmm0, %xmm4
+ unpckhps %xmm0, %xmm5
+ unpcklps %xmm1, %xmm6
+ unpckhps %xmm1, %xmm7
+
+ movaps TEMP(0), %xmm0
+ movaps TEMP(2), %xmm2
+ movaps %xmm4, TEMP(4)
+ movaps %xmm6, TEMP(6)
+
+ movaps %xmm0, %xmm4
+ movaps %xmm2, %xmm6
+ unpcklps TEMP(1), %xmm0
+ unpckhps TEMP(1), %xmm4
+ unpcklps TEMP(3), %xmm2
+ unpckhps TEMP(3), %xmm6
+ movaps %xmm0, %xmm1
+ movaps %xmm2, %xmm3
+ unpcklps %xmm4, %xmm0
+ unpckhps %xmm4, %xmm1
+ unpcklps %xmm6, %xmm2
+ unpckhps %xmm6, %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm2, %xmm6
+ subps %xmm1, %xmm4
+ subps %xmm3, %xmm6
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ mulps TEMP(5), %xmm4
+ mulps TEMP(5), %xmm6
+ movaps %xmm0, %xmm1
+ movaps %xmm2, %xmm3
+ unpcklps %xmm4, %xmm0
+ unpckhps %xmm4, %xmm1
+ unpcklps %xmm6, %xmm2
+ unpckhps %xmm6, %xmm3
+
+ movaps %xmm0, TEMP(0)
+ movaps %xmm1, TEMP(1)
+ movaps %xmm2, TEMP(2)
+ movaps %xmm3, TEMP(3)
+ movaps %xmm5, TEMP(5)
+ movaps %xmm7, TEMP(7)
+
+ movss TEMP_BYTE(12), %xmm0
+ movss TEMP_BYTE(28), %xmm1
+ movss TEMP_BYTE(44), %xmm2
+ movss TEMP_BYTE(60), %xmm3
+ addss TEMP_BYTE(8), %xmm0
+ addss TEMP_BYTE(24), %xmm1
+ addss TEMP_BYTE(40), %xmm2
+ addss TEMP_BYTE(56), %xmm3
+ movss %xmm0, TEMP_BYTE(8)
+ movss %xmm1, TEMP_BYTE(24)
+ movss %xmm2, TEMP_BYTE(40)
+ movss %xmm3, TEMP_BYTE(56)
+ movss TEMP_BYTE(76), %xmm0
+ movss TEMP_BYTE(92), %xmm1
+ movss TEMP_BYTE(108), %xmm2
+ movss TEMP_BYTE(124), %xmm3
+ addss TEMP_BYTE(72), %xmm0
+ addss TEMP_BYTE(88), %xmm1
+ addss TEMP_BYTE(104), %xmm2
+ addss TEMP_BYTE(120), %xmm3
+ movss %xmm0, TEMP_BYTE(72)
+ movss %xmm1, TEMP_BYTE(88)
+ movss %xmm2, TEMP_BYTE(104)
+ movss %xmm3, TEMP_BYTE(120)
+
+ movaps TEMP_BYTE(16), %xmm1
+ movaps TEMP_BYTE(48), %xmm3
+ movaps TEMP_BYTE(80), %xmm5
+ movaps TEMP_BYTE(112), %xmm7
+ movaps %xmm1, %xmm0
+ movaps %xmm3, %xmm2
+ movaps %xmm5, %xmm4
+ movaps %xmm7, %xmm6
+ shufps $0x1e, %xmm0, %xmm0
+ shufps $0x1e, %xmm2, %xmm2
+ shufps $0x1e, %xmm4, %xmm4
+ shufps $0x1e, %xmm6, %xmm6
+ lea LOCAL_VAR(mask), %eax
+ andps (%eax), %xmm0
+ andps (%eax), %xmm2
+ andps (%eax), %xmm4
+ andps (%eax), %xmm6
+ addps %xmm0, %xmm1
+ addps %xmm2, %xmm3
+ addps %xmm4, %xmm5
+ addps %xmm6, %xmm7
+
+ movaps TEMP_BYTE(32), %xmm2
+ movaps TEMP_BYTE(96), %xmm6
+ movaps %xmm2, %xmm0
+ movaps %xmm6, %xmm4
+ shufps $0x1e, %xmm0, %xmm0
+ shufps $0x1e, %xmm4, %xmm4
+ andps (%eax), %xmm0
+ andps (%eax), %xmm4
+ addps %xmm3, %xmm2
+ addps %xmm0, %xmm3
+ addps %xmm7, %xmm6
+ addps %xmm4, %xmm7
+
+ movaps TEMP_BYTE(0), %xmm0
+ movaps TEMP_BYTE(64), %xmm4
+
+ movl ARG(0), %ecx
+ movl ARG(1), %ebx
+
+ movss %xmm0, 1024(%ecx)
+ movss %xmm2, 896(%ecx)
+ movss %xmm1, 768(%ecx)
+ movss %xmm3, 640(%ecx)
+
+ shufps $0xe1, %xmm0, %xmm0
+ shufps $0xe1, %xmm2, %xmm2
+ shufps $0xe1, %xmm1, %xmm1
+ shufps $0xe1, %xmm3, %xmm3
+ movss %xmm0, (%ecx)
+ movss %xmm0, (%ebx)
+ movss %xmm2, 128(%ebx)
+ movss %xmm1, 256(%ebx)
+ movss %xmm3, 384(%ebx)
+
+ movhlps %xmm0, %xmm0
+ movhlps %xmm2, %xmm2
+ movhlps %xmm1, %xmm1
+ movhlps %xmm3, %xmm3
+ movss %xmm0, 512(%ecx)
+ movss %xmm2, 384(%ecx)
+ movss %xmm1, 256(%ecx)
+ movss %xmm3, 128(%ecx)
+
+ shufps $0xe1, %xmm0, %xmm0
+ shufps $0xe1, %xmm2, %xmm2
+ shufps $0xe1, %xmm1, %xmm1
+ shufps $0xe1, %xmm3, %xmm3
+ movss %xmm0, 512(%ebx)
+ movss %xmm2, 640(%ebx)
+ movss %xmm1, 768(%ebx)
+ movss %xmm3, 896(%ebx)
+
+ movaps %xmm4, %xmm0
+ shufps $0x1e, %xmm0, %xmm0
+ movaps %xmm5, %xmm1
+ andps (%eax), %xmm0
+
+ addps %xmm6, %xmm4
+ addps %xmm7, %xmm5
+ addps %xmm1, %xmm6
+ addps %xmm0, %xmm7
+
+ movss %xmm4, 960(%ecx)
+ movss %xmm6, 832(%ecx)
+ movss %xmm5, 704(%ecx)
+ movss %xmm7, 576(%ecx)
+ movhlps %xmm4, %xmm0
+ movhlps %xmm6, %xmm1
+ movhlps %xmm5, %xmm2
+ movhlps %xmm7, %xmm3
+ movss %xmm0, 448(%ecx)
+ movss %xmm1, 320(%ecx)
+ movss %xmm2, 192(%ecx)
+ movss %xmm3, 64(%ecx)
+
+ shufps $0xe1, %xmm4, %xmm4
+ shufps $0xe1, %xmm6, %xmm6
+ shufps $0xe1, %xmm5, %xmm5
+ shufps $0xe1, %xmm7, %xmm7
+ movss %xmm4, 64(%ebx)
+ movss %xmm6, 192(%ebx)
+ movss %xmm5, 320(%ebx)
+ movss %xmm7, 448(%ebx)
+
+ shufps $0xe1, %xmm0, %xmm0
+ shufps $0xe1, %xmm1, %xmm1
+ shufps $0xe1, %xmm2, %xmm2
+ shufps $0xe1, %xmm3, %xmm3
+ movss %xmm0, 576(%ebx)
+ movss %xmm1, 704(%ebx)
+ movss %xmm2, 832(%ebx)
+ movss %xmm3, 960(%ebx)
+
+ popl %ebx
+ movl %ebp, %esp
+ popl %ebp
+ ret
+
+#if defined(PIC) && defined(__APPLE__)
+ .section __IMPORT,__pointers,non_lazy_symbol_pointers
+L_costab_mmxsse:
+ .indirect_symbol ASM_NAME(costab_mmxsse)
+ .long 0
+#endif
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_x86_64.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_x86_64.S
new file mode 100644
index 00000000..9d858623
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_x86_64.S
@@ -0,0 +1,464 @@
+/*
+ dct64_x86_64: SSE optimized dct64 for x86-64
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifdef IS_MSABI
+/* short *out0 */
+#define ARG0 %r9
+/* short *out1 */
+#define ARG1 %rdx
+/* real *samples */
+#define ARG2 %r8
+#else
+/* short *out0 */
+#define ARG0 %rdi
+/* short *out1 */
+#define ARG1 %rsi
+/* real *samples */
+#define ARG2 %rdx
+#endif
+
+/*
+ void dct64_x86_64(short *out0, short *out1, real *samples);
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+ASM_NAME(costab_x86_64):
+ .long 1056974725
+ .long 1057056395
+ .long 1057223771
+ .long 1057485416
+ .long 1057855544
+ .long 1058356026
+ .long 1059019886
+ .long 1059897405
+ .long 1061067246
+ .long 1062657950
+ .long 1064892987
+ .long 1066774581
+ .long 1069414683
+ .long 1073984175
+ .long 1079645762
+ .long 1092815430
+ .long 1057005197
+ .long 1057342072
+ .long 1058087743
+ .long 1059427869
+ .long 1061799040
+ .long 1065862217
+ .long 1071413542
+ .long 1084439708
+ .long 1057128951
+ .long 1058664893
+ .long 1063675095
+ .long 1076102863
+ .long 1057655764
+ .long 1067924853
+ .long 1060439283
+ .long 0
+ .text
+ ALIGN16
+.globl ASM_NAME(dct64_x86_64)
+ASM_NAME(dct64_x86_64):
+#ifdef IS_MSABI /* should save xmm6-15 */
+ movq %rcx, ARG0
+ subq $168, %rsp /* stack alignment + 10 xmm registers */
+ movaps %xmm6, (%rsp)
+ movaps %xmm7, 16(%rsp)
+ movaps %xmm8, 32(%rsp)
+ movaps %xmm9, 48(%rsp)
+ movaps %xmm10, 64(%rsp)
+ movaps %xmm11, 80(%rsp)
+ movaps %xmm12, 96(%rsp)
+ movaps %xmm13, 112(%rsp)
+ movaps %xmm14, 128(%rsp)
+ movaps %xmm15, 144(%rsp)
+#endif
+
+ leaq ASM_NAME(costab_x86_64)(%rip), %rcx
+
+ MOVUAPS (ARG2), %xmm15
+ MOVUAPS 16(ARG2), %xmm14
+ MOVUAPS 112(ARG2), %xmm0
+ MOVUAPS 96(ARG2), %xmm1
+ shufps $0x1b, %xmm0, %xmm0
+ shufps $0x1b, %xmm1, %xmm1
+ movaps %xmm15, %xmm8
+ movaps %xmm14, %xmm9
+ addps %xmm0, %xmm8
+ addps %xmm1, %xmm9
+ subps %xmm0, %xmm15
+ subps %xmm1, %xmm14
+
+ MOVUAPS 32(ARG2), %xmm13
+ MOVUAPS 48(ARG2), %xmm12
+ MOVUAPS 80(ARG2), %xmm0
+ MOVUAPS 64(ARG2), %xmm1
+ shufps $0x1b, %xmm0, %xmm0
+ shufps $0x1b, %xmm1, %xmm1
+ movaps %xmm13, %xmm10
+ movaps %xmm12, %xmm11
+ addps %xmm0, %xmm10
+ addps %xmm1, %xmm11
+ subps %xmm0, %xmm13
+ subps %xmm1, %xmm12
+
+ movaps (%rcx), %xmm0
+ movaps 16(%rcx), %xmm1
+ movaps 32(%rcx), %xmm2
+ movaps 48(%rcx), %xmm3
+ mulps %xmm0, %xmm15
+ mulps %xmm1, %xmm14
+ mulps %xmm2, %xmm13
+ mulps %xmm3, %xmm12
+
+ movaps 64(%rcx), %xmm0
+ movaps 80(%rcx), %xmm1
+
+ pshufd $0x1b, %xmm11, %xmm2
+ pshufd $0x1b, %xmm10, %xmm3
+ shufps $0x1b, %xmm13, %xmm13
+ shufps $0x1b, %xmm12, %xmm12
+ movaps %xmm8, %xmm11
+ movaps %xmm9, %xmm10
+ movaps %xmm14, %xmm4
+ movaps %xmm15, %xmm5
+ subps %xmm2, %xmm11
+ subps %xmm3, %xmm10
+ subps %xmm13, %xmm14
+ subps %xmm12, %xmm15
+ addps %xmm2, %xmm8
+ addps %xmm3, %xmm9
+ addps %xmm5, %xmm12
+ addps %xmm4, %xmm13
+ mulps %xmm0, %xmm11
+ mulps %xmm1, %xmm10
+ mulps %xmm1, %xmm14
+ mulps %xmm0, %xmm15
+
+ movaps 96(%rcx), %xmm0
+
+ pshufd $0x1b, %xmm9, %xmm1
+ pshufd $0x1b, %xmm13, %xmm2
+ shufps $0x1b, %xmm10, %xmm10
+ shufps $0x1b, %xmm14, %xmm14
+ movaps %xmm8, %xmm9
+ movaps %xmm12, %xmm13
+ movaps %xmm11, %xmm3
+ movaps %xmm15, %xmm4
+ subps %xmm1, %xmm9
+ subps %xmm2, %xmm13
+ subps %xmm10, %xmm11
+ subps %xmm14, %xmm15
+ addps %xmm1, %xmm8
+ addps %xmm2, %xmm12
+ addps %xmm3, %xmm10
+ addps %xmm4, %xmm14
+ mulps %xmm0, %xmm9
+ mulps %xmm0, %xmm13
+ mulps %xmm0, %xmm11
+ mulps %xmm0, %xmm15
+
+ movaps 112(%rcx), %xmm0
+ movaps %xmm0, %xmm1
+ movlhps %xmm1, %xmm1
+
+ movaps %xmm8, %xmm2
+ movaps %xmm9, %xmm3
+ shufps $0x44, %xmm10, %xmm2
+ shufps $0xbb, %xmm11, %xmm9
+ shufps $0xbb, %xmm10, %xmm8
+ shufps $0x44, %xmm11, %xmm3
+ movaps %xmm2, %xmm4
+ movaps %xmm3, %xmm5
+ subps %xmm8, %xmm2
+ subps %xmm9, %xmm3
+ addps %xmm4, %xmm8
+ addps %xmm5, %xmm9
+ mulps %xmm1, %xmm2
+ mulps %xmm1, %xmm3
+ movaps %xmm8, %xmm10
+ movaps %xmm9, %xmm11
+ shufps $0x14, %xmm2, %xmm8
+ shufps $0xbe, %xmm2, %xmm10
+ shufps $0x14, %xmm3, %xmm9
+ shufps $0xbe, %xmm3, %xmm11
+
+ movaps %xmm12, %xmm2
+ movaps %xmm13, %xmm3
+ shufps $0x44, %xmm14, %xmm2
+ shufps $0xbb, %xmm15, %xmm13
+ shufps $0xbb, %xmm14, %xmm12
+ shufps $0x44, %xmm15, %xmm3
+ movaps %xmm2, %xmm4
+ movaps %xmm3, %xmm5
+ subps %xmm12, %xmm2
+ subps %xmm13, %xmm3
+ addps %xmm4, %xmm12
+ addps %xmm5, %xmm13
+ mulps %xmm1, %xmm2
+ mulps %xmm1, %xmm3
+ movaps %xmm12, %xmm14
+ movaps %xmm13, %xmm15
+ shufps $0x14, %xmm2, %xmm12
+ shufps $0xbe, %xmm2, %xmm14
+ shufps $0x14, %xmm3, %xmm13
+ shufps $0xbe, %xmm3, %xmm15
+
+ shufps $0xaa, %xmm0, %xmm0
+ pcmpeqd %xmm1, %xmm1
+ pslld $31, %xmm1
+ psllq $32, %xmm1
+ xorps %xmm1, %xmm0
+
+ movaps %xmm8, %xmm1
+ movaps %xmm10, %xmm2
+ unpcklps %xmm9, %xmm8
+ unpckhps %xmm9, %xmm1
+ unpcklps %xmm11, %xmm10
+ unpckhps %xmm11, %xmm2
+ movaps %xmm8, %xmm3
+ movaps %xmm10, %xmm4
+ unpcklps %xmm1, %xmm8
+ unpckhps %xmm1, %xmm3
+ unpcklps %xmm2, %xmm10
+ unpckhps %xmm2, %xmm4
+ movaps %xmm8, %xmm1
+ movaps %xmm10, %xmm2
+ subps %xmm3, %xmm1
+ subps %xmm4, %xmm2
+ addps %xmm3, %xmm8
+ addps %xmm4, %xmm10
+ mulps %xmm0, %xmm1
+ mulps %xmm0, %xmm2
+ movaps %xmm8, %xmm9
+ movaps %xmm10, %xmm11
+ unpcklps %xmm1, %xmm8
+ unpckhps %xmm1, %xmm9
+ unpcklps %xmm2, %xmm10
+ unpckhps %xmm2, %xmm11
+
+ movaps %xmm12, %xmm1
+ movaps %xmm14, %xmm2
+ unpcklps %xmm13, %xmm12
+ unpckhps %xmm13, %xmm1
+ unpcklps %xmm15, %xmm14
+ unpckhps %xmm15, %xmm2
+ movaps %xmm12, %xmm3
+ movaps %xmm14, %xmm4
+ unpcklps %xmm1, %xmm12
+ unpckhps %xmm1, %xmm3
+ unpcklps %xmm2, %xmm14
+ unpckhps %xmm2, %xmm4
+ movaps %xmm12, %xmm1
+ movaps %xmm14, %xmm2
+ subps %xmm3, %xmm1
+ subps %xmm4, %xmm2
+ addps %xmm3, %xmm12
+ addps %xmm4, %xmm14
+ mulps %xmm0, %xmm1
+ mulps %xmm0, %xmm2
+ movaps %xmm12, %xmm13
+ movaps %xmm14, %xmm15
+ unpcklps %xmm1, %xmm12
+ unpckhps %xmm1, %xmm13
+ unpcklps %xmm2, %xmm14
+ unpckhps %xmm2, %xmm15
+
+
+ xorps %xmm0, %xmm0
+ xorps %xmm1, %xmm1
+ shufpd $0x2, %xmm8, %xmm0
+ shufpd $0x2, %xmm9, %xmm1
+ psrlq $32, %xmm0
+ psrlq $32, %xmm1
+ addps %xmm0, %xmm8
+ addps %xmm1, %xmm9
+
+ xorps %xmm0, %xmm0
+ xorps %xmm1, %xmm1
+ shufpd $0x2, %xmm10, %xmm0
+ shufpd $0x2, %xmm11, %xmm1
+ psrlq $32, %xmm0
+ psrlq $32, %xmm1
+ addps %xmm0, %xmm10
+ addps %xmm1, %xmm11
+
+ xorps %xmm0, %xmm0
+ xorps %xmm1, %xmm1
+ shufpd $0x2, %xmm12, %xmm0
+ shufpd $0x2, %xmm13, %xmm1
+ psrlq $32, %xmm0
+ psrlq $32, %xmm1
+ addps %xmm0, %xmm12
+ addps %xmm1, %xmm13
+
+ xorps %xmm0, %xmm0
+ xorps %xmm1, %xmm1
+ shufpd $0x2, %xmm14, %xmm0
+ shufpd $0x2, %xmm15, %xmm1
+ psrlq $32, %xmm0
+ psrlq $32, %xmm1
+ addps %xmm0, %xmm14
+ addps %xmm1, %xmm15
+
+ pshufd $0x78, %xmm9, %xmm0
+ pshufd $0x78, %xmm11, %xmm1
+ pshufd $0x78, %xmm13, %xmm2
+ pshufd $0x78, %xmm15, %xmm3
+ psrldq $4, %xmm0
+ psrldq $4, %xmm1
+ psrldq $4, %xmm2
+ psrldq $4, %xmm3
+ addps %xmm0, %xmm9
+ addps %xmm1, %xmm11
+ addps %xmm2, %xmm13
+ addps %xmm3, %xmm15
+
+ pshufd $0x78, %xmm10, %xmm0
+ pshufd $0x78, %xmm14, %xmm1
+ psrldq $4, %xmm0
+ psrldq $4, %xmm1
+ addps %xmm11, %xmm10
+ addps %xmm15, %xmm14
+ addps %xmm0, %xmm11
+ addps %xmm1, %xmm15
+
+ cvtps2dq %xmm8, %xmm8
+ cvtps2dq %xmm9, %xmm9
+ cvtps2dq %xmm10, %xmm10
+ cvtps2dq %xmm11, %xmm11
+ packssdw %xmm10, %xmm8
+ packssdw %xmm11, %xmm9
+
+ movd %xmm8, %eax
+ movd %xmm9, %ecx
+ movw %ax, 512(ARG0)
+ movw %cx, 384(ARG0)
+ shrl $16, %eax
+ shrl $16, %ecx
+ movw %ax, (ARG0)
+ movw %ax, (ARG1)
+ movw %cx, 128(ARG1)
+
+ movhlps %xmm8, %xmm0
+ movhlps %xmm9, %xmm1
+ movd %xmm0, %eax
+ movd %xmm1, %ecx
+ movw %ax, 448(ARG0)
+ movw %cx, 320(ARG0)
+ shrl $16, %eax
+ shrl $16, %ecx
+ movw %ax, 64(ARG1)
+ movw %cx, 192(ARG1)
+
+ pshuflw $0xee, %xmm8, %xmm2
+ pshuflw $0xee, %xmm9, %xmm3
+ movd %xmm2, %eax
+ movd %xmm3, %ecx
+ movw %ax, 256(ARG0)
+ movw %cx, 128(ARG0)
+ shrl $16, %eax
+ shrl $16, %ecx
+ movw %ax, 256(ARG1)
+ movw %cx, 384(ARG1)
+
+ pshuflw $0xee, %xmm0, %xmm0
+ pshuflw $0xee, %xmm1, %xmm1
+ movd %xmm0, %eax
+ movd %xmm1, %ecx
+ movw %ax, 192(ARG0)
+ movw %cx, 64(ARG0)
+ shrl $16, %eax
+ shrl $16, %ecx
+ movw %ax, 320(ARG1)
+ movw %cx, 448(ARG1)
+
+ movaps %xmm12, %xmm0
+ movaps %xmm13, %xmm1
+ movaps %xmm14, %xmm2
+ movaps %xmm15, %xmm3
+ shufps $0x1e, %xmm0, %xmm0
+ pslldq $4, %xmm0
+ psrldq $4, %xmm0
+ addps %xmm2, %xmm12
+ addps %xmm3, %xmm13
+ addps %xmm1, %xmm14
+ addps %xmm0, %xmm15
+
+ cvtps2dq %xmm12, %xmm12
+ cvtps2dq %xmm13, %xmm13
+ cvtps2dq %xmm14, %xmm14
+ cvtps2dq %xmm15, %xmm15
+ packssdw %xmm13, %xmm12
+ packssdw %xmm15, %xmm14
+
+ movd %xmm12, %eax
+ movd %xmm14, %ecx
+ movw %ax, 480(ARG0)
+ movw %cx, 416(ARG0)
+ shrl $16, %eax
+ shrl $16, %ecx
+ movw %ax, 32(ARG1)
+ movw %cx, 96(ARG1)
+
+ pshuflw $0xee, %xmm12, %xmm0
+ pshuflw $0xee, %xmm14, %xmm1
+ movd %xmm0, %eax
+ movd %xmm1, %ecx
+ movw %ax, 224(ARG0)
+ movw %cx, 160(ARG0)
+ shrl $16, %eax
+ shrl $16, %ecx
+ movw %ax, 288(ARG1)
+ movw %cx, 352(ARG1)
+
+ movhlps %xmm12, %xmm0
+ movhlps %xmm14, %xmm1
+ movd %xmm0, %eax
+ movd %xmm1, %ecx
+ movw %ax, 352(ARG0)
+ movw %cx, 288(ARG0)
+ shrl $16, %eax
+ shrl $16, %ecx
+ movw %ax, 160(ARG1)
+ movw %cx, 224(ARG1)
+
+ pshuflw $0xee, %xmm0, %xmm0
+ pshuflw $0xee, %xmm1, %xmm1
+ movd %xmm0, %eax
+ movd %xmm1, %ecx
+ movw %ax, 96(ARG0)
+ movw %cx, 32(ARG0)
+ shrl $16, %eax
+ shrl $16, %ecx
+ movw %ax, 416(ARG1)
+ movw %cx, 480(ARG1)
+
+#ifdef IS_MSABI
+ movaps (%rsp), %xmm6
+ movaps 16(%rsp), %xmm7
+ movaps 32(%rsp), %xmm8
+ movaps 48(%rsp), %xmm9
+ movaps 64(%rsp), %xmm10
+ movaps 80(%rsp), %xmm11
+ movaps 96(%rsp), %xmm12
+ movaps 112(%rsp), %xmm13
+ movaps 128(%rsp), %xmm14
+ movaps 144(%rsp), %xmm15
+ addq $168, %rsp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_x86_64_float.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_x86_64_float.S
new file mode 100644
index 00000000..5197e4c0
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dct64_x86_64_float.S
@@ -0,0 +1,426 @@
+/*
+ dct64_x86_64_float: SSE optimized dct64 for x86-64 (float output version)
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifdef IS_MSABI
+/* short *out0 */
+#define ARG0 %r9
+/* short *out1 */
+#define ARG1 %rdx
+/* real *samples */
+#define ARG2 %r8
+#else
+/* real *out0 */
+#define ARG0 %rdi
+/* real *out1 */
+#define ARG1 %rsi
+/* real *samples */
+#define ARG2 %rdx
+#endif
+
+/*
+ void dct64_real_x86_64(real *out0, real *out1, real *samples);
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+ASM_NAME(costab_x86_64):
+ .long 1056974725
+ .long 1057056395
+ .long 1057223771
+ .long 1057485416
+ .long 1057855544
+ .long 1058356026
+ .long 1059019886
+ .long 1059897405
+ .long 1061067246
+ .long 1062657950
+ .long 1064892987
+ .long 1066774581
+ .long 1069414683
+ .long 1073984175
+ .long 1079645762
+ .long 1092815430
+ .long 1057005197
+ .long 1057342072
+ .long 1058087743
+ .long 1059427869
+ .long 1061799040
+ .long 1065862217
+ .long 1071413542
+ .long 1084439708
+ .long 1057128951
+ .long 1058664893
+ .long 1063675095
+ .long 1076102863
+ .long 1057655764
+ .long 1067924853
+ .long 1060439283
+ .long 0
+ .text
+ ALIGN16
+.globl ASM_NAME(dct64_real_x86_64)
+ASM_NAME(dct64_real_x86_64):
+#ifdef IS_MSABI /* should save xmm6-15 */
+ movq %rcx, ARG0
+ subq $168, %rsp /* stack alignment + 10 xmm registers */
+ movaps %xmm6, (%rsp)
+ movaps %xmm7, 16(%rsp)
+ movaps %xmm8, 32(%rsp)
+ movaps %xmm9, 48(%rsp)
+ movaps %xmm10, 64(%rsp)
+ movaps %xmm11, 80(%rsp)
+ movaps %xmm12, 96(%rsp)
+ movaps %xmm13, 112(%rsp)
+ movaps %xmm14, 128(%rsp)
+ movaps %xmm15, 144(%rsp)
+#endif
+
+ leaq ASM_NAME(costab_x86_64)(%rip), %rcx
+
+ MOVUAPS (ARG2), %xmm15
+ MOVUAPS 16(ARG2), %xmm14
+ MOVUAPS 112(ARG2), %xmm0
+ MOVUAPS 96(ARG2), %xmm1
+ shufps $0x1b, %xmm0, %xmm0
+ shufps $0x1b, %xmm1, %xmm1
+ movaps %xmm15, %xmm8
+ movaps %xmm14, %xmm9
+ addps %xmm0, %xmm8
+ addps %xmm1, %xmm9
+ subps %xmm0, %xmm15
+ subps %xmm1, %xmm14
+
+ MOVUAPS 32(ARG2), %xmm13
+ MOVUAPS 48(ARG2), %xmm12
+ MOVUAPS 80(ARG2), %xmm0
+ MOVUAPS 64(ARG2), %xmm1
+ shufps $0x1b, %xmm0, %xmm0
+ shufps $0x1b, %xmm1, %xmm1
+ movaps %xmm13, %xmm10
+ movaps %xmm12, %xmm11
+ addps %xmm0, %xmm10
+ addps %xmm1, %xmm11
+ subps %xmm0, %xmm13
+ subps %xmm1, %xmm12
+
+ movaps (%rcx), %xmm0
+ movaps 16(%rcx), %xmm1
+ movaps 32(%rcx), %xmm2
+ movaps 48(%rcx), %xmm3
+ mulps %xmm0, %xmm15
+ mulps %xmm1, %xmm14
+ mulps %xmm2, %xmm13
+ mulps %xmm3, %xmm12
+
+ movaps 64(%rcx), %xmm0
+ movaps 80(%rcx), %xmm1
+
+ pshufd $0x1b, %xmm11, %xmm2
+ pshufd $0x1b, %xmm10, %xmm3
+ shufps $0x1b, %xmm13, %xmm13
+ shufps $0x1b, %xmm12, %xmm12
+ movaps %xmm8, %xmm11
+ movaps %xmm9, %xmm10
+ movaps %xmm14, %xmm4
+ movaps %xmm15, %xmm5
+ subps %xmm2, %xmm11
+ subps %xmm3, %xmm10
+ subps %xmm13, %xmm14
+ subps %xmm12, %xmm15
+ addps %xmm2, %xmm8
+ addps %xmm3, %xmm9
+ addps %xmm5, %xmm12
+ addps %xmm4, %xmm13
+ mulps %xmm0, %xmm11
+ mulps %xmm1, %xmm10
+ mulps %xmm1, %xmm14
+ mulps %xmm0, %xmm15
+
+ movaps 96(%rcx), %xmm0
+
+ pshufd $0x1b, %xmm9, %xmm1
+ pshufd $0x1b, %xmm13, %xmm2
+ shufps $0x1b, %xmm10, %xmm10
+ shufps $0x1b, %xmm14, %xmm14
+ movaps %xmm8, %xmm9
+ movaps %xmm12, %xmm13
+ movaps %xmm11, %xmm3
+ movaps %xmm15, %xmm4
+ subps %xmm1, %xmm9
+ subps %xmm2, %xmm13
+ subps %xmm10, %xmm11
+ subps %xmm14, %xmm15
+ addps %xmm1, %xmm8
+ addps %xmm2, %xmm12
+ addps %xmm3, %xmm10
+ addps %xmm4, %xmm14
+ mulps %xmm0, %xmm9
+ mulps %xmm0, %xmm13
+ mulps %xmm0, %xmm11
+ mulps %xmm0, %xmm15
+
+ movaps 112(%rcx), %xmm0
+ movaps %xmm0, %xmm1
+ movlhps %xmm1, %xmm1
+
+ movaps %xmm8, %xmm2
+ movaps %xmm9, %xmm3
+ shufps $0x44, %xmm10, %xmm2
+ shufps $0xbb, %xmm11, %xmm9
+ shufps $0xbb, %xmm10, %xmm8
+ shufps $0x44, %xmm11, %xmm3
+ movaps %xmm2, %xmm4
+ movaps %xmm3, %xmm5
+ subps %xmm8, %xmm2
+ subps %xmm9, %xmm3
+ addps %xmm4, %xmm8
+ addps %xmm5, %xmm9
+ mulps %xmm1, %xmm2
+ mulps %xmm1, %xmm3
+ movaps %xmm8, %xmm10
+ movaps %xmm9, %xmm11
+ shufps $0x14, %xmm2, %xmm8
+ shufps $0xbe, %xmm2, %xmm10
+ shufps $0x14, %xmm3, %xmm9
+ shufps $0xbe, %xmm3, %xmm11
+
+ movaps %xmm12, %xmm2
+ movaps %xmm13, %xmm3
+ shufps $0x44, %xmm14, %xmm2
+ shufps $0xbb, %xmm15, %xmm13
+ shufps $0xbb, %xmm14, %xmm12
+ shufps $0x44, %xmm15, %xmm3
+ movaps %xmm2, %xmm4
+ movaps %xmm3, %xmm5
+ subps %xmm12, %xmm2
+ subps %xmm13, %xmm3
+ addps %xmm4, %xmm12
+ addps %xmm5, %xmm13
+ mulps %xmm1, %xmm2
+ mulps %xmm1, %xmm3
+ movaps %xmm12, %xmm14
+ movaps %xmm13, %xmm15
+ shufps $0x14, %xmm2, %xmm12
+ shufps $0xbe, %xmm2, %xmm14
+ shufps $0x14, %xmm3, %xmm13
+ shufps $0xbe, %xmm3, %xmm15
+
+ shufps $0xaa, %xmm0, %xmm0
+ pcmpeqd %xmm1, %xmm1
+ pslld $31, %xmm1
+ psllq $32, %xmm1
+ xorps %xmm1, %xmm0
+
+ movaps %xmm8, %xmm1
+ movaps %xmm10, %xmm2
+ unpcklps %xmm9, %xmm8
+ unpckhps %xmm9, %xmm1
+ unpcklps %xmm11, %xmm10
+ unpckhps %xmm11, %xmm2
+ movaps %xmm8, %xmm3
+ movaps %xmm10, %xmm4
+ unpcklps %xmm1, %xmm8
+ unpckhps %xmm1, %xmm3
+ unpcklps %xmm2, %xmm10
+ unpckhps %xmm2, %xmm4
+ movaps %xmm8, %xmm1
+ movaps %xmm10, %xmm2
+ subps %xmm3, %xmm1
+ subps %xmm4, %xmm2
+ addps %xmm3, %xmm8
+ addps %xmm4, %xmm10
+ mulps %xmm0, %xmm1
+ mulps %xmm0, %xmm2
+ movaps %xmm8, %xmm9
+ movaps %xmm10, %xmm11
+ unpcklps %xmm1, %xmm8
+ unpckhps %xmm1, %xmm9
+ unpcklps %xmm2, %xmm10
+ unpckhps %xmm2, %xmm11
+
+ movaps %xmm12, %xmm1
+ movaps %xmm14, %xmm2
+ unpcklps %xmm13, %xmm12
+ unpckhps %xmm13, %xmm1
+ unpcklps %xmm15, %xmm14
+ unpckhps %xmm15, %xmm2
+ movaps %xmm12, %xmm3
+ movaps %xmm14, %xmm4
+ unpcklps %xmm1, %xmm12
+ unpckhps %xmm1, %xmm3
+ unpcklps %xmm2, %xmm14
+ unpckhps %xmm2, %xmm4
+ movaps %xmm12, %xmm1
+ movaps %xmm14, %xmm2
+ subps %xmm3, %xmm1
+ subps %xmm4, %xmm2
+ addps %xmm3, %xmm12
+ addps %xmm4, %xmm14
+ mulps %xmm0, %xmm1
+ mulps %xmm0, %xmm2
+ movaps %xmm12, %xmm13
+ movaps %xmm14, %xmm15
+ unpcklps %xmm1, %xmm12
+ unpckhps %xmm1, %xmm13
+ unpcklps %xmm2, %xmm14
+ unpckhps %xmm2, %xmm15
+
+
+ xorps %xmm0, %xmm0
+ xorps %xmm1, %xmm1
+ shufpd $0x2, %xmm8, %xmm0
+ shufpd $0x2, %xmm9, %xmm1
+ psrlq $32, %xmm0
+ psrlq $32, %xmm1
+ addps %xmm0, %xmm8
+ addps %xmm1, %xmm9
+
+ xorps %xmm0, %xmm0
+ xorps %xmm1, %xmm1
+ shufpd $0x2, %xmm10, %xmm0
+ shufpd $0x2, %xmm11, %xmm1
+ psrlq $32, %xmm0
+ psrlq $32, %xmm1
+ addps %xmm0, %xmm10
+ addps %xmm1, %xmm11
+
+ xorps %xmm0, %xmm0
+ xorps %xmm1, %xmm1
+ shufpd $0x2, %xmm12, %xmm0
+ shufpd $0x2, %xmm13, %xmm1
+ psrlq $32, %xmm0
+ psrlq $32, %xmm1
+ addps %xmm0, %xmm12
+ addps %xmm1, %xmm13
+
+ xorps %xmm0, %xmm0
+ xorps %xmm1, %xmm1
+ shufpd $0x2, %xmm14, %xmm0
+ shufpd $0x2, %xmm15, %xmm1
+ psrlq $32, %xmm0
+ psrlq $32, %xmm1
+ addps %xmm0, %xmm14
+ addps %xmm1, %xmm15
+
+ pshufd $0x78, %xmm9, %xmm0
+ pshufd $0x78, %xmm11, %xmm1
+ pshufd $0x78, %xmm13, %xmm2
+ pshufd $0x78, %xmm15, %xmm3
+ psrldq $4, %xmm0
+ psrldq $4, %xmm1
+ psrldq $4, %xmm2
+ psrldq $4, %xmm3
+ addps %xmm0, %xmm9
+ addps %xmm1, %xmm11
+ addps %xmm2, %xmm13
+ addps %xmm3, %xmm15
+
+ pshufd $0x78, %xmm10, %xmm0
+ pshufd $0x78, %xmm14, %xmm1
+ psrldq $4, %xmm0
+ psrldq $4, %xmm1
+ addps %xmm11, %xmm10
+ addps %xmm15, %xmm14
+ addps %xmm0, %xmm11
+ addps %xmm1, %xmm15
+
+
+ movss %xmm8, 1024(ARG0)
+ movss %xmm10, 896(ARG0)
+ movss %xmm9, 768(ARG0)
+ movss %xmm11, 640(ARG0)
+ movhlps %xmm8, %xmm0
+ movhlps %xmm10, %xmm1
+ movhlps %xmm9, %xmm2
+ movhlps %xmm11, %xmm3
+ movss %xmm0, 512(ARG0)
+ movss %xmm1, 384(ARG0)
+ movss %xmm2, 256(ARG0)
+ movss %xmm3, 128(ARG0)
+
+ pshuflw $0xee, %xmm8, %xmm4
+ pshuflw $0xee, %xmm10, %xmm5
+ pshuflw $0xee, %xmm9, %xmm6
+ pshuflw $0xee, %xmm11, %xmm7
+ movss %xmm4, (ARG0)
+ movss %xmm4, (ARG1)
+ movss %xmm5, 128(ARG1)
+ movss %xmm6, 256(ARG1)
+ movss %xmm7, 384(ARG1)
+
+ pshuflw $0xee, %xmm0, %xmm0
+ pshuflw $0xee, %xmm1, %xmm1
+ pshuflw $0xee, %xmm2, %xmm2
+ pshuflw $0xee, %xmm3, %xmm3
+ movss %xmm0, 512(ARG1)
+ movss %xmm1, 640(ARG1)
+ movss %xmm2, 768(ARG1)
+ movss %xmm3, 896(ARG1)
+
+ pshufd $0x78, %xmm12, %xmm0
+ movaps %xmm13, %xmm1
+ psrldq $4, %xmm0
+
+ addps %xmm14, %xmm12
+ addps %xmm15, %xmm13
+ addps %xmm1, %xmm14
+ addps %xmm0, %xmm15
+
+ movss %xmm12, 960(ARG0)
+ movss %xmm14, 832(ARG0)
+ movss %xmm13, 704(ARG0)
+ movss %xmm15, 576(ARG0)
+ movhlps %xmm12, %xmm0
+ movhlps %xmm14, %xmm1
+ movhlps %xmm13, %xmm2
+ movhlps %xmm15, %xmm3
+ movss %xmm0, 448(ARG0)
+ movss %xmm1, 320(ARG0)
+ movss %xmm2, 192(ARG0)
+ movss %xmm3, 64(ARG0)
+
+ pshuflw $0xee, %xmm12, %xmm4
+ pshuflw $0xee, %xmm14, %xmm5
+ pshuflw $0xee, %xmm13, %xmm6
+ pshuflw $0xee, %xmm15, %xmm7
+ movss %xmm4, 64(ARG1)
+ movss %xmm5, 192(ARG1)
+ movss %xmm6, 320(ARG1)
+ movss %xmm7, 448(ARG1)
+
+ pshuflw $0xee, %xmm0, %xmm0
+ pshuflw $0xee, %xmm1, %xmm1
+ pshuflw $0xee, %xmm2, %xmm2
+ pshuflw $0xee, %xmm3, %xmm3
+ movss %xmm0, 576(ARG1)
+ movss %xmm1, 704(ARG1)
+ movss %xmm2, 832(ARG1)
+ movss %xmm3, 960(ARG1)
+
+#ifdef IS_MSABI
+ movaps (%rsp), %xmm6
+ movaps 16(%rsp), %xmm7
+ movaps 32(%rsp), %xmm8
+ movaps 48(%rsp), %xmm9
+ movaps 64(%rsp), %xmm10
+ movaps 80(%rsp), %xmm11
+ movaps 96(%rsp), %xmm12
+ movaps 112(%rsp), %xmm13
+ movaps 128(%rsp), %xmm14
+ movaps 144(%rsp), %xmm15
+ addq $168, %rsp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/debug.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/debug.h
new file mode 100644
index 00000000..83f2ba95
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/debug.h
@@ -0,0 +1,132 @@
+/*
+ Some macros for printing debugging/warning/error messages with location info.
+
+ public domain (or LGPL / GPL, if you like that more;-)
+ generated by debugdef.pl, what was
+ trivially written by Thomas Orgis <thomas@orgis.org>
+
+ You decide to define DEBUG or not and write debug("foo") or
+ mdebug("foo: %s", message) and variants with more arguments and this
+ is converted to an elaborate call to fprintf(stderr, ...) that prints your
+ message with a line end attached and with information on where the call
+ occured.
+*/
+
+#include "config.h"
+
+#ifdef ME
+#define DBGPRFX ME": "
+#else
+#define DBGPRFX ""
+#endif
+
+#define noop ((void)0)
+
+#ifdef XDEBUG
+#define mxdebug(s, ...) mdebug(s, __VA_ARGS__)
+#define xdebug(s) debug(s)
+#else
+#define mxdebug(s, ...) noop
+#define xdebug(s) noop
+#endif
+
+// Used for debugging and warning messages.
+#include <stdio.h>
+#define debug_print(t, s, ...) fprintf(stderr, DBGPRFX "[" __FILE__ ":%s():%i] " t ": " s "\n", __func__, __LINE__, __VA_ARGS__)
+
+#ifdef DEBUG
+#define mdebug(s, ...) debug_print("debug", s, __VA_ARGS__)
+#else
+#define mdebug(s, ...) noop
+#endif
+#define debug(s) mdebug("%s", s)
+
+// Print warning message.
+#ifndef NO_WARNING
+#define mwarning(s, ...) debug_print("warning", s, __VA_ARGS__)
+#else
+#define mwarning(s, ...)
+#endif
+#define warning(s) mwarning("%s", s)
+
+// Print error message.
+#ifndef NO_ERRORMSG
+#define merror(s, ...) debug_print("error", s, __VA_ARGS__)
+#else
+#define merror(s, ...) noop
+#endif
+#define error(s) merror("%s", s)
+
+// Print error message and return given value.
+#ifndef NO_ERETURN
+#define mereturn(rv, s, ...) do{ debug_print("ereturn", s, __VA_ARGS__); return rv; } while (0)
+#else
+#define mereturn(rv, s, ...) return rv
+#endif
+#define ereturn(rv, s) mereturn(rv, "%s", s)
+
+// For old code that had to hardcode the argument number.
+
+#define debug1(s, a) mdebug(s,a)
+#define debug2(s, a, b) mdebug(s, a, b)
+#define debug3(s, a, b, c) mdebug(s, a, b, c)
+#define debug4(s, a, b, c, d) mdebug(s, a, b, c, d)
+#define debug5(s, a, b, c, d, e) mdebug(s, a, b, c, d, e)
+#define debug6(s, a, b, c, d, e, f) mdebug(s, a, b, c, d, e, f)
+#define debug7(s, a, b, c, d, e, f, g) mdebug(s, a, b, c, d, e, f, g)
+#define debug8(s, a, b, c, d, e, f, g, h) mdebug(s, a, b, c, d, e, f, g, h)
+#define debug9(s, a, b, c, d, e, f, g, h, i) mdebug(s, a, b, c, d, e, f, g, h, i)
+#define debug10(s, a, b, c, d, e, f, g, h, i, j) mdebug(s, a, b, c, d, e, f, g, h, i, j)
+#define debug11(s, a, b, c, d, e, f, g, h, i, j, k) mdebug(s, a, b, c, d, e, f, g, h, i, j, k)
+#define debug12(s, a, b, c, d, e, f, g, h, i, j, k, l) mdebug(s, a, b, c, d, e, f, g, h, i, j, k, l)
+#define debug13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) mdebug(s, a, b, c, d, e, f, g, h, i, j, k, l, m)
+#define debug14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) mdebug(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
+#define debug15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) mdebug(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
+
+#define warning1(s, a) mwarning(s, a)
+#define warning2(s, a, b) mwarning(s, a, b)
+#define warning3(s, a, b, c) mwarning(s, a, b, c)
+#define warning4(s, a, b, c, d) mwarning(s, a, b, c, d)
+#define warning5(s, a, b, c, d, e) mwarning(s, a, b, c, d, e)
+#define warning6(s, a, b, c, d, e, f) mwarning(s, a, b, c, d, e, f)
+#define warning7(s, a, b, c, d, e, f, g) mwarning(s, a, b, c, d, e, f, g)
+#define warning8(s, a, b, c, d, e, f, g, h) mwarning(s, a, b, c, d, e, f, g, h)
+#define warning9(s, a, b, c, d, e, f, g, h, i) mwarning(s, a, b, c, d, e, f, g, h, i)
+#define warning10(s, a, b, c, d, e, f, g, h, i, j) mwarning(s, a, b, c, d, e, f, g, h, i, j)
+#define warning11(s, a, b, c, d, e, f, g, h, i, j, k) mwarning(s, a, b, c, d, e, f, g, h, i, j, k)
+#define warning12(s, a, b, c, d, e, f, g, h, i, j, k, l) mwarning(s, a, b, c, d, e, f, g, h, i, j, k, l)
+#define warning13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) mwarning(s, a, b, c, d, e, f, g, h, i, j, k, l, m)
+#define warning14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) mwarning(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
+#define warning15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) mwarning(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
+
+#define error1(s, a) merror(s, a)
+#define error2(s, a, b) merror(s, a, b)
+#define error3(s, a, b, c) merror(s, a, b, c)
+#define error4(s, a, b, c, d) merror(s, a, b, c, d)
+#define error5(s, a, b, c, d, e) merror(s, a, b, c, d, e)
+#define error6(s, a, b, c, d, e, f) merror(s, a, b, c, d, e, f)
+#define error7(s, a, b, c, d, e, f, g) merror(s, a, b, c, d, e, f, g)
+#define error8(s, a, b, c, d, e, f, g, h) merror(s, a, b, c, d, e, f, g, h)
+#define error9(s, a, b, c, d, e, f, g, h, i) merror(s, a, b, c, d, e, f, g, h, i)
+#define error10(s, a, b, c, d, e, f, g, h, i, j) merror(s, a, b, c, d, e, f, g, h, i, j)
+#define error11(s, a, b, c, d, e, f, g, h, i, j, k) merror(s, a, b, c, d, e, f, g, h, i, j, k)
+#define error12(s, a, b, c, d, e, f, g, h, i, j, k, l) merror(s, a, b, c, d, e, f, g, h, i, j, k, l)
+#define error13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) merror(s, a, b, c, d, e, f, g, h, i, j, k, l, m)
+#define error14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) merror(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
+#define error15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) merror(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
+
+#define ereturn1(rv, s, a) mereturn(rv, s, a)
+#define ereturn2(rv, s, a, b) mereturn(rv, s, a, b)
+#define ereturn3(rv, s, a, b, c) mereturn(rv, s, a, b, c)
+#define ereturn4(rv, s, a, b, c, d) mereturn(rv, s, a, b, c, d)
+#define ereturn5(rv, s, a, b, c, d, e) mereturn(rv, s, a, b, c, d, e)
+#define ereturn6(rv, s, a, b, c, d, e, f) mereturn(rv, s, a, b, c, d, e, f)
+#define ereturn7(rv, s, a, b, c, d, e, f, g) mereturn(rv, s, a, b, c, d, e, f, g)
+#define ereturn8(rv, s, a, b, c, d, e, f, g, h) mereturn(rv, s, a, b, c, d, e, f, g, h)
+#define ereturn9(rv, s, a, b, c, d, e, f, g, h, i) mereturn(rv, s, a, b, c, d, e, f, g, h, i)
+#define ereturn10(rv, s, a, b, c, d, e, f, g, h, i, j) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j)
+#define ereturn11(rv, s, a, b, c, d, e, f, g, h, i, j, k) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j, k)
+#define ereturn12(rv, s, a, b, c, d, e, f, g, h, i, j, k, l) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j, k, l)
+#define ereturn13(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m)
+#define ereturn14(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
+#define ereturn15(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/decode.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/decode.h
new file mode 100644
index 00000000..e32940c9
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/decode.h
@@ -0,0 +1,292 @@
+/*
+ decode.h: common definitions for decode functions
+
+ This file is strongly tied with optimize.h concerning the synth functions.
+ Perhaps one should restructure that a bit.
+
+ copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis, taking WRITE_SAMPLE from decode.c
+*/
+#ifndef MPG123_DECODE_H
+#define MPG123_DECODE_H
+
+/* Selection of class of output routines for basic format. */
+#ifndef REAL_IS_FIXED
+#define OUT_FORMATS 4 /* Basic output formats: 16bit, 8bit, real and s32 */
+#else
+#define OUT_FORMATS 2 /* Only up to 16bit */
+#endif
+
+#define OUT_16 0
+#define OUT_8 1
+/* Those are defined but not supported for fixed point decoding! */
+#define OUT_REAL 2 /* Write a floating point sample (that is, one matching the internal real type). */
+#define OUT_S32 3
+
+#ifdef NO_NTOM
+#define NTOM_MAX 1
+#else
+#define NTOM_MAX 8 /* maximum allowed factor for upsampling */
+#define NTOM_MAX_FREQ 96000 /* maximum frequency to upsample to / downsample from */
+#define NTOM_MUL (32768)
+void ntom_set_ntom(mpg123_handle *fr, off_t num);
+#endif
+
+/* Let's collect all possible synth functions here, for an overview.
+ If they are actually defined and used depends on preprocessor machinery.
+ See synth.c and optimize.h for that, also some special C and assembler files. */
+
+#ifndef NO_16BIT
+/* The signed-16bit-producing variants. */
+int synth_1to1 (real*, int, mpg123_handle*, int);
+int synth_1to1_dither (real*, int, mpg123_handle*, int);
+int synth_1to1_i386 (real*, int, mpg123_handle*, int);
+int synth_1to1_i586 (real*, int, mpg123_handle*, int);
+int synth_1to1_i586_dither(real*, int, mpg123_handle*, int);
+int synth_1to1_mmx (real*, int, mpg123_handle*, int);
+int synth_1to1_3dnow (real*, int, mpg123_handle*, int);
+int synth_1to1_sse (real*, int, mpg123_handle*, int);
+int synth_1to1_stereo_sse (real*, real*, mpg123_handle*);
+int synth_1to1_3dnowext (real*, int, mpg123_handle*, int);
+int synth_1to1_altivec (real*, int, mpg123_handle*, int);
+int synth_1to1_stereo_altivec(real*, real*, mpg123_handle*);
+int synth_1to1_x86_64 (real*, int, mpg123_handle*, int);
+int synth_1to1_stereo_x86_64(real*, real*, mpg123_handle*);
+int synth_1to1_avx (real*, int, mpg123_handle*, int);
+int synth_1to1_stereo_avx (real*, real*, mpg123_handle*);
+int synth_1to1_arm (real*, int, mpg123_handle*, int);
+int synth_1to1_neon (real*, int, mpg123_handle*, int);
+int synth_1to1_stereo_neon(real*, real*, mpg123_handle*);
+int synth_1to1_neon64 (real*, int, mpg123_handle*, int);
+int synth_1to1_stereo_neon64(real*, real*, mpg123_handle*);
+/* This is different, special usage in layer3.c only.
+ Hence, the name... and now forget about it.
+ Never use it outside that special portion of code inside layer3.c! */
+int absynth_1to1_i486(real*, int, mpg123_handle*, int);
+/* These mono/stereo converters use one of the above for the grunt work. */
+int synth_1to1_mono (real*, mpg123_handle*);
+int synth_1to1_m2s(real*, mpg123_handle*);
+
+/* Sample rate decimation comes in less flavours. */
+#ifndef NO_DOWNSAMPLE
+int synth_2to1 (real*, int, mpg123_handle*, int);
+int synth_2to1_dither (real*, int, mpg123_handle*, int);
+int synth_2to1_i386 (real*, int, mpg123_handle*, int);
+int synth_2to1_mono (real*, mpg123_handle*);
+int synth_2to1_m2s(real*, mpg123_handle*);
+int synth_4to1 (real *,int, mpg123_handle*, int);
+int synth_4to1_dither (real *,int, mpg123_handle*, int);
+int synth_4to1_i386 (real*, int, mpg123_handle*, int);
+int synth_4to1_mono (real*, mpg123_handle*);
+int synth_4to1_m2s(real*, mpg123_handle*);
+#endif
+#ifndef NO_NTOM
+/* NtoM is really just one implementation. */
+int synth_ntom (real *,int, mpg123_handle*, int);
+int synth_ntom_mono (real *, mpg123_handle *);
+int synth_ntom_m2s (real *, mpg123_handle *);
+#endif
+#endif
+
+#ifndef NO_8BIT
+/* The 8bit-producing variants. */
+/* There are direct 8-bit synths and wrappers over a possibly optimized 16bit one. */
+int synth_1to1_8bit (real*, int, mpg123_handle*, int);
+int synth_1to1_8bit_i386 (real*, int, mpg123_handle*, int);
+#ifndef NO_16BIT
+int synth_1to1_8bit_wrap (real*, int, mpg123_handle*, int);
+int synth_1to1_8bit_mono (real*, mpg123_handle*);
+#endif
+int synth_1to1_8bit_m2s(real*, mpg123_handle*);
+#ifndef NO_16BIT
+int synth_1to1_8bit_wrap_mono (real*, mpg123_handle*);
+int synth_1to1_8bit_wrap_m2s(real*, mpg123_handle*);
+#endif
+#ifndef NO_DOWNSAMPLE
+int synth_2to1_8bit (real*, int, mpg123_handle*, int);
+int synth_2to1_8bit_i386 (real*, int, mpg123_handle*, int);
+int synth_2to1_8bit_mono (real*, mpg123_handle*);
+int synth_2to1_8bit_m2s(real*, mpg123_handle*);
+int synth_4to1_8bit (real*, int, mpg123_handle*, int);
+int synth_4to1_8bit_i386 (real*, int, mpg123_handle*, int);
+int synth_4to1_8bit_mono (real*, mpg123_handle*);
+int synth_4to1_8bit_m2s(real*, mpg123_handle*);
+#endif
+#ifndef NO_NTOM
+int synth_ntom_8bit (real*, int, mpg123_handle*, int);
+int synth_ntom_8bit_mono (real*, mpg123_handle*);
+int synth_ntom_8bit_m2s(real*, mpg123_handle*);
+#endif
+#endif
+
+#ifndef REAL_IS_FIXED
+
+#ifndef NO_REAL
+/* The real-producing variants. */
+int synth_1to1_real (real*, int, mpg123_handle*, int);
+int synth_1to1_real_i386 (real*, int, mpg123_handle*, int);
+int synth_1to1_real_sse (real*, int, mpg123_handle*, int);
+int synth_1to1_real_stereo_sse (real*, real*, mpg123_handle*);
+int synth_1to1_real_x86_64 (real*, int, mpg123_handle*, int);
+int synth_1to1_real_stereo_x86_64(real*, real*, mpg123_handle*);
+int synth_1to1_real_avx (real*, int, mpg123_handle*, int);
+int synth_1to1_fltst_avx (real*, real*, mpg123_handle*);
+int synth_1to1_real_altivec (real*, int, mpg123_handle*, int);
+int synth_1to1_fltst_altivec(real*, real*, mpg123_handle*);
+int synth_1to1_real_neon (real*, int, mpg123_handle*, int);
+int synth_1to1_real_stereo_neon(real*, real*, mpg123_handle*);
+int synth_1to1_real_neon64 (real*, int, mpg123_handle*, int);
+int synth_1to1_fltst_neon64(real*, real*, mpg123_handle*);
+int synth_1to1_real_mono (real*, mpg123_handle*);
+int synth_1to1_real_m2s(real*, mpg123_handle*);
+#ifndef NO_DOWNSAMPLE
+int synth_2to1_real (real*, int, mpg123_handle*, int);
+int synth_2to1_real_i386 (real*, int, mpg123_handle*, int);
+int synth_2to1_real_mono (real*, mpg123_handle*);
+int synth_2to1_real_m2s(real*, mpg123_handle*);
+int synth_4to1_real (real*, int, mpg123_handle*, int);
+int synth_4to1_real_i386 (real*, int, mpg123_handle*, int);
+int synth_4to1_real_mono (real*, mpg123_handle*);
+int synth_4to1_real_m2s(real*, mpg123_handle*);
+#endif
+#ifndef NO_NTOM
+int synth_ntom_real (real*, int, mpg123_handle*, int);
+int synth_ntom_real_mono (real*, mpg123_handle*);
+int synth_ntom_real_m2s(real*, mpg123_handle*);
+#endif
+#endif
+
+#ifndef NO_32BIT
+/* 32bit integer */
+int synth_1to1_s32 (real*, int, mpg123_handle*, int);
+int synth_1to1_s32_i386 (real*, int, mpg123_handle*, int);
+int synth_1to1_s32_sse (real*, int, mpg123_handle*, int);
+int synth_1to1_s32_stereo_sse (real*, real*, mpg123_handle*);
+int synth_1to1_s32_x86_64 (real*, int, mpg123_handle*, int);
+int synth_1to1_s32_stereo_x86_64(real*, real*, mpg123_handle*);
+int synth_1to1_s32_avx (real*, int, mpg123_handle*, int);
+int synth_1to1_s32_stereo_avx (real*, real*, mpg123_handle*);
+int synth_1to1_s32_altivec (real*, int, mpg123_handle*, int);
+int synth_1to1_s32_stereo_altivec(real*, real*, mpg123_handle*);
+int synth_1to1_s32_neon (real*, int, mpg123_handle*, int);
+int synth_1to1_s32_stereo_neon(real*, real*, mpg123_handle*);
+int synth_1to1_s32_neon64 (real*, int, mpg123_handle*, int);
+int synth_1to1_s32st_neon64(real*, real*, mpg123_handle*);
+int synth_1to1_s32_mono (real*, mpg123_handle*);
+int synth_1to1_s32_m2s(real*, mpg123_handle*);
+#ifndef NO_DOWNSAMPLE
+int synth_2to1_s32 (real*, int, mpg123_handle*, int);
+int synth_2to1_s32_i386 (real*, int, mpg123_handle*, int);
+int synth_2to1_s32_mono (real*, mpg123_handle*);
+int synth_2to1_s32_m2s(real*, mpg123_handle*);
+int synth_4to1_s32 (real*, int, mpg123_handle*, int);
+int synth_4to1_s32_i386 (real*, int, mpg123_handle*, int);
+int synth_4to1_s32_mono (real*, mpg123_handle*);
+int synth_4to1_s32_m2s(real*, mpg123_handle*);
+#endif
+#ifndef NO_NTOM
+int synth_ntom_s32 (real*, int, mpg123_handle*, int);
+int synth_ntom_s32_mono (real*, mpg123_handle*);
+int synth_ntom_s32_m2s(real*, mpg123_handle*);
+#endif
+#endif
+
+#endif /* FIXED */
+
+
+/* Inside these synth functions, some dct64 variants may be used.
+ The special optimized ones that only appear in assembler code are not mentioned here.
+ And, generally, these functions are only employed in a matching synth function. */
+void dct64 (real *,real *,real *);
+void dct64_i386 (real *,real *,real *);
+void dct64_altivec(real *,real *,real *);
+void dct64_i486(int*, int* , real*); /* Yeah, of no use outside of synth_i486.c .*/
+
+/* This is used by the layer 3 decoder, one generic function and 3DNow variants. */
+void dct36 (real *,real *,real *,const real *,real *);
+void dct36_3dnow (real *,real *,real *,const real *,real *);
+void dct36_3dnowext(real *,real *,real *,const real *,real *);
+void dct36_x86_64 (real *,real *,real *,const real *,real *);
+void dct36_sse (real *,real *,real *,const real *,real *);
+void dct36_avx (real *,real *,real *,const real *,real *);
+void dct36_neon (real *,real *,real *,const real *,real *);
+void dct36_neon64 (real *,real *,real *,const real *,real *);
+
+/* Tools for NtoM resampling synth, defined in ntom.c . */
+int synth_ntom_set_step(mpg123_handle *fr); /* prepare ntom decoding */
+unsigned long ntom_val(mpg123_handle *fr, off_t frame); /* compute ntom_val for frame offset */
+/* Frame and sample offsets. */
+#ifndef NO_NTOM
+/*
+ Outsamples of _this_ frame.
+ To be exact: The samples to be expected from the next frame decode (using the current ntom_val). When you already decoded _this_ frame, this is the number of samples to be expected from the next one.
+*/
+off_t ntom_frame_outsamples(mpg123_handle *fr);
+/* Total out/insample offset. */
+off_t ntom_frmouts(mpg123_handle *fr, off_t frame);
+off_t ntom_ins2outs(mpg123_handle *fr, off_t ins);
+off_t ntom_frameoff(mpg123_handle *fr, off_t soff);
+#endif
+
+/* Initialization of any static data that majy be needed at runtime.
+ Make sure you call these once before it is too late. */
+#ifndef NO_LAYER3
+#ifdef RUNTIME_TABLES
+void init_layer3(void);
+#endif
+real init_layer3_gainpow2(mpg123_handle *fr, int i);
+void init_layer3_stuff(mpg123_handle *fr, real (*gainpow2)(mpg123_handle *fr, int i));
+#endif
+#ifndef NO_LAYER12
+#ifdef RUNTIME_TABLES
+void init_layer12(void);
+#endif
+real* init_layer12_table(mpg123_handle *fr, real *table, int m);
+void init_layer12_stuff(mpg123_handle *fr, real* (*init_table)(mpg123_handle *fr, real *table, int m));
+#endif
+
+#ifdef RUNTIME_TABLES
+void init_costabs(void);
+#else
+const
+#endif
+extern real *pnts[5]; /* costab.h provides, dct64 needs */
+
+/* Runtime (re)init functions; needed more often. */
+void make_decode_tables(mpg123_handle *fr); /* For every volume change. */
+/* Stuff needed after updating synth setup (see set_synth_functions()). */
+
+#ifdef OPT_MMXORSSE
+/* Special treatment for mmx-like decoders, these functions go into the slots below. */
+void make_decode_tables_mmx(mpg123_handle *fr);
+#ifndef NO_LAYER3
+real init_layer3_gainpow2_mmx(mpg123_handle *fr, int i);
+#endif
+#ifndef NO_LAYER12
+real* init_layer12_table_mmx(mpg123_handle *fr, real *table, int m);
+#endif
+#endif
+
+#ifndef NO_8BIT
+/* Needed when switching to 8bit output. */
+int make_conv16to8_table(mpg123_handle *fr);
+#endif
+
+/* These are the actual workers.
+ They operate on the parsed frame data and handle decompression to audio samples.
+ The synth functions defined above are called from inside the layer handlers. */
+
+#ifndef NO_LAYER3
+int do_layer3(mpg123_handle *fr);
+#endif
+#ifndef NO_LAYER2
+int do_layer2(mpg123_handle *fr);
+#endif
+#ifndef NO_LAYER1
+int do_layer1(mpg123_handle *fr);
+#endif
+/* There's an 3DNow counterpart in asm. */
+void do_equalizer(real *bandPtr,int channel, real equalizer[2][32]);
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dither.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dither.c
new file mode 100644
index 00000000..329a4de7
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dither.c
@@ -0,0 +1,3 @@
+/* Hack to allow building the same code with and without libtool. */
+#include "intsym.h"
+#include "dither_impl.h"
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dither.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dither.h
new file mode 100644
index 00000000..6a6cb3e4
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dither.h
@@ -0,0 +1,23 @@
+/*
+ dither: Generate noise for dithering / noise shaping.
+
+ copyright 2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#ifndef MPG123_DITHER_H
+#define MPG123_DITHER_H
+
+#define DITHERSIZE 65536
+enum mpg123_noise_type
+{
+ mpg123_white_noise = 0
+ ,mpg123_tpdf_noise
+ ,mpg123_highpass_tpdf_noise
+};
+
+void mpg123_noise(float* table, size_t count, enum mpg123_noise_type noisetype);
+void dither_table_init(float *dithertable);
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dither_impl.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dither_impl.h
new file mode 100644
index 00000000..30dbdd13
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/dither_impl.h
@@ -0,0 +1,119 @@
+/*
+ dither: Generate shaped noise for dithering
+
+ copyright 2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "config.h"
+#include "compat.h"
+#include "dither.h"
+
+static const uint32_t init_seed = 2463534242UL;
+
+#define LAP 100
+
+/*
+ xorshift random number generator, with output scaling to [-0.5, 0.5]
+ This is the white noise...
+ See http://www.jstatsoft.org/v08/i14/paper on XOR shift random number generators.
+*/
+static float rand_xorshift32(uint32_t *seed)
+{
+ union
+ {
+ uint32_t i;
+ float f;
+ } fi;
+
+ fi.i = *seed;
+ fi.i ^= (fi.i<<13);
+ fi.i ^= (fi.i>>17);
+ fi.i ^= (fi.i<<5);
+ *seed = fi.i;
+
+ /* scale the number to [-0.5, 0.5] */
+#ifdef IEEE_FLOAT
+ fi.i = (fi.i>>9)|0x3f800000;
+ fi.f -= 1.5f;
+#else
+ fi.f = (double)fi.i / 4294967295.0;
+ fi.f -= 0.5f;
+#endif
+ return fi.f;
+}
+
+static void white_noise(float *table, size_t count)
+{
+ size_t i;
+ uint32_t seed = init_seed;
+
+ for(i=0; i<count; ++i)
+ table[i] = rand_xorshift32(&seed);
+}
+
+static void tpdf_noise(float *table, size_t count)
+{
+ size_t i;
+ uint32_t seed = init_seed;
+
+ for(i=0; i<count; ++i)
+ table[i] = rand_xorshift32(&seed) + rand_xorshift32(&seed);
+}
+
+static void highpass_tpdf_noise(float *table, size_t count)
+{
+ size_t i;
+ uint32_t seed = init_seed;
+ /* Ensure some minimum lap for keeping the high-pass filter circular. */
+ size_t lap = count > 2*LAP ? LAP : count/2;
+
+ float input_noise;
+ float xv[9], yv[9];
+
+ for(i=0;i<9;i++)
+ {
+ xv[i] = yv[i] = 0.0f;
+ }
+
+ for(i=0;i<count+lap;i++)
+ {
+ if(i==count) seed=init_seed;
+
+ /* generate and add 2 random numbers, to make a TPDF noise distribution */
+ input_noise = rand_xorshift32(&seed) + rand_xorshift32(&seed);
+
+ /* apply 8th order Chebyshev high-pass IIR filter */
+ /* Coefficients are from http://www-users.cs.york.ac.uk/~fisher/mkfilter/trad.html
+ Given parameters are: Chebyshev, Highpass, ripple=-1, order=8, samplerate=44100, corner1=19000 */
+ xv[0] = xv[1]; xv[1] = xv[2]; xv[2] = xv[3]; xv[3] = xv[4]; xv[4] = xv[5]; xv[5] = xv[6]; xv[6] = xv[7]; xv[7] = xv[8];
+ xv[8] = input_noise / 1.382814179e+07;
+ yv[0] = yv[1]; yv[1] = yv[2]; yv[2] = yv[3]; yv[3] = yv[4]; yv[4] = yv[5]; yv[5] = yv[6]; yv[6] = yv[7]; yv[7] = yv[8];
+ yv[8] = (xv[0] + xv[8]) - 8 * (xv[1] + xv[7]) + 28 * (xv[2] + xv[6])
+ - 56 * (xv[3] + xv[5]) + 70 * xv[4]
+ + ( -0.6706204984 * yv[0]) + ( -5.3720827038 * yv[1])
+ + (-19.0865382480 * yv[2]) + (-39.2831607860 * yv[3])
+ + (-51.2308985070 * yv[4]) + (-43.3590135780 * yv[5])
+ + (-23.2632305320 * yv[6]) + ( -7.2370122050 * yv[7]);
+ if(i>=lap) table[i-lap] = yv[8] * 3.0f;
+ }
+}
+
+void mpg123_noise(float* table, size_t count, enum mpg123_noise_type noisetype)
+{
+ switch(noisetype)
+ {
+ case mpg123_white_noise: white_noise(table, count); break;
+ case mpg123_tpdf_noise: tpdf_noise(table, count); break;
+ case mpg123_highpass_tpdf_noise:
+ highpass_tpdf_noise(table, count);
+ break;
+ }
+}
+
+/* Generate white noise and shape it with a high pass filter. */
+void dither_table_init(float *dithertable)
+{
+ highpass_tpdf_noise(dithertable, DITHERSIZE);
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/equalizer.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/equalizer.c
new file mode 100644
index 00000000..bc5d5d93
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/equalizer.c
@@ -0,0 +1,17 @@
+/*
+ equalizer.c: equalizer settings
+
+ copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp
+*/
+
+
+#include "mpg123lib_intern.h"
+
+void do_equalizer(real *bandPtr,int channel, real equalizer[2][32])
+{
+ int i;
+ for(i=0;i<32;i++)
+ bandPtr[i] = REAL_MUL(bandPtr[i], equalizer[channel][i]);
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/equalizer_3dnow.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/equalizer_3dnow.S
new file mode 100644
index 00000000..471a0ed0
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/equalizer_3dnow.S
@@ -0,0 +1,70 @@
+/*
+ equalizer_3dnow: 3DNow! optimized do_equalizer()
+
+ copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by KIMURA Takuhiro
+*/
+
+#include "mangle.h"
+
+.text
+ ALIGN4
+.globl ASM_NAME(do_equalizer_3dnow)
+/* .type ASM_NAME(do_equalizer_3dnow),@function */
+/* void do_equalizer(real *bandPtr,int channel, real equalizer[2][32]); */
+ASM_NAME(do_equalizer_3dnow):
+ pushl %esi
+ pushl %ebx
+ /* bandPtr */
+ movl 12(%esp),%ebx
+ /* channel */
+ movl 16(%esp),%ecx
+ xorl %edx,%edx
+ /* equalizer */
+ movl 20(%esp),%esi
+ sall $7,%ecx
+ ALIGN4
+.L9:
+ movq (%ebx,%edx),%mm0
+ pfmul (%esi,%ecx),%mm0
+
+ movq 8(%ebx,%edx),%mm1
+ pfmul 8(%esi,%ecx),%mm1
+ movq %mm0,(%ebx,%edx)
+
+ movq 16(%ebx,%edx),%mm0
+ pfmul 16(%esi,%ecx),%mm0
+ movq %mm1,8(%ebx,%edx)
+
+ movq 24(%ebx,%edx),%mm1
+ pfmul 24(%esi,%ecx),%mm1
+ movq %mm0,16(%ebx,%edx)
+
+ movq 32(%ebx,%edx),%mm0
+ pfmul 32(%esi,%ecx),%mm0
+ movq %mm1,24(%ebx,%edx)
+
+ movq 40(%ebx,%edx),%mm1
+ pfmul 40(%esi,%ecx),%mm1
+ movq %mm0,32(%ebx,%edx)
+
+ movq 48(%ebx,%edx),%mm0
+ pfmul 48(%esi,%ecx),%mm0
+ movq %mm1,40(%ebx,%edx)
+
+ movq 56(%ebx,%edx),%mm1
+ pfmul 56(%esi,%ecx),%mm1
+ movq %mm0,48(%ebx,%edx)
+ movq %mm1,56(%ebx,%edx)
+
+ addl $64,%edx
+ addl $32,%ecx
+ cmpl $124,%edx
+ jle .L9
+ ALIGN4
+ popl %ebx
+ popl %esi
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/feature.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/feature.c
new file mode 100644
index 00000000..24adad6a
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/feature.c
@@ -0,0 +1,133 @@
+#include "mpg123lib_intern.h"
+
+int attribute_align_arg mpg123_feature2(int key)
+{
+ return mpg123_feature(key);
+}
+
+int attribute_align_arg mpg123_feature(const enum mpg123_feature_set key)
+{
+ switch(key)
+ {
+ case MPG123_FEATURE_ABI_UTF8OPEN:
+#ifdef WANT_WIN32_UNICODE
+ return 1;
+#else
+ return 0;
+#endif /* WANT_WIN32_UNICODE */
+
+ case MPG123_FEATURE_OUTPUT_8BIT:
+#ifdef NO_8BIT
+ return 0;
+#else
+ return 1;
+#endif /* mpg123_output_8bit */
+
+ case MPG123_FEATURE_OUTPUT_16BIT:
+#ifdef NO_16BIT
+ return 0;
+#else
+ return 1;
+#endif /* mpg123_output_16bit */
+
+ case MPG123_FEATURE_OUTPUT_32BIT:
+#ifdef NO_32BIT
+ return 0;
+#else
+ return 1;
+#endif /* mpg123_output_32bit */
+
+ case MPG123_FEATURE_OUTPUT_FLOAT32:
+#if defined(NO_REAL)
+ return 0;
+#else
+ return 1;
+#endif
+
+ case MPG123_FEATURE_OUTPUT_FLOAT64:
+ return 0;
+
+ case MPG123_FEATURE_PARSE_ID3V2:
+#ifdef NO_ID3V2
+ return 0;
+#else
+ return 1;
+#endif /* NO_ID3V2 */
+
+ case MPG123_FEATURE_DECODE_LAYER1:
+#ifdef NO_LAYER1
+ return 0;
+#else
+ return 1;
+#endif /* NO_LAYER1 */
+
+ case MPG123_FEATURE_DECODE_LAYER2:
+#ifdef NO_LAYER2
+ return 0;
+#else
+ return 1;
+#endif /* NO_LAYER2 */
+
+ case MPG123_FEATURE_DECODE_LAYER3:
+#ifdef NO_LAYER3
+ return 0;
+#else
+ return 1;
+#endif /* NO_LAYER3 */
+
+ case MPG123_FEATURE_DECODE_ACCURATE:
+#ifdef ACCURATE_ROUNDING
+ return 1;
+#else
+ return 0;
+#endif /* ACCURATE_ROUNDING */
+
+ case MPG123_FEATURE_DECODE_DOWNSAMPLE:
+#ifdef NO_DOWNSAMPLE
+ return 0;
+#else
+ return 1;
+#endif /* NO_DOWNSAMPLE */
+
+ case MPG123_FEATURE_DECODE_NTOM:
+#ifdef NO_NTOM
+ return 0;
+#else
+ return 1;
+#endif /* NO_NTOM */
+
+ case MPG123_FEATURE_PARSE_ICY:
+#ifdef NO_ICY
+ return 0;
+#else
+ return 1;
+#endif /* NO_ICY */
+
+ case MPG123_FEATURE_INDEX:
+#ifdef FRAME_INDEX
+ return 1;
+#else
+ return 0;
+#endif /* FRAME_INDEX */
+ case MPG123_FEATURE_TIMEOUT_READ:
+#ifdef TIMEOUT_READ
+ return 1;
+#else
+ return 0;
+#endif
+ case MPG123_FEATURE_EQUALIZER:
+#ifndef NO_EQUALIZER
+ return 1;
+#else
+ return 0;
+#endif
+ case MPG123_FEATURE_MOREINFO:
+#ifndef NO_MOREINFO
+ return 1;
+#else
+ return 0;
+#endif
+
+ default: return 0;
+ }
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/fmt123.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/fmt123.h
new file mode 100644
index 00000000..d7772e1e
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/fmt123.h
@@ -0,0 +1,159 @@
+/*
+ libmpg123: MPEG Audio Decoder library
+
+ separate header just for audio format definitions not tied to
+ library code
+
+ copyright 1995-2020 by the mpg123 project
+ free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+*/
+
+#ifndef MPG123_ENC_H
+#define MPG123_ENC_H
+
+/** \file fmt123.h Audio format definitions. */
+
+/** \defgroup mpg123_enc mpg123 PCM sample encodings
+ * These are definitions for audio formats used by libmpg123 and
+ * libout123.
+ *
+ * @{
+ */
+
+/** An enum over all sample types possibly known to mpg123.
+ * The values are designed as bit flags to allow bitmasking for encoding
+ * families.
+ * This is also why the enum is not used as type for actual encoding variables,
+ * plain integers (at least 16 bit, 15 bit being used) cover the possible
+ * combinations of these flags.
+ *
+ * Note that (your build of) libmpg123 does not necessarily support all these.
+ * Usually, you can expect the 8bit encodings and signed 16 bit.
+ * Also 32bit float will be usual beginning with mpg123-1.7.0 .
+ * What you should bear in mind is that (SSE, etc) optimized routines may be
+ * absent for some formats. We do have SSE for 16, 32 bit and float, though.
+ * 24 bit integer is done via postprocessing of 32 bit output -- just cutting
+ * the last byte, no rounding, even. If you want better, do it yourself.
+ *
+ * All formats are in native byte order. If you need different endinaness, you
+ * can simply postprocess the output buffers (libmpg123 wouldn't do anything
+ * else). The macro MPG123_SAMPLESIZE() can be helpful there.
+ */
+enum mpg123_enc_enum
+{
+/* 0000 0000 0000 1111 Some 8 bit integer encoding. */
+ MPG123_ENC_8 = 0x00f
+/* 0000 0000 0100 0000 Some 16 bit integer encoding. */
+, MPG123_ENC_16 = 0x040
+/* 0100 0000 0000 0000 Some 24 bit integer encoding. */
+, MPG123_ENC_24 = 0x4000
+/* 0000 0001 0000 0000 Some 32 bit integer encoding. */
+, MPG123_ENC_32 = 0x100
+/* 0000 0000 1000 0000 Some signed integer encoding. */
+, MPG123_ENC_SIGNED = 0x080
+/* 0000 1110 0000 0000 Some float encoding. */
+, MPG123_ENC_FLOAT = 0xe00
+/* 0000 0000 1101 0000 signed 16 bit */
+, MPG123_ENC_SIGNED_16 = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10)
+/* 0000 0000 0110 0000 unsigned 16 bit */
+, MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20)
+/* 0000 0000 0000 0001 unsigned 8 bit */
+, MPG123_ENC_UNSIGNED_8 = 0x01
+/* 0000 0000 1000 0010 signed 8 bit */
+, MPG123_ENC_SIGNED_8 = (MPG123_ENC_SIGNED|0x02)
+/* 0000 0000 0000 0100 ulaw 8 bit */
+, MPG123_ENC_ULAW_8 = 0x04
+/* 0000 0000 0000 1000 alaw 8 bit */
+, MPG123_ENC_ALAW_8 = 0x08
+/* 0001 0001 1000 0000 signed 32 bit */
+, MPG123_ENC_SIGNED_32 = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000
+/* 0010 0001 0000 0000 unsigned 32 bit */
+, MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000
+/* 0101 0000 1000 0000 signed 24 bit */
+, MPG123_ENC_SIGNED_24 = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000
+/* 0110 0000 0000 0000 unsigned 24 bit */
+, MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000
+/* 0000 0010 0000 0000 32bit float */
+, MPG123_ENC_FLOAT_32 = 0x200
+/* 0000 0100 0000 0000 64bit float */
+, MPG123_ENC_FLOAT_64 = 0x400
+/* Any possibly known encoding from the list above. */
+, MPG123_ENC_ANY = ( MPG123_ENC_SIGNED_16 | MPG123_ENC_UNSIGNED_16
+ | MPG123_ENC_UNSIGNED_8 | MPG123_ENC_SIGNED_8
+ | MPG123_ENC_ULAW_8 | MPG123_ENC_ALAW_8
+ | MPG123_ENC_SIGNED_32 | MPG123_ENC_UNSIGNED_32
+ | MPG123_ENC_SIGNED_24 | MPG123_ENC_UNSIGNED_24
+ | MPG123_ENC_FLOAT_32 | MPG123_ENC_FLOAT_64 )
+};
+
+/** Get size of one PCM sample with given encoding.
+ * This is included both in libmpg123 and libout123. Both offer
+ * an API function to provide the macro results from library
+ * compile-time, not that of you application. This most likely
+ * does not matter as I do not expect any fresh PCM sample
+ * encoding to appear. But who knows? Perhaps the encoding type
+ * will be abused for funny things in future, not even plain PCM.
+ * And, by the way: Thomas really likes the ?: operator.
+ * \param enc the encoding (mpg123_enc_enum value)
+ * \return size of one sample in bytes
+ */
+#define MPG123_SAMPLESIZE(enc) ( \
+ (enc) < 1 \
+ ? 0 \
+ : ( (enc) & MPG123_ENC_8 \
+ ? 1 \
+ : ( (enc) & MPG123_ENC_16 \
+ ? 2 \
+ : ( (enc) & MPG123_ENC_24 \
+ ? 3 \
+ : ( ( (enc) & MPG123_ENC_32 \
+ || (enc) == MPG123_ENC_FLOAT_32 ) \
+ ? 4 \
+ : ( (enc) == MPG123_ENC_FLOAT_64 \
+ ? 8 \
+ : 0 \
+) ) ) ) ) )
+
+/** Representation of zero in differing encodings.
+ * This exists to define proper silence in various encodings without
+ * having to link to libsyn123 to do actual conversions at runtime.
+ * You have to handle big/little endian order yourself, though.
+ * This takes the shortcut that any signed encoding has a zero with
+ * all-zero bits. Unsigned linear encodings just have the highest bit set
+ * (2^(n-1) for n bits), while the nonlinear 8-bit ones are special.
+ * \param enc the encoding (mpg123_enc_enum value)
+ * \param siz bytes per sample (return value of MPG123_SAMPLESIZE(enc))
+ * \param off byte (octet) offset counted from LSB
+ * \return unsigned byte value for the designated octet
+ */
+#define MPG123_ZEROSAMPLE(enc, siz, off) ( \
+ (enc) == MPG123_ENC_ULAW_8 \
+ ? (off == 0 ? 0xff : 0x00) \
+ : ( (enc) == MPG123_ENC_ALAW_8 \
+ ? (off == 0 ? 0xd5 : 0x00) \
+ : ( (((enc) & (MPG123_ENC_SIGNED|MPG123_ENC_FLOAT)) || (siz) != ((off)+1)) \
+ ? 0x00 \
+ : 0x80 \
+ ) ) )
+
+/** Structure defining an audio format.
+ * Providing the members as individual function arguments to define a certain
+ * output format is easy enough. This struct makes is more comfortable to deal
+ * with a list of formats.
+ * Negative values for the members might be used to communicate use of default
+ * values.
+ */
+struct mpg123_fmt
+{
+ long rate; /**< sampling rate in Hz */
+ int channels; /**< channel count */
+ /** encoding code, can be single value or bitwise or of members of
+ * mpg123_enc_enum */
+ int encoding;
+};
+
+/** @} */
+
+#endif
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/format.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/format.c
new file mode 100644
index 00000000..a482e65a
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/format.c
@@ -0,0 +1,776 @@
+/*
+ format: routines to deal with audio (output) format
+
+ copyright 2008-20 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis, starting with parts of the old audio.c, with only faintly manage to show now
+
+ A Major change from mpg123 <= 1.18 is that all encodings are only really
+ disabled when done so via specific build configuration. Otherwise, the
+ missing support of decoders to produce a certain format is augmented by
+ postprocessing that converts the samples. This means happily creating
+ data with higher resolution from less accurate decoder output.
+
+ The main point is to still offer float encoding when the decoding core uses
+ a fixed point representation that has only 16 bit output. Actually, that's
+ the only point: A fixed-point build needs to create float from 16 bit, also
+ 32 or 24 bit from the same source. That's all there is to it: Everything else
+ is covered by fallback synth functions. It may be a further step to check if
+ there are cases where conversion in postprocessing works well enough to omit
+ a certain specialized decoder ... but usually, they are justified by some
+ special way to get from float to integer to begin with.
+
+ I won't cover the case of faking double output with float/s16 decoders here.
+ Double precision output is a thing for experimental builds anyway. Mostly
+ theoretical and without a point.
+*/
+
+#include "mpg123lib_intern.h"
+#include "sample.h"
+#include "debug.h"
+
+/* static int chans[NUM_CHANNELS] = { 1 , 2 }; */
+static const long my_rates[MPG123_RATES] = /* only the standard rates */
+{
+ 8000, 11025, 12000,
+ 16000, 22050, 24000,
+ 32000, 44100, 48000,
+};
+
+static const int my_encodings[MPG123_ENCODINGS] =
+{
+ MPG123_ENC_SIGNED_16,
+ MPG123_ENC_UNSIGNED_16,
+ MPG123_ENC_SIGNED_32,
+ MPG123_ENC_UNSIGNED_32,
+ MPG123_ENC_SIGNED_24,
+ MPG123_ENC_UNSIGNED_24,
+ /* Floating point range, see below. */
+ MPG123_ENC_FLOAT_32,
+ MPG123_ENC_FLOAT_64,
+ /* 8 bit range, see below. */
+ MPG123_ENC_SIGNED_8,
+ MPG123_ENC_UNSIGNED_8,
+ MPG123_ENC_ULAW_8,
+ MPG123_ENC_ALAW_8
+};
+
+/* Make that match the above table.
+ And yes, I still don't like this kludgy stuff. */
+/* range[0] <= i < range[1] for forced floating point */
+static const int enc_float_range[2] = { 6, 8 };
+/* same for 8 bit encodings */
+static const int enc_8bit_range[2] = { 8, 12 };
+// for 24 bit quality (24 and 32 bit integers)
+static const int enc_24bit_range[2] = { 2, 6 };
+// for completeness, the 16 bits
+static const int enc_16bit_range[2] = { 0, 2};
+
+/*
+ Only one type of float is supported.
+ Actually, double is a very special experimental case not occuring in normal
+ builds. Might actually get rid of it.
+
+ Remember here: Also with REAL_IS_FIXED, I want to be able to produce float
+ output (f32) via post-processing.
+*/
+# ifdef REAL_IS_DOUBLE
+# define MPG123_FLOAT_ENC MPG123_ENC_FLOAT_64
+# else
+# define MPG123_FLOAT_ENC MPG123_ENC_FLOAT_32
+# endif
+
+/* The list of actually possible encodings. */
+static const int good_encodings[] =
+{
+#ifndef NO_16BIT
+ MPG123_ENC_SIGNED_16,
+ MPG123_ENC_UNSIGNED_16,
+#endif
+#ifndef NO_32BIT
+ MPG123_ENC_SIGNED_32,
+ MPG123_ENC_UNSIGNED_32,
+ MPG123_ENC_SIGNED_24,
+ MPG123_ENC_UNSIGNED_24,
+#endif
+#ifndef NO_REAL
+ MPG123_FLOAT_ENC,
+#endif
+#ifndef NO_8BIT
+ MPG123_ENC_SIGNED_8,
+ MPG123_ENC_UNSIGNED_8,
+ MPG123_ENC_ULAW_8,
+ MPG123_ENC_ALAW_8
+#endif
+};
+
+/* Check if encoding is a valid one in this build.
+ ...lazy programming: linear search. */
+static int good_enc(const int enc)
+{
+ size_t i;
+ for(i=0; i<sizeof(good_encodings)/sizeof(int); ++i)
+ if(enc == good_encodings[i]) return TRUE;
+
+ return FALSE;
+}
+
+void attribute_align_arg mpg123_rates(const long **list, size_t *number)
+{
+ if(list != NULL) *list = my_rates;
+ if(number != NULL) *number = sizeof(my_rates)/sizeof(long);
+}
+
+/* Now that's a bit tricky... One build of the library knows only a subset of the encodings. */
+void attribute_align_arg mpg123_encodings(const int **list, size_t *number)
+{
+ if(list != NULL) *list = good_encodings;
+ if(number != NULL) *number = sizeof(good_encodings)/sizeof(int);
+}
+
+int attribute_align_arg mpg123_encsize(int encoding)
+{
+ return MPG123_SAMPLESIZE(encoding);
+}
+
+/* char audio_caps[NUM_CHANNELS][MPG123_RATES+1][MPG123_ENCODINGS]; */
+
+static int rate2num(mpg123_pars *mp, long r)
+{
+ int i;
+ for(i=0;i<MPG123_RATES;i++) if(my_rates[i] == r) return i;
+#ifndef NO_NTOM
+ if(mp && mp->force_rate != 0 && mp->force_rate == r) return MPG123_RATES;
+#endif
+
+ return -1;
+}
+
+static int enc2num(int encoding)
+{
+ int i;
+ for(i=0;i<MPG123_ENCODINGS;++i)
+ if(my_encodings[i] == encoding) return i;
+
+ return -1;
+}
+
+static int cap_fit(mpg123_pars *p, struct audioformat *nf, int f0, int f2)
+{
+ int i;
+ int c = nf->channels-1;
+ int rn = rate2num(p, nf->rate);
+ if(rn >= 0) for(i=f0;i<f2;i++)
+ {
+ if(p->audio_caps[c][rn][i])
+ {
+ nf->encoding = my_encodings[i];
+ return 1;
+ }
+ }
+ return 0;
+}
+
+static int imin(int a, int b)
+{
+ return a < b ? a : b;
+}
+
+static int imax(int a, int b)
+{
+ return a > b ? a : b;
+}
+
+// Find a possible encoding with given rate and channel count,
+// try differing channel count, too.
+// This updates the given format and returns TRUE if an encoding
+// was found.
+static int enc_chan_fit( mpg123_pars *p, long rate, struct audioformat *nnf
+, int f0, int f2, int try_float )
+{
+#define ENCRANGE(range) imax(f0, range[0]), imin(f2, range[1])
+ struct audioformat nf = *nnf;
+ nf.rate = rate;
+ if(cap_fit(p, &nf, ENCRANGE(enc_16bit_range)))
+ goto eend;
+ if(cap_fit(p, &nf, ENCRANGE(enc_24bit_range)))
+ goto eend;
+ if(try_float &&
+ cap_fit(p, &nf, ENCRANGE(enc_float_range)))
+ goto eend;
+ if(cap_fit(p, &nf, ENCRANGE(enc_8bit_range)))
+ goto eend;
+
+ /* try again with different stereoness */
+ if(nf.channels == 2 && !(p->flags & MPG123_FORCE_STEREO)) nf.channels = 1;
+ else if(nf.channels == 1 && !(p->flags & MPG123_FORCE_MONO)) nf.channels = 2;
+
+ if(cap_fit(p, &nf, ENCRANGE(enc_16bit_range)))
+ goto eend;
+ if(cap_fit(p, &nf, ENCRANGE(enc_24bit_range)))
+ goto eend;
+ if(try_float &&
+ cap_fit(p, &nf, ENCRANGE(enc_float_range)))
+ goto eend;
+ if(cap_fit(p, &nf, ENCRANGE(enc_8bit_range)))
+ goto eend;
+ return FALSE;
+eend:
+ *nnf = nf;
+ return TRUE;
+#undef ENCRANGE
+}
+
+/* match constraints against supported audio formats, store possible setup in frame
+ return: -1: error; 0: no format change; 1: format change */
+int frame_output_format(mpg123_handle *fr)
+{
+ struct audioformat nf;
+ int f0=0;
+ int f2=MPG123_ENCODINGS+1; // Include all encodings by default.
+ mpg123_pars *p = &fr->p;
+ int try_float = (p->flags & MPG123_FLOAT_FALLBACK) ? 0 : 1;
+ /* initialize new format, encoding comes later */
+ nf.channels = fr->stereo;
+ mdebug("native frame format: %d ch @ %ld Hz", fr->stereo, frame_freq(fr));
+ // I intended the forcing stuff to be weaved into the format support table,
+ // but this probably will never happen, as this would change library behaviour.
+ // One could introduce an additional effective format table that takes for
+ // forcings into account, but that would have to be updated on any flag
+ // change. Tedious.
+ if(p->flags & MPG123_FORCE_8BIT)
+ {
+ f0 = enc_8bit_range[0];
+ f2 = enc_8bit_range[1];
+ }
+ if(p->flags & MPG123_FORCE_FLOAT)
+ {
+ try_float = 1;
+ f0 = enc_float_range[0];
+ f2 = enc_float_range[1];
+ }
+
+ /* force stereo is stronger */
+ if(p->flags & MPG123_FORCE_MONO) nf.channels = 1;
+ if(p->flags & MPG123_FORCE_STEREO) nf.channels = 2;
+
+ // Strategy update: Avoid too early triggering of the NtoM decoder.
+ // Main target is the native rate, with any encoding.
+ // Then, native rate with any channel count and any encoding.
+ // Then, it's down_sample from native rate.
+ // As last resort: NtoM rate.
+ // So the priority is 1. rate 2. channels 3. encoding.
+ // As encodings go, 16 bit is tranditionally preferred as efficient choice.
+ // Next in line are wider float and integer encodings, then 8 bit as
+ // last resort.
+
+#ifndef NO_NTOM
+ if(p->force_rate)
+ {
+ if(enc_chan_fit(p, p->force_rate, &nf, f0, f2, try_float))
+ goto end;
+ // Keep the order consistent if float is considered fallback only.
+ if(!try_float &&
+ enc_chan_fit(p, p->force_rate, &nf, f0, f2, TRUE))
+ goto end;
+
+ merror( "Unable to set up output format! Constraints: %s%s%liHz."
+ , ( p->flags & MPG123_FORCE_STEREO ? "stereo, " :
+ (p->flags & MPG123_FORCE_MONO ? "mono, " : "") )
+ , ( p->flags & MPG123_FORCE_FLOAT ? "float, " :
+ (p->flags & MPG123_FORCE_8BIT ? "8bit, " : "") )
+ , p->force_rate );
+/* if(NOQUIET && p->verbose <= 1) print_capabilities(fr); */
+
+ fr->err = MPG123_BAD_OUTFORMAT;
+ return -1;
+ }
+#endif
+ // Native decoder rate first.
+ if(enc_chan_fit(p, frame_freq(fr)>>p->down_sample, &nf, f0, f2, try_float))
+ goto end;
+ // Then downsamplings.
+ if(p->flags & MPG123_AUTO_RESAMPLE && p->down_sample < 2)
+ {
+ if(enc_chan_fit( p, frame_freq(fr)>>(p->down_sample+1), &nf
+ , f0, f2, try_float ))
+ goto end;
+ if(p->down_sample < 1 && enc_chan_fit( p, frame_freq(fr)>>2, &nf
+ , f0, f2, try_float ))
+ goto end;
+ }
+ // And again the whole deal with float fallback.
+ if(!try_float)
+ {
+ if(enc_chan_fit(p, frame_freq(fr)>>p->down_sample, &nf, f0, f2, TRUE))
+ goto end;
+ // Then downsamplings.
+ if(p->flags & MPG123_AUTO_RESAMPLE && p->down_sample < 2)
+ {
+ if(enc_chan_fit( p, frame_freq(fr)>>(p->down_sample+1), &nf
+ , f0, f2, TRUE ))
+ goto end;
+ if(p->down_sample < 1 && enc_chan_fit( p, frame_freq(fr)>>2, &nf
+ , f0, f2, TRUE ))
+ goto end;
+ }
+ }
+#ifndef NO_NTOM
+ // Try to find any rate that works and resample using NtoM hackery.
+ if( p->flags & MPG123_AUTO_RESAMPLE && fr->p.down_sample == 0)
+ {
+ int i;
+ int rn = rate2num(p, frame_freq(fr));
+ int rrn;
+ if(rn < 0) return 0;
+ /* Try higher rates first. */
+ for(rrn=rn+1; rrn<MPG123_RATES; ++rrn)
+ if(enc_chan_fit(p, my_rates[rrn], &nf, f0, f2, try_float))
+ goto end;
+ /* Then lower rates. */
+ for(i=f0;i<f2;i++) for(rrn=rn-1; rrn>=0; --rrn)
+ if(enc_chan_fit(p, my_rates[rrn], &nf, f0, f2, try_float))
+ goto end;
+ // And again for float fallback.
+ if(!try_float)
+ {
+ /* Try higher rates first. */
+ for(rrn=rn+1; rrn<MPG123_RATES; ++rrn)
+ if(enc_chan_fit(p, my_rates[rrn], &nf, f0, f2, TRUE))
+ goto end;
+ /* Then lower rates. */
+ for(i=f0;i<f2;i++) for(rrn=rn-1; rrn>=0; --rrn)
+ if(enc_chan_fit(p, my_rates[rrn], &nf, f0, f2, TRUE))
+ goto end;
+ }
+ }
+#endif
+
+ /* Here is the _bad_ end. */
+ merror( "Unable to set up output format! Constraints: %s%s%li, %li or %liHz."
+ , ( p->flags & MPG123_FORCE_STEREO ? "stereo, " :
+ (p->flags & MPG123_FORCE_MONO ? "mono, " : "") )
+ , ( p->flags & MPG123_FORCE_FLOAT ? "float, " :
+ (p->flags & MPG123_FORCE_8BIT ? "8bit, " : "") )
+ , frame_freq(fr)>>p->down_sample
+ , frame_freq(fr)>>(p->down_sample ? p->down_sample : 1)
+ , frame_freq(fr)>>2 );
+/* if(NOQUIET && p->verbose <= 1) print_capabilities(fr); */
+
+ fr->err = MPG123_BAD_OUTFORMAT;
+ return -1;
+
+end: /* Here is the _good_ end. */
+ /* we had a successful match, now see if there's a change */
+ if(nf.rate == fr->af.rate && nf.channels == fr->af.channels && nf.encoding == fr->af.encoding)
+ {
+ debug2("Old format with %i channels, and FORCE_MONO=%li", nf.channels, p->flags & MPG123_FORCE_MONO);
+ return 0; /* the same format as before */
+ }
+ else /* a new format */
+ {
+ debug1("New format with %i channels!", nf.channels);
+ fr->af.rate = nf.rate;
+ fr->af.channels = nf.channels;
+ fr->af.encoding = nf.encoding;
+ /* Cache the size of one sample in bytes, for ease of use. */
+ fr->af.encsize = mpg123_encsize(fr->af.encoding);
+ if(fr->af.encsize < 1)
+ {
+ error1("Some unknown encoding??? (%i)", fr->af.encoding);
+
+ fr->err = MPG123_BAD_OUTFORMAT;
+ return -1;
+ }
+ /* Set up the decoder synth format. Might differ. */
+#ifdef NO_SYNTH32
+ /* Without high-precision synths, 16 bit signed is the basis for
+ everything higher than 8 bit. */
+ if(fr->af.encsize > 2)
+ fr->af.dec_enc = MPG123_ENC_SIGNED_16;
+ else
+ {
+#endif
+ switch(fr->af.encoding)
+ {
+#ifndef NO_32BIT
+ case MPG123_ENC_SIGNED_24:
+ case MPG123_ENC_UNSIGNED_24:
+ case MPG123_ENC_UNSIGNED_32:
+ fr->af.dec_enc = MPG123_ENC_SIGNED_32;
+ break;
+#endif
+#ifndef NO_16BIT
+ case MPG123_ENC_UNSIGNED_16:
+ fr->af.dec_enc = MPG123_ENC_SIGNED_16;
+ break;
+#endif
+ default:
+ fr->af.dec_enc = fr->af.encoding;
+ }
+#ifdef NO_SYNTH32
+ }
+#endif
+ fr->af.dec_encsize = mpg123_encsize(fr->af.dec_enc);
+ return 1;
+ }
+}
+
+int attribute_align_arg mpg123_format_none(mpg123_handle *mh)
+{
+ int r;
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+
+ r = mpg123_fmt_none(&mh->p);
+ if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; }
+
+ return r;
+}
+
+int attribute_align_arg mpg123_fmt_none(mpg123_pars *mp)
+{
+ if(mp == NULL) return MPG123_BAD_PARS;
+
+ if(PVERB(mp,3)) fprintf(stderr, "Note: Disabling all formats.\n");
+
+ memset(mp->audio_caps,0,sizeof(mp->audio_caps));
+ return MPG123_OK;
+}
+
+int attribute_align_arg mpg123_format_all(mpg123_handle *mh)
+{
+ int r;
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+
+ r = mpg123_fmt_all(&mh->p);
+ if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; }
+
+ return r;
+}
+
+int attribute_align_arg mpg123_fmt_all(mpg123_pars *mp)
+{
+ size_t rate, ch, enc;
+ if(mp == NULL) return MPG123_BAD_PARS;
+
+ if(PVERB(mp,3)) fprintf(stderr, "Note: Enabling all formats.\n");
+
+ for(ch=0; ch < NUM_CHANNELS; ++ch)
+ for(rate=0; rate < MPG123_RATES+1; ++rate)
+ for(enc=0; enc < MPG123_ENCODINGS; ++enc)
+ mp->audio_caps[ch][rate][enc] = good_enc(my_encodings[enc]) ? 1 : 0;
+
+ return MPG123_OK;
+}
+
+int attribute_align_arg mpg123_format2(mpg123_handle *mh, long rate, int channels, int encodings)
+{
+ int r;
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+ r = mpg123_fmt2(&mh->p, rate, channels, encodings);
+ if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; }
+
+ return r;
+}
+
+// Keep old behaviour.
+int attribute_align_arg mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings)
+{
+ int r;
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+ r = mpg123_fmt(&mh->p, rate, channels, encodings);
+ if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; }
+
+ return r;
+}
+
+int attribute_align_arg mpg123_fmt2(mpg123_pars *mp, long rate, int channels, int encodings)
+{
+ int ie, ic, ratei, r1, r2;
+ int ch[2] = {0, 1};
+ if(mp == NULL) return MPG123_BAD_PARS;
+ if(!(channels & (MPG123_MONO|MPG123_STEREO))) return MPG123_BAD_CHANNEL;
+
+ if(PVERB(mp,3)) fprintf(stderr, "Note: Want to enable format %li/%i for encodings 0x%x.\n", rate, channels, encodings);
+
+ if(!(channels & MPG123_STEREO)) ch[1] = 0; /* {0,0} */
+ else if(!(channels & MPG123_MONO)) ch[0] = 1; /* {1,1} */
+ if(rate)
+ {
+ r1 = rate2num(mp, rate);
+ r2 = r1+1;
+ }
+ else
+ {
+ r1 = 0;
+ r2 = MPG123_RATES+1; /* including forced rate */
+ }
+
+ if(r1 < 0) return MPG123_BAD_RATE;
+
+ /* now match the encodings */
+ for(ratei = r1; ratei < r2; ++ratei)
+ for(ic = 0; ic < 2; ++ic)
+ {
+ for(ie = 0; ie < MPG123_ENCODINGS; ++ie)
+ if(good_enc(my_encodings[ie]) && ((my_encodings[ie] & encodings) == my_encodings[ie]))
+ mp->audio_caps[ch[ic]][ratei][ie] = 1;
+
+ if(ch[0] == ch[1]) break; /* no need to do it again */
+ }
+
+ return MPG123_OK;
+}
+
+// Keep old behaviour, error on rate=0.
+int attribute_align_arg mpg123_fmt(mpg123_pars *mp, long rate, int channels, int encodings)
+{
+ return (rate == 0)
+ ? MPG123_BAD_RATE
+ : mpg123_fmt2(mp, rate, channels, encodings);
+}
+
+int attribute_align_arg mpg123_format_support(mpg123_handle *mh, long rate, int encoding)
+{
+ if(mh == NULL) return 0;
+ else return mpg123_fmt_support(&mh->p, rate, encoding);
+}
+
+int attribute_align_arg mpg123_fmt_support(mpg123_pars *mp, long rate, int encoding)
+{
+ int ch = 0;
+ int ratei, enci;
+ ratei = rate2num(mp, rate);
+ enci = enc2num(encoding);
+ if(mp == NULL || ratei < 0 || enci < 0) return 0;
+ if(mp->audio_caps[0][ratei][enci]) ch |= MPG123_MONO;
+ if(mp->audio_caps[1][ratei][enci]) ch |= MPG123_STEREO;
+ return ch;
+}
+
+/* Call this one to ensure that any valid format will be something different than this. */
+void invalidate_format(struct audioformat *af)
+{
+ af->encoding = 0;
+ af->rate = 0;
+ af->channels = 0;
+}
+
+/* Number of bytes the decoder produces. */
+off_t decoder_synth_bytes(mpg123_handle *fr, off_t s)
+{
+ return s * fr->af.dec_encsize * fr->af.channels;
+}
+
+/* Samples/bytes for output buffer after post-processing. */
+/* take into account: channels, bytes per sample -- NOT resampling!*/
+off_t samples_to_bytes(mpg123_handle *fr , off_t s)
+{
+ return s * fr->af.encsize * fr->af.channels;
+}
+
+off_t bytes_to_samples(mpg123_handle *fr , off_t b)
+{
+ return b / fr->af.encsize / fr->af.channels;
+}
+
+/* Number of bytes needed for decoding _and_ post-processing. */
+off_t outblock_bytes(mpg123_handle *fr, off_t s)
+{
+ int encsize = (fr->af.encoding & MPG123_ENC_24)
+ ? 4 /* Intermediate 32 bit. */
+ : (fr->af.encsize > fr->af.dec_encsize
+ ? fr->af.encsize
+ : fr->af.dec_encsize);
+ return s * encsize * fr->af.channels;
+}
+
+#ifndef NO_32BIT
+
+/* Remove every fourth byte, facilitating conversion from 32 bit to 24 bit integers.
+ This has to be aware of endianness, of course. */
+static void chop_fourth_byte(struct outbuffer *buf)
+{
+ unsigned char *wpos = buf->data;
+ unsigned char *rpos = buf->data;
+ size_t blocks = buf->fill/4;
+ size_t i;
+ for(i=0; i<blocks; ++i,wpos+=3,rpos+=4)
+ DROP4BYTE(wpos, rpos)
+ buf->fill = wpos-buf->data;
+}
+
+static void conv_s32_to_u32(struct outbuffer *buf)
+{
+ size_t i;
+ int32_t *ssamples = (int32_t*) buf->data;
+ uint32_t *usamples = (uint32_t*) buf->data;
+ size_t count = buf->fill/sizeof(int32_t);
+
+ for(i=0; i<count; ++i)
+ usamples[i] = CONV_SU32(ssamples[i]);
+}
+
+#endif
+
+
+/* We always assume that whole numbers are written!
+ partials will be cut out. */
+
+static const char *bufsizeerr = "Fatal: Buffer too small for postprocessing!";
+
+
+#ifndef NO_16BIT
+
+static void conv_s16_to_u16(struct outbuffer *buf)
+{
+ size_t i;
+ int16_t *ssamples = (int16_t*) buf->data;
+ uint16_t *usamples = (uint16_t*)buf->data;
+ size_t count = buf->fill/sizeof(int16_t);
+
+ for(i=0; i<count; ++i)
+ usamples[i] = CONV_SU16(ssamples[i]);
+}
+
+#ifndef NO_REAL
+static void conv_s16_to_f32(struct outbuffer *buf)
+{
+ ssize_t i;
+ int16_t *in = (int16_t*) buf->data;
+ float *out = (float*) buf->data;
+ size_t count = buf->fill/sizeof(int16_t);
+ /* Does that make any sense? In x86, there is an actual instruction to divide
+ float by integer ... but then, if we have that FPU, we don't really need
+ fixed point decoder hacks ...? */
+ float scale = 1./SHORT_SCALE;
+
+ if(buf->size < count*sizeof(float))
+ {
+ error1("%s", bufsizeerr);
+ return;
+ }
+
+ /* Work from the back since output is bigger. */
+ for(i=count-1; i>=0; --i)
+ out[i] = (float)in[i] * scale;
+
+ buf->fill = count*sizeof(float);
+}
+#endif
+
+#ifndef NO_32BIT
+static void conv_s16_to_s32(struct outbuffer *buf)
+{
+ ssize_t i;
+ int16_t *in = (int16_t*) buf->data;
+ int32_t *out = (int32_t*) buf->data;
+ size_t count = buf->fill/sizeof(int16_t);
+
+ if(buf->size < count*sizeof(int32_t))
+ {
+ error1("%s", bufsizeerr);
+ return;
+ }
+
+ /* Work from the back since output is bigger. */
+ for(i=count-1; i>=0; --i)
+ {
+ out[i] = in[i];
+ /* Could just shift bytes, but would have to mess with sign bit. */
+ out[i] *= S32_RESCALE;
+ }
+
+ buf->fill = count*sizeof(int32_t);
+}
+#endif
+#endif
+
+#include "swap_bytes_impl.h"
+
+void swap_endian(struct outbuffer *buf, int block)
+{
+ size_t count;
+
+ if(block >= 2)
+ {
+ count = buf->fill/(unsigned int)block;
+ swap_bytes(buf->data, (size_t)block, count);
+ }
+}
+
+void postprocess_buffer(mpg123_handle *fr)
+{
+ /*
+ This caters for the final output formats that are never produced by
+ decoder synth directly (wide unsigned and 24 bit formats) or that are
+ missing because of limited decoder precision (16 bit synth but 32 or
+ 24 bit output).
+ */
+ switch(fr->af.dec_enc)
+ {
+#ifndef NO_32BIT
+ case MPG123_ENC_SIGNED_32:
+ switch(fr->af.encoding)
+ {
+ case MPG123_ENC_UNSIGNED_32:
+ conv_s32_to_u32(&fr->buffer);
+ break;
+ case MPG123_ENC_UNSIGNED_24:
+ conv_s32_to_u32(&fr->buffer);
+ chop_fourth_byte(&fr->buffer);
+ break;
+ case MPG123_ENC_SIGNED_24:
+ chop_fourth_byte(&fr->buffer);
+ break;
+ }
+ break;
+#endif
+#ifndef NO_16BIT
+ case MPG123_ENC_SIGNED_16:
+ switch(fr->af.encoding)
+ {
+ case MPG123_ENC_UNSIGNED_16:
+ conv_s16_to_u16(&fr->buffer);
+ break;
+#ifndef NO_REAL
+ case MPG123_ENC_FLOAT_32:
+ conv_s16_to_f32(&fr->buffer);
+ break;
+#endif
+#ifndef NO_32BIT
+ case MPG123_ENC_SIGNED_32:
+ conv_s16_to_s32(&fr->buffer);
+ break;
+ case MPG123_ENC_UNSIGNED_32:
+ conv_s16_to_s32(&fr->buffer);
+ conv_s32_to_u32(&fr->buffer);
+ break;
+ case MPG123_ENC_UNSIGNED_24:
+ conv_s16_to_s32(&fr->buffer);
+ conv_s32_to_u32(&fr->buffer);
+ chop_fourth_byte(&fr->buffer);
+ break;
+ case MPG123_ENC_SIGNED_24:
+ conv_s16_to_s32(&fr->buffer);
+ chop_fourth_byte(&fr->buffer);
+ break;
+#endif
+ }
+ break;
+#endif
+ }
+ if(fr->p.flags & MPG123_FORCE_ENDIAN)
+ {
+ if(
+#ifdef WORDS_BIGENDIAN
+ !(
+#endif
+ fr->p.flags & MPG123_BIG_ENDIAN
+#ifdef WORDS_BIGENDIAN
+ )
+#endif
+ )
+ swap_endian(&fr->buffer, mpg123_encsize(fr->af.encoding));
+ }
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/frame.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/frame.c
new file mode 100644
index 00000000..f818bc5b
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/frame.c
@@ -0,0 +1,1072 @@
+/*
+ frame: Heap of routines dealing with the core mpg123 data structure.
+
+ copyright 2008-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis
+*/
+
+#define WANT_GETCPUFLAGS
+#include "mpg123lib_intern.h"
+#include "getcpuflags.h"
+#include "debug.h"
+
+static void frame_fixed_reset(mpg123_handle *fr);
+
+/* that's doubled in decode_ntom.c */
+#define NTOM_MUL (32768)
+
+#define aligned_pointer(p, type, alignment) align_the_pointer(p, alignment)
+static void *align_the_pointer(void *base, unsigned int alignment)
+{
+ /*
+ Work in unsigned integer realm, explicitly.
+ Tricking the compiler into integer operations like % by invoking base-NULL is dangerous: It results into ptrdiff_t, which gets negative on big addresses. Big screw up, that.
+ I try to do it "properly" here: Casting only to uintptr_t and no artihmethic with void*.
+ */
+ uintptr_t baseval = (uintptr_t)(char*)base;
+ uintptr_t aoff = baseval % alignment;
+
+ debug3("align_the_pointer: pointer %p is off by %u from %u",
+ base, (unsigned int)aoff, alignment);
+
+ if(aoff) return (char*)base+alignment-aoff;
+ else return base;
+}
+
+static void frame_default_pars(mpg123_pars *mp)
+{
+ mp->outscale = 1.0;
+ mp->flags = 0;
+#ifdef GAPLESS
+ mp->flags |= MPG123_GAPLESS;
+#endif
+ mp->flags |= MPG123_AUTO_RESAMPLE|MPG123_FLOAT_FALLBACK;
+#ifndef NO_NTOM
+ mp->force_rate = 0;
+#endif
+ mp->down_sample = 0;
+ mp->rva = 0;
+ mp->halfspeed = 0;
+ mp->doublespeed = 0;
+ mp->verbose = 0;
+#ifndef NO_ICY
+ mp->icy_interval = 0;
+#endif
+ mp->timeout = 0;
+ mp->resync_limit = 1024;
+#ifdef FRAME_INDEX
+ mp->index_size = INDEX_SIZE;
+#endif
+ mp->preframes = 4; /* That's good for layer 3 ISO compliance bitstream. */
+ mpg123_fmt_all(mp);
+ /* Default of keeping some 4K buffers at hand, should cover the "usual" use case (using 16K pipe buffers as role model). */
+#ifndef NO_FEEDER
+ mp->feedpool = 5;
+ mp->feedbuffer = 4096;
+#endif
+ mp->freeformat_framesize = -1;
+}
+
+void frame_init(mpg123_handle *fr)
+{
+ frame_init_par(fr, NULL);
+}
+
+void frame_init_par(mpg123_handle *fr, mpg123_pars *mp)
+{
+ fr->own_buffer = TRUE;
+ fr->buffer.data = NULL;
+ fr->buffer.rdata = NULL;
+ fr->buffer.fill = 0;
+ fr->buffer.size = 0;
+ fr->rawbuffs = NULL;
+ fr->rawbuffss = 0;
+ fr->rawdecwin = NULL;
+ fr->rawdecwins = 0;
+#ifdef REAL_IS_FIXED
+ fr->gainpow2 = NULL; // At least crash early if I get it wrong.
+#endif
+#ifndef NO_8BIT
+ fr->conv16to8_buf = NULL;
+#endif
+#ifdef OPT_DITHER
+ fr->dithernoise = NULL;
+#endif
+ fr->layerscratch = NULL;
+ fr->xing_toc = NULL;
+#ifdef OPT_CPU_FLAGS
+ wrap_getcpuflags(&(fr->cpu_flags));
+#endif
+ fr->cpu_opts.type = defdec();
+ fr->cpu_opts.class = decclass(fr->cpu_opts.type);
+#ifndef NO_NTOM
+ /* these two look unnecessary, check guarantee for synth_ntom_set_step (in control_generic, even)! */
+ fr->ntom_val[0] = NTOM_MUL>>1;
+ fr->ntom_val[1] = NTOM_MUL>>1;
+ fr->ntom_step = NTOM_MUL;
+#endif
+ /* unnecessary: fr->buffer.size = fr->buffer.fill = 0; */
+ mpg123_reset_eq(fr);
+ init_icy(&fr->icy);
+ init_id3(fr);
+ /* frame_outbuffer is missing... */
+ /* frame_buffers is missing... that one needs cpu opt setting! */
+ /* after these... frame_reset is needed before starting full decode */
+ invalidate_format(&fr->af);
+ fr->rdat.r_read = NULL;
+ fr->rdat.r_lseek = NULL;
+ fr->rdat.iohandle = NULL;
+ fr->rdat.r_read_handle = NULL;
+ fr->rdat.r_lseek_handle = NULL;
+ fr->rdat.cleanup_handle = NULL;
+ fr->wrapperdata = NULL;
+ fr->wrapperclean = NULL;
+ fr->decoder_change = 1;
+ fr->err = MPG123_OK;
+ if(mp == NULL) frame_default_pars(&fr->p);
+ else memcpy(&fr->p, mp, sizeof(struct mpg123_pars_struct));
+
+#ifndef NO_FEEDER
+ bc_prepare(&fr->rdat.buffer, fr->p.feedpool, fr->p.feedbuffer);
+#endif
+
+ fr->down_sample = 0; /* Initialize to silence harmless errors when debugging. */
+ fr->id3v2_raw = NULL;
+ frame_fixed_reset(fr); /* Reset only the fixed data, dynamic buffers are not there yet! */
+ fr->synth = NULL;
+ fr->synth_mono = NULL;
+ fr->make_decode_tables = NULL;
+#ifdef FRAME_INDEX
+ fi_init(&fr->index);
+ frame_index_setup(fr); /* Apply the size setting. */
+#endif
+#ifndef NO_MOREINFO
+ fr->pinfo = NULL;
+#endif
+}
+
+#ifdef OPT_DITHER
+/* Also, only allocate the memory for the table on demand.
+ In future, one could create special noise for different sampling frequencies(?). */
+int frame_dither_init(mpg123_handle *fr)
+{
+ /* run-time dither noise table generation */
+ if(fr->dithernoise == NULL)
+ {
+ fr->dithernoise = malloc(sizeof(float)*DITHERSIZE);
+ if(fr->dithernoise == NULL) return 0;
+
+ dither_table_init(fr->dithernoise);
+ }
+ return 1;
+}
+#endif
+
+mpg123_pars attribute_align_arg *mpg123_new_pars(int *error)
+{
+ mpg123_pars *mp = malloc(sizeof(struct mpg123_pars_struct));
+ if(mp != NULL){ frame_default_pars(mp); if(error != NULL) *error = MPG123_OK; }
+ else if(error != NULL) *error = MPG123_OUT_OF_MEM;
+ return mp;
+}
+
+void attribute_align_arg mpg123_delete_pars(mpg123_pars* mp)
+{
+ if(mp != NULL) free(mp);
+}
+
+int attribute_align_arg mpg123_reset_eq(mpg123_handle *mh)
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+#ifndef NO_EQUALIZER
+ int i;
+ mh->have_eq_settings = 0;
+ for(i=0; i < 32; ++i) mh->equalizer[0][i] = mh->equalizer[1][i] = DOUBLE_TO_REAL(1.0);
+#endif
+ return MPG123_OK;
+}
+
+int frame_outbuffer(mpg123_handle *fr)
+{
+ size_t size = fr->outblock;
+ if(!fr->own_buffer)
+ {
+ if(fr->buffer.size < size)
+ {
+ fr->err = MPG123_BAD_BUFFER;
+ if(NOQUIET)
+ merror( "have external buffer of size %"SIZE_P", need %"SIZE_P
+ , (size_p)fr->buffer.size, (size_p)size );
+ return MPG123_ERR;
+ }
+ }
+
+ debug1("need frame buffer of %"SIZE_P, (size_p)size);
+ if(fr->buffer.rdata != NULL && fr->buffer.size != size)
+ {
+ free(fr->buffer.rdata);
+ fr->buffer.rdata = NULL;
+ }
+ fr->buffer.size = size;
+ fr->buffer.data = NULL;
+ /* be generous: use 16 byte alignment */
+ if(fr->buffer.rdata == NULL) fr->buffer.rdata = (unsigned char*) malloc(fr->buffer.size+15);
+ if(fr->buffer.rdata == NULL)
+ {
+ fr->err = MPG123_OUT_OF_MEM;
+ return MPG123_ERR;
+ }
+ fr->buffer.data = aligned_pointer(fr->buffer.rdata, unsigned char*, 16);
+ fr->own_buffer = TRUE;
+ fr->buffer.fill = 0;
+ return MPG123_OK;
+}
+
+int attribute_align_arg mpg123_replace_buffer(mpg123_handle *mh, void *data, size_t size)
+{
+ debug2("replace buffer with %p size %"SIZE_P, data, (size_p)size);
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+ /* Will accept any size, the error comes later... */
+ if(data == NULL)
+ {
+ mh->err = MPG123_BAD_BUFFER;
+ return MPG123_ERR;
+ }
+ if(mh->buffer.rdata != NULL) free(mh->buffer.rdata);
+ mh->own_buffer = FALSE;
+ mh->buffer.rdata = NULL;
+ mh->buffer.data = data;
+ mh->buffer.size = size;
+ mh->buffer.fill = 0;
+ return MPG123_OK;
+}
+
+#ifdef FRAME_INDEX
+int frame_index_setup(mpg123_handle *fr)
+{
+ int ret = MPG123_ERR;
+ if(fr->p.index_size >= 0)
+ { /* Simple fixed index. */
+ fr->index.grow_size = 0;
+ ret = fi_resize(&fr->index, (size_t)fr->p.index_size);
+ }
+ else
+ { /* A growing index. We give it a start, though. */
+ fr->index.grow_size = (size_t)(- fr->p.index_size);
+ if(fr->index.size < fr->index.grow_size)
+ ret = fi_resize(&fr->index, fr->index.grow_size);
+ else
+ ret = MPG123_OK; /* We have minimal size already... and since growing is OK... */
+ }
+ debug2("set up frame index of size %lu (ret=%i)", (unsigned long)fr->index.size, ret);
+ if(ret && NOQUIET)
+ error("frame index setup (initial resize) failed");
+ return ret;
+}
+#endif
+
+static void frame_decode_buffers_reset(mpg123_handle *fr)
+{
+ if(fr->rawbuffs) /* memset(NULL, 0, 0) not desired */
+ memset(fr->rawbuffs, 0, fr->rawbuffss);
+}
+
+int frame_buffers(mpg123_handle *fr)
+{
+ int buffssize = 0;
+ debug1("frame %p buffer", (void*)fr);
+/*
+ the used-to-be-static buffer of the synth functions, has some subtly different types/sizes
+
+ 2to1, 4to1, ntom, generic, i386: real[2][2][0x110]
+ mmx, sse: short[2][2][0x110]
+ i586(_dither): 4352 bytes; int/long[2][2][0x110]
+ i486: int[2][2][17*FIR_BUFFER_SIZE]
+ altivec: static real __attribute__ ((aligned (16))) buffs[4][4][0x110]
+
+ Huh, altivec looks like fun. Well, let it be large... then, the 16 byte alignment seems to be implicit on MacOSX malloc anyway.
+ Let's make a reasonable attempt to allocate enough memory...
+ Keep in mind: biggest ones are i486 and altivec (mutually exclusive!), then follows i586 and normal real.
+ mmx/sse use short but also real for resampling.
+ Thus, minimum is 2*2*0x110*sizeof(real).
+*/
+ if(fr->cpu_opts.type == altivec) buffssize = 4*4*0x110*sizeof(real);
+#ifdef OPT_I486
+ else if(fr->cpu_opts.type == ivier) buffssize = 2*2*17*FIR_BUFFER_SIZE*sizeof(int);
+#endif
+ else if(fr->cpu_opts.type == ifuenf || fr->cpu_opts.type == ifuenf_dither || fr->cpu_opts.type == dreidnow)
+ buffssize = 2*2*0x110*4; /* don't rely on type real, we need 4352 bytes */
+
+ if(2*2*0x110*sizeof(real) > buffssize)
+ buffssize = 2*2*0x110*sizeof(real);
+ buffssize += 15; /* For 16-byte alignment (SSE likes that). */
+
+ if(fr->rawbuffs != NULL && fr->rawbuffss != buffssize)
+ {
+ free(fr->rawbuffs);
+ fr->rawbuffs = NULL;
+ }
+
+ if(fr->rawbuffs == NULL) fr->rawbuffs = (unsigned char*) malloc(buffssize);
+ if(fr->rawbuffs == NULL) return -1;
+ fr->rawbuffss = buffssize;
+ fr->short_buffs[0][0] = aligned_pointer(fr->rawbuffs,short,16);
+ fr->short_buffs[0][1] = fr->short_buffs[0][0] + 0x110;
+ fr->short_buffs[1][0] = fr->short_buffs[0][1] + 0x110;
+ fr->short_buffs[1][1] = fr->short_buffs[1][0] + 0x110;
+ fr->real_buffs[0][0] = aligned_pointer(fr->rawbuffs,real,16);
+ fr->real_buffs[0][1] = fr->real_buffs[0][0] + 0x110;
+ fr->real_buffs[1][0] = fr->real_buffs[0][1] + 0x110;
+ fr->real_buffs[1][1] = fr->real_buffs[1][0] + 0x110;
+#ifdef OPT_I486
+ if(fr->cpu_opts.type == ivier)
+ {
+ fr->int_buffs[0][0] = (int*) fr->rawbuffs;
+ fr->int_buffs[0][1] = fr->int_buffs[0][0] + 17*FIR_BUFFER_SIZE;
+ fr->int_buffs[1][0] = fr->int_buffs[0][1] + 17*FIR_BUFFER_SIZE;
+ fr->int_buffs[1][1] = fr->int_buffs[1][0] + 17*FIR_BUFFER_SIZE;
+ }
+#endif
+#ifdef OPT_ALTIVEC
+ if(fr->cpu_opts.type == altivec)
+ {
+ int i,j;
+ fr->areal_buffs[0][0] = (real*) fr->rawbuffs;
+ for(i=0; i<4; ++i) for(j=0; j<4; ++j)
+ fr->areal_buffs[i][j] = fr->areal_buffs[0][0] + (i*4+j)*0x110;
+ }
+#endif
+ /* now the different decwins... all of the same size, actually */
+ /* The MMX ones want 32byte alignment, which I'll try to ensure manually */
+ {
+ int decwin_size = (512+32)*sizeof(real);
+#ifdef OPT_MMXORSSE
+#ifdef OPT_MULTI
+ if(fr->cpu_opts.class == mmxsse)
+ {
+#endif
+ /* decwin_mmx will share, decwins will be appended ... sizeof(float)==4 */
+ if(decwin_size < (512+32)*4) decwin_size = (512+32)*4;
+
+ /* the second window + alignment zone -- we align for 32 bytes for SSE as
+ requirement, 64 byte for matching cache line size (that matters!) */
+ decwin_size += (512+32)*4 + 63;
+ /* (512+32)*4/32 == 2176/32 == 68, so one decwin block retains alignment for 32 or 64 bytes */
+#ifdef OPT_MULTI
+ }
+#endif
+#endif
+#if defined(OPT_ALTIVEC) || defined(OPT_ARM)
+ /* sizeof(real) >= 4 ... yes, it could be 8, for example.
+ We got it intialized to at least (512+32)*sizeof(real).*/
+ decwin_size += 512*sizeof(real);
+#endif
+ /* Hm, that's basically realloc() ... */
+ if(fr->rawdecwin != NULL && fr->rawdecwins != decwin_size)
+ {
+ free(fr->rawdecwin);
+ fr->rawdecwin = NULL;
+ }
+
+ if(fr->rawdecwin == NULL)
+ fr->rawdecwin = (unsigned char*) malloc(decwin_size);
+
+ if(fr->rawdecwin == NULL) return -1;
+
+ fr->rawdecwins = decwin_size;
+ fr->decwin = (real*) fr->rawdecwin;
+#ifdef OPT_MMXORSSE
+#ifdef OPT_MULTI
+ if(fr->cpu_opts.class == mmxsse)
+ {
+#endif
+ /* align decwin, assign that to decwin_mmx, append decwins */
+ /* I need to add to decwin what is missing to the next full 64 byte -- also I want to make gcc -pedantic happy... */
+ fr->decwin = aligned_pointer(fr->rawdecwin,real,64);
+ debug1("aligned decwin: %p", (void*)fr->decwin);
+ fr->decwin_mmx = (float*)fr->decwin;
+ fr->decwins = fr->decwin_mmx+512+32;
+#ifdef OPT_MULTI
+ }
+ else debug("no decwins/decwin_mmx for that class");
+#endif
+#endif
+ }
+
+ /* Layer scratch buffers are of compile-time fixed size, so allocate only once. */
+ if(fr->layerscratch == NULL)
+ {
+ /* Allocate specific layer1/2/3 buffers, so that we know they'll work for SSE. */
+ size_t scratchsize = 0;
+ real *scratcher;
+#ifndef NO_LAYER1
+ scratchsize += sizeof(real) * 2 * SBLIMIT;
+#endif
+#ifndef NO_LAYER2
+ scratchsize += sizeof(real) * 2 * 4 * SBLIMIT;
+#endif
+#ifndef NO_LAYER3
+ scratchsize += sizeof(real) * 2 * SBLIMIT * SSLIMIT; /* hybrid_in */
+ scratchsize += sizeof(real) * 2 * SSLIMIT * SBLIMIT; /* hybrid_out */
+#endif
+ /*
+ Now figure out correct alignment:
+ We need 16 byte minimum, smallest unit of the blocks is 2*SBLIMIT*sizeof(real), which is 64*4=256. Let's do 64bytes as heuristic for cache line (as proven useful in buffs above).
+ */
+ fr->layerscratch = malloc(scratchsize+63);
+ if(fr->layerscratch == NULL) return -1;
+
+ /* Get aligned part of the memory, then divide it up. */
+ scratcher = aligned_pointer(fr->layerscratch,real,64);
+ /* Those funky pointer casts silence compilers...
+ One might change the code at hand to really just use 1D arrays, but in practice, that would not make a (positive) difference. */
+#ifndef NO_LAYER1
+ fr->layer1.fraction = (real(*)[SBLIMIT])scratcher;
+ scratcher += 2 * SBLIMIT;
+#endif
+#ifndef NO_LAYER2
+ fr->layer2.fraction = (real(*)[4][SBLIMIT])scratcher;
+ scratcher += 2 * 4 * SBLIMIT;
+#endif
+#ifndef NO_LAYER3
+ fr->layer3.hybrid_in = (real(*)[SBLIMIT][SSLIMIT])scratcher;
+ scratcher += 2 * SBLIMIT * SSLIMIT;
+ fr->layer3.hybrid_out = (real(*)[SSLIMIT][SBLIMIT])scratcher;
+ scratcher += 2 * SSLIMIT * SBLIMIT;
+#endif
+ /* Note: These buffers don't need resetting here. */
+ }
+
+ /* Only reset the buffers we created just now. */
+ frame_decode_buffers_reset(fr);
+
+ debug1("frame %p buffer done", (void*)fr);
+ return 0;
+}
+
+int frame_buffers_reset(mpg123_handle *fr)
+{
+ fr->buffer.fill = 0; /* hm, reset buffer fill... did we do a flush? */
+ fr->bsnum = 0;
+ /* Wondering: could it be actually _wanted_ to retain buffer contents over different files? (special gapless / cut stuff) */
+ fr->bsbuf = fr->bsspace[1];
+ fr->bsbufold = fr->bsbuf;
+ fr->bitreservoir = 0;
+ frame_decode_buffers_reset(fr);
+ memset(fr->bsspace, 0, 2*(MAXFRAMESIZE+512));
+ memset(fr->ssave, 0, 34);
+ fr->hybrid_blc[0] = fr->hybrid_blc[1] = 0;
+ memset(fr->hybrid_block, 0, sizeof(real)*2*2*SBLIMIT*SSLIMIT);
+ return 0;
+}
+
+static void frame_icy_reset(mpg123_handle* fr)
+{
+#ifndef NO_ICY
+ if(fr->icy.data != NULL) free(fr->icy.data);
+ fr->icy.data = NULL;
+ fr->icy.interval = 0;
+ fr->icy.next = 0;
+#endif
+}
+
+static void frame_free_toc(mpg123_handle *fr)
+{
+ if(fr->xing_toc != NULL){ free(fr->xing_toc); fr->xing_toc = NULL; }
+}
+
+/* Just copy the Xing TOC over... */
+int frame_fill_toc(mpg123_handle *fr, unsigned char* in)
+{
+ if(fr->xing_toc == NULL) fr->xing_toc = malloc(100);
+ if(fr->xing_toc != NULL)
+ {
+ memcpy(fr->xing_toc, in, 100);
+#ifdef DEBUG
+ debug("Got a TOC! Showing the values...");
+ {
+ int i;
+ for(i=0; i<100; ++i)
+ debug2("entry %i = %i", i, fr->xing_toc[i]);
+ }
+#endif
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/* Prepare the handle for a new track.
+ Reset variables, buffers... */
+int frame_reset(mpg123_handle* fr)
+{
+ frame_buffers_reset(fr);
+ frame_fixed_reset(fr);
+ frame_free_toc(fr);
+#ifdef FRAME_INDEX
+ fi_reset(&fr->index);
+#endif
+
+ return 0;
+}
+
+/* Reset everythign except dynamic memory. */
+static void frame_fixed_reset(mpg123_handle *fr)
+{
+ frame_icy_reset(fr);
+ open_bad(fr);
+ fr->to_decode = FALSE;
+ fr->to_ignore = FALSE;
+ fr->metaflags = 0;
+ fr->outblock = 0; /* This will be set before decoding! */
+ fr->num = -1;
+ fr->input_offset = -1;
+ fr->playnum = -1;
+ fr->state_flags = FRAME_ACCURATE;
+ fr->silent_resync = 0;
+ fr->audio_start = 0;
+ fr->clip = 0;
+ fr->oldhead = 0;
+ fr->firsthead = 0;
+ fr->lay = 0;
+ fr->vbr = MPG123_CBR;
+ fr->abr_rate = 0;
+ fr->track_frames = 0;
+ fr->track_samples = -1;
+ fr->framesize=0;
+ fr->mean_frames = 0;
+ fr->mean_framesize = 0;
+ fr->freesize = 0;
+ fr->lastscale = -1;
+ fr->rva.level[0] = -1;
+ fr->rva.level[1] = -1;
+ fr->rva.gain[0] = 0;
+ fr->rva.gain[1] = 0;
+ fr->rva.peak[0] = 0;
+ fr->rva.peak[1] = 0;
+ fr->fsizeold = 0;
+ fr->firstframe = 0;
+ fr->ignoreframe = fr->firstframe-fr->p.preframes;
+ fr->header_change = 0;
+ fr->lastframe = -1;
+ fr->fresh = 1;
+ fr->new_format = 0;
+#ifdef GAPLESS
+ frame_gapless_init(fr,-1,0,0);
+ fr->lastoff = 0;
+ fr->firstoff = 0;
+#endif
+#ifdef OPT_I486
+ fr->i486bo[0] = fr->i486bo[1] = FIR_SIZE-1;
+#endif
+ fr->bo = 1; /* the usual bo */
+#ifdef OPT_DITHER
+ fr->ditherindex = 0;
+#endif
+ reset_id3(fr);
+ reset_icy(&fr->icy);
+ /* ICY stuff should go into icy.c, eh? */
+#ifndef NO_ICY
+ fr->icy.interval = 0;
+ fr->icy.next = 0;
+#endif
+ fr->halfphase = 0; /* here or indeed only on first-time init? */
+ fr->error_protection = 0;
+ fr->freeformat_framesize = fr->p.freeformat_framesize;
+ fr->enc_delay = -1;
+ fr->enc_padding = -1;
+ memset(fr->id3buf, 0, sizeof(fr->id3buf));
+ if(fr->id3v2_raw)
+ free(fr->id3v2_raw);
+ fr->id3v2_raw = NULL;
+ fr->id3v2_size = 0;
+}
+
+static void frame_free_buffers(mpg123_handle *fr)
+{
+ if(fr->rawbuffs != NULL) free(fr->rawbuffs);
+ fr->rawbuffs = NULL;
+ fr->rawbuffss = 0;
+ if(fr->rawdecwin != NULL) free(fr->rawdecwin);
+ fr->rawdecwin = NULL;
+ fr->rawdecwins = 0;
+#ifndef NO_8BIT
+ if(fr->conv16to8_buf != NULL) free(fr->conv16to8_buf);
+ fr->conv16to8_buf = NULL;
+#endif
+ if(fr->layerscratch != NULL) free(fr->layerscratch);
+}
+
+void frame_exit(mpg123_handle *fr)
+{
+ if(fr->buffer.rdata != NULL)
+ {
+ debug1("freeing buffer at %p", (void*)fr->buffer.rdata);
+ free(fr->buffer.rdata);
+ }
+ fr->buffer.rdata = NULL;
+ frame_free_buffers(fr);
+ frame_free_toc(fr);
+#ifdef FRAME_INDEX
+ fi_exit(&fr->index);
+#endif
+#ifdef OPT_DITHER
+ if(fr->dithernoise != NULL)
+ {
+ free(fr->dithernoise);
+ fr->dithernoise = NULL;
+ }
+#endif
+ exit_id3(fr);
+ clear_icy(&fr->icy);
+ /* Clean up possible mess from LFS wrapper. */
+ if(fr->wrapperclean != NULL)
+ {
+ fr->wrapperclean(fr->wrapperdata);
+ fr->wrapperdata = NULL;
+ }
+#ifndef NO_FEEDER
+ bc_cleanup(&fr->rdat.buffer);
+#endif
+}
+
+int attribute_align_arg mpg123_framedata(mpg123_handle *mh, unsigned long *header, unsigned char **bodydata, size_t *bodybytes)
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+ if(!mh->to_decode) return MPG123_ERR;
+
+ if(header != NULL) *header = mh->oldhead;
+ if(bodydata != NULL) *bodydata = mh->bsbuf;
+ if(bodybytes != NULL) *bodybytes = mh->framesize;
+
+ return MPG123_OK;
+}
+
+int attribute_align_arg mpg123_set_moreinfo( mpg123_handle *mh
+, struct mpg123_moreinfo *mi)
+{
+#ifndef NO_MOREINFO
+ mh->pinfo = mi;
+ return MPG123_OK;
+#else
+ mh->err = MPG123_MISSING_FEATURE;
+ return MPG123_ERR;
+#endif
+}
+
+/*
+ Fuzzy frame offset searching (guessing).
+ When we don't have an accurate position, we may use an inaccurate one.
+ Possibilities:
+ - use approximate positions from Xing TOC (not yet parsed)
+ - guess wildly from mean framesize and offset of first frame / beginning of file.
+*/
+
+static off_t frame_fuzzy_find(mpg123_handle *fr, off_t want_frame, off_t* get_frame)
+{
+ /* Default is to go to the beginning. */
+ off_t ret = fr->audio_start;
+ *get_frame = 0;
+
+ /* But we try to find something better. */
+ /* Xing VBR TOC works with relative positions, both in terms of audio frames and stream bytes.
+ Thus, it only works when whe know the length of things.
+ Oh... I assume the offsets are relative to the _total_ file length. */
+ if(fr->xing_toc != NULL && fr->track_frames > 0 && fr->rdat.filelen > 0)
+ {
+ /* One could round... */
+ int toc_entry = (int) ((double)want_frame*100./fr->track_frames);
+ /* It is an index in the 100-entry table. */
+ if(toc_entry < 0) toc_entry = 0;
+ if(toc_entry > 99) toc_entry = 99;
+
+ /* Now estimate back what frame we get. */
+ *get_frame = (off_t) ((double)toc_entry/100. * fr->track_frames);
+ fr->state_flags &= ~FRAME_ACCURATE;
+ fr->silent_resync = 1;
+ /* Question: Is the TOC for whole file size (with/without ID3) or the "real" audio data only?
+ ID3v1 info could also matter. */
+ ret = (off_t) ((double)fr->xing_toc[toc_entry]/256.* fr->rdat.filelen);
+ }
+ else if(fr->mean_framesize > 0)
+ { /* Just guess with mean framesize (may be exact with CBR files). */
+ /* Query filelen here or not? */
+ fr->state_flags &= ~FRAME_ACCURATE; /* Fuzzy! */
+ fr->silent_resync = 1;
+ *get_frame = want_frame;
+ ret = (off_t) (fr->audio_start+fr->mean_framesize*want_frame);
+ }
+ debug5("fuzzy: want %li of %li, get %li at %li B of %li B",
+ (long)want_frame, (long)fr->track_frames, (long)*get_frame, (long)ret, (long)(fr->rdat.filelen-fr->audio_start));
+ return ret;
+}
+
+/*
+ find the best frame in index just before the wanted one, seek to there
+ then step to just before wanted one with read_frame
+ do not care tabout the stuff that was in buffer but not played back
+ everything that left the decoder is counted as played
+
+ Decide if you want low latency reaction and accurate timing info or stable long-time playback with buffer!
+*/
+
+off_t frame_index_find(mpg123_handle *fr, off_t want_frame, off_t* get_frame)
+{
+ /* default is file start if no index position */
+ off_t gopos = 0;
+ *get_frame = 0;
+#ifdef FRAME_INDEX
+ /* Possibly use VBRI index, too? I'd need an example for this... */
+ if(fr->index.fill)
+ {
+ /* find in index */
+ size_t fi;
+ /* at index fi there is frame step*fi... */
+ fi = want_frame/fr->index.step;
+ if(fi >= fr->index.fill) /* If we are beyond the end of frame index...*/
+ {
+ /* When fuzzy seek is allowed, we have some limited tolerance for the frames we want to read rather then jump over. */
+ if(fr->p.flags & MPG123_FUZZY && want_frame - (fr->index.fill-1)*fr->index.step > 10)
+ {
+ gopos = frame_fuzzy_find(fr, want_frame, get_frame);
+ if(gopos > fr->audio_start) return gopos; /* Only in that case, we have a useful guess. */
+ /* Else... just continue, fuzzyness didn't help. */
+ }
+ /* Use the last available position, slowly advancing from that one. */
+ fi = fr->index.fill - 1;
+ }
+ /* We have index position, that yields frame and byte offsets. */
+ *get_frame = fi*fr->index.step;
+ gopos = fr->index.data[fi];
+ fr->state_flags |= FRAME_ACCURATE; /* When using the frame index, we are accurate. */
+ }
+ else
+ {
+#endif
+ if(fr->p.flags & MPG123_FUZZY)
+ return frame_fuzzy_find(fr, want_frame, get_frame);
+ /* A bit hackish here... but we need to be fresh when looking for the first header again. */
+ fr->firsthead = 0;
+ fr->oldhead = 0;
+#ifdef FRAME_INDEX
+ }
+#endif
+ debug2("index: 0x%lx for frame %li", (unsigned long)gopos, (long) *get_frame);
+ return gopos;
+}
+
+off_t frame_ins2outs(mpg123_handle *fr, off_t ins)
+{
+ off_t outs = 0;
+ switch(fr->down_sample)
+ {
+ case 0:
+# ifndef NO_DOWNSAMPLE
+ case 1:
+ case 2:
+# endif
+ outs = ins>>fr->down_sample;
+ break;
+# ifndef NO_NTOM
+ case 3: outs = ntom_ins2outs(fr, ins); break;
+# endif
+ default: if(NOQUIET)
+ merror( "Bad down_sample (%i) ... should not be possible!!"
+ , fr->down_sample );
+ }
+ return outs;
+}
+
+off_t frame_outs(mpg123_handle *fr, off_t num)
+{
+ off_t outs = 0;
+ switch(fr->down_sample)
+ {
+ case 0:
+# ifndef NO_DOWNSAMPLE
+ case 1:
+ case 2:
+# endif
+ outs = (fr->spf>>fr->down_sample)*num;
+ break;
+#ifndef NO_NTOM
+ case 3: outs = ntom_frmouts(fr, num); break;
+#endif
+ default: if(NOQUIET)
+ merror( "Bad down_sample (%i) ... should not be possible!!"
+ , fr->down_sample );
+ }
+ return outs;
+}
+
+/* Compute the number of output samples we expect from this frame.
+ This is either simple spf() or a tad more elaborate for ntom. */
+off_t frame_expect_outsamples(mpg123_handle *fr)
+{
+ off_t outs = 0;
+ switch(fr->down_sample)
+ {
+ case 0:
+# ifndef NO_DOWNSAMPLE
+ case 1:
+ case 2:
+# endif
+ outs = fr->spf>>fr->down_sample;
+ break;
+#ifndef NO_NTOM
+ case 3: outs = ntom_frame_outsamples(fr); break;
+#endif
+ default: if(NOQUIET)
+ merror( "Bad down_sample (%i) ... should not be possible!!"
+ , fr->down_sample );
+ }
+ return outs;
+}
+
+off_t frame_offset(mpg123_handle *fr, off_t outs)
+{
+ off_t num = 0;
+ switch(fr->down_sample)
+ {
+ case 0:
+# ifndef NO_DOWNSAMPLE
+ case 1:
+ case 2:
+# endif
+ num = outs/(fr->spf>>fr->down_sample);
+ break;
+#ifndef NO_NTOM
+ case 3: num = ntom_frameoff(fr, outs); break;
+#endif
+ default: if(NOQUIET)
+ error("Bad down_sample ... should not be possible!!");
+ }
+ return num;
+}
+
+#ifdef GAPLESS
+/* input in _input_ samples */
+void frame_gapless_init(mpg123_handle *fr, off_t framecount, off_t bskip, off_t eskip)
+{
+ debug3("frame_gapless_init: given %"OFF_P" frames, skip %"OFF_P" and %"OFF_P, (off_p)framecount, (off_p)bskip, (off_p)eskip);
+ fr->gapless_frames = framecount;
+ if(fr->gapless_frames > 0 && bskip >=0 && eskip >= 0)
+ {
+ fr->begin_s = bskip+GAPLESS_DELAY;
+ fr->end_s = framecount*fr->spf-eskip+GAPLESS_DELAY;
+ }
+ else fr->begin_s = fr->end_s = 0;
+ /* These will get proper values later, from above plus resampling info. */
+ fr->begin_os = 0;
+ fr->end_os = 0;
+ fr->fullend_os = 0;
+ debug2("frame_gapless_init: from %"OFF_P" to %"OFF_P" samples", (off_p)fr->begin_s, (off_p)fr->end_s);
+}
+
+void frame_gapless_realinit(mpg123_handle *fr)
+{
+ fr->begin_os = frame_ins2outs(fr, fr->begin_s);
+ fr->end_os = frame_ins2outs(fr, fr->end_s);
+ if(fr->gapless_frames > 0)
+ fr->fullend_os = frame_ins2outs(fr, fr->gapless_frames*fr->spf);
+ else fr->fullend_os = 0;
+
+ debug4("frame_gapless_realinit: from %"OFF_P" to %"OFF_P" samples (%"OFF_P", %"OFF_P")", (off_p)fr->begin_os, (off_p)fr->end_os, (off_p)fr->fullend_os, (off_p)fr->gapless_frames);
+}
+
+/* At least note when there is trouble... */
+void frame_gapless_update(mpg123_handle *fr, off_t total_samples)
+{
+ off_t gapless_samples = fr->gapless_frames*fr->spf;
+ if(fr->gapless_frames < 1) return;
+
+ debug2("gapless update with new sample count %"OFF_P" as opposed to known %"OFF_P, (off_p)total_samples, (off_p)gapless_samples);
+ if(NOQUIET && total_samples != gapless_samples)
+ fprintf(stderr, "\nWarning: Real sample count %"OFF_P" differs from given gapless sample count %"OFF_P". Frankenstein stream?\n"
+ , (off_p)total_samples, (off_p)gapless_samples);
+
+ if(gapless_samples > total_samples)
+ {
+ if(NOQUIET)
+ merror( "End sample count smaller than gapless end! (%"OFF_P
+ " < %"OFF_P"). Disabling gapless mode from now on."
+ , (off_p)total_samples, (off_p)fr->end_s );
+ /* This invalidates the current position... but what should I do? */
+ frame_gapless_init(fr, -1, 0, 0);
+ frame_gapless_realinit(fr);
+ fr->lastframe = -1;
+ fr->lastoff = 0;
+ }
+}
+
+#endif
+
+/* Compute the needed frame to ignore from, for getting accurate/consistent output for intended firstframe. */
+static off_t ignoreframe(mpg123_handle *fr)
+{
+ off_t preshift = fr->p.preframes;
+ /* Layer 3 _really_ needs at least one frame before. */
+ if(fr->lay==3 && preshift < 1) preshift = 1;
+ /* Layer 1 & 2 reall do not need more than 2. */
+ if(fr->lay!=3 && preshift > 2) preshift = 2;
+
+ return fr->firstframe - preshift;
+}
+
+/* The frame seek... This is not simply the seek to fe*fr->spf samples in output because we think of _input_ frames here.
+ Seek to frame offset 1 may be just seek to 200 samples offset in output since the beginning of first frame is delay/padding.
+ Hm, is that right? OK for the padding stuff, but actually, should the decoder delay be better totally hidden or not?
+ With gapless, even the whole frame position could be advanced further than requested (since Homey don't play dat). */
+void frame_set_frameseek(mpg123_handle *fr, off_t fe)
+{
+ fr->firstframe = fe;
+#ifdef GAPLESS
+ if(fr->p.flags & MPG123_GAPLESS && fr->gapless_frames > 0)
+ {
+ /* Take care of the beginning... */
+ off_t beg_f = frame_offset(fr, fr->begin_os);
+ if(fe <= beg_f)
+ {
+ fr->firstframe = beg_f;
+ fr->firstoff = fr->begin_os - frame_outs(fr, beg_f);
+ }
+ else fr->firstoff = 0;
+ /* The end is set once for a track at least, on the frame_set_frameseek called in get_next_frame() */
+ if(fr->end_os > 0)
+ {
+ fr->lastframe = frame_offset(fr,fr->end_os);
+ fr->lastoff = fr->end_os - frame_outs(fr, fr->lastframe);
+ } else {fr->lastframe = -1; fr->lastoff = 0; }
+ } else { fr->firstoff = fr->lastoff = 0; fr->lastframe = -1; }
+#endif
+ fr->ignoreframe = ignoreframe(fr);
+#ifdef GAPLESS
+ debug5("frame_set_frameseek: begin at %li frames and %li samples, end at %li and %li; ignore from %li",
+ (long) fr->firstframe, (long) fr->firstoff,
+ (long) fr->lastframe, (long) fr->lastoff, (long) fr->ignoreframe);
+#else
+ debug3("frame_set_frameseek: begin at %li frames, end at %li; ignore from %li",
+ (long) fr->firstframe, (long) fr->lastframe, (long) fr->ignoreframe);
+#endif
+}
+
+void frame_skip(mpg123_handle *fr)
+{
+#ifndef NO_LAYER3
+ if(fr->lay == 3) set_pointer(fr, 1, 512);
+#endif
+}
+
+/* Sample accurate seek prepare for decoder. */
+/* This gets unadjusted output samples and takes resampling into account */
+void frame_set_seek(mpg123_handle *fr, off_t sp)
+{
+ fr->firstframe = frame_offset(fr, sp);
+ debug1("frame_set_seek: from %"OFF_P, fr->num);
+#ifndef NO_NTOM
+ if(fr->down_sample == 3) ntom_set_ntom(fr, fr->firstframe);
+#endif
+ fr->ignoreframe = ignoreframe(fr);
+#ifdef GAPLESS /* The sample offset is used for non-gapless mode, too! */
+ fr->firstoff = sp - frame_outs(fr, fr->firstframe);
+ debug5("frame_set_seek: begin at %li frames and %li samples, end at %li and %li; ignore from %li",
+ (long) fr->firstframe, (long) fr->firstoff,
+ (long) fr->lastframe, (long) fr->lastoff, (long) fr->ignoreframe);
+#else
+ debug3("frame_set_seek: begin at %li frames, end at %li; ignore from %li",
+ (long) fr->firstframe, (long) fr->lastframe, (long) fr->ignoreframe);
+#endif
+}
+
+int attribute_align_arg mpg123_volume_change(mpg123_handle *mh, double change)
+{
+ if(mh == NULL) return MPG123_ERR;
+ return mpg123_volume(mh, change + (double) mh->p.outscale);
+}
+
+int attribute_align_arg mpg123_volume_change_db(mpg123_handle *mh, double change)
+{
+ if(mh == NULL) return MPG123_ERR;
+ return mpg123_volume(mh, dbchange(mh->p.outscale, change));
+}
+
+int attribute_align_arg mpg123_volume(mpg123_handle *mh, double vol)
+{
+ if(mh == NULL) return MPG123_ERR;
+
+ if(vol >= 0) mh->p.outscale = vol;
+ else mh->p.outscale = 0.;
+
+ do_rva(mh);
+ return MPG123_OK;
+}
+
+static int get_rva(mpg123_handle *fr, double *peak, double *gain)
+{
+ double p = -1;
+ double g = 0;
+ int ret = 0;
+ if(fr->p.rva)
+ {
+ int rt = 0;
+ /* Should one assume a zero RVA as no RVA? */
+ if(fr->p.rva == 2 && fr->rva.level[1] != -1) rt = 1;
+ if(fr->rva.level[rt] != -1)
+ {
+ p = fr->rva.peak[rt];
+ g = fr->rva.gain[rt];
+ ret = 1; /* Success. */
+ }
+ }
+ if(peak != NULL) *peak = p;
+ if(gain != NULL) *gain = g;
+ return ret;
+}
+
+/* adjust the volume, taking both fr->outscale and rva values into account */
+void do_rva(mpg123_handle *fr)
+{
+ double peak = 0;
+ double gain = 0;
+ double newscale;
+ double rvafact = 1;
+ if(get_rva(fr, &peak, &gain))
+ {
+ if(NOQUIET && fr->p.verbose > 1) fprintf(stderr, "Note: doing RVA with gain %f\n", gain);
+ rvafact = pow(10,gain/20);
+ }
+
+ newscale = fr->p.outscale*rvafact;
+
+ /* if peak is unknown (== 0) this check won't hurt */
+ if((peak*newscale) > 1.0)
+ {
+ newscale = 1.0/peak;
+ warning2("limiting scale value to %f to prevent clipping with indicated peak factor of %f", newscale, peak);
+ }
+ /* first rva setting is forced with fr->lastscale < 0 */
+ if(newscale != fr->lastscale || fr->decoder_change)
+ {
+ debug3("changing scale value from %f to %f (peak estimated to %f)", fr->lastscale != -1 ? fr->lastscale : fr->p.outscale, newscale, (double) (newscale*peak));
+ fr->lastscale = newscale;
+ /* It may be too early, actually. */
+ if(fr->make_decode_tables != NULL) fr->make_decode_tables(fr); /* the actual work */
+ }
+}
+
+
+int attribute_align_arg mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db)
+{
+ if(mh == NULL) return MPG123_ERR;
+ if(base) *base = mh->p.outscale;
+ if(really) *really = mh->lastscale;
+ get_rva(mh, NULL, rva_db);
+ return MPG123_OK;
+}
+
+off_t attribute_align_arg mpg123_framepos(mpg123_handle *mh)
+{
+ if(mh == NULL) return MPG123_ERR;
+
+ return mh->input_offset;
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/frame.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/frame.h
new file mode 100644
index 00000000..e34ea16f
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/frame.h
@@ -0,0 +1,431 @@
+/*
+ frame: Central data structures and opmitization hooks.
+
+ copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis
+*/
+
+#ifndef MPG123_FRAME_H
+#define MPG123_FRAME_H
+
+#include <stdio.h>
+#include "config.h"
+#include "mpg123.h"
+#include "optimize.h"
+#include "getcpuflags.h"
+#include "id3.h"
+#include "icy.h"
+#include "reader.h"
+#ifdef FRAME_INDEX
+#include "index.h"
+#endif
+#include "synths.h"
+
+#ifdef OPT_DITHER
+#include "dither.h"
+int frame_dither_init(mpg123_handle *fr);
+#endif
+
+/* max = 1728 */
+#define MAXFRAMESIZE 3456
+
+struct al_table
+{
+ short bits;
+ short d;
+};
+
+/* the output buffer, used to be pcm_sample, pcm_point and audiobufsize */
+struct outbuffer
+{
+ unsigned char *data; /* main data pointer, aligned */
+ unsigned char *p; /* read pointer */
+ size_t fill; /* fill from read pointer */
+ size_t size;
+ unsigned char *rdata; /* unaligned base pointer */
+};
+
+struct audioformat
+{
+ int encoding; /* Final encoding, after post-processing. */
+ int encsize; /* Size of one sample in bytes, plain int should be fine here... */
+ int dec_enc; /* Encoding of decoder synth. */
+ int dec_encsize; /* Size of one decoder sample. */
+ int channels;
+ long rate;
+};
+
+void invalidate_format(struct audioformat *af);
+
+struct mpg123_pars_struct
+{
+ int verbose; /* verbose level */
+ long flags; /* combination of above */
+#ifndef NO_NTOM
+ long force_rate;
+#endif
+ int down_sample;
+ int rva; /* (which) rva to do: 0: nothing, 1: radio/mix/track 2: album/audiophile */
+ long halfspeed;
+ long doublespeed;
+ long timeout;
+#define NUM_CHANNELS 2
+ char audio_caps[NUM_CHANNELS][MPG123_RATES+1][MPG123_ENCODINGS];
+/* long start_frame; */ /* frame offset to begin with */
+/* long frame_number;*/ /* number of frames to decode */
+#ifndef NO_ICY
+ long icy_interval;
+#endif
+ double outscale;
+ long resync_limit;
+ long index_size; /* Long, because: negative values have a meaning. */
+ long preframes;
+#ifndef NO_FEEDER
+ long feedpool;
+ long feedbuffer;
+#endif
+ long freeformat_framesize;
+};
+
+enum frame_state_flags
+{
+ FRAME_ACCURATE = 0x1 /**< 0001 Positions are considered accurate. */
+ ,FRAME_FRANKENSTEIN = 0x2 /**< 0010 This stream is concatenated. */
+ ,FRAME_FRESH_DECODER = 0x4 /**< 0100 Decoder is fleshly initialized. */
+ ,FRAME_DECODER_LIVE = 0x8 /**< 1000 Decoder can be used. */
+};
+
+/* There is a lot to condense here... many ints can be merged as flags; though the main space is still consumed by buffers. */
+struct mpg123_handle_struct
+{
+ int fresh; /* to be moved into flags */
+ int new_format;
+ real hybrid_block[2][2][SBLIMIT*SSLIMIT];
+ int hybrid_blc[2];
+ /* the scratch vars for the decoders, sometimes real, sometimes short... sometimes int/long */
+ short *short_buffs[2][2];
+ real *real_buffs[2][2];
+ unsigned char *rawbuffs;
+ int rawbuffss;
+#ifdef OPT_I486
+ int i486bo[2];
+#endif
+ int bo; /* Just have it always here. */
+#ifdef OPT_DITHER
+ int ditherindex;
+ float *dithernoise;
+#endif
+ unsigned char* rawdecwin; /* the block with all decwins */
+ int rawdecwins; /* size of rawdecwin memory */
+ real *decwin; /* _the_ decode table */
+#ifdef OPT_MMXORSSE
+ /* I am not really sure that I need both of them... used in assembler */
+ float *decwin_mmx;
+ float *decwins;
+#endif
+#ifndef NO_EQUALIZER
+ int have_eq_settings;
+ real equalizer[2][32];
+#endif
+ /* for halfspeed mode */
+ unsigned char ssave[34];
+ int halfphase;
+#ifndef NO_8BIT
+ /* a raw buffer and a pointer into the middle for signed short conversion, only allocated on demand */
+ unsigned char *conv16to8_buf;
+ unsigned char *conv16to8;
+#endif
+ /* There's some possible memory saving for stuff that is not _really_ dynamic. */
+
+ /* layer3 */
+ int longLimit[9][23];
+ int shortLimit[9][14];
+#ifdef REAL_IS_FIXED
+ const real *gainpow2; // Actually static storage elsewhere.
+#else
+ real gainpow2[256+118+4]; /* not really dynamic, just different for mmx */
+#endif
+ /* layer2 */
+ real muls[27][64]; /* also used by layer 1 */
+
+#ifndef NO_NTOM
+ /* decode_ntom */
+ unsigned long ntom_val[2];
+ unsigned long ntom_step;
+#endif
+ /* special i486 fun */
+#ifdef OPT_I486
+ int *int_buffs[2][2];
+#endif
+ /* special altivec... */
+#ifdef OPT_ALTIVEC
+ real *areal_buffs[4][4];
+#endif
+ struct synth_s synths;
+ struct
+ {
+#ifdef OPT_MULTI
+
+#ifndef NO_LAYER3
+#if (defined OPT_3DNOW_VINTAGE || defined OPT_3DNOWEXT_VINTAGE || defined OPT_SSE || defined OPT_X86_64 || defined OPT_AVX || defined OPT_NEON || defined OPT_NEON64)
+ void (*the_dct36)(real *,real *,real *,const real *,real *);
+#endif
+#endif
+
+#endif
+ enum optdec type;
+ enum optcla class;
+ } cpu_opts;
+#ifdef OPT_CPU_FLAGS
+ struct cpuflags cpu_flags;
+#endif
+ int verbose; /* 0: nothing, 1: just print chosen decoder, 2: be verbose */
+
+ const struct al_table *alloc;
+ /* The runtime-chosen decoding, based on input and output format. */
+ func_synth synth;
+ func_synth_stereo synth_stereo;
+ func_synth_mono synth_mono;
+ /* Yes, this function is runtime-switched, too. */
+ void (*make_decode_tables)(mpg123_handle *fr); /* That is the volume control. */
+
+ int stereo; /* I _think_ 1 for mono and 2 for stereo */
+ int jsbound;
+#define SINGLE_STEREO -1
+#define SINGLE_LEFT 0
+#define SINGLE_RIGHT 1
+#define SINGLE_MIX 3
+ int single;
+ int II_sblimit;
+ int down_sample_sblimit;
+ int lsf; /* 0: MPEG 1.0; 1: MPEG 2.0/2.5 -- both used as bool and array index! */
+ /* Many flags in disguise as integers... wasting bytes. */
+ int mpeg25;
+ int down_sample;
+ int header_change;
+ int lay;
+ long spf; /* cached count of samples per frame */
+ int (*do_layer)(mpg123_handle *);
+ int error_protection;
+ int bitrate_index;
+ int sampling_frequency;
+ int padding;
+ int extension;
+ int mode;
+ int mode_ext;
+ int copyright;
+ int original;
+ int emphasis;
+ int framesize; /* computed framesize */
+ int freesize; /* free format frame size */
+ enum mpg123_vbr vbr; /* 1 if variable bitrate was detected */
+ off_t num; /* frame offset ... */
+ off_t input_offset; /* byte offset of this frame in input stream */
+ off_t playnum; /* playback offset... includes repetitions, reset at seeks */
+ off_t audio_start; /* The byte offset in the file where audio data begins. */
+ int state_flags;
+ char silent_resync; /* Do not complain for the next n resyncs. */
+ unsigned char* xing_toc; /* The seek TOC from Xing header. */
+ int freeformat;
+ long freeformat_framesize;
+
+ /* bitstream info; bsi */
+ int bitindex;
+ long bits_avail;
+ unsigned char *wordpointer;
+ /* temporary storage for getbits stuff */
+ unsigned long ultmp;
+ unsigned char uctmp;
+
+ /* rva data, used in common.c, set in id3.c */
+
+ double maxoutburst; /* The maximum amplitude in current sample represenation. */
+ double lastscale;
+ struct
+ {
+ int level[2];
+ float gain[2];
+ float peak[2];
+ } rva;
+
+ /* input data */
+ off_t track_frames;
+ off_t track_samples;
+ double mean_framesize;
+ off_t mean_frames;
+ int fsizeold;
+ int ssize;
+ unsigned int bitreservoir;
+ unsigned char bsspace[2][MAXFRAMESIZE+512+4]; /* MAXFRAMESIZE */
+ unsigned char *bsbuf;
+ unsigned char *bsbufold;
+ int bsnum;
+ /* That is the header matching the last read frame body. */
+ unsigned long oldhead;
+ /* That is the header that is supposedly the first of the stream. */
+ unsigned long firsthead;
+ int abr_rate;
+#ifdef FRAME_INDEX
+ struct frame_index index;
+#endif
+
+ /* output data */
+ struct outbuffer buffer;
+ struct audioformat af;
+ int own_buffer;
+ size_t outblock; /* number of bytes that this frame produces (upper bound) */
+ int to_decode; /* this frame holds data to be decoded */
+ int to_ignore; /* the same, somehow */
+ off_t firstframe; /* start decoding from here */
+ off_t lastframe; /* last frame to decode (for gapless or num_frames limit) */
+ off_t ignoreframe; /* frames to decode but discard before firstframe */
+#ifdef GAPLESS
+ off_t gapless_frames; /* frame count for the gapless part */
+ off_t firstoff; /* number of samples to ignore from firstframe */
+ off_t lastoff; /* number of samples to use from lastframe */
+ off_t begin_s; /* overall begin offset in samples */
+ off_t begin_os;
+ off_t end_s; /* overall end offset in samples */
+ off_t end_os;
+ off_t fullend_os; /* gapless_frames translated to output samples */
+#endif
+ unsigned int crc; /* Well, I need a safe 16bit type, actually. But wider doesn't hurt. */
+ struct reader *rd; /* pointer to the reading functions */
+ struct reader_data rdat; /* reader data and state info */
+ struct mpg123_pars_struct p;
+ int err;
+ int decoder_change;
+ int delayed_change;
+ long clip;
+ /* the meta crap */
+ int metaflags;
+ unsigned char id3buf[128];
+#ifndef NO_ID3V2
+ mpg123_id3v2 id3v2;
+#endif
+ unsigned char *id3v2_raw;
+ size_t id3v2_size;
+#ifndef NO_ICY
+ struct icy_meta icy;
+#endif
+ /*
+ More variables needed for decoders, layerX.c.
+ This time it is not about static variables but about the need for alignment which cannot be guaranteed on the stack by certain compilers (Sun Studio).
+ We do not require the compiler to align stuff for our hand-written assembly. We only hope that it's able to align stuff for SSE and similar ops it generates itself.
+ */
+ /*
+ Those layer-specific structs could actually share memory, as they are not in use simultaneously. One might allocate on decoder switch, too.
+ They all reside in one lump of memory (after each other), allocated to layerscratch.
+ */
+ real *layerscratch;
+#ifndef NO_LAYER1
+ struct
+ {
+ real (*fraction)[SBLIMIT]; /* ALIGNED(16) real fraction[2][SBLIMIT]; */
+ } layer1;
+#endif
+#ifndef NO_LAYER2
+ struct
+ {
+ real (*fraction)[4][SBLIMIT]; /* ALIGNED(16) real fraction[2][4][SBLIMIT] */
+ } layer2;
+#endif
+#ifndef NO_LAYER3
+ /* These are significant chunks of memory already... */
+ struct
+ {
+ real (*hybrid_in)[SBLIMIT][SSLIMIT]; /* ALIGNED(16) real hybridIn[2][SBLIMIT][SSLIMIT]; */
+ real (*hybrid_out)[SSLIMIT][SBLIMIT]; /* ALIGNED(16) real hybridOut[2][SSLIMIT][SBLIMIT]; */
+ } layer3;
+#endif
+ /* A place for storing additional data for the large file wrapper.
+ This is cruft! */
+ void *wrapperdata;
+ /* A callback used to properly destruct the wrapper data. */
+ void (*wrapperclean)(void*);
+ int enc_delay;
+ int enc_padding;
+#ifndef NO_MOREINFO
+ struct mpg123_moreinfo *pinfo;
+#endif
+};
+
+/* generic init, does not include dynamic buffers */
+void frame_init(mpg123_handle *fr);
+void frame_init_par(mpg123_handle *fr, mpg123_pars *mp);
+/* output buffer and format */
+int frame_outbuffer(mpg123_handle *fr);
+int frame_output_format(mpg123_handle *fr);
+
+int frame_buffers(mpg123_handle *fr); /* various decoder buffers, needed once */
+int frame_reset(mpg123_handle* fr); /* reset for next track */
+int frame_buffers_reset(mpg123_handle *fr);
+void frame_exit(mpg123_handle *fr); /* end, free all buffers */
+
+/* Index functions... */
+/* Well... print it... */
+int mpg123_print_index(mpg123_handle *fr, FILE* out);
+/* Find a seek position in index. */
+off_t frame_index_find(mpg123_handle *fr, off_t want_frame, off_t* get_frame);
+/* Apply index_size setting. */
+int frame_index_setup(mpg123_handle *fr);
+
+void do_volume(mpg123_handle *fr, double factor);
+void do_rva(mpg123_handle *fr);
+
+/* samples per frame ...
+Layer I
+Layer II
+Layer III
+MPEG-1
+384
+1152
+1152
+MPEG-2 LSF
+384
+1152
+576
+MPEG 2.5
+384
+1152
+576
+*/
+
+// Well, I take that one for granted... at least layer3.
+// The value is needed for mpg123_getstate() in any build.
+#define GAPLESS_DELAY 529
+#ifdef GAPLESS
+void frame_gapless_init(mpg123_handle *fr, off_t framecount, off_t bskip, off_t eskip);
+void frame_gapless_realinit(mpg123_handle *fr);
+void frame_gapless_update(mpg123_handle *mh, off_t total_samples);
+/*void frame_gapless_position(mpg123_handle* fr);
+void frame_gapless_bytify(mpg123_handle *fr);
+void frame_gapless_ignore(mpg123_handle *fr, off_t frames);*/
+/* void frame_gapless_buffercheck(mpg123_handle *fr); */
+#endif
+
+/* Number of samples the decoding of the current frame should yield. */
+off_t frame_expect_outsamples(mpg123_handle *fr);
+
+/* Skip this frame... do some fake action to get away without actually decoding it. */
+void frame_skip(mpg123_handle *fr);
+
+/*
+ Seeking core functions:
+ - convert input sample offset to output sample offset
+ - convert frame offset to output sample offset
+ - get leading frame offset for output sample offset
+ The offsets are "unadjusted"/internal; resampling is being taken care of.
+*/
+off_t frame_ins2outs(mpg123_handle *fr, off_t ins);
+off_t frame_outs(mpg123_handle *fr, off_t num);
+/* This one just computes the expected sample count for _this_ frame. */
+off_t frame_expect_outsampels(mpg123_handle *fr);
+off_t frame_offset(mpg123_handle *fr, off_t outs);
+void frame_set_frameseek(mpg123_handle *fr, off_t fe);
+void frame_set_seek(mpg123_handle *fr, off_t sp);
+off_t frame_tell_seek(mpg123_handle *fr);
+/* Take a copy of the Xing VBR TOC for fuzzy seeking. */
+int frame_fill_toc(mpg123_handle *fr, unsigned char* in);
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/gapless.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/gapless.h
new file mode 100644
index 00000000..a98b86bc
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/gapless.h
@@ -0,0 +1,119 @@
+/*
+ sampleadjust: gapless sample offset math
+
+ copyright 1995-2012 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+
+ This is no stand-alone header, precisely to be able to fool it into using fake handle types for testing the math.
+*/
+
+#include "debug.h"
+
+#ifdef GAPLESS
+/* From internal sample number to external. */
+static off_t sample_adjust(mpg123_handle *mh, off_t x)
+{
+ off_t s;
+ if(mh->p.flags & MPG123_GAPLESS)
+ {
+ /* It's a bit tricky to do this computation for the padding samples.
+ They are not there on the outside. */
+ if(x > mh->end_os)
+ {
+ if(x < mh->fullend_os)
+ s = mh->end_os - mh->begin_os;
+ else
+ s = x - (mh->fullend_os - mh->end_os + mh->begin_os);
+ }
+ else
+ s = x - mh->begin_os;
+ }
+ else
+ s = x;
+
+ return s;
+}
+
+/* from external samples to internal */
+static off_t sample_unadjust(mpg123_handle *mh, off_t x)
+{
+ off_t s;
+ if(mh->p.flags & MPG123_GAPLESS)
+ {
+ s = x + mh->begin_os;
+ /* There is a hole; we don't create sample positions in there.
+ Jump from the end of the gapless track directly to after the padding. */
+ if(s >= mh->end_os)
+ s += mh->fullend_os - mh->end_os;
+ }
+ else s = x;
+
+ return s;
+}
+
+/*
+ Take the buffer after a frame decode (strictly: it is the data from frame fr->num!) and cut samples out.
+ fr->buffer.fill may then be smaller than before...
+*/
+static void frame_buffercheck(mpg123_handle *fr)
+{
+ /* When we have no accurate position, gapless code does not make sense. */
+ if(!(fr->state_flags & FRAME_ACCURATE)) return;
+
+ /* Get a grip on dirty streams that start with a gapless header.
+ Simply accept all data from frames that are too much,
+ they are supposedly attached to the stream after the fact. */
+ if(fr->gapless_frames > 0 && fr->num >= fr->gapless_frames) return;
+
+ /* Important: We first cut samples from the end, then cut from beginning (including left-shift of the buffer).
+ This order works also for the case where firstframe == lastframe. */
+
+ /* The last interesting (planned) frame: Only use some leading samples.
+ Note a difference from the below: The last frame and offset are unchanges by seeks.
+ The lastoff keeps being valid. */
+ if(fr->lastframe > -1 && fr->num >= fr->lastframe)
+ {
+ /* There can be more than one frame of padding at the end, so we ignore the whole frame if we are beyond lastframe. */
+ off_t byteoff = (fr->num == fr->lastframe) ? samples_to_bytes(fr, fr->lastoff) : 0;
+ if((off_t)fr->buffer.fill > byteoff)
+ {
+ fr->buffer.fill = byteoff;
+ }
+ if(VERBOSE3) fprintf(stderr, "\nNote: Cut frame %"OFF_P" buffer on end of stream to %"OFF_P" samples, fill now %"SIZE_P" bytes.\n", (off_p)fr->num, (off_p)(fr->num == fr->lastframe ? fr->lastoff : 0), (size_p)fr->buffer.fill);
+ }
+
+ /* The first interesting frame: Skip some leading samples. */
+ if(fr->firstoff && fr->num == fr->firstframe)
+ {
+ off_t byteoff = samples_to_bytes(fr, fr->firstoff);
+ if((off_t)fr->buffer.fill > byteoff)
+ {
+ fr->buffer.fill -= byteoff;
+ /* buffer.p != buffer.data only for own buffer */
+ debug6("cutting %li samples/%li bytes on begin, own_buffer=%i at %p=%p, buf[1]=%i",
+ (long)fr->firstoff, (long)byteoff, fr->own_buffer, (void*)fr->buffer.p, (void*)fr->buffer.data, ((short*)fr->buffer.p)[2]);
+ if(fr->own_buffer) fr->buffer.p = fr->buffer.data + byteoff;
+ else memmove(fr->buffer.data, fr->buffer.data + byteoff, fr->buffer.fill);
+ debug3("done cutting, buffer at %p =? %p, buf[1]=%i",
+ (void*)fr->buffer.p, (void*)fr->buffer.data, ((short*)fr->buffer.p)[2]);
+ }
+ else fr->buffer.fill = 0;
+
+ if(VERBOSE3) fprintf(stderr, "\nNote: Cut frame %"OFF_P" buffer on beginning of stream by %"OFF_P" samples, fill now %"SIZE_P" bytes.\n", (off_p)fr->num, (off_p)fr->firstoff, (size_p)fr->buffer.fill);
+ /* We can only reach this frame again by seeking. And on seeking, firstoff will be recomputed.
+ So it is safe to null it here (and it makes the if() decision abort earlier). */
+ fr->firstoff = 0;
+ }
+}
+
+#define SAMPLE_ADJUST(mh,x) sample_adjust(mh,x)
+#define SAMPLE_UNADJUST(mh,x) sample_unadjust(mh,x)
+#define FRAME_BUFFERCHECK(mh) frame_buffercheck(mh)
+
+#else /* no gapless code included */
+
+#define SAMPLE_ADJUST(mh,x) (x)
+#define SAMPLE_UNADJUST(mh,x) (x)
+#define FRAME_BUFFERCHECK(mh)
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getbits.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getbits.h
new file mode 100644
index 00000000..6d0d548e
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getbits.h
@@ -0,0 +1,103 @@
+/*
+ getbits
+
+ copyright ?-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp
+
+ All code is in the header to suggest/force inlining of these small often-used functions.
+ This indeed has some impact on performance.
+*/
+
+#ifndef _MPG123_GETBITS_H_
+#define _MPG123_GETBITS_H_
+
+#include "mpg123lib_intern.h"
+#include "debug.h"
+
+#define backbits(fr,nob) ((void)( \
+ fr->bits_avail += nob, \
+ fr->bitindex -= nob, \
+ fr->wordpointer += (fr->bitindex>>3), \
+ fr->bitindex &= 0x7 ))
+
+#define getbitoffset(fr) ((-fr->bitindex)&0x7)
+/* Precomputing the bytes to be read is error-prone, and some over-read
+ is even expected for Huffman. Just play safe and return zeros in case
+ of overflow. This assumes you made bitindex zero already! */
+#define getbyte(fr) ( (fr)->bits_avail-=8, (fr)->bits_avail >= 0 \
+ ? *((fr)->wordpointer++) \
+ : 0 )
+
+static unsigned int getbits(mpg123_handle *fr, int number_of_bits)
+{
+ unsigned long rval;
+
+#ifdef DEBUG_GETBITS
+fprintf(stderr,"g%d",number_of_bits);
+#endif
+ fr->bits_avail -= number_of_bits;
+ /* Safety catch until we got the nasty code fully figured out. */
+ /* No, that catch stays here, even if we think we got it figured out! */
+ if(fr->bits_avail < 0)
+ {
+ if(NOQUIET)
+ error2( "Tried to read %i bits with %li available."
+ , number_of_bits, fr->bits_avail );
+ return 0;
+ }
+/* This is actually slow: if(!number_of_bits)
+ return 0; */
+
+#if 0
+ check_buffer_range(number_of_bits+fr->bitindex);
+#endif
+
+ {
+ rval = fr->wordpointer[0];
+ rval <<= 8;
+ rval |= fr->wordpointer[1];
+ rval <<= 8;
+ rval |= fr->wordpointer[2];
+
+ rval <<= fr->bitindex;
+ rval &= 0xffffff;
+
+ fr->bitindex += number_of_bits;
+
+ rval >>= (24-number_of_bits);
+
+ fr->wordpointer += (fr->bitindex>>3);
+ fr->bitindex &= 7;
+ }
+
+#ifdef DEBUG_GETBITS
+fprintf(stderr,":%lx\n",rval);
+#endif
+
+ return rval;
+}
+
+
+#define skipbits(fr, nob) fr->ultmp = ( \
+ fr->ultmp = fr->wordpointer[0], fr->ultmp <<= 8, fr->ultmp |= fr->wordpointer[1], \
+ fr->ultmp <<= 8, fr->ultmp |= fr->wordpointer[2], fr->ultmp <<= fr->bitindex, \
+ fr->ultmp &= 0xffffff, fr->bitindex += nob, fr->bits_avail -= nob, \
+ fr->ultmp >>= (24-nob), fr->wordpointer += (fr->bitindex>>3), \
+ fr->bitindex &= 7 )
+
+#define getbits_fast(fr, nob) ( \
+ fr->ultmp = (unsigned char) (fr->wordpointer[0] << fr->bitindex), \
+ fr->ultmp |= ((unsigned long) fr->wordpointer[1]<<fr->bitindex)>>8, \
+ fr->ultmp <<= nob, fr->ultmp >>= 8, \
+ fr->bitindex += nob, fr->bits_avail -= nob, \
+ fr->wordpointer += (fr->bitindex>>3), \
+ fr->bitindex &= 7, fr->ultmp )
+
+#define get1bit(fr) ( \
+ fr->uctmp = *fr->wordpointer << fr->bitindex, \
+ ++fr->bitindex, --fr->bits_avail, \
+ fr->wordpointer += (fr->bitindex>>3), fr->bitindex &= 7, fr->uctmp>>7 )
+
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getcpuflags.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getcpuflags.S
new file mode 100644
index 00000000..50a9d00a
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getcpuflags.S
@@ -0,0 +1,102 @@
+/*
+ getcpucpuflags: get cpuflags for ia32
+
+ copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http:#mpg123.org
+ initially written by KIMURA Takuhiro (for 3DNow!)
+ extended for general use by Thomas Orgis
+
+ extern int getcpuid(struct cpuflags*)
+ or just
+ extern int getcpuid(unsigned int*)
+ where there is memory for 4 ints
+ -> the first set of idflags (basic cpu family info)
+ and the idflags, stdflags, std2flags, extflags written to the parameter
+ -> 0x00000000 (CPUID instruction not supported)
+*/
+
+#include "mangle.h"
+
+.text
+ ALIGN4
+
+.globl ASM_NAME(getcpuflags)
+/* .type ASM_NAME(getcpuflags),@function */
+ASM_NAME(getcpuflags):
+ pushl %ebp
+ movl %esp,%ebp
+ pushl %edx
+ pushl %ecx
+ pushl %ebx
+ pushl %esi
+/* get the int pointer for storing the flags */
+ movl 8(%ebp), %esi
+/* does that one make sense? */
+ movl $0x80000000,%eax
+/* now save the flags and do a check for cpuid availability */
+ pushfl
+ pushfl
+ popl %eax
+ movl %eax,%ebx
+/* set that bit... */
+ xorl $0x00200000,%eax
+ pushl %eax
+ popfl
+/* ...and read back the flags to see if it is understood */
+ pushfl
+ popl %eax
+ popfl
+ cmpl %ebx,%eax
+ je .Lnocpuid
+/* In principle, I would have to check the CPU's identify first to be sure how to interpret the extended flags. */
+/* now get the info, first extended */
+ movl $0x0, 12(%esi) /* clear value */
+ movl $0x0, 16(%esi) /* clear value */
+/* only if supported... */
+ movl $0x80000000, %eax
+ cpuid
+/* IDT CPUs should not change EAX, generally I hope that non-3DNow cpus do not set a bogus support level here. */
+ cmpl $0x80000001, %eax
+ jb .Lnoextended /* Skip ext check without minimal support level. */
+/* is supported, get flags value */
+ movl $0x80000001,%eax
+ cpuid
+ movl %edx,12(%esi)
+.Lnoextended:
+/* then the other ones, called last to get the id flags in %eax for ret */
+ movl $0x00000001,%eax
+ cpuid
+ movl %eax, (%esi)
+ movl %ecx, 4(%esi)
+ movl %edx, 8(%esi)
+/* check if xgetbv instruction is available */
+ test $0x04000000, %ecx
+ jz .Lend
+ test $0x08000000, %ecx
+ jz .Lend
+ xor %ecx, %ecx
+ .byte 0x0f, 0x01, 0xd0 /* xgetbv instruction */
+ movl %eax, 16(%esi)
+ movl (%esi), %eax
+ jmp .Lend
+ ALIGN4
+.Lnocpuid:
+/* error: set everything to zero */
+ movl $0, %eax
+ movl $0, (%esi)
+ movl $0, 4(%esi)
+ movl $0, 8(%esi)
+ movl $0, 12(%esi)
+ movl $0, 16(%esi)
+ ALIGN4
+.Lend:
+/* return value are the id flags, still stored in %eax */
+ popl %esi
+ popl %ebx
+ popl %ecx
+ popl %edx
+ movl %ebp,%esp
+ popl %ebp
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getcpuflags.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getcpuflags.h
new file mode 100644
index 00000000..fd7d080a
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getcpuflags.h
@@ -0,0 +1,97 @@
+/*
+ getcpucpuflags: get cpuflags for ia32
+
+ copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http:#mpg123.org
+ initially written by KIMURA Takuhiro (for 3DNow!)
+ extended for general use by Thomas Orgis
+*/
+
+#ifndef MPG123_H_GETCPUFLAGS
+#define MPG123_H_GETCPUFLAGS
+
+#include "config.h"
+
+/* standard level flags part 1 (ECX)*/
+#define FLAG_SSE3 0x00000001
+#define FLAG_SSSE3 0x00000200
+#define FLAG_AVX 0x1C000000
+/* standard level flags part 2 (EDX) */
+#define FLAG2_MMX 0x00800000
+#define FLAG2_SSE 0x02000000
+#define FLAG2_SSE2 0x04000000
+#define FLAG2_FPU 0x00000001
+/* cpuid extended level 1 (AMD) */
+#define XFLAG_MMX 0x00800000
+#define XFLAG_3DNOW 0x80000000
+#define XFLAG_3DNOWEXT 0x40000000
+/* eXtended Control Register 0 */
+#define XCR0FLAG_AVX 0x00000006
+
+
+struct cpuflags
+{
+#if defined(OPT_ARM) || defined(OPT_NEON) || defined(OPT_NEON64)
+ unsigned int has_neon;
+#else
+ unsigned int id;
+ unsigned int std;
+ unsigned int std2;
+ unsigned int ext;
+ unsigned int xcr0_lo;
+#endif
+};
+
+unsigned int getcpuflags(struct cpuflags* cf);
+
+#ifdef WANT_GETCPUFLAGS
+#include <string.h>
+// Wrapper needed for ignorant clang memory sanitizer that chokes
+// because it does not know the assembly code intialized the vlaues.
+static unsigned int wrap_getcpuflags(struct cpuflags* cf)
+{
+ memset(cf, 0, sizeof(*cf));
+ return getcpuflags(cf);
+}
+#endif
+
+#if ((defined OPT_X86) || (defined OPT_X86_64) || (defined OPT_NEON) || (defined OPT_NEON64)) && (defined OPT_MULTI)
+
+// We really evaluate the CPU flags.
+#define OPT_CPU_FLAGS
+
+/* checks the family */
+#define cpu_i586(s) ( ((s.id & 0xf00)>>8) == 0 || ((s.id & 0xf00)>>8) > 4 )
+/* checking some flags... */
+#define cpu_fpu(s) (FLAG2_FPU & s.std2)
+#define cpu_mmx(s) (FLAG2_MMX & s.std2 || XFLAG_MMX & s.ext)
+#define cpu_3dnow(s) (XFLAG_3DNOW & s.ext)
+#define cpu_3dnowext(s) (XFLAG_3DNOWEXT & s.ext)
+#define cpu_sse(s) (FLAG2_SSE & s.std2)
+#define cpu_sse2(s) (FLAG2_SSE2 & s.std2)
+#define cpu_sse3(s) (FLAG_SSE3 & s.std)
+#define cpu_avx(s) ((FLAG_AVX & s.std) == FLAG_AVX && (XCR0FLAG_AVX & s.xcr0_lo) == XCR0FLAG_AVX)
+#define cpu_fast_sse(s) ((((s.id & 0xf00)>>8) == 6 && FLAG_SSSE3 & s.std) /* for Intel/VIA; family 6 CPUs with SSSE3 */ || \
+ (((s.id & 0xf00)>>8) == 0xf && (((s.id & 0x0ff00000)>>20) > 0 && ((s.id & 0x0ff00000)>>20) != 5))) /* for AMD; family > 0xF CPUs except Bobcat */
+#define cpu_neon(s) (s.has_neon)
+
+#else
+
+/* Faking stuff for non-multi builds. The same code for synth function choice is used.
+ Just no runtime dependency of result... */
+#define cpu_flags nothing
+#define cpu_i586(s) 1
+#define cpu_fpu(s) 1
+#define cpu_mmx(s) 1
+#define cpu_3dnow(s) 1
+#define cpu_3dnowext(s) 1
+#define cpu_sse(s) 1
+#define cpu_sse2(s) 1
+#define cpu_sse3(s) 1
+#define cpu_avx(s) 1
+#define cpu_neon(s) 1
+
+#endif
+
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getcpuflags_arm.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getcpuflags_arm.c
new file mode 100644
index 00000000..a0bbf43f
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getcpuflags_arm.c
@@ -0,0 +1,61 @@
+/*
+ getcpuflags_arm: get cpuflags for ARM
+
+ copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Momma
+*/
+
+#include <setjmp.h>
+#include <signal.h>
+#include "mpg123lib_intern.h"
+#include "getcpuflags.h"
+
+extern void check_neon(void);
+
+#ifndef _M_ARM
+static sigjmp_buf jmpbuf;
+#else
+static jmp_buf jmpbuf;
+#endif
+
+static void mpg123_arm_catch_sigill(int sig)
+{
+#ifndef _M_ARM
+ siglongjmp(jmpbuf, 1);
+#else
+ longjmp(jmpbuf, 1);
+#endif
+}
+
+unsigned int getcpuflags(struct cpuflags* cf)
+{
+#ifndef _M_ARM
+ struct sigaction act, act_old;
+ act.sa_handler = mpg123_arm_catch_sigill;
+ act.sa_flags = SA_RESTART;
+ sigemptyset(&act.sa_mask);
+ sigaction(SIGILL, &act, &act_old);
+
+ cf->has_neon = 0;
+
+ if(!sigsetjmp(jmpbuf, 1)) {
+ check_neon();
+ cf->has_neon = 1;
+ }
+
+ sigaction(SIGILL, &act_old, NULL);
+#else
+ cf->has_neon = 0;
+
+ if (!setjmp(jmpbuf)) {
+ signal(SIGILL, mpg123_arm_catch_sigill);
+ check_neon();
+ cf->has_neon = 1;
+ }
+
+ signal(SIGILL, SIG_DFL);
+#endif
+
+ return 0;
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getcpuflags_x86_64.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getcpuflags_x86_64.S
new file mode 100644
index 00000000..92fb7650
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/getcpuflags_x86_64.S
@@ -0,0 +1,57 @@
+/*
+ getcpuflags_x86_64: get cpuflags for x86-64
+
+ copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+ .text
+ ALIGN4
+ .globl ASM_NAME(getcpuflags)
+ASM_NAME(getcpuflags):
+ push %rbp
+ mov %rsp, %rbp
+ push %rbx
+
+#ifdef IS_MSABI
+ push %rdi
+ mov %rcx, %rdi
+#endif
+
+ movl $0, 12(%rdi)
+ movl $0, 16(%rdi)
+
+ mov $0x80000000, %eax
+ cpuid
+ cmp $0x80000001, %eax
+ jb 1f
+ mov $0x80000001, %eax
+ cpuid
+ movl %edx, 12(%rdi)
+1:
+ mov $0x00000001, %eax
+ cpuid
+ movl %eax, (%rdi)
+ movl %ecx, 4(%rdi)
+ movl %edx, 8(%rdi)
+ test $0x04000000, %ecx
+ jz 2f
+ test $0x08000000, %ecx
+ jz 2f
+ xor %ecx, %ecx
+ .byte 0x0f, 0x01, 0xd0 /* xgetbv instruction */
+ movl %eax, 16(%rdi)
+ movl (%rdi), %eax
+2:
+#ifdef IS_MSABI
+ pop %rdi
+#endif
+ pop %rbx
+ mov %rbp, %rsp
+ pop %rbp
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/huffman.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/huffman.h
new file mode 100644
index 00000000..576fbd88
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/huffman.h
@@ -0,0 +1,340 @@
+/*
+ huffman.h: huffman tables ... recalcualted to work with optimized decoder scheme (MH)
+
+ copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp
+
+ probably we could save a few bytes of memory, because the
+ smaller tables are often the part of a bigger table
+*/
+
+
+#ifndef _MPG123_HUFFMAN_H_
+#define _MPG123_HUFFMAN_H_
+
+struct newhuff
+{
+ unsigned int linbits;
+ const short *table;
+};
+
+static const short tab0[] =
+{
+ 0
+};
+
+static const short tab1[] =
+{
+ -5, -3, -1, 17, 1, 16, 0
+};
+
+static const short tab2[] =
+{
+ -15, -11, -9, -5, -3, -1, 34, 2, 18, -1, 33, 32, 17, -1, 1,
+ 16, 0
+};
+
+static const short tab3[] =
+{
+ -13, -11, -9, -5, -3, -1, 34, 2, 18, -1, 33, 32, 16, 17, -1,
+ 1, 0
+};
+
+static const short tab5[] =
+{
+ -29, -25, -23, -15, -7, -5, -3, -1, 51, 35, 50, 49, -3, -1, 19,
+ 3, -1, 48, 34, -3, -1, 18, 33, -1, 2, 32, 17, -1, 1, 16,
+ 0
+};
+
+static const short tab6[] =
+{
+ -25, -19, -13, -9, -5, -3, -1, 51, 3, 35, -1, 50, 48, -1, 19,
+ 49, -3, -1, 34, 2, 18, -3, -1, 33, 32, 1, -1, 17, -1, 16,
+ 0
+};
+
+static const short tab7[] =
+{
+ -69, -65, -57, -39, -29, -17, -11, -7, -3, -1, 85, 69, -1, 84, 83,
+ -1, 53, 68, -3, -1, 37, 82, 21, -5, -1, 81, -1, 5, 52, -1,
+ 80, -1, 67, 51, -5, -3, -1, 36, 66, 20, -1, 65, 64, -11, -7,
+ -3, -1, 4, 35, -1, 50, 3, -1, 19, 49, -3, -1, 48, 34, 18,
+ -5, -1, 33, -1, 2, 32, 17, -1, 1, 16, 0
+};
+
+static const short tab8[] =
+{
+ -65, -63, -59, -45, -31, -19, -13, -7, -5, -3, -1, 85, 84, 69, 83,
+ -3, -1, 53, 68, 37, -3, -1, 82, 5, 21, -5, -1, 81, -1, 52,
+ 67, -3, -1, 80, 51, 36, -5, -3, -1, 66, 20, 65, -3, -1, 4,
+ 64, -1, 35, 50, -9, -7, -3, -1, 19, 49, -1, 3, 48, 34, -1,
+ 2, 32, -1, 18, 33, 17, -3, -1, 1, 16, 0
+};
+
+static const short tab9[] =
+{
+ -63, -53, -41, -29, -19, -11, -5, -3, -1, 85, 69, 53, -1, 83, -1,
+ 84, 5, -3, -1, 68, 37, -1, 82, 21, -3, -1, 81, 52, -1, 67,
+ -1, 80, 4, -7, -3, -1, 36, 66, -1, 51, 64, -1, 20, 65, -5,
+ -3, -1, 35, 50, 19, -1, 49, -1, 3, 48, -5, -3, -1, 34, 2,
+ 18, -1, 33, 32, -3, -1, 17, 1, -1, 16, 0
+};
+
+static const short tab10[] =
+{
+-125,-121,-111, -83, -55, -35, -21, -13, -7, -3, -1, 119, 103, -1, 118,
+ 87, -3, -1, 117, 102, 71, -3, -1, 116, 86, -1, 101, 55, -9, -3,
+ -1, 115, 70, -3, -1, 85, 84, 99, -1, 39, 114, -11, -5, -3, -1,
+ 100, 7, 112, -1, 98, -1, 69, 53, -5, -1, 6, -1, 83, 68, 23,
+ -17, -5, -1, 113, -1, 54, 38, -5, -3, -1, 37, 82, 21, -1, 81,
+ -1, 52, 67, -3, -1, 22, 97, -1, 96, -1, 5, 80, -19, -11, -7,
+ -3, -1, 36, 66, -1, 51, 4, -1, 20, 65, -3, -1, 64, 35, -1,
+ 50, 3, -3, -1, 19, 49, -1, 48, 34, -7, -3, -1, 18, 33, -1,
+ 2, 32, 17, -1, 1, 16, 0
+};
+
+static const short tab11[] =
+{
+-121,-113, -89, -59, -43, -27, -17, -7, -3, -1, 119, 103, -1, 118, 117,
+ -3, -1, 102, 71, -1, 116, -1, 87, 85, -5, -3, -1, 86, 101, 55,
+ -1, 115, 70, -9, -7, -3, -1, 69, 84, -1, 53, 83, 39, -1, 114,
+ -1, 100, 7, -5, -1, 113, -1, 23, 112, -3, -1, 54, 99, -1, 96,
+ -1, 68, 37, -13, -7, -5, -3, -1, 82, 5, 21, 98, -3, -1, 38,
+ 6, 22, -5, -1, 97, -1, 81, 52, -5, -1, 80, -1, 67, 51, -1,
+ 36, 66, -15, -11, -7, -3, -1, 20, 65, -1, 4, 64, -1, 35, 50,
+ -1, 19, 49, -5, -3, -1, 3, 48, 34, 33, -5, -1, 18, -1, 2,
+ 32, 17, -3, -1, 1, 16, 0
+};
+
+static const short tab12[] =
+{
+-115, -99, -73, -45, -27, -17, -9, -5, -3, -1, 119, 103, 118, -1, 87,
+ 117, -3, -1, 102, 71, -1, 116, 101, -3, -1, 86, 55, -3, -1, 115,
+ 85, 39, -7, -3, -1, 114, 70, -1, 100, 23, -5, -1, 113, -1, 7,
+ 112, -1, 54, 99, -13, -9, -3, -1, 69, 84, -1, 68, -1, 6, 5,
+ -1, 38, 98, -5, -1, 97, -1, 22, 96, -3, -1, 53, 83, -1, 37,
+ 82, -17, -7, -3, -1, 21, 81, -1, 52, 67, -5, -3, -1, 80, 4,
+ 36, -1, 66, 20, -3, -1, 51, 65, -1, 35, 50, -11, -7, -5, -3,
+ -1, 64, 3, 48, 19, -1, 49, 34, -1, 18, 33, -7, -5, -3, -1,
+ 2, 32, 0, 17, -1, 1, 16
+};
+
+static const short tab13[] =
+{
+-509,-503,-475,-405,-333,-265,-205,-153,-115, -83, -53, -35, -21, -13, -9,
+ -7, -5, -3, -1, 254, 252, 253, 237, 255, -1, 239, 223, -3, -1, 238,
+ 207, -1, 222, 191, -9, -3, -1, 251, 206, -1, 220, -1, 175, 233, -1,
+ 236, 221, -9, -5, -3, -1, 250, 205, 190, -1, 235, 159, -3, -1, 249,
+ 234, -1, 189, 219, -17, -9, -3, -1, 143, 248, -1, 204, -1, 174, 158,
+ -5, -1, 142, -1, 127, 126, 247, -5, -1, 218, -1, 173, 188, -3, -1,
+ 203, 246, 111, -15, -7, -3, -1, 232, 95, -1, 157, 217, -3, -1, 245,
+ 231, -1, 172, 187, -9, -3, -1, 79, 244, -3, -1, 202, 230, 243, -1,
+ 63, -1, 141, 216, -21, -9, -3, -1, 47, 242, -3, -1, 110, 156, 15,
+ -5, -3, -1, 201, 94, 171, -3, -1, 125, 215, 78, -11, -5, -3, -1,
+ 200, 214, 62, -1, 185, -1, 155, 170, -1, 31, 241, -23, -13, -5, -1,
+ 240, -1, 186, 229, -3, -1, 228, 140, -1, 109, 227, -5, -1, 226, -1,
+ 46, 14, -1, 30, 225, -15, -7, -3, -1, 224, 93, -1, 213, 124, -3,
+ -1, 199, 77, -1, 139, 184, -7, -3, -1, 212, 154, -1, 169, 108, -1,
+ 198, 61, -37, -21, -9, -5, -3, -1, 211, 123, 45, -1, 210, 29, -5,
+ -1, 183, -1, 92, 197, -3, -1, 153, 122, 195, -7, -5, -3, -1, 167,
+ 151, 75, 209, -3, -1, 13, 208, -1, 138, 168, -11, -7, -3, -1, 76,
+ 196, -1, 107, 182, -1, 60, 44, -3, -1, 194, 91, -3, -1, 181, 137,
+ 28, -43, -23, -11, -5, -1, 193, -1, 152, 12, -1, 192, -1, 180, 106,
+ -5, -3, -1, 166, 121, 59, -1, 179, -1, 136, 90, -11, -5, -1, 43,
+ -1, 165, 105, -1, 164, -1, 120, 135, -5, -1, 148, -1, 119, 118, 178,
+ -11, -3, -1, 27, 177, -3, -1, 11, 176, -1, 150, 74, -7, -3, -1,
+ 58, 163, -1, 89, 149, -1, 42, 162, -47, -23, -9, -3, -1, 26, 161,
+ -3, -1, 10, 104, 160, -5, -3, -1, 134, 73, 147, -3, -1, 57, 88,
+ -1, 133, 103, -9, -3, -1, 41, 146, -3, -1, 87, 117, 56, -5, -1,
+ 131, -1, 102, 71, -3, -1, 116, 86, -1, 101, 115, -11, -3, -1, 25,
+ 145, -3, -1, 9, 144, -1, 72, 132, -7, -5, -1, 114, -1, 70, 100,
+ 40, -1, 130, 24, -41, -27, -11, -5, -3, -1, 55, 39, 23, -1, 113,
+ -1, 85, 7, -7, -3, -1, 112, 54, -1, 99, 69, -3, -1, 84, 38,
+ -1, 98, 53, -5, -1, 129, -1, 8, 128, -3, -1, 22, 97, -1, 6,
+ 96, -13, -9, -5, -3, -1, 83, 68, 37, -1, 82, 5, -1, 21, 81,
+ -7, -3, -1, 52, 67, -1, 80, 36, -3, -1, 66, 51, 20, -19, -11,
+ -5, -1, 65, -1, 4, 64, -3, -1, 35, 50, 19, -3, -1, 49, 3,
+ -1, 48, 34, -3, -1, 18, 33, -1, 2, 32, -3, -1, 17, 1, 16,
+ 0
+};
+
+static const short tab15[] =
+{
+-495,-445,-355,-263,-183,-115, -77, -43, -27, -13, -7, -3, -1, 255, 239,
+ -1, 254, 223, -1, 238, -1, 253, 207, -7, -3, -1, 252, 222, -1, 237,
+ 191, -1, 251, -1, 206, 236, -7, -3, -1, 221, 175, -1, 250, 190, -3,
+ -1, 235, 205, -1, 220, 159, -15, -7, -3, -1, 249, 234, -1, 189, 219,
+ -3, -1, 143, 248, -1, 204, 158, -7, -3, -1, 233, 127, -1, 247, 173,
+ -3, -1, 218, 188, -1, 111, -1, 174, 15, -19, -11, -3, -1, 203, 246,
+ -3, -1, 142, 232, -1, 95, 157, -3, -1, 245, 126, -1, 231, 172, -9,
+ -3, -1, 202, 187, -3, -1, 217, 141, 79, -3, -1, 244, 63, -1, 243,
+ 216, -33, -17, -9, -3, -1, 230, 47, -1, 242, -1, 110, 240, -3, -1,
+ 31, 241, -1, 156, 201, -7, -3, -1, 94, 171, -1, 186, 229, -3, -1,
+ 125, 215, -1, 78, 228, -15, -7, -3, -1, 140, 200, -1, 62, 109, -3,
+ -1, 214, 227, -1, 155, 185, -7, -3, -1, 46, 170, -1, 226, 30, -5,
+ -1, 225, -1, 14, 224, -1, 93, 213, -45, -25, -13, -7, -3, -1, 124,
+ 199, -1, 77, 139, -1, 212, -1, 184, 154, -7, -3, -1, 169, 108, -1,
+ 198, 61, -1, 211, 210, -9, -5, -3, -1, 45, 13, 29, -1, 123, 183,
+ -5, -1, 209, -1, 92, 208, -1, 197, 138, -17, -7, -3, -1, 168, 76,
+ -1, 196, 107, -5, -1, 182, -1, 153, 12, -1, 60, 195, -9, -3, -1,
+ 122, 167, -1, 166, -1, 192, 11, -1, 194, -1, 44, 91, -55, -29, -15,
+ -7, -3, -1, 181, 28, -1, 137, 152, -3, -1, 193, 75, -1, 180, 106,
+ -5, -3, -1, 59, 121, 179, -3, -1, 151, 136, -1, 43, 90, -11, -5,
+ -1, 178, -1, 165, 27, -1, 177, -1, 176, 105, -7, -3, -1, 150, 74,
+ -1, 164, 120, -3, -1, 135, 58, 163, -17, -7, -3, -1, 89, 149, -1,
+ 42, 162, -3, -1, 26, 161, -3, -1, 10, 160, 104, -7, -3, -1, 134,
+ 73, -1, 148, 57, -5, -1, 147, -1, 119, 9, -1, 88, 133, -53, -29,
+ -13, -7, -3, -1, 41, 103, -1, 118, 146, -1, 145, -1, 25, 144, -7,
+ -3, -1, 72, 132, -1, 87, 117, -3, -1, 56, 131, -1, 102, 71, -7,
+ -3, -1, 40, 130, -1, 24, 129, -7, -3, -1, 116, 8, -1, 128, 86,
+ -3, -1, 101, 55, -1, 115, 70, -17, -7, -3, -1, 39, 114, -1, 100,
+ 23, -3, -1, 85, 113, -3, -1, 7, 112, 54, -7, -3, -1, 99, 69,
+ -1, 84, 38, -3, -1, 98, 22, -3, -1, 6, 96, 53, -33, -19, -9,
+ -5, -1, 97, -1, 83, 68, -1, 37, 82, -3, -1, 21, 81, -3, -1,
+ 5, 80, 52, -7, -3, -1, 67, 36, -1, 66, 51, -1, 65, -1, 20,
+ 4, -9, -3, -1, 35, 50, -3, -1, 64, 3, 19, -3, -1, 49, 48,
+ 34, -9, -7, -3, -1, 18, 33, -1, 2, 32, 17, -3, -1, 1, 16,
+ 0
+};
+
+static const short tab16[] =
+{
+-509,-503,-461,-323,-103, -37, -27, -15, -7, -3, -1, 239, 254, -1, 223,
+ 253, -3, -1, 207, 252, -1, 191, 251, -5, -1, 175, -1, 250, 159, -3,
+ -1, 249, 248, 143, -7, -3, -1, 127, 247, -1, 111, 246, 255, -9, -5,
+ -3, -1, 95, 245, 79, -1, 244, 243, -53, -1, 240, -1, 63, -29, -19,
+ -13, -7, -5, -1, 206, -1, 236, 221, 222, -1, 233, -1, 234, 217, -1,
+ 238, -1, 237, 235, -3, -1, 190, 205, -3, -1, 220, 219, 174, -11, -5,
+ -1, 204, -1, 173, 218, -3, -1, 126, 172, 202, -5, -3, -1, 201, 125,
+ 94, 189, 242, -93, -5, -3, -1, 47, 15, 31, -1, 241, -49, -25, -13,
+ -5, -1, 158, -1, 188, 203, -3, -1, 142, 232, -1, 157, 231, -7, -3,
+ -1, 187, 141, -1, 216, 110, -1, 230, 156, -13, -7, -3, -1, 171, 186,
+ -1, 229, 215, -1, 78, -1, 228, 140, -3, -1, 200, 62, -1, 109, -1,
+ 214, 155, -19, -11, -5, -3, -1, 185, 170, 225, -1, 212, -1, 184, 169,
+ -5, -1, 123, -1, 183, 208, 227, -7, -3, -1, 14, 224, -1, 93, 213,
+ -3, -1, 124, 199, -1, 77, 139, -75, -45, -27, -13, -7, -3, -1, 154,
+ 108, -1, 198, 61, -3, -1, 92, 197, 13, -7, -3, -1, 138, 168, -1,
+ 153, 76, -3, -1, 182, 122, 60, -11, -5, -3, -1, 91, 137, 28, -1,
+ 192, -1, 152, 121, -1, 226, -1, 46, 30, -15, -7, -3, -1, 211, 45,
+ -1, 210, 209, -5, -1, 59, -1, 151, 136, 29, -7, -3, -1, 196, 107,
+ -1, 195, 167, -1, 44, -1, 194, 181, -23, -13, -7, -3, -1, 193, 12,
+ -1, 75, 180, -3, -1, 106, 166, 179, -5, -3, -1, 90, 165, 43, -1,
+ 178, 27, -13, -5, -1, 177, -1, 11, 176, -3, -1, 105, 150, -1, 74,
+ 164, -5, -3, -1, 120, 135, 163, -3, -1, 58, 89, 42, -97, -57, -33,
+ -19, -11, -5, -3, -1, 149, 104, 161, -3, -1, 134, 119, 148, -5, -3,
+ -1, 73, 87, 103, 162, -5, -1, 26, -1, 10, 160, -3, -1, 57, 147,
+ -1, 88, 133, -9, -3, -1, 41, 146, -3, -1, 118, 9, 25, -5, -1,
+ 145, -1, 144, 72, -3, -1, 132, 117, -1, 56, 131, -21, -11, -5, -3,
+ -1, 102, 40, 130, -3, -1, 71, 116, 24, -3, -1, 129, 128, -3, -1,
+ 8, 86, 55, -9, -5, -1, 115, -1, 101, 70, -1, 39, 114, -5, -3,
+ -1, 100, 85, 7, 23, -23, -13, -5, -1, 113, -1, 112, 54, -3, -1,
+ 99, 69, -1, 84, 38, -3, -1, 98, 22, -1, 97, -1, 6, 96, -9,
+ -5, -1, 83, -1, 53, 68, -1, 37, 82, -1, 81, -1, 21, 5, -33,
+ -23, -13, -7, -3, -1, 52, 67, -1, 80, 36, -3, -1, 66, 51, 20,
+ -5, -1, 65, -1, 4, 64, -1, 35, 50, -3, -1, 19, 49, -3, -1,
+ 3, 48, 34, -3, -1, 18, 33, -1, 2, 32, -3, -1, 17, 1, 16,
+ 0
+};
+
+static const short tab24[] =
+{
+-451,-117, -43, -25, -15, -7, -3, -1, 239, 254, -1, 223, 253, -3, -1,
+ 207, 252, -1, 191, 251, -5, -1, 250, -1, 175, 159, -1, 249, 248, -9,
+ -5, -3, -1, 143, 127, 247, -1, 111, 246, -3, -1, 95, 245, -1, 79,
+ 244, -71, -7, -3, -1, 63, 243, -1, 47, 242, -5, -1, 241, -1, 31,
+ 240, -25, -9, -1, 15, -3, -1, 238, 222, -1, 237, 206, -7, -3, -1,
+ 236, 221, -1, 190, 235, -3, -1, 205, 220, -1, 174, 234, -15, -7, -3,
+ -1, 189, 219, -1, 204, 158, -3, -1, 233, 173, -1, 218, 188, -7, -3,
+ -1, 203, 142, -1, 232, 157, -3, -1, 217, 126, -1, 231, 172, 255,-235,
+-143, -77, -45, -25, -15, -7, -3, -1, 202, 187, -1, 141, 216, -5, -3,
+ -1, 14, 224, 13, 230, -5, -3, -1, 110, 156, 201, -1, 94, 186, -9,
+ -5, -1, 229, -1, 171, 125, -1, 215, 228, -3, -1, 140, 200, -3, -1,
+ 78, 46, 62, -15, -7, -3, -1, 109, 214, -1, 227, 155, -3, -1, 185,
+ 170, -1, 226, 30, -7, -3, -1, 225, 93, -1, 213, 124, -3, -1, 199,
+ 77, -1, 139, 184, -31, -15, -7, -3, -1, 212, 154, -1, 169, 108, -3,
+ -1, 198, 61, -1, 211, 45, -7, -3, -1, 210, 29, -1, 123, 183, -3,
+ -1, 209, 92, -1, 197, 138, -17, -7, -3, -1, 168, 153, -1, 76, 196,
+ -3, -1, 107, 182, -3, -1, 208, 12, 60, -7, -3, -1, 195, 122, -1,
+ 167, 44, -3, -1, 194, 91, -1, 181, 28, -57, -35, -19, -7, -3, -1,
+ 137, 152, -1, 193, 75, -5, -3, -1, 192, 11, 59, -3, -1, 176, 10,
+ 26, -5, -1, 180, -1, 106, 166, -3, -1, 121, 151, -3, -1, 160, 9,
+ 144, -9, -3, -1, 179, 136, -3, -1, 43, 90, 178, -7, -3, -1, 165,
+ 27, -1, 177, 105, -1, 150, 164, -17, -9, -5, -3, -1, 74, 120, 135,
+ -1, 58, 163, -3, -1, 89, 149, -1, 42, 162, -7, -3, -1, 161, 104,
+ -1, 134, 119, -3, -1, 73, 148, -1, 57, 147, -63, -31, -15, -7, -3,
+ -1, 88, 133, -1, 41, 103, -3, -1, 118, 146, -1, 25, 145, -7, -3,
+ -1, 72, 132, -1, 87, 117, -3, -1, 56, 131, -1, 102, 40, -17, -7,
+ -3, -1, 130, 24, -1, 71, 116, -5, -1, 129, -1, 8, 128, -1, 86,
+ 101, -7, -5, -1, 23, -1, 7, 112, 115, -3, -1, 55, 39, 114, -15,
+ -7, -3, -1, 70, 100, -1, 85, 113, -3, -1, 54, 99, -1, 69, 84,
+ -7, -3, -1, 38, 98, -1, 22, 97, -5, -3, -1, 6, 96, 53, -1,
+ 83, 68, -51, -37, -23, -15, -9, -3, -1, 37, 82, -1, 21, -1, 5,
+ 80, -1, 81, -1, 52, 67, -3, -1, 36, 66, -1, 51, 20, -9, -5,
+ -1, 65, -1, 4, 64, -1, 35, 50, -1, 19, 49, -7, -5, -3, -1,
+ 3, 48, 34, 18, -1, 33, -1, 2, 32, -3, -1, 17, 1, -1, 16,
+ 0
+};
+
+static const short tab_c0[] =
+{
+ -29, -21, -13, -7, -3, -1, 11, 15, -1, 13, 14, -3, -1, 7, 5,
+ 9, -3, -1, 6, 3, -1, 10, 12, -3, -1, 2, 1, -1, 4, 8,
+ 0
+};
+
+static const short tab_c1[] =
+{
+ -15, -7, -3, -1, 15, 14, -1, 13, 12, -3, -1, 11, 10, -1, 9,
+ 8, -7, -3, -1, 7, 6, -1, 5, 4, -3, -1, 3, 2, -1, 1,
+ 0
+};
+
+
+
+static const struct newhuff ht[] =
+{
+ { /* 0 */ 0 , tab0 } ,
+ { /* 2 */ 0 , tab1 } ,
+ { /* 3 */ 0 , tab2 } ,
+ { /* 3 */ 0 , tab3 } ,
+ { /* 0 */ 0 , tab0 } ,
+ { /* 4 */ 0 , tab5 } ,
+ { /* 4 */ 0 , tab6 } ,
+ { /* 6 */ 0 , tab7 } ,
+ { /* 6 */ 0 , tab8 } ,
+ { /* 6 */ 0 , tab9 } ,
+ { /* 8 */ 0 , tab10 } ,
+ { /* 8 */ 0 , tab11 } ,
+ { /* 8 */ 0 , tab12 } ,
+ { /* 16 */ 0 , tab13 } ,
+ { /* 0 */ 0 , tab0 } ,
+ { /* 16 */ 0 , tab15 } ,
+
+ { /* 16 */ 1 , tab16 } ,
+ { /* 16 */ 2 , tab16 } ,
+ { /* 16 */ 3 , tab16 } ,
+ { /* 16 */ 4 , tab16 } ,
+ { /* 16 */ 6 , tab16 } ,
+ { /* 16 */ 8 , tab16 } ,
+ { /* 16 */ 10, tab16 } ,
+ { /* 16 */ 13, tab16 } ,
+ { /* 16 */ 4 , tab24 } ,
+ { /* 16 */ 5 , tab24 } ,
+ { /* 16 */ 6 , tab24 } ,
+ { /* 16 */ 7 , tab24 } ,
+ { /* 16 */ 8 , tab24 } ,
+ { /* 16 */ 9 , tab24 } ,
+ { /* 16 */ 11, tab24 } ,
+ { /* 16 */ 13, tab24 }
+};
+
+static const struct newhuff htc[] =
+{
+ { /* 1 , 1 , */ 0 , tab_c0 } ,
+ { /* 1 , 1 , */ 0 , tab_c1 }
+};
+
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/icy.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/icy.c
new file mode 100644
index 00000000..1c287e78
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/icy.c
@@ -0,0 +1,34 @@
+/*
+ icy: Puny code to pretend for a serious ICY data structure.
+
+ copyright 2007-2015 by the mpg123 project
+ -= free software under the terms of the LGPL 2.1 =-
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis
+*/
+
+#include "intsym.h"
+#include "icy.h"
+
+void init_icy(struct icy_meta *icy)
+{
+ icy->data = NULL;
+}
+
+void clear_icy(struct icy_meta *icy)
+{
+ if(icy->data != NULL) free(icy->data);
+ init_icy(icy);
+}
+
+void reset_icy(struct icy_meta *icy)
+{
+ clear_icy(icy);
+ init_icy(icy);
+}
+/*void set_icy(struct icy_meta *icy, char* new_data)
+{
+ if(icy->data) free(icy->data);
+ icy->data = new_data;
+ icy->changed = 1;
+}*/
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/icy.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/icy.h
new file mode 100644
index 00000000..a5fd64ea
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/icy.h
@@ -0,0 +1,38 @@
+/*
+ icy: support for SHOUTcast ICY meta info, an attempt to keep it organized
+
+ copyright 2006-7 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis and modelled after patch by Honza
+*/
+#ifndef MPG123_ICY_H
+#define MPG123_ICY_H
+
+#ifndef NO_ICY
+
+#include "compat.h"
+#include "mpg123.h"
+
+struct icy_meta
+{
+ char* data;
+ off_t interval;
+ off_t next;
+};
+
+void init_icy(struct icy_meta *);
+void clear_icy(struct icy_meta *);
+void reset_icy(struct icy_meta *);
+
+#else
+
+#undef init_icy
+#define init_icy(a)
+#undef clear_icy
+#define clear_icy(a)
+#undef reset_icy
+#define reset_icy(a)
+
+#endif /* NO_ICY */
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/icy2utf8.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/icy2utf8.c
new file mode 100644
index 00000000..71605d2a
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/icy2utf8.c
@@ -0,0 +1,440 @@
+/* mpg123 note: This is BSD-licensed code that is no problem for mpg123 usage under LGPL.
+ It's Free, understood? ;-) */
+
+/* Another note: This code is basically written by Thorsten Glaser,
+ Thomas Orgis did just some rearrangements and comments. */
+
+/*-
+ * Copyright (c) 2008
+ * Thorsten Glaser <tg@mirbsd.org>
+ *
+ * Provided that these terms and disclaimer and all copyright notices
+ * are retained or reproduced in an accompanying document, permission
+ * is granted to deal in this work without restriction, including un-
+ * limited rights to use, publicly perform, distribute, sell, modify,
+ * merge, give away, or sublicence.
+ *
+ * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
+ * the utmost extent permitted by applicable law, neither express nor
+ * implied; without malicious intent or gross negligence. In no event
+ * may a licensor, author or contributor be held liable for indirect,
+ * direct, other damage, loss, or other issues arising in any way out
+ * of dealing in the work, even if advised of the possibility of such
+ * damage or existence of a defect, except proven that it results out
+ * of said person's immediate fault when using the work as intended.
+ *-
+ * Convert from ICY encoding (windows-1252 codepage) to UTF-8
+ */
+
+#include "config.h"
+#include "intsym.h"
+/* Includes string and stdlib headers... */
+#include "compat.h"
+
+/* ThOr: too lazy for this type check; also we use char/short all around anyway.
+ Of cource, it would be the proper way to use _these_ kind of types all around. */
+#define uint8_t unsigned char
+#define uint16_t unsigned short
+
+static const uint8_t cp1252_utf8[] = {
+ /* 0x00 @ 0 */ 0x00,
+ /* 0x01 @ 1 */ 0x01,
+ /* 0x02 @ 2 */ 0x02,
+ /* 0x03 @ 3 */ 0x03,
+ /* 0x04 @ 4 */ 0x04,
+ /* 0x05 @ 5 */ 0x05,
+ /* 0x06 @ 6 */ 0x06,
+ /* 0x07 @ 7 */ 0x07,
+ /* 0x08 @ 8 */ 0x08,
+ /* 0x09 @ 9 */ 0x09,
+ /* 0x0A @ 10 */ 0x0A,
+ /* 0x0B @ 11 */ 0x0B,
+ /* 0x0C @ 12 */ 0x0C,
+ /* 0x0D @ 13 */ 0x0D,
+ /* 0x0E @ 14 */ 0x0E,
+ /* 0x0F @ 15 */ 0x0F,
+ /* 0x10 @ 16 */ 0x10,
+ /* 0x11 @ 17 */ 0x11,
+ /* 0x12 @ 18 */ 0x12,
+ /* 0x13 @ 19 */ 0x13,
+ /* 0x14 @ 20 */ 0x14,
+ /* 0x15 @ 21 */ 0x15,
+ /* 0x16 @ 22 */ 0x16,
+ /* 0x17 @ 23 */ 0x17,
+ /* 0x18 @ 24 */ 0x18,
+ /* 0x19 @ 25 */ 0x19,
+ /* 0x1A @ 26 */ 0x1A,
+ /* 0x1B @ 27 */ 0x1B,
+ /* 0x1C @ 28 */ 0x1C,
+ /* 0x1D @ 29 */ 0x1D,
+ /* 0x1E @ 30 */ 0x1E,
+ /* 0x1F @ 31 */ 0x1F,
+ /* 0x20 @ 32 */ 0x20,
+ /* 0x21 @ 33 */ 0x21,
+ /* 0x22 @ 34 */ 0x22,
+ /* 0x23 @ 35 */ 0x23,
+ /* 0x24 @ 36 */ 0x24,
+ /* 0x25 @ 37 */ 0x25,
+ /* 0x26 @ 38 */ 0x26,
+ /* 0x27 @ 39 */ 0x27,
+ /* 0x28 @ 40 */ 0x28,
+ /* 0x29 @ 41 */ 0x29,
+ /* 0x2A @ 42 */ 0x2A,
+ /* 0x2B @ 43 */ 0x2B,
+ /* 0x2C @ 44 */ 0x2C,
+ /* 0x2D @ 45 */ 0x2D,
+ /* 0x2E @ 46 */ 0x2E,
+ /* 0x2F @ 47 */ 0x2F,
+ /* 0x30 @ 48 */ 0x30,
+ /* 0x31 @ 49 */ 0x31,
+ /* 0x32 @ 50 */ 0x32,
+ /* 0x33 @ 51 */ 0x33,
+ /* 0x34 @ 52 */ 0x34,
+ /* 0x35 @ 53 */ 0x35,
+ /* 0x36 @ 54 */ 0x36,
+ /* 0x37 @ 55 */ 0x37,
+ /* 0x38 @ 56 */ 0x38,
+ /* 0x39 @ 57 */ 0x39,
+ /* 0x3A @ 58 */ 0x3A,
+ /* 0x3B @ 59 */ 0x3B,
+ /* 0x3C @ 60 */ 0x3C,
+ /* 0x3D @ 61 */ 0x3D,
+ /* 0x3E @ 62 */ 0x3E,
+ /* 0x3F @ 63 */ 0x3F,
+ /* 0x40 @ 64 */ 0x40,
+ /* 0x41 @ 65 */ 0x41,
+ /* 0x42 @ 66 */ 0x42,
+ /* 0x43 @ 67 */ 0x43,
+ /* 0x44 @ 68 */ 0x44,
+ /* 0x45 @ 69 */ 0x45,
+ /* 0x46 @ 70 */ 0x46,
+ /* 0x47 @ 71 */ 0x47,
+ /* 0x48 @ 72 */ 0x48,
+ /* 0x49 @ 73 */ 0x49,
+ /* 0x4A @ 74 */ 0x4A,
+ /* 0x4B @ 75 */ 0x4B,
+ /* 0x4C @ 76 */ 0x4C,
+ /* 0x4D @ 77 */ 0x4D,
+ /* 0x4E @ 78 */ 0x4E,
+ /* 0x4F @ 79 */ 0x4F,
+ /* 0x50 @ 80 */ 0x50,
+ /* 0x51 @ 81 */ 0x51,
+ /* 0x52 @ 82 */ 0x52,
+ /* 0x53 @ 83 */ 0x53,
+ /* 0x54 @ 84 */ 0x54,
+ /* 0x55 @ 85 */ 0x55,
+ /* 0x56 @ 86 */ 0x56,
+ /* 0x57 @ 87 */ 0x57,
+ /* 0x58 @ 88 */ 0x58,
+ /* 0x59 @ 89 */ 0x59,
+ /* 0x5A @ 90 */ 0x5A,
+ /* 0x5B @ 91 */ 0x5B,
+ /* 0x5C @ 92 */ 0x5C,
+ /* 0x5D @ 93 */ 0x5D,
+ /* 0x5E @ 94 */ 0x5E,
+ /* 0x5F @ 95 */ 0x5F,
+ /* 0x60 @ 96 */ 0x60,
+ /* 0x61 @ 97 */ 0x61,
+ /* 0x62 @ 98 */ 0x62,
+ /* 0x63 @ 99 */ 0x63,
+ /* 0x64 @ 100 */ 0x64,
+ /* 0x65 @ 101 */ 0x65,
+ /* 0x66 @ 102 */ 0x66,
+ /* 0x67 @ 103 */ 0x67,
+ /* 0x68 @ 104 */ 0x68,
+ /* 0x69 @ 105 */ 0x69,
+ /* 0x6A @ 106 */ 0x6A,
+ /* 0x6B @ 107 */ 0x6B,
+ /* 0x6C @ 108 */ 0x6C,
+ /* 0x6D @ 109 */ 0x6D,
+ /* 0x6E @ 110 */ 0x6E,
+ /* 0x6F @ 111 */ 0x6F,
+ /* 0x70 @ 112 */ 0x70,
+ /* 0x71 @ 113 */ 0x71,
+ /* 0x72 @ 114 */ 0x72,
+ /* 0x73 @ 115 */ 0x73,
+ /* 0x74 @ 116 */ 0x74,
+ /* 0x75 @ 117 */ 0x75,
+ /* 0x76 @ 118 */ 0x76,
+ /* 0x77 @ 119 */ 0x77,
+ /* 0x78 @ 120 */ 0x78,
+ /* 0x79 @ 121 */ 0x79,
+ /* 0x7A @ 122 */ 0x7A,
+ /* 0x7B @ 123 */ 0x7B,
+ /* 0x7C @ 124 */ 0x7C,
+ /* 0x7D @ 125 */ 0x7D,
+ /* 0x7E @ 126 */ 0x7E,
+ /* 0x7F @ 127 */ 0x7F,
+ /* 0x80 @ 128 */ 0xE2, 0x82, 0xAC,
+ /* 0x81 @ 131 */ 0xEF, 0xBF, 0xBD,
+ /* 0x82 @ 134 */ 0xE2, 0x80, 0x9A,
+ /* 0x83 @ 137 */ 0xC6, 0x92,
+ /* 0x84 @ 139 */ 0xE2, 0x80, 0x9E,
+ /* 0x85 @ 142 */ 0xE2, 0x80, 0xA6,
+ /* 0x86 @ 145 */ 0xE2, 0x80, 0xA0,
+ /* 0x87 @ 148 */ 0xE2, 0x80, 0xA1,
+ /* 0x88 @ 151 */ 0xCB, 0x86,
+ /* 0x89 @ 153 */ 0xE2, 0x80, 0xB0,
+ /* 0x8A @ 156 */ 0xC5, 0xA0,
+ /* 0x8B @ 158 */ 0xE2, 0x80, 0xB9,
+ /* 0x8C @ 161 */ 0xC5, 0x92,
+ /* 0x8D @ 163 */ 0xEF, 0xBF, 0xBD,
+ /* 0x8E @ 166 */ 0xC5, 0xBD,
+ /* 0x8F @ 168 */ 0xEF, 0xBF, 0xBD,
+ /* 0x90 @ 171 */ 0xEF, 0xBF, 0xBD,
+ /* 0x91 @ 174 */ 0xE2, 0x80, 0x98,
+ /* 0x92 @ 177 */ 0xE2, 0x80, 0x99,
+ /* 0x93 @ 180 */ 0xE2, 0x80, 0x9C,
+ /* 0x94 @ 183 */ 0xE2, 0x80, 0x9D,
+ /* 0x95 @ 186 */ 0xE2, 0x80, 0xA2,
+ /* 0x96 @ 189 */ 0xE2, 0x80, 0x93,
+ /* 0x97 @ 192 */ 0xE2, 0x80, 0x94,
+ /* 0x98 @ 195 */ 0xCB, 0x9C,
+ /* 0x99 @ 197 */ 0xE2, 0x84, 0xA2,
+ /* 0x9A @ 200 */ 0xC5, 0xA1,
+ /* 0x9B @ 202 */ 0xE2, 0x80, 0xBA,
+ /* 0x9C @ 205 */ 0xC5, 0x93,
+ /* 0x9D @ 207 */ 0xEF, 0xBF, 0xBD,
+ /* 0x9E @ 210 */ 0xC5, 0xBE,
+ /* 0x9F @ 212 */ 0xC5, 0xB8,
+ /* 0xA0 @ 214 */ 0xC2, 0xA0,
+ /* 0xA1 @ 216 */ 0xC2, 0xA1,
+ /* 0xA2 @ 218 */ 0xC2, 0xA2,
+ /* 0xA3 @ 220 */ 0xC2, 0xA3,
+ /* 0xA4 @ 222 */ 0xC2, 0xA4,
+ /* 0xA5 @ 224 */ 0xC2, 0xA5,
+ /* 0xA6 @ 226 */ 0xC2, 0xA6,
+ /* 0xA7 @ 228 */ 0xC2, 0xA7,
+ /* 0xA8 @ 230 */ 0xC2, 0xA8,
+ /* 0xA9 @ 232 */ 0xC2, 0xA9,
+ /* 0xAA @ 234 */ 0xC2, 0xAA,
+ /* 0xAB @ 236 */ 0xC2, 0xAB,
+ /* 0xAC @ 238 */ 0xC2, 0xAC,
+ /* 0xAD @ 240 */ 0xC2, 0xAD,
+ /* 0xAE @ 242 */ 0xC2, 0xAE,
+ /* 0xAF @ 244 */ 0xC2, 0xAF,
+ /* 0xB0 @ 246 */ 0xC2, 0xB0,
+ /* 0xB1 @ 248 */ 0xC2, 0xB1,
+ /* 0xB2 @ 250 */ 0xC2, 0xB2,
+ /* 0xB3 @ 252 */ 0xC2, 0xB3,
+ /* 0xB4 @ 254 */ 0xC2, 0xB4,
+ /* 0xB5 @ 256 */ 0xC2, 0xB5,
+ /* 0xB6 @ 258 */ 0xC2, 0xB6,
+ /* 0xB7 @ 260 */ 0xC2, 0xB7,
+ /* 0xB8 @ 262 */ 0xC2, 0xB8,
+ /* 0xB9 @ 264 */ 0xC2, 0xB9,
+ /* 0xBA @ 266 */ 0xC2, 0xBA,
+ /* 0xBB @ 268 */ 0xC2, 0xBB,
+ /* 0xBC @ 270 */ 0xC2, 0xBC,
+ /* 0xBD @ 272 */ 0xC2, 0xBD,
+ /* 0xBE @ 274 */ 0xC2, 0xBE,
+ /* 0xBF @ 276 */ 0xC2, 0xBF,
+ /* 0xC0 @ 278 */ 0xC3, 0x80,
+ /* 0xC1 @ 280 */ 0xC3, 0x81,
+ /* 0xC2 @ 282 */ 0xC3, 0x82,
+ /* 0xC3 @ 284 */ 0xC3, 0x83,
+ /* 0xC4 @ 286 */ 0xC3, 0x84,
+ /* 0xC5 @ 288 */ 0xC3, 0x85,
+ /* 0xC6 @ 290 */ 0xC3, 0x86,
+ /* 0xC7 @ 292 */ 0xC3, 0x87,
+ /* 0xC8 @ 294 */ 0xC3, 0x88,
+ /* 0xC9 @ 296 */ 0xC3, 0x89,
+ /* 0xCA @ 298 */ 0xC3, 0x8A,
+ /* 0xCB @ 300 */ 0xC3, 0x8B,
+ /* 0xCC @ 302 */ 0xC3, 0x8C,
+ /* 0xCD @ 304 */ 0xC3, 0x8D,
+ /* 0xCE @ 306 */ 0xC3, 0x8E,
+ /* 0xCF @ 308 */ 0xC3, 0x8F,
+ /* 0xD0 @ 310 */ 0xC3, 0x90,
+ /* 0xD1 @ 312 */ 0xC3, 0x91,
+ /* 0xD2 @ 314 */ 0xC3, 0x92,
+ /* 0xD3 @ 316 */ 0xC3, 0x93,
+ /* 0xD4 @ 318 */ 0xC3, 0x94,
+ /* 0xD5 @ 320 */ 0xC3, 0x95,
+ /* 0xD6 @ 322 */ 0xC3, 0x96,
+ /* 0xD7 @ 324 */ 0xC3, 0x97,
+ /* 0xD8 @ 326 */ 0xC3, 0x98,
+ /* 0xD9 @ 328 */ 0xC3, 0x99,
+ /* 0xDA @ 330 */ 0xC3, 0x9A,
+ /* 0xDB @ 332 */ 0xC3, 0x9B,
+ /* 0xDC @ 334 */ 0xC3, 0x9C,
+ /* 0xDD @ 336 */ 0xC3, 0x9D,
+ /* 0xDE @ 338 */ 0xC3, 0x9E,
+ /* 0xDF @ 340 */ 0xC3, 0x9F,
+ /* 0xE0 @ 342 */ 0xC3, 0xA0,
+ /* 0xE1 @ 344 */ 0xC3, 0xA1,
+ /* 0xE2 @ 346 */ 0xC3, 0xA2,
+ /* 0xE3 @ 348 */ 0xC3, 0xA3,
+ /* 0xE4 @ 350 */ 0xC3, 0xA4,
+ /* 0xE5 @ 352 */ 0xC3, 0xA5,
+ /* 0xE6 @ 354 */ 0xC3, 0xA6,
+ /* 0xE7 @ 356 */ 0xC3, 0xA7,
+ /* 0xE8 @ 358 */ 0xC3, 0xA8,
+ /* 0xE9 @ 360 */ 0xC3, 0xA9,
+ /* 0xEA @ 362 */ 0xC3, 0xAA,
+ /* 0xEB @ 364 */ 0xC3, 0xAB,
+ /* 0xEC @ 366 */ 0xC3, 0xAC,
+ /* 0xED @ 368 */ 0xC3, 0xAD,
+ /* 0xEE @ 370 */ 0xC3, 0xAE,
+ /* 0xEF @ 372 */ 0xC3, 0xAF,
+ /* 0xF0 @ 374 */ 0xC3, 0xB0,
+ /* 0xF1 @ 376 */ 0xC3, 0xB1,
+ /* 0xF2 @ 378 */ 0xC3, 0xB2,
+ /* 0xF3 @ 380 */ 0xC3, 0xB3,
+ /* 0xF4 @ 382 */ 0xC3, 0xB4,
+ /* 0xF5 @ 384 */ 0xC3, 0xB5,
+ /* 0xF6 @ 386 */ 0xC3, 0xB6,
+ /* 0xF7 @ 388 */ 0xC3, 0xB7,
+ /* 0xF8 @ 390 */ 0xC3, 0xB8,
+ /* 0xF9 @ 392 */ 0xC3, 0xB9,
+ /* 0xFA @ 394 */ 0xC3, 0xBA,
+ /* 0xFB @ 396 */ 0xC3, 0xBB,
+ /* 0xFC @ 398 */ 0xC3, 0xBC,
+ /* 0xFD @ 400 */ 0xC3, 0xBD,
+ /* 0xFE @ 402 */ 0xC3, 0xBE,
+ /* 0xFF @ 404 */ 0xC3, 0xBF,
+};
+
+static const uint16_t tblofs[257] = {
+ /* 0x00 */ 0, 1, 2, 3, 4, 5, 6, 7,
+ /* 0x08 */ 8, 9, 10, 11, 12, 13, 14, 15,
+ /* 0x10 */ 16, 17, 18, 19, 20, 21, 22, 23,
+ /* 0x18 */ 24, 25, 26, 27, 28, 29, 30, 31,
+ /* 0x20 */ 32, 33, 34, 35, 36, 37, 38, 39,
+ /* 0x28 */ 40, 41, 42, 43, 44, 45, 46, 47,
+ /* 0x30 */ 48, 49, 50, 51, 52, 53, 54, 55,
+ /* 0x38 */ 56, 57, 58, 59, 60, 61, 62, 63,
+ /* 0x40 */ 64, 65, 66, 67, 68, 69, 70, 71,
+ /* 0x48 */ 72, 73, 74, 75, 76, 77, 78, 79,
+ /* 0x50 */ 80, 81, 82, 83, 84, 85, 86, 87,
+ /* 0x58 */ 88, 89, 90, 91, 92, 93, 94, 95,
+ /* 0x60 */ 96, 97, 98, 99, 100, 101, 102, 103,
+ /* 0x68 */ 104, 105, 106, 107, 108, 109, 110, 111,
+ /* 0x70 */ 112, 113, 114, 115, 116, 117, 118, 119,
+ /* 0x78 */ 120, 121, 122, 123, 124, 125, 126, 127,
+ /* 0x80 */ 128, 131, 134, 137, 139, 142, 145, 148,
+ /* 0x88 */ 151, 153, 156, 158, 161, 163, 166, 168,
+ /* 0x90 */ 171, 174, 177, 180, 183, 186, 189, 192,
+ /* 0x98 */ 195, 197, 200, 202, 205, 207, 210, 212,
+ /* 0xA0 */ 214, 216, 218, 220, 222, 224, 226, 228,
+ /* 0xA8 */ 230, 232, 234, 236, 238, 240, 242, 244,
+ /* 0xB0 */ 246, 248, 250, 252, 254, 256, 258, 260,
+ /* 0xB8 */ 262, 264, 266, 268, 270, 272, 274, 276,
+ /* 0xC0 */ 278, 280, 282, 284, 286, 288, 290, 292,
+ /* 0xC8 */ 294, 296, 298, 300, 302, 304, 306, 308,
+ /* 0xD0 */ 310, 312, 314, 316, 318, 320, 322, 324,
+ /* 0xD8 */ 326, 328, 330, 332, 334, 336, 338, 340,
+ /* 0xE0 */ 342, 344, 346, 348, 350, 352, 354, 356,
+ /* 0xE8 */ 358, 360, 362, 364, 366, 368, 370, 372,
+ /* 0xF0 */ 374, 376, 378, 380, 382, 384, 386, 388,
+ /* 0xF8 */ 390, 392, 394, 396, 398, 400, 402, 404,
+ /* sizeof (cp1252_utf8) */ 406
+};
+
+/* Check if a string qualifies as UTF-8. */
+static int
+is_utf8(const char* src)
+{
+ uint8_t ch;
+ size_t i;
+ const uint8_t* s = (const uint8_t*) src;
+
+ /* We make a loop over every character, until we find a null one.
+ Remember: The string is supposed to end with a NUL, so ahead checks are safe. */
+ while ((ch = *s++)) {
+ /* Ye olde 7bit ASCII chars 'rr fine for anything */
+ if(ch < 0x80) continue;
+
+ /* Now, we watch out for non-UTF conform sequences. */
+ else if ((ch < 0xC2) || (ch > 0xFD))
+ return 0;
+ /* check for some misformed sequences */
+ if (((ch == 0xC2) && (s[0] < 0xA0)) ||
+ ((ch == 0xEF) && (s[0] == 0xBF) && (s[1] > 0xBD)))
+ /* XXX add more for outside the BMP */
+ return 0;
+
+ /* Check the continuation bytes. */
+ if (ch < 0xE0) i = 1;
+ else if (ch < 0xF0) i = 2;
+ else if (ch < 0xF8) i = 3;
+ else if (ch < 0xFC) i = 4;
+ else
+ i = 5;
+
+ while (i--)
+ if ((*s++ & 0xC0) != 0x80)
+ return 0;
+ }
+
+ /* If no check failed, the string indeed looks like valid UTF-8. */
+ return 1;
+}
+
+/* The main conversion routine.
+ ICY in CP-1252 (or UTF-8 alreay) to UTF-8 encoded string.
+ If force is applied, it will always encode to UTF-8, without checking. */
+char *
+icy2utf8(const char *src, int force)
+{
+ const uint8_t *s = (const uint8_t *)src;
+ size_t srclen, dstlen, i, k;
+ uint8_t ch, *d;
+ char *dst;
+
+ /* Some funny streams from Apple/iTunes give ICY info in UTF-8 already.
+ So, be prepared and don't try to re-encode such. Unless forced. */
+ if(!force && is_utf8(src)) return (compat_strdup(src));
+
+ srclen = strlen(src) + 1;
+ /* allocate conservatively */
+ if ((d = malloc(srclen * 3)) == NULL)
+ return (NULL);
+
+ i = 0;
+ dstlen = 0;
+ while (i < srclen) {
+ ch = s[i++];
+ k = tblofs[ch];
+ while (k < tblofs[ch + 1])
+ d[dstlen++] = cp1252_utf8[k++];
+ }
+
+ /* dstlen includes trailing NUL since srclen also does */
+ if ((dst = realloc(d, dstlen)) == NULL) {
+ free(d);
+ return (NULL);
+ }
+ return (dst);
+}
+
+/* This stuff is for testing only. */
+#ifdef TEST
+static const char intext[] = "\225 Gr\374\337e kosten 0,55 \200\205";
+
+#include <stdio.h>
+
+int
+main(void)
+{
+ char *t, *t2;
+
+ if ((t = icy2utf8(intext, 0)) == NULL) {
+ fprintf(stderr, "out of memory\n");
+ return (1);
+ }
+
+ /* make sure it won't be converted twice */
+ if ((t2 = icy2utf8(t), 0) == NULL) {
+ fprintf(stderr, "out of memory\n");
+ return (1);
+ }
+
+ printf("Result is:\t\343\200\214%s\343\200\215\n"
+ "\t\t\343\200\214%s\343\200\215\n", t, t2);
+
+ free(t);
+ free(t2);
+ return (0);
+}
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/icy2utf8.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/icy2utf8.h
new file mode 100644
index 00000000..aeec0121
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/icy2utf8.h
@@ -0,0 +1,10 @@
+/* You expect a license plate for _this_ file? */
+#ifndef MPG123_ICY2UTF_H
+#define MPG123_ICY2UTF_H
+
+#ifndef NO_ICY
+/* (string, force conversion) */
+char *icy2utf8(const char *, int);
+#endif
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/id3.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/id3.c
new file mode 100644
index 00000000..84c8bd28
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/id3.c
@@ -0,0 +1,1467 @@
+/*
+ id3: ID3v2.3 and ID3v2.4 parsing (a relevant subset)
+
+ copyright 2006-2020 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis
+
+ WIP: Handling of multiple ID3 tags in a stream.
+
+ 1. With update flag: Add non-unique data, replace unique.
+ - Only one TALB, TPE1, etc.
+ - Only one TXXX with a certain description.
+ - Only one COMM with certain language and description.
+ - Only one APIC with certain type and description, generally only one
+ of type 1 and 2 each.
+ 2. Without update flag: wipe whole data and only store new stuff.
+
+ BIG BAD BUT: How to properly handle seeks in a stream that make
+ the parser encounter the same tags again in random order? Is
+ there even a correct way to handle that without storing an
+ ordered list of all tags? I could simplify the code here and just
+ communicate that a frame should be an update to previous, and
+ at which stream position the frame was encountered. But since
+ libmpg123 is driven by MPEG frames, there could be multiple
+ ID3v2 tags in direct succession treated by the parser without
+ the library user being able to interfere.
+
+ This is severely fucked. All that complexity also doesn't matter
+ in practice, as streams use ICY and individual files have just one
+ ID3v2 tag (relevant for libmpg123). It's an academic problem. But
+ for seekable files, I could implement some jumping logic to find
+ and parse all ID3v2 for once and then set a flag that only jumps
+ the frames on seeks. That covers all local disk playback. For
+ streams, seeking is no issue (seeking back, at least), so the
+ update/replace logic works.
+
+ Look at the standard:
+
+------
+5. Tag location
+
+ The default location of an ID3v2 tag is prepended to the audio so
+ that players can benefit from the information when the data is
+ streamed. It is however possible to append the tag, or make a
+ prepend/append combination. When deciding upon where an unembedded
+ tag should be located, the following order of preference SHOULD be
+ considered.
+
+ 1. Prepend the tag.
+
+ 2. Prepend a tag with all vital information and add a second tag at
+ the end of the file, before tags from other tagging systems. The
+ first tag is required to have a SEEK frame.
+
+ 3. Add a tag at the end of the file, before tags from other tagging
+ systems.
+
+ In case 2 and 3 the tag can simply be appended if no other known tags
+ are present. The suggested method to find ID3v2 tags are:
+
+ 1. Look for a prepended tag using the pattern found in section 3.1.
+
+ 2. If a SEEK frame was found, use its values to guide further
+ searching.
+
+ 3. Look for a tag footer, scanning from the back of the file.
+
+ For every new tag that is found, the old tag should be discarded
+ unless the update flag in the extended header (section 3.2) is set.
+------
+
+ For seekable streams, I simply need to implement explicit ID3v2 search along
+ that recommendation and keep the complete information. Streams that continue
+ growing during playback will not recognize added ID3v2 tags. So be it.
+ For non-seekable streams, a tag is always parsed when encountered, assuming
+ the order of update tags always matches.
+
+ First step for the 1.26 release shall be the implementaton of the update
+ logic and glossing over the theoretical problem of re-parsing update
+ frames in the wrong order by ignoring it. They are not that relevant.
+
+ TODO: Cave in and add the missing frames from the spec. Not that far to go.
+ But need another data structure to communicate those ...
+*/
+
+#include "mpg123lib_intern.h"
+#include "id3.h"
+#include "debug.h"
+
+#ifndef NO_ID3V2 /* Only the main parsing routine will always be there. */
+
+/* We know the usual text frames plus some specifics. */
+#define KNOWN_FRAMES 5
+static const char frame_type[KNOWN_FRAMES][5] = { "COMM", "TXXX", "RVA2", "USLT", "APIC" };
+enum frame_types { unknown = -2, text = -1, comment, extra, rva2, uslt, picture };
+
+/* UTF support definitions */
+
+typedef void (*text_converter)(mpg123_string *sb, const unsigned char* source, size_t len, const int noquiet);
+
+static void convert_latin1 (mpg123_string *sb, const unsigned char* source, size_t len, const int noquiet);
+static void convert_utf16bom(mpg123_string *sb, const unsigned char* source, size_t len, const int noquiet);
+static void convert_utf8 (mpg123_string *sb, const unsigned char* source, size_t len, const int noquiet);
+
+static const text_converter text_converters[4] =
+{
+ convert_latin1,
+ /* We always check for (multiple) BOM in 16bit unicode. Without BOM, UTF16 BE is the default.
+ Errors in encoding are detected anyway. */
+ convert_utf16bom,
+ convert_utf16bom,
+ convert_utf8
+};
+
+static const unsigned int encoding_widths[4] = { 1, 2, 2, 1 };
+
+/* the code starts here... */
+
+static void null_id3_links(mpg123_handle *fr)
+{
+ fr->id3v2.title = NULL;
+ fr->id3v2.artist = NULL;
+ fr->id3v2.album = NULL;
+ fr->id3v2.year = NULL;
+ fr->id3v2.genre = NULL;
+ fr->id3v2.comment = NULL;
+}
+
+void init_id3(mpg123_handle *fr)
+{
+ fr->id3v2.version = 0; /* nothing there */
+ null_id3_links(fr);
+ fr->id3v2.comments = 0;
+ fr->id3v2.comment_list = NULL;
+ fr->id3v2.texts = 0;
+ fr->id3v2.text = NULL;
+ fr->id3v2.extras = 0;
+ fr->id3v2.extra = NULL;
+ fr->id3v2.pictures = 0;
+ fr->id3v2.picture = NULL;
+}
+
+/* Managing of the text, comment and extra lists. */
+
+/* Initialize one element. */
+static void init_mpg123_text(mpg123_text *txt)
+{
+ mpg123_init_string(&txt->text);
+ mpg123_init_string(&txt->description);
+ txt->id[0] = 0;
+ txt->id[1] = 0;
+ txt->id[2] = 0;
+ txt->id[3] = 0;
+ txt->lang[0] = 0;
+ txt->lang[1] = 0;
+ txt->lang[2] = 0;
+}
+
+static void init_mpg123_picture(mpg123_picture *pic)
+{
+ mpg123_init_string(&pic->mime_type);
+ mpg123_init_string(&pic->description);
+ pic->type = 0;
+ pic->size = 0;
+ pic->data = NULL;
+}
+
+/* Free memory of one element. */
+static void free_mpg123_text(mpg123_text *txt)
+{
+ mpg123_free_string(&txt->text);
+ mpg123_free_string(&txt->description);
+}
+
+static void free_mpg123_picture(mpg123_picture * pic)
+{
+ mpg123_free_string(&pic->mime_type);
+ mpg123_free_string(&pic->description);
+ if (pic->data != NULL)
+ free(pic->data);
+}
+
+/* Free memory of whole list. */
+#define free_comment(mh) free_id3_text(&((mh)->id3v2.comment_list), &((mh)->id3v2.comments))
+#define free_text(mh) free_id3_text(&((mh)->id3v2.text), &((mh)->id3v2.texts))
+#define free_extra(mh) free_id3_text(&((mh)->id3v2.extra), &((mh)->id3v2.extras))
+#define free_picture(mh) free_id3_picture(&((mh)->id3v2.picture), &((mh)->id3v2.pictures))
+static void free_id3_text(mpg123_text **list, size_t *size)
+{
+ size_t i;
+ for(i=0; i<*size; ++i) free_mpg123_text(&((*list)[i]));
+
+ free(*list);
+ *list = NULL;
+ *size = 0;
+}
+static void free_id3_picture(mpg123_picture **list, size_t *size)
+{
+ size_t i;
+ for(i=0; i<*size; ++i) free_mpg123_picture(&((*list)[i]));
+
+ free(*list);
+ *list = NULL;
+ *size = 0;
+}
+
+/* Add items to the list. */
+
+#define add_comment(mh, l, d) add_id3_text(&((mh)->id3v2.comment_list), &((mh)->id3v2.comments), NULL, l, d)
+#define add_text(mh, id) add_id3_text(&((mh)->id3v2.text), &((mh)->id3v2.texts), id, NULL, NULL)
+#define add_uslt(mh, l, d) add_id3_text(&((mh)->id3v2.text), &((mh)->id3v2.texts), id, l, d)
+#define add_extra(mh, d) add_id3_text(&((mh)->id3v2.extra), &((mh)->id3v2.extras), NULL, NULL, d)
+#define add_picture(mh, t, d) add_id3_picture(&((mh)->id3v2.picture), &((mh)->id3v2.pictures), t, d)
+static mpg123_text *add_id3_text( mpg123_text **list, size_t *size
+, char id[4], char lang[3], mpg123_string *description )
+{
+ mdebug( "add_id3_text id=%s lang=%s, desc=%s"
+ , id ? (char[5]) { id[0], id[1], id[2], id[3], 0 } : "(nil)"
+ , lang ? (char[4]) { lang[0], lang[1], lang[2], 0 } : "(nil)"
+ , description ? (description->fill ? description->p : "(empty)") : "(nil)" );
+ if(lang && !description)
+ return NULL; // no lone language intended
+ if(id || description)
+ {
+ // Look through list of existing texts and return an existing entry
+ // if it should be overwritten.
+ for(size_t i=0; i<*size; ++i)
+ {
+ mpg123_text *entry = *list+i;
+ if(description)
+ { // Overwrite entry with same description and same ID and language.
+ if( (!id || !memcmp(id, entry->id, 4))
+ && (!lang || !memcmp(entry->lang, lang, 3))
+ && mpg123_same_string(&(entry->description), description)
+ )
+ return entry;
+ } else if(id && !memcmp(id, entry->id, 4))
+ return entry; // Just ovewrite because of same ID.
+ mdebug("add_id3_text: entry %zu was no match", i);
+ }
+ }
+ mdebug("add_id3_text: append to list of %zu", *size);
+ // Nothing found, add new one.
+ mpg123_text *x = safe_realloc(*list, sizeof(mpg123_text)*(*size+1));
+ if(x == NULL) return NULL; /* bad */
+
+ *list = x;
+ *size += 1;
+ init_mpg123_text(&((*list)[*size-1]));
+
+ return &((*list)[*size-1]); /* Return pointer to the added text. */
+}
+
+
+static mpg123_picture *add_id3_picture(mpg123_picture **list, size_t *size, char type, mpg123_string *description)
+{
+ if(!description)
+ return NULL;
+
+ // Return entry to overwrite, if appropriate.
+ for(size_t i=0; i<*size; ++i)
+ {
+ mpg123_picture *entry = *list+i;
+ if( type == entry->type
+ && ( type == 1 || type == 2 ||
+ mpg123_same_string(&entry->description, description)
+ )
+ )
+ return entry;
+ }
+ // Append a new one.
+ mpg123_picture *x = safe_realloc(*list, sizeof(mpg123_picture)*(*size+1));
+ if(x == NULL) return NULL; /* bad */
+
+ *list = x;
+ *size += 1;
+ init_mpg123_picture(&((*list)[*size-1]));
+
+ return &((*list)[*size-1]); /* Return pointer to the added picture. */
+}
+
+/* OK, back to the higher level functions. */
+
+void exit_id3(mpg123_handle *fr)
+{
+ free_picture(fr);
+ free_comment(fr);
+ free_extra(fr);
+ free_text(fr);
+}
+
+void reset_id3(mpg123_handle *fr)
+{
+ exit_id3(fr);
+ init_id3(fr);
+}
+
+/* Set the id3v2.artist id3v2.title ... links to elements of the array. */
+void id3_link(mpg123_handle *fr)
+{
+ size_t i;
+ mpg123_id3v2 *v2 = &fr->id3v2;
+ debug("linking ID3v2");
+ null_id3_links(fr);
+ for(i=0; i<v2->texts; ++i)
+ {
+ mpg123_text *entry = &v2->text[i];
+ if (!strncmp("TIT2", entry->id, 4)) v2->title = &entry->text;
+ else if(!strncmp("TALB", entry->id, 4)) v2->album = &entry->text;
+ else if(!strncmp("TPE1", entry->id, 4)) v2->artist = &entry->text;
+ else if(!strncmp("TYER", entry->id, 4)) v2->year = &entry->text;
+ else if(!strncmp("TCON", entry->id, 4)) v2->genre = &entry->text;
+ }
+ for(i=0; i<v2->comments; ++i)
+ {
+ mpg123_text *entry = &v2->comment_list[i];
+ if(entry->description.fill == 0 || entry->description.p[0] == 0)
+ v2->comment = &entry->text;
+ }
+ /* When no generic comment found, use the last non-generic one. */
+ if(v2->comment == NULL && v2->comments > 0)
+ v2->comment = &v2->comment_list[v2->comments-1].text;
+}
+
+/*
+ Store ID3 text data in an mpg123_string; either verbatim copy or
+ everything translated to UTF-8 encoding.
+ Preserve the zero string separator (I don't need strlen for the total size).
+
+ Since we can overwrite strings with ID3 update frames, don't free
+ memory, just grow strings.
+*/
+static void store_id3_text(mpg123_string *sb, unsigned char *source, size_t source_size, const int noquiet, const int notranslate)
+{
+ unsigned char encoding;
+ if(sb) // Always overwrite, even with nothing.
+ sb->fill = 0;
+ if(!source_size)
+ {
+ debug("Empty id3 data!");
+ return;
+ }
+
+ /* We shall just copy the data. Client wants to decode itself. */
+ if(notranslate)
+ {
+ /* Future: Add a path for ID3 errors. */
+ if(!mpg123_grow_string(sb, source_size))
+ {
+ if(noquiet) error("Cannot resize target string, out of memory?");
+ return;
+ }
+ memcpy(sb->p, source, source_size);
+ sb->fill = source_size;
+ debug1("stored undecoded ID3 text of size %"SIZE_P, (size_p)source_size);
+ return;
+ }
+
+ encoding = source[0];
+ if(encoding > mpg123_id3_enc_max)
+ {
+ if(noquiet)
+ error1("Unknown text encoding %u, I take no chances, sorry!", encoding);
+ return;
+ }
+ id3_to_utf8(sb, encoding, source+1, source_size-1, noquiet);
+
+ if(sb->fill) debug1("UTF-8 string (the first one): %s", sb->p);
+ else if(noquiet) error("unable to convert string to UTF-8 (out of memory, junk input?)!");
+}
+
+/* On error, sb->size is 0. */
+/* Also, encoding has been checked already! */
+void id3_to_utf8(mpg123_string *sb, unsigned char encoding, const unsigned char *source, size_t source_size, int noquiet)
+{
+ unsigned int bwidth;
+ if(sb)
+ sb->fill = 0;
+ debug1("encoding: %u", encoding);
+ /* A note: ID3v2.3 uses UCS-2 non-variable 16bit encoding, v2.4 uses UTF16.
+ UTF-16 uses a reserved/private range in UCS-2 to add the magic, so we just always treat it as UTF. */
+ bwidth = encoding_widths[encoding];
+ /* Hack! I've seen a stray zero byte before BOM. Is that supposed to happen? */
+ if(encoding != mpg123_id3_utf16be) /* UTF16be _can_ beging with a null byte! */
+ while(source_size > bwidth && source[0] == 0)
+ {
+ --source_size;
+ ++source;
+ debug("skipped leading zero");
+ }
+ if(source_size % bwidth)
+ {
+ /* When we need two bytes for a character, it's strange to have an uneven bytestream length. */
+ if(noquiet) warning2("Weird tag size %d for encoding %u - I will probably trim too early or something but I think the MP3 is broken.", (int)source_size, encoding);
+ source_size -= source_size % bwidth;
+ }
+ text_converters[encoding](sb, source, source_size, noquiet);
+}
+
+/* You have checked encoding to be in the range already. */
+static unsigned char *next_text(unsigned char* prev, unsigned char encoding, size_t limit)
+{
+ unsigned char *text = prev;
+ size_t width = encoding_widths[encoding];
+
+ /* So I go lengths to find zero or double zero...
+ Remember bug 2834636: Only check for aligned NULLs! */
+ while(text-prev < (ssize_t)limit)
+ {
+ if(text[0] == 0)
+ {
+ if(width <= limit-(text-prev))
+ {
+ size_t i = 1;
+ for(; i<width; ++i) if(text[i] != 0) break;
+
+ if(i == width) /* found a null wide enough! */
+ {
+ text += width;
+ break;
+ }
+ }
+ else return NULL; /* No full character left? This text is broken */
+ }
+
+ text += width;
+ }
+ if((size_t)(text-prev) >= limit) text = NULL;
+
+ return text;
+}
+
+static const char *enc_name(unsigned char enc)
+{
+ switch(enc)
+ {
+ case 0: return "Latin 1";
+ case 1: return "UTF-16 BOM";
+ case 2: return "UTF-16 BE";
+ case 3: return "UTF-8";
+ default: return "unknown!";
+ }
+}
+
+static void process_text(mpg123_handle *fr, unsigned char *realdata, size_t realsize, char *id)
+{
+ /* Text encoding $xx */
+ /* The text (encoded) ... */
+ mpg123_text *t = add_text(fr, id);
+ if(VERBOSE4) fprintf(stderr, "Note: Storing text from %s encoding\n", enc_name(realdata[0]));
+ if(t == NULL)
+ {
+ if(NOQUIET) error("Unable to attach new text!");
+ return;
+ }
+ mdebug("process_text: (over)writing entry with ID %s", t->id[0]
+ ? (char[5]) { t->id[0], t->id[1], t->id[2], t->id[3], 0 }
+ : "(nil)" );
+ memcpy(t->id, id, 4);
+ store_id3_text(&t->text, realdata, realsize, NOQUIET, fr->p.flags & MPG123_PLAIN_ID3TEXT);
+ if(VERBOSE4) // Do not print unsanitized text to terminals!
+ fprintf(stderr, "Note: ID3v2 %c%c%c%c text frame stored\n", id[0], id[1], id[2], id[3]);
+}
+
+static void process_picture(mpg123_handle *fr, unsigned char *realdata, size_t realsize)
+{
+ unsigned char encoding;
+ mpg123_picture *i = NULL;
+ unsigned char* workpoint = NULL;
+ mpg123_string mime; mpg123_init_string(&mime);
+ unsigned char image_type = 0;
+ mpg123_string description; mpg123_init_string(&description);
+ unsigned char *image_data = NULL;
+ if(realsize < 1)
+ {
+ debug("Empty id3 data!");
+ return;
+ }
+ encoding = realdata[0];
+ realdata++; realsize--;
+ if(encoding > mpg123_id3_enc_max)
+ {
+ if(NOQUIET)
+ error1("Unknown text encoding %u, I take no chances, sorry!", encoding);
+ return;
+ }
+ if(VERBOSE4) fprintf(stderr, "Note: Storing picture from APIC frame.\n");
+
+ /* get mime type (encoding is always latin-1) */
+ workpoint = next_text(realdata, 0, realsize);
+ if(!workpoint)
+ {
+ if(NOQUIET)
+ error("Unable to get mime type for picture; skipping picture.");
+ return;
+ }
+ id3_to_utf8(&mime, 0, realdata, workpoint - realdata, NOQUIET);
+ realsize -= workpoint - realdata;
+ realdata = workpoint;
+ /* get picture type */
+ image_type = realdata[0];
+ realdata++; realsize--;
+ /* get description (encoding is encoding) */
+ workpoint = next_text(realdata, encoding, realsize);
+ if(!workpoint)
+ {
+ if(NOQUIET)
+ error("Unable to get description for picture; skipping picture.");
+ mpg123_free_string(&mime);
+ return;
+ }
+ id3_to_utf8(&description, encoding, realdata, workpoint - realdata, NOQUIET);
+ realsize -= workpoint - realdata;
+ if(realsize)
+ image_data = (unsigned char*)malloc(realsize);
+ if(!realsize || !image_data) {
+ if(NOQUIET)
+ error("No picture data or malloc failure; skipping picture.");
+ mpg123_free_string(&description);
+ mpg123_free_string(&mime);
+ return;
+ }
+ memcpy(image_data, workpoint, realsize);
+
+ // All data ready now, append to/replace in list.
+ i = add_picture(fr, image_type, &description);
+ if(!i)
+ {
+ if(NOQUIET)
+ error("Unable to attach new picture!");
+ free(image_data);
+ mpg123_free_string(&description);
+ mpg123_free_string(&mime);
+ return;
+ }
+
+ // Either this is a fresh image, or one to be replaced.
+ // We hand over memory, so old storage needs to be freed.
+ free_mpg123_picture(i);
+ i->type = image_type;
+ i->size = realsize;
+ i->data = image_data;
+ mpg123_move_string(&mime, &i->mime_type);
+ mpg123_move_string(&description, &i->description);
+ if(VERBOSE4)
+ fprintf(stderr, "Note: ID3v2 APIC picture frame of type: %d\n", i->type);
+}
+
+/* Store a new comment that perhaps is a RVA / RVA_ALBUM/AUDIOPHILE / RVA_MIX/RADIO one
+ Special gimmik: It also stores USLT to the texts. Stucture is the same as for comments. */
+static void process_comment(mpg123_handle *fr, enum frame_types tt, unsigned char *realdata, size_t realsize, int rva_level, char *id)
+{
+ /* Text encoding $xx */
+ /* Language $xx xx xx */
+ /* Short description (encoded!) <text> $00 (00) */
+ /* Then the comment text (encoded) ... */
+ unsigned char encoding = realdata[0];
+ char lang[3]; // realdata + 1
+ unsigned char *descr = realdata+4;
+ unsigned char *text = NULL;
+ mpg123_text *xcom = NULL;
+ mpg123_text localcom; // UTF-8 variant for local processing, remember to clean up!
+ init_mpg123_text(&localcom);
+
+ if(realsize < (size_t)(descr-realdata))
+ {
+ if(NOQUIET) error1("Invalid frame size of %"SIZE_P" (too small for anything).", (size_p)realsize);
+ return;
+ }
+ if(encoding > mpg123_id3_enc_max)
+ {
+ if(NOQUIET)
+ error1("Unknown text encoding %u, I take no chances, sorry!", encoding);
+ return;
+ }
+ memcpy(lang, realdata+1, 3);
+ /* Now I can abuse a byte from lang for the encoding. */
+ descr[-1] = encoding;
+ /* Be careful with finding the end of description, I have to honor encoding here. */
+ text = next_text(descr, encoding, realsize-(descr-realdata));
+ if(text == NULL)
+ {
+ if(NOQUIET)
+ error("No comment text / valid description?");
+ return;
+ }
+ { // just vor variable scope
+ mpg123_string description;
+ mpg123_init_string(&description);
+ // Store the text, with desired encoding, but for comments always a local copy in UTF-8.
+ store_id3_text( &description, descr-1, text-descr+1
+ , NOQUIET, fr->p.flags & MPG123_PLAIN_ID3TEXT );
+ if(tt == comment)
+ store_id3_text( &localcom.description, descr-1, text-descr+1
+ , NOQUIET, 0 );
+ if(VERBOSE4)
+ fprintf( stderr, "Note: Storing comment from %s encoding\n"
+ , enc_name(realdata[0]) );
+ xcom = tt == uslt
+ ? add_uslt(fr, lang, &description)
+ : add_comment(fr, lang, &description);
+ if(xcom == NULL)
+ {
+ if(NOQUIET)
+ error("Unable to attach new comment!");
+ mpg123_free_string(&description);
+ free_mpg123_text(&localcom);
+ return;
+ }
+ memcpy(xcom->id, id, 4);
+ memcpy(xcom->lang, lang, 3);
+ // That takes over the description allocation.
+ mpg123_move_string(&description, &xcom->description);
+ }
+
+ text[-1] = encoding; /* Byte abusal for encoding... */
+ store_id3_text(&xcom->text, text-1, realsize+1-(text-realdata), NOQUIET, fr->p.flags & MPG123_PLAIN_ID3TEXT);
+ /* Remember: I will probably decode the above (again) for rva comment checking. So no messing around, please. */
+
+ if(VERBOSE4) /* Do _not_ print the verbatim text: The encoding might be funny! */
+ {
+ fprintf(stderr, "Note: ID3 comm/uslt desc of length %"SIZE_P".\n", (size_p)xcom->description.fill);
+ fprintf(stderr, "Note: ID3 comm/uslt text of length %"SIZE_P".\n", (size_p)xcom->text.fill);
+ }
+ /* Look out for RVA info only when we really deal with a straight comment. */
+ if(tt == comment && localcom.description.fill > 0)
+ {
+ int rva_mode = -1; /* mix / album */
+ if( !strcasecmp(localcom.description.p, "rva")
+ || !strcasecmp(localcom.description.p, "rva_mix")
+ || !strcasecmp(localcom.description.p, "rva_track")
+ || !strcasecmp(localcom.description.p, "rva_radio") )
+ rva_mode = 0;
+ else if( !strcasecmp(localcom.description.p, "rva_album")
+ || !strcasecmp(localcom.description.p, "rva_audiophile")
+ || !strcasecmp(localcom.description.p, "rva_user") )
+ rva_mode = 1;
+ if((rva_mode > -1) && (fr->rva.level[rva_mode] <= rva_level))
+ {
+ /* Only translate the contents in here where we really need them. */
+ store_id3_text(&localcom.text, text-1, realsize+1-(text-realdata), NOQUIET, 0);
+ if(localcom.text.fill > 0)
+ {
+ fr->rva.gain[rva_mode] = (float) atof(localcom.text.p);
+ if(VERBOSE3) fprintf(stderr, "Note: RVA value %fdB\n", fr->rva.gain[rva_mode]);
+ fr->rva.peak[rva_mode] = 0;
+ fr->rva.level[rva_mode] = rva_level;
+ }
+ }
+ }
+ /* Make sure to free the local memory... */
+ free_mpg123_text(&localcom);
+}
+
+static void process_extra(mpg123_handle *fr, unsigned char* realdata, size_t realsize, int rva_level, char *id)
+{
+ /* Text encoding $xx */
+ /* Description ... $00 (00) */
+ /* Text ... */
+ unsigned char encoding = realdata[0];
+ unsigned char *descr = realdata+1; /* remember, the encoding is descr[-1] */
+ unsigned char *text;
+ mpg123_text *xex;
+ mpg123_text localex;
+
+ if((int)realsize < descr-realdata)
+ {
+ if(NOQUIET) error1("Invalid frame size of %lu (too small for anything).", (unsigned long)realsize);
+ return;
+ }
+ if(encoding > mpg123_id3_enc_max)
+ {
+ if(NOQUIET)
+ error1("Unknown text encoding %u, I take no chances, sorry!", encoding);
+ return;
+ }
+ text = next_text(descr, encoding, realsize-(descr-realdata));
+ if(VERBOSE4) fprintf(stderr, "Note: Storing extra from %s encoding\n", enc_name(realdata[0]));
+ if(text == NULL)
+ {
+ if(NOQUIET) error("No extra frame text / valid description?");
+ return;
+ }
+ { // just vor variable scope
+ mpg123_string description;
+ mpg123_init_string(&description);
+ /* The outside storage gets reencoded to UTF-8 only if not requested otherwise.
+ Remember that we really need the -1 here to hand in the encoding byte!*/
+ store_id3_text( &description, descr-1, text-descr+1
+ , NOQUIET, fr->p.flags & MPG123_PLAIN_ID3TEXT );
+ xex = add_extra(fr, &description);
+ if(xex)
+ mpg123_move_string(&description, &xex->description);
+ else
+ mpg123_free_string(&description);
+ }
+ if(xex == NULL)
+ {
+ if(NOQUIET) error("Unable to attach new extra text!");
+ return;
+ }
+ memcpy(xex->id, id, 4);
+ init_mpg123_text(&localex); /* For our local copy. */
+
+ /* Our local copy is always stored in UTF-8! */
+ store_id3_text(&localex.description, descr-1, text-descr+1, NOQUIET, 0);
+ /* At first, only store the outside copy of the payload. We may not need the local copy. */
+ text[-1] = encoding;
+ store_id3_text(&xex->text, text-1, realsize-(text-realdata)+1, NOQUIET, fr->p.flags & MPG123_PLAIN_ID3TEXT);
+
+ /* Now check if we would like to interpret this extra info for RVA. */
+ if(localex.description.fill > 0)
+ {
+ int is_peak = 0;
+ int rva_mode = -1; /* mix / album */
+
+ if(!strncasecmp(localex.description.p, "replaygain_track_",17))
+ {
+ if(VERBOSE3) fprintf(stderr, "Note: RVA ReplayGain track gain/peak\n");
+
+ rva_mode = 0;
+ if(!strcasecmp(localex.description.p, "replaygain_track_peak")) is_peak = 1;
+ else if(strcasecmp(localex.description.p, "replaygain_track_gain")) rva_mode = -1;
+ }
+ else
+ if(!strncasecmp(localex.description.p, "replaygain_album_",17))
+ {
+ if(VERBOSE3) fprintf(stderr, "Note: RVA ReplayGain album gain/peak\n");
+
+ rva_mode = 1;
+ if(!strcasecmp(localex.description.p, "replaygain_album_peak")) is_peak = 1;
+ else if(strcasecmp(localex.description.p, "replaygain_album_gain")) rva_mode = -1;
+ }
+ if((rva_mode > -1) && (fr->rva.level[rva_mode] <= rva_level))
+ {
+ /* Now we need the translated copy of the data. */
+ store_id3_text(&localex.text, text-1, realsize-(text-realdata)+1, NOQUIET, 0);
+ if(localex.text.fill > 0)
+ {
+ if(is_peak)
+ {
+ fr->rva.peak[rva_mode] = (float) atof(localex.text.p);
+ if(VERBOSE3) fprintf(stderr, "Note: RVA peak %f\n", fr->rva.peak[rva_mode]);
+ }
+ else
+ {
+ fr->rva.gain[rva_mode] = (float) atof(localex.text.p);
+ if(VERBOSE3) fprintf(stderr, "Note: RVA gain %fdB\n", fr->rva.gain[rva_mode]);
+ }
+ fr->rva.level[rva_mode] = rva_level;
+ }
+ }
+ }
+
+ free_mpg123_text(&localex);
+}
+
+/* Make a ID3v2.3+ 4-byte ID from a ID3v2.2 3-byte ID
+ Note that not all frames survived to 2.4; the mapping goes to 2.3 .
+ A notable miss is the old RVA frame, which is very unspecific anyway.
+ This function returns -1 when a not known 3 char ID was encountered, 0 otherwise. */
+static int promote_framename(mpg123_handle *fr, char *id) /* fr because of VERBOSE macros */
+{
+ size_t i;
+ char *old[] =
+ {
+ "COM", "TAL", "TBP", "TCM", "TCO", "TCR", "TDA", "TDY", "TEN", "TFT",
+ "TIM", "TKE", "TLA", "TLE", "TMT", "TOA", "TOF", "TOL", "TOR", "TOT",
+ "TP1", "TP2", "TP3", "TP4", "TPA", "TPB", "TRC", "TDA", "TRK", "TSI",
+ "TSS", "TT1", "TT2", "TT3", "TXT", "TXX", "TYE"
+ };
+ char *new[] =
+ {
+ "COMM", "TALB", "TBPM", "TCOM", "TCON", "TCOP", "TDAT", "TDLY", "TENC", "TFLT",
+ "TIME", "TKEY", "TLAN", "TLEN", "TMED", "TOPE", "TOFN", "TOLY", "TORY", "TOAL",
+ "TPE1", "TPE2", "TPE3", "TPE4", "TPOS", "TPUB", "TSRC", "TRDA", "TRCK", "TSIZ",
+ "TSSE", "TIT1", "TIT2", "TIT3", "TEXT", "TXXX", "TYER"
+ };
+ for(i=0; i<sizeof(old)/sizeof(char*); ++i)
+ {
+ if(!strncmp(id, old[i], 3))
+ {
+ memcpy(id, new[i], 4);
+ if(VERBOSE3) fprintf(stderr, "Translated ID3v2.2 frame %s to %s\n", old[i], new[i]);
+ return 0;
+ }
+ }
+ if(VERBOSE3) fprintf(stderr, "Ignoring untranslated ID3v2.2 frame %c%c%c\n", id[0], id[1], id[2]);
+ return -1;
+}
+
+#endif /* NO_ID3V2 */
+
+int store_id3v2( mpg123_handle *fr
+, unsigned long first4bytes, unsigned char buf[6], unsigned long length )
+{
+ int ret = 1;
+ off_t ret2;
+ unsigned long fullen = 10+length;
+ if(fr->id3v2_raw)
+ free(fr->id3v2_raw);
+ fr->id3v2_size = 0;
+ /* Allocate one byte more for a closing zero as safety catch for strlen(). */
+ fr->id3v2_raw = malloc(fullen+1);
+ if(!fr->id3v2_raw)
+ {
+ fr->err = MPG123_OUT_OF_MEM;
+ if(NOQUIET)
+ error1("ID3v2: Arrg! Unable to allocate %lu bytes"
+ " for ID3v2 data - trying to skip instead.", length+1);
+ if((ret2=fr->rd->skip_bytes(fr,length)) < 0)
+ ret = ret2;
+ else
+ ret = 0;
+ }
+ else
+ {
+ fr->id3v2_raw[0] = (first4bytes>>24) & 0xff;
+ fr->id3v2_raw[1] = (first4bytes>>16) & 0xff;
+ fr->id3v2_raw[2] = (first4bytes>>8) & 0xff;
+ fr->id3v2_raw[3] = first4bytes & 0xff;
+ memcpy(fr->id3v2_raw+4, buf, 6);
+ if((ret2=fr->rd->read_frame_body(fr, fr->id3v2_raw+10, length)) < 0)
+ {
+ ret=ret2;
+ free(fr->id3v2_raw);
+ fr->id3v2_raw = NULL;
+ }
+ else
+ { /* Closing with a zero for paranoia. */
+ fr->id3v2_raw[fullen] = 0;
+ fr->id3v2_size = fullen;
+ }
+ }
+ return ret;
+}
+
+/*
+ trying to parse ID3v2.3 and ID3v2.4 tags...
+
+ returns: 0: bad or just unparseable tag
+ 1: good, (possibly) new tag info
+ <0: reader error (may need more data feed, try again)
+*/
+int parse_new_id3(mpg123_handle *fr, unsigned long first4bytes)
+{
+ #define UNSYNC_FLAG 128
+ #define EXTHEAD_FLAG 64 /* ID3v2.3+ */
+ #define COMPRESS_FLAG 64 /* ID3v2.2 */
+ #define EXP_FLAG 32
+ #define FOOTER_FLAG 16
+ #define EXT_UPDATE_FLAG 64 /* ID3v2.4 only: extended header update flag */
+ #define UNKNOWN_FLAGS 15 /* 00001111*/
+ unsigned char buf[6];
+ unsigned long length=0;
+ unsigned char flags = 0;
+ int ret = 1;
+ off_t ret2;
+ int storetag = 0;
+ unsigned int footlen = 0;
+#ifndef NO_ID3V2
+ int skiptag = 0;
+#endif
+ unsigned char major = first4bytes & 0xff;
+ debug1("ID3v2: major tag version: %i", major);
+
+ if(major == 0xff) return 0; /* Invalid... */
+ if((ret2 = fr->rd->read_frame_body(fr, buf, 6)) < 0) /* read more header information */
+ return ret2;
+
+ if(buf[0] == 0xff) return 0; /* Revision, will never be 0xff. */
+
+ if(fr->p.flags & MPG123_STORE_RAW_ID3)
+ storetag = 1;
+ /* second new byte are some nice flags, if these are invalid skip the whole thing */
+ flags = buf[1];
+ debug1("ID3v2: flags 0x%08x", flags);
+ /* use 4 bytes from buf to construct 28bit uint value and return 1; return 0 if bytes are not synchsafe */
+ #define synchsafe_to_long(buf,res) \
+ ( \
+ (((buf)[0]|(buf)[1]|(buf)[2]|(buf)[3]) & 0x80) ? 0 : \
+ (res = (((unsigned long) (buf)[0]) << 21) \
+ | (((unsigned long) (buf)[1]) << 14) \
+ | (((unsigned long) (buf)[2]) << 7) \
+ | ((unsigned long) (buf)[3]) \
+ ,1) \
+ )
+ /* id3v2.3 does not store synchsafe frame sizes, but synchsafe tag size - doh! */
+ /* Remember: bytes_to_long() can yield ULONG_MAX on 32 bit platforms! */
+ #define bytes_to_long(buf,res) \
+ ( \
+ major == 3 ? \
+ (res = (((unsigned long) (buf)[0]) << 24) \
+ | (((unsigned long) (buf)[1]) << 16) \
+ | (((unsigned long) (buf)[2]) << 8) \
+ | ((unsigned long) (buf)[3]) \
+ ,1) : synchsafe_to_long(buf,res) \
+ )
+ /* for id3v2.2 only */
+ #define threebytes_to_long(buf,res) \
+ ( \
+ res = (((unsigned long) (buf)[0]) << 16) \
+ | (((unsigned long) (buf)[1]) << 8) \
+ | ((unsigned long) (buf)[2]) \
+ )
+
+ /* length-10 or length-20 (footer present); 4 synchsafe integers == 28 bit number */
+ /* we have already read 10 bytes, so left are length or length+10 bytes belonging to tag */
+ /* Note: This is an 28 bit value in 32 bit storage, plenty of space for */
+ /* length+x for reasonable x. */
+ if(!synchsafe_to_long(buf+2,length))
+ {
+ if(NOQUIET) error4("Bad tag length (not synchsafe): 0x%02x%02x%02x%02x; You got a bad ID3 tag here.", buf[2],buf[3],buf[4],buf[5]);
+ return 0;
+ }
+ if(flags & FOOTER_FLAG)
+ footlen = 10;
+ debug1("ID3v2: tag data length %lu", length);
+#ifndef NO_ID3V2
+ if(VERBOSE2) fprintf(stderr,"Note: ID3v2.%i rev %i tag of %lu bytes\n", major, buf[0], length);
+ /* skip if unknown version/scary flags, parse otherwise */
+ if(fr->p.flags & MPG123_SKIP_ID3V2)
+ {
+ if(VERBOSE3)
+ fprintf(stderr, "Note: Skipping ID3v2 tag per user request.\n");
+ skiptag = 1;
+ }
+ if((flags & UNKNOWN_FLAGS) || (major > 4) || (major < 2))
+ {
+ if(NOQUIET)
+ warning2( "ID3v2: Won't parse the ID3v2 tag with major version"
+ " %u and flags 0x%xu - some extra code may be needed"
+ , major, flags );
+ skiptag = 1;
+ }
+ // Standard says that compressed tags should be ignored as there isn't an agreed
+ // compressoion scheme.
+ if(major == 2 && flags & COMPRESS_FLAG)
+ {
+ if(NOQUIET)
+ warning("ID3v2: ignoring compressed ID3v2.2 tag");
+ skiptag = 1;
+ }
+ if(length < 10)
+ {
+ if(NOQUIET)
+ warning1("ID3v2: unrealistic small tag lengh %lu, skipping", length);
+ skiptag = 1;
+ }
+ if(!skiptag)
+ storetag = 1;
+#endif
+ if(storetag)
+ {
+ /* Stores whole tag with footer and an additonal trailing zero. */
+ if((ret2 = store_id3v2(fr, first4bytes, buf, length+footlen)) <= 0)
+ return ret2;
+ }
+#ifndef NO_ID3V2
+ if(skiptag)
+ {
+ if(VERBOSE3)
+ fprintf(stderr, "Note: skipped tag clearing possibly existing ID3v2 data");
+ reset_id3(fr); // Old data is invalid.
+#endif
+ if(!storetag && (ret2=fr->rd->skip_bytes(fr,length+footlen))<0)
+ ret=ret2;
+#ifndef NO_ID3V2
+ }
+ else
+ {
+ unsigned char* tagdata = fr->id3v2_raw+10;
+ /* try to interpret that beast */
+ debug("ID3v2: analysing frames...");
+ if(length > 0)
+ {
+ unsigned char extflags = 0;
+ unsigned long tagpos = 0;
+ /* bytes of frame title and of framesize value */
+ unsigned int head_part = major > 2 ? 4 : 3;
+ unsigned int flag_part = major > 2 ? 2 : 0;
+ /* The amount of bytes that are unconditionally read for each frame: */
+ /* ID, size, flags. */
+ unsigned int framebegin = head_part+head_part+flag_part;
+ debug1("ID3v2: have read at all %lu bytes for the tag now", (unsigned long)length+6);
+ if(flags & EXTHEAD_FLAG)
+ {
+ debug("ID3v2: extended header");
+ if(!bytes_to_long(tagdata, tagpos) || tagpos >= length)
+ {
+ ret = 0;
+ if(NOQUIET)
+ error4( "Bad (non-synchsafe/too large) tag offset from extended header:"
+ "0x%02x%02x%02x%02x"
+ , tagdata[0], tagdata[1], tagdata[2], tagdata[3] );
+ } else if(tagpos < 6)
+ {
+ ret = 0;
+ if(NOQUIET)
+ merror("Extended header too small (%lu).", tagpos);
+ }
+ if(major == 3)
+ {
+ tagpos += 4; // The size itself is not included.
+ if(tagpos >= length)
+ {
+ ret = 0;
+ if(NOQUIET)
+ error("Too much extended v2.3 header.");
+ }
+ } else if(ret) // v2.4 and at least got my 6 bytes of ext header
+ {
+ // Only v4 knows update frames, check for that.
+ // Need to step back. Header is 4 bytes length, one byte flag size,
+ // one byte flags. Flag size has to be 1!
+ if(tagdata[4] == 1 && tagdata[5] & EXT_UPDATE_FLAG)
+ {
+ if(VERBOSE3)
+ fprintf(stderr, "Note: ID3v2.4 update tag\n");
+ extflags |= EXT_UPDATE_FLAG;
+ }
+ }
+ }
+ if(!(extflags & EXT_UPDATE_FLAG))
+ {
+ if(VERBOSE3)
+ fprintf(stderr, "Note: non-update tag replacing existing ID3v2 data\n");
+ reset_id3(fr);
+ }
+ if(ret > 0)
+ {
+ char id[5];
+ unsigned long framesize;
+ unsigned long fflags; /* need 16 bits, actually */
+ id[4] = 0;
+ fr->id3v2.version = major;
+ /* Pos now advanced after ext head, now a frame has to follow. */
+ /* Note: tagpos <= length, which is 28 bit integer, so both */
+ /* far away from overflow for adding known small values. */
+ /* I want to read at least one full header now. */
+ while(length >= tagpos+framebegin)
+ {
+ int i = 0;
+ unsigned long pos = tagpos;
+ /* level 1,2,3 - 0 is info from lame/info tag! */
+ /* rva tags with ascending significance, then general frames */
+ enum frame_types tt = unknown;
+ /* we may have entered the padding zone or any other strangeness: check if we have valid frame id characters */
+ for(i=0; i< head_part; ++i)
+ if( !( ((tagdata[tagpos+i] > 47) && (tagdata[tagpos+i] < 58))
+ || ((tagdata[tagpos+i] > 64) && (tagdata[tagpos+i] < 91)) ) )
+ {
+ debug5("ID3v2: real tag data apparently ended after %lu bytes with 0x%02x%02x%02x%02x", tagpos, tagdata[tagpos], tagdata[tagpos+1], tagdata[tagpos+2], tagdata[tagpos+3]);
+ /* This is no hard error... let's just hope that we got something meaningful already (ret==1 in that case). */
+ goto tagparse_cleanup; /* Need to escape two loops here. */
+ }
+ if(ret > 0)
+ {
+ /* 4 or 3 bytes id */
+ strncpy(id, (char*) tagdata+pos, head_part);
+ id[head_part] = 0; /* terminate for 3 or 4 bytes */
+ pos += head_part;
+ tagpos += head_part;
+ /* size as 32 bits or 28 bits */
+ if(fr->id3v2.version == 2) threebytes_to_long(tagdata+pos, framesize);
+ else
+ if(!bytes_to_long(tagdata+pos, framesize))
+ {
+ /* Just assume that up to now there was some good data. */
+ if(NOQUIET) error1("ID3v2: non-syncsafe size of %s frame, skipping the remainder of tag", id);
+ break;
+ }
+ if(VERBOSE3) fprintf(stderr, "Note: ID3v2 %s frame of size %lu\n", id, framesize);
+ tagpos += head_part;
+ pos += head_part;
+ if(fr->id3v2.version > 2)
+ {
+ fflags = (((unsigned long) tagdata[pos]) << 8) | ((unsigned long) tagdata[pos+1]);
+ pos += 2;
+ tagpos += 2;
+ }
+ else fflags = 0;
+
+ if(length - tagpos < framesize)
+ {
+ if(NOQUIET) error("Whoa! ID3v2 frame claims to be larger than the whole rest of the tag.");
+ break;
+ }
+ tagpos += framesize; /* the important advancement in whole tag */
+ /* for sanity, after full parsing tagpos should be == pos */
+ /* debug4("ID3v2: found %s frame, size %lu (as bytes: 0x%08lx), flags 0x%016lx", id, framesize, framesize, fflags); */
+ /* v2.4: %0abc0000 %0h00kmnp */
+ /* v2.3: %abc00000 %ijk00000 */
+ /* v2.2: just zero */
+ #define V3 (major == 3)
+ #define BAD_FFLAGS (unsigned long) (V3 ? 7967 : 36784)
+ #define PRES_TAG_FFLAG (unsigned long) (V3 ? 32768 : 16384)
+ #define PRES_FILE_FFLAG (unsigned long) (V3 ? 16384 : 8192)
+ #define READ_ONLY_FFLAG (unsigned long) (V3 ? 8192 : 4096)
+ #define GROUP_FFLAG (unsigned long) (V3 ? 32 : 64)
+ #define COMPR_FFLAG (unsigned long) (V3 ? 128 : 8)
+ #define ENCR_FFLAG (unsigned long) (V3 ? 64 : 4)
+ #define UNSYNC_FFLAG (unsigned long) (V3 ? 0 : 2)
+ #define DATLEN_FFLAG (unsigned long) (V3 ? 0 : 1)
+ if(head_part < 4 && promote_framename(fr, id) != 0) continue;
+
+ /* shall not or want not handle these */
+ if(fflags & (BAD_FFLAGS | COMPR_FFLAG | ENCR_FFLAG))
+ {
+ if(NOQUIET) warning("ID3v2: skipping invalid/unsupported frame");
+ continue;
+ }
+
+ for(i = 0; i < KNOWN_FRAMES; ++i)
+ if(!strncmp(frame_type[i], id, 4)){ tt = i; break; }
+
+ if(id[0] == 'T' && tt != extra) tt = text;
+
+ if(tt != unknown)
+ {
+ int rva_mode = -1; /* mix / album */
+ unsigned long realsize = framesize;
+ unsigned char* realdata = tagdata+pos;
+ unsigned char* unsyncbuffer = NULL;
+ if(((flags & UNSYNC_FLAG) || (fflags & UNSYNC_FFLAG)) && framesize > 0)
+ {
+ unsigned long ipos = 0;
+ unsigned long opos = 0;
+ debug("Id3v2: going to de-unsync the frame data");
+ /* de-unsync: FF00 -> FF; real FF00 is simply represented as FF0000 ... */
+ /* damn, that means I have to delete bytes from withing the data block... thus need temporal storage */
+ /* standard mandates that de-unsync should always be safe if flag is set */
+ realdata = unsyncbuffer = malloc(framesize+1); /* will need <= bytes, plus a safety zero */
+ if(realdata == NULL)
+ {
+ if(NOQUIET) error("ID3v2: unable to allocate working buffer for de-unsync");
+ continue;
+ }
+ /* now going byte per byte through the data... */
+ realdata[0] = tagdata[pos];
+ opos = 1;
+ for(ipos = pos+1; ipos < pos+framesize; ++ipos)
+ {
+ if(!((tagdata[ipos] == 0) && (tagdata[ipos-1] == 0xff)))
+ {
+ realdata[opos++] = tagdata[ipos];
+ }
+ }
+ realsize = opos;
+ /* Append a zero to keep strlen() safe. */
+ realdata[realsize] = 0;
+ debug2("ID3v2: de-unsync made %lu out of %lu bytes", realsize, framesize);
+ }
+ // The spec says there is a group byte, without explicitly saying that it is
+ // the first thing following the header. I just assume so, because of the
+ // ordering of the flags.
+ if(fflags & GROUP_FFLAG)
+ { // Just skip group byte.
+ if(realsize)
+ {
+ if(VERBOSE3)
+ fprintf(stderr, "Note: frame of group %d\n", realdata[0]);
+ --realsize;
+ ++realdata;
+ } else if(NOQUIET)
+ error("Grouped frame without group byte, even.");
+ }
+ if(fflags & DATLEN_FFLAG)
+ {
+ // Spec says the original (without compression or unsync) data length follows,
+ // so it should match de-unsynced data now.
+ if(realsize >= 4)
+ {
+ unsigned long datlen;
+ if(bytes_to_long(realdata, datlen) && datlen == realsize-4)
+ {
+ realsize -= 4;
+ realdata += 4;
+ } else
+ {
+ if(NOQUIET)
+ error("frame data length bad, skipping");
+ realsize = 0;
+ }
+ } else
+ {
+ realsize = 0;
+ if(NOQUIET)
+ error("frame truncated at frame data length, skipping");
+ }
+ }
+ pos = 0; /* now at the beginning again... */
+ /* Avoid reading over boundary, even if there is a */
+ /* zero byte of padding for safety. */
+ if(realsize) switch(tt)
+ {
+ case comment:
+ case uslt:
+ process_comment(fr, tt, realdata, realsize, comment+1, id);
+ break;
+ case extra: /* perhaps foobar2000's work */
+ process_extra(fr, realdata, realsize, extra+1, id);
+ break;
+ case rva2: /* "the" RVA tag */
+ {
+ /* starts with null-terminated identification */
+ if(VERBOSE3) fprintf(stderr, "Note: RVA2 identification \"%s\"\n", realdata);
+ /* default: some individual value, mix mode */
+ rva_mode = 0;
+ if( !strncasecmp((char*)realdata, "album", 5)
+ || !strncasecmp((char*)realdata, "audiophile", 10)
+ || !strncasecmp((char*)realdata, "user", 4))
+ rva_mode = 1;
+ if(fr->rva.level[rva_mode] <= rva2+1)
+ {
+ pos += strlen((char*) realdata) + 1;
+ debug2("got my pos: %lu - %lu", realsize, pos);
+ // channel and two bytes for RVA value
+ // pos possibly just past the safety zero, so one more than realsize
+ if(pos > realsize || realsize-pos < 3)
+ {
+ if(NOQUIET)
+ error("bad RVA2 tag (truncated?)");
+ }
+ else if(realdata[pos] == 1)
+ {
+ ++pos;
+ /* only handle master channel */
+ debug("ID3v2: it is for the master channel");
+ /* two bytes adjustment, one byte for bits representing peak - n bytes, eh bits, for peak */
+ /* 16 bit signed integer = dB * 512. Do not shift signed integers! Multiply instead.
+ Also no implementation-defined casting. Reinterpret the pointer to signed char, then do
+ proper casting. */
+ fr->rva.gain[rva_mode] = (float) (
+ ((short)((signed char*)realdata)[pos]) * 256 + (short)realdata[pos+1] ) / 512;
+ pos += 2;
+ if(VERBOSE3) fprintf(stderr, "Note: RVA value %fdB\n", fr->rva.gain[rva_mode]);
+ /* heh, the peak value is represented by a number of bits - but in what manner? Skipping that part */
+ fr->rva.peak[rva_mode] = 0;
+ fr->rva.level[rva_mode] = rva2+1;
+ }
+ }
+ }
+ break;
+ /* non-rva metainfo, simply store... */
+ case text:
+ process_text(fr, realdata, realsize, id);
+ break;
+ case picture:
+ if (fr->p.flags & MPG123_PICTURE)
+ process_picture(fr, realdata, realsize);
+
+ break;
+ default: if(NOQUIET) error1("ID3v2: unknown frame type %i", tt);
+ }
+ if(unsyncbuffer)
+ free(unsyncbuffer);
+ }
+ #undef V3
+ #undef BAD_FFLAGS
+ #undef PRES_TAG_FFLAG
+ #undef PRES_FILE_FFLAG
+ #undef READ_ONLY_FFLAG
+ #undef GROUP_FFLAG
+ #undef COMPR_FFLAG
+ #undef ENCR_FFLAG
+ #undef UNSYNC_FFLAG
+ #undef DATLEN_FFLAG
+ }
+ else break;
+ #undef KNOWN_FRAMES
+ }
+ } else
+ {
+ if(VERBOSE3)
+ fprintf(stderr, "Note: faulty ID3v2 tag still clearing old data\n");
+ reset_id3(fr);
+ }
+ } else // No new data, but still there was a tag that invalidates old data.
+ {
+ if(VERBOSE3)
+ fprintf(stderr, "Note: empty ID3v2 clearing old data\n");
+ reset_id3(fr);
+ }
+tagparse_cleanup:
+ /* Get rid of stored raw data that should not be kept. */
+ if(!(fr->p.flags & MPG123_STORE_RAW_ID3))
+ {
+ free(fr->id3v2_raw);
+ fr->id3v2_raw = NULL;
+ fr->id3v2_size = 0;
+ }
+ }
+#endif /* NO_ID3V2 */
+ return ret;
+ #undef UNSYNC_FLAG
+ #undef EXTHEAD_FLAG
+ #undef COMPRESS_FLAG
+ #undef EXP_FLAG
+ #undef FOOTER_FLAG
+ #undef EXT_UPDATE_FLAG
+ #undef UNKOWN_FLAGS
+}
+
+#ifndef NO_ID3V2 /* Disabling all the rest... */
+
+static void convert_latin1(mpg123_string *sb, const unsigned char* s, size_t l, const int noquiet)
+{
+ size_t length = l;
+ size_t i;
+ unsigned char *p;
+ /* determine real length, a latin1 character can at most take 2 in UTF8 */
+ for(i=0; i<l; ++i)
+ if(s[i] >= 0x80) ++length;
+
+ debug1("UTF-8 length: %lu", (unsigned long)length);
+ /* one extra zero byte for paranoia */
+ if(!mpg123_grow_string(sb, length+1))
+ return;
+
+ p = (unsigned char*) sb->p; /* Signedness doesn't matter but it shows I thought about the non-issue */
+ for(i=0; i<l; ++i)
+ if(s[i] < 0x80){ *p = s[i]; ++p; }
+ else /* two-byte encoding */
+ {
+ *p = 0xc0 | (s[i]>>6);
+ *(p+1) = 0x80 | (s[i] & 0x3f);
+ p+=2;
+ }
+
+ sb->p[length] = 0;
+ sb->fill = length+1;
+}
+
+/*
+ Check if we have a byte oder mark(s) there, return:
+ -1: little endian
+ 0: no BOM
+ 1: big endian
+
+ This modifies source and len to indicate the data _after_ the BOM(s).
+ Note on nasty data: The last encountered BOM determines the endianness.
+ I have seen data with multiple BOMS, namely from "the" id3v2 program.
+ Not nice, but what should I do?
+*/
+static int check_bom(const unsigned char** source, size_t *len)
+{
+ int last_bom = 0;
+
+ while(*len >= 2)
+ {
+ int this_bom = 0;
+ if((*source)[0] == 0xff && (*source)[1] == 0xfe)
+ this_bom = -1;
+ if((*source)[0] == 0xfe && (*source)[1] == 0xff)
+ this_bom = 1;
+ if(this_bom == 0)
+ break;
+ /* Skip the detected BOM. */
+ last_bom = this_bom;
+ *source += 2;
+ *len -= 2;
+ }
+ return last_bom;
+}
+
+#define FULLPOINT(f,s) ( (((f)&0x3ff)<<10) + ((s)&0x3ff) + 0x10000 )
+/* Remember: There's a limit at 0x1ffff. */
+#define UTF8LEN(x) ( (x)<0x80 ? 1 : ((x)<0x800 ? 2 : ((x)<0x10000 ? 3 : 4)))
+static void convert_utf16bom(mpg123_string *sb, const unsigned char* s, size_t l, const int noquiet)
+{
+ size_t i;
+ size_t n; /* number bytes that make up full pairs */
+ unsigned char *p;
+ size_t length = 0; /* the resulting UTF-8 length */
+ /* Determine real length... extreme case can be more than utf-16 length. */
+ size_t high = 0;
+ size_t low = 1;
+ int bom_endian;
+
+ debug1("convert_utf16 with length %lu", (unsigned long)l);
+
+ bom_endian = check_bom(&s, &l);
+ debug1("UTF16 endianness check: %i", bom_endian);
+
+ if(bom_endian == -1) /* little-endian */
+ {
+ high = 1; /* The second byte is the high byte. */
+ low = 0; /* The first byte is the low byte. */
+ }
+
+ n = (l/2)*2; /* number bytes that make up full pairs */
+
+ /* first: get length, check for errors -- stop at first one */
+ for(i=0; i < n; i+=2)
+ {
+ unsigned long point = ((unsigned long) s[i+high]<<8) + s[i+low];
+ if((point & 0xfc00) == 0xd800) /* lead surrogate */
+ {
+ unsigned short second = (i+3 < l) ? (s[i+2+high]<<8) + s[i+2+low] : 0;
+ if((second & 0xfc00) == 0xdc00) /* good... */
+ {
+ point = FULLPOINT(point,second);
+ length += UTF8LEN(point); /* possibly 4 bytes */
+ i+=2; /* We overstepped one word. */
+ }
+ else /* if no valid pair, break here */
+ {
+ if(noquiet) error2("Invalid UTF16 surrogate pair at %li (0x%04lx).", (unsigned long)i, point);
+ n = i; /* Forget the half pair, END! */
+ break;
+ }
+ }
+ else length += UTF8LEN(point); /* 1,2 or 3 bytes */
+ }
+
+ if(!mpg123_grow_string(sb, length+1))
+ return;
+
+ /* Now really convert, skip checks as these have been done just before. */
+ p = (unsigned char*) sb->p; /* Signedness doesn't matter but it shows I thought about the non-issue */
+ for(i=0; i < n; i+=2)
+ {
+ unsigned long codepoint = ((unsigned long) s[i+high]<<8) + s[i+low];
+ if((codepoint & 0xfc00) == 0xd800) /* lead surrogate */
+ {
+ unsigned short second = (s[i+2+high]<<8) + s[i+2+low];
+ codepoint = FULLPOINT(codepoint,second);
+ i+=2; /* We overstepped one word. */
+ }
+ if(codepoint < 0x80) *p++ = (unsigned char) codepoint;
+ else if(codepoint < 0x800)
+ {
+ *p++ = (unsigned char) (0xc0 | (codepoint>>6));
+ *p++ = (unsigned char) (0x80 | (codepoint & 0x3f));
+ }
+ else if(codepoint < 0x10000)
+ {
+ *p++ = (unsigned char) (0xe0 | (codepoint>>12));
+ *p++ = 0x80 | ((codepoint>>6) & 0x3f);
+ *p++ = 0x80 | (codepoint & 0x3f);
+ }
+ else if (codepoint < 0x200000)
+ {
+ *p++ = (unsigned char) (0xf0 | codepoint>>18);
+ *p++ = (unsigned char) (0x80 | ((codepoint>>12) & 0x3f));
+ *p++ = (unsigned char) (0x80 | ((codepoint>>6) & 0x3f));
+ *p++ = (unsigned char) (0x80 | (codepoint & 0x3f));
+ } /* ignore bigger ones (that are not possible here anyway) */
+ }
+ sb->p[sb->size-1] = 0; /* paranoia... */
+ sb->fill = sb->size;
+}
+#undef UTF8LEN
+#undef FULLPOINT
+
+static void convert_utf8(mpg123_string *sb, const unsigned char* source, size_t len, const int noquiet)
+{
+ if(mpg123_grow_string(sb, len+1))
+ {
+ memcpy(sb->p, source, len);
+ sb->p[len] = 0;
+ sb->fill = len+1;
+ }
+}
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/id3.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/id3.h
new file mode 100644
index 00000000..3a566949
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/id3.h
@@ -0,0 +1,43 @@
+/*
+ id3: ID3v2.3 and ID3v2.4 parsing (a relevant subset)
+
+ copyright 2006-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis
+*/
+
+#ifndef MPG123_ID3_H
+#define MPG123_ID3_H
+
+/* really need it _here_! */
+#include "frame.h"
+
+#ifdef NO_ID3V2
+# ifdef init_id3
+# undef init_id3
+# endif
+# define init_id3(fr)
+# ifdef exit_id3
+# undef exit_id3
+# endif
+# define exit_id3(fr)
+# ifdef reset_id3
+# undef reset_id3
+# endif
+# define reset_id3(fr)
+# ifdef id3_link
+# undef id3_link
+# endif
+# define id3_link(fr)
+#else
+void init_id3(mpg123_handle *fr);
+void exit_id3(mpg123_handle *fr);
+void reset_id3(mpg123_handle *fr);
+void id3_link(mpg123_handle *fr);
+#endif
+int parse_new_id3(mpg123_handle *fr, unsigned long first4bytes);
+/* Convert text from some ID3 encoding to UTf-8.
+ On error, sb->fill is 0. The noquiet flag enables warning/error messages. */
+void id3_to_utf8(mpg123_string *sb, unsigned char encoding, const unsigned char *source, size_t source_size, int noquiet);
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/index.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/index.c
new file mode 100644
index 00000000..f8d94de5
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/index.c
@@ -0,0 +1,132 @@
+/*
+ index: frame index data structure and functions
+
+ copyright 2007-2020 by the mpg123 project
+ -= free software under the terms of the LGPL 2.1 =-
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis
+*/
+
+#include "intsym.h"
+#include "index.h"
+#include "debug.h"
+
+/* The next expected frame offset, one step ahead. */
+static off_t fi_next(struct frame_index *fi)
+{
+ return (off_t)fi->fill*fi->step;
+}
+
+/* Shrink down the used index to the half.
+ Be careful with size = 1 ... there's no shrinking possible there. */
+static void fi_shrink(struct frame_index *fi)
+{
+ if(fi->fill < 2) return; /* Won't shrink below 1. */
+ else
+ { /* Double the step, half the fill. Should work as well for fill%2 = 1 */
+ size_t c;
+ debug2("shrink index with fill %lu and step %lu", (unsigned long)fi->fill, (unsigned long)fi->step);
+ fi->step *= 2;
+ fi->fill /= 2;
+ /* Move the data down. */
+ for(c = 0; c < fi->fill; ++c)
+ fi->data[c] = fi->data[2*c];
+ }
+
+ fi->next = fi_next(fi);
+}
+
+void fi_init(struct frame_index *fi)
+{
+ fi->data = NULL;
+ fi->step = 1;
+ fi->fill = 0;
+ fi->size = 0;
+ fi->grow_size = 0;
+ fi->next = fi_next(fi);
+}
+
+void fi_exit(struct frame_index *fi)
+{
+ debug2("fi_exit: %p and %lu", (void*)fi->data, (unsigned long)fi->size);
+ if(fi->size && fi->data != NULL) free(fi->data);
+
+ fi_init(fi); /* Be prepared for further fun, still. */
+}
+
+int fi_resize(struct frame_index *fi, size_t newsize)
+{
+ off_t *newdata = NULL;
+ if(newsize == fi->size) return 0;
+
+ if(newsize > 0 && newsize < fi->size)
+ { /* When we reduce buffer size a bit, shrink stuff. */
+ while(fi->fill > newsize){ fi_shrink(fi); }
+ }
+
+ newdata = safe_realloc(fi->data, newsize*sizeof(off_t));
+ if(newsize == 0 || newdata != NULL)
+ {
+ fi->data = newdata;
+ fi->size = newsize;
+ if(fi->fill > fi->size) fi->fill = fi->size;
+
+ fi->next = fi_next(fi);
+ debug2("new index of size %lu at %p", (unsigned long)fi->size, (void*)fi->data);
+ return 0;
+ } else
+ return -1;
+}
+
+void fi_add(struct frame_index *fi, off_t pos)
+{
+ debug3("wanting to add to fill %lu, step %lu, size %lu", (unsigned long)fi->fill, (unsigned long)fi->step, (unsigned long)fi->size);
+ if(fi->fill == fi->size)
+ { /* Index is full, we need to shrink... or grow. */
+ /* Store the current frame number to check later if we still want it. */
+ off_t framenum = fi->fill*fi->step;
+ /* If we want not / cannot grow, we shrink. */
+ if( !(fi->grow_size && fi_resize(fi, fi->size+fi->grow_size)==0) )
+ fi_shrink(fi);
+
+ /* Now check if we still want to add this frame (could be that not, because of changed step). */
+ if(fi->next != framenum) return;
+ }
+ /* When we are here, we want that frame. */
+ if(fi->fill < fi->size) /* safeguard for size=1, or just generally */
+ {
+ debug1("adding to index at %p", (void*)(fi->data+fi->fill));
+ fi->data[fi->fill] = pos;
+ ++fi->fill;
+ fi->next = fi_next(fi);
+ debug3("added pos %li to index with fill %lu and step %lu", (long) pos, (unsigned long)fi->fill, (unsigned long)fi->step);
+ }
+}
+
+int fi_set(struct frame_index *fi, off_t *offsets, off_t step, size_t fill)
+{
+ if(fi_resize(fi, fill) == -1) return -1;
+ fi->step = step;
+ if(offsets != NULL)
+ {
+ memcpy(fi->data, offsets, fill*sizeof(off_t));
+ fi->fill = fill;
+ }
+ else
+ {
+ /* allocation only, no entries in index yet */
+ fi->fill = 0;
+ }
+ fi->next = fi_next(fi);
+ debug3("set new index of fill %lu, size %lu at %p",
+ (unsigned long)fi->fill, (unsigned long)fi->size, (void*)fi->data);
+ return 0;
+}
+
+void fi_reset(struct frame_index *fi)
+{
+ debug1("reset with size %"SIZE_P, (size_p)fi->size);
+ fi->fill = 0;
+ fi->step = 1;
+ fi->next = fi_next(fi);
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/index.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/index.h
new file mode 100644
index 00000000..3e1ca648
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/index.h
@@ -0,0 +1,59 @@
+#ifndef MPG123_H_INDEX
+#define MPG123_H_INDEX
+
+/*
+ index: frame index data structure and functions
+
+ This is for keeping track of frame positions for accurate seeking.
+ Now in it's own file, with initial code from frame.c and parse.c .
+
+ The idea of the index with a certain amount of entries is to cover
+ all yet-encountered frame positions with minimal coarseness.
+ Meaning: At first every frame position is recorded, then, when
+ the index is full, every second position is trown away to make
+ space. Next time it is full, the same happens. And so on.
+ In this manner we maintain a good resolution with the given
+ maximum index size while covering the whole stream.
+
+ copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis
+*/
+
+#include "config.h"
+#include "compat.h"
+
+struct frame_index
+{
+ off_t *data; /* actual data, the frame positions */
+ off_t step; /* advancement in frame number per index point */
+ off_t next; /* frame offset supposed to come next into the index */
+ size_t size; /* total number of possible entries */
+ size_t fill; /* number of used entries */
+ size_t grow_size; /* if > 0: index allowed to grow on need with these steps, instead of lowering resolution */
+};
+
+/* The condition for a framenum to be appended to the index.
+ if(FI_NEXT(fr->index, fr->num)) fi_add(offset); */
+#define FI_NEXT(fi, framenum) ((fi).size && framenum == (fi).next)
+
+/* Initialize stuff, set things to zero and NULL... */
+void fi_init(struct frame_index *fi);
+/* Deallocate/zero things. */
+void fi_exit(struct frame_index *fi);
+
+/* Prepare a given size, preserving current fill, if possible.
+ If the new size is smaller than fill, the entry density is reduced.
+ Return 0 on success. */
+int fi_resize(struct frame_index *fi, size_t newsize);
+
+/* Append a frame position, reducing index density if needed. */
+void fi_add(struct frame_index *fi, off_t pos);
+
+/* Replace the frame index */
+int fi_set(struct frame_index *fi, off_t *offsets, off_t step, size_t fill);
+
+/* Empty the index (setting fill=0 and step=1), but keep current size. */
+void fi_reset(struct frame_index *fi);
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/init_costabs.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/init_costabs.h
new file mode 100644
index 00000000..97095573
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/init_costabs.h
@@ -0,0 +1,24 @@
+/*
+ The function to compute the cos tables at runtime or for pregeneration.
+
+ copyright ?-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp (in tabinit.c).
+
+ The type clreal is either double or float, COS() is cos() or cosf() for runtime.
+*/
+
+void init_costabs(void)
+{
+ clreal *cpnts[] = { cos64,cos32,cos16,cos8,cos4 };
+ int i,k,kr,divv;
+ clreal *costab;
+
+ for(i=0;i<5;i++)
+ {
+ kr=0x10>>i; divv=0x40>>i;
+ costab = cpnts[i];
+ for(k=0;k<kr;k++)
+ costab[k] = 1.0 / (2.0 * COS(M_PI * ((clreal) k * 2.0 + 1.0) / (clreal) divv));
+ }
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/init_layer12.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/init_layer12.h
new file mode 100644
index 00000000..b8de19b9
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/init_layer12.h
@@ -0,0 +1,58 @@
+/*
+ The function to compute the layer I and II tables at runtime or for pregeneration.
+
+ copyright ?-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp (in layer2.c).
+
+ The type clreal is either double or float. POW() is pow() or powf().
+*/
+
+void init_layer12(void)
+{
+ const clreal mulmul[27] =
+ {
+ 0.0 , -2.0/3.0 , 2.0/3.0 ,
+ 2.0/7.0 , 2.0/15.0 , 2.0/31.0, 2.0/63.0 , 2.0/127.0 , 2.0/255.0 ,
+ 2.0/511.0 , 2.0/1023.0 , 2.0/2047.0 , 2.0/4095.0 , 2.0/8191.0 ,
+ 2.0/16383.0 , 2.0/32767.0 , 2.0/65535.0 ,
+ -4.0/5.0 , -2.0/5.0 , 2.0/5.0, 4.0/5.0 ,
+ -8.0/9.0 , -4.0/9.0 , -2.0/9.0 , 2.0/9.0 , 4.0/9.0 , 8.0/9.0
+ };
+ // void init_layer12_stuff()
+ // real* init_layer12_table()
+ for(int k=0;k<27;k++)
+ {
+ int i,j;
+ clreal *table = layer12_table[k];
+ for(j=3,i=0;i<63;i++,j--)
+ *table++ = mulmul[k] * POW(2.0,(clreal) j / 3.0);
+ *table++ = 0.0;
+ }
+
+ // void init_layer12()
+ const unsigned char base[3][9] =
+ {
+ { 1 , 0, 2 , } ,
+ { 17, 18, 0 , 19, 20 , } ,
+ { 21, 1, 22, 23, 0, 24, 25, 2, 26 }
+ };
+ int i,j,k,l,len;
+ const int tablen[3] = { 3 , 5 , 9 };
+ unsigned char *itable;
+ unsigned char *tables[3] = { grp_3tab , grp_5tab , grp_9tab };
+
+ for(i=0;i<3;i++)
+ {
+ itable = tables[i];
+ len = tablen[i];
+ for(j=0;j<len;j++)
+ for(k=0;k<len;k++)
+ for(l=0;l<len;l++)
+ {
+ *itable++ = base[i][l];
+ *itable++ = base[i][k];
+ *itable++ = base[i][j];
+ }
+ }
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/init_layer3.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/init_layer3.h
new file mode 100644
index 00000000..2ad9db15
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/init_layer3.h
@@ -0,0 +1,231 @@
+/*
+ The function to compute the layer III tables at runtime or for pregeneration.
+
+ copyright ?-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp (in layer3.c).
+
+ The type clreal is either double or float.
+*/
+
+// init tables for layer-3 ... specific with the downsampling...
+void init_layer3(void)
+{
+ int i,j,k,l;
+
+ for(i=0;i<8207;i++)
+ ispow[i] = POW((clreal)i,(clreal)4.0/3.0);
+
+ for(i=0;i<8;i++)
+ {
+ const clreal Ci[8] = {-0.6,-0.535,-0.33,-0.185,-0.095,-0.041,-0.0142,-0.0037};
+ clreal sq = sqrt(1.0+Ci[i]*Ci[i]);
+ aa_cs[i] = 1.0/sq;
+ aa_ca[i] = Ci[i]/sq;
+ }
+
+ for(i=0;i<18;i++)
+ {
+ win[0][i] = win[1][i] =
+ 0.5*SIN(M_PI/72.0 * (clreal)(2*(i+0) +1)) / COS(M_PI * (clreal)(2*(i+0) +19) / 72.0);
+ win[0][i+18] = win[3][i+18] =
+ 0.5*SIN(M_PI/72.0 * (clreal)(2*(i+18)+1)) / COS(M_PI * (clreal)(2*(i+18)+19) / 72.0);
+ }
+ for(i=0;i<6;i++)
+ {
+ win[1][i+18] = 0.5 / COS( M_PI * (clreal) (2*(i+18)+19) / 72.0 );
+ win[3][i+12] = 0.5 / COS( M_PI * (clreal) (2*(i+12)+19) / 72.0 );
+ win[1][i+24] = 0.5 * SIN( M_PI / 24.0 * (clreal) (2*i+13) ) / COS( M_PI * (clreal) (2*(i+24)+19) / 72.0 );
+ win[1][i+30] = win[3][i] = 0.0;
+ win[3][i+6 ] = 0.5 * SIN( M_PI / 24.0 * (clreal) (2*i+1 ) ) / COS( M_PI * (clreal) (2*(i+6 )+19) / 72.0 );
+ }
+
+ for(i=0;i<9;i++)
+ COS9[i] = COS( M_PI / 18.0 * (clreal) i);
+
+ for(i=0;i<9;i++)
+ tfcos36[i] = 0.5 / COS( M_PI * (clreal) (i*2+1) / 36.0 );
+
+ for(i=0;i<3;i++)
+ tfcos12[i] = 0.5 / COS( M_PI * (clreal) (i*2+1) / 12.0 );
+
+ COS6_1 = COS( M_PI / 6.0 * (clreal) 1);
+ COS6_2 = COS( M_PI / 6.0 * (clreal) 2);
+
+ cos9[0] = COS(1.0*M_PI/9.0);
+ cos9[1] = COS(5.0*M_PI/9.0);
+ cos9[2] = COS(7.0*M_PI/9.0);
+ cos18[0] = COS(1.0*M_PI/18.0);
+ cos18[1] = COS(11.0*M_PI/18.0);
+ cos18[2] = COS(13.0*M_PI/18.0);
+
+ for(i=0;i<12;i++)
+ {
+ win[2][i] = 0.5 * SIN( M_PI / 24.0 * (clreal) (2*i+1) ) / COS( M_PI * (clreal) (2*i+7) / 24.0 );
+ }
+
+ for(i=0;i<16;i++)
+ {
+ // Special-casing possibly troublesome values where t=inf or
+ // t=-1 in theory. In practice, this never caused issues, but there might
+ // be a system with enough precision in M_PI to raise an exception.
+ // Actually, the special values are not excluded from use in the code, but
+ // in practice, they even have no effect in the compliance tests.
+ if(i > 11) // It's periodic!
+ {
+ tan1_1[i] = tan1_1[i-12];
+ tan2_1[i] = tan2_1[i-12];
+ tan1_2[i] = tan1_2[i-12];
+ tan2_2[i] = tan2_2[i-12];
+ } else if(i == 6) // t=inf
+ {
+ tan1_1[i] = 1.0;
+ tan2_1[i] = 0.0;
+ tan1_2[i] = M_SQRT2;
+ tan2_2[i] = 0.0;
+ } else if(i == 9) // t=-1
+ {
+ tan1_1[i] = -HUGE_VAL;
+ tan2_1[i] = HUGE_VAL;
+ tan1_2[i] = -HUGE_VAL;
+ tan2_2[i] = HUGE_VAL;
+ } else
+ {
+ clreal t = TAN( (clreal) i * M_PI / 12.0 );
+ tan1_1[i] = t / (1.0+t);
+ tan2_1[i] = 1.0 / (1.0 + t);
+ tan1_2[i] = M_SQRT2 * t / (1.0+t);
+ tan2_2[i] = M_SQRT2 / (1.0 + t);
+ }
+ }
+
+ for(i=0;i<32;i++)
+ {
+ for(j=0;j<2;j++)
+ {
+ clreal base = POW(2.0,-0.25*(j+1.0));
+ clreal p1=1.0,p2=1.0;
+ if(i > 0)
+ {
+ if( i & 1 ) p1 = POW(base,(i+1.0)*0.5);
+ else p2 = POW(base,i*0.5);
+ }
+ pow1_1[j][i] = p1;
+ pow2_1[j][i] = p2;
+ pow1_2[j][i] = M_SQRT2 * p1;
+ pow2_2[j][i] = M_SQRT2 * p2;
+ }
+ }
+
+ for(j=0;j<4;j++)
+ {
+ const int len[4] = { 36,36,12,36 };
+ for(i=0;i<len[j];i+=2) win1[j][i] = + win[j][i];
+
+ for(i=1;i<len[j];i+=2) win1[j][i] = - win[j][i];
+ }
+
+ for(j=0;j<9;j++)
+ {
+ const struct bandInfoStruct *bi = &bandInfo[j];
+ short *mp;
+ short cb,lwin;
+ const unsigned char *bdf;
+ int switch_idx;
+
+ mp = map[j][0] = mapbuf0[j];
+ bdf = bi->longDiff;
+ switch_idx = (j < 3) ? 8 : 6;
+ for(i=0,cb = 0; cb < switch_idx ; cb++,i+=*bdf++)
+ {
+ *mp++ = (*bdf) >> 1;
+ *mp++ = i;
+ *mp++ = 3;
+ *mp++ = cb;
+ }
+ bdf = bi->shortDiff+3;
+ for(cb=3;cb<13;cb++)
+ {
+ int l = (*bdf++) >> 1;
+ for(lwin=0;lwin<3;lwin++)
+ {
+ *mp++ = l;
+ *mp++ = i + lwin;
+ *mp++ = lwin;
+ *mp++ = cb;
+ }
+ i += 6*l;
+ }
+ mapend[j][0] = mp;
+
+ mp = map[j][1] = mapbuf1[j];
+ bdf = bi->shortDiff+0;
+ for(i=0,cb=0;cb<13;cb++)
+ {
+ int l = (*bdf++) >> 1;
+ for(lwin=0;lwin<3;lwin++)
+ {
+ *mp++ = l;
+ *mp++ = i + lwin;
+ *mp++ = lwin;
+ *mp++ = cb;
+ }
+ i += 6*l;
+ }
+ mapend[j][1] = mp;
+
+ mp = map[j][2] = mapbuf2[j];
+ bdf = bi->longDiff;
+ for(cb = 0; cb < 22 ; cb++)
+ {
+ *mp++ = (*bdf++) >> 1;
+ *mp++ = cb;
+ }
+ mapend[j][2] = mp;
+ }
+
+ /* Now for some serious loopings! */
+ for(i=0;i<5;i++)
+ for(j=0;j<6;j++)
+ for(k=0;k<6;k++)
+ {
+ int n = k + j * 6 + i * 36;
+ i_slen2[n] = i|(j<<3)|(k<<6)|(3<<12);
+ }
+ for(i=0;i<4;i++)
+ for(j=0;j<4;j++)
+ for(k=0;k<4;k++)
+ {
+ int n = k + j * 4 + i * 16;
+ i_slen2[n+180] = i|(j<<3)|(k<<6)|(4<<12);
+ }
+ for(i=0;i<4;i++)
+ for(j=0;j<3;j++)
+ {
+ int n = j + i * 3;
+ i_slen2[n+244] = i|(j<<3) | (5<<12);
+ n_slen2[n+500] = i|(j<<3) | (2<<12) | (1<<15);
+ }
+ for(i=0;i<5;i++)
+ for(j=0;j<5;j++)
+ for(k=0;k<4;k++)
+ for(l=0;l<4;l++)
+ {
+ int n = l + k * 4 + j * 16 + i * 80;
+ n_slen2[n] = i|(j<<3)|(k<<6)|(l<<9)|(0<<12);
+ }
+ for(i=0;i<5;i++)
+ for(j=0;j<5;j++)
+ for(k=0;k<4;k++)
+ {
+ int n = k + j * 4 + i * 20;
+ n_slen2[n+400] = i|(j<<3)|(k<<6)|(1<<12);
+ }
+
+#ifdef CALCTABLES
+// Only needed for fixed point.
+ for(int i=-256;i<118+4;i++)
+ gainpow2[i+256] =
+ DOUBLE_TO_REAL_SCALE_LAYER3(POW((clreal)2.0,-0.25 * (clreal) (i+210)),i+256);
+#endif
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/l12tabs.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/l12tabs.h
new file mode 100644
index 00000000..8b49c6e7
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/l12tabs.h
@@ -0,0 +1,1224 @@
+// l12 MPEG decoding tables
+// output of:
+// src/libmpg123/calctables l12
+
+#if defined(RUNTIME_TABLES)
+
+#ifdef REAL_IS_FLOAT
+
+// aligned to 16 bytes for vector instructions, e.g. AltiVec
+
+static ALIGNED(16) real layer12_table[27][64];
+
+#endif
+
+static unsigned char grp_3tab[96];
+
+static unsigned char grp_5tab[384];
+
+static unsigned char grp_9tab[3072];
+
+#else
+
+#ifdef REAL_IS_FLOAT
+
+// aligned to 16 bytes for vector instructions, e.g. AltiVec
+
+static const ALIGNED(16) real layer12_table[27][64] =
+{
+ {
+ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ }
+, {
+ -1.33333333e+00, -1.05826737e+00, -8.39947367e-01, -6.66666667e-01
+ , -5.29133684e-01, -4.19973683e-01, -3.33333333e-01, -2.64566842e-01
+ , -2.09986842e-01, -1.66666667e-01, -1.32283421e-01, -1.04993421e-01
+ , -8.33333333e-02, -6.61417105e-02, -5.24967104e-02, -4.16666667e-02
+ , -3.30708552e-02, -2.62483552e-02, -2.08333333e-02, -1.65354276e-02
+ , -1.31241776e-02, -1.04166667e-02, -8.26771381e-03, -6.56208880e-03
+ , -5.20833333e-03, -4.13385691e-03, -3.28104440e-03, -2.60416667e-03
+ , -2.06692845e-03, -1.64052220e-03, -1.30208333e-03, -1.03346423e-03
+ , -8.20261100e-04, -6.51041667e-04, -5.16732113e-04, -4.10130550e-04
+ , -3.25520833e-04, -2.58366057e-04, -2.05065275e-04, -1.62760417e-04
+ , -1.29183028e-04, -1.02532638e-04, -8.13802083e-05, -6.45915142e-05
+ , -5.12663188e-05, -4.06901042e-05, -3.22957571e-05, -2.56331594e-05
+ , -2.03450521e-05, -1.61478785e-05, -1.28165797e-05, -1.01725260e-05
+ , -8.07393927e-06, -6.40828985e-06, -5.08626302e-06, -4.03696963e-06
+ , -3.20414492e-06, -2.54313151e-06, -2.01848482e-06, -1.60207246e-06
+ , -1.27156576e-06, -1.00924241e-06, -8.01036231e-07, 0.00000000e+00
+ }
+, {
+ 1.33333333e+00, 1.05826737e+00, 8.39947367e-01, 6.66666667e-01
+ , 5.29133684e-01, 4.19973683e-01, 3.33333333e-01, 2.64566842e-01
+ , 2.09986842e-01, 1.66666667e-01, 1.32283421e-01, 1.04993421e-01
+ , 8.33333333e-02, 6.61417105e-02, 5.24967104e-02, 4.16666667e-02
+ , 3.30708552e-02, 2.62483552e-02, 2.08333333e-02, 1.65354276e-02
+ , 1.31241776e-02, 1.04166667e-02, 8.26771381e-03, 6.56208880e-03
+ , 5.20833333e-03, 4.13385691e-03, 3.28104440e-03, 2.60416667e-03
+ , 2.06692845e-03, 1.64052220e-03, 1.30208333e-03, 1.03346423e-03
+ , 8.20261100e-04, 6.51041667e-04, 5.16732113e-04, 4.10130550e-04
+ , 3.25520833e-04, 2.58366057e-04, 2.05065275e-04, 1.62760417e-04
+ , 1.29183028e-04, 1.02532638e-04, 8.13802083e-05, 6.45915142e-05
+ , 5.12663188e-05, 4.06901042e-05, 3.22957571e-05, 2.56331594e-05
+ , 2.03450521e-05, 1.61478785e-05, 1.28165797e-05, 1.01725260e-05
+ , 8.07393927e-06, 6.40828985e-06, 5.08626302e-06, 4.03696963e-06
+ , 3.20414492e-06, 2.54313151e-06, 2.01848482e-06, 1.60207246e-06
+ , 1.27156576e-06, 1.00924241e-06, 8.01036231e-07, 0.00000000e+00
+ }
+, {
+ 5.71428571e-01, 4.53543158e-01, 3.59977443e-01, 2.85714286e-01
+ , 2.26771579e-01, 1.79988721e-01, 1.42857143e-01, 1.13385789e-01
+ , 8.99943607e-02, 7.14285714e-02, 5.66928947e-02, 4.49971804e-02
+ , 3.57142857e-02, 2.83464474e-02, 2.24985902e-02, 1.78571429e-02
+ , 1.41732237e-02, 1.12492951e-02, 8.92857143e-03, 7.08661184e-03
+ , 5.62464754e-03, 4.46428571e-03, 3.54330592e-03, 2.81232377e-03
+ , 2.23214286e-03, 1.77165296e-03, 1.40616189e-03, 1.11607143e-03
+ , 8.85826480e-04, 7.03080943e-04, 5.58035714e-04, 4.42913240e-04
+ , 3.51540472e-04, 2.79017857e-04, 2.21456620e-04, 1.75770236e-04
+ , 1.39508929e-04, 1.10728310e-04, 8.78851179e-05, 6.97544643e-05
+ , 5.53641550e-05, 4.39425589e-05, 3.48772321e-05, 2.76820775e-05
+ , 2.19712795e-05, 1.74386161e-05, 1.38410387e-05, 1.09856397e-05
+ , 8.71930804e-06, 6.92051937e-06, 5.49281987e-06, 4.35965402e-06
+ , 3.46025969e-06, 2.74640993e-06, 2.17982701e-06, 1.73012984e-06
+ , 1.37320497e-06, 1.08991350e-06, 8.65064922e-07, 6.86602483e-07
+ , 5.44956752e-07, 4.32532461e-07, 3.43301242e-07, 0.00000000e+00
+ }
+, {
+ 2.66666667e-01, 2.11653474e-01, 1.67989473e-01, 1.33333333e-01
+ , 1.05826737e-01, 8.39947367e-02, 6.66666667e-02, 5.29133684e-02
+ , 4.19973683e-02, 3.33333333e-02, 2.64566842e-02, 2.09986842e-02
+ , 1.66666667e-02, 1.32283421e-02, 1.04993421e-02, 8.33333333e-03
+ , 6.61417105e-03, 5.24967104e-03, 4.16666667e-03, 3.30708552e-03
+ , 2.62483552e-03, 2.08333333e-03, 1.65354276e-03, 1.31241776e-03
+ , 1.04166667e-03, 8.26771381e-04, 6.56208880e-04, 5.20833333e-04
+ , 4.13385691e-04, 3.28104440e-04, 2.60416667e-04, 2.06692845e-04
+ , 1.64052220e-04, 1.30208333e-04, 1.03346423e-04, 8.20261100e-05
+ , 6.51041667e-05, 5.16732113e-05, 4.10130550e-05, 3.25520833e-05
+ , 2.58366057e-05, 2.05065275e-05, 1.62760417e-05, 1.29183028e-05
+ , 1.02532638e-05, 8.13802083e-06, 6.45915142e-06, 5.12663188e-06
+ , 4.06901042e-06, 3.22957571e-06, 2.56331594e-06, 2.03450521e-06
+ , 1.61478785e-06, 1.28165797e-06, 1.01725260e-06, 8.07393927e-07
+ , 6.40828985e-07, 5.08626302e-07, 4.03696963e-07, 3.20414492e-07
+ , 2.54313151e-07, 2.01848482e-07, 1.60207246e-07, 0.00000000e+00
+ }
+, {
+ 1.29032258e-01, 1.02412971e-01, 8.12852290e-02, 6.45161290e-02
+ , 5.12064855e-02, 4.06426145e-02, 3.22580645e-02, 2.56032428e-02
+ , 2.03213073e-02, 1.61290323e-02, 1.28016214e-02, 1.01606536e-02
+ , 8.06451613e-03, 6.40081069e-03, 5.08032681e-03, 4.03225806e-03
+ , 3.20040535e-03, 2.54016341e-03, 2.01612903e-03, 1.60020267e-03
+ , 1.27008170e-03, 1.00806452e-03, 8.00101337e-04, 6.35040852e-04
+ , 5.04032258e-04, 4.00050668e-04, 3.17520426e-04, 2.52016129e-04
+ , 2.00025334e-04, 1.58760213e-04, 1.26008065e-04, 1.00012667e-04
+ , 7.93801065e-05, 6.30040323e-05, 5.00063335e-05, 3.96900532e-05
+ , 3.15020161e-05, 2.50031668e-05, 1.98450266e-05, 1.57510081e-05
+ , 1.25015834e-05, 9.92251331e-06, 7.87550403e-06, 6.25079169e-06
+ , 4.96125665e-06, 3.93775202e-06, 3.12539585e-06, 2.48062833e-06
+ , 1.96887601e-06, 1.56269792e-06, 1.24031416e-06, 9.84438004e-07
+ , 7.81348962e-07, 6.20157082e-07, 4.92219002e-07, 3.90674481e-07
+ , 3.10078541e-07, 2.46109501e-07, 1.95337240e-07, 1.55039270e-07
+ , 1.23054751e-07, 9.76686202e-08, 7.75196352e-08, 0.00000000e+00
+ }
+, {
+ 6.34920635e-02, 5.03936842e-02, 3.99974936e-02, 3.17460317e-02
+ , 2.51968421e-02, 1.99987468e-02, 1.58730159e-02, 1.25984210e-02
+ , 9.99937341e-03, 7.93650794e-03, 6.29921052e-03, 4.99968671e-03
+ , 3.96825397e-03, 3.14960526e-03, 2.49984335e-03, 1.98412698e-03
+ , 1.57480263e-03, 1.24992168e-03, 9.92063492e-04, 7.87401315e-04
+ , 6.24960838e-04, 4.96031746e-04, 3.93700658e-04, 3.12480419e-04
+ , 2.48015873e-04, 1.96850329e-04, 1.56240210e-04, 1.24007937e-04
+ , 9.84251644e-05, 7.81201048e-05, 6.20039683e-05, 4.92125822e-05
+ , 3.90600524e-05, 3.10019841e-05, 2.46062911e-05, 1.95300262e-05
+ , 1.55009921e-05, 1.23031456e-05, 9.76501310e-06, 7.75049603e-06
+ , 6.15157278e-06, 4.88250655e-06, 3.87524802e-06, 3.07578639e-06
+ , 2.44125327e-06, 1.93762401e-06, 1.53789319e-06, 1.22062664e-06
+ , 9.68812004e-07, 7.68946597e-07, 6.10313319e-07, 4.84406002e-07
+ , 3.84473299e-07, 3.05156659e-07, 2.42203001e-07, 1.92236649e-07
+ , 1.52578330e-07, 1.21101500e-07, 9.61183246e-08, 7.62891648e-08
+ , 6.05507502e-08, 4.80591623e-08, 3.81445824e-08, 0.00000000e+00
+ }
+, {
+ 3.14960630e-02, 2.49984418e-02, 1.98412764e-02, 1.57480315e-02
+ , 1.24992209e-02, 9.92063819e-03, 7.87401575e-03, 6.24961044e-03
+ , 4.96031909e-03, 3.93700787e-03, 3.12480522e-03, 2.48015955e-03
+ , 1.96850394e-03, 1.56240261e-03, 1.24007977e-03, 9.84251969e-04
+ , 7.81201305e-04, 6.20039887e-04, 4.92125984e-04, 3.90600653e-04
+ , 3.10019943e-04, 2.46062992e-04, 1.95300326e-04, 1.55009972e-04
+ , 1.23031496e-04, 9.76501631e-05, 7.75049858e-05, 6.15157480e-05
+ , 4.88250816e-05, 3.87524929e-05, 3.07578740e-05, 2.44125408e-05
+ , 1.93762465e-05, 1.53789370e-05, 1.22062704e-05, 9.68812323e-06
+ , 7.68946850e-06, 6.10313520e-06, 4.84406162e-06, 3.84473425e-06
+ , 3.05156760e-06, 2.42203081e-06, 1.92236713e-06, 1.52578380e-06
+ , 1.21101540e-06, 9.61183563e-07, 7.62891900e-07, 6.05507702e-07
+ , 4.80591781e-07, 3.81445950e-07, 3.02753851e-07, 2.40295891e-07
+ , 1.90722975e-07, 1.51376925e-07, 1.20147945e-07, 9.53614874e-08
+ , 7.56884627e-08, 6.00739727e-08, 4.76807437e-08, 3.78442314e-08
+ , 3.00369863e-08, 2.38403719e-08, 1.89221157e-08, 0.00000000e+00
+ }
+, {
+ 1.56862745e-02, 1.24502043e-02, 9.88173372e-03, 7.84313725e-03
+ , 6.22510216e-03, 4.94086686e-03, 3.92156863e-03, 3.11255108e-03
+ , 2.47043343e-03, 1.96078431e-03, 1.55627554e-03, 1.23521672e-03
+ , 9.80392157e-04, 7.78137771e-04, 6.17608358e-04, 4.90196078e-04
+ , 3.89068885e-04, 3.08804179e-04, 2.45098039e-04, 1.94534443e-04
+ , 1.54402089e-04, 1.22549020e-04, 9.72672213e-05, 7.72010447e-05
+ , 6.12745098e-05, 4.86336107e-05, 3.86005224e-05, 3.06372549e-05
+ , 2.43168053e-05, 1.93002612e-05, 1.53186275e-05, 1.21584027e-05
+ , 9.65013059e-06, 7.65931373e-06, 6.07920133e-06, 4.82506530e-06
+ , 3.82965686e-06, 3.03960067e-06, 2.41253265e-06, 1.91482843e-06
+ , 1.51980033e-06, 1.20626632e-06, 9.57414216e-07, 7.59900167e-07
+ , 6.03133162e-07, 4.78707108e-07, 3.79950083e-07, 3.01566581e-07
+ , 2.39353554e-07, 1.89975042e-07, 1.50783290e-07, 1.19676777e-07
+ , 9.49875208e-08, 7.53916452e-08, 5.98383885e-08, 4.74937604e-08
+ , 3.76958226e-08, 2.99191942e-08, 2.37468802e-08, 1.88479113e-08
+ , 1.49595971e-08, 1.18734401e-08, 9.42395565e-09, 0.00000000e+00
+ }
+, {
+ 7.82778865e-03, 6.21291997e-03, 4.93119785e-03, 3.91389432e-03
+ , 3.10645998e-03, 2.46559892e-03, 1.95694716e-03, 1.55322999e-03
+ , 1.23279946e-03, 9.78473581e-04, 7.76614996e-04, 6.16399731e-04
+ , 4.89236791e-04, 3.88307498e-04, 3.08199865e-04, 2.44618395e-04
+ , 1.94153749e-04, 1.54099933e-04, 1.22309198e-04, 9.70768745e-05
+ , 7.70499664e-05, 6.11545988e-05, 4.85384373e-05, 3.85249832e-05
+ , 3.05772994e-05, 2.42692186e-05, 1.92624916e-05, 1.52886497e-05
+ , 1.21346093e-05, 9.63124579e-06, 7.64432485e-06, 6.06730466e-06
+ , 4.81562290e-06, 3.82216243e-06, 3.03365233e-06, 2.40781145e-06
+ , 1.91108121e-06, 1.51682616e-06, 1.20390572e-06, 9.55540607e-07
+ , 7.58413082e-07, 6.01952862e-07, 4.77770303e-07, 3.79206541e-07
+ , 3.00976431e-07, 2.38885152e-07, 1.89603271e-07, 1.50488216e-07
+ , 1.19442576e-07, 9.48016353e-08, 7.52441078e-08, 5.97212879e-08
+ , 4.74008176e-08, 3.76220539e-08, 2.98606440e-08, 2.37004088e-08
+ , 1.88110269e-08, 1.49303220e-08, 1.18502044e-08, 9.40551347e-09
+ , 7.46516099e-09, 5.92510220e-09, 4.70275674e-09, 0.00000000e+00
+ }
+, {
+ 3.91006843e-03, 3.10342337e-03, 2.46318876e-03, 1.95503421e-03
+ , 1.55171168e-03, 1.23159438e-03, 9.77517107e-04, 7.75855842e-04
+ , 6.15797190e-04, 4.88758553e-04, 3.87927921e-04, 3.07898595e-04
+ , 2.44379277e-04, 1.93963960e-04, 1.53949297e-04, 1.22189638e-04
+ , 9.69819802e-05, 7.69746487e-05, 6.10948192e-05, 4.84909901e-05
+ , 3.84873243e-05, 3.05474096e-05, 2.42454951e-05, 1.92436622e-05
+ , 1.52737048e-05, 1.21227475e-05, 9.62183109e-06, 7.63685239e-06
+ , 6.06137376e-06, 4.81091554e-06, 3.81842620e-06, 3.03068688e-06
+ , 2.40545777e-06, 1.90921310e-06, 1.51534344e-06, 1.20272889e-06
+ , 9.54606549e-07, 7.57671720e-07, 6.01364443e-07, 4.77303275e-07
+ , 3.78835860e-07, 3.00682221e-07, 2.38651637e-07, 1.89417930e-07
+ , 1.50341111e-07, 1.19325819e-07, 9.47089650e-08, 7.51705554e-08
+ , 5.96629093e-08, 4.73544825e-08, 3.75852777e-08, 2.98314547e-08
+ , 2.36772413e-08, 1.87926388e-08, 1.49157273e-08, 1.18386206e-08
+ , 9.39631942e-09, 7.45786367e-09, 5.91931032e-09, 4.69815971e-09
+ , 3.72893183e-09, 2.95965516e-09, 2.34907986e-09, 0.00000000e+00
+ }
+, {
+ 1.95407914e-03, 1.55095364e-03, 1.23099272e-03, 9.77039570e-04
+ , 7.75476821e-04, 6.15496360e-04, 4.88519785e-04, 3.87738410e-04
+ , 3.07748180e-04, 2.44259893e-04, 1.93869205e-04, 1.53874090e-04
+ , 1.22129946e-04, 9.69346026e-05, 7.69370451e-05, 6.10649731e-05
+ , 4.84673013e-05, 3.84685225e-05, 3.05324866e-05, 2.42336506e-05
+ , 1.92342613e-05, 1.52662433e-05, 1.21168253e-05, 9.61713063e-06
+ , 7.63312164e-06, 6.05841266e-06, 4.80856532e-06, 3.81656082e-06
+ , 3.02920633e-06, 2.40428266e-06, 1.90828041e-06, 1.51460317e-06
+ , 1.20214133e-06, 9.54140205e-07, 7.57301583e-07, 6.01070665e-07
+ , 4.77070103e-07, 3.78650791e-07, 3.00535332e-07, 2.38535051e-07
+ , 1.89325396e-07, 1.50267666e-07, 1.19267526e-07, 9.46626978e-08
+ , 7.51338331e-08, 5.96337628e-08, 4.73313489e-08, 3.75669165e-08
+ , 2.98168814e-08, 2.36656745e-08, 1.87834583e-08, 1.49084407e-08
+ , 1.18328372e-08, 9.39172913e-09, 7.45422035e-09, 5.91641861e-09
+ , 4.69586457e-09, 3.72711018e-09, 2.95820931e-09, 2.34793228e-09
+ , 1.86355509e-09, 1.47910465e-09, 1.17396614e-09, 0.00000000e+00
+ }
+, {
+ 9.76800977e-04, 7.75287449e-04, 6.15346056e-04, 4.88400488e-04
+ , 3.87643725e-04, 3.07673028e-04, 2.44200244e-04, 1.93821862e-04
+ , 1.53836514e-04, 1.22100122e-04, 9.69109311e-05, 7.69182570e-05
+ , 6.10500611e-05, 4.84554656e-05, 3.84591285e-05, 3.05250305e-05
+ , 2.42277328e-05, 1.92295643e-05, 1.52625153e-05, 1.21138664e-05
+ , 9.61478213e-06, 7.63125763e-06, 6.05693320e-06, 4.80739106e-06
+ , 3.81562882e-06, 3.02846660e-06, 2.40369553e-06, 1.90781441e-06
+ , 1.51423330e-06, 1.20184777e-06, 9.53907204e-07, 7.57116649e-07
+ , 6.00923883e-07, 4.76953602e-07, 3.78558325e-07, 3.00461941e-07
+ , 2.38476801e-07, 1.89279162e-07, 1.50230971e-07, 1.19238400e-07
+ , 9.46395812e-08, 7.51154854e-08, 5.96192002e-08, 4.73197906e-08
+ , 3.75577427e-08, 2.98096001e-08, 2.36598953e-08, 1.87788713e-08
+ , 1.49048001e-08, 1.18299476e-08, 9.38943567e-09, 7.45240003e-09
+ , 5.91497382e-09, 4.69471784e-09, 3.72620002e-09, 2.95748691e-09
+ , 2.34735892e-09, 1.86310001e-09, 1.47874346e-09, 1.17367946e-09
+ , 9.31550004e-10, 7.39371728e-10, 5.86839729e-10, 0.00000000e+00
+ }
+, {
+ 4.88340862e-04, 3.87596399e-04, 3.07635466e-04, 2.44170431e-04
+ , 1.93798199e-04, 1.53817733e-04, 1.22085215e-04, 9.68990997e-05
+ , 7.69088664e-05, 6.10426077e-05, 4.84495499e-05, 3.84544332e-05
+ , 3.05213039e-05, 2.42247749e-05, 1.92272166e-05, 1.52606519e-05
+ , 1.21123875e-05, 9.61360830e-06, 7.63032597e-06, 6.05619373e-06
+ , 4.80680415e-06, 3.81516298e-06, 3.02809687e-06, 2.40340208e-06
+ , 1.90758149e-06, 1.51404843e-06, 1.20170104e-06, 9.53790746e-07
+ , 7.57024217e-07, 6.00850519e-07, 4.76895373e-07, 3.78512108e-07
+ , 3.00425260e-07, 2.38447686e-07, 1.89256054e-07, 1.50212630e-07
+ , 1.19223843e-07, 9.46280271e-08, 7.51063149e-08, 5.96119216e-08
+ , 4.73140135e-08, 3.75531574e-08, 2.98059608e-08, 2.36570068e-08
+ , 1.87765787e-08, 1.49029804e-08, 1.18285034e-08, 9.38828936e-09
+ , 7.45149020e-09, 5.91425169e-09, 4.69414468e-09, 3.72574510e-09
+ , 2.95712585e-09, 2.34707234e-09, 1.86287255e-09, 1.47856292e-09
+ , 1.17353617e-09, 9.31436275e-10, 7.39281462e-10, 5.86768085e-10
+ , 4.65718138e-10, 3.69640731e-10, 2.93384042e-10, 0.00000000e+00
+ }
+, {
+ 2.44155527e-04, 1.93786370e-04, 1.53808344e-04, 1.22077764e-04
+ , 9.68931851e-05, 7.69041720e-05, 6.10388818e-05, 4.84465926e-05
+ , 3.84520860e-05, 3.05194409e-05, 2.42232963e-05, 1.92260430e-05
+ , 1.52597204e-05, 1.21116481e-05, 9.61302150e-06, 7.62986022e-06
+ , 6.05582407e-06, 4.80651075e-06, 3.81493011e-06, 3.02791204e-06
+ , 2.40325538e-06, 1.90746506e-06, 1.51395602e-06, 1.20162769e-06
+ , 9.53732528e-07, 7.56978009e-07, 6.00813844e-07, 4.76866264e-07
+ , 3.78489004e-07, 3.00406922e-07, 2.38433132e-07, 1.89244502e-07
+ , 1.50203461e-07, 1.19216566e-07, 9.46222511e-08, 7.51017305e-08
+ , 5.96082830e-08, 4.73111256e-08, 3.75508652e-08, 2.98041415e-08
+ , 2.36555628e-08, 1.87754326e-08, 1.49020707e-08, 1.18277814e-08
+ , 9.38771631e-09, 7.45103537e-09, 5.91389069e-09, 4.69385815e-09
+ , 3.72551769e-09, 2.95694535e-09, 2.34692908e-09, 1.86275884e-09
+ , 1.47847267e-09, 1.17346454e-09, 9.31379422e-10, 7.39236337e-10
+ , 5.86732269e-10, 4.65689711e-10, 3.69618168e-10, 2.93366135e-10
+ , 2.32844855e-10, 1.84809084e-10, 1.46683067e-10, 0.00000000e+00
+ }
+, {
+ 1.22074038e-04, 9.68902281e-05, 7.69018250e-05, 6.10370190e-05
+ , 4.84451140e-05, 3.84509125e-05, 3.05185095e-05, 2.42225570e-05
+ , 1.92254563e-05, 1.52592547e-05, 1.21112785e-05, 9.61272813e-06
+ , 7.62962737e-06, 6.05563926e-06, 4.80636406e-06, 3.81481368e-06
+ , 3.02781963e-06, 2.40318203e-06, 1.90740684e-06, 1.51390981e-06
+ , 1.20159102e-06, 9.53703421e-07, 7.56954907e-07, 6.00795508e-07
+ , 4.76851711e-07, 3.78477453e-07, 3.00397754e-07, 2.38425855e-07
+ , 1.89238727e-07, 1.50198877e-07, 1.19212928e-07, 9.46193634e-08
+ , 7.50994385e-08, 5.96064638e-08, 4.73096817e-08, 3.75497192e-08
+ , 2.98032319e-08, 2.36548408e-08, 1.87748596e-08, 1.49016160e-08
+ , 1.18274204e-08, 9.38742981e-09, 7.45080798e-09, 5.91371021e-09
+ , 4.69371490e-09, 3.72540399e-09, 2.95685511e-09, 2.34685745e-09
+ , 1.86270199e-09, 1.47842755e-09, 1.17342873e-09, 9.31350997e-10
+ , 7.39213776e-10, 5.86714363e-10, 4.65675499e-10, 3.69606888e-10
+ , 2.93357182e-10, 2.32837749e-10, 1.84803444e-10, 1.46678591e-10
+ , 1.16418875e-10, 9.24017220e-11, 7.33392954e-11, 0.00000000e+00
+ }
+, {
+ 6.10360876e-05, 4.84443748e-05, 3.84503258e-05, 3.05180438e-05
+ , 2.42221874e-05, 1.92251629e-05, 1.52590219e-05, 1.21110937e-05
+ , 9.61258144e-06, 7.62951095e-06, 6.05554685e-06, 4.80629072e-06
+ , 3.81475547e-06, 3.02777343e-06, 2.40314536e-06, 1.90737774e-06
+ , 1.51388671e-06, 1.20157268e-06, 9.53688869e-07, 7.56943357e-07
+ , 6.00786340e-07, 4.76844434e-07, 3.78471678e-07, 3.00393170e-07
+ , 2.38422217e-07, 1.89235839e-07, 1.50196585e-07, 1.19211109e-07
+ , 9.46179196e-08, 7.50982925e-08, 5.96055543e-08, 4.73089598e-08
+ , 3.75491463e-08, 2.98027771e-08, 2.36544799e-08, 1.87745731e-08
+ , 1.49013886e-08, 1.18272399e-08, 9.38728657e-09, 7.45069429e-09
+ , 5.91361997e-09, 4.69364328e-09, 3.72534714e-09, 2.95680999e-09
+ , 2.34682164e-09, 1.86267357e-09, 1.47840499e-09, 1.17341082e-09
+ , 9.31336786e-10, 7.39202497e-10, 5.86705410e-10, 4.65668393e-10
+ , 3.69601248e-10, 2.93352705e-10, 2.32834196e-10, 1.84800624e-10
+ , 1.46676353e-10, 1.16417098e-10, 9.24003121e-11, 7.33381763e-11
+ , 5.82085491e-11, 4.62001560e-11, 3.66690882e-11, 0.00000000e+00
+ }
+, {
+ -1.60000000e+00, -1.26992084e+00, -1.00793684e+00, -8.00000000e-01
+ , -6.34960421e-01, -5.03968420e-01, -4.00000000e-01, -3.17480210e-01
+ , -2.51984210e-01, -2.00000000e-01, -1.58740105e-01, -1.25992105e-01
+ , -1.00000000e-01, -7.93700526e-02, -6.29960525e-02, -5.00000000e-02
+ , -3.96850263e-02, -3.14980262e-02, -2.50000000e-02, -1.98425131e-02
+ , -1.57490131e-02, -1.25000000e-02, -9.92125657e-03, -7.87450656e-03
+ , -6.25000000e-03, -4.96062829e-03, -3.93725328e-03, -3.12500000e-03
+ , -2.48031414e-03, -1.96862664e-03, -1.56250000e-03, -1.24015707e-03
+ , -9.84313320e-04, -7.81250000e-04, -6.20078536e-04, -4.92156660e-04
+ , -3.90625000e-04, -3.10039268e-04, -2.46078330e-04, -1.95312500e-04
+ , -1.55019634e-04, -1.23039165e-04, -9.76562500e-05, -7.75098170e-05
+ , -6.15195825e-05, -4.88281250e-05, -3.87549085e-05, -3.07597913e-05
+ , -2.44140625e-05, -1.93774542e-05, -1.53798956e-05, -1.22070313e-05
+ , -9.68872712e-06, -7.68994781e-06, -6.10351563e-06, -4.84436356e-06
+ , -3.84497391e-06, -3.05175781e-06, -2.42218178e-06, -1.92248695e-06
+ , -1.52587891e-06, -1.21109089e-06, -9.61243477e-07, 0.00000000e+00
+ }
+, {
+ -8.00000000e-01, -6.34960421e-01, -5.03968420e-01, -4.00000000e-01
+ , -3.17480210e-01, -2.51984210e-01, -2.00000000e-01, -1.58740105e-01
+ , -1.25992105e-01, -1.00000000e-01, -7.93700526e-02, -6.29960525e-02
+ , -5.00000000e-02, -3.96850263e-02, -3.14980262e-02, -2.50000000e-02
+ , -1.98425131e-02, -1.57490131e-02, -1.25000000e-02, -9.92125657e-03
+ , -7.87450656e-03, -6.25000000e-03, -4.96062829e-03, -3.93725328e-03
+ , -3.12500000e-03, -2.48031414e-03, -1.96862664e-03, -1.56250000e-03
+ , -1.24015707e-03, -9.84313320e-04, -7.81250000e-04, -6.20078536e-04
+ , -4.92156660e-04, -3.90625000e-04, -3.10039268e-04, -2.46078330e-04
+ , -1.95312500e-04, -1.55019634e-04, -1.23039165e-04, -9.76562500e-05
+ , -7.75098170e-05, -6.15195825e-05, -4.88281250e-05, -3.87549085e-05
+ , -3.07597913e-05, -2.44140625e-05, -1.93774542e-05, -1.53798956e-05
+ , -1.22070313e-05, -9.68872712e-06, -7.68994781e-06, -6.10351563e-06
+ , -4.84436356e-06, -3.84497391e-06, -3.05175781e-06, -2.42218178e-06
+ , -1.92248695e-06, -1.52587891e-06, -1.21109089e-06, -9.61243477e-07
+ , -7.62939453e-07, -6.05545445e-07, -4.80621738e-07, 0.00000000e+00
+ }
+, {
+ 8.00000000e-01, 6.34960421e-01, 5.03968420e-01, 4.00000000e-01
+ , 3.17480210e-01, 2.51984210e-01, 2.00000000e-01, 1.58740105e-01
+ , 1.25992105e-01, 1.00000000e-01, 7.93700526e-02, 6.29960525e-02
+ , 5.00000000e-02, 3.96850263e-02, 3.14980262e-02, 2.50000000e-02
+ , 1.98425131e-02, 1.57490131e-02, 1.25000000e-02, 9.92125657e-03
+ , 7.87450656e-03, 6.25000000e-03, 4.96062829e-03, 3.93725328e-03
+ , 3.12500000e-03, 2.48031414e-03, 1.96862664e-03, 1.56250000e-03
+ , 1.24015707e-03, 9.84313320e-04, 7.81250000e-04, 6.20078536e-04
+ , 4.92156660e-04, 3.90625000e-04, 3.10039268e-04, 2.46078330e-04
+ , 1.95312500e-04, 1.55019634e-04, 1.23039165e-04, 9.76562500e-05
+ , 7.75098170e-05, 6.15195825e-05, 4.88281250e-05, 3.87549085e-05
+ , 3.07597913e-05, 2.44140625e-05, 1.93774542e-05, 1.53798956e-05
+ , 1.22070313e-05, 9.68872712e-06, 7.68994781e-06, 6.10351563e-06
+ , 4.84436356e-06, 3.84497391e-06, 3.05175781e-06, 2.42218178e-06
+ , 1.92248695e-06, 1.52587891e-06, 1.21109089e-06, 9.61243477e-07
+ , 7.62939453e-07, 6.05545445e-07, 4.80621738e-07, 0.00000000e+00
+ }
+, {
+ 1.60000000e+00, 1.26992084e+00, 1.00793684e+00, 8.00000000e-01
+ , 6.34960421e-01, 5.03968420e-01, 4.00000000e-01, 3.17480210e-01
+ , 2.51984210e-01, 2.00000000e-01, 1.58740105e-01, 1.25992105e-01
+ , 1.00000000e-01, 7.93700526e-02, 6.29960525e-02, 5.00000000e-02
+ , 3.96850263e-02, 3.14980262e-02, 2.50000000e-02, 1.98425131e-02
+ , 1.57490131e-02, 1.25000000e-02, 9.92125657e-03, 7.87450656e-03
+ , 6.25000000e-03, 4.96062829e-03, 3.93725328e-03, 3.12500000e-03
+ , 2.48031414e-03, 1.96862664e-03, 1.56250000e-03, 1.24015707e-03
+ , 9.84313320e-04, 7.81250000e-04, 6.20078536e-04, 4.92156660e-04
+ , 3.90625000e-04, 3.10039268e-04, 2.46078330e-04, 1.95312500e-04
+ , 1.55019634e-04, 1.23039165e-04, 9.76562500e-05, 7.75098170e-05
+ , 6.15195825e-05, 4.88281250e-05, 3.87549085e-05, 3.07597913e-05
+ , 2.44140625e-05, 1.93774542e-05, 1.53798956e-05, 1.22070313e-05
+ , 9.68872712e-06, 7.68994781e-06, 6.10351563e-06, 4.84436356e-06
+ , 3.84497391e-06, 3.05175781e-06, 2.42218178e-06, 1.92248695e-06
+ , 1.52587891e-06, 1.21109089e-06, 9.61243477e-07, 0.00000000e+00
+ }
+, {
+ -1.77777778e+00, -1.41102316e+00, -1.11992982e+00, -8.88888889e-01
+ , -7.05511579e-01, -5.59964911e-01, -4.44444444e-01, -3.52755789e-01
+ , -2.79982456e-01, -2.22222222e-01, -1.76377895e-01, -1.39991228e-01
+ , -1.11111111e-01, -8.81889473e-02, -6.99956139e-02, -5.55555556e-02
+ , -4.40944737e-02, -3.49978069e-02, -2.77777778e-02, -2.20472368e-02
+ , -1.74989035e-02, -1.38888889e-02, -1.10236184e-02, -8.74945174e-03
+ , -6.94444444e-03, -5.51180921e-03, -4.37472587e-03, -3.47222222e-03
+ , -2.75590460e-03, -2.18736293e-03, -1.73611111e-03, -1.37795230e-03
+ , -1.09368147e-03, -8.68055556e-04, -6.88976151e-04, -5.46840733e-04
+ , -4.34027778e-04, -3.44488076e-04, -2.73420367e-04, -2.17013889e-04
+ , -1.72244038e-04, -1.36710183e-04, -1.08506944e-04, -8.61220189e-05
+ , -6.83550917e-05, -5.42534722e-05, -4.30610094e-05, -3.41775458e-05
+ , -2.71267361e-05, -2.15305047e-05, -1.70887729e-05, -1.35633681e-05
+ , -1.07652524e-05, -8.54438646e-06, -6.78168403e-06, -5.38262618e-06
+ , -4.27219323e-06, -3.39084201e-06, -2.69131309e-06, -2.13609662e-06
+ , -1.69542101e-06, -1.34565654e-06, -1.06804831e-06, 0.00000000e+00
+ }
+, {
+ -8.88888889e-01, -7.05511579e-01, -5.59964911e-01, -4.44444444e-01
+ , -3.52755789e-01, -2.79982456e-01, -2.22222222e-01, -1.76377895e-01
+ , -1.39991228e-01, -1.11111111e-01, -8.81889473e-02, -6.99956139e-02
+ , -5.55555556e-02, -4.40944737e-02, -3.49978069e-02, -2.77777778e-02
+ , -2.20472368e-02, -1.74989035e-02, -1.38888889e-02, -1.10236184e-02
+ , -8.74945174e-03, -6.94444444e-03, -5.51180921e-03, -4.37472587e-03
+ , -3.47222222e-03, -2.75590460e-03, -2.18736293e-03, -1.73611111e-03
+ , -1.37795230e-03, -1.09368147e-03, -8.68055556e-04, -6.88976151e-04
+ , -5.46840733e-04, -4.34027778e-04, -3.44488076e-04, -2.73420367e-04
+ , -2.17013889e-04, -1.72244038e-04, -1.36710183e-04, -1.08506944e-04
+ , -8.61220189e-05, -6.83550917e-05, -5.42534722e-05, -4.30610094e-05
+ , -3.41775458e-05, -2.71267361e-05, -2.15305047e-05, -1.70887729e-05
+ , -1.35633681e-05, -1.07652524e-05, -8.54438646e-06, -6.78168403e-06
+ , -5.38262618e-06, -4.27219323e-06, -3.39084201e-06, -2.69131309e-06
+ , -2.13609662e-06, -1.69542101e-06, -1.34565654e-06, -1.06804831e-06
+ , -8.47710503e-07, -6.72828272e-07, -5.34024154e-07, 0.00000000e+00
+ }
+, {
+ -4.44444444e-01, -3.52755789e-01, -2.79982456e-01, -2.22222222e-01
+ , -1.76377895e-01, -1.39991228e-01, -1.11111111e-01, -8.81889473e-02
+ , -6.99956139e-02, -5.55555556e-02, -4.40944737e-02, -3.49978069e-02
+ , -2.77777778e-02, -2.20472368e-02, -1.74989035e-02, -1.38888889e-02
+ , -1.10236184e-02, -8.74945174e-03, -6.94444444e-03, -5.51180921e-03
+ , -4.37472587e-03, -3.47222222e-03, -2.75590460e-03, -2.18736293e-03
+ , -1.73611111e-03, -1.37795230e-03, -1.09368147e-03, -8.68055556e-04
+ , -6.88976151e-04, -5.46840733e-04, -4.34027778e-04, -3.44488076e-04
+ , -2.73420367e-04, -2.17013889e-04, -1.72244038e-04, -1.36710183e-04
+ , -1.08506944e-04, -8.61220189e-05, -6.83550917e-05, -5.42534722e-05
+ , -4.30610094e-05, -3.41775458e-05, -2.71267361e-05, -2.15305047e-05
+ , -1.70887729e-05, -1.35633681e-05, -1.07652524e-05, -8.54438646e-06
+ , -6.78168403e-06, -5.38262618e-06, -4.27219323e-06, -3.39084201e-06
+ , -2.69131309e-06, -2.13609662e-06, -1.69542101e-06, -1.34565654e-06
+ , -1.06804831e-06, -8.47710503e-07, -6.72828272e-07, -5.34024154e-07
+ , -4.23855252e-07, -3.36414136e-07, -2.67012077e-07, 0.00000000e+00
+ }
+, {
+ 4.44444444e-01, 3.52755789e-01, 2.79982456e-01, 2.22222222e-01
+ , 1.76377895e-01, 1.39991228e-01, 1.11111111e-01, 8.81889473e-02
+ , 6.99956139e-02, 5.55555556e-02, 4.40944737e-02, 3.49978069e-02
+ , 2.77777778e-02, 2.20472368e-02, 1.74989035e-02, 1.38888889e-02
+ , 1.10236184e-02, 8.74945174e-03, 6.94444444e-03, 5.51180921e-03
+ , 4.37472587e-03, 3.47222222e-03, 2.75590460e-03, 2.18736293e-03
+ , 1.73611111e-03, 1.37795230e-03, 1.09368147e-03, 8.68055556e-04
+ , 6.88976151e-04, 5.46840733e-04, 4.34027778e-04, 3.44488076e-04
+ , 2.73420367e-04, 2.17013889e-04, 1.72244038e-04, 1.36710183e-04
+ , 1.08506944e-04, 8.61220189e-05, 6.83550917e-05, 5.42534722e-05
+ , 4.30610094e-05, 3.41775458e-05, 2.71267361e-05, 2.15305047e-05
+ , 1.70887729e-05, 1.35633681e-05, 1.07652524e-05, 8.54438646e-06
+ , 6.78168403e-06, 5.38262618e-06, 4.27219323e-06, 3.39084201e-06
+ , 2.69131309e-06, 2.13609662e-06, 1.69542101e-06, 1.34565654e-06
+ , 1.06804831e-06, 8.47710503e-07, 6.72828272e-07, 5.34024154e-07
+ , 4.23855252e-07, 3.36414136e-07, 2.67012077e-07, 0.00000000e+00
+ }
+, {
+ 8.88888889e-01, 7.05511579e-01, 5.59964911e-01, 4.44444444e-01
+ , 3.52755789e-01, 2.79982456e-01, 2.22222222e-01, 1.76377895e-01
+ , 1.39991228e-01, 1.11111111e-01, 8.81889473e-02, 6.99956139e-02
+ , 5.55555556e-02, 4.40944737e-02, 3.49978069e-02, 2.77777778e-02
+ , 2.20472368e-02, 1.74989035e-02, 1.38888889e-02, 1.10236184e-02
+ , 8.74945174e-03, 6.94444444e-03, 5.51180921e-03, 4.37472587e-03
+ , 3.47222222e-03, 2.75590460e-03, 2.18736293e-03, 1.73611111e-03
+ , 1.37795230e-03, 1.09368147e-03, 8.68055556e-04, 6.88976151e-04
+ , 5.46840733e-04, 4.34027778e-04, 3.44488076e-04, 2.73420367e-04
+ , 2.17013889e-04, 1.72244038e-04, 1.36710183e-04, 1.08506944e-04
+ , 8.61220189e-05, 6.83550917e-05, 5.42534722e-05, 4.30610094e-05
+ , 3.41775458e-05, 2.71267361e-05, 2.15305047e-05, 1.70887729e-05
+ , 1.35633681e-05, 1.07652524e-05, 8.54438646e-06, 6.78168403e-06
+ , 5.38262618e-06, 4.27219323e-06, 3.39084201e-06, 2.69131309e-06
+ , 2.13609662e-06, 1.69542101e-06, 1.34565654e-06, 1.06804831e-06
+ , 8.47710503e-07, 6.72828272e-07, 5.34024154e-07, 0.00000000e+00
+ }
+, {
+ 1.77777778e+00, 1.41102316e+00, 1.11992982e+00, 8.88888889e-01
+ , 7.05511579e-01, 5.59964911e-01, 4.44444444e-01, 3.52755789e-01
+ , 2.79982456e-01, 2.22222222e-01, 1.76377895e-01, 1.39991228e-01
+ , 1.11111111e-01, 8.81889473e-02, 6.99956139e-02, 5.55555556e-02
+ , 4.40944737e-02, 3.49978069e-02, 2.77777778e-02, 2.20472368e-02
+ , 1.74989035e-02, 1.38888889e-02, 1.10236184e-02, 8.74945174e-03
+ , 6.94444444e-03, 5.51180921e-03, 4.37472587e-03, 3.47222222e-03
+ , 2.75590460e-03, 2.18736293e-03, 1.73611111e-03, 1.37795230e-03
+ , 1.09368147e-03, 8.68055556e-04, 6.88976151e-04, 5.46840733e-04
+ , 4.34027778e-04, 3.44488076e-04, 2.73420367e-04, 2.17013889e-04
+ , 1.72244038e-04, 1.36710183e-04, 1.08506944e-04, 8.61220189e-05
+ , 6.83550917e-05, 5.42534722e-05, 4.30610094e-05, 3.41775458e-05
+ , 2.71267361e-05, 2.15305047e-05, 1.70887729e-05, 1.35633681e-05
+ , 1.07652524e-05, 8.54438646e-06, 6.78168403e-06, 5.38262618e-06
+ , 4.27219323e-06, 3.39084201e-06, 2.69131309e-06, 2.13609662e-06
+ , 1.69542101e-06, 1.34565654e-06, 1.06804831e-06, 0.00000000e+00
+ }
+};
+
+#endif
+
+#ifdef REAL_IS_FIXED
+
+static const real layer12_table[27][64] =
+{
+ {
+ 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ }
+, {
+ -1431655765, -1136305934, -901886617, -715827883
+ , -568152967, -450943309, -357913941, -284076483
+ , -225471654, -178956971, -142038242, -112735827
+ , -89478485, -71019121, -56367914, -44739243
+ , -35509560, -28183957, -22369621, -17754780
+ , -14091978, -11184811, -8877390, -7045989
+ , -5592405, -4438695, -3522995, -2796203
+ , -2219348, -1761497, -1398101, -1109674
+ , -880749, -699051, -554837, -440374
+ , -349525, -277418, -220187, -174763
+ , -138709, -110094, -87381, -69355
+ , -55047, -43691, -34677, -27523
+ , -21845, -17339, -13762, -10923
+ , -8669, -6881, -5461, -4335
+ , -3440, -2731, -2167, -1720
+ , -1365, -1084, -860, 0
+ }
+, {
+ 1431655765, 1136305934, 901886617, 715827883
+ , 568152967, 450943309, 357913941, 284076483
+ , 225471654, 178956971, 142038242, 112735827
+ , 89478485, 71019121, 56367914, 44739243
+ , 35509560, 28183957, 22369621, 17754780
+ , 14091978, 11184811, 8877390, 7045989
+ , 5592405, 4438695, 3522995, 2796203
+ , 2219348, 1761497, 1398101, 1109674
+ , 880749, 699051, 554837, 440374
+ , 349525, 277418, 220187, 174763
+ , 138709, 110094, 87381, 69355
+ , 55047, 43691, 34677, 27523
+ , 21845, 17339, 13762, 10923
+ , 8669, 6881, 5461, 4335
+ , 3440, 2731, 2167, 1720
+ , 1365, 1084, 860, 0
+ }
+, {
+ 613566757, 486988257, 386522836, 306783378
+ , 243494129, 193261418, 153391689, 121747064
+ , 96630709, 76695845, 60873532, 48315355
+ , 38347922, 30436766, 24157677, 19173961
+ , 15218383, 12078839, 9586981, 7609192
+ , 6039419, 4793490, 3804596, 3019710
+ , 2396745, 1902298, 1509855, 1198373
+ , 951149, 754927, 599186, 475574
+ , 377464, 299593, 237787, 188732
+ , 149797, 118894, 94366, 74898
+ , 59447, 47183, 37449, 29723
+ , 23591, 18725, 14862, 11796
+ , 9362, 7431, 5898, 4681
+ , 3715, 2949, 2341, 1858
+ , 1474, 1170, 929, 737
+ , 585, 464, 369, 0
+ }
+, {
+ 286331153, 227261187, 180377323, 143165577
+ , 113630593, 90188662, 71582788, 56815297
+ , 45094331, 35791394, 28407648, 22547165
+ , 17895697, 14203824, 11273583, 8947849
+ , 7101912, 5636791, 4473924, 3550956
+ , 2818396, 2236962, 1775478, 1409198
+ , 1118481, 887739, 704599, 559241
+ , 443870, 352299, 279620, 221935
+ , 176150, 139810, 110967, 88075
+ , 69905, 55484, 44037, 34953
+ , 27742, 22019, 17476, 13871
+ , 11009, 8738, 6935, 5505
+ , 4369, 3468, 2752, 2185
+ , 1734, 1376, 1092, 867
+ , 688, 546, 433, 344
+ , 273, 217, 172, 0
+ }
+, {
+ 138547332, 109965090, 87279350, 69273666
+ , 54982545, 43639675, 34636833, 27491273
+ , 21819838, 17318417, 13745636, 10909919
+ , 8659208, 6872818, 5454959, 4329604
+ , 3436409, 2727480, 2164802, 1718205
+ , 1363740, 1082401, 859102, 681870
+ , 541201, 429551, 340935, 270600
+ , 214776, 170467, 135300, 107388
+ , 85234, 67650, 53694, 42617
+ , 33825, 26847, 21308, 16913
+ , 13423, 10654, 8456, 6712
+ , 5327, 4228, 3356, 2664
+ , 2114, 1678, 1332, 1057
+ , 839, 666, 529, 419
+ , 333, 264, 210, 166
+ , 132, 105, 83, 0
+ }
+, {
+ 68174084, 54109806, 42946982, 34087042
+ , 27054903, 21473491, 17043521, 13527452
+ , 10736745, 8521761, 6763726, 5368373
+ , 4260880, 3381863, 2684186, 2130440
+ , 1690931, 1342093, 1065220, 845466
+ , 671047, 532610, 422733, 335523
+ , 266305, 211366, 167762, 133153
+ , 105683, 83881, 66576, 52842
+ , 41940, 33288, 26421, 20970
+ , 16644, 13210, 10485, 8322
+ , 6605, 5243, 4161, 3303
+ , 2621, 2081, 1651, 1311
+ , 1040, 826, 655, 520
+ , 413, 328, 260, 206
+ , 164, 130, 103, 82
+ , 65, 52, 41, 0
+ }
+, {
+ 33818640, 26841872, 21304408, 16909320
+ , 13420936, 10652204, 8454660, 6710468
+ , 5326102, 4227330, 3355234, 2663051
+ , 2113665, 1677617, 1331526, 1056833
+ , 838809, 665763, 528416, 419404
+ , 332881, 264208, 209702, 166441
+ , 132104, 104851, 83220, 66052
+ , 52426, 41610, 33026, 26213
+ , 20805, 16513, 13106, 10403
+ , 8257, 6553, 5201, 4128
+ , 3277, 2601, 2064, 1638
+ , 1300, 1032, 819, 650
+ , 516, 410, 325, 258
+ , 205, 163, 129, 102
+ , 81, 65, 51, 41
+ , 32, 26, 20, 0
+ }
+, {
+ 16843009, 13368305, 10610431, 8421505
+ , 6684153, 5305215, 4210752, 3342076
+ , 2652608, 2105376, 1671038, 1326304
+ , 1052688, 835519, 663152, 526344
+ , 417760, 331576, 263172, 208880
+ , 165788, 131586, 104440, 82894
+ , 65793, 52220, 41447, 32897
+ , 26110, 20723, 16448, 13055
+ , 10362, 8224, 6527, 5181
+ , 4112, 3264, 2590, 2056
+ , 1632, 1295, 1028, 816
+ , 648, 514, 408, 324
+ , 257, 204, 162, 129
+ , 102, 81, 64, 51
+ , 40, 32, 25, 20
+ , 16, 13, 10, 0
+ }
+, {
+ 8405024, 6671072, 5294833, 4202512
+ , 3335536, 2647417, 2101256, 1667768
+ , 1323708, 1050628, 833884, 661854
+ , 525314, 416942, 330927, 262657
+ , 208471, 165464, 131329, 104236
+ , 82732, 65664, 52118, 41366
+ , 32832, 26059, 20683, 16416
+ , 13029, 10341, 8208, 6515
+ , 5171, 4104, 3257, 2585
+ , 2052, 1629, 1293, 1026
+ , 814, 646, 513, 407
+ , 323, 257, 204, 162
+ , 128, 102, 81, 64
+ , 51, 40, 32, 25
+ , 20, 16, 13, 10
+ , 8, 6, 5, 0
+ }
+, {
+ 4198404, 3332275, 2644829, 2099202
+ , 1666138, 1322414, 1049601, 833069
+ , 661207, 524801, 416534, 330604
+ , 262400, 208267, 165302, 131200
+ , 104134, 82651, 65600, 52067
+ , 41325, 32800, 26033, 20663
+ , 16400, 13017, 10331, 8200
+ , 6508, 5166, 4100, 3254
+ , 2583, 2050, 1627, 1291
+ , 1025, 814, 646, 513
+ , 407, 323, 256, 203
+ , 161, 128, 102, 81
+ , 64, 51, 40, 32
+ , 25, 20, 16, 13
+ , 10, 8, 6, 5
+ , 4, 3, 3, 0
+ }
+, {
+ 2098177, 1665324, 1321768, 1049088
+ , 832662, 660884, 524544, 416331
+ , 330442, 262272, 208165, 165221
+ , 131136, 104083, 82611, 65568
+ , 52041, 41305, 32784, 26021
+ , 20653, 16392, 13010, 10326
+ , 8196, 6505, 5163, 4098
+ , 3253, 2582, 2049, 1626
+ , 1291, 1025, 813, 645
+ , 512, 407, 323, 256
+ , 203, 161, 128, 102
+ , 81, 64, 51, 40
+ , 32, 25, 20, 16
+ , 13, 10, 8, 6
+ , 5, 4, 3, 3
+ , 2, 2, 1, 0
+ }
+, {
+ 1048832, 832459, 660723, 524416
+ , 416229, 330361, 262208, 208115
+ , 165181, 131104, 104057, 82590
+ , 65552, 52029, 41295, 32776
+ , 26014, 20648, 16388, 13007
+ , 10324, 8194, 6504, 5162
+ , 4097, 3252, 2581, 2049
+ , 1626, 1290, 1024, 813
+ , 645, 512, 406, 323
+ , 256, 203, 161, 128
+ , 102, 81, 64, 51
+ , 40, 32, 25, 20
+ , 16, 13, 10, 8
+ , 6, 5, 4, 3
+ , 3, 2, 2, 1
+ , 1, 1, 1, 0
+ }
+, {
+ 524352, 416178, 330321, 262176
+ , 208089, 165161, 131088, 104045
+ , 82580, 65544, 52022, 41290
+ , 32772, 26011, 20645, 16386
+ , 13006, 10323, 8193, 6503
+ , 5161, 4097, 3251, 2581
+ , 2048, 1626, 1290, 1024
+ , 813, 645, 512, 406
+ , 323, 256, 203, 161
+ , 128, 102, 81, 64
+ , 51, 40, 32, 25
+ , 20, 16, 13, 10
+ , 8, 6, 5, 4
+ , 3, 3, 2, 2
+ , 1, 1, 1, 1
+ , 1, 0, 0, 0
+ }
+, {
+ 262160, 208077, 165150, 131080
+ , 104038, 82575, 65540, 52019
+ , 41288, 32770, 26010, 20644
+ , 16385, 13005, 10322, 8193
+ , 6502, 5161, 4096, 3251
+ , 2580, 2048, 1626, 1290
+ , 1024, 813, 645, 512
+ , 406, 323, 256, 203
+ , 161, 128, 102, 81
+ , 64, 51, 40, 32
+ , 25, 20, 16, 13
+ , 10, 8, 6, 5
+ , 4, 3, 3, 2
+ , 2, 1, 1, 1
+ , 1, 1, 0, 0
+ , 0, 0, 0, 0
+ }
+, {
+ 131076, 104035, 82573, 65538
+ , 52018, 41286, 32769, 26009
+ , 20643, 16385, 13004, 10322
+ , 8192, 6502, 5161, 4096
+ , 3251, 2580, 2048, 1626
+ , 1290, 1024, 813, 645
+ , 512, 406, 323, 256
+ , 203, 161, 128, 102
+ , 81, 64, 51, 40
+ , 32, 25, 20, 16
+ , 13, 10, 8, 6
+ , 5, 4, 3, 3
+ , 2, 2, 1, 1
+ , 1, 1, 1, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ }
+, {
+ 65537, 52017, 41286, 32769
+ , 26008, 20643, 16384, 13004
+ , 10321, 8192, 6502, 5161
+ , 4096, 3251, 2580, 2048
+ , 1626, 1290, 1024, 813
+ , 645, 512, 406, 323
+ , 256, 203, 161, 128
+ , 102, 81, 64, 51
+ , 40, 32, 25, 20
+ , 16, 13, 10, 8
+ , 6, 5, 4, 3
+ , 3, 2, 2, 1
+ , 1, 1, 1, 1
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ }
+, {
+ -1717986918, -1363567121, -1082263941, -858993459
+ , -681783560, -541131970, -429496730, -340891780
+ , -270565985, -214748365, -170445890, -135282993
+ , -107374182, -85222945, -67641496, -53687091
+ , -42611473, -33820748, -26843546, -21305736
+ , -16910374, -13421773, -10652868, -8455187
+ , -6710886, -5326434, -4227594, -3355443
+ , -2663217, -2113797, -1677722, -1331609
+ , -1056898, -838861, -665804, -528449
+ , -419430, -332902, -264225, -209715
+ , -166451, -132112, -104858, -83226
+ , -66056, -52429, -41613, -33028
+ , -26214, -20806, -16514, -13107
+ , -10403, -8257, -6554, -5202
+ , -4129, -3277, -2601, -2064
+ , -1638, -1300, -1032, 0
+ }
+, {
+ -858993459, -681783560, -541131970, -429496730
+ , -340891780, -270565985, -214748365, -170445890
+ , -135282993, -107374182, -85222945, -67641496
+ , -53687091, -42611473, -33820748, -26843546
+ , -21305736, -16910374, -13421773, -10652868
+ , -8455187, -6710886, -5326434, -4227594
+ , -3355443, -2663217, -2113797, -1677722
+ , -1331609, -1056898, -838861, -665804
+ , -528449, -419430, -332902, -264225
+ , -209715, -166451, -132112, -104858
+ , -83226, -66056, -52429, -41613
+ , -33028, -26214, -20806, -16514
+ , -13107, -10403, -8257, -6554
+ , -5202, -4129, -3277, -2601
+ , -2064, -1638, -1300, -1032
+ , -819, -650, -516, 0
+ }
+, {
+ 858993459, 681783560, 541131970, 429496730
+ , 340891780, 270565985, 214748365, 170445890
+ , 135282993, 107374182, 85222945, 67641496
+ , 53687091, 42611473, 33820748, 26843546
+ , 21305736, 16910374, 13421773, 10652868
+ , 8455187, 6710886, 5326434, 4227594
+ , 3355443, 2663217, 2113797, 1677722
+ , 1331609, 1056898, 838861, 665804
+ , 528449, 419430, 332902, 264225
+ , 209715, 166451, 132112, 104858
+ , 83226, 66056, 52429, 41613
+ , 33028, 26214, 20806, 16514
+ , 13107, 10403, 8257, 6554
+ , 5202, 4129, 3277, 2601
+ , 2064, 1638, 1300, 1032
+ , 819, 650, 516, 0
+ }
+, {
+ 1717986918, 1363567121, 1082263941, 858993459
+ , 681783560, 541131970, 429496730, 340891780
+ , 270565985, 214748365, 170445890, 135282993
+ , 107374182, 85222945, 67641496, 53687091
+ , 42611473, 33820748, 26843546, 21305736
+ , 16910374, 13421773, 10652868, 8455187
+ , 6710886, 5326434, 4227594, 3355443
+ , 2663217, 2113797, 1677722, 1331609
+ , 1056898, 838861, 665804, 528449
+ , 419430, 332902, 264225, 209715
+ , 166451, 132112, 104858, 83226
+ , 66056, 52429, 41613, 33028
+ , 26214, 20806, 16514, 13107
+ , 10403, 8257, 6554, 5202
+ , 4129, 3277, 2601, 2064
+ , 1638, 1300, 1032, 0
+ }
+, {
+ -1908874354, -1515074579, -1202515490, -954437177
+ , -757537289, -601257745, -477218588, -378768645
+ , -300628872, -238609294, -189384322, -150314436
+ , -119304647, -94692161, -75157218, -59652324
+ , -47346081, -37578609, -29826162, -23673040
+ , -18789305, -14913081, -11836520, -9394652
+ , -7456540, -5918260, -4697326, -3728270
+ , -2959130, -2348663, -1864135, -1479565
+ , -1174332, -932068, -739783, -587166
+ , -466034, -369891, -293583, -233017
+ , -184946, -146791, -116508, -92473
+ , -73396, -58254, -46236, -36698
+ , -29127, -23118, -18349, -14564
+ , -11559, -9174, -7282, -5780
+ , -4587, -3641, -2890, -2294
+ , -1820, -1445, -1147, 0
+ }
+, {
+ -954437177, -757537289, -601257745, -477218588
+ , -378768645, -300628872, -238609294, -189384322
+ , -150314436, -119304647, -94692161, -75157218
+ , -59652324, -47346081, -37578609, -29826162
+ , -23673040, -18789305, -14913081, -11836520
+ , -9394652, -7456540, -5918260, -4697326
+ , -3728270, -2959130, -2348663, -1864135
+ , -1479565, -1174332, -932068, -739783
+ , -587166, -466034, -369891, -293583
+ , -233017, -184946, -146791, -116508
+ , -92473, -73396, -58254, -46236
+ , -36698, -29127, -23118, -18349
+ , -14564, -11559, -9174, -7282
+ , -5780, -4587, -3641, -2890
+ , -2294, -1820, -1445, -1147
+ , -910, -722, -573, 0
+ }
+, {
+ -477218588, -378768645, -300628872, -238609294
+ , -189384322, -150314436, -119304647, -94692161
+ , -75157218, -59652324, -47346081, -37578609
+ , -29826162, -23673040, -18789305, -14913081
+ , -11836520, -9394652, -7456540, -5918260
+ , -4697326, -3728270, -2959130, -2348663
+ , -1864135, -1479565, -1174332, -932068
+ , -739783, -587166, -466034, -369891
+ , -293583, -233017, -184946, -146791
+ , -116508, -92473, -73396, -58254
+ , -46236, -36698, -29127, -23118
+ , -18349, -14564, -11559, -9174
+ , -7282, -5780, -4587, -3641
+ , -2890, -2294, -1820, -1445
+ , -1147, -910, -722, -573
+ , -455, -361, -287, 0
+ }
+, {
+ 477218588, 378768645, 300628872, 238609294
+ , 189384322, 150314436, 119304647, 94692161
+ , 75157218, 59652324, 47346081, 37578609
+ , 29826162, 23673040, 18789305, 14913081
+ , 11836520, 9394652, 7456540, 5918260
+ , 4697326, 3728270, 2959130, 2348663
+ , 1864135, 1479565, 1174332, 932068
+ , 739783, 587166, 466034, 369891
+ , 293583, 233017, 184946, 146791
+ , 116508, 92473, 73396, 58254
+ , 46236, 36698, 29127, 23118
+ , 18349, 14564, 11559, 9174
+ , 7282, 5780, 4587, 3641
+ , 2890, 2294, 1820, 1445
+ , 1147, 910, 722, 573
+ , 455, 361, 287, 0
+ }
+, {
+ 954437177, 757537289, 601257745, 477218588
+ , 378768645, 300628872, 238609294, 189384322
+ , 150314436, 119304647, 94692161, 75157218
+ , 59652324, 47346081, 37578609, 29826162
+ , 23673040, 18789305, 14913081, 11836520
+ , 9394652, 7456540, 5918260, 4697326
+ , 3728270, 2959130, 2348663, 1864135
+ , 1479565, 1174332, 932068, 739783
+ , 587166, 466034, 369891, 293583
+ , 233017, 184946, 146791, 116508
+ , 92473, 73396, 58254, 46236
+ , 36698, 29127, 23118, 18349
+ , 14564, 11559, 9174, 7282
+ , 5780, 4587, 3641, 2890
+ , 2294, 1820, 1445, 1147
+ , 910, 722, 573, 0
+ }
+, {
+ 1908874354, 1515074579, 1202515490, 954437177
+ , 757537289, 601257745, 477218588, 378768645
+ , 300628872, 238609294, 189384322, 150314436
+ , 119304647, 94692161, 75157218, 59652324
+ , 47346081, 37578609, 29826162, 23673040
+ , 18789305, 14913081, 11836520, 9394652
+ , 7456540, 5918260, 4697326, 3728270
+ , 2959130, 2348663, 1864135, 1479565
+ , 1174332, 932068, 739783, 587166
+ , 466034, 369891, 293583, 233017
+ , 184946, 146791, 116508, 92473
+ , 73396, 58254, 46236, 36698
+ , 29127, 23118, 18349, 14564
+ , 11559, 9174, 7282, 5780
+ , 4587, 3641, 2890, 2294
+ , 1820, 1445, 1147, 0
+ }
+};
+
+#endif
+
+static const unsigned char grp_3tab[96] =
+{
+ 1, 1, 1, 0, 1, 1, 2, 1, 1, 1, 0, 1, 0, 0, 1, 2, 0, 1
+, 1, 2, 1, 0, 2, 1, 2, 2, 1, 1, 1, 0, 0, 1, 0, 2, 1, 0
+, 1, 0, 0, 0, 0, 0, 2, 0, 0, 1, 2, 0, 0, 2, 0, 2, 2, 0
+, 1, 1, 2, 0, 1, 2, 2, 1, 2, 1, 0, 2, 0, 0, 2, 2, 0, 2
+, 1, 2, 2, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0
+};
+
+static const unsigned char grp_5tab[384] =
+{
+ 17, 17, 17, 18, 17, 17, 0, 17, 17, 19, 17, 17, 20, 17, 17, 17, 18, 17
+, 18, 18, 17, 0, 18, 17, 19, 18, 17, 20, 18, 17, 17, 0, 17, 18, 0, 17
+, 0, 0, 17, 19, 0, 17, 20, 0, 17, 17, 19, 17, 18, 19, 17, 0, 19, 17
+, 19, 19, 17, 20, 19, 17, 17, 20, 17, 18, 20, 17, 0, 20, 17, 19, 20, 17
+, 20, 20, 17, 17, 17, 18, 18, 17, 18, 0, 17, 18, 19, 17, 18, 20, 17, 18
+, 17, 18, 18, 18, 18, 18, 0, 18, 18, 19, 18, 18, 20, 18, 18, 17, 0, 18
+, 18, 0, 18, 0, 0, 18, 19, 0, 18, 20, 0, 18, 17, 19, 18, 18, 19, 18
+, 0, 19, 18, 19, 19, 18, 20, 19, 18, 17, 20, 18, 18, 20, 18, 0, 20, 18
+, 19, 20, 18, 20, 20, 18, 17, 17, 0, 18, 17, 0, 0, 17, 0, 19, 17, 0
+, 20, 17, 0, 17, 18, 0, 18, 18, 0, 0, 18, 0, 19, 18, 0, 20, 18, 0
+, 17, 0, 0, 18, 0, 0, 0, 0, 0, 19, 0, 0, 20, 0, 0, 17, 19, 0
+, 18, 19, 0, 0, 19, 0, 19, 19, 0, 20, 19, 0, 17, 20, 0, 18, 20, 0
+, 0, 20, 0, 19, 20, 0, 20, 20, 0, 17, 17, 19, 18, 17, 19, 0, 17, 19
+, 19, 17, 19, 20, 17, 19, 17, 18, 19, 18, 18, 19, 0, 18, 19, 19, 18, 19
+, 20, 18, 19, 17, 0, 19, 18, 0, 19, 0, 0, 19, 19, 0, 19, 20, 0, 19
+, 17, 19, 19, 18, 19, 19, 0, 19, 19, 19, 19, 19, 20, 19, 19, 17, 20, 19
+, 18, 20, 19, 0, 20, 19, 19, 20, 19, 20, 20, 19, 17, 17, 20, 18, 17, 20
+, 0, 17, 20, 19, 17, 20, 20, 17, 20, 17, 18, 20, 18, 18, 20, 0, 18, 20
+, 19, 18, 20, 20, 18, 20, 17, 0, 20, 18, 0, 20, 0, 0, 20, 19, 0, 20
+, 20, 0, 20, 17, 19, 20, 18, 19, 20, 0, 19, 20, 19, 19, 20, 20, 19, 20
+, 17, 20, 20, 18, 20, 20, 0, 20, 20, 19, 20, 20, 20, 20, 20, 0, 0, 0
+, 0, 0, 0, 0, 0, 0
+};
+
+static const unsigned char grp_9tab[3072] =
+{
+ 21, 21, 21, 1, 21, 21, 22, 21, 21, 23, 21, 21, 0, 21, 21, 24, 21, 21
+, 25, 21, 21, 2, 21, 21, 26, 21, 21, 21, 1, 21, 1, 1, 21, 22, 1, 21
+, 23, 1, 21, 0, 1, 21, 24, 1, 21, 25, 1, 21, 2, 1, 21, 26, 1, 21
+, 21, 22, 21, 1, 22, 21, 22, 22, 21, 23, 22, 21, 0, 22, 21, 24, 22, 21
+, 25, 22, 21, 2, 22, 21, 26, 22, 21, 21, 23, 21, 1, 23, 21, 22, 23, 21
+, 23, 23, 21, 0, 23, 21, 24, 23, 21, 25, 23, 21, 2, 23, 21, 26, 23, 21
+, 21, 0, 21, 1, 0, 21, 22, 0, 21, 23, 0, 21, 0, 0, 21, 24, 0, 21
+, 25, 0, 21, 2, 0, 21, 26, 0, 21, 21, 24, 21, 1, 24, 21, 22, 24, 21
+, 23, 24, 21, 0, 24, 21, 24, 24, 21, 25, 24, 21, 2, 24, 21, 26, 24, 21
+, 21, 25, 21, 1, 25, 21, 22, 25, 21, 23, 25, 21, 0, 25, 21, 24, 25, 21
+, 25, 25, 21, 2, 25, 21, 26, 25, 21, 21, 2, 21, 1, 2, 21, 22, 2, 21
+, 23, 2, 21, 0, 2, 21, 24, 2, 21, 25, 2, 21, 2, 2, 21, 26, 2, 21
+, 21, 26, 21, 1, 26, 21, 22, 26, 21, 23, 26, 21, 0, 26, 21, 24, 26, 21
+, 25, 26, 21, 2, 26, 21, 26, 26, 21, 21, 21, 1, 1, 21, 1, 22, 21, 1
+, 23, 21, 1, 0, 21, 1, 24, 21, 1, 25, 21, 1, 2, 21, 1, 26, 21, 1
+, 21, 1, 1, 1, 1, 1, 22, 1, 1, 23, 1, 1, 0, 1, 1, 24, 1, 1
+, 25, 1, 1, 2, 1, 1, 26, 1, 1, 21, 22, 1, 1, 22, 1, 22, 22, 1
+, 23, 22, 1, 0, 22, 1, 24, 22, 1, 25, 22, 1, 2, 22, 1, 26, 22, 1
+, 21, 23, 1, 1, 23, 1, 22, 23, 1, 23, 23, 1, 0, 23, 1, 24, 23, 1
+, 25, 23, 1, 2, 23, 1, 26, 23, 1, 21, 0, 1, 1, 0, 1, 22, 0, 1
+, 23, 0, 1, 0, 0, 1, 24, 0, 1, 25, 0, 1, 2, 0, 1, 26, 0, 1
+, 21, 24, 1, 1, 24, 1, 22, 24, 1, 23, 24, 1, 0, 24, 1, 24, 24, 1
+, 25, 24, 1, 2, 24, 1, 26, 24, 1, 21, 25, 1, 1, 25, 1, 22, 25, 1
+, 23, 25, 1, 0, 25, 1, 24, 25, 1, 25, 25, 1, 2, 25, 1, 26, 25, 1
+, 21, 2, 1, 1, 2, 1, 22, 2, 1, 23, 2, 1, 0, 2, 1, 24, 2, 1
+, 25, 2, 1, 2, 2, 1, 26, 2, 1, 21, 26, 1, 1, 26, 1, 22, 26, 1
+, 23, 26, 1, 0, 26, 1, 24, 26, 1, 25, 26, 1, 2, 26, 1, 26, 26, 1
+, 21, 21, 22, 1, 21, 22, 22, 21, 22, 23, 21, 22, 0, 21, 22, 24, 21, 22
+, 25, 21, 22, 2, 21, 22, 26, 21, 22, 21, 1, 22, 1, 1, 22, 22, 1, 22
+, 23, 1, 22, 0, 1, 22, 24, 1, 22, 25, 1, 22, 2, 1, 22, 26, 1, 22
+, 21, 22, 22, 1, 22, 22, 22, 22, 22, 23, 22, 22, 0, 22, 22, 24, 22, 22
+, 25, 22, 22, 2, 22, 22, 26, 22, 22, 21, 23, 22, 1, 23, 22, 22, 23, 22
+, 23, 23, 22, 0, 23, 22, 24, 23, 22, 25, 23, 22, 2, 23, 22, 26, 23, 22
+, 21, 0, 22, 1, 0, 22, 22, 0, 22, 23, 0, 22, 0, 0, 22, 24, 0, 22
+, 25, 0, 22, 2, 0, 22, 26, 0, 22, 21, 24, 22, 1, 24, 22, 22, 24, 22
+, 23, 24, 22, 0, 24, 22, 24, 24, 22, 25, 24, 22, 2, 24, 22, 26, 24, 22
+, 21, 25, 22, 1, 25, 22, 22, 25, 22, 23, 25, 22, 0, 25, 22, 24, 25, 22
+, 25, 25, 22, 2, 25, 22, 26, 25, 22, 21, 2, 22, 1, 2, 22, 22, 2, 22
+, 23, 2, 22, 0, 2, 22, 24, 2, 22, 25, 2, 22, 2, 2, 22, 26, 2, 22
+, 21, 26, 22, 1, 26, 22, 22, 26, 22, 23, 26, 22, 0, 26, 22, 24, 26, 22
+, 25, 26, 22, 2, 26, 22, 26, 26, 22, 21, 21, 23, 1, 21, 23, 22, 21, 23
+, 23, 21, 23, 0, 21, 23, 24, 21, 23, 25, 21, 23, 2, 21, 23, 26, 21, 23
+, 21, 1, 23, 1, 1, 23, 22, 1, 23, 23, 1, 23, 0, 1, 23, 24, 1, 23
+, 25, 1, 23, 2, 1, 23, 26, 1, 23, 21, 22, 23, 1, 22, 23, 22, 22, 23
+, 23, 22, 23, 0, 22, 23, 24, 22, 23, 25, 22, 23, 2, 22, 23, 26, 22, 23
+, 21, 23, 23, 1, 23, 23, 22, 23, 23, 23, 23, 23, 0, 23, 23, 24, 23, 23
+, 25, 23, 23, 2, 23, 23, 26, 23, 23, 21, 0, 23, 1, 0, 23, 22, 0, 23
+, 23, 0, 23, 0, 0, 23, 24, 0, 23, 25, 0, 23, 2, 0, 23, 26, 0, 23
+, 21, 24, 23, 1, 24, 23, 22, 24, 23, 23, 24, 23, 0, 24, 23, 24, 24, 23
+, 25, 24, 23, 2, 24, 23, 26, 24, 23, 21, 25, 23, 1, 25, 23, 22, 25, 23
+, 23, 25, 23, 0, 25, 23, 24, 25, 23, 25, 25, 23, 2, 25, 23, 26, 25, 23
+, 21, 2, 23, 1, 2, 23, 22, 2, 23, 23, 2, 23, 0, 2, 23, 24, 2, 23
+, 25, 2, 23, 2, 2, 23, 26, 2, 23, 21, 26, 23, 1, 26, 23, 22, 26, 23
+, 23, 26, 23, 0, 26, 23, 24, 26, 23, 25, 26, 23, 2, 26, 23, 26, 26, 23
+, 21, 21, 0, 1, 21, 0, 22, 21, 0, 23, 21, 0, 0, 21, 0, 24, 21, 0
+, 25, 21, 0, 2, 21, 0, 26, 21, 0, 21, 1, 0, 1, 1, 0, 22, 1, 0
+, 23, 1, 0, 0, 1, 0, 24, 1, 0, 25, 1, 0, 2, 1, 0, 26, 1, 0
+, 21, 22, 0, 1, 22, 0, 22, 22, 0, 23, 22, 0, 0, 22, 0, 24, 22, 0
+, 25, 22, 0, 2, 22, 0, 26, 22, 0, 21, 23, 0, 1, 23, 0, 22, 23, 0
+, 23, 23, 0, 0, 23, 0, 24, 23, 0, 25, 23, 0, 2, 23, 0, 26, 23, 0
+, 21, 0, 0, 1, 0, 0, 22, 0, 0, 23, 0, 0, 0, 0, 0, 24, 0, 0
+, 25, 0, 0, 2, 0, 0, 26, 0, 0, 21, 24, 0, 1, 24, 0, 22, 24, 0
+, 23, 24, 0, 0, 24, 0, 24, 24, 0, 25, 24, 0, 2, 24, 0, 26, 24, 0
+, 21, 25, 0, 1, 25, 0, 22, 25, 0, 23, 25, 0, 0, 25, 0, 24, 25, 0
+, 25, 25, 0, 2, 25, 0, 26, 25, 0, 21, 2, 0, 1, 2, 0, 22, 2, 0
+, 23, 2, 0, 0, 2, 0, 24, 2, 0, 25, 2, 0, 2, 2, 0, 26, 2, 0
+, 21, 26, 0, 1, 26, 0, 22, 26, 0, 23, 26, 0, 0, 26, 0, 24, 26, 0
+, 25, 26, 0, 2, 26, 0, 26, 26, 0, 21, 21, 24, 1, 21, 24, 22, 21, 24
+, 23, 21, 24, 0, 21, 24, 24, 21, 24, 25, 21, 24, 2, 21, 24, 26, 21, 24
+, 21, 1, 24, 1, 1, 24, 22, 1, 24, 23, 1, 24, 0, 1, 24, 24, 1, 24
+, 25, 1, 24, 2, 1, 24, 26, 1, 24, 21, 22, 24, 1, 22, 24, 22, 22, 24
+, 23, 22, 24, 0, 22, 24, 24, 22, 24, 25, 22, 24, 2, 22, 24, 26, 22, 24
+, 21, 23, 24, 1, 23, 24, 22, 23, 24, 23, 23, 24, 0, 23, 24, 24, 23, 24
+, 25, 23, 24, 2, 23, 24, 26, 23, 24, 21, 0, 24, 1, 0, 24, 22, 0, 24
+, 23, 0, 24, 0, 0, 24, 24, 0, 24, 25, 0, 24, 2, 0, 24, 26, 0, 24
+, 21, 24, 24, 1, 24, 24, 22, 24, 24, 23, 24, 24, 0, 24, 24, 24, 24, 24
+, 25, 24, 24, 2, 24, 24, 26, 24, 24, 21, 25, 24, 1, 25, 24, 22, 25, 24
+, 23, 25, 24, 0, 25, 24, 24, 25, 24, 25, 25, 24, 2, 25, 24, 26, 25, 24
+, 21, 2, 24, 1, 2, 24, 22, 2, 24, 23, 2, 24, 0, 2, 24, 24, 2, 24
+, 25, 2, 24, 2, 2, 24, 26, 2, 24, 21, 26, 24, 1, 26, 24, 22, 26, 24
+, 23, 26, 24, 0, 26, 24, 24, 26, 24, 25, 26, 24, 2, 26, 24, 26, 26, 24
+, 21, 21, 25, 1, 21, 25, 22, 21, 25, 23, 21, 25, 0, 21, 25, 24, 21, 25
+, 25, 21, 25, 2, 21, 25, 26, 21, 25, 21, 1, 25, 1, 1, 25, 22, 1, 25
+, 23, 1, 25, 0, 1, 25, 24, 1, 25, 25, 1, 25, 2, 1, 25, 26, 1, 25
+, 21, 22, 25, 1, 22, 25, 22, 22, 25, 23, 22, 25, 0, 22, 25, 24, 22, 25
+, 25, 22, 25, 2, 22, 25, 26, 22, 25, 21, 23, 25, 1, 23, 25, 22, 23, 25
+, 23, 23, 25, 0, 23, 25, 24, 23, 25, 25, 23, 25, 2, 23, 25, 26, 23, 25
+, 21, 0, 25, 1, 0, 25, 22, 0, 25, 23, 0, 25, 0, 0, 25, 24, 0, 25
+, 25, 0, 25, 2, 0, 25, 26, 0, 25, 21, 24, 25, 1, 24, 25, 22, 24, 25
+, 23, 24, 25, 0, 24, 25, 24, 24, 25, 25, 24, 25, 2, 24, 25, 26, 24, 25
+, 21, 25, 25, 1, 25, 25, 22, 25, 25, 23, 25, 25, 0, 25, 25, 24, 25, 25
+, 25, 25, 25, 2, 25, 25, 26, 25, 25, 21, 2, 25, 1, 2, 25, 22, 2, 25
+, 23, 2, 25, 0, 2, 25, 24, 2, 25, 25, 2, 25, 2, 2, 25, 26, 2, 25
+, 21, 26, 25, 1, 26, 25, 22, 26, 25, 23, 26, 25, 0, 26, 25, 24, 26, 25
+, 25, 26, 25, 2, 26, 25, 26, 26, 25, 21, 21, 2, 1, 21, 2, 22, 21, 2
+, 23, 21, 2, 0, 21, 2, 24, 21, 2, 25, 21, 2, 2, 21, 2, 26, 21, 2
+, 21, 1, 2, 1, 1, 2, 22, 1, 2, 23, 1, 2, 0, 1, 2, 24, 1, 2
+, 25, 1, 2, 2, 1, 2, 26, 1, 2, 21, 22, 2, 1, 22, 2, 22, 22, 2
+, 23, 22, 2, 0, 22, 2, 24, 22, 2, 25, 22, 2, 2, 22, 2, 26, 22, 2
+, 21, 23, 2, 1, 23, 2, 22, 23, 2, 23, 23, 2, 0, 23, 2, 24, 23, 2
+, 25, 23, 2, 2, 23, 2, 26, 23, 2, 21, 0, 2, 1, 0, 2, 22, 0, 2
+, 23, 0, 2, 0, 0, 2, 24, 0, 2, 25, 0, 2, 2, 0, 2, 26, 0, 2
+, 21, 24, 2, 1, 24, 2, 22, 24, 2, 23, 24, 2, 0, 24, 2, 24, 24, 2
+, 25, 24, 2, 2, 24, 2, 26, 24, 2, 21, 25, 2, 1, 25, 2, 22, 25, 2
+, 23, 25, 2, 0, 25, 2, 24, 25, 2, 25, 25, 2, 2, 25, 2, 26, 25, 2
+, 21, 2, 2, 1, 2, 2, 22, 2, 2, 23, 2, 2, 0, 2, 2, 24, 2, 2
+, 25, 2, 2, 2, 2, 2, 26, 2, 2, 21, 26, 2, 1, 26, 2, 22, 26, 2
+, 23, 26, 2, 0, 26, 2, 24, 26, 2, 25, 26, 2, 2, 26, 2, 26, 26, 2
+, 21, 21, 26, 1, 21, 26, 22, 21, 26, 23, 21, 26, 0, 21, 26, 24, 21, 26
+, 25, 21, 26, 2, 21, 26, 26, 21, 26, 21, 1, 26, 1, 1, 26, 22, 1, 26
+, 23, 1, 26, 0, 1, 26, 24, 1, 26, 25, 1, 26, 2, 1, 26, 26, 1, 26
+, 21, 22, 26, 1, 22, 26, 22, 22, 26, 23, 22, 26, 0, 22, 26, 24, 22, 26
+, 25, 22, 26, 2, 22, 26, 26, 22, 26, 21, 23, 26, 1, 23, 26, 22, 23, 26
+, 23, 23, 26, 0, 23, 26, 24, 23, 26, 25, 23, 26, 2, 23, 26, 26, 23, 26
+, 21, 0, 26, 1, 0, 26, 22, 0, 26, 23, 0, 26, 0, 0, 26, 24, 0, 26
+, 25, 0, 26, 2, 0, 26, 26, 0, 26, 21, 24, 26, 1, 24, 26, 22, 24, 26
+, 23, 24, 26, 0, 24, 26, 24, 24, 26, 25, 24, 26, 2, 24, 26, 26, 24, 26
+, 21, 25, 26, 1, 25, 26, 22, 25, 26, 23, 25, 26, 0, 25, 26, 24, 25, 26
+, 25, 25, 26, 2, 25, 26, 26, 25, 26, 21, 2, 26, 1, 2, 26, 22, 2, 26
+, 23, 2, 26, 0, 2, 26, 24, 2, 26, 25, 2, 26, 2, 2, 26, 26, 2, 26
+, 21, 26, 26, 1, 26, 26, 22, 26, 26, 23, 26, 26, 0, 26, 26, 24, 26, 26
+, 25, 26, 26, 2, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/l2tables.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/l2tables.h
new file mode 100644
index 00000000..d06b029c
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/l2tables.h
@@ -0,0 +1,167 @@
+/*
+ l2tables.h: Layer 2 Alloc tables
+
+ copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp
+
+ most other tables are calculated on program start (which is (of course) not ISO-conform)
+ Layer-3 huffman table is in huffman.h
+
+ Note: runtime computation of those other tables is optional now, and only for
+ floating point decoding.
+*/
+
+
+#ifndef _MPG123_L2TABLES_H_
+#define _MPG123_L2TABLES_H_
+
+static const struct al_table alloc_0[] = {
+ {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
+ {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
+ {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
+ {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
+ {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
+ {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {2,0},{5,3},{7,5},{16,-32767},
+ {2,0},{5,3},{7,5},{16,-32767},
+ {2,0},{5,3},{7,5},{16,-32767},
+ {2,0},{5,3},{7,5},{16,-32767} };
+
+static const struct al_table alloc_1[] = {
+ {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
+ {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
+ {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
+ {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
+ {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
+ {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
+ {2,0},{5,3},{7,5},{16,-32767},
+ {2,0},{5,3},{7,5},{16,-32767},
+ {2,0},{5,3},{7,5},{16,-32767},
+ {2,0},{5,3},{7,5},{16,-32767},
+ {2,0},{5,3},{7,5},{16,-32767},
+ {2,0},{5,3},{7,5},{16,-32767},
+ {2,0},{5,3},{7,5},{16,-32767} };
+
+static const struct al_table alloc_2[] = {
+ {4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
+ {10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
+ {4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
+ {10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63} };
+
+static const struct al_table alloc_3[] = {
+ {4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
+ {10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
+ {4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
+ {10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63} };
+
+static const struct al_table alloc_4[] = {
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
+ {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
+ {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9},
+ {2,0},{5,3},{7,5},{10,9} };
+
+#endif
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/l3bandgain.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/l3bandgain.h
new file mode 100644
index 00000000..05cab97c
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/l3bandgain.h
@@ -0,0 +1,94 @@
+/*
+ l3bandinfo.h: the layer III bandInfo structures and gainpow2_scale
+
+ copyright 1995-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp
+
+ This is separated out of layer3.c to re-use independently in calctables.
+*/
+
+struct bandInfoStruct
+{
+ unsigned short longIdx[23];
+ unsigned char longDiff[22];
+ unsigned short shortIdx[14];
+ unsigned char shortDiff[13];
+};
+
+/* Techy details about our friendly MPEG data. Fairly constant over the years;-) */
+static const struct bandInfoStruct bandInfo[9] =
+{
+ { /* MPEG 1.0 */
+ {0,4,8,12,16,20,24,30,36,44,52,62,74, 90,110,134,162,196,238,288,342,418,576},
+ {4,4,4,4,4,4,6,6,8, 8,10,12,16,20,24,28,34,42,50,54, 76,158},
+ {0,4*3,8*3,12*3,16*3,22*3,30*3,40*3,52*3,66*3, 84*3,106*3,136*3,192*3},
+ {4,4,4,4,6,8,10,12,14,18,22,30,56}
+ },
+ {
+ {0,4,8,12,16,20,24,30,36,42,50,60,72, 88,106,128,156,190,230,276,330,384,576},
+ {4,4,4,4,4,4,6,6,6, 8,10,12,16,18,22,28,34,40,46,54, 54,192},
+ {0,4*3,8*3,12*3,16*3,22*3,28*3,38*3,50*3,64*3, 80*3,100*3,126*3,192*3},
+ {4,4,4,4,6,6,10,12,14,16,20,26,66}
+ },
+ {
+ {0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576},
+ {4,4,4,4,4,4,6,6,8,10,12,16,20,24,30,38,46,56,68,84,102, 26},
+ {0,4*3,8*3,12*3,16*3,22*3,30*3,42*3,58*3,78*3,104*3,138*3,180*3,192*3},
+ {4,4,4,4,6,8,12,16,20,26,34,42,12}
+ },
+ { /* MPEG 2.0 */
+ {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
+ {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54 } ,
+ {0,4*3,8*3,12*3,18*3,24*3,32*3,42*3,56*3,74*3,100*3,132*3,174*3,192*3} ,
+ {4,4,4,6,6,8,10,14,18,26,32,42,18 }
+ },
+ { /* Twiddling 3 values here (not just 330->332!) fixed bug 1895025. */
+ {0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576},
+ {6,6,6,6,6,6,8,10,12,14,16,18,22,26,32,38,46,54,62,70,76,36 },
+ {0,4*3,8*3,12*3,18*3,26*3,36*3,48*3,62*3,80*3,104*3,136*3,180*3,192*3},
+ {4,4,4,6,8,10,12,14,18,24,32,44,12 }
+ },
+ {
+ {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
+ {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54 },
+ {0,4*3,8*3,12*3,18*3,26*3,36*3,48*3,62*3,80*3,104*3,134*3,174*3,192*3},
+ {4,4,4,6,8,10,12,14,18,24,30,40,18 }
+ },
+ { /* MPEG 2.5 */
+ {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
+ {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54},
+ {0,12,24,36,54,78,108,144,186,240,312,402,522,576},
+ {4,4,4,6,8,10,12,14,18,24,30,40,18}
+ },
+ {
+ {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
+ {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54},
+ {0,12,24,36,54,78,108,144,186,240,312,402,522,576},
+ {4,4,4,6,8,10,12,14,18,24,30,40,18}
+ },
+ {
+ {0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576},
+ {12,12,12,12,12,12,16,20,24,28,32,40,48,56,64,76,90,2,2,2,2,2},
+ {0, 24, 48, 72,108,156,216,288,372,480,486,492,498,576},
+ {8,8,8,12,16,20,24,28,36,2,2,2,26}
+ }
+};
+
+#if defined(REAL_IS_FIXED) || defined(CALCTABLES)
+static const char gainpow2_scale[256+118+4+1] =
+{
+ 19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,
+ 27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,32,32,32,32,33,33,33,33,34,34,34,34,34,
+ 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
+ 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
+ 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
+ 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
+ 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
+ 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
+ 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
+ 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
+ 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
+ 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,0
+};
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/l3tabs.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/l3tabs.h
new file mode 100644
index 00000000..7b410925
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/l3tabs.h
@@ -0,0 +1,5285 @@
+// l3 MPEG decoding tables
+// output of:
+// src/libmpg123/calctables l3
+
+#if defined(RUNTIME_TABLES)
+
+#ifdef REAL_IS_FLOAT
+
+// aligned to 16 bytes for vector instructions, e.g. AltiVec
+
+static ALIGNED(16) real ispow[8207];
+static ALIGNED(16) real aa_ca[8];
+static ALIGNED(16) real aa_cs[8];
+static ALIGNED(16) real win[4][36];
+static ALIGNED(16) real win1[4][36];
+ALIGNED(16) real COS9[9];
+static real COS6_1;
+static real COS6_2;
+ALIGNED(16) real tfcos36[9];
+static ALIGNED(16) real tfcos12[3];
+static ALIGNED(16) real cos9[3];
+static ALIGNED(16) real cos18[3];
+static ALIGNED(16) real tan1_1[16];
+static ALIGNED(16) real tan2_1[16];
+static ALIGNED(16) real tan1_2[16];
+static ALIGNED(16) real tan2_2[16];
+static ALIGNED(16) real pow1_1[2][32];
+static ALIGNED(16) real pow2_1[2][32];
+static ALIGNED(16) real pow1_2[2][32];
+static ALIGNED(16) real pow2_2[2][32];
+
+#endif
+
+static short mapbuf0[9][152];
+static short mapbuf1[9][156];
+static short mapbuf2[9][44];
+static short *map[9][3];
+static short *mapend[9][3];
+static unsigned short n_slen2[512];
+static unsigned short i_slen2[256];
+
+#else
+
+#ifdef REAL_IS_FLOAT
+
+// aligned to 16 bytes for vector instructions, e.g. AltiVec
+
+static const ALIGNED(16) real ispow[8207] =
+{
+ 0.00000000e+00, 1.00000000e+00, 2.51984210e+00, 4.32674871e+00
+, 6.34960421e+00, 8.54987973e+00, 1.09027236e+01, 1.33905183e+01
+, 1.60000000e+01, 1.87207544e+01, 2.15443469e+01, 2.44637810e+01
+, 2.74731418e+01, 3.05673509e+01, 3.37419917e+01, 3.69931811e+01
+, 4.03174736e+01, 4.37117870e+01, 4.71733451e+01, 5.06996313e+01
+, 5.42883523e+01, 5.79374077e+01, 6.16448653e+01, 6.54089405e+01
+, 6.92279794e+01, 7.31004435e+01, 7.70248978e+01, 8.10000000e+01
+, 8.50244912e+01, 8.90971879e+01, 9.32169752e+01, 9.73828002e+01
+, 1.01593667e+02, 1.05848633e+02, 1.10146801e+02, 1.14487321e+02
+, 1.18869381e+02, 1.23292209e+02, 1.27755065e+02, 1.32257246e+02
+, 1.36798076e+02, 1.41376907e+02, 1.45993119e+02, 1.50646117e+02
+, 1.55335327e+02, 1.60060199e+02, 1.64820202e+02, 1.69614826e+02
+, 1.74443577e+02, 1.79305980e+02, 1.84201575e+02, 1.89129918e+02
+, 1.94090580e+02, 1.99083145e+02, 2.04107210e+02, 2.09162385e+02
+, 2.14248292e+02, 2.19364564e+02, 2.24510845e+02, 2.29686789e+02
+, 2.34892058e+02, 2.40126328e+02, 2.45389280e+02, 2.50680604e+02
+, 2.56000000e+02, 2.61347174e+02, 2.66721841e+02, 2.72123723e+02
+, 2.77552547e+02, 2.83008049e+02, 2.88489971e+02, 2.93998060e+02
+, 2.99532071e+02, 3.05091761e+02, 3.10676898e+02, 3.16287249e+02
+, 3.21922592e+02, 3.27582707e+02, 3.33267377e+02, 3.38976394e+02
+, 3.44709550e+02, 3.50466646e+02, 3.56247482e+02, 3.62051866e+02
+, 3.67879608e+02, 3.73730522e+02, 3.79604427e+02, 3.85501143e+02
+, 3.91420496e+02, 3.97362314e+02, 4.03326427e+02, 4.09312672e+02
+, 4.15320884e+02, 4.21350905e+02, 4.27402579e+02, 4.33475750e+02
+, 4.39570269e+02, 4.45685987e+02, 4.51822757e+02, 4.57980436e+02
+, 4.64158883e+02, 4.70357960e+02, 4.76577530e+02, 4.82817459e+02
+, 4.89077615e+02, 4.95357868e+02, 5.01658090e+02, 5.07978156e+02
+, 5.14317941e+02, 5.20677324e+02, 5.27056184e+02, 5.33454404e+02
+, 5.39871867e+02, 5.46308458e+02, 5.52764065e+02, 5.59238575e+02
+, 5.65731879e+02, 5.72243870e+02, 5.78774440e+02, 5.85323483e+02
+, 5.91890898e+02, 5.98476581e+02, 6.05080431e+02, 6.11702349e+02
+, 6.18342238e+02, 6.25000000e+02, 6.31675540e+02, 6.38368763e+02
+, 6.45079578e+02, 6.51807891e+02, 6.58553612e+02, 6.65316653e+02
+, 6.72096925e+02, 6.78894340e+02, 6.85708813e+02, 6.92540258e+02
+, 6.99388593e+02, 7.06253733e+02, 7.13135597e+02, 7.20034104e+02
+, 7.26949174e+02, 7.33880729e+02, 7.40828689e+02, 7.47792979e+02
+, 7.54773522e+02, 7.61770242e+02, 7.68783065e+02, 7.75811917e+02
+, 7.82856726e+02, 7.89917420e+02, 7.96993927e+02, 8.04086177e+02
+, 8.11194101e+02, 8.18317630e+02, 8.25456695e+02, 8.32611230e+02
+, 8.39781167e+02, 8.46966442e+02, 8.54166988e+02, 8.61382741e+02
+, 8.68613637e+02, 8.75859614e+02, 8.83120608e+02, 8.90396558e+02
+, 8.97687403e+02, 9.04993081e+02, 9.12313534e+02, 9.19648701e+02
+, 9.26998523e+02, 9.34362944e+02, 9.41741904e+02, 9.49135347e+02
+, 9.56543216e+02, 9.63965455e+02, 9.71402010e+02, 9.78852824e+02
+, 9.86317844e+02, 9.93797016e+02, 1.00129029e+03, 1.00879760e+03
+, 1.01631891e+03, 1.02385416e+03, 1.03140330e+03, 1.03896628e+03
+, 1.04654305e+03, 1.05413355e+03, 1.06173775e+03, 1.06935559e+03
+, 1.07698701e+03, 1.08463198e+03, 1.09229044e+03, 1.09996236e+03
+, 1.10764767e+03, 1.11534634e+03, 1.12305831e+03, 1.13078355e+03
+, 1.13852200e+03, 1.14627363e+03, 1.15403838e+03, 1.16181622e+03
+, 1.16960710e+03, 1.17741097e+03, 1.18522779e+03, 1.19305752e+03
+, 1.20090012e+03, 1.20875555e+03, 1.21662376e+03, 1.22450471e+03
+, 1.23239836e+03, 1.24030468e+03, 1.24822361e+03, 1.25615512e+03
+, 1.26409918e+03, 1.27205573e+03, 1.28002474e+03, 1.28800618e+03
+, 1.29600000e+03, 1.30400617e+03, 1.31202464e+03, 1.32005539e+03
+, 1.32809836e+03, 1.33615353e+03, 1.34422087e+03, 1.35230032e+03
+, 1.36039186e+03, 1.36849545e+03, 1.37661105e+03, 1.38473864e+03
+, 1.39287816e+03, 1.40102960e+03, 1.40919291e+03, 1.41736805e+03
+, 1.42555501e+03, 1.43375373e+03, 1.44196419e+03, 1.45018636e+03
+, 1.45842020e+03, 1.46666567e+03, 1.47492276e+03, 1.48319141e+03
+, 1.49147160e+03, 1.49976331e+03, 1.50806648e+03, 1.51638111e+03
+, 1.52470714e+03, 1.53304456e+03, 1.54139333e+03, 1.54975342e+03
+, 1.55812480e+03, 1.56650744e+03, 1.57490131e+03, 1.58330638e+03
+, 1.59172262e+03, 1.60015000e+03, 1.60858848e+03, 1.61703805e+03
+, 1.62549868e+03, 1.63397032e+03, 1.64245296e+03, 1.65094657e+03
+, 1.65945112e+03, 1.66796657e+03, 1.67649291e+03, 1.68503011e+03
+, 1.69357813e+03, 1.70213695e+03, 1.71070654e+03, 1.71928688e+03
+, 1.72787793e+03, 1.73647968e+03, 1.74509210e+03, 1.75371515e+03
+, 1.76234882e+03, 1.77099307e+03, 1.77964789e+03, 1.78831324e+03
+, 1.79698910e+03, 1.80567544e+03, 1.81437225e+03, 1.82307949e+03
+, 1.83179713e+03, 1.84052517e+03, 1.84926356e+03, 1.85801228e+03
+, 1.86677132e+03, 1.87554064e+03, 1.88432023e+03, 1.89311006e+03
+, 1.90191010e+03, 1.91072033e+03, 1.91954072e+03, 1.92837127e+03
+, 1.93721193e+03, 1.94606269e+03, 1.95492353e+03, 1.96379442e+03
+, 1.97267534e+03, 1.98156626e+03, 1.99046717e+03, 1.99937804e+03
+, 2.00829885e+03, 2.01722958e+03, 2.02617020e+03, 2.03512070e+03
+, 2.04408105e+03, 2.05305123e+03, 2.06203121e+03, 2.07102099e+03
+, 2.08002053e+03, 2.08902982e+03, 2.09804883e+03, 2.10707754e+03
+, 2.11611594e+03, 2.12516400e+03, 2.13422170e+03, 2.14328902e+03
+, 2.15236594e+03, 2.16145244e+03, 2.17054849e+03, 2.17965409e+03
+, 2.18876921e+03, 2.19789383e+03, 2.20702793e+03, 2.21617149e+03
+, 2.22532449e+03, 2.23448691e+03, 2.24365873e+03, 2.25283994e+03
+, 2.26203051e+03, 2.27123042e+03, 2.28043967e+03, 2.28965821e+03
+, 2.29888605e+03, 2.30812316e+03, 2.31736951e+03, 2.32662510e+03
+, 2.33588991e+03, 2.34516390e+03, 2.35444708e+03, 2.36373942e+03
+, 2.37304090e+03, 2.38235150e+03, 2.39167120e+03, 2.40100000e+03
+, 2.41033787e+03, 2.41968478e+03, 2.42904074e+03, 2.43840571e+03
+, 2.44777968e+03, 2.45716264e+03, 2.46655456e+03, 2.47595543e+03
+, 2.48536523e+03, 2.49478394e+03, 2.50421156e+03, 2.51364806e+03
+, 2.52309342e+03, 2.53254763e+03, 2.54201067e+03, 2.55148252e+03
+, 2.56096318e+03, 2.57045262e+03, 2.57995082e+03, 2.58945777e+03
+, 2.59897346e+03, 2.60849787e+03, 2.61803097e+03, 2.62757277e+03
+, 2.63712323e+03, 2.64668235e+03, 2.65625011e+03, 2.66582649e+03
+, 2.67541148e+03, 2.68500506e+03, 2.69460722e+03, 2.70421794e+03
+, 2.71383721e+03, 2.72346501e+03, 2.73310133e+03, 2.74274614e+03
+, 2.75239945e+03, 2.76206122e+03, 2.77173146e+03, 2.78141013e+03
+, 2.79109723e+03, 2.80079274e+03, 2.81049666e+03, 2.82020895e+03
+, 2.82992962e+03, 2.83965863e+03, 2.84939599e+03, 2.85914168e+03
+, 2.86889568e+03, 2.87865797e+03, 2.88842855e+03, 2.89820740e+03
+, 2.90799450e+03, 2.91778985e+03, 2.92759342e+03, 2.93740521e+03
+, 2.94722520e+03, 2.95705337e+03, 2.96688972e+03, 2.97673423e+03
+, 2.98658688e+03, 2.99644767e+03, 3.00631658e+03, 3.01619359e+03
+, 3.02607869e+03, 3.03597188e+03, 3.04587312e+03, 3.05578243e+03
+, 3.06569977e+03, 3.07562514e+03, 3.08555852e+03, 3.09549991e+03
+, 3.10544928e+03, 3.11540663e+03, 3.12537194e+03, 3.13534520e+03
+, 3.14532640e+03, 3.15531553e+03, 3.16531256e+03, 3.17531750e+03
+, 3.18533032e+03, 3.19535102e+03, 3.20537958e+03, 3.21541599e+03
+, 3.22546023e+03, 3.23551231e+03, 3.24557220e+03, 3.25563988e+03
+, 3.26571536e+03, 3.27579862e+03, 3.28588964e+03, 3.29598841e+03
+, 3.30609493e+03, 3.31620917e+03, 3.32633113e+03, 3.33646080e+03
+, 3.34659817e+03, 3.35674321e+03, 3.36689593e+03, 3.37705631e+03
+, 3.38722433e+03, 3.39739999e+03, 3.40758328e+03, 3.41777418e+03
+, 3.42797268e+03, 3.43817877e+03, 3.44839245e+03, 3.45861369e+03
+, 3.46884249e+03, 3.47907883e+03, 3.48932271e+03, 3.49957411e+03
+, 3.50983303e+03, 3.52009945e+03, 3.53037336e+03, 3.54065475e+03
+, 3.55094361e+03, 3.56123993e+03, 3.57154369e+03, 3.58185489e+03
+, 3.59217352e+03, 3.60249957e+03, 3.61283301e+03, 3.62317386e+03
+, 3.63352208e+03, 3.64387768e+03, 3.65424065e+03, 3.66461096e+03
+, 3.67498862e+03, 3.68537360e+03, 3.69576591e+03, 3.70616553e+03
+, 3.71657245e+03, 3.72698666e+03, 3.73740815e+03, 3.74783692e+03
+, 3.75827294e+03, 3.76871621e+03, 3.77916672e+03, 3.78962446e+03
+, 3.80008941e+03, 3.81056158e+03, 3.82104095e+03, 3.83152751e+03
+, 3.84202125e+03, 3.85252216e+03, 3.86303023e+03, 3.87354545e+03
+, 3.88406781e+03, 3.89459731e+03, 3.90513392e+03, 3.91567765e+03
+, 3.92622848e+03, 3.93678640e+03, 3.94735141e+03, 3.95792349e+03
+, 3.96850263e+03, 3.97908883e+03, 3.98968207e+03, 4.00028236e+03
+, 4.01088967e+03, 4.02150399e+03, 4.03212533e+03, 4.04275366e+03
+, 4.05338899e+03, 4.06403129e+03, 4.07468057e+03, 4.08533681e+03
+, 4.09600000e+03, 4.10667014e+03, 4.11734721e+03, 4.12803121e+03
+, 4.13872213e+03, 4.14941995e+03, 4.16012468e+03, 4.17083629e+03
+, 4.18155479e+03, 4.19228016e+03, 4.20301239e+03, 4.21375148e+03
+, 4.22449742e+03, 4.23525020e+03, 4.24600980e+03, 4.25677622e+03
+, 4.26754946e+03, 4.27832950e+03, 4.28911634e+03, 4.29990996e+03
+, 4.31071036e+03, 4.32151753e+03, 4.33233146e+03, 4.34315214e+03
+, 4.35397956e+03, 4.36481373e+03, 4.37565461e+03, 4.38650222e+03
+, 4.39735654e+03, 4.40821756e+03, 4.41908527e+03, 4.42995967e+03
+, 4.44084075e+03, 4.45172850e+03, 4.46262291e+03, 4.47352397e+03
+, 4.48443167e+03, 4.49534602e+03, 4.50626699e+03, 4.51719458e+03
+, 4.52812879e+03, 4.53906960e+03, 4.55001700e+03, 4.56097100e+03
+, 4.57193158e+03, 4.58289873e+03, 4.59387244e+03, 4.60485271e+03
+, 4.61583954e+03, 4.62683290e+03, 4.63783280e+03, 4.64883922e+03
+, 4.65985216e+03, 4.67087162e+03, 4.68189757e+03, 4.69293002e+03
+, 4.70396896e+03, 4.71501438e+03, 4.72606627e+03, 4.73712463e+03
+, 4.74818945e+03, 4.75926071e+03, 4.77033842e+03, 4.78142256e+03
+, 4.79251313e+03, 4.80361012e+03, 4.81471352e+03, 4.82582333e+03
+, 4.83693953e+03, 4.84806213e+03, 4.85919110e+03, 4.87032646e+03
+, 4.88146818e+03, 4.89261627e+03, 4.90377070e+03, 4.91493149e+03
+, 4.92609861e+03, 4.93727207e+03, 4.94845185e+03, 4.95963795e+03
+, 4.97083036e+03, 4.98202908e+03, 4.99323409e+03, 5.00444539e+03
+, 5.01566297e+03, 5.02688683e+03, 5.03811696e+03, 5.04935335e+03
+, 5.06059599e+03, 5.07184488e+03, 5.08310002e+03, 5.09436138e+03
+, 5.10562897e+03, 5.11690279e+03, 5.12818281e+03, 5.13946905e+03
+, 5.15076148e+03, 5.16206010e+03, 5.17336491e+03, 5.18467590e+03
+, 5.19599307e+03, 5.20731639e+03, 5.21864588e+03, 5.22998152e+03
+, 5.24132331e+03, 5.25267123e+03, 5.26402529e+03, 5.27538547e+03
+, 5.28675177e+03, 5.29812418e+03, 5.30950270e+03, 5.32088732e+03
+, 5.33227803e+03, 5.34367483e+03, 5.35507771e+03, 5.36648666e+03
+, 5.37790168e+03, 5.38932276e+03, 5.40074990e+03, 5.41218308e+03
+, 5.42362230e+03, 5.43506756e+03, 5.44651884e+03, 5.45797615e+03
+, 5.46943948e+03, 5.48090881e+03, 5.49238415e+03, 5.50386548e+03
+, 5.51535281e+03, 5.52684612e+03, 5.53834540e+03, 5.54985066e+03
+, 5.56136189e+03, 5.57287908e+03, 5.58440221e+03, 5.59593130e+03
+, 5.60746633e+03, 5.61900729e+03, 5.63055418e+03, 5.64210700e+03
+, 5.65366573e+03, 5.66523038e+03, 5.67680092e+03, 5.68837737e+03
+, 5.69995971e+03, 5.71154794e+03, 5.72314204e+03, 5.73474203e+03
+, 5.74634788e+03, 5.75795959e+03, 5.76957716e+03, 5.78120058e+03
+, 5.79282985e+03, 5.80446496e+03, 5.81610590e+03, 5.82775267e+03
+, 5.83940526e+03, 5.85106367e+03, 5.86272788e+03, 5.87439790e+03
+, 5.88607372e+03, 5.89775534e+03, 5.90944274e+03, 5.92113592e+03
+, 5.93283488e+03, 5.94453961e+03, 5.95625010e+03, 5.96796635e+03
+, 5.97968835e+03, 5.99141611e+03, 6.00314960e+03, 6.01488883e+03
+, 6.02663379e+03, 6.03838448e+03, 6.05014088e+03, 6.06190300e+03
+, 6.07367083e+03, 6.08544436e+03, 6.09722359e+03, 6.10900851e+03
+, 6.12079911e+03, 6.13259540e+03, 6.14439736e+03, 6.15620499e+03
+, 6.16801829e+03, 6.17983725e+03, 6.19166185e+03, 6.20349211e+03
+, 6.21532801e+03, 6.22716955e+03, 6.23901672e+03, 6.25086952e+03
+, 6.26272794e+03, 6.27459197e+03, 6.28646161e+03, 6.29833687e+03
+, 6.31021772e+03, 6.32210416e+03, 6.33399620e+03, 6.34589382e+03
+, 6.35779702e+03, 6.36970579e+03, 6.38162013e+03, 6.39354004e+03
+, 6.40546550e+03, 6.41739652e+03, 6.42933308e+03, 6.44127519e+03
+, 6.45322284e+03, 6.46517601e+03, 6.47713472e+03, 6.48909895e+03
+, 6.50106869e+03, 6.51304395e+03, 6.52502471e+03, 6.53701098e+03
+, 6.54900274e+03, 6.56100000e+03, 6.57300274e+03, 6.58501097e+03
+, 6.59702467e+03, 6.60904384e+03, 6.62106848e+03, 6.63309859e+03
+, 6.64513415e+03, 6.65717516e+03, 6.66922162e+03, 6.68127352e+03
+, 6.69333086e+03, 6.70539363e+03, 6.71746183e+03, 6.72953545e+03
+, 6.74161449e+03, 6.75369894e+03, 6.76578880e+03, 6.77788406e+03
+, 6.78998472e+03, 6.80209078e+03, 6.81420222e+03, 6.82631905e+03
+, 6.83844126e+03, 6.85056884e+03, 6.86270179e+03, 6.87484011e+03
+, 6.88698379e+03, 6.89913282e+03, 6.91128720e+03, 6.92344693e+03
+, 6.93561201e+03, 6.94778241e+03, 6.95995815e+03, 6.97213922e+03
+, 6.98432561e+03, 6.99651732e+03, 7.00871434e+03, 7.02091667e+03
+, 7.03312431e+03, 7.04533724e+03, 7.05755547e+03, 7.06977899e+03
+, 7.08200780e+03, 7.09424188e+03, 7.10648125e+03, 7.11872588e+03
+, 7.13097578e+03, 7.14323095e+03, 7.15549138e+03, 7.16775706e+03
+, 7.18002798e+03, 7.19230416e+03, 7.20458557e+03, 7.21687222e+03
+, 7.22916411e+03, 7.24146122e+03, 7.25376355e+03, 7.26607110e+03
+, 7.27838386e+03, 7.29070184e+03, 7.30302502e+03, 7.31535340e+03
+, 7.32768697e+03, 7.34002574e+03, 7.35236970e+03, 7.36471884e+03
+, 7.37707316e+03, 7.38943265e+03, 7.40179731e+03, 7.41416714e+03
+, 7.42654213e+03, 7.43892228e+03, 7.45130758e+03, 7.46369803e+03
+, 7.47609363e+03, 7.48849436e+03, 7.50090023e+03, 7.51331123e+03
+, 7.52572736e+03, 7.53814862e+03, 7.55057499e+03, 7.56300648e+03
+, 7.57544307e+03, 7.58788478e+03, 7.60033158e+03, 7.61278349e+03
+, 7.62524048e+03, 7.63770257e+03, 7.65016975e+03, 7.66264200e+03
+, 7.67511933e+03, 7.68760174e+03, 7.70008921e+03, 7.71258175e+03
+, 7.72507935e+03, 7.73758200e+03, 7.75008971e+03, 7.76260247e+03
+, 7.77512027e+03, 7.78764311e+03, 7.80017099e+03, 7.81270390e+03
+, 7.82524184e+03, 7.83778480e+03, 7.85033279e+03, 7.86288579e+03
+, 7.87544380e+03, 7.88800682e+03, 7.90057484e+03, 7.91314787e+03
+, 7.92572589e+03, 7.93830890e+03, 7.95089690e+03, 7.96348989e+03
+, 7.97608785e+03, 7.98869079e+03, 8.00129871e+03, 8.01391159e+03
+, 8.02652944e+03, 8.03915225e+03, 8.05178002e+03, 8.06441274e+03
+, 8.07705040e+03, 8.08969302e+03, 8.10234057e+03, 8.11499306e+03
+, 8.12765049e+03, 8.14031285e+03, 8.15298013e+03, 8.16565233e+03
+, 8.17832946e+03, 8.19101149e+03, 8.20369844e+03, 8.21639030e+03
+, 8.22908705e+03, 8.24178871e+03, 8.25449526e+03, 8.26720671e+03
+, 8.27992304e+03, 8.29264426e+03, 8.30537036e+03, 8.31810133e+03
+, 8.33083718e+03, 8.34357790e+03, 8.35632348e+03, 8.36907392e+03
+, 8.38182923e+03, 8.39458939e+03, 8.40735439e+03, 8.42012425e+03
+, 8.43289895e+03, 8.44567849e+03, 8.45846286e+03, 8.47125207e+03
+, 8.48404611e+03, 8.49684497e+03, 8.50964865e+03, 8.52245715e+03
+, 8.53527047e+03, 8.54808859e+03, 8.56091153e+03, 8.57373926e+03
+, 8.58657180e+03, 8.59940913e+03, 8.61225126e+03, 8.62509817e+03
+, 8.63794987e+03, 8.65080636e+03, 8.66366762e+03, 8.67653365e+03
+, 8.68940446e+03, 8.70228004e+03, 8.71516038e+03, 8.72804548e+03
+, 8.74093533e+03, 8.75382995e+03, 8.76672931e+03, 8.77963342e+03
+, 8.79254227e+03, 8.80545586e+03, 8.81837419e+03, 8.83129725e+03
+, 8.84422504e+03, 8.85715755e+03, 8.87009479e+03, 8.88303675e+03
+, 8.89598342e+03, 8.90893481e+03, 8.92189090e+03, 8.93485170e+03
+, 8.94781720e+03, 8.96078740e+03, 8.97376230e+03, 8.98674188e+03
+, 8.99972616e+03, 9.01271512e+03, 9.02570876e+03, 9.03870708e+03
+, 9.05171007e+03, 9.06471774e+03, 9.07773007e+03, 9.09074707e+03
+, 9.10376873e+03, 9.11679505e+03, 9.12982602e+03, 9.14286165e+03
+, 9.15590192e+03, 9.16894683e+03, 9.18199639e+03, 9.19505059e+03
+, 9.20810942e+03, 9.22117289e+03, 9.23424098e+03, 9.24731369e+03
+, 9.26039103e+03, 9.27347299e+03, 9.28655956e+03, 9.29965075e+03
+, 9.31274654e+03, 9.32584694e+03, 9.33895194e+03, 9.35206154e+03
+, 9.36517573e+03, 9.37829452e+03, 9.39141790e+03, 9.40454586e+03
+, 9.41767841e+03, 9.43081554e+03, 9.44395724e+03, 9.45710352e+03
+, 9.47025437e+03, 9.48340978e+03, 9.49656976e+03, 9.50973430e+03
+, 9.52290339e+03, 9.53607704e+03, 9.54925524e+03, 9.56243800e+03
+, 9.57562529e+03, 9.58881713e+03, 9.60201350e+03, 9.61521441e+03
+, 9.62841986e+03, 9.64162983e+03, 9.65484433e+03, 9.66806335e+03
+, 9.68128690e+03, 9.69451496e+03, 9.70774753e+03, 9.72098461e+03
+, 9.73422621e+03, 9.74747230e+03, 9.76072290e+03, 9.77397800e+03
+, 9.78723759e+03, 9.80050168e+03, 9.81377025e+03, 9.82704331e+03
+, 9.84032086e+03, 9.85360288e+03, 9.86688938e+03, 9.88018036e+03
+, 9.89347581e+03, 9.90677573e+03, 9.92008011e+03, 9.93338895e+03
+, 9.94670225e+03, 9.96002001e+03, 9.97334223e+03, 9.98666889e+03
+, 1.00000000e+04, 1.00133356e+04, 1.00266756e+04, 1.00400200e+04
+, 1.00533689e+04, 1.00667222e+04, 1.00800799e+04, 1.00934421e+04
+, 1.01068086e+04, 1.01201796e+04, 1.01335551e+04, 1.01469349e+04
+, 1.01603192e+04, 1.01737078e+04, 1.01871009e+04, 1.02004983e+04
+, 1.02139002e+04, 1.02273065e+04, 1.02407171e+04, 1.02541322e+04
+, 1.02675516e+04, 1.02809755e+04, 1.02944037e+04, 1.03078363e+04
+, 1.03212732e+04, 1.03347146e+04, 1.03481603e+04, 1.03616104e+04
+, 1.03750648e+04, 1.03885237e+04, 1.04019868e+04, 1.04154544e+04
+, 1.04289263e+04, 1.04424025e+04, 1.04558831e+04, 1.04693680e+04
+, 1.04828573e+04, 1.04963509e+04, 1.05098489e+04, 1.05233512e+04
+, 1.05368578e+04, 1.05503688e+04, 1.05638840e+04, 1.05774036e+04
+, 1.05909276e+04, 1.06044558e+04, 1.06179884e+04, 1.06315253e+04
+, 1.06450665e+04, 1.06586119e+04, 1.06721617e+04, 1.06857158e+04
+, 1.06992743e+04, 1.07128369e+04, 1.07264039e+04, 1.07399752e+04
+, 1.07535508e+04, 1.07671307e+04, 1.07807148e+04, 1.07943032e+04
+, 1.08078959e+04, 1.08214929e+04, 1.08350941e+04, 1.08486997e+04
+, 1.08623094e+04, 1.08759235e+04, 1.08895418e+04, 1.09031644e+04
+, 1.09167912e+04, 1.09304223e+04, 1.09440576e+04, 1.09576972e+04
+, 1.09713410e+04, 1.09849891e+04, 1.09986414e+04, 1.10122979e+04
+, 1.10259587e+04, 1.10396237e+04, 1.10532930e+04, 1.10669664e+04
+, 1.10806441e+04, 1.10943261e+04, 1.11080122e+04, 1.11217025e+04
+, 1.11353971e+04, 1.11490959e+04, 1.11627989e+04, 1.11765061e+04
+, 1.11902175e+04, 1.12039331e+04, 1.12176529e+04, 1.12313769e+04
+, 1.12451051e+04, 1.12588375e+04, 1.12725740e+04, 1.12863148e+04
+, 1.13000597e+04, 1.13138088e+04, 1.13275621e+04, 1.13413196e+04
+, 1.13550813e+04, 1.13688471e+04, 1.13826171e+04, 1.13963912e+04
+, 1.14101695e+04, 1.14239520e+04, 1.14377387e+04, 1.14515295e+04
+, 1.14653244e+04, 1.14791235e+04, 1.14929267e+04, 1.15067341e+04
+, 1.15205457e+04, 1.15343613e+04, 1.15481811e+04, 1.15620051e+04
+, 1.15758332e+04, 1.15896654e+04, 1.16035017e+04, 1.16173422e+04
+, 1.16311868e+04, 1.16450355e+04, 1.16588883e+04, 1.16727453e+04
+, 1.16866063e+04, 1.17004715e+04, 1.17143408e+04, 1.17282142e+04
+, 1.17420917e+04, 1.17559733e+04, 1.17698589e+04, 1.17837487e+04
+, 1.17976426e+04, 1.18115406e+04, 1.18254426e+04, 1.18393488e+04
+, 1.18532590e+04, 1.18671733e+04, 1.18810917e+04, 1.18950142e+04
+, 1.19089408e+04, 1.19228714e+04, 1.19368061e+04, 1.19507448e+04
+, 1.19646877e+04, 1.19786346e+04, 1.19925855e+04, 1.20065405e+04
+, 1.20204996e+04, 1.20344627e+04, 1.20484299e+04, 1.20624011e+04
+, 1.20763763e+04, 1.20903557e+04, 1.21043390e+04, 1.21183264e+04
+, 1.21323178e+04, 1.21463133e+04, 1.21603128e+04, 1.21743163e+04
+, 1.21883239e+04, 1.22023354e+04, 1.22163510e+04, 1.22303707e+04
+, 1.22443943e+04, 1.22584220e+04, 1.22724537e+04, 1.22864893e+04
+, 1.23005290e+04, 1.23145727e+04, 1.23286204e+04, 1.23426722e+04
+, 1.23567279e+04, 1.23707876e+04, 1.23848513e+04, 1.23989190e+04
+, 1.24129907e+04, 1.24270664e+04, 1.24411460e+04, 1.24552297e+04
+, 1.24693173e+04, 1.24834089e+04, 1.24975045e+04, 1.25116041e+04
+, 1.25257076e+04, 1.25398151e+04, 1.25539266e+04, 1.25680421e+04
+, 1.25821615e+04, 1.25962848e+04, 1.26104122e+04, 1.26245435e+04
+, 1.26386787e+04, 1.26528179e+04, 1.26669611e+04, 1.26811082e+04
+, 1.26952592e+04, 1.27094142e+04, 1.27235731e+04, 1.27377360e+04
+, 1.27519028e+04, 1.27660736e+04, 1.27802483e+04, 1.27944269e+04
+, 1.28086094e+04, 1.28227959e+04, 1.28369863e+04, 1.28511806e+04
+, 1.28653788e+04, 1.28795810e+04, 1.28937871e+04, 1.29079971e+04
+, 1.29222109e+04, 1.29364288e+04, 1.29506505e+04, 1.29648761e+04
+, 1.29791056e+04, 1.29933390e+04, 1.30075764e+04, 1.30218176e+04
+, 1.30360627e+04, 1.30503117e+04, 1.30645646e+04, 1.30788214e+04
+, 1.30930821e+04, 1.31073466e+04, 1.31216151e+04, 1.31358874e+04
+, 1.31501636e+04, 1.31644437e+04, 1.31787276e+04, 1.31930154e+04
+, 1.32073071e+04, 1.32216027e+04, 1.32359021e+04, 1.32502054e+04
+, 1.32645125e+04, 1.32788235e+04, 1.32931384e+04, 1.33074571e+04
+, 1.33217797e+04, 1.33361061e+04, 1.33504364e+04, 1.33647705e+04
+, 1.33791084e+04, 1.33934502e+04, 1.34077959e+04, 1.34221454e+04
+, 1.34364987e+04, 1.34508558e+04, 1.34652168e+04, 1.34795816e+04
+, 1.34939503e+04, 1.35083227e+04, 1.35226990e+04, 1.35370791e+04
+, 1.35514631e+04, 1.35658508e+04, 1.35802424e+04, 1.35946378e+04
+, 1.36090370e+04, 1.36234400e+04, 1.36378468e+04, 1.36522574e+04
+, 1.36666718e+04, 1.36810900e+04, 1.36955120e+04, 1.37099379e+04
+, 1.37243675e+04, 1.37388009e+04, 1.37532381e+04, 1.37676791e+04
+, 1.37821239e+04, 1.37965724e+04, 1.38110248e+04, 1.38254809e+04
+, 1.38399408e+04, 1.38544045e+04, 1.38688720e+04, 1.38833432e+04
+, 1.38978182e+04, 1.39122970e+04, 1.39267795e+04, 1.39412658e+04
+, 1.39557559e+04, 1.39702498e+04, 1.39847474e+04, 1.39992487e+04
+, 1.40137538e+04, 1.40282627e+04, 1.40427753e+04, 1.40572917e+04
+, 1.40718118e+04, 1.40863357e+04, 1.41008633e+04, 1.41153946e+04
+, 1.41299297e+04, 1.41444686e+04, 1.41590111e+04, 1.41735574e+04
+, 1.41881075e+04, 1.42026613e+04, 1.42172187e+04, 1.42317800e+04
+, 1.42463449e+04, 1.42609136e+04, 1.42754860e+04, 1.42900621e+04
+, 1.43046420e+04, 1.43192255e+04, 1.43338128e+04, 1.43484038e+04
+, 1.43629984e+04, 1.43775968e+04, 1.43921989e+04, 1.44068048e+04
+, 1.44214143e+04, 1.44360275e+04, 1.44506444e+04, 1.44652650e+04
+, 1.44798893e+04, 1.44945173e+04, 1.45091490e+04, 1.45237844e+04
+, 1.45384234e+04, 1.45530662e+04, 1.45677126e+04, 1.45823627e+04
+, 1.45970165e+04, 1.46116740e+04, 1.46263352e+04, 1.46410000e+04
+, 1.46556685e+04, 1.46703407e+04, 1.46850165e+04, 1.46996960e+04
+, 1.47143792e+04, 1.47290660e+04, 1.47437566e+04, 1.47584507e+04
+, 1.47731485e+04, 1.47878500e+04, 1.48025551e+04, 1.48172639e+04
+, 1.48319764e+04, 1.48466925e+04, 1.48614122e+04, 1.48761356e+04
+, 1.48908626e+04, 1.49055933e+04, 1.49203276e+04, 1.49350655e+04
+, 1.49498071e+04, 1.49645523e+04, 1.49793012e+04, 1.49940536e+04
+, 1.50088098e+04, 1.50235695e+04, 1.50383329e+04, 1.50530998e+04
+, 1.50678705e+04, 1.50826447e+04, 1.50974225e+04, 1.51122040e+04
+, 1.51269891e+04, 1.51417778e+04, 1.51565701e+04, 1.51713660e+04
+, 1.51861655e+04, 1.52009687e+04, 1.52157754e+04, 1.52305858e+04
+, 1.52453997e+04, 1.52602172e+04, 1.52750384e+04, 1.52898631e+04
+, 1.53046915e+04, 1.53195234e+04, 1.53343589e+04, 1.53491980e+04
+, 1.53640407e+04, 1.53788870e+04, 1.53937368e+04, 1.54085903e+04
+, 1.54234473e+04, 1.54383079e+04, 1.54531721e+04, 1.54680398e+04
+, 1.54829111e+04, 1.54977860e+04, 1.55126645e+04, 1.55275466e+04
+, 1.55424322e+04, 1.55573213e+04, 1.55722141e+04, 1.55871104e+04
+, 1.56020102e+04, 1.56169136e+04, 1.56318206e+04, 1.56467311e+04
+, 1.56616452e+04, 1.56765628e+04, 1.56914840e+04, 1.57064087e+04
+, 1.57213370e+04, 1.57362688e+04, 1.57512042e+04, 1.57661431e+04
+, 1.57810855e+04, 1.57960315e+04, 1.58109810e+04, 1.58259341e+04
+, 1.58408906e+04, 1.58558507e+04, 1.58708144e+04, 1.58857816e+04
+, 1.59007523e+04, 1.59157265e+04, 1.59307042e+04, 1.59456855e+04
+, 1.59606703e+04, 1.59756586e+04, 1.59906504e+04, 1.60056457e+04
+, 1.60206446e+04, 1.60356469e+04, 1.60506528e+04, 1.60656622e+04
+, 1.60806751e+04, 1.60956915e+04, 1.61107114e+04, 1.61257347e+04
+, 1.61407616e+04, 1.61557920e+04, 1.61708259e+04, 1.61858633e+04
+, 1.62009042e+04, 1.62159485e+04, 1.62309964e+04, 1.62460477e+04
+, 1.62611026e+04, 1.62761609e+04, 1.62912227e+04, 1.63062880e+04
+, 1.63213568e+04, 1.63364290e+04, 1.63515047e+04, 1.63665839e+04
+, 1.63816666e+04, 1.63967527e+04, 1.64118423e+04, 1.64269354e+04
+, 1.64420320e+04, 1.64571320e+04, 1.64722355e+04, 1.64873424e+04
+, 1.65024528e+04, 1.65175667e+04, 1.65326840e+04, 1.65478048e+04
+, 1.65629290e+04, 1.65780567e+04, 1.65931879e+04, 1.66083225e+04
+, 1.66234605e+04, 1.66386020e+04, 1.66537469e+04, 1.66688953e+04
+, 1.66840471e+04, 1.66992024e+04, 1.67143611e+04, 1.67295232e+04
+, 1.67446888e+04, 1.67598578e+04, 1.67750302e+04, 1.67902061e+04
+, 1.68053854e+04, 1.68205681e+04, 1.68357543e+04, 1.68509439e+04
+, 1.68661369e+04, 1.68813333e+04, 1.68965332e+04, 1.69117364e+04
+, 1.69269431e+04, 1.69421532e+04, 1.69573667e+04, 1.69725837e+04
+, 1.69878040e+04, 1.70030278e+04, 1.70182549e+04, 1.70334855e+04
+, 1.70487195e+04, 1.70639568e+04, 1.70791976e+04, 1.70944418e+04
+, 1.71096894e+04, 1.71249403e+04, 1.71401947e+04, 1.71554525e+04
+, 1.71707136e+04, 1.71859782e+04, 1.72012461e+04, 1.72165175e+04
+, 1.72317922e+04, 1.72470703e+04, 1.72623518e+04, 1.72776366e+04
+, 1.72929249e+04, 1.73082165e+04, 1.73235115e+04, 1.73388099e+04
+, 1.73541117e+04, 1.73694168e+04, 1.73847253e+04, 1.74000372e+04
+, 1.74153525e+04, 1.74306711e+04, 1.74459931e+04, 1.74613184e+04
+, 1.74766471e+04, 1.74919792e+04, 1.75073146e+04, 1.75226534e+04
+, 1.75379956e+04, 1.75533411e+04, 1.75686899e+04, 1.75840421e+04
+, 1.75993977e+04, 1.76147566e+04, 1.76301189e+04, 1.76454845e+04
+, 1.76608535e+04, 1.76762258e+04, 1.76916014e+04, 1.77069804e+04
+, 1.77223627e+04, 1.77377484e+04, 1.77531374e+04, 1.77685297e+04
+, 1.77839254e+04, 1.77993244e+04, 1.78147267e+04, 1.78301324e+04
+, 1.78455414e+04, 1.78609537e+04, 1.78763694e+04, 1.78917883e+04
+, 1.79072106e+04, 1.79226362e+04, 1.79380652e+04, 1.79534974e+04
+, 1.79689330e+04, 1.79843719e+04, 1.79998141e+04, 1.80152596e+04
+, 1.80307084e+04, 1.80461605e+04, 1.80616160e+04, 1.80770747e+04
+, 1.80925368e+04, 1.81080022e+04, 1.81234708e+04, 1.81389428e+04
+, 1.81544180e+04, 1.81698966e+04, 1.81853785e+04, 1.82008636e+04
+, 1.82163521e+04, 1.82318438e+04, 1.82473388e+04, 1.82628372e+04
+, 1.82783388e+04, 1.82938437e+04, 1.83093519e+04, 1.83248633e+04
+, 1.83403781e+04, 1.83558961e+04, 1.83714174e+04, 1.83869420e+04
+, 1.84024699e+04, 1.84180010e+04, 1.84335355e+04, 1.84490732e+04
+, 1.84646141e+04, 1.84801584e+04, 1.84957059e+04, 1.85112567e+04
+, 1.85268107e+04, 1.85423680e+04, 1.85579286e+04, 1.85734924e+04
+, 1.85890595e+04, 1.86046299e+04, 1.86202035e+04, 1.86357804e+04
+, 1.86513605e+04, 1.86669439e+04, 1.86825305e+04, 1.86981204e+04
+, 1.87137135e+04, 1.87293099e+04, 1.87449095e+04, 1.87605124e+04
+, 1.87761185e+04, 1.87917279e+04, 1.88073405e+04, 1.88229564e+04
+, 1.88385755e+04, 1.88541978e+04, 1.88698234e+04, 1.88854522e+04
+, 1.89010842e+04, 1.89167195e+04, 1.89323580e+04, 1.89479997e+04
+, 1.89636446e+04, 1.89792928e+04, 1.89949442e+04, 1.90105989e+04
+, 1.90262567e+04, 1.90419178e+04, 1.90575821e+04, 1.90732496e+04
+, 1.90889204e+04, 1.91045943e+04, 1.91202715e+04, 1.91359519e+04
+, 1.91516355e+04, 1.91673223e+04, 1.91830123e+04, 1.91987056e+04
+, 1.92144020e+04, 1.92301016e+04, 1.92458045e+04, 1.92615105e+04
+, 1.92772198e+04, 1.92929323e+04, 1.93086479e+04, 1.93243668e+04
+, 1.93400888e+04, 1.93558141e+04, 1.93715425e+04, 1.93872741e+04
+, 1.94030090e+04, 1.94187470e+04, 1.94344882e+04, 1.94502326e+04
+, 1.94659802e+04, 1.94817309e+04, 1.94974849e+04, 1.95132420e+04
+, 1.95290023e+04, 1.95447658e+04, 1.95605325e+04, 1.95763024e+04
+, 1.95920754e+04, 1.96078516e+04, 1.96236310e+04, 1.96394135e+04
+, 1.96551992e+04, 1.96709881e+04, 1.96867802e+04, 1.97025754e+04
+, 1.97183738e+04, 1.97341754e+04, 1.97499801e+04, 1.97657880e+04
+, 1.97815991e+04, 1.97974133e+04, 1.98132306e+04, 1.98290512e+04
+, 1.98448748e+04, 1.98607017e+04, 1.98765317e+04, 1.98923648e+04
+, 1.99082011e+04, 1.99240405e+04, 1.99398831e+04, 1.99557289e+04
+, 1.99715778e+04, 1.99874298e+04, 2.00032850e+04, 2.00191433e+04
+, 2.00350047e+04, 2.00508693e+04, 2.00667371e+04, 2.00826080e+04
+, 2.00984820e+04, 2.01143591e+04, 2.01302394e+04, 2.01461228e+04
+, 2.01620093e+04, 2.01778990e+04, 2.01937918e+04, 2.02096877e+04
+, 2.02255868e+04, 2.02414890e+04, 2.02573943e+04, 2.02733027e+04
+, 2.02892143e+04, 2.03051289e+04, 2.03210467e+04, 2.03369676e+04
+, 2.03528916e+04, 2.03688188e+04, 2.03847490e+04, 2.04006824e+04
+, 2.04166189e+04, 2.04325585e+04, 2.04485012e+04, 2.04644470e+04
+, 2.04803959e+04, 2.04963479e+04, 2.05123030e+04, 2.05282612e+04
+, 2.05442226e+04, 2.05601870e+04, 2.05761545e+04, 2.05921251e+04
+, 2.06080989e+04, 2.06240757e+04, 2.06400556e+04, 2.06560386e+04
+, 2.06720247e+04, 2.06880139e+04, 2.07040062e+04, 2.07200015e+04
+, 2.07360000e+04, 2.07520015e+04, 2.07680062e+04, 2.07840139e+04
+, 2.08000247e+04, 2.08160386e+04, 2.08320555e+04, 2.08480755e+04
+, 2.08640987e+04, 2.08801249e+04, 2.08961541e+04, 2.09121865e+04
+, 2.09282219e+04, 2.09442604e+04, 2.09603019e+04, 2.09763466e+04
+, 2.09923943e+04, 2.10084450e+04, 2.10244988e+04, 2.10405557e+04
+, 2.10566157e+04, 2.10726787e+04, 2.10887448e+04, 2.11048140e+04
+, 2.11208862e+04, 2.11369614e+04, 2.11530397e+04, 2.11691211e+04
+, 2.11852055e+04, 2.12012930e+04, 2.12173836e+04, 2.12334772e+04
+, 2.12495738e+04, 2.12656735e+04, 2.12817762e+04, 2.12978820e+04
+, 2.13139908e+04, 2.13301027e+04, 2.13462176e+04, 2.13623356e+04
+, 2.13784566e+04, 2.13945806e+04, 2.14107077e+04, 2.14268378e+04
+, 2.14429709e+04, 2.14591071e+04, 2.14752463e+04, 2.14913886e+04
+, 2.15075339e+04, 2.15236822e+04, 2.15398335e+04, 2.15559879e+04
+, 2.15721453e+04, 2.15883057e+04, 2.16044692e+04, 2.16206356e+04
+, 2.16368051e+04, 2.16529776e+04, 2.16691532e+04, 2.16853317e+04
+, 2.17015133e+04, 2.17176979e+04, 2.17338855e+04, 2.17500761e+04
+, 2.17662698e+04, 2.17824664e+04, 2.17986661e+04, 2.18148687e+04
+, 2.18310744e+04, 2.18472831e+04, 2.18634948e+04, 2.18797095e+04
+, 2.18959272e+04, 2.19121479e+04, 2.19283716e+04, 2.19445983e+04
+, 2.19608280e+04, 2.19770607e+04, 2.19932964e+04, 2.20095351e+04
+, 2.20257768e+04, 2.20420215e+04, 2.20582692e+04, 2.20745199e+04
+, 2.20907736e+04, 2.21070302e+04, 2.21232899e+04, 2.21395525e+04
+, 2.21558182e+04, 2.21720868e+04, 2.21883584e+04, 2.22046330e+04
+, 2.22209105e+04, 2.22371911e+04, 2.22534746e+04, 2.22697611e+04
+, 2.22860506e+04, 2.23023430e+04, 2.23186385e+04, 2.23349369e+04
+, 2.23512383e+04, 2.23675426e+04, 2.23838500e+04, 2.24001603e+04
+, 2.24164735e+04, 2.24327898e+04, 2.24491090e+04, 2.24654312e+04
+, 2.24817563e+04, 2.24980844e+04, 2.25144155e+04, 2.25307495e+04
+, 2.25470865e+04, 2.25634264e+04, 2.25797693e+04, 2.25961152e+04
+, 2.26124640e+04, 2.26288158e+04, 2.26451705e+04, 2.26615282e+04
+, 2.26778889e+04, 2.26942524e+04, 2.27106190e+04, 2.27269885e+04
+, 2.27433609e+04, 2.27597363e+04, 2.27761146e+04, 2.27924959e+04
+, 2.28088801e+04, 2.28252673e+04, 2.28416574e+04, 2.28580504e+04
+, 2.28744464e+04, 2.28908453e+04, 2.29072472e+04, 2.29236520e+04
+, 2.29400597e+04, 2.29564704e+04, 2.29728840e+04, 2.29893005e+04
+, 2.30057200e+04, 2.30221424e+04, 2.30385677e+04, 2.30549959e+04
+, 2.30714271e+04, 2.30878612e+04, 2.31042982e+04, 2.31207382e+04
+, 2.31371811e+04, 2.31536269e+04, 2.31700756e+04, 2.31865272e+04
+, 2.32029818e+04, 2.32194393e+04, 2.32358996e+04, 2.32523630e+04
+, 2.32688292e+04, 2.32852983e+04, 2.33017704e+04, 2.33182453e+04
+, 2.33347232e+04, 2.33512040e+04, 2.33676876e+04, 2.33841742e+04
+, 2.34006637e+04, 2.34171562e+04, 2.34336515e+04, 2.34501497e+04
+, 2.34666508e+04, 2.34831548e+04, 2.34996617e+04, 2.35161715e+04
+, 2.35326843e+04, 2.35491999e+04, 2.35657184e+04, 2.35822398e+04
+, 2.35987641e+04, 2.36152913e+04, 2.36318214e+04, 2.36483543e+04
+, 2.36648902e+04, 2.36814290e+04, 2.36979706e+04, 2.37145151e+04
+, 2.37310625e+04, 2.37476128e+04, 2.37641660e+04, 2.37807221e+04
+, 2.37972810e+04, 2.38138429e+04, 2.38304076e+04, 2.38469752e+04
+, 2.38635456e+04, 2.38801190e+04, 2.38966952e+04, 2.39132743e+04
+, 2.39298563e+04, 2.39464411e+04, 2.39630288e+04, 2.39796194e+04
+, 2.39962129e+04, 2.40128092e+04, 2.40294084e+04, 2.40460105e+04
+, 2.40626154e+04, 2.40792232e+04, 2.40958338e+04, 2.41124474e+04
+, 2.41290637e+04, 2.41456830e+04, 2.41623051e+04, 2.41789300e+04
+, 2.41955579e+04, 2.42121885e+04, 2.42288221e+04, 2.42454585e+04
+, 2.42620977e+04, 2.42787398e+04, 2.42953848e+04, 2.43120326e+04
+, 2.43286832e+04, 2.43453367e+04, 2.43619931e+04, 2.43786523e+04
+, 2.43953143e+04, 2.44119792e+04, 2.44286469e+04, 2.44453175e+04
+, 2.44619909e+04, 2.44786672e+04, 2.44953463e+04, 2.45120282e+04
+, 2.45287130e+04, 2.45454006e+04, 2.45620911e+04, 2.45787844e+04
+, 2.45954805e+04, 2.46121795e+04, 2.46288812e+04, 2.46455859e+04
+, 2.46622933e+04, 2.46790036e+04, 2.46957167e+04, 2.47124327e+04
+, 2.47291514e+04, 2.47458730e+04, 2.47625975e+04, 2.47793247e+04
+, 2.47960548e+04, 2.48127877e+04, 2.48295234e+04, 2.48462619e+04
+, 2.48630033e+04, 2.48797474e+04, 2.48964944e+04, 2.49132442e+04
+, 2.49299969e+04, 2.49467523e+04, 2.49635105e+04, 2.49802716e+04
+, 2.49970355e+04, 2.50138022e+04, 2.50305717e+04, 2.50473440e+04
+, 2.50641191e+04, 2.50808970e+04, 2.50976777e+04, 2.51144613e+04
+, 2.51312476e+04, 2.51480368e+04, 2.51648287e+04, 2.51816235e+04
+, 2.51984210e+04, 2.52152213e+04, 2.52320245e+04, 2.52488304e+04
+, 2.52656392e+04, 2.52824507e+04, 2.52992650e+04, 2.53160822e+04
+, 2.53329021e+04, 2.53497248e+04, 2.53665503e+04, 2.53833786e+04
+, 2.54002097e+04, 2.54170436e+04, 2.54338802e+04, 2.54507197e+04
+, 2.54675619e+04, 2.54844069e+04, 2.55012547e+04, 2.55181053e+04
+, 2.55349587e+04, 2.55518148e+04, 2.55686737e+04, 2.55855355e+04
+, 2.56023999e+04, 2.56192672e+04, 2.56361373e+04, 2.56530101e+04
+, 2.56698857e+04, 2.56867640e+04, 2.57036452e+04, 2.57205291e+04
+, 2.57374158e+04, 2.57543052e+04, 2.57711974e+04, 2.57880924e+04
+, 2.58049902e+04, 2.58218907e+04, 2.58387940e+04, 2.58557001e+04
+, 2.58726089e+04, 2.58895205e+04, 2.59064348e+04, 2.59233519e+04
+, 2.59402718e+04, 2.59571944e+04, 2.59741198e+04, 2.59910479e+04
+, 2.60079788e+04, 2.60249125e+04, 2.60418489e+04, 2.60587881e+04
+, 2.60757300e+04, 2.60926747e+04, 2.61096221e+04, 2.61265722e+04
+, 2.61435252e+04, 2.61604808e+04, 2.61774393e+04, 2.61944004e+04
+, 2.62113643e+04, 2.62283310e+04, 2.62453004e+04, 2.62622725e+04
+, 2.62792474e+04, 2.62962251e+04, 2.63132054e+04, 2.63301885e+04
+, 2.63471744e+04, 2.63641630e+04, 2.63811543e+04, 2.63981484e+04
+, 2.64151451e+04, 2.64321447e+04, 2.64491469e+04, 2.64661519e+04
+, 2.64831597e+04, 2.65001701e+04, 2.65171833e+04, 2.65341992e+04
+, 2.65512179e+04, 2.65682393e+04, 2.65852634e+04, 2.66022902e+04
+, 2.66193197e+04, 2.66363520e+04, 2.66533870e+04, 2.66704247e+04
+, 2.66874652e+04, 2.67045083e+04, 2.67215542e+04, 2.67386028e+04
+, 2.67556542e+04, 2.67727082e+04, 2.67897649e+04, 2.68068244e+04
+, 2.68238866e+04, 2.68409515e+04, 2.68580191e+04, 2.68750894e+04
+, 2.68921625e+04, 2.69092382e+04, 2.69263167e+04, 2.69433978e+04
+, 2.69604817e+04, 2.69775683e+04, 2.69946576e+04, 2.70117495e+04
+, 2.70288442e+04, 2.70459416e+04, 2.70630417e+04, 2.70801445e+04
+, 2.70972500e+04, 2.71143582e+04, 2.71314691e+04, 2.71485827e+04
+, 2.71656990e+04, 2.71828180e+04, 2.71999397e+04, 2.72170641e+04
+, 2.72341911e+04, 2.72513209e+04, 2.72684534e+04, 2.72855885e+04
+, 2.73027264e+04, 2.73198669e+04, 2.73370101e+04, 2.73541560e+04
+, 2.73713046e+04, 2.73884559e+04, 2.74056099e+04, 2.74227665e+04
+, 2.74399259e+04, 2.74570879e+04, 2.74742526e+04, 2.74914200e+04
+, 2.75085900e+04, 2.75257628e+04, 2.75429382e+04, 2.75601163e+04
+, 2.75772971e+04, 2.75944805e+04, 2.76116667e+04, 2.76288555e+04
+, 2.76460470e+04, 2.76632411e+04, 2.76804379e+04, 2.76976374e+04
+, 2.77148396e+04, 2.77320444e+04, 2.77492519e+04, 2.77664621e+04
+, 2.77836749e+04, 2.78008905e+04, 2.78181086e+04, 2.78353295e+04
+, 2.78525530e+04, 2.78697791e+04, 2.78870079e+04, 2.79042394e+04
+, 2.79214736e+04, 2.79387104e+04, 2.79559499e+04, 2.79731920e+04
+, 2.79904368e+04, 2.80076842e+04, 2.80249343e+04, 2.80421870e+04
+, 2.80594424e+04, 2.80767005e+04, 2.80939612e+04, 2.81112246e+04
+, 2.81284906e+04, 2.81457592e+04, 2.81630306e+04, 2.81803045e+04
+, 2.81975811e+04, 2.82148604e+04, 2.82321423e+04, 2.82494268e+04
+, 2.82667140e+04, 2.82840038e+04, 2.83012963e+04, 2.83185914e+04
+, 2.83358892e+04, 2.83531896e+04, 2.83704926e+04, 2.83877983e+04
+, 2.84051066e+04, 2.84224176e+04, 2.84397311e+04, 2.84570474e+04
+, 2.84743662e+04, 2.84916877e+04, 2.85090118e+04, 2.85263386e+04
+, 2.85436680e+04, 2.85610000e+04, 2.85783346e+04, 2.85956719e+04
+, 2.86130118e+04, 2.86303544e+04, 2.86476995e+04, 2.86650473e+04
+, 2.86823977e+04, 2.86997508e+04, 2.87171064e+04, 2.87344647e+04
+, 2.87518256e+04, 2.87691891e+04, 2.87865553e+04, 2.88039240e+04
+, 2.88212954e+04, 2.88386694e+04, 2.88560460e+04, 2.88734253e+04
+, 2.88908071e+04, 2.89081916e+04, 2.89255787e+04, 2.89429683e+04
+, 2.89603607e+04, 2.89777556e+04, 2.89951531e+04, 2.90125532e+04
+, 2.90299560e+04, 2.90473613e+04, 2.90647693e+04, 2.90821799e+04
+, 2.90995930e+04, 2.91170088e+04, 2.91344272e+04, 2.91518482e+04
+, 2.91692718e+04, 2.91866980e+04, 2.92041268e+04, 2.92215582e+04
+, 2.92389922e+04, 2.92564288e+04, 2.92738680e+04, 2.92913098e+04
+, 2.93087541e+04, 2.93262011e+04, 2.93436507e+04, 2.93611029e+04
+, 2.93785576e+04, 2.93960150e+04, 2.94134750e+04, 2.94309375e+04
+, 2.94484026e+04, 2.94658704e+04, 2.94833407e+04, 2.95008136e+04
+, 2.95182891e+04, 2.95357672e+04, 2.95532478e+04, 2.95707311e+04
+, 2.95882169e+04, 2.96057053e+04, 2.96231963e+04, 2.96406899e+04
+, 2.96581861e+04, 2.96756848e+04, 2.96931861e+04, 2.97106900e+04
+, 2.97281965e+04, 2.97457056e+04, 2.97632172e+04, 2.97807314e+04
+, 2.97982482e+04, 2.98157676e+04, 2.98332895e+04, 2.98508140e+04
+, 2.98683411e+04, 2.98858708e+04, 2.99034030e+04, 2.99209378e+04
+, 2.99384752e+04, 2.99560151e+04, 2.99735576e+04, 2.99911027e+04
+, 3.00086503e+04, 3.00262005e+04, 3.00437533e+04, 3.00613086e+04
+, 3.00788665e+04, 3.00964270e+04, 3.01139900e+04, 3.01315555e+04
+, 3.01491237e+04, 3.01666944e+04, 3.01842676e+04, 3.02018435e+04
+, 3.02194218e+04, 3.02370028e+04, 3.02545863e+04, 3.02721723e+04
+, 3.02897609e+04, 3.03073520e+04, 3.03249457e+04, 3.03425420e+04
+, 3.03601408e+04, 3.03777422e+04, 3.03953461e+04, 3.04129525e+04
+, 3.04305615e+04, 3.04481731e+04, 3.04657872e+04, 3.04834038e+04
+, 3.05010230e+04, 3.05186448e+04, 3.05362690e+04, 3.05538959e+04
+, 3.05715252e+04, 3.05891571e+04, 3.06067916e+04, 3.06244286e+04
+, 3.06420681e+04, 3.06597102e+04, 3.06773548e+04, 3.06950019e+04
+, 3.07126516e+04, 3.07303038e+04, 3.07479586e+04, 3.07656159e+04
+, 3.07832757e+04, 3.08009380e+04, 3.08186029e+04, 3.08362703e+04
+, 3.08539403e+04, 3.08716128e+04, 3.08892878e+04, 3.09069653e+04
+, 3.09246454e+04, 3.09423280e+04, 3.09600131e+04, 3.09777007e+04
+, 3.09953909e+04, 3.10130836e+04, 3.10307788e+04, 3.10484766e+04
+, 3.10661768e+04, 3.10838796e+04, 3.11015849e+04, 3.11192927e+04
+, 3.11370031e+04, 3.11547160e+04, 3.11724313e+04, 3.11901492e+04
+, 3.12078697e+04, 3.12255926e+04, 3.12433180e+04, 3.12610460e+04
+, 3.12787765e+04, 3.12965095e+04, 3.13142450e+04, 3.13319830e+04
+, 3.13497235e+04, 3.13674665e+04, 3.13852121e+04, 3.14029601e+04
+, 3.14207107e+04, 3.14384638e+04, 3.14562193e+04, 3.14739774e+04
+, 3.14917380e+04, 3.15095011e+04, 3.15272667e+04, 3.15450348e+04
+, 3.15628054e+04, 3.15805785e+04, 3.15983541e+04, 3.16161322e+04
+, 3.16339128e+04, 3.16516959e+04, 3.16694815e+04, 3.16872696e+04
+, 3.17050602e+04, 3.17228533e+04, 3.17406488e+04, 3.17584469e+04
+, 3.17762475e+04, 3.17940506e+04, 3.18118561e+04, 3.18296642e+04
+, 3.18474747e+04, 3.18652877e+04, 3.18831033e+04, 3.19009213e+04
+, 3.19187418e+04, 3.19365648e+04, 3.19543902e+04, 3.19722182e+04
+, 3.19900486e+04, 3.20078816e+04, 3.20257170e+04, 3.20435549e+04
+, 3.20613953e+04, 3.20792381e+04, 3.20970835e+04, 3.21149313e+04
+, 3.21327816e+04, 3.21506344e+04, 3.21684897e+04, 3.21863474e+04
+, 3.22042076e+04, 3.22220703e+04, 3.22399355e+04, 3.22578031e+04
+, 3.22756732e+04, 3.22935458e+04, 3.23114209e+04, 3.23292985e+04
+, 3.23471785e+04, 3.23650609e+04, 3.23829459e+04, 3.24008333e+04
+, 3.24187232e+04, 3.24366156e+04, 3.24545104e+04, 3.24724077e+04
+, 3.24903075e+04, 3.25082097e+04, 3.25261144e+04, 3.25440216e+04
+, 3.25619312e+04, 3.25798433e+04, 3.25977578e+04, 3.26156748e+04
+, 3.26335943e+04, 3.26515162e+04, 3.26694406e+04, 3.26873675e+04
+, 3.27052968e+04, 3.27232285e+04, 3.27411627e+04, 3.27590994e+04
+, 3.27770386e+04, 3.27949801e+04, 3.28129242e+04, 3.28308707e+04
+, 3.28488196e+04, 3.28667710e+04, 3.28847249e+04, 3.29026812e+04
+, 3.29206399e+04, 3.29386011e+04, 3.29565648e+04, 3.29745309e+04
+, 3.29924994e+04, 3.30104704e+04, 3.30284439e+04, 3.30464198e+04
+, 3.30643981e+04, 3.30823789e+04, 3.31003621e+04, 3.31183477e+04
+, 3.31363358e+04, 3.31543264e+04, 3.31723194e+04, 3.31903148e+04
+, 3.32083127e+04, 3.32263130e+04, 3.32443157e+04, 3.32623209e+04
+, 3.32803285e+04, 3.32983386e+04, 3.33163511e+04, 3.33343660e+04
+, 3.33523833e+04, 3.33704031e+04, 3.33884254e+04, 3.34064500e+04
+, 3.34244771e+04, 3.34425066e+04, 3.34605386e+04, 3.34785730e+04
+, 3.34966098e+04, 3.35146490e+04, 3.35326907e+04, 3.35507348e+04
+, 3.35687813e+04, 3.35868302e+04, 3.36048816e+04, 3.36229354e+04
+, 3.36409916e+04, 3.36590503e+04, 3.36771113e+04, 3.36951748e+04
+, 3.37132407e+04, 3.37313090e+04, 3.37493798e+04, 3.37674529e+04
+, 3.37855285e+04, 3.38036065e+04, 3.38216870e+04, 3.38397698e+04
+, 3.38578550e+04, 3.38759427e+04, 3.38940328e+04, 3.39121253e+04
+, 3.39302202e+04, 3.39483175e+04, 3.39664173e+04, 3.39845194e+04
+, 3.40026240e+04, 3.40207309e+04, 3.40388403e+04, 3.40569521e+04
+, 3.40750663e+04, 3.40931829e+04, 3.41113019e+04, 3.41294233e+04
+, 3.41475472e+04, 3.41656734e+04, 3.41838020e+04, 3.42019330e+04
+, 3.42200665e+04, 3.42382023e+04, 3.42563406e+04, 3.42744812e+04
+, 3.42926243e+04, 3.43107697e+04, 3.43289176e+04, 3.43470678e+04
+, 3.43652204e+04, 3.43833755e+04, 3.44015329e+04, 3.44196927e+04
+, 3.44378550e+04, 3.44560196e+04, 3.44741866e+04, 3.44923560e+04
+, 3.45105278e+04, 3.45287020e+04, 3.45468786e+04, 3.45650576e+04
+, 3.45832390e+04, 3.46014227e+04, 3.46196089e+04, 3.46377974e+04
+, 3.46559883e+04, 3.46741817e+04, 3.46923774e+04, 3.47105754e+04
+, 3.47287759e+04, 3.47469788e+04, 3.47651840e+04, 3.47833916e+04
+, 3.48016016e+04, 3.48198140e+04, 3.48380288e+04, 3.48562460e+04
+, 3.48744655e+04, 3.48926874e+04, 3.49109117e+04, 3.49291384e+04
+, 3.49473674e+04, 3.49655988e+04, 3.49838327e+04, 3.50020688e+04
+, 3.50203074e+04, 3.50385483e+04, 3.50567916e+04, 3.50750373e+04
+, 3.50932854e+04, 3.51115358e+04, 3.51297886e+04, 3.51480437e+04
+, 3.51663013e+04, 3.51845612e+04, 3.52028235e+04, 3.52210881e+04
+, 3.52393551e+04, 3.52576245e+04, 3.52758963e+04, 3.52941704e+04
+, 3.53124469e+04, 3.53307257e+04, 3.53490069e+04, 3.53672905e+04
+, 3.53855764e+04, 3.54038647e+04, 3.54221554e+04, 3.54404484e+04
+, 3.54587438e+04, 3.54770415e+04, 3.54953417e+04, 3.55136441e+04
+, 3.55319489e+04, 3.55502561e+04, 3.55685657e+04, 3.55868776e+04
+, 3.56051918e+04, 3.56235084e+04, 3.56418274e+04, 3.56601487e+04
+, 3.56784723e+04, 3.56967984e+04, 3.57151267e+04, 3.57334575e+04
+, 3.57517905e+04, 3.57701260e+04, 3.57884637e+04, 3.58068039e+04
+, 3.58251463e+04, 3.58434912e+04, 3.58618383e+04, 3.58801879e+04
+, 3.58985397e+04, 3.59168939e+04, 3.59352505e+04, 3.59536094e+04
+, 3.59719706e+04, 3.59903342e+04, 3.60087001e+04, 3.60270684e+04
+, 3.60454390e+04, 3.60638120e+04, 3.60821873e+04, 3.61005649e+04
+, 3.61189449e+04, 3.61373272e+04, 3.61557118e+04, 3.61740988e+04
+, 3.61924882e+04, 3.62108798e+04, 3.62292738e+04, 3.62476701e+04
+, 3.62660688e+04, 3.62844698e+04, 3.63028731e+04, 3.63212788e+04
+, 3.63396868e+04, 3.63580971e+04, 3.63765098e+04, 3.63949248e+04
+, 3.64133421e+04, 3.64317617e+04, 3.64501837e+04, 3.64686080e+04
+, 3.64870347e+04, 3.65054636e+04, 3.65238949e+04, 3.65423285e+04
+, 3.65607644e+04, 3.65792027e+04, 3.65976433e+04, 3.66160862e+04
+, 3.66345314e+04, 3.66529790e+04, 3.66714288e+04, 3.66898810e+04
+, 3.67083356e+04, 3.67267924e+04, 3.67452515e+04, 3.67637130e+04
+, 3.67821768e+04, 3.68006429e+04, 3.68191113e+04, 3.68375821e+04
+, 3.68560551e+04, 3.68745305e+04, 3.68930082e+04, 3.69114882e+04
+, 3.69299705e+04, 3.69484551e+04, 3.69669421e+04, 3.69854313e+04
+, 3.70039229e+04, 3.70224167e+04, 3.70409129e+04, 3.70594114e+04
+, 3.70779122e+04, 3.70964153e+04, 3.71149207e+04, 3.71334284e+04
+, 3.71519385e+04, 3.71704508e+04, 3.71889654e+04, 3.72074824e+04
+, 3.72260016e+04, 3.72445232e+04, 3.72630470e+04, 3.72815732e+04
+, 3.73001016e+04, 3.73186324e+04, 3.73371655e+04, 3.73557008e+04
+, 3.73742385e+04, 3.73927784e+04, 3.74113207e+04, 3.74298653e+04
+, 3.74484121e+04, 3.74669613e+04, 3.74855127e+04, 3.75040664e+04
+, 3.75226225e+04, 3.75411808e+04, 3.75597414e+04, 3.75783043e+04
+, 3.75968696e+04, 3.76154371e+04, 3.76340068e+04, 3.76525789e+04
+, 3.76711533e+04, 3.76897300e+04, 3.77083089e+04, 3.77268902e+04
+, 3.77454737e+04, 3.77640595e+04, 3.77826476e+04, 3.78012380e+04
+, 3.78198307e+04, 3.78384257e+04, 3.78570229e+04, 3.78756224e+04
+, 3.78942242e+04, 3.79128283e+04, 3.79314347e+04, 3.79500434e+04
+, 3.79686543e+04, 3.79872676e+04, 3.80058831e+04, 3.80245009e+04
+, 3.80431209e+04, 3.80617433e+04, 3.80803679e+04, 3.80989948e+04
+, 3.81176240e+04, 3.81362554e+04, 3.81548891e+04, 3.81735251e+04
+, 3.81921634e+04, 3.82108040e+04, 3.82294468e+04, 3.82480919e+04
+, 3.82667393e+04, 3.82853889e+04, 3.83040408e+04, 3.83226950e+04
+, 3.83413515e+04, 3.83600102e+04, 3.83786712e+04, 3.83973345e+04
+, 3.84160000e+04, 3.84346678e+04, 3.84533379e+04, 3.84720102e+04
+, 3.84906848e+04, 3.85093617e+04, 3.85280408e+04, 3.85467222e+04
+, 3.85654058e+04, 3.85840918e+04, 3.86027800e+04, 3.86214704e+04
+, 3.86401631e+04, 3.86588581e+04, 3.86775553e+04, 3.86962548e+04
+, 3.87149565e+04, 3.87336605e+04, 3.87523668e+04, 3.87710753e+04
+, 3.87897861e+04, 3.88084992e+04, 3.88272144e+04, 3.88459320e+04
+, 3.88646518e+04, 3.88833739e+04, 3.89020982e+04, 3.89208247e+04
+, 3.89395535e+04, 3.89582846e+04, 3.89770179e+04, 3.89957535e+04
+, 3.90144913e+04, 3.90332314e+04, 3.90519737e+04, 3.90707183e+04
+, 3.90894651e+04, 3.91082142e+04, 3.91269655e+04, 3.91457191e+04
+, 3.91644749e+04, 3.91832329e+04, 3.92019932e+04, 3.92207558e+04
+, 3.92395206e+04, 3.92582876e+04, 3.92770569e+04, 3.92958284e+04
+, 3.93146022e+04, 3.93333782e+04, 3.93521564e+04, 3.93709369e+04
+, 3.93897196e+04, 3.94085046e+04, 3.94272918e+04, 3.94460812e+04
+, 3.94648729e+04, 3.94836668e+04, 3.95024630e+04, 3.95212614e+04
+, 3.95400620e+04, 3.95588648e+04, 3.95776699e+04, 3.95964773e+04
+, 3.96152868e+04, 3.96340986e+04, 3.96529126e+04, 3.96717289e+04
+, 3.96905474e+04, 3.97093681e+04, 3.97281911e+04, 3.97470162e+04
+, 3.97658436e+04, 3.97846733e+04, 3.98035052e+04, 3.98223392e+04
+, 3.98411756e+04, 3.98600141e+04, 3.98788549e+04, 3.98976979e+04
+, 3.99165431e+04, 3.99353906e+04, 3.99542402e+04, 3.99730921e+04
+, 3.99919463e+04, 4.00108026e+04, 4.00296612e+04, 4.00485220e+04
+, 4.00673850e+04, 4.00862502e+04, 4.01051176e+04, 4.01239873e+04
+, 4.01428592e+04, 4.01617333e+04, 4.01806096e+04, 4.01994882e+04
+, 4.02183689e+04, 4.02372519e+04, 4.02561371e+04, 4.02750245e+04
+, 4.02939141e+04, 4.03128059e+04, 4.03317000e+04, 4.03505962e+04
+, 4.03694947e+04, 4.03883954e+04, 4.04072983e+04, 4.04262034e+04
+, 4.04451107e+04, 4.04640202e+04, 4.04829319e+04, 4.05018459e+04
+, 4.05207620e+04, 4.05396804e+04, 4.05586010e+04, 4.05775237e+04
+, 4.05964487e+04, 4.06153759e+04, 4.06343053e+04, 4.06532369e+04
+, 4.06721707e+04, 4.06911067e+04, 4.07100449e+04, 4.07289853e+04
+, 4.07479279e+04, 4.07668727e+04, 4.07858198e+04, 4.08047690e+04
+, 4.08237204e+04, 4.08426740e+04, 4.08616298e+04, 4.08805878e+04
+, 4.08995480e+04, 4.09185105e+04, 4.09374751e+04, 4.09564419e+04
+, 4.09754109e+04, 4.09943821e+04, 4.10133555e+04, 4.10323310e+04
+, 4.10513088e+04, 4.10702888e+04, 4.10892710e+04, 4.11082553e+04
+, 4.11272419e+04, 4.11462306e+04, 4.11652215e+04, 4.11842147e+04
+, 4.12032100e+04, 4.12222075e+04, 4.12412072e+04, 4.12602091e+04
+, 4.12792131e+04, 4.12982194e+04, 4.13172278e+04, 4.13362385e+04
+, 4.13552513e+04, 4.13742663e+04, 4.13932835e+04, 4.14123028e+04
+, 4.14313244e+04, 4.14503481e+04, 4.14693740e+04, 4.14884021e+04
+, 4.15074324e+04, 4.15264649e+04, 4.15454995e+04, 4.15645364e+04
+, 4.15835754e+04, 4.16026166e+04, 4.16216599e+04, 4.16407055e+04
+, 4.16597532e+04, 4.16788031e+04, 4.16978552e+04, 4.17169094e+04
+, 4.17359659e+04, 4.17550245e+04, 4.17740853e+04, 4.17931482e+04
+, 4.18122133e+04, 4.18312807e+04, 4.18503501e+04, 4.18694218e+04
+, 4.18884956e+04, 4.19075716e+04, 4.19266498e+04, 4.19457301e+04
+, 4.19648126e+04, 4.19838973e+04, 4.20029841e+04, 4.20220731e+04
+, 4.20411643e+04, 4.20602576e+04, 4.20793532e+04, 4.20984508e+04
+, 4.21175507e+04, 4.21366527e+04, 4.21557569e+04, 4.21748632e+04
+, 4.21939717e+04, 4.22130824e+04, 4.22321952e+04, 4.22513102e+04
+, 4.22704274e+04, 4.22895467e+04, 4.23086682e+04, 4.23277918e+04
+, 4.23469176e+04, 4.23660456e+04, 4.23851757e+04, 4.24043080e+04
+, 4.24234424e+04, 4.24425790e+04, 4.24617178e+04, 4.24808587e+04
+, 4.25000018e+04, 4.25191470e+04, 4.25382944e+04, 4.25574439e+04
+, 4.25765956e+04, 4.25957494e+04, 4.26149054e+04, 4.26340636e+04
+, 4.26532239e+04, 4.26723863e+04, 4.26915509e+04, 4.27107177e+04
+, 4.27298866e+04, 4.27490576e+04, 4.27682308e+04, 4.27874062e+04
+, 4.28065837e+04, 4.28257634e+04, 4.28449452e+04, 4.28641291e+04
+, 4.28833152e+04, 4.29025034e+04, 4.29216938e+04, 4.29408863e+04
+, 4.29600810e+04, 4.29792778e+04, 4.29984768e+04, 4.30176779e+04
+, 4.30368812e+04, 4.30560865e+04, 4.30752941e+04, 4.30945038e+04
+, 4.31137156e+04, 4.31329295e+04, 4.31521456e+04, 4.31713639e+04
+, 4.31905842e+04, 4.32098067e+04, 4.32290314e+04, 4.32482582e+04
+, 4.32674871e+04, 4.32867182e+04, 4.33059514e+04, 4.33251867e+04
+, 4.33444242e+04, 4.33636638e+04, 4.33829055e+04, 4.34021494e+04
+, 4.34213954e+04, 4.34406435e+04, 4.34598938e+04, 4.34791462e+04
+, 4.34984007e+04, 4.35176574e+04, 4.35369162e+04, 4.35561771e+04
+, 4.35754402e+04, 4.35947054e+04, 4.36139727e+04, 4.36332421e+04
+, 4.36525137e+04, 4.36717874e+04, 4.36910632e+04, 4.37103412e+04
+, 4.37296212e+04, 4.37489034e+04, 4.37681878e+04, 4.37874742e+04
+, 4.38067628e+04, 4.38260535e+04, 4.38453463e+04, 4.38646413e+04
+, 4.38839383e+04, 4.39032375e+04, 4.39225388e+04, 4.39418422e+04
+, 4.39611478e+04, 4.39804555e+04, 4.39997652e+04, 4.40190772e+04
+, 4.40383912e+04, 4.40577073e+04, 4.40770256e+04, 4.40963460e+04
+, 4.41156684e+04, 4.41349931e+04, 4.41543198e+04, 4.41736486e+04
+, 4.41929796e+04, 4.42123126e+04, 4.42316478e+04, 4.42509851e+04
+, 4.42703245e+04, 4.42896661e+04, 4.43090097e+04, 4.43283554e+04
+, 4.43477033e+04, 4.43670533e+04, 4.43864053e+04, 4.44057595e+04
+, 4.44251158e+04, 4.44444742e+04, 4.44638347e+04, 4.44831973e+04
+, 4.45025621e+04, 4.45219289e+04, 4.45412978e+04, 4.45606689e+04
+, 4.45800420e+04, 4.45994173e+04, 4.46187947e+04, 4.46381741e+04
+, 4.46575557e+04, 4.46769394e+04, 4.46963251e+04, 4.47157130e+04
+, 4.47351030e+04, 4.47544951e+04, 4.47738892e+04, 4.47932855e+04
+, 4.48126839e+04, 4.48320844e+04, 4.48514870e+04, 4.48708916e+04
+, 4.48902984e+04, 4.49097073e+04, 4.49291183e+04, 4.49485313e+04
+, 4.49679465e+04, 4.49873638e+04, 4.50067831e+04, 4.50262046e+04
+, 4.50456281e+04, 4.50650537e+04, 4.50844815e+04, 4.51039113e+04
+, 4.51233432e+04, 4.51427772e+04, 4.51622133e+04, 4.51816515e+04
+, 4.52010918e+04, 4.52205342e+04, 4.52399787e+04, 4.52594252e+04
+, 4.52788738e+04, 4.52983246e+04, 4.53177774e+04, 4.53372323e+04
+, 4.53566893e+04, 4.53761484e+04, 4.53956096e+04, 4.54150728e+04
+, 4.54345382e+04, 4.54540056e+04, 4.54734751e+04, 4.54929467e+04
+, 4.55124204e+04, 4.55318961e+04, 4.55513740e+04, 4.55708539e+04
+, 4.55903359e+04, 4.56098200e+04, 4.56293062e+04, 4.56487944e+04
+, 4.56682847e+04, 4.56877772e+04, 4.57072717e+04, 4.57267682e+04
+, 4.57462669e+04, 4.57657676e+04, 4.57852704e+04, 4.58047753e+04
+, 4.58242822e+04, 4.58437913e+04, 4.58633024e+04, 4.58828156e+04
+, 4.59023308e+04, 4.59218482e+04, 4.59413676e+04, 4.59608891e+04
+, 4.59804126e+04, 4.59999382e+04, 4.60194659e+04, 4.60389957e+04
+, 4.60585275e+04, 4.60780615e+04, 4.60975974e+04, 4.61171355e+04
+, 4.61366756e+04, 4.61562178e+04, 4.61757621e+04, 4.61953084e+04
+, 4.62148568e+04, 4.62344073e+04, 4.62539598e+04, 4.62735144e+04
+, 4.62930711e+04, 4.63126298e+04, 4.63321906e+04, 4.63517535e+04
+, 4.63713184e+04, 4.63908854e+04, 4.64104544e+04, 4.64300255e+04
+, 4.64495987e+04, 4.64691740e+04, 4.64887513e+04, 4.65083306e+04
+, 4.65279120e+04, 4.65474955e+04, 4.65670811e+04, 4.65866687e+04
+, 4.66062583e+04, 4.66258501e+04, 4.66454438e+04, 4.66650397e+04
+, 4.66846376e+04, 4.67042375e+04, 4.67238395e+04, 4.67434436e+04
+, 4.67630497e+04, 4.67826579e+04, 4.68022681e+04, 4.68218804e+04
+, 4.68414948e+04, 4.68611112e+04, 4.68807296e+04, 4.69003501e+04
+, 4.69199727e+04, 4.69395973e+04, 4.69592239e+04, 4.69788526e+04
+, 4.69984834e+04, 4.70181162e+04, 4.70377510e+04, 4.70573879e+04
+, 4.70770269e+04, 4.70966679e+04, 4.71163109e+04, 4.71359560e+04
+, 4.71556032e+04, 4.71752524e+04, 4.71949036e+04, 4.72145569e+04
+, 4.72342122e+04, 4.72538696e+04, 4.72735290e+04, 4.72931905e+04
+, 4.73128540e+04, 4.73325195e+04, 4.73521871e+04, 4.73718568e+04
+, 4.73915284e+04, 4.74112022e+04, 4.74308779e+04, 4.74505557e+04
+, 4.74702356e+04, 4.74899174e+04, 4.75096014e+04, 4.75292873e+04
+, 4.75489753e+04, 4.75686653e+04, 4.75883574e+04, 4.76080515e+04
+, 4.76277477e+04, 4.76474459e+04, 4.76671461e+04, 4.76868483e+04
+, 4.77065526e+04, 4.77262590e+04, 4.77459673e+04, 4.77656777e+04
+, 4.77853901e+04, 4.78051046e+04, 4.78248211e+04, 4.78445396e+04
+, 4.78642602e+04, 4.78839828e+04, 4.79037074e+04, 4.79234340e+04
+, 4.79431627e+04, 4.79628934e+04, 4.79826262e+04, 4.80023609e+04
+, 4.80220977e+04, 4.80418366e+04, 4.80615774e+04, 4.80813203e+04
+, 4.81010652e+04, 4.81208122e+04, 4.81405611e+04, 4.81603121e+04
+, 4.81800651e+04, 4.81998201e+04, 4.82195772e+04, 4.82393363e+04
+, 4.82590974e+04, 4.82788605e+04, 4.82986257e+04, 4.83183929e+04
+, 4.83381621e+04, 4.83579333e+04, 4.83777065e+04, 4.83974818e+04
+, 4.84172591e+04, 4.84370384e+04, 4.84568197e+04, 4.84766030e+04
+, 4.84963884e+04, 4.85161758e+04, 4.85359652e+04, 4.85557566e+04
+, 4.85755500e+04, 4.85953454e+04, 4.86151429e+04, 4.86349424e+04
+, 4.86547439e+04, 4.86745474e+04, 4.86943529e+04, 4.87141604e+04
+, 4.87339700e+04, 4.87537816e+04, 4.87735951e+04, 4.87934107e+04
+, 4.88132283e+04, 4.88330479e+04, 4.88528696e+04, 4.88726932e+04
+, 4.88925188e+04, 4.89123465e+04, 4.89321762e+04, 4.89520078e+04
+, 4.89718415e+04, 4.89916772e+04, 4.90115149e+04, 4.90313546e+04
+, 4.90511963e+04, 4.90710401e+04, 4.90908858e+04, 4.91107335e+04
+, 4.91305832e+04, 4.91504350e+04, 4.91702887e+04, 4.91901445e+04
+, 4.92100022e+04, 4.92298620e+04, 4.92497238e+04, 4.92695875e+04
+, 4.92894533e+04, 4.93093211e+04, 4.93291908e+04, 4.93490626e+04
+, 4.93689364e+04, 4.93888122e+04, 4.94086899e+04, 4.94285697e+04
+, 4.94484515e+04, 4.94683352e+04, 4.94882210e+04, 4.95081088e+04
+, 4.95279985e+04, 4.95478903e+04, 4.95677841e+04, 4.95876798e+04
+, 4.96075776e+04, 4.96274773e+04, 4.96473791e+04, 4.96672828e+04
+, 4.96871885e+04, 4.97070962e+04, 4.97270060e+04, 4.97469177e+04
+, 4.97668314e+04, 4.97867471e+04, 4.98066648e+04, 4.98265844e+04
+, 4.98465061e+04, 4.98664298e+04, 4.98863554e+04, 4.99062830e+04
+, 4.99262127e+04, 4.99461443e+04, 4.99660779e+04, 4.99860135e+04
+, 5.00059511e+04, 5.00258907e+04, 5.00458322e+04, 5.00657758e+04
+, 5.00857213e+04, 5.01056688e+04, 5.01256183e+04, 5.01455698e+04
+, 5.01655233e+04, 5.01854787e+04, 5.02054362e+04, 5.02253956e+04
+, 5.02453570e+04, 5.02653204e+04, 5.02852858e+04, 5.03052531e+04
+, 5.03252224e+04, 5.03451938e+04, 5.03651671e+04, 5.03851423e+04
+, 5.04051196e+04, 5.04250988e+04, 5.04450800e+04, 5.04650632e+04
+, 5.04850484e+04, 5.05050356e+04, 5.05250247e+04, 5.05450158e+04
+, 5.05650089e+04, 5.05850040e+04, 5.06050010e+04, 5.06250000e+04
+, 5.06450010e+04, 5.06650040e+04, 5.06850089e+04, 5.07050158e+04
+, 5.07250247e+04, 5.07450355e+04, 5.07650484e+04, 5.07850632e+04
+, 5.08050800e+04, 5.08250987e+04, 5.08451194e+04, 5.08651421e+04
+, 5.08851668e+04, 5.09051934e+04, 5.09252220e+04, 5.09452526e+04
+, 5.09652851e+04, 5.09853196e+04, 5.10053561e+04, 5.10253945e+04
+, 5.10454350e+04, 5.10654773e+04, 5.10855217e+04, 5.11055680e+04
+, 5.11256163e+04, 5.11456665e+04, 5.11657187e+04, 5.11857729e+04
+, 5.12058290e+04, 5.12258871e+04, 5.12459472e+04, 5.12660092e+04
+, 5.12860732e+04, 5.13061392e+04, 5.13262071e+04, 5.13462770e+04
+, 5.13663488e+04, 5.13864226e+04, 5.14064984e+04, 5.14265761e+04
+, 5.14466558e+04, 5.14667374e+04, 5.14868210e+04, 5.15069066e+04
+, 5.15269941e+04, 5.15470836e+04, 5.15671750e+04, 5.15872684e+04
+, 5.16073638e+04, 5.16274611e+04, 5.16475603e+04, 5.16676615e+04
+, 5.16877647e+04, 5.17078698e+04, 5.17279769e+04, 5.17480859e+04
+, 5.17681969e+04, 5.17883099e+04, 5.18084248e+04, 5.18285416e+04
+, 5.18486604e+04, 5.18687812e+04, 5.18889039e+04, 5.19090285e+04
+, 5.19291551e+04, 5.19492837e+04, 5.19694142e+04, 5.19895466e+04
+, 5.20096810e+04, 5.20298174e+04, 5.20499557e+04, 5.20700959e+04
+, 5.20902381e+04, 5.21103823e+04, 5.21305284e+04, 5.21506764e+04
+, 5.21708264e+04, 5.21909783e+04, 5.22111322e+04, 5.22312880e+04
+, 5.22514458e+04, 5.22716055e+04, 5.22917671e+04, 5.23119307e+04
+, 5.23320963e+04, 5.23522638e+04, 5.23724332e+04, 5.23926046e+04
+, 5.24127779e+04, 5.24329531e+04, 5.24531303e+04, 5.24733094e+04
+, 5.24934905e+04, 5.25136735e+04, 5.25338585e+04, 5.25540454e+04
+, 5.25742342e+04, 5.25944250e+04, 5.26146177e+04, 5.26348123e+04
+, 5.26550089e+04, 5.26752074e+04, 5.26954079e+04, 5.27156102e+04
+, 5.27358146e+04, 5.27560208e+04, 5.27762290e+04, 5.27964392e+04
+, 5.28166512e+04, 5.28368652e+04, 5.28570811e+04, 5.28772990e+04
+, 5.28975188e+04, 5.29177405e+04, 5.29379642e+04, 5.29581898e+04
+, 5.29784173e+04, 5.29986468e+04, 5.30188782e+04, 5.30391115e+04
+, 5.30593467e+04, 5.30795839e+04, 5.30998230e+04, 5.31200640e+04
+, 5.31403070e+04, 5.31605519e+04, 5.31807987e+04, 5.32010475e+04
+, 5.32212981e+04, 5.32415507e+04, 5.32618053e+04, 5.32820617e+04
+, 5.33023201e+04, 5.33225804e+04, 5.33428426e+04, 5.33631068e+04
+, 5.33833728e+04, 5.34036408e+04, 5.34239108e+04, 5.34441826e+04
+, 5.34644564e+04, 5.34847321e+04, 5.35050097e+04, 5.35252892e+04
+, 5.35455706e+04, 5.35658540e+04, 5.35861393e+04, 5.36064265e+04
+, 5.36267157e+04, 5.36470067e+04, 5.36672997e+04, 5.36875946e+04
+, 5.37078914e+04, 5.37281901e+04, 5.37484908e+04, 5.37687933e+04
+, 5.37890978e+04, 5.38094042e+04, 5.38297125e+04, 5.38500227e+04
+, 5.38703349e+04, 5.38906489e+04, 5.39109649e+04, 5.39312828e+04
+, 5.39516026e+04, 5.39719243e+04, 5.39922479e+04, 5.40125734e+04
+, 5.40329009e+04, 5.40532302e+04, 5.40735615e+04, 5.40938947e+04
+, 5.41142298e+04, 5.41345668e+04, 5.41549057e+04, 5.41752465e+04
+, 5.41955893e+04, 5.42159339e+04, 5.42362805e+04, 5.42566289e+04
+, 5.42769793e+04, 5.42973316e+04, 5.43176858e+04, 5.43380419e+04
+, 5.43583999e+04, 5.43787598e+04, 5.43991216e+04, 5.44194853e+04
+, 5.44398509e+04, 5.44602184e+04, 5.44805879e+04, 5.45009592e+04
+, 5.45213324e+04, 5.45417076e+04, 5.45620846e+04, 5.45824636e+04
+, 5.46028444e+04, 5.46232272e+04, 5.46436118e+04, 5.46639984e+04
+, 5.46843868e+04, 5.47047772e+04, 5.47251694e+04, 5.47455636e+04
+, 5.47659597e+04, 5.47863576e+04, 5.48067575e+04, 5.48271592e+04
+, 5.48475629e+04, 5.48679684e+04, 5.48883759e+04, 5.49087852e+04
+, 5.49291964e+04, 5.49496096e+04, 5.49700246e+04, 5.49904415e+04
+, 5.50108604e+04, 5.50312811e+04, 5.50517037e+04, 5.50721282e+04
+, 5.50925546e+04, 5.51129829e+04, 5.51334131e+04, 5.51538452e+04
+, 5.51742791e+04, 5.51947150e+04, 5.52151528e+04, 5.52355924e+04
+, 5.52560339e+04, 5.52764774e+04, 5.52969227e+04, 5.53173699e+04
+, 5.53378190e+04, 5.53582700e+04, 5.53787229e+04, 5.53991776e+04
+, 5.54196343e+04, 5.54400928e+04, 5.54605533e+04, 5.54810156e+04
+, 5.55014798e+04, 5.55219459e+04, 5.55424138e+04, 5.55628837e+04
+, 5.55833555e+04, 5.56038291e+04, 5.56243046e+04, 5.56447820e+04
+, 5.56652613e+04, 5.56857425e+04, 5.57062255e+04, 5.57267105e+04
+, 5.57471973e+04, 5.57676860e+04, 5.57881766e+04, 5.58086690e+04
+, 5.58291634e+04, 5.58496596e+04, 5.58701577e+04, 5.58906577e+04
+, 5.59111596e+04, 5.59316633e+04, 5.59521689e+04, 5.59726765e+04
+, 5.59931858e+04, 5.60136971e+04, 5.60342102e+04, 5.60547253e+04
+, 5.60752422e+04, 5.60957609e+04, 5.61162816e+04, 5.61368041e+04
+, 5.61573285e+04, 5.61778548e+04, 5.61983829e+04, 5.62189130e+04
+, 5.62394449e+04, 5.62599786e+04, 5.62805143e+04, 5.63010518e+04
+, 5.63215912e+04, 5.63421325e+04, 5.63626756e+04, 5.63832206e+04
+, 5.64037675e+04, 5.64243163e+04, 5.64448669e+04, 5.64654194e+04
+, 5.64859738e+04, 5.65065300e+04, 5.65270881e+04, 5.65476481e+04
+, 5.65682099e+04, 5.65887737e+04, 5.66093392e+04, 5.66299067e+04
+, 5.66504760e+04, 5.66710472e+04, 5.66916202e+04, 5.67121952e+04
+, 5.67327720e+04, 5.67533506e+04, 5.67739311e+04, 5.67945135e+04
+, 5.68150978e+04, 5.68356839e+04, 5.68562718e+04, 5.68768617e+04
+, 5.68974534e+04, 5.69180470e+04, 5.69386424e+04, 5.69592397e+04
+, 5.69798388e+04, 5.70004399e+04, 5.70210427e+04, 5.70416475e+04
+, 5.70622541e+04, 5.70828625e+04, 5.71034729e+04, 5.71240850e+04
+, 5.71446991e+04, 5.71653150e+04, 5.71859327e+04, 5.72065524e+04
+, 5.72271738e+04, 5.72477972e+04, 5.72684224e+04, 5.72890494e+04
+, 5.73096783e+04, 5.73303091e+04, 5.73509417e+04, 5.73715762e+04
+, 5.73922125e+04, 5.74128507e+04, 5.74334907e+04, 5.74541326e+04
+, 5.74747764e+04, 5.74954220e+04, 5.75160694e+04, 5.75367187e+04
+, 5.75573699e+04, 5.75780229e+04, 5.75986778e+04, 5.76193345e+04
+, 5.76399931e+04, 5.76606535e+04, 5.76813158e+04, 5.77019799e+04
+, 5.77226458e+04, 5.77433137e+04, 5.77639833e+04, 5.77846549e+04
+, 5.78053282e+04, 5.78260035e+04, 5.78466805e+04, 5.78673594e+04
+, 5.78880402e+04, 5.79087228e+04, 5.79294073e+04, 5.79500936e+04
+, 5.79707817e+04, 5.79914717e+04, 5.80121636e+04, 5.80328572e+04
+, 5.80535528e+04, 5.80742501e+04, 5.80949494e+04, 5.81156504e+04
+, 5.81363533e+04, 5.81570581e+04, 5.81777647e+04, 5.81984731e+04
+, 5.82191834e+04, 5.82398955e+04, 5.82606095e+04, 5.82813253e+04
+, 5.83020429e+04, 5.83227624e+04, 5.83434837e+04, 5.83642069e+04
+, 5.83849319e+04, 5.84056588e+04, 5.84263874e+04, 5.84471180e+04
+, 5.84678503e+04, 5.84885845e+04, 5.85093206e+04, 5.85300584e+04
+, 5.85507982e+04, 5.85715397e+04, 5.85922831e+04, 5.86130283e+04
+, 5.86337754e+04, 5.86545243e+04, 5.86752750e+04, 5.86960275e+04
+, 5.87167819e+04, 5.87375382e+04, 5.87582962e+04, 5.87790561e+04
+, 5.87998179e+04, 5.88205814e+04, 5.88413468e+04, 5.88621141e+04
+, 5.88828831e+04, 5.89036540e+04, 5.89244267e+04, 5.89452013e+04
+, 5.89659777e+04, 5.89867559e+04, 5.90075359e+04, 5.90283178e+04
+, 5.90491015e+04, 5.90698870e+04, 5.90906744e+04, 5.91114636e+04
+, 5.91322546e+04, 5.91530475e+04, 5.91738421e+04, 5.91946386e+04
+, 5.92154370e+04, 5.92362371e+04, 5.92570391e+04, 5.92778429e+04
+, 5.92986485e+04, 5.93194560e+04, 5.93402653e+04, 5.93610764e+04
+, 5.93818893e+04, 5.94027041e+04, 5.94235206e+04, 5.94443390e+04
+, 5.94651593e+04, 5.94859813e+04, 5.95068052e+04, 5.95276309e+04
+, 5.95484584e+04, 5.95692877e+04, 5.95901189e+04, 5.96109518e+04
+, 5.96317866e+04, 5.96526232e+04, 5.96734617e+04, 5.96943019e+04
+, 5.97151440e+04, 5.97359879e+04, 5.97568336e+04, 5.97776811e+04
+, 5.97985305e+04, 5.98193816e+04, 5.98402346e+04, 5.98610894e+04
+, 5.98819460e+04, 5.99028045e+04, 5.99236647e+04, 5.99445268e+04
+, 5.99653906e+04, 5.99862563e+04, 6.00071238e+04, 6.00279932e+04
+, 6.00488643e+04, 6.00697372e+04, 6.00906120e+04, 6.01114886e+04
+, 6.01323670e+04, 6.01532472e+04, 6.01741292e+04, 6.01950130e+04
+, 6.02158986e+04, 6.02367861e+04, 6.02576753e+04, 6.02785664e+04
+, 6.02994593e+04, 6.03203540e+04, 6.03412505e+04, 6.03621488e+04
+, 6.03830489e+04, 6.04039508e+04, 6.04248546e+04, 6.04457601e+04
+, 6.04666675e+04, 6.04875766e+04, 6.05084876e+04, 6.05294003e+04
+, 6.05503149e+04, 6.05712313e+04, 6.05921495e+04, 6.06130695e+04
+, 6.06339913e+04, 6.06549149e+04, 6.06758403e+04, 6.06967675e+04
+, 6.07176965e+04, 6.07386274e+04, 6.07595600e+04, 6.07804944e+04
+, 6.08014306e+04, 6.08223687e+04, 6.08433085e+04, 6.08642501e+04
+, 6.08851936e+04, 6.09061388e+04, 6.09270859e+04, 6.09480347e+04
+, 6.09689853e+04, 6.09899378e+04, 6.10108920e+04, 6.10318481e+04
+, 6.10528059e+04, 6.10737655e+04, 6.10947270e+04, 6.11156902e+04
+, 6.11366552e+04, 6.11576221e+04, 6.11785907e+04, 6.11995611e+04
+, 6.12205333e+04, 6.12415074e+04, 6.12624832e+04, 6.12834608e+04
+, 6.13044402e+04, 6.13254214e+04, 6.13464044e+04, 6.13673892e+04
+, 6.13883757e+04, 6.14093641e+04, 6.14303543e+04, 6.14513463e+04
+, 6.14723400e+04, 6.14933356e+04, 6.15143329e+04, 6.15353320e+04
+, 6.15563330e+04, 6.15773357e+04, 6.15983402e+04, 6.16193465e+04
+, 6.16403546e+04, 6.16613644e+04, 6.16823761e+04, 6.17033896e+04
+, 6.17244048e+04, 6.17454218e+04, 6.17664407e+04, 6.17874613e+04
+, 6.18084837e+04, 6.18295079e+04, 6.18505338e+04, 6.18715616e+04
+, 6.18925912e+04, 6.19136225e+04, 6.19346556e+04, 6.19556905e+04
+, 6.19767272e+04, 6.19977657e+04, 6.20188060e+04, 6.20398480e+04
+, 6.20608918e+04, 6.20819374e+04, 6.21029848e+04, 6.21240340e+04
+, 6.21450850e+04, 6.21661377e+04, 6.21871923e+04, 6.22082486e+04
+, 6.22293067e+04, 6.22503666e+04, 6.22714282e+04, 6.22924917e+04
+, 6.23135569e+04, 6.23346239e+04, 6.23556927e+04, 6.23767632e+04
+, 6.23978356e+04, 6.24189097e+04, 6.24399856e+04, 6.24610633e+04
+, 6.24821427e+04, 6.25032240e+04, 6.25243070e+04, 6.25453918e+04
+, 6.25664783e+04, 6.25875667e+04, 6.26086568e+04, 6.26297487e+04
+, 6.26508424e+04, 6.26719378e+04, 6.26930350e+04, 6.27141340e+04
+, 6.27352348e+04, 6.27563373e+04, 6.27774417e+04, 6.27985478e+04
+, 6.28196556e+04, 6.28407653e+04, 6.28618767e+04, 6.28829899e+04
+, 6.29041048e+04, 6.29252216e+04, 6.29463401e+04, 6.29674603e+04
+, 6.29885824e+04, 6.30097062e+04, 6.30308318e+04, 6.30519592e+04
+, 6.30730883e+04, 6.30942192e+04, 6.31153518e+04, 6.31364863e+04
+, 6.31576225e+04, 6.31787605e+04, 6.31999002e+04, 6.32210417e+04
+, 6.32421850e+04, 6.32633300e+04, 6.32844768e+04, 6.33056254e+04
+, 6.33267758e+04, 6.33479279e+04, 6.33690818e+04, 6.33902374e+04
+, 6.34113948e+04, 6.34325540e+04, 6.34537149e+04, 6.34748776e+04
+, 6.34960421e+04, 6.35172083e+04, 6.35383763e+04, 6.35595461e+04
+, 6.35807176e+04, 6.36018909e+04, 6.36230659e+04, 6.36442427e+04
+, 6.36654213e+04, 6.36866016e+04, 6.37077837e+04, 6.37289675e+04
+, 6.37501532e+04, 6.37713405e+04, 6.37925297e+04, 6.38137205e+04
+, 6.38349132e+04, 6.38561076e+04, 6.38773038e+04, 6.38985017e+04
+, 6.39197014e+04, 6.39409028e+04, 6.39621060e+04, 6.39833110e+04
+, 6.40045177e+04, 6.40257262e+04, 6.40469364e+04, 6.40681484e+04
+, 6.40893621e+04, 6.41105776e+04, 6.41317949e+04, 6.41530139e+04
+, 6.41742346e+04, 6.41954572e+04, 6.42166814e+04, 6.42379075e+04
+, 6.42591352e+04, 6.42803648e+04, 6.43015960e+04, 6.43228291e+04
+, 6.43440639e+04, 6.43653004e+04, 6.43865387e+04, 6.44077788e+04
+, 6.44290205e+04, 6.44502641e+04, 6.44715094e+04, 6.44927564e+04
+, 6.45140052e+04, 6.45352558e+04, 6.45565081e+04, 6.45777621e+04
+, 6.45990179e+04, 6.46202755e+04, 6.46415348e+04, 6.46627958e+04
+, 6.46840586e+04, 6.47053231e+04, 6.47265894e+04, 6.47478574e+04
+, 6.47691272e+04, 6.47903987e+04, 6.48116720e+04, 6.48329470e+04
+, 6.48542238e+04, 6.48755023e+04, 6.48967825e+04, 6.49180645e+04
+, 6.49393483e+04, 6.49606337e+04, 6.49819210e+04, 6.50032099e+04
+, 6.50245007e+04, 6.50457931e+04, 6.50670873e+04, 6.50883832e+04
+, 6.51096809e+04, 6.51309804e+04, 6.51522815e+04, 6.51735844e+04
+, 6.51948891e+04, 6.52161955e+04, 6.52375036e+04, 6.52588135e+04
+, 6.52801251e+04, 6.53014384e+04, 6.53227535e+04, 6.53440703e+04
+, 6.53653889e+04, 6.53867092e+04, 6.54080313e+04, 6.54293550e+04
+, 6.54506806e+04, 6.54720078e+04, 6.54933368e+04, 6.55146675e+04
+, 6.55360000e+04, 6.55573342e+04, 6.55786701e+04, 6.56000078e+04
+, 6.56213472e+04, 6.56426884e+04, 6.56640312e+04, 6.56853759e+04
+, 6.57067222e+04, 6.57280703e+04, 6.57494201e+04, 6.57707716e+04
+, 6.57921249e+04, 6.58134799e+04, 6.58348367e+04, 6.58561952e+04
+, 6.58775554e+04, 6.58989173e+04, 6.59202810e+04, 6.59416464e+04
+, 6.59630135e+04, 6.59843824e+04, 6.60057530e+04, 6.60271253e+04
+, 6.60484994e+04, 6.60698751e+04, 6.60912526e+04, 6.61126319e+04
+, 6.61340129e+04, 6.61553956e+04, 6.61767800e+04, 6.61981661e+04
+, 6.62195540e+04, 6.62409436e+04, 6.62623350e+04, 6.62837280e+04
+, 6.63051228e+04, 6.63265193e+04, 6.63479176e+04, 6.63693175e+04
+, 6.63907192e+04, 6.64121226e+04, 6.64335278e+04, 6.64549346e+04
+, 6.64763432e+04, 6.64977535e+04, 6.65191656e+04, 6.65405793e+04
+, 6.65619948e+04, 6.65834120e+04, 6.66048309e+04, 6.66262516e+04
+, 6.66476740e+04, 6.66690981e+04, 6.66905239e+04, 6.67119514e+04
+, 6.67333807e+04, 6.67548116e+04, 6.67762443e+04, 6.67976788e+04
+, 6.68191149e+04, 6.68405527e+04, 6.68619923e+04, 6.68834336e+04
+, 6.69048766e+04, 6.69263214e+04, 6.69477678e+04, 6.69692160e+04
+, 6.69906658e+04, 6.70121174e+04, 6.70335708e+04, 6.70550258e+04
+, 6.70764825e+04, 6.70979410e+04, 6.71194012e+04, 6.71408631e+04
+, 6.71623267e+04, 6.71837920e+04, 6.72052591e+04, 6.72267278e+04
+, 6.72481983e+04, 6.72696705e+04, 6.72911444e+04, 6.73126200e+04
+, 6.73340973e+04, 6.73555764e+04, 6.73770571e+04, 6.73985396e+04
+, 6.74200237e+04, 6.74415096e+04, 6.74629972e+04, 6.74844865e+04
+, 6.75059776e+04, 6.75274703e+04, 6.75489647e+04, 6.75704609e+04
+, 6.75919587e+04, 6.76134583e+04, 6.76349596e+04, 6.76564626e+04
+, 6.76779673e+04, 6.76994737e+04, 6.77209818e+04, 6.77424916e+04
+, 6.77640031e+04, 6.77855164e+04, 6.78070313e+04, 6.78285480e+04
+, 6.78500663e+04, 6.78715864e+04, 6.78931081e+04, 6.79146316e+04
+, 6.79361568e+04, 6.79576837e+04, 6.79792123e+04, 6.80007426e+04
+, 6.80222746e+04, 6.80438083e+04, 6.80653437e+04, 6.80868808e+04
+, 6.81084196e+04, 6.81299601e+04, 6.81515023e+04, 6.81730463e+04
+, 6.81945919e+04, 6.82161392e+04, 6.82376882e+04, 6.82592390e+04
+, 6.82807914e+04, 6.83023455e+04, 6.83239014e+04, 6.83454589e+04
+, 6.83670181e+04, 6.83885790e+04, 6.84101417e+04, 6.84317060e+04
+, 6.84532720e+04, 6.84748398e+04, 6.84964092e+04, 6.85179803e+04
+, 6.85395531e+04, 6.85611277e+04, 6.85827039e+04, 6.86042818e+04
+, 6.86258614e+04, 6.86474427e+04, 6.86690257e+04, 6.86906104e+04
+, 6.87121968e+04, 6.87337849e+04, 6.87553747e+04, 6.87769662e+04
+, 6.87985593e+04, 6.88201542e+04, 6.88417508e+04, 6.88633490e+04
+, 6.88849490e+04, 6.89065506e+04, 6.89281540e+04, 6.89497590e+04
+, 6.89713657e+04, 6.89929741e+04, 6.90145843e+04, 6.90361961e+04
+, 6.90578095e+04, 6.90794247e+04, 6.91010416e+04, 6.91226602e+04
+, 6.91442804e+04, 6.91659024e+04, 6.91875260e+04, 6.92091513e+04
+, 6.92307783e+04, 6.92524071e+04, 6.92740374e+04, 6.92956695e+04
+, 6.93173033e+04, 6.93389388e+04, 6.93605759e+04, 6.93822147e+04
+, 6.94038553e+04, 6.94254975e+04, 6.94471414e+04, 6.94687869e+04
+, 6.94904342e+04, 6.95120832e+04, 6.95337338e+04, 6.95553861e+04
+, 6.95770401e+04, 6.95986958e+04, 6.96203532e+04, 6.96420123e+04
+, 6.96636730e+04, 6.96853355e+04, 6.97069996e+04, 6.97286654e+04
+, 6.97503328e+04, 6.97720020e+04, 6.97936729e+04, 6.98153454e+04
+, 6.98370196e+04, 6.98586955e+04, 6.98803731e+04, 6.99020523e+04
+, 6.99237333e+04, 6.99454159e+04, 6.99671002e+04, 6.99887862e+04
+, 7.00104738e+04, 7.00321632e+04, 7.00538542e+04, 7.00755469e+04
+, 7.00972412e+04, 7.01189373e+04, 7.01406350e+04, 7.01623344e+04
+, 7.01840355e+04, 7.02057383e+04, 7.02274427e+04, 7.02491489e+04
+, 7.02708567e+04, 7.02925661e+04, 7.03142773e+04, 7.03359901e+04
+, 7.03577046e+04, 7.03794208e+04, 7.04011387e+04, 7.04228582e+04
+, 7.04445794e+04, 7.04663023e+04, 7.04880268e+04, 7.05097530e+04
+, 7.05314809e+04, 7.05532105e+04, 7.05749418e+04, 7.05966747e+04
+, 7.06184093e+04, 7.06401455e+04, 7.06618835e+04, 7.06836231e+04
+, 7.07053644e+04, 7.07271073e+04, 7.07488519e+04, 7.07705982e+04
+, 7.07923462e+04, 7.08140958e+04, 7.08358472e+04, 7.08576001e+04
+, 7.08793548e+04, 7.09011111e+04, 7.09228691e+04, 7.09446287e+04
+, 7.09663900e+04, 7.09881530e+04, 7.10099177e+04, 7.10316840e+04
+, 7.10534520e+04, 7.10752217e+04, 7.10969930e+04, 7.11187660e+04
+, 7.11405407e+04, 7.11623170e+04, 7.11840950e+04, 7.12058746e+04
+, 7.12276560e+04, 7.12494390e+04, 7.12712236e+04, 7.12930099e+04
+, 7.13147979e+04, 7.13365876e+04, 7.13583789e+04, 7.13801719e+04
+, 7.14019665e+04, 7.14237628e+04, 7.14455608e+04, 7.14673604e+04
+, 7.14891617e+04, 7.15109646e+04, 7.15327693e+04, 7.15545755e+04
+, 7.15763835e+04, 7.15981931e+04, 7.16200043e+04, 7.16418173e+04
+, 7.16636318e+04, 7.16854481e+04, 7.17072660e+04, 7.17290856e+04
+, 7.17509068e+04, 7.17727297e+04, 7.17945542e+04, 7.18163804e+04
+, 7.18382083e+04, 7.18600378e+04, 7.18818689e+04, 7.19037018e+04
+, 7.19255363e+04, 7.19473724e+04, 7.19692102e+04, 7.19910497e+04
+, 7.20128908e+04, 7.20347336e+04, 7.20565780e+04, 7.20784241e+04
+, 7.21002718e+04, 7.21221212e+04, 7.21439723e+04, 7.21658250e+04
+, 7.21876793e+04, 7.22095353e+04, 7.22313930e+04, 7.22532523e+04
+, 7.22751133e+04, 7.22969759e+04, 7.23188402e+04, 7.23407061e+04
+, 7.23625737e+04, 7.23844430e+04, 7.24063138e+04, 7.24281864e+04
+, 7.24500606e+04, 7.24719364e+04, 7.24938139e+04, 7.25156931e+04
+, 7.25375739e+04, 7.25594563e+04, 7.25813404e+04, 7.26032262e+04
+, 7.26251135e+04, 7.26470026e+04, 7.26688933e+04, 7.26907856e+04
+, 7.27126796e+04, 7.27345753e+04, 7.27564725e+04, 7.27783715e+04
+, 7.28002721e+04, 7.28221743e+04, 7.28440782e+04, 7.28659837e+04
+, 7.28878909e+04, 7.29097997e+04, 7.29317101e+04, 7.29536222e+04
+, 7.29755360e+04, 7.29974514e+04, 7.30193684e+04, 7.30412871e+04
+, 7.30632075e+04, 7.30851294e+04, 7.31070530e+04, 7.31289783e+04
+, 7.31509052e+04, 7.31728338e+04, 7.31947640e+04, 7.32166958e+04
+, 7.32386293e+04, 7.32605644e+04, 7.32825012e+04, 7.33044396e+04
+, 7.33263796e+04, 7.33483213e+04, 7.33702646e+04, 7.33922096e+04
+, 7.34141562e+04, 7.34361045e+04, 7.34580544e+04, 7.34800059e+04
+, 7.35019591e+04, 7.35239139e+04, 7.35458703e+04, 7.35678284e+04
+, 7.35897881e+04, 7.36117495e+04, 7.36337125e+04, 7.36556771e+04
+, 7.36776434e+04, 7.36996113e+04, 7.37215809e+04, 7.37435521e+04
+, 7.37655249e+04, 7.37874994e+04, 7.38094755e+04, 7.38314532e+04
+, 7.38534326e+04, 7.38754136e+04, 7.38973962e+04, 7.39193805e+04
+, 7.39413664e+04, 7.39633540e+04, 7.39853431e+04, 7.40073339e+04
+, 7.40293264e+04, 7.40513205e+04, 7.40733162e+04, 7.40953135e+04
+, 7.41173125e+04, 7.41393131e+04, 7.41613154e+04, 7.41833192e+04
+, 7.42053248e+04, 7.42273319e+04, 7.42493407e+04, 7.42713511e+04
+, 7.42933631e+04, 7.43153768e+04, 7.43373921e+04, 7.43594090e+04
+, 7.43814275e+04, 7.44034477e+04, 7.44254695e+04, 7.44474930e+04
+, 7.44695180e+04, 7.44915447e+04, 7.45135731e+04, 7.45356030e+04
+, 7.45576346e+04, 7.45796678e+04, 7.46017027e+04, 7.46237391e+04
+, 7.46457772e+04, 7.46678169e+04, 7.46898583e+04, 7.47119013e+04
+, 7.47339459e+04, 7.47559921e+04, 7.47780399e+04, 7.48000894e+04
+, 7.48221405e+04, 7.48441932e+04, 7.48662476e+04, 7.48883036e+04
+, 7.49103612e+04, 7.49324204e+04, 7.49544812e+04, 7.49765437e+04
+, 7.49986078e+04, 7.50206735e+04, 7.50427408e+04, 7.50648098e+04
+, 7.50868804e+04, 7.51089526e+04, 7.51310264e+04, 7.51531019e+04
+, 7.51751789e+04, 7.51972576e+04, 7.52193379e+04, 7.52414199e+04
+, 7.52635034e+04, 7.52855886e+04, 7.53076754e+04, 7.53297638e+04
+, 7.53518538e+04, 7.53739455e+04, 7.53960387e+04, 7.54181336e+04
+, 7.54402301e+04, 7.54623282e+04, 7.54844280e+04, 7.55065293e+04
+, 7.55286323e+04, 7.55507369e+04, 7.55728431e+04, 7.55949510e+04
+, 7.56170604e+04, 7.56391715e+04, 7.56612841e+04, 7.56833984e+04
+, 7.57055143e+04, 7.57276319e+04, 7.57497510e+04, 7.57718717e+04
+, 7.57939941e+04, 7.58161181e+04, 7.58382437e+04, 7.58603709e+04
+, 7.58824997e+04, 7.59046302e+04, 7.59267622e+04, 7.59488959e+04
+, 7.59710311e+04, 7.59931680e+04, 7.60153065e+04, 7.60374466e+04
+, 7.60595884e+04, 7.60817317e+04, 7.61038766e+04, 7.61260232e+04
+, 7.61481714e+04, 7.61703212e+04, 7.61924725e+04, 7.62146255e+04
+, 7.62367801e+04, 7.62589364e+04, 7.62810942e+04, 7.63032536e+04
+, 7.63254147e+04, 7.63475773e+04, 7.63697416e+04, 7.63919075e+04
+, 7.64140750e+04, 7.64362440e+04, 7.64584147e+04, 7.64805870e+04
+, 7.65027609e+04, 7.65249365e+04, 7.65471136e+04, 7.65692923e+04
+, 7.65914727e+04, 7.66136546e+04, 7.66358381e+04, 7.66580233e+04
+, 7.66802101e+04, 7.67023984e+04, 7.67245884e+04, 7.67467800e+04
+, 7.67689731e+04, 7.67911679e+04, 7.68133643e+04, 7.68355623e+04
+, 7.68577619e+04, 7.68799631e+04, 7.69021659e+04, 7.69243703e+04
+, 7.69465763e+04, 7.69687839e+04, 7.69909931e+04, 7.70132039e+04
+, 7.70354163e+04, 7.70576303e+04, 7.70798459e+04, 7.71020631e+04
+, 7.71242820e+04, 7.71465024e+04, 7.71687244e+04, 7.71909480e+04
+, 7.72131732e+04, 7.72354000e+04, 7.72576284e+04, 7.72798585e+04
+, 7.73020901e+04, 7.73243233e+04, 7.73465581e+04, 7.73687945e+04
+, 7.73910325e+04, 7.74132721e+04, 7.74355133e+04, 7.74577561e+04
+, 7.74800005e+04, 7.75022465e+04, 7.75244941e+04, 7.75467432e+04
+, 7.75689940e+04, 7.75912464e+04, 7.76135004e+04, 7.76357559e+04
+, 7.76580131e+04, 7.76802718e+04, 7.77025322e+04, 7.77247941e+04
+, 7.77470577e+04, 7.77693228e+04, 7.77915895e+04, 7.78138578e+04
+, 7.78361278e+04, 7.78583993e+04, 7.78806724e+04, 7.79029471e+04
+, 7.79252233e+04, 7.79475012e+04, 7.79697807e+04, 7.79920617e+04
+, 7.80143444e+04, 7.80366286e+04, 7.80589145e+04, 7.80812019e+04
+, 7.81034909e+04, 7.81257815e+04, 7.81480737e+04, 7.81703675e+04
+, 7.81926629e+04, 7.82149598e+04, 7.82372584e+04, 7.82595585e+04
+, 7.82818602e+04, 7.83041636e+04, 7.83264685e+04, 7.83487750e+04
+, 7.83710830e+04, 7.83933927e+04, 7.84157040e+04, 7.84380168e+04
+, 7.84603313e+04, 7.84826473e+04, 7.85049649e+04, 7.85272841e+04
+, 7.85496048e+04, 7.85719272e+04, 7.85942512e+04, 7.86165767e+04
+, 7.86389038e+04, 7.86612325e+04, 7.86835628e+04, 7.87058947e+04
+, 7.87282281e+04, 7.87505632e+04, 7.87728998e+04, 7.87952380e+04
+, 7.88175778e+04, 7.88399192e+04, 7.88622621e+04, 7.88846067e+04
+, 7.89069528e+04, 7.89293005e+04, 7.89516498e+04, 7.89740007e+04
+, 7.89963531e+04, 7.90187071e+04, 7.90410627e+04, 7.90634199e+04
+, 7.90857787e+04, 7.91081391e+04, 7.91305010e+04, 7.91528645e+04
+, 7.91752296e+04, 7.91975963e+04, 7.92199645e+04, 7.92423344e+04
+, 7.92647058e+04, 7.92870788e+04, 7.93094533e+04, 7.93318295e+04
+, 7.93542072e+04, 7.93765865e+04, 7.93989674e+04, 7.94213498e+04
+, 7.94437339e+04, 7.94661195e+04, 7.94885067e+04, 7.95108954e+04
+, 7.95332858e+04, 7.95556777e+04, 7.95780712e+04, 7.96004663e+04
+, 7.96228629e+04, 7.96452611e+04, 7.96676609e+04, 7.96900623e+04
+, 7.97124652e+04, 7.97348697e+04, 7.97572758e+04, 7.97796835e+04
+, 7.98020927e+04, 7.98245035e+04, 7.98469159e+04, 7.98693299e+04
+, 7.98917454e+04, 7.99141625e+04, 7.99365812e+04, 7.99590014e+04
+, 7.99814232e+04, 8.00038466e+04, 8.00262716e+04, 8.00486981e+04
+, 8.00711262e+04, 8.00935559e+04, 8.01159871e+04, 8.01384199e+04
+, 8.01608543e+04, 8.01832903e+04, 8.02057278e+04, 8.02281669e+04
+, 8.02506075e+04, 8.02730498e+04, 8.02954936e+04, 8.03179389e+04
+, 8.03403859e+04, 8.03628344e+04, 8.03852845e+04, 8.04077361e+04
+, 8.04301893e+04, 8.04526441e+04, 8.04751004e+04, 8.04975583e+04
+, 8.05200178e+04, 8.05424788e+04, 8.05649414e+04, 8.05874056e+04
+, 8.06098713e+04, 8.06323386e+04, 8.06548075e+04, 8.06772779e+04
+, 8.06997499e+04, 8.07222235e+04, 8.07446986e+04, 8.07671753e+04
+, 8.07896536e+04, 8.08121334e+04, 8.08346148e+04, 8.08570977e+04
+, 8.08795822e+04, 8.09020683e+04, 8.09245559e+04, 8.09470451e+04
+, 8.09695359e+04, 8.09920282e+04, 8.10145221e+04, 8.10370175e+04
+, 8.10595145e+04, 8.10820131e+04, 8.11045132e+04, 8.11270149e+04
+, 8.11495181e+04, 8.11720229e+04, 8.11945293e+04, 8.12170372e+04
+, 8.12395467e+04, 8.12620578e+04, 8.12845704e+04, 8.13070845e+04
+, 8.13296002e+04, 8.13521175e+04, 8.13746364e+04, 8.13971568e+04
+, 8.14196787e+04, 8.14422022e+04, 8.14647273e+04, 8.14872539e+04
+, 8.15097821e+04, 8.15323118e+04, 8.15548431e+04, 8.15773760e+04
+, 8.15999104e+04, 8.16224464e+04, 8.16449839e+04, 8.16675230e+04
+, 8.16900636e+04, 8.17126058e+04, 8.17351495e+04, 8.17576948e+04
+, 8.17802417e+04, 8.18027901e+04, 8.18253400e+04, 8.18478915e+04
+, 8.18704446e+04, 8.18929992e+04, 8.19155554e+04, 8.19381131e+04
+, 8.19606724e+04, 8.19832332e+04, 8.20057956e+04, 8.20283595e+04
+, 8.20509250e+04, 8.20734921e+04, 8.20960606e+04, 8.21186308e+04
+, 8.21412025e+04, 8.21637757e+04, 8.21863505e+04, 8.22089269e+04
+, 8.22315047e+04, 8.22540842e+04, 8.22766652e+04, 8.22992477e+04
+, 8.23218318e+04, 8.23444174e+04, 8.23670046e+04, 8.23895934e+04
+, 8.24121837e+04, 8.24347755e+04, 8.24573689e+04, 8.24799638e+04
+, 8.25025603e+04, 8.25251583e+04, 8.25477579e+04, 8.25703590e+04
+, 8.25929617e+04, 8.26155659e+04, 8.26381716e+04, 8.26607789e+04
+, 8.26833878e+04, 8.27059982e+04, 8.27286101e+04, 8.27512236e+04
+, 8.27738386e+04, 8.27964552e+04, 8.28190733e+04, 8.28416930e+04
+, 8.28643142e+04, 8.28869369e+04, 8.29095612e+04, 8.29321871e+04
+, 8.29548145e+04, 8.29774434e+04, 8.30000739e+04, 8.30227059e+04
+, 8.30453394e+04, 8.30679745e+04, 8.30906112e+04, 8.31132493e+04
+, 8.31358891e+04, 8.31585303e+04, 8.31811731e+04, 8.32038175e+04
+, 8.32264634e+04, 8.32491108e+04, 8.32717598e+04, 8.32944103e+04
+, 8.33170623e+04, 8.33397159e+04, 8.33623710e+04, 8.33850277e+04
+, 8.34076859e+04, 8.34303456e+04, 8.34530069e+04, 8.34756697e+04
+, 8.34983341e+04, 8.35210000e+04, 8.35436674e+04, 8.35663364e+04
+, 8.35890069e+04, 8.36116790e+04, 8.36343526e+04, 8.36570277e+04
+, 8.36797043e+04, 8.37023825e+04, 8.37250623e+04, 8.37477435e+04
+, 8.37704263e+04, 8.37931107e+04, 8.38157965e+04, 8.38384839e+04
+, 8.38611729e+04, 8.38838634e+04, 8.39065554e+04, 8.39292489e+04
+, 8.39519440e+04, 8.39746406e+04, 8.39973388e+04, 8.40200385e+04
+, 8.40427397e+04, 8.40654424e+04, 8.40881467e+04, 8.41108525e+04
+, 8.41335599e+04, 8.41562688e+04, 8.41789792e+04, 8.42016911e+04
+, 8.42244046e+04, 8.42471196e+04, 8.42698361e+04, 8.42925542e+04
+, 8.43152738e+04, 8.43379949e+04, 8.43607176e+04, 8.43834418e+04
+, 8.44061675e+04, 8.44288947e+04, 8.44516235e+04, 8.44743538e+04
+, 8.44970857e+04, 8.45198190e+04, 8.45425539e+04, 8.45652904e+04
+, 8.45880283e+04, 8.46107678e+04, 8.46335088e+04, 8.46562513e+04
+, 8.46789954e+04, 8.47017410e+04, 8.47244881e+04, 8.47472368e+04
+, 8.47699869e+04, 8.47927386e+04, 8.48154919e+04, 8.48382466e+04
+, 8.48610029e+04, 8.48837607e+04, 8.49065200e+04, 8.49292809e+04
+, 8.49520433e+04, 8.49748072e+04, 8.49975726e+04, 8.50203395e+04
+, 8.50431080e+04, 8.50658780e+04, 8.50886495e+04, 8.51114226e+04
+, 8.51341972e+04, 8.51569733e+04, 8.51797509e+04, 8.52025300e+04
+, 8.52253107e+04, 8.52480929e+04, 8.52708766e+04, 8.52936618e+04
+, 8.53164486e+04, 8.53392368e+04, 8.53620266e+04, 8.53848179e+04
+, 8.54076108e+04, 8.54304051e+04, 8.54532010e+04, 8.54759984e+04
+, 8.54987973e+04, 8.55215978e+04, 8.55443997e+04, 8.55672032e+04
+, 8.55900082e+04, 8.56128147e+04, 8.56356228e+04, 8.56584323e+04
+, 8.56812434e+04, 8.57040560e+04, 8.57268701e+04, 8.57496857e+04
+, 8.57725029e+04, 8.57953215e+04, 8.58181417e+04, 8.58409634e+04
+, 8.58637866e+04, 8.58866114e+04, 8.59094376e+04, 8.59322654e+04
+, 8.59550946e+04, 8.59779254e+04, 8.60007578e+04, 8.60235916e+04
+, 8.60464269e+04, 8.60692638e+04, 8.60921022e+04, 8.61149420e+04
+, 8.61377834e+04, 8.61606264e+04, 8.61834708e+04, 8.62063167e+04
+, 8.62291642e+04, 8.62520132e+04, 8.62748637e+04, 8.62977157e+04
+, 8.63205692e+04, 8.63434242e+04, 8.63662807e+04, 8.63891388e+04
+, 8.64119983e+04, 8.64348594e+04, 8.64577220e+04, 8.64805861e+04
+, 8.65034517e+04, 8.65263188e+04, 8.65491874e+04, 8.65720576e+04
+, 8.65949292e+04, 8.66178024e+04, 8.66406771e+04, 8.66635532e+04
+, 8.66864309e+04, 8.67093101e+04, 8.67321908e+04, 8.67550731e+04
+, 8.67779568e+04, 8.68008420e+04, 8.68237288e+04, 8.68466170e+04
+, 8.68695068e+04, 8.68923981e+04, 8.69152908e+04, 8.69381851e+04
+, 8.69610809e+04, 8.69839782e+04, 8.70068770e+04, 8.70297773e+04
+, 8.70526792e+04, 8.70755825e+04, 8.70984873e+04, 8.71213937e+04
+, 8.71443015e+04, 8.71672108e+04, 8.71901217e+04, 8.72130341e+04
+, 8.72359479e+04, 8.72588633e+04, 8.72817802e+04, 8.73046985e+04
+, 8.73276184e+04, 8.73505398e+04, 8.73734627e+04, 8.73963871e+04
+, 8.74193130e+04, 8.74422404e+04, 8.74651693e+04, 8.74880997e+04
+, 8.75110316e+04, 8.75339650e+04, 8.75568999e+04, 8.75798364e+04
+, 8.76027743e+04, 8.76257137e+04, 8.76486546e+04, 8.76715970e+04
+, 8.76945410e+04, 8.77174864e+04, 8.77404333e+04, 8.77633817e+04
+, 8.77863317e+04, 8.78092831e+04, 8.78322360e+04, 8.78551904e+04
+, 8.78781464e+04, 8.79011038e+04, 8.79240627e+04, 8.79470231e+04
+, 8.79699850e+04, 8.79929485e+04, 8.80159134e+04, 8.80388798e+04
+, 8.80618477e+04, 8.80848171e+04, 8.81077880e+04, 8.81307604e+04
+, 8.81537343e+04, 8.81767097e+04, 8.81996866e+04, 8.82226650e+04
+, 8.82456449e+04, 8.82686263e+04, 8.82916092e+04, 8.83145935e+04
+, 8.83375794e+04, 8.83605668e+04, 8.83835556e+04, 8.84065460e+04
+, 8.84295379e+04, 8.84525312e+04, 8.84755260e+04, 8.84985224e+04
+, 8.85215202e+04, 8.85445195e+04, 8.85675203e+04, 8.85905227e+04
+, 8.86135265e+04, 8.86365318e+04, 8.86595385e+04, 8.86825468e+04
+, 8.87055566e+04, 8.87285679e+04, 8.87515806e+04, 8.87745949e+04
+, 8.87976106e+04, 8.88206279e+04, 8.88436466e+04, 8.88666668e+04
+, 8.88896885e+04, 8.89127117e+04, 8.89357364e+04, 8.89587626e+04
+, 8.89817902e+04, 8.90048194e+04, 8.90278500e+04, 8.90508822e+04
+, 8.90739158e+04, 8.90969509e+04, 8.91199875e+04, 8.91430256e+04
+, 8.91660652e+04, 8.91891063e+04, 8.92121488e+04, 8.92351929e+04
+, 8.92582384e+04, 8.92812854e+04, 8.93043340e+04, 8.93273840e+04
+, 8.93504354e+04, 8.93734884e+04, 8.93965429e+04, 8.94195988e+04
+, 8.94426562e+04, 8.94657152e+04, 8.94887756e+04, 8.95118374e+04
+, 8.95349008e+04, 8.95579657e+04, 8.95810320e+04, 8.96040999e+04
+, 8.96271692e+04, 8.96502400e+04, 8.96733123e+04, 8.96963860e+04
+, 8.97194613e+04, 8.97425380e+04, 8.97656162e+04, 8.97886959e+04
+, 8.98117771e+04, 8.98348598e+04, 8.98579439e+04, 8.98810296e+04
+, 8.99041167e+04, 8.99272053e+04, 8.99502954e+04, 8.99733869e+04
+, 8.99964800e+04, 9.00195745e+04, 9.00426705e+04, 9.00657680e+04
+, 9.00888670e+04, 9.01119674e+04, 9.01350693e+04, 9.01581727e+04
+, 9.01812776e+04, 9.02043840e+04, 9.02274919e+04, 9.02506012e+04
+, 9.02737120e+04, 9.02968243e+04, 9.03199381e+04, 9.03430533e+04
+, 9.03661700e+04, 9.03892882e+04, 9.04124079e+04, 9.04355291e+04
+, 9.04586517e+04, 9.04817758e+04, 9.05049014e+04, 9.05280285e+04
+, 9.05511570e+04, 9.05742871e+04, 9.05974186e+04, 9.06205515e+04
+, 9.06436860e+04, 9.06668219e+04, 9.06899593e+04, 9.07130982e+04
+, 9.07362386e+04, 9.07593804e+04, 9.07825237e+04, 9.08056685e+04
+, 9.08288148e+04, 9.08519625e+04, 9.08751117e+04, 9.08982624e+04
+, 9.09214146e+04, 9.09445682e+04, 9.09677233e+04, 9.09908799e+04
+, 9.10140379e+04, 9.10371974e+04, 9.10603584e+04, 9.10835209e+04
+, 9.11066849e+04, 9.11298503e+04, 9.11530172e+04, 9.11761855e+04
+, 9.11993553e+04, 9.12225267e+04, 9.12456994e+04, 9.12688737e+04
+, 9.12920494e+04, 9.13152266e+04, 9.13384052e+04, 9.13615854e+04
+, 9.13847670e+04, 9.14079500e+04, 9.14311346e+04, 9.14543206e+04
+, 9.14775081e+04, 9.15006970e+04, 9.15238874e+04, 9.15470793e+04
+, 9.15702727e+04, 9.15934675e+04, 9.16166638e+04, 9.16398616e+04
+, 9.16630608e+04, 9.16862615e+04, 9.17094637e+04, 9.17326673e+04
+, 9.17558724e+04, 9.17790790e+04, 9.18022870e+04, 9.18254965e+04
+, 9.18487075e+04, 9.18719199e+04, 9.18951338e+04, 9.19183492e+04
+, 9.19415660e+04, 9.19647843e+04, 9.19880041e+04, 9.20112253e+04
+, 9.20344480e+04, 9.20576722e+04, 9.20808978e+04, 9.21041249e+04
+, 9.21273534e+04, 9.21505835e+04, 9.21738149e+04, 9.21970479e+04
+, 9.22202823e+04, 9.22435182e+04, 9.22667555e+04, 9.22899943e+04
+, 9.23132346e+04, 9.23364763e+04, 9.23597195e+04, 9.23829642e+04
+, 9.24062103e+04, 9.24294578e+04, 9.24527069e+04, 9.24759574e+04
+, 9.24992093e+04, 9.25224628e+04, 9.25457176e+04, 9.25689740e+04
+, 9.25922318e+04, 9.26154911e+04, 9.26387518e+04, 9.26620140e+04
+, 9.26852776e+04, 9.27085427e+04, 9.27318093e+04, 9.27550773e+04
+, 9.27783468e+04, 9.28016178e+04, 9.28248902e+04, 9.28481640e+04
+, 9.28714393e+04, 9.28947161e+04, 9.29179944e+04, 9.29412741e+04
+, 9.29645552e+04, 9.29878378e+04, 9.30111219e+04, 9.30344074e+04
+, 9.30576944e+04, 9.30809828e+04, 9.31042727e+04, 9.31275641e+04
+, 9.31508569e+04, 9.31741512e+04, 9.31974469e+04, 9.32207441e+04
+, 9.32440427e+04, 9.32673428e+04, 9.32906443e+04, 9.33139473e+04
+, 9.33372518e+04, 9.33605577e+04, 9.33838651e+04, 9.34071739e+04
+, 9.34304841e+04, 9.34537959e+04, 9.34771090e+04, 9.35004237e+04
+, 9.35237398e+04, 9.35470573e+04, 9.35703763e+04, 9.35936967e+04
+, 9.36170186e+04, 9.36403420e+04, 9.36636668e+04, 9.36869931e+04
+, 9.37103208e+04, 9.37336499e+04, 9.37569805e+04, 9.37803126e+04
+, 9.38036461e+04, 9.38269811e+04, 9.38503175e+04, 9.38736554e+04
+, 9.38969947e+04, 9.39203355e+04, 9.39436777e+04, 9.39670213e+04
+, 9.39903665e+04, 9.40137130e+04, 9.40370610e+04, 9.40604105e+04
+, 9.40837614e+04, 9.41071138e+04, 9.41304676e+04, 9.41538229e+04
+, 9.41771796e+04, 9.42005377e+04, 9.42238974e+04, 9.42472584e+04
+, 9.42706209e+04, 9.42939849e+04, 9.43173503e+04, 9.43407171e+04
+, 9.43640854e+04, 9.43874551e+04, 9.44108263e+04, 9.44341990e+04
+, 9.44575730e+04, 9.44809486e+04, 9.45043255e+04, 9.45277039e+04
+, 9.45510838e+04, 9.45744651e+04, 9.45978479e+04, 9.46212321e+04
+, 9.46446177e+04, 9.46680048e+04, 9.46913933e+04, 9.47147833e+04
+, 9.47381747e+04, 9.47615676e+04, 9.47849619e+04, 9.48083576e+04
+, 9.48317548e+04, 9.48551535e+04, 9.48785536e+04, 9.49019551e+04
+, 9.49253580e+04, 9.49487625e+04, 9.49721683e+04, 9.49955756e+04
+, 9.50189843e+04, 9.50423945e+04, 9.50658061e+04, 9.50892192e+04
+, 9.51126337e+04, 9.51360496e+04, 9.51594670e+04, 9.51828858e+04
+, 9.52063061e+04, 9.52297278e+04, 9.52531510e+04, 9.52765755e+04
+, 9.53000016e+04, 9.53234290e+04, 9.53468579e+04, 9.53702883e+04
+, 9.53937201e+04, 9.54171533e+04, 9.54405880e+04, 9.54640241e+04
+, 9.54874616e+04, 9.55109006e+04, 9.55343410e+04, 9.55577828e+04
+, 9.55812261e+04, 9.56046709e+04, 9.56281170e+04, 9.56515646e+04
+, 9.56750137e+04, 9.56984641e+04, 9.57219161e+04, 9.57453694e+04
+, 9.57688242e+04, 9.57922804e+04, 9.58157381e+04, 9.58391972e+04
+, 9.58626577e+04, 9.58861197e+04, 9.59095831e+04, 9.59330479e+04
+, 9.59565142e+04, 9.59799819e+04, 9.60034510e+04, 9.60269216e+04
+, 9.60503936e+04, 9.60738670e+04, 9.60973419e+04, 9.61208182e+04
+, 9.61442960e+04, 9.61677751e+04, 9.61912558e+04, 9.62147378e+04
+, 9.62382213e+04, 9.62617062e+04, 9.62851925e+04, 9.63086803e+04
+, 9.63321695e+04, 9.63556601e+04, 9.63791522e+04, 9.64026457e+04
+, 9.64261406e+04, 9.64496370e+04, 9.64731348e+04, 9.64966340e+04
+, 9.65201347e+04, 9.65436368e+04, 9.65671403e+04, 9.65906452e+04
+, 9.66141516e+04, 9.66376594e+04, 9.66611687e+04, 9.66846793e+04
+, 9.67081914e+04, 9.67317050e+04, 9.67552199e+04, 9.67787363e+04
+, 9.68022541e+04, 9.68257733e+04, 9.68492940e+04, 9.68728161e+04
+, 9.68963396e+04, 9.69198646e+04, 9.69433910e+04, 9.69669188e+04
+, 9.69904480e+04, 9.70139787e+04, 9.70375108e+04, 9.70610443e+04
+, 9.70845792e+04, 9.71081156e+04, 9.71316534e+04, 9.71551926e+04
+, 9.71787333e+04, 9.72022753e+04, 9.72258188e+04, 9.72493637e+04
+, 9.72729101e+04, 9.72964579e+04, 9.73200071e+04, 9.73435577e+04
+, 9.73671097e+04, 9.73906632e+04, 9.74142181e+04, 9.74377744e+04
+, 9.74613322e+04, 9.74848913e+04, 9.75084519e+04, 9.75320139e+04
+, 9.75555774e+04, 9.75791422e+04, 9.76027085e+04, 9.76262762e+04
+, 9.76498454e+04, 9.76734159e+04, 9.76969879e+04, 9.77205613e+04
+, 9.77441361e+04, 9.77677123e+04, 9.77912900e+04, 9.78148691e+04
+, 9.78384496e+04, 9.78620315e+04, 9.78856148e+04, 9.79091996e+04
+, 9.79327858e+04, 9.79563734e+04, 9.79799624e+04, 9.80035529e+04
+, 9.80271447e+04, 9.80507380e+04, 9.80743327e+04, 9.80979288e+04
+, 9.81215264e+04, 9.81451253e+04, 9.81687257e+04, 9.81923275e+04
+, 9.82159307e+04, 9.82395354e+04, 9.82631414e+04, 9.82867489e+04
+, 9.83103578e+04, 9.83339681e+04, 9.83575798e+04, 9.83811929e+04
+, 9.84048075e+04, 9.84284235e+04, 9.84520409e+04, 9.84756597e+04
+, 9.84992799e+04, 9.85229015e+04, 9.85465246e+04, 9.85701490e+04
+, 9.85937749e+04, 9.86174022e+04, 9.86410310e+04, 9.86646611e+04
+, 9.86882926e+04, 9.87119256e+04, 9.87355600e+04, 9.87591958e+04
+, 9.87828330e+04, 9.88064716e+04, 9.88301116e+04, 9.88537531e+04
+, 9.88773959e+04, 9.89010402e+04, 9.89246859e+04, 9.89483330e+04
+, 9.89719815e+04, 9.89956314e+04, 9.90192828e+04, 9.90429355e+04
+, 9.90665897e+04, 9.90902452e+04, 9.91139022e+04, 9.91375606e+04
+, 9.91612204e+04, 9.91848817e+04, 9.92085443e+04, 9.92322083e+04
+, 9.92558738e+04, 9.92795407e+04, 9.93032089e+04, 9.93268786e+04
+, 9.93505497e+04, 9.93742222e+04, 9.93978961e+04, 9.94215715e+04
+, 9.94452482e+04, 9.94689263e+04, 9.94926059e+04, 9.95162869e+04
+, 9.95399692e+04, 9.95636530e+04, 9.95873382e+04, 9.96110248e+04
+, 9.96347128e+04, 9.96584022e+04, 9.96820930e+04, 9.97057853e+04
+, 9.97294789e+04, 9.97531739e+04, 9.97768704e+04, 9.98005683e+04
+, 9.98242675e+04, 9.98479682e+04, 9.98716703e+04, 9.98953738e+04
+, 9.99190786e+04, 9.99427849e+04, 9.99664926e+04, 9.99902018e+04
+, 1.00013912e+05, 1.00037624e+05, 1.00061338e+05, 1.00085052e+05
+, 1.00108768e+05, 1.00132486e+05, 1.00156205e+05, 1.00179925e+05
+, 1.00203647e+05, 1.00227370e+05, 1.00251095e+05, 1.00274821e+05
+, 1.00298548e+05, 1.00322277e+05, 1.00346007e+05, 1.00369739e+05
+, 1.00393472e+05, 1.00417206e+05, 1.00440942e+05, 1.00464679e+05
+, 1.00488417e+05, 1.00512157e+05, 1.00535899e+05, 1.00559642e+05
+, 1.00583386e+05, 1.00607131e+05, 1.00630878e+05, 1.00654627e+05
+, 1.00678377e+05, 1.00702128e+05, 1.00725880e+05, 1.00749634e+05
+, 1.00773390e+05, 1.00797147e+05, 1.00820905e+05, 1.00844664e+05
+, 1.00868425e+05, 1.00892188e+05, 1.00915952e+05, 1.00939717e+05
+, 1.00963483e+05, 1.00987251e+05, 1.01011021e+05, 1.01034792e+05
+, 1.01058564e+05, 1.01082337e+05, 1.01106112e+05, 1.01129889e+05
+, 1.01153667e+05, 1.01177446e+05, 1.01201226e+05, 1.01225008e+05
+, 1.01248792e+05, 1.01272576e+05, 1.01296363e+05, 1.01320150e+05
+, 1.01343939e+05, 1.01367730e+05, 1.01391521e+05, 1.01415314e+05
+, 1.01439109e+05, 1.01462905e+05, 1.01486702e+05, 1.01510501e+05
+, 1.01534301e+05, 1.01558103e+05, 1.01581906e+05, 1.01605710e+05
+, 1.01629516e+05, 1.01653323e+05, 1.01677131e+05, 1.01700941e+05
+, 1.01724752e+05, 1.01748565e+05, 1.01772379e+05, 1.01796194e+05
+, 1.01820011e+05, 1.01843830e+05, 1.01867649e+05, 1.01891470e+05
+, 1.01915293e+05, 1.01939116e+05, 1.01962942e+05, 1.01986768e+05
+, 1.02010596e+05, 1.02034426e+05, 1.02058256e+05, 1.02082089e+05
+, 1.02105922e+05, 1.02129757e+05, 1.02153593e+05, 1.02177431e+05
+, 1.02201270e+05, 1.02225111e+05, 1.02248953e+05, 1.02272796e+05
+, 1.02296641e+05, 1.02320487e+05, 1.02344334e+05, 1.02368183e+05
+, 1.02392033e+05, 1.02415885e+05, 1.02439738e+05, 1.02463592e+05
+, 1.02487448e+05, 1.02511305e+05, 1.02535164e+05, 1.02559024e+05
+, 1.02582885e+05, 1.02606748e+05, 1.02630612e+05, 1.02654477e+05
+, 1.02678344e+05, 1.02702213e+05, 1.02726082e+05, 1.02749953e+05
+, 1.02773826e+05, 1.02797700e+05, 1.02821575e+05, 1.02845451e+05
+, 1.02869329e+05, 1.02893209e+05, 1.02917089e+05, 1.02940972e+05
+, 1.02964855e+05, 1.02988740e+05, 1.03012626e+05, 1.03036514e+05
+, 1.03060403e+05, 1.03084293e+05, 1.03108185e+05, 1.03132079e+05
+, 1.03155973e+05, 1.03179869e+05, 1.03203766e+05, 1.03227665e+05
+, 1.03251565e+05, 1.03275467e+05, 1.03299370e+05, 1.03323274e+05
+, 1.03347180e+05, 1.03371087e+05, 1.03394995e+05, 1.03418905e+05
+, 1.03442816e+05, 1.03466729e+05, 1.03490643e+05, 1.03514558e+05
+, 1.03538475e+05, 1.03562393e+05, 1.03586312e+05, 1.03610233e+05
+, 1.03634155e+05, 1.03658079e+05, 1.03682004e+05, 1.03705931e+05
+, 1.03729858e+05, 1.03753787e+05, 1.03777718e+05, 1.03801650e+05
+, 1.03825583e+05, 1.03849518e+05, 1.03873454e+05, 1.03897391e+05
+, 1.03921330e+05, 1.03945270e+05, 1.03969212e+05, 1.03993155e+05
+, 1.04017099e+05, 1.04041045e+05, 1.04064992e+05, 1.04088940e+05
+, 1.04112890e+05, 1.04136841e+05, 1.04160794e+05, 1.04184748e+05
+, 1.04208703e+05, 1.04232660e+05, 1.04256618e+05, 1.04280577e+05
+, 1.04304538e+05, 1.04328501e+05, 1.04352464e+05, 1.04376429e+05
+, 1.04400395e+05, 1.04424363e+05, 1.04448332e+05, 1.04472303e+05
+, 1.04496275e+05, 1.04520248e+05, 1.04544222e+05, 1.04568198e+05
+, 1.04592176e+05, 1.04616154e+05, 1.04640135e+05, 1.04664116e+05
+, 1.04688099e+05, 1.04712083e+05, 1.04736069e+05, 1.04760056e+05
+, 1.04784044e+05, 1.04808034e+05, 1.04832025e+05, 1.04856017e+05
+, 1.04880011e+05, 1.04904006e+05, 1.04928003e+05, 1.04952001e+05
+, 1.04976000e+05, 1.05000001e+05, 1.05024003e+05, 1.05048006e+05
+, 1.05072011e+05, 1.05096017e+05, 1.05120025e+05, 1.05144034e+05
+, 1.05168044e+05, 1.05192056e+05, 1.05216069e+05, 1.05240083e+05
+, 1.05264099e+05, 1.05288116e+05, 1.05312134e+05, 1.05336154e+05
+, 1.05360175e+05, 1.05384198e+05, 1.05408222e+05, 1.05432247e+05
+, 1.05456274e+05, 1.05480302e+05, 1.05504332e+05, 1.05528363e+05
+, 1.05552395e+05, 1.05576428e+05, 1.05600463e+05, 1.05624499e+05
+, 1.05648537e+05, 1.05672576e+05, 1.05696617e+05, 1.05720658e+05
+, 1.05744701e+05, 1.05768746e+05, 1.05792792e+05, 1.05816839e+05
+, 1.05840888e+05, 1.05864938e+05, 1.05888989e+05, 1.05913042e+05
+, 1.05937096e+05, 1.05961151e+05, 1.05985208e+05, 1.06009266e+05
+, 1.06033326e+05, 1.06057387e+05, 1.06081449e+05, 1.06105512e+05
+, 1.06129577e+05, 1.06153644e+05, 1.06177711e+05, 1.06201780e+05
+, 1.06225851e+05, 1.06249923e+05, 1.06273996e+05, 1.06298070e+05
+, 1.06322146e+05, 1.06346224e+05, 1.06370302e+05, 1.06394382e+05
+, 1.06418464e+05, 1.06442546e+05, 1.06466630e+05, 1.06490716e+05
+, 1.06514803e+05, 1.06538891e+05, 1.06562980e+05, 1.06587071e+05
+, 1.06611163e+05, 1.06635257e+05, 1.06659352e+05, 1.06683448e+05
+, 1.06707546e+05, 1.06731645e+05, 1.06755745e+05, 1.06779847e+05
+, 1.06803950e+05, 1.06828055e+05, 1.06852161e+05, 1.06876268e+05
+, 1.06900376e+05, 1.06924486e+05, 1.06948597e+05, 1.06972710e+05
+, 1.06996824e+05, 1.07020939e+05, 1.07045056e+05, 1.07069174e+05
+, 1.07093294e+05, 1.07117414e+05, 1.07141537e+05, 1.07165660e+05
+, 1.07189785e+05, 1.07213911e+05, 1.07238039e+05, 1.07262168e+05
+, 1.07286298e+05, 1.07310430e+05, 1.07334563e+05, 1.07358697e+05
+, 1.07382833e+05, 1.07406970e+05, 1.07431108e+05, 1.07455248e+05
+, 1.07479389e+05, 1.07503532e+05, 1.07527676e+05, 1.07551821e+05
+, 1.07575967e+05, 1.07600115e+05, 1.07624265e+05, 1.07648415e+05
+, 1.07672567e+05, 1.07696720e+05, 1.07720875e+05, 1.07745031e+05
+, 1.07769189e+05, 1.07793347e+05, 1.07817507e+05, 1.07841669e+05
+, 1.07865832e+05, 1.07889996e+05, 1.07914161e+05, 1.07938328e+05
+, 1.07962497e+05, 1.07986666e+05, 1.08010837e+05, 1.08035009e+05
+, 1.08059183e+05, 1.08083358e+05, 1.08107534e+05, 1.08131712e+05
+, 1.08155891e+05, 1.08180071e+05, 1.08204253e+05, 1.08228436e+05
+, 1.08252621e+05, 1.08276807e+05, 1.08300994e+05, 1.08325182e+05
+, 1.08349372e+05, 1.08373563e+05, 1.08397756e+05, 1.08421950e+05
+, 1.08446145e+05, 1.08470342e+05, 1.08494540e+05, 1.08518739e+05
+, 1.08542939e+05, 1.08567141e+05, 1.08591345e+05, 1.08615550e+05
+, 1.08639756e+05, 1.08663963e+05, 1.08688172e+05, 1.08712382e+05
+, 1.08736593e+05, 1.08760806e+05, 1.08785020e+05, 1.08809236e+05
+, 1.08833452e+05, 1.08857671e+05, 1.08881890e+05, 1.08906111e+05
+, 1.08930333e+05, 1.08954557e+05, 1.08978782e+05, 1.09003008e+05
+, 1.09027236e+05, 1.09051465e+05, 1.09075695e+05, 1.09099926e+05
+, 1.09124159e+05, 1.09148394e+05, 1.09172629e+05, 1.09196866e+05
+, 1.09221105e+05, 1.09245345e+05, 1.09269586e+05, 1.09293828e+05
+, 1.09318072e+05, 1.09342317e+05, 1.09366563e+05, 1.09390811e+05
+, 1.09415060e+05, 1.09439311e+05, 1.09463562e+05, 1.09487816e+05
+, 1.09512070e+05, 1.09536326e+05, 1.09560583e+05, 1.09584842e+05
+, 1.09609101e+05, 1.09633363e+05, 1.09657625e+05, 1.09681889e+05
+, 1.09706154e+05, 1.09730421e+05, 1.09754689e+05, 1.09778958e+05
+, 1.09803229e+05, 1.09827501e+05, 1.09851774e+05, 1.09876049e+05
+, 1.09900325e+05, 1.09924602e+05, 1.09948880e+05, 1.09973160e+05
+, 1.09997442e+05, 1.10021724e+05, 1.10046008e+05, 1.10070294e+05
+, 1.10094580e+05, 1.10118869e+05, 1.10143158e+05, 1.10167449e+05
+, 1.10191741e+05, 1.10216034e+05, 1.10240329e+05, 1.10264625e+05
+, 1.10288922e+05, 1.10313221e+05, 1.10337521e+05, 1.10361822e+05
+, 1.10386125e+05, 1.10410429e+05, 1.10434735e+05, 1.10459041e+05
+, 1.10483350e+05, 1.10507659e+05, 1.10531970e+05, 1.10556282e+05
+, 1.10580595e+05, 1.10604910e+05, 1.10629226e+05, 1.10653544e+05
+, 1.10677862e+05, 1.10702183e+05, 1.10726504e+05, 1.10750827e+05
+, 1.10775151e+05, 1.10799476e+05, 1.10823803e+05, 1.10848131e+05
+, 1.10872461e+05, 1.10896792e+05, 1.10921124e+05, 1.10945457e+05
+, 1.10969792e+05, 1.10994128e+05, 1.11018466e+05, 1.11042805e+05
+, 1.11067145e+05, 1.11091486e+05, 1.11115829e+05, 1.11140173e+05
+, 1.11164519e+05, 1.11188865e+05, 1.11213214e+05, 1.11237563e+05
+, 1.11261914e+05, 1.11286266e+05, 1.11310620e+05, 1.11334974e+05
+, 1.11359330e+05, 1.11383688e+05, 1.11408047e+05, 1.11432407e+05
+, 1.11456768e+05, 1.11481131e+05, 1.11505495e+05, 1.11529861e+05
+, 1.11554228e+05, 1.11578596e+05, 1.11602965e+05, 1.11627336e+05
+, 1.11651708e+05, 1.11676081e+05, 1.11700456e+05, 1.11724832e+05
+, 1.11749210e+05, 1.11773589e+05, 1.11797969e+05, 1.11822350e+05
+, 1.11846733e+05, 1.11871117e+05, 1.11895502e+05, 1.11919889e+05
+, 1.11944277e+05, 1.11968667e+05, 1.11993057e+05, 1.12017449e+05
+, 1.12041843e+05, 1.12066237e+05, 1.12090633e+05, 1.12115031e+05
+, 1.12139429e+05, 1.12163829e+05, 1.12188231e+05, 1.12212633e+05
+, 1.12237037e+05, 1.12261443e+05, 1.12285849e+05, 1.12310257e+05
+, 1.12334667e+05, 1.12359077e+05, 1.12383489e+05, 1.12407903e+05
+, 1.12432317e+05, 1.12456733e+05, 1.12481150e+05, 1.12505569e+05
+, 1.12529989e+05, 1.12554410e+05, 1.12578833e+05, 1.12603257e+05
+, 1.12627682e+05, 1.12652108e+05, 1.12676536e+05, 1.12700965e+05
+, 1.12725396e+05, 1.12749828e+05, 1.12774261e+05, 1.12798695e+05
+, 1.12823131e+05, 1.12847568e+05, 1.12872007e+05, 1.12896446e+05
+, 1.12920888e+05, 1.12945330e+05, 1.12969774e+05, 1.12994219e+05
+, 1.13018665e+05, 1.13043113e+05, 1.13067562e+05, 1.13092012e+05
+, 1.13116464e+05, 1.13140917e+05, 1.13165371e+05, 1.13189827e+05
+, 1.13214284e+05, 1.13238742e+05, 1.13263202e+05, 1.13287662e+05
+, 1.13312125e+05, 1.13336588e+05, 1.13361053e+05, 1.13385519e+05
+, 1.13409987e+05, 1.13434456e+05, 1.13458926e+05, 1.13483397e+05
+, 1.13507870e+05, 1.13532344e+05, 1.13556820e+05, 1.13581296e+05
+, 1.13605774e+05, 1.13630254e+05, 1.13654735e+05, 1.13679217e+05
+, 1.13703700e+05, 1.13728185e+05, 1.13752671e+05, 1.13777158e+05
+, 1.13801646e+05, 1.13826136e+05, 1.13850628e+05, 1.13875120e+05
+, 1.13899614e+05, 1.13924109e+05, 1.13948606e+05, 1.13973104e+05
+, 1.13997603e+05, 1.14022103e+05, 1.14046605e+05, 1.14071108e+05
+, 1.14095613e+05, 1.14120118e+05, 1.14144625e+05, 1.14169134e+05
+, 1.14193643e+05, 1.14218154e+05, 1.14242667e+05, 1.14267180e+05
+, 1.14291695e+05, 1.14316211e+05, 1.14340729e+05, 1.14365248e+05
+, 1.14389768e+05, 1.14414290e+05, 1.14438812e+05, 1.14463337e+05
+, 1.14487862e+05, 1.14512389e+05, 1.14536917e+05, 1.14561446e+05
+, 1.14585977e+05, 1.14610509e+05, 1.14635042e+05, 1.14659577e+05
+, 1.14684113e+05, 1.14708650e+05, 1.14733189e+05, 1.14757729e+05
+, 1.14782270e+05, 1.14806812e+05, 1.14831356e+05, 1.14855901e+05
+, 1.14880448e+05, 1.14904996e+05, 1.14929545e+05, 1.14954095e+05
+, 1.14978647e+05, 1.15003200e+05, 1.15027754e+05, 1.15052310e+05
+, 1.15076867e+05, 1.15101425e+05, 1.15125984e+05, 1.15150545e+05
+, 1.15175107e+05, 1.15199671e+05, 1.15224236e+05, 1.15248802e+05
+, 1.15273369e+05, 1.15297938e+05, 1.15322508e+05, 1.15347079e+05
+, 1.15371652e+05, 1.15396226e+05, 1.15420801e+05, 1.15445378e+05
+, 1.15469956e+05, 1.15494535e+05, 1.15519115e+05, 1.15543697e+05
+, 1.15568280e+05, 1.15592865e+05, 1.15617450e+05, 1.15642037e+05
+, 1.15666626e+05, 1.15691215e+05, 1.15715806e+05, 1.15740399e+05
+, 1.15764992e+05, 1.15789587e+05, 1.15814183e+05, 1.15838781e+05
+, 1.15863379e+05, 1.15887980e+05, 1.15912581e+05, 1.15937184e+05
+, 1.15961788e+05, 1.15986393e+05, 1.16011000e+05, 1.16035608e+05
+, 1.16060217e+05, 1.16084827e+05, 1.16109439e+05, 1.16134052e+05
+, 1.16158667e+05, 1.16183282e+05, 1.16207900e+05, 1.16232518e+05
+, 1.16257138e+05, 1.16281759e+05, 1.16306381e+05, 1.16331004e+05
+, 1.16355629e+05, 1.16380255e+05, 1.16404883e+05, 1.16429512e+05
+, 1.16454142e+05, 1.16478773e+05, 1.16503406e+05, 1.16528040e+05
+, 1.16552675e+05, 1.16577312e+05, 1.16601950e+05, 1.16626589e+05
+, 1.16651229e+05, 1.16675871e+05, 1.16700514e+05, 1.16725159e+05
+, 1.16749804e+05, 1.16774451e+05, 1.16799100e+05, 1.16823749e+05
+, 1.16848400e+05, 1.16873052e+05, 1.16897706e+05, 1.16922361e+05
+, 1.16947017e+05, 1.16971674e+05, 1.16996333e+05, 1.17020993e+05
+, 1.17045654e+05, 1.17070317e+05, 1.17094981e+05, 1.17119646e+05
+, 1.17144313e+05, 1.17168980e+05, 1.17193649e+05, 1.17218320e+05
+, 1.17242992e+05, 1.17267665e+05, 1.17292339e+05, 1.17317014e+05
+, 1.17341691e+05, 1.17366370e+05, 1.17391049e+05, 1.17415730e+05
+, 1.17440412e+05, 1.17465095e+05, 1.17489780e+05, 1.17514466e+05
+, 1.17539153e+05, 1.17563842e+05, 1.17588532e+05, 1.17613223e+05
+, 1.17637915e+05, 1.17662609e+05, 1.17687304e+05, 1.17712000e+05
+, 1.17736698e+05, 1.17761397e+05, 1.17786097e+05, 1.17810799e+05
+, 1.17835501e+05, 1.17860206e+05, 1.17884911e+05, 1.17909618e+05
+, 1.17934326e+05, 1.17959035e+05, 1.17983745e+05, 1.18008457e+05
+, 1.18033171e+05, 1.18057885e+05, 1.18082601e+05, 1.18107318e+05
+, 1.18132036e+05, 1.18156756e+05, 1.18181477e+05, 1.18206199e+05
+, 1.18230922e+05, 1.18255647e+05, 1.18280373e+05, 1.18305101e+05
+, 1.18329829e+05, 1.18354559e+05, 1.18379291e+05, 1.18404023e+05
+, 1.18428757e+05, 1.18453492e+05, 1.18478229e+05, 1.18502966e+05
+, 1.18527705e+05, 1.18552446e+05, 1.18577187e+05, 1.18601930e+05
+, 1.18626674e+05, 1.18651420e+05, 1.18676167e+05, 1.18700915e+05
+, 1.18725664e+05, 1.18750415e+05, 1.18775166e+05, 1.18799920e+05
+, 1.18824674e+05, 1.18849430e+05, 1.18874187e+05, 1.18898945e+05
+, 1.18923705e+05, 1.18948466e+05, 1.18973228e+05, 1.18997992e+05
+, 1.19022757e+05, 1.19047523e+05, 1.19072290e+05, 1.19097059e+05
+, 1.19121829e+05, 1.19146600e+05, 1.19171372e+05, 1.19196146e+05
+, 1.19220921e+05, 1.19245698e+05, 1.19270475e+05, 1.19295254e+05
+, 1.19320035e+05, 1.19344816e+05, 1.19369599e+05, 1.19394383e+05
+, 1.19419169e+05, 1.19443955e+05, 1.19468743e+05, 1.19493532e+05
+, 1.19518323e+05, 1.19543115e+05, 1.19567908e+05, 1.19592702e+05
+, 1.19617498e+05, 1.19642295e+05, 1.19667093e+05, 1.19691893e+05
+, 1.19716694e+05, 1.19741496e+05, 1.19766299e+05, 1.19791104e+05
+, 1.19815910e+05, 1.19840717e+05, 1.19865526e+05, 1.19890335e+05
+, 1.19915146e+05, 1.19939959e+05, 1.19964773e+05, 1.19989587e+05
+, 1.20014404e+05, 1.20039221e+05, 1.20064040e+05, 1.20088860e+05
+, 1.20113681e+05, 1.20138504e+05, 1.20163328e+05, 1.20188153e+05
+, 1.20212980e+05, 1.20237808e+05, 1.20262637e+05, 1.20287467e+05
+, 1.20312299e+05, 1.20337131e+05, 1.20361966e+05, 1.20386801e+05
+, 1.20411638e+05, 1.20436476e+05, 1.20461315e+05, 1.20486156e+05
+, 1.20510998e+05, 1.20535841e+05, 1.20560685e+05, 1.20585531e+05
+, 1.20610378e+05, 1.20635226e+05, 1.20660076e+05, 1.20684927e+05
+, 1.20709779e+05, 1.20734632e+05, 1.20759487e+05, 1.20784343e+05
+, 1.20809200e+05, 1.20834058e+05, 1.20858918e+05, 1.20883779e+05
+, 1.20908641e+05, 1.20933505e+05, 1.20958370e+05, 1.20983236e+05
+, 1.21008104e+05, 1.21032972e+05, 1.21057842e+05, 1.21082714e+05
+, 1.21107586e+05, 1.21132460e+05, 1.21157335e+05, 1.21182212e+05
+, 1.21207089e+05, 1.21231968e+05, 1.21256848e+05, 1.21281730e+05
+, 1.21306613e+05, 1.21331497e+05, 1.21356382e+05, 1.21381269e+05
+, 1.21406156e+05, 1.21431046e+05, 1.21455936e+05, 1.21480828e+05
+, 1.21505721e+05, 1.21530615e+05, 1.21555510e+05, 1.21580407e+05
+, 1.21605305e+05, 1.21630205e+05, 1.21655105e+05, 1.21680007e+05
+, 1.21704910e+05, 1.21729815e+05, 1.21754721e+05, 1.21779628e+05
+, 1.21804536e+05, 1.21829445e+05, 1.21854356e+05, 1.21879268e+05
+, 1.21904182e+05, 1.21929096e+05, 1.21954012e+05, 1.21978929e+05
+, 1.22003848e+05, 1.22028767e+05, 1.22053688e+05, 1.22078611e+05
+, 1.22103534e+05, 1.22128459e+05, 1.22153385e+05, 1.22178313e+05
+, 1.22203241e+05, 1.22228171e+05, 1.22253102e+05, 1.22278035e+05
+, 1.22302968e+05, 1.22327903e+05, 1.22352840e+05, 1.22377777e+05
+, 1.22402716e+05, 1.22427656e+05, 1.22452597e+05, 1.22477540e+05
+, 1.22502484e+05, 1.22527429e+05, 1.22552375e+05, 1.22577323e+05
+, 1.22602272e+05, 1.22627222e+05, 1.22652174e+05, 1.22677126e+05
+, 1.22702080e+05, 1.22727036e+05, 1.22751992e+05, 1.22776950e+05
+, 1.22801909e+05, 1.22826870e+05, 1.22851831e+05, 1.22876794e+05
+, 1.22901758e+05, 1.22926724e+05, 1.22951691e+05, 1.22976659e+05
+, 1.23001628e+05, 1.23026598e+05, 1.23051570e+05, 1.23076543e+05
+, 1.23101517e+05, 1.23126493e+05, 1.23151470e+05, 1.23176448e+05
+, 1.23201427e+05, 1.23226408e+05, 1.23251390e+05, 1.23276373e+05
+, 1.23301358e+05, 1.23326343e+05, 1.23351330e+05, 1.23376318e+05
+, 1.23401308e+05, 1.23426299e+05, 1.23451291e+05, 1.23476284e+05
+, 1.23501279e+05, 1.23526274e+05, 1.23551272e+05, 1.23576270e+05
+, 1.23601270e+05, 1.23626270e+05, 1.23651273e+05, 1.23676276e+05
+, 1.23701281e+05, 1.23726287e+05, 1.23751294e+05, 1.23776302e+05
+, 1.23801312e+05, 1.23826323e+05, 1.23851335e+05, 1.23876349e+05
+, 1.23901364e+05, 1.23926380e+05, 1.23951397e+05, 1.23976416e+05
+, 1.24001435e+05, 1.24026456e+05, 1.24051479e+05, 1.24076502e+05
+, 1.24101527e+05, 1.24126554e+05, 1.24151581e+05, 1.24176610e+05
+, 1.24201640e+05, 1.24226671e+05, 1.24251703e+05, 1.24276737e+05
+, 1.24301772e+05, 1.24326808e+05, 1.24351846e+05, 1.24376884e+05
+, 1.24401924e+05, 1.24426966e+05, 1.24452008e+05, 1.24477052e+05
+, 1.24502097e+05, 1.24527143e+05, 1.24552191e+05, 1.24577240e+05
+, 1.24602290e+05, 1.24627341e+05, 1.24652394e+05, 1.24677448e+05
+, 1.24702503e+05, 1.24727559e+05, 1.24752617e+05, 1.24777676e+05
+, 1.24802736e+05, 1.24827797e+05, 1.24852860e+05, 1.24877924e+05
+, 1.24902989e+05, 1.24928056e+05, 1.24953123e+05, 1.24978192e+05
+, 1.25003262e+05, 1.25028334e+05, 1.25053407e+05, 1.25078481e+05
+, 1.25103556e+05, 1.25128632e+05, 1.25153710e+05, 1.25178789e+05
+, 1.25203869e+05, 1.25228951e+05, 1.25254034e+05, 1.25279118e+05
+, 1.25304203e+05, 1.25329290e+05, 1.25354377e+05, 1.25379467e+05
+, 1.25404557e+05, 1.25429648e+05, 1.25454741e+05, 1.25479835e+05
+, 1.25504931e+05, 1.25530027e+05, 1.25555125e+05, 1.25580224e+05
+, 1.25605325e+05, 1.25630426e+05, 1.25655529e+05, 1.25680633e+05
+, 1.25705739e+05, 1.25730845e+05, 1.25755953e+05, 1.25781062e+05
+, 1.25806173e+05, 1.25831284e+05, 1.25856397e+05, 1.25881511e+05
+, 1.25906627e+05, 1.25931743e+05, 1.25956861e+05, 1.25981980e+05
+, 1.26007101e+05, 1.26032222e+05, 1.26057345e+05, 1.26082470e+05
+, 1.26107595e+05, 1.26132722e+05, 1.26157850e+05, 1.26182979e+05
+, 1.26208109e+05, 1.26233241e+05, 1.26258374e+05, 1.26283508e+05
+, 1.26308643e+05, 1.26333780e+05, 1.26358918e+05, 1.26384057e+05
+, 1.26409197e+05, 1.26434339e+05, 1.26459482e+05, 1.26484626e+05
+, 1.26509772e+05, 1.26534918e+05, 1.26560066e+05, 1.26585215e+05
+, 1.26610366e+05, 1.26635518e+05, 1.26660670e+05, 1.26685825e+05
+, 1.26710980e+05, 1.26736137e+05, 1.26761295e+05, 1.26786454e+05
+, 1.26811614e+05, 1.26836776e+05, 1.26861939e+05, 1.26887103e+05
+, 1.26912268e+05, 1.26937435e+05, 1.26962603e+05, 1.26987772e+05
+, 1.27012942e+05, 1.27038114e+05, 1.27063287e+05, 1.27088461e+05
+, 1.27113636e+05, 1.27138813e+05, 1.27163991e+05, 1.27189170e+05
+, 1.27214350e+05, 1.27239532e+05, 1.27264715e+05, 1.27289899e+05
+, 1.27315084e+05, 1.27340271e+05, 1.27365459e+05, 1.27390648e+05
+, 1.27415838e+05, 1.27441030e+05, 1.27466223e+05, 1.27491417e+05
+, 1.27516612e+05, 1.27541809e+05, 1.27567006e+05, 1.27592205e+05
+, 1.27617406e+05, 1.27642607e+05, 1.27667810e+05, 1.27693014e+05
+, 1.27718219e+05, 1.27743426e+05, 1.27768633e+05, 1.27793842e+05
+, 1.27819053e+05, 1.27844264e+05, 1.27869477e+05, 1.27894691e+05
+, 1.27919906e+05, 1.27945123e+05, 1.27970340e+05, 1.27995559e+05
+, 1.28020779e+05, 1.28046001e+05, 1.28071223e+05, 1.28096447e+05
+, 1.28121672e+05, 1.28146899e+05, 1.28172127e+05, 1.28197355e+05
+, 1.28222585e+05, 1.28247817e+05, 1.28273049e+05, 1.28298283e+05
+, 1.28323518e+05, 1.28348755e+05, 1.28373992e+05, 1.28399231e+05
+, 1.28424471e+05, 1.28449712e+05, 1.28474955e+05, 1.28500199e+05
+, 1.28525444e+05, 1.28550690e+05, 1.28575937e+05, 1.28601186e+05
+, 1.28626436e+05, 1.28651687e+05, 1.28676940e+05, 1.28702193e+05
+, 1.28727448e+05, 1.28752704e+05, 1.28777962e+05, 1.28803220e+05
+, 1.28828480e+05, 1.28853741e+05, 1.28879004e+05, 1.28904267e+05
+, 1.28929532e+05, 1.28954798e+05, 1.28980065e+05, 1.29005334e+05
+, 1.29030604e+05, 1.29055875e+05, 1.29081147e+05, 1.29106420e+05
+, 1.29131695e+05, 1.29156971e+05, 1.29182248e+05, 1.29207527e+05
+, 1.29232806e+05, 1.29258087e+05, 1.29283369e+05, 1.29308653e+05
+, 1.29333937e+05, 1.29359223e+05, 1.29384510e+05, 1.29409799e+05
+, 1.29435088e+05, 1.29460379e+05, 1.29485671e+05, 1.29510964e+05
+, 1.29536259e+05, 1.29561555e+05, 1.29586852e+05, 1.29612150e+05
+, 1.29637449e+05, 1.29662750e+05, 1.29688052e+05, 1.29713355e+05
+, 1.29738659e+05, 1.29763965e+05, 1.29789272e+05, 1.29814580e+05
+, 1.29839889e+05, 1.29865200e+05, 1.29890511e+05, 1.29915824e+05
+, 1.29941139e+05, 1.29966454e+05, 1.29991771e+05, 1.30017089e+05
+, 1.30042408e+05, 1.30067728e+05, 1.30093050e+05, 1.30118373e+05
+, 1.30143697e+05, 1.30169022e+05, 1.30194349e+05, 1.30219677e+05
+, 1.30245006e+05, 1.30270336e+05, 1.30295667e+05, 1.30321000e+05
+, 1.30346334e+05, 1.30371669e+05, 1.30397006e+05, 1.30422343e+05
+, 1.30447682e+05, 1.30473022e+05, 1.30498363e+05, 1.30523706e+05
+, 1.30549050e+05, 1.30574395e+05, 1.30599741e+05, 1.30625089e+05
+, 1.30650437e+05, 1.30675787e+05, 1.30701138e+05, 1.30726491e+05
+, 1.30751844e+05, 1.30777199e+05, 1.30802555e+05, 1.30827913e+05
+, 1.30853271e+05, 1.30878631e+05, 1.30903992e+05, 1.30929354e+05
+, 1.30954718e+05, 1.30980082e+05, 1.31005448e+05, 1.31030816e+05
+, 1.31056184e+05, 1.31081553e+05, 1.31106924e+05, 1.31132296e+05
+, 1.31157670e+05, 1.31183044e+05, 1.31208420e+05, 1.31233797e+05
+, 1.31259175e+05, 1.31284554e+05, 1.31309935e+05, 1.31335317e+05
+, 1.31360700e+05, 1.31386084e+05, 1.31411470e+05, 1.31436857e+05
+, 1.31462245e+05, 1.31487634e+05, 1.31513024e+05, 1.31538416e+05
+, 1.31563809e+05, 1.31589203e+05, 1.31614598e+05, 1.31639995e+05
+, 1.31665393e+05, 1.31690792e+05, 1.31716192e+05, 1.31741594e+05
+, 1.31766996e+05, 1.31792400e+05, 1.31817805e+05, 1.31843212e+05
+, 1.31868619e+05, 1.31894028e+05, 1.31919438e+05, 1.31944850e+05
+, 1.31970262e+05, 1.31995676e+05, 1.32021091e+05, 1.32046507e+05
+, 1.32071924e+05, 1.32097343e+05, 1.32122763e+05, 1.32148184e+05
+, 1.32173606e+05, 1.32199030e+05, 1.32224454e+05, 1.32249880e+05
+, 1.32275307e+05, 1.32300736e+05, 1.32326165e+05, 1.32351596e+05
+, 1.32377028e+05, 1.32402462e+05, 1.32427896e+05, 1.32453332e+05
+, 1.32478769e+05, 1.32504207e+05, 1.32529646e+05, 1.32555087e+05
+, 1.32580529e+05, 1.32605972e+05, 1.32631416e+05, 1.32656861e+05
+, 1.32682308e+05, 1.32707756e+05, 1.32733205e+05, 1.32758656e+05
+, 1.32784107e+05, 1.32809560e+05, 1.32835014e+05, 1.32860469e+05
+, 1.32885926e+05, 1.32911383e+05, 1.32936842e+05, 1.32962302e+05
+, 1.32987764e+05, 1.33013226e+05, 1.33038690e+05, 1.33064155e+05
+, 1.33089621e+05, 1.33115089e+05, 1.33140557e+05, 1.33166027e+05
+, 1.33191498e+05, 1.33216971e+05, 1.33242444e+05, 1.33267919e+05
+, 1.33293395e+05, 1.33318872e+05, 1.33344350e+05, 1.33369830e+05
+, 1.33395311e+05, 1.33420793e+05, 1.33446276e+05, 1.33471761e+05
+, 1.33497246e+05, 1.33522733e+05, 1.33548221e+05, 1.33573711e+05
+, 1.33599201e+05, 1.33624693e+05, 1.33650186e+05, 1.33675680e+05
+, 1.33701176e+05, 1.33726672e+05, 1.33752170e+05, 1.33777669e+05
+, 1.33803170e+05, 1.33828671e+05, 1.33854174e+05, 1.33879678e+05
+, 1.33905183e+05, 1.33930689e+05, 1.33956197e+05, 1.33981706e+05
+, 1.34007216e+05, 1.34032727e+05, 1.34058239e+05, 1.34083753e+05
+, 1.34109268e+05, 1.34134784e+05, 1.34160301e+05, 1.34185819e+05
+, 1.34211339e+05, 1.34236860e+05, 1.34262382e+05, 1.34287906e+05
+, 1.34313430e+05, 1.34338956e+05, 1.34364483e+05, 1.34390011e+05
+, 1.34415541e+05, 1.34441071e+05, 1.34466603e+05, 1.34492136e+05
+, 1.34517670e+05, 1.34543206e+05, 1.34568742e+05, 1.34594280e+05
+, 1.34619819e+05, 1.34645360e+05, 1.34670901e+05, 1.34696444e+05
+, 1.34721988e+05, 1.34747533e+05, 1.34773080e+05, 1.34798627e+05
+, 1.34824176e+05, 1.34849726e+05, 1.34875277e+05, 1.34900830e+05
+, 1.34926383e+05, 1.34951938e+05, 1.34977494e+05, 1.35003051e+05
+, 1.35028610e+05, 1.35054169e+05, 1.35079730e+05, 1.35105292e+05
+, 1.35130856e+05, 1.35156420e+05, 1.35181986e+05, 1.35207553e+05
+, 1.35233121e+05, 1.35258690e+05, 1.35284261e+05, 1.35309833e+05
+, 1.35335406e+05, 1.35360980e+05, 1.35386555e+05, 1.35412132e+05
+, 1.35437710e+05, 1.35463289e+05, 1.35488869e+05, 1.35514450e+05
+, 1.35540033e+05, 1.35565617e+05, 1.35591202e+05, 1.35616788e+05
+, 1.35642376e+05, 1.35667964e+05, 1.35693554e+05, 1.35719145e+05
+, 1.35744738e+05, 1.35770331e+05, 1.35795926e+05, 1.35821522e+05
+, 1.35847119e+05, 1.35872717e+05, 1.35898317e+05, 1.35923918e+05
+, 1.35949519e+05, 1.35975123e+05, 1.36000727e+05, 1.36026333e+05
+, 1.36051939e+05, 1.36077547e+05, 1.36103156e+05, 1.36128767e+05
+, 1.36154378e+05, 1.36179991e+05, 1.36205605e+05, 1.36231220e+05
+, 1.36256837e+05, 1.36282454e+05, 1.36308073e+05, 1.36333693e+05
+, 1.36359314e+05, 1.36384937e+05, 1.36410560e+05, 1.36436185e+05
+, 1.36461811e+05, 1.36487439e+05, 1.36513067e+05, 1.36538697e+05
+, 1.36564327e+05, 1.36589960e+05, 1.36615593e+05, 1.36641227e+05
+, 1.36666863e+05, 1.36692500e+05, 1.36718138e+05, 1.36743777e+05
+, 1.36769418e+05, 1.36795059e+05, 1.36820702e+05, 1.36846346e+05
+, 1.36871991e+05, 1.36897638e+05, 1.36923285e+05, 1.36948934e+05
+, 1.36974584e+05, 1.37000236e+05, 1.37025888e+05, 1.37051542e+05
+, 1.37077197e+05, 1.37102853e+05, 1.37128510e+05, 1.37154169e+05
+, 1.37179828e+05, 1.37205489e+05, 1.37231151e+05, 1.37256814e+05
+, 1.37282479e+05, 1.37308145e+05, 1.37333811e+05, 1.37359480e+05
+, 1.37385149e+05, 1.37410819e+05, 1.37436491e+05, 1.37462164e+05
+, 1.37487838e+05, 1.37513513e+05, 1.37539190e+05, 1.37564867e+05
+, 1.37590546e+05, 1.37616226e+05, 1.37641907e+05, 1.37667590e+05
+, 1.37693274e+05, 1.37718958e+05, 1.37744644e+05, 1.37770332e+05
+, 1.37796020e+05, 1.37821710e+05, 1.37847401e+05, 1.37873093e+05
+, 1.37898786e+05, 1.37924480e+05, 1.37950176e+05, 1.37975873e+05
+, 1.38001571e+05, 1.38027270e+05, 1.38052970e+05, 1.38078672e+05
+, 1.38104375e+05, 1.38130079e+05, 1.38155784e+05, 1.38181490e+05
+, 1.38207198e+05, 1.38232907e+05, 1.38258617e+05, 1.38284328e+05
+, 1.38310040e+05, 1.38335754e+05, 1.38361469e+05, 1.38387185e+05
+, 1.38412902e+05, 1.38438620e+05, 1.38464340e+05, 1.38490060e+05
+, 1.38515782e+05, 1.38541505e+05, 1.38567230e+05, 1.38592955e+05
+, 1.38618682e+05, 1.38644410e+05, 1.38670139e+05, 1.38695869e+05
+, 1.38721601e+05, 1.38747333e+05, 1.38773067e+05, 1.38798802e+05
+, 1.38824538e+05, 1.38850276e+05, 1.38876015e+05, 1.38901754e+05
+, 1.38927495e+05, 1.38953238e+05, 1.38978981e+05, 1.39004726e+05
+, 1.39030471e+05, 1.39056218e+05, 1.39081967e+05, 1.39107716e+05
+, 1.39133466e+05, 1.39159218e+05, 1.39184971e+05, 1.39210725e+05
+, 1.39236481e+05, 1.39262237e+05, 1.39287995e+05, 1.39313754e+05
+, 1.39339514e+05, 1.39365275e+05, 1.39391038e+05, 1.39416801e+05
+, 1.39442566e+05, 1.39468332e+05, 1.39494099e+05, 1.39519868e+05
+, 1.39545637e+05, 1.39571408e+05, 1.39597180e+05, 1.39622953e+05
+, 1.39648728e+05, 1.39674503e+05, 1.39700280e+05, 1.39726058e+05
+, 1.39751837e+05, 1.39777617e+05, 1.39803399e+05, 1.39829181e+05
+, 1.39854965e+05, 1.39880750e+05, 1.39906537e+05, 1.39932324e+05
+, 1.39958113e+05, 1.39983903e+05, 1.40009694e+05, 1.40035486e+05
+, 1.40061279e+05, 1.40087074e+05, 1.40112869e+05, 1.40138666e+05
+, 1.40164465e+05, 1.40190264e+05, 1.40216064e+05, 1.40241866e+05
+, 1.40267669e+05, 1.40293473e+05, 1.40319278e+05, 1.40345085e+05
+, 1.40370892e+05, 1.40396701e+05, 1.40422511e+05, 1.40448322e+05
+, 1.40474135e+05, 1.40499948e+05, 1.40525763e+05, 1.40551579e+05
+, 1.40577396e+05, 1.40603214e+05, 1.40629034e+05, 1.40654854e+05
+, 1.40680676e+05, 1.40706499e+05, 1.40732324e+05, 1.40758149e+05
+, 1.40783976e+05, 1.40809803e+05, 1.40835632e+05, 1.40861462e+05
+, 1.40887294e+05, 1.40913126e+05, 1.40938960e+05, 1.40964795e+05
+, 1.40990631e+05, 1.41016468e+05, 1.41042307e+05, 1.41068146e+05
+, 1.41093987e+05, 1.41119829e+05, 1.41145672e+05, 1.41171516e+05
+, 1.41197362e+05, 1.41223209e+05, 1.41249057e+05, 1.41274906e+05
+, 1.41300756e+05, 1.41326607e+05, 1.41352460e+05, 1.41378314e+05
+, 1.41404169e+05, 1.41430025e+05, 1.41455882e+05, 1.41481741e+05
+, 1.41507601e+05, 1.41533461e+05, 1.41559324e+05, 1.41585187e+05
+, 1.41611051e+05, 1.41636917e+05, 1.41662784e+05, 1.41688652e+05
+, 1.41714521e+05, 1.41740391e+05, 1.41766263e+05, 1.41792135e+05
+, 1.41818009e+05, 1.41843884e+05, 1.41869761e+05, 1.41895638e+05
+, 1.41921517e+05, 1.41947396e+05, 1.41973277e+05, 1.41999160e+05
+, 1.42025043e+05, 1.42050927e+05, 1.42076813e+05, 1.42102700e+05
+, 1.42128588e+05, 1.42154477e+05, 1.42180368e+05, 1.42206259e+05
+, 1.42232152e+05, 1.42258046e+05, 1.42283941e+05, 1.42309837e+05
+, 1.42335735e+05, 1.42361633e+05, 1.42387533e+05, 1.42413434e+05
+, 1.42439336e+05, 1.42465240e+05, 1.42491144e+05, 1.42517050e+05
+, 1.42542957e+05, 1.42568865e+05, 1.42594774e+05, 1.42620685e+05
+, 1.42646596e+05, 1.42672509e+05, 1.42698423e+05, 1.42724338e+05
+, 1.42750254e+05, 1.42776172e+05, 1.42802091e+05, 1.42828010e+05
+, 1.42853931e+05, 1.42879854e+05, 1.42905777e+05, 1.42931701e+05
+, 1.42957627e+05, 1.42983554e+05, 1.43009482e+05, 1.43035411e+05
+, 1.43061342e+05, 1.43087273e+05, 1.43113206e+05, 1.43139140e+05
+, 1.43165075e+05, 1.43191012e+05, 1.43216949e+05, 1.43242888e+05
+, 1.43268827e+05, 1.43294768e+05, 1.43320711e+05, 1.43346654e+05
+, 1.43372598e+05, 1.43398544e+05, 1.43424491e+05, 1.43450439e+05
+, 1.43476388e+05, 1.43502339e+05, 1.43528290e+05, 1.43554243e+05
+, 1.43580197e+05, 1.43606152e+05, 1.43632108e+05, 1.43658065e+05
+, 1.43684024e+05, 1.43709984e+05, 1.43735945e+05, 1.43761907e+05
+, 1.43787870e+05, 1.43813835e+05, 1.43839800e+05, 1.43865767e+05
+, 1.43891735e+05, 1.43917704e+05, 1.43943674e+05, 1.43969646e+05
+, 1.43995619e+05, 1.44021592e+05, 1.44047567e+05, 1.44073543e+05
+, 1.44099521e+05, 1.44125499e+05, 1.44151479e+05, 1.44177460e+05
+, 1.44203442e+05, 1.44229425e+05, 1.44255409e+05, 1.44281395e+05
+, 1.44307382e+05, 1.44333370e+05, 1.44359359e+05, 1.44385349e+05
+, 1.44411340e+05, 1.44437333e+05, 1.44463326e+05, 1.44489321e+05
+, 1.44515317e+05, 1.44541315e+05, 1.44567313e+05, 1.44593313e+05
+, 1.44619313e+05, 1.44645315e+05, 1.44671318e+05, 1.44697322e+05
+, 1.44723328e+05, 1.44749334e+05, 1.44775342e+05, 1.44801351e+05
+, 1.44827361e+05, 1.44853372e+05, 1.44879385e+05, 1.44905398e+05
+, 1.44931413e+05, 1.44957429e+05, 1.44983446e+05, 1.45009464e+05
+, 1.45035484e+05, 1.45061504e+05, 1.45087526e+05, 1.45113549e+05
+, 1.45139573e+05, 1.45165598e+05, 1.45191625e+05, 1.45217652e+05
+, 1.45243681e+05, 1.45269711e+05, 1.45295742e+05, 1.45321774e+05
+, 1.45347808e+05, 1.45373842e+05, 1.45399878e+05, 1.45425915e+05
+, 1.45451953e+05, 1.45477992e+05, 1.45504033e+05, 1.45530074e+05
+, 1.45556117e+05, 1.45582161e+05, 1.45608206e+05, 1.45634252e+05
+, 1.45660300e+05, 1.45686348e+05, 1.45712398e+05, 1.45738449e+05
+, 1.45764501e+05, 1.45790554e+05, 1.45816609e+05, 1.45842664e+05
+, 1.45868721e+05, 1.45894779e+05, 1.45920838e+05, 1.45946898e+05
+, 1.45972959e+05, 1.45999022e+05, 1.46025085e+05, 1.46051150e+05
+, 1.46077216e+05, 1.46103284e+05, 1.46129352e+05, 1.46155421e+05
+, 1.46181492e+05, 1.46207564e+05, 1.46233637e+05, 1.46259711e+05
+, 1.46285786e+05, 1.46311863e+05, 1.46337940e+05, 1.46364019e+05
+, 1.46390099e+05, 1.46416180e+05, 1.46442263e+05, 1.46468346e+05
+, 1.46494431e+05, 1.46520516e+05, 1.46546603e+05, 1.46572691e+05
+, 1.46598781e+05, 1.46624871e+05, 1.46650963e+05, 1.46677055e+05
+, 1.46703149e+05, 1.46729244e+05, 1.46755341e+05, 1.46781438e+05
+, 1.46807537e+05, 1.46833636e+05, 1.46859737e+05, 1.46885839e+05
+, 1.46911942e+05, 1.46938047e+05, 1.46964152e+05, 1.46990259e+05
+, 1.47016367e+05, 1.47042476e+05, 1.47068586e+05, 1.47094697e+05
+, 1.47120809e+05, 1.47146923e+05, 1.47173038e+05, 1.47199154e+05
+, 1.47225271e+05, 1.47251389e+05, 1.47277508e+05, 1.47303629e+05
+, 1.47329751e+05, 1.47355874e+05, 1.47381998e+05, 1.47408123e+05
+, 1.47434249e+05, 1.47460377e+05, 1.47486505e+05, 1.47512635e+05
+, 1.47538766e+05, 1.47564898e+05, 1.47591032e+05, 1.47617166e+05
+, 1.47643302e+05, 1.47669438e+05, 1.47695576e+05, 1.47721715e+05
+, 1.47747856e+05, 1.47773997e+05, 1.47800140e+05, 1.47826283e+05
+, 1.47852428e+05, 1.47878574e+05, 1.47904721e+05, 1.47930870e+05
+, 1.47957019e+05, 1.47983170e+05, 1.48009322e+05, 1.48035474e+05
+, 1.48061629e+05, 1.48087784e+05, 1.48113940e+05, 1.48140098e+05
+, 1.48166257e+05, 1.48192416e+05, 1.48218577e+05, 1.48244740e+05
+, 1.48270903e+05, 1.48297067e+05, 1.48323233e+05, 1.48349400e+05
+, 1.48375568e+05, 1.48401737e+05, 1.48427907e+05, 1.48454079e+05
+, 1.48480251e+05, 1.48506425e+05, 1.48532600e+05, 1.48558776e+05
+, 1.48584953e+05, 1.48611131e+05, 1.48637311e+05, 1.48663491e+05
+, 1.48689673e+05, 1.48715856e+05, 1.48742040e+05, 1.48768226e+05
+, 1.48794412e+05, 1.48820599e+05, 1.48846788e+05, 1.48872978e+05
+, 1.48899169e+05, 1.48925361e+05, 1.48951555e+05, 1.48977749e+05
+, 1.49003945e+05, 1.49030141e+05, 1.49056339e+05, 1.49082538e+05
+, 1.49108739e+05, 1.49134940e+05, 1.49161143e+05, 1.49187346e+05
+, 1.49213551e+05, 1.49239757e+05, 1.49265964e+05, 1.49292172e+05
+, 1.49318382e+05, 1.49344592e+05, 1.49370804e+05, 1.49397017e+05
+, 1.49423231e+05, 1.49449446e+05, 1.49475663e+05, 1.49501880e+05
+, 1.49528099e+05, 1.49554318e+05, 1.49580539e+05, 1.49606761e+05
+, 1.49632985e+05, 1.49659209e+05, 1.49685435e+05, 1.49711661e+05
+, 1.49737889e+05, 1.49764118e+05, 1.49790348e+05, 1.49816579e+05
+, 1.49842812e+05, 1.49869045e+05, 1.49895280e+05, 1.49921516e+05
+, 1.49947753e+05, 1.49973991e+05, 1.50000230e+05, 1.50026471e+05
+, 1.50052712e+05, 1.50078955e+05, 1.50105199e+05, 1.50131444e+05
+, 1.50157690e+05, 1.50183938e+05, 1.50210186e+05, 1.50236436e+05
+, 1.50262686e+05, 1.50288938e+05, 1.50315191e+05, 1.50341446e+05
+, 1.50367701e+05, 1.50393957e+05, 1.50420215e+05, 1.50446474e+05
+, 1.50472734e+05, 1.50498995e+05, 1.50525257e+05, 1.50551521e+05
+, 1.50577785e+05, 1.50604051e+05, 1.50630318e+05, 1.50656585e+05
+, 1.50682855e+05, 1.50709125e+05, 1.50735396e+05, 1.50761669e+05
+, 1.50787942e+05, 1.50814217e+05, 1.50840493e+05, 1.50866770e+05
+, 1.50893049e+05, 1.50919328e+05, 1.50945609e+05, 1.50971890e+05
+, 1.50998173e+05, 1.51024457e+05, 1.51050742e+05, 1.51077028e+05
+, 1.51103316e+05, 1.51129604e+05, 1.51155894e+05, 1.51182185e+05
+, 1.51208477e+05, 1.51234770e+05, 1.51261064e+05, 1.51287360e+05
+, 1.51313656e+05, 1.51339954e+05, 1.51366253e+05, 1.51392553e+05
+, 1.51418854e+05, 1.51445156e+05, 1.51471460e+05, 1.51497764e+05
+, 1.51524070e+05, 1.51550377e+05, 1.51576685e+05, 1.51602994e+05
+, 1.51629304e+05, 1.51655615e+05, 1.51681928e+05, 1.51708242e+05
+, 1.51734556e+05, 1.51760872e+05, 1.51787190e+05, 1.51813508e+05
+, 1.51839827e+05, 1.51866148e+05, 1.51892469e+05, 1.51918792e+05
+, 1.51945116e+05, 1.51971441e+05, 1.51997767e+05, 1.52024095e+05
+, 1.52050423e+05, 1.52076753e+05, 1.52103084e+05, 1.52129416e+05
+, 1.52155749e+05, 1.52182083e+05, 1.52208418e+05, 1.52234755e+05
+, 1.52261092e+05, 1.52287431e+05, 1.52313771e+05, 1.52340112e+05
+, 1.52366454e+05, 1.52392798e+05, 1.52419142e+05, 1.52445488e+05
+, 1.52471834e+05, 1.52498182e+05, 1.52524531e+05, 1.52550881e+05
+, 1.52577233e+05, 1.52603585e+05, 1.52629939e+05, 1.52656293e+05
+, 1.52682649e+05, 1.52709006e+05, 1.52735364e+05, 1.52761724e+05
+, 1.52788084e+05, 1.52814445e+05, 1.52840808e+05, 1.52867172e+05
+, 1.52893537e+05, 1.52919903e+05, 1.52946270e+05, 1.52972638e+05
+, 1.52999008e+05, 1.53025379e+05, 1.53051750e+05, 1.53078123e+05
+, 1.53104497e+05, 1.53130872e+05, 1.53157249e+05, 1.53183626e+05
+, 1.53210005e+05, 1.53236384e+05, 1.53262765e+05, 1.53289147e+05
+, 1.53315530e+05, 1.53341914e+05, 1.53368300e+05, 1.53394686e+05
+, 1.53421074e+05, 1.53447463e+05, 1.53473853e+05, 1.53500244e+05
+, 1.53526636e+05, 1.53553029e+05, 1.53579424e+05, 1.53605819e+05
+, 1.53632216e+05, 1.53658614e+05, 1.53685013e+05, 1.53711413e+05
+, 1.53737814e+05, 1.53764217e+05, 1.53790620e+05, 1.53817025e+05
+, 1.53843431e+05, 1.53869838e+05, 1.53896246e+05, 1.53922655e+05
+, 1.53949065e+05, 1.53975477e+05, 1.54001889e+05, 1.54028303e+05
+, 1.54054718e+05, 1.54081134e+05, 1.54107551e+05, 1.54133969e+05
+, 1.54160388e+05, 1.54186809e+05, 1.54213231e+05, 1.54239653e+05
+, 1.54266077e+05, 1.54292502e+05, 1.54318929e+05, 1.54345356e+05
+, 1.54371784e+05, 1.54398214e+05, 1.54424645e+05, 1.54451076e+05
+, 1.54477509e+05, 1.54503943e+05, 1.54530379e+05, 1.54556815e+05
+, 1.54583252e+05, 1.54609691e+05, 1.54636131e+05, 1.54662572e+05
+, 1.54689014e+05, 1.54715457e+05, 1.54741901e+05, 1.54768346e+05
+, 1.54794793e+05, 1.54821241e+05, 1.54847689e+05, 1.54874139e+05
+, 1.54900590e+05, 1.54927043e+05, 1.54953496e+05, 1.54979950e+05
+, 1.55006406e+05, 1.55032862e+05, 1.55059320e+05, 1.55085779e+05
+, 1.55112239e+05, 1.55138700e+05, 1.55165163e+05, 1.55191626e+05
+, 1.55218091e+05, 1.55244557e+05, 1.55271023e+05, 1.55297491e+05
+, 1.55323960e+05, 1.55350431e+05, 1.55376902e+05, 1.55403375e+05
+, 1.55429848e+05, 1.55456323e+05, 1.55482799e+05, 1.55509276e+05
+, 1.55535754e+05, 1.55562233e+05, 1.55588713e+05, 1.55615195e+05
+, 1.55641678e+05, 1.55668161e+05, 1.55694646e+05, 1.55721132e+05
+, 1.55747619e+05, 1.55774108e+05, 1.55800597e+05, 1.55827087e+05
+, 1.55853579e+05, 1.55880072e+05, 1.55906566e+05, 1.55933061e+05
+, 1.55959557e+05, 1.55986054e+05, 1.56012552e+05, 1.56039052e+05
+, 1.56065553e+05, 1.56092054e+05, 1.56118557e+05, 1.56145061e+05
+, 1.56171566e+05, 1.56198073e+05, 1.56224580e+05, 1.56251089e+05
+, 1.56277598e+05, 1.56304109e+05, 1.56330621e+05, 1.56357134e+05
+, 1.56383648e+05, 1.56410163e+05, 1.56436680e+05, 1.56463197e+05
+, 1.56489716e+05, 1.56516235e+05, 1.56542756e+05, 1.56569278e+05
+, 1.56595801e+05, 1.56622326e+05, 1.56648851e+05, 1.56675378e+05
+, 1.56701905e+05, 1.56728434e+05, 1.56754964e+05, 1.56781495e+05
+, 1.56808027e+05, 1.56834560e+05, 1.56861094e+05, 1.56887630e+05
+, 1.56914166e+05, 1.56940704e+05, 1.56967243e+05, 1.56993783e+05
+, 1.57020324e+05, 1.57046866e+05, 1.57073410e+05, 1.57099954e+05
+, 1.57126500e+05, 1.57153046e+05, 1.57179594e+05, 1.57206143e+05
+, 1.57232693e+05, 1.57259244e+05, 1.57285796e+05, 1.57312350e+05
+, 1.57338904e+05, 1.57365460e+05, 1.57392017e+05, 1.57418575e+05
+, 1.57445134e+05, 1.57471694e+05, 1.57498255e+05, 1.57524817e+05
+, 1.57551381e+05, 1.57577946e+05, 1.57604511e+05, 1.57631078e+05
+, 1.57657646e+05, 1.57684215e+05, 1.57710785e+05, 1.57737357e+05
+, 1.57763929e+05, 1.57790503e+05, 1.57817077e+05, 1.57843653e+05
+, 1.57870230e+05, 1.57896808e+05, 1.57923387e+05, 1.57949968e+05
+, 1.57976549e+05, 1.58003132e+05, 1.58029715e+05, 1.58056300e+05
+, 1.58082886e+05, 1.58109473e+05, 1.58136061e+05, 1.58162650e+05
+, 1.58189240e+05, 1.58215832e+05, 1.58242424e+05, 1.58269018e+05
+, 1.58295613e+05, 1.58322209e+05, 1.58348806e+05, 1.58375404e+05
+, 1.58402003e+05, 1.58428604e+05, 1.58455205e+05, 1.58481808e+05
+, 1.58508412e+05, 1.58535016e+05, 1.58561622e+05, 1.58588230e+05
+, 1.58614838e+05, 1.58641447e+05, 1.58668057e+05, 1.58694669e+05
+, 1.58721282e+05, 1.58747895e+05, 1.58774510e+05, 1.58801126e+05
+, 1.58827744e+05, 1.58854362e+05, 1.58880981e+05, 1.58907602e+05
+, 1.58934223e+05, 1.58960846e+05, 1.58987470e+05, 1.59014095e+05
+, 1.59040721e+05, 1.59067348e+05, 1.59093976e+05, 1.59120606e+05
+, 1.59147236e+05, 1.59173868e+05, 1.59200500e+05, 1.59227134e+05
+, 1.59253769e+05, 1.59280405e+05, 1.59307042e+05, 1.59333681e+05
+, 1.59360320e+05, 1.59386961e+05, 1.59413602e+05, 1.59440245e+05
+, 1.59466889e+05, 1.59493534e+05, 1.59520180e+05, 1.59546827e+05
+, 1.59573476e+05, 1.59600125e+05, 1.59626776e+05, 1.59653427e+05
+, 1.59680080e+05, 1.59706734e+05, 1.59733389e+05, 1.59760045e+05
+, 1.59786702e+05, 1.59813361e+05, 1.59840020e+05, 1.59866681e+05
+, 1.59893342e+05, 1.59920005e+05, 1.59946669e+05, 1.59973334e+05
+, 1.60000000e+05, 1.60026667e+05, 1.60053336e+05, 1.60080005e+05
+, 1.60106676e+05, 1.60133347e+05, 1.60160020e+05, 1.60186694e+05
+, 1.60213369e+05, 1.60240045e+05, 1.60266722e+05, 1.60293401e+05
+, 1.60320080e+05, 1.60346761e+05, 1.60373442e+05, 1.60400125e+05
+, 1.60426809e+05, 1.60453494e+05, 1.60480180e+05, 1.60506867e+05
+, 1.60533555e+05, 1.60560245e+05, 1.60586935e+05, 1.60613627e+05
+, 1.60640320e+05, 1.60667014e+05, 1.60693709e+05, 1.60720405e+05
+, 1.60747102e+05, 1.60773800e+05, 1.60800500e+05, 1.60827200e+05
+, 1.60853902e+05, 1.60880604e+05, 1.60907308e+05, 1.60934013e+05
+, 1.60960719e+05, 1.60987426e+05, 1.61014135e+05, 1.61040844e+05
+, 1.61067555e+05, 1.61094266e+05, 1.61120979e+05, 1.61147693e+05
+, 1.61174408e+05, 1.61201124e+05, 1.61227841e+05, 1.61254559e+05
+, 1.61281278e+05, 1.61307999e+05, 1.61334720e+05, 1.61361443e+05
+, 1.61388167e+05, 1.61414892e+05, 1.61441618e+05, 1.61468345e+05
+, 1.61495073e+05, 1.61521802e+05, 1.61548533e+05, 1.61575264e+05
+, 1.61601997e+05, 1.61628730e+05, 1.61655465e+05, 1.61682201e+05
+, 1.61708938e+05, 1.61735676e+05, 1.61762416e+05, 1.61789156e+05
+, 1.61815897e+05, 1.61842640e+05, 1.61869384e+05, 1.61896128e+05
+, 1.61922874e+05, 1.61949621e+05, 1.61976369e+05, 1.62003119e+05
+, 1.62029869e+05, 1.62056620e+05, 1.62083373e+05, 1.62110126e+05
+, 1.62136881e+05, 1.62163637e+05, 1.62190394e+05, 1.62217152e+05
+, 1.62243911e+05, 1.62270671e+05, 1.62297432e+05, 1.62324195e+05
+, 1.62350958e+05, 1.62377723e+05, 1.62404489e+05, 1.62431256e+05
+, 1.62458024e+05, 1.62484793e+05, 1.62511563e+05, 1.62538334e+05
+, 1.62565106e+05, 1.62591880e+05, 1.62618654e+05, 1.62645430e+05
+, 1.62672207e+05, 1.62698985e+05, 1.62725764e+05, 1.62752544e+05
+, 1.62779325e+05, 1.62806107e+05, 1.62832891e+05, 1.62859675e+05
+, 1.62886461e+05, 1.62913247e+05, 1.62940035e+05, 1.62966824e+05
+, 1.62993614e+05, 1.63020405e+05, 1.63047197e+05, 1.63073991e+05
+, 1.63100785e+05, 1.63127580e+05, 1.63154377e+05, 1.63181175e+05
+, 1.63207973e+05, 1.63234773e+05, 1.63261574e+05, 1.63288376e+05
+, 1.63315180e+05, 1.63341984e+05, 1.63368789e+05, 1.63395596e+05
+, 1.63422403e+05, 1.63449212e+05, 1.63476022e+05, 1.63502833e+05
+, 1.63529645e+05, 1.63556458e+05, 1.63583272e+05, 1.63610087e+05
+, 1.63636904e+05, 1.63663721e+05, 1.63690540e+05, 1.63717359e+05
+, 1.63744180e+05, 1.63771002e+05, 1.63797825e+05, 1.63824649e+05
+, 1.63851474e+05, 1.63878301e+05, 1.63905128e+05, 1.63931956e+05
+, 1.63958786e+05, 1.63985617e+05, 1.64012448e+05, 1.64039281e+05
+, 1.64066115e+05, 1.64092950e+05, 1.64119786e+05, 1.64146624e+05
+, 1.64173462e+05, 1.64200301e+05, 1.64227142e+05, 1.64253983e+05
+, 1.64280826e+05, 1.64307670e+05, 1.64334515e+05, 1.64361361e+05
+, 1.64388208e+05, 1.64415056e+05, 1.64441906e+05, 1.64468756e+05
+, 1.64495607e+05, 1.64522460e+05, 1.64549314e+05, 1.64576169e+05
+, 1.64603024e+05, 1.64629881e+05, 1.64656739e+05, 1.64683599e+05
+, 1.64710459e+05, 1.64737320e+05, 1.64764183e+05, 1.64791046e+05
+, 1.64817911e+05, 1.64844777e+05, 1.64871643e+05, 1.64898511e+05
+, 1.64925380e+05, 1.64952250e+05, 1.64979122e+05, 1.65005994e+05
+, 1.65032867e+05, 1.65059742e+05, 1.65086617e+05, 1.65113494e+05
+, 1.65140372e+05, 1.65167251e+05, 1.65194131e+05, 1.65221012e+05
+, 1.65247894e+05, 1.65274777e+05, 1.65301661e+05, 1.65328547e+05
+, 1.65355433e+05, 1.65382321e+05, 1.65409210e+05, 1.65436099e+05
+, 1.65462990e+05, 1.65489882e+05, 1.65516775e+05
+};
+static const ALIGNED(16) real aa_ca[8] =
+{
+ -5.14495755e-01, -4.71731969e-01, -3.13377454e-01, -1.81913200e-01
+, -9.45741925e-02, -4.09655829e-02, -1.41985686e-02, -3.69997467e-03
+};
+static const ALIGNED(16) real aa_cs[8] =
+{
+ 8.57492926e-01, 8.81741997e-01, 9.49628649e-01, 9.83314592e-01
+, 9.95517816e-01, 9.99160558e-01, 9.99899195e-01, 9.99993155e-01
+};
+static const ALIGNED(16) real win[4][36] =
+{
+ {
+ 3.22824301e-02, 1.07206359e-01, 2.01414267e-01, 3.25616354e-01
+ , 5.00000000e-01, 7.67774705e-01, 1.24122289e+00, 2.33195123e+00
+ , 7.74415058e+00, -8.45125736e+00, -3.03905801e+00, -1.94832968e+00
+ , -1.47488149e+00, -1.20710678e+00, -1.03272313e+00, -9.08521049e-01
+ , -8.14313140e-01, -7.39389211e-01, -6.77525384e-01, -6.24844449e-01
+ , -5.78791741e-01, -5.37601636e-01, -5.00000000e-01, -4.65028346e-01
+ , -4.31934290e-01, -4.00099577e-01, -3.68989865e-01, -3.38116916e-01
+ , -3.07007204e-01, -2.75172491e-01, -2.42078435e-01, -2.07106781e-01
+ , -1.69505145e-01, -1.28315040e-01, -8.22623323e-02, -2.95813971e-02
+ }
+, {
+ 3.22824301e-02, 1.07206359e-01, 2.01414267e-01, 3.25616354e-01
+ , 5.00000000e-01, 7.67774705e-01, 1.24122289e+00, 2.33195123e+00
+ , 7.74415058e+00, -8.45125736e+00, -3.03905801e+00, -1.94832968e+00
+ , -1.47488149e+00, -1.20710678e+00, -1.03272313e+00, -9.08521049e-01
+ , -8.14313140e-01, -7.39389211e-01, -6.78170852e-01, -6.30236207e-01
+ , -5.92844524e-01, -5.63690973e-01, -5.41196100e-01, -5.24264563e-01
+ , -5.07758331e-01, -4.65925826e-01, -3.97054578e-01, -3.04670693e-01
+ , -1.92992796e-01, -6.68476524e-02, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ }
+, {
+ 1.07206359e-01, 5.00000000e-01, 2.33195123e+00, -3.03905801e+00
+ , -1.20710678e+00, -8.14313140e-01, -6.24844449e-01, -5.00000000e-01
+ , -4.00099577e-01, -3.07007204e-01, -2.07106781e-01, -8.22623323e-02
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ }
+, {
+ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 3.01530274e-01, 1.46592583e+00
+ , 6.97810613e+00, -9.09404497e+00, -3.53905801e+00, -2.29034982e+00
+ , -1.66275476e+00, -1.30656296e+00, -1.08284029e+00, -9.30579498e-01
+ , -8.21339816e-01, -7.40093616e-01, -6.77525384e-01, -6.24844449e-01
+ , -5.78791741e-01, -5.37601636e-01, -5.00000000e-01, -4.65028346e-01
+ , -4.31934290e-01, -4.00099577e-01, -3.68989865e-01, -3.38116916e-01
+ , -3.07007204e-01, -2.75172491e-01, -2.42078435e-01, -2.07106781e-01
+ , -1.69505145e-01, -1.28315040e-01, -8.22623323e-02, -2.95813971e-02
+ }
+};
+static const ALIGNED(16) real win1[4][36] =
+{
+ {
+ 3.22824301e-02, -1.07206359e-01, 2.01414267e-01, -3.25616354e-01
+ , 5.00000000e-01, -7.67774705e-01, 1.24122289e+00, -2.33195123e+00
+ , 7.74415058e+00, 8.45125736e+00, -3.03905801e+00, 1.94832968e+00
+ , -1.47488149e+00, 1.20710678e+00, -1.03272313e+00, 9.08521049e-01
+ , -8.14313140e-01, 7.39389211e-01, -6.77525384e-01, 6.24844449e-01
+ , -5.78791741e-01, 5.37601636e-01, -5.00000000e-01, 4.65028346e-01
+ , -4.31934290e-01, 4.00099577e-01, -3.68989865e-01, 3.38116916e-01
+ , -3.07007204e-01, 2.75172491e-01, -2.42078435e-01, 2.07106781e-01
+ , -1.69505145e-01, 1.28315040e-01, -8.22623323e-02, 2.95813971e-02
+ }
+, {
+ 3.22824301e-02, -1.07206359e-01, 2.01414267e-01, -3.25616354e-01
+ , 5.00000000e-01, -7.67774705e-01, 1.24122289e+00, -2.33195123e+00
+ , 7.74415058e+00, 8.45125736e+00, -3.03905801e+00, 1.94832968e+00
+ , -1.47488149e+00, 1.20710678e+00, -1.03272313e+00, 9.08521049e-01
+ , -8.14313140e-01, 7.39389211e-01, -6.78170852e-01, 6.30236207e-01
+ , -5.92844524e-01, 5.63690973e-01, -5.41196100e-01, 5.24264563e-01
+ , -5.07758331e-01, 4.65925826e-01, -3.97054578e-01, 3.04670693e-01
+ , -1.92992796e-01, 6.68476524e-02, 0.00000000e+00, -0.00000000e+00
+ , 0.00000000e+00, -0.00000000e+00, 0.00000000e+00, -0.00000000e+00
+ }
+, {
+ 1.07206359e-01, -5.00000000e-01, 2.33195123e+00, 3.03905801e+00
+ , -1.20710678e+00, 8.14313140e-01, -6.24844449e-01, 5.00000000e-01
+ , -4.00099577e-01, 3.07007204e-01, -2.07106781e-01, 8.22623323e-02
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ , 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00
+ }
+, {
+ 0.00000000e+00, -0.00000000e+00, 0.00000000e+00, -0.00000000e+00
+ , 0.00000000e+00, -0.00000000e+00, 3.01530274e-01, -1.46592583e+00
+ , 6.97810613e+00, 9.09404497e+00, -3.53905801e+00, 2.29034982e+00
+ , -1.66275476e+00, 1.30656296e+00, -1.08284029e+00, 9.30579498e-01
+ , -8.21339816e-01, 7.40093616e-01, -6.77525384e-01, 6.24844449e-01
+ , -5.78791741e-01, 5.37601636e-01, -5.00000000e-01, 4.65028346e-01
+ , -4.31934290e-01, 4.00099577e-01, -3.68989865e-01, 3.38116916e-01
+ , -3.07007204e-01, 2.75172491e-01, -2.42078435e-01, 2.07106781e-01
+ , -1.69505145e-01, 1.28315040e-01, -8.22623323e-02, 2.95813971e-02
+ }
+};
+const ALIGNED(16) real COS9[9] =
+{
+ 1.00000000e+00, 9.84807753e-01, 9.39692621e-01, 8.66025404e-01
+, 7.66044443e-01, 6.42787610e-01, 5.00000000e-01, 3.42020143e-01
+, 1.73648178e-01
+};
+static const real COS6_1 = 8.66025404e-01;
+static const real COS6_2 = 5.00000000e-01;
+const ALIGNED(16) real tfcos36[9] =
+{
+ 5.01909919e-01, 5.17638090e-01, 5.51688959e-01, 6.10387294e-01
+, 7.07106781e-01, 8.71723398e-01, 1.18310079e+00, 1.93185165e+00
+, 5.73685662e+00
+};
+static const ALIGNED(16) real tfcos12[3] =
+{
+ 5.17638090e-01, 7.07106781e-01, 1.93185165e+00
+};
+static const ALIGNED(16) real cos9[3] =
+{
+ 9.39692621e-01, -1.73648178e-01, -7.66044443e-01
+};
+static const ALIGNED(16) real cos18[3] =
+{
+ 9.84807753e-01, -3.42020143e-01, -6.42787610e-01
+};
+static const ALIGNED(16) real tan1_1[16] =
+{
+ 0.00000000e+00, 2.11324865e-01, 3.66025404e-01, 5.00000000e-01
+, 6.33974596e-01, 7.88675135e-01, 1.00000000e+00, 1.36602540e+00
+, 2.36602540e+00, -1.00000000e+38, -1.36602540e+00, -3.66025404e-01
+, 0.00000000e+00, 2.11324865e-01, 3.66025404e-01, 5.00000000e-01
+};
+static const ALIGNED(16) real tan2_1[16] =
+{
+ 1.00000000e+00, 7.88675135e-01, 6.33974596e-01, 5.00000000e-01
+, 3.66025404e-01, 2.11324865e-01, 0.00000000e+00, -3.66025404e-01
+, -1.36602540e+00, 1.00000000e+38, 2.36602540e+00, 1.36602540e+00
+, 1.00000000e+00, 7.88675135e-01, 6.33974596e-01, 5.00000000e-01
+};
+static const ALIGNED(16) real tan1_2[16] =
+{
+ 0.00000000e+00, 2.98858491e-01, 5.17638090e-01, 7.07106781e-01
+, 8.96575472e-01, 1.11535507e+00, 1.41421356e+00, 1.93185165e+00
+, 3.34606521e+00, -1.00000000e+38, -1.93185165e+00, -5.17638090e-01
+, 0.00000000e+00, 2.98858491e-01, 5.17638090e-01, 7.07106781e-01
+};
+static const ALIGNED(16) real tan2_2[16] =
+{
+ 1.41421356e+00, 1.11535507e+00, 8.96575472e-01, 7.07106781e-01
+, 5.17638090e-01, 2.98858491e-01, 0.00000000e+00, -5.17638090e-01
+, -1.93185165e+00, 1.00000000e+38, 3.34606521e+00, 1.93185165e+00
+, 1.41421356e+00, 1.11535507e+00, 8.96575472e-01, 7.07106781e-01
+};
+static const ALIGNED(16) real pow1_1[2][32] =
+{
+ {
+ 1.00000000e+00, 8.40896415e-01, 1.00000000e+00, 7.07106781e-01
+ , 1.00000000e+00, 5.94603558e-01, 1.00000000e+00, 5.00000000e-01
+ , 1.00000000e+00, 4.20448208e-01, 1.00000000e+00, 3.53553391e-01
+ , 1.00000000e+00, 2.97301779e-01, 1.00000000e+00, 2.50000000e-01
+ , 1.00000000e+00, 2.10224104e-01, 1.00000000e+00, 1.76776695e-01
+ , 1.00000000e+00, 1.48650889e-01, 1.00000000e+00, 1.25000000e-01
+ , 1.00000000e+00, 1.05112052e-01, 1.00000000e+00, 8.83883476e-02
+ , 1.00000000e+00, 7.43254447e-02, 1.00000000e+00, 6.25000000e-02
+ }
+, {
+ 1.00000000e+00, 7.07106781e-01, 1.00000000e+00, 5.00000000e-01
+ , 1.00000000e+00, 3.53553391e-01, 1.00000000e+00, 2.50000000e-01
+ , 1.00000000e+00, 1.76776695e-01, 1.00000000e+00, 1.25000000e-01
+ , 1.00000000e+00, 8.83883476e-02, 1.00000000e+00, 6.25000000e-02
+ , 1.00000000e+00, 4.41941738e-02, 1.00000000e+00, 3.12500000e-02
+ , 1.00000000e+00, 2.20970869e-02, 1.00000000e+00, 1.56250000e-02
+ , 1.00000000e+00, 1.10485435e-02, 1.00000000e+00, 7.81250000e-03
+ , 1.00000000e+00, 5.52427173e-03, 1.00000000e+00, 3.90625000e-03
+ }
+};
+static const ALIGNED(16) real pow2_1[2][32] =
+{
+ {
+ 1.00000000e+00, 1.00000000e+00, 8.40896415e-01, 1.00000000e+00
+ , 7.07106781e-01, 1.00000000e+00, 5.94603558e-01, 1.00000000e+00
+ , 5.00000000e-01, 1.00000000e+00, 4.20448208e-01, 1.00000000e+00
+ , 3.53553391e-01, 1.00000000e+00, 2.97301779e-01, 1.00000000e+00
+ , 2.50000000e-01, 1.00000000e+00, 2.10224104e-01, 1.00000000e+00
+ , 1.76776695e-01, 1.00000000e+00, 1.48650889e-01, 1.00000000e+00
+ , 1.25000000e-01, 1.00000000e+00, 1.05112052e-01, 1.00000000e+00
+ , 8.83883476e-02, 1.00000000e+00, 7.43254447e-02, 1.00000000e+00
+ }
+, {
+ 1.00000000e+00, 1.00000000e+00, 7.07106781e-01, 1.00000000e+00
+ , 5.00000000e-01, 1.00000000e+00, 3.53553391e-01, 1.00000000e+00
+ , 2.50000000e-01, 1.00000000e+00, 1.76776695e-01, 1.00000000e+00
+ , 1.25000000e-01, 1.00000000e+00, 8.83883476e-02, 1.00000000e+00
+ , 6.25000000e-02, 1.00000000e+00, 4.41941738e-02, 1.00000000e+00
+ , 3.12500000e-02, 1.00000000e+00, 2.20970869e-02, 1.00000000e+00
+ , 1.56250000e-02, 1.00000000e+00, 1.10485435e-02, 1.00000000e+00
+ , 7.81250000e-03, 1.00000000e+00, 5.52427173e-03, 1.00000000e+00
+ }
+};
+static const ALIGNED(16) real pow1_2[2][32] =
+{
+ {
+ 1.41421356e+00, 1.18920712e+00, 1.41421356e+00, 1.00000000e+00
+ , 1.41421356e+00, 8.40896415e-01, 1.41421356e+00, 7.07106781e-01
+ , 1.41421356e+00, 5.94603558e-01, 1.41421356e+00, 5.00000000e-01
+ , 1.41421356e+00, 4.20448208e-01, 1.41421356e+00, 3.53553391e-01
+ , 1.41421356e+00, 2.97301779e-01, 1.41421356e+00, 2.50000000e-01
+ , 1.41421356e+00, 2.10224104e-01, 1.41421356e+00, 1.76776695e-01
+ , 1.41421356e+00, 1.48650889e-01, 1.41421356e+00, 1.25000000e-01
+ , 1.41421356e+00, 1.05112052e-01, 1.41421356e+00, 8.83883476e-02
+ }
+, {
+ 1.41421356e+00, 1.00000000e+00, 1.41421356e+00, 7.07106781e-01
+ , 1.41421356e+00, 5.00000000e-01, 1.41421356e+00, 3.53553391e-01
+ , 1.41421356e+00, 2.50000000e-01, 1.41421356e+00, 1.76776695e-01
+ , 1.41421356e+00, 1.25000000e-01, 1.41421356e+00, 8.83883476e-02
+ , 1.41421356e+00, 6.25000000e-02, 1.41421356e+00, 4.41941738e-02
+ , 1.41421356e+00, 3.12500000e-02, 1.41421356e+00, 2.20970869e-02
+ , 1.41421356e+00, 1.56250000e-02, 1.41421356e+00, 1.10485435e-02
+ , 1.41421356e+00, 7.81250000e-03, 1.41421356e+00, 5.52427173e-03
+ }
+};
+static const ALIGNED(16) real pow2_2[2][32] =
+{
+ {
+ 1.41421356e+00, 1.41421356e+00, 1.18920712e+00, 1.41421356e+00
+ , 1.00000000e+00, 1.41421356e+00, 8.40896415e-01, 1.41421356e+00
+ , 7.07106781e-01, 1.41421356e+00, 5.94603558e-01, 1.41421356e+00
+ , 5.00000000e-01, 1.41421356e+00, 4.20448208e-01, 1.41421356e+00
+ , 3.53553391e-01, 1.41421356e+00, 2.97301779e-01, 1.41421356e+00
+ , 2.50000000e-01, 1.41421356e+00, 2.10224104e-01, 1.41421356e+00
+ , 1.76776695e-01, 1.41421356e+00, 1.48650889e-01, 1.41421356e+00
+ , 1.25000000e-01, 1.41421356e+00, 1.05112052e-01, 1.41421356e+00
+ }
+, {
+ 1.41421356e+00, 1.41421356e+00, 1.00000000e+00, 1.41421356e+00
+ , 7.07106781e-01, 1.41421356e+00, 5.00000000e-01, 1.41421356e+00
+ , 3.53553391e-01, 1.41421356e+00, 2.50000000e-01, 1.41421356e+00
+ , 1.76776695e-01, 1.41421356e+00, 1.25000000e-01, 1.41421356e+00
+ , 8.83883476e-02, 1.41421356e+00, 6.25000000e-02, 1.41421356e+00
+ , 4.41941738e-02, 1.41421356e+00, 3.12500000e-02, 1.41421356e+00
+ , 2.20970869e-02, 1.41421356e+00, 1.56250000e-02, 1.41421356e+00
+ , 1.10485435e-02, 1.41421356e+00, 7.81250000e-03, 1.41421356e+00
+ }
+};
+
+#endif
+
+#ifdef REAL_IS_FIXED
+
+static const real ispow[8207] =
+{
+ 0, 8192, 20643, 35445
+, 52016, 70041, 89315, 109695
+, 131072, 153360, 176491, 200407
+, 225060, 250408, 276414, 303048
+, 330281, 358087, 386444, 415331
+, 444730, 474623, 504995, 535830
+, 567116, 598839, 630988, 663552
+, 696521, 729884, 763633, 797760
+, 832255, 867112, 902323, 937880
+, 973778, 1010010, 1046569, 1083451
+, 1120650, 1158160, 1195976, 1234093
+, 1272507, 1311213, 1350207, 1389485
+, 1429042, 1468875, 1508979, 1549352
+, 1589990, 1630889, 1672046, 1713458
+, 1755122, 1797035, 1839193, 1881594
+, 1924236, 1967115, 2010229, 2053576
+, 2097152, 2140956, 2184985, 2229238
+, 2273710, 2318402, 2363310, 2408432
+, 2453767, 2499312, 2545065, 2591025
+, 2637190, 2683558, 2730126, 2776895
+, 2823861, 2871023, 2918379, 2965929
+, 3013670, 3061600, 3109719, 3158025
+, 3206517, 3255192, 3304050, 3353089
+, 3402309, 3451707, 3501282, 3551033
+, 3600960, 3651060, 3701332, 3751776
+, 3802390, 3853172, 3904123, 3955241
+, 4006524, 4057972, 4109583, 4161357
+, 4213293, 4265389, 4317644, 4370058
+, 4422630, 4475359, 4528243, 4581282
+, 4634476, 4687822, 4741320, 4794970
+, 4848770, 4902720, 4956819, 5011066
+, 5065460, 5120000, 5174686, 5229517
+, 5284492, 5339610, 5394871, 5450274
+, 5505818, 5561502, 5617327, 5673290
+, 5729391, 5785631, 5842007, 5898519
+, 5955168, 6011951, 6068869, 6125920
+, 6183105, 6240422, 6297871, 6355451
+, 6413162, 6471004, 6528974, 6587074
+, 6645302, 6703658, 6762141, 6820751
+, 6879487, 6938349, 6997336, 7056447
+, 7115683, 7175042, 7234524, 7294129
+, 7353855, 7413703, 7473672, 7533762
+, 7593972, 7654301, 7714750, 7775317
+, 7836002, 7896805, 7957725, 8018762
+, 8079916, 8141185, 8202570, 8264070
+, 8325685, 8387413, 8449256, 8511212
+, 8573281, 8635462, 8697756, 8760161
+, 8822678, 8885305, 8948043, 9010892
+, 9073850, 9136917, 9200094, 9263379
+, 9326772, 9390274, 9453882, 9517598
+, 9581421, 9645351, 9709386, 9773527
+, 9837774, 9902125, 9966582, 10031143
+, 10095807, 10160576, 10225448, 10290423
+, 10355500, 10420681, 10485963, 10551347
+, 10616832, 10682419, 10748106, 10813894
+, 10879782, 10945770, 11011857, 11078044
+, 11144330, 11210715, 11277198, 11343779
+, 11410458, 11477234, 11544108, 11611079
+, 11678147, 11745311, 11812571, 11879927
+, 11947378, 12014925, 12082567, 12150304
+, 12218135, 12286061, 12354081, 12422194
+, 12490401, 12558701, 12627094, 12695580
+, 12764158, 12832829, 12901592, 12970446
+, 13039392, 13108429, 13177557, 13246776
+, 13316085, 13385485, 13454975, 13524554
+, 13594224, 13663982, 13733830, 13803767
+, 13873792, 13943906, 14014108, 14084398
+, 14154776, 14225242, 14295794, 14366435
+, 14437162, 14507975, 14578876, 14649862
+, 14720935, 14792093, 14863337, 14934667
+, 15006082, 15077582, 15149167, 15220837
+, 15292591, 15364429, 15436351, 15508358
+, 15580448, 15652621, 15724878, 15797217
+, 15869640, 15942146, 16014734, 16087404
+, 16160156, 16232991, 16305907, 16378905
+, 16451984, 16525145, 16598386, 16671709
+, 16745112, 16818596, 16892160, 16965804
+, 17039528, 17113332, 17187216, 17261179
+, 17335222, 17409343, 17483544, 17557824
+, 17632182, 17706618, 17781133, 17855726
+, 17930397, 18005146, 18079973, 18154877
+, 18229858, 18304917, 18380052, 18455265
+, 18530554, 18605920, 18681362, 18756880
+, 18832475, 18908145, 18983891, 19059713
+, 19135610, 19211583, 19287630, 19363753
+, 19439951, 19516223, 19592571, 19668992
+, 19745488, 19822058, 19898702, 19975420
+, 20052211, 20129076, 20206015, 20283027
+, 20360112, 20437270, 20514501, 20591805
+, 20669181, 20746630, 20824151, 20901745
+, 20979410, 21057148, 21134957, 21212838
+, 21290791, 21368815, 21446910, 21525076
+, 21603314, 21681622, 21760001, 21838451
+, 21916971, 21995561, 22074222, 22152953
+, 22231754, 22310625, 22389566, 22468576
+, 22547656, 22626806, 22706024, 22785312
+, 22864669, 22944094, 23023589, 23103152
+, 23182783, 23262484, 23342252, 23422089
+, 23501993, 23581966, 23662007, 23742115
+, 23822291, 23902534, 23982845, 24063223
+, 24143669, 24224181, 24304761, 24385407
+, 24466120, 24546899, 24627745, 24708658
+, 24789637, 24870682, 24951793, 25032970
+, 25114213, 25195521, 25276895, 25358335
+, 25439841, 25521411, 25603047, 25684748
+, 25766514, 25848345, 25930241, 26012201
+, 26094226, 26176316, 26258469, 26340688
+, 26422970, 26505317, 26587727, 26670202
+, 26752740, 26835342, 26918008, 27000737
+, 27083530, 27166386, 27249305, 27332287
+, 27415332, 27498440, 27581611, 27664845
+, 27748142, 27831501, 27914922, 27998406
+, 28081952, 28165561, 28249231, 28332963
+, 28416758, 28500614, 28584532, 28668511
+, 28752552, 28836655, 28920819, 29005044
+, 29089330, 29173677, 29258086, 29342555
+, 29427085, 29511676, 29596328, 29681040
+, 29765813, 29850646, 29935539, 30020493
+, 30105507, 30190581, 30275714, 30360908
+, 30446162, 30531475, 30616848, 30702280
+, 30787772, 30873323, 30958934, 31044604
+, 31130332, 31216120, 31301967, 31387873
+, 31473838, 31559862, 31645944, 31732084
+, 31818284, 31904541, 31990857, 32077231
+, 32163664, 32250154, 32336703, 32423309
+, 32509974, 32596696, 32683476, 32770313
+, 32857208, 32944161, 33031171, 33118238
+, 33205363, 33292544, 33379783, 33467079
+, 33554432, 33641842, 33729308, 33816832
+, 33904412, 33992048, 34079741, 34167491
+, 34255297, 34343159, 34431078, 34519052
+, 34607083, 34695170, 34783312, 34871511
+, 34959765, 35048075, 35136441, 35224862
+, 35313339, 35401872, 35490459, 35579102
+, 35667801, 35756554, 35845363, 35934226
+, 36023145, 36112118, 36201147, 36290230
+, 36379367, 36468560, 36557807, 36647108
+, 36736464, 36825875, 36915339, 37004858
+, 37094431, 37184058, 37273739, 37363474
+, 37453263, 37543106, 37633003, 37722953
+, 37812957, 37903015, 37993126, 38083291
+, 38173509, 38263780, 38354105, 38444483
+, 38534914, 38625398, 38715935, 38806525
+, 38897168, 38987864, 39078612, 39169414
+, 39260268, 39351174, 39442133, 39533145
+, 39624209, 39715325, 39806494, 39897714
+, 39988987, 40080312, 40171690, 40263119
+, 40354600, 40446133, 40537718, 40629354
+, 40721042, 40812782, 40904574, 40996417
+, 41088311, 41180257, 41272254, 41364303
+, 41456402, 41548553, 41640755, 41733008
+, 41825313, 41917668, 42010074, 42102530
+, 42195038, 42287596, 42380205, 42472865
+, 42565575, 42658336, 42751147, 42844009
+, 42936921, 43029883, 43122895, 43215958
+, 43309070, 43402233, 43495446, 43588709
+, 43682022, 43775384, 43868797, 43962259
+, 44055771, 44149332, 44242943, 44336604
+, 44430314, 44524073, 44617882, 44711741
+, 44805648, 44899605, 44993611, 45087666
+, 45181770, 45275923, 45370126, 45464377
+, 45558677, 45653025, 45747423, 45841869
+, 45936364, 46030908, 46125500, 46220141
+, 46314830, 46409567, 46504353, 46599187
+, 46694070, 46789001, 46883980, 46979007
+, 47074082, 47169205, 47264376, 47359595
+, 47454862, 47550177, 47645540, 47740950
+, 47836408, 47931914, 48027467, 48123068
+, 48218716, 48314412, 48410155, 48505945
+, 48601783, 48697668, 48793601, 48889580
+, 48985607, 49081681, 49177802, 49273969
+, 49370184, 49466446, 49562754, 49659109
+, 49755511, 49851960, 49948456, 50044998
+, 50141586, 50238222, 50334903, 50431631
+, 50528406, 50625227, 50722094, 50819007
+, 50915967, 51012973, 51110025, 51207123
+, 51304267, 51401457, 51498694, 51595976
+, 51693304, 51790677, 51888097, 51985562
+, 52083073, 52180630, 52278232, 52375880
+, 52473573, 52571312, 52669097, 52766926
+, 52864801, 52962722, 53060688, 53158699
+, 53256755, 53354856, 53453002, 53551194
+, 53649430, 53747712, 53846038, 53944410
+, 54042826, 54141287, 54239793, 54338344
+, 54436939, 54535579, 54634263, 54732993
+, 54831766, 54930585, 55029447, 55128354
+, 55227306, 55326302, 55425342, 55524426
+, 55623555, 55722728, 55821945, 55921206
+, 56020511, 56119860, 56219253, 56318690
+, 56418171, 56517696, 56617265, 56716877
+, 56816534, 56916234, 57015977, 57115764
+, 57215595, 57315470, 57415388, 57515349
+, 57615354, 57715403, 57815494, 57915629
+, 58015808, 58116029, 58216294, 58316602
+, 58416954, 58517348, 58617785, 58718266
+, 58818789, 58919356, 59019965, 59120617
+, 59221312, 59322050, 59422831, 59523654
+, 59624521, 59725429, 59826381, 59927375
+, 60028412, 60129491, 60230613, 60331777
+, 60432983, 60534232, 60635524, 60736857
+, 60838233, 60939651, 61041112, 61142614
+, 61244159, 61345746, 61447375, 61549046
+, 61650759, 61752513, 61854310, 61956149
+, 62058030, 62159952, 62261916, 62363922
+, 62465970, 62568059, 62670191, 62772363
+, 62874578, 62976833, 63079131, 63181470
+, 63283850, 63386272, 63488735, 63591239
+, 63693785, 63796372, 63899001, 64001670
+, 64104381, 64207133, 64309926, 64412760
+, 64515636, 64618552, 64721509, 64824507
+, 64927546, 65030627, 65133747, 65236909
+, 65340112, 65443355, 65546639, 65649964
+, 65753329, 65856735, 65960182, 66063669
+, 66167197, 66270765, 66374374, 66478023
+, 66581713, 66685443, 66789213, 66893024
+, 66996875, 67100766, 67204698, 67308669
+, 67412681, 67516733, 67620825, 67724957
+, 67829130, 67933342, 68037594, 68141886
+, 68246218, 68350590, 68455002, 68559454
+, 68663945, 68768476, 68873047, 68977658
+, 69082308, 69186998, 69291728, 69396497
+, 69501306, 69606154, 69711042, 69815969
+, 69920936, 70025942, 70130987, 70236072
+, 70341196, 70446360, 70551562, 70656804
+, 70762085, 70867406, 70972765, 71078164
+, 71183601, 71289078, 71394594, 71500149
+, 71605742, 71711375, 71817046, 71922757
+, 72028506, 72134294, 72240121, 72345987
+, 72451891, 72557835, 72663817, 72769837
+, 72875896, 72981994, 73088130, 73194305
+, 73300519, 73406770, 73513061, 73619389
+, 73725757, 73832162, 73938606, 74045088
+, 74151609, 74258168, 74364765, 74471400
+, 74578073, 74684785, 74791535, 74898323
+, 75005149, 75112012, 75218914, 75325854
+, 75432832, 75539848, 75646902, 75753994
+, 75861123, 75968291, 76075496, 76182739
+, 76290020, 76397338, 76504694, 76612088
+, 76719520, 76826989, 76934495, 77042040
+, 77149622, 77257241, 77364898, 77472592
+, 77580324, 77688093, 77795899, 77903743
+, 78011625, 78119543, 78227499, 78335492
+, 78443522, 78551590, 78659695, 78767836
+, 78876015, 78984232, 79092485, 79200775
+, 79309102, 79417467, 79525868, 79634306
+, 79742781, 79851293, 79959842, 80068428
+, 80177050, 80285710, 80394406, 80503139
+, 80611908, 80720715, 80829558, 80938438
+, 81047354, 81156307, 81265296, 81374322
+, 81483385, 81592484, 81701620, 81810792
+, 81920000, 82029245, 82138526, 82247844
+, 82357198, 82466588, 82576014, 82685477
+, 82794976, 82904512, 83014083, 83123691
+, 83233334, 83343014, 83452730, 83562482
+, 83672271, 83782095, 83891955, 84001851
+, 84111783, 84221751, 84331755, 84441795
+, 84551870, 84661982, 84772129, 84882312
+, 84992531, 85102786, 85213076, 85323402
+, 85433764, 85544161, 85654594, 85765063
+, 85875567, 85986107, 86096682, 86207293
+, 86317939, 86428621, 86539338, 86650091
+, 86760879, 86871702, 86982561, 87093455
+, 87204384, 87315349, 87426349, 87537384
+, 87648455, 87759560, 87870701, 87981877
+, 88093088, 88204334, 88315616, 88426932
+, 88538283, 88649670, 88761091, 88872548
+, 88984039, 89095565, 89207126, 89318723
+, 89430353, 89542019, 89653720, 89765455
+, 89877226, 89989030, 90100870, 90212745
+, 90324654, 90436598, 90548576, 90660589
+, 90772637, 90884719, 90996836, 91108987
+, 91221173, 91333394, 91445648, 91557938
+, 91670262, 91782620, 91895012, 92007439
+, 92119901, 92232396, 92344926, 92457491
+, 92570089, 92682722, 92795389, 92908090
+, 93020826, 93133595, 93246399, 93359237
+, 93472109, 93585015, 93697955, 93810929
+, 93923937, 94036980, 94150056, 94263166
+, 94376310, 94489488, 94602700, 94715946
+, 94829225, 94942539, 95055886, 95169267
+, 95282682, 95396131, 95509613, 95623129
+, 95736679, 95850263, 95963880, 96077530
+, 96191215, 96304933, 96418684, 96532470
+, 96646288, 96760140, 96874026, 96987945
+, 97101898, 97215884, 97329904, 97443956
+, 97558043, 97672162, 97786315, 97900502
+, 98014721, 98128974, 98243260, 98357580
+, 98471933, 98586318, 98700737, 98815190
+, 98929675, 99044194, 99158745, 99273330
+, 99387948, 99502598, 99617282, 99731999
+, 99846749, 99961532, 100076348, 100191197
+, 100306078, 100420993, 100535940, 100650921
+, 100765934, 100880980, 100996059, 101111170
+, 101226315, 101341492, 101456702, 101571944
+, 101687220, 101802528, 101917868, 102033241
+, 102148647, 102264086, 102379557, 102495061
+, 102610597, 102726166, 102841767, 102957401
+, 103073067, 103188765, 103304497, 103420260
+, 103536056, 103651884, 103767745, 103883638
+, 103999563, 104115521, 104231511, 104347533
+, 104463588, 104579675, 104695794, 104811945
+, 104928128, 105044344, 105160592, 105276871
+, 105393183, 105509527, 105625904, 105742312
+, 105858752, 105975224, 106091729, 106208265
+, 106324833, 106441433, 106558066, 106674730
+, 106791426, 106908154, 107024913, 107141705
+, 107258528, 107375384, 107492271, 107609190
+, 107726140, 107843123, 107960137, 108077182
+, 108194260, 108311369, 108428510, 108545683
+, 108662887, 108780122, 108897390, 109014689
+, 109132019, 109249381, 109366775, 109484200
+, 109601656, 109719144, 109836664, 109954215
+, 110071797, 110189411, 110307056, 110424733
+, 110542441, 110660180, 110777950, 110895752
+, 111013585, 111131450, 111249346, 111367273
+, 111485231, 111603220, 111721241, 111839292
+, 111957375, 112075489, 112193635, 112311811
+, 112430018, 112548257, 112666526, 112784827
+, 112903159, 113021521, 113139915, 113258339
+, 113376795, 113495282, 113613799, 113732347
+, 113850927, 113969537, 114088178, 114206850
+, 114325552, 114444286, 114563050, 114681845
+, 114800671, 114919528, 115038415, 115157333
+, 115276282, 115395262, 115514272, 115633313
+, 115752384, 115871486, 115990619, 116109783
+, 116228976, 116348201, 116467456, 116586742
+, 116706058, 116825404, 116944781, 117064189
+, 117183627, 117303095, 117422594, 117542124
+, 117661683, 117781273, 117900894, 118020545
+, 118140226, 118259937, 118379679, 118499451
+, 118619253, 118739086, 118858948, 118978842
+, 119098765, 119218718, 119338702, 119458716
+, 119578759, 119698834, 119818938, 119939072
+, 120059236, 120179431, 120299655, 120419910
+, 120540194, 120660509, 120780854, 120901228
+, 121021633, 121142067, 121262532, 121383026
+, 121503550, 121624105, 121744689, 121865303
+, 121985946, 122106620, 122227323, 122348057
+, 122468820, 122589613, 122710435, 122831287
+, 122952170, 123073081, 123194023, 123314994
+, 123435995, 123557025, 123678085, 123799175
+, 123920295, 124041444, 124162622, 124283830
+, 124405068, 124526335, 124647632, 124768959
+, 124890314, 125011700, 125133114, 125254559
+, 125376032, 125497536, 125619068, 125740630
+, 125862221, 125983842, 126105492, 126227171
+, 126348880, 126470618, 126592386, 126714182
+, 126836008, 126957863, 127079748, 127201661
+, 127323604, 127445576, 127567578, 127689608
+, 127811668, 127933756, 128055874, 128178021
+, 128300197, 128422403, 128544637, 128666900
+, 128789193, 128911514, 129033865, 129156244
+, 129278652, 129401090, 129523556, 129646052
+, 129768576, 129891129, 130013711, 130136323
+, 130258963, 130381631, 130504329, 130627056
+, 130749811, 130872595, 130995408, 131118250
+, 131241120, 131364020, 131486948, 131609905
+, 131732890, 131855904, 131978947, 132102019
+, 132225119, 132348248, 132471406, 132594592
+, 132717807, 132841050, 132964323, 133087623
+, 133210952, 133334310, 133457696, 133581111
+, 133704554, 133828026, 133951527, 134075055
+, 134198613, 134322198, 134445812, 134569455
+, 134693126, 134816825, 134940553, 135064309
+, 135188094, 135311906, 135435747, 135559617
+, 135683515, 135807441, 135931395, 136055378
+, 136179388, 136303427, 136427495, 136551590
+, 136675714, 136799866, 136924046, 137048254
+, 137172490, 137296755, 137421048, 137545368
+, 137669717, 137794094, 137918499, 138042932
+, 138167393, 138291882, 138416400, 138540945
+, 138665518, 138790119, 138914748, 139039405
+, 139164090, 139288803, 139413544, 139538313
+, 139663110, 139787934, 139912787, 140037667
+, 140162575, 140287511, 140412475, 140537467
+, 140662486, 140787533, 140912608, 141037711
+, 141162842, 141288000, 141413186, 141538399
+, 141663641, 141788910, 141914207, 142039531
+, 142164883, 142290263, 142415670, 142541105
+, 142666567, 142792057, 142917575, 143043120
+, 143168693, 143294294, 143419921, 143545577
+, 143671260, 143796970, 143922708, 144048473
+, 144174266, 144300086, 144425934, 144551809
+, 144677712, 144803641, 144929599, 145055583
+, 145181595, 145307635, 145433701, 145559795
+, 145685917, 145812065, 145938241, 146064445
+, 146190675, 146316933, 146443218, 146569530
+, 146695869, 146822236, 146948630, 147075051
+, 147201499, 147327974, 147454477, 147581007
+, 147707563, 147834147, 147960758, 148087396
+, 148214061, 148340754, 148467473, 148594219
+, 148720993, 148847793, 148974620, 149101475
+, 149228356, 149355264, 149482200, 149609162
+, 149736151, 149863167, 149990210, 150117280
+, 150244377, 150371501, 150498652, 150625829
+, 150753033, 150880265, 151007523, 151134807
+, 151262119, 151389457, 151516823, 151644215
+, 151771633, 151899079, 152026551, 152154050
+, 152281576, 152409128, 152536707, 152664313
+, 152791945, 152919604, 153047290, 153175002
+, 153302741, 153430507, 153558299, 153686118
+, 153813963, 153941835, 154069734, 154197659
+, 154325610, 154453588, 154581593, 154709624
+, 154837682, 154965766, 155093876, 155222013
+, 155350177, 155478367, 155606583, 155734826
+, 155863095, 155991391, 156119713, 156248061
+, 156376436, 156504837, 156633264, 156761718
+, 156890198, 157018704, 157147237, 157275796
+, 157404381, 157532993, 157661630, 157790294
+, 157918985, 158047701, 158176444, 158305212
+, 158434008, 158562829, 158691676, 158820550
+, 158949449, 159078375, 159207327, 159336305
+, 159465310, 159594340, 159723396, 159852479
+, 159981587, 160110722, 160239882, 160369069
+, 160498282, 160627520, 160756785, 160886076
+, 161015392, 161144735, 161274103, 161403498
+, 161532918, 161662365, 161791837, 161921335
+, 162050859, 162180409, 162309985, 162439587
+, 162569215, 162698868, 162828547, 162958252
+, 163087983, 163217740, 163347523, 163477331
+, 163607165, 163737025, 163866910, 163996822
+, 164126759, 164256722, 164386710, 164516724
+, 164646764, 164776830, 164906921, 165037038
+, 165167181, 165297349, 165427543, 165557762
+, 165688007, 165818278, 165948574, 166078896
+, 166209243, 166339616, 166470015, 166600439
+, 166730888, 166861363, 166991864, 167122390
+, 167252942, 167383519, 167514122, 167644750
+, 167775403, 167906082, 168036786, 168167516
+, 168298271, 168429052, 168559858, 168690689
+, 168821546, 168952428, 169083335, 169214268
+, 169345226, 169476210, 169607219, 169738253
+, 169869312, 170000397, 170131507, 170262642
+, 170393802, 170524988, 170656199, 170787435
+, 170918696, 171049983, 171181295, 171312632
+, 171443994, 171575381, 171706793, 171838231
+, 171969694, 172101182, 172232695, 172364233
+, 172495796, 172627384, 172758997, 172890636
+, 173022299, 173153988, 173285702, 173417440
+, 173549204, 173680993, 173812806, 173944645
+, 174076509, 174208397, 174340311, 174472249
+, 174604213, 174736201, 174868215, 175000253
+, 175132316, 175264404, 175396517, 175528655
+, 175660818, 175793005, 175925218, 176057455
+, 176189717, 176322004, 176454316, 176586653
+, 176719014, 176851400, 176983811, 177116247
+, 177248708, 177381193, 177513703, 177646237
+, 177778797, 177911381, 178043990, 178176624
+, 178309282, 178441965, 178574672, 178707405
+, 178840162, 178972943, 179105749, 179238580
+, 179371435, 179504316, 179637220, 179770149
+, 179903103, 180036082, 180169084, 180302112
+, 180435164, 180568240, 180701342, 180834467
+, 180967617, 181100792, 181233991, 181367214
+, 181500462, 181633735, 181767032, 181900353
+, 182033699, 182167069, 182300464, 182433883
+, 182567326, 182700794, 182834286, 182967803
+, 183101344, 183234909, 183368499, 183502113
+, 183635751, 183769414, 183903101, 184036812
+, 184170548, 184304307, 184438092, 184571900
+, 184705732, 184839589, 184973470, 185107376
+, 185241305, 185375259, 185509237, 185643239
+, 185777266, 185911316, 186045391, 186179490
+, 186313613, 186447760, 186581931, 186716126
+, 186850346, 186984590, 187118857, 187253149
+, 187387465, 187521805, 187656169, 187790557
+, 187924969, 188059405, 188193866, 188328350
+, 188462858, 188597390, 188731946, 188866527
+, 189001131, 189135759, 189270411, 189405087
+, 189539787, 189674511, 189809259, 189944031
+, 190078827, 190213646, 190348490, 190483357
+, 190618249, 190753164, 190888103, 191023066
+, 191158052, 191293063, 191428097, 191563155
+, 191698237, 191833343, 191968473, 192103626
+, 192238803, 192374004, 192509229, 192644477
+, 192779749, 192915045, 193050365, 193185708
+, 193321075, 193456466, 193591881, 193727319
+, 193862781, 193998266, 194133775, 194269308
+, 194404864, 194540444, 194676048, 194811675
+, 194947326, 195083001, 195218699, 195354421
+, 195490166, 195625935, 195761727, 195897543
+, 196033383, 196169246, 196305132, 196441042
+, 196576976, 196712933, 196848914, 196984918
+, 197120945, 197256996, 197393071, 197529169
+, 197665290, 197801435, 197937603, 198073795
+, 198210010, 198346249, 198482510, 198618796
+, 198755104, 198891437, 199027792, 199164171
+, 199300573, 199436998, 199573447, 199709919
+, 199846415, 199982934, 200119476, 200256041
+, 200392630, 200529242, 200665877, 200802535
+, 200939217, 201075922, 201212650, 201349402
+, 201486176, 201622974, 201759795, 201896639
+, 202033507, 202170398, 202307311, 202444248
+, 202581209, 202718192, 202855198, 202992228
+, 203129281, 203266357, 203403456, 203540578
+, 203677723, 203814891, 203952082, 204089297
+, 204226534, 204363795, 204501078, 204638385
+, 204775715, 204913067, 205050443, 205187842
+, 205325264, 205462708, 205600176, 205737667
+, 205875180, 206012717, 206150277, 206287859
+, 206425465, 206563093, 206700745, 206838419
+, 206976116, 207113836, 207251579, 207389345
+, 207527134, 207664946, 207802780, 207940638
+, 208078518, 208216421, 208354347, 208492295
+, 208630267, 208768261, 208906279, 209044319
+, 209182381, 209320467, 209458575, 209596706
+, 209734860, 209873037, 210011236, 210149458
+, 210287703, 210425971, 210564261, 210702574
+, 210840910, 210979268, 211117649, 211256053
+, 211394480, 211532929, 211671400, 211809895
+, 211948412, 212086952, 212225514, 212364099
+, 212502706, 212641337, 212779989, 212918665
+, 213057363, 213196083, 213334826, 213473592
+, 213612380, 213751191, 213890024, 214028880
+, 214167758, 214306659, 214445582, 214584528
+, 214723497, 214862488, 215001501, 215140537
+, 215279595, 215418676, 215557779, 215696904
+, 215836053, 215975223, 216114416, 216253631
+, 216392869, 216532129, 216671412, 216810717
+, 216950044, 217089394, 217228766, 217368160
+, 217507577, 217647016, 217786477, 217925961
+, 218065467, 218204996, 218344546, 218484119
+, 218623715, 218763332, 218902972, 219042634
+, 219182319, 219322026, 219461754, 219601506
+, 219741279, 219881075, 220020893, 220160733
+, 220300595, 220440479, 220580386, 220720315
+, 220860266, 221000239, 221140235, 221280252
+, 221420292, 221560354, 221700438, 221840544
+, 221980672, 222120823, 222260995, 222401190
+, 222541406, 222681645, 222821906, 222962189
+, 223102494, 223242821, 223383170, 223523541
+, 223663934, 223804350, 223944787, 224085246
+, 224225728, 224366231, 224506756, 224647303
+, 224787873, 224928464, 225069077, 225209712
+, 225350370, 225491049, 225631750, 225772473
+, 225913218, 226053985, 226194773, 226335584
+, 226476417, 226617271, 226758148, 226899046
+, 227039966, 227180908, 227321872, 227462858
+, 227603865, 227744895, 227885946, 228027019
+, 228168114, 228309231, 228450369, 228591529
+, 228732712, 228873916, 229015141, 229156389
+, 229297658, 229438949, 229580262, 229721596
+, 229862953, 230004331, 230145730, 230287152
+, 230428595, 230570060, 230711546, 230853055
+, 230994585, 231136136, 231277709, 231419304
+, 231560921, 231702559, 231844219, 231985901
+, 232127604, 232269329, 232411076, 232552844
+, 232694633, 232836445, 232978278, 233120132
+, 233262008, 233403906, 233545825, 233687766
+, 233829728, 233971712, 234113717, 234255744
+, 234397793, 234539863, 234681954, 234824068
+, 234966202, 235108358, 235250536, 235392735
+, 235534955, 235677197, 235819461, 235961746
+, 236104052, 236246380, 236388729, 236531100
+, 236673492, 236815905, 236958340, 237100797
+, 237243274, 237385774, 237528294, 237670836
+, 237813399, 237955984, 238098590, 238241217
+, 238383866, 238526536, 238669228, 238811940
+, 238954674, 239097430, 239240207, 239383005
+, 239525824, 239668664, 239811526, 239954409
+, 240097314, 240240240, 240383187, 240526155
+, 240669144, 240812155, 240955187, 241098240
+, 241241314, 241384410, 241527527, 241670665
+, 241813824, 241957005, 242100206, 242243429
+, 242386673, 242529938, 242673224, 242816532
+, 242959860, 243103210, 243246581, 243389973
+, 243533386, 243676820, 243820276, 243963752
+, 244107249, 244250768, 244394308, 244537869
+, 244681450, 244825053, 244968677, 245112322
+, 245255989, 245399676, 245543384, 245687113
+, 245830863, 245974635, 246118427, 246262240
+, 246406074, 246549930, 246693806, 246837703
+, 246981621, 247125560, 247269521, 247413502
+, 247557504, 247701527, 247845571, 247989635
+, 248133721, 248277828, 248421956, 248566104
+, 248710273, 248854464, 248998675, 249142907
+, 249287160, 249431434, 249575729, 249720044
+, 249864381, 250008738, 250153116, 250297515
+, 250441935, 250586375, 250730837, 250875319
+, 251019822, 251164346, 251308890, 251453456
+, 251598042, 251742649, 251887277, 252031925
+, 252176594, 252321284, 252465995, 252610727
+, 252755479, 252900252, 253045045, 253189860
+, 253334695, 253479551, 253624427, 253769324
+, 253914242, 254059181, 254204140, 254349120
+, 254494121, 254639142, 254784184, 254929246
+, 255074329, 255219433, 255364558, 255509703
+, 255654868, 255800054, 255945261, 256090489
+, 256235737, 256381006, 256526295, 256671605
+, 256816935, 256962286, 257107657, 257253049
+, 257398462, 257543895, 257689349, 257834823
+, 257980318, 258125833, 258271369, 258416925
+, 258562502, 258708099, 258853717, 258999355
+, 259145014, 259290693, 259436392, 259582112
+, 259727853, 259873614, 260019395, 260165197
+, 260311019, 260456862, 260602725, 260748609
+, 260894513, 261040437, 261186382, 261332347
+, 261478333, 261624339, 261770365, 261916411
+, 262062478, 262208566, 262354674, 262500802
+, 262646950, 262793119, 262939308, 263085517
+, 263231747, 263377997, 263524267, 263670558
+, 263816869, 263963200, 264109551, 264255923
+, 264402315, 264548728, 264695160, 264841613
+, 264988086, 265134579, 265281093, 265427627
+, 265574181, 265720755, 265867349, 266013964
+, 266160599, 266307254, 266453929, 266600625
+, 266747340, 266894076, 267040832, 267187608
+, 267334404, 267481221, 267628057, 267774914
+, 267921791, 268068688, 268215605, 268362542
+, 268509500, 268656477, 268803475, 268950493
+, 269097530, 269244588, 269391666, 269538764
+, 269685882, 269833021, 269980179, 270127357
+, 270274555, 270421774, 270569012, 270716271
+, 270863549, 271010848, 271158166, 271305505
+, 271452863, 271600242, 271747640, 271895059
+, 272042497, 272189956, 272337434, 272484933
+, 272632451, 272779990, 272927548, 273075126
+, 273222724, 273370342, 273517981, 273665639
+, 273813316, 273961014, 274108732, 274256470
+, 274404227, 274552005, 274699802, 274847619
+, 274995456, 275143313, 275291190, 275439087
+, 275587003, 275734940, 275882896, 276030872
+, 276178868, 276326884, 276474919, 276622975
+, 276771050, 276919145, 277067260, 277215394
+, 277363549, 277511723, 277659917, 277808130
+, 277956364, 278104617, 278252890, 278401183
+, 278549496, 278697828, 278846180, 278994552
+, 279142943, 279291354, 279439785, 279588236
+, 279736706, 279885196, 280033706, 280182236
+, 280330785, 280479353, 280627942, 280776550
+, 280925178, 281073825, 281222493, 281371179
+, 281519886, 281668612, 281817358, 281966123
+, 282114908, 282263713, 282412537, 282561381
+, 282710244, 282859127, 283008030, 283156952
+, 283305894, 283454855, 283603836, 283752836
+, 283901856, 284050896, 284199955, 284349034
+, 284498132, 284647250, 284796387, 284945544
+, 285094721, 285243917, 285393132, 285542367
+, 285691621, 285840895, 285990189, 286139502
+, 286288834, 286438186, 286587557, 286736948
+, 286886358, 287035788, 287185237, 287334706
+, 287484194, 287633701, 287783228, 287932774
+, 288082340, 288231925, 288381530, 288531154
+, 288680797, 288830460, 288980142, 289129844
+, 289279565, 289429305, 289579065, 289728844
+, 289878642, 290028460, 290178297, 290328153
+, 290478029, 290627924, 290777839, 290927773
+, 291077726, 291227698, 291377690, 291527701
+, 291677731, 291827781, 291977850, 292127938
+, 292278045, 292428172, 292578318, 292728484
+, 292878668, 293028872, 293179095, 293329337
+, 293479599, 293629880, 293780180, 293930499
+, 294080837, 294231195, 294381572, 294531968
+, 294682383, 294832818, 294983272, 295133744
+, 295284237, 295434748, 295585278, 295735828
+, 295886396, 296036984, 296187591, 296338218
+, 296488863, 296639527, 296790211, 296940914
+, 297091636, 297242377, 297393137, 297543916
+, 297694714, 297845532, 297996368, 298147224
+, 298298098, 298448992, 298599905, 298750837
+, 298901788, 299052758, 299203747, 299354755
+, 299505782, 299656829, 299807894, 299958978
+, 300110081, 300261204, 300412345, 300563505
+, 300714685, 300865883, 301017101, 301168337
+, 301319592, 301470867, 301622160, 301773472
+, 301924804, 302076154, 302227523, 302378911
+, 302530318, 302681744, 302833189, 302984653
+, 303136136, 303287638, 303439159, 303590698
+, 303742257, 303893834, 304045431, 304197046
+, 304348680, 304500333, 304652005, 304803696
+, 304955405, 305107134, 305258881, 305410648
+, 305562433, 305714237, 305866060, 306017901
+, 306169762, 306321641, 306473539, 306625456
+, 306777392, 306929347, 307081320, 307233312
+, 307385323, 307537353, 307689402, 307841469
+, 307993555, 308145660, 308297784, 308449927
+, 308602088, 308754268, 308906467, 309058684
+, 309210921, 309363176, 309515449, 309667742
+, 309820053, 309972383, 310124732, 310277099
+, 310429485, 310581890, 310734313, 310886755
+, 311039216, 311191696, 311344194, 311496711
+, 311649247, 311801801, 311954374, 312106965
+, 312259575, 312412204, 312564852, 312717518
+, 312870203, 313022906, 313175628, 313328369
+, 313481128, 313633906, 313786703, 313939518
+, 314092351, 314245204, 314398074, 314550964
+, 314703872, 314856799, 315009744, 315162708
+, 315315690, 315468691, 315621710, 315774748
+, 315927805, 316080880, 316233973, 316387086
+, 316540216, 316693365, 316846533, 316999719
+, 317152924, 317306147, 317459389, 317612649
+, 317765928, 317919225, 318072541, 318225875
+, 318379228, 318532599, 318685988, 318839396
+, 318992823, 319146268, 319299731, 319453213
+, 319606713, 319760232, 319913769, 320067324
+, 320220898, 320374491, 320528101, 320681731
+, 320835378, 320989044, 321142729, 321296431
+, 321450153, 321603892, 321757650, 321911426
+, 322065221, 322219034, 322372865, 322526715
+, 322680583, 322834470, 322988374, 323142297
+, 323296239, 323450199, 323604177, 323758173
+, 323912188, 324066221, 324220272, 324374342
+, 324528430, 324682536, 324836660, 324990803
+, 325144964, 325299144, 325453341, 325607557
+, 325761791, 325916044, 326070314, 326224603
+, 326378910, 326533236, 326687579, 326841941
+, 326996321, 327150720, 327305136, 327459571
+, 327614024, 327768495, 327922984, 328077492
+, 328232018, 328386562, 328541124, 328695704
+, 328850302, 329004919, 329159554, 329314207
+, 329468878, 329623567, 329778275, 329933000
+, 330087744, 330242506, 330397286, 330552084
+, 330706900, 330861735, 331016587, 331171458
+, 331326347, 331481254, 331636178, 331791121
+, 331946083, 332101062, 332256059, 332411074
+, 332566108, 332721159, 332876229, 333031317
+, 333186422, 333341546, 333496688, 333651848
+, 333807026, 333962221, 334117435, 334272667
+, 334427917, 334583185, 334738471, 334893776
+, 335049098, 335204438, 335359796, 335515172
+, 335670566, 335825978, 335981408, 336136856
+, 336292322, 336447806, 336603308, 336758828
+, 336914365, 337069921, 337225495, 337381087
+, 337536696, 337692324, 337847969, 338003633
+, 338159314, 338315013, 338470730, 338626465
+, 338782218, 338937989, 339093778, 339249585
+, 339405409, 339561252, 339717112, 339872990
+, 340028886, 340184800, 340340732, 340496682
+, 340652650, 340808635, 340964638, 341120659
+, 341276698, 341432755, 341588830, 341744922
+, 341901032, 342057161, 342213306, 342369470
+, 342525652, 342681851, 342838068, 342994303
+, 343150556, 343306826, 343463115, 343619421
+, 343775745, 343932086, 344088446, 344244823
+, 344401218, 344557631, 344714061, 344870509
+, 345026975, 345183459, 345339960, 345496480
+, 345653016, 345809571, 345966143, 346122733
+, 346279341, 346435967, 346592610, 346749271
+, 346905949, 347062646, 347219359, 347376091
+, 347532840, 347689607, 347846392, 348003194
+, 348160014, 348316852, 348473707, 348630580
+, 348787471, 348944379, 349101305, 349258249
+, 349415210, 349572189, 349729185, 349886199
+, 350043231, 350200280, 350357347, 350514432
+, 350671534, 350828653, 350985791, 351142946
+, 351300118, 351457308, 351614516, 351771741
+, 351928984, 352086244, 352243522, 352400817
+, 352558130, 352715461, 352872809, 353030175
+, 353187558, 353344959, 353502377, 353659813
+, 353817266, 353974737, 354132225, 354289731
+, 354447254, 354604795, 354762354, 354919929
+, 355077523, 355235134, 355392762, 355550408
+, 355708071, 355865752, 356023450, 356181166
+, 356338899, 356496649, 356654418, 356812203
+, 356970006, 357127826, 357285664, 357443520
+, 357601392, 357759282, 357917190, 358075115
+, 358233057, 358391017, 358548994, 358706989
+, 358865001, 359023030, 359181077, 359339141
+, 359497223, 359655322, 359813438, 359971572
+, 360129723, 360287891, 360446077, 360604280
+, 360762501, 360920738, 361078994, 361237266
+, 361395556, 361553863, 361712188, 361870530
+, 362028889, 362187265, 362345659, 362504070
+, 362662499, 362820944, 362979407, 363137888
+, 363296385, 363454900, 363613432, 363771982
+, 363930549, 364089133, 364247734, 364406353
+, 364564988, 364723642, 364882312, 365041000
+, 365199704, 365358426, 365517166, 365675922
+, 365834696, 365993487, 366152296, 366311121
+, 366469964, 366628824, 366787701, 366946595
+, 367105507, 367264435, 367423381, 367582344
+, 367741325, 367900322, 368059337, 368218369
+, 368377418, 368536484, 368695567, 368854668
+, 369013785, 369172920, 369332072, 369491241
+, 369650428, 369809631, 369968852, 370128089
+, 370287344, 370446616, 370605905, 370765211
+, 370924535, 371083875, 371243232, 371402607
+, 371561999, 371721408, 371880833, 372040276
+, 372199737, 372359214, 372518708, 372678219
+, 372837748, 372997293, 373156856, 373316435
+, 373476032, 373635645, 373795276, 373954924
+, 374114589, 374274270, 374433969, 374593685
+, 374753418, 374913168, 375072935, 375232719
+, 375392520, 375552338, 375712173, 375872025
+, 376031894, 376191780, 376351683, 376511603
+, 376671540, 376831494, 376991465, 377151453
+, 377311458, 377471479, 377631518, 377791574
+, 377951647, 378111736, 378271843, 378431966
+, 378592107, 378752264, 378912439, 379072630
+, 379232838, 379393063, 379553305, 379713564
+, 379873840, 380034133, 380194443, 380354769
+, 380515113, 380675473, 380835850, 380996244
+, 381156655, 381317083, 381477528, 381637990
+, 381798468, 381958964, 382119476, 382280005
+, 382440551, 382601114, 382761694, 382922290
+, 383082903, 383243534, 383404181, 383564844
+, 383725525, 383886223, 384046937, 384207668
+, 384368416, 384529181, 384689962, 384850761
+, 385011576, 385172408, 385333256, 385494122
+, 385655004, 385815903, 385976819, 386137752
+, 386298701, 386459667, 386620650, 386781650
+, 386942667, 387103700, 387264750, 387425816
+, 387586900, 387748000, 387909117, 388070251
+, 388231401, 388392568, 388553752, 388714952
+, 388876170, 389037404, 389198654, 389359922
+, 389521206, 389682507, 389843824, 390005158
+, 390166509, 390327877, 390489261, 390650662
+, 390812079, 390973513, 391134964, 391296432
+, 391457916, 391619417, 391780934, 391942469
+, 392104019, 392265587, 392427171, 392588772
+, 392750389, 392912023, 393073674, 393235341
+, 393397025, 393558725, 393720442, 393882176
+, 394043926, 394205693, 394367477, 394529277
+, 394691093, 394852927, 395014776, 395176643
+, 395338526, 395500425, 395662342, 395824274
+, 395986224, 396148189, 396310172, 396472171
+, 396634186, 396796218, 396958267, 397120332
+, 397282414, 397444512, 397606627, 397768758
+, 397930906, 398093070, 398255251, 398417448
+, 398579662, 398741892, 398904139, 399066402
+, 399228682, 399390979, 399553291, 399715621
+, 399877966, 400040329, 400202707, 400365103
+, 400527514, 400689943, 400852387, 401014848
+, 401177326, 401339820, 401502330, 401664857
+, 401827400, 401989960, 402152536, 402315129
+, 402477738, 402640363, 402803005, 402965664
+, 403128338, 403291030, 403453737, 403616461
+, 403779201, 403941958, 404104731, 404267521
+, 404430327, 404593149, 404755988, 404918843
+, 405081715, 405244602, 405407507, 405570427
+, 405733364, 405896317, 406059287, 406222273
+, 406385275, 406548294, 406711329, 406874381
+, 407037448, 407200532, 407363633, 407526750
+, 407689883, 407853032, 408016198, 408179380
+, 408342578, 408505793, 408669024, 408832271
+, 408995534, 409158814, 409322110, 409485423
+, 409648751, 409812096, 409975457, 410138835
+, 410302229, 410465639, 410629065, 410792508
+, 410955967, 411119442, 411282933, 411446441
+, 411609964, 411773505, 411937061, 412100633
+, 412264222, 412427827, 412591449, 412755086
+, 412918740, 413082410, 413246096, 413409798
+, 413573517, 413737251, 413901002, 414064769
+, 414228553, 414392352, 414556168, 414720000
+, 414883848, 415047712, 415211593, 415375489
+, 415539402, 415703331, 415867276, 416031238
+, 416195215, 416359209, 416523218, 416687244
+, 416851286, 417015344, 417179419, 417343509
+, 417507616, 417671738, 417835877, 418000032
+, 418164203, 418328390, 418492594, 418656813
+, 418821048, 418985300, 419149568, 419313852
+, 419478151, 419642467, 419806800, 419971148
+, 420135512, 420299892, 420464289, 420628701
+, 420793130, 420957574, 421122035, 421286511
+, 421451004, 421615513, 421780038, 421944579
+, 422109136, 422273709, 422438298, 422602903
+, 422767524, 422932161, 423096814, 423261483
+, 423426168, 423590870, 423755587, 423920320
+, 424085069, 424249834, 424414616, 424579413
+, 424744226, 424909055, 425073900, 425238762
+, 425403639, 425568532, 425733441, 425898366
+, 426063307, 426228264, 426393237, 426558226
+, 426723231, 426888252, 427053288, 427218341
+, 427383410, 427548494, 427713595, 427878711
+, 428043844, 428208992, 428374156, 428539337
+, 428704533, 428869745, 429034973, 429200217
+, 429365476, 429530752, 429696043, 429861351
+, 430026674, 430192013, 430357369, 430522740
+, 430688126, 430853529, 431018948, 431184382
+, 431349833, 431515299, 431680781, 431846279
+, 432011793, 432177323, 432342868, 432508430
+, 432674007, 432839600, 433005209, 433170834
+, 433336474, 433502131, 433667803, 433833491
+, 433999195, 434164914, 434330650, 434496401
+, 434662168, 434827951, 434993750, 435159565
+, 435325395, 435491241, 435657103, 435822981
+, 435988874, 436154784, 436320709, 436486650
+, 436652606, 436818579, 436984567, 437150571
+, 437316590, 437482626, 437648677, 437814744
+, 437980827, 438146925, 438313039, 438479169
+, 438645315, 438811476, 438977653, 439143846
+, 439310055, 439476279, 439642519, 439808775
+, 439975046, 440141333, 440307636, 440473955
+, 440640289, 440806639, 440973005, 441139386
+, 441305783, 441472196, 441638624, 441805068
+, 441971528, 442138004, 442304495, 442471002
+, 442637524, 442804062, 442970616, 443137185
+, 443303770, 443470371, 443636988, 443803620
+, 443970267, 444136931, 444303610, 444470304
+, 444637014, 444803740, 444970482, 445137239
+, 445304012, 445470800, 445637604, 445804423
+, 445971259, 446138109, 446304976, 446471858
+, 446638755, 446805668, 446972597, 447139542
+, 447306501, 447473477, 447640468, 447807475
+, 447974497, 448141535, 448308588, 448475657
+, 448642742, 448809842, 448976957, 449144088
+, 449311235, 449478397, 449645575, 449812768
+, 449979977, 450147202, 450314442, 450481697
+, 450648968, 450816255, 450983557, 451150874
+, 451318207, 451485556, 451652920, 451820300
+, 451987695, 452155105, 452322531, 452489973
+, 452657430, 452824903, 452992391, 453159894
+, 453327413, 453494948, 453662498, 453830063
+, 453997644, 454165240, 454332852, 454500480
+, 454668122, 454835781, 455003454, 455171143
+, 455338848, 455506568, 455674303, 455842054
+, 456009821, 456177602, 456345399, 456513212
+, 456681040, 456848884, 457016742, 457184617
+, 457352506, 457520411, 457688332, 457856268
+, 458024219, 458192186, 458360168, 458528165
+, 458696178, 458864207, 459032250, 459200309
+, 459368384, 459536474, 459704579, 459872699
+, 460040835, 460208986, 460377153, 460545335
+, 460713532, 460881745, 461049973, 461218216
+, 461386475, 461554749, 461723039, 461891343
+, 462059663, 462227999, 462396350, 462564716
+, 462733097, 462901494, 463069906, 463238333
+, 463406776, 463575234, 463743707, 463912196
+, 464080699, 464249219, 464417753, 464586303
+, 464754868, 464923448, 465092044, 465260655
+, 465429281, 465597922, 465766579, 465935251
+, 466103938, 466272641, 466441358, 466610091
+, 466778840, 466947603, 467116382, 467285176
+, 467453985, 467622810, 467791650, 467960505
+, 468129375, 468298260, 468467161, 468636077
+, 468805008, 468973954, 469142916, 469311893
+, 469480885, 469649892, 469818914, 469987952
+, 470157005, 470326073, 470495156, 470664254
+, 470833368, 471002497, 471171641, 471340800
+, 471509974, 471679164, 471848368, 472017588
+, 472186823, 472356073, 472525339, 472694619
+, 472863915, 473033226, 473202552, 473371893
+, 473541249, 473710620, 473880007, 474049409
+, 474218825, 474388257, 474557704, 474727167
+, 474896644, 475066136, 475235644, 475405167
+, 475574704, 475744257, 475913825, 476083408
+, 476253007, 476422620, 476592248, 476761892
+, 476931550, 477101224, 477270913, 477440617
+, 477610336, 477780070, 477949819, 478119583
+, 478289362, 478459157, 478628966, 478798790
+, 478968630, 479138484, 479308354, 479478239
+, 479648138, 479818053, 479987983, 480157928
+, 480327888, 480497863, 480667853, 480837858
+, 481007878, 481177913, 481347963, 481518028
+, 481688108, 481858203, 482028313, 482198438
+, 482368578, 482538734, 482708904, 482879089
+, 483049289, 483219504, 483389734, 483559979
+, 483730240, 483900515, 484070805, 484241110
+, 484411430, 484581765, 484752115, 484922480
+, 485092860, 485263254, 485433664, 485604089
+, 485774529, 485944983, 486115453, 486285938
+, 486456437, 486626952, 486797481, 486968025
+, 487138585, 487309159, 487479748, 487650352
+, 487820971, 487991605, 488162254, 488332917
+, 488503596, 488674290, 488844998, 489015721
+, 489186460, 489357213, 489527981, 489698764
+, 489869562, 490040374, 490211202, 490382044
+, 490552902, 490723774, 490894661, 491065563
+, 491236480, 491407412, 491578358, 491749320
+, 491920296, 492091287, 492262294, 492433314
+, 492604350, 492775401, 492946466, 493117547
+, 493288642, 493459752, 493630876, 493802016
+, 493973171, 494144340, 494315524, 494486723
+, 494657937, 494829165, 495000409, 495171667
+, 495342940, 495514228, 495685530, 495856848
+, 496028180, 496199527, 496370889, 496542265
+, 496713657, 496885063, 497056484, 497227919
+, 497399370, 497570835, 497742315, 497913810
+, 498085320, 498256844, 498428383, 498599937
+, 498771506, 498943089, 499114687, 499286300
+, 499457928, 499629570, 499801227, 499972899
+, 500144586, 500316287, 500488003, 500659734
+, 500831480, 501003240, 501175015, 501346805
+, 501518609, 501690428, 501862262, 502034111
+, 502205974, 502377852, 502549745, 502721652
+, 502893574, 503065511, 503237462, 503409429
+, 503581409, 503753405, 503925415, 504097440
+, 504269480, 504441534, 504613603, 504785686
+, 504957785, 505129897, 505302025, 505474167
+, 505646324, 505818496, 505990682, 506162883
+, 506335098, 506507328, 506679573, 506851833
+, 507024107, 507196395, 507368699, 507541017
+, 507713349, 507885697, 508058058, 508230435
+, 508402826, 508575232, 508747652, 508920087
+, 509092536, 509265000, 509437479, 509609972
+, 509782480, 509955003, 510127540, 510300092
+, 510472658, 510645239, 510817834, 510990444
+, 511163069, 511335708, 511508362, 511681030
+, 511853713, 512026411, 512199123, 512371849
+, 512544590, 512717346, 512890116, 513062901
+, 513235701, 513408514, 513581343, 513754186
+, 513927043, 514099916, 514272802, 514445703
+, 514618619, 514791549, 514964494, 515137453
+, 515310427, 515483415, 515656418, 515829435
+, 516002467, 516175513, 516348574, 516521649
+, 516694739, 516867844, 517040962, 517214096
+, 517387243, 517560406, 517733582, 517906774
+, 518079979, 518253200, 518426434, 518599683
+, 518772947, 518946225, 519119518, 519292825
+, 519466146, 519639482, 519812833, 519986197
+, 520159577, 520332970, 520506379, 520679801
+, 520853238, 521026690, 521200156, 521373636
+, 521547131, 521720640, 521894164, 522067702
+, 522241255, 522414822, 522588403, 522761999
+, 522935609, 523109234, 523282873, 523456526
+, 523630194, 523803876, 523977573, 524151284
+, 524325009, 524498749, 524672503, 524846272
+, 525020055, 525193852, 525367664, 525541490
+, 525715330, 525889185, 526063054, 526236938
+, 526410836, 526584748, 526758675, 526932616
+, 527106571, 527280541, 527454525, 527628524
+, 527802536, 527976563, 528150605, 528324661
+, 528498731, 528672815, 528846914, 529021027
+, 529195155, 529369297, 529543453, 529717623
+, 529891808, 530066007, 530240220, 530414448
+, 530588690, 530762946, 530937217, 531111502
+, 531285801, 531460115, 531634442, 531808785
+, 531983141, 532157512, 532331897, 532506296
+, 532680709, 532855137, 533029579, 533204036
+, 533378506, 533552991, 533727490, 533902004
+, 534076531, 534251073, 534425630, 534600200
+, 534774785, 534949384, 535123997, 535298624
+, 535473266, 535647922, 535822592, 535997276
+, 536171975, 536346688, 536521415, 536696156
+, 536870912, 537045682, 537220466, 537395264
+, 537570076, 537744903, 537919744, 538094599
+, 538269468, 538444352, 538619249, 538794161
+, 538969087, 539144028, 539318982, 539493951
+, 539668934, 539843931, 540018942, 540193967
+, 540369007, 540544060, 540719128, 540894210
+, 541069307, 541244417, 541419542, 541594680
+, 541769833, 541945000, 542120182, 542295377
+, 542470587, 542645810, 542821048, 542996300
+, 543171566, 543346846, 543522141, 543697449
+, 543872772, 544048109, 544223460, 544398825
+, 544574204, 544749597, 544925004, 545100426
+, 545275862, 545451311, 545626775, 545802253
+, 545977745, 546153251, 546328772, 546504306
+, 546679854, 546855417, 547030994, 547206584
+, 547382189, 547557808, 547733441, 547909088
+, 548084749, 548260425, 548436114, 548611817
+, 548787535, 548963266, 549139012, 549314771
+, 549490545, 549666333, 549842135, 550017950
+, 550193780, 550369624, 550545482, 550721354
+, 550897241, 551073141, 551249055, 551424983
+, 551600925, 551776882, 551952852, 552128836
+, 552304835, 552480847, 552656873, 552832914
+, 553008968, 553185037, 553361119, 553537215
+, 553713326, 553889450, 554065589, 554241741
+, 554417908, 554594088, 554770283, 554946491
+, 555122714, 555298950, 555475201, 555651465
+, 555827743, 556004036, 556180342, 556356662
+, 556532997, 556709345, 556885707, 557062083
+, 557238473, 557414877, 557591295, 557767727
+, 557944173, 558120633, 558297107, 558473595
+, 558650097, 558826612, 559003142, 559179686
+, 559356243, 559532814, 559709400, 559885999
+, 560062612, 560239240, 560415881, 560592536
+, 560769205, 560945887, 561122584, 561299295
+, 561476019, 561652758, 561829510, 562006276
+, 562183057, 562359851, 562536659, 562713480
+, 562890316, 563067166, 563244029, 563420907
+, 563597798, 563774703, 563951622, 564128555
+, 564305502, 564482463, 564659437, 564836426
+, 565013428, 565190444, 565367474, 565544518
+, 565721576, 565898647, 566075733, 566252832
+, 566429945, 566607072, 566784213, 566961368
+, 567138536, 567315719, 567492915, 567670125
+, 567847349, 568024586, 568201838, 568379103
+, 568556382, 568733675, 568910982, 569088303
+, 569265637, 569442985, 569620347, 569797723
+, 569975113, 570152516, 570329933, 570507365
+, 570684809, 570862268, 571039740, 571217227
+, 571394727, 571572240, 571749768, 571927309
+, 572104865, 572282433, 572460016, 572637613
+, 572815223, 572992847, 573170485, 573348136
+, 573525802, 573703481, 573881173, 574058880
+, 574236600, 574414334, 574592082, 574769844
+, 574947619, 575125408, 575303211, 575481028
+, 575658858, 575836702, 576014560, 576192431
+, 576370316, 576548215, 576726128, 576904054
+, 577081994, 577259948, 577437916, 577615897
+, 577793892, 577971901, 578149923, 578327959
+, 578506009, 578684072, 578862149, 579040240
+, 579218345, 579396463, 579574595, 579752741
+, 579930900, 580109073, 580287260, 580465460
+, 580643674, 580821902, 581000143, 581178399
+, 581356667, 581534950, 581713246, 581891555
+, 582069879, 582248216, 582426567, 582604931
+, 582783309, 582961701, 583140106, 583318525
+, 583496958, 583675404, 583853864, 584032337
+, 584210825, 584389325, 584567840, 584746368
+, 584924910, 585103465, 585282034, 585460616
+, 585639213, 585817822, 585996446, 586175083
+, 586353733, 586532398, 586711076, 586889767
+, 587068472, 587247191, 587425923, 587604669
+, 587783428, 587962201, 588140988, 588319788
+, 588498602, 588677429, 588856270, 589035125
+, 589213993, 589392875, 589571770, 589750679
+, 589929601, 590108537, 590287487, 590466450
+, 590645427, 590824417, 591003421, 591182438
+, 591361469, 591540513, 591719571, 591898643
+, 592077728, 592256827, 592435939, 592615065
+, 592794204, 592973357, 593152523, 593331703
+, 593510896, 593690103, 593869324, 594048558
+, 594227805, 594407066, 594586341, 594765629
+, 594944930, 595124245, 595303574, 595482916
+, 595662271, 595841640, 596021023, 596200419
+, 596379829, 596559252, 596738688, 596918138
+, 597097602, 597277079, 597456569, 597636073
+, 597815591, 597995122, 598174666, 598354224
+, 598533795, 598713380, 598892979, 599072590
+, 599252216, 599431854, 599611506, 599791172
+, 599970851, 600150544, 600330250, 600509969
+, 600689702, 600869448, 601049208, 601228981
+, 601408768, 601588568, 601768381, 601948208
+, 602128049, 602307902, 602487770, 602667650
+, 602847544, 603027452, 603207373, 603387307
+, 603567255, 603747216, 603927191, 604107179
+, 604287180, 604467195, 604647223, 604827265
+, 605007320, 605187388, 605367470, 605547565
+, 605727674, 605907796, 606087931, 606268080
+, 606448242, 606628417, 606808606, 606988808
+, 607169024, 607349253, 607529496, 607709751
+, 607890020, 608070303, 608250599, 608430908
+, 608611231, 608791566, 608971916, 609152278
+, 609332654, 609513044, 609693446, 609873862
+, 610054292, 610234735, 610415191, 610595660
+, 610776143, 610956639, 611137148, 611317671
+, 611498207, 611678756, 611859319, 612039895
+, 612220484, 612401087, 612581703, 612762332
+, 612942975, 613123631, 613304300, 613484983
+, 613665679, 613846388, 614027110, 614207846
+, 614388595, 614569357, 614750133, 614930922
+, 615111724, 615292540, 615473368, 615654210
+, 615835066, 616015934, 616196816, 616377712
+, 616558620, 616739542, 616920477, 617101425
+, 617282386, 617463361, 617644349, 617825351
+, 618006365, 618187393, 618368434, 618549488
+, 618730556, 618911637, 619092731, 619273838
+, 619454959, 619636093, 619817240, 619998400
+, 620179573, 620360760, 620541960, 620723173
+, 620904400, 621085639, 621266892, 621448158
+, 621629438, 621810730, 621992036, 622173355
+, 622354687, 622536032, 622717391, 622898763
+, 623080148, 623261546, 623442957, 623624382
+, 623805820, 623987271, 624168735, 624350212
+, 624531703, 624713207, 624894724, 625076254
+, 625257797, 625439354, 625620923, 625802506
+, 625984102, 626165711, 626347334, 626528969
+, 626710618, 626892280, 627073955, 627255643
+, 627437344, 627619058, 627800786, 627982527
+, 628164281, 628346048, 628527828, 628709621
+, 628891428, 629073248, 629255080, 629436926
+, 629618785, 629800658, 629982543, 630164441
+, 630346353, 630528278, 630710215, 630892166
+, 631074130, 631256108, 631438098, 631620101
+, 631802118, 631984147, 632166190, 632348246
+, 632530315, 632712397, 632894492, 633076600
+, 633258722, 633440856, 633623004, 633805164
+, 633987338, 634169525, 634351725, 634533938
+, 634716164, 634898403, 635080655, 635262921
+, 635445199, 635627490, 635809795, 635992113
+, 636174443, 636356787, 636539144, 636721514
+, 636903896, 637086292, 637268701, 637451123
+, 637633559, 637816007, 637998468, 638180942
+, 638363430, 638545930, 638728443, 638910970
+, 639093509, 639276062, 639458627, 639641206
+, 639823797, 640006402, 640189020, 640371650
+, 640554294, 640736951, 640919621, 641102303
+, 641284999, 641467708, 641650430, 641833165
+, 642015912, 642198673, 642381447, 642564234
+, 642747034, 642929846, 643112672, 643295511
+, 643478363, 643661228, 643844105, 644026996
+, 644209900, 644392817, 644575746, 644758689
+, 644941645, 645124613, 645307595, 645490590
+, 645673597, 645856618, 646039651, 646222698
+, 646405757, 646588830, 646771915, 646955013
+, 647138125, 647321249, 647504386, 647687536
+, 647870699, 648053875, 648237064, 648420266
+, 648603481, 648786709, 648969949, 649153203
+, 649336470, 649519749, 649703042, 649886347
+, 650069665, 650252997, 650436341, 650619698
+, 650803068, 650986451, 651169847, 651353255
+, 651536677, 651720112, 651903559, 652087020
+, 652270493, 652453979, 652637478, 652820990
+, 653004515, 653188053, 653371604, 653555167
+, 653738744, 653922333, 654105935, 654289550
+, 654473178, 654656819, 654840473, 655024140
+, 655207819, 655391512, 655575217, 655758935
+, 655942666, 656126410, 656310167, 656493936
+, 656677719, 656861514, 657045322, 657229143
+, 657412977, 657596824, 657780683, 657964556
+, 658148441, 658332339, 658516250, 658700174
+, 658884111, 659068060, 659252023, 659435998
+, 659619986, 659803987, 659988000, 660172027
+, 660356066, 660540118, 660724183, 660908261
+, 661092351, 661276455, 661460571, 661644700
+, 661828842, 662012997, 662197164, 662381344
+, 662565538, 662749743, 662933962, 663118194
+, 663302438, 663486695, 663670965, 663855247
+, 664039543, 664223851, 664408172, 664592506
+, 664776853, 664961212, 665145584, 665329969
+, 665514367, 665698777, 665883200, 666067636
+, 666252085, 666436547, 666621021, 666805508
+, 666990008, 667174521, 667359046, 667543584
+, 667728135, 667912699, 668097275, 668281864
+, 668466466, 668651081, 668835708, 669020348
+, 669205001, 669389667, 669574345, 669759036
+, 669943740, 670128456, 670313185, 670497927
+, 670682682, 670867450, 671052230, 671237023
+, 671421828, 671606647, 671791478, 671976321
+, 672161178, 672346047, 672530929, 672715823
+, 672900731, 673085651, 673270583, 673455529
+, 673640487, 673825458, 674010441, 674195437
+, 674380446, 674565468, 674750502, 674935549
+, 675120609, 675305681, 675490766, 675675863
+, 675860974, 676046097, 676231232, 676416381
+, 676601542, 676786716, 676971902, 677157101
+, 677342313, 677527537, 677712774, 677898024
+, 678083286, 678268561, 678453849, 678639149
+, 678824462, 679009787, 679195126, 679380477
+, 679565840, 679751216, 679936605, 680122006
+, 680307421, 680492847, 680678287, 680863739
+, 681049203, 681234680, 681420170, 681605673
+, 681791188, 681976716, 682162256, 682347809
+, 682533374, 682718953, 682904543, 683090147
+, 683275763, 683461391, 683647033, 683832687
+, 684018353, 684204032, 684389724, 684575428
+, 684761145, 684946874, 685132616, 685318371
+, 685504138, 685689918, 685875710, 686061515
+, 686247332, 686433163, 686619005, 686804861
+, 686990728, 687176609, 687362502, 687548407
+, 687734325, 687920256, 688106199, 688292155
+, 688478123, 688664104, 688850098, 689036104
+, 689222122, 689408154, 689594197, 689780254
+, 689966322, 690152404, 690338498, 690524604
+, 690710723, 690896854, 691082998, 691269155
+, 691455324, 691641506, 691827700, 692013907
+, 692200126, 692386358, 692572602, 692758859
+, 692945128, 693131410, 693317704, 693504011
+, 693690330, 693876662, 694063007, 694249364
+, 694435733, 694622115, 694808509, 694994916
+, 695181336, 695367768, 695554212, 695740669
+, 695927138, 696113620, 696300115, 696486621
+, 696673141, 696859673, 697046217, 697232774
+, 697419343, 697605925, 697792519, 697979126
+, 698165745, 698352377, 698539021, 698725677
+, 698912347, 699099028, 699285722, 699472429
+, 699659147, 699845879, 700032623, 700219379
+, 700406148, 700592929, 700779723, 700966529
+, 701153347, 701340178, 701527022, 701713878
+, 701900746, 702087627, 702274520, 702461425
+, 702648343, 702835274, 703022217, 703209172
+, 703396140, 703583120, 703770113, 703957118
+, 704144135, 704331165, 704518208, 704705262
+, 704892329, 705079409, 705266501, 705453605
+, 705640722, 705827851, 706014993, 706202147
+, 706389313, 706576492, 706763683, 706950887
+, 707138103, 707325331, 707512572, 707699825
+, 707887090, 708074368, 708261659, 708448961
+, 708636276, 708823604, 709010944, 709198296
+, 709385660, 709573037, 709760427, 709947828
+, 710135242, 710322669, 710510107, 710697559
+, 710885022, 711072498, 711259986, 711447487
+, 711635000, 711822525, 712010063, 712197613
+, 712385175, 712572750, 712760337, 712947936
+, 713135548, 713323172, 713510808, 713698457
+, 713886118, 714073791, 714261477, 714449175
+, 714636885, 714824608, 715012343, 715200090
+, 715387850, 715575622, 715763406, 715951203
+, 716139012, 716326833, 716514667, 716702513
+, 716890371, 717078242, 717266124, 717454019
+, 717641927, 717829847, 718017779, 718205723
+, 718393680, 718581648, 718769630, 718957623
+, 719145629, 719333647, 719521677, 719709720
+, 719897775, 720085842, 720273922, 720462013
+, 720650117, 720838234, 721026362, 721214503
+, 721402656, 721590822, 721778999, 721967189
+, 722155392, 722343606, 722531833, 722720072
+, 722908323, 723096587, 723284862, 723473150
+, 723661451, 723849763, 724038088, 724226425
+, 724414774, 724603136, 724791509, 724979895
+, 725168294, 725356704, 725545127, 725733562
+, 725922009, 726110468, 726298940, 726487424
+, 726675920, 726864428, 727052949, 727241481
+, 727430026, 727618583, 727807153, 727995734
+, 728184328, 728372934, 728561553, 728750183
+, 728938826, 729127480, 729316148, 729504827
+, 729693518, 729882222, 730070938, 730259666
+, 730448406, 730637159, 730825923, 731014700
+, 731203489, 731392290, 731581104, 731769929
+, 731958767, 732147617, 732336479, 732525353
+, 732714240, 732903139, 733092049, 733280972
+, 733469908, 733658855, 733847814, 734036786
+, 734225770, 734414766, 734603774, 734792794
+, 734981827, 735170871, 735359928, 735548997
+, 735738078, 735927171, 736116277, 736305394
+, 736494524, 736683666, 736872820, 737061986
+, 737251164, 737440354, 737629557, 737818771
+, 738007998, 738197237, 738386488, 738575751
+, 738765026, 738954314, 739143613, 739332925
+, 739522249, 739711585, 739900933, 740090293
+, 740279665, 740469049, 740658446, 740847854
+, 741037275, 741226708, 741416152, 741605609
+, 741795078, 741984560, 742174053, 742363558
+, 742553076, 742742605, 742932147, 743121701
+, 743311266, 743500844, 743690434, 743880036
+, 744069651, 744259277, 744448915, 744638566
+, 744828228, 745017903, 745207589, 745397288
+, 745586999, 745776721, 745966456, 746156203
+, 746345962, 746535733, 746725517, 746915312
+, 747105119, 747294938, 747484770, 747674613
+, 747864469, 748054336, 748244216, 748434107
+, 748624011, 748813927, 749003855, 749193794
+, 749383746, 749573710, 749763686, 749953674
+, 750143674, 750333686, 750523710, 750713746
+, 750903794, 751093854, 751283926, 751474011
+, 751664107, 751854215, 752044335, 752234467
+, 752424612, 752614768, 752804936, 752995117
+, 753185309, 753375513, 753565729, 753755958
+, 753946198, 754136450, 754326715, 754516991
+, 754707279, 754897580, 755087892, 755278216
+, 755468553, 755658901, 755849261, 756039633
+, 756230018, 756420414, 756610822, 756801242
+, 756991675, 757182119, 757372575, 757563043
+, 757753523, 757944015, 758134519, 758325035
+, 758515563, 758706103, 758896655, 759087219
+, 759277794, 759468382, 759658982, 759849593
+, 760040217, 760230853, 760421500, 760612160
+, 760802831, 760993514, 761184210, 761374917
+, 761565636, 761756367, 761947110, 762137866
+, 762328632, 762519411, 762710202, 762901005
+, 763091820, 763282646, 763473485, 763664335
+, 763855198, 764046072, 764236958, 764427856
+, 764618767, 764809689, 765000622, 765191568
+, 765382526, 765573496, 765764477, 765955471
+, 766146476, 766337493, 766528523, 766719564
+, 766910617, 767101682, 767292758, 767483847
+, 767674948, 767866060, 768057185, 768248321
+, 768439469, 768630629, 768821801, 769012985
+, 769204180, 769395388, 769586607, 769777839
+, 769969082, 770160337, 770351604, 770542883
+, 770734174, 770925476, 771116791, 771308117
+, 771499455, 771690805, 771882167, 772073541
+, 772264926, 772456324, 772647733, 772839155
+, 773030588, 773222032, 773413489, 773604958
+, 773796438, 773987931, 774179435, 774370951
+, 774562479, 774754018, 774945570, 775137133
+, 775328708, 775520295, 775711894, 775903505
+, 776095127, 776286762, 776478408, 776670066
+, 776861736, 777053417, 777245111, 777436816
+, 777628533, 777820262, 778012003, 778203755
+, 778395520, 778587296, 778779084, 778970884
+, 779162695, 779354519, 779546354, 779738201
+, 779930060, 780121930, 780313813, 780505707
+, 780697613, 780889531, 781081460, 781273402
+, 781465355, 781657320, 781849297, 782041285
+, 782233285, 782425297, 782617321, 782809357
+, 783001404, 783193464, 783385535, 783577617
+, 783769712, 783961818, 784153936, 784346066
+, 784538208, 784730361, 784922526, 785114703
+, 785306892, 785499092, 785691304, 785883528
+, 786075764, 786268012, 786460271, 786652542
+, 786844824, 787037119, 787229425, 787421743
+, 787614073, 787806414, 787998767, 788191132
+, 788383509, 788575897, 788768297, 788960709
+, 789153133, 789345568, 789538015, 789730474
+, 789922944, 790115426, 790307920, 790500426
+, 790692943, 790885472, 791078013, 791270566
+, 791463130, 791655706, 791848294, 792040893
+, 792233504, 792426127, 792618762, 792811408
+, 793004066, 793196735, 793389417, 793582110
+, 793774814, 793967531, 794160259, 794352999
+, 794545750, 794738513, 794931288, 795124075
+, 795316873, 795509683, 795702505, 795895338
+, 796088183, 796281039, 796473908, 796666788
+, 796859680, 797052583, 797245498, 797438425
+, 797631363, 797824313, 798017275, 798210248
+, 798403233, 798596230, 798789238, 798982258
+, 799175290, 799368333, 799561388, 799754455
+, 799947533, 800140623, 800333725, 800526838
+, 800719963, 800913099, 801106248, 801299407
+, 801492579, 801685762, 801878957, 802072163
+, 802265381, 802458611, 802651852, 802845105
+, 803038370, 803231646, 803424934, 803618233
+, 803811544, 804004867, 804198201, 804391547
+, 804584905, 804778274, 804971654, 805165047
+, 805358451, 805551866, 805745294, 805938733
+, 806132183, 806325645, 806519119, 806712604
+, 806906101, 807099609, 807293129, 807486661
+, 807680204, 807873759, 808067326, 808260904
+, 808454493, 808648094, 808841707, 809035332
+, 809228968, 809422615, 809616274, 809809945
+, 810003627, 810197321, 810391027, 810584744
+, 810778472, 810972213, 811165964, 811359728
+, 811553503, 811747289, 811941087, 812134897
+, 812328718, 812522551, 812716395, 812910251
+, 813104118, 813297997, 813491888, 813685790
+, 813879703, 814073628, 814267565, 814461513
+, 814655473, 814849445, 815043427, 815237422
+, 815431428, 815625445, 815819475, 816013515
+, 816207567, 816401631, 816595706, 816789793
+, 816983891, 817178001, 817372122, 817566255
+, 817760400, 817954555, 818148723, 818342902
+, 818537092, 818731294, 818925508, 819119733
+, 819313969, 819508217, 819702477, 819896748
+, 820091031, 820285325, 820479630, 820673947
+, 820868276, 821062616, 821256968, 821451331
+, 821645705, 821840091, 822034489, 822228898
+, 822423319, 822617751, 822812194, 823006649
+, 823201116, 823395594, 823590083, 823784584
+, 823979097, 824173621, 824368156, 824562703
+, 824757261, 824951831, 825146413, 825341005
+, 825535610, 825730225, 825924853, 826119491
+, 826314141, 826508803, 826703476, 826898160
+, 827092856, 827287564, 827482283, 827677013
+, 827871755, 828066508, 828261273, 828456049
+, 828650837, 828845636, 829040446, 829235268
+, 829430102, 829624946, 829819803, 830014670
+, 830209550, 830404440, 830599342, 830794256
+, 830989181, 831184117, 831379065, 831574024
+, 831768994, 831963976, 832158970, 832353975
+, 832548991, 832744019, 832939058, 833134109
+, 833329170, 833524244, 833719329, 833914425
+, 834109533, 834304652, 834499782, 834694924
+, 834890077, 835085242, 835280418, 835475605
+, 835670804, 835866015, 836061236, 836256469
+, 836451714, 836646970, 836842237, 837037516
+, 837232806, 837428107, 837623420, 837818744
+, 838014080, 838209427, 838404785, 838600155
+, 838795536, 838990928, 839186332, 839381747
+, 839577174, 839772612, 839968061, 840163522
+, 840358994, 840554478, 840749972, 840945479
+, 841140996, 841336525, 841532065, 841727617
+, 841923180, 842118754, 842314340, 842509937
+, 842705546, 842901165, 843096797, 843292439
+, 843488093, 843683758, 843879435, 844075122
+, 844270822, 844466532, 844662254, 844857987
+, 845053732, 845249488, 845445255, 845641034
+, 845836823, 846032625, 846228437, 846424261
+, 846620096, 846815943, 847011801, 847207670
+, 847403550, 847599442, 847795345, 847991260
+, 848187186, 848383123, 848579071, 848775031
+, 848971002, 849166984, 849362978, 849558983
+, 849754999, 849951027, 850147065, 850343116
+, 850539177, 850735250, 850931334, 851127429
+, 851323536, 851519654, 851715783, 851911924
+, 852108076, 852304239, 852500413, 852696599
+, 852892796, 853089004, 853285224, 853481454
+, 853677697, 853873950, 854070215, 854266491
+, 854462778, 854659076, 854855386, 855051707
+, 855248039, 855444383, 855640738, 855837104
+, 856033481, 856229870, 856426270, 856622681
+, 856819103, 857015537, 857211982, 857408438
+, 857604905, 857801384, 857997874, 858194375
+, 858390888, 858587411, 858783946, 858980492
+, 859177050, 859373619, 859570198, 859766790
+, 859963392, 860160006, 860356630, 860553267
+, 860749914, 860946572, 861143242, 861339923
+, 861536615, 861733319, 861930034, 862126760
+, 862323497, 862520245, 862717005, 862913775
+, 863110557, 863307351, 863504155, 863700971
+, 863897798, 864094636, 864291485, 864488346
+, 864685217, 864882100, 865078994, 865275900
+, 865472816, 865669744, 865866683, 866063633
+, 866260595, 866457567, 866654551, 866851546
+, 867048552, 867245569, 867442598, 867639637
+, 867836688, 868033750, 868230823, 868427908
+, 868625004, 868822110, 869019228, 869216357
+, 869413498, 869610649, 869807812, 870004986
+, 870202171, 870399367, 870596574, 870793793
+, 870991023, 871188264, 871385516, 871582779
+, 871780053, 871977339, 872174635, 872371943
+, 872569262, 872766592, 872963934, 873161286
+, 873358650, 873556024, 873753410, 873950807
+, 874148216, 874345635, 874543065, 874740507
+, 874937960, 875135424, 875332899, 875530385
+, 875727882, 875925391, 876122910, 876320441
+, 876517983, 876715536, 876913100, 877110675
+, 877308262, 877505859, 877703468, 877901088
+, 878098719, 878296361, 878494014, 878691678
+, 878889353, 879087040, 879284737, 879482446
+, 879680166, 879877897, 880075639, 880273392
+, 880471156, 880668932, 880866718, 881064516
+, 881262324, 881460144, 881657975, 881855817
+, 882053670, 882251534, 882449409, 882647296
+, 882845193, 883043102, 883241021, 883438952
+, 883636894, 883834847, 884032811, 884230786
+, 884428772, 884626769, 884824777, 885022797
+, 885220827, 885418869, 885616921, 885814985
+, 886013060, 886211145, 886409242, 886607350
+, 886805469, 887003599, 887201741, 887399893
+, 887598056, 887796230, 887994416, 888192612
+, 888390820, 888589038, 888787268, 888985509
+, 889183760, 889382023, 889580297, 889778582
+, 889976878, 890175185, 890373503, 890571832
+, 890770172, 890968523, 891166885, 891365258
+, 891563643, 891762038, 891960444, 892158862
+, 892357290, 892555729, 892754180, 892952641
+, 893151114, 893349597, 893548092, 893746597
+, 893945114, 894143642, 894342180, 894540730
+, 894739291, 894937862, 895136445, 895335039
+, 895533644, 895732259, 895930886, 896129524
+, 896328173, 896526833, 896725503, 896924185
+, 897122878, 897321582, 897520297, 897719022
+, 897917759, 898116507, 898315266, 898514036
+, 898712816, 898911608, 899110411, 899309225
+, 899508050, 899706885, 899905732, 900104590
+, 900303458, 900502338, 900701229, 900900130
+, 901099043, 901297967, 901496901, 901695847
+, 901894803, 902093771, 902292749, 902491739
+, 902690739, 902889750, 903088773, 903287806
+, 903486850, 903685906, 903884972, 904084049
+, 904283137, 904482236, 904681346, 904880467
+, 905079599, 905278742, 905477896, 905677061
+, 905876237, 906075423, 906274621, 906473829
+, 906673049, 906872279, 907071521, 907270773
+, 907470037, 907669311, 907868596, 908067892
+, 908267199, 908466517, 908665846, 908865186
+, 909064537, 909263899, 909463271, 909662655
+, 909862049, 910061455, 910260871, 910460298
+, 910659737, 910859186, 911058646, 911258117
+, 911457599, 911657091, 911856595, 912056110
+, 912255635, 912455172, 912654719, 912854277
+, 913053846, 913253426, 913453017, 913652619
+, 913852232, 914051856, 914251490, 914451136
+, 914650792, 914850459, 915050138, 915249827
+, 915449527, 915649237, 915848959, 916048692
+, 916248435, 916448190, 916647955, 916847731
+, 917047518, 917247316, 917447125, 917646945
+, 917846775, 918046617, 918246469, 918446332
+, 918646206, 918846091, 919045987, 919245894
+, 919445811, 919645740, 919845679, 920045629
+, 920245590, 920445562, 920645545, 920845538
+, 921045543, 921245558, 921445584, 921645621
+, 921845669, 922045728, 922245797, 922445878
+, 922645969, 922846071, 923046184, 923246308
+, 923446443, 923646588, 923846745, 924046912
+, 924247090, 924447279, 924647479, 924847689
+, 925047911, 925248143, 925448386, 925648640
+, 925848904, 926049180, 926249466, 926449764
+, 926650072, 926850391, 927050720, 927251061
+, 927451412, 927651774, 927852147, 928052531
+, 928252926, 928453331, 928653747, 928854174
+, 929054612, 929255061, 929455521, 929655991
+, 929856472, 930056964, 930257467, 930457980
+, 930658504, 930859040, 931059586, 931260142
+, 931460710, 931661288, 931861877, 932062477
+, 932263088, 932463709, 932664342, 932864985
+, 933065639, 933266303, 933466979, 933667665
+, 933868362, 934069070, 934269789, 934470518
+, 934671258, 934872009, 935072771, 935273543
+, 935474326, 935675120, 935875925, 936076741
+, 936277567, 936478404, 936679252, 936880111
+, 937080980, 937281861, 937482751, 937683653
+, 937884566, 938085489, 938286423, 938487368
+, 938688323, 938889289, 939090266, 939291254
+, 939492253, 939693262, 939894282, 940095313
+, 940296354, 940497407, 940698470, 940899543
+, 941100628, 941301723, 941502829, 941703946
+, 941905073, 942106212, 942307361, 942508520
+, 942709691, 942910872, 943112064, 943313266
+, 943514480, 943715704, 943916938, 944118184
+, 944319440, 944520707, 944721985, 944923273
+, 945124572, 945325882, 945527203, 945728534
+, 945929876, 946131229, 946332592, 946533966
+, 946735351, 946936747, 947138153, 947339570
+, 947540998, 947742436, 947943885, 948145345
+, 948346815, 948548297, 948749789, 948951291
+, 949152804, 949354328, 949555863, 949757409
+, 949958965, 950160531, 950362109, 950563697
+, 950765296, 950966905, 951168526, 951370156
+, 951571798, 951773450, 951975113, 952176787
+, 952378471, 952580166, 952781872, 952983588
+, 953185315, 953387053, 953588801, 953790560
+, 953992330, 954194110, 954395901, 954597703
+, 954799515, 955001338, 955203172, 955405016
+, 955606871, 955808737, 956010613, 956212500
+, 956414398, 956616306, 956818225, 957020155
+, 957222095, 957424046, 957626008, 957827980
+, 958029963, 958231956, 958433960, 958635975
+, 958838001, 959040037, 959242083, 959444141
+, 959646209, 959848287, 960050377, 960252477
+, 960454587, 960656708, 960858840, 961060983
+, 961263136, 961465299, 961667474, 961869659
+, 962071854, 962274060, 962476277, 962678505
+, 962880743, 963082991, 963285251, 963487521
+, 963689801, 963892092, 964094394, 964296707
+, 964499030, 964701363, 964903707, 965106062
+, 965308428, 965510804, 965713190, 965915588
+, 966117995, 966320414, 966522843, 966725283
+, 966927733, 967130194, 967332665, 967535147
+, 967737640, 967940143, 968142657, 968345181
+, 968547716, 968750262, 968952818, 969155385
+, 969357962, 969560550, 969763149, 969965758
+, 970168378, 970371008, 970573649, 970776300
+, 970978962, 971181635, 971384318, 971587011
+, 971789716, 971992431, 972195156, 972397892
+, 972600639, 972803396, 973006163, 973208942
+, 973411731, 973614530, 973817340, 974020160
+, 974222991, 974425833, 974628685, 974831548
+, 975034421, 975237305, 975440200, 975643105
+, 975846020, 976048946, 976251883, 976454830
+, 976657788, 976860756, 977063735, 977266724
+, 977469724, 977672734, 977875755, 978078787
+, 978281829, 978484881, 978687944, 978891018
+, 979094102, 979297197, 979500302, 979703418
+, 979906544, 980109681, 980312828, 980515986
+, 980719154, 980922333, 981125523, 981328723
+, 981531933, 981735154, 981938386, 982141628
+, 982344880, 982548143, 982751417, 982954701
+, 983157995, 983361300, 983564616, 983767942
+, 983971279, 984174626, 984377983, 984581352
+, 984784730, 984988119, 985191519, 985394929
+, 985598350, 985801781, 986005222, 986208675
+, 986412137, 986615610, 986819094, 987022588
+, 987226092, 987429608, 987633133, 987836669
+, 988040216, 988243773, 988447340, 988650918
+, 988854506, 989058105, 989261715, 989465335
+, 989668965, 989872606, 990076257, 990279919
+, 990483591, 990687274, 990890967, 991094671
+, 991298385, 991502109, 991705844, 991909590
+, 992113346, 992317112, 992520889, 992724677
+, 992928475, 993132283, 993336102, 993539931
+, 993743770, 993947620, 994151481, 994355352
+, 994559234, 994763125, 994967028, 995170941
+, 995374864, 995578798, 995782742, 995986696
+, 996190661, 996394637, 996598623, 996802619
+, 997006626, 997210643, 997414671, 997618709
+, 997822757, 998026816, 998230886, 998434965
+, 998639056, 998843156, 999047267, 999251389
+, 999455521, 999659663, 999863816, 1000067979
+, 1000272153, 1000476337, 1000680531, 1000884736
+, 1001088952, 1001293177, 1001497413, 1001701660
+, 1001905917, 1002110184, 1002314462, 1002518750
+, 1002723049, 1002927358, 1003131677, 1003336007
+, 1003540347, 1003744698, 1003949059, 1004153430
+, 1004357812, 1004562204, 1004766607, 1004971020
+, 1005175443, 1005379877, 1005584321, 1005788776
+, 1005993241, 1006197716, 1006402202, 1006606698
+, 1006811205, 1007015722, 1007220249, 1007424787
+, 1007629335, 1007833893, 1008038462, 1008243041
+, 1008447631, 1008652231, 1008856841, 1009061462
+, 1009266093, 1009470734, 1009675386, 1009880048
+, 1010084721, 1010289404, 1010494097, 1010698801
+, 1010903515, 1011108239, 1011312974, 1011517719
+, 1011722475, 1011927241, 1012132017, 1012336803
+, 1012541600, 1012746407, 1012951225, 1013156053
+, 1013360891, 1013565740, 1013770599, 1013975469
+, 1014180348, 1014385238, 1014590139, 1014795050
+, 1014999971, 1015204902, 1015409844, 1015614796
+, 1015819759, 1016024732, 1016229715, 1016434708
+, 1016639712, 1016844726, 1017049751, 1017254786
+, 1017459831, 1017664886, 1017869952, 1018075028
+, 1018280115, 1018485212, 1018690319, 1018895436
+, 1019100564, 1019305702, 1019510851, 1019716009
+, 1019921179, 1020126358, 1020331548, 1020536748
+, 1020741958, 1020947179, 1021152410, 1021357651
+, 1021562903, 1021768165, 1021973437, 1022178719
+, 1022384012, 1022589315, 1022794629, 1022999953
+, 1023205287, 1023410631, 1023615986, 1023821351
+, 1024026726, 1024232111, 1024437507, 1024642913
+, 1024848330, 1025053757, 1025259194, 1025464641
+, 1025670099, 1025875566, 1026081045, 1026286533
+, 1026492032, 1026697541, 1026903060, 1027108590
+, 1027314130, 1027519680, 1027725240, 1027930811
+, 1028136392, 1028341984, 1028547585, 1028753197
+, 1028958819, 1029164451, 1029370094, 1029575747
+, 1029781410, 1029987084, 1030192768, 1030398462
+, 1030604166, 1030809880, 1031015605, 1031221340
+, 1031427086, 1031632841, 1031838607, 1032044383
+, 1032250170, 1032455966, 1032661773, 1032867590
+, 1033073418, 1033279255, 1033485103, 1033690961
+, 1033896830, 1034102708, 1034308597, 1034514496
+, 1034720406, 1034926325, 1035132255, 1035338195
+, 1035544146, 1035750106, 1035956077, 1036162058
+, 1036368050, 1036574051, 1036780063, 1036986085
+, 1037192117, 1037398160, 1037604212, 1037810275
+, 1038016348, 1038222432, 1038428526, 1038634629
+, 1038840743, 1039046868, 1039253002, 1039459147
+, 1039665302, 1039871467, 1040077643, 1040283828
+, 1040490024, 1040696230, 1040902446, 1041108673
+, 1041314910, 1041521157, 1041727414, 1041933681
+, 1042139959, 1042346246, 1042552544, 1042758852
+, 1042965171, 1043171499, 1043377838, 1043584187
+, 1043790546, 1043996916, 1044203295, 1044409685
+, 1044616085, 1044822495, 1045028916, 1045235346
+, 1045441787, 1045648238, 1045854699, 1046061170
+, 1046267652, 1046474144, 1046680645, 1046887158
+, 1047093680, 1047300212, 1047506755, 1047713308
+, 1047919871, 1048126444, 1048333027, 1048539621
+, 1048746224, 1048952838, 1049159462, 1049366097
+, 1049572741, 1049779396, 1049986060, 1050192735
+, 1050399420, 1050606116, 1050812821, 1051019537
+, 1051226262, 1051432998, 1051639744, 1051846500
+, 1052053267, 1052260043, 1052466830, 1052673627
+, 1052880434, 1053087251, 1053294079, 1053500916
+, 1053707764, 1053914622, 1054121489, 1054328368
+, 1054535256, 1054742154, 1054949063, 1055155981
+, 1055362910, 1055569849, 1055776798, 1055983758
+, 1056190727, 1056397707, 1056604696, 1056811696
+, 1057018706, 1057225726, 1057432756, 1057639797
+, 1057846847, 1058053908, 1058260979, 1058468059
+, 1058675150, 1058882252, 1059089363, 1059296484
+, 1059503616, 1059710757, 1059917909, 1060125071
+, 1060332243, 1060539425, 1060746617, 1060953820
+, 1061161032, 1061368255, 1061575488, 1061782730
+, 1061989983, 1062197246, 1062404520, 1062611803
+, 1062819096, 1063026400, 1063233713, 1063441037
+, 1063648371, 1063855715, 1064063069, 1064270433
+, 1064477807, 1064685192, 1064892586, 1065099990
+, 1065307405, 1065514830, 1065722265, 1065929709
+, 1066137164, 1066344630, 1066552105, 1066759590
+, 1066967085, 1067174591, 1067382106, 1067589632
+, 1067797168, 1068004714, 1068212269, 1068419835
+, 1068627411, 1068834998, 1069042594, 1069250200
+, 1069457816, 1069665443, 1069873079, 1070080726
+, 1070288383, 1070496049, 1070703726, 1070911413
+, 1071119110, 1071326817, 1071534534, 1071742261
+, 1071949998, 1072157746, 1072365503, 1072573270
+, 1072781048, 1072988835, 1073196633, 1073404441
+, 1073612258, 1073820086, 1074027924, 1074235772
+, 1074443630, 1074651498, 1074859376, 1075067264
+, 1075275162, 1075483070, 1075690988, 1075898917
+, 1076106855, 1076314803, 1076522762, 1076730730
+, 1076938709, 1077146697, 1077354696, 1077562705
+, 1077770723, 1077978752, 1078186791, 1078394839
+, 1078602898, 1078810967, 1079019046, 1079227135
+, 1079435234, 1079643343, 1079851462, 1080059591
+, 1080267730, 1080475879, 1080684038, 1080892207
+, 1081100386, 1081308576, 1081516775, 1081724984
+, 1081933203, 1082141432, 1082349672, 1082557921
+, 1082766180, 1082974450, 1083182729, 1083391018
+, 1083599318, 1083807627, 1084015947, 1084224276
+, 1084432615, 1084640965, 1084849324, 1085057694
+, 1085266073, 1085474462, 1085682862, 1085891271
+, 1086099691, 1086308120, 1086516560, 1086725009
+, 1086933468, 1087141938, 1087350417, 1087558907
+, 1087767406, 1087975915, 1088184435, 1088392964
+, 1088601503, 1088810053, 1089018612, 1089227181
+, 1089435761, 1089644350, 1089852949, 1090061559
+, 1090270178, 1090478807, 1090687446, 1090896095
+, 1091104754, 1091313424, 1091522103, 1091730792
+, 1091939491, 1092148200, 1092356919, 1092565648
+, 1092774387, 1092983136, 1093191894, 1093400663
+, 1093609442, 1093818231, 1094027030, 1094235838
+, 1094444657, 1094653486, 1094862324, 1095071173
+, 1095280031, 1095488900, 1095697778, 1095906666
+, 1096115565, 1096324473, 1096533391, 1096742319
+, 1096951257, 1097160206, 1097369164, 1097578132
+, 1097787109, 1097996097, 1098205095, 1098414103
+, 1098623121, 1098832148, 1099041186, 1099250233
+, 1099459291, 1099668358, 1099877435, 1100086523
+, 1100295620, 1100504727, 1100713844, 1100922971
+, 1101132108, 1101341255, 1101550412, 1101759578
+, 1101968755, 1102177942, 1102387138, 1102596345
+, 1102805561, 1103014787, 1103224023, 1103433270
+, 1103642526, 1103851792, 1104061067, 1104270353
+, 1104479649, 1104688955, 1104898270, 1105107596
+, 1105316931, 1105526276, 1105735631, 1105944997
+, 1106154372, 1106363756, 1106573151, 1106782556
+, 1106991971, 1107201395, 1107410830, 1107620274
+, 1107829728, 1108039192, 1108248667, 1108458150
+, 1108667644, 1108877148, 1109086662, 1109296185
+, 1109505719, 1109715262, 1109924815, 1110134378
+, 1110343951, 1110553534, 1110763127, 1110972730
+, 1111182342, 1111391965, 1111601597, 1111811239
+, 1112020891, 1112230553, 1112440225, 1112649907
+, 1112859598, 1113069300, 1113279011, 1113488733
+, 1113698464, 1113908205, 1114117956, 1114327716
+, 1114537487, 1114747267, 1114957058, 1115166858
+, 1115376668, 1115586488, 1115796318, 1116006157
+, 1116216007, 1116425866, 1116635736, 1116845615
+, 1117055504, 1117265403, 1117475311, 1117685230
+, 1117895158, 1118105097, 1118315045, 1118525003
+, 1118734971, 1118944948, 1119154936, 1119364933
+, 1119574941, 1119784958, 1119994985, 1120205022
+, 1120415068, 1120625125, 1120835191, 1121045267
+, 1121255353, 1121465449, 1121675555, 1121885670
+, 1122095796, 1122305931, 1122516076, 1122726231
+, 1122936396, 1123146570, 1123356755, 1123566949
+, 1123777153, 1123987367, 1124197590, 1124407824
+, 1124618067, 1124828321, 1125038584, 1125248856
+, 1125459139, 1125669432, 1125879734, 1126090046
+, 1126300368, 1126510700, 1126721041, 1126931393
+, 1127141754, 1127352125, 1127562506, 1127772897
+, 1127983297, 1128193707, 1128404127, 1128614557
+, 1128824997, 1129035447, 1129245906, 1129456375
+, 1129666854, 1129877343, 1130087841, 1130298350
+, 1130508868, 1130719396, 1130929934, 1131140481
+, 1131351039, 1131561606, 1131772183, 1131982769
+, 1132193366, 1132403972, 1132614588, 1132825214
+, 1133035850, 1133246496, 1133457151, 1133667816
+, 1133878491, 1134089176, 1134299870, 1134510574
+, 1134721288, 1134932012, 1135142746, 1135353489
+, 1135564242, 1135775005, 1135985778, 1136196560
+, 1136407352, 1136618154, 1136828966, 1137039788
+, 1137250619, 1137461460, 1137672311, 1137883172
+, 1138094042, 1138304922, 1138515812, 1138726712
+, 1138937622, 1139148541, 1139359470, 1139570409
+, 1139781357, 1139992315, 1140203284, 1140414261
+, 1140625249, 1140836246, 1141047253, 1141258270
+, 1141469297, 1141680333, 1141891379, 1142102435
+, 1142313501, 1142524576, 1142735661, 1142946756
+, 1143157861, 1143368975, 1143580099, 1143791233
+, 1144002377, 1144213530, 1144424693, 1144635866
+, 1144847048, 1145058241, 1145269443, 1145480655
+, 1145691876, 1145903107, 1146114348, 1146325599
+, 1146536859, 1146748130, 1146959410, 1147170699
+, 1147381999, 1147593308, 1147804626, 1148015955
+, 1148227293, 1148438641, 1148649999, 1148861367
+, 1149072744, 1149284131, 1149495527, 1149706934
+, 1149918350, 1150129775, 1150341211, 1150552656
+, 1150764111, 1150975576, 1151187050, 1151398534
+, 1151610028, 1151821531, 1152033044, 1152244567
+, 1152456100, 1152667642, 1152879194, 1153090756
+, 1153302327, 1153513909, 1153725499, 1153937100
+, 1154148710, 1154360330, 1154571960, 1154783599
+, 1154995248, 1155206907, 1155418575, 1155630253
+, 1155841941, 1156053639, 1156265346, 1156477063
+, 1156688789, 1156900526, 1157112272, 1157324027
+, 1157535793, 1157747568, 1157959352, 1158171147
+, 1158382951, 1158594765, 1158806588, 1159018421
+, 1159230264, 1159442116, 1159653979, 1159865850
+, 1160077732, 1160289623, 1160501524, 1160713435
+, 1160925355, 1161137285, 1161349224, 1161561173
+, 1161773132, 1161985101, 1162197079, 1162409067
+, 1162621064, 1162833072, 1163045089, 1163257115
+, 1163469151, 1163681197, 1163893253, 1164105318
+, 1164317393, 1164529477, 1164741571, 1164953675
+, 1165165789, 1165377912, 1165590045, 1165802187
+, 1166014339, 1166226501, 1166438672, 1166650853
+, 1166863044, 1167075244, 1167287454, 1167499674
+, 1167711903, 1167924142, 1168136390, 1168348649
+, 1168560916, 1168773194, 1168985481, 1169197778
+, 1169410084, 1169622400, 1169834726, 1170047061
+, 1170259406, 1170471761, 1170684125, 1170896499
+, 1171108882, 1171321275, 1171533678, 1171746090
+, 1171958512, 1172170944, 1172383385, 1172595836
+, 1172808296, 1173020766, 1173233246, 1173445735
+, 1173658234, 1173870743, 1174083261, 1174295789
+, 1174508326, 1174720873, 1174933430, 1175145996
+, 1175358572, 1175571158, 1175783753, 1175996357
+, 1176208972, 1176421596, 1176634229, 1176846872
+, 1177059525, 1177272187, 1177484859, 1177697541
+, 1177910232, 1178122933, 1178335643, 1178548363
+, 1178761093, 1178973832, 1179186581, 1179399339
+, 1179612107, 1179824884, 1180037672, 1180250468
+, 1180463275, 1180676090, 1180888916, 1181101751
+, 1181314596, 1181527450, 1181740314, 1181953187
+, 1182166070, 1182378963, 1182591865, 1182804777
+, 1183017698, 1183230629, 1183443570, 1183656520
+, 1183869480, 1184082449, 1184295428, 1184508416
+, 1184721414, 1184934422, 1185147439, 1185360465
+, 1185573502, 1185786548, 1185999603, 1186212668
+, 1186425743, 1186638827, 1186851920, 1187065024
+, 1187278136, 1187491259, 1187704391, 1187917532
+, 1188130683, 1188343844, 1188557014, 1188770194
+, 1188983383, 1189196582, 1189409790, 1189623008
+, 1189836236, 1190049473, 1190262720, 1190475976
+, 1190689242, 1190902517, 1191115802, 1191329096
+, 1191542400, 1191755713, 1191969036, 1192182369
+, 1192395711, 1192609063, 1192822424, 1193035795
+, 1193249175, 1193462565, 1193675964, 1193889373
+, 1194102791, 1194316219, 1194529657, 1194743104
+, 1194956561, 1195170027, 1195383502, 1195596987
+, 1195810482, 1196023986, 1196237500, 1196451023
+, 1196664556, 1196878099, 1197091650, 1197305212
+, 1197518783, 1197732363, 1197945953, 1198159553
+, 1198373162, 1198586780, 1198800408, 1199014046
+, 1199227693, 1199441349, 1199655015, 1199868691
+, 1200082376, 1200296071, 1200509775, 1200723489
+, 1200937212, 1201150944, 1201364687, 1201578438
+, 1201792200, 1202005970, 1202219750, 1202433540
+, 1202647339, 1202861148, 1203074966, 1203288794
+, 1203502631, 1203716478, 1203930334, 1204144200
+, 1204358075, 1204571960, 1204785854, 1204999758
+, 1205213671, 1205427594, 1205641526, 1205855467
+, 1206069419, 1206283379, 1206497349, 1206711329
+, 1206925318, 1207139317, 1207353325, 1207567342
+, 1207781369, 1207995406, 1208209452, 1208423507
+, 1208637572, 1208851647, 1209065731, 1209279824
+, 1209493927, 1209708039, 1209922161, 1210136293
+, 1210350433, 1210564584, 1210778743, 1210992912
+, 1211207091, 1211421279, 1211635477, 1211849684
+, 1212063900, 1212278126, 1212492362, 1212706607
+, 1212920861, 1213135125, 1213349398, 1213563681
+, 1213777973, 1213992275, 1214206586, 1214420907
+, 1214635237, 1214849576, 1215063925, 1215278284
+, 1215492652, 1215707029, 1215921416, 1216135812
+, 1216350218, 1216564633, 1216779057, 1216993491
+, 1217207935, 1217422388, 1217636850, 1217851322
+, 1218065803, 1218280294, 1218494794, 1218709304
+, 1218923823, 1219138351, 1219352889, 1219567436
+, 1219781993, 1219996559, 1220211135, 1220425720
+, 1220640314, 1220854918, 1221069532, 1221284154
+, 1221498787, 1221713428, 1221928079, 1222142740
+, 1222357410, 1222572089, 1222786778, 1223001476
+, 1223216184, 1223430901, 1223645627, 1223860363
+, 1224075109, 1224289863, 1224504627, 1224719401
+, 1224934184, 1225148976, 1225363778, 1225578589
+, 1225793410, 1226008240, 1226223080, 1226437928
+, 1226652787, 1226867654, 1227082531, 1227297418
+, 1227512314, 1227727219, 1227942134, 1228157058
+, 1228371992, 1228586934, 1228801887, 1229016849
+, 1229231820, 1229446800, 1229661790, 1229876789
+, 1230091798, 1230306816, 1230521844, 1230736881
+, 1230951927, 1231166983, 1231382048, 1231597122
+, 1231812206, 1232027299, 1232242402, 1232457514
+, 1232672636, 1232887766, 1233102907, 1233318056
+, 1233533215, 1233748383, 1233963561, 1234178748
+, 1234393945, 1234609151, 1234824366, 1235039590
+, 1235254824, 1235470068, 1235685321, 1235900583
+, 1236115854, 1236331135, 1236546425, 1236761725
+, 1236977034, 1237192352, 1237407680, 1237623017
+, 1237838364, 1238053719, 1238269085, 1238484459
+, 1238699843, 1238915236, 1239130639, 1239346051
+, 1239561472, 1239776903, 1239992343, 1240207793
+, 1240423251, 1240638720, 1240854197, 1241069684
+, 1241285180, 1241500686, 1241716201, 1241931725
+, 1242147259, 1242362802, 1242578354, 1242793916
+, 1243009487, 1243225067, 1243440657, 1243656256
+, 1243871864, 1244087482, 1244303109, 1244518745
+, 1244734391, 1244950046, 1245165711, 1245381385
+, 1245597068, 1245812760, 1246028462, 1246244173
+, 1246459894, 1246675623, 1246891363, 1247107111
+, 1247322869, 1247538636, 1247754413, 1247970198
+, 1248185993, 1248401798, 1248617612, 1248833435
+, 1249049267, 1249265109, 1249480960, 1249696820
+, 1249912690, 1250128569, 1250344458, 1250560355
+, 1250776262, 1250992179, 1251208104, 1251424039
+, 1251639983, 1251855937, 1252071900, 1252287872
+, 1252503854, 1252719845, 1252935845, 1253151854
+, 1253367873, 1253583901, 1253799938, 1254015985
+, 1254232041, 1254448106, 1254664181, 1254880265
+, 1255096358, 1255312461, 1255528572, 1255744693
+, 1255960824, 1256176964, 1256393113, 1256609271
+, 1256825438, 1257041615, 1257257802, 1257473997
+, 1257690202, 1257906416, 1258122639, 1258338872
+, 1258555114, 1258771365, 1258987626, 1259203895
+, 1259420174, 1259636463, 1259852760, 1260069067
+, 1260285384, 1260501709, 1260718044, 1260934388
+, 1261150741, 1261367104, 1261583476, 1261799857
+, 1262016248, 1262232647, 1262449056, 1262665475
+, 1262881902, 1263098339, 1263314785, 1263531241
+, 1263747705, 1263964179, 1264180662, 1264397155
+, 1264613657, 1264830168, 1265046688, 1265263217
+, 1265479756, 1265696304, 1265912861, 1266129428
+, 1266346004, 1266562589, 1266779183, 1266995787
+, 1267212400, 1267429022, 1267645653, 1267862294
+, 1268078944, 1268295603, 1268512271, 1268728949
+, 1268945636, 1269162332, 1269379038, 1269595752
+, 1269812476, 1270029209, 1270245952, 1270462703
+, 1270679464, 1270896234, 1271113014, 1271329802
+, 1271546600, 1271763407, 1271980224, 1272197049
+, 1272413884, 1272630728, 1272847582, 1273064444
+, 1273281316, 1273498197, 1273715087, 1273931987
+, 1274148895, 1274365813, 1274582740, 1274799677
+, 1275016622, 1275233577, 1275450541, 1275667515
+, 1275884497, 1276101489, 1276318490, 1276535500
+, 1276752520, 1276969548, 1277186586, 1277403633
+, 1277620690, 1277837755, 1278054830, 1278271914
+, 1278489007, 1278706110, 1278923221, 1279140342
+, 1279357472, 1279574611, 1279791760, 1280008918
+, 1280226085, 1280443261, 1280660446, 1280877641
+, 1281094844, 1281312057, 1281529279, 1281746511
+, 1281963751, 1282181001, 1282398260, 1282615528
+, 1282832806, 1283050092, 1283267388, 1283484693
+, 1283702007, 1283919331, 1284136663, 1284354005
+, 1284571356, 1284788716, 1285006085, 1285223464
+, 1285440852, 1285658249, 1285875655, 1286093070
+, 1286310494, 1286527928, 1286745371, 1286962823
+, 1287180284, 1287397755, 1287615234, 1287832723
+, 1288050221, 1288267728, 1288485245, 1288702770
+, 1288920305, 1289137849, 1289355402, 1289572964
+, 1289790535, 1290008116, 1290225706, 1290443305
+, 1290660913, 1290878530, 1291096157, 1291313792
+, 1291531437, 1291749091, 1291966754, 1292184426
+, 1292402108, 1292619799, 1292837498, 1293055207
+, 1293272925, 1293490653, 1293708389, 1293926135
+, 1294143890, 1294361654, 1294579427, 1294797209
+, 1295015000, 1295232801, 1295450611, 1295668430
+, 1295886258, 1296104095, 1296321941, 1296539797
+, 1296757661, 1296975535, 1297193418, 1297411310
+, 1297629211, 1297847122, 1298065041, 1298282970
+, 1298500908, 1298718855, 1298936811, 1299154776
+, 1299372751, 1299590734, 1299808727, 1300026729
+, 1300244740, 1300462760, 1300680789, 1300898828
+, 1301116875, 1301334932, 1301552998, 1301771072
+, 1301989157, 1302207250, 1302425352, 1302643464
+, 1302861584, 1303079714, 1303297853, 1303516001
+, 1303734158, 1303952324, 1304170499, 1304388684
+, 1304606878, 1304825080, 1305043292, 1305261513
+, 1305479743, 1305697982, 1305916231, 1306134488
+, 1306352755, 1306571030, 1306789315, 1307007609
+, 1307225912, 1307444224, 1307662546, 1307880876
+, 1308099216, 1308317564, 1308535922, 1308754289
+, 1308972665, 1309191050, 1309409444, 1309627847
+, 1309846259, 1310064681, 1310283112, 1310501551
+, 1310720000, 1310938458, 1311156925, 1311375401
+, 1311593886, 1311812380, 1312030884, 1312249396
+, 1312467918, 1312686449, 1312904988, 1313123537
+, 1313342095, 1313560662, 1313779238, 1313997824
+, 1314216418, 1314435021, 1314653634, 1314872255
+, 1315090886, 1315309526, 1315528175, 1315746833
+, 1315965500, 1316184176, 1316402861, 1316621555
+, 1316840259, 1317058971, 1317277693, 1317496423
+, 1317715163, 1317933912, 1318152669, 1318371436
+, 1318590212, 1318808997, 1319027792, 1319246595
+, 1319465407, 1319684228, 1319903059, 1320121898
+, 1320340747, 1320559605, 1320778471, 1320997347
+, 1321216232, 1321435126, 1321654029, 1321872941
+, 1322091862, 1322310792, 1322529731, 1322748679
+, 1322967637, 1323186603, 1323405579, 1323624563
+, 1323843557, 1324062559, 1324281571, 1324500592
+, 1324719622, 1324938661, 1325157708, 1325376765
+, 1325595831, 1325814906, 1326033991, 1326253084
+, 1326472186, 1326691297, 1326910418, 1327129547
+, 1327348685, 1327567833, 1327786989, 1328006155
+, 1328225329, 1328444513, 1328663706, 1328882907
+, 1329102118, 1329321338, 1329540567, 1329759804
+, 1329979051, 1330198307, 1330417572, 1330636846
+, 1330856129, 1331075421, 1331294722, 1331514033
+, 1331733352, 1331952680, 1332172017, 1332391363
+, 1332610719, 1332830083, 1333049456, 1333268839
+, 1333488230, 1333707630, 1333927040, 1334146458
+, 1334365886, 1334585322, 1334804768, 1335024222
+, 1335243686, 1335463158, 1335682640, 1335902131
+, 1336121630, 1336341139, 1336560657, 1336780183
+, 1336999719, 1337219264, 1337438817, 1337658380
+, 1337877952, 1338097532, 1338317122, 1338536721
+, 1338756329, 1338975945, 1339195571, 1339415206
+, 1339634850, 1339854503, 1340074164, 1340293835
+, 1340513515, 1340733204, 1340952901, 1341172608
+, 1341392324, 1341612049, 1341831783, 1342051525
+, 1342271277, 1342491038, 1342710808, 1342930586
+, 1343150374, 1343370171, 1343589977, 1343809791
+, 1344029615, 1344249448, 1344469289, 1344689140
+, 1344909000, 1345128868, 1345348746, 1345568633
+, 1345788528, 1346008433, 1346228346, 1346448269
+, 1346668200, 1346888141, 1347108090, 1347328049
+, 1347548016, 1347767993, 1347987978, 1348207972
+, 1348427976, 1348647988, 1348868009, 1349088040
+, 1349308079, 1349528127, 1349748184, 1349968250
+, 1350188326, 1350408410, 1350628503, 1350848605
+, 1351068716, 1351288836, 1351508965, 1351729102
+, 1351949249, 1352169405, 1352389570, 1352609744
+, 1352829926, 1353050118, 1353270318, 1353490528
+, 1353710747, 1353930974, 1354151210, 1354371456
+, 1354591710, 1354811973, 1355032246, 1355252527
+, 1355472817, 1355693116, 1355913424
+};
+static const real aa_ca[8] =
+{
+ -8631806, -7914349, -5257601, -3051997
+, -1586692, -687288, -238212, -62075
+};
+static const real aa_cs[8] =
+{
+ 14386344, 14793176, 15932125, 16497281
+, 16702017, 16763133, 16775525, 16777101
+};
+static const real win[4][36] =
+{
+ {
+ 541609, 1798624, 3379171, 5462936
+ , 8388608, 12881122, 20824265, 39123649
+ , 129925287, -141788570, -50986933, -32687548
+ , -24744405, -20251891, -17326219, -15242454
+ , -13661907, -12404893, -11366990, -10483150
+ , -9710514, -9019459, -8388608, -7801881
+ , -7246655, -6712557, -6190623, -5672661
+ , -5150726, -4616628, -4061402, -3474675
+ , -2843824, -2152769, -1380133, -496293
+ }
+, {
+ 541609, 1798624, 3379171, 5462936
+ , 8388608, 12881122, 20824265, 39123649
+ , 129925287, -141788570, -50986933, -32687548
+ , -24744405, -20251891, -17326219, -15242454
+ , -13661907, -12404893, -11377819, -10573609
+ , -9946281, -9457165, -9079764, -8795700
+ , -8518771, -7816938, -6661470, -5111526
+ , -3237882, -1121518, 0, 0
+ , 0, 0, 0, 0
+ }
+, {
+ 1798624, 8388608, 39123649, -50986933
+ , -20251891, -13661907, -10483150, -8388608
+ , -6712557, -5150726, -3474675, -1380133
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ }
+, {
+ 0, 0, 0, 0
+ , 0, 0, 5058839, 24594154
+ , 117073194, -152572757, -59375541, -38425694
+ , -27896396, -21920489, -18167045, -15612533
+ , -13779795, -12416710, -11366990, -10483150
+ , -9710514, -9019459, -8388608, -7801881
+ , -7246655, -6712557, -6190623, -5672661
+ , -5150726, -4616628, -4061402, -3474675
+ , -2843824, -2152769, -1380133, -496293
+ }
+};
+static const real win1[4][36] =
+{
+ {
+ 541609, -1798624, 3379171, -5462936
+ , 8388608, -12881122, 20824265, -39123649
+ , 129925287, 141788570, -50986933, 32687548
+ , -24744405, 20251891, -17326219, 15242454
+ , -13661907, 12404893, -11366990, 10483150
+ , -9710514, 9019459, -8388608, 7801881
+ , -7246655, 6712557, -6190623, 5672661
+ , -5150726, 4616628, -4061402, 3474675
+ , -2843824, 2152769, -1380133, 496293
+ }
+, {
+ 541609, -1798624, 3379171, -5462936
+ , 8388608, -12881122, 20824265, -39123649
+ , 129925287, 141788570, -50986933, 32687548
+ , -24744405, 20251891, -17326219, 15242454
+ , -13661907, 12404893, -11377819, 10573609
+ , -9946281, 9457165, -9079764, 8795700
+ , -8518771, 7816938, -6661470, 5111526
+ , -3237882, 1121518, 0, 0
+ , 0, 0, 0, 0
+ }
+, {
+ 1798624, -8388608, 39123649, 50986933
+ , -20251891, 13661907, -10483150, 8388608
+ , -6712557, 5150726, -3474675, 1380133
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ , 0, 0, 0, 0
+ }
+, {
+ 0, 0, 0, 0
+ , 0, 0, 5058839, -24594154
+ , 117073194, 152572757, -59375541, 38425694
+ , -27896396, 21920489, -18167045, 15612533
+ , -13779795, 12416710, -11366990, 10483150
+ , -9710514, 9019459, -8388608, 7801881
+ , -7246655, 6712557, -6190623, 5672661
+ , -5150726, 4616628, -4061402, 3474675
+ , -2843824, 2152769, -1380133, 496293
+ }
+};
+const real COS9[9] =
+{
+ 16777216, 16522332, 15765426, 14529495
+, 12852093, 10784187, 8388608, 5738146
+, 2913333
+};
+static const real COS6_1 = 14529495;
+static const real COS6_2 = 8388608;
+const real tfcos36[9] =
+{
+ 8420651, 8684526, 9255805, 10240599
+, 11863283, 14625092, 19849138, 32411092
+, 96248483
+};
+static const real tfcos12[3] =
+{
+ 8684526, 11863283, 32411092
+};
+static const real cos9[3] =
+{
+ 15765426, -2913333, -12852093
+};
+static const real cos18[3] =
+{
+ 16522332, -5738146, -10784187
+};
+static const real tan1_1[16] =
+{
+ 0, 6925, 11994, 16384
+, 20774, 25843, 32768, 44762
+, 77530, -2147483648, -44762, -11994
+, 0, 6925, 11994, 16384
+};
+static const real tan2_1[16] =
+{
+ 32768, 25843, 20774, 16384
+, 11994, 6925, 0, -11994
+, -44762, -2147483648, 77530, 44762
+, 32768, 25843, 20774, 16384
+};
+static const real tan1_2[16] =
+{
+ 0, 9793, 16962, 23170
+, 29379, 36548, 46341, 63303
+, 109644, -2147483648, -63303, -16962
+, 0, 9793, 16962, 23170
+};
+static const real tan2_2[16] =
+{
+ 46341, 36548, 29379, 23170
+, 16962, 9793, 0, -16962
+, -63303, -2147483648, 109644, 63303
+, 46341, 36548, 29379, 23170
+};
+static const real pow1_1[2][32] =
+{
+ {
+ 32768, 27554, 32768, 23170
+ , 32768, 19484, 32768, 16384
+ , 32768, 13777, 32768, 11585
+ , 32768, 9742, 32768, 8192
+ , 32768, 6889, 32768, 5793
+ , 32768, 4871, 32768, 4096
+ , 32768, 3444, 32768, 2896
+ , 32768, 2435, 32768, 2048
+ }
+, {
+ 32768, 23170, 32768, 16384
+ , 32768, 11585, 32768, 8192
+ , 32768, 5793, 32768, 4096
+ , 32768, 2896, 32768, 2048
+ , 32768, 1448, 32768, 1024
+ , 32768, 724, 32768, 512
+ , 32768, 362, 32768, 256
+ , 32768, 181, 32768, 128
+ }
+};
+static const real pow2_1[2][32] =
+{
+ {
+ 32768, 32768, 27554, 32768
+ , 23170, 32768, 19484, 32768
+ , 16384, 32768, 13777, 32768
+ , 11585, 32768, 9742, 32768
+ , 8192, 32768, 6889, 32768
+ , 5793, 32768, 4871, 32768
+ , 4096, 32768, 3444, 32768
+ , 2896, 32768, 2435, 32768
+ }
+, {
+ 32768, 32768, 23170, 32768
+ , 16384, 32768, 11585, 32768
+ , 8192, 32768, 5793, 32768
+ , 4096, 32768, 2896, 32768
+ , 2048, 32768, 1448, 32768
+ , 1024, 32768, 724, 32768
+ , 512, 32768, 362, 32768
+ , 256, 32768, 181, 32768
+ }
+};
+static const real pow1_2[2][32] =
+{
+ {
+ 46341, 38968, 46341, 32768
+ , 46341, 27554, 46341, 23170
+ , 46341, 19484, 46341, 16384
+ , 46341, 13777, 46341, 11585
+ , 46341, 9742, 46341, 8192
+ , 46341, 6889, 46341, 5793
+ , 46341, 4871, 46341, 4096
+ , 46341, 3444, 46341, 2896
+ }
+, {
+ 46341, 32768, 46341, 23170
+ , 46341, 16384, 46341, 11585
+ , 46341, 8192, 46341, 5793
+ , 46341, 4096, 46341, 2896
+ , 46341, 2048, 46341, 1448
+ , 46341, 1024, 46341, 724
+ , 46341, 512, 46341, 362
+ , 46341, 256, 46341, 181
+ }
+};
+static const real pow2_2[2][32] =
+{
+ {
+ 46341, 46341, 38968, 46341
+ , 32768, 46341, 27554, 46341
+ , 23170, 46341, 19484, 46341
+ , 16384, 46341, 13777, 46341
+ , 11585, 46341, 9742, 46341
+ , 8192, 46341, 6889, 46341
+ , 5793, 46341, 4871, 46341
+ , 4096, 46341, 3444, 46341
+ }
+, {
+ 46341, 46341, 32768, 46341
+ , 23170, 46341, 16384, 46341
+ , 11585, 46341, 8192, 46341
+ , 5793, 46341, 4096, 46341
+ , 2896, 46341, 2048, 46341
+ , 1448, 46341, 1024, 46341
+ , 724, 46341, 512, 46341
+ , 362, 46341, 256, 46341
+ }
+};
+static const real gainpow2[378] =
+{
+ 1518500250, 1276901417, 1073741824, 1805811301, 1518500250
+, 1276901417, 1073741824, 1805811301, 1518500250, 1276901417
+, 1073741824, 1805811301, 1518500250, 1276901417, 1073741824
+, 1805811301, 1518500250, 1276901417, 1073741824, 1805811301
+, 1518500250, 1276901417, 1073741824, 1805811301, 1518500250
+, 1276901417, 1073741824, 1805811301, 1518500250, 1276901417
+, 1073741824, 1805811301, 1518500250, 1276901417, 1073741824
+, 1805811301, 1518500250, 1276901417, 1073741824, 1805811301
+, 1518500250, 1276901417, 1073741824, 1805811301, 1518500250
+, 1276901417, 1073741824, 1805811301, 1518500250, 1276901417
+, 1073741824, 1805811301, 1518500250, 1276901417, 1073741824
+, 1805811301, 1518500250, 1276901417, 1073741824, 1805811301
+, 1518500250, 1276901417, 1073741824, 902905651, 759250125
+, 638450708, 536870912, 451452825, 379625062, 319225354
+, 268435456, 225726413, 189812531, 159612677, 134217728
+, 112863206, 94906266, 79806339, 67108864, 56431603
+, 47453133, 39903169, 33554432, 28215802, 23726566
+, 19951585, 16777216, 14107901, 11863283, 9975792
+, 8388608, 7053950, 5931642, 4987896, 4194304
+, 3526975, 2965821, 2493948, 2097152, 1763488
+, 1482910, 1246974, 1048576, 881744, 741455
+, 623487, 524288, 440872, 370728, 311744
+, 262144, 220436, 185364, 155872, 131072
+, 110218, 92682, 77936, 65536, 55109
+, 46341, 38968, 32768, 27554, 23170
+, 19484, 16384, 13777, 11585, 9742
+, 8192, 6889, 5793, 4871, 4096
+, 3444, 2896, 2435, 2048, 1722
+, 1448, 1218, 1024, 861, 724
+, 609, 512, 431, 362, 304
+, 256, 215, 181, 152, 128
+, 108, 91, 76, 64, 54
+, 45, 38, 32, 27, 23
+, 19, 16, 13, 11, 10
+, 8, 7, 6, 5, 4
+, 3, 3, 2, 2, 2
+, 1, 1, 1, 1, 1
+, 1, 1, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0, 0, 0
+, 0, 0, 0
+};
+
+#endif
+
+static const short mapbuf0[9][152] =
+{
+ {
+ 2, 0, 3, 0, 2, 4, 3, 1, 2
+ , 8, 3, 2, 2, 12, 3, 3, 2, 16
+ , 3, 4, 2, 20, 3, 5, 3, 24, 3
+ , 6, 3, 30, 3, 7, 2, 36, 0, 3
+ , 2, 37, 1, 3, 2, 38, 2, 3, 3
+ , 48, 0, 4, 3, 49, 1, 4, 3, 50
+ , 2, 4, 4, 66, 0, 5, 4, 67, 1
+ , 5, 4, 68, 2, 5, 5, 90, 0, 6
+ , 5, 91, 1, 6, 5, 92, 2, 6, 6
+ , 120, 0, 7, 6, 121, 1, 7, 6, 122
+ , 2, 7, 7, 156, 0, 8, 7, 157, 1
+ , 8, 7, 158, 2, 8, 9, 198, 0, 9
+ , 9, 199, 1, 9, 9, 200, 2, 9, 11
+ , 252, 0, 10, 11, 253, 1, 10, 11, 254
+ , 2, 10, 15, 318, 0, 11, 15, 319, 1
+ , 11, 15, 320, 2, 11, 28, 408, 0, 12
+ , 28, 409, 1, 12, 28, 410, 2, 12
+ }
+, {
+ 2, 0, 3, 0, 2, 4, 3, 1, 2
+ , 8, 3, 2, 2, 12, 3, 3, 2, 16
+ , 3, 4, 2, 20, 3, 5, 3, 24, 3
+ , 6, 3, 30, 3, 7, 2, 36, 0, 3
+ , 2, 37, 1, 3, 2, 38, 2, 3, 3
+ , 48, 0, 4, 3, 49, 1, 4, 3, 50
+ , 2, 4, 3, 66, 0, 5, 3, 67, 1
+ , 5, 3, 68, 2, 5, 5, 84, 0, 6
+ , 5, 85, 1, 6, 5, 86, 2, 6, 6
+ , 114, 0, 7, 6, 115, 1, 7, 6, 116
+ , 2, 7, 7, 150, 0, 8, 7, 151, 1
+ , 8, 7, 152, 2, 8, 8, 192, 0, 9
+ , 8, 193, 1, 9, 8, 194, 2, 9, 10
+ , 240, 0, 10, 10, 241, 1, 10, 10, 242
+ , 2, 10, 13, 300, 0, 11, 13, 301, 1
+ , 11, 13, 302, 2, 11, 33, 378, 0, 12
+ , 33, 379, 1, 12, 33, 380, 2, 12
+ }
+, {
+ 2, 0, 3, 0, 2, 4, 3, 1, 2
+ , 8, 3, 2, 2, 12, 3, 3, 2, 16
+ , 3, 4, 2, 20, 3, 5, 3, 24, 3
+ , 6, 3, 30, 3, 7, 2, 36, 0, 3
+ , 2, 37, 1, 3, 2, 38, 2, 3, 3
+ , 48, 0, 4, 3, 49, 1, 4, 3, 50
+ , 2, 4, 4, 66, 0, 5, 4, 67, 1
+ , 5, 4, 68, 2, 5, 6, 90, 0, 6
+ , 6, 91, 1, 6, 6, 92, 2, 6, 8
+ , 126, 0, 7, 8, 127, 1, 7, 8, 128
+ , 2, 7, 10, 174, 0, 8, 10, 175, 1
+ , 8, 10, 176, 2, 8, 13, 234, 0, 9
+ , 13, 235, 1, 9, 13, 236, 2, 9, 17
+ , 312, 0, 10, 17, 313, 1, 10, 17, 314
+ , 2, 10, 21, 414, 0, 11, 21, 415, 1
+ , 11, 21, 416, 2, 11, 6, 540, 0, 12
+ , 6, 541, 1, 12, 6, 542, 2, 12
+ }
+, {
+ 3, 0, 3, 0, 3, 6, 3, 1, 3
+ , 12, 3, 2, 3, 18, 3, 3, 3, 24
+ , 3, 4, 3, 30, 3, 5, 3, 36, 0
+ , 3, 3, 37, 1, 3, 3, 38, 2, 3
+ , 3, 54, 0, 4, 3, 55, 1, 4, 3
+ , 56, 2, 4, 4, 72, 0, 5, 4, 73
+ , 1, 5, 4, 74, 2, 5, 5, 96, 0
+ , 6, 5, 97, 1, 6, 5, 98, 2, 6
+ , 7, 126, 0, 7, 7, 127, 1, 7, 7
+ , 128, 2, 7, 9, 168, 0, 8, 9, 169
+ , 1, 8, 9, 170, 2, 8, 13, 222, 0
+ , 9, 13, 223, 1, 9, 13, 224, 2, 9
+ , 16, 300, 0, 10, 16, 301, 1, 10, 16
+ , 302, 2, 10, 21, 396, 0, 11, 21, 397
+ , 1, 11, 21, 398, 2, 11, 9, 522, 0
+ , 12, 9, 523, 1, 12, 9, 524, 2, 12
+ , 0, 0, 0, 0, 0, 0, 0, 0
+ }
+, {
+ 3, 0, 3, 0, 3, 6, 3, 1, 3
+ , 12, 3, 2, 3, 18, 3, 3, 3, 24
+ , 3, 4, 3, 30, 3, 5, 3, 36, 0
+ , 3, 3, 37, 1, 3, 3, 38, 2, 3
+ , 4, 54, 0, 4, 4, 55, 1, 4, 4
+ , 56, 2, 4, 5, 78, 0, 5, 5, 79
+ , 1, 5, 5, 80, 2, 5, 6, 108, 0
+ , 6, 6, 109, 1, 6, 6, 110, 2, 6
+ , 7, 144, 0, 7, 7, 145, 1, 7, 7
+ , 146, 2, 7, 9, 186, 0, 8, 9, 187
+ , 1, 8, 9, 188, 2, 8, 12, 240, 0
+ , 9, 12, 241, 1, 9, 12, 242, 2, 9
+ , 16, 312, 0, 10, 16, 313, 1, 10, 16
+ , 314, 2, 10, 22, 408, 0, 11, 22, 409
+ , 1, 11, 22, 410, 2, 11, 6, 540, 0
+ , 12, 6, 541, 1, 12, 6, 542, 2, 12
+ , 0, 0, 0, 0, 0, 0, 0, 0
+ }
+, {
+ 3, 0, 3, 0, 3, 6, 3, 1, 3
+ , 12, 3, 2, 3, 18, 3, 3, 3, 24
+ , 3, 4, 3, 30, 3, 5, 3, 36, 0
+ , 3, 3, 37, 1, 3, 3, 38, 2, 3
+ , 4, 54, 0, 4, 4, 55, 1, 4, 4
+ , 56, 2, 4, 5, 78, 0, 5, 5, 79
+ , 1, 5, 5, 80, 2, 5, 6, 108, 0
+ , 6, 6, 109, 1, 6, 6, 110, 2, 6
+ , 7, 144, 0, 7, 7, 145, 1, 7, 7
+ , 146, 2, 7, 9, 186, 0, 8, 9, 187
+ , 1, 8, 9, 188, 2, 8, 12, 240, 0
+ , 9, 12, 241, 1, 9, 12, 242, 2, 9
+ , 15, 312, 0, 10, 15, 313, 1, 10, 15
+ , 314, 2, 10, 20, 402, 0, 11, 20, 403
+ , 1, 11, 20, 404, 2, 11, 9, 522, 0
+ , 12, 9, 523, 1, 12, 9, 524, 2, 12
+ , 0, 0, 0, 0, 0, 0, 0, 0
+ }
+, {
+ 3, 0, 3, 0, 3, 6, 3, 1, 3
+ , 12, 3, 2, 3, 18, 3, 3, 3, 24
+ , 3, 4, 3, 30, 3, 5, 3, 36, 0
+ , 3, 3, 37, 1, 3, 3, 38, 2, 3
+ , 4, 54, 0, 4, 4, 55, 1, 4, 4
+ , 56, 2, 4, 5, 78, 0, 5, 5, 79
+ , 1, 5, 5, 80, 2, 5, 6, 108, 0
+ , 6, 6, 109, 1, 6, 6, 110, 2, 6
+ , 7, 144, 0, 7, 7, 145, 1, 7, 7
+ , 146, 2, 7, 9, 186, 0, 8, 9, 187
+ , 1, 8, 9, 188, 2, 8, 12, 240, 0
+ , 9, 12, 241, 1, 9, 12, 242, 2, 9
+ , 15, 312, 0, 10, 15, 313, 1, 10, 15
+ , 314, 2, 10, 20, 402, 0, 11, 20, 403
+ , 1, 11, 20, 404, 2, 11, 9, 522, 0
+ , 12, 9, 523, 1, 12, 9, 524, 2, 12
+ , 0, 0, 0, 0, 0, 0, 0, 0
+ }
+, {
+ 3, 0, 3, 0, 3, 6, 3, 1, 3
+ , 12, 3, 2, 3, 18, 3, 3, 3, 24
+ , 3, 4, 3, 30, 3, 5, 3, 36, 0
+ , 3, 3, 37, 1, 3, 3, 38, 2, 3
+ , 4, 54, 0, 4, 4, 55, 1, 4, 4
+ , 56, 2, 4, 5, 78, 0, 5, 5, 79
+ , 1, 5, 5, 80, 2, 5, 6, 108, 0
+ , 6, 6, 109, 1, 6, 6, 110, 2, 6
+ , 7, 144, 0, 7, 7, 145, 1, 7, 7
+ , 146, 2, 7, 9, 186, 0, 8, 9, 187
+ , 1, 8, 9, 188, 2, 8, 12, 240, 0
+ , 9, 12, 241, 1, 9, 12, 242, 2, 9
+ , 15, 312, 0, 10, 15, 313, 1, 10, 15
+ , 314, 2, 10, 20, 402, 0, 11, 20, 403
+ , 1, 11, 20, 404, 2, 11, 9, 522, 0
+ , 12, 9, 523, 1, 12, 9, 524, 2, 12
+ , 0, 0, 0, 0, 0, 0, 0, 0
+ }
+, {
+ 6, 0, 3, 0, 6, 12, 3, 1, 6
+ , 24, 3, 2, 6, 36, 3, 3, 6, 48
+ , 3, 4, 6, 60, 3, 5, 6, 72, 0
+ , 3, 6, 73, 1, 3, 6, 74, 2, 3
+ , 8, 108, 0, 4, 8, 109, 1, 4, 8
+ , 110, 2, 4, 10, 156, 0, 5, 10, 157
+ , 1, 5, 10, 158, 2, 5, 12, 216, 0
+ , 6, 12, 217, 1, 6, 12, 218, 2, 6
+ , 14, 288, 0, 7, 14, 289, 1, 7, 14
+ , 290, 2, 7, 18, 372, 0, 8, 18, 373
+ , 1, 8, 18, 374, 2, 8, 1, 480, 0
+ , 9, 1, 481, 1, 9, 1, 482, 2, 9
+ , 1, 486, 0, 10, 1, 487, 1, 10, 1
+ , 488, 2, 10, 1, 492, 0, 11, 1, 493
+ , 1, 11, 1, 494, 2, 11, 13, 498, 0
+ , 12, 13, 499, 1, 12, 13, 500, 2, 12
+ , 0, 0, 0, 0, 0, 0, 0, 0
+ }
+};
+static const short mapbuf1[9][156] =
+{
+ {
+ 2, 0, 0, 0, 2, 1, 1, 0, 2
+ , 2, 2, 0, 2, 12, 0, 1, 2, 13
+ , 1, 1, 2, 14, 2, 1, 2, 24, 0
+ , 2, 2, 25, 1, 2, 2, 26, 2, 2
+ , 2, 36, 0, 3, 2, 37, 1, 3, 2
+ , 38, 2, 3, 3, 48, 0, 4, 3, 49
+ , 1, 4, 3, 50, 2, 4, 4, 66, 0
+ , 5, 4, 67, 1, 5, 4, 68, 2, 5
+ , 5, 90, 0, 6, 5, 91, 1, 6, 5
+ , 92, 2, 6, 6, 120, 0, 7, 6, 121
+ , 1, 7, 6, 122, 2, 7, 7, 156, 0
+ , 8, 7, 157, 1, 8, 7, 158, 2, 8
+ , 9, 198, 0, 9, 9, 199, 1, 9, 9
+ , 200, 2, 9, 11, 252, 0, 10, 11, 253
+ , 1, 10, 11, 254, 2, 10, 15, 318, 0
+ , 11, 15, 319, 1, 11, 15, 320, 2, 11
+ , 28, 408, 0, 12, 28, 409, 1, 12, 28
+ , 410, 2, 12
+ }
+, {
+ 2, 0, 0, 0, 2, 1, 1, 0, 2
+ , 2, 2, 0, 2, 12, 0, 1, 2, 13
+ , 1, 1, 2, 14, 2, 1, 2, 24, 0
+ , 2, 2, 25, 1, 2, 2, 26, 2, 2
+ , 2, 36, 0, 3, 2, 37, 1, 3, 2
+ , 38, 2, 3, 3, 48, 0, 4, 3, 49
+ , 1, 4, 3, 50, 2, 4, 3, 66, 0
+ , 5, 3, 67, 1, 5, 3, 68, 2, 5
+ , 5, 84, 0, 6, 5, 85, 1, 6, 5
+ , 86, 2, 6, 6, 114, 0, 7, 6, 115
+ , 1, 7, 6, 116, 2, 7, 7, 150, 0
+ , 8, 7, 151, 1, 8, 7, 152, 2, 8
+ , 8, 192, 0, 9, 8, 193, 1, 9, 8
+ , 194, 2, 9, 10, 240, 0, 10, 10, 241
+ , 1, 10, 10, 242, 2, 10, 13, 300, 0
+ , 11, 13, 301, 1, 11, 13, 302, 2, 11
+ , 33, 378, 0, 12, 33, 379, 1, 12, 33
+ , 380, 2, 12
+ }
+, {
+ 2, 0, 0, 0, 2, 1, 1, 0, 2
+ , 2, 2, 0, 2, 12, 0, 1, 2, 13
+ , 1, 1, 2, 14, 2, 1, 2, 24, 0
+ , 2, 2, 25, 1, 2, 2, 26, 2, 2
+ , 2, 36, 0, 3, 2, 37, 1, 3, 2
+ , 38, 2, 3, 3, 48, 0, 4, 3, 49
+ , 1, 4, 3, 50, 2, 4, 4, 66, 0
+ , 5, 4, 67, 1, 5, 4, 68, 2, 5
+ , 6, 90, 0, 6, 6, 91, 1, 6, 6
+ , 92, 2, 6, 8, 126, 0, 7, 8, 127
+ , 1, 7, 8, 128, 2, 7, 10, 174, 0
+ , 8, 10, 175, 1, 8, 10, 176, 2, 8
+ , 13, 234, 0, 9, 13, 235, 1, 9, 13
+ , 236, 2, 9, 17, 312, 0, 10, 17, 313
+ , 1, 10, 17, 314, 2, 10, 21, 414, 0
+ , 11, 21, 415, 1, 11, 21, 416, 2, 11
+ , 6, 540, 0, 12, 6, 541, 1, 12, 6
+ , 542, 2, 12
+ }
+, {
+ 2, 0, 0, 0, 2, 1, 1, 0, 2
+ , 2, 2, 0, 2, 12, 0, 1, 2, 13
+ , 1, 1, 2, 14, 2, 1, 2, 24, 0
+ , 2, 2, 25, 1, 2, 2, 26, 2, 2
+ , 3, 36, 0, 3, 3, 37, 1, 3, 3
+ , 38, 2, 3, 3, 54, 0, 4, 3, 55
+ , 1, 4, 3, 56, 2, 4, 4, 72, 0
+ , 5, 4, 73, 1, 5, 4, 74, 2, 5
+ , 5, 96, 0, 6, 5, 97, 1, 6, 5
+ , 98, 2, 6, 7, 126, 0, 7, 7, 127
+ , 1, 7, 7, 128, 2, 7, 9, 168, 0
+ , 8, 9, 169, 1, 8, 9, 170, 2, 8
+ , 13, 222, 0, 9, 13, 223, 1, 9, 13
+ , 224, 2, 9, 16, 300, 0, 10, 16, 301
+ , 1, 10, 16, 302, 2, 10, 21, 396, 0
+ , 11, 21, 397, 1, 11, 21, 398, 2, 11
+ , 9, 522, 0, 12, 9, 523, 1, 12, 9
+ , 524, 2, 12
+ }
+, {
+ 2, 0, 0, 0, 2, 1, 1, 0, 2
+ , 2, 2, 0, 2, 12, 0, 1, 2, 13
+ , 1, 1, 2, 14, 2, 1, 2, 24, 0
+ , 2, 2, 25, 1, 2, 2, 26, 2, 2
+ , 3, 36, 0, 3, 3, 37, 1, 3, 3
+ , 38, 2, 3, 4, 54, 0, 4, 4, 55
+ , 1, 4, 4, 56, 2, 4, 5, 78, 0
+ , 5, 5, 79, 1, 5, 5, 80, 2, 5
+ , 6, 108, 0, 6, 6, 109, 1, 6, 6
+ , 110, 2, 6, 7, 144, 0, 7, 7, 145
+ , 1, 7, 7, 146, 2, 7, 9, 186, 0
+ , 8, 9, 187, 1, 8, 9, 188, 2, 8
+ , 12, 240, 0, 9, 12, 241, 1, 9, 12
+ , 242, 2, 9, 16, 312, 0, 10, 16, 313
+ , 1, 10, 16, 314, 2, 10, 22, 408, 0
+ , 11, 22, 409, 1, 11, 22, 410, 2, 11
+ , 6, 540, 0, 12, 6, 541, 1, 12, 6
+ , 542, 2, 12
+ }
+, {
+ 2, 0, 0, 0, 2, 1, 1, 0, 2
+ , 2, 2, 0, 2, 12, 0, 1, 2, 13
+ , 1, 1, 2, 14, 2, 1, 2, 24, 0
+ , 2, 2, 25, 1, 2, 2, 26, 2, 2
+ , 3, 36, 0, 3, 3, 37, 1, 3, 3
+ , 38, 2, 3, 4, 54, 0, 4, 4, 55
+ , 1, 4, 4, 56, 2, 4, 5, 78, 0
+ , 5, 5, 79, 1, 5, 5, 80, 2, 5
+ , 6, 108, 0, 6, 6, 109, 1, 6, 6
+ , 110, 2, 6, 7, 144, 0, 7, 7, 145
+ , 1, 7, 7, 146, 2, 7, 9, 186, 0
+ , 8, 9, 187, 1, 8, 9, 188, 2, 8
+ , 12, 240, 0, 9, 12, 241, 1, 9, 12
+ , 242, 2, 9, 15, 312, 0, 10, 15, 313
+ , 1, 10, 15, 314, 2, 10, 20, 402, 0
+ , 11, 20, 403, 1, 11, 20, 404, 2, 11
+ , 9, 522, 0, 12, 9, 523, 1, 12, 9
+ , 524, 2, 12
+ }
+, {
+ 2, 0, 0, 0, 2, 1, 1, 0, 2
+ , 2, 2, 0, 2, 12, 0, 1, 2, 13
+ , 1, 1, 2, 14, 2, 1, 2, 24, 0
+ , 2, 2, 25, 1, 2, 2, 26, 2, 2
+ , 3, 36, 0, 3, 3, 37, 1, 3, 3
+ , 38, 2, 3, 4, 54, 0, 4, 4, 55
+ , 1, 4, 4, 56, 2, 4, 5, 78, 0
+ , 5, 5, 79, 1, 5, 5, 80, 2, 5
+ , 6, 108, 0, 6, 6, 109, 1, 6, 6
+ , 110, 2, 6, 7, 144, 0, 7, 7, 145
+ , 1, 7, 7, 146, 2, 7, 9, 186, 0
+ , 8, 9, 187, 1, 8, 9, 188, 2, 8
+ , 12, 240, 0, 9, 12, 241, 1, 9, 12
+ , 242, 2, 9, 15, 312, 0, 10, 15, 313
+ , 1, 10, 15, 314, 2, 10, 20, 402, 0
+ , 11, 20, 403, 1, 11, 20, 404, 2, 11
+ , 9, 522, 0, 12, 9, 523, 1, 12, 9
+ , 524, 2, 12
+ }
+, {
+ 2, 0, 0, 0, 2, 1, 1, 0, 2
+ , 2, 2, 0, 2, 12, 0, 1, 2, 13
+ , 1, 1, 2, 14, 2, 1, 2, 24, 0
+ , 2, 2, 25, 1, 2, 2, 26, 2, 2
+ , 3, 36, 0, 3, 3, 37, 1, 3, 3
+ , 38, 2, 3, 4, 54, 0, 4, 4, 55
+ , 1, 4, 4, 56, 2, 4, 5, 78, 0
+ , 5, 5, 79, 1, 5, 5, 80, 2, 5
+ , 6, 108, 0, 6, 6, 109, 1, 6, 6
+ , 110, 2, 6, 7, 144, 0, 7, 7, 145
+ , 1, 7, 7, 146, 2, 7, 9, 186, 0
+ , 8, 9, 187, 1, 8, 9, 188, 2, 8
+ , 12, 240, 0, 9, 12, 241, 1, 9, 12
+ , 242, 2, 9, 15, 312, 0, 10, 15, 313
+ , 1, 10, 15, 314, 2, 10, 20, 402, 0
+ , 11, 20, 403, 1, 11, 20, 404, 2, 11
+ , 9, 522, 0, 12, 9, 523, 1, 12, 9
+ , 524, 2, 12
+ }
+, {
+ 4, 0, 0, 0, 4, 1, 1, 0, 4
+ , 2, 2, 0, 4, 24, 0, 1, 4, 25
+ , 1, 1, 4, 26, 2, 1, 4, 48, 0
+ , 2, 4, 49, 1, 2, 4, 50, 2, 2
+ , 6, 72, 0, 3, 6, 73, 1, 3, 6
+ , 74, 2, 3, 8, 108, 0, 4, 8, 109
+ , 1, 4, 8, 110, 2, 4, 10, 156, 0
+ , 5, 10, 157, 1, 5, 10, 158, 2, 5
+ , 12, 216, 0, 6, 12, 217, 1, 6, 12
+ , 218, 2, 6, 14, 288, 0, 7, 14, 289
+ , 1, 7, 14, 290, 2, 7, 18, 372, 0
+ , 8, 18, 373, 1, 8, 18, 374, 2, 8
+ , 1, 480, 0, 9, 1, 481, 1, 9, 1
+ , 482, 2, 9, 1, 486, 0, 10, 1, 487
+ , 1, 10, 1, 488, 2, 10, 1, 492, 0
+ , 11, 1, 493, 1, 11, 1, 494, 2, 11
+ , 13, 498, 0, 12, 13, 499, 1, 12, 13
+ , 500, 2, 12
+ }
+};
+static const short mapbuf2[9][44] =
+{
+ {
+ 2, 0, 2, 1, 2, 2, 2, 3, 2
+ , 4, 2, 5, 3, 6, 3, 7, 4, 8
+ , 4, 9, 5, 10, 6, 11, 8, 12, 10
+ , 13, 12, 14, 14, 15, 17, 16, 21, 17
+ , 25, 18, 27, 19, 38, 20, 79, 21
+ }
+, {
+ 2, 0, 2, 1, 2, 2, 2, 3, 2
+ , 4, 2, 5, 3, 6, 3, 7, 3, 8
+ , 4, 9, 5, 10, 6, 11, 8, 12, 9
+ , 13, 11, 14, 14, 15, 17, 16, 20, 17
+ , 23, 18, 27, 19, 27, 20, 96, 21
+ }
+, {
+ 2, 0, 2, 1, 2, 2, 2, 3, 2
+ , 4, 2, 5, 3, 6, 3, 7, 4, 8
+ , 5, 9, 6, 10, 8, 11, 10, 12, 12
+ , 13, 15, 14, 19, 15, 23, 16, 28, 17
+ , 34, 18, 42, 19, 51, 20, 13, 21
+ }
+, {
+ 3, 0, 3, 1, 3, 2, 3, 3, 3
+ , 4, 3, 5, 4, 6, 5, 7, 6, 8
+ , 7, 9, 8, 10, 10, 11, 12, 12, 14
+ , 13, 16, 14, 19, 15, 23, 16, 26, 17
+ , 30, 18, 34, 19, 29, 20, 27, 21
+ }
+, {
+ 3, 0, 3, 1, 3, 2, 3, 3, 3
+ , 4, 3, 5, 4, 6, 5, 7, 6, 8
+ , 7, 9, 8, 10, 9, 11, 11, 12, 13
+ , 13, 16, 14, 19, 15, 23, 16, 27, 17
+ , 31, 18, 35, 19, 38, 20, 18, 21
+ }
+, {
+ 3, 0, 3, 1, 3, 2, 3, 3, 3
+ , 4, 3, 5, 4, 6, 5, 7, 6, 8
+ , 7, 9, 8, 10, 10, 11, 12, 12, 14
+ , 13, 16, 14, 19, 15, 23, 16, 26, 17
+ , 30, 18, 34, 19, 29, 20, 27, 21
+ }
+, {
+ 3, 0, 3, 1, 3, 2, 3, 3, 3
+ , 4, 3, 5, 4, 6, 5, 7, 6, 8
+ , 7, 9, 8, 10, 10, 11, 12, 12, 14
+ , 13, 16, 14, 19, 15, 23, 16, 26, 17
+ , 30, 18, 34, 19, 29, 20, 27, 21
+ }
+, {
+ 3, 0, 3, 1, 3, 2, 3, 3, 3
+ , 4, 3, 5, 4, 6, 5, 7, 6, 8
+ , 7, 9, 8, 10, 10, 11, 12, 12, 14
+ , 13, 16, 14, 19, 15, 23, 16, 26, 17
+ , 30, 18, 34, 19, 29, 20, 27, 21
+ }
+, {
+ 6, 0, 6, 1, 6, 2, 6, 3, 6
+ , 4, 6, 5, 8, 6, 10, 7, 12, 8
+ , 14, 9, 16, 10, 20, 11, 24, 12, 28
+ , 13, 32, 14, 38, 15, 45, 16, 1, 17
+ , 1, 18, 1, 19, 1, 20, 1, 21
+ }
+};
+static const short *map[9][3] =
+{
+ { mapbuf0[0], mapbuf1[0], mapbuf2[0] }
+, { mapbuf0[1], mapbuf1[1], mapbuf2[1] }
+, { mapbuf0[2], mapbuf1[2], mapbuf2[2] }
+, { mapbuf0[3], mapbuf1[3], mapbuf2[3] }
+, { mapbuf0[4], mapbuf1[4], mapbuf2[4] }
+, { mapbuf0[5], mapbuf1[5], mapbuf2[5] }
+, { mapbuf0[6], mapbuf1[6], mapbuf2[6] }
+, { mapbuf0[7], mapbuf1[7], mapbuf2[7] }
+, { mapbuf0[8], mapbuf1[8], mapbuf2[8] }
+};
+static const short *mapend[9][3] =
+{
+ { mapbuf0[0]+152, mapbuf1[0]+156, mapbuf2[0]+44 }
+, { mapbuf0[1]+152, mapbuf1[1]+156, mapbuf2[1]+44 }
+, { mapbuf0[2]+152, mapbuf1[2]+156, mapbuf2[2]+44 }
+, { mapbuf0[3]+144, mapbuf1[3]+156, mapbuf2[3]+44 }
+, { mapbuf0[4]+144, mapbuf1[4]+156, mapbuf2[4]+44 }
+, { mapbuf0[5]+144, mapbuf1[5]+156, mapbuf2[5]+44 }
+, { mapbuf0[6]+144, mapbuf1[6]+156, mapbuf2[6]+44 }
+, { mapbuf0[7]+144, mapbuf1[7]+156, mapbuf2[7]+44 }
+, { mapbuf0[8]+144, mapbuf1[8]+156, mapbuf2[8]+44 }
+};
+static const unsigned short n_slen2[512] =
+{
+ 0, 512, 1024, 1536, 64, 576, 1088, 1600, 128
+, 640, 1152, 1664, 192, 704, 1216, 1728, 8, 520
+, 1032, 1544, 72, 584, 1096, 1608, 136, 648, 1160
+, 1672, 200, 712, 1224, 1736, 16, 528, 1040, 1552
+, 80, 592, 1104, 1616, 144, 656, 1168, 1680, 208
+, 720, 1232, 1744, 24, 536, 1048, 1560, 88, 600
+, 1112, 1624, 152, 664, 1176, 1688, 216, 728, 1240
+, 1752, 32, 544, 1056, 1568, 96, 608, 1120, 1632
+, 160, 672, 1184, 1696, 224, 736, 1248, 1760, 1
+, 513, 1025, 1537, 65, 577, 1089, 1601, 129, 641
+, 1153, 1665, 193, 705, 1217, 1729, 9, 521, 1033
+, 1545, 73, 585, 1097, 1609, 137, 649, 1161, 1673
+, 201, 713, 1225, 1737, 17, 529, 1041, 1553, 81
+, 593, 1105, 1617, 145, 657, 1169, 1681, 209, 721
+, 1233, 1745, 25, 537, 1049, 1561, 89, 601, 1113
+, 1625, 153, 665, 1177, 1689, 217, 729, 1241, 1753
+, 33, 545, 1057, 1569, 97, 609, 1121, 1633, 161
+, 673, 1185, 1697, 225, 737, 1249, 1761, 2, 514
+, 1026, 1538, 66, 578, 1090, 1602, 130, 642, 1154
+, 1666, 194, 706, 1218, 1730, 10, 522, 1034, 1546
+, 74, 586, 1098, 1610, 138, 650, 1162, 1674, 202
+, 714, 1226, 1738, 18, 530, 1042, 1554, 82, 594
+, 1106, 1618, 146, 658, 1170, 1682, 210, 722, 1234
+, 1746, 26, 538, 1050, 1562, 90, 602, 1114, 1626
+, 154, 666, 1178, 1690, 218, 730, 1242, 1754, 34
+, 546, 1058, 1570, 98, 610, 1122, 1634, 162, 674
+, 1186, 1698, 226, 738, 1250, 1762, 3, 515, 1027
+, 1539, 67, 579, 1091, 1603, 131, 643, 1155, 1667
+, 195, 707, 1219, 1731, 11, 523, 1035, 1547, 75
+, 587, 1099, 1611, 139, 651, 1163, 1675, 203, 715
+, 1227, 1739, 19, 531, 1043, 1555, 83, 595, 1107
+, 1619, 147, 659, 1171, 1683, 211, 723, 1235, 1747
+, 27, 539, 1051, 1563, 91, 603, 1115, 1627, 155
+, 667, 1179, 1691, 219, 731, 1243, 1755, 35, 547
+, 1059, 1571, 99, 611, 1123, 1635, 163, 675, 1187
+, 1699, 227, 739, 1251, 1763, 4, 516, 1028, 1540
+, 68, 580, 1092, 1604, 132, 644, 1156, 1668, 196
+, 708, 1220, 1732, 12, 524, 1036, 1548, 76, 588
+, 1100, 1612, 140, 652, 1164, 1676, 204, 716, 1228
+, 1740, 20, 532, 1044, 1556, 84, 596, 1108, 1620
+, 148, 660, 1172, 1684, 212, 724, 1236, 1748, 28
+, 540, 1052, 1564, 92, 604, 1116, 1628, 156, 668
+, 1180, 1692, 220, 732, 1244, 1756, 36, 548, 1060
+, 1572, 100, 612, 1124, 1636, 164, 676, 1188, 1700
+, 228, 740, 1252, 1764, 4096, 4160, 4224, 4288, 4104
+, 4168, 4232, 4296, 4112, 4176, 4240, 4304, 4120, 4184
+, 4248, 4312, 4128, 4192, 4256, 4320, 4097, 4161, 4225
+, 4289, 4105, 4169, 4233, 4297, 4113, 4177, 4241, 4305
+, 4121, 4185, 4249, 4313, 4129, 4193, 4257, 4321, 4098
+, 4162, 4226, 4290, 4106, 4170, 4234, 4298, 4114, 4178
+, 4242, 4306, 4122, 4186, 4250, 4314, 4130, 4194, 4258
+, 4322, 4099, 4163, 4227, 4291, 4107, 4171, 4235, 4299
+, 4115, 4179, 4243, 4307, 4123, 4187, 4251, 4315, 4131
+, 4195, 4259, 4323, 4100, 4164, 4228, 4292, 4108, 4172
+, 4236, 4300, 4116, 4180, 4244, 4308, 4124, 4188, 4252
+, 4316, 4132, 4196, 4260, 4324, 40960, 40968, 40976, 40961
+, 40969, 40977, 40962, 40970, 40978, 40963, 40971, 40979
+};
+static const unsigned short i_slen2[256] =
+{
+ 12288, 12352, 12416, 12480, 12544, 12608, 12296, 12360, 12424
+, 12488, 12552, 12616, 12304, 12368, 12432, 12496, 12560, 12624
+, 12312, 12376, 12440, 12504, 12568, 12632, 12320, 12384, 12448
+, 12512, 12576, 12640, 12328, 12392, 12456, 12520, 12584, 12648
+, 12289, 12353, 12417, 12481, 12545, 12609, 12297, 12361, 12425
+, 12489, 12553, 12617, 12305, 12369, 12433, 12497, 12561, 12625
+, 12313, 12377, 12441, 12505, 12569, 12633, 12321, 12385, 12449
+, 12513, 12577, 12641, 12329, 12393, 12457, 12521, 12585, 12649
+, 12290, 12354, 12418, 12482, 12546, 12610, 12298, 12362, 12426
+, 12490, 12554, 12618, 12306, 12370, 12434, 12498, 12562, 12626
+, 12314, 12378, 12442, 12506, 12570, 12634, 12322, 12386, 12450
+, 12514, 12578, 12642, 12330, 12394, 12458, 12522, 12586, 12650
+, 12291, 12355, 12419, 12483, 12547, 12611, 12299, 12363, 12427
+, 12491, 12555, 12619, 12307, 12371, 12435, 12499, 12563, 12627
+, 12315, 12379, 12443, 12507, 12571, 12635, 12323, 12387, 12451
+, 12515, 12579, 12643, 12331, 12395, 12459, 12523, 12587, 12651
+, 12292, 12356, 12420, 12484, 12548, 12612, 12300, 12364, 12428
+, 12492, 12556, 12620, 12308, 12372, 12436, 12500, 12564, 12628
+, 12316, 12380, 12444, 12508, 12572, 12636, 12324, 12388, 12452
+, 12516, 12580, 12644, 12332, 12396, 12460, 12524, 12588, 12652
+, 16384, 16448, 16512, 16576, 16392, 16456, 16520, 16584, 16400
+, 16464, 16528, 16592, 16408, 16472, 16536, 16600, 16385, 16449
+, 16513, 16577, 16393, 16457, 16521, 16585, 16401, 16465, 16529
+, 16593, 16409, 16473, 16537, 16601, 16386, 16450, 16514, 16578
+, 16394, 16458, 16522, 16586, 16402, 16466, 16530, 16594, 16410
+, 16474, 16538, 16602, 16387, 16451, 16515, 16579, 16395, 16459
+, 16523, 16587, 16403, 16467, 16531, 16595, 16411, 16475, 16539
+, 16603, 20480, 20488, 20496, 20481, 20489, 20497, 20482, 20490
+, 20498, 20483, 20491, 20499
+};
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/layer1.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/layer1.c
new file mode 100644
index 00000000..c5bfc75d
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/layer1.c
@@ -0,0 +1,250 @@
+/*
+ layer1.c: the layer 1 decoder
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp
+
+ may have a few bugs after last optimization ...
+*/
+
+#include "mpg123lib_intern.h"
+#include "getbits.h"
+#include "debug.h"
+
+/*
+ Allocation value is not allowed to be 15. Initially, libmad showed me the
+ error that mpg123 used to ignore. Then, I found a quote on that in
+ Shlien, S. (1994): Guide to MPEG-1 Audio Standard.
+ IEEE Transactions on Broadcasting 40, 4
+
+ "To avoid conflicts with the synchronization code, code '1111' is defined
+ to be illegal."
+*/
+static int check_balloc(mpg123_handle *fr, unsigned int *balloc, unsigned int *end)
+{
+ unsigned int *ba;
+ for(ba=balloc; ba != end; ++ba)
+ if(*ba == 15)
+ {
+ if(NOQUIET) error("Illegal bit allocation value.");
+ return -1;
+ }
+
+ return 0;
+}
+
+#define NEED_BITS(fr, num) \
+ if((fr)->bits_avail < num) \
+ { \
+ if(NOQUIET) \
+ error2("%u bits needed, %li available", num, (fr)->bits_avail); \
+ return -1; \
+ } \
+
+static int I_step_one(unsigned int balloc[], unsigned int scale_index[2][SBLIMIT],mpg123_handle *fr)
+{
+ unsigned int *ba=balloc;
+ unsigned int *sca = (unsigned int *) scale_index;
+
+ if(fr->stereo == 2)
+ {
+ int i;
+ int jsbound = fr->jsbound;
+ unsigned int needbits = jsbound*2*4 + (SBLIMIT-jsbound)*4;
+
+ NEED_BITS(fr, needbits);
+ needbits = 0;
+ for(i=0;i<jsbound;i++)
+ {
+ ba[0] = getbits_fast(fr, 4);
+ ba[1] = getbits_fast(fr, 4);
+ needbits += ((ba[0]?1:0)+(ba[1]?1:0))*6;
+ ba+=2;
+ }
+ for(i=jsbound;i<SBLIMIT;i++)
+ {
+ *ba = getbits_fast(fr, 4);
+ needbits += (*ba?1:0)*12;
+ ++ba;
+ }
+
+ if(check_balloc(fr, balloc, ba)) return -1;
+
+ ba = balloc;
+ NEED_BITS(fr, needbits)
+ for(i=0;i<jsbound;i++)
+ {
+ if ((*ba++))
+ *sca++ = getbits_fast(fr, 6);
+ if ((*ba++))
+ *sca++ = getbits_fast(fr, 6);
+ }
+ for (i=jsbound;i<SBLIMIT;i++) if((*ba++))
+ {
+ *sca++ = getbits_fast(fr, 6);
+ *sca++ = getbits_fast(fr, 6);
+ }
+ }
+ else
+ {
+ int i;
+ unsigned int needbits = SBLIMIT*4;
+
+ NEED_BITS(fr, needbits)
+ needbits = 0;
+ for(i=0;i<SBLIMIT;i++)
+ {
+ *ba = getbits_fast(fr, 4);
+ needbits += (*ba?1:0)*6;
+ ++ba;
+ }
+
+ if(check_balloc(fr, balloc, ba)) return -1;
+
+ ba = balloc;
+ NEED_BITS(fr, needbits)
+ for (i=0;i<SBLIMIT;i++)
+ if ((*ba++))
+ *sca++ = getbits_fast(fr, 6);
+ }
+
+ return 0;
+}
+
+/* Something sane in place of undefined (-1)<<n. Well, not really. */
+#define MINUS_SHIFT(n) ( (int)(((unsigned int)-1)<<(n)) )
+
+static int I_step_two(real fraction[2][SBLIMIT],unsigned int balloc[2*SBLIMIT], unsigned int scale_index[2][SBLIMIT],mpg123_handle *fr)
+{
+ int i,n;
+ int smpb[2*SBLIMIT]; /* values: 0-65535 */
+ int *sample;
+ register unsigned int *ba;
+ register unsigned int *sca = (unsigned int *) scale_index;
+
+ if(fr->stereo == 2)
+ {
+ unsigned int needbits = 0;
+ int jsbound = fr->jsbound;
+ register real *f0 = fraction[0];
+ register real *f1 = fraction[1];
+
+ ba = balloc;
+ for(sample=smpb,i=0;i<jsbound;i++)
+ {
+ if((n=*ba++))
+ needbits += n+1;
+ if((n=*ba++))
+ needbits += n+1;
+ }
+ for(i=jsbound;i<SBLIMIT;i++)
+ if((n = *ba++))
+ needbits += n+1;
+ NEED_BITS(fr, needbits)
+
+ ba = balloc;
+ for(sample=smpb,i=0;i<jsbound;i++)
+ {
+ if((n = *ba++)) *sample++ = getbits(fr, n+1);
+
+ if((n = *ba++)) *sample++ = getbits(fr, n+1);
+ }
+ for(i=jsbound;i<SBLIMIT;i++)
+ if((n = *ba++))
+ *sample++ = getbits(fr, n+1);
+
+ ba = balloc;
+ for(sample=smpb,i=0;i<jsbound;i++)
+ {
+ if((n=*ba++))
+ *f0++ = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15(MINUS_SHIFT(n) + (*sample++) + 1), fr->muls[n+1][*sca++]);
+ else *f0++ = DOUBLE_TO_REAL(0.0);
+
+ if((n=*ba++))
+ *f1++ = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15(MINUS_SHIFT(n) + (*sample++) + 1), fr->muls[n+1][*sca++]);
+ else *f1++ = DOUBLE_TO_REAL(0.0);
+ }
+ for(i=jsbound;i<SBLIMIT;i++)
+ {
+ if((n=*ba++))
+ {
+ real samp = DOUBLE_TO_REAL_15(MINUS_SHIFT(n) + (*sample++) + 1);
+ *f0++ = REAL_MUL_SCALE_LAYER12(samp, fr->muls[n+1][*sca++]);
+ *f1++ = REAL_MUL_SCALE_LAYER12(samp, fr->muls[n+1][*sca++]);
+ }
+ else *f0++ = *f1++ = DOUBLE_TO_REAL(0.0);
+ }
+ for(i=fr->down_sample_sblimit;i<32;i++)
+ fraction[0][i] = fraction[1][i] = 0.0;
+ }
+ else
+ {
+ unsigned int needbits = 0;
+ register real *f0 = fraction[0];
+
+ ba = balloc;
+ for(sample=smpb,i=0;i<SBLIMIT;i++)
+ if((n = *ba++))
+ needbits += n+1;
+ NEED_BITS(fr, needbits);
+
+ ba = balloc;
+ for(sample=smpb,i=0;i<SBLIMIT;i++)
+ if ((n = *ba++))
+ *sample++ = getbits(fr, n+1);
+
+
+ ba = balloc;
+ for(sample=smpb,i=0;i<SBLIMIT;i++)
+ {
+ if((n=*ba++))
+ *f0++ = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15(MINUS_SHIFT(n) + (*sample++) + 1), fr->muls[n+1][*sca++]);
+ else *f0++ = DOUBLE_TO_REAL(0.0);
+ }
+ for(i=fr->down_sample_sblimit;i<32;i++)
+ fraction[0][i] = DOUBLE_TO_REAL(0.0);
+ }
+ return 0;
+}
+
+int do_layer1(mpg123_handle *fr)
+{
+ int clip=0;
+ int i,stereo = fr->stereo;
+ unsigned int balloc[2*SBLIMIT];
+ unsigned int scale_index[2][SBLIMIT];
+ real (*fraction)[SBLIMIT] = fr->layer1.fraction; /* fraction[2][SBLIMIT] */
+ int single = fr->single;
+
+ fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext<<2)+4 : 32;
+
+ if(stereo == 1 || single == SINGLE_MIX) /* I don't see mixing handled here */
+ single = SINGLE_LEFT;
+
+ if(I_step_one(balloc,scale_index,fr))
+ {
+ if(NOQUIET)
+ error("Aborting layer I decoding after step one.");
+ return clip;
+ }
+
+ for(i=0;i<SCALE_BLOCK;i++)
+ {
+ if(I_step_two(fraction,balloc,scale_index,fr))
+ {
+ if(NOQUIET)
+ error("Aborting layer I decoding after step two.");
+ return clip;
+ }
+
+ if(single != SINGLE_STEREO)
+ clip += (fr->synth_mono)(fraction[single], fr);
+ else
+ clip += (fr->synth_stereo)(fraction[0], fraction[1], fr);
+ }
+
+ return clip;
+}
+
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/layer2.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/layer2.c
new file mode 100644
index 00000000..0f2071b5
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/layer2.c
@@ -0,0 +1,380 @@
+/*
+ layer2.c: the layer 2 decoder, root of mpg123
+
+ copyright 1994-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp
+
+ mpg123 started as mp2 decoder a long time ago...
+ part of this file is required for layer 1, too.
+*/
+
+
+#include "mpg123lib_intern.h"
+
+#ifndef NO_LAYER2
+#include "l2tables.h"
+#endif
+
+#include "getbits.h"
+
+#ifndef NO_LAYER12 /* Stuff needed for layer I and II. */
+
+#include "l12tabs.h"
+
+#ifdef RUNTIME_TABLES
+#include "init_layer12.h"
+#endif
+
+// The layer12_table is already in real format (fixed or float), just needs
+// a little scaling in the MMX/SSE case.
+
+void init_layer12_stuff(mpg123_handle *fr, real* (*init_table)(mpg123_handle *fr, real *table, int m))
+{
+ int k;
+ real *table;
+ for(k=0;k<27;k++)
+ {
+ table = init_table(fr, fr->muls[k], k);
+ *table++ = 0.0;
+ }
+}
+
+real* init_layer12_table(mpg123_handle *fr, real *table, int m)
+{
+ int i;
+ for(i=0;i<63;i++)
+ *table++ = layer12_table[m][i];
+ return table;
+}
+
+#ifdef OPT_MMXORSSE
+real* init_layer12_table_mmx(mpg123_handle *fr, real *table, int m)
+{
+ int i,j;
+ if(!fr->p.down_sample)
+ {
+ for(j=3,i=0;i<63;i++,j--)
+ *table++ = 16384 * layer12_table[m][i];
+ }
+ else
+ {
+ for(j=3,i=0;i<63;i++,j--)
+ *table++ = layer12_table[m][i];
+ }
+ return table;
+}
+#endif
+
+#endif /* NO_LAYER12 */
+
+/* The rest is the actual decoding of layer II data. */
+
+#ifndef NO_LAYER2
+
+static int II_step_one(unsigned int *bit_alloc,int *scale,mpg123_handle *fr)
+{
+ int stereo = fr->stereo-1;
+ int sblimit = fr->II_sblimit;
+ int jsbound = fr->jsbound;
+ int sblimit2 = fr->II_sblimit<<stereo;
+ const struct al_table *alloc1 = fr->alloc;
+ int i;
+ unsigned int scfsi_buf[64];
+ unsigned int *scfsi,*bita;
+ int sc,step;
+ /* Count the bits needed for getbits_fast(). */
+ unsigned int needbits = 0;
+ unsigned int scale_bits[4] = { 18, 12, 6, 12 };
+
+ bita = bit_alloc;
+ if(stereo)
+ {
+ for(i=jsbound;i;i--,alloc1+=(1<<step))
+ {
+ step=alloc1->bits;
+ bita[0] = (char) getbits(fr, step);
+ bita[1] = (char) getbits(fr, step);
+ needbits += ((bita[0]?1:0)+(bita[1]?1:0))*2;
+ bita+=2;
+ }
+ for(i=sblimit-jsbound;i;i--,alloc1+=(1<<step))
+ {
+ step=alloc1->bits;
+ bita[0] = (char) getbits(fr, step);
+ bita[1] = bita[0];
+ needbits += (bita[0]?1:0)*2*2;
+ bita+=2;
+ }
+ bita = bit_alloc;
+ scfsi=scfsi_buf;
+
+ if(fr->bits_avail < needbits)
+ {
+ if(NOQUIET)
+ error2("need %u bits, have %li", needbits, fr->bits_avail);
+ return -1;
+ }
+ for(i=sblimit2;i;i--)
+ if(*bita++) *scfsi++ = (char) getbits_fast(fr, 2);
+ }
+ else /* mono */
+ {
+ for(i=sblimit;i;i--,alloc1+=(1<<step))
+ {
+ step=alloc1->bits;
+ *bita = (char) getbits(fr, step);
+ if(*bita)
+ needbits += 2;
+ ++bita;
+ }
+ bita = bit_alloc;
+ scfsi=scfsi_buf;
+ if(fr->bits_avail < needbits)
+ {
+ if(NOQUIET)
+ error2("need %u bits, have %li", needbits, fr->bits_avail);
+ return -1;
+ }
+ for(i=sblimit;i;i--)
+ if(*bita++) *scfsi++ = (char) getbits_fast(fr, 2);
+ }
+
+ needbits = 0;
+ bita = bit_alloc;
+ scfsi=scfsi_buf;
+ for(i=sblimit2;i;--i)
+ if(*bita++)
+ needbits += scale_bits[*scfsi++];
+ if(fr->bits_avail < needbits)
+ {
+ if(NOQUIET)
+ error2("need %u bits, have %li", needbits, fr->bits_avail);
+ return -1;
+ }
+
+ bita = bit_alloc;
+ scfsi=scfsi_buf;
+ for(i=sblimit2;i;--i)
+ if(*bita++)
+ switch(*scfsi++)
+ {
+ case 0:
+ *scale++ = getbits_fast(fr, 6);
+ *scale++ = getbits_fast(fr, 6);
+ *scale++ = getbits_fast(fr, 6);
+ break;
+ case 1 :
+ *scale++ = sc = getbits_fast(fr, 6);
+ *scale++ = sc;
+ *scale++ = getbits_fast(fr, 6);
+ break;
+ case 2:
+ *scale++ = sc = getbits_fast(fr, 6);
+ *scale++ = sc;
+ *scale++ = sc;
+ break;
+ default: /* case 3 */
+ *scale++ = getbits_fast(fr, 6);
+ *scale++ = sc = getbits_fast(fr, 6);
+ *scale++ = sc;
+ break;
+ }
+
+ return 0;
+}
+
+
+static void II_step_two(unsigned int *bit_alloc,real fraction[2][4][SBLIMIT],int *scale,mpg123_handle *fr,int x1)
+{
+ int i,j,k,ba;
+ int stereo = fr->stereo;
+ int sblimit = fr->II_sblimit;
+ int jsbound = fr->jsbound;
+ const struct al_table *alloc2,*alloc1 = fr->alloc;
+ unsigned int *bita=bit_alloc;
+ int d1,step;
+
+ for(i=0;i<jsbound;i++,alloc1+=(1<<step))
+ {
+ step = alloc1->bits;
+ for(j=0;j<stereo;j++)
+ {
+ if( (ba=*bita++) )
+ {
+ k=(alloc2 = alloc1+ba)->bits;
+ if( (d1=alloc2->d) < 0)
+ {
+ real cm=fr->muls[k][scale[x1]];
+ fraction[j][0][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm);
+ fraction[j][1][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm);
+ fraction[j][2][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm);
+ }
+ else
+ {
+ const unsigned char *table[] = { 0,0,0,grp_3tab,0,grp_5tab,0,0,0,grp_9tab };
+ unsigned int m=scale[x1];
+ unsigned int idx = (unsigned int) getbits(fr, k);
+ const unsigned char *tab = table[d1] + idx + idx + idx;
+ fraction[j][0][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m]);
+ fraction[j][1][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m]);
+ fraction[j][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m]);
+ }
+ scale+=3;
+ }
+ else
+ fraction[j][0][i] = fraction[j][1][i] = fraction[j][2][i] = DOUBLE_TO_REAL(0.0);
+ if(fr->bits_avail < 0)
+ return; /* Caller checks that again. */
+ }
+ }
+
+ for(i=jsbound;i<sblimit;i++,alloc1+=(1<<step))
+ {
+ step = alloc1->bits;
+ bita++; /* channel 1 and channel 2 bitalloc are the same */
+ if( (ba=*bita++) )
+ {
+ k=(alloc2 = alloc1+ba)->bits;
+ if( (d1=alloc2->d) < 0)
+ {
+ real cm;
+ cm=fr->muls[k][scale[x1+3]];
+ fraction[0][0][i] = DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1);
+ fraction[0][1][i] = DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1);
+ fraction[0][2][i] = DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1);
+ fraction[1][0][i] = REAL_MUL_SCALE_LAYER12(fraction[0][0][i], cm);
+ fraction[1][1][i] = REAL_MUL_SCALE_LAYER12(fraction[0][1][i], cm);
+ fraction[1][2][i] = REAL_MUL_SCALE_LAYER12(fraction[0][2][i], cm);
+ cm=fr->muls[k][scale[x1]];
+ fraction[0][0][i] = REAL_MUL_SCALE_LAYER12(fraction[0][0][i], cm);
+ fraction[0][1][i] = REAL_MUL_SCALE_LAYER12(fraction[0][1][i], cm);
+ fraction[0][2][i] = REAL_MUL_SCALE_LAYER12(fraction[0][2][i], cm);
+ }
+ else
+ {
+ const unsigned char *table[] = { 0,0,0,grp_3tab,0,grp_5tab,0,0,0,grp_9tab };
+ unsigned int m1 = scale[x1];
+ unsigned int m2 = scale[x1+3];
+ unsigned int idx = (unsigned int) getbits(fr, k);
+ const unsigned char *tab = table[d1] + idx + idx + idx;
+ fraction[0][0][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m1]); fraction[1][0][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m2]);
+ fraction[0][1][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m1]); fraction[1][1][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m2]);
+ fraction[0][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m1]); fraction[1][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m2]);
+ }
+ scale+=6;
+ if(fr->bits_avail < 0)
+ return; /* Caller checks that again. */
+ }
+ else
+ {
+ fraction[0][0][i] = fraction[0][1][i] = fraction[0][2][i] =
+ fraction[1][0][i] = fraction[1][1][i] = fraction[1][2][i] = DOUBLE_TO_REAL(0.0);
+ }
+/*
+ Historic comment...
+ should we use individual scalefac for channel 2 or
+ is the current way the right one , where we just copy channel 1 to
+ channel 2 ??
+ The current 'strange' thing is, that we throw away the scalefac
+ values for the second channel ...!!
+ -> changed .. now we use the scalefac values of channel one !!
+*/
+ }
+
+ if(sblimit > (fr->down_sample_sblimit) )
+ sblimit = fr->down_sample_sblimit;
+
+ for(i=sblimit;i<SBLIMIT;i++)
+ for (j=0;j<stereo;j++)
+ fraction[j][0][i] = fraction[j][1][i] = fraction[j][2][i] = DOUBLE_TO_REAL(0.0);
+}
+
+
+static void II_select_table(mpg123_handle *fr)
+{
+ const int translate[3][2][16] =
+ {
+ {
+ { 0,2,2,2,2,2,2,0,0,0,1,1,1,1,1,0 },
+ { 0,2,2,0,0,0,1,1,1,1,1,1,1,1,1,0 }
+ },
+ {
+ { 0,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0 },
+ { 0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0 }
+ },
+ {
+ { 0,3,3,3,3,3,3,0,0,0,1,1,1,1,1,0 },
+ { 0,3,3,0,0,0,1,1,1,1,1,1,1,1,1,0 }
+ }
+ };
+
+ int table,sblim;
+ const struct al_table *tables[5] = { alloc_0, alloc_1, alloc_2, alloc_3 , alloc_4 };
+ const int sblims[5] = { 27 , 30 , 8, 12 , 30 };
+
+ if(fr->sampling_frequency >= 3) /* Or equivalent: (fr->lsf == 1) */
+ table = 4;
+ else
+ table = translate[fr->sampling_frequency][2-fr->stereo][fr->bitrate_index];
+
+ sblim = sblims[table];
+ fr->alloc = tables[table];
+ fr->II_sblimit = sblim;
+}
+
+
+int do_layer2(mpg123_handle *fr)
+{
+ int clip=0;
+ int i,j;
+ int stereo = fr->stereo;
+ /* pick_table clears unused subbands */
+ /* replacement for real fraction[2][4][SBLIMIT], needs alignment. */
+ real (*fraction)[4][SBLIMIT] = fr->layer2.fraction;
+ unsigned int bit_alloc[64];
+ int scale[192];
+ int single = fr->single;
+
+ II_select_table(fr);
+ fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext<<2)+4 : fr->II_sblimit;
+
+ if(fr->jsbound > fr->II_sblimit)
+ {
+ fprintf(stderr, "Truncating stereo boundary to sideband limit.\n");
+ fr->jsbound=fr->II_sblimit;
+ }
+
+ /* TODO: What happens with mono mixing, actually? */
+ if(stereo == 1 || single == SINGLE_MIX) /* also, mix not really handled */
+ single = SINGLE_LEFT;
+
+ if(II_step_one(bit_alloc, scale, fr))
+ {
+ if(NOQUIET)
+ error("first step of layer I decoding failed");
+ return clip;
+ }
+
+ for(i=0;i<SCALE_BLOCK;i++)
+ {
+ II_step_two(bit_alloc,fraction,scale,fr,i>>2);
+ if(fr->bits_avail < 0)
+ {
+ if(NOQUIET)
+ error("missing bits in layer II step two");
+ return clip;
+ }
+ for(j=0;j<3;j++)
+ {
+ if(single != SINGLE_STEREO)
+ clip += (fr->synth_mono)(fraction[single][j], fr);
+ else
+ clip += (fr->synth_stereo)(fraction[0][j], fraction[1][j], fr);
+ }
+ }
+
+ return clip;
+}
+
+#endif /* NO_LAYER2 */
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/layer3.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/layer3.c
new file mode 100644
index 00000000..a25ef098
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/layer3.c
@@ -0,0 +1,1943 @@
+/*
+ layer3.c: the layer 3 decoder
+
+ copyright 1995-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp
+
+ Dear visitor:
+ If you feel you don't understand fully the works of this file, your feeling might be correct.
+
+ Optimize-TODO: put short bands into the band-field without the stride of 3 reals
+ Length-optimze: unify long and short band code where it is possible
+
+ The int-vs-pointer situation has to be cleaned up.
+*/
+
+#include "mpg123lib_intern.h"
+#ifdef USE_NEW_HUFFTABLE
+#include "newhuffman.h"
+#else
+#include "huffman.h"
+#endif
+#include "getbits.h"
+#include "debug.h"
+
+
+
+/* define CUT_SFB21 if you want to cut-off the frequency above 16kHz */
+#if 0
+#define CUT_SFB21
+#endif
+
+#include "l3tabs.h"
+#include "l3bandgain.h"
+
+#ifdef RUNTIME_TABLES
+#include "init_layer3.h"
+#endif
+
+/* Decoder state data, living on the stack of do_layer3. */
+
+struct gr_info_s
+{
+ int scfsi;
+ unsigned part2_3_length;
+ unsigned big_values;
+ unsigned scalefac_compress;
+ unsigned block_type;
+ unsigned mixed_block_flag;
+ unsigned table_select[3];
+ /* Making those two signed int as workaround for open64/pathscale/sun compilers, and also for consistency, since they're worked on together with other signed variables. */
+ int maxband[3];
+ int maxbandl;
+ unsigned maxb;
+ unsigned region1start;
+ unsigned region2start;
+ unsigned preflag;
+ unsigned scalefac_scale;
+ unsigned count1table_select;
+#ifdef REAL_IS_FIXED
+ const real *full_gain[3];
+ const real *pow2gain;
+#else
+ real *full_gain[3];
+ real *pow2gain;
+#endif
+};
+
+struct III_sideinfo
+{
+ unsigned main_data_begin;
+ unsigned private_bits;
+ /* Hm, funny... struct inside struct... */
+ struct { struct gr_info_s gr[2]; } ch[2];
+};
+
+#ifdef OPT_MMXORSSE
+real init_layer3_gainpow2_mmx(mpg123_handle *fr, int i)
+{
+ if(!fr->p.down_sample) return DOUBLE_TO_REAL(16384.0 * pow((double)2.0,-0.25 * (double) (i+210) ));
+ else return DOUBLE_TO_REAL(pow((double)2.0,-0.25 * (double) (i+210)));
+}
+#endif
+
+real init_layer3_gainpow2(mpg123_handle *fr, int i)
+{
+ return DOUBLE_TO_REAL_SCALE_LAYER3(pow((double)2.0,-0.25 * (double) (i+210)),i+256);
+}
+
+void init_layer3_stuff(mpg123_handle *fr, real (*gainpow2_func)(mpg123_handle *fr, int i))
+{
+ int i,j;
+
+#ifdef REAL_IS_FIXED
+ fr->gainpow2 = gainpow2;
+#else
+ for(i=-256;i<118+4;i++)
+ fr->gainpow2[i+256] = gainpow2_func(fr,i);
+#endif
+
+ for(j=0;j<9;j++)
+ {
+ for(i=0;i<23;i++)
+ {
+ fr->longLimit[j][i] = (bandInfo[j].longIdx[i] - 1 + 8) / 18 + 1;
+ if(fr->longLimit[j][i] > (fr->down_sample_sblimit) )
+ fr->longLimit[j][i] = fr->down_sample_sblimit;
+ }
+ for(i=0;i<14;i++)
+ {
+ fr->shortLimit[j][i] = (bandInfo[j].shortIdx[i] - 1) / 18 + 1;
+ if(fr->shortLimit[j][i] > (fr->down_sample_sblimit) )
+ fr->shortLimit[j][i] = fr->down_sample_sblimit;
+ }
+ }
+}
+
+/*
+ Observe!
+ Now come the actualy decoding routines.
+*/
+
+/* read additional side information (for MPEG 1 and MPEG 2) */
+static int III_get_side_info(mpg123_handle *fr, struct III_sideinfo *si,int stereo, int ms_stereo,long sfreq,int single)
+{
+ int ch, gr;
+ int powdiff = (single == SINGLE_MIX) ? 4 : 0;
+
+ const int tabs[2][5] = { { 2,9,5,3,4 } , { 1,8,1,2,9 } };
+ const int *tab = tabs[fr->lsf];
+
+ { /* First ensure we got enough bits available. */
+ unsigned int needbits = 0;
+ needbits += tab[1]; /* main_data_begin */
+ needbits += stereo == 1 ? tab[2] : tab[3]; /* private */
+ if(!fr->lsf)
+ needbits += stereo*4; /* scfsi */
+ /* For each granule for each channel ... */
+ needbits += tab[0]*stereo*(29+tab[4]+1+22+(!fr->lsf?1:0)+2);
+ if(fr->bits_avail < needbits) \
+ {
+ if(NOQUIET)
+ error2( "%u bits for side info needed, only %li available"
+ , needbits, fr->bits_avail );
+ return 1;
+ }
+ }
+
+ si->main_data_begin = getbits(fr, tab[1]);
+
+ if(si->main_data_begin > fr->bitreservoir)
+ {
+ if(!fr->to_ignore && VERBOSE2) fprintf(stderr, "Note: missing %d bytes in bit reservoir for frame %li\n", (int)(si->main_data_begin - fr->bitreservoir), (long)fr->num);
+
+ /* overwrite main_data_begin for the really available bit reservoir */
+ backbits(fr, tab[1]);
+ if(fr->lsf == 0)
+ {
+ fr->wordpointer[0] = (unsigned char) (fr->bitreservoir >> 1);
+ fr->wordpointer[1] = (unsigned char) ((fr->bitreservoir & 1) << 7);
+ }
+ else fr->wordpointer[0] = (unsigned char) fr->bitreservoir;
+
+ /* zero "side-info" data for a silence-frame
+ without touching audio data used as bit reservoir for following frame */
+ memset(fr->wordpointer+2, 0, fr->ssize-2);
+
+ /* reread the new bit reservoir offset */
+ si->main_data_begin = getbits(fr, tab[1]);
+ }
+
+ /* Keep track of the available data bytes for the bit reservoir.
+ CRC is included in ssize already. */
+ fr->bitreservoir = fr->bitreservoir + fr->framesize - fr->ssize;
+
+ /* Limit the reservoir to the max for MPEG 1.0 or 2.x . */
+ if(fr->bitreservoir > (unsigned int) (fr->lsf == 0 ? 511 : 255))
+ fr->bitreservoir = (fr->lsf == 0 ? 511 : 255);
+
+ /* Now back into less commented territory. It's code. It works. */
+
+ if (stereo == 1)
+ si->private_bits = getbits(fr, tab[2]);
+ else
+ si->private_bits = getbits(fr, tab[3]);
+
+ if(!fr->lsf) for(ch=0; ch<stereo; ch++)
+ {
+ si->ch[ch].gr[0].scfsi = -1;
+ si->ch[ch].gr[1].scfsi = getbits(fr, 4);
+ }
+
+ for (gr=0; gr<tab[0]; gr++)
+ for (ch=0; ch<stereo; ch++)
+ {
+ register struct gr_info_s *gr_info = &(si->ch[ch].gr[gr]);
+ unsigned int qss;
+ gr_info->part2_3_length = getbits(fr, 12);
+ gr_info->big_values = getbits(fr, 9);
+ if(gr_info->big_values > 288)
+ {
+ if(NOQUIET) error("big_values too large!");
+ gr_info->big_values = 288;
+ }
+ qss = getbits_fast(fr, 8);
+ gr_info->pow2gain = fr->gainpow2+256 - qss + powdiff;
+ if(ms_stereo)
+ gr_info->pow2gain += 2;
+#ifndef NO_MOREINFO
+ if(fr->pinfo)
+ fr->pinfo->qss[gr][ch] = qss;
+#endif
+ gr_info->scalefac_compress = getbits(fr, tab[4]);
+ if(gr_info->part2_3_length == 0)
+ {
+ if(gr_info->scalefac_compress > 0 && VERBOSE2)
+ error1( "scalefac_compress should be zero instead of %i"
+ , gr_info->scalefac_compress );
+ gr_info->scalefac_compress = 0;
+ }
+
+ /* 22 bits for if/else block */
+ if(getbits(fr,1))
+ { /* window switch flag */
+ int i;
+ gr_info->block_type = getbits_fast(fr, 2);
+ gr_info->mixed_block_flag = get1bit(fr);
+ gr_info->table_select[0] = getbits_fast(fr, 5);
+ gr_info->table_select[1] = getbits_fast(fr, 5);
+ /*
+ table_select[2] not needed, because there is no region2,
+ but to satisfy some verification tools we set it either.
+ */
+ gr_info->table_select[2] = 0;
+ for(i=0;i<3;i++)
+ {
+ unsigned int sbg = (getbits_fast(fr, 3)<<3);
+ gr_info->full_gain[i] = gr_info->pow2gain + sbg;
+#ifndef NO_MOREINFO
+ if(fr->pinfo)
+ fr->pinfo->sub_gain[gr][ch][i] = sbg / 8;
+#endif
+ }
+
+ if(gr_info->block_type == 0)
+ {
+ if(NOQUIET) error("Blocktype == 0 and window-switching == 1 not allowed.");
+ return 1;
+ }
+
+ /* region_count/start parameters are implicit in this case. */
+ if( (!fr->lsf || (gr_info->block_type == 2)) && !fr->mpeg25)
+ {
+ gr_info->region1start = 36>>1;
+ gr_info->region2start = 576>>1;
+ }
+ else
+ {
+ if(fr->mpeg25)
+ {
+ int r0c,r1c;
+ if((gr_info->block_type == 2) && (!gr_info->mixed_block_flag) ) r0c = 5;
+ else r0c = 7;
+
+ /* r0c+1+r1c+1 == 22, always. */
+ r1c = 20 - r0c;
+ gr_info->region1start = bandInfo[sfreq].longIdx[r0c+1] >> 1 ;
+ gr_info->region2start = bandInfo[sfreq].longIdx[r0c+1+r1c+1] >> 1;
+ }
+ else
+ {
+ gr_info->region1start = 54>>1;
+ gr_info->region2start = 576>>1;
+ }
+ }
+ }
+ else
+ {
+ int i,r0c,r1c;
+ for (i=0; i<3; i++)
+ gr_info->table_select[i] = getbits_fast(fr, 5);
+
+ r0c = getbits_fast(fr, 4); /* 0 .. 15 */
+ r1c = getbits_fast(fr, 3); /* 0 .. 7 */
+ gr_info->region1start = bandInfo[sfreq].longIdx[r0c+1] >> 1 ;
+
+ /* max(r0c+r1c+2) = 15+7+2 = 24 */
+ if(r0c+1+r1c+1 > 22) gr_info->region2start = 576>>1;
+ else gr_info->region2start = bandInfo[sfreq].longIdx[r0c+1+r1c+1] >> 1;
+
+ gr_info->block_type = 0;
+ gr_info->mixed_block_flag = 0;
+ }
+ if(!fr->lsf) gr_info->preflag = get1bit(fr);
+
+ gr_info->scalefac_scale = get1bit(fr);
+ gr_info->count1table_select = get1bit(fr);
+ }
+ return 0;
+}
+
+
+/* read scalefactors */
+static int III_get_scale_factors_1(mpg123_handle *fr, int *scf,struct gr_info_s *gr_info,int ch,int gr)
+{
+ const unsigned char slen[2][16] =
+ {
+ {0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4},
+ {0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3}
+ };
+ int numbits;
+ int num0 = slen[0][gr_info->scalefac_compress];
+ int num1 = slen[1][gr_info->scalefac_compress];
+
+ if(gr_info->block_type == 2)
+ {
+ int i=18;
+ numbits = (num0 + num1) * 18 /* num0 * (17+1?) + num1 * 18 */
+ - (gr_info->mixed_block_flag ? num0 : 0);
+ if(fr->bits_avail < numbits)
+ return -1;
+
+ if(gr_info->mixed_block_flag)
+ {
+ for (i=8;i;i--)
+ *scf++ = getbits_fast(fr, num0);
+
+ i = 9;
+ }
+
+ for(;i;i--) *scf++ = getbits_fast(fr, num0);
+
+ for(i = 18; i; i--) *scf++ = getbits_fast(fr, num1);
+
+ *scf++ = 0; *scf++ = 0; *scf++ = 0; /* short[13][0..2] = 0 */
+ }
+ else
+ {
+ int i;
+ int scfsi = gr_info->scfsi;
+
+ if(scfsi < 0)
+ { /* scfsi < 0 => granule == 0 */
+ numbits = (num0 + num1) * 10 + num0;
+ if(fr->bits_avail < numbits)
+ return -1;
+
+ for(i=11;i;i--) *scf++ = getbits_fast(fr, num0);
+
+ for(i=10;i;i--) *scf++ = getbits_fast(fr, num1);
+
+ *scf++ = 0;
+ }
+ else
+ {
+ numbits = !(scfsi & 0x8) * num0 * 6
+ + !(scfsi & 0x4) * num0 * 5
+ + !(scfsi & 0x2) * num1 * 5
+ + !(scfsi & 0x1) * num1 * 5;
+ if(fr->bits_avail < numbits)
+ return -1;
+
+ if(!(scfsi & 0x8))
+ {
+ for (i=0;i<6;i++) *scf++ = getbits_fast(fr, num0);
+ }
+ else scf += 6;
+
+ if(!(scfsi & 0x4))
+ {
+ for (i=0;i<5;i++) *scf++ = getbits_fast(fr, num0);
+ }
+ else scf += 5;
+
+ if(!(scfsi & 0x2))
+ {
+ for(i=0;i<5;i++) *scf++ = getbits_fast(fr, num1);
+ }
+ else scf += 5;
+
+ if(!(scfsi & 0x1))
+ {
+ for (i=0;i<5;i++) *scf++ = getbits_fast(fr, num1);
+ }
+ else scf += 5;
+
+ *scf++ = 0; /* no l[21] in original sources */
+ }
+ }
+
+ return numbits;
+}
+
+
+static int III_get_scale_factors_2(mpg123_handle *fr, int *scf,struct gr_info_s *gr_info,int i_stereo)
+{
+ const unsigned char *pnt;
+ int i,j,n=0,numbits=0;
+ unsigned int slen, slen2;
+
+ const unsigned char stab[3][6][4] =
+ {
+ {
+ { 6, 5, 5,5 } , { 6, 5, 7,3 } , { 11,10,0,0},
+ { 7, 7, 7,0 } , { 6, 6, 6,3 } , { 8, 8,5,0}
+ },
+ {
+ { 9, 9, 9,9 } , { 9, 9,12,6 } , { 18,18,0,0},
+ {12,12,12,0 } , {12, 9, 9,6 } , { 15,12,9,0}
+ },
+ {
+ { 6, 9, 9,9 } , { 6, 9,12,6 } , { 15,18,0,0},
+ { 6,15,12,0 } , { 6,12, 9,6 } , { 6,18,9,0}
+ }
+ };
+
+ if(i_stereo) /* i_stereo AND second channel -> do_layer3() checks this */
+ slen = i_slen2[gr_info->scalefac_compress>>1];
+ else
+ slen = n_slen2[gr_info->scalefac_compress];
+
+ gr_info->preflag = (slen>>15) & 0x1;
+
+ n = 0;
+ if( gr_info->block_type == 2 )
+ {
+ n++;
+ if(gr_info->mixed_block_flag) n++;
+ }
+
+ pnt = stab[n][(slen>>12)&0x7];
+
+ slen2 = slen;
+ for(i=0;i<4;i++)
+ {
+ int num = slen2 & 0x7;
+ slen2 >>= 3;
+ if(num)
+ numbits += pnt[i] * num;
+ }
+ if(numbits > gr_info->part2_3_length)
+ return -1;
+
+ for(i=0;i<4;i++)
+ {
+ int num = slen & 0x7;
+ slen >>= 3;
+ if(num)
+ {
+ for(j=0;j<(int)(pnt[i]);j++) *scf++ = getbits_fast(fr, num);
+ }
+ else
+ for(j=0;j<(int)(pnt[i]);j++) *scf++ = 0;
+ }
+
+ n = (n << 1) + 1;
+ for(i=0;i<n;i++) *scf++ = 0;
+
+ return numbits;
+}
+
+static unsigned char pretab_choice[2][22] =
+{
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0}
+};
+
+/*
+ Dequantize samples
+ ...includes Huffman decoding
+*/
+
+/* 24 is enough because tab13 has max. a 19 bit huffvector */
+/* The old code played games with shifting signed integers around in not quite */
+/* legal ways. Also, it used long where just 32 bits are required. This could */
+/* be good or bad on 64 bit architectures ... anyway, making clear that */
+/* 32 bits suffice is a benefit. */
+#if 0
+/* To reconstruct old code, use this: */
+#define MASK_STYPE long
+#define MASK_UTYPE unsigned long
+#define MASK_TYPE MASK_STYPE
+#define MSB_MASK (mask < 0)
+#else
+/* This should be more proper: */
+#define MASK_STYPE int32_t
+#define MASK_UTYPE uint32_t
+#define MASK_TYPE MASK_UTYPE
+#define MSB_MASK ((MASK_UTYPE)mask & (MASK_UTYPE)1<<(sizeof(MASK_TYPE)*8-1))
+#endif
+#define BITSHIFT ((sizeof(MASK_TYPE)-1)*8)
+#define REFRESH_MASK \
+ while(num < BITSHIFT) { \
+ mask |= ((MASK_UTYPE)getbyte(fr))<<(BITSHIFT-num); \
+ num += 8; \
+ part2remain -= 8; }
+/* Complicated way of checking for msb value. This used to be (mask < 0). */
+
+static int III_dequantize_sample(mpg123_handle *fr, real xr[SBLIMIT][SSLIMIT],int *scf, struct gr_info_s *gr_info,int sfreq,int part2bits)
+{
+ int shift = 1 + gr_info->scalefac_scale;
+ real *xrpnt = (real *) xr;
+ int l[3],l3;
+ int part2remain = gr_info->part2_3_length - part2bits;
+ const short *me;
+#ifdef REAL_IS_FIXED
+ int gainpow2_scale_idx = 378;
+#endif
+
+ /* Assumption: If there is some part2_3_length at all, there should be
+ enough of it to work with properly. In case of zero length we silently
+ zero things. */
+ if(gr_info->part2_3_length > 0)
+ {
+
+ /* mhipp tree has this split up a bit... */
+ int num=getbitoffset(fr);
+ MASK_TYPE mask;
+ /* We must split this, because for num==0 the shift is undefined if you do it in one step. */
+ mask = ((MASK_UTYPE) getbits(fr, num))<<BITSHIFT;
+ mask <<= 8-num;
+ part2remain -= num;
+
+ /* Bitindex is zero now, we are allowed to use getbyte(). */
+
+ {
+ int bv = gr_info->big_values;
+ int region1 = gr_info->region1start;
+ int region2 = gr_info->region2start;
+ l3 = ((576>>1)-bv)>>1;
+
+ /* we may lose the 'odd' bit here !! check this later again */
+ if(bv <= region1)
+ {
+ l[0] = bv;
+ l[1] = 0;
+ l[2] = 0;
+ }
+ else
+ {
+ l[0] = region1;
+ if(bv <= region2)
+ {
+ l[1] = bv - l[0];
+ l[2] = 0;
+ }
+ else
+ {
+ l[1] = region2 - l[0];
+ l[2] = bv - region2;
+ }
+ }
+ }
+
+#define CHECK_XRPNT if(xrpnt >= &xr[SBLIMIT][0]) \
+{ \
+ if(NOQUIET) \
+ error2("attempted xrpnt overflow (%p !< %p)", (void*) xrpnt, (void*) &xr[SBLIMIT][0]); \
+ return 1; \
+}
+
+ if(gr_info->block_type == 2)
+ {
+ /* decoding with short or mixed mode BandIndex table */
+ int i,max[4];
+ int step=0,lwin=3,cb=0;
+ register real v = 0.0;
+ register int mc;
+ register const short *m;
+
+ if(gr_info->mixed_block_flag)
+ {
+ max[3] = -1;
+ max[0] = max[1] = max[2] = 2;
+ m = map[sfreq][0];
+ me = mapend[sfreq][0];
+ }
+ else
+ {
+ max[0] = max[1] = max[2] = max[3] = -1;
+ /* max[3] not really needed in this case */
+ m = map[sfreq][1];
+ me = mapend[sfreq][1];
+ }
+
+ mc = 0;
+ for(i=0;i<2;i++)
+ {
+ int lp = l[i];
+ const struct newhuff *h = ht+gr_info->table_select[i];
+ for(;lp;lp--,mc--)
+ {
+ register MASK_STYPE x,y;
+ if( (!mc) )
+ {
+ mc = *m++;
+//fprintf(stderr, "%i setting xrpnt = xr + %i (%ld)\n", __LINE__, *m, xrpnt-(real*)xr);
+ xrpnt = ((real *) xr) + (*m++);
+ lwin = *m++;
+ cb = *m++;
+ if(lwin == 3)
+ {
+#ifdef REAL_IS_FIXED
+ gainpow2_scale_idx = (int)(gr_info->pow2gain + (*scf << shift) - fr->gainpow2);
+#endif
+ v = gr_info->pow2gain[(*scf++) << shift];
+ step = 1;
+ }
+ else
+ {
+#ifdef REAL_IS_FIXED
+ gainpow2_scale_idx = (int)(gr_info->full_gain[lwin] + (*scf << shift) - fr->gainpow2);
+#endif
+ v = gr_info->full_gain[lwin][(*scf++) << shift];
+ step = 3;
+ }
+ }
+ {
+ const short *val = h->table;
+ REFRESH_MASK;
+#ifdef USE_NEW_HUFFTABLE
+ while((y=val[(MASK_UTYPE)mask>>(BITSHIFT+4)])<0)
+ {
+ val -= y;
+ num -= 4;
+ mask <<= 4;
+ }
+ num -= (y >> 8);
+ mask <<= (y >> 8);
+ x = (y >> 4) & 0xf;
+ y &= 0xf;
+#else
+ while((y=*val++)<0)
+ {
+ if (MSB_MASK) val -= y;
+
+ num--;
+ mask <<= 1;
+ }
+ x = y >> 4;
+ y &= 0xf;
+#endif
+ }
+ CHECK_XRPNT;
+ if(x == 15 && h->linbits)
+ {
+ max[lwin] = cb;
+ REFRESH_MASK;
+ x += ((MASK_UTYPE) mask) >> (BITSHIFT+8-h->linbits);
+ num -= h->linbits+1;
+ mask <<= h->linbits;
+ if(MSB_MASK) *xrpnt = REAL_MUL_SCALE_LAYER3(-ispow[x], v, gainpow2_scale_idx);
+ else *xrpnt = REAL_MUL_SCALE_LAYER3( ispow[x], v, gainpow2_scale_idx);
+
+ mask <<= 1;
+ }
+ else if(x)
+ {
+ max[lwin] = cb;
+ if(MSB_MASK) *xrpnt = REAL_MUL_SCALE_LAYER3(-ispow[x], v, gainpow2_scale_idx);
+ else *xrpnt = REAL_MUL_SCALE_LAYER3( ispow[x], v, gainpow2_scale_idx);
+
+ num--;
+ mask <<= 1;
+ }
+ else *xrpnt = DOUBLE_TO_REAL(0.0);
+
+ xrpnt += step;
+ CHECK_XRPNT;
+ if(y == 15 && h->linbits)
+ {
+ max[lwin] = cb;
+ REFRESH_MASK;
+ y += ((MASK_UTYPE) mask) >> (BITSHIFT+8-h->linbits);
+ num -= h->linbits+1;
+ mask <<= h->linbits;
+ if(MSB_MASK) *xrpnt = REAL_MUL_SCALE_LAYER3(-ispow[y], v, gainpow2_scale_idx);
+ else *xrpnt = REAL_MUL_SCALE_LAYER3( ispow[y], v, gainpow2_scale_idx);
+
+ mask <<= 1;
+ }
+ else if(y)
+ {
+ max[lwin] = cb;
+ if(MSB_MASK) *xrpnt = REAL_MUL_SCALE_LAYER3(-ispow[y], v, gainpow2_scale_idx);
+ else *xrpnt = REAL_MUL_SCALE_LAYER3( ispow[y], v, gainpow2_scale_idx);
+
+ num--;
+ mask <<= 1;
+ }
+ else *xrpnt = DOUBLE_TO_REAL(0.0);
+
+ xrpnt += step;
+ }
+ }
+
+ for(;l3 && (part2remain+num > 0);l3--)
+ {
+ const struct newhuff* h;
+ const short* val;
+ register short a;
+
+ h = htc+gr_info->count1table_select;
+ val = h->table;
+
+ REFRESH_MASK;
+ while((a=*val++)<0)
+ {
+ if(MSB_MASK) val -= a;
+
+ num--;
+ mask <<= 1;
+ }
+ if(part2remain+num <= 0)
+ {
+ num -= part2remain+num;
+ break;
+ }
+
+ for(i=0;i<4;i++)
+ {
+ if(!(i & 1))
+ {
+ if(!mc)
+ {
+ mc = *m++;
+//fprintf(stderr, "%i setting xrpnt = xr + %i (%ld)\n", __LINE__, *m, xrpnt-(real*)xr);
+ xrpnt = ((real *) xr) + (*m++);
+ lwin = *m++;
+ cb = *m++;
+ if(lwin == 3)
+ {
+#ifdef REAL_IS_FIXED
+ gainpow2_scale_idx = (int)(gr_info->pow2gain + (*scf << shift) - fr->gainpow2);
+#endif
+ v = gr_info->pow2gain[(*scf++) << shift];
+ step = 1;
+ }
+ else
+ {
+#ifdef REAL_IS_FIXED
+ gainpow2_scale_idx = (int)(gr_info->full_gain[lwin] + (*scf << shift) - fr->gainpow2);
+#endif
+ v = gr_info->full_gain[lwin][(*scf++) << shift];
+ step = 3;
+ }
+ }
+ mc--;
+ }
+ CHECK_XRPNT;
+ if( (a & (0x8>>i)) )
+ {
+ max[lwin] = cb;
+ if(part2remain+num <= 0)
+ break;
+
+ if(MSB_MASK) *xrpnt = -REAL_SCALE_LAYER3(v, gainpow2_scale_idx);
+ else *xrpnt = REAL_SCALE_LAYER3(v, gainpow2_scale_idx);
+
+ num--;
+ mask <<= 1;
+ }
+ else *xrpnt = DOUBLE_TO_REAL(0.0);
+
+ xrpnt += step;
+ }
+ }
+
+ if(lwin < 3)
+ { /* short band? */
+ while(1)
+ {
+ for(;mc > 0;mc--)
+ {
+ CHECK_XRPNT;
+ *xrpnt = DOUBLE_TO_REAL(0.0); xrpnt += 3; /* short band -> step=3 */
+ *xrpnt = DOUBLE_TO_REAL(0.0); xrpnt += 3;
+ }
+ if(m >= me)
+ break;
+
+ mc = *m++;
+ xrpnt = ((real *) xr) + *m++;
+ if(*m++ == 0)
+ break; /* optimize: field will be set to zero at the end of the function */
+
+ m++; /* cb */
+ }
+ }
+
+ gr_info->maxband[0] = max[0]+1;
+ gr_info->maxband[1] = max[1]+1;
+ gr_info->maxband[2] = max[2]+1;
+ gr_info->maxbandl = max[3]+1;
+
+ {
+ int rmax = max[0] > max[1] ? max[0] : max[1];
+ rmax = (rmax > max[2] ? rmax : max[2]) + 1;
+ gr_info->maxb = rmax ? fr->shortLimit[sfreq][rmax] : fr->longLimit[sfreq][max[3]+1];
+ }
+
+ }
+ else
+ {
+ /* decoding with 'long' BandIndex table (block_type != 2) */
+ const unsigned char *pretab = pretab_choice[gr_info->preflag];
+ int i,max = -1;
+ int cb = 0;
+ const short *m = map[sfreq][2];
+ register real v = 0.0;
+ int mc = 0;
+
+ /* long hash table values */
+ for(i=0;i<3;i++)
+ {
+ int lp = l[i];
+ const struct newhuff *h = ht+gr_info->table_select[i];
+
+ for(;lp;lp--,mc--)
+ {
+ MASK_STYPE x,y;
+ if(!mc)
+ {
+ mc = *m++;
+ cb = *m++;
+#ifdef CUT_SFB21
+ if(cb == 21)
+ v = 0.0;
+ else
+#endif
+ {
+#ifdef REAL_IS_FIXED
+ gainpow2_scale_idx = (int)(gr_info->pow2gain + (*scf << shift) - fr->gainpow2);
+#endif
+ v = gr_info->pow2gain[(*(scf++) + (*pretab++)) << shift];
+ }
+ }
+ {
+ const short *val = h->table;
+ REFRESH_MASK;
+#ifdef USE_NEW_HUFFTABLE
+ while((y=val[(MASK_UTYPE)mask>>(BITSHIFT+4)])<0)
+ {
+ val -= y;
+ num -= 4;
+ mask <<= 4;
+ }
+ num -= (y >> 8);
+ mask <<= (y >> 8);
+ x = (y >> 4) & 0xf;
+ y &= 0xf;
+#else
+ while((y=*val++)<0)
+ {
+ if (MSB_MASK) val -= y;
+
+ num--;
+ mask <<= 1;
+ }
+ x = y >> 4;
+ y &= 0xf;
+#endif
+ }
+
+ CHECK_XRPNT;
+ if(x == 15 && h->linbits)
+ {
+ max = cb;
+ REFRESH_MASK;
+ x += ((MASK_UTYPE) mask) >> (BITSHIFT+8-h->linbits);
+ num -= h->linbits+1;
+ mask <<= h->linbits;
+ if(MSB_MASK) *xrpnt++ = REAL_MUL_SCALE_LAYER3(-ispow[x], v, gainpow2_scale_idx);
+ else *xrpnt++ = REAL_MUL_SCALE_LAYER3( ispow[x], v, gainpow2_scale_idx);
+
+ mask <<= 1;
+ }
+ else if(x)
+ {
+ max = cb;
+ if(MSB_MASK) *xrpnt++ = REAL_MUL_SCALE_LAYER3(-ispow[x], v, gainpow2_scale_idx);
+ else *xrpnt++ = REAL_MUL_SCALE_LAYER3( ispow[x], v, gainpow2_scale_idx);
+ num--;
+
+ mask <<= 1;
+ }
+ else *xrpnt++ = DOUBLE_TO_REAL(0.0);
+
+ CHECK_XRPNT;
+ if(y == 15 && h->linbits)
+ {
+ max = cb;
+ REFRESH_MASK;
+ y += ((MASK_UTYPE) mask) >> (BITSHIFT+8-h->linbits);
+ num -= h->linbits+1;
+ mask <<= h->linbits;
+ if(MSB_MASK) *xrpnt++ = REAL_MUL_SCALE_LAYER3(-ispow[y], v, gainpow2_scale_idx);
+ else *xrpnt++ = REAL_MUL_SCALE_LAYER3( ispow[y], v, gainpow2_scale_idx);
+
+ mask <<= 1;
+ }
+ else if(y)
+ {
+ max = cb;
+ if(MSB_MASK) *xrpnt++ = REAL_MUL_SCALE_LAYER3(-ispow[y], v, gainpow2_scale_idx);
+ else *xrpnt++ = REAL_MUL_SCALE_LAYER3( ispow[y], v, gainpow2_scale_idx);
+
+ num--;
+ mask <<= 1;
+ }
+ else *xrpnt++ = DOUBLE_TO_REAL(0.0);
+ }
+ }
+
+ /* short (count1table) values */
+ for(;l3 && (part2remain+num > 0);l3--)
+ {
+ const struct newhuff *h = htc+gr_info->count1table_select;
+ const short *val = h->table;
+ register short a;
+
+ REFRESH_MASK;
+ while((a=*val++)<0)
+ {
+ if (MSB_MASK) val -= a;
+
+ num--;
+ mask <<= 1;
+ }
+ if(part2remain+num <= 0)
+ {
+ num -= part2remain+num;
+ break;
+ }
+
+ for(i=0;i<4;i++)
+ {
+ if(!(i & 1))
+ {
+ if(!mc)
+ {
+ mc = *m++;
+ cb = *m++;
+#ifdef CUT_SFB21
+ if(cb == 21)
+ v = 0.0;
+ else
+#endif
+ {
+#ifdef REAL_IS_FIXED
+ gainpow2_scale_idx = (int)(gr_info->pow2gain + (*scf << shift) - fr->gainpow2);
+#endif
+ v = gr_info->pow2gain[((*scf++) + (*pretab++)) << shift];
+ }
+ }
+ mc--;
+ }
+ CHECK_XRPNT;
+ if( (a & (0x8>>i)) )
+ {
+ max = cb;
+ if(part2remain+num <= 0)
+ break;
+
+ if(MSB_MASK) *xrpnt++ = -REAL_SCALE_LAYER3(v, gainpow2_scale_idx);
+ else *xrpnt++ = REAL_SCALE_LAYER3(v, gainpow2_scale_idx);
+
+ num--;
+ mask <<= 1;
+ }
+ else *xrpnt++ = DOUBLE_TO_REAL(0.0);
+ }
+ }
+
+ gr_info->maxbandl = max+1;
+ gr_info->maxb = fr->longLimit[sfreq][gr_info->maxbandl];
+ }
+
+ part2remain += num;
+ backbits(fr, num);
+ num = 0;
+
+ }
+ else
+ {
+ part2remain = 0;
+ /* Not entirely sure what good values are, must be > 0. */
+ gr_info->maxband[0] =
+ gr_info->maxband[1] =
+ gr_info->maxband[2] =
+ gr_info->maxbandl = 1; /* sfb=maxband[lwin]*3 + lwin - mixed_block_flag must be >= 0 */
+ gr_info->maxb = 1;
+ }
+
+ while(xrpnt < &xr[SBLIMIT][0])
+ *xrpnt++ = DOUBLE_TO_REAL(0.0);
+
+ while( part2remain > 16 )
+ {
+ skipbits(fr, 16); /* Dismiss stuffing Bits */
+ part2remain -= 16;
+ }
+ if(part2remain > 0) skipbits(fr, part2remain);
+ else if(part2remain < 0)
+ {
+ if(VERBOSE2)
+ error1("Can't rewind stream by %d bits!",-part2remain);
+ return 1; /* -> error */
+ }
+ return 0;
+}
+
+
+/* calculate real channel values for Joint-I-Stereo-mode */
+static void III_i_stereo(real xr_buf[2][SBLIMIT][SSLIMIT],int *scalefac, struct gr_info_s *gr_info,int sfreq,int ms_stereo,int lsf)
+{
+ real (*xr)[SBLIMIT*SSLIMIT] = (real (*)[SBLIMIT*SSLIMIT] ) xr_buf;
+ const struct bandInfoStruct *bi = &bandInfo[sfreq];
+
+ const real *tab1,*tab2;
+
+#if 1
+ int tab;
+/* TODO: optimize as static */
+ const real *tabs[3][2][2] =
+ {
+ { { tan1_1,tan2_1 } , { tan1_2,tan2_2 } },
+ { { pow1_1[0],pow2_1[0] } , { pow1_2[0],pow2_2[0] } },
+ { { pow1_1[1],pow2_1[1] } , { pow1_2[1],pow2_2[1] } }
+ };
+
+ tab = lsf + (gr_info->scalefac_compress & lsf);
+ tab1 = tabs[tab][ms_stereo][0];
+ tab2 = tabs[tab][ms_stereo][1];
+#else
+ if(lsf)
+ {
+ int p = gr_info->scalefac_compress & 0x1;
+ if(ms_stereo)
+ {
+ tab1 = pow1_2[p];
+ tab2 = pow2_2[p];
+ }
+ else
+ {
+ tab1 = pow1_1[p];
+ tab2 = pow2_1[p];
+ }
+ }
+ else
+ {
+ if(ms_stereo)
+ {
+ tab1 = tan1_2;
+ tab2 = tan2_2;
+ }
+ else
+ {
+ tab1 = tan1_1;
+ tab2 = tan2_1;
+ }
+ }
+#endif
+
+ if(gr_info->block_type == 2)
+ {
+ int lwin,do_l = 0;
+ if( gr_info->mixed_block_flag ) do_l = 1;
+
+ for(lwin=0;lwin<3;lwin++)
+ { /* process each window */
+ /* get first band with zero values */
+ int is_p,sb,idx,sfb = gr_info->maxband[lwin]; /* sfb is minimal 3 for mixed mode */
+ if(sfb > 3) do_l = 0;
+
+ for(;sfb<12;sfb++)
+ {
+ is_p = scalefac[sfb*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */
+ if(is_p != 7)
+ {
+ real t1,t2;
+ sb = bi->shortDiff[sfb];
+ idx = bi->shortIdx[sfb] + lwin;
+ t1 = tab1[is_p]; t2 = tab2[is_p];
+ for (; sb > 0; sb--,idx+=3)
+ {
+ real v = xr[0][idx];
+ xr[0][idx] = REAL_MUL_15(v, t1);
+ xr[1][idx] = REAL_MUL_15(v, t2);
+ }
+ }
+ }
+
+#if 1
+/* in the original: copy 10 to 11 , here: copy 11 to 12
+maybe still wrong??? (copy 12 to 13?) */
+ is_p = scalefac[11*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */
+ sb = bi->shortDiff[12];
+ idx = bi->shortIdx[12] + lwin;
+#else
+ is_p = scalefac[10*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */
+ sb = bi->shortDiff[11];
+ idx = bi->shortIdx[11] + lwin;
+#endif
+ if(is_p != 7)
+ {
+ real t1,t2;
+ t1 = tab1[is_p]; t2 = tab2[is_p];
+ for( ; sb > 0; sb--,idx+=3 )
+ {
+ real v = xr[0][idx];
+ xr[0][idx] = REAL_MUL_15(v, t1);
+ xr[1][idx] = REAL_MUL_15(v, t2);
+ }
+ }
+ } /* end for(lwin; .. ; . ) */
+
+ /* also check l-part, if ALL bands in the three windows are 'empty' and mode = mixed_mode */
+ if(do_l)
+ {
+ int sfb = gr_info->maxbandl;
+ int idx;
+ if(sfb > 21) return; /* similarity fix related to CVE-2006-1655 */
+
+ idx = bi->longIdx[sfb];
+ for( ; sfb<8; sfb++ )
+ {
+ int sb = bi->longDiff[sfb];
+ int is_p = scalefac[sfb]; /* scale: 0-15 */
+ if(is_p != 7)
+ {
+ real t1,t2;
+ t1 = tab1[is_p]; t2 = tab2[is_p];
+ for( ; sb > 0; sb--,idx++)
+ {
+ real v = xr[0][idx];
+ xr[0][idx] = REAL_MUL_15(v, t1);
+ xr[1][idx] = REAL_MUL_15(v, t2);
+ }
+ }
+ else idx += sb;
+ }
+ }
+ }
+ else
+ { /* ((gr_info->block_type != 2)) */
+ int sfb = gr_info->maxbandl;
+ int is_p,idx;
+ if(sfb > 21) return; /* tightened fix for CVE-2006-1655 */
+
+ idx = bi->longIdx[sfb];
+ for ( ; sfb<21; sfb++)
+ {
+ int sb = bi->longDiff[sfb];
+ is_p = scalefac[sfb]; /* scale: 0-15 */
+ if(is_p != 7)
+ {
+ real t1,t2;
+ t1 = tab1[is_p]; t2 = tab2[is_p];
+ for( ; sb > 0; sb--,idx++)
+ {
+ real v = xr[0][idx];
+ xr[0][idx] = REAL_MUL_15(v, t1);
+ xr[1][idx] = REAL_MUL_15(v, t2);
+ }
+ }
+ else idx += sb;
+ }
+
+ is_p = scalefac[20];
+ if(is_p != 7)
+ { /* copy l-band 20 to l-band 21 */
+ int sb;
+ real t1 = tab1[is_p],t2 = tab2[is_p];
+
+ for( sb = bi->longDiff[21]; sb > 0; sb--,idx++ )
+ {
+ real v = xr[0][idx];
+ xr[0][idx] = REAL_MUL_15(v, t1);
+ xr[1][idx] = REAL_MUL_15(v, t2);
+ }
+ }
+ }
+}
+
+
+static void III_antialias(real xr[SBLIMIT][SSLIMIT],struct gr_info_s *gr_info)
+{
+ int sblim;
+
+ if(gr_info->block_type == 2)
+ {
+ if(!gr_info->mixed_block_flag) return;
+
+ sblim = 1;
+ }
+ else sblim = gr_info->maxb-1;
+
+ /* 31 alias-reduction operations between each pair of sub-bands */
+ /* with 8 butterflies between each pair */
+
+ {
+ int sb;
+ real *xr1=(real *) xr[1];
+
+ for(sb=sblim; sb; sb--,xr1+=10)
+ {
+ int ss;
+ const real *cs=aa_cs,*ca=aa_ca;
+ real *xr2 = xr1;
+
+ for(ss=7;ss>=0;ss--)
+ { /* upper and lower butterfly inputs */
+ register real bu = *--xr2,bd = *xr1;
+ *xr2 = REAL_MUL(bu, *cs) - REAL_MUL(bd, *ca);
+ *xr1++ = REAL_MUL(bd, *cs++) + REAL_MUL(bu, *ca++);
+ }
+ }
+ }
+}
+
+/*
+ This is an optimized DCT from Jeff Tsay's maplay 1.2+ package.
+ Saved one multiplication by doing the 'twiddle factor' stuff
+ together with the window mul. (MH)
+
+ This uses Byeong Gi Lee's Fast Cosine Transform algorithm, but the
+ 9 point IDCT needs to be reduced further. Unfortunately, I don't
+ know how to do that, because 9 is not an even number. - Jeff.
+
+ Original Message:
+
+ 9 Point Inverse Discrete Cosine Transform
+
+ This piece of code is Copyright 1997 Mikko Tommila and is freely usable
+ by anybody. The algorithm itself is of course in the public domain.
+
+ Again derived heuristically from the 9-point WFTA.
+
+ The algorithm is optimized (?) for speed, not for small rounding errors or
+ good readability.
+
+ 36 additions, 11 multiplications
+
+ Again this is very likely sub-optimal.
+
+ The code is optimized to use a minimum number of temporary variables,
+ so it should compile quite well even on 8-register Intel x86 processors.
+ This makes the code quite obfuscated and very difficult to understand.
+
+ References:
+ [1] S. Winograd: "On Computing the Discrete Fourier Transform",
+ Mathematics of Computation, Volume 32, Number 141, January 1978,
+ Pages 175-199
+*/
+
+/* Calculation of the inverse MDCT
+ used to be static without 3dnow - does that really matter? */
+void dct36(real *inbuf,real *o1,real *o2,const real *wintab,real *tsbuf)
+{
+ real tmp[18];
+
+ {
+ register real *in = inbuf;
+
+ in[17]+=in[16]; in[16]+=in[15]; in[15]+=in[14];
+ in[14]+=in[13]; in[13]+=in[12]; in[12]+=in[11];
+ in[11]+=in[10]; in[10]+=in[9]; in[9] +=in[8];
+ in[8] +=in[7]; in[7] +=in[6]; in[6] +=in[5];
+ in[5] +=in[4]; in[4] +=in[3]; in[3] +=in[2];
+ in[2] +=in[1]; in[1] +=in[0];
+
+ in[17]+=in[15]; in[15]+=in[13]; in[13]+=in[11]; in[11]+=in[9];
+ in[9] +=in[7]; in[7] +=in[5]; in[5] +=in[3]; in[3] +=in[1];
+
+#if 1
+ {
+ real t3;
+ {
+ real t0, t1, t2;
+
+ t0 = REAL_MUL(COS6_2, (in[8] + in[16] - in[4]));
+ t1 = REAL_MUL(COS6_2, in[12]);
+
+ t3 = in[0];
+ t2 = t3 - t1 - t1;
+ tmp[1] = tmp[7] = t2 - t0;
+ tmp[4] = t2 + t0 + t0;
+ t3 += t1;
+
+ t2 = REAL_MUL(COS6_1, (in[10] + in[14] - in[2]));
+ tmp[1] -= t2;
+ tmp[7] += t2;
+ }
+ {
+ real t0, t1, t2;
+
+ t0 = REAL_MUL(cos9[0], (in[4] + in[8] ));
+ t1 = REAL_MUL(cos9[1], (in[8] - in[16]));
+ t2 = REAL_MUL(cos9[2], (in[4] + in[16]));
+
+ tmp[2] = tmp[6] = t3 - t0 - t2;
+ tmp[0] = tmp[8] = t3 + t0 + t1;
+ tmp[3] = tmp[5] = t3 - t1 + t2;
+ }
+ }
+ {
+ real t1, t2, t3;
+
+ t1 = REAL_MUL(cos18[0], (in[2] + in[10]));
+ t2 = REAL_MUL(cos18[1], (in[10] - in[14]));
+ t3 = REAL_MUL(COS6_1, in[6]);
+
+ {
+ real t0 = t1 + t2 + t3;
+ tmp[0] += t0;
+ tmp[8] -= t0;
+ }
+
+ t2 -= t3;
+ t1 -= t3;
+
+ t3 = REAL_MUL(cos18[2], (in[2] + in[14]));
+
+ t1 += t3;
+ tmp[3] += t1;
+ tmp[5] -= t1;
+
+ t2 -= t3;
+ tmp[2] += t2;
+ tmp[6] -= t2;
+ }
+
+#else
+ {
+ real t0, t1, t2, t3, t4, t5, t6, t7;
+
+ t1 = REAL_MUL(COS6_2, in[12]);
+ t2 = REAL_MUL(COS6_2, (in[8] + in[16] - in[4]));
+
+ t3 = in[0] + t1;
+ t4 = in[0] - t1 - t1;
+ t5 = t4 - t2;
+ tmp[4] = t4 + t2 + t2;
+
+ t0 = REAL_MUL(cos9[0], (in[4] + in[8]));
+ t1 = REAL_MUL(cos9[1], (in[8] - in[16]));
+
+ t2 = REAL_MUL(cos9[2], (in[4] + in[16]));
+
+ t6 = t3 - t0 - t2;
+ t0 += t3 + t1;
+ t3 += t2 - t1;
+
+ t2 = REAL_MUL(cos18[0], (in[2] + in[10]));
+ t4 = REAL_MUL(cos18[1], (in[10] - in[14]));
+ t7 = REAL_MUL(COS6_1, in[6]);
+
+ t1 = t2 + t4 + t7;
+ tmp[0] = t0 + t1;
+ tmp[8] = t0 - t1;
+ t1 = REAL_MUL(cos18[2], (in[2] + in[14]));
+ t2 += t1 - t7;
+
+ tmp[3] = t3 + t2;
+ t0 = REAL_MUL(COS6_1, (in[10] + in[14] - in[2]));
+ tmp[5] = t3 - t2;
+
+ t4 -= t1 + t7;
+
+ tmp[1] = t5 - t0;
+ tmp[7] = t5 + t0;
+ tmp[2] = t6 + t4;
+ tmp[6] = t6 - t4;
+ }
+#endif
+
+ {
+ real t0, t1, t2, t3, t4, t5, t6, t7;
+
+ t1 = REAL_MUL(COS6_2, in[13]);
+ t2 = REAL_MUL(COS6_2, (in[9] + in[17] - in[5]));
+
+ t3 = in[1] + t1;
+ t4 = in[1] - t1 - t1;
+ t5 = t4 - t2;
+
+ t0 = REAL_MUL(cos9[0], (in[5] + in[9]));
+ t1 = REAL_MUL(cos9[1], (in[9] - in[17]));
+
+ tmp[13] = REAL_MUL((t4 + t2 + t2), tfcos36[17-13]);
+ t2 = REAL_MUL(cos9[2], (in[5] + in[17]));
+
+ t6 = t3 - t0 - t2;
+ t0 += t3 + t1;
+ t3 += t2 - t1;
+
+ t2 = REAL_MUL(cos18[0], (in[3] + in[11]));
+ t4 = REAL_MUL(cos18[1], (in[11] - in[15]));
+ t7 = REAL_MUL(COS6_1, in[7]);
+
+ t1 = t2 + t4 + t7;
+ tmp[17] = REAL_MUL((t0 + t1), tfcos36[17-17]);
+ tmp[9] = REAL_MUL((t0 - t1), tfcos36[17-9]);
+ t1 = REAL_MUL(cos18[2], (in[3] + in[15]));
+ t2 += t1 - t7;
+
+ tmp[14] = REAL_MUL((t3 + t2), tfcos36[17-14]);
+ t0 = REAL_MUL(COS6_1, (in[11] + in[15] - in[3]));
+ tmp[12] = REAL_MUL((t3 - t2), tfcos36[17-12]);
+
+ t4 -= t1 + t7;
+
+ tmp[16] = REAL_MUL((t5 - t0), tfcos36[17-16]);
+ tmp[10] = REAL_MUL((t5 + t0), tfcos36[17-10]);
+ tmp[15] = REAL_MUL((t6 + t4), tfcos36[17-15]);
+ tmp[11] = REAL_MUL((t6 - t4), tfcos36[17-11]);
+ }
+
+#define MACRO(v) { \
+ real tmpval; \
+ tmpval = tmp[(v)] + tmp[17-(v)]; \
+ out2[9+(v)] = REAL_MUL(tmpval, w[27+(v)]); \
+ out2[8-(v)] = REAL_MUL(tmpval, w[26-(v)]); \
+ tmpval = tmp[(v)] - tmp[17-(v)]; \
+ ts[SBLIMIT*(8-(v))] = out1[8-(v)] + REAL_MUL(tmpval, w[8-(v)]); \
+ ts[SBLIMIT*(9+(v))] = out1[9+(v)] + REAL_MUL(tmpval, w[9+(v)]); }
+
+ {
+ register real *out2 = o2;
+ register const real *w = wintab;
+ register real *out1 = o1;
+ register real *ts = tsbuf;
+
+ MACRO(0);
+ MACRO(1);
+ MACRO(2);
+ MACRO(3);
+ MACRO(4);
+ MACRO(5);
+ MACRO(6);
+ MACRO(7);
+ MACRO(8);
+ }
+
+ }
+}
+
+
+/* new DCT12 */
+static void dct12(real *in,real *rawout1,real *rawout2,register const real *wi,register real *ts)
+{
+#define DCT12_PART1 \
+ in5 = in[5*3]; \
+ in5 += (in4 = in[4*3]); \
+ in4 += (in3 = in[3*3]); \
+ in3 += (in2 = in[2*3]); \
+ in2 += (in1 = in[1*3]); \
+ in1 += (in0 = in[0*3]); \
+ \
+ in5 += in3; in3 += in1; \
+ \
+ in2 = REAL_MUL(in2, COS6_1); \
+ in3 = REAL_MUL(in3, COS6_1);
+
+#define DCT12_PART2 \
+ in0 += REAL_MUL(in4, COS6_2); \
+ \
+ in4 = in0 + in2; \
+ in0 -= in2; \
+ \
+ in1 += REAL_MUL(in5, COS6_2); \
+ \
+ in5 = REAL_MUL((in1 + in3), tfcos12[0]); \
+ in1 = REAL_MUL((in1 - in3), tfcos12[2]); \
+ \
+ in3 = in4 + in5; \
+ in4 -= in5; \
+ \
+ in2 = in0 + in1; \
+ in0 -= in1;
+
+ {
+ real in0,in1,in2,in3,in4,in5;
+ register real *out1 = rawout1;
+ ts[SBLIMIT*0] = out1[0]; ts[SBLIMIT*1] = out1[1]; ts[SBLIMIT*2] = out1[2];
+ ts[SBLIMIT*3] = out1[3]; ts[SBLIMIT*4] = out1[4]; ts[SBLIMIT*5] = out1[5];
+
+ DCT12_PART1
+
+ {
+ real tmp0,tmp1 = (in0 - in4);
+ {
+ real tmp2 = REAL_MUL((in1 - in5), tfcos12[1]);
+ tmp0 = tmp1 + tmp2;
+ tmp1 -= tmp2;
+ }
+ ts[(17-1)*SBLIMIT] = out1[17-1] + REAL_MUL(tmp0, wi[11-1]);
+ ts[(12+1)*SBLIMIT] = out1[12+1] + REAL_MUL(tmp0, wi[6+1]);
+ ts[(6 +1)*SBLIMIT] = out1[6 +1] + REAL_MUL(tmp1, wi[1]);
+ ts[(11-1)*SBLIMIT] = out1[11-1] + REAL_MUL(tmp1, wi[5-1]);
+ }
+
+ DCT12_PART2
+
+ ts[(17-0)*SBLIMIT] = out1[17-0] + REAL_MUL(in2, wi[11-0]);
+ ts[(12+0)*SBLIMIT] = out1[12+0] + REAL_MUL(in2, wi[6+0]);
+ ts[(12+2)*SBLIMIT] = out1[12+2] + REAL_MUL(in3, wi[6+2]);
+ ts[(17-2)*SBLIMIT] = out1[17-2] + REAL_MUL(in3, wi[11-2]);
+
+ ts[(6 +0)*SBLIMIT] = out1[6+0] + REAL_MUL(in0, wi[0]);
+ ts[(11-0)*SBLIMIT] = out1[11-0] + REAL_MUL(in0, wi[5-0]);
+ ts[(6 +2)*SBLIMIT] = out1[6+2] + REAL_MUL(in4, wi[2]);
+ ts[(11-2)*SBLIMIT] = out1[11-2] + REAL_MUL(in4, wi[5-2]);
+ }
+
+ in++;
+
+ {
+ real in0,in1,in2,in3,in4,in5;
+ register real *out2 = rawout2;
+
+ DCT12_PART1
+
+ {
+ real tmp0,tmp1 = (in0 - in4);
+ {
+ real tmp2 = REAL_MUL((in1 - in5), tfcos12[1]);
+ tmp0 = tmp1 + tmp2;
+ tmp1 -= tmp2;
+ }
+ out2[5-1] = REAL_MUL(tmp0, wi[11-1]);
+ out2[0+1] = REAL_MUL(tmp0, wi[6+1]);
+ ts[(12+1)*SBLIMIT] += REAL_MUL(tmp1, wi[1]);
+ ts[(17-1)*SBLIMIT] += REAL_MUL(tmp1, wi[5-1]);
+ }
+
+ DCT12_PART2
+
+ out2[5-0] = REAL_MUL(in2, wi[11-0]);
+ out2[0+0] = REAL_MUL(in2, wi[6+0]);
+ out2[0+2] = REAL_MUL(in3, wi[6+2]);
+ out2[5-2] = REAL_MUL(in3, wi[11-2]);
+
+ ts[(12+0)*SBLIMIT] += REAL_MUL(in0, wi[0]);
+ ts[(17-0)*SBLIMIT] += REAL_MUL(in0, wi[5-0]);
+ ts[(12+2)*SBLIMIT] += REAL_MUL(in4, wi[2]);
+ ts[(17-2)*SBLIMIT] += REAL_MUL(in4, wi[5-2]);
+ }
+
+ in++;
+
+ {
+ real in0,in1,in2,in3,in4,in5;
+ register real *out2 = rawout2;
+ out2[12]=out2[13]=out2[14]=out2[15]=out2[16]=out2[17]=0.0;
+
+ DCT12_PART1
+
+ {
+ real tmp0,tmp1 = (in0 - in4);
+ {
+ real tmp2 = REAL_MUL((in1 - in5), tfcos12[1]);
+ tmp0 = tmp1 + tmp2;
+ tmp1 -= tmp2;
+ }
+ out2[11-1] = REAL_MUL(tmp0, wi[11-1]);
+ out2[6 +1] = REAL_MUL(tmp0, wi[6+1]);
+ out2[0+1] += REAL_MUL(tmp1, wi[1]);
+ out2[5-1] += REAL_MUL(tmp1, wi[5-1]);
+ }
+
+ DCT12_PART2
+
+ out2[11-0] = REAL_MUL(in2, wi[11-0]);
+ out2[6 +0] = REAL_MUL(in2, wi[6+0]);
+ out2[6 +2] = REAL_MUL(in3, wi[6+2]);
+ out2[11-2] = REAL_MUL(in3, wi[11-2]);
+
+ out2[0+0] += REAL_MUL(in0, wi[0]);
+ out2[5-0] += REAL_MUL(in0, wi[5-0]);
+ out2[0+2] += REAL_MUL(in4, wi[2]);
+ out2[5-2] += REAL_MUL(in4, wi[5-2]);
+ }
+}
+
+
+static void III_hybrid(real fsIn[SBLIMIT][SSLIMIT], real tsOut[SSLIMIT][SBLIMIT], int ch,struct gr_info_s *gr_info, mpg123_handle *fr)
+{
+ real (*block)[2][SBLIMIT*SSLIMIT] = fr->hybrid_block;
+ int *blc = fr->hybrid_blc;
+
+ real *tspnt = (real *) tsOut;
+ real *rawout1,*rawout2;
+ int bt = 0;
+ size_t sb = 0;
+
+ {
+ int b = blc[ch];
+ rawout1=block[b][ch];
+ b=-b+1;
+ rawout2=block[b][ch];
+ blc[ch] = b;
+ }
+
+ if(gr_info->mixed_block_flag)
+ {
+ sb = 2;
+ opt_dct36(fr)(fsIn[0],rawout1,rawout2,win[0],tspnt);
+ opt_dct36(fr)(fsIn[1],rawout1+18,rawout2+18,win1[0],tspnt+1);
+ rawout1 += 36; rawout2 += 36; tspnt += 2;
+ }
+
+ bt = gr_info->block_type;
+ if(bt == 2)
+ {
+ for(; sb<gr_info->maxb; sb+=2,tspnt+=2,rawout1+=36,rawout2+=36)
+ {
+ dct12(fsIn[sb] ,rawout1 ,rawout2 ,win[2] ,tspnt);
+ dct12(fsIn[sb+1],rawout1+18,rawout2+18,win1[2],tspnt+1);
+ }
+ }
+ else
+ {
+ for(; sb<gr_info->maxb; sb+=2,tspnt+=2,rawout1+=36,rawout2+=36)
+ {
+ opt_dct36(fr)(fsIn[sb],rawout1,rawout2,win[bt],tspnt);
+ opt_dct36(fr)(fsIn[sb+1],rawout1+18,rawout2+18,win1[bt],tspnt+1);
+ }
+ }
+
+ for(;sb<SBLIMIT;sb++,tspnt++)
+ {
+ int i;
+ for(i=0;i<SSLIMIT;i++)
+ {
+ tspnt[i*SBLIMIT] = *rawout1++;
+ *rawout2++ = DOUBLE_TO_REAL(0.0);
+ }
+ }
+}
+
+#ifndef NO_MOREINFO
+static void fill_pinfo_side(mpg123_handle *fr, struct III_sideinfo *si, int gr, int stereo1)
+{
+ int i, sb;
+ float ifqstep; /* Why not double? */
+ int ch, ss;;
+
+ for(ch = 0; ch < stereo1; ++ch)
+ {
+ struct gr_info_s *gr_infos = &(si->ch[ch].gr[gr]);
+ fr->pinfo->big_values[gr][ch] = gr_infos->big_values;
+ fr->pinfo->scalefac_scale[gr][ch] = gr_infos->scalefac_scale;
+ fr->pinfo->mixed[gr][ch] = gr_infos->mixed_block_flag;
+ fr->pinfo->blocktype[gr][ch] = gr_infos->block_type;
+ fr->pinfo->mainbits[gr][ch] = gr_infos->part2_3_length;
+ fr->pinfo->preflag[gr][ch] = gr_infos->preflag;
+ if(gr == 1)
+ fr->pinfo->scfsi[ch] = gr_infos->scfsi;
+ }
+
+ for(ch = 0; ch < stereo1; ++ch)
+ {
+ struct gr_info_s *gr_infos = &(si->ch[ch].gr[gr]);
+ ifqstep = (fr->pinfo->scalefac_scale[gr][ch] == 0) ? .5 : 1.0;
+ if(2 == gr_infos->block_type)
+ {
+ for(i = 0; i < 3; ++i)
+ {
+ for(sb = 0; sb < 12; ++sb)
+ {
+ int j = 3 * sb + i;
+ /*
+ is_p = scalefac[sfb*3+lwin-gr_infos->mixed_block_flag];
+ */
+ /* scalefac was copied into pinfo->sfb_s[] before */
+ fr->pinfo->sfb_s[gr][ch][j] = -ifqstep *
+ fr->pinfo->sfb_s[gr][ch][j - gr_infos->mixed_block_flag];
+ fr->pinfo->sfb_s[gr][ch][j] -= 2 *
+ (fr->pinfo->sub_gain[gr][ch][i]);
+ }
+ fr->pinfo->sfb_s[gr][ch][3 * sb + i] =
+ -2 * (fr->pinfo->sub_gain[gr][ch][i]);
+ }
+ } else
+ {
+ for(sb = 0; sb < 21; ++sb)
+ {
+ /* scalefac was copied into pinfo->sfb[] before */
+ fr->pinfo->sfb[gr][ch][sb] = fr->pinfo->sfb_s[gr][ch][sb];
+ if (gr_infos->preflag)
+ fr->pinfo->sfb[gr][ch][sb] += pretab_choice[1][sb];
+ fr->pinfo->sfb[gr][ch][sb] *= -ifqstep;
+ }
+ fr->pinfo->sfb[gr][ch][21] = 0;
+ }
+ }
+
+
+ for(ch = 0; ch < stereo1; ++ch)
+ {
+ int j = 0;
+ for(sb = 0; sb < SBLIMIT; ++sb)
+ for (ss = 0; ss < SSLIMIT; ++ss, ++j)
+ fr->pinfo->xr[gr][ch][j] = fr->layer3.hybrid_in[ch][sb][ss];
+ }
+}
+#endif
+
+/* And at the end... the main layer3 handler */
+int do_layer3(mpg123_handle *fr)
+{
+ int gr, ch, ss,clip=0;
+ int scalefacs[2][39]; /* max 39 for short[13][3] mode, mixed: 38, long: 22 */
+ struct III_sideinfo sideinfo;
+ int stereo = fr->stereo;
+ int single = fr->single;
+ int ms_stereo,i_stereo;
+ int sfreq = fr->sampling_frequency;
+ int stereo1,granules;
+
+ if(stereo == 1)
+ { /* stream is mono */
+ stereo1 = 1;
+ single = SINGLE_LEFT;
+ }
+ else if(single != SINGLE_STEREO) /* stream is stereo, but force to mono */
+ stereo1 = 1;
+ else
+ stereo1 = 2;
+
+ if(fr->mode == MPG_MD_JOINT_STEREO)
+ {
+ ms_stereo = (fr->mode_ext & 0x2)>>1;
+ i_stereo = fr->mode_ext & 0x1;
+ }
+ else ms_stereo = i_stereo = 0;
+
+ granules = fr->lsf ? 1 : 2;
+
+ /* quick hack to keep the music playing */
+ /* after having seen this nasty test file... */
+ if(III_get_side_info(fr, &sideinfo,stereo,ms_stereo,sfreq,single))
+ {
+ if(NOQUIET) error("bad frame - unable to get valid sideinfo");
+ return clip;
+ }
+
+ set_pointer(fr, 1, sideinfo.main_data_begin);
+#ifndef NO_MOREINFO
+ if(fr->pinfo)
+ {
+ fr->pinfo->maindata = sideinfo.main_data_begin;
+ fr->pinfo->padding = fr->padding;
+ }
+#endif
+ for(gr=0;gr<granules;gr++)
+ {
+ /* hybridIn[2][SBLIMIT][SSLIMIT] */
+ real (*hybridIn)[SBLIMIT][SSLIMIT] = fr->layer3.hybrid_in;
+ /* hybridOut[2][SSLIMIT][SBLIMIT] */
+ real (*hybridOut)[SSLIMIT][SBLIMIT] = fr->layer3.hybrid_out;
+
+ {
+ struct gr_info_s *gr_info = &(sideinfo.ch[0].gr[gr]);
+ long part2bits;
+ if(gr_info->part2_3_length > fr->bits_avail)
+ {
+ if(NOQUIET)
+ error2(
+ "part2_3_length (%u) too large for available bit count (%li)"
+ , gr_info->part2_3_length, fr->bits_avail );
+ return clip;
+ }
+ if(fr->lsf)
+ part2bits = III_get_scale_factors_2(fr, scalefacs[0],gr_info,0);
+ else
+ part2bits = III_get_scale_factors_1(fr, scalefacs[0],gr_info,0,gr);
+
+ if(part2bits < 0)
+ {
+ if(VERBOSE2)
+ error("not enough bits for scale factors");
+ return clip;
+ }
+
+#ifndef NO_MOREINFO
+ if(fr->pinfo)
+ {
+ int i;
+ fr->pinfo->sfbits[gr][0] = part2bits;
+ for(i=0; i<39; ++i)
+ fr->pinfo->sfb_s[gr][0][i] = scalefacs[0][i];
+ }
+#endif
+
+ if(III_dequantize_sample(fr, hybridIn[0], scalefacs[0],gr_info,sfreq,part2bits))
+ {
+ if(NOQUIET)
+ error("dequantization failed!");
+ return clip;
+ }
+ if(fr->bits_avail < 0)
+ {
+ if(NOQUIET)
+ error("bit deficit after dequant");
+ return clip;
+ }
+ }
+
+ if(stereo == 2)
+ {
+ struct gr_info_s *gr_info = &(sideinfo.ch[1].gr[gr]);
+ long part2bits;
+ if(fr->lsf)
+ part2bits = III_get_scale_factors_2(fr, scalefacs[1],gr_info,i_stereo);
+ else
+ part2bits = III_get_scale_factors_1(fr, scalefacs[1],gr_info,1,gr);
+
+ if(part2bits < 0)
+ {
+ if(VERBOSE2)
+ error("not enough bits for scale factors");
+ return clip;
+ }
+
+#ifndef NO_MOREINFO
+ if(fr->pinfo)
+ {
+ int i;
+ fr->pinfo->sfbits[gr][1] = part2bits;
+ for(i=0; i<39; ++i)
+ fr->pinfo->sfb_s[gr][1][i] = scalefacs[1][i];
+ }
+#endif
+
+ if(III_dequantize_sample(fr, hybridIn[1],scalefacs[1],gr_info,sfreq,part2bits))
+ {
+ if(NOQUIET)
+ error("dequantization failed!");
+ return clip;
+ }
+ if(fr->bits_avail < 0)
+ {
+ if(NOQUIET)
+ error("bit deficit after dequant");
+ return clip;
+ }
+
+ if(ms_stereo)
+ {
+ int i;
+ unsigned int maxb = sideinfo.ch[0].gr[gr].maxb;
+ if(sideinfo.ch[1].gr[gr].maxb > maxb) maxb = sideinfo.ch[1].gr[gr].maxb;
+
+ for(i=0;i<SSLIMIT*(int)maxb;i++)
+ {
+ real tmp0 = ((real *)hybridIn[0])[i];
+ real tmp1 = ((real *)hybridIn[1])[i];
+ ((real *)hybridIn[0])[i] = tmp0 + tmp1;
+ ((real *)hybridIn[1])[i] = tmp0 - tmp1;
+ }
+ }
+
+ if(i_stereo) III_i_stereo(hybridIn,scalefacs[1],gr_info,sfreq,ms_stereo,fr->lsf);
+
+ if(ms_stereo || i_stereo || (single == SINGLE_MIX) )
+ {
+ if(gr_info->maxb > sideinfo.ch[0].gr[gr].maxb)
+ sideinfo.ch[0].gr[gr].maxb = gr_info->maxb;
+ else
+ gr_info->maxb = sideinfo.ch[0].gr[gr].maxb;
+ }
+
+ switch(single)
+ {
+ case SINGLE_MIX:
+ {
+ register int i;
+ register real *in0 = (real *) hybridIn[0],*in1 = (real *) hybridIn[1];
+ for(i=0;i<SSLIMIT*(int)gr_info->maxb;i++,in0++)
+ *in0 = (*in0 + *in1++); /* *0.5 done by pow-scale */
+ }
+ break;
+ case SINGLE_RIGHT:
+ {
+ register int i;
+ register real *in0 = (real *) hybridIn[0],*in1 = (real *) hybridIn[1];
+ for(i=0;i<SSLIMIT*(int)gr_info->maxb;i++)
+ *in0++ = *in1++;
+ }
+ break;
+ }
+ }
+
+#ifndef NO_MOREINFO
+ if(fr->pinfo)
+ fill_pinfo_side(fr, &sideinfo, gr, stereo1);
+#endif
+
+ for(ch=0;ch<stereo1;ch++)
+ {
+ struct gr_info_s *gr_info = &(sideinfo.ch[ch].gr[gr]);
+ III_antialias(hybridIn[ch],gr_info);
+ III_hybrid(hybridIn[ch], hybridOut[ch], ch,gr_info, fr);
+ }
+
+#ifdef OPT_I486
+ if(single != SINGLE_STEREO || fr->af.encoding != MPG123_ENC_SIGNED_16 || fr->down_sample != 0)
+ {
+#endif
+ for(ss=0;ss<SSLIMIT;ss++)
+ {
+ if(single != SINGLE_STEREO)
+ clip += (fr->synth_mono)(hybridOut[0][ss], fr);
+ else
+ clip += (fr->synth_stereo)(hybridOut[0][ss], hybridOut[1][ss], fr);
+
+ }
+#ifdef OPT_I486
+ } else
+ {
+ /* Only stereo, 16 bits benefit from the 486 optimization. */
+ ss=0;
+ while(ss < SSLIMIT)
+ {
+ int n;
+ n=(fr->buffer.size - fr->buffer.fill) / (2*2*32);
+ if(n > (SSLIMIT-ss)) n=SSLIMIT-ss;
+
+ /* Clip counting makes no sense with this function. */
+ absynth_1to1_i486(hybridOut[0][ss], 0, fr, n);
+ absynth_1to1_i486(hybridOut[1][ss], 1, fr, n);
+ ss+=n;
+ fr->buffer.fill+=(2*2*32)*n;
+ }
+ }
+#endif
+ }
+
+ return clip;
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/lfs_alias.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/lfs_alias.c
new file mode 100644
index 00000000..982d7ca9
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/lfs_alias.c
@@ -0,0 +1,236 @@
+/*
+ lfs_alias: Aliases to the small/native API functions with the size of long int as suffix.
+
+ copyright 2010-2020 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis
+
+ Use case: Client code on Linux/x86-64 that defines _FILE_OFFSET_BITS to 64,
+ which is the only choice on that platform anyway. It should be no-op, but
+ prompts the platform-agnostic header of mpg123 to define API calls with the
+ corresponding suffix. This file provides the names for this case. It's cruft,
+ but glibc does it, too -- so people rely on it.
+ Oh, and it also caters for the lunatics that define _FILE_OFFSET_BITS=32 on
+ 32 bit platforms. In addition, it's needed for platforms that always have
+ off_t /= long, and clients still insisting on defining _FILE_OFFSET_BITS.
+
+ Depending on use case, the aliases map to 32 (small) or 64 bit (large) offset
+ functions, to the ones from libmpg123 or the ones from lfs_wrap.
+
+ So, two basic cases:
+ 1. mpg123_bla_32 alias for mpg123_bla (native)
+ 2. mpg123_bla alias for mpg123_bla_32 (wrapper)
+ Same for 64 bits. Confusing, I know. It sucks.
+
+ Note that the mpg123 header is _not_ used here to avoid definition with whacky off_t.
+ The aliases are always about arguments of native alias_t type. This can be off_t, but
+ on Linux/x86, this is long int. The off_t declarations in mpg123.h confuse things,
+ so reproduce definitions for the wrapper functions in that case. The definitions are
+ pulled by an inline Perl script in any case ... no need to copy anything manually!
+ As a benefit, one can skip undefining possible largefile namings.
+*/
+
+#include "config.h"
+
+/* Hack for Solaris: Some system headers included from compat.h might force _FILE_OFFSET_BITS. Need to follow that here.
+ Also, want it around to have types defined. */
+#include "compat.h"
+
+#ifndef LFS_ALIAS_BITS
+#error "I need the count of alias bits here."
+#endif
+
+#define MACROCAT_REALLY(a, b) a ## b
+#define MACROCAT(a, b) MACROCAT_REALLY(a, b)
+
+/* This is wicked switchery: Decide which way the aliases are facing. */
+
+#if _FILE_OFFSET_BITS+0 == LFS_ALIAS_BITS
+
+/* The native functions have suffix, the aliases not. */
+#define NATIVE_SUFFIX MACROCAT(_, _FILE_OFFSET_BITS)
+#define NATIVE_NAME(func) MACROCAT(func, NATIVE_SUFFIX)
+#define ALIAS_NAME(func) func
+
+#else
+
+/* The alias functions have suffix, the native ones not. */
+#define ALIAS_SUFFIX MACROCAT(_, LFS_ALIAS_BITS)
+#define ALIAS_NAME(func) MACROCAT(func, ALIAS_SUFFIX)
+#define NATIVE_NAME(func) func
+
+#endif
+
+/* Copy of necessary definitions, actually just forward declarations. */
+struct mpg123_handle_struct;
+typedef struct mpg123_handle_struct mpg123_handle;
+
+
+/* Get attribute_align_arg, to stay safe. */
+#include "abi_align.h"
+
+/*
+ Extract the list of functions we need wrappers for, pregenerating the wrappers for simple cases (inline script for nedit):
+perl -ne '
+if(/^\s*MPG123_EXPORT\s+(\S+)\s+(mpg123_\S+)\((.*)\);\s*$/)
+{
+ my $type = $1;
+ my $name = $2;
+ my $args = $3;
+ next unless ($type =~ /off_t/ or $args =~ /off_t/ or ($name =~ /open/ and $name ne mpg123_open_feed));
+ $type =~ s/off_t/lfs_alias_t/g;
+ my @nargs = ();
+ $args =~ s/off_t/lfs_alias_t/g;
+ foreach my $a (split(/,/, $args))
+ {
+ $a =~ s/^.*\s\**([a-z_]+)$/$1/;
+ push(@nargs, $a);
+ }
+ my $nargs = join(", ", @nargs);
+ $nargs = "Human: figure me out." if($nargs =~ /\(/);
+ print <<EOT
+
+$type NATIVE_NAME($name)($args);
+$type attribute_align_arg ALIAS_NAME($name)($args)
+{
+ return NATIVE_NAME($name)($nargs);
+}
+EOT
+
+}' < mpg123.h.in
+*/
+
+int NATIVE_NAME(mpg123_open_fixed)( mpg123_handle *mh, const char *path
+, int channels, int encoding );
+int attribute_align_arg ALIAS_NAME(mpg123_open_fixed)( mpg123_handle *mh, const char *path
+, int channels, int encoding )
+{
+ return NATIVE_NAME(mpg123_open_fixed)(mh, path, channels, encoding);
+}
+
+int NATIVE_NAME(mpg123_open)(mpg123_handle *mh, const char *path);
+int attribute_align_arg ALIAS_NAME(mpg123_open)(mpg123_handle *mh, const char *path)
+{
+ return NATIVE_NAME(mpg123_open)(mh, path);
+}
+
+int NATIVE_NAME(mpg123_open_fd)(mpg123_handle *mh, int fd);
+int attribute_align_arg ALIAS_NAME(mpg123_open_fd)(mpg123_handle *mh, int fd)
+{
+ return NATIVE_NAME(mpg123_open_fd)(mh, fd);
+}
+
+int NATIVE_NAME(mpg123_open_handle)(mpg123_handle *mh, void *iohandle);
+int attribute_align_arg ALIAS_NAME(mpg123_open_handle)(mpg123_handle *mh, void *iohandle)
+{
+ return NATIVE_NAME(mpg123_open_handle)(mh, iohandle);
+}
+
+int NATIVE_NAME(mpg123_decode_frame)(mpg123_handle *mh, lfs_alias_t *num, unsigned char **audio, size_t *bytes);
+int attribute_align_arg ALIAS_NAME(mpg123_decode_frame)(mpg123_handle *mh, lfs_alias_t *num, unsigned char **audio, size_t *bytes)
+{
+ return NATIVE_NAME(mpg123_decode_frame)(mh, num, audio, bytes);
+}
+
+int NATIVE_NAME(mpg123_framebyframe_decode)(mpg123_handle *mh, lfs_alias_t *num, unsigned char **audio, size_t *bytes);
+int attribute_align_arg ALIAS_NAME(mpg123_framebyframe_decode)(mpg123_handle *mh, lfs_alias_t *num, unsigned char **audio, size_t *bytes)
+{
+ return NATIVE_NAME(mpg123_framebyframe_decode)(mh, num, audio, bytes);
+}
+
+lfs_alias_t NATIVE_NAME(mpg123_framepos)(mpg123_handle *mh);
+lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_framepos)(mpg123_handle *mh)
+{
+ return NATIVE_NAME(mpg123_framepos)(mh);
+}
+
+lfs_alias_t NATIVE_NAME(mpg123_tell)(mpg123_handle *mh);
+lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_tell)(mpg123_handle *mh)
+{
+ return NATIVE_NAME(mpg123_tell)(mh);
+}
+
+lfs_alias_t NATIVE_NAME(mpg123_tellframe)(mpg123_handle *mh);
+lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_tellframe)(mpg123_handle *mh)
+{
+ return NATIVE_NAME(mpg123_tellframe)(mh);
+}
+
+lfs_alias_t NATIVE_NAME(mpg123_tell_stream)(mpg123_handle *mh);
+lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_tell_stream)(mpg123_handle *mh)
+{
+ return NATIVE_NAME(mpg123_tell_stream)(mh);
+}
+
+lfs_alias_t NATIVE_NAME(mpg123_seek)(mpg123_handle *mh, lfs_alias_t sampleoff, int whence);
+lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_seek)(mpg123_handle *mh, lfs_alias_t sampleoff, int whence)
+{
+ return NATIVE_NAME(mpg123_seek)(mh, sampleoff, whence);
+}
+
+lfs_alias_t NATIVE_NAME(mpg123_feedseek)(mpg123_handle *mh, lfs_alias_t sampleoff, int whence, lfs_alias_t *input_offset);
+lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_feedseek)(mpg123_handle *mh, lfs_alias_t sampleoff, int whence, lfs_alias_t *input_offset)
+{
+ return NATIVE_NAME(mpg123_feedseek)(mh, sampleoff, whence, input_offset);
+}
+
+lfs_alias_t NATIVE_NAME(mpg123_seek_frame)(mpg123_handle *mh, lfs_alias_t frameoff, int whence);
+lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_seek_frame)(mpg123_handle *mh, lfs_alias_t frameoff, int whence)
+{
+ return NATIVE_NAME(mpg123_seek_frame)(mh, frameoff, whence);
+}
+
+lfs_alias_t NATIVE_NAME(mpg123_timeframe)(mpg123_handle *mh, double sec);
+lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_timeframe)(mpg123_handle *mh, double sec)
+{
+ return NATIVE_NAME(mpg123_timeframe)(mh, sec);
+}
+
+int NATIVE_NAME(mpg123_index)(mpg123_handle *mh, lfs_alias_t **offsets, lfs_alias_t *step, size_t *fill);
+int attribute_align_arg ALIAS_NAME(mpg123_index)(mpg123_handle *mh, lfs_alias_t **offsets, lfs_alias_t *step, size_t *fill)
+{
+ return NATIVE_NAME(mpg123_index)(mh, offsets, step, fill);
+}
+
+int NATIVE_NAME(mpg123_set_index)(mpg123_handle *mh, lfs_alias_t *offsets, lfs_alias_t step, size_t fill);
+int attribute_align_arg ALIAS_NAME(mpg123_set_index)(mpg123_handle *mh, lfs_alias_t *offsets, lfs_alias_t step, size_t fill)
+{
+ return NATIVE_NAME(mpg123_set_index)(mh, offsets, step, fill);
+}
+
+int NATIVE_NAME(mpg123_position)( mpg123_handle *mh, lfs_alias_t frame_offset, lfs_alias_t buffered_bytes, lfs_alias_t *current_frame, lfs_alias_t *frames_left, double *current_seconds, double *seconds_left);
+int attribute_align_arg ALIAS_NAME(mpg123_position)( mpg123_handle *mh, lfs_alias_t frame_offset, lfs_alias_t buffered_bytes, lfs_alias_t *current_frame, lfs_alias_t *frames_left, double *current_seconds, double *seconds_left)
+{
+ return NATIVE_NAME(mpg123_position)(mh, frame_offset, buffered_bytes, current_frame, frames_left, current_seconds, seconds_left);
+}
+
+lfs_alias_t NATIVE_NAME(mpg123_framelength)(mpg123_handle *mh);
+lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_framelength)(mpg123_handle *mh)
+{
+ return NATIVE_NAME(mpg123_framelength)(mh);
+}
+
+lfs_alias_t NATIVE_NAME(mpg123_length)(mpg123_handle *mh);
+lfs_alias_t attribute_align_arg ALIAS_NAME(mpg123_length)(mpg123_handle *mh)
+{
+ return NATIVE_NAME(mpg123_length)(mh);
+}
+
+int NATIVE_NAME(mpg123_set_filesize)(mpg123_handle *mh, lfs_alias_t size);
+int attribute_align_arg ALIAS_NAME(mpg123_set_filesize)(mpg123_handle *mh, lfs_alias_t size)
+{
+ return NATIVE_NAME(mpg123_set_filesize)(mh, size);
+}
+
+int NATIVE_NAME(mpg123_replace_reader)(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), lfs_alias_t (*r_lseek)(int, lfs_alias_t, int));
+int attribute_align_arg ALIAS_NAME(mpg123_replace_reader)(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), lfs_alias_t (*r_lseek)(int, lfs_alias_t, int))
+{
+ return NATIVE_NAME(mpg123_replace_reader)(mh, r_read, r_lseek);
+}
+
+int NATIVE_NAME(mpg123_replace_reader_handle)(mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), lfs_alias_t (*r_lseek)(void *, lfs_alias_t, int), void (*cleanup)(void*));
+int attribute_align_arg ALIAS_NAME(mpg123_replace_reader_handle)(mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), lfs_alias_t (*r_lseek)(void *, lfs_alias_t, int), void (*cleanup)(void*))
+{
+ return NATIVE_NAME(mpg123_replace_reader_handle)(mh, r_read, r_lseek, cleanup);
+}
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/lfs_wrap.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/lfs_wrap.c
new file mode 100644
index 00000000..baf11f19
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/lfs_wrap.c
@@ -0,0 +1,793 @@
+/*
+ lfs_wrap: Crappy wrapper code for supporting crappy ambiguous large file support.
+
+ copyright 2010-2020 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+
+ initially written by Thomas Orgis, thanks to Guido Draheim for consulting
+
+ This file contains wrappers for the case that _FILE_OFFSET_BITS (or equivalent, theoretically, depends on mpg123.h) is defined and thus certain mpg123 API calls get renamed with a suffix (p.ex. _64).
+ The renamed calls expect large off_t arguments, and possibly return large off_t values... these wrappers here provide the same functionality with long integer arguments/values.
+
+ Prototypical idea: There is
+ off_t mpg123_seek_64(mpg123_handle*, off_t, int)
+ This code provides
+ long mpg123_seek(mpg123_handle*, long, int)
+
+ This is rather simple business... wouldn't mpg123 offer replacing the I/O core with callbacks. Translating the callbacks between long and off_t world is the main reason why this file contains non-trivial code.
+
+ Note about file descriptors: We just assume that they are generally interchangeable between large and small file code... and that a large file descriptor will trigger errors when accessed with small file code where it may cause trouble (a really large file).
+*/
+
+/* It mainly needs the official API ... */
+/* ... but also some inside access (frame struct, readers). */
+#include "mpg123lib_intern.h"
+/* Include the system headers _after_ the implied config.h!
+ Otherwise _FILE_OFFSET_BITS is not in effect! */
+#include <errno.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include "compat.h"
+#include "debug.h"
+
+/*
+ Now, start off easy... translate simple API calls.
+ I need to deal with these here:
+perl -ne '
+if(/^\s*MPG123_EXPORT\s+(\S+)\s+(mpg123_\S+)\((.*)\);\s*$/)
+{
+ $type = $1;
+ $name = $2;
+ $args = $3;
+ next unless ($type =~ /off_t/ or $args =~ /off_t/);
+ print "$name\n" unless grep {$_ eq $name}
+ ("mpg123_open", "mpg123_open_fd", "mpg123_open_handle", "mpg123_replace_reader", "mpg123_replace_reader_handle");
+}' < mpg123.h.in
+
+mpg123_decode_frame
+mpg123_framebyframe_decode
+mpg123_framepos
+mpg123_tell
+mpg123_tellframe
+mpg123_tell_stream
+mpg123_seek
+mpg123_feedseek
+mpg123_seek_frame
+mpg123_timeframe
+mpg123_index
+mpg123_set_index
+mpg123_position
+mpg123_length
+mpg123_set_filesize
+mpg123_decode_raw ... that's experimental.
+
+Let's work on them in that order.
+*/
+
+/* I see that I will need custom data storage. Main use is for the replaced I/O later, but the seek table for small file offsets needs extra storage, too. */
+
+/* The wrapper handle for descriptor and handle I/O. */
+
+/* The handle is used for nothing (0), or one of these two modes of operation: */
+#define IO_FD 1 /* Wrapping over callbacks operation on integer file descriptor. */
+#define IO_HANDLE 2 /* Wrapping over custom handle callbacks. */
+
+struct wrap_data
+{
+ /* Storage for small offset index table. */
+ long *indextable;
+ /* I/O handle stuff */
+ int iotype; /* IO_FD or IO_HANDLE */
+ /* Data for IO_FD. */
+ int fd;
+ int my_fd; /* A descriptor that the wrapper code opened itself. */
+ /* The actual callbacks from the outside. */
+ ssize_t (*r_read) (int, void *, size_t);
+ long (*r_lseek)(int, long, int);
+ /* Data for IO_HANDLE. */
+ void* handle;
+ ssize_t (*r_h_read)(void *, void *, size_t);
+ long (*r_h_lseek)(void*, long, int);
+ void (*h_cleanup)(void*);
+};
+
+
+/* Cleanup I/O part of the handle handle... but not deleting the wrapper handle itself.
+ That is stored in the frame and only deleted on mpg123_delete(). */
+static void wrap_io_cleanup(void *handle)
+{
+ struct wrap_data *ioh = handle;
+ if(ioh->iotype == IO_HANDLE)
+ {
+ if(ioh->h_cleanup != NULL && ioh->handle != NULL)
+ ioh->h_cleanup(ioh->handle);
+
+ ioh->handle = NULL;
+ }
+ if(ioh->my_fd >= 0)
+ {
+ close(ioh->my_fd);
+ ioh->my_fd = -1;
+ }
+}
+
+/* Really finish off the handle... freeing all memory. */
+static void wrap_destroy(void *handle)
+{
+ struct wrap_data *wh = handle;
+ wrap_io_cleanup(handle);
+ if(wh->indextable != NULL)
+ free(wh->indextable);
+
+ free(wh);
+}
+
+/* More helper code... extract the special wrapper handle, possible allocate and initialize it. */
+static struct wrap_data* wrap_get(mpg123_handle *mh)
+{
+ struct wrap_data* whd;
+ if(mh == NULL) return NULL;
+
+ /* Access the private storage inside the mpg123 handle.
+ The real callback functions and handles are stored there. */
+ if(mh->wrapperdata == NULL)
+ {
+ /* Create a new one. */
+ mh->wrapperdata = malloc(sizeof(struct wrap_data));
+ if(mh->wrapperdata == NULL)
+ {
+ mh->err = MPG123_OUT_OF_MEM;
+ return NULL;
+ }
+ /* When we have wrapper data present, the callback for its proper cleanup is needed. */
+ mh->wrapperclean = wrap_destroy;
+
+ whd = mh->wrapperdata;
+ whd->indextable = NULL;
+ whd->iotype = 0;
+ whd->fd = -1;
+ whd->my_fd = -1;
+ whd->r_read = NULL;
+ whd->r_lseek = NULL;
+ whd->handle = NULL;
+ whd->r_h_read = NULL;
+ whd->r_h_lseek = NULL;
+ whd->h_cleanup = NULL;
+ }
+ else whd = mh->wrapperdata;
+
+ return whd;
+}
+
+/* After settling the data... start with some simple wrappers. */
+
+#undef mpg123_decode_frame
+/* int mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes) */
+int attribute_align_arg mpg123_decode_frame(mpg123_handle *mh, long *num, unsigned char **audio, size_t *bytes)
+{
+ off_t largenum;
+ int err;
+
+ err = MPG123_LARGENAME(mpg123_decode_frame)(mh, &largenum, audio, bytes);
+ if(err == MPG123_OK && num != NULL)
+ {
+ *num = largenum;
+ if(*num != largenum)
+ {
+ mh->err = MPG123_LFS_OVERFLOW;
+ err = MPG123_ERR;
+ }
+ }
+ return err;
+}
+
+#undef mpg123_framebyframe_decode
+/* int mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); */
+int attribute_align_arg mpg123_framebyframe_decode(mpg123_handle *mh, long *num, unsigned char **audio, size_t *bytes)
+{
+ off_t largenum;
+ int err;
+
+ err = MPG123_LARGENAME(mpg123_framebyframe_decode)(mh, &largenum, audio, bytes);
+ if(err == MPG123_OK && num != NULL)
+ {
+ *num = largenum;
+ if(*num != largenum)
+ {
+ mh->err = MPG123_LFS_OVERFLOW;
+ err = MPG123_ERR;
+ }
+ }
+ return err;
+}
+
+#undef mpg123_framepos
+/* off_t mpg123_framepos(mpg123_handle *mh); */
+long attribute_align_arg mpg123_framepos(mpg123_handle *mh)
+{
+ long val;
+ off_t largeval;
+
+ largeval = MPG123_LARGENAME(mpg123_framepos)(mh);
+ val = largeval;
+ if(val != largeval)
+ {
+ mh->err = MPG123_LFS_OVERFLOW;
+ return MPG123_ERR;
+ }
+ return val;
+}
+
+#undef mpg123_tell
+/* off_t mpg123_tell(mpg123_handle *mh); */
+long attribute_align_arg mpg123_tell(mpg123_handle *mh)
+{
+ long val;
+ off_t largeval;
+
+ largeval = MPG123_LARGENAME(mpg123_tell)(mh);
+ val = largeval;
+ if(val != largeval)
+ {
+ mh->err = MPG123_LFS_OVERFLOW;
+ return MPG123_ERR;
+ }
+ return val;
+}
+
+#undef mpg123_tellframe
+/* off_t mpg123_tellframe(mpg123_handle *mh); */
+long attribute_align_arg mpg123_tellframe(mpg123_handle *mh)
+{
+ long val;
+ off_t largeval;
+
+ largeval = MPG123_LARGENAME(mpg123_tellframe)(mh);
+ val = largeval;
+ if(val != largeval)
+ {
+ mh->err = MPG123_LFS_OVERFLOW;
+ return MPG123_ERR;
+ }
+ return val;
+}
+
+#undef mpg123_tell_stream
+/* off_t mpg123_tell_stream(mpg123_handle *mh); */
+long attribute_align_arg mpg123_tell_stream(mpg123_handle *mh)
+{
+ long val;
+ off_t largeval;
+
+ largeval = MPG123_LARGENAME(mpg123_tell_stream)(mh);
+ val = largeval;
+ if(val != largeval)
+ {
+ mh->err = MPG123_LFS_OVERFLOW;
+ return MPG123_ERR;
+ }
+ return val;
+}
+
+#undef mpg123_seek
+/* off_t mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence); */
+long attribute_align_arg mpg123_seek(mpg123_handle *mh, long sampleoff, int whence)
+{
+ long val;
+ off_t largeval;
+
+ largeval = MPG123_LARGENAME(mpg123_seek)(mh, sampleoff, whence);
+ val = largeval;
+ if(val != largeval)
+ {
+ mh->err = MPG123_LFS_OVERFLOW;
+ return MPG123_ERR;
+ }
+ return val;
+}
+
+#undef mpg123_feedseek
+/* off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset); */
+long attribute_align_arg mpg123_feedseek(mpg123_handle *mh, long sampleoff, int whence, long *input_offset)
+{
+ long val;
+ off_t largeioff;
+ off_t largeval;
+ if(input_offset == NULL)
+ {
+ mh->err = MPG123_NULL_POINTER;
+ return MPG123_ERR;
+ }
+
+ largeval = MPG123_LARGENAME(mpg123_feedseek)(mh, sampleoff, whence, &largeioff);
+ /* Error/message codes are small... */
+ if(largeval < 0) return (long)largeval;
+
+ val = largeval;
+ *input_offset = largeioff;
+ if(val != largeval || *input_offset != largeioff)
+ {
+ mh->err = MPG123_LFS_OVERFLOW;
+ return MPG123_ERR;
+ }
+ return val;
+}
+
+#undef mpg123_seek_frame
+/* off_t mpg123_seek_frame(mpg123_handle *mh, off_t frameoff, int whence); */
+long attribute_align_arg mpg123_seek_frame(mpg123_handle *mh, long frameoff, int whence)
+{
+ long val;
+ off_t largeval;
+
+ largeval = MPG123_LARGENAME(mpg123_seek_frame)(mh, frameoff, whence);
+ val = largeval;
+ if(val != largeval)
+ {
+ mh->err = MPG123_LFS_OVERFLOW;
+ return MPG123_ERR;
+ }
+ return val;
+}
+
+#undef mpg123_timeframe
+/* off_t mpg123_timeframe(mpg123_handle *mh, double sec); */
+long attribute_align_arg mpg123_timeframe(mpg123_handle *mh, double sec)
+{
+ long val;
+ off_t largeval;
+
+ largeval = MPG123_LARGENAME(mpg123_timeframe)(mh, sec);
+ val = largeval;
+ if(val != largeval)
+ {
+ mh->err = MPG123_LFS_OVERFLOW;
+ return MPG123_ERR;
+ }
+ return val;
+}
+
+/* Now something less simple: Index retrieval and manipulation.
+ The index is an _array_ of off_t, which means that I need to construct a copy with translated long values. */
+#undef mpg123_index
+/* int mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill) */
+int attribute_align_arg mpg123_index(mpg123_handle *mh, long **offsets, long *step, size_t *fill)
+{
+ int err;
+ size_t i;
+ long smallstep;
+ size_t thefill;
+ off_t largestep;
+ off_t *largeoffsets;
+ struct wrap_data *whd;
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+ if(offsets == NULL || step == NULL || fill == NULL)
+ {
+ mh->err = MPG123_BAD_INDEX_PAR;
+ return MPG123_ERR;
+ }
+
+ whd = wrap_get(mh);
+ if(whd == NULL) return MPG123_ERR;
+
+ err = MPG123_LARGENAME(mpg123_index)(mh, &largeoffsets, &largestep, &thefill);
+ if(err != MPG123_OK) return err;
+
+ /* For a _very_ large file, even the step could overflow. */
+ smallstep = largestep;
+ if(smallstep != largestep)
+ {
+ mh->err = MPG123_LFS_OVERFLOW;
+ return MPG123_ERR;
+ }
+ if(step != NULL) *step = smallstep;
+
+ /* When there are no values stored, there is no table content to take care of.
+ Table pointer does not matter. Mission completed. */
+ if(thefill == 0) return MPG123_OK;
+
+ if(fill != NULL) *fill = thefill;
+
+ /* Construct a copy of the index to hand over to the small-minded client. */
+ *offsets = safe_realloc(whd->indextable, (*fill)*sizeof(long));
+ if(*offsets == NULL)
+ {
+ mh->err = MPG123_OUT_OF_MEM;
+ return MPG123_ERR;
+ }
+ whd->indextable = *offsets;
+ /* Elaborate conversion of each index value, with overflow check. */
+ for(i=0; i<*fill; ++i)
+ {
+ whd->indextable[i] = largeoffsets[i];
+ if(whd->indextable[i] != largeoffsets[i])
+ {
+ mh->err = MPG123_LFS_OVERFLOW;
+ return MPG123_ERR;
+ }
+ }
+ /* If we came that far... there should be a valid copy of the table now. */
+ return MPG123_OK;
+}
+
+/* The writing does basically the same than the above, just the opposite.
+ Oh, and the overflow checks are not needed -- off_t is bigger than long. */
+#undef mpg123_set_index
+/* int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill); */
+int attribute_align_arg mpg123_set_index(mpg123_handle *mh, long *offsets, long step, size_t fill)
+{
+ int err;
+ size_t i;
+ struct wrap_data *whd;
+ off_t *indextmp;
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+
+ whd = wrap_get(mh);
+ if(whd == NULL) return MPG123_ERR;
+
+ /* Expensive temporary storage... for staying outside at the API layer. */
+ indextmp = malloc(fill*sizeof(off_t));
+ if(indextmp == NULL)
+ {
+ mh->err = MPG123_OUT_OF_MEM;
+ return MPG123_ERR;
+ }
+
+ if(fill > 0 && offsets == NULL)
+ {
+ mh->err = MPG123_BAD_INDEX_PAR;
+ err = MPG123_ERR;
+ }
+ else
+ {
+ /* Fill the large-file copy of the provided index, then feed it to mpg123. */
+ for(i=0; i<fill; ++i)
+ indextmp[i] = offsets[i];
+
+ err = MPG123_LARGENAME(mpg123_set_index)(mh, indextmp, step, fill);
+ }
+ free(indextmp);
+
+ return err;
+}
+
+/* So... breathe... a couple of simple wrappers before the big mess. */
+#undef mpg123_position
+/* int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left); */
+int attribute_align_arg mpg123_position(mpg123_handle *mh, long frame_offset, long buffered_bytes, long *current_frame, long *frames_left, double *current_seconds, double *seconds_left)
+{
+ off_t curframe, frameleft;
+ long small_curframe, small_frameleft;
+ int err;
+
+ err = MPG123_LARGENAME(mpg123_position)(mh, frame_offset, buffered_bytes, &curframe, &frameleft, current_seconds, seconds_left);
+ if(err != MPG123_OK) return err;
+
+ small_curframe = curframe;
+ small_frameleft = frameleft;
+ if(small_curframe != curframe || small_frameleft != frameleft)
+ {
+ mh->err = MPG123_LFS_OVERFLOW;
+ return MPG123_ERR;
+ }
+
+ if(current_frame != NULL) *current_frame = small_curframe;
+
+ if(frames_left != NULL) *frames_left = small_frameleft;
+
+
+ return MPG123_OK;
+}
+
+#undef mpg123_framelength
+/* off_t mpg123_framelength(mpg123_handle *mh); */
+long attribute_align_arg mpg123_framelength(mpg123_handle *mh)
+{
+ long val;
+ off_t largeval;
+
+ largeval = MPG123_LARGENAME(mpg123_framelength)(mh);
+ val = largeval;
+ if(val != largeval)
+ {
+ mh->err = MPG123_LFS_OVERFLOW;
+ return MPG123_ERR;
+ }
+ return val;
+}
+
+#undef mpg123_length
+/* off_t mpg123_length(mpg123_handle *mh); */
+long attribute_align_arg mpg123_length(mpg123_handle *mh)
+{
+ long val;
+ off_t largeval;
+
+ largeval = MPG123_LARGENAME(mpg123_length)(mh);
+ val = largeval;
+ if(val != largeval)
+ {
+ mh->err = MPG123_LFS_OVERFLOW;
+ return MPG123_ERR;
+ }
+ return val;
+}
+
+/* The simplest wrapper of all... */
+#undef mpg123_set_filesize
+/* int mpg123_set_filesize(mpg123_handle *mh, off_t size); */
+int attribute_align_arg mpg123_set_filesize(mpg123_handle *mh, long size)
+{
+ return MPG123_LARGENAME(mpg123_set_filesize)(mh, size);
+}
+
+
+/* =========================================
+ THE BOUNDARY OF SANITY
+ Behold, stranger!
+ ========================================= */
+
+
+/*
+ The messy part: Replacement of I/O core (actally, this is only due to lseek()).
+ Both descriptor and handle replaced I/O are mapped to replaced handle I/O, the handle wrapping over the actual callbacks and the actual handle/descriptor.
+ You got multiple levels of handles and callbacks to think about. Have fun reading and comprehending.
+*/
+
+/* Could go into compat.h ... Windows needs that flag. */
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
+/* Read callback needs nothing special. */
+ssize_t wrap_read(void* handle, void *buf, size_t count)
+{
+ struct wrap_data *ioh = handle;
+ switch(ioh->iotype)
+ {
+ case IO_FD: return ioh->r_read(ioh->fd, buf, count);
+ case IO_HANDLE: return ioh->r_h_read(ioh->handle, buf, count);
+ }
+ error("Serious breakage - bad IO type in LFS wrapper!");
+ return -1;
+}
+
+/* Seek callback needs protection from too big offsets. */
+off_t wrap_lseek(void *handle, off_t offset, int whence)
+{
+ struct wrap_data *ioh = handle;
+ long smalloff = offset;
+ if(smalloff == offset)
+ {
+ switch(ioh->iotype)
+ {
+ case IO_FD: return ioh->r_lseek(ioh->fd, smalloff, whence);
+ case IO_HANDLE: return ioh->r_h_lseek(ioh->handle, smalloff, whence);
+ }
+ return -1;
+ }
+ else
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
+}
+
+
+/*
+ Now, let's replace the API dealing with replacement I/O.
+ Start with undefining the renames...
+*/
+
+#undef mpg123_replace_reader
+#undef mpg123_replace_reader_handle
+#undef mpg123_open
+#undef mpg123_open_fixed
+#undef mpg123_open_fd
+#undef mpg123_open_handle
+
+
+/* Normal reader replacement needs fallback implementations. */
+static ssize_t fallback_read(int fd, void *buf, size_t count)
+{
+ return read(fd, buf, count);
+}
+
+static long fallback_lseek(int fd, long offset, int whence)
+{
+ /* Since the offset is long int already, the returned value really should fit into a long... but whatever. */
+ long newpos_long;
+ off_t newpos;
+ newpos = lseek(fd, offset, whence);
+ newpos_long = newpos;
+ if(newpos_long == newpos)
+ return newpos_long;
+ else
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
+}
+
+/* Reader replacement prepares the hidden handle storage for next mpg123_open_fd() or plain mpg123_open(). */
+int attribute_align_arg mpg123_replace_reader(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), long (*r_lseek)(int, long, int) )
+{
+ struct wrap_data* ioh;
+
+ if(mh == NULL) return MPG123_ERR;
+
+ mpg123_close(mh);
+ ioh = wrap_get(mh);
+ if(ioh == NULL) return MPG123_ERR;
+
+ /* If both callbacks are NULL, switch totally to internal I/O, else just use fallback for at most half of them. */
+ if(r_read == NULL && r_lseek == NULL)
+ {
+ /* Only the type is actually important to disable the code. */
+ ioh->iotype = 0;
+ ioh->fd = -1;
+ ioh->r_read = NULL;
+ ioh->r_lseek = NULL;
+ }
+ else
+ {
+ ioh->iotype = IO_FD;
+ ioh->fd = -1; /* On next mpg123_open_fd(), this gets a value. */
+ ioh->r_read = r_read != NULL ? r_read : fallback_read;
+ ioh->r_lseek = r_lseek != NULL ? r_lseek : fallback_lseek;
+ }
+
+ /* The real reader replacement will happen while opening. */
+ return MPG123_OK;
+}
+
+int attribute_align_arg mpg123_replace_reader_handle(mpg123_handle *mh, ssize_t (*r_read) (void*, void *, size_t), long (*r_lseek)(void*, long, int), void (*cleanup)(void*))
+{
+ struct wrap_data* ioh;
+
+ if(mh == NULL) return MPG123_ERR;
+
+ mpg123_close(mh);
+ ioh = wrap_get(mh);
+ if(ioh == NULL) return MPG123_ERR;
+
+ ioh->iotype = IO_HANDLE;
+ ioh->handle = NULL;
+ ioh->r_h_read = r_read;
+ ioh->r_h_lseek = r_lseek;
+ ioh->h_cleanup = cleanup;
+
+ /* The real reader replacement will happen while opening. */
+ return MPG123_OK;
+}
+
+/*
+ The open routines always need to watch out for a prepared wrapper handle to use replaced normal I/O.
+ Two cases to consider:
+ 1. Plain normal open using internal I/O.
+ 2. Client called mpg123_replace_reader() before.
+ The second case needs hackery to activate the client I/O callbacks. For that, we create a custom I/O handle and use the guts of mpg123_open_fd() on it.
+*/
+int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path)
+{
+ struct wrap_data* ioh;
+
+ if(mh == NULL) return MPG123_ERR;
+
+ ioh = mh->wrapperdata;
+ /* Mimic the use of mpg123_replace_reader() functions by lower levels...
+ IO_HANDLE is not valid here, though. Only IO_FD. */
+ if(ioh != NULL && ioh->iotype == IO_FD)
+ {
+ int err;
+ err = MPG123_LARGENAME(mpg123_replace_reader_handle)(mh, wrap_read, wrap_lseek, wrap_io_cleanup);
+ if(err != MPG123_OK) return MPG123_ERR;
+
+ /* The above call implied mpg123_close() already */
+ /*
+ I really need to open the file here... to be able to use the replacer handle I/O ...
+ my_fd is used to indicate closing of the descriptor on cleanup.
+ */
+ ioh->my_fd = compat_open(path, O_RDONLY|O_BINARY);
+ if(ioh->my_fd < 0)
+ {
+ if(!(mh->p.flags & MPG123_QUIET)) error2("Cannot open file %s: %s", path, strerror(errno));
+
+ mh->err = MPG123_BAD_FILE;
+ return MPG123_ERR;
+ }
+ /* Store a copy of the descriptor where it is actually used. */
+ ioh->fd = ioh->my_fd;
+ /* Initiate I/O operating on my handle now. */
+ err = open_stream_handle(mh, ioh);
+ if(err != MPG123_OK)
+ {
+ wrap_io_cleanup(ioh);
+ return MPG123_ERR;
+ }
+ /* All fine... */
+ return MPG123_OK;
+ }
+ else return MPG123_LARGENAME(mpg123_open)(mh, path);
+}
+
+// This one needs to follow the logic of the original, and wrap the actual
+// mpg123_open() here.
+int attribute_align_arg mpg123_open_fixed( mpg123_handle *mh, const char *path
+, int channels, int encoding )
+{
+ int err = open_fixed_pre(mh, channels, encoding);
+ if(err == MPG123_OK)
+ err = mpg123_open(mh, path);
+ if(err == MPG123_OK)
+ err = open_fixed_post(mh, channels, encoding);
+ return err;
+}
+
+/*
+ This is in fact very similar to the above:
+ The open routines always need to watch out for a prepared wrapper handle to use replaced normal I/O.
+ Two cases to consider:
+ 1. Plain normal open_fd using internal I/O.
+ 2. Client called mpg123_replace_reader() before.
+ The second case needs hackery to activate the client I/O callbacks. For that, we create a custom I/O handle and use the guts of mpg123_open_fd() on it.
+*/
+
+int attribute_align_arg mpg123_open_fd(mpg123_handle *mh, int fd)
+{
+ struct wrap_data* ioh;
+
+ if(mh == NULL) return MPG123_ERR;
+
+ mpg123_close(mh);
+ ioh = mh->wrapperdata;
+ if(ioh != NULL && ioh->iotype == IO_FD)
+ {
+ int err;
+ err = MPG123_LARGENAME(mpg123_replace_reader_handle)(mh, wrap_read, wrap_lseek, wrap_io_cleanup);
+ if(err != MPG123_OK) return MPG123_ERR;
+
+ /* The above call implied mpg123_close() already */
+
+ /* Store the real file descriptor inside the handle. */
+ ioh->fd = fd;
+ /* Initiate I/O operating on my handle now. */
+ err = open_stream_handle(mh, ioh);
+ if(err != MPG123_OK)
+ {
+ wrap_io_cleanup(ioh);
+ return MPG123_ERR;
+ }
+ /* All fine... */
+ return MPG123_OK;
+ }
+ else return MPG123_LARGENAME(mpg123_open_fd)(mh, fd);
+}
+
+int attribute_align_arg mpg123_open_handle(mpg123_handle *mh, void *handle)
+{
+ struct wrap_data* ioh;
+
+ if(mh == NULL) return MPG123_ERR;
+
+ mpg123_close(mh);
+ ioh = mh->wrapperdata;
+ if(ioh != NULL && ioh->iotype == IO_HANDLE && ioh->r_h_read != NULL)
+ {
+ /* Wrap the custom handle into my handle. */
+ int err;
+ err = MPG123_LARGENAME(mpg123_replace_reader_handle)(mh, wrap_read, wrap_lseek, wrap_io_cleanup);
+ if(err != MPG123_OK) return MPG123_ERR;
+
+ ioh->handle = handle;
+ /* No extra error handling, keep behaviour of the original open_handle. */
+ return open_stream_handle(mh, ioh);
+ }
+ else
+ {
+ /* This is an error ... you need to prepare the I/O before using it. */
+ mh->err = MPG123_BAD_CUSTOM_IO;
+ return MPG123_ERR;
+ }
+}
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/libmpg123.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/libmpg123.c
new file mode 100644
index 00000000..068524f7
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/libmpg123.c
@@ -0,0 +1,1912 @@
+/*
+ libmpg123: MPEG Audio Decoder library
+
+ copyright 1995-2020 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+
+*/
+
+#include "mpg123lib_intern.h"
+#include "icy2utf8.h"
+
+#include "gapless.h"
+/* Want accurate rounding function regardless of decoder setup. */
+#define FORCE_ACCURATE
+#include "sample.h"
+#include "parse.h"
+
+#include "debug.h"
+
+#define SEEKFRAME(mh) ((mh)->ignoreframe < 0 ? 0 : (mh)->ignoreframe)
+
+int attribute_align_arg mpg123_init(void)
+{
+ // Since 1.27.0, this is a no-op and shall stay that way.
+ return MPG123_OK;
+}
+
+void attribute_align_arg mpg123_exit(void)
+{
+ // Nothing to ever happen here.
+}
+
+/* create a new handle with specified decoder, decoder can be "", "auto" or NULL for auto-detection */
+mpg123_handle attribute_align_arg *mpg123_new(const char* decoder, int *error)
+{
+ return mpg123_parnew(NULL, decoder, error);
+}
+
+// Runtime table calculation is back for specific uses that want minimal
+// binary size. It's hidden in handle initialization, not in mpg123_init(),
+// any user of such a minimal build should ensure that there is no trouble
+// from concurrency or just call mpg123_new() once in single-threaded context.
+
+/* ...the full routine with optional initial parameters to override defaults. */
+mpg123_handle attribute_align_arg *mpg123_parnew(mpg123_pars *mp, const char* decoder, int *error)
+{
+ mpg123_handle *fr = NULL;
+ int err = MPG123_OK;
+
+#ifdef RUNTIME_TABLES
+ static char tables_initialized = 0;
+ if(!tables_initialized)
+ {
+#ifndef NO_LAYER12
+ init_layer12(); /* inits also shared tables with layer1 */
+#endif
+#ifndef NO_LAYER3
+ init_layer3();
+#endif
+ init_costabs();
+ tables_initialized = 1;
+ }
+#endif
+
+ // Silly paranoia checks. Really silly, but libmpg123 has been ported to strange
+ // platforms in the past.
+ if((sizeof(short) != 2) || (sizeof(long) < 4))
+ {
+ if(error != NULL) *error = MPG123_BAD_TYPES;
+ return NULL;
+ }
+
+#if (defined REAL_IS_FLOAT) && (defined IEEE_FLOAT)
+ /* This is rather pointless but it eases my mind to check that we did
+ not enable the special rounding on a VAX or something. */
+ if(12346 != REAL_TO_SHORT_ACCURATE(12345.67f))
+ {
+ if(error != NULL) *error = MPG123_BAD_FLOAT;
+ return NULL;
+ }
+#endif
+
+ fr = (mpg123_handle*) malloc(sizeof(mpg123_handle));
+ if(fr != NULL)
+ {
+ frame_init_par(fr, mp);
+ debug("cpu opt setting");
+ if(frame_cpu_opt(fr, decoder) != 1)
+ {
+ err = MPG123_BAD_DECODER;
+ frame_exit(fr);
+ free(fr);
+ fr = NULL;
+ }
+ }
+ if(fr != NULL)
+ {
+ fr->decoder_change = 1;
+ }
+ else if(err == MPG123_OK) err = MPG123_OUT_OF_MEM;
+
+ if(error != NULL) *error = err;
+ return fr;
+}
+
+int attribute_align_arg mpg123_decoder(mpg123_handle *mh, const char* decoder)
+{
+ enum optdec dt = dectype(decoder);
+
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+
+ if(dt == nodec)
+ {
+ mh->err = MPG123_BAD_DECODER;
+ return MPG123_ERR;
+ }
+ if(dt == mh->cpu_opts.type) return MPG123_OK;
+
+ /* Now really change. */
+ /* frame_exit(mh);
+ frame_init(mh); */
+ debug("cpu opt setting");
+ if(frame_cpu_opt(mh, decoder) != 1)
+ {
+ mh->err = MPG123_BAD_DECODER;
+ frame_exit(mh);
+ return MPG123_ERR;
+ }
+ /* New buffers for decoder are created in frame_buffers() */
+ if((frame_outbuffer(mh) != 0))
+ {
+ mh->err = MPG123_NO_BUFFERS;
+ frame_exit(mh);
+ return MPG123_ERR;
+ }
+ /* Do _not_ call decode_update here! That is only allowed after a first MPEG frame has been met. */
+ mh->decoder_change = 1;
+ return MPG123_OK;
+}
+
+int attribute_align_arg mpg123_param(mpg123_handle *mh, enum mpg123_parms key, long val, double fval)
+{
+ int r;
+
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+ r = mpg123_par(&mh->p, key, val, fval);
+ if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; }
+ else
+ { /* Special treatment for some settings. */
+#ifdef FRAME_INDEX
+ if(key == MPG123_INDEX_SIZE)
+ { /* Apply frame index size and grow property on the fly. */
+ r = frame_index_setup(mh);
+ if(r != MPG123_OK) mh->err = MPG123_INDEX_FAIL;
+ }
+#endif
+#ifndef NO_FEEDER
+ /* Feeder pool size is applied right away, reader will react to that. */
+ if(key == MPG123_FEEDPOOL || key == MPG123_FEEDBUFFER)
+ bc_poolsize(&mh->rdat.buffer, mh->p.feedpool, mh->p.feedbuffer);
+#endif
+ }
+ return r;
+}
+
+int attribute_align_arg mpg123_param2(mpg123_handle *mh, int key, long val, double fval)
+{
+ return mpg123_param(mh, key, val, fval);
+}
+
+int attribute_align_arg mpg123_par(mpg123_pars *mp, enum mpg123_parms key, long val, double fval)
+{
+ int ret = MPG123_OK;
+
+ if(mp == NULL) return MPG123_BAD_PARS;
+ switch(key)
+ {
+ case MPG123_VERBOSE:
+ mp->verbose = val;
+ break;
+ case MPG123_FLAGS:
+#ifndef GAPLESS
+ if(val & MPG123_GAPLESS) ret = MPG123_NO_GAPLESS;
+#endif
+ if(ret == MPG123_OK) mp->flags = val;
+ debug1("set flags to 0x%lx", (unsigned long) mp->flags);
+ break;
+ case MPG123_ADD_FLAGS:
+#ifndef GAPLESS
+ /* Enabling of gapless mode doesn't work when it's not there, but disabling (below) is no problem. */
+ if(val & MPG123_GAPLESS) ret = MPG123_NO_GAPLESS;
+ else
+#endif
+ mp->flags |= val;
+ debug1("set flags to 0x%lx", (unsigned long) mp->flags);
+ break;
+ case MPG123_REMOVE_FLAGS:
+ mp->flags &= ~val;
+ debug1("set flags to 0x%lx", (unsigned long) mp->flags);
+ break;
+ case MPG123_FORCE_RATE: /* should this trigger something? */
+#ifdef NO_NTOM
+ if(val > 0)
+ ret = MPG123_BAD_RATE;
+#else
+ if(val > 96000) ret = MPG123_BAD_RATE;
+ else mp->force_rate = val < 0 ? 0 : val; /* >0 means enable, 0 disable */
+#endif
+ break;
+ case MPG123_DOWN_SAMPLE:
+#ifdef NO_DOWNSAMPLE
+ if(val != 0) ret = MPG123_BAD_RATE;
+#else
+ if(val < 0 || val > 2) ret = MPG123_BAD_RATE;
+ else mp->down_sample = (int)val;
+#endif
+ break;
+ case MPG123_RVA:
+ if(val < 0 || val > MPG123_RVA_MAX) ret = MPG123_BAD_RVA;
+ else mp->rva = (int)val;
+ break;
+ case MPG123_DOWNSPEED:
+ mp->halfspeed = val < 0 ? 0 : val;
+ break;
+ case MPG123_UPSPEED:
+ mp->doublespeed = val < 0 ? 0 : val;
+ break;
+ case MPG123_ICY_INTERVAL:
+#ifndef NO_ICY
+ mp->icy_interval = val > 0 ? val : 0;
+#else
+ if(val > 0) ret = MPG123_BAD_PARAM;
+#endif
+ break;
+ case MPG123_OUTSCALE:
+ /* Choose the value that is non-zero, if any.
+ Downscaling integers to 1.0 . */
+ mp->outscale = val == 0 ? fval : (double)val/SHORT_SCALE;
+ break;
+ case MPG123_TIMEOUT:
+#ifdef TIMEOUT_READ
+ mp->timeout = val >= 0 ? val : 0;
+#else
+ if(val > 0) ret = MPG123_NO_TIMEOUT;
+#endif
+ break;
+ case MPG123_RESYNC_LIMIT:
+ mp->resync_limit = val;
+ break;
+ case MPG123_INDEX_SIZE:
+#ifdef FRAME_INDEX
+ mp->index_size = val;
+#else
+ if(val) // It is only an eror if you want to enable the index.
+ ret = MPG123_NO_INDEX;
+#endif
+ break;
+ case MPG123_PREFRAMES:
+ if(val >= 0) mp->preframes = val;
+ else ret = MPG123_BAD_VALUE;
+ break;
+ case MPG123_FEEDPOOL:
+#ifndef NO_FEEDER
+ if(val >= 0) mp->feedpool = val;
+ else ret = MPG123_BAD_VALUE;
+#else
+ ret = MPG123_MISSING_FEATURE;
+#endif
+ break;
+ case MPG123_FEEDBUFFER:
+#ifndef NO_FEEDER
+ if(val > 0) mp->feedbuffer = val;
+ else ret = MPG123_BAD_VALUE;
+#else
+ ret = MPG123_MISSING_FEATURE;
+#endif
+ break;
+ case MPG123_FREEFORMAT_SIZE:
+ mp->freeformat_framesize = val;
+ break;
+ default:
+ ret = MPG123_BAD_PARAM;
+ }
+ return ret;
+}
+
+int attribute_align_arg mpg123_par2(mpg123_pars *mp, int key, long val, double fval)
+{
+ return mpg123_par(mp, key, val, fval);
+}
+
+int attribute_align_arg mpg123_getparam(mpg123_handle *mh, enum mpg123_parms key, long *val, double *fval)
+{
+ int r;
+
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+ r = mpg123_getpar(&mh->p, key, val, fval);
+ if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; }
+ return r;
+}
+
+int attribute_align_arg mpg123_getparam2(mpg123_handle *mh, int key, long *val, double *fval)
+{
+ return mpg123_getparam(mh, key, val, fval);
+}
+
+int attribute_align_arg mpg123_getpar(mpg123_pars *mp, enum mpg123_parms key, long *val, double *fval)
+{
+ int ret = 0;
+
+ if(mp == NULL) return MPG123_BAD_PARS;
+ switch(key)
+ {
+ case MPG123_VERBOSE:
+ if(val) *val = mp->verbose;
+ break;
+ case MPG123_FLAGS:
+ case MPG123_ADD_FLAGS:
+ if(val) *val = mp->flags;
+ break;
+ case MPG123_FORCE_RATE:
+ if(val)
+#ifdef NO_NTOM
+ *val = 0;
+#else
+ *val = mp->force_rate;
+#endif
+ break;
+ case MPG123_DOWN_SAMPLE:
+ if(val) *val = mp->down_sample;
+ break;
+ case MPG123_RVA:
+ if(val) *val = mp->rva;
+ break;
+ case MPG123_DOWNSPEED:
+ if(val) *val = mp->halfspeed;
+ break;
+ case MPG123_UPSPEED:
+ if(val) *val = mp->doublespeed;
+ break;
+ case MPG123_ICY_INTERVAL:
+#ifndef NO_ICY
+ if(val) *val = (long)mp->icy_interval;
+#else
+ if(val) *val = 0;
+#endif
+ break;
+ case MPG123_OUTSCALE:
+ if(fval) *fval = mp->outscale;
+ if(val) *val = (long)(mp->outscale*SHORT_SCALE);
+ break;
+ case MPG123_RESYNC_LIMIT:
+ if(val) *val = mp->resync_limit;
+ break;
+ case MPG123_INDEX_SIZE:
+ if(val)
+#ifdef FRAME_INDEX
+ *val = mp->index_size;
+#else
+ *val = 0; /* graceful fallback: no index is index of zero size */
+#endif
+ break;
+ case MPG123_PREFRAMES:
+ *val = mp->preframes;
+ break;
+ case MPG123_FEEDPOOL:
+#ifndef NO_FEEDER
+ *val = mp->feedpool;
+#else
+ ret = MPG123_MISSING_FEATURE;
+#endif
+ break;
+ case MPG123_FEEDBUFFER:
+#ifndef NO_FEEDER
+ *val = mp->feedbuffer;
+#else
+ ret = MPG123_MISSING_FEATURE;
+#endif
+ break;
+ case MPG123_FREEFORMAT_SIZE:
+ *val = mp->freeformat_framesize;
+ break;
+ default:
+ ret = MPG123_BAD_PARAM;
+ }
+ return ret;
+}
+
+int attribute_align_arg mpg123_getpar2(mpg123_pars *mp, int key, long *val, double *fval)
+{
+ return mpg123_getpar(mp, key, val, fval);
+}
+
+int attribute_align_arg mpg123_getstate(mpg123_handle *mh, enum mpg123_state key, long *val, double *fval)
+{
+ int ret = MPG123_OK;
+ long theval = 0;
+ double thefval = 0.;
+
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+
+ switch(key)
+ {
+ case MPG123_ACCURATE:
+ theval = mh->state_flags & FRAME_ACCURATE;
+ break;
+ case MPG123_FRANKENSTEIN:
+ theval = mh->state_flags & FRAME_FRANKENSTEIN;
+ break;
+ case MPG123_BUFFERFILL:
+#ifndef NO_FEEDER
+ {
+ size_t sval = bc_fill(&mh->rdat.buffer);
+ theval = (long)sval;
+ if(theval < 0 || (size_t)theval != sval)
+ {
+ mh->err = MPG123_INT_OVERFLOW;
+ ret = MPG123_ERR;
+ }
+ }
+#else
+ mh->err = MPG123_MISSING_FEATURE;
+ ret = MPG123_ERR;
+#endif
+ break;
+ case MPG123_FRESH_DECODER:
+ theval = mh->state_flags & FRAME_FRESH_DECODER;
+ mh->state_flags &= ~FRAME_FRESH_DECODER;
+ break;
+ case MPG123_ENC_DELAY:
+ theval = mh->enc_delay;
+ break;
+ case MPG123_ENC_PADDING:
+ theval = mh->enc_padding;
+ break;
+ case MPG123_DEC_DELAY:
+ theval = mh->lay == 3 ? GAPLESS_DELAY : -1;
+ break;
+ default:
+ mh->err = MPG123_BAD_KEY;
+ ret = MPG123_ERR;
+ }
+
+ if(val != NULL) *val = theval;
+ if(fval != NULL) *fval = thefval;
+
+ return ret;
+}
+
+int attribute_align_arg mpg123_getstate2(mpg123_handle *mh, int key, long *val, double *fval)
+{
+ return mpg123_getstate(mh, key, val, fval);
+}
+
+int attribute_align_arg mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val)
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+#ifndef NO_EQUALIZER
+ if(band < 0 || band > 31){ mh->err = MPG123_BAD_BAND; return MPG123_ERR; }
+ switch(channel)
+ {
+ case MPG123_LEFT|MPG123_RIGHT:
+ mh->equalizer[0][band] = mh->equalizer[1][band] = DOUBLE_TO_REAL(val);
+ break;
+ case MPG123_LEFT: mh->equalizer[0][band] = DOUBLE_TO_REAL(val); break;
+ case MPG123_RIGHT: mh->equalizer[1][band] = DOUBLE_TO_REAL(val); break;
+ default:
+ mh->err=MPG123_BAD_CHANNEL;
+ return MPG123_ERR;
+ }
+ mh->have_eq_settings = TRUE;
+#endif
+ return MPG123_OK;
+}
+
+int attribute_align_arg mpg123_eq2(mpg123_handle *mh, int channel, int band, double val)
+{
+ return mpg123_eq(mh, channel, band, val);
+}
+
+int attribute_align_arg mpg123_eq_bands(mpg123_handle *mh, int channel, int a, int b, double factor)
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+#ifndef NO_EQUALIZER
+ int ret;
+ // Always count up.
+ if(a>b){ int s=a; a=b; b=s; }
+ for(int n=a; n<=b; ++n)
+ if( (ret=mpg123_eq(mh, channel, n, factor)) != MPG123_OK )
+ return ret;
+#endif
+ return MPG123_OK;
+}
+
+int attribute_align_arg mpg123_eq_change(mpg123_handle *mh, int channel, int a, int b, double db)
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+#ifndef NO_EQUALIZER
+ // Always count up.
+ if(a>b){ int s=a; a=b; b=s; }
+ for(int band=a; band<=b; ++band)
+ {
+ if(band < 0 || band > 31){ mh->err = MPG123_BAD_BAND; return MPG123_ERR; }
+ if(channel & MPG123_LEFT)
+ mh->equalizer[0][band] = DOUBLE_TO_REAL(dbchange(REAL_TO_DOUBLE(mh->equalizer[0][band]), db));
+ if(channel & MPG123_RIGHT)
+ mh->equalizer[1][band] = DOUBLE_TO_REAL(dbchange(REAL_TO_DOUBLE(mh->equalizer[1][band]), db));;
+ mh->have_eq_settings = TRUE;
+ }
+#endif
+ return MPG123_OK;
+}
+
+double attribute_align_arg mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band)
+{
+ double ret = 1.;
+#ifndef NO_EQUALIZER
+
+ /* Handle this gracefully. When there is no band, it has no volume. */
+ if(mh != NULL && band > -1 && band < 32)
+ switch(channel)
+ {
+ case MPG123_LEFT|MPG123_RIGHT:
+ ret = 0.5*(REAL_TO_DOUBLE(mh->equalizer[0][band])+REAL_TO_DOUBLE(mh->equalizer[1][band]));
+ break;
+ case MPG123_LEFT: ret = REAL_TO_DOUBLE(mh->equalizer[0][band]); break;
+ case MPG123_RIGHT: ret = REAL_TO_DOUBLE(mh->equalizer[1][band]); break;
+ /* Default case is already handled: ret = 0 */
+ }
+#endif
+ return ret;
+}
+
+double attribute_align_arg mpg123_geteq2(mpg123_handle *mh, int channel, int band)
+{
+ return mpg123_geteq(mh, channel, band);
+}
+
+/* plain file access, no http! */
+int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path)
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+
+ mpg123_close(mh);
+ return open_stream(mh, path, -1);
+}
+
+// The convenience function mpg123_open_fixed() wraps over acual mpg123_open
+// and hence needs to have the exact same code in lfs_wrap.c. The flesh is
+// in open_fixed_pre() and open_fixed_post(), wich are only defined here.
+int open_fixed_pre(mpg123_handle *mh, int channels, int encoding)
+{
+ if(!mh)
+ return MPG123_BAD_HANDLE;
+ mh->p.flags |= MPG123_NO_FRANKENSTEIN;
+ int err = mpg123_format_none(mh);
+ if(err == MPG123_OK)
+ err = mpg123_format2(mh, 0, channels, encoding);
+ return err;
+}
+
+int open_fixed_post(mpg123_handle *mh, int channels, int encoding)
+{
+ if(!mh)
+ return MPG123_BAD_HANDLE;
+ long rate;
+ int err = mpg123_getformat(mh, &rate, &channels, &encoding);
+ if(err == MPG123_OK)
+ err = mpg123_format_none(mh);
+ if(err == MPG123_OK)
+ err = mpg123_format(mh, rate, channels, encoding);
+ if(err == MPG123_OK)
+ {
+ if(mh->track_frames < 1 && (mh->rdat.flags & READER_SEEKABLE))
+ {
+ debug("open_fixed_post: scan because we can seek and do not know track_frames");
+ err = mpg123_scan(mh);
+ }
+ }
+ if(err != MPG123_OK)
+ mpg123_close(mh);
+ return err;
+}
+
+int attribute_align_arg mpg123_open_fixed( mpg123_handle *mh, const char *path
+, int channels, int encoding )
+{
+ int err = open_fixed_pre(mh, channels, encoding);
+ if(err == MPG123_OK)
+ err = mpg123_open(mh, path);
+ if(err == MPG123_OK)
+ err = open_fixed_post(mh, channels, encoding);
+ return err;
+}
+
+int attribute_align_arg mpg123_open_fd(mpg123_handle *mh, int fd)
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+
+ mpg123_close(mh);
+ return open_stream(mh, NULL, fd);
+}
+
+int attribute_align_arg mpg123_open_handle(mpg123_handle *mh, void *iohandle)
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+
+ mpg123_close(mh);
+ if(mh->rdat.r_read_handle == NULL)
+ {
+ mh->err = MPG123_BAD_CUSTOM_IO;
+ return MPG123_ERR;
+ }
+ return open_stream_handle(mh, iohandle);
+}
+
+int attribute_align_arg mpg123_open_feed(mpg123_handle *mh)
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+
+ mpg123_close(mh);
+ return open_feed(mh);
+}
+
+int attribute_align_arg mpg123_replace_reader( mpg123_handle *mh,
+ ssize_t (*r_read) (int, void *, size_t),
+ off_t (*r_lseek)(int, off_t, int) )
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+
+ mpg123_close(mh);
+ mh->rdat.r_read = r_read;
+ mh->rdat.r_lseek = r_lseek;
+ return MPG123_OK;
+}
+
+int attribute_align_arg mpg123_replace_reader_handle( mpg123_handle *mh,
+ ssize_t (*r_read) (void*, void *, size_t),
+ off_t (*r_lseek)(void*, off_t, int),
+ void (*cleanup)(void*) )
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+
+ mpg123_close(mh);
+ mh->rdat.r_read_handle = r_read;
+ mh->rdat.r_lseek_handle = r_lseek;
+ mh->rdat.cleanup_handle = cleanup;
+ return MPG123_OK;
+}
+
+/* Update decoding engine for
+ a) a new choice of decoder
+ b) a changed native format of the MPEG stream
+ ... calls are only valid after parsing some MPEG frame! */
+int decode_update(mpg123_handle *mh)
+{
+ long native_rate;
+ int b;
+
+ mh->state_flags &= ~FRAME_DECODER_LIVE;
+ if(mh->num < 0)
+ {
+ if(!(mh->p.flags & MPG123_QUIET)) error("decode_update() has been called before reading the first MPEG frame! Internal programming error.");
+
+ mh->err = MPG123_BAD_DECODER_SETUP;
+ return MPG123_ERR;
+ }
+
+ mh->state_flags |= FRAME_FRESH_DECODER;
+ native_rate = frame_freq(mh);
+
+ b = frame_output_format(mh); /* Select the new output format based on given constraints. */
+ if(b < 0) return MPG123_ERR;
+
+ if(b == 1) mh->new_format = 1; /* Store for later... */
+
+ debug3("updating decoder structure with native rate %li and af.rate %li (new format: %i)", native_rate, mh->af.rate, mh->new_format);
+ if(mh->af.rate == native_rate) mh->down_sample = 0;
+ else if(mh->af.rate == native_rate>>1) mh->down_sample = 1;
+ else if(mh->af.rate == native_rate>>2) mh->down_sample = 2;
+ else mh->down_sample = 3; /* flexible (fixed) rate */
+ switch(mh->down_sample)
+ {
+ case 0:
+ case 1:
+ case 2:
+ mh->down_sample_sblimit = SBLIMIT>>(mh->down_sample);
+ /* With downsampling I get less samples per frame */
+ mh->outblock = outblock_bytes(mh, (mh->spf>>mh->down_sample));
+ break;
+#ifndef NO_NTOM
+ case 3:
+ {
+ if(synth_ntom_set_step(mh) != 0) return -1;
+ if(frame_freq(mh) > mh->af.rate)
+ {
+ mh->down_sample_sblimit = SBLIMIT * mh->af.rate;
+ mh->down_sample_sblimit /= frame_freq(mh);
+ if(mh->down_sample_sblimit < 1)
+ mh->down_sample_sblimit = 1;
+ }
+ else mh->down_sample_sblimit = SBLIMIT;
+ mh->outblock = outblock_bytes(mh,
+ ( ( NTOM_MUL-1+mh->spf
+ * (((size_t)NTOM_MUL*mh->af.rate)/frame_freq(mh))
+ )/NTOM_MUL ));
+ }
+ break;
+#endif
+ }
+
+ if(!(mh->p.flags & MPG123_FORCE_MONO))
+ {
+ if(mh->af.channels == 1) mh->single = SINGLE_MIX;
+ else mh->single = SINGLE_STEREO;
+ }
+ else mh->single = (mh->p.flags & MPG123_FORCE_MONO)-1;
+ if(set_synth_functions(mh) != 0) return -1;;
+
+ /* The needed size of output buffer may have changed. */
+ if(frame_outbuffer(mh) != MPG123_OK) return -1;
+
+ do_rva(mh);
+ debug3("done updating decoder structure with native rate %li and af.rate %li and down_sample %i", frame_freq(mh), mh->af.rate, mh->down_sample);
+
+ mh->decoder_change = 0;
+ mh->state_flags |= FRAME_DECODER_LIVE;
+ return 0;
+}
+
+size_t attribute_align_arg mpg123_safe_buffer(void)
+{
+ /* real is the largest possible output (it's 32bit float, 32bit int or 64bit double). */
+ return sizeof(real)*2*1152*NTOM_MAX;
+}
+
+size_t attribute_align_arg mpg123_outblock(mpg123_handle *mh)
+{
+ /* Try to be helpful and never return zero output block size. */
+ if(mh != NULL && mh->outblock > 0) return mh->outblock;
+ else return mpg123_safe_buffer();
+}
+
+/* Read in the next frame we actually want for decoding.
+ This includes skipping/ignoring frames, in additon to skipping junk in the parser. */
+static int get_next_frame(mpg123_handle *mh)
+{
+ int change = mh->decoder_change;
+ /* Ensure we got proper decoder for ignoring frames.
+ Header can be changed from seeking around. But be careful: Only after at
+ least one frame got read, decoder update makes sense. */
+ if(mh->header_change > 1 && mh->num >= 0)
+ {
+ change = 1;
+ mh->header_change = 0;
+ debug("starting with big header change");
+ if(decode_update(mh) < 0)
+ return MPG123_ERR;
+ }
+
+ do
+ {
+ int b;
+ /* Decode & discard some frame(s) before beginning. */
+ if(mh->to_ignore && mh->num < mh->firstframe && mh->num >= mh->ignoreframe)
+ {
+ debug1("ignoring frame %li", (long)mh->num);
+ /* Decoder structure must be current! decode_update has been called before... */
+ (mh->do_layer)(mh); mh->buffer.fill = 0;
+#ifndef NO_NTOM
+ /* The ignored decoding may have failed. Make sure ntom stays consistent. */
+ if(mh->down_sample == 3) ntom_set_ntom(mh, mh->num+1);
+#endif
+ mh->to_ignore = mh->to_decode = FALSE;
+ }
+ /* Read new frame data; possibly breaking out here for MPG123_NEED_MORE. */
+ debug("read frame");
+ mh->to_decode = FALSE;
+ b = read_frame(mh); /* That sets to_decode only if a full frame was read. */
+ debug4("read of frame %li returned %i (to_decode=%i) at sample %li", (long)mh->num, b, mh->to_decode, (long)mpg123_tell(mh));
+ if(b == MPG123_NEED_MORE) return MPG123_NEED_MORE; /* need another call with data */
+ else if(b <= 0)
+ {
+ /* More sophisticated error control? */
+ if(b==0 || (mh->rdat.filelen >= 0 && mh->rdat.filepos == mh->rdat.filelen))
+ { /* We simply reached the end. */
+ mh->track_frames = mh->num + 1;
+ debug("What about updating/checking gapless sample count here?");
+ return MPG123_DONE;
+ }
+ else return MPG123_ERR; /* Some real error. */
+ }
+ /* Now, there should be new data to decode ... and also possibly new stream properties */
+ if(mh->header_change > 1 || mh->decoder_change)
+ {
+ debug("big header or decoder change");
+ change = 1;
+ mh->header_change = 0;
+ /* Need to update decoder structure right away since frame might need to
+ be decoded on next loop iteration for properly ignoring its output. */
+ if(decode_update(mh) < 0)
+ return MPG123_ERR;
+ }
+ /* Now some accounting: Look at the numbers and decide if we want this frame. */
+ ++mh->playnum;
+ /* Plain skipping without decoding, only when frame is not ignored on next cycle. */
+ if(mh->num < mh->firstframe || (mh->p.doublespeed && (mh->playnum % mh->p.doublespeed)))
+ {
+ if(!(mh->to_ignore && mh->num < mh->firstframe && mh->num >= mh->ignoreframe))
+ {
+ frame_skip(mh);
+ /* Should one fix NtoM here or not?
+ It is not work the trouble for doublespeed, but what with leading frames? */
+ }
+ }
+ /* Or, we are finally done and have a new frame. */
+ else break;
+ } while(1);
+
+ /* If we reach this point, we got a new frame ready to be decoded.
+ All other situations resulted in returns from the loop. */
+ if(change)
+ {
+ if(mh->fresh)
+ {
+#ifdef GAPLESS
+ int b=0;
+ /* Prepare offsets for gapless decoding. */
+ debug1("preparing gapless stuff with native rate %li", frame_freq(mh));
+ frame_gapless_realinit(mh);
+ frame_set_frameseek(mh, mh->num);
+#endif
+ mh->fresh = 0;
+#ifdef GAPLESS
+ /* Could this possibly happen? With a real big gapless offset... */
+ if(mh->num < mh->firstframe) b = get_next_frame(mh);
+ if(b < 0) return b; /* Could be error, need for more, new format... */
+#endif
+ }
+ }
+ return MPG123_OK;
+}
+
+/* Assumption: A buffer full of zero samples can be constructed by repetition of this byte.
+ Oh, and it handles some format conversion.
+ Only to be used by decode_the_frame() ... */
+static int zero_byte(mpg123_handle *fr)
+{
+#ifndef NO_8BIT
+ return fr->af.encoding & MPG123_ENC_8 ? fr->conv16to8[0] : 0;
+#else
+ return 0; /* All normal signed formats have the zero here (even in byte form -- that may be an assumption for your funny machine...). */
+#endif
+}
+
+/*
+ Not part of the api. This just decodes the frame and fills missing bits with zeroes.
+ There can be frames that are broken and thus make do_layer() fail.
+*/
+static void decode_the_frame(mpg123_handle *fr)
+{
+ size_t needed_bytes = decoder_synth_bytes(fr, frame_expect_outsamples(fr));
+ fr->clip += (fr->do_layer)(fr);
+ /*fprintf(stderr, "frame %"OFF_P": got %"SIZE_P" / %"SIZE_P"\n", fr->num,(size_p)fr->buffer.fill, (size_p)needed_bytes);*/
+ /* There could be less data than promised.
+ Also, then debugging, we look out for coding errors that could result in _more_ data than expected. */
+#ifdef DEBUG
+ if(fr->buffer.fill != needed_bytes)
+ {
+#endif
+ if(fr->buffer.fill < needed_bytes)
+ {
+ if(VERBOSE2)
+ fprintf(stderr, "Note: broken frame %li, filling up with %"SIZE_P" zeroes, from %"SIZE_P"\n", (long)fr->num, (size_p)(needed_bytes-fr->buffer.fill), (size_p)fr->buffer.fill);
+
+ /*
+ One could do a loop with individual samples instead... but zero is zero
+ Actually, that is wrong: zero is mostly a series of null bytes,
+ but we have funny 8bit formats that have a different opinion on zero...
+ Unsigned 16 or 32 bit formats are handled later.
+ */
+ memset( fr->buffer.data + fr->buffer.fill, zero_byte(fr), needed_bytes - fr->buffer.fill );
+
+ fr->buffer.fill = needed_bytes;
+#ifndef NO_NTOM
+ /* ntom_val will be wrong when the decoding wasn't carried out completely */
+ ntom_set_ntom(fr, fr->num+1);
+#endif
+ }
+#ifdef DEBUG
+ else
+ {
+ if(NOQUIET)
+ error2("I got _more_ bytes than expected (%"SIZE_P" / %"SIZE_P"), that should not be possible!", (size_p)fr->buffer.fill, (size_p)needed_bytes);
+ }
+ }
+#endif
+ postprocess_buffer(fr);
+}
+
+/*
+ Decode the current frame into the frame structure's buffer, accessible at the location stored in <audio>, with <bytes> bytes available.
+ <num> will contain the last decoded frame number. This function should be called after mpg123_framebyframe_next positioned the stream at a
+ valid mp3 frame. The buffer contents will get lost on the next call to mpg123_framebyframe_next or mpg123_framebyframe_decode.
+ returns
+ MPG123_OK -- successfully decoded or ignored the frame, you get your output data or in case of ignored frames 0 bytes
+ MPG123_DONE -- decoding finished, should not happen
+ MPG123_ERR -- some error occured.
+ MPG123_ERR_NULL -- audio or bytes are not pointing to valid storage addresses
+ MPG123_BAD_HANDLE -- mh has not been initialized
+ MPG123_NO_SPACE -- not enough space in buffer for safe decoding, should not happen
+*/
+int attribute_align_arg mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes)
+{
+ if(bytes == NULL) return MPG123_ERR_NULL;
+ if(audio == NULL) return MPG123_ERR_NULL;
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+ if(mh->buffer.size < mh->outblock) return MPG123_NO_SPACE;
+
+ *audio = NULL;
+ *bytes = 0;
+ mh->buffer.fill = 0; /* always start fresh */
+ if(!mh->to_decode) return MPG123_OK;
+
+ if(num != NULL) *num = mh->num;
+ debug("decoding");
+ if(!(mh->state_flags & FRAME_DECODER_LIVE))
+ return MPG123_ERR;
+ decode_the_frame(mh);
+ mh->to_decode = mh->to_ignore = FALSE;
+ mh->buffer.p = mh->buffer.data;
+ FRAME_BUFFERCHECK(mh);
+ *audio = mh->buffer.p;
+ *bytes = mh->buffer.fill;
+ return MPG123_OK;
+}
+
+/*
+ Find, read and parse the next mp3 frame while skipping junk and parsing id3 tags, lame headers, etc.
+ Prepares everything for decoding using mpg123_framebyframe_decode.
+ returns
+ MPG123_OK -- new frame was read and parsed, call mpg123_framebyframe_decode to actually decode
+ MPG123_NEW_FORMAT -- new frame was read, it results in changed output format, call mpg123_framebyframe_decode to actually decode
+ MPG123_BAD_HANDLE -- mh has not been initialized
+ MPG123_NEED_MORE -- more input data is needed to advance to the next frame. supply more input data using mpg123_feed
+*/
+int attribute_align_arg mpg123_framebyframe_next(mpg123_handle *mh)
+{
+ int b;
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+
+ mh->to_decode = mh->to_ignore = FALSE;
+ mh->buffer.fill = 0;
+
+ b = get_next_frame(mh);
+ if(b < 0) return b;
+ debug1("got next frame, %i", mh->to_decode);
+
+ /* mpg123_framebyframe_decode will return MPG123_OK with 0 bytes decoded if mh->to_decode is 0 */
+ if(!mh->to_decode)
+ return MPG123_OK;
+
+ if(mh->new_format)
+ {
+ debug("notifiying new format");
+ mh->new_format = 0;
+ return MPG123_NEW_FORMAT;
+ }
+
+ return MPG123_OK;
+}
+
+/*
+ Put _one_ decoded frame into the frame structure's buffer, accessible at the location stored in <audio>, with <bytes> bytes available.
+ The buffer contents will be lost on next call to mpg123_decode_frame.
+ MPG123_OK -- successfully decoded the frame, you get your output data
+ MPg123_DONE -- This is it. End.
+ MPG123_ERR -- some error occured...
+ MPG123_NEW_FORMAT -- new frame was read, it results in changed output format -> will be decoded on next call
+ MPG123_NEED_MORE -- that should not happen as this function is intended for in-library stream reader but if you force it...
+ MPG123_NO_SPACE -- not enough space in buffer for safe decoding, also should not happen
+
+ num will be updated to the last decoded frame number (may possibly _not_ increase, p.ex. when format changed).
+*/
+int attribute_align_arg mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes)
+{
+ if(bytes != NULL) *bytes = 0;
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+ if(mh->buffer.size < mh->outblock) return MPG123_NO_SPACE;
+ mh->buffer.fill = 0; /* always start fresh */
+ /* Be nice: Set these also for sensible values in case of error. */
+ if(audio) *audio = NULL;
+ if(bytes) *bytes = 0;
+ while(TRUE)
+ {
+ /* decode if possible */
+ if(mh->to_decode)
+ {
+ if(num != NULL) *num = mh->num;
+ if(mh->new_format)
+ {
+ debug("notifiying new format");
+ mh->new_format = 0;
+ return MPG123_NEW_FORMAT;
+ }
+ debug("decoding");
+
+ if( (mh->decoder_change && decode_update(mh) < 0)
+ || !(mh->state_flags & FRAME_DECODER_LIVE) )
+ return MPG123_ERR;
+ decode_the_frame(mh);
+
+ mh->to_decode = mh->to_ignore = FALSE;
+ mh->buffer.p = mh->buffer.data;
+ FRAME_BUFFERCHECK(mh);
+ if(audio != NULL) *audio = mh->buffer.p;
+ if(bytes != NULL) *bytes = mh->buffer.fill;
+
+ return MPG123_OK;
+ }
+ else
+ {
+ int b = get_next_frame(mh);
+ if(b < 0) return b;
+ debug1("got next frame, %i", mh->to_decode);
+ }
+ }
+}
+
+int attribute_align_arg mpg123_read(mpg123_handle *mh, void *out, size_t size, size_t *done)
+{
+ return mpg123_decode(mh, NULL, 0, out, size, done);
+}
+
+int attribute_align_arg mpg123_feed(mpg123_handle *mh, const unsigned char *in, size_t size)
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+#ifndef NO_FEEDER
+ if(size > 0)
+ {
+ if(in != NULL)
+ {
+ if(feed_more(mh, in, size) != 0) return MPG123_ERR;
+ else
+ {
+ /* The need for more data might have triggered an error.
+ This one is outdated now with the new data. */
+ if(mh->err == MPG123_ERR_READER) mh->err = MPG123_OK;
+
+ return MPG123_OK;
+ }
+ }
+ else
+ {
+ mh->err = MPG123_NULL_BUFFER;
+ return MPG123_ERR;
+ }
+ }
+ return MPG123_OK;
+#else
+ mh->err = MPG123_MISSING_FEATURE;
+ return MPG123_ERR;
+#endif
+}
+
+/*
+ The old picture:
+ while(1) {
+ len = read(0,buf,16384);
+ if(len <= 0)
+ break;
+ ret = decodeMP3(&mp,buf,len,out,8192,&size);
+ while(ret == MP3_OK) {
+ write(1,out,size);
+ ret = decodeMP3(&mp,NULL,0,out,8192,&size);
+ }
+ }
+*/
+
+int attribute_align_arg mpg123_decode(mpg123_handle *mh, const unsigned char *inmemory, size_t inmemsize, void *outmem, size_t outmemsize, size_t *done)
+{
+ int ret = MPG123_OK;
+ size_t mdone = 0;
+ unsigned char *outmemory = outmem;
+
+ if(done != NULL) *done = 0;
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+ if(inmemsize > 0 && mpg123_feed(mh, inmemory, inmemsize) != MPG123_OK)
+ {
+ ret = MPG123_ERR;
+ goto decodeend;
+ }
+ if(outmemory == NULL) outmemsize = 0; /* Not just give error, give chance to get a status message. */
+
+ while(ret == MPG123_OK)
+ {
+ debug4("decode loop, fill %i (%li vs. %li); to_decode: %i", (int)mh->buffer.fill, (long)mh->num, (long)mh->firstframe, mh->to_decode);
+ /* Decode a frame that has been read before.
+ This only happens when buffer is empty! */
+ if(mh->to_decode)
+ {
+ if(mh->new_format)
+ {
+ debug("notifiying new format");
+ mh->new_format = 0;
+ ret = MPG123_NEW_FORMAT;
+ goto decodeend;
+ }
+ if(mh->buffer.size - mh->buffer.fill < mh->outblock)
+ {
+ ret = MPG123_NO_SPACE;
+ goto decodeend;
+ }
+ if( (mh->decoder_change && decode_update(mh) < 0)
+ || ! (mh->state_flags & FRAME_DECODER_LIVE) )
+ {
+ ret = MPG123_ERR;
+ goto decodeend;
+ }
+ decode_the_frame(mh);
+ mh->to_decode = mh->to_ignore = FALSE;
+ mh->buffer.p = mh->buffer.data;
+ debug2("decoded frame %li, got %li samples in buffer", (long)mh->num, (long)(mh->buffer.fill / (samples_to_bytes(mh, 1))));
+ FRAME_BUFFERCHECK(mh);
+ }
+ if(mh->buffer.fill) /* Copy (part of) the decoded data to the caller's buffer. */
+ {
+ /* get what is needed - or just what is there */
+ int a = mh->buffer.fill > (outmemsize - mdone) ? outmemsize - mdone : mh->buffer.fill;
+ debug4("buffer fill: %i; copying %i (%i - %li)", (int)mh->buffer.fill, a, (int)outmemsize, (long)mdone);
+ memcpy(outmemory, mh->buffer.p, a);
+ /* less data in frame buffer, less needed, output pointer increase, more data given... */
+ mh->buffer.fill -= a;
+ outmemory += a;
+ mdone += a;
+ mh->buffer.p += a;
+ if(!(outmemsize > mdone)) goto decodeend;
+ }
+ else /* If we didn't have data, get a new frame. */
+ {
+ int b = get_next_frame(mh);
+ if(b < 0){ ret = b; goto decodeend; }
+ }
+ }
+decodeend:
+ if(done != NULL) *done = mdone;
+ return ret;
+}
+
+long attribute_align_arg mpg123_clip(mpg123_handle *mh)
+{
+ long ret = 0;
+
+ if(mh != NULL)
+ {
+ ret = mh->clip;
+ mh->clip = 0;
+ }
+ return ret;
+}
+
+/* Simples: Track needs initializtion if no initial frame has been read yet. */
+#define track_need_init(mh) ((mh)->num < 0)
+
+static int init_track(mpg123_handle *mh)
+{
+ if(track_need_init(mh))
+ {
+ /* Fresh track, need first frame for basic info. */
+ int b = get_next_frame(mh);
+ if(b < 0) return b;
+ }
+ return 0;
+}
+
+// Duplicating the code for the changed member types in struct mpg123_frameinfo2.
+#define MPG123_INFO_FUNC \
+{ \
+ int b; \
+ \
+ if(mh == NULL) return MPG123_BAD_HANDLE; \
+ if(mi == NULL) \
+ { \
+ mh->err = MPG123_ERR_NULL; \
+ return MPG123_ERR; \
+ } \
+ b = init_track(mh); \
+ if(b < 0) return b; \
+ \
+ mi->version = mh->mpeg25 ? MPG123_2_5 : (mh->lsf ? MPG123_2_0 : MPG123_1_0); \
+ mi->layer = mh->lay; \
+ mi->rate = frame_freq(mh); \
+ switch(mh->mode) \
+ { \
+ case 0: mi->mode = MPG123_M_STEREO; break; \
+ case 1: mi->mode = MPG123_M_JOINT; break; \
+ case 2: mi->mode = MPG123_M_DUAL; break; \
+ case 3: mi->mode = MPG123_M_MONO; break; \
+ default: mi->mode = 0; /* Nothing good to do here. */ \
+ } \
+ mi->mode_ext = mh->mode_ext; \
+ mi->framesize = mh->framesize+4; /* Include header. */ \
+ mi->flags = 0; \
+ if(mh->error_protection) mi->flags |= MPG123_CRC; \
+ if(mh->copyright) mi->flags |= MPG123_COPYRIGHT; \
+ if(mh->extension) mi->flags |= MPG123_PRIVATE; \
+ if(mh->original) mi->flags |= MPG123_ORIGINAL; \
+ mi->emphasis = mh->emphasis; \
+ mi->bitrate = frame_bitrate(mh); \
+ mi->abr_rate = mh->abr_rate; \
+ mi->vbr = mh->vbr; \
+ return MPG123_OK; \
+}
+
+int attribute_align_arg mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi)
+MPG123_INFO_FUNC
+
+int attribute_align_arg mpg123_info2(mpg123_handle *mh, struct mpg123_frameinfo2 *mi)
+MPG123_INFO_FUNC
+
+int attribute_align_arg mpg123_getformat2( mpg123_handle *mh
+, long *rate, int *channels, int *encoding, int clear_flag )
+{
+ int b;
+
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+ b = init_track(mh);
+ if(b < 0) return b;
+
+ if(rate != NULL) *rate = mh->af.rate;
+ if(channels != NULL) *channels = mh->af.channels;
+ if(encoding != NULL) *encoding = mh->af.encoding;
+ if(clear_flag) mh->new_format = 0;
+ return MPG123_OK;
+}
+
+int attribute_align_arg mpg123_getformat(mpg123_handle *mh, long *rate, int *channels, int *encoding)
+{
+ return mpg123_getformat2(mh, rate, channels, encoding, 1);
+}
+
+off_t attribute_align_arg mpg123_timeframe(mpg123_handle *mh, double seconds)
+{
+ off_t b;
+
+ if(mh == NULL) return MPG123_ERR;
+ b = init_track(mh);
+ if(b<0) return b;
+ return (off_t)(seconds/mpg123_tpf(mh));
+}
+
+/*
+ Now, where are we? We need to know the last decoded frame... and what's left of it in buffer.
+ The current frame number can mean the last decoded frame or the to-be-decoded frame.
+ If mh->to_decode, then mh->num frames have been decoded, the frame mh->num now coming next.
+ If not, we have the possibility of mh->num+1 frames being decoded or nothing at all.
+ Then, there is firstframe...when we didn't reach it yet, then the next data will come from there.
+ mh->num starts with -1
+*/
+off_t attribute_align_arg mpg123_tell(mpg123_handle *mh)
+{
+ if(mh == NULL) return MPG123_ERR;
+ if(track_need_init(mh)) return 0;
+ /* Now we have all the info at hand. */
+ debug5("tell: %li/%i first %li buffer %lu; frame_outs=%li", (long)mh->num, mh->to_decode, (long)mh->firstframe, (unsigned long)mh->buffer.fill, (long)frame_outs(mh, mh->num));
+
+ { /* Funny block to keep C89 happy. */
+ off_t pos = 0;
+ if((mh->num < mh->firstframe) || (mh->num == mh->firstframe && mh->to_decode))
+ { /* We are at the beginning, expect output from firstframe on. */
+ pos = frame_outs(mh, mh->firstframe);
+#ifdef GAPLESS
+ pos += mh->firstoff;
+#endif
+ }
+ else if(mh->to_decode)
+ { /* We start fresh with this frame. Buffer should be empty, but we make sure to count it in. */
+ pos = frame_outs(mh, mh->num) - bytes_to_samples(mh, mh->buffer.fill);
+ }
+ else
+ { /* We serve what we have in buffer and then the beginning of next frame... */
+ pos = frame_outs(mh, mh->num+1) - bytes_to_samples(mh, mh->buffer.fill);
+ }
+ /* Substract padding and delay from the beginning. */
+ pos = SAMPLE_ADJUST(mh,pos);
+ /* Negative sample offsets are not right, less than nothing is still nothing. */
+ return pos>0 ? pos : 0;
+ }
+}
+
+off_t attribute_align_arg mpg123_tellframe(mpg123_handle *mh)
+{
+ if(mh == NULL) return MPG123_ERR;
+ if(mh->num < mh->firstframe) return mh->firstframe;
+ if(mh->to_decode) return mh->num;
+ /* Consider firstoff? */
+ return mh->buffer.fill ? mh->num : mh->num + 1;
+}
+
+off_t attribute_align_arg mpg123_tell_stream(mpg123_handle *mh)
+{
+ if(mh == NULL) return MPG123_ERR;
+ /* mh->rd is at least a bad_reader, so no worry. */
+ return mh->rd->tell(mh);
+}
+
+static int do_the_seek(mpg123_handle *mh)
+{
+ int b;
+ off_t fnum = SEEKFRAME(mh);
+ mh->buffer.fill = 0;
+
+ /* If we are inside the ignoreframe - firstframe window, we may get away without actual seeking. */
+ if(mh->num < mh->firstframe)
+ {
+ mh->to_decode = FALSE; /* In any case, don't decode the current frame, perhaps ignore instead. */
+ if(mh->num > fnum) return MPG123_OK;
+ }
+
+ /* If we are already there, we are fine either for decoding or for ignoring. */
+ if(mh->num == fnum && (mh->to_decode || fnum < mh->firstframe)) return MPG123_OK;
+ /* We have the frame before... just go ahead as normal. */
+ if(mh->num == fnum-1)
+ {
+ mh->to_decode = FALSE;
+ return MPG123_OK;
+ }
+
+ /* OK, real seeking follows... clear buffers and go for it. */
+ frame_buffers_reset(mh);
+#ifndef NO_NTOM
+ if(mh->down_sample == 3)
+ {
+ ntom_set_ntom(mh, fnum);
+ debug3("fixed ntom for frame %"OFF_P" to %lu, num=%"OFF_P, (off_p)fnum, mh->ntom_val[0], (off_p)mh->num);
+ }
+#endif
+ b = mh->rd->seek_frame(mh, fnum);
+ if(mh->header_change > 1)
+ {
+ if(decode_update(mh) < 0) return MPG123_ERR;
+ mh->header_change = 0;
+ }
+ debug1("seek_frame returned: %i", b);
+ if(b<0) return b;
+ /* Only mh->to_ignore is TRUE. */
+ if(mh->num < mh->firstframe) mh->to_decode = FALSE;
+
+ mh->playnum = mh->num;
+ return 0;
+}
+
+off_t attribute_align_arg mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence)
+{
+ int b;
+ off_t pos;
+
+ pos = mpg123_tell(mh); /* adjusted samples */
+ /* pos < 0 also can mean that simply a former seek failed at the lower levels.
+ In that case, we only allow absolute seeks. */
+ if(pos < 0 && whence != SEEK_SET)
+ { /* Unless we got the obvious error of NULL handle, this is a special seek failure. */
+ if(mh != NULL) mh->err = MPG123_NO_RELSEEK;
+ return MPG123_ERR;
+ }
+ if((b=init_track(mh)) < 0) return b;
+ switch(whence)
+ {
+ case SEEK_CUR: pos += sampleoff; break;
+ case SEEK_SET: pos = sampleoff; break;
+ case SEEK_END:
+ /* When we do not know the end already, we can try to find it. */
+ if(mh->track_frames < 1 && (mh->rdat.flags & READER_SEEKABLE))
+ mpg123_scan(mh);
+ if(mh->track_frames > 0) pos = SAMPLE_ADJUST(mh,frame_outs(mh, mh->track_frames)) - sampleoff;
+#ifdef GAPLESS
+ else if(mh->end_os > 0) pos = SAMPLE_ADJUST(mh,mh->end_os) - sampleoff;
+#endif
+ else
+ {
+ mh->err = MPG123_NO_SEEK_FROM_END;
+ return MPG123_ERR;
+ }
+ break;
+ default: mh->err = MPG123_BAD_WHENCE; return MPG123_ERR;
+ }
+ if(pos < 0) pos = 0;
+ /* pos now holds the wanted sample offset in adjusted samples */
+ frame_set_seek(mh, SAMPLE_UNADJUST(mh,pos));
+ pos = do_the_seek(mh);
+ if(pos < 0) return pos;
+
+ return mpg123_tell(mh);
+}
+
+/*
+ A bit more tricky... libmpg123 does not do the seeking itself.
+ All it can do is to ignore frames until the wanted one is there.
+ The caller doesn't know where a specific frame starts and mpg123 also only knows the general region after it scanned the file.
+ Well, it is tricky...
+*/
+off_t attribute_align_arg mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset)
+{
+ int b;
+ off_t pos;
+
+ pos = mpg123_tell(mh); /* adjusted samples */
+ debug3("seek from %li to %li (whence=%i)", (long)pos, (long)sampleoff, whence);
+ /* The special seek error handling does not apply here... there is no lowlevel I/O. */
+ if(pos < 0) return pos; /* mh == NULL is covered in mpg123_tell() */
+#ifndef NO_FEEDER
+ if(input_offset == NULL)
+ {
+ mh->err = MPG123_NULL_POINTER;
+ return MPG123_ERR;
+ }
+
+ if((b=init_track(mh)) < 0) return b; /* May need more to do anything at all. */
+
+ switch(whence)
+ {
+ case SEEK_CUR: pos += sampleoff; break;
+ case SEEK_SET: pos = sampleoff; break;
+ case SEEK_END:
+ if(mh->track_frames > 0) pos = SAMPLE_ADJUST(mh,frame_outs(mh, mh->track_frames)) - sampleoff;
+#ifdef GAPLESS
+ else if(mh->end_os >= 0) pos = SAMPLE_ADJUST(mh,mh->end_os) - sampleoff;
+#endif
+ else
+ {
+ mh->err = MPG123_NO_SEEK_FROM_END;
+ return MPG123_ERR;
+ }
+ break;
+ default: mh->err = MPG123_BAD_WHENCE; return MPG123_ERR;
+ }
+ if(pos < 0) pos = 0;
+ frame_set_seek(mh, SAMPLE_UNADJUST(mh,pos));
+ pos = SEEKFRAME(mh);
+ mh->buffer.fill = 0;
+
+ /* Shortcuts without modifying input stream. */
+ *input_offset = mh->rdat.buffer.fileoff + mh->rdat.buffer.size;
+ if(mh->num < mh->firstframe) mh->to_decode = FALSE;
+ if(mh->num == pos && mh->to_decode) goto feedseekend;
+ if(mh->num == pos-1) goto feedseekend;
+ /* Whole way. */
+ *input_offset = feed_set_pos(mh, frame_index_find(mh, SEEKFRAME(mh), &pos));
+ mh->num = pos-1; /* The next read frame will have num = pos. */
+ if(*input_offset < 0) return MPG123_ERR;
+
+feedseekend:
+ return mpg123_tell(mh);
+#else
+ mh->err = MPG123_MISSING_FEATURE;
+ return MPG123_ERR;
+#endif
+}
+
+off_t attribute_align_arg mpg123_seek_frame(mpg123_handle *mh, off_t offset, int whence)
+{
+ int b;
+ off_t pos = 0;
+
+ if(mh == NULL) return MPG123_ERR;
+ if((b=init_track(mh)) < 0) return b;
+
+ /* Could play games here with to_decode... */
+ pos = mh->num;
+ switch(whence)
+ {
+ case SEEK_CUR: pos += offset; break;
+ case SEEK_SET: pos = offset; break;
+ case SEEK_END:
+ if(mh->track_frames > 0) pos = mh->track_frames - offset;
+ else
+ {
+ mh->err = MPG123_NO_SEEK_FROM_END;
+ return MPG123_ERR;
+ }
+ break;
+ default:
+ mh->err = MPG123_BAD_WHENCE;
+ return MPG123_ERR;
+ }
+ if(pos < 0) pos = 0;
+ /* Not limiting the possible position on end for the chance that there might be more to the stream than announced via track_frames. */
+
+ frame_set_frameseek(mh, pos);
+ pos = do_the_seek(mh);
+ if(pos < 0) return pos;
+
+ return mpg123_tellframe(mh);
+}
+
+int attribute_align_arg mpg123_set_filesize(mpg123_handle *mh, off_t size)
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+
+ mh->rdat.filelen = size;
+ return MPG123_OK;
+}
+
+off_t attribute_align_arg mpg123_framelength(mpg123_handle *mh)
+{
+ int b;
+ if(mh == NULL)
+ return MPG123_ERR;
+ b = init_track(mh);
+ if(b<0)
+ return b;
+ if(mh->track_frames > 0)
+ return mh->track_frames;
+ if(mh->rdat.filelen > 0)
+ { /* A bad estimate. Ignoring tags 'n stuff. */
+ double bpf = mh->mean_framesize > 0.
+ ? mh->mean_framesize
+ : compute_bpf(mh);
+ return (off_t)((double)(mh->rdat.filelen)/bpf+0.5);
+ }
+ /* Last resort: No view of the future, can at least count the frames that
+ were already parsed. */
+ if(mh->num > -1)
+ return mh->num+1;
+ /* Giving up. */
+ return MPG123_ERR;
+}
+
+off_t attribute_align_arg mpg123_length(mpg123_handle *mh)
+{
+ int b;
+ off_t length;
+
+ if(mh == NULL) return MPG123_ERR;
+ b = init_track(mh);
+ if(b<0) return b;
+ if(mh->track_samples > -1) length = mh->track_samples;
+ else if(mh->track_frames > 0) length = mh->track_frames*mh->spf;
+ else if(mh->rdat.filelen > 0) /* Let the case of 0 length just fall through. */
+ {
+ /* A bad estimate. Ignoring tags 'n stuff. */
+ double bpf = mh->mean_framesize ? mh->mean_framesize : compute_bpf(mh);
+ length = (off_t)((double)(mh->rdat.filelen)/bpf*mh->spf);
+ }
+ else if(mh->rdat.filelen == 0) return mpg123_tell(mh); /* we could be in feeder mode */
+ else return MPG123_ERR; /* No length info there! */
+
+ debug1("mpg123_length: internal sample length: %"OFF_P, (off_p)length);
+
+ length = frame_ins2outs(mh, length);
+ debug1("mpg123_length: external sample length: %"OFF_P, (off_p)length);
+ length = SAMPLE_ADJUST(mh,length);
+ return length;
+}
+
+
+int attribute_align_arg mpg123_scan(mpg123_handle *mh)
+{
+ int b;
+ off_t oldpos;
+ off_t track_frames = 0;
+ off_t track_samples = 0;
+
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+ if(!(mh->rdat.flags & READER_SEEKABLE)){ mh->err = MPG123_NO_SEEK; return MPG123_ERR; }
+ /* Scan through the _whole_ file, since the current position is no count but computed assuming constant samples per frame. */
+ /* Also, we can just keep the current buffer and seek settings. Just operate on input frames here. */
+ debug("issuing scan");
+ b = init_track(mh); /* mh->num >= 0 !! */
+ if(b<0)
+ {
+ if(b == MPG123_DONE) return MPG123_OK;
+ else return MPG123_ERR; /* Must be error here, NEED_MORE is not for seekable streams. */
+ }
+ oldpos = mpg123_tell(mh);
+ b = mh->rd->seek_frame(mh, 0);
+ if(b<0 || mh->num != 0) return MPG123_ERR;
+ /* One frame must be there now. */
+ track_frames = 1;
+ track_samples = mh->spf; /* Internal samples. */
+ debug("TODO: We should disable gapless code when encountering inconsistent mh->spf!");
+ debug(" ... at least unset MPG123_ACCURATE.");
+ /* Do not increment mh->track_frames in the loop as tha would confuse Frankenstein detection. */
+ while(read_frame(mh) == 1)
+ {
+ ++track_frames;
+ track_samples += mh->spf;
+ }
+ mh->track_frames = track_frames;
+ mh->track_samples = track_samples;
+ debug2("Scanning yielded %"OFF_P" track samples, %"OFF_P" frames.", (off_p)mh->track_samples, (off_p)mh->track_frames);
+#ifdef GAPLESS
+ /* Also, think about usefulness of that extra value track_samples ... it could be used for consistency checking. */
+ if(mh->p.flags & MPG123_GAPLESS) frame_gapless_update(mh, mh->track_samples);
+#endif
+ return mpg123_seek(mh, oldpos, SEEK_SET) >= 0 ? MPG123_OK : MPG123_ERR;
+}
+
+int attribute_align_arg mpg123_meta_check(mpg123_handle *mh)
+{
+ if(mh != NULL) return mh->metaflags;
+ else return 0;
+}
+
+void attribute_align_arg mpg123_meta_free(mpg123_handle *mh)
+{
+ if(mh == NULL) return;
+
+ reset_id3(mh);
+ reset_icy(&mh->icy);
+}
+
+int attribute_align_arg mpg123_id3(mpg123_handle *mh, mpg123_id3v1 **v1, mpg123_id3v2 **v2)
+{
+ if(v1 != NULL) *v1 = NULL;
+ if(v2 != NULL) *v2 = NULL;
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+
+ if(mh->metaflags & MPG123_ID3)
+ {
+ id3_link(mh);
+ if(v1 != NULL && mh->rdat.flags & READER_ID3TAG) *v1 = (mpg123_id3v1*) mh->id3buf;
+ if(v2 != NULL)
+#ifdef NO_ID3V2
+ *v2 = NULL;
+#else
+ *v2 = &mh->id3v2;
+#endif
+
+ mh->metaflags |= MPG123_ID3;
+ mh->metaflags &= ~MPG123_NEW_ID3;
+ }
+ return MPG123_OK;
+}
+
+int attribute_align_arg mpg123_id3_raw( mpg123_handle *mh
+, unsigned char **v1, size_t *v1_size
+, unsigned char **v2, size_t *v2_size )
+{
+ if(!mh)
+ return MPG123_ERR;
+ if(v1 != NULL)
+ *v1 = mh->id3buf[0] ? mh->id3buf : NULL;
+ if(v1_size != NULL)
+ *v1_size = mh->id3buf[0] ? 128 : 0;
+ if(v2 != NULL)
+ *v2 = mh->id3v2_raw;
+ if(v2_size != NULL)
+ *v2_size = mh->id3v2_size;
+ return MPG123_OK;
+}
+
+int attribute_align_arg mpg123_icy(mpg123_handle *mh, char **icy_meta)
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+#ifndef NO_ICY
+ if(icy_meta == NULL)
+ {
+ mh->err = MPG123_NULL_POINTER;
+ return MPG123_ERR;
+ }
+ *icy_meta = NULL;
+
+ if(mh->metaflags & MPG123_ICY)
+ {
+ *icy_meta = mh->icy.data;
+ mh->metaflags |= MPG123_ICY;
+ mh->metaflags &= ~MPG123_NEW_ICY;
+ }
+ return MPG123_OK;
+#else
+ mh->err = MPG123_MISSING_FEATURE;
+ return MPG123_ERR;
+#endif
+}
+
+char* attribute_align_arg mpg123_icy2utf8(const char* icy_text)
+{
+#ifndef NO_ICY
+ return icy2utf8(icy_text, 0);
+#else
+ return NULL;
+#endif
+}
+
+/* That one is always defined... it's not worth it to remove it for NO_ID3V2. */
+enum mpg123_text_encoding attribute_align_arg mpg123_enc_from_id3(unsigned char id3_enc_byte)
+{
+ switch(id3_enc_byte)
+ {
+ case mpg123_id3_latin1: return mpg123_text_latin1;
+ case mpg123_id3_utf16bom: return mpg123_text_utf16bom; /* ID3v2.3 has UCS-2 with BOM here. */
+ case mpg123_id3_utf16be: return mpg123_text_utf16be;
+ case mpg123_id3_utf8: return mpg123_text_utf8;
+ default: return mpg123_text_unknown;
+ }
+}
+
+int attribute_align_arg mpg123_enc_from_id3_2(unsigned char id3_enc_byte)
+{
+ return mpg123_enc_from_id3(id3_enc_byte);
+}
+
+#ifndef NO_STRING
+int attribute_align_arg mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size)
+{
+ switch(enc)
+ {
+#ifndef NO_ID3V2
+ /* The encodings we get from ID3v2 tags. */
+ case mpg123_text_utf8:
+ id3_to_utf8(sb, mpg123_id3_utf8, source, source_size, 0);
+ break;
+ case mpg123_text_latin1:
+ id3_to_utf8(sb, mpg123_id3_latin1, source, source_size, 0);
+ break;
+ case mpg123_text_utf16bom:
+ case mpg123_text_utf16:
+ id3_to_utf8(sb, mpg123_id3_utf16bom, source, source_size, 0);
+ break;
+ /* Special because one cannot skip zero bytes here. */
+ case mpg123_text_utf16be:
+ id3_to_utf8(sb, mpg123_id3_utf16be, source, source_size, 0);
+ break;
+#endif
+#ifndef NO_ICY
+ /* ICY encoding... */
+ case mpg123_text_icy:
+ case mpg123_text_cp1252:
+ {
+ mpg123_free_string(sb);
+ /* Paranoia: Make sure that the string ends inside the buffer... */
+ if(source[source_size-1] == 0)
+ {
+ /* Convert from ICY encoding... with force applied or not. */
+ char *tmpstring = icy2utf8((const char*)source, enc == mpg123_text_cp1252 ? 1 : 0);
+ if(tmpstring != NULL)
+ {
+ mpg123_set_string(sb, tmpstring);
+ free(tmpstring);
+ }
+ }
+ }
+ break;
+#endif
+ default:
+ mpg123_free_string(sb);
+ }
+ /* At least a trailing null of some form should be there... */
+ return (sb->fill > 0) ? 1 : 0;
+}
+
+int attribute_align_arg mpg123_store_utf8_2(mpg123_string *sb, int enc, const unsigned char *source, size_t source_size)
+{
+ return mpg123_store_utf8(sb, enc, source, source_size);
+}
+#endif
+
+
+
+int attribute_align_arg mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill)
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+ if(offsets == NULL || step == NULL || fill == NULL)
+ {
+ mh->err = MPG123_BAD_INDEX_PAR;
+ return MPG123_ERR;
+ }
+#ifdef FRAME_INDEX
+ *offsets = mh->index.data;
+ *step = mh->index.step;
+ *fill = mh->index.fill;
+#else
+ *offsets = NULL;
+ *step = 0;
+ *fill = 0;
+#endif
+ return MPG123_OK;
+}
+
+int attribute_align_arg mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill)
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+#ifdef FRAME_INDEX
+ if(step == 0)
+ {
+ mh->err = MPG123_BAD_INDEX_PAR;
+ return MPG123_ERR;
+ }
+ if(fi_set(&mh->index, offsets, step, fill) == -1)
+ {
+ mh->err = MPG123_OUT_OF_MEM;
+ return MPG123_ERR;
+ }
+ return MPG123_OK;
+#else
+ mh->err = MPG123_MISSING_FEATURE;
+ return MPG123_ERR;
+#endif
+}
+
+int attribute_align_arg mpg123_close(mpg123_handle *mh)
+{
+ if(mh == NULL) return MPG123_BAD_HANDLE;
+
+ /* mh->rd is never NULL! */
+ if(mh->rd->close != NULL) mh->rd->close(mh);
+
+ if(mh->new_format)
+ {
+ debug("Hey, we are closing a track before the new format has been queried...");
+ invalidate_format(&mh->af);
+ mh->new_format = 0;
+ }
+ /* Always reset the frame buffers on close, so we cannot forget it in funky opening routines (wrappers, even). */
+ frame_reset(mh);
+ return MPG123_OK;
+}
+
+void attribute_align_arg mpg123_delete(mpg123_handle *mh)
+{
+ if(mh != NULL)
+ {
+ mpg123_close(mh);
+ frame_exit(mh); /* free buffers in frame */
+ free(mh); /* free struct; cast? */
+ }
+}
+
+void attribute_align_arg mpg123_free(void *ptr)
+{
+ free(ptr);
+}
+
+static const char *mpg123_error[] =
+{
+ "No error... (code 0)",
+ "Unable to set up output format! (code 1)",
+ "Invalid channel number specified. (code 2)",
+ "Invalid sample rate specified. (code 3)",
+ "Unable to allocate memory for 16 to 8 converter table! (code 4)",
+ "Bad parameter id! (code 5)",
+ "Bad buffer given -- invalid pointer or too small size. (code 6)",
+ "Out of memory -- some malloc() failed. (code 7)",
+ "You didn't initialize the library! (code 8)",
+ "Invalid decoder choice. (code 9)",
+ "Invalid mpg123 handle. (code 10)",
+ "Unable to initialize frame buffers (out of memory?)! (code 11)",
+ "Invalid RVA mode. (code 12)",
+ "This build doesn't support gapless decoding. (code 13)",
+ "Not enough buffer space. (code 14)",
+ "Incompatible numeric data types. (code 15)",
+ "Bad equalizer band. (code 16)",
+ "Null pointer given where valid storage address needed. (code 17)",
+ "Error reading the stream. (code 18)",
+ "Cannot seek from end (end is not known). (code 19)",
+ "Invalid 'whence' for seek function. (code 20)",
+ "Build does not support stream timeouts. (code 21)",
+ "File access error. (code 22)",
+ "Seek not supported by stream. (code 23)",
+ "No stream opened. (code 24)",
+ "Bad parameter handle. (code 25)",
+ "Invalid parameter addresses for index retrieval. (code 26)",
+ "Lost track in the bytestream and did not attempt resync. (code 27)",
+ "Failed to find valid MPEG data within limit on resync. (code 28)",
+ "No 8bit encoding possible. (code 29)",
+ "Stack alignment is not good. (code 30)",
+ "You gave me a NULL buffer? (code 31)",
+ "File position is screwed up, please do an absolute seek (code 32)",
+ "Inappropriate NULL-pointer provided.",
+ "Bad key value given.",
+ "There is no frame index (disabled in this build).",
+ "Frame index operation failed.",
+ "Decoder setup failed (invalid combination of settings?)",
+ "Feature not in this build."
+ ,"Some bad value has been provided."
+ ,"Low-level seeking has failed (call to lseek(), usually)."
+ ,"Custom I/O obviously not prepared."
+ ,"Overflow in LFS (large file support) conversion."
+ ,"Overflow in integer conversion."
+ ,"Bad IEEE 754 rounding. Re-build libmpg123 properly."
+};
+
+const char* attribute_align_arg mpg123_plain_strerror(int errcode)
+{
+ if(errcode >= 0 && errcode < sizeof(mpg123_error)/sizeof(char*))
+ return mpg123_error[errcode];
+ else switch(errcode)
+ {
+ case MPG123_ERR:
+ return "A generic mpg123 error.";
+ case MPG123_DONE:
+ return "Message: I am done with this track.";
+ case MPG123_NEED_MORE:
+ return "Message: Feed me more input data!";
+ case MPG123_NEW_FORMAT:
+ return "Message: Prepare for a changed audio format (query the new one)!";
+ default:
+ return "I have no idea - an unknown error code!";
+ }
+}
+
+int attribute_align_arg mpg123_errcode(mpg123_handle *mh)
+{
+ if(mh != NULL) return mh->err;
+ return MPG123_BAD_HANDLE;
+}
+
+const char* attribute_align_arg mpg123_strerror(mpg123_handle *mh)
+{
+ return mpg123_plain_strerror(mpg123_errcode(mh));
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/mangle.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/mangle.h
new file mode 100644
index 00000000..e37386ab
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/mangle.h
@@ -0,0 +1,199 @@
+/*
+ mangle: support defines for preprocessed assembler
+
+ copyright 1995-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+
+ This once started out as mangle.h from MPlayer, but you can't really call it derived work... the small part that in principle stems from MPlayer also being not very special (once you decided to use such a header at all, it's quite obvious material).
+*/
+
+#ifndef __MANGLE_H
+#define __MANGLE_H
+
+#include "config.h"
+#include "intsym.h"
+
+#if (defined OPT_I486) || (defined OPT_I586) || (defined OPT_I586_DITHER) \
+ || (defined OPT_MMX) || (defined OPT_SSE) || (defined OPT_3DNOW) || (defined OPT_3DNOWEXT) \
+ || (defined OPT_3DNOW_VINTAGE) || (defined OPT_3DNOWEXT_VINTAGE) \
+ || (defined OPT_SSE_VINTAGE)
+#define OPT_X86
+#endif
+
+#ifdef CCALIGN
+#define MOVUAPS movaps
+#else
+#define MOVUAPS movups
+#endif
+
+/*
+ ALIGNX: align to X bytes
+ This differs per compiler/platform in taking the byte count or an exponent for base 2.
+ A way out is balign, if the assembler supports it (gas extension).
+*/
+
+#ifdef ASMALIGN_BALIGN
+
+#define ALIGN4 .balign 4
+#define ALIGN8 .balign 8
+#define ALIGN16 .balign 16
+#define ALIGN32 .balign 32
+#define ALIGN64 .balign 64
+
+#else
+
+#ifdef ASMALIGN_EXP
+#define ALIGN4 .align 2
+#define ALIGN8 .align 3
+#define ALIGN16 .align 4
+#define ALIGN32 .align 5
+#define ALIGN64 .align 6
+#else
+#ifdef ASMALIGN_BYTE
+#define ALIGN4 .align 4
+#define ALIGN8 .align 8
+#define ALIGN16 .align 16
+#define ALIGN32 .align 32
+#define ALIGN64 .align 64
+#else
+#ifdef ASMALIGN_ARMASM
+#define ALIGN4 ALIGN 4
+#define ALIGN8 ALIGN 8
+#define ALIGN16 ALIGN 16
+#define ALIGN32 ALIGN 32
+#define ALIGN64 ALIGN 64
+#else
+#error "Dunno how assembler alignment works. Please specify."
+#endif
+#endif
+#endif
+
+#endif
+
+#define MANGLE_MACROCAT_REALLY(a, b) a ## b
+#define MANGLE_MACROCAT(a, b) MANGLE_MACROCAT_REALLY(a, b)
+/* Feel free to add more to the list, eg. a.out IMO */
+#if defined(__USER_LABEL_PREFIX__)
+#define ASM_NAME(a) MANGLE_MACROCAT(__USER_LABEL_PREFIX__,a)
+#define ASM_VALUE(a) MANGLE_MACROCAT($,ASM_NAME(a))
+#elif defined(__CYGWIN__) || defined(_WIN32) && !defined (_WIN64) && !defined (_M_ARM) || defined(__OS2__) || \
+ (defined(__OpenBSD__) && !defined(__ELF__)) || defined(__APPLE__)
+#define ASM_NAME(a) MANGLE_MACROCAT(_,a)
+#define ASM_VALUE(a) MANGLE_MACROCAT($_,a)
+#else
+#define ASM_NAME(a) a
+#define ASM_VALUE(a) MANGLE_MACROCAT($,a)
+#endif
+
+/* Enable position-independent code for certain platforms. */
+
+#if defined(OPT_X86)
+
+#define _EBX_ %ebx
+
+#if defined(PIC) && defined(__ELF__)
+
+/* ELF binaries (Unix/Linux) */
+#define LOCAL_VAR(a) a ## @GOTOFF(_EBX_)
+#define GLOBAL_VAR(a) ASM_NAME(a) ## @GOTOFF(_EBX_)
+#define GLOBAL_VAR_PTR(a) ASM_NAME(a) ## @GOT(_EBX_)
+#define FUNC(a) ASM_NAME(a)
+#define EXTERNAL_FUNC(a) ASM_NAME(a) ## @PLT
+#undef ASM_VALUE
+#define ASM_VALUE(a) MANGLE_MACROCAT($,a) ##@GOTOFF
+#define GET_GOT \
+ call 1f; \
+1: \
+ pop _EBX_; \
+2: \
+ addl $_GLOBAL_OFFSET_TABLE_ + (2b-1b), _EBX_
+#define PREPARE_GOT pushl _EBX_
+#define RESTORE_GOT popl _EBX_
+
+#elif defined(PIC) && defined(__APPLE__)
+
+/* Mach-O binaries (OSX/iOS) */
+#define LOCAL_VAR(a) a ## - Lpic_base(_EBX_)
+#define GLOBAL_VAR(a) .err This ABI cannot access non-local symbols directly.
+#define GLOBAL_VAR_PTR(a) L_ ## a ## - Lpic_base(_EBX_)
+#define FUNC(a) L_ ## a
+#define EXTERNAL_FUNC(a) L_ ## a
+#define GET_GOT \
+ call Lpic_base; \
+Lpic_base: \
+ pop _EBX_
+#define PREPARE_GOT pushl _EBX_
+#define RESTORE_GOT popl _EBX_
+
+#else
+
+/* Dummies for everyone else. */
+#define LOCAL_VAR(a) a
+#define GLOBAL_VAR ASM_NAME
+#define GLOBAL_VAR_PTR(a) .err Cannot use indirect addressing in non-PIC object.
+#define FUNC ASM_NAME
+#define EXTERNAL_FUNC ASM_NAME
+#define GET_GOT
+#define PREPARE_GOT
+#define RESTORE_GOT
+
+#endif /* PIC variants */
+
+#endif /* OPT_X86 */
+
+#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__)
+#define COMM(a,b,c) .comm a,b
+#else
+#define COMM(a,b,c) .comm a,b,c
+#endif
+/* more hacks for macosx; no .bss ... */
+#ifdef __APPLE__
+#define BSS .data
+#else
+#define BSS .bss
+#endif
+
+/* armasm for WIN32 UWP */
+#ifdef _M_ARM
+#define GLOBAL_SYMBOL EXPORT
+#else
+#define GLOBAL_SYMBOL .globl
+#endif
+
+/* Mark non-executable stack.
+ It's mainly for GNU on Linux... who else does (not) like this? */
+#if !defined(__SUNPRO_C) && defined(__linux__) && defined(__ELF__)
+#if defined(__arm__)
+#define NONEXEC_STACK .section .note.GNU-stack,"",%progbits
+#else
+#define NONEXEC_STACK .section .note.GNU-stack,"",@progbits
+#endif
+#else
+#define NONEXEC_STACK
+#endif
+
+#if (defined(__x86_64__) || defined(_M_X64)) && (defined(_WIN64) || defined (__CYGWIN__))
+#define IS_MSABI 1 /* Not using SYSV */
+#endif
+
+/* Macros for +-4GiB PC-relative addressing on AArch64 */
+#ifdef __APPLE__
+#define AARCH64_PCREL_HI(label) label@PAGE
+#define AARCH64_PCREL_LO(label) label@PAGEOFF
+#else
+#define AARCH64_PCREL_HI(label) label
+#define AARCH64_PCREL_LO(label) :lo12:label
+#endif
+
+#ifdef __APPLE__
+#define AARCH64_DUP_4S(dst, src, elem) dup.4s dst, src[elem]
+#define AARCH64_DUP_2D(dst, src, elem) dup.2d dst, src[elem]
+#define AARCH64_SQXTN2_8H(dst, src) sqxtn2.8h dst, src
+#else
+#define AARCH64_DUP_4S(dst, src, elem) dup dst.4s, src.s[elem]
+#define AARCH64_DUP_2D(dst, src, elem) dup dst.2d, src.d[elem]
+#define AARCH64_SQXTN2_8H(dst, src) sqxtn2 dst.8h, src.4s
+#endif
+
+#endif /* !__MANGLE_H */
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/mpeghead.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/mpeghead.h
new file mode 100644
index 00000000..7696df74
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/mpeghead.h
@@ -0,0 +1,89 @@
+/*
+ mpeghead: the bits of an MPEG frame header
+
+ copyright ?-2011 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp & Thomas Orgis (from parse.c)
+*/
+#ifndef MPG123_MPEGHEAD_H
+#define MPG123_MPEGHEAD_H
+
+/*
+ Avoid human error, let perl do the work of dissecting an MPEG header into parts.
+ To be clear: Never edit the following definitions by hand, modify the code block inside this comment and run it through perl instead!
+
+ $head = "AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM";
+ %parts = qw(A sync B version C layer D crc E bitrate F samplerate G padding H private I channel J chanex K copyright L original M emphasis);
+ for(sort keys %parts)
+ {
+ $name = uc($parts{$_});
+ $bits = $head;
+ $bits =~ s/$_/1/g;
+ $bits =~ s/[^1 ]/0/g;
+ print "\/\* $bits \*\/\n";
+ $bits =~ s/\s//g;
+ print "#define HDR_$name".(" " x (18-length($name))).sprintf("0x%08x", eval("0b$bits"))."\n";
+ $bits =~ m/(0*)$/;
+ print "#define HDR_${name}_VAL(h)".(" " x (11-length($name)))."(((h)\&HDR_$name) >> ".length($1).")\n";
+ }
+*/
+
+/* 11111111 11100000 00000000 00000000 */
+#define HDR_SYNC 0xffe00000
+#define HDR_SYNC_VAL(h) (((h)&HDR_SYNC) >> 21)
+/* 00000000 00011000 00000000 00000000 */
+#define HDR_VERSION 0x00180000
+#define HDR_VERSION_VAL(h) (((h)&HDR_VERSION) >> 19)
+/* 00000000 00000110 00000000 00000000 */
+#define HDR_LAYER 0x00060000
+#define HDR_LAYER_VAL(h) (((h)&HDR_LAYER) >> 17)
+/* 00000000 00000001 00000000 00000000 */
+#define HDR_CRC 0x00010000
+#define HDR_CRC_VAL(h) (((h)&HDR_CRC) >> 16)
+/* 00000000 00000000 11110000 00000000 */
+#define HDR_BITRATE 0x0000f000
+#define HDR_BITRATE_VAL(h) (((h)&HDR_BITRATE) >> 12)
+/* 00000000 00000000 00001100 00000000 */
+#define HDR_SAMPLERATE 0x00000c00
+#define HDR_SAMPLERATE_VAL(h) (((h)&HDR_SAMPLERATE) >> 10)
+/* 00000000 00000000 00000010 00000000 */
+#define HDR_PADDING 0x00000200
+#define HDR_PADDING_VAL(h) (((h)&HDR_PADDING) >> 9)
+/* 00000000 00000000 00000001 00000000 */
+#define HDR_PRIVATE 0x00000100
+#define HDR_PRIVATE_VAL(h) (((h)&HDR_PRIVATE) >> 8)
+/* 00000000 00000000 00000000 11000000 */
+#define HDR_CHANNEL 0x000000c0
+#define HDR_CHANNEL_VAL(h) (((h)&HDR_CHANNEL) >> 6)
+/* 00000000 00000000 00000000 00110000 */
+#define HDR_CHANEX 0x00000030
+#define HDR_CHANEX_VAL(h) (((h)&HDR_CHANEX) >> 4)
+/* 00000000 00000000 00000000 00001000 */
+#define HDR_COPYRIGHT 0x00000008
+#define HDR_COPYRIGHT_VAL(h) (((h)&HDR_COPYRIGHT) >> 3)
+/* 00000000 00000000 00000000 00000100 */
+#define HDR_ORIGINAL 0x00000004
+#define HDR_ORIGINAL_VAL(h) (((h)&HDR_ORIGINAL) >> 2)
+/* 00000000 00000000 00000000 00000011 */
+#define HDR_EMPHASIS 0x00000003
+#define HDR_EMPHASIS_VAL(h) (((h)&HDR_EMPHASIS) >> 0)
+
+/*
+ A generic mask for telling if a header is somewhat valid for the current stream.
+ Meaning: Most basic info is not allowed to change.
+ Checking of channel count needs to be done, too, though. So,
+ if channel count matches, frames are decoded the same way: frame buffers and decoding
+ routines can stay the same, especially frame buffers (think spf * channels!).
+*/
+#define HDR_CMPMASK (HDR_SYNC|HDR_VERSION|HDR_LAYER|HDR_SAMPLERATE)
+
+/* A stricter mask, for matching free format headers. */
+#define HDR_SAMEMASK (HDR_SYNC|HDR_VERSION|HDR_LAYER|HDR_BITRATE|HDR_SAMPLERATE|HDR_CHANNEL)
+
+/* Free format headers have zero bitrate value. */
+#define HDR_FREE_FORMAT(head) (!(head & HDR_BITRATE))
+
+/* A mask for changed sampling rate (version or rate bits). */
+#define HDR_SAMPMASK (HDR_VERSION|HDR_SAMPLERATE)
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/mpg123.h.in b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/mpg123.h.in
new file mode 100644
index 00000000..1fca4585
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/mpg123.h.in
@@ -0,0 +1,2033 @@
+/*
+ libmpg123: MPEG Audio Decoder library (version @PACKAGE_VERSION@)
+
+ copyright 1995-2015 by the mpg123 project
+ free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+*/
+
+#ifndef MPG123_LIB_H
+#define MPG123_LIB_H
+
+#if 0 /* OpenMPT */
+#include <fmt123.h>
+#endif /* OpenMPT */
+#include "fmt123.h" /* OpenMPT */
+
+/** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */
+
+/** A macro to check at compile time which set of API functions to expect.
+ * This should be incremented at least each time a new symbol is added
+ * to the header.
+ */
+#ifndef MPG123_API_VERSION
+#define MPG123_API_VERSION @API_VERSION@
+#endif
+
+#ifndef MPG123_EXPORT
+/** Defines needed for MS Visual Studio(tm) DLL builds.
+ * Every public function must be prefixed with MPG123_EXPORT. When building
+ * the DLL ensure to define BUILD_MPG123_DLL. This makes the function accessible
+ * for clients and includes it in the import library which is created together
+ * with the DLL. When consuming the DLL ensure to define LINK_MPG123_DLL which
+ * imports the functions from the DLL.
+ */
+#ifdef BUILD_MPG123_DLL
+/* The dll exports. */
+#define MPG123_EXPORT __declspec(dllexport)
+#else
+#ifdef LINK_MPG123_DLL
+/* The exe imports. */
+#define MPG123_EXPORT __declspec(dllimport)
+#else
+/* Nothing on normal/UNIX builds */
+#define MPG123_EXPORT
+#endif
+#endif
+#endif
+
+/** Earlier versions of libmpg123 put enums into public API calls,
+ * thich is not exactly safe. There are ABI rules, but you can use
+ * compiler switches to change the sizes of enums. It is safer not
+ * to have them in API calls. Thus, the default is to remap calls and
+ * structs to variants that use plain ints. Define MPG123_ENUM_API to
+ * prevent that remapping.
+ *
+ * You might want to define this to increase the chance of your binary
+ * working with an older version of the library. But if that is your goal,
+ * you should better build with an older version to begin with.
+ */
+#ifndef MPG123_ENUM_API
+
+#define mpg123_param mpg123_param2
+#define mpg123_getparam mpg123_getparam2
+#define mpg123_feature mpg123_feature2
+#define mpg123_eq mpg123_eq2
+#define mpg123_geteq mpg123_geteq2
+#define mpg123_frameinfo mpg123_frameinfo2
+#define mpg123_info mpg123_info2
+#define mpg123_getstate mpg123_getstate2
+#define mpg123_enc_from_id3 mpg123_enc_from_id3_2
+#define mpg123_store_utf8 mpg123_store_utf8_2
+#define mpg123_par mpg123_par2
+#define mpg123_getpar mpg123_getpar2
+
+#endif
+
+/* You can use this file directly, avoiding the autoconf replacements.
+ Might have to set MPG123_NO_LARGENAME, too, in case you have
+ _FILE_OFFSET_BITS defined where it does not make sense. */
+#ifndef MPG123_NO_CONFIGURE
+
+@INCLUDE_STDLIB_H@
+@INCLUDE_SYS_TYPE_H@
+
+/* A little hack to help MSVC not having ssize_t. */
+#ifdef _MSC_VER
+#include <stddef.h>
+typedef ptrdiff_t mpg123_ssize_t;
+#else
+typedef ssize_t mpg123_ssize_t;
+#endif
+
+/* You can always enforce largefile hackery by setting MPG123_LARGESUFFIX. */
+/* Otherwise, this header disables it if the build system decided so. */
+#if !defined(MPG123_LARGESUFFIX) && @BUILD_NO_LARGENAME@
+#ifndef MPG123_NO_LARGENAME
+#define MPG123_NO_LARGENAME
+#endif
+#endif
+
+#endif /* MPG123_NO_CONFIGURE */
+
+/* Simplified large file handling.
+ I used to have a check here that prevents building for a library with conflicting large file setup
+ (application that uses 32 bit offsets with library that uses 64 bits).
+ While that was perfectly fine in an environment where there is one incarnation of the library,
+ it hurt GNU/Linux and Solaris systems with multilib where the distribution fails to provide the
+ correct header matching the 32 bit library (where large files need explicit support) or
+ the 64 bit library (where there is no distinction).
+
+ New approach: When the app defines _FILE_OFFSET_BITS, it wants non-default large file support,
+ and thus functions with added suffix (mpg123_open_64).
+ Any mismatch will be caught at link time because of the _FILE_OFFSET_BITS setting used when
+ building libmpg123. Plus, there's dual mode large file support in mpg123 since 1.12 now.
+ Link failure is not the expected outcome of any half-sane usage anymore.
+
+ More complication: What about client code defining _LARGEFILE64_SOURCE? It might want direct access to the _64 functions, along with the ones without suffix. Well, that's possible now via defining MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling or enforcing the suffix names.
+*/
+
+/*
+ Now, the renaming of large file aware functions.
+ By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME.
+*/
+#if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX))
+
+/* Need some trickery to concatenate the value(s) of the given macro(s). */
+#define MPG123_MACROCAT_REALLY(a, b) a ## b
+#define MPG123_MACROCAT(a, b) MPG123_MACROCAT_REALLY(a, b)
+#ifndef MPG123_LARGESUFFIX
+#define MPG123_LARGESUFFIX MPG123_MACROCAT(_, _FILE_OFFSET_BITS)
+#endif
+#define MPG123_LARGENAME(func) MPG123_MACROCAT(func, MPG123_LARGESUFFIX)
+
+#define mpg123_open_fixed MPG123_LARGENAME(mpg123_open_fixed)
+#define mpg123_open MPG123_LARGENAME(mpg123_open)
+#define mpg123_open_fd MPG123_LARGENAME(mpg123_open_fd)
+#define mpg123_open_handle MPG123_LARGENAME(mpg123_open_handle)
+#define mpg123_framebyframe_decode MPG123_LARGENAME(mpg123_framebyframe_decode)
+#define mpg123_decode_frame MPG123_LARGENAME(mpg123_decode_frame)
+#define mpg123_tell MPG123_LARGENAME(mpg123_tell)
+#define mpg123_tellframe MPG123_LARGENAME(mpg123_tellframe)
+#define mpg123_tell_stream MPG123_LARGENAME(mpg123_tell_stream)
+#define mpg123_seek MPG123_LARGENAME(mpg123_seek)
+#define mpg123_feedseek MPG123_LARGENAME(mpg123_feedseek)
+#define mpg123_seek_frame MPG123_LARGENAME(mpg123_seek_frame)
+#define mpg123_timeframe MPG123_LARGENAME(mpg123_timeframe)
+#define mpg123_index MPG123_LARGENAME(mpg123_index)
+#define mpg123_set_index MPG123_LARGENAME(mpg123_set_index)
+#define mpg123_position MPG123_LARGENAME(mpg123_position)
+#define mpg123_length MPG123_LARGENAME(mpg123_length)
+#define mpg123_framelength MPG123_LARGENAME(mpg123_framelength)
+#define mpg123_set_filesize MPG123_LARGENAME(mpg123_set_filesize)
+#define mpg123_replace_reader MPG123_LARGENAME(mpg123_replace_reader)
+#define mpg123_replace_reader_handle MPG123_LARGENAME(mpg123_replace_reader_handle)
+#define mpg123_framepos MPG123_LARGENAME(mpg123_framepos)
+
+#endif /* largefile hackery */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** \defgroup mpg123_init mpg123 library and handle setup
+ *
+ * Functions to initialise and shutdown the mpg123 library and handles.
+ * The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-)
+ * Tip: Use a RVA setting...
+ *
+ * @{
+ */
+
+/** Opaque structure for the libmpg123 decoder handle. */
+struct mpg123_handle_struct;
+
+/** Opaque structure for the libmpg123 decoder handle.
+ * Most functions take a pointer to a mpg123_handle as first argument and operate on its data in an object-oriented manner.
+ */
+typedef struct mpg123_handle_struct mpg123_handle;
+
+/** Useless no-op that used to do initialization work.
+ *
+ * For API version before 46 (mpg123 1.27.0), you had to ensure to have
+ * this called once before creating a handle. To be pure, this had to
+ * happen in a single-threaded context, too (while in practice, there was no
+ * harm done possibly racing to compute the same numbers again).
+ *
+ * Now this function really does nothing anymore. The only reason to call
+ * it is to be compatible with old versions of the library that still require
+ * it.
+ *
+ * \return MPG123_OK if successful, otherwise an error number.
+ */
+MPG123_EXPORT int mpg123_init(void);
+
+/** Superfluous Function to close down the mpg123 library.
+ * This was created with the thought that there sometime will be cleanup code
+ * to be run after library use. This never materialized. You can forget about
+ * this function and it is only here for old programs that do call it.
+ */
+MPG123_EXPORT void mpg123_exit(void);
+
+/** Create a handle with optional choice of decoder (named by a string, see mpg123_decoders() or mpg123_supported_decoders()).
+ * and optional retrieval of an error code to feed to mpg123_plain_strerror().
+ * Optional means: Any of or both the parameters may be NULL.
+ *
+ * \param decoder optional choice of decoder variant (NULL for default)
+ * \param error optional address to store error codes
+ * \return Non-NULL pointer to fresh handle when successful.
+ */
+MPG123_EXPORT mpg123_handle *mpg123_new(const char* decoder, int *error);
+
+/** Delete handle, mh is either a valid mpg123 handle or NULL.
+ * \param mh handle
+ */
+MPG123_EXPORT void mpg123_delete(mpg123_handle *mh);
+
+/** Free plain memory allocated within libmpg123.
+ * This is for library users that are not sure to use the same underlying
+ * memory allocator as libmpg123. It is just a wrapper over free() in
+ * the underlying C library.
+ */
+MPG123_EXPORT void mpg123_free(void *ptr);
+
+/** Enumeration of the parameters types that it is possible to set/get. */
+enum mpg123_parms
+{
+ MPG123_VERBOSE = 0, /**< set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) */
+ MPG123_FLAGS, /**< set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) */
+ MPG123_ADD_FLAGS, /**< add some flags (integer) */
+ MPG123_FORCE_RATE, /**< when value > 0, force output rate to that value (integer) */
+ MPG123_DOWN_SAMPLE, /**< 0=native rate, 1=half rate, 2=quarter rate (integer) */
+ MPG123_RVA, /**< one of the RVA choices above (integer) */
+ MPG123_DOWNSPEED, /**< play a frame N times (integer) */
+ MPG123_UPSPEED, /**< play every Nth frame (integer) */
+ MPG123_START_FRAME, /**< start with this frame (skip frames before that, integer) */
+ MPG123_DECODE_FRAMES, /**< decode only this number of frames (integer) */
+ MPG123_ICY_INTERVAL, /**< Stream contains ICY metadata with this interval (integer).
+ Make sure to set this _before_ opening a stream.*/
+ MPG123_OUTSCALE, /**< the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) */
+ MPG123_TIMEOUT, /**< timeout for reading from a stream (not supported on win32, integer) */
+ MPG123_REMOVE_FLAGS, /**< remove some flags (inverse of MPG123_ADD_FLAGS, integer) */
+ MPG123_RESYNC_LIMIT, /**< Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). This can enlarge the limit for skipping junk on beginning, too (but not reduce it). */
+ MPG123_INDEX_SIZE /**< Set the frame index size (if supported). Values <0 mean that the index is allowed to grow dynamically in these steps (in positive direction, of course) -- Use this when you really want a full index with every individual frame. */
+ ,MPG123_PREFRAMES /**< Decode/ignore that many frames in advance for layer 3. This is needed to fill bit reservoir after seeking, for example (but also at least one frame in advance is needed to have all "normal" data for layer 3). Give a positive integer value, please.*/
+ ,MPG123_FEEDPOOL /**< For feeder mode, keep that many buffers in a pool to avoid frequent malloc/free. The pool is allocated on mpg123_open_feed(). If you change this parameter afterwards, you can trigger growth and shrinkage during decoding. The default value could change any time. If you care about this, then set it. (integer) */
+ ,MPG123_FEEDBUFFER /**< Minimal size of one internal feeder buffer, again, the default value is subject to change. (integer) */
+ ,MPG123_FREEFORMAT_SIZE /**< Tell the parser a free-format frame size to
+ * avoid read-ahead to get it. A value of -1 (default) means that the parser
+ * will determine it. The parameter value is applied during decoder setup
+ * for a freshly opened stream only.
+ */
+};
+
+/** Flag bits for MPG123_FLAGS, use the usual binary or to combine. */
+enum mpg123_param_flags
+{
+ MPG123_FORCE_MONO = 0x7 /**< 0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. */
+ ,MPG123_MONO_LEFT = 0x1 /**< 0001 Force playback of left channel only. */
+ ,MPG123_MONO_RIGHT = 0x2 /**< 0010 Force playback of right channel only. */
+ ,MPG123_MONO_MIX = 0x4 /**< 0100 Force playback of mixed mono. */
+ ,MPG123_FORCE_STEREO = 0x8 /**< 1000 Force stereo output. */
+ ,MPG123_FORCE_8BIT = 0x10 /**< 00010000 Force 8bit formats. */
+ ,MPG123_QUIET = 0x20 /**< 00100000 Suppress any printouts (overrules verbose). */
+ ,MPG123_GAPLESS = 0x40 /**< 01000000 Enable gapless decoding (default on if libmpg123 has support). */
+ ,MPG123_NO_RESYNC = 0x80 /**< 10000000 Disable resync stream after error. */
+ ,MPG123_SEEKBUFFER = 0x100 /**< 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). */
+ ,MPG123_FUZZY = 0x200 /**< 001000000000 Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC) */
+ ,MPG123_FORCE_FLOAT = 0x400 /**< 010000000000 Force floating point output (32 or 64 bits depends on mpg123 internal precision). */
+ ,MPG123_PLAIN_ID3TEXT = 0x800 /**< 100000000000 Do not translate ID3 text data to UTF-8. ID3 strings will contain the raw text data, with the first byte containing the ID3 encoding code. */
+ ,MPG123_IGNORE_STREAMLENGTH = 0x1000 /**< 1000000000000 Ignore any stream length information contained in the stream, which can be contained in a 'TLEN' frame of an ID3v2 tag or a Xing tag */
+ ,MPG123_SKIP_ID3V2 = 0x2000 /**< 10 0000 0000 0000 Do not parse ID3v2 tags, just skip them. */
+ ,MPG123_IGNORE_INFOFRAME = 0x4000 /**< 100 0000 0000 0000 Do not parse the LAME/Xing info frame, treat it as normal MPEG data. */
+ ,MPG123_AUTO_RESAMPLE = 0x8000 /**< 1000 0000 0000 0000 Allow automatic internal resampling of any kind (default on if supported). Especially when going lowlevel with replacing output buffer, you might want to unset this flag. Setting MPG123_DOWNSAMPLE or MPG123_FORCE_RATE will override this. */
+ ,MPG123_PICTURE = 0x10000 /**< 17th bit: Enable storage of pictures from tags (ID3v2 APIC). */
+ ,MPG123_NO_PEEK_END = 0x20000 /**< 18th bit: Do not seek to the end of
+ * the stream in order to probe
+ * the stream length and search for the id3v1 field. This also means
+ * the file size is unknown unless set using mpg123_set_filesize() and
+ * the stream is assumed as non-seekable unless overridden.
+ */
+ ,MPG123_FORCE_SEEKABLE = 0x40000 /**< 19th bit: Force the stream to be seekable. */
+ ,MPG123_STORE_RAW_ID3 = 0x80000 /**< store raw ID3 data (even if skipping) */
+ ,MPG123_FORCE_ENDIAN = 0x100000 /**< Enforce endianess of output samples.
+ * This is not reflected in the format codes. If this flag is set along with
+ * MPG123_BIG_ENDIAN, MPG123_ENC_SIGNED16 means s16be, without
+ * MPG123_BIG_ENDIAN, it means s16le. Normal operation without
+ * MPG123_FORCE_ENDIAN produces output in native byte order.
+ */
+ ,MPG123_BIG_ENDIAN = 0x200000 /**< Choose big endian instead of little. */
+ ,MPG123_NO_READAHEAD = 0x400000 /**< Disable read-ahead in parser. If
+ * you know you provide full frames to the feeder API, this enables
+ * decoder output from the first one on, instead of having to wait for
+ * the next frame to confirm that the stream is healthy. It also disables
+ * free format support unless you provide a frame size using
+ * MPG123_FREEFORMAT_SIZE.
+ */
+ ,MPG123_FLOAT_FALLBACK = 0x800000 /**< Consider floating point output encoding only after
+ * trying other (possibly downsampled) rates and encodings first. This is to
+ * support efficient playback where floating point output is only configured for
+ * an external resampler, bypassing that resampler when the desired rate can
+ * be produced directly. This is enabled by default to be closer to older versions
+ * of libmpg123 which did not enable float automatically at all. If disabled,
+ * float is considered after the 16 bit default and higher-bit integer encodings
+ * for any rate. */
+ ,MPG123_NO_FRANKENSTEIN = 0x1000000 /**< Disable support for Frankenstein streams
+ * (different MPEG streams stiched together). Do not accept serious change of MPEG
+ * header inside a single stream. With this flag, the audio output format cannot
+ * change during decoding unless you open a new stream. This also stops decoding
+ * after an announced end of stream (Info header contained a number of frames
+ * and this number has been reached). This makes your MP3 files behave more like
+ * ordinary media files with defined structure, rather than stream dumps with
+ * some sugar. */
+};
+
+/** choices for MPG123_RVA */
+enum mpg123_param_rva
+{
+ MPG123_RVA_OFF = 0 /**< RVA disabled (default). */
+ ,MPG123_RVA_MIX = 1 /**< Use mix/track/radio gain. */
+ ,MPG123_RVA_ALBUM = 2 /**< Use album/audiophile gain */
+ ,MPG123_RVA_MAX = MPG123_RVA_ALBUM /**< The maximum RVA code, may increase in future. */
+};
+
+#ifdef MPG123_ENUM_API
+/** Set a specific parameter on a handle.
+ *
+ * Note that this name is mapped to mpg123_param2() instead unless
+ * MPG123_ENUM_API is defined.
+ *
+ * \param mh handle
+ * \param type parameter choice
+ * \param value integer value
+ * \param fvalue floating point value
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_param( mpg123_handle *mh
+, enum mpg123_parms type, long value, double fvalue );
+#endif
+
+/** Set a specific parameter on a handle. No enums.
+ *
+ * This is actually called instead of mpg123_param()
+ * unless MPG123_ENUM_API is defined.
+ *
+ * \param mh handle
+ * \param type parameter choice (from enum #mpg123_parms)
+ * \param value integer value
+ * \param fvalue floating point value
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_param2( mpg123_handle *mh
+, int type, long value, double fvalue );
+
+#ifdef MPG123_ENUM_API
+/** Get a specific parameter from a handle.
+ *
+ * Note that this name is mapped to mpg123_getparam2() instead unless
+ * MPG123_ENUM_API is defined.
+ *
+ * \param mh handle
+ * \param type parameter choice
+ * \param value integer value return address
+ * \param fvalue floating point value return address
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_getparam( mpg123_handle *mh
+, enum mpg123_parms type, long *value, double *fvalue );
+#endif
+
+/** Get a specific parameter from a handle. No enums.
+ *
+ * This is actually called instead of mpg123_getparam() unless MPG123_ENUM_API
+ * is defined.
+ *
+ * \param mh handle
+ * \param type parameter choice (from enum #mpg123_parms)
+ * \param value integer value return address
+ * \param fvalue floating point value return address
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_getparam2( mpg123_handle *mh
+, int type, long *value, double *fvalue );
+
+/** Feature set available for query with mpg123_feature. */
+enum mpg123_feature_set
+{
+ MPG123_FEATURE_ABI_UTF8OPEN = 0 /**< mpg123 expects path names to be given in UTF-8 encoding instead of plain native. */
+ ,MPG123_FEATURE_OUTPUT_8BIT /**< 8bit output */
+ ,MPG123_FEATURE_OUTPUT_16BIT /**< 16bit output */
+ ,MPG123_FEATURE_OUTPUT_32BIT /**< 32bit output */
+ ,MPG123_FEATURE_INDEX /**< support for building a frame index for accurate seeking */
+ ,MPG123_FEATURE_PARSE_ID3V2 /**< id3v2 parsing */
+ ,MPG123_FEATURE_DECODE_LAYER1 /**< mpeg layer-1 decoder enabled */
+ ,MPG123_FEATURE_DECODE_LAYER2 /**< mpeg layer-2 decoder enabled */
+ ,MPG123_FEATURE_DECODE_LAYER3 /**< mpeg layer-3 decoder enabled */
+ ,MPG123_FEATURE_DECODE_ACCURATE /**< accurate decoder rounding */
+ ,MPG123_FEATURE_DECODE_DOWNSAMPLE /**< downsample (sample omit) */
+ ,MPG123_FEATURE_DECODE_NTOM /**< flexible rate decoding */
+ ,MPG123_FEATURE_PARSE_ICY /**< ICY support */
+ ,MPG123_FEATURE_TIMEOUT_READ /**< Reader with timeout (network). */
+ ,MPG123_FEATURE_EQUALIZER /**< tunable equalizer */
+ ,MPG123_FEATURE_MOREINFO /**< more info extraction (for frame analyzer) */
+ ,MPG123_FEATURE_OUTPUT_FLOAT32 /**< 32 bit float output */
+ ,MPG123_FEATURE_OUTPUT_FLOAT64 /**< 64 bit float output (as of now: never!) */
+};
+
+#ifdef MPG123_ENUM_API
+/** Query libmpg123 features.
+ *
+ * Note that this name is mapped to mpg123_feature2() instead unless
+ * MPG123_ENUM_API is defined.
+ *
+ * \param key feature selection
+ * \return 1 for success, 0 for unimplemented functions
+ */
+MPG123_EXPORT int mpg123_feature(const enum mpg123_feature_set key);
+#endif
+
+/** Query libmpg123 features. No enums.
+ *
+ * This is actually called instead of mpg123_feature() unless MPG123_ENUM_API
+ * is defined.
+ *
+ * \param key feature selection (from enum #mpg123_feature_set)
+ * \return 1 for success, 0 for unimplemented functions
+ */
+MPG123_EXPORT int mpg123_feature2(int key);
+
+/** @} */
+
+
+/** \defgroup mpg123_error mpg123 error handling
+ *
+ * Functions to get text version of the error numbers and an enumeration
+ * of the error codes returned by libmpg123.
+ *
+ * Most functions operating on a mpg123_handle simply return MPG123_OK (0)
+ * on success and MPG123_ERR (-1) on failure, setting the internal error
+ * variable of the handle to the specific error code. If there was not a valid
+ * (non-NULL) handle provided to a function operating on one, MPG123_BAD_HANDLE
+ * may be returned if this can not be confused with a valid positive return
+ * value.
+ * Meaning: A function expected to return positive integers on success will
+ * always indicate error or a special condition by returning a negative one.
+ *
+ * Decoding/seek functions may also return message codes MPG123_DONE,
+ * MPG123_NEW_FORMAT and MPG123_NEED_MORE (all negative, see below on how to
+ * react). Note that calls to those can be nested, so generally watch out
+ * for these codes after initial handle setup.
+ * Especially any function that needs information about the current stream
+ * to work will try to at least parse the beginning if that did not happen
+ * yet.
+ *
+ * On a function that is supposed to return MPG123_OK on success and
+ * MPG123_ERR on failure, make sure you check for != MPG123_OK, not
+ * == MPG123_ERR, as the error code could get more specific in future,
+ * or there is just a special message from a decoding routine as indicated
+ * above.
+ *
+ * @{
+ */
+
+/** Enumeration of the message and error codes and returned by libmpg123 functions. */
+enum mpg123_errors
+{
+ MPG123_DONE=-12, /**< Message: Track ended. Stop decoding. */
+ MPG123_NEW_FORMAT=-11, /**< Message: Output format will be different on next call. Note that some libmpg123 versions between 1.4.3 and 1.8.0 insist on you calling mpg123_getformat() after getting this message code. Newer verisons behave like advertised: You have the chance to call mpg123_getformat(), but you can also just continue decoding and get your data. */
+ MPG123_NEED_MORE=-10, /**< Message: For feed reader: "Feed me more!" (call mpg123_feed() or mpg123_decode() with some new input data). */
+ MPG123_ERR=-1, /**< Generic Error */
+ MPG123_OK=0, /**< Success */
+ MPG123_BAD_OUTFORMAT, /**< Unable to set up output format! */
+ MPG123_BAD_CHANNEL, /**< Invalid channel number specified. */
+ MPG123_BAD_RATE, /**< Invalid sample rate specified. */
+ MPG123_ERR_16TO8TABLE, /**< Unable to allocate memory for 16 to 8 converter table! */
+ MPG123_BAD_PARAM, /**< Bad parameter id! */
+ MPG123_BAD_BUFFER, /**< Bad buffer given -- invalid pointer or too small size. */
+ MPG123_OUT_OF_MEM, /**< Out of memory -- some malloc() failed. */
+ MPG123_NOT_INITIALIZED, /**< You didn't initialize the library! */
+ MPG123_BAD_DECODER, /**< Invalid decoder choice. */
+ MPG123_BAD_HANDLE, /**< Invalid mpg123 handle. */
+ MPG123_NO_BUFFERS, /**< Unable to initialize frame buffers (out of memory?). */
+ MPG123_BAD_RVA, /**< Invalid RVA mode. */
+ MPG123_NO_GAPLESS, /**< This build doesn't support gapless decoding. */
+ MPG123_NO_SPACE, /**< Not enough buffer space. */
+ MPG123_BAD_TYPES, /**< Incompatible numeric data types. */
+ MPG123_BAD_BAND, /**< Bad equalizer band. */
+ MPG123_ERR_NULL, /**< Null pointer given where valid storage address needed. */
+ MPG123_ERR_READER, /**< Error reading the stream. */
+ MPG123_NO_SEEK_FROM_END,/**< Cannot seek from end (end is not known). */
+ MPG123_BAD_WHENCE, /**< Invalid 'whence' for seek function.*/
+ MPG123_NO_TIMEOUT, /**< Build does not support stream timeouts. */
+ MPG123_BAD_FILE, /**< File access error. */
+ MPG123_NO_SEEK, /**< Seek not supported by stream. */
+ MPG123_NO_READER, /**< No stream opened. */
+ MPG123_BAD_PARS, /**< Bad parameter handle. */
+ MPG123_BAD_INDEX_PAR, /**< Bad parameters to mpg123_index() and mpg123_set_index() */
+ MPG123_OUT_OF_SYNC, /**< Lost track in bytestream and did not try to resync. */
+ MPG123_RESYNC_FAIL, /**< Resync failed to find valid MPEG data. */
+ MPG123_NO_8BIT, /**< No 8bit encoding possible. */
+ MPG123_BAD_ALIGN, /**< Stack aligmnent error */
+ MPG123_NULL_BUFFER, /**< NULL input buffer with non-zero size... */
+ MPG123_NO_RELSEEK, /**< Relative seek not possible (screwed up file offset) */
+ MPG123_NULL_POINTER, /**< You gave a null pointer somewhere where you shouldn't have. */
+ MPG123_BAD_KEY, /**< Bad key value given. */
+ MPG123_NO_INDEX, /**< No frame index in this build. */
+ MPG123_INDEX_FAIL, /**< Something with frame index went wrong. */
+ MPG123_BAD_DECODER_SETUP, /**< Something prevents a proper decoder setup */
+ MPG123_MISSING_FEATURE /**< This feature has not been built into libmpg123. */
+ ,MPG123_BAD_VALUE /**< A bad value has been given, somewhere. */
+ ,MPG123_LSEEK_FAILED /**< Low-level seek failed. */
+ ,MPG123_BAD_CUSTOM_IO /**< Custom I/O not prepared. */
+ ,MPG123_LFS_OVERFLOW /**< Offset value overflow during translation of large file API calls -- your client program cannot handle that large file. */
+ ,MPG123_INT_OVERFLOW /**< Some integer overflow. */
+ ,MPG123_BAD_FLOAT /**< Floating-point computations work not as expected. */
+};
+
+/** Look up error strings given integer code.
+ * \param errcode integer error code
+ * \return string describing what that error error code means
+ */
+MPG123_EXPORT const char* mpg123_plain_strerror(int errcode);
+
+/** Give string describing what error has occured in the context of handle mh.
+ * When a function operating on an mpg123 handle returns MPG123_ERR, you should check for the actual reason via
+ * char *errmsg = mpg123_strerror(mh)
+ * This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE.
+ * \param mh handle
+ * \return error message
+ */
+MPG123_EXPORT const char* mpg123_strerror(mpg123_handle *mh);
+
+/** Return the plain errcode intead of a string.
+ * \param mh handle
+ * \return error code recorded in handle or MPG123_BAD_HANDLE
+ */
+MPG123_EXPORT int mpg123_errcode(mpg123_handle *mh);
+
+/** @} */
+
+
+/** \defgroup mpg123_decoder mpg123 decoder selection
+ *
+ * Functions to list and select the available decoders.
+ * Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is).
+ *
+ * @{
+ */
+
+/** Get available decoder list.
+ * \return NULL-terminated array of generally available decoder names (plain 8bit ASCII)
+ */
+MPG123_EXPORT const char **mpg123_decoders(void);
+
+/** Get supported decoder list.
+ *
+ * This possibly writes to static storage in the library, so avoid
+ * calling concurrently, please.
+ *
+ * \return NULL-terminated array of the decoders supported by the CPU (plain 8bit ASCII)
+ */
+MPG123_EXPORT const char **mpg123_supported_decoders(void);
+
+/** Set the active decoder.
+ * \param mh handle
+ * \param decoder_name name of decoder
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name);
+
+/** Get the currently active decoder name.
+ * The active decoder engine can vary depening on output constraints,
+ * mostly non-resampling, integer output is accelerated via 3DNow & Co. but for
+ * other modes a fallback engine kicks in.
+ * Note that this can return a decoder that is only active in the hidden and not
+ * available as decoder choice from the outside.
+ * \param mh handle
+ * \return The decoder name or NULL on error.
+ */
+MPG123_EXPORT const char* mpg123_current_decoder(mpg123_handle *mh);
+
+/** @} */
+
+
+/** \defgroup mpg123_output mpg123 output audio format
+ *
+ * Functions to get and select the format of the decoded audio.
+ *
+ * Before you dive in, please be warned that you might get confused by this.
+ * This seems to happen a lot, therefore I am trying to explain in advance.
+ * If you do feel confused and just want to decode your normal MPEG audio files that
+ * don't alter properties in the middle, just use mpg123_open_fixed() with a fixed encoding
+ * and channel count and forget about a matrix of audio formats. If you want to get funky,
+ * read ahead ...
+ *
+ * The mpg123 library decides what output format to use when encountering the first frame in a stream, or actually any frame that is still valid but differs from the frames before in the prompted output format. At such a deciding point, an internal table of allowed encodings, sampling rates and channel setups is consulted. According to this table, an output format is chosen and the decoding engine set up accordingly (including optimized routines for different output formats). This might seem unusual but it just follows from the non-existence of "MPEG audio files" with defined overall properties. There are streams, streams are concatenations of (semi) independent frames. We store streams on disk and call them "MPEG audio files", but that does not change their nature as the decoder is concerned (the LAME/Xing header for gapless decoding makes things interesting again).
+ *
+ * To get to the point: What you do with mpg123_format() and friends is to fill the internal table of allowed formats before it is used. That includes removing support for some formats or adding your forced sample rate (see MPG123_FORCE_RATE) that will be used with the crude internal resampler. Also keep in mind that the sample encoding is just a question of choice -- the MPEG frames do only indicate their native sampling rate and channel count. If you want to decode to integer or float samples, 8 or 16 bit ... that is your decision. In a "clean" world, libmpg123 would always decode to 32 bit float and let you handle any sample conversion. But there are optimized routines that work faster by directly decoding to the desired encoding / accuracy. We prefer efficiency over conceptual tidyness.
+ *
+ * People often start out thinking that mpg123_format() should change the actual decoding format on the fly. That is wrong. It only has effect on the next natural change of output format, when libmpg123 will consult its format table again. To make life easier, you might want to call mpg123_format_none() before any thing else and then just allow one desired encoding and a limited set of sample rates / channel choices that you actually intend to deal with. You can force libmpg123 to decode everything to 44100 KHz, stereo, 16 bit integer ... it will duplicate mono channels and even do resampling if needed (unless that feature is disabled in the build, same with some encodings). But I have to stress that the resampling of libmpg123 is very crude and doesn't even contain any kind of "proper" interpolation.
+ *
+ * In any case, watch out for MPG123_NEW_FORMAT as return message from decoding routines and call mpg123_getformat() to get the currently active output format.
+ *
+ * @{
+ */
+
+/** They can be combined into one number (3) to indicate mono and stereo... */
+enum mpg123_channelcount
+{
+ MPG123_MONO = 1 /**< mono */
+ ,MPG123_STEREO = 2 /**< stereo */
+};
+
+/** An array of supported standard sample rates
+ * These are possible native sample rates of MPEG audio files.
+ * You can still force mpg123 to resample to a different one, but by
+ * default you will only get audio in one of these samplings.
+ * This list is in ascending order.
+ * \param list Store a pointer to the sample rates array there.
+ * \param number Store the number of sample rates there. */
+MPG123_EXPORT void mpg123_rates(const long **list, size_t *number);
+
+/** An array of supported audio encodings.
+ * An audio encoding is one of the fully qualified members of mpg123_enc_enum (MPG123_ENC_SIGNED_16, not MPG123_SIGNED).
+ * \param list Store a pointer to the encodings array there.
+ * \param number Store the number of encodings there. */
+MPG123_EXPORT void mpg123_encodings(const int **list, size_t *number);
+
+/** Return the size (in bytes) of one mono sample of the named encoding.
+ * \param encoding The encoding value to analyze.
+ * \return positive size of encoding in bytes, 0 on invalid encoding. */
+MPG123_EXPORT int mpg123_encsize(int encoding);
+
+/** Configure a mpg123 handle to accept no output format at all,
+ * use before specifying supported formats with mpg123_format
+ * \param mh handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_format_none(mpg123_handle *mh);
+
+/** Configure mpg123 handle to accept all formats
+ * (also any custom rate you may set) -- this is default.
+ * \param mh handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_format_all(mpg123_handle *mh);
+
+/** Set the audio format support of a mpg123_handle in detail:
+ * \param mh handle
+ * \param rate The sample rate value (in Hertz).
+ * \param channels A combination of MPG123_STEREO and MPG123_MONO.
+ * \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16 | MPG123_ENC_ULAW_8 (or 0 for no support). Please note that some encodings may not be supported in the library build and thus will be ignored here.
+ * \return MPG123_OK on success, MPG123_ERR if there was an error. */
+MPG123_EXPORT int mpg123_format( mpg123_handle *mh
+, long rate, int channels, int encodings );
+
+/** Set the audio format support of a mpg123_handle in detail:
+ * \param mh handle
+ * \param rate The sample rate value (in Hertz). Special value 0 means
+ * all rates (the reason for this variant of mpg123_format()).
+ * \param channels A combination of MPG123_STEREO and MPG123_MONO.
+ * \param encodings A combination of accepted encodings for rate and channels,
+ * p.ex MPG123_ENC_SIGNED16 | MPG123_ENC_ULAW_8 (or 0 for no support).
+ * Please note that some encodings may not be supported in the library build
+ * and thus will be ignored here.
+ * \return MPG123_OK on success, MPG123_ERR if there was an error. */
+MPG123_EXPORT int mpg123_format2( mpg123_handle *mh
+, long rate, int channels, int encodings );
+
+/** Check to see if a specific format at a specific rate is supported
+ * by mpg123_handle.
+ * \param mh handle
+ * \param rate sampling rate
+ * \param encoding encoding
+ * \return 0 for no support (that includes invalid parameters), MPG123_STEREO,
+ * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */
+MPG123_EXPORT int mpg123_format_support( mpg123_handle *mh
+, long rate, int encoding );
+
+/** Get the current output format written to the addresses given.
+ * If the stream is freshly loaded, this will try to parse enough
+ * of it to give you the format to come. This clears the flag that
+ * would otherwise make the first decoding call return
+ * MPG123_NEW_FORMAT.
+ * \param mh handle
+ * \param rate sampling rate return address
+ * \param channels channel count return address
+ * \param encoding encoding return address
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_getformat( mpg123_handle *mh
+, long *rate, int *channels, int *encoding );
+
+/** Get the current output format written to the addresses given.
+ * This differs from plain mpg123_getformat() in that you can choose
+ * _not_ to clear the flag that would trigger the next decoding call
+ * to return MPG123_NEW_FORMAT in case of a new format arriving.
+ * \param mh handle
+ * \param rate sampling rate return address
+ * \param channels channel count return address
+ * \param encoding encoding return address
+ * \param clear_flag if true, clear internal format flag
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_getformat2( mpg123_handle *mh
+, long *rate, int *channels, int *encoding, int clear_flag );
+
+/** @} */
+
+
+/** \defgroup mpg123_input mpg123 file input and decoding
+ *
+ * Functions for input bitstream and decoding operations.
+ * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!).
+ * @{
+ */
+
+/** Open a simple MPEG file with fixed properties.
+ *
+ * This function shall simplify the common use case of a plain MPEG
+ * file on disk that you want to decode, with one fixed sample
+ * rate and channel count, and usually a length defined by a Lame/Info/Xing
+ * tag. It will:
+ *
+ * - set the MPG123_NO_FRANKENSTEIN flag
+ * - set up format support according to given parameters,
+ * - open the file,
+ * - query audio format,
+ * - fix the audio format support table to ensure the format stays the same,
+ * - call mpg123_scan() if there is no header frame to tell the track length.
+ *
+ * From that on, you can call mpg123_getformat() for querying the sample
+ * rate (and channel count in case you allowed both) and mpg123_length()
+ * to get a pretty safe number for the duration.
+ * Only the sample rate is left open as that indeed is a fixed property of
+ * MPEG files. You could set MPG123_FORCE_RATE beforehand, but that may trigger
+ * low-quality resampling in the decoder, only do so if in dire need.
+ * The library will convert mono files to stereo for you, and vice versa.
+ * If any constraint cannot be satisified (most likely because of a non-default
+ * build of libmpg123), you get MPG123_ERR returned and can query the detailed
+ * cause from the handle. Only on MPG123_OK there will an open file that you
+ * then close using mpg123_close(), or implicitly on mpg123_delete() or the next
+ * call to open another file.
+ *
+ * So, for your usual CD rip collection, you could use
+ *
+ * mpg123_open_fixed(mh, path, MPG123_STEREO, MPG123_ENC_SIGNED_16)
+ *
+ * and be happy calling mpg123_getformat() to verify 44100 Hz rate, then just
+ * playing away with mpg123_read(). The occasional mono file, or MP2 file,
+ * will also be decoded without you really noticing. Just the speed could be
+ * wrong if you do not care about sample rate at all.
+ * \param mh handle
+ * \param path filesystem path (see mpg123_open())
+ * \param channels allowed channel count, either 1 (MPG123_MONO) or
+ * 2 (MPG123_STEREO), or bitwise or of them, but then you're halfway back to
+ * calling mpg123_format() again;-)
+ * \param encoding a definite encoding from enum mpg123_enc_enum
+ * or a bitmask like for mpg123_format(), defeating the purpose somewhat
+ */
+MPG123_EXPORT int mpg123_open_fixed(mpg123_handle *mh, const char *path
+, int channels, int encoding);
+
+/** Open and prepare to decode the specified file by filesystem path.
+ * This does not open HTTP urls; libmpg123 contains no networking code.
+ * If you want to decode internet streams, use mpg123_open_fd() or mpg123_open_feed().
+ *
+ * The path parameter usually is just a string that is handed to the underlying
+ * OS routine for opening, treated as a blob of binary data. On platforms
+ * where encoding needs to be involved, something like _wopen() is called
+ * underneath and the path argument to libmpg123 is assumed to be encoded in UTF-8.
+ * So, if you have to ask yourself which encoding is needed, the answer is
+ * UTF-8, which also fits any sane modern install of Unix-like systems.
+ *
+ * \param mh handle
+ * \param path filesystem
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_open(mpg123_handle *mh, const char *path);
+
+/** Use an already opened file descriptor as the bitstream input
+ * mpg123_close() will _not_ close the file descriptor.
+ * \param mh handle
+ * \param fd file descriptor
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd);
+
+/** Use an opaque handle as bitstream input. This works only with the
+ * replaced I/O from mpg123_replace_reader_handle()!
+ * mpg123_close() will call the cleanup callback for your handle (if you gave one).
+ * \param mh handle
+ * \param iohandle your handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle);
+
+/** Open a new bitstream and prepare for direct feeding
+ * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream.
+ * Also, you are expected to handle ICY metadata extraction yourself. This
+ * input method does not handle MPG123_ICY_INTERVAL. It does parse ID3 frames, though.
+ * \param mh handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_open_feed(mpg123_handle *mh);
+
+/** Closes the source, if libmpg123 opened it.
+ * \param mh handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_close(mpg123_handle *mh);
+
+/** Read from stream and decode up to outmemsize bytes.
+ *
+ * Note: The type of outmemory changed to a void pointer in mpg123 1.26.0
+ * (API version 45).
+ *
+ * \param mh handle
+ * \param outmemory address of output buffer to write to
+ * \param outmemsize maximum number of bytes to write
+ * \param done address to store the number of actually decoded bytes to
+ * \return MPG123_OK or error/message code
+ */
+MPG123_EXPORT int mpg123_read(mpg123_handle *mh
+, void *outmemory, size_t outmemsize, size_t *done );
+
+/** Feed data for a stream that has been opened with mpg123_open_feed().
+ * It's give and take: You provide the bytestream, mpg123 gives you the decoded samples.
+ * \param mh handle
+ * \param in input buffer
+ * \param size number of input bytes
+ * \return MPG123_OK or error/message code.
+ */
+MPG123_EXPORT int mpg123_feed( mpg123_handle *mh
+, const unsigned char *in, size_t size );
+
+/** Decode MPEG Audio from inmemory to outmemory.
+ * This is very close to a drop-in replacement for old mpglib.
+ * When you give zero-sized output buffer the input will be parsed until
+ * decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it)
+ * without taking decoded data.
+ * Think of this function being the union of mpg123_read() and mpg123_feed() (which it actually is, sort of;-).
+ * You can actually always decide if you want those specialized functions in separate steps or one call this one here.
+ *
+ * Note: The type of outmemory changed to a void pointer in mpg123 1.26.0
+ * (API version 45).
+ *
+ * \param mh handle
+ * \param inmemory input buffer
+ * \param inmemsize number of input bytes
+ * \param outmemory output buffer
+ * \param outmemsize maximum number of output bytes
+ * \param done address to store the number of actually decoded bytes to
+ * \return error/message code (watch out especially for MPG123_NEED_MORE)
+ */
+MPG123_EXPORT int mpg123_decode( mpg123_handle *mh
+, const unsigned char *inmemory, size_t inmemsize
+, void *outmemory, size_t outmemsize, size_t *done );
+
+/** Decode next MPEG frame to internal buffer
+ * or read a frame and return after setting a new format.
+ * \param mh handle
+ * \param num current frame offset gets stored there
+ * \param audio This pointer is set to the internal buffer to read the decoded audio from.
+ * \param bytes number of output bytes ready in the buffer
+ * \return MPG123_OK or error/message code
+ */
+MPG123_EXPORT int mpg123_decode_frame( mpg123_handle *mh
+, off_t *num, unsigned char **audio, size_t *bytes );
+
+/** Decode current MPEG frame to internal buffer.
+ * Warning: This is experimental API that might change in future releases!
+ * Please watch mpg123 development closely when using it.
+ * \param mh handle
+ * \param num last frame offset gets stored there
+ * \param audio this pointer is set to the internal buffer to read the decoded audio from.
+ * \param bytes number of output bytes ready in the buffer
+ * \return MPG123_OK or error/message code
+ */
+MPG123_EXPORT int mpg123_framebyframe_decode( mpg123_handle *mh
+, off_t *num, unsigned char **audio, size_t *bytes );
+
+/** Find, read and parse the next mp3 frame
+ * Warning: This is experimental API that might change in future releases!
+ * Please watch mpg123 development closely when using it.
+ * \param mh handle
+ * \return MPG123_OK or error/message code
+ */
+MPG123_EXPORT int mpg123_framebyframe_next(mpg123_handle *mh);
+
+/** Get access to the raw input data for the last parsed frame.
+ * This gives you a direct look (and write access) to the frame body data.
+ * Together with the raw header, you can reconstruct the whole raw MPEG stream without junk and meta data, or play games by actually modifying the frame body data before decoding this frame (mpg123_framebyframe_decode()).
+ * A more sane use would be to use this for CRC checking (see mpg123_info() and MPG123_CRC), the first two bytes of the body make up the CRC16 checksum, if present.
+ * You can provide NULL for a parameter pointer when you are not interested in the value.
+ *
+ * \param mh handle
+ * \param header the 4-byte MPEG header
+ * \param bodydata pointer to the frame body stored in the handle (without the header)
+ * \param bodybytes size of frame body in bytes (without the header)
+ * \return MPG123_OK if there was a yet un-decoded frame to get the
+ * data from, MPG123_BAD_HANDLE or MPG123_ERR otherwise (without further
+ * explanation, the error state of the mpg123_handle is not modified by
+ * this function).
+ */
+MPG123_EXPORT int mpg123_framedata( mpg123_handle *mh
+, unsigned long *header, unsigned char **bodydata, size_t *bodybytes );
+
+/** Get the input position (byte offset in stream) of the last parsed frame.
+ * This can be used for external seek index building, for example.
+ * It just returns the internally stored offset, regardless of validity --
+ * you ensure that a valid frame has been parsed before!
+ * \param mh handle
+ * \return byte offset in stream
+ */
+MPG123_EXPORT off_t mpg123_framepos(mpg123_handle *mh);
+
+/** @} */
+
+
+/** \defgroup mpg123_seek mpg123 position and seeking
+ *
+ * Functions querying and manipulating position in the decoded audio bitstream.
+ * The position is measured in decoded audio samples or MPEG frame offset for
+ * the specific functions. The term sample refers to a group of samples for
+ * multiple channels, normally dubbed PCM frames. The latter term is
+ * avoided here because frame means something different in the context of MPEG
+ * audio. Since all samples of a PCM frame occur at the same time, there is only
+ * very limited ambiguity when talking about playback offset, as counting each
+ * channel sample individually does not make sense.
+ *
+ * If gapless code is in effect, the positions are adjusted to compensate the
+ * skipped padding/delay - meaning, you should not care about that at all and
+ * just use the position defined for the samples you get out of the decoder;-)
+ * The general usage is modelled after stdlib's ftell() and fseek().
+ * Especially, the whence parameter for the seek functions has the same meaning
+ * as the one for fseek() and needs the same constants from stdlib.h:
+ *
+ * - SEEK_SET: set position to (or near to) specified offset
+ * - SEEK_CUR: change position by offset from now
+ * - SEEK_END: set position to offset from end
+ *
+ * Note that sample-accurate seek only works when gapless support has been
+ * enabled at compile time; seek is frame-accurate otherwise.
+ * Also, really sample-accurate seeking (meaning that you get the identical
+ * sample value after seeking compared to plain decoding up to the position)
+ * is only guaranteed when you do not mess with the position code by using
+ * #MPG123_UPSPEED, #MPG123_DOWNSPEED or #MPG123_START_FRAME. The first two mainly
+ * should cause trouble with NtoM resampling, but in any case with these options
+ * in effect, you have to keep in mind that the sample offset is not the same
+ * as counting the samples you get from decoding since mpg123 counts the skipped
+ * samples, too (or the samples played twice only once)!
+ *
+ * Short: When you care about the sample position, don't mess with those
+ * parameters;-)
+ *
+ * Streams may be openend in ways that do not support seeking. Also, consider
+ * the effect of #MPG123_FUZZY.
+ *
+ * @{
+ */
+
+/** Returns the current position in samples.
+ * On the next successful read, you'd get audio data with that offset.
+ * \param mh handle
+ * \return sample (PCM frame) offset or MPG123_ERR (null handle)
+ */
+MPG123_EXPORT off_t mpg123_tell(mpg123_handle *mh);
+
+/** Returns the frame number that the next read will give you data from.
+ * \param mh handle
+ * \return frame offset or MPG123_ERR (null handle)
+ */
+MPG123_EXPORT off_t mpg123_tellframe(mpg123_handle *mh);
+
+/** Returns the current byte offset in the input stream.
+ * \param mh handle
+ * \return byte offset or MPG123_ERR (null handle)
+ */
+MPG123_EXPORT off_t mpg123_tell_stream(mpg123_handle *mh);
+
+/** Seek to a desired sample offset.
+ * Usage is modelled afer the standard lseek().
+ * \param mh handle
+ * \param sampleoff offset in samples (PCM frames)
+ * \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
+ * \return The resulting offset >= 0 or error/message code
+ */
+MPG123_EXPORT off_t mpg123_seek( mpg123_handle *mh
+, off_t sampleoff, int whence );
+
+/** Seek to a desired sample offset in data feeding mode.
+ * This just prepares things to be right only if you ensure that the next chunk
+ * of input data will be from input_offset byte position.
+ * \param mh handle
+ * \param sampleoff offset in samples (PCM frames)
+ * \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
+ * \param input_offset The position it expects to be at the
+ * next time data is fed to mpg123_decode().
+ * \return The resulting offset >= 0 or error/message code
+ */
+MPG123_EXPORT off_t mpg123_feedseek( mpg123_handle *mh
+, off_t sampleoff, int whence, off_t *input_offset );
+
+/** Seek to a desired MPEG frame offset.
+ * Usage is modelled afer the standard lseek().
+ * \param mh handle
+ * \param frameoff offset in MPEG frames
+ * \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
+ * \return The resulting offset >= 0 or error/message code */
+MPG123_EXPORT off_t mpg123_seek_frame( mpg123_handle *mh
+, off_t frameoff, int whence );
+
+/** Return a MPEG frame offset corresponding to an offset in seconds.
+ * This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only.
+ * \return frame offset >= 0 or error/message code */
+MPG123_EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec);
+
+/** Give access to the frame index table that is managed for seeking.
+ * You are asked not to modify the values... Use mpg123_set_index to set the
+ * seek index
+ * \param mh handle
+ * \param offsets pointer to the index array
+ * \param step one index byte offset advances this many MPEG frames
+ * \param fill number of recorded index offsets; size of the array
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_index( mpg123_handle *mh
+, off_t **offsets, off_t *step, size_t *fill );
+
+/** Set the frame index table
+ * Setting offsets to NULL and fill > 0 will allocate fill entries. Setting offsets
+ * to NULL and fill to 0 will clear the index and free the allocated memory used by the index.
+ * \param mh handle
+ * \param offsets pointer to the index array
+ * \param step one index byte offset advances this many MPEG frames
+ * \param fill number of recorded index offsets; size of the array
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_set_index( mpg123_handle *mh
+, off_t *offsets, off_t step, size_t fill );
+
+/** An old crutch to keep old mpg123 binaries happy.
+ * WARNING: This function is there only to avoid runtime linking errors with
+ * standalone mpg123 before version 1.23.0 (if you strangely update the
+ * library but not the end-user program) and actually is broken
+ * for various cases (p.ex. 24 bit output). Do never use. It might eventually
+ * be purged from the library.
+ */
+MPG123_EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left);
+
+/** @} */
+
+
+/** \defgroup mpg123_voleq mpg123 volume and equalizer
+ *
+ * @{
+ */
+
+/** another channel enumeration, for left/right choice */
+enum mpg123_channels
+{
+ MPG123_LEFT=0x1 /**< The Left Channel. */
+ ,MPG123_RIGHT=0x2 /**< The Right Channel. */
+ ,MPG123_LR=0x3 /**< Both left and right channel; same as MPG123_LEFT|MPG123_RIGHT */
+};
+
+#ifdef MPG123_ENUM_API
+/** Set the 32 Band Audio Equalizer settings.
+ *
+ * Note that this name is mapped to mpg123_eq2() instead unless
+ * MPG123_ENUM_API is defined.
+ *
+ * \param mh handle
+ * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or
+ * #MPG123_LEFT|#MPG123_RIGHT for both.
+ * \param band The equaliser band to change (from 0 to 31)
+ * \param val The (linear) adjustment factor.
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_eq( mpg123_handle *mh
+, enum mpg123_channels channel, int band, double val );
+#endif
+
+/** Set the 32 Band Audio Equalizer settings. No enums.
+ *
+ * This is actually called instead of mpg123_eq() unless MPG123_ENUM_API
+ * is defined.
+ *
+ * \param mh handle
+ * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or
+ * #MPG123_LEFT|#MPG123_RIGHT for both.
+ * \param band The equaliser band to change (from 0 to 31)
+ * \param val The (linear) adjustment factor.
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_eq2( mpg123_handle *mh
+, int channel, int band, double val );
+
+/** Set a range of equalizer bands
+ * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or
+ * #MPG123_LEFT|#MPG123_RIGHT for both.
+ * \param a The first equalizer band to set (from 0 to 31)
+ * \param b The last equalizer band to set (from 0 to 31)
+ * \param factor The (linear) adjustment factor, 1 being neutral.
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_eq_bands( mpg123_handle *mh
+, int channel, int a, int b, double factor );
+
+/** Change a range of equalizer bands
+ * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or
+ * #MPG123_LEFT|#MPG123_RIGHT for both.
+ * \param a The first equalizer band to change (from 0 to 31)
+ * \param b The last equalizer band to change (from 0 to 31)
+ * \param db The adjustment in dB (limited to +/- 60 dB).
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_eq_change( mpg123_handle *mh
+, int channel, int a, int b, double db );
+
+#ifdef MPG123_ENUM_API
+/** Get the 32 Band Audio Equalizer settings.
+ *
+ * Note that this name is mapped to mpg123_geteq2() instead unless
+ * MPG123_ENUM_API is defined.
+ *
+ * \param mh handle
+ * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or
+ * #MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both.
+ * \param band The equaliser band to change (from 0 to 31)
+ * \return The (linear) adjustment factor (zero for pad parameters) */
+MPG123_EXPORT double mpg123_geteq(mpg123_handle *mh
+ , enum mpg123_channels channel, int band);
+#endif
+
+/** Get the 32 Band Audio Equalizer settings.
+ *
+ * This is actually called instead of mpg123_geteq() unless MPG123_ENUM_API
+ * is defined.
+ *
+ * \param mh handle
+ * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or
+ * #MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both.
+ * \param band The equaliser band to change (from 0 to 31)
+ * \return The (linear) adjustment factor (zero for pad parameters) */
+MPG123_EXPORT double mpg123_geteq2(mpg123_handle *mh, int channel, int band);
+
+/** Reset the 32 Band Audio Equalizer settings to flat
+ * \param mh handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_reset_eq(mpg123_handle *mh);
+
+/** Set the absolute output volume including the RVA setting,
+ * vol<0 just applies (a possibly changed) RVA setting.
+ * \param mh handle
+ * \param vol volume value (linear factor)
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_volume(mpg123_handle *mh, double vol);
+
+/** Adjust output volume including the RVA setting by chosen amount
+ * \param mh handle
+ * \param change volume value (linear factor increment)
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_volume_change(mpg123_handle *mh, double change);
+
+/** Adjust output volume including the RVA setting by chosen amount
+ * \param mh handle
+ * \param change volume adjustment in decibels (limited to +/- 60 dB)
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_volume_change_db(mpg123_handle *mh, double db);
+
+/** Return current volume setting, the actual value due to RVA, and the RVA
+ * adjustment itself. It's all as double float value to abstract the sample
+ * format. The volume values are linear factors / amplitudes (not percent)
+ * and the RVA value is in decibels.
+ * \param mh handle
+ * \param base return address for base volume (linear factor)
+ * \param really return address for actual volume (linear factor)
+ * \param rva_db return address for RVA value (decibels)
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db);
+
+/* TODO: Set some preamp in addition / to replace internal RVA handling? */
+
+/** @} */
+
+
+/** \defgroup mpg123_status mpg123 status and information
+ *
+ * @{
+ */
+
+/** Enumeration of the mode types of Variable Bitrate */
+enum mpg123_vbr {
+ MPG123_CBR=0, /**< Constant Bitrate Mode (default) */
+ MPG123_VBR, /**< Variable Bitrate Mode */
+ MPG123_ABR /**< Average Bitrate Mode */
+};
+
+/** Enumeration of the MPEG Versions */
+enum mpg123_version {
+ MPG123_1_0=0, /**< MPEG Version 1.0 */
+ MPG123_2_0, /**< MPEG Version 2.0 */
+ MPG123_2_5 /**< MPEG Version 2.5 */
+};
+
+
+/** Enumeration of the MPEG Audio mode.
+ * Only the mono mode has 1 channel, the others have 2 channels. */
+enum mpg123_mode {
+ MPG123_M_STEREO=0, /**< Standard Stereo. */
+ MPG123_M_JOINT, /**< Joint Stereo. */
+ MPG123_M_DUAL, /**< Dual Channel. */
+ MPG123_M_MONO /**< Single Channel. */
+};
+
+
+/** Enumeration of the MPEG Audio flag bits */
+enum mpg123_flags {
+ MPG123_CRC=0x1, /**< The bitstream is error protected using 16-bit CRC. */
+ MPG123_COPYRIGHT=0x2, /**< The bitstream is copyrighted. */
+ MPG123_PRIVATE=0x4, /**< The private bit has been set. */
+ MPG123_ORIGINAL=0x8 /**< The bitstream is an original, not a copy. */
+};
+
+#ifdef MPG123_ENUM_API
+/** Data structure for storing information about a frame of MPEG Audio */
+struct mpg123_frameinfo
+{
+ enum mpg123_version version; /**< The MPEG version (1.0/2.0/2.5). */
+ int layer; /**< The MPEG Audio Layer (MP1/MP2/MP3). */
+ long rate; /**< The sampling rate in Hz. */
+ enum mpg123_mode mode; /**< The audio mode (Mono, Stereo, Joint-stero, Dual Channel). */
+ int mode_ext; /**< The mode extension bit flag. */
+ int framesize; /**< The size of the frame (in bytes, including header). */
+ enum mpg123_flags flags; /**< MPEG Audio flag bits. Just now I realize that it should be declared as int, not enum. It's a bitwise combination of the enum values. */
+ int emphasis; /**< The emphasis type. */
+ int bitrate; /**< Bitrate of the frame (kbps). */
+ int abr_rate; /**< The target average bitrate. */
+ enum mpg123_vbr vbr; /**< The VBR mode. */
+};
+#endif
+
+/** Data structure for storing information about a frame of MPEG Audio without enums */
+struct mpg123_frameinfo2
+{
+ int version; /**< The MPEG version (1.0/2.0/2.5), enum mpg123_version. */
+ int layer; /**< The MPEG Audio Layer (MP1/MP2/MP3). */
+ long rate; /**< The sampling rate in Hz. */
+ int mode; /**< The audio mode (enum mpg123_mode, Mono, Stereo, Joint-stero, Dual Channel). */
+ int mode_ext; /**< The mode extension bit flag. */
+ int framesize; /**< The size of the frame (in bytes, including header). */
+ int flags; /**< MPEG Audio flag bits. Bitwise combination of enum mpg123_flags values. */
+ int emphasis; /**< The emphasis type. */
+ int bitrate; /**< Bitrate of the frame (kbps). */
+ int abr_rate; /**< The target average bitrate. */
+ int vbr; /**< The VBR mode, enum mpg123_vbr. */
+};
+
+/** Data structure for even more detailed information out of the decoder,
+ * for MPEG layer III only.
+ * This was added to support the frame analyzer by the Lame project and
+ * just follows what was used there before. You know what the fields mean
+ * if you want use this structure. */
+struct mpg123_moreinfo
+{
+ double xr[2][2][576]; /**< internal data */
+ double sfb[2][2][22]; /**< [2][2][SBMAX_l] */
+ double sfb_s[2][2][3*13]; /**< [2][2][3*SBMAX_s] */
+ int qss[2][2]; /**< internal data */
+ int big_values[2][2]; /**< internal data */
+ int sub_gain[2][2][3]; /**< internal data */
+ int scalefac_scale[2][2]; /**< internal data */
+ int preflag[2][2]; /**< internal data */
+ int blocktype[2][2]; /**< internal data */
+ int mixed[2][2]; /**< internal data */
+ int mainbits[2][2]; /**< internal data */
+ int sfbits[2][2]; /**< internal data */
+ int scfsi[2]; /**< internal data */
+ int maindata; /**< internal data */
+ int padding; /**< internal data */
+};
+
+#ifdef MPG123_ENUM_API
+/** Get frame information about the MPEG audio bitstream and store
+ * it in a mpg123_frameinfo structure.
+ *
+ * Note that this name is mapped to mpg123_info2() instead unless
+ * MPG123_ENUM_API is defined.
+ *
+ * \param mh handle
+ * \param mi address of existing frameinfo structure to write to
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi);
+#endif
+
+/** Get frame information about the MPEG audio bitstream and store
+ * it in a mpg123_frameinfo2 structure.
+ *
+ * This is actually called instead of mpg123_info()
+ * unless MPG123_ENUM_API is defined.
+ *
+ * \param mh handle
+ * \param mi address of existing frameinfo structure to write to
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_info2(mpg123_handle *mh, struct mpg123_frameinfo2 *mi);
+
+/** Trigger collection of additional decoder information while decoding.
+ * \param mh handle
+ * \param mi pointer to data storage (NULL to disable collection)
+ * \return MPG123_OK if the collection was enabled/disabled as desired, MPG123_ERR
+ * otherwise (e.g. if the feature is disabled)
+ */
+MPG123_EXPORT int mpg123_set_moreinfo( mpg123_handle *mh
+, struct mpg123_moreinfo *mi );
+
+/** Get the safe output buffer size for all cases
+ * (when you want to replace the internal buffer)
+ * \return safe buffer size
+ */
+MPG123_EXPORT size_t mpg123_safe_buffer(void);
+
+/** Make a full parsing scan of each frame in the file. ID3 tags are found. An
+ * accurate length value is stored. Seek index will be filled. A seek back to
+ * current position is performed. At all, this function refuses work when
+ * stream is not seekable.
+ * \param mh handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_scan(mpg123_handle *mh);
+
+/** Return, if possible, the full (expected) length of current track in
+ * MPEG frames.
+ * \param mh handle
+ * \return length >= 0 or MPG123_ERR if there is no length guess possible.
+ */
+MPG123_EXPORT off_t mpg123_framelength(mpg123_handle *mh);
+
+/** Return, if possible, the full (expected) length of current
+ * track in samples (PCM frames).
+ *
+ * This relies either on an Info frame at the beginning or a previous
+ * call to mpg123_scan() to get the real number of MPEG frames in a
+ * file. It will guess based on file size if neither Info frame nor
+ * scan data are present. In any case, there is no guarantee that the
+ * decoder will not give you more data, for example in case the open
+ * file gets appended to during decoding.
+ * \param mh handle
+ * \return length >= 0 or MPG123_ERR if there is no length guess possible.
+ */
+MPG123_EXPORT off_t mpg123_length(mpg123_handle *mh);
+
+/** Override the value for file size in bytes.
+ * Useful for getting sensible track length values in feed mode or for HTTP streams.
+ * \param mh handle
+ * \param size file size in bytes
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size);
+
+/** Get MPEG frame duration in seconds.
+ * \param mh handle
+ * \return frame duration in seconds, <0 on error
+ */
+MPG123_EXPORT double mpg123_tpf(mpg123_handle *mh);
+
+/** Get MPEG frame duration in samples.
+ * \param mh handle
+ * \return samples per frame for the most recently parsed frame; <0 on errors
+ */
+MPG123_EXPORT int mpg123_spf(mpg123_handle *mh);
+
+/** Get and reset the clip count.
+ * \param mh handle
+ * \return count of clipped samples
+ */
+MPG123_EXPORT long mpg123_clip(mpg123_handle *mh);
+
+
+/** The key values for state information from mpg123_getstate(). */
+enum mpg123_state
+{
+ MPG123_ACCURATE = 1 /**< Query if positons are currently accurate (integer value, 0 if false, 1 if true). */
+ ,MPG123_BUFFERFILL /**< Get fill of internal (feed) input buffer as integer byte count returned as long and as double. An error is returned on integer overflow while converting to (signed) long, but the returned floating point value shold still be fine. */
+ ,MPG123_FRANKENSTEIN /**< Stream consists of carelessly stitched together files. Seeking may yield unexpected results (also with MPG123_ACCURATE, it may be confused). */
+ ,MPG123_FRESH_DECODER /**< Decoder structure has been updated, possibly indicating changed stream (integer value, 0 if false, 1 if true). Flag is cleared after retrieval. */
+ ,MPG123_ENC_DELAY /** Encoder delay read from Info tag (layer III, -1 if unknown). */
+ ,MPG123_ENC_PADDING /** Encoder padding read from Info tag (layer III, -1 if unknown). */
+ ,MPG123_DEC_DELAY /** Decoder delay (for layer III only, -1 otherwise). */
+};
+
+#ifdef MPG123_ENUM_API
+/** Get various current decoder/stream state information.
+ *
+ * Note that this name is mapped to mpg123_getstate2() instead unless
+ * MPG123_ENUM_API is defined.
+ *
+ * \param mh handle
+ * \param key the key to identify the information to give.
+ * \param val the address to return (long) integer values to
+ * \param fval the address to return floating point values to
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_getstate( mpg123_handle *mh
+, enum mpg123_state key, long *val, double *fval );
+#endif
+
+/** Get various current decoder/stream state information. No enums.
+ *
+ * This is actually called instead of mpg123_getstate()
+ * unless MPG123_ENUM_API is defined.
+ *
+ * \param mh handle
+ * \param key the key to identify the information to give (enum mpg123_state)
+ * \param val the address to return (long) integer values to
+ * \param fval the address to return floating point values to
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_getstate2( mpg123_handle *mh
+, int key, long *val, double *fval );
+
+/** @} */
+
+
+/** \defgroup mpg123_metadata mpg123 metadata handling
+ *
+ * Functions to retrieve the metadata from MPEG Audio files and streams.
+ * Also includes string handling functions.
+ *
+ * @{
+ */
+
+/** Data structure for storing strings in a safer way than a standard C-String.
+ * Can also hold a number of null-terminated strings. */
+typedef struct
+{
+ char* p; /**< pointer to the string data */
+ size_t size; /**< raw number of bytes allocated */
+ size_t fill; /**< number of used bytes (including closing zero byte) */
+} mpg123_string;
+
+/** Allocate and intialize a new string.
+ * \param val optional initial string value (can be NULL)
+ */
+MPG123_EXPORT mpg123_string* mpg123_new_string(const char* val);
+
+/** Free memory of contents and the string structure itself.
+ * \param sb string handle
+ */
+MPG123_EXPORT void mpg123_delete_string(mpg123_string* sb);
+
+/** Initialize an existing mpg123_string structure to {NULL, 0, 0}.
+ * If you hand in a NULL pointer here, your program should crash. The other
+ * string functions are more forgiving, but this one here is too basic.
+ * \param sb string handle (address of existing structure on your side)
+ */
+MPG123_EXPORT void mpg123_init_string(mpg123_string* sb);
+
+/** Free-up memory of the contents of an mpg123_string (not the struct itself).
+ * This also calls mpg123_init_string() and hence is safe to be called
+ * repeatedly.
+ * \param sb string handle
+ */
+MPG123_EXPORT void mpg123_free_string(mpg123_string* sb);
+
+/** Change the size of a mpg123_string
+ * \param sb string handle
+ * \param news new size in bytes
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_resize_string(mpg123_string* sb, size_t news);
+
+/** Increase size of a mpg123_string if necessary (it may stay larger).
+ * Note that the functions for adding and setting in current libmpg123
+ * use this instead of mpg123_resize_string().
+ * That way, you can preallocate memory and safely work afterwards with
+ * pieces.
+ * \param sb string handle
+ * \param news new minimum size
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_grow_string(mpg123_string* sb, size_t news);
+
+/** Copy the contents of one mpg123_string string to another.
+ * Yes the order of arguments is reversed compated to memcpy().
+ * \param from string handle
+ * \param to string handle
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_copy_string(mpg123_string* from, mpg123_string* to);
+
+/** Move the contents of one mpg123_string string to another.
+ * This frees any memory associated with the target and moves over the
+ * pointers from the source, leaving the source without content after
+ * that. The only possible error is that you hand in NULL pointers.
+ * If you handed in a valid source, its contents will be gone, even if
+ * there was no target to move to. If you hand in a valid target, its
+ * original contents will also always be gone, to be replaced with the
+ * source's contents if there was some.
+ * \param from source string handle
+ * \param to target string handle
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_move_string(mpg123_string* from, mpg123_string* to);
+
+/** Append a C-String to an mpg123_string
+ * \param sb string handle
+ * \param stuff to append
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_add_string(mpg123_string* sb, const char* stuff);
+
+/** Append a C-substring to an mpg123 string
+ * \param sb string handle
+ * \param stuff content to copy
+ * \param from offset to copy from
+ * \param count number of characters to copy (a null-byte is always appended)
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_add_substring( mpg123_string *sb
+, const char *stuff, size_t from, size_t count );
+
+/** Set the content of a mpg123_string to a C-string
+ * \param sb string handle
+ * \param stuff content to copy
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_set_string(mpg123_string* sb, const char* stuff);
+
+/** Set the content of a mpg123_string to a C-substring
+ * \param sb string handle
+ * \param stuff the future content
+ * \param from offset to copy from
+ * \param count number of characters to copy (a null-byte is always appended)
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_set_substring( mpg123_string *sb
+, const char *stuff, size_t from, size_t count );
+
+/** Count characters in a mpg123 string (non-null bytes or Unicode points).
+ * This function is of limited use, as it does just count code points
+ * encoded in an UTF-8 string, only loosely related to the count of visible
+ * characters. Get your full Unicode handling support elsewhere.
+ * \param sb string handle
+ * \param utf8 a flag to tell if the string is in utf8 encoding
+ * \return character count
+*/
+MPG123_EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8);
+
+/** Remove trailing \\r and \\n, if present.
+ * \param sb string handle
+ * \return 0 on error, 1 on success
+ */
+MPG123_EXPORT int mpg123_chomp_string(mpg123_string *sb);
+
+/** Determine if two strings contain the same data.
+ * This only returns 1 if both given handles are non-NULL and
+ * if they are filled with the same bytes.
+ * \param a first string handle
+ * \param b second string handle
+ * \return 0 for different strings, 1 for identical
+ */
+MPG123_EXPORT int mpg123_same_string(mpg123_string *a, mpg123_string *b);
+
+/** The mpg123 text encodings. This contains encodings we encounter in ID3 tags or ICY meta info. */
+enum mpg123_text_encoding
+{
+ mpg123_text_unknown = 0 /**< Unkown encoding... mpg123_id3_encoding can return that on invalid codes. */
+ ,mpg123_text_utf8 = 1 /**< UTF-8 */
+ ,mpg123_text_latin1 = 2 /**< ISO-8859-1. Note that sometimes latin1 in ID3 is abused for totally different encodings. */
+ ,mpg123_text_icy = 3 /**< ICY metadata encoding, usually CP-1252 but we take it as UTF-8 if it qualifies as such. */
+ ,mpg123_text_cp1252 = 4 /**< Really CP-1252 without any guessing. */
+ ,mpg123_text_utf16 = 5 /**< Some UTF-16 encoding. The last of a set of leading BOMs (byte order mark) rules.
+ * When there is no BOM, big endian ordering is used. Note that UCS-2 qualifies as UTF-8 when
+ * you don't mess with the reserved code points. If you want to decode little endian data
+ * without BOM you need to prepend 0xff 0xfe yourself. */
+ ,mpg123_text_utf16bom = 6 /**< Just an alias for UTF-16, ID3v2 has this as distinct code. */
+ ,mpg123_text_utf16be = 7 /**< Another alias for UTF16 from ID3v2. Note, that, because of the mess that is reality,
+ * BOMs are used if encountered. There really is not much distinction between the UTF16 types for mpg123
+ * One exception: Since this is seen in ID3v2 tags, leading null bytes are skipped for all other UTF16
+ * types (we expect a BOM before real data there), not so for utf16be!*/
+ ,mpg123_text_max = 7 /**< Placeholder for the maximum encoding value. */
+};
+
+/** The encoding byte values from ID3v2. */
+enum mpg123_id3_enc
+{
+ mpg123_id3_latin1 = 0 /**< Note: This sometimes can mean anything in practice... */
+ ,mpg123_id3_utf16bom = 1 /**< UTF16, UCS-2 ... it's all the same for practical purposes. */
+ ,mpg123_id3_utf16be = 2 /**< Big-endian UTF-16, BOM see note for mpg123_text_utf16be. */
+ ,mpg123_id3_utf8 = 3 /**< Our lovely overly ASCII-compatible 8 byte encoding for the world. */
+ ,mpg123_id3_enc_max = 3 /**< Placeholder to check valid range of encoding byte. */
+};
+
+#ifdef MPG123_ENUM_API
+/** Convert ID3 encoding byte to mpg123 encoding index.
+ *
+ * Note that this name is mapped to mpg123_enc_from_id3_2() instead unless
+ * MPG123_ENUM_API is defined.
+ *
+ * \param id3_enc_byte the ID3 encoding code
+ * \return the mpg123 encoding index
+ */
+MPG123_EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_byte);
+#endif
+
+/** Convert ID3 encoding byte to mpg123 encoding index. No enums.
+ *
+ * This is actually called instead of mpg123_enc_from_id3()
+ * unless MPG123_ENUM_API is defined.
+ *
+ * \param id3_enc_byte the ID3 encoding code
+ * \return the mpg123 encoding index
+ */
+MPG123_EXPORT int mpg123_enc_from_id3_2(unsigned char id3_enc_byte);
+
+#ifdef MPG123_ENUM_API
+/** Store text data in string, after converting to UTF-8 from indicated encoding.
+ *
+ * Note that this name is mapped to mpg123_store_utf8_2() instead unless
+ * MPG123_ENUM_API is defined.
+ *
+ * A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing).
+ * Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that).
+ * \param sb target string
+ * \param enc mpg123 text encoding value
+ * \param source source buffer with plain unsigned bytes (you might need to cast from signed char)
+ * \param source_size number of bytes in the source buffer
+ * \return 0 on error, 1 on success (on error, mpg123_free_string is called on sb)
+ */
+MPG123_EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size);
+#endif
+
+/** Store text data in string, after converting to UTF-8 from indicated encoding. No enums.
+ *
+ * This is actually called instead of mpg123_store_utf8()
+ * unless MPG123_ENUM_API is defined.
+ *
+ * A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing).
+ * Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that).
+ * \param sb target string
+ * \param enc mpg123 text encoding value (enum mpg123_text_encoding)
+ * \param source source buffer with plain unsigned bytes (you might need to cast from signed char)
+ * \param source_size number of bytes in the source buffer
+ * \return 0 on error, 1 on success (on error, mpg123_free_string is called on sb)
+ */
+MPG123_EXPORT int mpg123_store_utf8_2(mpg123_string *sb
+, int enc, const unsigned char *source, size_t source_size);
+
+/** Sub data structure for ID3v2, for storing various text fields (including comments).
+ * This is for ID3v2 COMM, TXXX and all the other text fields.
+ * Only COMM, TXXX and USLT may have a description, only COMM and USLT
+ * have a language.
+ * You should consult the ID3v2 specification for the use of the various text fields
+ * ("frames" in ID3v2 documentation, I use "fields" here to separate from MPEG frames). */
+typedef struct
+{
+ char lang[3]; /**< Three-letter language code (not terminated). */
+ char id[4]; /**< The ID3v2 text field id, like TALB, TPE2, ... (4 characters, no string termination). */
+ mpg123_string description; /**< Empty for the generic comment... */
+ mpg123_string text; /**< ... */
+} mpg123_text;
+
+/** The picture type values from ID3v2. */
+enum mpg123_id3_pic_type
+{
+ mpg123_id3_pic_other = 0 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_icon = 1 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_other_icon = 2 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_front_cover = 3 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_back_cover = 4 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_leaflet = 5 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_media = 6 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_lead = 7 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_artist = 8 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_conductor = 9 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_orchestra = 10 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_composer = 11 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_lyricist = 12 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_location = 13 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_recording = 14 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_performance = 15 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_video = 16 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_fish = 17 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_illustration = 18 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_artist_logo = 19 /**< see ID3v2 docs */
+ ,mpg123_id3_pic_publisher_logo = 20 /**< see ID3v2 docs */
+};
+
+/** Sub data structure for ID3v2, for storing picture data including comment.
+ * This is for the ID3v2 APIC field. You should consult the ID3v2 specification
+ * for the use of the APIC field ("frames" in ID3v2 documentation, I use "fields"
+ * here to separate from MPEG frames). */
+typedef struct
+{
+ char type; /**< mpg123_id3_pic_type value */
+ mpg123_string description; /**< description string */
+ mpg123_string mime_type; /**< MIME type */
+ size_t size; /**< size in bytes */
+ unsigned char* data; /**< pointer to the image data */
+} mpg123_picture;
+
+/** Data structure for storing IDV3v2 tags.
+ * This structure is not a direct binary mapping with the file contents.
+ * The ID3v2 text frames are allowed to contain multiple strings.
+ * So check for null bytes until you reach the mpg123_string fill.
+ * All text is encoded in UTF-8. */
+typedef struct
+{
+ unsigned char version; /**< 3 or 4 for ID3v2.3 or ID3v2.4. */
+ mpg123_string *title; /**< Title string (pointer into text_list). */
+ mpg123_string *artist; /**< Artist string (pointer into text_list). */
+ mpg123_string *album; /**< Album string (pointer into text_list). */
+ mpg123_string *year; /**< The year as a string (pointer into text_list). */
+ mpg123_string *genre; /**< Genre String (pointer into text_list). The genre string(s) may very well need postprocessing, esp. for ID3v2.3. */
+ mpg123_string *comment; /**< Pointer to last encountered comment text with empty description. */
+ /* Encountered ID3v2 fields are appended to these lists.
+ There can be multiple occurences, the pointers above always point to the last encountered data. */
+ mpg123_text *comment_list; /**< Array of comments. */
+ size_t comments; /**< Number of comments. */
+ mpg123_text *text; /**< Array of ID3v2 text fields (including USLT) */
+ size_t texts; /**< Numer of text fields. */
+ mpg123_text *extra; /**< The array of extra (TXXX) fields. */
+ size_t extras; /**< Number of extra text (TXXX) fields. */
+ mpg123_picture *picture; /**< Array of ID3v2 pictures fields (APIC).
+ Only populated if MPG123_PICTURE flag is set! */
+ size_t pictures; /**< Number of picture (APIC) fields. */
+} mpg123_id3v2;
+
+/** Data structure for ID3v1 tags (the last 128 bytes of a file).
+ * Don't take anything for granted (like string termination)!
+ * Also note the change ID3v1.1 did: comment[28] = 0; comment[29] = track_number
+ * It is your task to support ID3v1 only or ID3v1.1 ...*/
+typedef struct
+{
+ char tag[3]; /**< Always the string "TAG", the classic intro. */
+ char title[30]; /**< Title string. */
+ char artist[30]; /**< Artist string. */
+ char album[30]; /**< Album string. */
+ char year[4]; /**< Year string. */
+ char comment[30]; /**< Comment string. */
+ unsigned char genre; /**< Genre index. */
+} mpg123_id3v1;
+
+#define MPG123_ID3 0x3 /**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */
+#define MPG123_NEW_ID3 0x1 /**< 0001 There is ID3 info that changed since last call to mpg123_id3. */
+#define MPG123_ICY 0xc /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/
+#define MPG123_NEW_ICY 0x4 /**< 0100 There is ICY info that changed since last call to mpg123_icy. */
+
+/** Query if there is (new) meta info, be it ID3 or ICY (or something new in future).
+ * \param mh handle
+ * \return combination of flags, 0 on error (same as "nothing new")
+ */
+MPG123_EXPORT int mpg123_meta_check(mpg123_handle *mh);
+
+/** Clean up meta data storage (ID3v2 and ICY), freeing memory.
+ * \param mh handle
+ */
+MPG123_EXPORT void mpg123_meta_free(mpg123_handle *mh);
+
+/** Point v1 and v2 to existing data structures wich may change on any next read/decode function call.
+ * v1 and/or v2 can be set to NULL when there is no corresponding data.
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_id3( mpg123_handle *mh
+, mpg123_id3v1 **v1, mpg123_id3v2 **v2 );
+
+/** Return pointers to and size of stored raw ID3 data if storage has
+ * been configured with MPG123_STORE_RAW_ID3 and stream parsing passed the
+ * metadata already. Null value with zero size is a possibility!
+ * The storage can change at any next API call.
+ *
+ * \param mh mpg123 handle
+ * \param v1 address to store pointer to v1 tag
+ * \param v1_size size of v1 data in bytes
+ * \param v2 address to store pointer to v2 tag
+ * \param v2_size size of v2 data in bytes
+ * \return MPG123_OK or MPG123_ERR. Only on MPG123_OK the output
+ * values are set.
+ */
+MPG123_EXPORT int mpg123_id3_raw( mpg123_handle *mh
+, unsigned char **v1, size_t *v1_size
+, unsigned char **v2, size_t *v2_size );
+
+/** Point icy_meta to existing data structure wich may change on any next read/decode function call.
+ * \param mh handle
+ * \param icy_meta return address for ICY meta string (set to NULL if nothing there)
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta);
+
+/** Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8.
+ * Note that this is very similar to mpg123_store_utf8(&sb, mpg123_text_icy, icy_text, strlen(icy_text+1)) .
+ * \param icy_text The input data in ICY encoding
+ * \return pointer to newly allocated buffer with UTF-8 data (You free() it!) */
+MPG123_EXPORT char* mpg123_icy2utf8(const char* icy_text);
+
+
+/** @} */
+
+
+/** \defgroup mpg123_advpar mpg123 advanced parameter API
+ *
+ * Direct access to a parameter set without full handle around it.
+ * Possible uses:
+ * - Influence behaviour of library _during_ initialization of handle (MPG123_VERBOSE).
+ * - Use one set of parameters for multiple handles.
+ *
+ * The functions for handling mpg123_pars (mpg123_par() and mpg123_fmt()
+ * family) directly return a fully qualified mpg123 error code, the ones
+ * operating on full handles normally MPG123_OK or MPG123_ERR, storing the
+ * specific error code itseld inside the handle.
+ *
+ * @{
+ */
+
+/** Opaque structure for the libmpg123 decoder parameters. */
+struct mpg123_pars_struct;
+
+/** Opaque structure for the libmpg123 decoder parameters. */
+typedef struct mpg123_pars_struct mpg123_pars;
+
+/** Create a handle with preset parameters.
+ * \param mp parameter handle
+ * \param decoder decoder choice
+ * \param error error code return address
+ * \return mpg123 handle
+ */
+MPG123_EXPORT mpg123_handle *mpg123_parnew( mpg123_pars *mp
+, const char* decoder, int *error );
+
+/** Allocate memory for and return a pointer to a new mpg123_pars
+ * \param error error code return address
+ * \return new parameter handle
+ */
+MPG123_EXPORT mpg123_pars *mpg123_new_pars(int *error);
+
+/** Delete and free up memory used by a mpg123_pars data structure
+ * \param mp parameter handle
+ */
+MPG123_EXPORT void mpg123_delete_pars(mpg123_pars* mp);
+
+/** Configure mpg123 parameters to accept no output format at all,
+ * use before specifying supported formats with mpg123_format
+ * \param mp parameter handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_fmt_none(mpg123_pars *mp);
+
+/** Configure mpg123 parameters to accept all formats
+ * (also any custom rate you may set) -- this is default.
+ * \param mp parameter handle
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_fmt_all(mpg123_pars *mp);
+
+/** Set the audio format support of a mpg123_pars in detail:
+ * \param mp parameter handle
+ * \param rate The sample rate value (in Hertz).
+ * \param channels A combination of MPG123_STEREO and MPG123_MONO.
+ * \param encodings A combination of accepted encodings for rate and channels,
+ * p.ex MPG123_ENC_SIGNED16|MPG123_ENC_ULAW_8 (or 0 for no
+ * support).
+ * \return MPG123_OK on success
+*/
+MPG123_EXPORT int mpg123_fmt(mpg123_pars *mp
+, long rate, int channels, int encodings);
+
+/** Set the audio format support of a mpg123_pars in detail:
+ * \param mp parameter handle
+ * \param rate The sample rate value (in Hertz). Special value 0 means
+ * all rates (reason for this variant of mpg123_fmt).
+ * \param channels A combination of MPG123_STEREO and MPG123_MONO.
+ * \param encodings A combination of accepted encodings for rate and channels,
+ * p.ex MPG123_ENC_SIGNED16|MPG123_ENC_ULAW_8 (or 0 for no
+ * support).
+ * \return MPG123_OK on success
+*/
+MPG123_EXPORT int mpg123_fmt2(mpg123_pars *mp
+, long rate, int channels, int encodings);
+
+/** Check to see if a specific format at a specific rate is supported
+ * by mpg123_pars.
+ * \param mp parameter handle
+ * \param rate sampling rate
+ * \param encoding encoding
+ * \return 0 for no support (that includes invalid parameters), MPG123_STEREO,
+ * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */
+MPG123_EXPORT int mpg123_fmt_support(mpg123_pars *mp, long rate, int encoding);
+
+#ifdef MPG123_ENUM_API
+/** Set a specific parameter in a par handle.
+ *
+ * Note that this name is mapped to mpg123_par2() instead unless
+ * MPG123_ENUM_API is defined.
+ *
+ * \param mp parameter handle
+ * \param type parameter choice
+ * \param value integer value
+ * \param fvalue floating point value
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_par( mpg123_pars *mp
+, enum mpg123_parms type, long value, double fvalue );
+#endif
+
+/** Set a specific parameter in a par handle. No enums.
+ *
+ * This is actually called instead of mpg123_par()
+ * unless MPG123_ENUM_API is defined.
+ *
+ * \param mp parameter handle
+ * \param type parameter choice (enum mpg123_parms)
+ * \param value integer value
+ * \param fvalue floating point value
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_par2( mpg123_pars *mp
+, int type, long value, double fvalue );
+
+#ifdef MPG123_ENUM_API
+/** Get a specific parameter from a par handle.
+ *
+ * Note that this name is mapped to mpg123_getpar2() instead unless
+ * MPG123_ENUM_API is defined.
+ *
+ * \param mp parameter handle
+ * \param type parameter choice
+ * \param value integer value return address
+ * \param fvalue floating point value return address
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_getpar( mpg123_pars *mp
+, enum mpg123_parms type, long *value, double *fvalue );
+#endif
+
+/** Get a specific parameter from a par handle. No enums.
+ *
+ * This is actually called instead of mpg123_getpar()
+ * unless MPG123_ENUM_API is defined.
+ *
+ * \param mp parameter handle
+ * \param type parameter choice (enum mpg123_parms)
+ * \param value integer value return address
+ * \param fvalue floating point value return address
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_getpar2( mpg123_pars *mp
+, int type, long *value, double *fvalue );
+
+/** @} */
+
+
+/** \defgroup mpg123_lowio mpg123 low level I/O
+ * You may want to do tricky stuff with I/O that does not work with mpg123's default file access or you want to make it decode into your own pocket...
+ *
+ * @{ */
+
+/** Replace default internal buffer with user-supplied buffer.
+ * Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio.
+ * Note that the required buffer size could be bigger than expected from output
+ * encoding if libmpg123 has to convert from primary decoder output (p.ex. 32 bit
+ * storage for 24 bit output).
+ *
+ * Note: The type of data changed to a void pointer in mpg123 1.26.0
+ * (API version 45).
+ *
+ * \param mh handle
+ * \param data pointer to user buffer
+ * \param size of buffer in bytes
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_replace_buffer(mpg123_handle *mh
+, void *data, size_t size);
+
+/** The max size of one frame's decoded output with current settings.
+ * Use that to determine an appropriate minimum buffer size for decoding one frame.
+ * \param mh handle
+ * \return maximum decoded data size in bytes
+ */
+MPG123_EXPORT size_t mpg123_outblock(mpg123_handle *mh);
+
+/** Replace low-level stream access functions; read and lseek as known in POSIX.
+ * You can use this to make any fancy file opening/closing yourself,
+ * using mpg123_open_fd() to set the file descriptor for your read/lseek
+ * (doesn't need to be a "real" file descriptor...).
+ * Setting a function to NULL means that the default internal read is
+ * used (active from next mpg123_open call on).
+ * Note: As it would be troublesome to mess with this while having a file open,
+ * this implies mpg123_close().
+ * \param mh handle
+ * \param r_read callback for reading (behaviour like POSIX read)
+ * \param r_lseek callback for seeking (like POSIX lseek)
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_replace_reader( mpg123_handle *mh
+, mpg123_ssize_t (*r_read) (int, void *, size_t)
+, off_t (*r_lseek)(int, off_t, int)
+);
+
+/** Replace I/O functions with your own ones operating on some kind of
+ * handle instead of integer descriptors.
+ * The handle is a void pointer, so you can pass any data you want...
+ * mpg123_open_handle() is the call you make to use the I/O defined here.
+ * There is no fallback to internal read/seek here.
+ * Note: As it would be troublesome to mess with this while having a file open,
+ * this mpg123_close() is implied here.
+ * \param mh handle
+ * \param r_read callback for reading (behaviour like POSIX read)
+ * \param r_lseek callback for seeking (like POSIX lseek)
+ * \param cleanup A callback to clean up an I/O handle on mpg123_close,
+ * can be NULL for none (you take care of cleaning your handles).
+ * \return MPG123_OK on success
+ */
+MPG123_EXPORT int mpg123_replace_reader_handle( mpg123_handle *mh
+, mpg123_ssize_t (*r_read) (void *, void *, size_t)
+, off_t (*r_lseek)(void *, off_t, int)
+, void (*cleanup)(void*) );
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/mpg123lib_intern.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/mpg123lib_intern.h
new file mode 100644
index 00000000..e89af704
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/mpg123lib_intern.h
@@ -0,0 +1,354 @@
+/*
+ mpg123lib_intern: Common non-public stuff for libmpg123
+
+ copyright 1995-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+
+ derived from the old mpg123.h
+*/
+
+#ifndef MPG123_H_INTERN
+#define MPG123_H_INTERN
+
+#define MPG123_RATES 9
+#define MPG123_ENCODINGS 12
+
+#include "config.h" /* Load this before _anything_ */
+#include "intsym.h" /* Prefixing of internal symbols that still are public in a static lib. */
+
+#include "abi_align.h"
+
+/* export DLL symbols */
+#if defined(WIN32) && defined(DYNAMIC_BUILD)
+#define BUILD_MPG123_DLL
+#endif
+#include "compat.h"
+#define MPG123_ENUM_API
+#include "mpg123.h"
+
+#define SKIP_JUNK 1
+
+#ifndef M_PI
+# define M_PI 3.14159265358979323846
+#endif
+#ifndef M_SQRT2
+# define M_SQRT2 1.41421356237309504880
+#endif
+
+#ifdef SUNOS
+#define memmove(dst,src,size) bcopy(src,dst,size)
+#endif
+
+// The real type is either 32 bit float or integer. We do not attempt
+// double precision for MPEG audio decoding (or any audio storage/compression
+// format, even).
+// The calctables tool works in double precision float, but converts to fixed
+// point 'real' on output in addition to floating point.
+
+// The base type used in the computation code.
+// With C11 we could rely on tgmath for sin() to use the right precision.
+#ifdef CALCTABLES
+# define clreal double
+# define COS cos
+# define SIN sin
+# define TAN tan
+# define POW pow
+#else
+# define clreal float
+# define COS cosf
+# define SIN sinf
+# define TAN tanf
+# define POW powf
+#endif
+
+#if defined(REAL_IS_FLOAT) && !defined(CALCTABLES)
+
+#define real float
+
+#elif defined(REAL_IS_FIXED) || defined(CALCTABLES)
+
+#ifdef RUNTIME_TABLES
+#error "Runtime tables are only for floating point decoders."
+#endif
+
+# define real int32_t
+# define dreal int64_t
+
+/*
+ for fixed-point decoders, use pre-calculated tables to avoid expensive floating-point maths
+ undef this macro for run-time calculation
+*/
+
+# define REAL_RADIX 24
+# define REAL_FACTOR 16777216.0
+
+static inline int32_t double_to_long_rounded(double x, double scalefac)
+{
+ x *= scalefac;
+ x += (x > 0) ? 0.5 : -0.5;
+ return (int32_t)x;
+}
+
+static inline int32_t scale_rounded(int32_t x, int shift)
+{
+ x += (x >> 31);
+ x >>= (shift - 1);
+ x += (x & 1);
+ return (x >> 1);
+}
+
+# ifdef __GNUC__
+# if defined(OPT_I386)
+/* for i386_nofpu decoder */
+# define REAL_MUL_ASM(x, y, radix) \
+({ \
+ long _x=(x), _y=(y); \
+ __asm__ ( \
+ "imull %1 \n\t" \
+ "shrdl %2, %%edx, %0 \n\t" \
+ : "+&a" (_x) \
+ : "mr" (_y), "I" (radix) \
+ : "%edx", "cc" \
+ ); \
+ _x; \
+})
+
+# define REAL_MUL_SCALE_LAYER3_ASM(x, y, radix) \
+({ \
+ long _x=(x), _y=(y), _radix=(radix); \
+ __asm__ ( \
+ "imull %1 \n\t" \
+ "shrdl %%cl, %%edx, %0 \n\t" \
+ : "+&a" (_x) \
+ : "mr" (_y), "c" (_radix) \
+ : "%edx", "cc" \
+ ); \
+ _x; \
+})
+# elif defined(OPT_PPC)
+/* for powerpc */
+# define REAL_MUL_ASM(x, y, radix) \
+({ \
+ long _x=(x), _y=(y), _mull, _mulh; \
+ __asm__ ( \
+ "mullw %0, %2, %3 \n\t" \
+ "mulhw %1, %2, %3 \n\t" \
+ "srwi %0, %0, %4 \n\t" \
+ "rlwimi %0, %1, %5, 0, %6 \n\t" \
+ : "=&r" (_mull), "=&r" (_mulh) \
+ : "r" (_x), "r" (_y), "i" (radix), "i" (32-(radix)), "i" ((radix)-1) \
+ ); \
+ _mull; \
+})
+
+# define REAL_MUL_SCALE_LAYER3_ASM(x, y, radix) \
+({ \
+ long _x=(x), _y=(y), _radix=(radix), _mull, _mulh, _radix2; \
+ __asm__ ( \
+ "mullw %0, %3, %4 \n\t" \
+ "mulhw %1, %3, %4 \n\t" \
+ "subfic %2, %5, 32 \n\t" \
+ "srw %0, %0, %5 \n\t" \
+ "slw %1, %1, %2 \n\t" \
+ "or %0, %0, %1 \n\t" \
+ : "=&r" (_mull), "=&r" (_mulh), "=&r" (_radix2) \
+ : "r" (_x), "r" (_y), "r" (_radix) \
+ : "cc" \
+ ); \
+ _mull; \
+})
+# elif defined(OPT_ARM)
+/* for arm */
+# define REAL_MUL_ASM(x, y, radix) \
+({ \
+ long _x=(x), _y=(y), _mull, _mulh; \
+ __asm__ ( \
+ "smull %0, %1, %2, %3 \n\t" \
+ "mov %0, %0, lsr %4 \n\t" \
+ "orr %0, %0, %1, lsl %5 \n\t" \
+ : "=&r" (_mull), "=&r" (_mulh) \
+ : "r" (_x), "r" (_y), "M" (radix), "M" (32-(radix)) \
+ ); \
+ _mull; \
+})
+
+# define REAL_MUL_SCALE_LAYER3_ASM(x, y, radix) \
+({ \
+ long _x=(x), _y=(y), _radix=(radix), _mull, _mulh, _radix2; \
+ __asm__ ( \
+ "smull %0, %1, %3, %4 \n\t" \
+ "mov %0, %0, lsr %5 \n\t" \
+ "rsb %2, %5, #32 \n\t" \
+ "mov %1, %1, lsl %2 \n\t" \
+ "orr %0, %0, %1 \n\t" \
+ : "=&r" (_mull), "=&r" (_mulh), "=&r" (_radix2) \
+ : "r" (_x), "r" (_y), "r" (_radix) \
+ ); \
+ _mull; \
+})
+# endif
+# endif
+
+/* I just changed the (int) to (real) there... seemed right. */
+# define DOUBLE_TO_REAL(x) (double_to_long_rounded(x, REAL_FACTOR))
+# define SCALE_15 32768.0
+# define DOUBLE_TO_REAL_15(x) (double_to_long_rounded(x, SCALE_15))
+# define SCALE_POW43 8192.0
+# define DOUBLE_TO_REAL_POW43(x) (double_to_long_rounded(x, SCALE_POW43))
+# define SCALE_LAYER12 1073741824.0
+# define DOUBLE_TO_REAL_SCALE_LAYER12(x) (double_to_long_rounded(x, SCALE_LAYER12))
+# define DOUBLE_TO_REAL_SCALE_LAYER3(x, y) (double_to_long_rounded(x, pow(2.0,gainpow2_scale[y])))
+# define REAL_TO_DOUBLE(x) ((double)(x) / REAL_FACTOR)
+# ifdef REAL_MUL_ASM
+# define REAL_MUL(x, y) REAL_MUL_ASM(x, y, REAL_RADIX)
+# define REAL_MUL_15(x, y) REAL_MUL_ASM(x, y, 15)
+# define REAL_MUL_SCALE_LAYER12(x, y) REAL_MUL_ASM(x, y, 15 + 30 - REAL_RADIX)
+# else
+# define REAL_MUL(x, y) (((dreal)(x) * (dreal)(y)) >> REAL_RADIX)
+# define REAL_MUL_15(x, y) (((dreal)(x) * (dreal)(y)) >> 15)
+# define REAL_MUL_SCALE_LAYER12(x, y) (((dreal)(x) * (dreal)(y)) >> (15 + 30 - REAL_RADIX))
+# endif
+# ifdef REAL_MUL_SCALE_LAYER3_ASM
+# define REAL_MUL_SCALE_LAYER3(x, y, z) REAL_MUL_SCALE_LAYER3_ASM(x, y, 13 + gainpow2_scale[z] - REAL_RADIX)
+# else
+# define REAL_MUL_SCALE_LAYER3(x, y, z) (((dreal)(x) * (dreal)(y)) >> (13 + gainpow2_scale[z] - REAL_RADIX))
+# endif
+# define REAL_SCALE_LAYER12(x) ((real)((x) >> (30 - REAL_RADIX)))
+# define REAL_SCALE_LAYER3(x, y) ((real)((x) >> (gainpow2_scale[y] - REAL_RADIX)))
+# ifdef ACCURATE_ROUNDING
+# define REAL_MUL_SYNTH(x, y) REAL_MUL(x, y)
+# define REAL_SCALE_DCT64(x) (x)
+# define REAL_SCALE_WINDOW(x) (x)
+# else
+# define REAL_MUL_SYNTH(x, y) ((x) * (y))
+# define REAL_SCALE_DCT64(x) ((x) >> 8)
+# define REAL_SCALE_WINDOW(x) scale_rounded(x, 16)
+# endif
+
+#else
+
+#error "Simple float or fixed-point, nothing else makes sense."
+
+#endif
+
+#ifndef REAL_IS_FIXED
+# if (defined SIZEOF_INT32_T) && (SIZEOF_INT32_T != 4)
+# error "Bad 32bit types!!!"
+# endif
+#endif
+
+#ifndef DOUBLE_TO_REAL
+# define DOUBLE_TO_REAL(x) (real)(x)
+#endif
+#ifndef DOUBLE_TO_REAL_15
+# define DOUBLE_TO_REAL_15(x) (real)(x)
+#endif
+#ifndef DOUBLE_TO_REAL_POW43
+# define DOUBLE_TO_REAL_POW43(x) (real)(x)
+#endif
+#ifndef DOUBLE_TO_REAL_SCALE_LAYER12
+# define DOUBLE_TO_REAL_SCALE_LAYER12(x) (real)(x)
+#endif
+#ifndef DOUBLE_TO_REAL_SCALE_LAYER3
+# define DOUBLE_TO_REAL_SCALE_LAYER3(x, y) (real)(x)
+#endif
+#ifndef REAL_TO_DOUBLE
+# define REAL_TO_DOUBLE(x) (x)
+#endif
+
+#ifndef REAL_MUL
+# define REAL_MUL(x, y) ((x) * (y))
+#endif
+#ifndef REAL_MUL_SYNTH
+# define REAL_MUL_SYNTH(x, y) ((x) * (y))
+#endif
+#ifndef REAL_MUL_15
+# define REAL_MUL_15(x, y) ((x) * (y))
+#endif
+#ifndef REAL_MUL_SCALE_LAYER12
+# define REAL_MUL_SCALE_LAYER12(x, y) ((x) * (y))
+#endif
+#ifndef REAL_MUL_SCALE_LAYER3
+# define REAL_MUL_SCALE_LAYER3(x, y, z) ((x) * (y))
+#endif
+#ifndef REAL_SCALE_LAYER12
+# define REAL_SCALE_LAYER12(x) (x)
+#endif
+#ifndef REAL_SCALE_LAYER3
+# define REAL_SCALE_LAYER3(x, y) (x)
+#endif
+#ifndef REAL_SCALE_DCT64
+# define REAL_SCALE_DCT64(x) (x)
+#endif
+
+/* used to be: AUDIOBUFSIZE = n*64 with n=1,2,3 ...
+ now: factor on minimum frame buffer size (which takes upsampling into account) */
+#define AUDIOBUFSIZE 2
+
+#include "true.h"
+
+#define MAX_NAME_SIZE 81
+#define SBLIMIT 32
+#define SCALE_BLOCK 12
+#define SSLIMIT 18
+
+/* Same as MPG_M_* */
+#define MPG_MD_STEREO 0
+#define MPG_MD_JOINT_STEREO 1
+#define MPG_MD_DUAL_CHANNEL 2
+#define MPG_MD_MONO 3
+
+/* We support short or float output samples...
+ Short integer amplitude is scaled by this. */
+#define SHORT_SCALE 32768
+/* That scales a short-scaled value to a 32bit integer scaled one
+ value = 2**31/2**15 */
+#define S32_RESCALE 65536
+
+/* Pre Shift fo 16 to 8 bit converter table */
+#define AUSHIFT (3)
+
+#include "optimize.h"
+#include "decode.h"
+#include "parse.h"
+#include "frame.h"
+
+/* fr is a mpg123_handle* by convention here... */
+#define NOQUIET (!(fr->p.flags & MPG123_QUIET))
+#define VERBOSE (NOQUIET && fr->p.verbose)
+#define VERBOSE2 (NOQUIET && fr->p.verbose > 1)
+#define VERBOSE3 (NOQUIET && fr->p.verbose > 2)
+#define VERBOSE4 (NOQUIET && fr->p.verbose > 3)
+#define PVERB(mp, level) (!((mp)->flags & MPG123_QUIET) && (mp)->verbose >= (level))
+
+int decode_update(mpg123_handle *mh);
+/* residing in format.c */
+off_t decoder_synth_bytes(mpg123_handle *fr , off_t s);
+off_t samples_to_bytes(mpg123_handle *fr , off_t s);
+off_t bytes_to_samples(mpg123_handle *fr , off_t b);
+off_t outblock_bytes(mpg123_handle *fr, off_t s);
+/* Postprocessing format conversion of freshly decoded buffer. */
+void postprocess_buffer(mpg123_handle *fr);
+
+int open_fixed_pre(mpg123_handle *mh, int channels, int encoding);
+int open_fixed_post(mpg123_handle *mh, int channels, int encoding);
+
+/* If networking is enabled and we really mean internal networking, the timeout_read function is available. */
+#if defined (NETWORK) && !defined (WANT_WIN32_SOCKETS)
+/* Does not work with win32 */
+#define TIMEOUT_READ
+#endif
+
+// Change a given linear factor by the given dB value, bounded
+// to +/- 60 dB.
+static inline double dbchange(double base_factor, double db)
+{
+ double nscale = base_factor * pow(10, db/20);
+ if(nscale < 0.001) // -60 dB
+ nscale = 0.001;
+ if(nscale > 1000)
+ nscale = 1000; // +60 dB
+ return nscale;
+}
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/newhuffman.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/newhuffman.h
new file mode 100644
index 00000000..4d108a95
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/newhuffman.h
@@ -0,0 +1,824 @@
+/*
+ nwehuffman.h: optimized huffman tables (radix-4 lookup)
+
+ copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+
+#ifndef _MPG123_NEWHUFFMAN_H_
+#define _MPG123_NEWHUFFMAN_H_
+
+struct newhuff
+{
+ unsigned int linbits;
+ const short *table;
+};
+
+static const short tab0_[] =
+{
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+static const short tab1_[] =
+{
+ 0x0311, 0x0311, 0x0301, 0x0301, 0x0210, 0x0210, 0x0210, 0x0210,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+};
+
+static const short tab2_[] =
+{
+ -16, -32, 0x0311, 0x0311, 0x0301, 0x0301, 0x0310, 0x0310,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ 0x0222, 0x0222, 0x0222, 0x0222, 0x0202, 0x0202, 0x0202, 0x0202,
+ 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112,
+ 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121,
+ 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120,
+};
+
+static const short tab3_[] =
+{
+ -16, -32, 0x0310, 0x0310, 0x0211, 0x0211, 0x0211, 0x0211,
+ 0x0201, 0x0201, 0x0201, 0x0201, 0x0200, 0x0200, 0x0200, 0x0200,
+ 0x0222, 0x0222, 0x0222, 0x0222, 0x0202, 0x0202, 0x0202, 0x0202,
+ 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112,
+ 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121,
+ 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120
+};
+
+static const short tab5_[] =
+{
+ -16, -32, 0x0311, 0x0311, 0x0301, 0x0301, 0x0310, 0x0310,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ 0x0433, 0x0423, 0x0332, 0x0332, 0x0231, 0x0231, 0x0231, 0x0231,
+ 0x0313, 0x0313, 0x0303, 0x0303, 0x0330, 0x0330, 0x0322, 0x0322,
+ 0x0212, 0x0212, 0x0212, 0x0212, 0x0221, 0x0221, 0x0221, 0x0221,
+ 0x0202, 0x0202, 0x0202, 0x0202, 0x0220, 0x0220, 0x0220, 0x0220,
+};
+
+static const short tab6_[] =
+{
+ -16, -32, -48, 0x0412, 0x0421, 0x0420, 0x0301, 0x0301,
+ 0x0211, 0x0211, 0x0211, 0x0211, 0x0310, 0x0310, 0x0300, 0x0300,
+ 0x0333, 0x0333, 0x0303, 0x0303, 0x0223, 0x0223, 0x0223, 0x0223,
+ 0x0232, 0x0232, 0x0232, 0x0232, 0x0230, 0x0230, 0x0230, 0x0230,
+ 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113,
+ 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131,
+ 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122,
+ 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102,
+};
+
+static const short tab7_[] =
+{
+ -16, -32, -48, 0x0411, 0x0301, 0x0301, 0x0310, 0x0310,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ -48, -64, -80, 0x0415, 0x0451, -96, 0x0450, -112,
+ 0x0424, 0x0442, 0x0314, 0x0314, 0x0341, 0x0341, 0x0340, 0x0340,
+ 0x0404, 0x0423, 0x0432, 0x0403, 0x0313, 0x0313, 0x0331, 0x0331,
+ 0x0330, 0x0330, 0x0322, 0x0322, 0x0212, 0x0212, 0x0212, 0x0212,
+ 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121,
+ 0x0202, 0x0202, 0x0202, 0x0202, 0x0220, 0x0220, 0x0220, 0x0220,
+ 0x0255, 0x0255, 0x0255, 0x0255, 0x0245, 0x0245, 0x0245, 0x0245,
+ 0x0254, 0x0254, 0x0254, 0x0254, 0x0253, 0x0253, 0x0253, 0x0253,
+ 0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135,
+ 0x0144, 0x0144, 0x0144, 0x0144, 0x0144, 0x0144, 0x0144, 0x0144,
+ 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125,
+ 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152,
+ 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
+ 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134,
+ 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143,
+ 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133,
+};
+
+static const short tab8_[] =
+{
+ -16, -32, 0x0412, 0x0421, 0x0211, 0x0211, 0x0211, 0x0211,
+ 0x0301, 0x0301, 0x0310, 0x0310, 0x0200, 0x0200, 0x0200, 0x0200,
+ -32, -48, -64, 0x0415, 0x0451, -80, -96, 0x0424,
+ 0x0442, 0x0414, 0x0341, 0x0341, 0x0404, 0x0440, 0x0423, 0x0432,
+ 0x0413, 0x0431, 0x0403, 0x0430, 0x0222, 0x0222, 0x0222, 0x0222,
+ 0x0202, 0x0202, 0x0202, 0x0202, 0x0220, 0x0220, 0x0220, 0x0220,
+ 0x0355, 0x0355, 0x0354, 0x0354, 0x0245, 0x0245, 0x0245, 0x0245,
+ 0x0153, 0x0153, 0x0153, 0x0153, 0x0153, 0x0153, 0x0153, 0x0153,
+ 0x0235, 0x0235, 0x0235, 0x0235, 0x0244, 0x0244, 0x0244, 0x0244,
+ 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125,
+ 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152,
+ 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
+ 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134,
+ 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143,
+ 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150,
+ 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133,
+};
+
+static const short tab9_[] =
+{
+ -16, -32, -48, -64, -80, 0x0412, 0x0421, 0x0420,
+ 0x0311, 0x0311, 0x0301, 0x0301, 0x0310, 0x0310, 0x0300, 0x0300,
+ -80, 0x0435, 0x0453, -96, 0x0444, 0x0425, 0x0452, 0x0415,
+ 0x0351, 0x0351, 0x0334, 0x0334, 0x0343, 0x0343, 0x0450, 0x0404,
+ 0x0324, 0x0324, 0x0342, 0x0342, 0x0333, 0x0333, 0x0340, 0x0340,
+ 0x0214, 0x0214, 0x0214, 0x0214, 0x0241, 0x0241, 0x0241, 0x0241,
+ 0x0223, 0x0223, 0x0223, 0x0223, 0x0232, 0x0232, 0x0232, 0x0232,
+ 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113,
+ 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131,
+ 0x0203, 0x0203, 0x0203, 0x0203, 0x0230, 0x0230, 0x0230, 0x0230,
+ 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122,
+ 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102,
+ 0x0155, 0x0155, 0x0155, 0x0155, 0x0155, 0x0155, 0x0155, 0x0155,
+ 0x0145, 0x0145, 0x0145, 0x0145, 0x0145, 0x0145, 0x0145, 0x0145,
+ 0x0154, 0x0154, 0x0154, 0x0154, 0x0154, 0x0154, 0x0154, 0x0154,
+ 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
+};
+
+static const short tab10_[] =
+{
+ -16, -32, -48, 0x0411, 0x0301, 0x0301, 0x0310, 0x0310,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ -48, -64, -80, -96, -112, -128, -144, 0x0417,
+ 0x0471, -160, -176, -192, 0x0416, 0x0461, 0x0460, -208,
+ -208, -224, 0x0414, 0x0441, 0x0440, 0x0423, 0x0432, 0x0403,
+ 0x0313, 0x0313, 0x0331, 0x0331, 0x0330, 0x0330, 0x0322, 0x0322,
+ 0x0212, 0x0212, 0x0212, 0x0212, 0x0221, 0x0221, 0x0221, 0x0221,
+ 0x0202, 0x0202, 0x0202, 0x0202, 0x0220, 0x0220, 0x0220, 0x0220,
+ 0x0377, 0x0377, 0x0367, 0x0367, 0x0376, 0x0376, 0x0357, 0x0357,
+ 0x0375, 0x0375, 0x0366, 0x0366, 0x0247, 0x0247, 0x0247, 0x0247,
+ 0x0274, 0x0274, 0x0274, 0x0274, 0x0256, 0x0256, 0x0256, 0x0256,
+ 0x0265, 0x0265, 0x0265, 0x0265, 0x0237, 0x0237, 0x0237, 0x0237,
+ 0x0273, 0x0273, 0x0273, 0x0273, 0x0246, 0x0246, 0x0246, 0x0246,
+ 0x0355, 0x0355, 0x0354, 0x0354, 0x0263, 0x0263, 0x0263, 0x0263,
+ 0x0127, 0x0127, 0x0127, 0x0127, 0x0127, 0x0127, 0x0127, 0x0127,
+ 0x0172, 0x0172, 0x0172, 0x0172, 0x0172, 0x0172, 0x0172, 0x0172,
+ 0x0264, 0x0264, 0x0264, 0x0264, 0x0207, 0x0207, 0x0207, 0x0207,
+ 0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170,
+ 0x0162, 0x0162, 0x0162, 0x0162, 0x0162, 0x0162, 0x0162, 0x0162,
+ 0x0245, 0x0245, 0x0245, 0x0245, 0x0235, 0x0235, 0x0235, 0x0235,
+ 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106,
+ 0x0253, 0x0253, 0x0253, 0x0253, 0x0244, 0x0244, 0x0244, 0x0244,
+ 0x0136, 0x0136, 0x0136, 0x0136, 0x0136, 0x0136, 0x0136, 0x0136,
+ 0x0126, 0x0126, 0x0126, 0x0126, 0x0126, 0x0126, 0x0126, 0x0126,
+ 0x0225, 0x0225, 0x0225, 0x0225, 0x0252, 0x0252, 0x0252, 0x0252,
+ 0x0115, 0x0115, 0x0115, 0x0115, 0x0115, 0x0115, 0x0115, 0x0115,
+ 0x0151, 0x0151, 0x0151, 0x0151, 0x0151, 0x0151, 0x0151, 0x0151,
+ 0x0234, 0x0234, 0x0234, 0x0234, 0x0243, 0x0243, 0x0243, 0x0243,
+ 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
+ 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150,
+ 0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124,
+ 0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142,
+ 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133,
+ 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104,
+};
+
+static const short tab11_[] =
+{
+ -16, -32, -48, -64, 0x0412, -80, 0x0311, 0x0311,
+ 0x0301, 0x0301, 0x0310, 0x0310, 0x0200, 0x0200, 0x0200, 0x0200,
+ -80, -96, -112, -128, -144, 0x0427, 0x0472, -160,
+ 0x0371, 0x0371, 0x0417, 0x0470, 0x0436, 0x0463, 0x0460, -176,
+ -176, 0x0415, 0x0362, 0x0362, 0x0426, 0x0406, 0x0316, 0x0316,
+ 0x0361, 0x0361, 0x0451, 0x0434, 0x0450, -192, 0x0424, 0x0442,
+ 0x0414, 0x0441, 0x0404, 0x0440, 0x0323, 0x0323, 0x0332, 0x0332,
+ 0x0213, 0x0213, 0x0213, 0x0213, 0x0231, 0x0231, 0x0231, 0x0231,
+ 0x0303, 0x0303, 0x0330, 0x0330, 0x0222, 0x0222, 0x0222, 0x0222,
+ 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121,
+ 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102,
+ 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120,
+ 0x0277, 0x0277, 0x0277, 0x0277, 0x0267, 0x0267, 0x0267, 0x0267,
+ 0x0276, 0x0276, 0x0276, 0x0276, 0x0275, 0x0275, 0x0275, 0x0275,
+ 0x0266, 0x0266, 0x0266, 0x0266, 0x0247, 0x0247, 0x0247, 0x0247,
+ 0x0274, 0x0274, 0x0274, 0x0274, 0x0357, 0x0357, 0x0355, 0x0355,
+ 0x0256, 0x0256, 0x0256, 0x0256, 0x0265, 0x0265, 0x0265, 0x0265,
+ 0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137,
+ 0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173,
+ 0x0146, 0x0146, 0x0146, 0x0146, 0x0146, 0x0146, 0x0146, 0x0146,
+ 0x0245, 0x0245, 0x0245, 0x0245, 0x0254, 0x0254, 0x0254, 0x0254,
+ 0x0235, 0x0235, 0x0235, 0x0235, 0x0253, 0x0253, 0x0253, 0x0253,
+ 0x0164, 0x0164, 0x0164, 0x0164, 0x0164, 0x0164, 0x0164, 0x0164,
+ 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107,
+ 0x0144, 0x0144, 0x0144, 0x0144, 0x0144, 0x0144, 0x0144, 0x0144,
+ 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125,
+ 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152,
+ 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
+ 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143,
+ 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133,
+};
+
+static const short tab12_[] =
+{
+ -16, -32, -48, -64, -80, -96, 0x0412, 0x0421,
+ -112, 0x0400, 0x0311, 0x0311, 0x0301, 0x0301, 0x0310, 0x0310,
+ -112, -128, -144, -160, 0x0456, 0x0437, -176, 0x0427,
+ 0x0472, 0x0446, 0x0464, 0x0417, 0x0471, -192, 0x0436, 0x0463,
+ 0x0445, 0x0454, 0x0444, -192, 0x0326, 0x0326, 0x0362, 0x0362,
+ 0x0361, 0x0361, 0x0416, 0x0460, 0x0435, 0x0453, 0x0425, 0x0452,
+ 0x0315, 0x0315, 0x0351, 0x0351, 0x0334, 0x0334, 0x0343, 0x0343,
+ 0x0450, 0x0404, 0x0324, 0x0324, 0x0342, 0x0342, 0x0314, 0x0314,
+ 0x0233, 0x0233, 0x0233, 0x0233, 0x0241, 0x0241, 0x0241, 0x0241,
+ 0x0223, 0x0223, 0x0223, 0x0223, 0x0232, 0x0232, 0x0232, 0x0232,
+ 0x0340, 0x0340, 0x0303, 0x0303, 0x0230, 0x0230, 0x0230, 0x0230,
+ 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113,
+ 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131,
+ 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122,
+ 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102,
+ 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120,
+ 0x0277, 0x0277, 0x0277, 0x0277, 0x0267, 0x0267, 0x0267, 0x0267,
+ 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176,
+ 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157,
+ 0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175,
+ 0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166,
+ 0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147,
+ 0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174,
+ 0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165,
+ 0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173,
+ 0x0155, 0x0155, 0x0155, 0x0155, 0x0155, 0x0155, 0x0155, 0x0155,
+ 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107,
+ 0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170,
+ 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106,
+ 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
+};
+
+static const short tab13_[] =
+{
+ -16, -32, -48, -64, 0x0411, 0x0401, 0x0310, 0x0310,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ -64, -80, -96, -112, -128, -144, -160, -176,
+ -192, -208, -224, -240, -256, -272, -288, -304,
+ -304, -320, -336, -352, 0x0481, -368, -384, -400,
+ -416, -432, 0x0415, 0x0451, -448, -464, -480, 0x0414,
+ 0x0341, 0x0341, 0x0404, 0x0440, 0x0423, 0x0432, 0x0313, 0x0313,
+ 0x0331, 0x0331, 0x0303, 0x0303, 0x0330, 0x0330, 0x0322, 0x0322,
+ 0x0212, 0x0212, 0x0212, 0x0212, 0x0221, 0x0221, 0x0221, 0x0221,
+ 0x0202, 0x0202, 0x0202, 0x0202, 0x0220, 0x0220, 0x0220, 0x0220,
+ -448, -464, -480, -496, -512, -528, -544, -560,
+ -576, -592, -608, -624, -640, -656, 0x041f, 0x04f1,
+ 0x04f0, -656, -672, -688, 0x04e2, -704, 0x041e, 0x04e1,
+ -720, -736, -752, -768, -784, -800, 0x04c6, 0x043d,
+ -800, 0x042d, 0x04d2, 0x041d, 0x04b7, -816, -832, 0x04c3,
+ -848, 0x044b, 0x03d1, 0x03d1, 0x040d, 0x04d0, 0x048a, 0x04a8,
+ 0x044c, 0x04c4, 0x046b, 0x04b6, 0x033c, 0x033c, 0x032c, 0x032c,
+ 0x03c2, 0x03c2, 0x035b, 0x035b, 0x04b5, 0x0489, 0x031c, 0x031c,
+ 0x03c1, 0x03c1, 0x0498, 0x040c, 0x03c0, 0x03c0, 0x04b4, 0x046a,
+ 0x04a6, 0x0479, 0x033b, 0x033b, 0x03b3, 0x03b3, 0x0488, 0x045a,
+ 0x032b, 0x032b, 0x04a5, 0x0469, 0x03a4, 0x03a4, 0x0478, 0x0487,
+ 0x0394, 0x0394, 0x0477, 0x0476, 0x02b2, 0x02b2, 0x02b2, 0x02b2,
+ 0x021b, 0x021b, 0x021b, 0x021b, 0x02b1, 0x02b1, 0x02b1, 0x02b1,
+ 0x030b, 0x030b, 0x03b0, 0x03b0, 0x0396, 0x0396, 0x034a, 0x034a,
+ 0x033a, 0x033a, 0x03a3, 0x03a3, 0x0359, 0x0359, 0x0395, 0x0395,
+ 0x022a, 0x022a, 0x022a, 0x022a, 0x02a2, 0x02a2, 0x02a2, 0x02a2,
+ 0x021a, 0x021a, 0x021a, 0x021a, 0x02a1, 0x02a1, 0x02a1, 0x02a1,
+ 0x030a, 0x030a, 0x0368, 0x0368, 0x02a0, 0x02a0, 0x02a0, 0x02a0,
+ 0x0386, 0x0386, 0x0349, 0x0349, 0x0293, 0x0293, 0x0293, 0x0293,
+ 0x0339, 0x0339, 0x0358, 0x0358, 0x0385, 0x0385, 0x0367, 0x0367,
+ 0x0229, 0x0229, 0x0229, 0x0229, 0x0292, 0x0292, 0x0292, 0x0292,
+ 0x0357, 0x0357, 0x0375, 0x0375, 0x0238, 0x0238, 0x0238, 0x0238,
+ 0x0283, 0x0283, 0x0283, 0x0283, 0x0366, 0x0366, 0x0347, 0x0347,
+ 0x0374, 0x0374, 0x0356, 0x0356, 0x0365, 0x0365, 0x0373, 0x0373,
+ 0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119,
+ 0x0191, 0x0191, 0x0191, 0x0191, 0x0191, 0x0191, 0x0191, 0x0191,
+ 0x0209, 0x0209, 0x0209, 0x0209, 0x0290, 0x0290, 0x0290, 0x0290,
+ 0x0248, 0x0248, 0x0248, 0x0248, 0x0284, 0x0284, 0x0284, 0x0284,
+ 0x0272, 0x0272, 0x0272, 0x0272, 0x0346, 0x0346, 0x0364, 0x0364,
+ 0x0128, 0x0128, 0x0128, 0x0128, 0x0128, 0x0128, 0x0128, 0x0128,
+ 0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182,
+ 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118,
+ 0x0237, 0x0237, 0x0237, 0x0237, 0x0227, 0x0227, 0x0227, 0x0227,
+ 0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117,
+ 0x0171, 0x0171, 0x0171, 0x0171, 0x0171, 0x0171, 0x0171, 0x0171,
+ 0x0255, 0x0255, 0x0255, 0x0255, 0x0207, 0x0207, 0x0207, 0x0207,
+ 0x0270, 0x0270, 0x0270, 0x0270, 0x0236, 0x0236, 0x0236, 0x0236,
+ 0x0263, 0x0263, 0x0263, 0x0263, 0x0245, 0x0245, 0x0245, 0x0245,
+ 0x0254, 0x0254, 0x0254, 0x0254, 0x0226, 0x0226, 0x0226, 0x0226,
+ 0x0262, 0x0262, 0x0262, 0x0262, 0x0235, 0x0235, 0x0235, 0x0235,
+ 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108,
+ 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180,
+ 0x0116, 0x0116, 0x0116, 0x0116, 0x0116, 0x0116, 0x0116, 0x0116,
+ 0x0161, 0x0161, 0x0161, 0x0161, 0x0161, 0x0161, 0x0161, 0x0161,
+ 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106,
+ 0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160,
+ 0x0253, 0x0253, 0x0253, 0x0253, 0x0244, 0x0244, 0x0244, 0x0244,
+ 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125,
+ 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152,
+ 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
+ 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134,
+ 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143,
+ 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150,
+ 0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124,
+ 0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142,
+ 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133,
+ -448, 0x04ff, 0x04ef, 0x04df, 0x04ee, 0x04cf, 0x04de, 0x04bf,
+ 0x04fb, 0x04ce, 0x04dc, -464, 0x03ec, 0x03ec, 0x03dd, 0x03dd,
+ 0x04fa, 0x04cd, 0x03be, 0x03be, 0x03eb, 0x03eb, 0x039f, 0x039f,
+ 0x03f9, 0x03f9, 0x03ea, 0x03ea, 0x03bd, 0x03bd, 0x03db, 0x03db,
+ 0x038f, 0x038f, 0x03f8, 0x03f8, 0x03cc, 0x03cc, 0x04ae, 0x049e,
+ 0x038e, 0x038e, 0x047f, 0x047e, 0x02f7, 0x02f7, 0x02f7, 0x02f7,
+ 0x02da, 0x02da, 0x02da, 0x02da, 0x03ad, 0x03ad, 0x03bc, 0x03bc,
+ 0x03cb, 0x03cb, 0x03f6, 0x03f6, 0x026f, 0x026f, 0x026f, 0x026f,
+ 0x02e8, 0x02e8, 0x02e8, 0x02e8, 0x025f, 0x025f, 0x025f, 0x025f,
+ 0x029d, 0x029d, 0x029d, 0x029d, 0x02d9, 0x02d9, 0x02d9, 0x02d9,
+ 0x02f5, 0x02f5, 0x02f5, 0x02f5, 0x02e7, 0x02e7, 0x02e7, 0x02e7,
+ 0x02ac, 0x02ac, 0x02ac, 0x02ac, 0x02bb, 0x02bb, 0x02bb, 0x02bb,
+ 0x024f, 0x024f, 0x024f, 0x024f, 0x02f4, 0x02f4, 0x02f4, 0x02f4,
+ 0x03ca, 0x03ca, 0x03e6, 0x03e6, 0x02f3, 0x02f3, 0x02f3, 0x02f3,
+ 0x013f, 0x013f, 0x013f, 0x013f, 0x013f, 0x013f, 0x013f, 0x013f,
+ 0x028d, 0x028d, 0x028d, 0x028d, 0x02d8, 0x02d8, 0x02d8, 0x02d8,
+ 0x012f, 0x012f, 0x012f, 0x012f, 0x012f, 0x012f, 0x012f, 0x012f,
+ 0x01f2, 0x01f2, 0x01f2, 0x01f2, 0x01f2, 0x01f2, 0x01f2, 0x01f2,
+ 0x026e, 0x026e, 0x026e, 0x026e, 0x029c, 0x029c, 0x029c, 0x029c,
+ 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f,
+ 0x02c9, 0x02c9, 0x02c9, 0x02c9, 0x025e, 0x025e, 0x025e, 0x025e,
+ 0x01ab, 0x01ab, 0x01ab, 0x01ab, 0x01ab, 0x01ab, 0x01ab, 0x01ab,
+ 0x027d, 0x027d, 0x027d, 0x027d, 0x02d7, 0x02d7, 0x02d7, 0x02d7,
+ 0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e,
+ 0x02c8, 0x02c8, 0x02c8, 0x02c8, 0x02d6, 0x02d6, 0x02d6, 0x02d6,
+ 0x013e, 0x013e, 0x013e, 0x013e, 0x013e, 0x013e, 0x013e, 0x013e,
+ 0x01b9, 0x01b9, 0x01b9, 0x01b9, 0x01b9, 0x01b9, 0x01b9, 0x01b9,
+ 0x029b, 0x029b, 0x029b, 0x029b, 0x02aa, 0x02aa, 0x02aa, 0x02aa,
+ 0x01ba, 0x01ba, 0x01ba, 0x01ba, 0x01ba, 0x01ba, 0x01ba, 0x01ba,
+ 0x01e5, 0x01e5, 0x01e5, 0x01e5, 0x01e5, 0x01e5, 0x01e5, 0x01e5,
+ 0x01e4, 0x01e4, 0x01e4, 0x01e4, 0x01e4, 0x01e4, 0x01e4, 0x01e4,
+ 0x018c, 0x018c, 0x018c, 0x018c, 0x018c, 0x018c, 0x018c, 0x018c,
+ 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d,
+ 0x01e3, 0x01e3, 0x01e3, 0x01e3, 0x01e3, 0x01e3, 0x01e3, 0x01e3,
+ 0x012e, 0x012e, 0x012e, 0x012e, 0x012e, 0x012e, 0x012e, 0x012e,
+ 0x010e, 0x010e, 0x010e, 0x010e, 0x010e, 0x010e, 0x010e, 0x010e,
+ 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0,
+ 0x015d, 0x015d, 0x015d, 0x015d, 0x015d, 0x015d, 0x015d, 0x015d,
+ 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5,
+ 0x017c, 0x017c, 0x017c, 0x017c, 0x017c, 0x017c, 0x017c, 0x017c,
+ 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7,
+ 0x014d, 0x014d, 0x014d, 0x014d, 0x014d, 0x014d, 0x014d, 0x014d,
+ 0x018b, 0x018b, 0x018b, 0x018b, 0x018b, 0x018b, 0x018b, 0x018b,
+ 0x01b8, 0x01b8, 0x01b8, 0x01b8, 0x01b8, 0x01b8, 0x01b8, 0x01b8,
+ 0x01d4, 0x01d4, 0x01d4, 0x01d4, 0x01d4, 0x01d4, 0x01d4, 0x01d4,
+ 0x019a, 0x019a, 0x019a, 0x019a, 0x019a, 0x019a, 0x019a, 0x019a,
+ 0x01a9, 0x01a9, 0x01a9, 0x01a9, 0x01a9, 0x01a9, 0x01a9, 0x01a9,
+ 0x016c, 0x016c, 0x016c, 0x016c, 0x016c, 0x016c, 0x016c, 0x016c,
+ 0x01d3, 0x01d3, 0x01d3, 0x01d3, 0x01d3, 0x01d3, 0x01d3, 0x01d3,
+ 0x017b, 0x017b, 0x017b, 0x017b, 0x017b, 0x017b, 0x017b, 0x017b,
+ 0x015c, 0x015c, 0x015c, 0x015c, 0x015c, 0x015c, 0x015c, 0x015c,
+ 0x01c5, 0x01c5, 0x01c5, 0x01c5, 0x01c5, 0x01c5, 0x01c5, 0x01c5,
+ 0x0199, 0x0199, 0x0199, 0x0199, 0x0199, 0x0199, 0x0199, 0x0199,
+ 0x017a, 0x017a, 0x017a, 0x017a, 0x017a, 0x017a, 0x017a, 0x017a,
+ 0x01a7, 0x01a7, 0x01a7, 0x01a7, 0x01a7, 0x01a7, 0x01a7, 0x01a7,
+ 0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0197,
+ 0x03fe, 0x03fe, 0x03fc, 0x03fc, 0x02fd, 0x02fd, 0x02fd, 0x02fd,
+ 0x01ed, 0x01ed, 0x01ed, 0x01ed, 0x01ed, 0x01ed, 0x01ed, 0x01ed,
+ 0x01af, 0x01af, 0x01af, 0x01af, 0x01af, 0x01af, 0x01af, 0x01af,
+ 0x01e9, 0x01e9, 0x01e9, 0x01e9, 0x01e9, 0x01e9, 0x01e9, 0x01e9,
+};
+
+static const short tab15_[] =
+{
+ -16, -32, -48, -64, -80, -96, -112, -128,
+ -144, -160, 0x0311, 0x0311, 0x0401, 0x0410, 0x0300, 0x0300,
+ -160, -176, -192, -208, -224, -240, -256, -272,
+ -288, -304, -320, -336, -352, -368, -384, -400,
+ -400, -416, -432, -448, -464, -480, -496, -512,
+ -528, -544, -560, -576, -592, -608, -624, -640,
+ -640, -656, 0x0491, -672, -688, -704, -720, -736,
+ 0x0428, 0x0482, 0x0418, 0x0481, -752, -768, -784, -800,
+ 0x0427, 0x0472, 0x0464, 0x0417, 0x0455, 0x0471, -800, 0x0436,
+ 0x0463, 0x0445, 0x0454, 0x0426, 0x0462, 0x0416, -816, 0x0435,
+ 0x0361, 0x0361, 0x0453, 0x0444, 0x0325, 0x0325, 0x0352, 0x0352,
+ 0x0315, 0x0315, 0x0351, 0x0351, 0x0405, 0x0450, 0x0334, 0x0334,
+ 0x0343, 0x0343, 0x0324, 0x0324, 0x0342, 0x0342, 0x0333, 0x0333,
+ 0x0241, 0x0241, 0x0241, 0x0241, 0x0314, 0x0314, 0x0304, 0x0304,
+ 0x0223, 0x0223, 0x0223, 0x0223, 0x0232, 0x0232, 0x0232, 0x0232,
+ 0x0340, 0x0340, 0x0303, 0x0303, 0x0213, 0x0213, 0x0213, 0x0213,
+ 0x0231, 0x0231, 0x0231, 0x0231, 0x0230, 0x0230, 0x0230, 0x0230,
+ 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122,
+ 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112,
+ 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121,
+ 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102,
+ 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120,
+ -720, -736, 0x04ee, -752, -768, -784, 0x04fb, -800,
+ 0x04dd, 0x04af, 0x04fa, 0x04be, 0x04eb, 0x04cd, 0x04dc, 0x049f,
+ 0x04f9, 0x04ea, 0x04bd, 0x04db, 0x048f, 0x04f8, 0x04cc, 0x049e,
+ 0x04e9, 0x047f, 0x04f7, 0x04ad, 0x04da, 0x04bc, 0x046f, -800,
+ 0x03cb, 0x03cb, 0x03f6, 0x03f6, 0x048e, 0x04e8, 0x045f, 0x049d,
+ 0x03f5, 0x03f5, 0x037e, 0x037e, 0x03e7, 0x03e7, 0x03ac, 0x03ac,
+ 0x03ca, 0x03ca, 0x03bb, 0x03bb, 0x04d9, 0x048d, 0x034f, 0x034f,
+ 0x03f4, 0x03f4, 0x033f, 0x033f, 0x03f3, 0x03f3, 0x03d8, 0x03d8,
+ 0x03e6, 0x03e6, 0x032f, 0x032f, 0x03f2, 0x03f2, 0x046e, 0x04f0,
+ 0x031f, 0x031f, 0x03f1, 0x03f1, 0x039c, 0x039c, 0x03c9, 0x03c9,
+ 0x035e, 0x035e, 0x03ab, 0x03ab, 0x03ba, 0x03ba, 0x03e5, 0x03e5,
+ 0x037d, 0x037d, 0x03d7, 0x03d7, 0x034e, 0x034e, 0x03e4, 0x03e4,
+ 0x038c, 0x038c, 0x03c8, 0x03c8, 0x033e, 0x033e, 0x036d, 0x036d,
+ 0x03d6, 0x03d6, 0x03e3, 0x03e3, 0x039b, 0x039b, 0x03b9, 0x03b9,
+ 0x032e, 0x032e, 0x03aa, 0x03aa, 0x03e2, 0x03e2, 0x031e, 0x031e,
+ 0x03e1, 0x03e1, 0x040e, 0x04e0, 0x035d, 0x035d, 0x03d5, 0x03d5,
+ 0x037c, 0x037c, 0x03c7, 0x03c7, 0x034d, 0x034d, 0x038b, 0x038b,
+ 0x02d4, 0x02d4, 0x02d4, 0x02d4, 0x03b8, 0x03b8, 0x039a, 0x039a,
+ 0x03a9, 0x03a9, 0x036c, 0x036c, 0x03c6, 0x03c6, 0x033d, 0x033d,
+ 0x02d3, 0x02d3, 0x02d3, 0x02d3, 0x02d2, 0x02d2, 0x02d2, 0x02d2,
+ 0x032d, 0x032d, 0x030d, 0x030d, 0x021d, 0x021d, 0x021d, 0x021d,
+ 0x027b, 0x027b, 0x027b, 0x027b, 0x02b7, 0x02b7, 0x02b7, 0x02b7,
+ 0x02d1, 0x02d1, 0x02d1, 0x02d1, 0x035c, 0x035c, 0x03d0, 0x03d0,
+ 0x02c5, 0x02c5, 0x02c5, 0x02c5, 0x028a, 0x028a, 0x028a, 0x028a,
+ 0x02a8, 0x02a8, 0x02a8, 0x02a8, 0x024c, 0x024c, 0x024c, 0x024c,
+ 0x02c4, 0x02c4, 0x02c4, 0x02c4, 0x026b, 0x026b, 0x026b, 0x026b,
+ 0x02b6, 0x02b6, 0x02b6, 0x02b6, 0x0399, 0x0399, 0x030c, 0x030c,
+ 0x023c, 0x023c, 0x023c, 0x023c, 0x02c3, 0x02c3, 0x02c3, 0x02c3,
+ 0x027a, 0x027a, 0x027a, 0x027a, 0x02a7, 0x02a7, 0x02a7, 0x02a7,
+ 0x02a6, 0x02a6, 0x02a6, 0x02a6, 0x03c0, 0x03c0, 0x030b, 0x030b,
+ 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2,
+ 0x022c, 0x022c, 0x022c, 0x022c, 0x025b, 0x025b, 0x025b, 0x025b,
+ 0x02b5, 0x02b5, 0x02b5, 0x02b5, 0x021c, 0x021c, 0x021c, 0x021c,
+ 0x0289, 0x0289, 0x0289, 0x0289, 0x0298, 0x0298, 0x0298, 0x0298,
+ 0x02c1, 0x02c1, 0x02c1, 0x02c1, 0x024b, 0x024b, 0x024b, 0x024b,
+ 0x02b4, 0x02b4, 0x02b4, 0x02b4, 0x026a, 0x026a, 0x026a, 0x026a,
+ 0x023b, 0x023b, 0x023b, 0x023b, 0x0279, 0x0279, 0x0279, 0x0279,
+ 0x01b3, 0x01b3, 0x01b3, 0x01b3, 0x01b3, 0x01b3, 0x01b3, 0x01b3,
+ 0x0297, 0x0297, 0x0297, 0x0297, 0x0288, 0x0288, 0x0288, 0x0288,
+ 0x022b, 0x022b, 0x022b, 0x022b, 0x025a, 0x025a, 0x025a, 0x025a,
+ 0x01b2, 0x01b2, 0x01b2, 0x01b2, 0x01b2, 0x01b2, 0x01b2, 0x01b2,
+ 0x02a5, 0x02a5, 0x02a5, 0x02a5, 0x021b, 0x021b, 0x021b, 0x021b,
+ 0x01b1, 0x01b1, 0x01b1, 0x01b1, 0x01b1, 0x01b1, 0x01b1, 0x01b1,
+ 0x02b0, 0x02b0, 0x02b0, 0x02b0, 0x0269, 0x0269, 0x0269, 0x0269,
+ 0x0296, 0x0296, 0x0296, 0x0296, 0x024a, 0x024a, 0x024a, 0x024a,
+ 0x02a4, 0x02a4, 0x02a4, 0x02a4, 0x0278, 0x0278, 0x0278, 0x0278,
+ 0x0287, 0x0287, 0x0287, 0x0287, 0x023a, 0x023a, 0x023a, 0x023a,
+ 0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01a3,
+ 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159,
+ 0x0195, 0x0195, 0x0195, 0x0195, 0x0195, 0x0195, 0x0195, 0x0195,
+ 0x012a, 0x012a, 0x012a, 0x012a, 0x012a, 0x012a, 0x012a, 0x012a,
+ 0x01a2, 0x01a2, 0x01a2, 0x01a2, 0x01a2, 0x01a2, 0x01a2, 0x01a2,
+ 0x011a, 0x011a, 0x011a, 0x011a, 0x011a, 0x011a, 0x011a, 0x011a,
+ 0x01a1, 0x01a1, 0x01a1, 0x01a1, 0x01a1, 0x01a1, 0x01a1, 0x01a1,
+ 0x020a, 0x020a, 0x020a, 0x020a, 0x02a0, 0x02a0, 0x02a0, 0x02a0,
+ 0x0168, 0x0168, 0x0168, 0x0168, 0x0168, 0x0168, 0x0168, 0x0168,
+ 0x0186, 0x0186, 0x0186, 0x0186, 0x0186, 0x0186, 0x0186, 0x0186,
+ 0x0149, 0x0149, 0x0149, 0x0149, 0x0149, 0x0149, 0x0149, 0x0149,
+ 0x0194, 0x0194, 0x0194, 0x0194, 0x0194, 0x0194, 0x0194, 0x0194,
+ 0x0139, 0x0139, 0x0139, 0x0139, 0x0139, 0x0139, 0x0139, 0x0139,
+ 0x0193, 0x0193, 0x0193, 0x0193, 0x0193, 0x0193, 0x0193, 0x0193,
+ 0x0277, 0x0277, 0x0277, 0x0277, 0x0209, 0x0209, 0x0209, 0x0209,
+ 0x0158, 0x0158, 0x0158, 0x0158, 0x0158, 0x0158, 0x0158, 0x0158,
+ 0x0185, 0x0185, 0x0185, 0x0185, 0x0185, 0x0185, 0x0185, 0x0185,
+ 0x0129, 0x0129, 0x0129, 0x0129, 0x0129, 0x0129, 0x0129, 0x0129,
+ 0x0167, 0x0167, 0x0167, 0x0167, 0x0167, 0x0167, 0x0167, 0x0167,
+ 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176,
+ 0x0192, 0x0192, 0x0192, 0x0192, 0x0192, 0x0192, 0x0192, 0x0192,
+ 0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119,
+ 0x0190, 0x0190, 0x0190, 0x0190, 0x0190, 0x0190, 0x0190, 0x0190,
+ 0x0148, 0x0148, 0x0148, 0x0148, 0x0148, 0x0148, 0x0148, 0x0148,
+ 0x0184, 0x0184, 0x0184, 0x0184, 0x0184, 0x0184, 0x0184, 0x0184,
+ 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157,
+ 0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175,
+ 0x0138, 0x0138, 0x0138, 0x0138, 0x0138, 0x0138, 0x0138, 0x0138,
+ 0x0183, 0x0183, 0x0183, 0x0183, 0x0183, 0x0183, 0x0183, 0x0183,
+ 0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166,
+ 0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147,
+ 0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174,
+ 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108,
+ 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180,
+ 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156,
+ 0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165,
+ 0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137,
+ 0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173,
+ 0x0146, 0x0146, 0x0146, 0x0146, 0x0146, 0x0146, 0x0146, 0x0146,
+ 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107,
+ 0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170,
+ 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106,
+ 0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160,
+ 0x01ff, 0x01ff, 0x01ff, 0x01ff, 0x01ff, 0x01ff, 0x01ff, 0x01ff,
+ 0x01ef, 0x01ef, 0x01ef, 0x01ef, 0x01ef, 0x01ef, 0x01ef, 0x01ef,
+ 0x01fe, 0x01fe, 0x01fe, 0x01fe, 0x01fe, 0x01fe, 0x01fe, 0x01fe,
+ 0x01df, 0x01df, 0x01df, 0x01df, 0x01df, 0x01df, 0x01df, 0x01df,
+ 0x01fd, 0x01fd, 0x01fd, 0x01fd, 0x01fd, 0x01fd, 0x01fd, 0x01fd,
+ 0x01cf, 0x01cf, 0x01cf, 0x01cf, 0x01cf, 0x01cf, 0x01cf, 0x01cf,
+ 0x01fc, 0x01fc, 0x01fc, 0x01fc, 0x01fc, 0x01fc, 0x01fc, 0x01fc,
+ 0x01de, 0x01de, 0x01de, 0x01de, 0x01de, 0x01de, 0x01de, 0x01de,
+ 0x01ed, 0x01ed, 0x01ed, 0x01ed, 0x01ed, 0x01ed, 0x01ed, 0x01ed,
+ 0x01bf, 0x01bf, 0x01bf, 0x01bf, 0x01bf, 0x01bf, 0x01bf, 0x01bf,
+ 0x01ce, 0x01ce, 0x01ce, 0x01ce, 0x01ce, 0x01ce, 0x01ce, 0x01ce,
+ 0x01ec, 0x01ec, 0x01ec, 0x01ec, 0x01ec, 0x01ec, 0x01ec, 0x01ec,
+ 0x01ae, 0x01ae, 0x01ae, 0x01ae, 0x01ae, 0x01ae, 0x01ae, 0x01ae,
+ 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f,
+};
+
+static const short tab16_[] =
+{
+ -16, -32, -48, -64, 0x0411, 0x0401, 0x0310, 0x0310,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ -64, -80, -96, 0x04ff, -112, -128, -144, 0x04f2,
+ -160, 0x041f, 0x04f1, -176, -192, -208, -224, -240,
+ -240, -256, -272, -288, -304, -320, -336, -352,
+ -368, -384, -400, -416, -432, -448, 0x0451, -464,
+ -464, -480, -496, 0x0414, 0x0441, -512, 0x0423, 0x0432,
+ 0x0313, 0x0313, 0x0331, 0x0331, 0x0403, 0x0430, 0x0322, 0x0322,
+ 0x0212, 0x0212, 0x0212, 0x0212, 0x0221, 0x0221, 0x0221, 0x0221,
+ 0x0202, 0x0202, 0x0202, 0x0202, 0x0220, 0x0220, 0x0220, 0x0220,
+ 0x03ef, 0x03ef, 0x03fe, 0x03fe, 0x03df, 0x03df, 0x03fd, 0x03fd,
+ 0x03cf, 0x03cf, 0x03fc, 0x03fc, 0x03bf, 0x03bf, 0x03fb, 0x03fb,
+ 0x02af, 0x02af, 0x02af, 0x02af, 0x03fa, 0x03fa, 0x039f, 0x039f,
+ 0x03f9, 0x03f9, 0x03f8, 0x03f8, 0x028f, 0x028f, 0x028f, 0x028f,
+ 0x027f, 0x027f, 0x027f, 0x027f, 0x02f7, 0x02f7, 0x02f7, 0x02f7,
+ 0x026f, 0x026f, 0x026f, 0x026f, 0x02f6, 0x02f6, 0x02f6, 0x02f6,
+ 0x025f, 0x025f, 0x025f, 0x025f, 0x02f5, 0x02f5, 0x02f5, 0x02f5,
+ 0x014f, 0x014f, 0x014f, 0x014f, 0x014f, 0x014f, 0x014f, 0x014f,
+ 0x01f4, 0x01f4, 0x01f4, 0x01f4, 0x01f4, 0x01f4, 0x01f4, 0x01f4,
+ 0x01f3, 0x01f3, 0x01f3, 0x01f3, 0x01f3, 0x01f3, 0x01f3, 0x01f3,
+ 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0,
+ 0x023f, 0x023f, 0x023f, 0x023f, -416, -432, -448, -464,
+ 0x012f, 0x012f, 0x012f, 0x012f, 0x012f, 0x012f, 0x012f, 0x012f,
+ 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f,
+ -448, -464, -480, -496, -512, -528, -544, -560,
+ -576, -592, -608, 0x04e3, -624, -640, -656, -672,
+ -672, -688, -704, 0x040d, -720, -736, -752, 0x043c,
+ -768, 0x041c, 0x04c0, -784, 0x03e2, 0x03e2, 0x042e, 0x041e,
+ 0x04d3, 0x042d, 0x04d2, 0x04d1, 0x043b, -784, 0x031d, 0x031d,
+ 0x04c4, 0x046b, 0x04c3, 0x04a7, 0x032c, 0x032c, 0x04c2, 0x04b5,
+ 0x04c1, 0x040c, 0x044b, 0x04b4, 0x046a, 0x04a6, 0x03b3, 0x03b3,
+ 0x045a, 0x04a5, 0x032b, 0x032b, 0x03b2, 0x03b2, 0x031b, 0x031b,
+ 0x03b1, 0x03b1, 0x040b, 0x04b0, 0x0469, 0x0496, 0x044a, 0x04a4,
+ 0x0478, 0x0487, 0x03a3, 0x03a3, 0x043a, 0x0459, 0x032a, 0x032a,
+ 0x0495, 0x0468, 0x03a1, 0x03a1, 0x0486, 0x0477, 0x0394, 0x0394,
+ 0x0449, 0x0457, 0x0367, 0x0367, 0x02a2, 0x02a2, 0x02a2, 0x02a2,
+ 0x021a, 0x021a, 0x021a, 0x021a, 0x030a, 0x030a, 0x03a0, 0x03a0,
+ 0x0339, 0x0339, 0x0393, 0x0393, 0x0358, 0x0358, 0x0385, 0x0385,
+ 0x0229, 0x0229, 0x0229, 0x0229, 0x0292, 0x0292, 0x0292, 0x0292,
+ 0x0376, 0x0376, 0x0309, 0x0309, 0x0219, 0x0219, 0x0219, 0x0219,
+ 0x0291, 0x0291, 0x0291, 0x0291, 0x0390, 0x0390, 0x0348, 0x0348,
+ 0x0384, 0x0384, 0x0375, 0x0375, 0x0338, 0x0338, 0x0383, 0x0383,
+ 0x0366, 0x0366, 0x0328, 0x0328, 0x0282, 0x0282, 0x0282, 0x0282,
+ 0x0347, 0x0347, 0x0374, 0x0374, 0x0218, 0x0218, 0x0218, 0x0218,
+ 0x0281, 0x0281, 0x0281, 0x0281, 0x0280, 0x0280, 0x0280, 0x0280,
+ 0x0308, 0x0308, 0x0356, 0x0356, 0x0237, 0x0237, 0x0237, 0x0237,
+ 0x0273, 0x0273, 0x0273, 0x0273, 0x0365, 0x0365, 0x0346, 0x0346,
+ 0x0227, 0x0227, 0x0227, 0x0227, 0x0272, 0x0272, 0x0272, 0x0272,
+ 0x0364, 0x0364, 0x0355, 0x0355, 0x0207, 0x0207, 0x0207, 0x0207,
+ 0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117,
+ 0x0171, 0x0171, 0x0171, 0x0171, 0x0171, 0x0171, 0x0171, 0x0171,
+ 0x0270, 0x0270, 0x0270, 0x0270, 0x0236, 0x0236, 0x0236, 0x0236,
+ 0x0263, 0x0263, 0x0263, 0x0263, 0x0245, 0x0245, 0x0245, 0x0245,
+ 0x0254, 0x0254, 0x0254, 0x0254, 0x0226, 0x0226, 0x0226, 0x0226,
+ 0x0162, 0x0162, 0x0162, 0x0162, 0x0162, 0x0162, 0x0162, 0x0162,
+ 0x0116, 0x0116, 0x0116, 0x0116, 0x0116, 0x0116, 0x0116, 0x0116,
+ 0x0161, 0x0161, 0x0161, 0x0161, 0x0161, 0x0161, 0x0161, 0x0161,
+ 0x0206, 0x0206, 0x0206, 0x0206, 0x0260, 0x0260, 0x0260, 0x0260,
+ 0x0153, 0x0153, 0x0153, 0x0153, 0x0153, 0x0153, 0x0153, 0x0153,
+ 0x0235, 0x0235, 0x0235, 0x0235, 0x0244, 0x0244, 0x0244, 0x0244,
+ 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125,
+ 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152,
+ 0x0115, 0x0115, 0x0115, 0x0115, 0x0115, 0x0115, 0x0115, 0x0115,
+ 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
+ 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134,
+ 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143,
+ 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150,
+ 0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124,
+ 0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142,
+ 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133,
+ 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104,
+ 0x0140, 0x0140, 0x0140, 0x0140, 0x0140, 0x0140, 0x0140, 0x0140,
+ 0x04ce, -448, 0x03de, 0x03de, 0x03e9, 0x03e9, 0x04ea, 0x04d9,
+ 0x02ee, 0x02ee, 0x02ee, 0x02ee, 0x03ed, 0x03ed, 0x03eb, 0x03eb,
+ 0x02be, 0x02be, 0x02be, 0x02be, 0x02cd, 0x02cd, 0x02cd, 0x02cd,
+ 0x03dc, 0x03dc, 0x03db, 0x03db, 0x02ae, 0x02ae, 0x02ae, 0x02ae,
+ 0x02cc, 0x02cc, 0x02cc, 0x02cc, 0x03ad, 0x03ad, 0x03da, 0x03da,
+ 0x037e, 0x037e, 0x03ac, 0x03ac, 0x02ca, 0x02ca, 0x02ca, 0x02ca,
+ 0x03c9, 0x03c9, 0x037d, 0x037d, 0x025e, 0x025e, 0x025e, 0x025e,
+ 0x01bd, 0x01bd, 0x01bd, 0x01bd, 0x01bd, 0x01bd, 0x01bd, 0x01bd,
+ 0x019e, 0x019e, 0x019e, 0x019e, 0x019e, 0x019e, 0x019e, 0x019e,
+ 0x02bc, 0x02bc, 0x02bc, 0x02bc, 0x02cb, 0x02cb, 0x02cb, 0x02cb,
+ 0x028e, 0x028e, 0x028e, 0x028e, 0x02e8, 0x02e8, 0x02e8, 0x02e8,
+ 0x029d, 0x029d, 0x029d, 0x029d, 0x02e7, 0x02e7, 0x02e7, 0x02e7,
+ 0x02bb, 0x02bb, 0x02bb, 0x02bb, 0x028d, 0x028d, 0x028d, 0x028d,
+ 0x02d8, 0x02d8, 0x02d8, 0x02d8, 0x026e, 0x026e, 0x026e, 0x026e,
+ 0x01e6, 0x01e6, 0x01e6, 0x01e6, 0x01e6, 0x01e6, 0x01e6, 0x01e6,
+ 0x019c, 0x019c, 0x019c, 0x019c, 0x019c, 0x019c, 0x019c, 0x019c,
+ 0x02ab, 0x02ab, 0x02ab, 0x02ab, 0x02ba, 0x02ba, 0x02ba, 0x02ba,
+ 0x02e5, 0x02e5, 0x02e5, 0x02e5, 0x02d7, 0x02d7, 0x02d7, 0x02d7,
+ 0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e,
+ 0x02e4, 0x02e4, 0x02e4, 0x02e4, 0x028c, 0x028c, 0x028c, 0x028c,
+ 0x01c8, 0x01c8, 0x01c8, 0x01c8, 0x01c8, 0x01c8, 0x01c8, 0x01c8,
+ 0x013e, 0x013e, 0x013e, 0x013e, 0x013e, 0x013e, 0x013e, 0x013e,
+ 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d,
+ 0x02d6, 0x02d6, 0x02d6, 0x02d6, 0x029b, 0x029b, 0x029b, 0x029b,
+ 0x02b9, 0x02b9, 0x02b9, 0x02b9, 0x02aa, 0x02aa, 0x02aa, 0x02aa,
+ 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1,
+ 0x01d4, 0x01d4, 0x01d4, 0x01d4, 0x01d4, 0x01d4, 0x01d4, 0x01d4,
+ 0x02b8, 0x02b8, 0x02b8, 0x02b8, 0x02a9, 0x02a9, 0x02a9, 0x02a9,
+ 0x017b, 0x017b, 0x017b, 0x017b, 0x017b, 0x017b, 0x017b, 0x017b,
+ 0x02b7, 0x02b7, 0x02b7, 0x02b7, 0x02d0, 0x02d0, 0x02d0, 0x02d0,
+ 0x010e, 0x010e, 0x010e, 0x010e, 0x010e, 0x010e, 0x010e, 0x010e,
+ 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0,
+ 0x015d, 0x015d, 0x015d, 0x015d, 0x015d, 0x015d, 0x015d, 0x015d,
+ 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5,
+ 0x017c, 0x017c, 0x017c, 0x017c, 0x017c, 0x017c, 0x017c, 0x017c,
+ 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7,
+ 0x014d, 0x014d, 0x014d, 0x014d, 0x014d, 0x014d, 0x014d, 0x014d,
+ 0x018b, 0x018b, 0x018b, 0x018b, 0x018b, 0x018b, 0x018b, 0x018b,
+ 0x019a, 0x019a, 0x019a, 0x019a, 0x019a, 0x019a, 0x019a, 0x019a,
+ 0x016c, 0x016c, 0x016c, 0x016c, 0x016c, 0x016c, 0x016c, 0x016c,
+ 0x01c6, 0x01c6, 0x01c6, 0x01c6, 0x01c6, 0x01c6, 0x01c6, 0x01c6,
+ 0x013d, 0x013d, 0x013d, 0x013d, 0x013d, 0x013d, 0x013d, 0x013d,
+ 0x015c, 0x015c, 0x015c, 0x015c, 0x015c, 0x015c, 0x015c, 0x015c,
+ 0x01c5, 0x01c5, 0x01c5, 0x01c5, 0x01c5, 0x01c5, 0x01c5, 0x01c5,
+ 0x018a, 0x018a, 0x018a, 0x018a, 0x018a, 0x018a, 0x018a, 0x018a,
+ 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x01a8,
+ 0x0199, 0x0199, 0x0199, 0x0199, 0x0199, 0x0199, 0x0199, 0x0199,
+ 0x014c, 0x014c, 0x014c, 0x014c, 0x014c, 0x014c, 0x014c, 0x014c,
+ 0x01b6, 0x01b6, 0x01b6, 0x01b6, 0x01b6, 0x01b6, 0x01b6, 0x01b6,
+ 0x017a, 0x017a, 0x017a, 0x017a, 0x017a, 0x017a, 0x017a, 0x017a,
+ 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b,
+ 0x0189, 0x0189, 0x0189, 0x0189, 0x0189, 0x0189, 0x0189, 0x0189,
+ 0x0198, 0x0198, 0x0198, 0x0198, 0x0198, 0x0198, 0x0198, 0x0198,
+ 0x0179, 0x0179, 0x0179, 0x0179, 0x0179, 0x0179, 0x0179, 0x0179,
+ 0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0197,
+ 0x0188, 0x0188, 0x0188, 0x0188, 0x0188, 0x0188, 0x0188, 0x0188,
+ 0x01ec, 0x01ec, 0x01ec, 0x01ec, 0x01ec, 0x01ec, 0x01ec, 0x01ec,
+ 0x01dd, 0x01dd, 0x01dd, 0x01dd, 0x01dd, 0x01dd, 0x01dd, 0x01dd,
+};
+
+static const short tab24_[] =
+{
+ -16, -32, -48, 0x04ff, -64, -80, -96, -112,
+ -128, -144, -160, -176, 0x0411, 0x0401, 0x0410, 0x0400,
+ 0x04ef, 0x04fe, 0x04df, 0x04fd, 0x04cf, 0x04fc, 0x04bf, 0x04fb,
+ 0x03fa, 0x03fa, 0x04af, 0x049f, 0x03f9, 0x03f9, 0x03f8, 0x03f8,
+ 0x048f, 0x047f, 0x03f7, 0x03f7, 0x036f, 0x036f, 0x03f6, 0x03f6,
+ 0x035f, 0x035f, 0x03f5, 0x03f5, 0x034f, 0x034f, 0x03f4, 0x03f4,
+ 0x033f, 0x033f, 0x03f3, 0x03f3, 0x032f, 0x032f, 0x03f2, 0x03f2,
+ 0x03f1, 0x03f1, 0x041f, 0x04f0, -144, -160, -176, -192,
+ -192, -208, -224, -240, -256, -272, -288, -304,
+ -320, -336, -352, -368, -384, -400, -416, -432,
+ -432, -448, -464, -480, -496, -512, -528, -544,
+ -560, -576, -592, -608, -624, -640, -656, -672,
+ -672, -688, -704, -720, -736, -752, -768, -784,
+ -800, -816, -832, -848, -864, 0x0473, -880, 0x0472,
+ 0x0446, 0x0464, 0x0455, 0x0471, 0x0436, 0x0463, 0x0445, 0x0454,
+ 0x0426, 0x0462, 0x0416, 0x0461, -880, 0x0435, 0x0453, 0x0444,
+ 0x0425, 0x0452, 0x0415, -880, 0x0351, 0x0351, 0x0434, 0x0443,
+ 0x0324, 0x0324, 0x0342, 0x0342, 0x0333, 0x0333, 0x0314, 0x0314,
+ 0x0341, 0x0341, 0x0404, 0x0440, 0x0323, 0x0323, 0x0332, 0x0332,
+ 0x0213, 0x0213, 0x0213, 0x0213, 0x0231, 0x0231, 0x0231, 0x0231,
+ 0x0303, 0x0303, 0x0330, 0x0330, 0x0222, 0x0222, 0x0222, 0x0222,
+ 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112,
+ 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121,
+ 0x0202, 0x0202, 0x0202, 0x0202, 0x0220, 0x0220, 0x0220, 0x0220,
+ 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f,
+ 0x03ee, 0x03ee, 0x03de, 0x03de, 0x03ed, 0x03ed, 0x03ce, 0x03ce,
+ 0x03ec, 0x03ec, 0x03dd, 0x03dd, 0x03be, 0x03be, 0x03eb, 0x03eb,
+ 0x03cd, 0x03cd, 0x03dc, 0x03dc, 0x03ae, 0x03ae, 0x03ea, 0x03ea,
+ 0x03bd, 0x03bd, 0x03db, 0x03db, 0x03cc, 0x03cc, 0x039e, 0x039e,
+ 0x03e9, 0x03e9, 0x03ad, 0x03ad, 0x03da, 0x03da, 0x03bc, 0x03bc,
+ 0x03cb, 0x03cb, 0x038e, 0x038e, 0x03e8, 0x03e8, 0x039d, 0x039d,
+ 0x03d9, 0x03d9, 0x037e, 0x037e, 0x03e7, 0x03e7, 0x03ac, 0x03ac,
+ 0x03ca, 0x03ca, 0x03bb, 0x03bb, 0x038d, 0x038d, 0x03d8, 0x03d8,
+ 0x040e, 0x04e0, 0x030d, 0x030d, 0x02e6, 0x02e6, 0x02e6, 0x02e6,
+ 0x036e, 0x036e, 0x039c, 0x039c, 0x02c9, 0x02c9, 0x02c9, 0x02c9,
+ 0x025e, 0x025e, 0x025e, 0x025e, 0x02ba, 0x02ba, 0x02ba, 0x02ba,
+ 0x02e5, 0x02e5, 0x02e5, 0x02e5, 0x03ab, 0x03ab, 0x037d, 0x037d,
+ 0x02d7, 0x02d7, 0x02d7, 0x02d7, 0x02e4, 0x02e4, 0x02e4, 0x02e4,
+ 0x028c, 0x028c, 0x028c, 0x028c, 0x02c8, 0x02c8, 0x02c8, 0x02c8,
+ 0x034e, 0x034e, 0x032e, 0x032e, 0x023e, 0x023e, 0x023e, 0x023e,
+ 0x026d, 0x026d, 0x026d, 0x026d, 0x02d6, 0x02d6, 0x02d6, 0x02d6,
+ 0x02e3, 0x02e3, 0x02e3, 0x02e3, 0x029b, 0x029b, 0x029b, 0x029b,
+ 0x02b9, 0x02b9, 0x02b9, 0x02b9, 0x02aa, 0x02aa, 0x02aa, 0x02aa,
+ 0x02e2, 0x02e2, 0x02e2, 0x02e2, 0x021e, 0x021e, 0x021e, 0x021e,
+ 0x02e1, 0x02e1, 0x02e1, 0x02e1, 0x025d, 0x025d, 0x025d, 0x025d,
+ 0x02d5, 0x02d5, 0x02d5, 0x02d5, 0x027c, 0x027c, 0x027c, 0x027c,
+ 0x02c7, 0x02c7, 0x02c7, 0x02c7, 0x024d, 0x024d, 0x024d, 0x024d,
+ 0x028b, 0x028b, 0x028b, 0x028b, 0x02b8, 0x02b8, 0x02b8, 0x02b8,
+ 0x02d4, 0x02d4, 0x02d4, 0x02d4, 0x029a, 0x029a, 0x029a, 0x029a,
+ 0x02a9, 0x02a9, 0x02a9, 0x02a9, 0x026c, 0x026c, 0x026c, 0x026c,
+ 0x02c6, 0x02c6, 0x02c6, 0x02c6, 0x023d, 0x023d, 0x023d, 0x023d,
+ 0x02d3, 0x02d3, 0x02d3, 0x02d3, 0x022d, 0x022d, 0x022d, 0x022d,
+ 0x02d2, 0x02d2, 0x02d2, 0x02d2, 0x021d, 0x021d, 0x021d, 0x021d,
+ 0x027b, 0x027b, 0x027b, 0x027b, 0x02b7, 0x02b7, 0x02b7, 0x02b7,
+ 0x02d1, 0x02d1, 0x02d1, 0x02d1, 0x025c, 0x025c, 0x025c, 0x025c,
+ 0x02c5, 0x02c5, 0x02c5, 0x02c5, 0x028a, 0x028a, 0x028a, 0x028a,
+ 0x02a8, 0x02a8, 0x02a8, 0x02a8, 0x0299, 0x0299, 0x0299, 0x0299,
+ 0x024c, 0x024c, 0x024c, 0x024c, 0x02c4, 0x02c4, 0x02c4, 0x02c4,
+ 0x026b, 0x026b, 0x026b, 0x026b, 0x02b6, 0x02b6, 0x02b6, 0x02b6,
+ 0x03d0, 0x03d0, 0x030c, 0x030c, 0x023c, 0x023c, 0x023c, 0x023c,
+ 0x02c3, 0x02c3, 0x02c3, 0x02c3, 0x027a, 0x027a, 0x027a, 0x027a,
+ 0x02a7, 0x02a7, 0x02a7, 0x02a7, 0x022c, 0x022c, 0x022c, 0x022c,
+ 0x02c2, 0x02c2, 0x02c2, 0x02c2, 0x025b, 0x025b, 0x025b, 0x025b,
+ 0x02b5, 0x02b5, 0x02b5, 0x02b5, 0x021c, 0x021c, 0x021c, 0x021c,
+ 0x0289, 0x0289, 0x0289, 0x0289, 0x0298, 0x0298, 0x0298, 0x0298,
+ 0x02c1, 0x02c1, 0x02c1, 0x02c1, 0x024b, 0x024b, 0x024b, 0x024b,
+ 0x03c0, 0x03c0, 0x030b, 0x030b, 0x023b, 0x023b, 0x023b, 0x023b,
+ 0x03b0, 0x03b0, 0x030a, 0x030a, 0x021a, 0x021a, 0x021a, 0x021a,
+ 0x01b4, 0x01b4, 0x01b4, 0x01b4, 0x01b4, 0x01b4, 0x01b4, 0x01b4,
+ 0x026a, 0x026a, 0x026a, 0x026a, 0x02a6, 0x02a6, 0x02a6, 0x02a6,
+ 0x0279, 0x0279, 0x0279, 0x0279, 0x0297, 0x0297, 0x0297, 0x0297,
+ 0x03a0, 0x03a0, 0x0309, 0x0309, 0x0290, 0x0290, 0x0290, 0x0290,
+ 0x01b3, 0x01b3, 0x01b3, 0x01b3, 0x01b3, 0x01b3, 0x01b3, 0x01b3,
+ 0x0188, 0x0188, 0x0188, 0x0188, 0x0188, 0x0188, 0x0188, 0x0188,
+ 0x022b, 0x022b, 0x022b, 0x022b, 0x025a, 0x025a, 0x025a, 0x025a,
+ 0x01b2, 0x01b2, 0x01b2, 0x01b2, 0x01b2, 0x01b2, 0x01b2, 0x01b2,
+ 0x02a5, 0x02a5, 0x02a5, 0x02a5, 0x021b, 0x021b, 0x021b, 0x021b,
+ 0x02b1, 0x02b1, 0x02b1, 0x02b1, 0x0269, 0x0269, 0x0269, 0x0269,
+ 0x0196, 0x0196, 0x0196, 0x0196, 0x0196, 0x0196, 0x0196, 0x0196,
+ 0x01a4, 0x01a4, 0x01a4, 0x01a4, 0x01a4, 0x01a4, 0x01a4, 0x01a4,
+ 0x024a, 0x024a, 0x024a, 0x024a, 0x0278, 0x0278, 0x0278, 0x0278,
+ 0x0187, 0x0187, 0x0187, 0x0187, 0x0187, 0x0187, 0x0187, 0x0187,
+ 0x013a, 0x013a, 0x013a, 0x013a, 0x013a, 0x013a, 0x013a, 0x013a,
+ 0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01a3,
+ 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159,
+ 0x0195, 0x0195, 0x0195, 0x0195, 0x0195, 0x0195, 0x0195, 0x0195,
+ 0x012a, 0x012a, 0x012a, 0x012a, 0x012a, 0x012a, 0x012a, 0x012a,
+ 0x01a2, 0x01a2, 0x01a2, 0x01a2, 0x01a2, 0x01a2, 0x01a2, 0x01a2,
+ 0x01a1, 0x01a1, 0x01a1, 0x01a1, 0x01a1, 0x01a1, 0x01a1, 0x01a1,
+ 0x0168, 0x0168, 0x0168, 0x0168, 0x0168, 0x0168, 0x0168, 0x0168,
+ 0x0186, 0x0186, 0x0186, 0x0186, 0x0186, 0x0186, 0x0186, 0x0186,
+ 0x0177, 0x0177, 0x0177, 0x0177, 0x0177, 0x0177, 0x0177, 0x0177,
+ 0x0149, 0x0149, 0x0149, 0x0149, 0x0149, 0x0149, 0x0149, 0x0149,
+ 0x0194, 0x0194, 0x0194, 0x0194, 0x0194, 0x0194, 0x0194, 0x0194,
+ 0x0139, 0x0139, 0x0139, 0x0139, 0x0139, 0x0139, 0x0139, 0x0139,
+ 0x0193, 0x0193, 0x0193, 0x0193, 0x0193, 0x0193, 0x0193, 0x0193,
+ 0x0158, 0x0158, 0x0158, 0x0158, 0x0158, 0x0158, 0x0158, 0x0158,
+ 0x0185, 0x0185, 0x0185, 0x0185, 0x0185, 0x0185, 0x0185, 0x0185,
+ 0x0129, 0x0129, 0x0129, 0x0129, 0x0129, 0x0129, 0x0129, 0x0129,
+ 0x0167, 0x0167, 0x0167, 0x0167, 0x0167, 0x0167, 0x0167, 0x0167,
+ 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176,
+ 0x0192, 0x0192, 0x0192, 0x0192, 0x0192, 0x0192, 0x0192, 0x0192,
+ 0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119,
+ 0x0191, 0x0191, 0x0191, 0x0191, 0x0191, 0x0191, 0x0191, 0x0191,
+ 0x0148, 0x0148, 0x0148, 0x0148, 0x0148, 0x0148, 0x0148, 0x0148,
+ 0x0184, 0x0184, 0x0184, 0x0184, 0x0184, 0x0184, 0x0184, 0x0184,
+ 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157,
+ 0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175,
+ 0x0138, 0x0138, 0x0138, 0x0138, 0x0138, 0x0138, 0x0138, 0x0138,
+ 0x0183, 0x0183, 0x0183, 0x0183, 0x0183, 0x0183, 0x0183, 0x0183,
+ 0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166,
+ 0x0128, 0x0128, 0x0128, 0x0128, 0x0128, 0x0128, 0x0128, 0x0128,
+ 0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182,
+ 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118,
+ 0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147,
+ 0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174,
+ 0x0181, 0x0181, 0x0181, 0x0181, 0x0181, 0x0181, 0x0181, 0x0181,
+ 0x0208, 0x0208, 0x0208, 0x0208, 0x0280, 0x0280, 0x0280, 0x0280,
+ 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156,
+ 0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165,
+ 0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117,
+ 0x0207, 0x0207, 0x0207, 0x0207, 0x0270, 0x0270, 0x0270, 0x0270,
+ 0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137,
+ 0x0127, 0x0127, 0x0127, 0x0127, 0x0127, 0x0127, 0x0127, 0x0127,
+ 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106,
+ 0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160,
+ 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
+ 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150,
+};
+
+static const short tab_c0[] =
+{
+ -29, -21, -13, -7, -3, -1, 11, 15, -1, 13, 14, -3, -1, 7, 5,
+ 9, -3, -1, 6, 3, -1, 10, 12, -3, -1, 2, 1, -1, 4, 8,
+ 0
+};
+
+static const short tab_c1[] =
+{
+ -15, -7, -3, -1, 15, 14, -1, 13, 12, -3, -1, 11, 10, -1, 9,
+ 8, -7, -3, -1, 7, 6, -1, 5, 4, -3, -1, 3, 2, -1, 1,
+ 0
+};
+
+static const struct newhuff ht[] =
+{
+ { /* 0 */ 0 , tab0_ } ,
+ { /* 2 */ 0 , tab1_ } ,
+ { /* 3 */ 0 , tab2_ } ,
+ { /* 3 */ 0 , tab3_ } ,
+ { /* 0 */ 0 , tab0_ } ,
+ { /* 4 */ 0 , tab5_ } ,
+ { /* 4 */ 0 , tab6_ } ,
+ { /* 6 */ 0 , tab7_ } ,
+ { /* 6 */ 0 , tab8_ } ,
+ { /* 6 */ 0 , tab9_ } ,
+ { /* 8 */ 0 , tab10_ } ,
+ { /* 8 */ 0 , tab11_ } ,
+ { /* 8 */ 0 , tab12_ } ,
+ { /* 16 */ 0 , tab13_ } ,
+ { /* 0 */ 0 , tab0_ } ,
+ { /* 16 */ 0 , tab15_ } ,
+
+ { /* 16 */ 1 , tab16_ } ,
+ { /* 16 */ 2 , tab16_ } ,
+ { /* 16 */ 3 , tab16_ } ,
+ { /* 16 */ 4 , tab16_ } ,
+ { /* 16 */ 6 , tab16_ } ,
+ { /* 16 */ 8 , tab16_ } ,
+ { /* 16 */ 10, tab16_ } ,
+ { /* 16 */ 13, tab16_ } ,
+ { /* 16 */ 4 , tab24_ } ,
+ { /* 16 */ 5 , tab24_ } ,
+ { /* 16 */ 6 , tab24_ } ,
+ { /* 16 */ 7 , tab24_ } ,
+ { /* 16 */ 8 , tab24_ } ,
+ { /* 16 */ 9 , tab24_ } ,
+ { /* 16 */ 11, tab24_ } ,
+ { /* 16 */ 13, tab24_ }
+};
+
+static const struct newhuff htc[] =
+{
+ { /* 1 , 1 , */ 0 , tab_c0 } ,
+ { /* 1 , 1 , */ 0 , tab_c1 }
+};
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/ntom.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/ntom.c
new file mode 100644
index 00000000..196a5690
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/ntom.c
@@ -0,0 +1,148 @@
+/*
+ ntom.c: N->M down/up sampling; the setup code.
+
+ copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp
+*/
+
+#define SAFE_NTOM /* Do not depend on off_t*off_t with big values still being in the range... */
+#include "mpg123lib_intern.h"
+#include "debug.h"
+
+int synth_ntom_set_step(mpg123_handle *fr)
+{
+ long m,n;
+ m = frame_freq(fr);
+ n = fr->af.rate;
+ if(VERBOSE2)
+ fprintf(stderr,"Init rate converter: %ld->%ld\n",m,n);
+
+ if(n > NTOM_MAX_FREQ || m > NTOM_MAX_FREQ || m <= 0 || n <= 0) {
+ if(NOQUIET) error("NtoM converter: illegal rates");
+ fr->err = MPG123_BAD_RATE;
+ return -1;
+ }
+
+ n *= NTOM_MUL;
+ fr->ntom_step = (unsigned long) n / m;
+
+ if(fr->ntom_step > (unsigned long)NTOM_MAX*NTOM_MUL) {
+ if(NOQUIET) error3("max. 1:%i conversion allowed (%lu vs %lu)!", NTOM_MAX, fr->ntom_step, (unsigned long)8*NTOM_MUL);
+ fr->err = MPG123_BAD_RATE;
+ return -1;
+ }
+
+ fr->ntom_val[0] = fr->ntom_val[1] = ntom_val(fr, fr->num);
+ return 0;
+}
+
+/*
+ The SAFE_NTOM does iterative loops instead of straight multiplication.
+ The safety is not just about the algorithm closely mimicking the decoder instead of applying some formula,
+ it is more about avoiding multiplication of possibly big sample offsets (a 32bit off_t could overflow too easily).
+*/
+
+unsigned long ntom_val(mpg123_handle *fr, off_t frame)
+{
+ off_t ntm;
+#ifdef SAFE_NTOM /* Carry out the loop, without the threatening integer overflow. */
+ off_t f;
+ ntm = NTOM_MUL>>1; /* for frame 0 */
+ for(f=0; f<frame; ++f) /* for frame > 0 */
+ {
+ ntm += fr->spf*fr->ntom_step;
+ ntm -= (ntm/NTOM_MUL)*NTOM_MUL;
+ }
+#else /* Just make one computation with overall sample offset. */
+ ntm = (NTOM_MUL>>1) + fr->spf*frame*fr->ntom_step;
+ ntm -= (ntm/NTOM_MUL)*NTOM_MUL;
+#endif
+ return (unsigned long) ntm;
+}
+
+/* Set the ntom value for next expected frame to be decoded.
+ This is for keeping output consistent across seeks. */
+void ntom_set_ntom(mpg123_handle *fr, off_t num)
+{
+ fr->ntom_val[1] = fr->ntom_val[0] = ntom_val(fr, num);
+}
+
+/* Carry out the ntom sample count operation for this one frame.
+ No fear of integer overflow here. */
+off_t ntom_frame_outsamples(mpg123_handle *fr)
+{
+ /* The do this before decoding the separate channels, so there is only one common ntom value. */
+ int ntm = fr->ntom_val[0];
+ ntm += fr->spf*fr->ntom_step;
+ return ntm/NTOM_MUL;
+}
+
+/* Convert frame offset to unadjusted output sample offset. */
+off_t ntom_frmouts(mpg123_handle *fr, off_t frame)
+{
+#ifdef SAFE_NTOM
+ off_t f;
+#endif
+ off_t soff = 0;
+ off_t ntm = ntom_val(fr,0);
+#ifdef SAFE_NTOM
+ if(frame <= 0) return 0;
+ for(f=0; f<frame; ++f)
+ {
+ ntm += fr->spf*fr->ntom_step;
+ soff += ntm/NTOM_MUL;
+ ntm -= (ntm/NTOM_MUL)*NTOM_MUL;
+ }
+#else
+ soff = (ntm + frame*(off_t)fr->spf*(off_t)fr->ntom_step)/(off_t)NTOM_MUL;
+#endif
+ return soff;
+}
+
+/* Convert input samples to unadjusted output samples. */
+off_t ntom_ins2outs(mpg123_handle *fr, off_t ins)
+{
+ off_t soff = 0;
+ off_t ntm = ntom_val(fr,0);
+#ifdef SAFE_NTOM
+ {
+ off_t block = fr->spf;
+ if(ins <= 0) return 0;
+ do
+ {
+ off_t nowblock = ins > block ? block : ins;
+ ntm += nowblock*fr->ntom_step;
+ soff += ntm/NTOM_MUL;
+ ntm -= (ntm/NTOM_MUL)*NTOM_MUL;
+ ins -= nowblock;
+ } while(ins > 0);
+ }
+#else
+ /* Beware of overflows: when off_t is 32bits, the multiplication blows too easily.
+ Of course, it blows for 64bits, too, in theory, but that's for _really_ large files. */
+ soff = ((off_t)ntm + (off_t)ins*(off_t)fr->ntom_step)/(off_t)NTOM_MUL;
+#endif
+ return soff;
+}
+
+/* Determine frame offset from unadjusted output sample offset. */
+off_t ntom_frameoff(mpg123_handle *fr, off_t soff)
+{
+ off_t ioff = 0; /* frames or samples */
+ off_t ntm = ntom_val(fr,0);
+#ifdef SAFE_NTOM
+ if(soff <= 0) return 0;
+ for(ioff=0; 1; ++ioff)
+ {
+ ntm += fr->spf*fr->ntom_step;
+ if(ntm/NTOM_MUL > soff) break;
+ soff -= ntm/NTOM_MUL;
+ ntm -= (ntm/NTOM_MUL)*NTOM_MUL;
+ }
+ return ioff;
+#else
+ ioff = (soff*(off_t)NTOM_MUL-ntm)/(off_t)fr->ntom_step;
+ return ioff/(off_t)fr->spf;
+#endif
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/optimize.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/optimize.c
new file mode 100644
index 00000000..7ada9349
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/optimize.c
@@ -0,0 +1,1164 @@
+/*
+ optimize: get a grip on the different optimizations
+
+ copyright 2006-21 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis, inspired by 3DNow stuff in mpg123.[hc]
+
+ Currently, this file contains the struct and function to choose an optimization variant and works only when OPT_MULTI is in effect.
+*/
+
+#define I_AM_OPTIMIZE
+#define WANT_GETCPUFLAGS
+#include "mpg123lib_intern.h" /* includes optimize.h */
+#include "getcpuflags.h"
+#include "debug.h"
+
+
+/* Ugly macros to build conditional synth function array values. */
+
+#ifndef NO_8BIT
+#define IF8(synth) synth,
+#else
+#define IF8(synth)
+#endif
+
+#ifndef NO_SYNTH32
+
+#ifndef NO_REAL
+#define IFREAL(synth) synth,
+#else
+#define IFREAL(synth)
+#endif
+
+#ifndef NO_32BIT
+#define IF32(synth) synth
+#else
+#define IF32(synth)
+#endif
+
+#else
+
+#define IFREAL(synth)
+#define IF32(synth)
+
+#endif
+
+#ifndef NO_16BIT
+# define OUT_SYNTHS(synth_16, synth_8, synth_real, synth_32) { synth_16, IF8(synth_8) IFREAL(synth_real) IF32(synth_32) }
+#else
+# define OUT_SYNTHS(synth_16, synth_8, synth_real, synth_32) { IF8(synth_8) IFREAL(synth_real) IF32(synth_32) }
+#endif
+
+/* The call of left and right plain synth, wrapped.
+ This may be replaced by a direct stereo optimized synth. */
+static int synth_stereo_wrap(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ int clip;
+ clip = (fr->synth)(bandPtr_l, 0, fr, 0);
+ clip += (fr->synth)(bandPtr_r, 1, fr, 1);
+ return clip;
+}
+
+static const struct synth_s synth_base =
+{
+ { /* plain */
+ OUT_SYNTHS(synth_1to1, synth_1to1_8bit, synth_1to1_real, synth_1to1_s32)
+# ifndef NO_DOWNSAMPLE
+ ,OUT_SYNTHS(synth_2to1, synth_2to1_8bit, synth_2to1_real, synth_2to1_s32)
+ ,OUT_SYNTHS(synth_4to1, synth_4to1_8bit, synth_4to1_real, synth_4to1_s32)
+# endif
+# ifndef NO_NTOM
+ ,OUT_SYNTHS(synth_ntom, synth_ntom_8bit, synth_ntom_real, synth_ntom_s32)
+# endif
+ },
+ { /* stereo, by default only wrappers over plain synth */
+ OUT_SYNTHS(synth_stereo_wrap, synth_stereo_wrap, synth_stereo_wrap, synth_stereo_wrap)
+# ifndef NO_DOWNSAMPLE
+ ,OUT_SYNTHS(synth_stereo_wrap, synth_stereo_wrap, synth_stereo_wrap, synth_stereo_wrap)
+ ,OUT_SYNTHS(synth_stereo_wrap, synth_stereo_wrap, synth_stereo_wrap, synth_stereo_wrap)
+# endif
+# ifndef NO_NTOM
+ ,OUT_SYNTHS(synth_stereo_wrap, synth_stereo_wrap, synth_stereo_wrap, synth_stereo_wrap)
+# endif
+ },
+ { /* mono2stereo */
+ OUT_SYNTHS(synth_1to1_m2s, synth_1to1_8bit_m2s, synth_1to1_real_m2s, synth_1to1_s32_m2s)
+# ifndef NO_DOWNSAMPLE
+ ,OUT_SYNTHS(synth_2to1_m2s, synth_2to1_8bit_m2s, synth_2to1_real_m2s, synth_2to1_s32_m2s)
+ ,OUT_SYNTHS(synth_4to1_m2s, synth_4to1_8bit_m2s, synth_4to1_real_m2s, synth_4to1_s32_m2s)
+# endif
+# ifndef NO_NTOM
+ ,OUT_SYNTHS(synth_ntom_m2s, synth_ntom_8bit_m2s, synth_ntom_real_m2s, synth_ntom_s32_m2s)
+# endif
+ },
+ { /* mono*/
+ OUT_SYNTHS(synth_1to1_mono, synth_1to1_8bit_mono, synth_1to1_real_mono, synth_1to1_s32_mono)
+# ifndef NO_DOWNSAMPLE
+ ,OUT_SYNTHS(synth_2to1_mono, synth_2to1_8bit_mono, synth_2to1_real_mono, synth_2to1_s32_mono)
+ ,OUT_SYNTHS(synth_4to1_mono, synth_4to1_8bit_mono, synth_4to1_real_mono, synth_4to1_s32_mono)
+# endif
+# ifndef NO_NTOM
+ ,OUT_SYNTHS(synth_ntom_mono, synth_ntom_8bit_mono, synth_ntom_real_mono, synth_ntom_s32_mono)
+#endif
+ }
+};
+
+#ifdef OPT_X86
+/* More plain synths for i386 */
+const func_synth plain_i386[r_limit][f_limit] =
+{ /* plain */
+ OUT_SYNTHS(synth_1to1_i386, synth_1to1_8bit_i386, synth_1to1_real_i386, synth_1to1_s32_i386)
+# ifndef NO_DOWNSAMPLE
+ ,OUT_SYNTHS(synth_2to1_i386, synth_2to1_8bit_i386, synth_2to1_real_i386, synth_2to1_s32_i386)
+ ,OUT_SYNTHS(synth_4to1_i386, synth_4to1_8bit_i386, synth_4to1_real_i386, synth_4to1_s32_i386)
+# endif
+# ifndef NO_NTOM
+ ,OUT_SYNTHS(synth_ntom, synth_ntom_8bit, synth_ntom_real, synth_ntom_s32)
+# endif
+};
+#endif
+
+
+enum optdec defdec(void){ return defopt; }
+
+enum optcla decclass(const enum optdec type)
+{
+ return
+ (
+ type == mmx
+ || type == sse
+ || type == sse_vintage
+ || type == dreidnowext
+ || type == dreidnowext_vintage
+ || type == x86_64
+ || type == neon
+ || type == neon64
+ || type == avx
+ ) ? mmxsse : normal;
+}
+
+static int find_synth(func_synth synth, const func_synth synths[r_limit][f_limit])
+{
+ enum synth_resample ri;
+ enum synth_format fi;
+ for(ri=0; ri<r_limit; ++ri)
+ for(fi=0; fi<f_limit; ++fi)
+ if(synth == synths[ri][fi])
+ return TRUE;
+
+ return FALSE;
+}
+
+
+#if defined(OPT_SSE) || defined(OPT_SSE_VINTAGE)
+/* After knowing that it is either vintage or current SSE,
+ this separates the two. In case of non-OPT_MULTI, only one
+ of OPT_SSE and OPT_SSE_VINTAGE is active. */
+static enum optdec sse_or_vintage(mpg123_handle *fr)
+{
+ enum optdec type;
+ type = sse_vintage;
+# ifdef OPT_SSE
+# ifdef OPT_MULTI
+ if(fr->cpu_opts.the_dct36 == dct36_sse)
+# endif
+ type = sse;
+# endif
+ return type;
+}
+#endif
+
+/* Determine what kind of decoder is actually active
+ This depends on runtime choices which may cause fallback to i386 or generic code. */
+static int find_dectype(mpg123_handle *fr)
+{
+ enum optdec type = nodec;
+ /* Direct and indirect usage, 1to1 stereo decoding.
+ Concentrating on the plain stereo synth should be fine, mono stuff is derived. */
+ func_synth basic_synth = fr->synth;
+#ifndef NO_8BIT
+#ifndef NO_16BIT
+ if(basic_synth == synth_1to1_8bit_wrap)
+ basic_synth = fr->synths.plain[r_1to1][f_16]; /* That is what's really below the surface. */
+#endif
+#endif
+
+ if(FALSE) ; /* Just to initialize the else if ladder. */
+#ifndef NO_16BIT
+#if defined(OPT_3DNOWEXT) || defined(OPT_3DNOWEXT_VINTAGE)
+ else if(basic_synth == synth_1to1_3dnowext)
+ {
+ type = dreidnowext;
+# ifdef OPT_3DNOWEXT_VINTAGE
+# ifdef OPT_MULTI
+ if(fr->cpu_opts.the_dct36 == dct36_3dnowext)
+# endif
+ type = dreidnowext_vintage;
+# endif
+ }
+#endif
+#if defined(OPT_SSE) || defined(OPT_SSE_VINTAGE)
+ else if(basic_synth == synth_1to1_sse)
+ {
+ type = sse_or_vintage(fr);
+ }
+#endif
+#if defined(OPT_3DNOW) || defined(OPT_3DNOW_VINTAGE)
+ else if(basic_synth == synth_1to1_3dnow)
+ {
+ type = dreidnow;
+# ifdef OPT_3DNOW_VINTAGE
+# ifdef OPT_MULTI
+ if(fr->cpu_opts.the_dct36 == dct36_3dnow)
+# endif
+ type = dreidnow_vintage;
+# endif
+ }
+#endif
+#ifdef OPT_MMX
+ else if(basic_synth == synth_1to1_mmx) type = mmx;
+#endif
+#ifdef OPT_I586_DITHER
+ else if(basic_synth == synth_1to1_i586_dither) type = ifuenf_dither;
+#endif
+#ifdef OPT_I586
+ else if(basic_synth == synth_1to1_i586) type = ifuenf;
+#endif
+#ifdef OPT_ALTIVEC
+ else if(basic_synth == synth_1to1_altivec) type = altivec;
+#endif
+#ifdef OPT_X86_64
+ else if(basic_synth == synth_1to1_x86_64) type = x86_64;
+#endif
+#ifdef OPT_AVX
+ else if(basic_synth == synth_1to1_avx) type = avx;
+#endif
+#ifdef OPT_ARM
+ else if(basic_synth == synth_1to1_arm) type = arm;
+#endif
+#ifdef OPT_NEON
+ else if(basic_synth == synth_1to1_neon) type = neon;
+#endif
+#ifdef OPT_NEON64
+ else if(basic_synth == synth_1to1_neon64) type = neon64;
+#endif
+#ifdef OPT_GENERIC_DITHER
+ else if(basic_synth == synth_1to1_dither) type = generic_dither;
+#endif
+#ifdef OPT_DITHER /* either i586 or generic! */
+#ifndef NO_DOWNSAMPLE
+ else if
+ (
+ basic_synth == synth_2to1_dither
+ || basic_synth == synth_4to1_dither
+ ) type = generic_dither;
+#endif
+#endif
+#endif /* 16bit */
+
+#ifndef NO_SYNTH32
+
+#ifndef NO_REAL
+#if defined(OPT_SSE) || defined(OPT_SSE_VINTAGE)
+ else if(basic_synth == synth_1to1_real_sse)
+ {
+ type = sse_or_vintage(fr);
+ }
+#endif
+#ifdef OPT_X86_64
+ else if(basic_synth == synth_1to1_real_x86_64) type = x86_64;
+#endif
+#ifdef OPT_AVX
+ else if(basic_synth == synth_1to1_real_avx) type = avx;
+#endif
+#ifdef OPT_ALTIVEC
+ else if(basic_synth == synth_1to1_real_altivec) type = altivec;
+#endif
+#ifdef OPT_NEON
+ else if(basic_synth == synth_1to1_real_neon) type = neon;
+#endif
+#ifdef OPT_NEON64
+ else if(basic_synth == synth_1to1_real_neon64) type = neon64;
+#endif
+
+#endif /* real */
+
+#ifndef NO_32BIT
+#if defined(OPT_SSE) || defined(OPT_SSE_VINTAGE)
+ else if(basic_synth == synth_1to1_s32_sse)
+ {
+ type = sse_or_vintage(fr);
+ }
+#endif
+#ifdef OPT_X86_64
+ else if(basic_synth == synth_1to1_s32_x86_64) type = x86_64;
+#endif
+#ifdef OPT_AVX
+ else if(basic_synth == synth_1to1_s32_avx) type = avx;
+#endif
+#ifdef OPT_ALTIVEC
+ else if(basic_synth == synth_1to1_s32_altivec) type = altivec;
+#endif
+#ifdef OPT_NEON
+ else if(basic_synth == synth_1to1_s32_neon) type = neon;
+#endif
+#ifdef OPT_NEON64
+ else if(basic_synth == synth_1to1_s32_neon64) type = neon64;
+#endif
+#endif /* 32bit */
+
+#endif /* any 32 bit synth */
+
+#ifdef OPT_X86
+ else if(find_synth(basic_synth, plain_i386))
+ type = idrei;
+#endif
+
+ else if(find_synth(basic_synth, synth_base.plain))
+ type = generic;
+
+
+
+#ifdef OPT_I486
+ /* i486 is special ... the specific code is in use for 16bit 1to1 stereo
+ otherwise we have i386 active... but still, the distinction doesn't matter*/
+ type = ivier;
+#endif
+
+ if(type != nodec)
+ {
+ fr->cpu_opts.type = type;
+ fr->cpu_opts.class = decclass(type);
+
+ debug3("determined active decoder type %i (%s) of class %i", type, decname[type], fr->cpu_opts.class);
+ return MPG123_OK;
+ }
+ else
+ {
+ if(NOQUIET) error("Unable to determine active decoder type -- this is SERIOUS b0rkage!");
+
+ fr->err = MPG123_BAD_DECODER_SETUP;
+ return MPG123_ERR;
+ }
+}
+
+/* set synth functions for current frame, optimizations handled by opt_* macros */
+int set_synth_functions(mpg123_handle *fr)
+{
+ enum synth_resample resample = r_none;
+ enum synth_format basic_format = f_none; /* Default is always 16bit, or whatever. */
+
+ /* Select the basic output format, different from 16bit: 8bit, real. */
+ if(FALSE){}
+#ifndef NO_16BIT
+ else if(fr->af.dec_enc & MPG123_ENC_16)
+ basic_format = f_16;
+#endif
+#ifndef NO_8BIT
+ else if(fr->af.dec_enc & MPG123_ENC_8)
+ basic_format = f_8;
+#endif
+#ifndef NO_REAL
+ else if(fr->af.dec_enc & MPG123_ENC_FLOAT)
+ basic_format = f_real;
+#endif
+#ifndef NO_32BIT
+ /* 24 bit integer means decoding to 32 bit first. */
+ else if(fr->af.dec_enc & MPG123_ENC_32 || fr->af.dec_enc & MPG123_ENC_24)
+ basic_format = f_32;
+#endif
+
+ /* Make sure the chosen format is compiled into this lib. */
+ if(basic_format == f_none)
+ {
+ if(NOQUIET) error("set_synth_functions: This output format is disabled in this build!");
+
+ return -1;
+ }
+
+ /* Be explicit about downsampling variant. */
+ switch(fr->down_sample)
+ {
+ case 0: resample = r_1to1; break;
+#ifndef NO_DOWNSAMPLE
+ case 1: resample = r_2to1; break;
+ case 2: resample = r_4to1; break;
+#endif
+#ifndef NO_NTOM
+ case 3: resample = r_ntom; break;
+#endif
+ }
+
+ if(resample == r_none)
+ {
+ if(NOQUIET) error("set_synth_functions: This resampling mode is not supported in this build!");
+
+ return -1;
+ }
+
+ debug2("selecting synth: resample=%i format=%i", resample, basic_format);
+ /* Finally selecting the synth functions for stereo / mono. */
+ fr->synth = fr->synths.plain[resample][basic_format];
+ fr->synth_stereo = fr->synths.stereo[resample][basic_format];
+ fr->synth_mono = fr->af.channels==2
+ ? fr->synths.mono2stereo[resample][basic_format] /* Mono MPEG file decoded to stereo. */
+ : fr->synths.mono[resample][basic_format]; /* Mono MPEG file decoded to mono. */
+
+ if(find_dectype(fr) != MPG123_OK) /* Actually determine the currently active decoder breed. */
+ {
+ fr->err = MPG123_BAD_DECODER_SETUP;
+ return MPG123_ERR;
+ }
+
+ if(frame_buffers(fr) != 0)
+ {
+ fr->err = MPG123_NO_BUFFERS;
+ if(NOQUIET) error("Failed to set up decoder buffers!");
+
+ return MPG123_ERR;
+ }
+
+#ifndef NO_8BIT
+ if(basic_format == f_8)
+ {
+ if(make_conv16to8_table(fr) != 0)
+ {
+ if(NOQUIET) error("Failed to set up conv16to8 table!");
+ /* it's a bit more work to get proper error propagation up */
+ return -1;
+ }
+ }
+#endif
+
+#ifdef OPT_MMXORSSE
+ /* Special treatment for MMX, SSE and 3DNowExt stuff.
+ The real-decoding SSE for x86-64 uses normal tables! */
+ if(fr->cpu_opts.class == mmxsse
+# ifndef NO_REAL
+ && basic_format != f_real
+# endif
+# ifndef NO_32BIT
+ && basic_format != f_32
+# endif
+# ifdef ACCURATE_ROUNDING
+ && fr->cpu_opts.type != sse
+ && fr->cpu_opts.type != sse_vintage
+ && fr->cpu_opts.type != x86_64
+ && fr->cpu_opts.type != neon
+ && fr->cpu_opts.type != neon64
+ && fr->cpu_opts.type != avx
+# endif
+ )
+ {
+#ifndef NO_LAYER3
+ init_layer3_stuff(fr, init_layer3_gainpow2_mmx);
+#endif
+#ifndef NO_LAYER12
+ init_layer12_stuff(fr, init_layer12_table_mmx);
+#endif
+ fr->make_decode_tables = make_decode_tables_mmx;
+ }
+ else
+#endif
+ {
+#ifndef NO_LAYER3
+ init_layer3_stuff(fr, init_layer3_gainpow2);
+#endif
+#ifndef NO_LAYER12
+ init_layer12_stuff(fr, init_layer12_table);
+#endif
+ fr->make_decode_tables = make_decode_tables;
+ }
+
+ /* We allocated the table buffers just now, so (re)create the tables. */
+ fr->make_decode_tables(fr);
+
+ return 0;
+}
+
+int frame_cpu_opt(mpg123_handle *fr, const char* cpu)
+{
+ const char* chosen = ""; /* the chosen decoder opt as string */
+ enum optdec want_dec = nodec;
+ int done = 0;
+ int auto_choose = 0;
+#ifdef OPT_DITHER
+ int dithered = FALSE; /* If some dithered decoder is chosen. */
+#endif
+
+ want_dec = dectype(cpu);
+ auto_choose = want_dec == autodec;
+ /* Fill whole array of synth functions with generic code first. */
+ fr->synths = synth_base;
+
+#ifndef OPT_MULTI
+ {
+ if(!auto_choose && want_dec != defopt)
+ {
+ if(NOQUIET) error2("you wanted decoder type %i, I only have %i", want_dec, defopt);
+ }
+ auto_choose = TRUE; /* There will be only one choice anyway. */
+ }
+#endif
+
+ fr->cpu_opts.type = nodec;
+#ifdef OPT_MULTI
+#ifndef NO_LAYER3
+#if (defined OPT_3DNOW_VINTAGE || defined OPT_3DNOWEXT_VINTAGE || defined OPT_SSE || defined OPT_X86_64 || defined OPT_AVX || defined OPT_NEON || defined OPT_NEON64)
+ fr->cpu_opts.the_dct36 = dct36;
+#endif
+#endif
+#endif
+ /* covers any i386+ cpu; they actually differ only in the synth_1to1 function, mostly... */
+#ifdef OPT_X86
+ if(cpu_i586(fr->cpu_flags))
+ {
+# ifdef OPT_MULTI
+ debug2("standard flags: 0x%08x\textended flags: 0x%08x", fr->cpu_flags.std, fr->cpu_flags.ext);
+# endif
+# ifdef OPT_SSE
+ if( !done && (auto_choose || want_dec == sse)
+ && cpu_sse(fr->cpu_flags) && cpu_mmx(fr->cpu_flags) )
+ {
+ chosen = dn_sse;
+ fr->cpu_opts.type = sse;
+#ifdef OPT_MULTI
+# ifndef NO_LAYER3
+ /* if(cpu_fast_sse(fr->cpu_flags)) */ fr->cpu_opts.the_dct36 = dct36_sse;
+# endif
+#endif
+# ifndef NO_16BIT
+ fr->synths.plain[r_1to1][f_16] = synth_1to1_sse;
+# ifdef ACCURATE_ROUNDING
+ fr->synths.stereo[r_1to1][f_16] = synth_1to1_stereo_sse;
+# endif
+# endif
+# ifndef NO_REAL
+ fr->synths.plain[r_1to1][f_real] = synth_1to1_real_sse;
+ fr->synths.stereo[r_1to1][f_real] = synth_1to1_real_stereo_sse;
+# endif
+# ifndef NO_32BIT
+ fr->synths.plain[r_1to1][f_32] = synth_1to1_s32_sse;
+ fr->synths.stereo[r_1to1][f_32] = synth_1to1_s32_stereo_sse;
+# endif
+ done = 1;
+ }
+# endif
+# ifdef OPT_SSE_VINTAGE
+ if( !done && (auto_choose || want_dec == sse_vintage)
+ && cpu_sse(fr->cpu_flags) && cpu_mmx(fr->cpu_flags) )
+ {
+ chosen = dn_sse_vintage;
+ fr->cpu_opts.type = sse_vintage;
+# ifndef NO_16BIT
+ fr->synths.plain[r_1to1][f_16] = synth_1to1_sse;
+# ifdef ACCURATE_ROUNDING
+ fr->synths.stereo[r_1to1][f_16] = synth_1to1_stereo_sse;
+# endif
+# endif
+# ifndef NO_REAL
+ fr->synths.plain[r_1to1][f_real] = synth_1to1_real_sse;
+ fr->synths.stereo[r_1to1][f_real] = synth_1to1_real_stereo_sse;
+# endif
+# ifndef NO_32BIT
+ fr->synths.plain[r_1to1][f_32] = synth_1to1_s32_sse;
+ fr->synths.stereo[r_1to1][f_32] = synth_1to1_s32_stereo_sse;
+# endif
+ done = 1;
+ }
+# endif
+# ifdef OPT_3DNOWEXT
+ if( !done && (auto_choose || want_dec == dreidnowext)
+ && cpu_3dnow(fr->cpu_flags)
+ && cpu_3dnowext(fr->cpu_flags)
+ && cpu_mmx(fr->cpu_flags) )
+ {
+ chosen = dn_dreidnowext;
+ fr->cpu_opts.type = dreidnowext;
+# ifndef NO_16BIT
+ fr->synths.plain[r_1to1][f_16] = synth_1to1_3dnowext;
+# endif
+ done = 1;
+ }
+# endif
+# ifdef OPT_3DNOWEXT_VINTAGE
+ if( !done && (auto_choose || want_dec == dreidnowext_vintage)
+ && cpu_3dnow(fr->cpu_flags)
+ && cpu_3dnowext(fr->cpu_flags)
+ && cpu_mmx(fr->cpu_flags) )
+ {
+ chosen = dn_dreidnowext_vintage;
+ fr->cpu_opts.type = dreidnowext_vintage;
+#ifdef OPT_MULTI
+# ifndef NO_LAYER3
+ fr->cpu_opts.the_dct36 = dct36_3dnowext;
+# endif
+#endif
+# ifndef NO_16BIT
+ fr->synths.plain[r_1to1][f_16] = synth_1to1_3dnowext;
+# endif
+ done = 1;
+ }
+# endif
+# ifdef OPT_3DNOW
+ if( !done && (auto_choose || want_dec == dreidnow)
+ && cpu_3dnow(fr->cpu_flags) && cpu_mmx(fr->cpu_flags) )
+ {
+ chosen = dn_dreidnow;
+ fr->cpu_opts.type = dreidnow;
+# ifndef NO_16BIT
+ fr->synths.plain[r_1to1][f_16] = synth_1to1_3dnow;
+# endif
+ done = 1;
+ }
+# endif
+# ifdef OPT_3DNOW_VINTAGE
+ if( !done && (auto_choose || want_dec == dreidnow_vintage)
+ && cpu_3dnow(fr->cpu_flags) && cpu_mmx(fr->cpu_flags) )
+ {
+ chosen = dn_dreidnow_vintage;
+ fr->cpu_opts.type = dreidnow_vintage;
+#ifdef OPT_MULTI
+# ifndef NO_LAYER3
+ fr->cpu_opts.the_dct36 = dct36_3dnow;
+# endif
+#endif
+# ifndef NO_16BIT
+ fr->synths.plain[r_1to1][f_16] = synth_1to1_3dnow;
+# endif
+ done = 1;
+ }
+# endif
+ #ifdef OPT_MMX
+ if( !done && (auto_choose || want_dec == mmx)
+ && cpu_mmx(fr->cpu_flags) )
+ {
+ chosen = dn_mmx;
+ fr->cpu_opts.type = mmx;
+# ifndef NO_16BIT
+ fr->synths.plain[r_1to1][f_16] = synth_1to1_mmx;
+# endif
+ done = 1;
+ }
+ #endif
+ #ifdef OPT_I586
+ if(!done && (auto_choose || want_dec == ifuenf))
+ {
+ chosen = "i586/pentium";
+ fr->cpu_opts.type = ifuenf;
+# ifndef NO_16BIT
+ fr->synths.plain[r_1to1][f_16] = synth_1to1_i586;
+# endif
+ done = 1;
+ }
+ #endif
+ #ifdef OPT_I586_DITHER
+ if(!done && (auto_choose || want_dec == ifuenf_dither))
+ {
+ chosen = "dithered i586/pentium";
+ fr->cpu_opts.type = ifuenf_dither;
+ dithered = TRUE;
+# ifndef NO_16BIT
+ fr->synths.plain[r_1to1][f_16] = synth_1to1_i586_dither;
+# ifndef NO_DOWNSAMPLE
+ fr->synths.plain[r_2to1][f_16] = synth_2to1_dither;
+ fr->synths.plain[r_4to1][f_16] = synth_4to1_dither;
+# endif
+# endif
+ done = 1;
+ }
+ #endif
+ }
+ #ifdef OPT_I486
+ /* That won't cooperate in multi opt mode - forcing i486 in layer3.c
+ But still... here it is... maybe for real use in future. */
+ if(!done && (auto_choose || want_dec == ivier))
+ {
+ chosen = dn_ivier;
+ fr->cpu_opts.type = ivier;
+ done = 1;
+ }
+ #endif
+ #ifdef OPT_I386
+ if(!done && (auto_choose || want_dec == idrei))
+ {
+ chosen = dn_idrei;
+ fr->cpu_opts.type = idrei;
+ done = 1;
+ }
+ #endif
+
+ if(done)
+ {
+ /*
+ We have chosen some x86 decoder... fillup some i386 stuff.
+ There is an open question about using dithered synth_1to1 for 8bit wrappers.
+ For quality it won't make sense, but wrapped i586_dither wrapped may still be faster...
+ */
+ enum synth_resample ri;
+ enum synth_format fi;
+# ifndef NO_8BIT
+# ifndef NO_16BIT /* possibility to use a 16->8 wrapper... */
+ if(fr->synths.plain[r_1to1][f_16] != synth_base.plain[r_1to1][f_16])
+ {
+ fr->synths.plain[r_1to1][f_8] = synth_1to1_8bit_wrap;
+ fr->synths.mono[r_1to1][f_8] = synth_1to1_8bit_wrap_mono;
+ fr->synths.mono2stereo[r_1to1][f_8] = synth_1to1_8bit_wrap_m2s;
+ }
+# endif
+# endif
+ for(ri=0; ri<r_limit; ++ri)
+ for(fi=0; fi<f_limit; ++fi)
+ {
+ if(fr->synths.plain[ri][fi] == synth_base.plain[ri][fi])
+ fr->synths.plain[ri][fi] = plain_i386[ri][fi];
+ }
+ }
+
+#endif /* OPT_X86 */
+
+#ifdef OPT_AVX
+ if(!done && (auto_choose || want_dec == avx) && cpu_avx(fr->cpu_flags))
+ {
+ chosen = "x86-64 (AVX)";
+ fr->cpu_opts.type = avx;
+#ifdef OPT_MULTI
+# ifndef NO_LAYER3
+ fr->cpu_opts.the_dct36 = dct36_avx;
+# endif
+#endif
+# ifndef NO_16BIT
+ fr->synths.plain[r_1to1][f_16] = synth_1to1_avx;
+ fr->synths.stereo[r_1to1][f_16] = synth_1to1_stereo_avx;
+# endif
+# ifndef NO_REAL
+ fr->synths.plain[r_1to1][f_real] = synth_1to1_real_avx;
+ fr->synths.stereo[r_1to1][f_real] = synth_1to1_fltst_avx;
+# endif
+# ifndef NO_32BIT
+ fr->synths.plain[r_1to1][f_32] = synth_1to1_s32_avx;
+ fr->synths.stereo[r_1to1][f_32] = synth_1to1_s32_stereo_avx;
+# endif
+ done = 1;
+ }
+#endif
+
+#ifdef OPT_X86_64
+ if(!done && (auto_choose || want_dec == x86_64))
+ {
+ chosen = "x86-64 (SSE)";
+ fr->cpu_opts.type = x86_64;
+#ifdef OPT_MULTI
+# ifndef NO_LAYER3
+ fr->cpu_opts.the_dct36 = dct36_x86_64;
+# endif
+#endif
+# ifndef NO_16BIT
+ fr->synths.plain[r_1to1][f_16] = synth_1to1_x86_64;
+ fr->synths.stereo[r_1to1][f_16] = synth_1to1_stereo_x86_64;
+# endif
+# ifndef NO_REAL
+ fr->synths.plain[r_1to1][f_real] = synth_1to1_real_x86_64;
+ fr->synths.stereo[r_1to1][f_real] = synth_1to1_real_stereo_x86_64;
+# endif
+# ifndef NO_32BIT
+ fr->synths.plain[r_1to1][f_32] = synth_1to1_s32_x86_64;
+ fr->synths.stereo[r_1to1][f_32] = synth_1to1_s32_stereo_x86_64;
+# endif
+ done = 1;
+ }
+#endif
+
+# ifdef OPT_ALTIVEC
+ if(!done && (auto_choose || want_dec == altivec))
+ {
+ chosen = dn_altivec;
+ fr->cpu_opts.type = altivec;
+# ifndef NO_16BIT
+ fr->synths.plain[r_1to1][f_16] = synth_1to1_altivec;
+ fr->synths.stereo[r_1to1][f_16] = synth_1to1_stereo_altivec;
+# endif
+# ifndef NO_REAL
+ fr->synths.plain[r_1to1][f_real] = synth_1to1_real_altivec;
+ fr->synths.stereo[r_1to1][f_real] = synth_1to1_fltst_altivec;
+# endif
+# ifndef NO_32BIT
+ fr->synths.plain[r_1to1][f_32] = synth_1to1_s32_altivec;
+ fr->synths.stereo[r_1to1][f_32] = synth_1to1_s32_stereo_altivec;
+# endif
+ done = 1;
+ }
+# endif
+
+# ifdef OPT_NEON
+ if(!done && (auto_choose || want_dec == neon) && cpu_neon(fr->cpu_flags))
+ {
+ chosen = dn_neon;
+ fr->cpu_opts.type = neon;
+#ifdef OPT_MULTI
+# ifndef NO_LAYER3
+ fr->cpu_opts.the_dct36 = dct36_neon;
+# endif
+#endif
+# ifndef NO_16BIT
+ fr->synths.plain[r_1to1][f_16] = synth_1to1_neon;
+ fr->synths.stereo[r_1to1][f_16] = synth_1to1_stereo_neon;
+# endif
+# ifndef NO_REAL
+ fr->synths.plain[r_1to1][f_real] = synth_1to1_real_neon;
+ fr->synths.stereo[r_1to1][f_real] = synth_1to1_real_stereo_neon;
+# endif
+# ifndef NO_32BIT
+ fr->synths.plain[r_1to1][f_32] = synth_1to1_s32_neon;
+ fr->synths.stereo[r_1to1][f_32] = synth_1to1_s32_stereo_neon;
+# endif
+ done = 1;
+ }
+# endif
+
+# ifdef OPT_ARM
+ if(!done && (auto_choose || want_dec == arm))
+ {
+ chosen = dn_arm;
+ fr->cpu_opts.type = arm;
+# ifndef NO_16BIT
+ fr->synths.plain[r_1to1][f_16] = synth_1to1_arm;
+# endif
+ done = 1;
+ }
+# endif
+
+# ifdef OPT_NEON64
+ if(!done && (auto_choose || want_dec == neon64) && cpu_neon(fr->cpu_flags))
+ {
+ chosen = dn_neon64;
+ fr->cpu_opts.type = neon64;
+#ifdef OPT_MULTI
+# ifndef NO_LAYER3
+ fr->cpu_opts.the_dct36 = dct36_neon64;
+# endif
+#endif
+# ifndef NO_16BIT
+ fr->synths.plain[r_1to1][f_16] = synth_1to1_neon64;
+ fr->synths.stereo[r_1to1][f_16] = synth_1to1_stereo_neon64;
+# endif
+# ifndef NO_REAL
+ fr->synths.plain[r_1to1][f_real] = synth_1to1_real_neon64;
+ fr->synths.stereo[r_1to1][f_real] = synth_1to1_fltst_neon64;
+# endif
+# ifndef NO_32BIT
+ fr->synths.plain[r_1to1][f_32] = synth_1to1_s32_neon64;
+ fr->synths.stereo[r_1to1][f_32] = synth_1to1_s32st_neon64;
+# endif
+ done = 1;
+ }
+# endif
+
+# ifdef OPT_GENERIC
+ if(!done && (auto_choose || want_dec == generic))
+ {
+ chosen = dn_generic;
+ fr->cpu_opts.type = generic;
+ done = 1;
+ }
+# endif
+
+#ifdef OPT_GENERIC_DITHER
+ if(!done && (auto_choose || want_dec == generic_dither))
+ {
+ chosen = "dithered generic";
+ fr->cpu_opts.type = generic_dither;
+ dithered = TRUE;
+# ifndef NO_16BIT
+ fr->synths.plain[r_1to1][f_16] = synth_1to1_dither;
+# ifndef NO_DOWNSAMPLE
+ fr->synths.plain[r_2to1][f_16] = synth_2to1_dither;
+ fr->synths.plain[r_4to1][f_16] = synth_4to1_dither;
+# endif
+# endif
+ done = 1;
+ }
+#endif
+
+ fr->cpu_opts.class = decclass(fr->cpu_opts.type);
+
+# ifndef NO_8BIT
+# ifndef NO_16BIT /* possibility to use a 16->8 wrapper... */
+ /* Last chance to use some optimized routine via generic wrappers (for 8bit). */
+ if( fr->cpu_opts.type != ifuenf_dither
+ && fr->cpu_opts.type != generic_dither
+ && fr->synths.plain[r_1to1][f_16] != synth_base.plain[r_1to1][f_16] )
+ {
+ fr->synths.plain[r_1to1][f_8] = synth_1to1_8bit_wrap;
+ fr->synths.mono[r_1to1][f_8] = synth_1to1_8bit_wrap_mono;
+ fr->synths.mono2stereo[r_1to1][f_8] = synth_1to1_8bit_wrap_m2s;
+ }
+# endif
+# endif
+
+#ifdef OPT_DITHER
+ if(done && dithered)
+ {
+ /* run-time dither noise table generation */
+ if(!frame_dither_init(fr))
+ {
+ if(NOQUIET) error("Dither noise setup failed!");
+ return 0;
+ }
+ }
+#endif
+
+ if(done)
+ {
+ if(VERBOSE) fprintf(stderr, "Decoder: %s\n", chosen);
+ return 1;
+ }
+ else
+ {
+ if(NOQUIET) error("Could not set optimization!");
+ return 0;
+ }
+}
+
+enum optdec dectype(const char* decoder)
+{
+ enum optdec dt;
+ if( (decoder == NULL)
+ || (decoder[0] == 0) )
+ return autodec;
+
+ for(dt=autodec; dt<nodec; ++dt)
+ if(!strcasecmp(decoder, decname[dt])) return dt;
+
+ return nodec; /* If we found nothing... */
+}
+
+#ifdef OPT_MULTI
+
+/* same number of entries as full list, but empty at beginning */
+static const char *mpg123_supported_decoder_list[] =
+{
+ #ifdef OPT_SSE
+ NULL,
+ #endif
+ #ifdef OPT_SSE_VINTAGE
+ NULL,
+ #endif
+ #ifdef OPT_3DNOWEXT
+ NULL,
+ #endif
+ #ifdef OPT_3DNOWEXT_VINTAGE
+ NULL,
+ #endif
+ #ifdef OPT_3DNOW
+ NULL,
+ #endif
+ #ifdef OPT_3DNOW_VINTAGE
+ NULL,
+ #endif
+ #ifdef OPT_MMX
+ NULL,
+ #endif
+ #ifdef OPT_I586
+ NULL,
+ #endif
+ #ifdef OPT_I586_DITHER
+ NULL,
+ #endif
+ #ifdef OPT_I486
+ NULL,
+ #endif
+ #ifdef OPT_I386
+ NULL,
+ #endif
+ #ifdef OPT_ALTIVEC
+ NULL,
+ #endif
+ #ifdef OPT_AVX
+ NULL,
+ #endif
+ #ifdef OPT_X86_64
+ NULL,
+ #endif
+ #ifdef OPT_ARM
+ NULL,
+ #endif
+ #ifdef OPT_NEON
+ NULL,
+ #endif
+ #ifdef OPT_NEON64
+ NULL,
+ #endif
+ #ifdef OPT_GENERIC_FLOAT
+ NULL,
+ #endif
+# ifdef OPT_GENERIC
+ NULL,
+# endif
+# ifdef OPT_GENERIC_DITHER
+ NULL,
+# endif
+ NULL
+};
+#endif
+
+static const char *mpg123_decoder_list[] =
+{
+ #ifdef OPT_SSE
+ dn_sse,
+ #endif
+ #ifdef OPT_SSE_VINTAGE
+ dn_sse_vintage,
+ #endif
+ #ifdef OPT_3DNOWEXT
+ dn_dreidnowext,
+ #endif
+ #ifdef OPT_3DNOWEXT_VINTAGE
+ dn_dreidnowext_vintage,
+ #endif
+ #ifdef OPT_3DNOW
+ dn_dreidnow,
+ #endif
+ #ifdef OPT_3DNOW_VINTAGE
+ dn_dreidnow_vintage,
+ #endif
+ #ifdef OPT_MMX
+ dn_mmx,
+ #endif
+ #ifdef OPT_I586
+ dn_ifuenf,
+ #endif
+ #ifdef OPT_I586_DITHER
+ dn_ifuenf_dither,
+ #endif
+ #ifdef OPT_I486
+ dn_ivier,
+ #endif
+ #ifdef OPT_I386
+ dn_idrei,
+ #endif
+ #ifdef OPT_ALTIVEC
+ dn_altivec,
+ #endif
+ #ifdef OPT_AVX
+ dn_avx,
+ #endif
+ #ifdef OPT_X86_64
+ dn_x86_64,
+ #endif
+ #ifdef OPT_ARM
+ dn_arm,
+ #endif
+ #ifdef OPT_NEON
+ dn_neon,
+ #endif
+ #ifdef OPT_NEON64
+ dn_neon64,
+ #endif
+ #ifdef OPT_GENERIC
+ dn_generic,
+ #endif
+ #ifdef OPT_GENERIC_DITHER
+ dn_generic_dither,
+ #endif
+ NULL
+};
+
+void check_decoders(void)
+{
+#ifndef OPT_MULTI
+ /* In non-multi mode, only the full list (one entry) is used. */
+ return;
+#else
+ const char **d = mpg123_supported_decoder_list;
+#if (defined OPT_X86) || (defined OPT_X86_64) || (defined OPT_NEON) || (defined OPT_NEON64)
+ struct cpuflags cpu_flags;
+ wrap_getcpuflags(&cpu_flags);
+#endif
+#ifdef OPT_X86
+ if(cpu_i586(cpu_flags))
+ {
+ /* not yet: if(cpu_sse2(cpu_flags)) printf(" SSE2");
+ if(cpu_sse3(cpu_flags)) printf(" SSE3"); */
+#ifdef OPT_SSE
+ if(cpu_sse(cpu_flags)) *(d++) = dn_sse;
+#endif
+#ifdef OPT_SSE_VINTAGE
+ if(cpu_sse(cpu_flags)) *(d++) = dn_sse_vintage;
+#endif
+#ifdef OPT_3DNOWEXT
+ if(cpu_3dnowext(cpu_flags)) *(d++) = dn_dreidnowext;
+#endif
+#ifdef OPT_3DNOWEXT_VINTAGE
+ if(cpu_3dnowext(cpu_flags)) *(d++) = dn_dreidnowext_vintage;
+#endif
+#ifdef OPT_3DNOW
+ if(cpu_3dnow(cpu_flags)) *(d++) = dn_dreidnow;
+#endif
+#ifdef OPT_3DNOW_VINTAGE
+ if(cpu_3dnow(cpu_flags)) *(d++) = dn_dreidnow_vintage;
+#endif
+#ifdef OPT_MMX
+ if(cpu_mmx(cpu_flags)) *(d++) = dn_mmx;
+#endif
+#ifdef OPT_I586
+ *(d++) = dn_ifuenf;
+#endif
+#ifdef OPT_I586_DITHER
+ *(d++) = dn_ifuenf_dither;
+#endif
+ }
+#endif
+/* just assume that the i486 built is run on a i486 cpu... */
+#ifdef OPT_I486
+ *(d++) = dn_ivier;
+#endif
+#ifdef OPT_ALTIVEC
+ *(d++) = dn_altivec;
+#endif
+/* every supported x86 can do i386, any cpu can do generic */
+#ifdef OPT_I386
+ *(d++) = dn_idrei;
+#endif
+#ifdef OPT_AVX
+ if(cpu_avx(cpu_flags)) *(d++) = dn_avx;
+#endif
+#ifdef OPT_X86_64
+ *(d++) = dn_x86_64;
+#endif
+#ifdef OPT_ARM
+ *(d++) = dn_arm;
+#endif
+#ifdef OPT_NEON
+ if(cpu_neon(cpu_flags)) *(d++) = dn_neon;
+#endif
+#ifdef OPT_NEON64
+ if(cpu_neon(cpu_flags)) *(d++) = dn_neon64;
+#endif
+#ifdef OPT_GENERIC
+ *(d++) = dn_generic;
+#endif
+#ifdef OPT_GENERIC_DITHER
+ *(d++) = dn_generic_dither;
+#endif
+#endif /* ndef OPT_MULTI */
+}
+
+const char* attribute_align_arg mpg123_current_decoder(mpg123_handle *mh)
+{
+ if(mh == NULL) return NULL;
+
+ return decname[mh->cpu_opts.type];
+}
+
+const char attribute_align_arg **mpg123_decoders(void){ return mpg123_decoder_list; }
+const char attribute_align_arg **mpg123_supported_decoders(void)
+{
+ check_decoders();
+#ifdef OPT_MULTI
+ return mpg123_supported_decoder_list;
+#else
+ return mpg123_decoder_list;
+#endif
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/optimize.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/optimize.h
new file mode 100644
index 00000000..4ac33a2e
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/optimize.h
@@ -0,0 +1,388 @@
+#ifndef MPG123_H_OPTIMIZE
+#define MPG123_H_OPTIMIZE
+/*
+ optimize: get a grip on the different optimizations
+
+ copyright 2007-2013 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis, taking from mpg123.[hc]
+
+ for building mpg123 with one optimization only, you have to choose exclusively between
+ OPT_GENERIC (generic C code for everyone)
+ OPT_GENERIC_DITHER (same with dithering for 1to1)
+ OPT_I386 (Intel i386)
+ OPT_I486 (Somewhat special code for i486; does not work together with others.)
+ OPT_I586 (Intel Pentium)
+ OPT_I586_DITHER (Intel Pentium with dithering/noise shaping for enhanced quality)
+ OPT_MMX (Intel Pentium and compatibles with MMX, fast, but not the best accuracy)
+ OPT_3DNOW (AMD 3DNow!, K6-2/3, Athlon, compatibles...)
+ OPT_3DNOW_VINTAGE
+ OPT_3DNOWEXT (AMD 3DNow! extended, generally Athlon, compatibles...)
+ OPT_3DNOWEXT_VINTAGE
+ OPT_SSE
+ OPT_SSE_VINTAGE
+ OPT_ALTIVEC (Motorola/IBM PPC with AltiVec under MacOSX)
+ OPT_X86_64 (x86-64 / AMD64 / Intel 64)
+ OPT_AVX
+
+ or you define OPT_MULTI and give a combination which makes sense (do not include i486, do not mix altivec and x86).
+
+ I still have to examine the dynamics of this here together with REAL_IS_FIXED.
+ Basic point is: Don't use REAL_IS_FIXED with something else than generic or i386.
+
+ Also, one should minimize code size by really ensuring that only functions that are really needed are included.
+ Currently, all generic functions will be always there (to be safe for fallbacks for advanced decoders).
+ Strictly, at least the synth_1to1 should not be necessary for single-decoder mode.
+*/
+
+
+/* Runtime optimization interface now here: */
+
+/* Nedit inline Perl script to generate decoder list and name mapping in one place
+ optimize.c defining I_AM_OPTIMIZE to get the names
+
+perl <<'EOT'
+## order is important (autodec first, nodec last)
+@names=
+(
+ ['autodec', 'auto']
+,['generic', 'generic']
+,['generic_dither', 'generic_dither']
+,['idrei', 'i386']
+,['ivier', 'i486']
+,['ifuenf', 'i586']
+,['ifuenf_dither', 'i586_dither']
+,['mmx', 'MMX']
+,['dreidnow', '3DNow']
+,['dreidnowext', '3DNowExt']
+,['altivec', 'AltiVec']
+,['sse', 'SSE']
+,['x86_64', 'x86-64']
+,['arm','ARM']
+,['neon','NEON']
+,['avx','AVX']
+,['dreidnow_vintage', '3DNow_vintage']
+,['dreidnowext_vintage', '3DNowExt_vintage']
+,['sse_vintage', 'SSE_vintage']
+,['nodec', 'nodec']
+);
+
+print "enum optdec\n{\n";
+for my $n (@names)
+{
+ $name = $n->[0];
+ $enum = $name eq 'autodec' ? $name = " $name=0" : ",$name";
+ print "\t$enum\n"
+}
+print "};\n";
+print "##ifdef I_AM_OPTIMIZE\n";
+for my $n (@names)
+{
+ my $key = $n->[0];
+ my $val = $n->[1];
+ print "static const char dn_$key\[\] = \"$val\";\n";
+}
+print "static const char* decname[] =\n{\n";
+for my $n (@names)
+{
+ my $key = $n->[0];
+ print "\t".($key eq 'autodec' ? ' ' : ',')."dn_$key\n";
+}
+print "};\n##endif"
+EOT
+*/
+enum optdec
+{
+ autodec=0
+ ,generic
+ ,generic_dither
+ ,idrei
+ ,ivier
+ ,ifuenf
+ ,ifuenf_dither
+ ,mmx
+ ,dreidnow
+ ,dreidnowext
+ ,altivec
+ ,sse
+ ,x86_64
+ ,arm
+ ,neon
+ ,neon64
+ ,avx
+ ,dreidnow_vintage
+ ,dreidnowext_vintage
+ ,sse_vintage
+ ,nodec
+};
+#ifdef I_AM_OPTIMIZE
+static const char dn_autodec[] = "auto";
+static const char dn_generic[] = "generic";
+static const char dn_generic_dither[] = "generic_dither";
+static const char dn_idrei[] = "i386";
+static const char dn_ivier[] = "i486";
+static const char dn_ifuenf[] = "i586";
+static const char dn_ifuenf_dither[] = "i586_dither";
+static const char dn_mmx[] = "MMX";
+static const char dn_dreidnow[] = "3DNow";
+static const char dn_dreidnowext[] = "3DNowExt";
+static const char dn_altivec[] = "AltiVec";
+static const char dn_sse[] = "SSE";
+static const char dn_x86_64[] = "x86-64";
+static const char dn_arm[] = "ARM";
+static const char dn_neon[] = "NEON";
+static const char dn_neon64[] = "NEON64";
+static const char dn_avx[] = "AVX";
+static const char dn_dreidnow_vintage[] = "3DNow_vintage";
+static const char dn_dreidnowext_vintage[] = "3DNowExt_vintage";
+static const char dn_sse_vintage[] = "SSE_vintage";
+static const char dn_nodec[] = "nodec";
+static const char* decname[] =
+{
+ dn_autodec
+ ,dn_generic
+ ,dn_generic_dither
+ ,dn_idrei
+ ,dn_ivier
+ ,dn_ifuenf
+ ,dn_ifuenf_dither
+ ,dn_mmx
+ ,dn_dreidnow
+ ,dn_dreidnowext
+ ,dn_altivec
+ ,dn_sse
+ ,dn_x86_64
+ ,dn_arm
+ ,dn_neon
+ ,dn_neon64
+ ,dn_avx
+ ,dn_dreidnow_vintage
+ ,dn_dreidnowext_vintage
+ ,dn_sse_vintage
+ ,dn_nodec
+};
+#endif
+
+enum optcla { nocla=0, normal, mmxsse };
+
+/* - Set up the table of synth functions for current decoder choice. */
+int frame_cpu_opt(mpg123_handle *fr, const char* cpu);
+/* - Choose, from the synth table, the synth functions to use for current output format/rate. */
+int set_synth_functions(mpg123_handle *fr);
+/* - Parse decoder name and return numerical code. */
+enum optdec dectype(const char* decoder);
+/* - Return the default decoder type. */
+enum optdec defdec(void);
+/* - Return the class of a decoder type (mmxsse or normal). */
+enum optcla decclass(const enum optdec);
+
+/* Now comes a whole lot of definitions, for multi decoder mode and single decoder mode.
+ Because of the latter, it may look redundant at times. */
+
+/* this is included in mpg123.h, which includes config.h */
+#ifdef CCALIGN
+#define ALIGNED(a) __attribute__((aligned(a)))
+#else
+#define ALIGNED(a)
+#endif
+
+/* Safety catch for invalid decoder choice. */
+#ifdef REAL_IS_FIXED
+#if (defined OPT_I486) || (defined OPT_I586) || (defined OPT_I586_DITHER) \
+ || (defined OPT_MMX) || (defined OPT_SSE) || (defined_OPT_ALTIVEC) \
+ || (defined OPT_3DNOW) || (defined OPT_3DNOWEXT) || (defined OPT_X86_64) \
+ || (defined OPT_3DNOW_VINTAGE) || (defined OPT_3DNOWEXT_VINTAGE) \
+ || (defined OPT_SSE_VINTAGE) \
+ || (defined OPT_NEON) || (defined OPT_NEON64) || (defined OPT_AVX) \
+ || (defined OPT_GENERIC_DITHER)
+#error "Bad decoder choice together with fixed point math!"
+#endif
+#endif
+
+#if (defined NO_LAYER1 && defined NO_LAYER2)
+#define NO_LAYER12
+#endif
+
+#ifdef OPT_GENERIC
+#ifndef OPT_MULTI
+# define defopt generic
+#endif
+#endif
+
+#ifdef OPT_GENERIC_DITHER
+#define OPT_DITHER
+#ifndef OPT_MULTI
+# define defopt generic_dither
+#endif
+#endif
+
+/* i486 is special... always alone! */
+#ifdef OPT_I486
+#define OPT_X86
+#define defopt ivier
+#ifdef OPT_MULTI
+#error "i486 can only work alone!"
+#endif
+#define FIR_BUFFER_SIZE 128
+#define FIR_SIZE 16
+#endif
+
+#ifdef OPT_I386
+#define OPT_X86
+#ifndef OPT_MULTI
+# define defopt idrei
+#endif
+#endif
+
+#ifdef OPT_I586
+#define OPT_X86
+#ifndef OPT_MULTI
+# define defopt ifuenf
+#endif
+#endif
+
+#ifdef OPT_I586_DITHER
+#define OPT_X86
+#define OPT_DITHER
+#ifndef OPT_MULTI
+# define defopt ifuenf_dither
+#endif
+#endif
+
+/* We still have some special code around MMX tables. */
+
+#ifdef OPT_MMX
+#define OPT_MMXORSSE
+#define OPT_X86
+#ifndef OPT_MULTI
+# define defopt mmx
+#endif
+#endif
+
+#ifdef OPT_SSE
+#define OPT_MMXORSSE
+#define OPT_MPLAYER
+#define OPT_X86
+#ifndef OPT_MULTI
+# define defopt sse
+# define opt_dct36(fr) dct36_sse
+#endif
+#endif
+
+#ifdef OPT_SSE_VINTAGE
+#define OPT_MMXORSSE
+#define OPT_MPLAYER
+#define OPT_X86
+#ifndef OPT_MULTI
+# define defopt sse
+#endif
+#endif
+
+#ifdef OPT_3DNOWEXT
+#define OPT_MMXORSSE
+#define OPT_MPLAYER
+#define OPT_X86
+#ifndef OPT_MULTI
+# define defopt dreidnowext
+#endif
+#endif
+
+/* same as above but also using 3DNowExt dct36 */
+#ifdef OPT_3DNOWEXT_VINTAGE
+#define OPT_MMXORSSE
+#define OPT_MPLAYER
+#define OPT_X86
+#ifndef OPT_MULTI
+# define defopt dreidnowext_vintage
+# define opt_dct36(fr) dct36_3dnowext
+#endif
+#endif
+
+#ifdef OPT_MPLAYER
+extern const int costab_mmxsse[];
+#endif
+
+/* 3dnow used to use synth_1to1_i586 for mono / 8bit conversion - was that intentional? */
+/* I'm trying to skip the pentium code here ... until I see that that is indeed a bad idea */
+#ifdef OPT_3DNOW
+#define OPT_X86
+#ifndef OPT_MULTI
+# define defopt dreidnow
+#endif
+#endif
+
+/* same as above but also using 3DNow dct36 */
+#ifdef OPT_3DNOW_VINTAGE
+#define OPT_X86
+#ifndef OPT_MULTI
+# define defopt dreidnow_vintage
+# define opt_dct36(fr) dct36_3dnow
+#endif
+#endif
+
+#ifdef OPT_ALTIVEC
+#ifndef OPT_MULTI
+# define defopt altivec
+#endif
+#endif
+
+#ifdef OPT_X86_64
+#define OPT_MMXORSSE
+#ifndef OPT_MULTI
+# define defopt x86_64
+# define opt_dct36(fr) dct36_x86_64
+#endif
+#endif
+
+#ifdef OPT_AVX
+#define OPT_MMXORSSE
+#ifndef OPT_MULTI
+# define defopt avx
+# define opt_dct36(fr) dct36_avx
+#endif
+#endif
+
+#ifdef OPT_ARM
+#ifndef OPT_MULTI
+# define defopt arm
+#endif
+#endif
+
+#ifdef OPT_NEON
+#define OPT_MMXORSSE
+#ifndef OPT_MULTI
+# define defopt neon
+# define opt_dct36(fr) dct36_neon
+#endif
+#endif
+
+#ifdef OPT_NEON64
+#define OPT_MMXORSSE
+#ifndef OPT_MULTI
+# define defopt neon64
+# define opt_dct36(fr) dct36_neon64
+#endif
+#endif
+
+/*
+ Now come two blocks of standard definitions for multi-decoder mode and single-decoder mode.
+ Most stuff is so automatic that it's indeed generated by some inline shell script.
+ Remember to use these scripts when possible, instead of direct repetitive hacking.
+*/
+
+#ifdef OPT_MULTI
+
+# define defopt nodec
+
+# if (defined OPT_3DNOW_VINTAGE || defined OPT_3DNOWEXT_VINTAGE || defined OPT_SSE || defined OPT_X86_64 || defined OPT_AVX || defined OPT_NEON || defined OPT_NEON64)
+# define opt_dct36(fr) ((fr)->cpu_opts.the_dct36)
+# endif
+
+#endif /* OPT_MULTI else */
+
+# ifndef opt_dct36
+# define opt_dct36(fr) dct36
+# endif
+
+#endif /* MPG123_H_OPTIMIZE */
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/parse.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/parse.c
new file mode 100644
index 00000000..c2efd3dc
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/parse.c
@@ -0,0 +1,1385 @@
+/*
+ parse: spawned from common; clustering around stream/frame parsing
+
+ copyright ?-2020 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp & Thomas Orgis
+*/
+
+#include "mpg123lib_intern.h"
+
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include "getbits.h"
+
+#if defined (WANT_WIN32_SOCKETS)
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
+/* a limit for number of frames in a track; beyond that unsigned long may not be enough to hold byte addresses */
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifndef ULONG_MAX
+/* hm, is this portable across preprocessors? */
+#define ULONG_MAX ((unsigned long)-1)
+#endif
+#define TRACK_MAX_FRAMES ULONG_MAX/4/1152
+
+#include "mpeghead.h"
+
+#include "debug.h"
+
+#define bsbufid(fr) (fr)->bsbuf==(fr)->bsspace[0] ? 0 : ((fr)->bsbuf==fr->bsspace[1] ? 1 : ( (fr)->bsbuf==(fr)->bsspace[0]+512 ? 2 : ((fr)->bsbuf==fr->bsspace[1]+512 ? 3 : -1) ) )
+
+/* PARSE_GOOD and PARSE_BAD have to be 1 and 0 (TRUE and FALSE), others can vary. */
+enum parse_codes
+{
+ PARSE_MORE = MPG123_NEED_MORE
+ ,PARSE_ERR = MPG123_ERR
+ ,PARSE_END = 10 /* No more audio data to find. */
+ ,PARSE_GOOD = 1 /* Everything's fine. */
+ ,PARSE_BAD = 0 /* Not fine (invalid data). */
+ ,PARSE_RESYNC = 2 /* Header not good, go into resync. */
+ ,PARSE_AGAIN = 3 /* Really start over, throw away and read a new header, again. */
+};
+
+/* bitrates for [mpeg1/2][layer] */
+static const int tabsel_123[2][3][16] =
+{
+ {
+ {0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,},
+ {0,32,48,56, 64, 80, 96,112,128,160,192,224,256,320,384,},
+ {0,32,40,48, 56, 64, 80, 96,112,128,160,192,224,256,320,}
+ },
+ {
+ {0,32,48,56,64,80,96,112,128,144,160,176,192,224,256,},
+ {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,},
+ {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,}
+ }
+};
+
+static const long freqs[9] = { 44100, 48000, 32000, 22050, 24000, 16000 , 11025 , 12000 , 8000 };
+
+static int decode_header(mpg123_handle *fr,unsigned long newhead, int *freeformat_count);
+static int skip_junk(mpg123_handle *fr, unsigned long *newheadp, long *headcount);
+static int do_readahead(mpg123_handle *fr, unsigned long newhead);
+static int wetwork(mpg123_handle *fr, unsigned long *newheadp);
+
+/* These two are to be replaced by one function that gives all the frame parameters (for outsiders).*/
+/* Those functions are unsafe regarding bad arguments (inside the mpg123_handle), but just returning anything would also be unsafe, the caller code has to be trusted. */
+
+int frame_bitrate(mpg123_handle *fr)
+{
+ return tabsel_123[fr->lsf][fr->lay-1][fr->bitrate_index];
+}
+
+long frame_freq(mpg123_handle *fr)
+{
+ return freqs[fr->sampling_frequency];
+}
+
+/* compiler is smart enought to inline this one or should I really do it as macro...? */
+static int head_check(unsigned long head)
+{
+ if
+ (
+ ((head & HDR_SYNC) != HDR_SYNC)
+ ||
+ /* layer: 01,10,11 is 1,2,3; 00 is reserved */
+ (!(HDR_LAYER_VAL(head)))
+ ||
+ /* 1111 means bad bitrate */
+ (HDR_BITRATE_VAL(head) == 0xf)
+ ||
+ /* sampling freq: 11 is reserved */
+ (HDR_SAMPLERATE_VAL(head) == 0x3)
+ /* here used to be a mpeg 2.5 check... re-enabled 2.5 decoding due to lack of evidence that it is really not good */
+ )
+ {
+ return FALSE;
+ }
+ /* if no check failed, the header is valid (hopefully)*/
+ else
+ {
+ return TRUE;
+ }
+}
+
+/* This is moderately sized buffers. Int offset is enough. */
+static unsigned long bit_read_long(unsigned char *buf, int *offset)
+{
+ unsigned long val = /* 32 bit value */
+ (((unsigned long) buf[*offset]) << 24)
+ | (((unsigned long) buf[*offset+1]) << 16)
+ | (((unsigned long) buf[*offset+2]) << 8)
+ | ((unsigned long) buf[*offset+3]);
+ *offset += 4;
+ return val;
+}
+
+static unsigned short bit_read_short(unsigned char *buf, int *offset)
+{
+ unsigned short val = /* 16 bit value */
+ (((unsigned short) buf[*offset] ) << 8)
+ | ((unsigned short) buf[*offset+1]);
+ *offset += 2;
+ return val;
+}
+
+static int check_lame_tag(mpg123_handle *fr)
+{
+ int i;
+ unsigned long xing_flags;
+ unsigned long long_tmp;
+ /*
+ going to look for Xing or Info at some position after the header
+ MPEG 1 MPEG 2/2.5 (LSF)
+ Stereo, Joint Stereo, Dual Channel 32 17
+ Mono 17 9
+ */
+ int lame_offset = (fr->stereo == 2)
+ ? (fr->lsf ? 17 : 32)
+ : (fr->lsf ? 9 : 17);
+
+ if(fr->p.flags & MPG123_IGNORE_INFOFRAME) goto check_lame_tag_no;
+
+ debug("do we have lame tag?");
+ /*
+ Note: CRC or not, that does not matter here.
+ But, there is any combination of Xing flags in the wild. There are headers
+ without the search index table! I cannot assume a reasonable minimal size
+ for the actual data, have to check if each byte of information is present.
+ But: 4 B Info/Xing + 4 B flags is bare minimum.
+ */
+ if(fr->framesize < lame_offset+8) goto check_lame_tag_no;
+
+ /* only search for tag when all zero before it (apart from checksum) */
+ for(i=2; i < lame_offset; ++i) if(fr->bsbuf[i] != 0) goto check_lame_tag_no;
+
+ debug("possibly...");
+ if
+ (
+ (fr->bsbuf[lame_offset] == 'I')
+ && (fr->bsbuf[lame_offset+1] == 'n')
+ && (fr->bsbuf[lame_offset+2] == 'f')
+ && (fr->bsbuf[lame_offset+3] == 'o')
+ )
+ {
+ /* We still have to see what there is */
+ }
+ else if
+ (
+ (fr->bsbuf[lame_offset] == 'X')
+ && (fr->bsbuf[lame_offset+1] == 'i')
+ && (fr->bsbuf[lame_offset+2] == 'n')
+ && (fr->bsbuf[lame_offset+3] == 'g')
+ )
+ {
+ fr->vbr = MPG123_VBR; /* Xing header means always VBR */
+ }
+ else goto check_lame_tag_no;
+
+ /* we have one of these headers... */
+ if(VERBOSE2) fprintf(stderr, "Note: Xing/Lame/Info header detected\n");
+ lame_offset += 4;
+ xing_flags = bit_read_long(fr->bsbuf, &lame_offset);
+ debug1("Xing: flags 0x%08lx", xing_flags);
+
+ /* From now on, I have to carefully check if the announced data is actually
+ there! I'm always returning 'yes', though. */
+ #define check_bytes_left(n) if(fr->framesize < lame_offset+n) \
+ goto check_lame_tag_yes
+ if(xing_flags & 1) /* total bitstream frames */
+ {
+ check_bytes_left(4); long_tmp = bit_read_long(fr->bsbuf, &lame_offset);
+ if(fr->p.flags & MPG123_IGNORE_STREAMLENGTH)
+ {
+ if(VERBOSE3) fprintf(stderr
+ , "Note: Ignoring Xing frames because of MPG123_IGNORE_STREAMLENGTH\n");
+ }
+ else
+ {
+ /* Check for endless stream, but: TRACK_MAX_FRAMES sensible at all? */
+ fr->track_frames = long_tmp > TRACK_MAX_FRAMES ? 0 : (off_t) long_tmp;
+#ifdef GAPLESS
+ /* All or nothing: Only if encoder delay/padding is known, we'll cut
+ samples for gapless. */
+ if(fr->p.flags & MPG123_GAPLESS)
+ frame_gapless_init(fr, fr->track_frames, 0, 0);
+#endif
+ if(VERBOSE3) fprintf(stderr, "Note: Xing: %lu frames\n", long_tmp);
+ }
+ }
+ if(xing_flags & 0x2) /* total bitstream bytes */
+ {
+ check_bytes_left(4); long_tmp = bit_read_long(fr->bsbuf, &lame_offset);
+ if(fr->p.flags & MPG123_IGNORE_STREAMLENGTH)
+ {
+ if(VERBOSE3) fprintf(stderr
+ , "Note: Ignoring Xing bytes because of MPG123_IGNORE_STREAMLENGTH\n");
+ }
+ else
+ {
+ /* The Xing bitstream length, at least as interpreted by the Lame
+ encoder, encompasses all data from the Xing header frame on,
+ ignoring leading ID3v2 data. Trailing tags (ID3v1) seem to be
+ included, though. */
+ if(fr->rdat.filelen < 1)
+ fr->rdat.filelen = (off_t) long_tmp + fr->audio_start; /* Overflow? */
+ else
+ {
+ if((off_t)long_tmp != fr->rdat.filelen - fr->audio_start && NOQUIET)
+ { /* 1/filelen instead of 1/(filelen-start), my decision */
+ double diff = 100.0/fr->rdat.filelen
+ * ( fr->rdat.filelen - fr->audio_start
+ - (off_t)long_tmp );
+ if(diff < 0.) diff = -diff;
+
+ if(VERBOSE3) fprintf(stderr
+ , "Note: Xing stream size %lu differs by %f%% from determined/given file size!\n"
+ , long_tmp, diff);
+
+ if(diff > 1. && NOQUIET) fprintf(stderr
+ , "Warning: Xing stream size off by more than 1%%, fuzzy seeking may be even more fuzzy than by design!\n");
+ }
+ }
+
+ if(VERBOSE3) fprintf(stderr, "Note: Xing: %lu bytes\n", long_tmp);
+ }
+ }
+ if(xing_flags & 0x4) /* TOC */
+ {
+ check_bytes_left(100);
+ frame_fill_toc(fr, fr->bsbuf+lame_offset);
+ lame_offset += 100;
+ }
+ if(xing_flags & 0x8) /* VBR quality */
+ {
+ check_bytes_left(4); long_tmp = bit_read_long(fr->bsbuf, &lame_offset);
+ if(VERBOSE3) fprintf(stderr, "Note: Xing: quality = %lu\n", long_tmp);
+ }
+ /*
+ Either zeros/nothing, or:
+ 0-8: LAME3.90a
+ 9: revision/VBR method
+ 10: lowpass
+ 11-18: ReplayGain
+ 19: encoder flags
+ 20: ABR
+ 21-23: encoder delays
+ */
+ check_bytes_left(24); /* I'm interested in 24 B of extra info. */
+ if(fr->bsbuf[lame_offset] != 0)
+ {
+ unsigned char lame_vbr;
+ float replay_gain[2] = {0,0};
+ float peak = 0;
+ float gain_offset = 0; /* going to be +6 for old lame that used 83dB */
+ char nb[10];
+ off_t pad_in;
+ off_t pad_out;
+ memcpy(nb, fr->bsbuf+lame_offset, 9);
+ nb[9] = 0;
+ if(VERBOSE3) fprintf(stderr, "Note: Info: Encoder: %s\n", nb);
+ if(!strncmp("LAME", nb, 4))
+ {
+ /* Lame versions before 3.95.1 used 83 dB reference level, later
+ versions 89 dB. We stick with 89 dB as being "normal", adding
+ 6 dB. */
+ unsigned int major, minor;
+ char rest[6];
+ rest[0] = 0;
+ if(sscanf(nb+4, "%u.%u%s", &major, &minor, rest) >= 2)
+ {
+ debug3("LAME: %u/%u/%s", major, minor, rest);
+ /* We cannot detect LAME 3.95 reliably (same version string as
+ 3.95.1), so this is a blind spot. Everything < 3.95 is safe,
+ though. */
+ if(major < 3 || (major == 3 && minor < 95))
+ {
+ gain_offset = 6;
+ if(VERBOSE3) fprintf(stderr
+ , "Note: Info: Old LAME detected, using ReplayGain preamp of %f dB.\n"
+ , gain_offset);
+ }
+ }
+ else if(VERBOSE3) fprintf(stderr
+ , "Note: Info: Cannot determine LAME version.\n");
+ }
+ lame_offset += 9; /* 9 in */
+
+ /* The 4 big bits are tag revision, the small bits vbr method. */
+ lame_vbr = fr->bsbuf[lame_offset] & 15;
+ lame_offset += 1; /* 10 in */
+ if(VERBOSE3)
+ {
+ fprintf(stderr, "Note: Info: rev %u\n", fr->bsbuf[lame_offset] >> 4);
+ fprintf(stderr, "Note: Info: vbr mode %u\n", lame_vbr);
+ }
+ switch(lame_vbr)
+ {
+ /* from rev1 proposal... not sure if all good in practice */
+ case 1:
+ case 8: fr->vbr = MPG123_CBR; break;
+ case 2:
+ case 9: fr->vbr = MPG123_ABR; break;
+ default: fr->vbr = MPG123_VBR; /* 00==unknown is taken as VBR */
+ }
+ lame_offset += 1; /* 11 in, skipping lowpass filter value */
+
+ /* ReplayGain peak ampitude, 32 bit float -- why did I parse it as int
+ before?? Ah, yes, Lame seems to store it as int since some day in 2003;
+ I've only seen zeros anyway until now, bah! */
+ if
+ (
+ (fr->bsbuf[lame_offset] != 0)
+ || (fr->bsbuf[lame_offset+1] != 0)
+ || (fr->bsbuf[lame_offset+2] != 0)
+ || (fr->bsbuf[lame_offset+3] != 0)
+ )
+ {
+ debug("Wow! Is there _really_ a non-zero peak value? Now is it stored as float or int - how should I know?");
+ /* byte*peak_bytes = (byte*) &peak;
+ ... endianess ... just copy bytes to avoid floating point operation on unaligned memory?
+ peak_bytes[0] = ...
+ peak = *(float*) (fr->bsbuf+lame_offset); */
+ }
+ if(VERBOSE3) fprintf(stderr
+ , "Note: Info: peak = %f (I won't use this)\n", peak);
+ peak = 0; /* until better times arrived */
+ lame_offset += 4; /* 15 in */
+
+ /* ReplayGain values - lame only writes radio mode gain...
+ 16bit gain, 3 bits name, 3 bits originator, sign (1=-, 0=+),
+ dB value*10 in 9 bits (fixed point) ignore the setting if name or
+ originator == 000!
+ radio 0 0 1 0 1 1 1 0 0 1 1 1 1 1 0 1
+ audiophile 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 0 */
+ for(i =0; i < 2; ++i)
+ {
+ unsigned char gt = fr->bsbuf[lame_offset] >> 5;
+ unsigned char origin = (fr->bsbuf[lame_offset] >> 2) & 0x7;
+ float factor = (fr->bsbuf[lame_offset] & 0x2) ? -0.1f : 0.1f;
+ unsigned short gain = bit_read_short(fr->bsbuf, &lame_offset) & 0x1ff; /* 19 in (2 cycles) */
+ if(origin == 0 || gt < 1 || gt > 2) continue;
+
+ --gt;
+ replay_gain[gt] = factor * (float) gain;
+ /* Apply gain offset for automatic origin. */
+ if(origin == 3) replay_gain[gt] += gain_offset;
+ }
+ if(VERBOSE3)
+ {
+ fprintf(stderr, "Note: Info: Radio Gain = %03.1fdB\n"
+ , replay_gain[0]);
+ fprintf(stderr, "Note: Info: Audiophile Gain = %03.1fdB\n"
+ , replay_gain[1]);
+ }
+ for(i=0; i < 2; ++i)
+ {
+ if(fr->rva.level[i] <= 0)
+ {
+ fr->rva.peak[i] = 0; /* TODO: use parsed peak? */
+ fr->rva.gain[i] = replay_gain[i];
+ fr->rva.level[i] = 0;
+ }
+ }
+
+ lame_offset += 1; /* 20 in, skipping encoding flags byte */
+
+ /* ABR rate */
+ if(fr->vbr == MPG123_ABR)
+ {
+ fr->abr_rate = fr->bsbuf[lame_offset];
+ if(VERBOSE3) fprintf(stderr, "Note: Info: ABR rate = %u\n"
+ , fr->abr_rate);
+ }
+ lame_offset += 1; /* 21 in */
+
+ /* Encoder delay and padding, two 12 bit values
+ ... lame does write them from int. */
+ pad_in = ( (((int) fr->bsbuf[lame_offset]) << 4)
+ | (((int) fr->bsbuf[lame_offset+1]) >> 4) );
+ pad_out = ( (((int) fr->bsbuf[lame_offset+1]) << 8)
+ | ((int) fr->bsbuf[lame_offset+2]) ) & 0xfff;
+ lame_offset += 3; /* 24 in */
+ if(VERBOSE3) fprintf(stderr, "Note: Encoder delay = %i; padding = %i\n"
+ , (int)pad_in, (int)pad_out);
+ /* Store even if libmpg123 does not do gapless decoding itself. */
+ fr->enc_delay = (int)pad_in;
+ fr->enc_padding = (int)pad_out;
+ #ifdef GAPLESS
+ if(fr->p.flags & MPG123_GAPLESS)
+ frame_gapless_init(fr, fr->track_frames, pad_in, pad_out);
+ #endif
+ /* final: 24 B LAME data */
+ }
+
+check_lame_tag_yes:
+ /* switch buffer back ... */
+ fr->bsbuf = fr->bsspace[fr->bsnum]+512;
+ fr->bsnum = (fr->bsnum + 1) & 1;
+ return 1;
+check_lame_tag_no:
+ return 0;
+}
+
+/* Just tell if the header is some mono. */
+static int header_mono(unsigned long newhead)
+{
+ return HDR_CHANNEL_VAL(newhead) == MPG_MD_MONO ? TRUE : FALSE;
+}
+
+/* true if the two headers will work with the same decoding routines */
+static int head_compatible(unsigned long fred, unsigned long bret)
+{
+ return ( (fred & HDR_CMPMASK) == (bret & HDR_CMPMASK)
+ && header_mono(fred) == header_mono(bret) );
+}
+
+static void halfspeed_prepare(mpg123_handle *fr)
+{
+ /* save for repetition */
+ if(fr->p.halfspeed && fr->lay == 3)
+ {
+ debug("halfspeed - reusing old bsbuf ");
+ memcpy (fr->ssave, fr->bsbuf, fr->ssize);
+ }
+}
+
+/* If this returns 1, the next frame is the repetition. */
+static int halfspeed_do(mpg123_handle *fr)
+{
+ /* Speed-down hack: Play it again, Sam (the frame, I mean). */
+ if (fr->p.halfspeed)
+ {
+ if(fr->halfphase) /* repeat last frame */
+ {
+ debug("repeat!");
+ fr->to_decode = fr->to_ignore = TRUE;
+ --fr->halfphase;
+ set_pointer(fr, 0, 0);
+ if(fr->lay == 3) memcpy (fr->bsbuf, fr->ssave, fr->ssize);
+ if(fr->error_protection) fr->crc = getbits(fr, 16); /* skip crc */
+ return 1;
+ }
+ else
+ {
+ fr->halfphase = fr->p.halfspeed - 1;
+ }
+ }
+ return 0;
+}
+
+/*
+ Temporary macro until we got this worked out.
+ Idea is to filter out special return values that shall trigger direct jumps to end / resync / read again.
+ Particularily, the generic ret==PARSE_BAD==0 and ret==PARSE_GOOD==1 are not affected.
+*/
+#define JUMP_CONCLUSION(ret) \
+{ \
+if(ret < 0){ debug1("%s", ret == MPG123_NEED_MORE ? "need more" : "read error"); goto read_frame_bad; } \
+else if(ret == PARSE_AGAIN) goto read_again; \
+else if(ret == PARSE_RESYNC) goto init_resync; \
+else if(ret == PARSE_END){ ret=0; goto read_frame_bad; } \
+}
+
+/*
+ That's a big one: read the next frame. 1 is success, <= 0 is some error
+ Special error READER_MORE means: Please feed more data and try again.
+*/
+int read_frame(mpg123_handle *fr)
+{
+ /* TODO: rework this thing */
+ int freeformat_count = 0;
+ unsigned long newhead;
+ off_t framepos;
+ int ret;
+ /* stuff that needs resetting if complete frame reading fails */
+ int oldsize = fr->framesize;
+ int oldphase = fr->halfphase;
+
+ /* The counter for the search-first-header loop.
+ It is persistent outside the loop to prevent seemingly endless loops
+ when repeatedly headers are found that do not have valid followup headers. */
+ long headcount = 0;
+
+ fr->fsizeold=fr->framesize; /* for Layer3 */
+
+ if(halfspeed_do(fr) == 1) return 1;
+
+ /* From now on, old frame data is tainted by parsing attempts. */
+ fr->to_decode = fr->to_ignore = FALSE;
+
+ if( fr->p.flags & MPG123_NO_FRANKENSTEIN &&
+ ( (fr->track_frames > 0 && fr->num >= fr->track_frames-1)
+#ifdef GAPLESS
+ || (fr->gapless_frames > 0 && fr->num >= fr->gapless_frames-1)
+#endif
+ ) )
+ {
+ mdebug( "stopping parsing at %"OFF_P
+ " frames as indicated fixed track length"
+ , (off_p)fr->num+1 );
+ return 0;
+ }
+
+read_again:
+ /* In case we are looping to find a valid frame, discard any buffered data before the current position.
+ This is essential to prevent endless looping, always going back to the beginning when feeder buffer is exhausted. */
+ if(fr->rd->forget != NULL) fr->rd->forget(fr);
+
+ debug2("trying to get frame %"OFF_P" at %"OFF_P, (off_p)fr->num+1, (off_p)fr->rd->tell(fr));
+ if((ret = fr->rd->head_read(fr,&newhead)) <= 0){ debug1("need more? (%i)", ret); goto read_frame_bad;}
+
+init_resync:
+
+#ifdef SKIP_JUNK
+ if(!fr->firsthead && !head_check(newhead))
+ {
+ ret = skip_junk(fr, &newhead, &headcount);
+ JUMP_CONCLUSION(ret);
+ }
+#endif
+
+ ret = head_check(newhead);
+ if(ret) ret = decode_header(fr, newhead, &freeformat_count);
+
+ JUMP_CONCLUSION(ret); /* That only continues for ret == PARSE_BAD or PARSE_GOOD. */
+ if(ret == PARSE_BAD)
+ { /* Header was not good. */
+ ret = wetwork(fr, &newhead); /* Messy stuff, handle junk, resync ... */
+ JUMP_CONCLUSION(ret);
+ /* Normally, we jumped already. If for some reason everything's fine to continue, do continue. */
+ if(ret != PARSE_GOOD) goto read_frame_bad;
+ }
+
+ if(!fr->firsthead)
+ {
+ ret = fr->p.flags & MPG123_NO_READAHEAD
+ ? PARSE_GOOD
+ : do_readahead(fr, newhead);
+ /* readahead can fail mit NEED_MORE, in which case we must also make the just read header available again for next go */
+ if(ret < 0) fr->rd->back_bytes(fr, 4);
+ JUMP_CONCLUSION(ret);
+ }
+
+ /* Now we should have our valid header and proceed to reading the frame. */
+
+ if(fr->p.flags & MPG123_NO_FRANKENSTEIN)
+ {
+ if(fr->firsthead && !head_compatible(fr->firsthead, newhead))
+ {
+ mdebug( "stopping before reading frame %"OFF_P
+ " as its header indicates Frankenstein coming for you", (off_p)fr->num );
+ return 0;
+ }
+ }
+
+ /* if filepos is invalid, so is framepos */
+ framepos = fr->rd->tell(fr) - 4;
+ /* flip/init buffer for Layer 3 */
+ {
+ unsigned char *newbuf = fr->bsspace[fr->bsnum]+512;
+ /* read main data into memory */
+ debug2("read frame body of %i at %"OFF_P, fr->framesize, framepos+4);
+ if((ret=fr->rd->read_frame_body(fr,newbuf,fr->framesize))<0)
+ {
+ /* if failed: flip back */
+ debug1("%s", ret == MPG123_NEED_MORE ? "need more" : "read error");
+ goto read_frame_bad;
+ }
+ fr->bsbufold = fr->bsbuf;
+ fr->bsbuf = newbuf;
+ }
+ fr->bsnum = (fr->bsnum + 1) & 1;
+
+ if(!fr->firsthead)
+ {
+ fr->firsthead = newhead; /* _now_ it's time to store it... the first real header */
+ /* This is the first header of our current stream segment.
+ It is only the actual first header of the whole stream when fr->num is still below zero!
+ Think of resyncs where firsthead has been reset for format flexibility. */
+ if(fr->num < 0)
+ {
+ fr->audio_start = framepos;
+ /* Only check for LAME tag at beginning of whole stream
+ ... when there indeed is one in between, it's the user's problem. */
+ if(fr->lay == 3 && check_lame_tag(fr) == 1)
+ { /* ...in practice, Xing/LAME tags are layer 3 only. */
+ if(fr->rd->forget != NULL) fr->rd->forget(fr);
+
+ fr->oldhead = 0;
+ goto read_again;
+ }
+ /* now adjust volume */
+ do_rva(fr);
+ }
+
+ debug2("fr->firsthead: %08lx, audio_start: %li", fr->firsthead, (long int)fr->audio_start);
+ }
+
+ set_pointer(fr, 0, 0);
+
+ /* Question: How bad does the floating point value get with repeated recomputation?
+ Also, considering that we can play the file or parts of many times. */
+ if(++fr->mean_frames != 0)
+ {
+ fr->mean_framesize = ((fr->mean_frames-1)*fr->mean_framesize+compute_bpf(fr)) / fr->mean_frames ;
+ }
+ ++fr->num; /* 0 for first frame! */
+ debug4("Frame %"OFF_P" %08lx %i, next filepos=%"OFF_P,
+ (off_p)fr->num, newhead, fr->framesize, (off_p)fr->rd->tell(fr));
+ if(!(fr->state_flags & FRAME_FRANKENSTEIN) && (
+ (fr->track_frames > 0 && fr->num >= fr->track_frames)
+#ifdef GAPLESS
+ || (fr->gapless_frames > 0 && fr->num >= fr->gapless_frames)
+#endif
+ ))
+ {
+ fr->state_flags |= FRAME_FRANKENSTEIN;
+ if(NOQUIET) fprintf(stderr, "\nWarning: Encountered more data after announced end of track (frame %"OFF_P"/%"OFF_P"). Frankenstein!\n", (off_p)fr->num,
+#ifdef GAPLESS
+ fr->gapless_frames > 0 ? (off_p)fr->gapless_frames :
+#endif
+ (off_p)fr->track_frames);
+ }
+
+ halfspeed_prepare(fr);
+
+ /* index the position */
+ fr->input_offset = framepos;
+#ifdef FRAME_INDEX
+ /* Keep track of true frame positions in our frame index.
+ but only do so when we are sure that the frame number is accurate... */
+ if((fr->state_flags & FRAME_ACCURATE) && FI_NEXT(fr->index, fr->num))
+ fi_add(&fr->index, framepos);
+#endif
+
+ if(fr->silent_resync > 0) --fr->silent_resync;
+
+ if(fr->rd->forget != NULL) fr->rd->forget(fr);
+
+ fr->to_decode = fr->to_ignore = TRUE;
+ if(fr->error_protection) fr->crc = getbits(fr, 16); /* skip crc */
+
+ /*
+ Let's check for header change after deciding that the new one is good
+ and actually having read a frame.
+
+ header_change > 1: decoder structure has to be updated
+ Preserve header_change value from previous runs if it is serious.
+ If we still have a big change pending, it should be dealt with outside,
+ fr->header_change set to zero afterwards.
+ */
+ if(fr->header_change < 2)
+ {
+ fr->header_change = 2; /* output format change is possible... */
+ if(fr->oldhead) /* check a following header for change */
+ {
+ if(fr->oldhead == newhead) fr->header_change = 0;
+ else
+ /* Headers that match in this test behave the same for the outside world.
+ namely: same decoding routines, same amount of decoded data. */
+ if(head_compatible(fr->oldhead, newhead))
+ fr->header_change = 1;
+ else
+ {
+ fr->state_flags |= FRAME_FRANKENSTEIN;
+ if(NOQUIET)
+ fprintf(stderr, "\nWarning: Big change (MPEG version, layer, rate). Frankenstein stream?\n");
+ }
+ }
+ else if(fr->firsthead && !head_compatible(fr->firsthead, newhead))
+ {
+ fr->state_flags |= FRAME_FRANKENSTEIN;
+ if(NOQUIET)
+ fprintf(stderr, "\nWarning: Big change from first (MPEG version, layer, rate). Frankenstein stream?\n");
+ }
+ }
+
+ fr->oldhead = newhead;
+
+ return 1;
+read_frame_bad:
+ /* Also if we searched for valid data in vein, we can forget skipped data.
+ Otherwise, the feeder would hold every dead old byte in memory until the first valid frame! */
+ if(fr->rd->forget != NULL) fr->rd->forget(fr);
+
+ fr->silent_resync = 0;
+ if(fr->err == MPG123_OK) fr->err = MPG123_ERR_READER;
+ fr->framesize = oldsize;
+ fr->halfphase = oldphase;
+ /* That return code might be inherited from some feeder action, or reader error. */
+ return ret;
+}
+
+
+/*
+ * read ahead and find the next MPEG header, to guess framesize
+ * return value: success code
+ * PARSE_GOOD: found a valid frame size (stored in the handle).
+ * <0: error codes, possibly from feeder buffer (NEED_MORE)
+ * PARSE_BAD: cannot get the framesize for some reason and shall silentry try the next possible header (if this is no free format stream after all...)
+ */
+static int guess_freeformat_framesize(mpg123_handle *fr, unsigned long oldhead)
+{
+ long i;
+ int ret;
+ unsigned long head;
+ if(!(fr->rdat.flags & (READER_SEEKABLE|READER_BUFFERED)))
+ {
+ if(NOQUIET) error("Cannot look for freeformat frame size with non-seekable and non-buffered stream!");
+
+ return PARSE_BAD;
+ }
+ if((ret=fr->rd->head_read(fr,&head))<=0)
+ return ret;
+
+ /* We are already 4 bytes into it */
+ for(i=4;i<MAXFRAMESIZE+4;i++)
+ {
+ if((ret=fr->rd->head_shift(fr,&head))<=0) return ret;
+
+ /* No head_check needed, the mask contains all relevant bits. */
+ if((head & HDR_SAMEMASK) == (oldhead & HDR_SAMEMASK))
+ {
+ fr->rd->back_bytes(fr,i+1);
+ fr->framesize = i-3;
+ return PARSE_GOOD; /* Success! */
+ }
+ }
+ fr->rd->back_bytes(fr,i);
+ return PARSE_BAD;
+}
+
+
+/*
+ * decode a header and write the information
+ * into the frame structure
+ * Return values are compatible with those of read_frame, namely:
+ * 1: success
+ * 0: no valid header
+ * <0: some error
+ * You are required to do a head_check() before calling!
+ */
+static int decode_header(mpg123_handle *fr,unsigned long newhead, int *freeformat_count)
+{
+#ifdef DEBUG /* Do not waste cycles checking the header twice all the time. */
+ if(!head_check(newhead))
+ {
+ error1("trying to decode obviously invalid header 0x%08lx", newhead);
+ }
+#endif
+ /* For some reason, the layer and sampling freq settings used to be wrapped
+ in a weird conditional including MPG123_NO_RESYNC. What was I thinking?
+ This information has to be consistent. */
+ fr->lay = 4 - HDR_LAYER_VAL(newhead);
+
+ if(HDR_VERSION_VAL(newhead) & 0x2)
+ {
+ fr->lsf = (HDR_VERSION_VAL(newhead) & 0x1) ? 0 : 1;
+ fr->mpeg25 = 0;
+ fr->sampling_frequency = HDR_SAMPLERATE_VAL(newhead) + (fr->lsf*3);
+ }
+ else
+ {
+ fr->lsf = 1;
+ fr->mpeg25 = 1;
+ fr->sampling_frequency = 6 + HDR_SAMPLERATE_VAL(newhead);
+ }
+
+ #ifdef DEBUG
+ /* seen a file where this varies (old lame tag without crc, track with crc) */
+ if((HDR_CRC_VAL(newhead)^0x1) != fr->error_protection) debug("changed crc bit!");
+ #endif
+ fr->error_protection = HDR_CRC_VAL(newhead)^0x1;
+ fr->bitrate_index = HDR_BITRATE_VAL(newhead);
+ fr->padding = HDR_PADDING_VAL(newhead);
+ fr->extension = HDR_PRIVATE_VAL(newhead);
+ fr->mode = HDR_CHANNEL_VAL(newhead);
+ fr->mode_ext = HDR_CHANEX_VAL(newhead);
+ fr->copyright = HDR_COPYRIGHT_VAL(newhead);
+ fr->original = HDR_ORIGINAL_VAL(newhead);
+ fr->emphasis = HDR_EMPHASIS_VAL(newhead);
+ fr->freeformat = !(newhead & HDR_BITRATE);
+
+ fr->stereo = (fr->mode == MPG_MD_MONO) ? 1 : 2;
+
+ /* we can't use tabsel_123 for freeformat, so trying to guess framesize... */
+ if(fr->freeformat)
+ {
+ /* when we first encounter the frame with freeformat, guess framesize */
+ if(fr->freeformat_framesize < 0)
+ {
+ int ret;
+ if(fr->p.flags & MPG123_NO_READAHEAD)
+ {
+ if(VERBOSE3)
+ error("Got no free-format frame size and am not allowed to read ahead.");
+ return PARSE_BAD;
+ }
+ *freeformat_count += 1;
+ if(*freeformat_count > 5)
+ {
+ if(VERBOSE3) error("You fooled me too often. Refusing to guess free format frame size _again_.");
+ return PARSE_BAD;
+ }
+ ret = guess_freeformat_framesize(fr, newhead);
+ if(ret == PARSE_GOOD)
+ {
+ fr->freeformat_framesize = fr->framesize - fr->padding;
+ if(VERBOSE2)
+ fprintf(stderr, "Note: free format frame size %li\n", fr->freeformat_framesize);
+ }
+ else
+ {
+ if(ret == MPG123_NEED_MORE)
+ debug("Need more data to guess free format frame size.");
+ else if(VERBOSE3)
+ error("Encountered free format header, but failed to guess frame size.");
+
+ return ret;
+ }
+ }
+ /* freeformat should be CBR, so the same framesize can be used at the 2nd reading or later */
+ else
+ {
+ fr->framesize = fr->freeformat_framesize + fr->padding;
+ }
+ }
+
+ switch(fr->lay)
+ {
+#ifndef NO_LAYER1
+ case 1:
+ fr->spf = 384;
+ fr->do_layer = do_layer1;
+ if(!fr->freeformat)
+ {
+ long fs = (long) tabsel_123[fr->lsf][0][fr->bitrate_index] * 12000;
+ fs /= freqs[fr->sampling_frequency];
+ fs = ((fs+fr->padding)<<2)-4;
+ fr->framesize = (int)fs;
+ }
+ break;
+#endif
+#ifndef NO_LAYER2
+ case 2:
+ fr->spf = 1152;
+ fr->do_layer = do_layer2;
+ if(!fr->freeformat)
+ {
+ debug2("bitrate index: %i (%i)", fr->bitrate_index, tabsel_123[fr->lsf][1][fr->bitrate_index] );
+ long fs = (long) tabsel_123[fr->lsf][1][fr->bitrate_index] * 144000;
+ fs /= freqs[fr->sampling_frequency];
+ fs += fr->padding - 4;
+ fr->framesize = (int)fs;
+ }
+ break;
+#endif
+#ifndef NO_LAYER3
+ case 3:
+ fr->spf = fr->lsf ? 576 : 1152; /* MPEG 2.5 implies LSF.*/
+ fr->do_layer = do_layer3;
+ if(fr->lsf)
+ fr->ssize = (fr->stereo == 1) ? 9 : 17;
+ else
+ fr->ssize = (fr->stereo == 1) ? 17 : 32;
+
+ if(fr->error_protection)
+ fr->ssize += 2;
+
+ if(!fr->freeformat)
+ {
+ long fs = (long) tabsel_123[fr->lsf][2][fr->bitrate_index] * 144000;
+ fs /= freqs[fr->sampling_frequency]<<(fr->lsf);
+ fs += fr->padding - 4;
+ fr->framesize = fs;
+ }
+ if(fr->framesize < fr->ssize)
+ {
+ if(NOQUIET)
+ error2( "Frame smaller than mandatory side info (%i < %i)!"
+ , fr->framesize, fr->ssize );
+ return PARSE_BAD;
+ }
+ break;
+#endif
+ default:
+ if(NOQUIET) error1("Layer type %i not supported in this build!", fr->lay);
+
+ return PARSE_BAD;
+ }
+ if (fr->framesize > MAXFRAMESIZE)
+ {
+ if(NOQUIET) error1("Frame size too big: %d", fr->framesize+4-fr->padding);
+
+ return PARSE_BAD;
+ }
+ return PARSE_GOOD;
+}
+
+/* Prepare for bit reading. Two stages:
+ 0. Layers 1 and 2, side info for layer 3
+ 1. Second call for possible bit reservoir for layer 3 part 2,3.
+ This overwrites side info needed for stage 0.
+
+ Continuing to read bits after layer 3 side info shall fail unless
+ set_pointer() is called to refresh things.
+*/
+void set_pointer(mpg123_handle *fr, int part2, long backstep)
+{
+ fr->bitindex = 0;
+ if(fr->lay == 3)
+ {
+ if(part2)
+ {
+ fr->wordpointer = fr->bsbuf + fr->ssize - backstep;
+ if(backstep)
+ memcpy( fr->wordpointer, fr->bsbufold+fr->fsizeold-backstep
+ , backstep );
+ fr->bits_avail = (long)(fr->framesize - fr->ssize + backstep)*8;
+ }
+ else
+ {
+ fr->wordpointer = fr->bsbuf;
+ fr->bits_avail = fr->ssize*8;
+ }
+ }
+ else
+ {
+ fr->wordpointer = fr->bsbuf;
+ fr->bits_avail = fr->framesize*8;
+ }
+}
+
+/********************************/
+
+double compute_bpf(mpg123_handle *fr)
+{
+ return (fr->framesize > 0) ? fr->framesize + 4.0 : 1.0;
+}
+
+int attribute_align_arg mpg123_spf(mpg123_handle *mh)
+{
+ if(mh == NULL) return MPG123_ERR;
+
+ return mh->firsthead ? mh->spf : MPG123_ERR;
+}
+
+double attribute_align_arg mpg123_tpf(mpg123_handle *fr)
+{
+ static int bs[4] = { 0,384,1152,1152 };
+ double tpf;
+ if(fr == NULL || !fr->firsthead) return MPG123_ERR;
+
+ tpf = (double) bs[fr->lay];
+ tpf /= freqs[fr->sampling_frequency] << (fr->lsf);
+ return tpf;
+}
+
+int attribute_align_arg mpg123_position(mpg123_handle *fr, off_t no, off_t buffsize,
+ off_t *current_frame, off_t *frames_left,
+ double *current_seconds, double *seconds_left)
+{
+ double tpf;
+ double dt = 0.0;
+ off_t cur, left;
+ double curs, lefts;
+
+ if(!fr || !fr->rd) return MPG123_ERR;
+
+ no += fr->num; /* no starts out as offset */
+ cur = no;
+ tpf = mpg123_tpf(fr);
+ if(buffsize > 0 && fr->af.rate > 0 && fr->af.channels > 0)
+ {
+ dt = (double) buffsize / fr->af.rate / fr->af.channels;
+ if(fr->af.encoding & MPG123_ENC_16) dt *= 0.5;
+ }
+
+ left = 0;
+
+ if((fr->track_frames != 0) && (fr->track_frames >= fr->num)) left = no < fr->track_frames ? fr->track_frames - no : 0;
+ else
+ if(fr->rdat.filelen >= 0)
+ {
+ double bpf;
+ off_t t = fr->rd->tell(fr);
+ bpf = fr->mean_framesize ? fr->mean_framesize : compute_bpf(fr);
+ left = (off_t)((double)(fr->rdat.filelen-t)/bpf);
+ /* no can be different for prophetic purposes, file pointer is always associated with fr->num! */
+ if(fr->num != no)
+ {
+ if(fr->num > no) left += fr->num - no;
+ else
+ {
+ if(left >= (no - fr->num)) left -= no - fr->num;
+ else left = 0; /* uh, oh! */
+ }
+ }
+ /* I totally don't understand why we should re-estimate the given correct(?) value */
+ /* fr->num = (unsigned long)((double)t/bpf); */
+ }
+
+ /* beginning with 0 or 1?*/
+ curs = (double) no*tpf-dt;
+ lefts = (double)left*tpf+dt;
+#if 0
+ curs = curs < 0 ? 0.0 : curs;
+#endif
+ if(left < 0 || lefts < 0)
+ { /* That is the case for non-seekable streams. */
+ left = 0;
+ lefts = 0.0;
+ }
+ if(current_frame != NULL) *current_frame = cur;
+ if(frames_left != NULL) *frames_left = left;
+ if(current_seconds != NULL) *current_seconds = curs;
+ if(seconds_left != NULL) *seconds_left = lefts;
+ return MPG123_OK;
+}
+
+int get_songlen(mpg123_handle *fr,int no)
+{
+ double tpf;
+
+ if(!fr)
+ return 0;
+
+ if(no < 0) {
+ if(!fr->rd || fr->rdat.filelen < 0)
+ return 0;
+ no = (int) ((double) fr->rdat.filelen / compute_bpf(fr));
+ }
+
+ tpf = mpg123_tpf(fr);
+ return (int) (no*tpf);
+}
+
+/* first attempt of read ahead check to find the real first header; cannot believe what junk is out there! */
+static int do_readahead(mpg123_handle *fr, unsigned long newhead)
+{
+ unsigned long nexthead = 0;
+ int hd = 0;
+ off_t start, oret;
+ int ret;
+
+ if( ! (!fr->firsthead && fr->rdat.flags & (READER_SEEKABLE|READER_BUFFERED)) )
+ return PARSE_GOOD;
+
+ start = fr->rd->tell(fr);
+
+ debug2("doing ahead check with BPF %d at %"OFF_P, fr->framesize+4, (off_p)start);
+ /* step framesize bytes forward and read next possible header*/
+ if((oret=fr->rd->skip_bytes(fr, fr->framesize))<0)
+ {
+ if(oret==READER_ERROR && NOQUIET) error("cannot seek!");
+
+ return oret == MPG123_NEED_MORE ? PARSE_MORE : PARSE_ERR;
+ }
+
+ /* Read header, seek back. */
+ hd = fr->rd->head_read(fr,&nexthead);
+ if( fr->rd->back_bytes(fr, fr->rd->tell(fr)-start) < 0 )
+ {
+ if(NOQUIET) error("Cannot seek back!");
+
+ return PARSE_ERR;
+ }
+ if(hd == MPG123_NEED_MORE) return PARSE_MORE;
+
+ debug1("After fetching next header, at %"OFF_P, (off_p)fr->rd->tell(fr));
+ if(!hd)
+ {
+ if(NOQUIET) warning("Cannot read next header, a one-frame stream? Duh...");
+ return PARSE_END;
+ }
+
+ debug2("does next header 0x%08lx match first 0x%08lx?", nexthead, newhead);
+ if(!head_check(nexthead) || !head_compatible(newhead, nexthead))
+ {
+ debug("No, the header was not valid, start from beginning...");
+ fr->oldhead = 0; /* start over */
+ /* try next byte for valid header */
+ if((ret=fr->rd->back_bytes(fr, 3))<0)
+ {
+ if(NOQUIET) error("Cannot seek 3 bytes back!");
+
+ return PARSE_ERR;
+ }
+ return PARSE_AGAIN;
+ }
+ else return PARSE_GOOD;
+}
+
+static int handle_id3v2(mpg123_handle *fr, unsigned long newhead)
+{
+ int ret;
+ fr->oldhead = 0; /* Think about that. Used to be present only for skipping of junk, not resync-style wetwork. */
+ ret = parse_new_id3(fr, newhead);
+ if (ret < 0) return ret;
+#ifndef NO_ID3V2
+ else if(ret > 0){ debug("got ID3v2"); fr->metaflags |= MPG123_NEW_ID3|MPG123_ID3; }
+ else debug("no useful ID3v2");
+#endif
+ return PARSE_AGAIN;
+}
+
+static int handle_apetag(mpg123_handle *fr, unsigned long newhead)
+{
+ unsigned char apebuf[28];
+ unsigned long val;
+ int i, ret;
+ /* How many bytes to backpedal to get back to just after the first byte of */
+ /* the supposed header. */
+ int back_bytes = 3;
+ fr->oldhead = 0;
+
+ debug1("trying to read remaining APE header at %"OFF_P, (off_p)fr->rd->tell(fr));
+ /* Apetag headers are 32 bytes, newhead contains 4, read the rest */
+ if((ret=fr->rd->fullread(fr,apebuf,28)) < 0)
+ return ret;
+ back_bytes += ret;
+ if(ret < 28)
+ goto apetag_bad;
+
+ debug1("trying to parse APE header at %"OFF_P, (off_p)fr->rd->tell(fr));
+ /* Apetags start with "APETAGEX", "APET" is already tested. */
+ if(strncmp((char *)apebuf,"AGEX",4) != 0)
+ goto apetag_bad;
+
+ /* Version must be 2.000 / 2000 */
+ val = ((unsigned long)apebuf[7]<<24)
+ | ((unsigned long)apebuf[6]<<16)
+ | ((unsigned long)apebuf[5]<<8)
+ | apebuf[4];
+ if(val != 2000)
+ goto apetag_bad;
+
+ /* Last 8 bytes must be 0 */
+ for(i=20; i<28; i++)
+ if(apebuf[i])
+ goto apetag_bad;
+
+ /* Looks good, skip the rest. */
+ val = ((unsigned long)apebuf[11]<<24)
+ | ((unsigned long)apebuf[10]<<16)
+ | ((unsigned long)apebuf[9]<<8)
+ | apebuf[8];
+ debug2( "skipping %lu bytes of APE data at %"OFF_P
+ , val, (off_p)fr->rd->tell(fr) );
+ /* If encountering EOF here, things are just at an end. */
+ if((ret=fr->rd->skip_bytes(fr,val)) < 0)
+ return ret;
+
+ return PARSE_AGAIN;
+
+apetag_bad:
+ debug("no proper APE tag found, seeking back");
+ if(fr->rd->back_bytes(fr,back_bytes) < 0 && NOQUIET)
+ error1("Cannot seek %d bytes back!", back_bytes);
+
+ return PARSE_AGAIN; /* Give the resync code a chance to fix things */
+}
+
+/* Advance a byte in stream to get next possible header and forget
+ buffered data if possible (for feed reader). */
+#define FORGET_INTERVAL 1024 /* Used by callers to set forget flag each <n> bytes. */
+static int forget_head_shift(mpg123_handle *fr, unsigned long *newheadp, int forget)
+{
+ int ret;
+ if((ret=fr->rd->head_shift(fr,newheadp))<=0) return ret;
+ /* Try to forget buffered data as early as possible to speed up parsing where
+ new data needs to be added for resync (and things would be re-parsed again
+ and again because of the start from beginning after hitting end). */
+ if(forget && fr->rd->forget != NULL)
+ {
+ /* Ensure that the last 4 bytes stay in buffers for reading the header
+ anew. */
+ if(!fr->rd->back_bytes(fr, 4))
+ {
+ fr->rd->forget(fr);
+ fr->rd->back_bytes(fr, -4);
+ }
+ }
+ return ret; /* No surprise here, error already triggered early return. */
+}
+
+/* watch out for junk/tags on beginning of stream by invalid header */
+static int skip_junk(mpg123_handle *fr, unsigned long *newheadp, long *headcount)
+{
+ int ret;
+ int freeformat_count = 0;
+ long limit = 65536;
+ unsigned long newhead = *newheadp;
+ unsigned int forgetcount = 0;
+ /* check for id3v2; first three bytes (of 4) are "ID3" */
+ if((newhead & (unsigned long) 0xffffff00) == (unsigned long) 0x49443300)
+ {
+ return handle_id3v2(fr, newhead);
+ }
+ else if(VERBOSE2 && fr->silent_resync == 0) fprintf(stderr,"Note: Junk at the beginning (0x%08lx)\n",newhead);
+
+ /* I even saw RIFF headers at the beginning of MPEG streams ;( */
+ if(newhead == ('R'<<24)+('I'<<16)+('F'<<8)+'F')
+ {
+ if(VERBOSE2 && fr->silent_resync == 0) fprintf(stderr, "Note: Looks like a RIFF header.\n");
+
+ if((ret=fr->rd->head_read(fr,&newhead))<=0) return ret;
+
+ while(newhead != ('d'<<24)+('a'<<16)+('t'<<8)+'a')
+ {
+ if(++forgetcount > FORGET_INTERVAL) forgetcount = 0;
+ if((ret=forget_head_shift(fr,&newhead,!forgetcount))<=0) return ret;
+ }
+ if((ret=fr->rd->head_read(fr,&newhead))<=0) return ret;
+
+ if(VERBOSE2 && fr->silent_resync == 0) fprintf(stderr,"Note: Skipped RIFF header!\n");
+
+ fr->oldhead = 0;
+ *newheadp = newhead;
+ return PARSE_AGAIN;
+ }
+
+ /*
+ Unhandled junk... just continue search for a header, stepping in single bytes through next 64K.
+ This is rather identical to the resync loop.
+ */
+ debug("searching for header...");
+ *newheadp = 0; /* Invalidate the external value. */
+ ret = 0; /* We will check the value after the loop. */
+
+ /* We prepare for at least the 64K bytes as usual, unless
+ user explicitly wanted more (even infinity). Never less. */
+ if(fr->p.resync_limit < 0 || fr->p.resync_limit > limit)
+ limit = fr->p.resync_limit;
+
+ do
+ {
+ ++(*headcount);
+ if(limit >= 0 && *headcount >= limit) break;
+
+ if(++forgetcount > FORGET_INTERVAL) forgetcount = 0;
+ if((ret=forget_head_shift(fr, &newhead, !forgetcount))<=0) return ret;
+
+ if(head_check(newhead) && (ret=decode_header(fr, newhead, &freeformat_count))) break;
+ } while(1);
+ if(ret<0) return ret;
+
+ if(limit >= 0 && *headcount >= limit)
+ {
+ if(NOQUIET) error1("Giving up searching valid MPEG header after %li bytes of junk.", *headcount);
+ fr->err = MPG123_RESYNC_FAIL;
+ return PARSE_ERR;
+ }
+ else debug1("hopefully found one at %"OFF_P, (off_p)fr->rd->tell(fr));
+
+ /* If the new header ist good, it is already decoded. */
+ *newheadp = newhead;
+ return PARSE_GOOD;
+}
+
+/* The newhead is bad, so let's check if it is something special, otherwise just resync. */
+static int wetwork(mpg123_handle *fr, unsigned long *newheadp)
+{
+ int ret = PARSE_ERR;
+ unsigned long newhead = *newheadp;
+ *newheadp = 0;
+
+ /* Classic ID3 tags. Read, then start parsing again. */
+ if((newhead & 0xffffff00) == ('T'<<24)+('A'<<16)+('G'<<8))
+ {
+ fr->id3buf[0] = (unsigned char) ((newhead >> 24) & 0xff);
+ fr->id3buf[1] = (unsigned char) ((newhead >> 16) & 0xff);
+ fr->id3buf[2] = (unsigned char) ((newhead >> 8) & 0xff);
+ fr->id3buf[3] = (unsigned char) ( newhead & 0xff);
+
+ if((ret=fr->rd->fullread(fr,fr->id3buf+4,124)) < 0) return ret;
+
+ fr->metaflags |= MPG123_NEW_ID3|MPG123_ID3;
+ fr->rdat.flags |= READER_ID3TAG; /* that marks id3v1 */
+ if(VERBOSE3) fprintf(stderr,"Note: Skipped ID3v1 tag.\n");
+
+ return PARSE_AGAIN;
+ }
+ /* This is similar to initial junk skipping code... */
+ /* Check for id3v2; first three bytes (of 4) are "ID3" */
+ if((newhead & (unsigned long) 0xffffff00) == (unsigned long) 0x49443300)
+ {
+ return handle_id3v2(fr, newhead);
+ }
+ /* Check for an apetag header */
+ if(newhead == ('A'<<24)+('P'<<16)+('E'<<8)+'T')
+ {
+ return handle_apetag(fr, newhead);
+ }
+ else if(NOQUIET && fr->silent_resync == 0)
+ {
+ fprintf(stderr,"Note: Illegal Audio-MPEG-Header 0x%08lx at offset %"OFF_P".\n",
+ newhead, (off_p)fr->rd->tell(fr)-4);
+ }
+
+ /* Now we got something bad at hand, try to recover. */
+
+ if(NOQUIET && (newhead & 0xffffff00) == ('b'<<24)+('m'<<16)+('p'<<8)) fprintf(stderr,"Note: Could be a BMP album art.\n");
+
+ if( !(fr->p.flags & MPG123_NO_RESYNC) )
+ {
+ long try = 0;
+ long limit = fr->p.resync_limit;
+ unsigned int forgetcount = 0;
+
+ /* If a resync is needed the bitreservoir of previous frames is no longer valid */
+ fr->bitreservoir = 0;
+
+ if(NOQUIET && fr->silent_resync == 0) fprintf(stderr, "Note: Trying to resync...\n");
+
+ do /* ... shift the header with additional single bytes until be found something that could be a header. */
+ {
+ ++try;
+ if(limit >= 0 && try >= limit) break;
+
+ if(++forgetcount > FORGET_INTERVAL) forgetcount = 0;
+ if((ret=forget_head_shift(fr,&newhead,!forgetcount)) <= 0)
+ {
+ *newheadp = newhead;
+ if(NOQUIET) fprintf (stderr, "Note: Hit end of (available) data during resync.\n");
+
+ return ret ? ret : PARSE_END;
+ }
+ if(VERBOSE3) debug3("resync try %li at %"OFF_P", got newhead 0x%08lx", try, (off_p)fr->rd->tell(fr), newhead);
+ } while(!head_check(newhead));
+
+ *newheadp = newhead;
+ if(NOQUIET && fr->silent_resync == 0) fprintf (stderr, "Note: Skipped %li bytes in input.\n", try);
+
+ /* Now we either got something that could be a header, or we gave up. */
+ if(limit >= 0 && try >= limit)
+ {
+ if(NOQUIET)
+ error1("Giving up resync after %li bytes - your stream is not nice... (maybe increasing resync limit could help).", try);
+
+ fr->err = MPG123_RESYNC_FAIL;
+ return PARSE_ERR;
+ }
+ else
+ {
+ debug1("Found possibly valid header 0x%lx... unsetting oldhead to reinit stream.", newhead);
+ fr->oldhead = 0;
+ return PARSE_RESYNC;
+ }
+ }
+ else
+ {
+ if(NOQUIET) error("not attempting to resync...");
+
+ fr->err = MPG123_OUT_OF_SYNC;
+ return PARSE_ERR;
+ }
+ /* Control never goes here... we return before that. */
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/parse.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/parse.h
new file mode 100644
index 00000000..33eeccdc
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/parse.h
@@ -0,0 +1,25 @@
+/*
+ parse: spawned from common; clustering around stream/frame parsing
+
+ copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp & Thomas Orgis
+*/
+
+#ifndef MPG123_PARSE_H
+#define MPG123_PARSE_H
+
+#include "frame.h"
+
+int read_frame_init(mpg123_handle* fr);
+int frame_bitrate(mpg123_handle *fr);
+long frame_freq(mpg123_handle *fr);
+int read_frame_recover(mpg123_handle* fr); /* dead? */
+int read_frame(mpg123_handle *fr);
+void set_pointer(mpg123_handle *fr, int part2, long backstep);
+int position_info(mpg123_handle* fr, unsigned long no, long buffsize, unsigned long* frames_left, double* current_seconds, double* seconds_left);
+double compute_bpf(mpg123_handle *fr);
+long time_to_frame(mpg123_handle *fr, double seconds);
+int get_songlen(mpg123_handle *fr,int no);
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/reader.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/reader.h
new file mode 100644
index 00000000..52735c1c
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/reader.h
@@ -0,0 +1,140 @@
+/*
+ reader: reading input data
+
+ copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis (after code from Michael Hipp)
+*/
+
+#ifndef MPG123_READER_H
+#define MPG123_READER_H
+
+#include "config.h"
+#include "mpg123.h"
+
+#ifndef NO_FEEDER
+struct buffy
+{
+ unsigned char *data;
+ ssize_t size;
+ ssize_t realsize;
+ struct buffy *next;
+};
+
+
+struct bufferchain
+{
+ struct buffy* first; /* The beginning of the chain. */
+ struct buffy* last; /* The end... of the chain. */
+ ssize_t size; /* Aggregated size of all buffies. */
+ /* These positions are relative to buffer chain beginning. */
+ ssize_t pos; /* Position in whole chain. */
+ ssize_t firstpos; /* The point of return on non-forget() */
+ /* The "real" filepos is fileoff + pos. */
+ off_t fileoff; /* Beginning of chain is at this file offset. */
+ size_t bufblock; /* Default (minimal) size of buffers. */
+ size_t pool_size; /* Keep that many buffers in storage. */
+ size_t pool_fill; /* That many buffers are there. */
+ /* A pool of buffers to re-use, if activated. It's a linked list that is worked on from the front. */
+ struct buffy *pool;
+};
+
+/* Call this before any buffer chain use (even bc_init()). */
+void bc_prepare(struct bufferchain *, size_t pool_size, size_t bufblock);
+/* Free persistent data in the buffer chain, after bc_reset(). */
+void bc_cleanup(struct bufferchain *);
+/* Change pool size. This does not actually allocate/free anything on itself, just instructs later operations to free less / allocate more buffers. */
+void bc_poolsize(struct bufferchain *, size_t pool_size, size_t bufblock);
+/* Return available byte count in the buffer. */
+size_t bc_fill(struct bufferchain *bc);
+
+#endif
+
+struct reader_data
+{
+ off_t filelen; /* total file length or total buffer size */
+ off_t filepos; /* position in file or position in buffer chain */
+ int filept;
+ /* Custom opaque I/O handle from the client. */
+ void *iohandle;
+ int flags;
+ long timeout_sec;
+ ssize_t (*fdread) (mpg123_handle *, void *, size_t);
+ /* User can replace the read and lseek functions. The r_* are the stored replacement functions or NULL. */
+ ssize_t (*r_read) (int fd, void *buf, size_t count);
+ off_t (*r_lseek)(int fd, off_t offset, int whence);
+ /* These are custom I/O routines for opaque user handles.
+ They get picked if there's some iohandle set. */
+ ssize_t (*r_read_handle) (void *handle, void *buf, size_t count);
+ off_t (*r_lseek_handle)(void *handle, off_t offset, int whence);
+ /* An optional cleaner for the handle on closing the stream. */
+ void (*cleanup_handle)(void *handle);
+ /* These two pointers are the actual workers (default map to POSIX read/lseek). */
+ ssize_t (*read) (int fd, void *buf, size_t count);
+ off_t (*lseek)(int fd, off_t offset, int whence);
+ /* Buffered readers want that abstracted, set internally. */
+ ssize_t (*fullread)(mpg123_handle *, unsigned char *, ssize_t);
+#ifndef NO_FEEDER
+ struct bufferchain buffer; /* Not dynamically allocated, these few struct bytes aren't worth the trouble. */
+#endif
+};
+
+/* start to use off_t to properly do LFS in future ... used to be long */
+#ifdef __MORPHOS__
+#undef tell /* unistd.h defines it as lseek(x, 0L, 1) */
+#endif
+struct reader
+{
+ int (*init) (mpg123_handle *);
+ void (*close) (mpg123_handle *);
+ ssize_t (*fullread) (mpg123_handle *, unsigned char *, ssize_t);
+ int (*head_read) (mpg123_handle *, unsigned long *newhead); /* succ: TRUE, else <= 0 (FALSE or READER_MORE) */
+ int (*head_shift) (mpg123_handle *, unsigned long *head); /* succ: TRUE, else <= 0 (FALSE or READER_MORE) */
+ off_t (*skip_bytes) (mpg123_handle *, off_t len); /* succ: >=0, else error or READER_MORE */
+ int (*read_frame_body)(mpg123_handle *, unsigned char *, int size);
+ int (*back_bytes) (mpg123_handle *, off_t bytes);
+ int (*seek_frame) (mpg123_handle *, off_t num);
+ off_t (*tell) (mpg123_handle *);
+ void (*rewind) (mpg123_handle *);
+ void (*forget) (mpg123_handle *);
+};
+
+/* Open a file by path or use an opened file descriptor. */
+int open_stream(mpg123_handle *, const char *path, int fd);
+/* Open an external handle. */
+int open_stream_handle(mpg123_handle *, void *iohandle);
+
+/* feed based operation has some specials */
+int open_feed(mpg123_handle *);
+/* externally called function, returns 0 on success, -1 on error */
+int feed_more(mpg123_handle *fr, const unsigned char *in, long count);
+void feed_forget(mpg123_handle *fr); /* forget the data that has been read (free some buffers) */
+off_t feed_set_pos(mpg123_handle *fr, off_t pos); /* Set position (inside available data if possible), return wanted byte offset of next feed. */
+
+void open_bad(mpg123_handle *);
+
+#define READER_FD_OPENED 0x1
+#define READER_ID3TAG 0x2
+#define READER_SEEKABLE 0x4
+#define READER_BUFFERED 0x8
+#define READER_NONBLOCK 0x20
+#define READER_HANDLEIO 0x40
+
+#define READER_STREAM 0
+#define READER_ICY_STREAM 1
+#define READER_FEED 2
+/* These two add a little buffering to enable small seeks for peek ahead. */
+#define READER_BUF_STREAM 3
+#define READER_BUF_ICY_STREAM 4
+
+#ifdef READ_SYSTEM
+#define READER_SYSTEM 5
+#define READERS 6
+#else
+#define READERS 5
+#endif
+
+#define READER_ERROR MPG123_ERR
+#define READER_MORE MPG123_NEED_MORE
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/readers.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/readers.c
new file mode 100644
index 00000000..fbaa4d9e
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/readers.c
@@ -0,0 +1,1266 @@
+/* TODO: Check all read calls (in loops, especially!) for return value 0 (EOF)! */
+/* Check if get_fileinfo should read ID3 info or not, seems a bit out of place here. */
+/* #define EXTRA_DEBUG */
+/*
+ readers.c: reading input data
+
+ copyright ?-2020 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp
+*/
+
+#include "mpg123lib_intern.h"
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+/* For select(), I need select.h according to POSIX 2001, else: sys/time.h sys/types.h unistd.h (the latter two included in compat.h already). */
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef _MSC_VER
+#include <io.h>
+#endif
+
+#include "compat.h"
+#include "debug.h"
+
+static int default_init(mpg123_handle *fr);
+static off_t get_fileinfo(mpg123_handle *);
+static ssize_t posix_read(int fd, void *buf, size_t count){ return read(fd, buf, count); }
+static off_t posix_lseek(int fd, off_t offset, int whence){ return lseek(fd, offset, whence); }
+static off_t nix_lseek(int fd, off_t offset, int whence){ return -1; }
+
+static ssize_t plain_fullread(mpg123_handle *fr,unsigned char *buf, ssize_t count);
+
+/* Wrapper to decide between descriptor-based and external handle-based I/O. */
+static off_t io_seek(struct reader_data *rdat, off_t offset, int whence);
+static ssize_t io_read(struct reader_data *rdat, void *buf, size_t count);
+
+#ifndef NO_FEEDER
+/* Bufferchain methods. */
+static void bc_init(struct bufferchain *bc);
+static void bc_reset(struct bufferchain *bc);
+static int bc_append(struct bufferchain *bc, ssize_t size);
+#if 0
+static void bc_drop(struct bufferchain *bc);
+#endif
+static int bc_add(struct bufferchain *bc, const unsigned char *data, ssize_t size);
+static ssize_t bc_give(struct bufferchain *bc, unsigned char *out, ssize_t size);
+static ssize_t bc_skip(struct bufferchain *bc, ssize_t count);
+static ssize_t bc_seekback(struct bufferchain *bc, ssize_t count);
+static void bc_forget(struct bufferchain *bc);
+#endif
+
+/* A normal read and a read with timeout. */
+static ssize_t plain_read(mpg123_handle *fr, void *buf, size_t count)
+{
+ ssize_t ret = io_read(&fr->rdat, buf, count);
+ if(VERBOSE3) debug2("read %li bytes of %li", (long)ret, (long)count);
+ return ret;
+}
+
+#ifdef TIMEOUT_READ
+
+/* Wait for data becoming available, allowing soft-broken network connection to die
+ This is needed for Shoutcast servers that have forgotten about us while connection was temporarily down. */
+static ssize_t timeout_read(mpg123_handle *fr, void *buf, size_t count)
+{
+ struct timeval tv;
+ ssize_t ret = 0;
+ fd_set fds;
+ tv.tv_sec = fr->rdat.timeout_sec;
+ tv.tv_usec = 0;
+ FD_ZERO(&fds);
+ FD_SET(fr->rdat.filept, &fds);
+ ret = select(fr->rdat.filept+1, &fds, NULL, NULL, &tv);
+ /* This works only with "my" read function. Not user-replaced. */
+ if(ret > 0) ret = read(fr->rdat.filept, buf, count);
+ else
+ {
+ ret=-1; /* no activity is the error */
+ if(NOQUIET) error("stream timed out");
+ }
+ return ret;
+}
+#endif
+
+#ifndef NO_ICY
+/* stream based operation with icy meta data*/
+static ssize_t icy_fullread(mpg123_handle *fr, unsigned char *buf, ssize_t count)
+{
+ ssize_t ret,cnt;
+ cnt = 0;
+ if(fr->rdat.flags & READER_SEEKABLE)
+ {
+ if(NOQUIET) error("mpg123 programmer error: I don't do ICY on seekable streams.");
+ return -1;
+ }
+ /*
+ There used to be a check for expected file end here (length value or ID3 flag).
+ This is not needed:
+ 1. EOF is indicated by fdread returning zero bytes anyway.
+ 2. We get false positives of EOF for either files that grew or
+ 3. ... files that have ID3v1 tags in between (stream with intro).
+ */
+
+ while(cnt < count)
+ {
+ /* all icy code is inside this if block, everything else is the plain fullread we know */
+ /* debug1("read: %li left", (long) count-cnt); */
+ if(fr->icy.next < count-cnt)
+ {
+ unsigned char temp_buff;
+ size_t meta_size;
+ ssize_t cut_pos;
+
+ /* we are near icy-metaint boundary, read up to the boundary */
+ if(fr->icy.next > 0)
+ {
+ cut_pos = fr->icy.next;
+ ret = fr->rdat.fdread(fr,buf+cnt,cut_pos);
+ if(ret < 1)
+ {
+ if(ret == 0) break; /* Just EOF. */
+ if(NOQUIET) error("icy boundary read");
+
+ return READER_ERROR;
+ }
+
+ if(!(fr->rdat.flags & READER_BUFFERED))
+ SATURATE_ADD(fr->rdat.filepos, ret, OFF_MAX);
+ cnt += ret;
+ fr->icy.next -= ret;
+ if(fr->icy.next > 0)
+ {
+ debug1("another try... still %li left", (long)fr->icy.next);
+ continue;
+ }
+ }
+ /* now off to read icy data */
+
+ /* one byte icy-meta size (must be multiplied by 16 to get icy-meta length) */
+
+ ret = fr->rdat.fdread(fr,&temp_buff,1); /* Getting one single byte hast to suceed. */
+ if(ret < 0){ if(NOQUIET) error("reading icy size"); return READER_ERROR; }
+ if(ret == 0) break;
+
+ debug2("got meta-size byte: %u, at filepos %li", temp_buff, (long)fr->rdat.filepos );
+ if(!(fr->rdat.flags & READER_BUFFERED))
+ SATURATE_ADD(fr->rdat.filepos, ret, OFF_MAX); /* 1... */
+
+ if((meta_size = ((size_t) temp_buff) * 16))
+ {
+ /* we have got some metadata */
+ char *meta_buff;
+ /* TODO: Get rid of this malloc ... perhaps hooking into the reader buffer pool? */
+ meta_buff = malloc(meta_size+1);
+ if(meta_buff != NULL)
+ {
+ ssize_t left = meta_size;
+ while(left > 0)
+ {
+ ret = fr->rdat.fdread(fr,meta_buff+meta_size-left,left);
+ /* 0 is error here, too... there _must_ be the ICY data, the server promised! */
+ if(ret < 1){ if(NOQUIET) error("reading icy-meta"); return READER_ERROR; }
+ left -= ret;
+ }
+ meta_buff[meta_size] = 0; /* string paranoia */
+ if(!(fr->rdat.flags & READER_BUFFERED))
+ SATURATE_ADD(fr->rdat.filepos, ret, OFF_MAX);
+
+ if(fr->icy.data) free(fr->icy.data);
+ fr->icy.data = meta_buff;
+ fr->metaflags |= MPG123_NEW_ICY;
+ debug2("icy-meta: %s size: %d bytes", fr->icy.data, (int)meta_size);
+ }
+ else
+ {
+ if(NOQUIET) error1("cannot allocate memory for meta_buff (%lu bytes) ... trying to skip the metadata!", (unsigned long)meta_size);
+ fr->rd->skip_bytes(fr, meta_size);
+ }
+ }
+ fr->icy.next = fr->icy.interval;
+ }
+ else
+ {
+ ret = plain_fullread(fr, buf+cnt, count-cnt);
+ if(ret < 0){ if(NOQUIET) error1("reading the rest of %li", (long)(count-cnt)); return READER_ERROR; }
+ if(ret == 0) break;
+
+ cnt += ret;
+ fr->icy.next -= ret;
+ }
+ }
+ /* debug1("done reading, got %li", (long)cnt); */
+ return cnt;
+}
+#else
+#define icy_fullread NULL
+#endif /* NO_ICY */
+
+/* stream based operation */
+static ssize_t plain_fullread(mpg123_handle *fr,unsigned char *buf, ssize_t count)
+{
+ ssize_t ret,cnt=0;
+
+#ifdef EXTRA_DEBUG
+ debug1("plain fullread of %"SSIZE_P, (size_p)count);
+#endif
+ /*
+ There used to be a check for expected file end here (length value or ID3 flag).
+ This is not needed:
+ 1. EOF is indicated by fdread returning zero bytes anyway.
+ 2. We get false positives of EOF for either files that grew or
+ 3. ... files that have ID3v1 tags in between (stream with intro).
+ */
+ while(cnt < count)
+ {
+ ret = fr->rdat.fdread(fr,buf+cnt,count-cnt);
+ if(ret < 0) return READER_ERROR;
+ if(ret == 0) break;
+ if(!(fr->rdat.flags & READER_BUFFERED))
+ SATURATE_ADD(fr->rdat.filepos, ret, OFF_MAX);
+ cnt += ret;
+ }
+ return cnt;
+}
+
+static off_t stream_lseek(mpg123_handle *fr, off_t pos, int whence)
+{
+ off_t ret;
+ ret = io_seek(&fr->rdat, pos, whence);
+ if (ret >= 0) fr->rdat.filepos = ret;
+ else
+ {
+ fr->err = MPG123_LSEEK_FAILED;
+ ret = READER_ERROR; /* not the original value */
+ }
+ return ret;
+}
+
+static void stream_close(mpg123_handle *fr)
+{
+ if(fr->rdat.flags & READER_FD_OPENED) compat_close(fr->rdat.filept);
+
+ fr->rdat.filept = 0;
+
+#ifndef NO_FEEDER
+ if(fr->rdat.flags & READER_BUFFERED) bc_reset(&fr->rdat.buffer);
+#endif
+ if(fr->rdat.flags & READER_HANDLEIO)
+ {
+ if(fr->rdat.cleanup_handle != NULL) fr->rdat.cleanup_handle(fr->rdat.iohandle);
+
+ fr->rdat.iohandle = NULL;
+ }
+}
+
+static int stream_seek_frame(mpg123_handle *fr, off_t newframe)
+{
+ debug2("seek_frame to %"OFF_P" (from %"OFF_P")", (off_p)newframe, (off_p)fr->num);
+ /* Seekable streams can go backwards and jump forwards.
+ Non-seekable streams still can go forward, just not jump. */
+ if((fr->rdat.flags & READER_SEEKABLE) || (newframe >= fr->num))
+ {
+ off_t preframe; /* a leading frame we jump to */
+ off_t seek_to; /* the byte offset we want to reach */
+ off_t to_skip; /* bytes to skip to get there (can be negative) */
+ /*
+ now seek to nearest leading index position and read from there until newframe is reached.
+ We use skip_bytes, which handles seekable and non-seekable streams
+ (the latter only for positive offset, which we ensured before entering here).
+ */
+ seek_to = frame_index_find(fr, newframe, &preframe);
+ /* No need to seek to index position if we are closer already.
+ But I am picky about fr->num == newframe, play safe by reading the frame again.
+ If you think that's stupid, don't call a seek to the current frame. */
+ if(fr->num >= newframe || fr->num < preframe)
+ {
+ to_skip = seek_to - fr->rd->tell(fr);
+ if(fr->rd->skip_bytes(fr, to_skip) != seek_to)
+ return READER_ERROR;
+
+ debug2("going to %lu; just got %lu", (long unsigned)newframe, (long unsigned)preframe);
+ fr->num = preframe-1; /* Watch out! I am going to read preframe... fr->num should indicate the frame before! */
+ }
+ while(fr->num < newframe)
+ {
+ /* try to be non-fatal now... frameNum only gets advanced on success anyway */
+ if(!read_frame(fr)) break;
+ }
+ /* Now the wanted frame should be ready for decoding. */
+ debug1("arrived at %lu", (long unsigned)fr->num);
+
+ return MPG123_OK;
+ }
+ else
+ {
+ fr->err = MPG123_NO_SEEK;
+ return READER_ERROR; /* invalid, no seek happened */
+ }
+}
+
+/* return FALSE on error, TRUE on success, READER_MORE on occasion */
+static int generic_head_read(mpg123_handle *fr,unsigned long *newhead)
+{
+ unsigned char hbuf[4];
+ int ret = fr->rd->fullread(fr,hbuf,4);
+ if(ret == READER_MORE) return ret;
+ if(ret != 4) return FALSE;
+
+ *newhead = ((unsigned long) hbuf[0] << 24) |
+ ((unsigned long) hbuf[1] << 16) |
+ ((unsigned long) hbuf[2] << 8) |
+ (unsigned long) hbuf[3];
+
+ return TRUE;
+}
+
+/* return FALSE on error, TRUE on success, READER_MORE on occasion */
+static int generic_head_shift(mpg123_handle *fr,unsigned long *head)
+{
+ unsigned char hbuf;
+ int ret = fr->rd->fullread(fr,&hbuf,1);
+ if(ret == READER_MORE) return ret;
+ if(ret != 1) return FALSE;
+
+ *head <<= 8;
+ *head |= hbuf;
+ *head &= 0xffffffff;
+ return TRUE;
+}
+
+/* returns reached position... negative ones are bad... */
+static off_t stream_skip_bytes(mpg123_handle *fr,off_t len)
+{
+ if(fr->rdat.flags & READER_SEEKABLE)
+ {
+ off_t ret = stream_lseek(fr, len, SEEK_CUR);
+ return (ret < 0) ? READER_ERROR : ret;
+ }
+ else if(len >= 0)
+ {
+ unsigned char buf[1024]; /* ThOr: Compaq cxx complained and it makes sense to me... or should one do a cast? What for? */
+ ssize_t ret;
+ while (len > 0)
+ {
+ ssize_t num = len < (off_t)sizeof(buf) ? (ssize_t)len : (ssize_t)sizeof(buf);
+ ret = fr->rd->fullread(fr, buf, num);
+ if (ret < 0) return ret;
+ else if(ret == 0) break; /* EOF... an error? interface defined to tell the actual position... */
+ len -= ret;
+ }
+ return fr->rd->tell(fr);
+ }
+#ifndef NO_FEEDER
+ else if(fr->rdat.flags & READER_BUFFERED)
+ { /* Perhaps we _can_ go a bit back. */
+ if(fr->rdat.buffer.pos >= -len)
+ {
+ fr->rdat.buffer.pos += len;
+ return fr->rd->tell(fr);
+ }
+ else
+ {
+ fr->err = MPG123_NO_SEEK;
+ return READER_ERROR;
+ }
+ }
+#endif
+ else
+ {
+ fr->err = MPG123_NO_SEEK;
+ return READER_ERROR;
+ }
+}
+
+/* Return 0 on success... */
+static int stream_back_bytes(mpg123_handle *fr, off_t bytes)
+{
+ off_t want = fr->rd->tell(fr)-bytes;
+ if(want < 0) return READER_ERROR;
+ if(stream_skip_bytes(fr,-bytes) != want) return READER_ERROR;
+
+ return 0;
+}
+
+
+/* returns size on success... otherwise an error code < 0 */
+static int generic_read_frame_body(mpg123_handle *fr,unsigned char *buf, int size)
+{
+ long l;
+ l=fr->rd->fullread(fr,buf,size);
+ return (l >= 0 && l<size) ? READER_ERROR : l;
+}
+
+static off_t generic_tell(mpg123_handle *fr)
+{
+#ifndef NO_FEEDER
+ if(fr->rdat.flags & READER_BUFFERED)
+ {
+ fr->rdat.filepos = fr->rdat.buffer.fileoff;
+ SATURATE_ADD(fr->rdat.filepos, fr->rdat.buffer.pos, OFF_MAX);
+ }
+#endif
+
+ return fr->rdat.filepos;
+}
+
+/* This does not (fully) work for non-seekable streams... You have to check for that flag, pal! */
+static void stream_rewind(mpg123_handle *fr)
+{
+ if(fr->rdat.flags & READER_SEEKABLE)
+ {
+ fr->rdat.filepos = stream_lseek(fr,0,SEEK_SET);
+#ifndef NO_FEEDER
+ fr->rdat.buffer.fileoff = fr->rdat.filepos;
+#endif
+ }
+#ifndef NO_FEEDER
+ if(fr->rdat.flags & READER_BUFFERED)
+ {
+ fr->rdat.buffer.pos = 0;
+ fr->rdat.buffer.firstpos = 0;
+ fr->rdat.filepos = fr->rdat.buffer.fileoff;
+ }
+#endif
+}
+
+/*
+ * returns length of a file (if filept points to a file)
+ * reads the last 128 bytes information into buffer
+ * ... that is not totally safe...
+ */
+static off_t get_fileinfo(mpg123_handle *fr)
+{
+ off_t len;
+
+ if((len=io_seek(&fr->rdat,0,SEEK_END)) < 0)
+ {
+ debug("cannot seek to end");
+ return -1;
+ } else if(len >= 128)
+ {
+ if(io_seek(&fr->rdat,-128,SEEK_END) < 0)
+ {
+ debug("cannot seek to END-128");
+ return -1;
+ }
+ if(fr->rd->fullread(fr,(unsigned char *)fr->id3buf,128) != 128)
+ {
+ debug("cannot read ID3v1?!");
+ return -1;
+ }
+ if(!strncmp((char*)fr->id3buf,"TAG",3)) len -= 128;
+ } else
+ {
+ debug("stream too short for ID3");
+ }
+
+ if(io_seek(&fr->rdat,0,SEEK_SET) < 0)
+ {
+ debug("cannot seek back");
+ return -1;
+ }
+ fr->rdat.filepos = 0; // un-do our seeking here
+
+ debug1("returning length: %"OFF_P, (off_p)len);
+ return len;
+}
+
+#ifndef NO_FEEDER
+/* Methods for the buffer chain, mainly used for feed reader, but not just that. */
+
+
+static struct buffy* buffy_new(size_t size, size_t minsize)
+{
+ struct buffy *newbuf;
+ newbuf = malloc(sizeof(struct buffy));
+ if(newbuf == NULL) return NULL;
+
+ newbuf->realsize = size > minsize ? size : minsize;
+ newbuf->data = malloc(newbuf->realsize);
+ if(newbuf->data == NULL)
+ {
+ free(newbuf);
+ return NULL;
+ }
+ newbuf->size = 0;
+ newbuf->next = NULL;
+ return newbuf;
+}
+
+static void buffy_del(struct buffy* buf)
+{
+ if(buf)
+ {
+ free(buf->data);
+ free(buf);
+ }
+}
+
+/* Delete this buffy and all following buffies. */
+static void buffy_del_chain(struct buffy* buf)
+{
+ while(buf)
+ {
+ struct buffy* next = buf->next;
+ buffy_del(buf);
+ buf = next;
+ }
+}
+
+void bc_prepare(struct bufferchain *bc, size_t pool_size, size_t bufblock)
+{
+ bc_poolsize(bc, pool_size, bufblock);
+ bc->pool = NULL;
+ bc->pool_fill = 0;
+ bc_init(bc); /* Ensure that members are zeroed for read-only use. */
+}
+
+size_t bc_fill(struct bufferchain *bc)
+{
+ return (size_t)(bc->size - bc->pos);
+}
+
+void bc_poolsize(struct bufferchain *bc, size_t pool_size, size_t bufblock)
+{
+ bc->pool_size = pool_size;
+ bc->bufblock = bufblock;
+}
+
+void bc_cleanup(struct bufferchain *bc)
+{
+ buffy_del_chain(bc->pool);
+ bc->pool = NULL;
+ bc->pool_fill = 0;
+}
+
+/* Fetch a buffer from the pool (if possible) or create one. */
+static struct buffy* bc_alloc(struct bufferchain *bc, size_t size)
+{
+ /* Easy route: Just try the first available buffer.
+ Size does not matter, it's only a hint for creation of new buffers. */
+ if(bc->pool)
+ {
+ struct buffy *buf = bc->pool;
+ bc->pool = buf->next;
+ buf->next = NULL; /* That shall be set to a sensible value later. */
+ buf->size = 0;
+ --bc->pool_fill;
+ debug2("bc_alloc: picked %p from pool (fill now %"SIZE_P")", (void*)buf, (size_p)bc->pool_fill);
+ return buf;
+ }
+ else return buffy_new(size, bc->bufblock);
+}
+
+/* Either stuff the buffer back into the pool or free it for good. */
+static void bc_free(struct bufferchain *bc, struct buffy* buf)
+{
+ if(!buf) return;
+
+ if(bc->pool_fill < bc->pool_size)
+ {
+ buf->next = bc->pool;
+ bc->pool = buf;
+ ++bc->pool_fill;
+ }
+ else buffy_del(buf);
+}
+
+/* Make the buffer count in the pool match the pool size. */
+static int bc_fill_pool(struct bufferchain *bc)
+{
+ /* Remove superfluous ones. */
+ while(bc->pool_fill > bc->pool_size)
+ {
+ /* Lazyness: Just work on the front. */
+ struct buffy* buf = bc->pool;
+ bc->pool = buf->next;
+ buffy_del(buf);
+ --bc->pool_fill;
+ }
+
+ /* Add missing ones. */
+ while(bc->pool_fill < bc->pool_size)
+ {
+ /* Again, just work on the front. */
+ struct buffy* buf;
+ buf = buffy_new(0, bc->bufblock); /* Use default block size. */
+ if(!buf) return -1;
+
+ buf->next = bc->pool;
+ bc->pool = buf;
+ ++bc->pool_fill;
+ }
+
+ return 0;
+}
+
+
+static void bc_init(struct bufferchain *bc)
+{
+ bc->first = NULL;
+ bc->last = bc->first;
+ bc->size = 0;
+ bc->pos = 0;
+ bc->firstpos = 0;
+ bc->fileoff = 0;
+}
+
+static void bc_reset(struct bufferchain *bc)
+{
+ /* Free current chain, possibly stuffing back into the pool. */
+ while(bc->first)
+ {
+ struct buffy* buf = bc->first;
+ bc->first = buf->next;
+ bc_free(bc, buf);
+ }
+ bc_fill_pool(bc); /* Ignoring an error here... */
+ bc_init(bc);
+}
+
+/* Create a new buffy at the end to be filled. */
+static int bc_append(struct bufferchain *bc, ssize_t size)
+{
+ struct buffy *newbuf;
+ if(size < 1) return -1;
+
+ newbuf = bc_alloc(bc, size);
+ if(newbuf == NULL) return -2;
+
+ if(bc->last != NULL) bc->last->next = newbuf;
+ else if(bc->first == NULL) bc->first = newbuf;
+
+ bc->last = newbuf;
+ debug3("bc_append: new last buffer %p with %"SSIZE_P" B (really %"SSIZE_P")", (void*)bc->last, (ssize_p)bc->last->size, (ssize_p)bc->last->realsize);
+ return 0;
+}
+
+/* Append a new buffer and copy content to it. */
+static int bc_add(struct bufferchain *bc, const unsigned char *data, ssize_t size)
+{
+ int ret = 0;
+ ssize_t part = 0;
+ debug2("bc_add: adding %"SSIZE_P" bytes at %"OFF_P, (ssize_p)size, (off_p)(bc->fileoff+bc->size));
+ if(size >=4) debug4("first bytes: %02x %02x %02x %02x", data[0], data[1], data[2], data[3]);
+
+ while(size > 0)
+ {
+ /* Try to fill up the last buffer block. */
+ if(bc->last != NULL && bc->last->size < bc->last->realsize)
+ {
+ part = bc->last->realsize - bc->last->size;
+ if(part > size) part = size;
+
+ debug2("bc_add: adding %"SSIZE_P" B to existing block %p", (ssize_p)part, (void*)bc->last);
+ memcpy(bc->last->data+bc->last->size, data, part);
+ bc->last->size += part;
+ size -= part;
+ bc->size += part;
+ data += part;
+ }
+
+ /* If there is still data left, put it into a new buffer block. */
+ if(size > 0 && (ret = bc_append(bc, size)) != 0)
+ break;
+ }
+
+ return ret;
+}
+
+/* Common handler for "You want more than I can give." situation. */
+static ssize_t bc_need_more(struct bufferchain *bc)
+{
+ debug3("hit end, back to beginning (%li - %li < %li)", (long)bc->size, (long)bc->pos, (long)bc->size);
+ /* go back to firstpos, undo the previous reads */
+ bc->pos = bc->firstpos;
+ return READER_MORE;
+}
+
+/* Give some data, advancing position but not forgetting yet. */
+static ssize_t bc_give(struct bufferchain *bc, unsigned char *out, ssize_t size)
+{
+ struct buffy *b = bc->first;
+ ssize_t gotcount = 0;
+ ssize_t offset = 0;
+ if(bc->size - bc->pos < size) return bc_need_more(bc);
+
+ /* find the current buffer */
+ while(b != NULL && (offset + b->size) <= bc->pos)
+ {
+ offset += b->size;
+ b = b->next;
+ }
+ /* now start copying from there */
+ while(gotcount < size && (b != NULL))
+ {
+ ssize_t loff = bc->pos - offset;
+ ssize_t chunk = size - gotcount; /* amount of bytes to get from here... */
+ if(chunk > b->size - loff) chunk = b->size - loff;
+
+#ifdef EXTRA_DEBUG
+ debug3("copying %liB from %p+%li",(long)chunk, b->data, (long)loff);
+#endif
+
+ memcpy(out+gotcount, b->data+loff, chunk);
+ gotcount += chunk;
+ bc->pos += chunk;
+ offset += b->size;
+ b = b->next;
+ }
+#ifdef EXTRA_DEBUG
+ debug2("got %li bytes, pos advanced to %li", (long)gotcount, (long)bc->pos);
+#endif
+
+ return gotcount;
+}
+
+/* Skip some bytes and return the new position.
+ The buffers are still there, just the read pointer is moved! */
+static ssize_t bc_skip(struct bufferchain *bc, ssize_t count)
+{
+ if(count >= 0)
+ {
+ if(bc->size - bc->pos < count) return bc_need_more(bc);
+ else return bc->pos += count;
+ }
+ else return READER_ERROR;
+}
+
+static ssize_t bc_seekback(struct bufferchain *bc, ssize_t count)
+{
+ if(count >= 0 && count <= bc->pos) return bc->pos -= count;
+ else return READER_ERROR;
+}
+
+/* Throw away buffies that we passed. */
+static void bc_forget(struct bufferchain *bc)
+{
+ struct buffy *b = bc->first;
+ /* free all buffers that are def'n'tly outdated */
+ /* we have buffers until filepos... delete all buffers fully below it */
+ if(b) debug2("bc_forget: block %lu pos %lu", (unsigned long)b->size, (unsigned long)bc->pos);
+ else debug("forget with nothing there!");
+
+ while(b != NULL && bc->pos >= b->size)
+ {
+ struct buffy *n = b->next; /* != NULL or this is indeed the end and the last cycle anyway */
+ if(n == NULL) bc->last = NULL; /* Going to delete the last buffy... */
+ bc->fileoff += b->size;
+ bc->pos -= b->size;
+ bc->size -= b->size;
+
+ debug5("bc_forget: forgot %p with %lu, pos=%li, size=%li, fileoff=%li", (void*)b->data, (long)b->size, (long)bc->pos, (long)bc->size, (long)bc->fileoff);
+
+ bc_free(bc, b);
+ b = n;
+ }
+ bc->first = b;
+ bc->firstpos = bc->pos;
+}
+
+/* reader for input via manually provided buffers */
+
+static int feed_init(mpg123_handle *fr)
+{
+ bc_init(&fr->rdat.buffer);
+ bc_fill_pool(&fr->rdat.buffer);
+ fr->rdat.filelen = 0;
+ fr->rdat.filepos = 0;
+ fr->rdat.flags |= READER_BUFFERED;
+ return 0;
+}
+
+/* externally called function, returns 0 on success, -1 on error */
+int feed_more(mpg123_handle *fr, const unsigned char *in, long count)
+{
+ int ret = 0;
+ if(VERBOSE3) debug("feed_more");
+ if((ret = bc_add(&fr->rdat.buffer, in, count)) != 0)
+ {
+ ret = READER_ERROR;
+ if(NOQUIET) error1("Failed to add buffer, return: %i", ret);
+ }
+ else /* Not talking about filelen... that stays at 0. */
+
+ if(VERBOSE3) debug3("feed_more: %p %luB bufsize=%lu", fr->rdat.buffer.last->data,
+ (unsigned long)fr->rdat.buffer.last->size, (unsigned long)fr->rdat.buffer.size);
+ return ret;
+}
+
+static ssize_t feed_read(mpg123_handle *fr, unsigned char *out, ssize_t count)
+{
+ ssize_t gotcount = bc_give(&fr->rdat.buffer, out, count);
+ if(gotcount >= 0 && gotcount != count) return READER_ERROR;
+ else return gotcount;
+}
+
+/* returns reached position... negative ones are bad... */
+static off_t feed_skip_bytes(mpg123_handle *fr,off_t len)
+{
+ /* This is either the new buffer offset or some negative error value. */
+ off_t res = bc_skip(&fr->rdat.buffer, (ssize_t)len);
+ if(res < 0) return res;
+
+ return fr->rdat.buffer.fileoff+res;
+}
+
+static int feed_back_bytes(mpg123_handle *fr, off_t bytes)
+{
+ if(bytes >=0)
+ return bc_seekback(&fr->rdat.buffer, (ssize_t)bytes) >= 0 ? 0 : READER_ERROR;
+ else
+ return feed_skip_bytes(fr, -bytes) >= 0 ? 0 : READER_ERROR;
+}
+
+static int feed_seek_frame(mpg123_handle *fr, off_t num){ return READER_ERROR; }
+
+/* Not just for feed reader, also for self-feeding buffered reader. */
+static void buffered_forget(mpg123_handle *fr)
+{
+ bc_forget(&fr->rdat.buffer);
+ fr->rdat.filepos = fr->rdat.buffer.fileoff;
+ SATURATE_ADD(fr->rdat.filepos, fr->rdat.buffer.pos, OFF_MAX);
+}
+
+off_t feed_set_pos(mpg123_handle *fr, off_t pos)
+{
+ struct bufferchain *bc = &fr->rdat.buffer;
+ if(pos >= bc->fileoff && pos-bc->fileoff < bc->size)
+ { /* We have the position! */
+ bc->pos = (ssize_t)(pos - bc->fileoff);
+ debug1("feed_set_pos inside, next feed from %"OFF_P, (off_p)(bc->fileoff+bc->size));
+ return bc->fileoff+bc->size; /* Next input after end of buffer... */
+ }
+ else
+ { /* I expect to get the specific position on next feed. Forget what I have now. */
+ bc_reset(bc);
+ bc->fileoff = pos;
+ debug1("feed_set_pos outside, buffer reset, next feed from %"OFF_P, (off_p)pos);
+ return pos; /* Next input from exactly that position. */
+ }
+}
+
+/* The specific stuff for buffered stream reader. */
+
+static ssize_t buffered_fullread(mpg123_handle *fr, unsigned char *out, ssize_t count)
+{
+ struct bufferchain *bc = &fr->rdat.buffer;
+ ssize_t gotcount;
+ if(VERBOSE3)
+ mdebug("buffered_fullread: want %zd", count);
+ if(bc->size - bc->pos < count)
+ { /* Add more stuff to buffer. If hitting end of file, adjust count. */
+ unsigned char readbuf[4096];
+ ssize_t need = count - (bc->size-bc->pos);
+ while(need>0)
+ {
+ int ret;
+ ssize_t got = fr->rdat.fullread(fr, readbuf, sizeof(readbuf));
+ if(got < 0)
+ {
+ if(NOQUIET) error("buffer reading");
+ return READER_ERROR;
+ }
+
+ if(VERBOSE3) debug1("buffered_fullread: buffering %li bytes from stream (if > 0)", (long)got);
+ if(got > 0 && (ret=bc_add(bc, readbuf, got)) != 0)
+ {
+ if(NOQUIET) error1("unable to add to chain, return: %i", ret);
+ return READER_ERROR;
+ }
+
+ need -= got; /* May underflow here... */
+ if(got < sizeof(readbuf)) /* That naturally catches got == 0, too. */
+ {
+ if(VERBOSE3) fprintf(stderr, "Note: Input data end.\n");
+ break; /* End. */
+ }
+ }
+ if(bc->size - bc->pos < count)
+ count = bc->size - bc->pos; /* We want only what we got. */
+ }
+ gotcount = bc_give(bc, out, count);
+ if(VERBOSE3)
+ mdebug("buffered_fullread: got %zd", gotcount);
+ if(gotcount != count){ if(NOQUIET) error("gotcount != count"); return READER_ERROR; }
+ else return gotcount;
+}
+#else
+int feed_more(mpg123_handle *fr, const unsigned char *in, long count)
+{
+ fr->err = MPG123_MISSING_FEATURE;
+ return -1;
+}
+off_t feed_set_pos(mpg123_handle *fr, off_t pos)
+{
+ fr->err = MPG123_MISSING_FEATURE;
+ return -1;
+}
+#endif /* NO_FEEDER */
+
+/*****************************************************************
+ * read frame helper
+ */
+
+#define bugger_off { mh->err = MPG123_NO_READER; return MPG123_ERR; }
+static int bad_init(mpg123_handle *mh) bugger_off
+static void bad_close(mpg123_handle *mh){}
+static ssize_t bad_fullread(mpg123_handle *mh, unsigned char *data, ssize_t count) bugger_off
+static int bad_head_read(mpg123_handle *mh, unsigned long *newhead) bugger_off
+static int bad_head_shift(mpg123_handle *mh, unsigned long *head) bugger_off
+static off_t bad_skip_bytes(mpg123_handle *mh, off_t len) bugger_off
+static int bad_read_frame_body(mpg123_handle *mh, unsigned char *data, int size) bugger_off
+static int bad_back_bytes(mpg123_handle *mh, off_t bytes) bugger_off
+static int bad_seek_frame(mpg123_handle *mh, off_t num) bugger_off
+static off_t bad_tell(mpg123_handle *mh) bugger_off
+static void bad_rewind(mpg123_handle *mh){}
+#undef bugger_off
+
+#define READER_STREAM 0
+#define READER_ICY_STREAM 1
+#define READER_FEED 2
+#define READER_BUF_STREAM 3
+#define READER_BUF_ICY_STREAM 4
+static struct reader readers[] =
+{
+ { /* READER_STREAM */
+ default_init,
+ stream_close,
+ plain_fullread,
+ generic_head_read,
+ generic_head_shift,
+ stream_skip_bytes,
+ generic_read_frame_body,
+ stream_back_bytes,
+ stream_seek_frame,
+ generic_tell,
+ stream_rewind,
+ NULL
+ } ,
+ { /* READER_ICY_STREAM */
+ default_init,
+ stream_close,
+ icy_fullread,
+ generic_head_read,
+ generic_head_shift,
+ stream_skip_bytes,
+ generic_read_frame_body,
+ stream_back_bytes,
+ stream_seek_frame,
+ generic_tell,
+ stream_rewind,
+ NULL
+ },
+#ifdef NO_FEEDER
+#define feed_init NULL
+#define feed_read NULL
+#define buffered_fullread NULL
+#define feed_seek_frame NULL
+#define feed_back_bytes NULL
+#define feed_skip_bytes NULL
+#define buffered_forget NULL
+#endif
+ { /* READER_FEED */
+ feed_init,
+ stream_close,
+ feed_read,
+ generic_head_read,
+ generic_head_shift,
+ feed_skip_bytes,
+ generic_read_frame_body,
+ feed_back_bytes,
+ feed_seek_frame,
+ generic_tell,
+ stream_rewind,
+ buffered_forget
+ },
+ { /* READER_BUF_STREAM */
+ default_init,
+ stream_close,
+ buffered_fullread,
+ generic_head_read,
+ generic_head_shift,
+ stream_skip_bytes,
+ generic_read_frame_body,
+ stream_back_bytes,
+ stream_seek_frame,
+ generic_tell,
+ stream_rewind,
+ buffered_forget
+ } ,
+ { /* READER_BUF_ICY_STREAM */
+ default_init,
+ stream_close,
+ buffered_fullread,
+ generic_head_read,
+ generic_head_shift,
+ stream_skip_bytes,
+ generic_read_frame_body,
+ stream_back_bytes,
+ stream_seek_frame,
+ generic_tell,
+ stream_rewind,
+ buffered_forget
+ },
+#ifdef READ_SYSTEM
+ ,{
+ system_init,
+ NULL, /* filled in by system_init() */
+ fullread,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ }
+#endif
+};
+
+static struct reader bad_reader =
+{
+ bad_init,
+ bad_close,
+ bad_fullread,
+ bad_head_read,
+ bad_head_shift,
+ bad_skip_bytes,
+ bad_read_frame_body,
+ bad_back_bytes,
+ bad_seek_frame,
+ bad_tell,
+ bad_rewind,
+ NULL
+};
+
+static int default_init(mpg123_handle *fr)
+{
+#ifdef TIMEOUT_READ
+ if(fr->p.timeout > 0)
+ {
+ int flags;
+ if(fr->rdat.r_read != NULL)
+ {
+ if(NOQUIET)
+ error( "Timeout reading does not work with user-provided"
+ " read function. Implement it yourself!" );
+ return -1;
+ }
+ flags = fcntl(fr->rdat.filept, F_GETFL);
+ flags |= O_NONBLOCK;
+ fcntl(fr->rdat.filept, F_SETFL, flags);
+ fr->rdat.fdread = timeout_read;
+ fr->rdat.timeout_sec = fr->p.timeout;
+ fr->rdat.flags |= READER_NONBLOCK;
+ }
+ else
+#endif
+ fr->rdat.fdread = plain_read;
+
+ fr->rdat.read = fr->rdat.r_read != NULL ? fr->rdat.r_read : posix_read;
+ fr->rdat.lseek = fr->rdat.r_lseek != NULL ? fr->rdat.r_lseek : posix_lseek;
+#ifndef NO_ICY
+ /* ICY streams of any sort shall not be seekable. */
+ if(fr->p.icy_interval > 0) fr->rdat.lseek = nix_lseek;
+#endif
+
+ fr->rdat.filepos = 0;
+ fr->rdat.filelen = fr->p.flags & MPG123_NO_PEEK_END ? -1 : get_fileinfo(fr);
+ if(fr->p.flags & MPG123_FORCE_SEEKABLE)
+ fr->rdat.flags |= READER_SEEKABLE;
+ /*
+ Don't enable seeking on ICY streams, just plain normal files.
+ This check is necessary since the client can enforce ICY parsing on files that would otherwise be seekable.
+ It is a task for the future to make the ICY parsing safe with seeks ... or not.
+ */
+ if(fr->rdat.filelen >= 0)
+ {
+ debug("seekable stream");
+ fr->rdat.flags |= READER_SEEKABLE;
+ if(!strncmp((char*)fr->id3buf,"TAG",3))
+ {
+ fr->rdat.flags |= READER_ID3TAG;
+ fr->metaflags |= MPG123_NEW_ID3;
+ }
+ }
+ /* Switch reader to a buffered one, if allowed. */
+ else if(fr->p.flags & MPG123_SEEKBUFFER)
+ {
+#ifdef NO_FEEDER
+ if(NOQUIET)
+ error("Buffered readers not supported in this build.");
+ fr->err = MPG123_MISSING_FEATURE;
+ return -1;
+#else
+ if (fr->rd == &readers[READER_STREAM])
+ {
+ debug("switching to buffered stream reader");
+ fr->rd = &readers[READER_BUF_STREAM];
+ fr->rdat.fullread = plain_fullread;
+ }
+#ifndef NO_ICY
+ else if(fr->rd == &readers[READER_ICY_STREAM])
+ {
+ debug("switching to buffered ICY stream reader");
+ fr->rd = &readers[READER_BUF_ICY_STREAM];
+ fr->rdat.fullread = icy_fullread;
+ }
+#endif
+ else
+ {
+ if(NOQUIET) error("mpg123 Programmer's fault: invalid reader");
+ return -1;
+ }
+ bc_init(&fr->rdat.buffer);
+ fr->rdat.filelen = 0; /* We carry the offset, but never know how big the stream is. */
+ fr->rdat.flags |= READER_BUFFERED;
+#endif /* NO_ICY */
+ }
+ return 0;
+}
+
+
+void open_bad(mpg123_handle *mh)
+{
+ debug("open_bad");
+#ifndef NO_ICY
+ clear_icy(&mh->icy);
+#endif
+ mh->rd = &bad_reader;
+ mh->rdat.flags = 0;
+#ifndef NO_FEEDER
+ bc_init(&mh->rdat.buffer);
+#endif
+ mh->rdat.filelen = -1;
+}
+
+int open_feed(mpg123_handle *fr)
+{
+ debug("feed reader");
+#ifdef NO_FEEDER
+ if(NOQUIET)
+ error("Buffered readers not supported in this build.");
+ fr->err = MPG123_MISSING_FEATURE;
+ return -1;
+#else
+#ifndef NO_ICY
+ if(fr->p.icy_interval > 0)
+ {
+ if(NOQUIET) error("Feed reader cannot do ICY parsing!");
+
+ return -1;
+ }
+ clear_icy(&fr->icy);
+#endif
+ fr->rd = &readers[READER_FEED];
+ fr->rdat.flags = 0;
+ if(fr->rd->init(fr) < 0) return -1;
+
+ debug("feed reader init successful");
+ return 0;
+#endif /* NO_FEEDER */
+}
+
+/* Final code common to open_stream and open_stream_handle. */
+static int open_finish(mpg123_handle *fr)
+{
+#ifndef NO_ICY
+ if(fr->p.icy_interval > 0)
+ {
+ debug("ICY reader");
+ fr->icy.interval = fr->p.icy_interval;
+ fr->icy.next = fr->icy.interval;
+ fr->rd = &readers[READER_ICY_STREAM];
+ }
+ else
+#endif
+ {
+ fr->rd = &readers[READER_STREAM];
+ debug("stream reader");
+ }
+
+ if(fr->rd->init(fr) < 0) return -1;
+
+ return MPG123_OK;
+}
+
+int open_stream(mpg123_handle *fr, const char *bs_filenam, int fd)
+{
+ int filept_opened = 1;
+ int filept; /* descriptor of opened file/stream */
+
+ clear_icy(&fr->icy); /* can be done inside frame_clear ...? */
+
+ if(!bs_filenam) /* no file to open, got a descriptor (stdin) */
+ {
+ filept = fd;
+ filept_opened = 0; /* and don't try to close it... */
+ }
+ #ifndef O_BINARY
+ #define O_BINARY (0)
+ #endif
+ else if((filept = compat_open(bs_filenam, O_RDONLY|O_BINARY)) < 0) /* a plain old file to open... */
+ {
+ if(NOQUIET) error2("Cannot open file %s: %s", bs_filenam, strerror(errno));
+ fr->err = MPG123_BAD_FILE;
+ return MPG123_ERR; /* error... */
+ }
+
+ /* now we have something behind filept and can init the reader */
+ fr->rdat.filelen = -1;
+ fr->rdat.filept = filept;
+ fr->rdat.flags = 0;
+ if(filept_opened) fr->rdat.flags |= READER_FD_OPENED;
+
+ return open_finish(fr);
+}
+
+int open_stream_handle(mpg123_handle *fr, void *iohandle)
+{
+ clear_icy(&fr->icy); /* can be done inside frame_clear ...? */
+ fr->rdat.filelen = -1;
+ fr->rdat.filept = -1;
+ fr->rdat.iohandle = iohandle;
+ fr->rdat.flags = 0;
+ fr->rdat.flags |= READER_HANDLEIO;
+
+ return open_finish(fr);
+}
+
+/* Wrappers for actual reading/seeking... I'm full of wrappers here. */
+static off_t io_seek(struct reader_data *rdat, off_t offset, int whence)
+{
+ if(rdat->flags & READER_HANDLEIO)
+ {
+ if(rdat->r_lseek_handle != NULL)
+ {
+ return rdat->r_lseek_handle(rdat->iohandle, offset, whence);
+ }
+ else return -1;
+ }
+ else
+ return rdat->lseek(rdat->filept, offset, whence);
+}
+
+static ssize_t io_read(struct reader_data *rdat, void *buf, size_t count)
+{
+ if(rdat->flags & READER_HANDLEIO)
+ {
+ if(rdat->r_read_handle != NULL)
+ {
+ return rdat->r_read_handle(rdat->iohandle, buf, count);
+ }
+ else return -1;
+ }
+ else
+ return rdat->read(rdat->filept, buf, count);
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/sample.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/sample.h
new file mode 100644
index 00000000..c57b0af4
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/sample.h
@@ -0,0 +1,195 @@
+/*
+ sample.h: The conversion from internal data to output samples of differing formats.
+
+ copyright 2007-9 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis, taking WRITE_SAMPLE from decode.c
+ Later added the end-conversion specific macros here, too.
+*/
+
+#ifndef SAMPLE_H
+#define SAMPLE_H
+
+/* mpg123lib_intern.h is included already, right? */
+
+/* Special case is fixed point math... which does work, but not that nice yet. */
+#ifdef REAL_IS_FIXED
+static inline int16_t idiv_signed_rounded(int32_t x, int shift)
+{
+ x >>= (shift - 1);
+ x += (x & 1);
+ return (int16_t)(x >> 1);
+}
+# define REAL_PLUS_32767 ( 32767 << 15 )
+# define REAL_MINUS_32768 ( -32768 << 15 )
+# define REAL_TO_SHORT(x) (idiv_signed_rounded(x, 15))
+/* No better code (yet). */
+# define REAL_TO_SHORT_ACCURATE(x) REAL_TO_SHORT(x)
+/* This is just here for completeness, it is not used! */
+# define REAL_TO_S32(x) (x)
+#endif
+
+/* From now on for single precision float... double precision is a possible option once we added some bits. But, it would be rather insane. */
+#ifndef REAL_TO_SHORT
+
+#if (defined FORCE_ACCURATE) || (defined ACCURATE_ROUNDING)
+/* Define the accurate rounding function. */
+# if (defined REAL_IS_FLOAT) && (defined IEEE_FLOAT)
+/* This function is only available for IEEE754 single-precision values
+ This is nearly identical to proper rounding, just -+0.5 is rounded to 0 */
+static inline int16_t ftoi16(float x)
+{
+ union
+ {
+ float f;
+ int32_t i;
+ } u_fi;
+ u_fi.f = x + 12582912.0f; /* Magic Number: 2^23 + 2^22 */
+ return (int16_t)u_fi.i;
+}
+# define REAL_TO_SHORT_ACCURATE(x) ftoi16(x)
+# else
+/* The "proper" rounding, plain C, a bit slow. */
+# define REAL_TO_SHORT_ACCURATE(x) (short)((x)>0.0?(x)+0.5:(x)-0.5)
+# endif
+#endif
+
+/* Now define the normal rounding. */
+# ifdef ACCURATE_ROUNDING
+# define REAL_TO_SHORT(x) REAL_TO_SHORT_ACCURATE(x)
+# else
+/* Non-accurate rounding... simple truncation. Fastest, most LSB errors. */
+# define REAL_TO_SHORT(x) (short)(x)
+# endif
+
+#endif /* REAL_TO_SHORT */
+
+/* We should add dithering for S32, too? */
+#ifndef REAL_TO_S32
+# ifdef ACCURATE_ROUNDING
+# define REAL_TO_S32(x) (int32_t)((x)>0.0?(x)+0.5:(x)-0.5)
+# else
+# define REAL_TO_S32(x) (int32_t)(x)
+# endif
+#endif
+
+#ifndef REAL_PLUS_32767
+# define REAL_PLUS_32767 32767.0
+#endif
+#ifndef REAL_MINUS_32768
+# define REAL_MINUS_32768 -32768.0
+#endif
+#ifndef REAL_PLUS_S32
+# define REAL_PLUS_S32 2147483647.0
+#endif
+#ifndef REAL_MINUS_S32
+# define REAL_MINUS_S32 -2147483648.0
+#endif
+
+
+/* The actual storage of a decoded sample is separated in the following macros.
+ We can handle different types, we could also handle dithering here. */
+
+#ifdef NEWOLD_WRITE_SAMPLE
+
+/* This is the old new mpg123 WRITE_SAMPLE, fixed for newer GCC by MPlayer folks.
+ Makes a huge difference on old machines. */
+#if WORDS_BIGENDIAN
+#define MANTISSA_OFFSET 1
+#else
+#define MANTISSA_OFFSET 0
+#endif
+#define WRITE_SHORT_SAMPLE(samples,sum,clip) { \
+ union { double dtemp; int itemp[2]; } u; int v; \
+ u.dtemp = ((((65536.0 * 65536.0 * 16)+(65536.0 * 0.5))* 65536.0)) + (sum);\
+ v = u.itemp[MANTISSA_OFFSET] - 0x80000000; \
+ if( v > 32767) { *(samples) = 0x7fff; (clip)++; } \
+ else if( v < -32768) { *(samples) = -0x8000; (clip)++; } \
+ else { *(samples) = v; } \
+}
+
+#else
+/* Macro to produce a short (signed 16bit) output sample from internal representation,
+ which may be float, double or indeed some integer for fixed point handling. */
+#define WRITE_SHORT_SAMPLE(samples,sum,clip) \
+ if( (sum) > REAL_PLUS_32767) { *(samples) = 0x7fff; (clip)++; } \
+ else if( (sum) < REAL_MINUS_32768) { *(samples) = -0x8000; (clip)++; } \
+ else { *(samples) = REAL_TO_SHORT(sum); }
+#endif
+
+/* Same as above, but always using accurate rounding. Would we want softer clipping here, too? */
+#define WRITE_SHORT_SAMPLE_ACCURATE(samples,sum,clip) \
+ if( (sum) > REAL_PLUS_32767) { *(samples) = 0x7fff; (clip)++; } \
+ else if( (sum) < REAL_MINUS_32768) { *(samples) = -0x8000; (clip)++; } \
+ else { *(samples) = REAL_TO_SHORT_ACCURATE(sum); }
+
+/*
+ 32bit signed
+ We do clipping with the same old borders... but different conversion.
+ We see here that we need extra work for non-16bit output... we optimized for 16bit.
+ -0x7fffffff-1 is the minimum 32 bit signed integer value expressed so that MSVC
+ does not give a compile time warning.
+*/
+#define WRITE_S32_SAMPLE(samples,sum,clip) \
+ { \
+ real tmpsum = REAL_MUL((sum),S32_RESCALE); \
+ if( tmpsum > REAL_PLUS_S32 ){ *(samples) = 0x7fffffff; (clip)++; } \
+ else if( tmpsum < REAL_MINUS_S32 ) { *(samples) = -0x7fffffff-1; (clip)++; } \
+ else { *(samples) = REAL_TO_S32(tmpsum); } \
+ }
+
+/* Produce an 8bit sample, via 16bit intermediate. */
+#define WRITE_8BIT_SAMPLE(samples,sum,clip) \
+{ \
+ int16_t write_8bit_tmp; \
+ if( (sum) > REAL_PLUS_32767) { write_8bit_tmp = 0x7fff; (clip)++; } \
+ else if( (sum) < REAL_MINUS_32768) { write_8bit_tmp = -0x8000; (clip)++; } \
+ else { write_8bit_tmp = REAL_TO_SHORT(sum); } \
+ *(samples) = fr->conv16to8[write_8bit_tmp>>AUSHIFT]; \
+}
+#ifndef REAL_IS_FIXED
+#define WRITE_REAL_SAMPLE(samples,sum,clip) *(samples) = ((real)1./SHORT_SCALE)*(sum)
+#endif
+
+/* Finished 32 bit sample to unsigned 32 bit sample. */
+#define CONV_SU32(s) \
+( (s >= 0) \
+ ? ((uint32_t)s + (uint32_t)2147483648UL) \
+ : (s == -2147483647L-1L /* Work around to prevent a non-conformant MSVC warning/error */ \
+ ? 0 /* Separate because negation would overflow. */ \
+ : (uint32_t)2147483648UL - (uint32_t)(-s) ) \
+)
+
+/* Finished 16 bit sample to unsigned 16 bit sample. */
+#define CONV_SU16(s) (uint16_t)((int32_t)(s)+32768)
+
+/* Same style for syn123 generic conversion. */
+#define CONV_SU8(s) (uint8_t)((int16_t)s+128)
+
+/* Unsigned 32 bit sample to signed 32 bit sample. */
+#define CONV_US32(u) \
+( (u >= 2147483648UL) \
+ ? (int32_t)((uint32_t)u - (uint32_t)2147483648UL) \
+ : ((u == 0) \
+ ? (int32_t)(-2147483647L-1L) \
+ : -(int32_t)((uint32_t)2147483648UL - u) ) \
+)
+
+/* Unsigned 16 bit sample to signed 16 bit sample. */
+#define CONV_US16(s) (int16_t)((int32_t)s-32768)
+
+/* Same style for syn123 generic conversion. */
+#define CONV_US8(s) (int8_t)((int16_t)s-128)
+
+/* 24 bit conversion: drop or add a least significant byte. */
+#ifdef WORDS_BIGENDIAN
+/* Highest byte first. Drop last. */
+#define DROP4BYTE(w,r) {(w)[0]=(r)[0]; (w)[1]=(r)[1]; (w)[2]=(r)[2];}
+#define ADD4BYTE(w,r) {(w)[0]=(r)[0]; (w)[1]=(r)[1]; (w)[2]=(r)[2]; (w)[3]=0;}
+#else
+/* Lowest byte first, drop that. */
+#define DROP4BYTE(w,r) {(w)[0]=(r)[1]; (w)[1]=(r)[2]; (w)[2]=(r)[3];}
+#define ADD4BYTE(w,r) {(w)[0]=0; (w)[1]=(r)[0]; (w)[2]=(r)[1]; (w)[3]=(r)[2];}
+#endif
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/stringbuf.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/stringbuf.c
new file mode 100644
index 00000000..fb3b8306
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/stringbuf.c
@@ -0,0 +1,250 @@
+/*
+ stringbuf: mimicking a bit of C++ to more safely handle strings
+
+ copyright 2006-20 by the mpg123 project
+ - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis
+*/
+
+#include "mpg123lib_intern.h"
+#include "config.h"
+#include "mpg123.h"
+#include "compat.h"
+#include <string.h>
+#include "debug.h"
+
+mpg123_string* attribute_align_arg mpg123_new_string(const char *val)
+{
+ mpg123_string *sb = malloc(sizeof(mpg123_string));
+ if(!sb)
+ return NULL;
+ mpg123_init_string(sb);
+ mpg123_set_string(sb, val);
+ return sb;
+}
+
+void attribute_align_arg mpg123_delete_string(mpg123_string* sb)
+{
+ if(!sb)
+ return;
+ mpg123_free_string(sb);
+ free(sb);
+}
+
+void attribute_align_arg mpg123_init_string(mpg123_string* sb)
+{
+ /* Handing in NULL here is a fatal mistake and rightfully so. */
+ sb->p = NULL;
+ sb->size = 0;
+ sb->fill = 0;
+}
+
+void attribute_align_arg mpg123_free_string(mpg123_string* sb)
+{
+ if(!sb)
+ return;
+ if(sb->p != NULL) free(sb->p);
+ mpg123_init_string(sb);
+}
+
+int attribute_align_arg mpg123_grow_string(mpg123_string* sb, size_t new)
+{
+ if(!sb)
+ return 0;
+ if(sb->size < new) return mpg123_resize_string(sb, new);
+ else return 1;
+}
+
+int attribute_align_arg mpg123_resize_string(mpg123_string* sb, size_t new)
+{
+ if(!sb)
+ return 0;
+ debug3("resizing string pointer %p from %lu to %lu", (void*) sb->p, (unsigned long)sb->size, (unsigned long)new);
+ if(new == 0)
+ {
+ if(sb->size && sb->p != NULL) free(sb->p);
+ mpg123_init_string(sb);
+ return 1;
+ }
+ if(sb->size != new)
+ {
+ char* t;
+ debug("really!");
+ t = (char*) safe_realloc(sb->p, new*sizeof(char));
+ debug1("safe_realloc returned %p", (void*) t);
+ if(t != NULL)
+ {
+ sb->p = t;
+ sb->size = new;
+ if(sb->size < sb->fill)
+ {
+ // Cut short the existing data, properly.
+ sb->fill = sb->size;
+ sb->p[sb->fill-1] = 0;
+ }
+ return 1;
+ }
+ else return 0;
+ }
+ else return 1; /* success */
+}
+
+int attribute_align_arg mpg123_copy_string(mpg123_string* from, mpg123_string* to)
+{
+ size_t fill;
+ char *text;
+
+ debug2("called copy_string with %p -> %p", (void*)from, (void*)to);
+ if(to == NULL)
+ return 0;
+ if(from == NULL)
+ {
+ fill = 0;
+ text = NULL;
+ }
+ else
+ {
+ fill = from->fill;
+ text = from->p;
+ }
+
+ if(mpg123_resize_string(to, fill))
+ {
+ if(fill) /* Avoid memcpy(NULL, NULL, 0) */
+ memcpy(to->p, text, fill);
+ to->fill = fill;
+ return 1;
+ }
+ else return 0;
+}
+
+int attribute_align_arg mpg123_move_string(mpg123_string *from, mpg123_string *to)
+{
+ if(to)
+ mpg123_free_string(to);
+ else
+ mpg123_free_string(from);
+ if(from && to)
+ *to = *from;
+ if(from)
+ mpg123_init_string(from);
+ return (from && to) ? 1 : 0;
+}
+
+int attribute_align_arg mpg123_add_string(mpg123_string* sb, const char* stuff)
+{
+ debug1("adding %s", stuff);
+ return mpg123_add_substring(sb, stuff, 0, stuff ? strlen(stuff) : 0);
+}
+
+int attribute_align_arg mpg123_add_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count)
+{
+ debug("adding a substring");
+ if(!sb || !stuff)
+ return 0;
+ if(sb->fill) /* includes zero byte... */
+ {
+ if( (SIZE_MAX - sb->fill >= count) /* Avoid overflow. */
+ && (sb->size >= sb->fill+count || mpg123_grow_string(sb, sb->fill+count)) )
+ {
+ memcpy(sb->p+sb->fill-1, stuff+from, count);
+ sb->fill += count;
+ sb->p[sb->fill-1] = 0; /* Terminate! */
+ }
+ else return 0;
+ }
+ else
+ {
+ if( count < SIZE_MAX && mpg123_grow_string(sb, count+1) )
+ {
+ memcpy(sb->p, stuff+from, count);
+ sb->fill = count+1;
+ sb->p[sb->fill-1] = 0; /* Terminate! */
+ }
+ else return 0;
+ }
+ return 1;
+}
+
+int attribute_align_arg mpg123_set_substring(mpg123_string* sb, const char* stuff, size_t from, size_t count)
+{
+ if(!sb)
+ return 0;
+ sb->fill = 0;
+ return mpg123_add_substring(sb, stuff, from, count);
+}
+
+int attribute_align_arg mpg123_set_string(mpg123_string* sb, const char* stuff)
+{
+ if(!sb)
+ return 0;
+ sb->fill = 0;
+ return mpg123_add_string(sb, stuff);
+}
+
+size_t attribute_align_arg mpg123_strlen(mpg123_string *sb, int utf8)
+{
+ size_t i;
+ size_t bytelen;
+
+ /* Notions of empty string. If there's only a single character, it has to be the trailing zero, and if the first is the trailing zero anyway, we got empty. */
+ if(!sb || sb->fill < 2 || sb->p[0] == 0) return 0;
+
+ /* Find the first non-null character from the back.
+ We already established that the first character is non-null
+ That at fill-2 has to be null, though. */
+ for(i=sb->fill-2; i>0; --i)
+ if(sb->p[i] != 0) break;
+
+ /* For simple byte strings, we are done now. */
+ bytelen = i+1;
+
+ if(!utf8) return bytelen;
+ else
+ {
+ /* Work out the actual count of UTF8 bytes.
+ This employs no particular encoding error checking. */
+ size_t len = 0;
+ for(i=0; i<bytelen; ++i)
+ {
+ /* Every byte that is not a continuation byte ( 0xc0 == 10xx xxxx ) stands for a character. */
+ if((sb->p[i] & 0xc0) != 0x80) len++;
+ }
+ return len;
+ }
+}
+
+int attribute_align_arg mpg123_chomp_string(mpg123_string *sb)
+{
+ ssize_t i;
+ if(!sb || !sb->fill) return 0;
+
+ /* Ensure that it is zero-terminated. */
+ sb->p[sb->fill-1] = 0;
+ for(i=sb->fill-2; i>=0; --i)
+ {
+ char *c = sb->p+i;
+ /* Stop at the first proper character. */
+ if(*c && *c != '\r' && *c != '\n') break;
+ else *c = 0;
+ }
+ /* initial fill at least 1, so i at least -1,
+ +2 means nothing happened for fill=1 .
+ With i=0, we got one non-null character, fill shall be 2
+ to accomodate the trailing zero. */
+ sb->fill = (size_t)i+2;
+
+ return 1;
+}
+
+int attribute_align_arg mpg123_same_string(mpg123_string *a, mpg123_string *b)
+{
+ if(!a || !b)
+ return 0;
+ if(a->fill != b->fill)
+ return 0;
+ if(memcmp(a->p, b->p, a->fill))
+ return 0;
+ return 1;
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/swap_bytes_impl.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/swap_bytes_impl.h
new file mode 100644
index 00000000..28e7ff48
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/swap_bytes_impl.h
@@ -0,0 +1,103 @@
+/*
+ swap_bytes: Swap byte order of samples in a buffer.
+
+ copyright 2018 by the mpg123 project
+ licensed under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+
+ initially written by Thomas Orgis
+
+ This is C source to include in your code to get the function named
+ swap_bytes. It is serves intentional duplication in libmpg123 and
+ libsyn123 to avoid introducing a dependency between them. This function
+ is too small for that.
+*/
+
+/* Other headers are already included! */
+
+/* Optionally use platform-specific byteswap macros. */
+#ifdef HAVE_BYTESWAP_H
+#include <byteswap.h>
+#endif
+
+/* Plain stupid swapping of elements in a byte array. */
+/* This is the fallback when there is no native bswap macro. */
+#define SWAP(a,b) tmp = p[a]; p[a] = p[b]; p[b] = tmp;
+
+/* Convert samplecount elements of samplesize bytes each in buffer buf. */
+static void swap_bytes(void *buf, size_t samplesize, size_t samplecount)
+{
+ unsigned char *p = buf;
+ unsigned char *pend = (unsigned char*)buf+samplesize*samplecount;
+ unsigned char tmp;
+
+ if(samplesize < 2)
+ return;
+ switch(samplesize)
+ {
+ case 2: /* AB -> BA */
+#ifdef HAVE_BYTESWAP_H
+ {
+ uint16_t* pp = (uint16_t*)p;
+ for(; pp<(uint16_t*)pend; ++pp)
+ *pp = bswap_16(*pp);
+ }
+#else
+ for(; p<pend; p+=2)
+ {
+ SWAP(0,1)
+ }
+#endif
+ break;
+ case 3: /* ABC -> CBA */
+ for(; p<pend; p+=3)
+ {
+ SWAP(0,2)
+ }
+ break;
+ case 4: /* ABCD -> DCBA */
+#ifdef HAVE_BYTESWAP_H
+ {
+ uint32_t* pp = (uint32_t*)p;
+ for(; pp<(uint32_t*)pend; ++pp)
+ *pp = bswap_32(*pp);
+ }
+#else
+ for(; p<pend; p+=4)
+ {
+ SWAP(0,3)
+ SWAP(1,2)
+ }
+#endif
+ break;
+ case 8: /* ABCDEFGH -> HGFEDCBA */
+#ifdef HAVE_BYTESWAP_H
+ {
+ uint64_t* pp = (uint64_t*)p;
+ for(; pp<(uint64_t*)pend; ++pp)
+ *pp = bswap_64(*pp);
+ }
+#else
+ for(; p<pend; p+=8)
+ {
+ SWAP(0,7)
+ SWAP(1,6)
+ SWAP(2,5)
+ SWAP(3,4)
+ }
+#endif
+ break;
+ /* All the weird choices with the full nested loop. */
+ default:
+ for(; p<pend; p+=samplesize)
+ {
+ size_t j;
+ for(j=0; j<samplesize/2; ++j)
+ {
+ SWAP(j, samplesize-j-1)
+ }
+ }
+ }
+}
+
+#undef SWAP
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth.c
new file mode 100644
index 00000000..ed927d93
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth.c
@@ -0,0 +1,1192 @@
+/*
+ synth.c: The functions for synthesizing samples, at the end of decoding.
+
+ copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp, heavily dissected and rearranged by Thomas Orgis
+*/
+
+#include "mpg123lib_intern.h"
+#ifdef OPT_GENERIC_DITHER
+#define FORCE_ACCURATE
+#endif
+#include "sample.h"
+#include "debug.h"
+
+/*
+ Part 1: All synth functions that produce signed short.
+ That is:
+ - synth_1to1 with cpu-specific variants (synth_1to1_i386, synth_1to1_i586 ...)
+ - synth_1to1_mono and synth_1to1_m2s; which use fr->synths.plain[r_1to1][f_16].
+ Nearly every decoder variant has it's own synth_1to1, while the mono conversion is shared.
+*/
+
+#define SAMPLE_T short
+#define WRITE_SAMPLE(samples,sum,clip) WRITE_SHORT_SAMPLE(samples,sum,clip)
+
+/* Part 1a: All straight 1to1 decoding functions */
+#define BLOCK 0x40 /* One decoding block is 64 samples. */
+
+#define SYNTH_NAME synth_1to1
+#include "synth.h"
+#undef SYNTH_NAME
+
+/* Mono-related synths; they wrap over _some_ synth_1to1. */
+#define SYNTH_NAME fr->synths.plain[r_1to1][f_16]
+#define MONO_NAME synth_1to1_mono
+#define MONO2STEREO_NAME synth_1to1_m2s
+#include "synth_mono.h"
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+/* Now we have possibly some special synth_1to1 ...
+ ... they produce signed short; the mono functions defined above work on the special synths, too. */
+
+#ifdef OPT_GENERIC_DITHER
+#define SYNTH_NAME synth_1to1_dither
+/* We need the accurate sample writing... */
+#undef WRITE_SAMPLE
+#define WRITE_SAMPLE(samples,sum,clip) WRITE_SHORT_SAMPLE_ACCURATE(samples,sum,clip)
+
+#define USE_DITHER
+#include "synth.h"
+#undef USE_DITHER
+#undef SYNTH_NAME
+
+#undef WRITE_SAMPLE
+#define WRITE_SAMPLE(samples,sum,clip) WRITE_SHORT_SAMPLE(samples,sum,clip)
+
+#endif
+
+#ifdef OPT_X86
+/* The i386-specific C code, here as short variant, later 8bit and float. */
+#define NO_AUTOINCREMENT
+#define SYNTH_NAME synth_1to1_i386
+#include "synth.h"
+#undef SYNTH_NAME
+/* i386 uses the normal mono functions. */
+#undef NO_AUTOINCREMENT
+#endif
+
+#undef BLOCK /* Following functions are so special that they don't need this. */
+
+#ifdef OPT_I586
+/* This is defined in assembler. */
+int synth_1to1_i586_asm(real *bandPtr, int channel, unsigned char *out, unsigned char *buffs, int *bo, real *decwin);
+/* This is just a hull to use the mpg123 handle. */
+int synth_1to1_i586(real *bandPtr, int channel, mpg123_handle *fr, int final)
+{
+ int ret;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ ret = synth_1to1_i586_asm(bandPtr, channel, fr->buffer.data+fr->buffer.fill, fr->rawbuffs, &fr->bo, fr->decwin);
+ if(final) fr->buffer.fill += 128;
+ return ret;
+}
+#endif
+
+#ifdef OPT_I586_DITHER
+/* This is defined in assembler. */
+int synth_1to1_i586_asm_dither(real *bandPtr, int channel, unsigned char *out, unsigned char *buffs, int *bo, real *decwin, float *dithernoise);
+/* This is just a hull to use the mpg123 handle. */
+int synth_1to1_i586_dither(real *bandPtr, int channel, mpg123_handle *fr, int final)
+{
+ int ret;
+ int bo_dither[2]; /* Temporary workaround? Could expand the asm code. */
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ /* Applying this hack, to change the asm only bit by bit (adding dithernoise pointer). */
+ bo_dither[0] = fr->bo;
+ bo_dither[1] = fr->ditherindex;
+ ret = synth_1to1_i586_asm_dither(bandPtr, channel, fr->buffer.data+fr->buffer.fill, fr->rawbuffs, bo_dither, fr->decwin, fr->dithernoise);
+ fr->bo = bo_dither[0];
+ fr->ditherindex = bo_dither[1];
+
+ if(final) fr->buffer.fill += 128;
+ return ret;
+}
+#endif
+
+#if defined(OPT_3DNOW) || defined(OPT_3DNOW_VINTAGE)
+/* Those are defined in assembler. */
+void do_equalizer_3dnow(real *bandPtr,int channel, real equalizer[2][32]);
+int synth_1to1_3dnow_asm(real *bandPtr, int channel, unsigned char *out, unsigned char *buffs, int *bo, real *decwin);
+/* This is just a hull to use the mpg123 handle. */
+int synth_1to1_3dnow(real *bandPtr, int channel, mpg123_handle *fr, int final)
+{
+ int ret;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer_3dnow(bandPtr,channel,fr->equalizer);
+#endif
+ /* this is in asm, can be dither or not */
+ /* uh, is this return from pointer correct? */
+ ret = (int) synth_1to1_3dnow_asm(bandPtr, channel, fr->buffer.data+fr->buffer.fill, fr->rawbuffs, &fr->bo, fr->decwin);
+ if(final) fr->buffer.fill += 128;
+ return ret;
+}
+#endif
+
+#ifdef OPT_MMX
+/* This is defined in assembler. */
+int synth_1to1_MMX(real *bandPtr, int channel, short *out, short *buffs, int *bo, float *decwins);
+/* This is just a hull to use the mpg123 handle. */
+int synth_1to1_mmx(real *bandPtr, int channel, mpg123_handle *fr, int final)
+{
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ /* in asm */
+ synth_1to1_MMX(bandPtr, channel, (short*) (fr->buffer.data+fr->buffer.fill), (short *) fr->rawbuffs, &fr->bo, fr->decwins);
+ if(final) fr->buffer.fill += 128;
+ return 0;
+}
+#endif
+
+#if defined(OPT_SSE) || defined(OPT_SSE_VINTAGE)
+#ifdef ACCURATE_ROUNDING
+/* This is defined in assembler. */
+int synth_1to1_sse_accurate_asm(real *window, real *b0, short *samples, int bo1);
+int synth_1to1_s_sse_accurate_asm(real *window, real *b0l, real *b0r, short *samples, int bo1);
+void dct64_real_sse(real *out0, real *out1, real *samples);
+/* This is just a hull to use the mpg123 handle. */
+int synth_1to1_sse(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+ real *b0, **buf;
+ int clip;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_real_sse(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_real_sse(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ clip = synth_1to1_sse_accurate_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 128;
+
+ return clip;
+}
+
+int synth_1to1_stereo_sse(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_real_sse(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_real_sse(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_real_sse(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_real_sse(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ clip = synth_1to1_s_sse_accurate_asm(fr->decwin, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 128;
+
+ return clip;
+}
+#else
+/* This is defined in assembler. */
+void synth_1to1_sse_asm(real *bandPtr, int channel, short *samples, short *buffs, int *bo, real *decwin);
+/* This is just a hull to use the mpg123 handle. */
+int synth_1to1_sse(real *bandPtr, int channel, mpg123_handle *fr, int final)
+{
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ synth_1to1_sse_asm(bandPtr, channel, (short*) (fr->buffer.data+fr->buffer.fill), (short *) fr->rawbuffs, &fr->bo, fr->decwins);
+ if(final) fr->buffer.fill += 128;
+ return 0;
+}
+#endif
+#endif
+
+#if defined(OPT_3DNOWEXT) || defined(OPT_3DNOWEXT_VINTAGE)
+/* This is defined in assembler. */
+void synth_1to1_3dnowext_asm(real *bandPtr, int channel, short *samples, short *buffs, int *bo, real *decwin);
+/* This is just a hull to use the mpg123 handle. */
+int synth_1to1_3dnowext(real *bandPtr, int channel, mpg123_handle *fr, int final)
+{
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ synth_1to1_3dnowext_asm(bandPtr, channel, (short*) (fr->buffer.data+fr->buffer.fill), (short *) fr->rawbuffs, &fr->bo, fr->decwins);
+ if(final) fr->buffer.fill += 128;
+ return 0;
+}
+#endif
+
+#ifdef OPT_X86_64
+#ifdef ACCURATE_ROUNDING
+/* Assembler routines. */
+int synth_1to1_x86_64_accurate_asm(real *window, real *b0, short *samples, int bo1);
+int synth_1to1_s_x86_64_accurate_asm(real *window, real *b0l, real *b0r, short *samples, int bo1);
+void dct64_real_x86_64(real *out0, real *out1, real *samples);
+/* Hull for C mpg123 API */
+int synth_1to1_x86_64(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_real_x86_64(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_real_x86_64(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ clip = synth_1to1_x86_64_accurate_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 128;
+
+ return clip;
+}
+
+int synth_1to1_stereo_x86_64(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_real_x86_64(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_real_x86_64(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_real_x86_64(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_real_x86_64(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ clip = synth_1to1_s_x86_64_accurate_asm(fr->decwin, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 128;
+
+ return clip;
+}
+#else
+/* This is defined in assembler. */
+int synth_1to1_x86_64_asm(short *window, short *b0, short *samples, int bo1);
+int synth_1to1_s_x86_64_asm(short *window, short *b0l, short *b0r, short *samples, int bo1);
+void dct64_x86_64(short *out0, short *out1, real *samples);
+/* This is just a hull to use the mpg123 handle. */
+int synth_1to1_x86_64(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+ short *b0, **buf;
+ int clip;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->short_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->short_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_x86_64(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_x86_64(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ clip = synth_1to1_x86_64_asm((short *)fr->decwins, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 128;
+
+ return clip;
+}
+
+int synth_1to1_stereo_x86_64(real *bandPtr_l,real *bandPtr_r, mpg123_handle *fr)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+ short *b0l, *b0r, **bufl, **bufr;
+ int clip;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->short_buffs[0];
+ bufr = fr->short_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_x86_64(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_x86_64(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_x86_64(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_x86_64(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ clip = synth_1to1_s_x86_64_asm((short *)fr->decwins, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 128;
+
+ return clip;
+}
+#endif
+#endif
+
+#ifdef OPT_AVX
+#ifdef ACCURATE_ROUNDING
+/* Assembler routines. */
+#ifndef OPT_X86_64
+int synth_1to1_x86_64_accurate_asm(real *window, real *b0, short *samples, int bo1);
+#endif
+int synth_1to1_s_avx_accurate_asm(real *window, real *b0l, real *b0r, short *samples, int bo1);
+void dct64_real_avx(real *out0, real *out1, real *samples);
+/* Hull for C mpg123 API */
+int synth_1to1_avx(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_real_avx(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_real_avx(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ clip = synth_1to1_x86_64_accurate_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 128;
+
+ return clip;
+}
+
+int synth_1to1_stereo_avx(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_real_avx(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_real_avx(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_real_avx(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_real_avx(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ clip = synth_1to1_s_avx_accurate_asm(fr->decwin, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 128;
+
+ return clip;
+}
+#else
+/* This is defined in assembler. */
+#ifndef OPT_X86_64
+int synth_1to1_x86_64_asm(short *window, short *b0, short *samples, int bo1);
+#endif
+int synth_1to1_s_avx_asm(short *window, short *b0l, short *b0r, short *samples, int bo1);
+void dct64_avx(short *out0, short *out1, real *samples);
+/* This is just a hull to use the mpg123 handle. */
+int synth_1to1_avx(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+ short *b0, **buf;
+ int clip;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->short_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->short_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_avx(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_avx(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ clip = synth_1to1_x86_64_asm((short *)fr->decwins, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 128;
+
+ return clip;
+}
+
+int synth_1to1_stereo_avx(real *bandPtr_l,real *bandPtr_r, mpg123_handle *fr)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+ short *b0l, *b0r, **bufl, **bufr;
+ int clip;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->short_buffs[0];
+ bufr = fr->short_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_avx(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_avx(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_avx(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_avx(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ clip = synth_1to1_s_avx_asm((short *)fr->decwins, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 128;
+
+ return clip;
+}
+#endif
+#endif
+
+#ifdef OPT_ARM
+#ifdef ACCURATE_ROUNDING
+/* Assembler routines. */
+int synth_1to1_arm_accurate_asm(real *window, real *b0, short *samples, int bo1);
+/* Hull for C mpg123 API */
+int synth_1to1_arm(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ clip = synth_1to1_arm_accurate_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 128;
+
+ return clip;
+}
+#else
+/* Assembler routines. */
+int synth_1to1_arm_asm(real *window, real *b0, short *samples, int bo1);
+/* Hull for C mpg123 API */
+int synth_1to1_arm(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ clip = synth_1to1_arm_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 128;
+
+ return clip;
+}
+#endif
+#endif
+
+#ifdef OPT_NEON
+#ifdef ACCURATE_ROUNDING
+/* This is defined in assembler. */
+int synth_1to1_neon_accurate_asm(real *window, real *b0, short *samples, int bo1);
+int synth_1to1_s_neon_accurate_asm(real *window, real *b0l, real *b0r, short *samples, int bo1);
+void dct64_real_neon(real *out0, real *out1, real *samples);
+/* Hull for C mpg123 API */
+int synth_1to1_neon(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_real_neon(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_real_neon(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ clip = synth_1to1_neon_accurate_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 128;
+
+ return clip;
+}
+
+int synth_1to1_stereo_neon(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_real_neon(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_real_neon(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_real_neon(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_real_neon(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ clip = synth_1to1_s_neon_accurate_asm(fr->decwin, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 128;
+
+ return clip;
+}
+#else
+/* This is defined in assembler. */
+int synth_1to1_neon_asm(short *window, short *b0, short *samples, int bo1);
+int synth_1to1_s_neon_asm(short *window, short *b0l, short *b0r, short *samples, int bo1);
+void dct64_neon(short *out0, short *out1, real *samples);
+/* Hull for C mpg123 API */
+int synth_1to1_neon(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+ short *b0, **buf;
+ int clip;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->short_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->short_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_neon(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_neon(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ clip = synth_1to1_neon_asm((short *)fr->decwins, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 128;
+
+ return clip;
+}
+
+int synth_1to1_stereo_neon(real *bandPtr_l,real *bandPtr_r, mpg123_handle *fr)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+ short *b0l, *b0r, **bufl, **bufr;
+ int clip;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->short_buffs[0];
+ bufr = fr->short_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_neon(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_neon(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_neon(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_neon(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ clip = synth_1to1_s_neon_asm((short *)fr->decwins, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 128;
+
+ return clip;
+}
+#endif
+#endif
+
+#ifdef OPT_NEON64
+#ifdef ACCURATE_ROUNDING
+/* This is defined in assembler. */
+int synth_1to1_neon64_accurate_asm(real *window, real *b0, short *samples, int bo1);
+int synth_1to1_s_neon64_accurate_asm(real *window, real *b0l, real *b0r, short *samples, int bo1);
+void dct64_real_neon64(real *out0, real *out1, real *samples);
+/* Hull for C mpg123 API */
+int synth_1to1_neon64(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_real_neon64(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_real_neon64(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ clip = synth_1to1_neon64_accurate_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 128;
+
+ return clip;
+}
+
+int synth_1to1_stereo_neon64(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_real_neon64(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_real_neon64(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_real_neon64(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_real_neon64(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ clip = synth_1to1_s_neon64_accurate_asm(fr->decwin, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 128;
+
+ return clip;
+}
+#else
+/* This is defined in assembler. */
+int synth_1to1_neon64_asm(short *window, short *b0, short *samples, int bo1);
+int synth_1to1_s_neon64_asm(short *window, short *b0l, short *b0r, short *samples, int bo1);
+void dct64_neon64(short *out0, short *out1, real *samples);
+/* Hull for C mpg123 API */
+int synth_1to1_neon64(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+ short *b0, **buf;
+ int clip;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->short_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->short_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_neon64(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_neon64(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ clip = synth_1to1_neon64_asm((short *)fr->decwins, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 128;
+
+ return clip;
+}
+
+int synth_1to1_stereo_neon64(real *bandPtr_l,real *bandPtr_r, mpg123_handle *fr)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+ short *b0l, *b0r, **bufl, **bufr;
+ int clip;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->short_buffs[0];
+ bufr = fr->short_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_neon64(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_neon64(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_neon64(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_neon64(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ clip = synth_1to1_s_neon64_asm((short *)fr->decwins, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 128;
+
+ return clip;
+}
+#endif
+#endif
+
+#ifndef NO_DOWNSAMPLE
+
+/*
+ Part 1b: 2to1 synth.
+ Only generic and i386 functions this time.
+*/
+#define BLOCK 0x20 /* One decoding block is 32 samples. */
+
+#define SYNTH_NAME synth_2to1
+#include "synth.h"
+#undef SYNTH_NAME
+
+#ifdef OPT_DITHER /* Used for generic_dither and as fallback for i586_dither. */
+#define SYNTH_NAME synth_2to1_dither
+#define USE_DITHER
+#include "synth.h"
+#undef USE_DITHER
+#undef SYNTH_NAME
+#endif
+
+#define SYNTH_NAME fr->synths.plain[r_2to1][f_16]
+#define MONO_NAME synth_2to1_mono
+#define MONO2STEREO_NAME synth_2to1_m2s
+#include "synth_mono.h"
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+#ifdef OPT_X86
+#define NO_AUTOINCREMENT
+#define SYNTH_NAME synth_2to1_i386
+#include "synth.h"
+#undef SYNTH_NAME
+/* i386 uses the normal mono functions. */
+#undef NO_AUTOINCREMENT
+#endif
+
+#undef BLOCK
+
+/*
+ Part 1c: 4to1 synth.
+ Same procedure as above...
+*/
+#define BLOCK 0x10 /* One decoding block is 16 samples. */
+
+#define SYNTH_NAME synth_4to1
+#include "synth.h"
+#undef SYNTH_NAME
+
+#ifdef OPT_DITHER
+#define SYNTH_NAME synth_4to1_dither
+#define USE_DITHER
+#include "synth.h"
+#undef USE_DITHER
+#undef SYNTH_NAME
+#endif
+
+#define SYNTH_NAME fr->synths.plain[r_4to1][f_16] /* This is just for the _i386 one... gotta check if it is really useful... */
+#define MONO_NAME synth_4to1_mono
+#define MONO2STEREO_NAME synth_4to1_m2s
+#include "synth_mono.h"
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+#ifdef OPT_X86
+#define NO_AUTOINCREMENT
+#define SYNTH_NAME synth_4to1_i386
+#include "synth.h"
+#undef SYNTH_NAME
+/* i386 uses the normal mono functions. */
+#undef NO_AUTOINCREMENT
+#endif
+
+#undef BLOCK
+
+#endif /* NO_DOWNSAMPLE */
+
+#ifndef NO_NTOM
+/*
+ Part 1d: ntom synth.
+ Same procedure as above... Just no extra play anymore, straight synth that uses the plain dct64.
+*/
+
+/* These are all in one header, there's no flexibility to gain. */
+#define SYNTH_NAME synth_ntom
+#define MONO_NAME synth_ntom_mono
+#define MONO2STEREO_NAME synth_ntom_m2s
+#include "synth_ntom.h"
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+#endif
+
+/* Done with short output. */
+#undef SAMPLE_T
+#undef WRITE_SAMPLE
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth.h
new file mode 100644
index 00000000..87dd0075
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth.h
@@ -0,0 +1,196 @@
+/*
+ synth.h: generic synth functions
+
+ copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp, generalized by Thomas Orgis
+
+ This header is used multiple times to create different variants of these functions.
+ See decode.c and friends.
+ Hint: BLOCK, MONO_NAME, MONO2STEREO_NAME, SYNTH_NAME and SAMPLE_T as well as WRITE_SAMPLE do vary.
+
+ Thomas looked closely at the decode_1to1, decode_2to1 and decode_4to1 contents, seeing that they are too similar to be separate files.
+ This is what resulted...
+
+ Basically, you need one set of these functions for each output sample type.
+ That currently means signed short, 8bit or float/double; though unsigned short may come, too.
+
+ Define NO_AUTOINCREMENT i386 code that shall not rely on autoincrement.
+ Actual benefit of this has to be examined; may apply to specific (old) compilers, only.
+*/
+
+
+/* Main synth function, uses the plain dct64 or dct64_i386. */
+int SYNTH_NAME(real *bandPtr, int channel, mpg123_handle *fr, int final)
+{
+#ifndef NO_AUTOINCREMENT
+#define BACKPEDAL 0x10 /* We use autoincrement and thus need this re-adjustment for window/b0. */
+#define MY_DCT64 dct64
+#else
+#define BACKPEDAL 0x00 /* i386 code does not need that. */
+#define MY_DCT64 dct64_i386
+#endif
+ static const int step = 2;
+ SAMPLE_T *samples = (SAMPLE_T *) (fr->buffer.data + fr->buffer.fill);
+
+ real *b0, **buf; /* (*buf)[0x110]; */
+ int clip = 0;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+#ifdef USE_DITHER
+ /* We always go forward 32 dither points (and back again for the second channel),
+ (re)sampling the noise the same way as the original signal. */
+ fr->ditherindex -= 32;
+#endif
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+#ifdef USE_DITHER
+ /* We check only once for the overflow of dither index here ...
+ this wraps differently than the original i586 dither code, in theory (but when DITHERSIZE % BLOCK/2 == 0 it's the same). */
+ if(DITHERSIZE-fr->ditherindex < 32) fr->ditherindex = 0;
+ /* And we define a macro for the dither action... */
+ #define ADD_DITHER(fr,sum) sum+=fr->dithernoise[fr->ditherindex]; fr->ditherindex += 64/BLOCK;
+#else
+ #define ADD_DITHER(fr,sum)
+#endif
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ MY_DCT64(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ MY_DCT64(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ {
+ register int j;
+ real *window = fr->decwin + 16 - bo1;
+
+ for(j=(BLOCK/4); j; j--, b0+=0x400/BLOCK-BACKPEDAL, window+=0x800/BLOCK-BACKPEDAL, samples+=step)
+ {
+ real sum;
+#ifndef NO_AUTOINCREMENT
+ sum = REAL_MUL_SYNTH(*window++, *b0++);
+ sum -= REAL_MUL_SYNTH(*window++, *b0++);
+ sum += REAL_MUL_SYNTH(*window++, *b0++);
+ sum -= REAL_MUL_SYNTH(*window++, *b0++);
+ sum += REAL_MUL_SYNTH(*window++, *b0++);
+ sum -= REAL_MUL_SYNTH(*window++, *b0++);
+ sum += REAL_MUL_SYNTH(*window++, *b0++);
+ sum -= REAL_MUL_SYNTH(*window++, *b0++);
+ sum += REAL_MUL_SYNTH(*window++, *b0++);
+ sum -= REAL_MUL_SYNTH(*window++, *b0++);
+ sum += REAL_MUL_SYNTH(*window++, *b0++);
+ sum -= REAL_MUL_SYNTH(*window++, *b0++);
+ sum += REAL_MUL_SYNTH(*window++, *b0++);
+ sum -= REAL_MUL_SYNTH(*window++, *b0++);
+ sum += REAL_MUL_SYNTH(*window++, *b0++);
+ sum -= REAL_MUL_SYNTH(*window++, *b0++);
+#else
+ sum = REAL_MUL_SYNTH(window[0x0], b0[0x0]);
+ sum -= REAL_MUL_SYNTH(window[0x1], b0[0x1]);
+ sum += REAL_MUL_SYNTH(window[0x2], b0[0x2]);
+ sum -= REAL_MUL_SYNTH(window[0x3], b0[0x3]);
+ sum += REAL_MUL_SYNTH(window[0x4], b0[0x4]);
+ sum -= REAL_MUL_SYNTH(window[0x5], b0[0x5]);
+ sum += REAL_MUL_SYNTH(window[0x6], b0[0x6]);
+ sum -= REAL_MUL_SYNTH(window[0x7], b0[0x7]);
+ sum += REAL_MUL_SYNTH(window[0x8], b0[0x8]);
+ sum -= REAL_MUL_SYNTH(window[0x9], b0[0x9]);
+ sum += REAL_MUL_SYNTH(window[0xA], b0[0xA]);
+ sum -= REAL_MUL_SYNTH(window[0xB], b0[0xB]);
+ sum += REAL_MUL_SYNTH(window[0xC], b0[0xC]);
+ sum -= REAL_MUL_SYNTH(window[0xD], b0[0xD]);
+ sum += REAL_MUL_SYNTH(window[0xE], b0[0xE]);
+ sum -= REAL_MUL_SYNTH(window[0xF], b0[0xF]);
+#endif
+
+ ADD_DITHER(fr,sum)
+ WRITE_SAMPLE(samples,sum,clip);
+ }
+
+ {
+ real sum;
+ sum = REAL_MUL_SYNTH(window[0x0], b0[0x0]);
+ sum += REAL_MUL_SYNTH(window[0x2], b0[0x2]);
+ sum += REAL_MUL_SYNTH(window[0x4], b0[0x4]);
+ sum += REAL_MUL_SYNTH(window[0x6], b0[0x6]);
+ sum += REAL_MUL_SYNTH(window[0x8], b0[0x8]);
+ sum += REAL_MUL_SYNTH(window[0xA], b0[0xA]);
+ sum += REAL_MUL_SYNTH(window[0xC], b0[0xC]);
+ sum += REAL_MUL_SYNTH(window[0xE], b0[0xE]);
+
+ ADD_DITHER(fr,sum)
+ WRITE_SAMPLE(samples,sum,clip);
+ samples += step;
+ b0-=0x400/BLOCK;
+ window-=0x800/BLOCK;
+ }
+ window += bo1<<1;
+
+ for(j=(BLOCK/4)-1; j; j--, b0-=0x400/BLOCK+BACKPEDAL, window-=0x800/BLOCK-BACKPEDAL, samples+=step)
+ {
+ real sum;
+#ifndef NO_AUTOINCREMENT
+ sum = -REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+#else
+ sum = -REAL_MUL_SYNTH(window[-0x1], b0[0x0]);
+ sum -= REAL_MUL_SYNTH(window[-0x2], b0[0x1]);
+ sum -= REAL_MUL_SYNTH(window[-0x3], b0[0x2]);
+ sum -= REAL_MUL_SYNTH(window[-0x4], b0[0x3]);
+ sum -= REAL_MUL_SYNTH(window[-0x5], b0[0x4]);
+ sum -= REAL_MUL_SYNTH(window[-0x6], b0[0x5]);
+ sum -= REAL_MUL_SYNTH(window[-0x7], b0[0x6]);
+ sum -= REAL_MUL_SYNTH(window[-0x8], b0[0x7]);
+ sum -= REAL_MUL_SYNTH(window[-0x9], b0[0x8]);
+ sum -= REAL_MUL_SYNTH(window[-0xA], b0[0x9]);
+ sum -= REAL_MUL_SYNTH(window[-0xB], b0[0xA]);
+ sum -= REAL_MUL_SYNTH(window[-0xC], b0[0xB]);
+ sum -= REAL_MUL_SYNTH(window[-0xD], b0[0xC]);
+ sum -= REAL_MUL_SYNTH(window[-0xE], b0[0xD]);
+ sum -= REAL_MUL_SYNTH(window[-0xF], b0[0xE]);
+ sum -= REAL_MUL_SYNTH(window[-0x0], b0[0xF]); /* Is that right? 0x0? Just wondering... */
+#endif
+ ADD_DITHER(fr,sum)
+ WRITE_SAMPLE(samples,sum,clip);
+ }
+ }
+
+ if(final) fr->buffer.fill += BLOCK*sizeof(SAMPLE_T);
+
+ return clip;
+#undef ADD_DITHER
+#undef BACKPEDAL
+#undef MY_DCT64
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_3dnow.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_3dnow.S
new file mode 100644
index 00000000..8e306ae9
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_3dnow.S
@@ -0,0 +1,345 @@
+/*
+ decode_3dnow.s - 3DNow! optimized synth_1to1()
+
+ copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Syuuhei Kashiyama
+
+ This code based 'decode_3dnow.s' by Syuuhei Kashiyama
+ <squash@mb.kcom.ne.jp>,only two types of changes have been made:
+
+ - remove PREFETCH instruction for speedup
+ - change function name for support 3DNow! automatic detect
+ - femms moved to before 'call dct64_3dnow'
+
+ You can find Kashiyama's original 3dnow! support patch
+ (for mpg123-0.59o) at
+ http://user.ecc.u-tokyo.ac.jp/~g810370/linux-simd/ (Japanese).
+
+ by KIMURA Takuhiro <kim@hannah.ipc.miyakyo-u.ac.jp> - until 31.Mar.1999
+ <kim@comtec.co.jp> - after 1.Apr.1999
+
+
+
+ Replacement of synth_1to1() with AMD's 3DNow! SIMD operations support
+
+ Syuuhei Kashiyama <squash@mb.kcom.ne.jp>
+
+ The author of this program disclaim whole expressed or implied
+ warranties with regard to this program, and in no event shall the
+ author of this program liable to whatever resulted from the use of
+ this program. Use it at your own risk.
+*/
+
+#include "mangle.h"
+
+#ifdef ACCURATE_ROUNDING
+#if !defined (__APPLE__) && !defined (__OS2__)
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN8
+max_s16:
+ .long 1191181824 /* 32767.0 */
+ .long 1191181824
+min_s16:
+ .long -956301312 /* -32768.0 */
+ .long -956301312
+ftoi_magic:
+ .long 1262485504 /* 2^23 + 2^22 */
+ .long 1262485504
+#endif
+ .text
+ ALIGN16
+.globl ASM_NAME(synth_1to1_3dnow_asm)
+/* int synth_1to1_3dnow_asm(real *bandPtr, int channel, unsigned char *out, unsigned char *buffs, int *bo, real *decwin); */
+ASM_NAME(synth_1to1_3dnow_asm):
+ subl $24,%esp
+ pushl %ebp
+ pushl %edi
+ xorl %ebp,%ebp
+ pushl %esi
+ pushl %ebx
+/* stack old: 0=ebx 4=esi 8=edi 12=ebp 16,20,24,28,32,36=local 40=back 44=bandptr 48=channel 52=out 56=pnt */
+/* stack new: 0=ebx 4=esi 8=edi 12=ebp 16,20,24,28,32,36=local 40=back 44=bandptr 48=channel 52=out 56=buffs 60=bo 64=decwin */
+#define OUT 52(%esp)
+#define CHANNEL 48(%esp)
+#define BANDPTR 44(%esp)
+#define BUFFS 56(%esp)
+#define BO 60(%esp)
+#define DECWIN 64(%esp)
+#define LOCAL0 16(%esp)
+#define LOCAL1 20(%esp)
+#define EBXSAVE 24(%esp)
+#define LOCAL5 36(%esp)
+
+#ifdef ACCURATE_ROUNDING
+ #undef _EBX_
+ #define _EBX_ %eax
+ GET_GOT
+ /* FIXME */
+#if PIC
+ movl _EBX_, EBXSAVE
+#endif
+#endif
+ movl OUT,%esi
+ movl %esi,LOCAL0 /* save buffer start (samples pointer) to another local var */
+ movl CHANNEL,%ebx
+ movl BO,%esi /* bo address */
+ movl (%esi),%edx /* bo value */
+
+ femms
+ testl %ebx,%ebx
+ jne .L26
+/* if(!channel) */
+ decl %edx /* --bo */
+ andl $15,%edx
+ movl %edx,(%esi) /* save bo */
+ movl BUFFS,%ecx
+ jmp .L27
+.L26: /* if(channel) */
+ addl $2,LOCAL0 /* samples++ */
+ movl BUFFS,%ecx
+ addl $2176,%ecx
+.L27:
+/* edx (and it's lower end) still holds bo value */
+ testb $1,%dl /* bo & 0x1 */
+ je .L28
+ movl %edx,LOCAL5
+ movl %ecx,%ebx
+ movl BANDPTR,%esi
+ movl %edx,%edi
+ pushl %esi
+ sall $2,%edi
+ movl %ebx,%eax
+ movl %edi,24(%esp) /* LOCAL1, actually */
+ addl %edi,%eax
+ pushl %eax
+ movl %edx,%eax
+ incl %eax
+ andl $15,%eax
+ leal 1088(,%eax,4),%eax
+ addl %ebx,%eax
+ pushl %eax
+ call FUNC(dct64_3dnow)
+ addl $12,%esp
+ jmp .L29
+.L28:
+ leal 1(%edx),%esi
+ movl BANDPTR,%edi
+ movl %esi,LOCAL5
+ leal 1092(%ecx,%edx,4),%eax
+ pushl %edi
+ leal 1088(%ecx),%ebx
+ pushl %eax
+ sall $2,%esi
+ leal (%ecx,%edx,4),%eax
+ pushl %eax
+ call FUNC(dct64_3dnow)
+ addl $12,%esp
+ movl %esi,LOCAL1
+.L29:
+ movl DECWIN,%edx
+ addl $64,%edx
+ movl $16,%ecx
+ subl LOCAL1,%edx
+ movl LOCAL0,%edi
+
+ pcmpeqb %mm7,%mm7
+ pslld $31,%mm7
+ movq (%edx),%mm0
+ movq (%ebx),%mm1
+ ALIGN32
+.L33:
+#if defined(ACCURATE_ROUNDING) && defined(PIC)
+ movl EBXSAVE, _EBX_
+#endif
+ movq 8(%edx),%mm3
+ pfmul %mm1,%mm0
+ movq 8(%ebx),%mm4
+ movq 16(%edx),%mm5
+ pfmul %mm4,%mm3
+ movq 16(%ebx),%mm6
+ pfadd %mm3,%mm0
+ movq 24(%edx),%mm1
+ pfmul %mm6,%mm5
+ movq 24(%ebx),%mm2
+ pfadd %mm5,%mm0
+ movq 32(%edx),%mm3
+ pfmul %mm2,%mm1
+ movq 32(%ebx),%mm4
+ pfadd %mm1,%mm0
+ movq 40(%edx),%mm5
+ pfmul %mm4,%mm3
+ movq 40(%ebx),%mm6
+ pfadd %mm3,%mm0
+ movq 48(%edx),%mm1
+ pfmul %mm6,%mm5
+ movq 48(%ebx),%mm2
+ pfadd %mm0,%mm5
+ movq 56(%edx),%mm3
+ pfmul %mm1,%mm2
+ movq 56(%ebx),%mm4
+ pfadd %mm5,%mm2
+ addl $64,%ebx
+ subl $-128,%edx
+ movq (%edx),%mm0
+ pfmul %mm4,%mm3
+ movq (%ebx),%mm1
+ pfadd %mm3,%mm2
+ movq %mm2,%mm3
+ psrlq $32,%mm3
+ pfsub %mm3,%mm2
+ incl %ebp
+#ifdef ACCURATE_ROUNDING
+ pfmin LOCAL_VAR(max_s16),%mm2
+ pfmax LOCAL_VAR(min_s16),%mm2
+ pfadd LOCAL_VAR(ftoi_magic),%mm2
+#else
+ pf2id %mm2,%mm2
+ packssdw %mm2,%mm2
+#endif
+ movd %mm2,%eax
+ movw %ax,0(%edi)
+ addl $4,%edi
+ decl %ecx
+ jnz .L33
+
+#if defined(ACCURATE_ROUNDING) && defined(PIC)
+ movl EBXSAVE, _EBX_
+#endif
+ movd (%ebx),%mm0
+ movd (%edx),%mm1
+ punpckldq 8(%ebx),%mm0
+ punpckldq 8(%edx),%mm1
+ movd 16(%ebx),%mm3
+ movd 16(%edx),%mm4
+ pfmul %mm1,%mm0
+ punpckldq 24(%ebx),%mm3
+ punpckldq 24(%edx),%mm4
+ movd 32(%ebx),%mm5
+ movd 32(%edx),%mm6
+ pfmul %mm4,%mm3
+ punpckldq 40(%ebx),%mm5
+ punpckldq 40(%edx),%mm6
+ pfadd %mm3,%mm0
+ movd 48(%ebx),%mm1
+ movd 48(%edx),%mm2
+ pfmul %mm6,%mm5
+ punpckldq 56(%ebx),%mm1
+ punpckldq 56(%edx),%mm2
+ pfadd %mm5,%mm0
+ pfmul %mm2,%mm1
+ pfadd %mm1,%mm0
+ pfacc %mm1,%mm0
+#ifdef ACCURATE_ROUNDING
+ pfmin LOCAL_VAR(max_s16),%mm0
+ pfmax LOCAL_VAR(min_s16),%mm0
+ pfadd LOCAL_VAR(ftoi_magic),%mm0
+#else
+ pf2id %mm0,%mm0
+ packssdw %mm0,%mm0
+#endif
+ movd %mm0,%eax
+ movw %ax,0(%edi)
+ incl %ebp
+ movl LOCAL5,%esi
+ addl $-64,%ebx
+ movl $15,%ebp
+ addl $4,%edi
+ leal -128(%edx,%esi,8),%edx
+
+ movl $15,%ecx
+ movd (%ebx),%mm0
+ movd -4(%edx),%mm1
+ punpckldq 4(%ebx),%mm0
+ punpckldq -8(%edx),%mm1
+ ALIGN32
+.L46:
+#if defined(ACCURATE_ROUNDING) && defined(PIC)
+ movl EBXSAVE, _EBX_
+#endif
+ movd 8(%ebx),%mm3
+ movd -12(%edx),%mm4
+ pfmul %mm1,%mm0
+ punpckldq 12(%ebx),%mm3
+ punpckldq -16(%edx),%mm4
+ movd 16(%ebx),%mm5
+ movd -20(%edx),%mm6
+ pfmul %mm4,%mm3
+ punpckldq 20(%ebx),%mm5
+ punpckldq -24(%edx),%mm6
+ pfadd %mm3,%mm0
+ movd 24(%ebx),%mm1
+ movd -28(%edx),%mm2
+ pfmul %mm6,%mm5
+ punpckldq 28(%ebx),%mm1
+ punpckldq -32(%edx),%mm2
+ pfadd %mm5,%mm0
+ movd 32(%ebx),%mm3
+ movd -36(%edx),%mm4
+ pfmul %mm2,%mm1
+ punpckldq 36(%ebx),%mm3
+ punpckldq -40(%edx),%mm4
+ pfadd %mm1,%mm0
+ movd 40(%ebx),%mm5
+ movd -44(%edx),%mm6
+ pfmul %mm4,%mm3
+ punpckldq 44(%ebx),%mm5
+ punpckldq -48(%edx),%mm6
+ pfadd %mm3,%mm0
+ movd 48(%ebx),%mm1
+ movd -52(%edx),%mm2
+ pfmul %mm6,%mm5
+ punpckldq 52(%ebx),%mm1
+ punpckldq -56(%edx),%mm2
+ pfadd %mm0,%mm5
+ movd 56(%ebx),%mm3
+ movd -60(%edx),%mm4
+ pfmul %mm2,%mm1
+ punpckldq 60(%ebx),%mm3
+ punpckldq (%edx),%mm4
+ pfadd %mm1,%mm5
+ addl $-128,%edx
+ addl $-64,%ebx
+ movd (%ebx),%mm0
+ movd -4(%edx),%mm1
+ pfmul %mm4,%mm3
+ punpckldq 4(%ebx),%mm0
+ punpckldq -8(%edx),%mm1
+ pfadd %mm5,%mm3
+ pfacc %mm3,%mm3
+ incl %ebp
+ pxor %mm7,%mm3
+#ifdef ACCURATE_ROUNDING
+ pfmin LOCAL_VAR(max_s16),%mm3
+ pfmax LOCAL_VAR(min_s16),%mm3
+ pfadd LOCAL_VAR(ftoi_magic),%mm3
+#else
+ pf2id %mm3,%mm3
+ packssdw %mm3,%mm3
+#endif
+ movd %mm3,%eax
+ movw %ax,(%edi)
+ addl $4,%edi
+ decl %ecx
+ jnz .L46
+
+ femms
+ movl %ebp,%eax
+ popl %ebx
+ popl %esi
+ popl %edi
+ popl %ebp
+ addl $24,%esp
+ ret
+
+#if defined(PIC) && defined(__APPLE__)
+ .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
+L_dct64_3dnow:
+ .indirect_symbol ASM_NAME(dct64_3dnow)
+ hlt ; hlt ; hlt ; hlt ; hlt
+#endif
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_3dnowext.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_3dnowext.S
new file mode 100644
index 00000000..77eff753
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_3dnowext.S
@@ -0,0 +1,13 @@
+#include "mangle.h"
+#define MPL_DCT64 FUNC(dct64_3dnowext)
+#define SYNTH_NAME ASM_NAME(synth_1to1_3dnowext_asm)
+#include "synth_sse3d.h"
+
+#if defined(PIC) && defined(__APPLE__)
+ .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
+L_dct64_3dnowext:
+ .indirect_symbol ASM_NAME(dct64_3dnowext)
+ hlt ; hlt ; hlt ; hlt ; hlt
+#endif
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_8bit.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_8bit.c
new file mode 100644
index 00000000..8a9a55fc
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_8bit.c
@@ -0,0 +1,142 @@
+/*
+ synth_8bit.c: The functions for synthesizing 8bit samples, at the end of decoding.
+
+ copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp, heavily dissected and rearranged by Thomas Orgis
+*/
+
+#include "mpg123lib_intern.h"
+#include "sample.h"
+#include "debug.h"
+
+/*
+ Part 2: All synth functions that produce 8bit output.
+ What we need is just a special WRITE_SAMPLE. For the generic and i386 functions, that is.
+ For the rather optimized synth_1to1, we will need the postprocessing 8bit converters from synth_8bit.h .
+*/
+
+#define SAMPLE_T unsigned char
+#define WRITE_SAMPLE(samples,sum,clip) WRITE_8BIT_SAMPLE(samples,sum,clip)
+
+/* Part 2a: All straight 1to1 decoding functions */
+#define BLOCK 0x40 /* One decoding block is 64 samples. */
+
+#define SYNTH_NAME synth_1to1_8bit
+#include "synth.h"
+#undef SYNTH_NAME
+
+/* Mono-related synths; they wrap over _some_ synth_1to1_8bit (could be generic, could be i386). */
+#define SYNTH_NAME fr->synths.plain[r_1to1][f_8]
+#define MONO_NAME synth_1to1_8bit_mono
+#define MONO2STEREO_NAME synth_1to1_8bit_m2s
+#include "synth_mono.h"
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+#ifdef OPT_X86
+#define NO_AUTOINCREMENT
+#define SYNTH_NAME synth_1to1_8bit_i386
+#include "synth.h"
+#undef SYNTH_NAME
+/* i386 uses the normal mono functions. */
+#undef NO_AUTOINCREMENT
+#endif
+
+/* But now, we need functions that take the 16bit output of optimized synth_1to1 and convert it.
+ I suppose that is still faster than dropping the optimization altogether! */
+
+#define BASE_SYNTH_NAME fr->synths.plain[r_1to1][f_16]
+#define SYNTH_NAME synth_1to1_8bit_wrap
+#define MONO_NAME synth_1to1_8bit_wrap_mono
+#define MONO2STEREO_NAME synth_1to1_8bit_wrap_m2s
+#include "synth_8bit.h"
+#undef BASE_SYNTH_NAME
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+#undef BLOCK
+
+#ifndef NO_DOWNSAMPLE
+
+/*
+ Part 2b: 2to1 synth. Only generic and i386.
+*/
+#define BLOCK 0x20 /* One decoding block is 32 samples. */
+
+#define SYNTH_NAME synth_2to1_8bit
+#include "synth.h"
+#undef SYNTH_NAME
+
+/* Mono-related synths; they wrap over _some_ synth_2to1_8bit (could be generic, could be i386). */
+#define SYNTH_NAME fr->synths.plain[r_2to1][f_8]
+#define MONO_NAME synth_2to1_8bit_mono
+#define MONO2STEREO_NAME synth_2to1_8bit_m2s
+#include "synth_mono.h"
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+#ifdef OPT_X86
+#define NO_AUTOINCREMENT
+#define SYNTH_NAME synth_2to1_8bit_i386
+#include "synth.h"
+#undef SYNTH_NAME
+/* i386 uses the normal mono functions. */
+#undef NO_AUTOINCREMENT
+#endif
+
+#undef BLOCK
+
+/*
+ Part 2c: 4to1 synth. Only generic and i386.
+*/
+#define BLOCK 0x10 /* One decoding block is 16 samples. */
+
+#define SYNTH_NAME synth_4to1_8bit
+#include "synth.h"
+#undef SYNTH_NAME
+
+/* Mono-related synths; they wrap over _some_ synth_4to1_8bit (could be generic, could be i386). */
+#define SYNTH_NAME fr->synths.plain[r_4to1][f_8]
+#define MONO_NAME synth_4to1_8bit_mono
+#define MONO2STEREO_NAME synth_4to1_8bit_m2s
+#include "synth_mono.h"
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+#ifdef OPT_X86
+#define NO_AUTOINCREMENT
+#define SYNTH_NAME synth_4to1_8bit_i386
+#include "synth.h"
+#undef SYNTH_NAME
+/* i386 uses the normal mono functions. */
+#undef NO_AUTOINCREMENT
+#endif
+
+#undef BLOCK
+
+#endif /* NO_DOWNSAMPLE */
+
+#ifndef NO_NTOM
+/*
+ Part 2d: ntom synth.
+ Same procedure as above... Just no extra play anymore, straight synth that may use an optimized dct64.
+*/
+
+/* These are all in one header, there's no flexibility to gain. */
+#define SYNTH_NAME synth_ntom_8bit
+#define MONO_NAME synth_ntom_8bit_mono
+#define MONO2STEREO_NAME synth_ntom_8bit_m2s
+#include "synth_ntom.h"
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+#endif
+
+#undef SAMPLE_T
+#undef WRITE_SAMPLE
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_8bit.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_8bit.h
new file mode 100644
index 00000000..e518d4f1
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_8bit.h
@@ -0,0 +1,86 @@
+/*
+ synth_8bit.h: Wrappers over optimized synth_xtoy for converting signed short to 8bit.
+
+ copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp, code generalized to the wrapper by Thomas Orgis
+
+ Only variable is the BLOCK size to choose 1to1, 2to1 or 4to1.
+ Oh, and the names: BASE_SYNTH_NAME, SYNTH_NAME, MONO_NAME, MONO2STEREO_NAME
+ (p.ex. opt_synth_1to1(fr), synth_1to1_8bit, synth_1to1_8bit_mono, ...).
+*/
+
+int SYNTH_NAME(real *bandPtr, int channel, mpg123_handle *fr, int final)
+{
+ short samples_tmp[BLOCK];
+ short *tmp1 = samples_tmp + channel;
+ int i,ret;
+
+ unsigned char *samples = fr->buffer.data;
+ int pnt = fr->buffer.fill;
+ fr->buffer.data = (unsigned char*) samples_tmp;
+ fr->buffer.fill = 0;
+ ret = BASE_SYNTH_NAME(bandPtr, channel, fr , 0);
+ fr->buffer.data = samples;
+
+ samples += channel + pnt;
+ for(i=0;i<(BLOCK/2);i++)
+ {
+ *samples = fr->conv16to8[*tmp1>>AUSHIFT];
+ samples += 2;
+ tmp1 += 2;
+ }
+ fr->buffer.fill = pnt + (final ? BLOCK : 0 );
+
+ return ret;
+}
+
+int MONO_NAME(real *bandPtr, mpg123_handle *fr)
+{
+ short samples_tmp[BLOCK];
+ short *tmp1 = samples_tmp;
+ int i,ret;
+
+ unsigned char *samples = fr->buffer.data;
+ int pnt = fr->buffer.fill;
+ fr->buffer.data = (unsigned char*) samples_tmp;
+ fr->buffer.fill = 0;
+ ret = BASE_SYNTH_NAME(bandPtr, 0, fr, 0);
+ fr->buffer.data = samples;
+
+ samples += pnt;
+ for(i=0;i<(BLOCK/2);i++)
+ {
+ *samples++ = fr->conv16to8[*tmp1>>AUSHIFT];
+ tmp1+=2;
+ }
+ fr->buffer.fill = pnt + BLOCK/2;
+
+ return ret;
+}
+
+int MONO2STEREO_NAME(real *bandPtr, mpg123_handle *fr)
+{
+ short samples_tmp[BLOCK];
+ short *tmp1 = samples_tmp;
+ int i,ret;
+
+ unsigned char *samples = fr->buffer.data;
+ int pnt = fr->buffer.fill;
+ fr->buffer.data = (unsigned char*) samples_tmp;
+ fr->buffer.fill = 0;
+ ret = BASE_SYNTH_NAME(bandPtr, 0, fr, 0);
+ fr->buffer.data = samples;
+
+ samples += pnt;
+ for(i=0;i<(BLOCK/2);i++)
+ {
+ *samples++ = fr->conv16to8[*tmp1>>AUSHIFT];
+ *samples++ = fr->conv16to8[*tmp1>>AUSHIFT];
+ tmp1 += 2;
+ }
+ fr->buffer.fill = pnt + BLOCK;
+
+ return ret;
+}
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_altivec.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_altivec.c
new file mode 100644
index 00000000..e1f3ea19
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_altivec.c
@@ -0,0 +1,1057 @@
+/*
+ decode.c: decoding samples...
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp
+ altivec optimization by tmkk
+*/
+
+#include "mpg123lib_intern.h"
+
+#ifndef __APPLE__
+#include <altivec.h>
+#endif
+
+/* A macro for normal synth functions */
+#define SYNTH_ALTIVEC(B0STEP) \
+ v1 = vec_ld(0,window); \
+ v2 = vec_ld(16,window); \
+ v3 = vec_ld(32,window); \
+ v4 = vec_ld(48,window); \
+ v5 = vec_ld(64,window); \
+ v1 = vec_perm(v1,v2,vperm1); \
+ v6 = vec_ld(0,b0); \
+ v2 = vec_perm(v2,v3,vperm1); \
+ v7 = vec_ld(16,b0); \
+ v3 = vec_perm(v3,v4,vperm1); \
+ v8 = vec_ld(32,b0); \
+ v4 = vec_perm(v4,v5,vperm1); \
+ v9 = vec_ld(48,b0); \
+ \
+ vsum = vec_madd(v1,v6,vzero); \
+ vsum = vec_madd(v2,v7,vsum); \
+ vsum = vec_madd(v3,v8,vsum); \
+ vsum = vec_madd(v4,v9,vsum); \
+ \
+ window += 32; \
+ b0 += B0STEP; \
+ \
+ v1 = vec_ld(0,window); \
+ v2 = vec_ld(16,window); \
+ v3 = vec_ld(32,window); \
+ v4 = vec_ld(48,window); \
+ v5 = vec_ld(64,window); \
+ v1 = vec_perm(v1,v2,vperm1); \
+ v6 = vec_ld(0,b0); \
+ v2 = vec_perm(v2,v3,vperm1); \
+ v7 = vec_ld(16,b0); \
+ v3 = vec_perm(v3,v4,vperm1); \
+ v8 = vec_ld(32,b0); \
+ v4 = vec_perm(v4,v5,vperm1); \
+ v9 = vec_ld(48,b0); \
+ \
+ vsum2 = vec_madd(v1,v6,vzero); \
+ vsum2 = vec_madd(v2,v7,vsum2); \
+ vsum2 = vec_madd(v3,v8,vsum2); \
+ vsum2 = vec_madd(v4,v9,vsum2); \
+ \
+ window += 32; \
+ b0 += B0STEP; \
+ \
+ v1 = vec_ld(0,window); \
+ v2 = vec_ld(16,window); \
+ v3 = vec_ld(32,window); \
+ v4 = vec_ld(48,window); \
+ v5 = vec_ld(64,window); \
+ v1 = vec_perm(v1,v2,vperm1); \
+ v6 = vec_ld(0,b0); \
+ v2 = vec_perm(v2,v3,vperm1); \
+ v7 = vec_ld(16,b0); \
+ v3 = vec_perm(v3,v4,vperm1); \
+ v8 = vec_ld(32,b0); \
+ v4 = vec_perm(v4,v5,vperm1); \
+ v9 = vec_ld(48,b0); \
+ \
+ vsum3 = vec_madd(v1,v6,vzero); \
+ vsum3 = vec_madd(v2,v7,vsum3); \
+ vsum3 = vec_madd(v3,v8,vsum3); \
+ vsum3 = vec_madd(v4,v9,vsum3); \
+ \
+ window += 32; \
+ b0 += B0STEP; \
+ \
+ v1 = vec_ld(0,window); \
+ v2 = vec_ld(16,window); \
+ v3 = vec_ld(32,window); \
+ v4 = vec_ld(48,window); \
+ v5 = vec_ld(64,window); \
+ v1 = vec_perm(v1,v2,vperm1); \
+ v6 = vec_ld(0,b0); \
+ v2 = vec_perm(v2,v3,vperm1); \
+ v7 = vec_ld(16,b0); \
+ v3 = vec_perm(v3,v4,vperm1); \
+ v8 = vec_ld(32,b0); \
+ v4 = vec_perm(v4,v5,vperm1); \
+ v9 = vec_ld(48,b0); \
+ \
+ vsum4 = vec_madd(v1,v6,vzero); \
+ vsum4 = vec_madd(v2,v7,vsum4); \
+ vsum4 = vec_madd(v3,v8,vsum4); \
+ vsum4 = vec_madd(v4,v9,vsum4); \
+ \
+ window += 32; \
+ b0 += B0STEP; \
+ \
+ v1 = vec_mergeh(vsum,vsum3); \
+ v2 = vec_mergeh(vsum2,vsum4); \
+ v3 = vec_mergel(vsum,vsum3); \
+ v4 = vec_mergel(vsum2,vsum4); \
+ v5 = vec_mergeh(v1,v2); \
+ v6 = vec_mergel(v1,v2); \
+ v7 = vec_mergeh(v3,v4); \
+ v8 = vec_mergel(v3,v4);
+
+/* A macro for stereo synth functions */
+#define SYNTH_STEREO_ALTIVEC(B0STEP) \
+ v1 = vec_ld(0,window); \
+ v2 = vec_ld(16,window); \
+ v3 = vec_ld(32,window); \
+ v4 = vec_ld(48,window); \
+ v5 = vec_ld(64,window); \
+ v1 = vec_perm(v1,v2,vperm1); \
+ v6 = vec_ld(0,b0l); \
+ v10 = vec_ld(0,b0r); \
+ v2 = vec_perm(v2,v3,vperm1); \
+ v7 = vec_ld(16,b0l); \
+ v11 = vec_ld(16,b0r); \
+ v3 = vec_perm(v3,v4,vperm1); \
+ v8 = vec_ld(32,b0l); \
+ v12 = vec_ld(32,b0r); \
+ v4 = vec_perm(v4,v5,vperm1); \
+ v9 = vec_ld(48,b0l); \
+ v13 = vec_ld(48,b0r); \
+ \
+ vsum = vec_madd(v1,v6,vzero); \
+ vsum5 = vec_madd(v1,v10,vzero); \
+ vsum = vec_madd(v2,v7,vsum); \
+ vsum5 = vec_madd(v2,v11,vsum5); \
+ vsum = vec_madd(v3,v8,vsum); \
+ vsum5 = vec_madd(v3,v12,vsum5); \
+ vsum = vec_madd(v4,v9,vsum); \
+ vsum5 = vec_madd(v4,v13,vsum5); \
+ \
+ window += 32; \
+ b0l += B0STEP; \
+ b0r += B0STEP; \
+ \
+ v1 = vec_ld(0,window); \
+ v2 = vec_ld(16,window); \
+ v3 = vec_ld(32,window); \
+ v4 = vec_ld(48,window); \
+ v5 = vec_ld(64,window); \
+ v1 = vec_perm(v1,v2,vperm1); \
+ v6 = vec_ld(0,b0l); \
+ v10 = vec_ld(0,b0r); \
+ v2 = vec_perm(v2,v3,vperm1); \
+ v7 = vec_ld(16,b0l); \
+ v11 = vec_ld(16,b0r); \
+ v3 = vec_perm(v3,v4,vperm1); \
+ v8 = vec_ld(32,b0l); \
+ v12 = vec_ld(32,b0r); \
+ v4 = vec_perm(v4,v5,vperm1); \
+ v9 = vec_ld(48,b0l); \
+ v13 = vec_ld(48,b0r); \
+ \
+ vsum2 = vec_madd(v1,v6,vzero); \
+ vsum6 = vec_madd(v1,v10,vzero); \
+ vsum2 = vec_madd(v2,v7,vsum2); \
+ vsum6 = vec_madd(v2,v11,vsum6); \
+ vsum2 = vec_madd(v3,v8,vsum2); \
+ vsum6 = vec_madd(v3,v12,vsum6); \
+ vsum2 = vec_madd(v4,v9,vsum2); \
+ vsum6 = vec_madd(v4,v13,vsum6); \
+ \
+ window += 32; \
+ b0l += B0STEP; \
+ b0r += B0STEP; \
+ \
+ v1 = vec_ld(0,window); \
+ v2 = vec_ld(16,window); \
+ v3 = vec_ld(32,window); \
+ v4 = vec_ld(48,window); \
+ v5 = vec_ld(64,window); \
+ v1 = vec_perm(v1,v2,vperm1); \
+ v6 = vec_ld(0,b0l); \
+ v10 = vec_ld(0,b0r); \
+ v2 = vec_perm(v2,v3,vperm1); \
+ v7 = vec_ld(16,b0l); \
+ v11 = vec_ld(16,b0r); \
+ v3 = vec_perm(v3,v4,vperm1); \
+ v8 = vec_ld(32,b0l); \
+ v12 = vec_ld(32,b0r); \
+ v4 = vec_perm(v4,v5,vperm1); \
+ v9 = vec_ld(48,b0l); \
+ v13 = vec_ld(48,b0r); \
+ \
+ vsum3 = vec_madd(v1,v6,vzero); \
+ vsum7 = vec_madd(v1,v10,vzero); \
+ vsum3 = vec_madd(v2,v7,vsum3); \
+ vsum7 = vec_madd(v2,v11,vsum7); \
+ vsum3 = vec_madd(v3,v8,vsum3); \
+ vsum7 = vec_madd(v3,v12,vsum7); \
+ vsum3 = vec_madd(v4,v9,vsum3); \
+ vsum7 = vec_madd(v4,v13,vsum7); \
+ \
+ window += 32; \
+ b0l += B0STEP; \
+ b0r += B0STEP; \
+ \
+ v1 = vec_ld(0,window); \
+ v2 = vec_ld(16,window); \
+ v3 = vec_ld(32,window); \
+ v4 = vec_ld(48,window); \
+ v5 = vec_ld(64,window); \
+ v1 = vec_perm(v1,v2,vperm1); \
+ v6 = vec_ld(0,b0l); \
+ v10 = vec_ld(0,b0r); \
+ v2 = vec_perm(v2,v3,vperm1); \
+ v7 = vec_ld(16,b0l); \
+ v11 = vec_ld(16,b0r); \
+ v3 = vec_perm(v3,v4,vperm1); \
+ v8 = vec_ld(32,b0l); \
+ v12 = vec_ld(32,b0r); \
+ v4 = vec_perm(v4,v5,vperm1); \
+ v9 = vec_ld(48,b0l); \
+ v13 = vec_ld(48,b0r); \
+ \
+ vsum4 = vec_madd(v1,v6,vzero); \
+ vsum8 = vec_madd(v1,v10,vzero); \
+ vsum4 = vec_madd(v2,v7,vsum4); \
+ vsum8 = vec_madd(v2,v11,vsum8); \
+ vsum4 = vec_madd(v3,v8,vsum4); \
+ vsum8 = vec_madd(v3,v12,vsum8); \
+ vsum4 = vec_madd(v4,v9,vsum4); \
+ vsum8 = vec_madd(v4,v13,vsum8); \
+ \
+ window += 32; \
+ b0l += B0STEP; \
+ b0r += B0STEP; \
+ \
+ v1 = vec_mergeh(vsum,vsum3); \
+ v5 = vec_mergeh(vsum5,vsum7); \
+ v2 = vec_mergeh(vsum2,vsum4); \
+ v6 = vec_mergeh(vsum6,vsum8); \
+ v3 = vec_mergel(vsum,vsum3); \
+ v7 = vec_mergel(vsum5,vsum7); \
+ v4 = vec_mergel(vsum2,vsum4); \
+ v8 = vec_mergel(vsum6,vsum8); \
+ vsum = vec_mergeh(v1,v2); \
+ vsum5 = vec_mergeh(v5,v6); \
+ vsum2 = vec_mergel(v1,v2); \
+ vsum6 = vec_mergel(v5,v6); \
+ vsum3 = vec_mergeh(v3,v4); \
+ vsum7 = vec_mergeh(v7,v8); \
+ vsum4 = vec_mergel(v3,v4); \
+ vsum8 = vec_mergel(v7,v8);
+
+int synth_1to1_altivec(real *bandPtr,int channel,mpg123_handle *fr, int final)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int clip;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_altivec(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_altivec(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+
+ {
+ register int j;
+ real *window = fr->decwin + 16 - bo1;
+
+ ALIGNED(16) int clip_tmp[4];
+ vector float v1,v2,v3,v4,v5,v6,v7,v8,v9;
+ vector unsigned char vperm1,vperm2,vperm3,vperm4;
+ vector float vsum,vsum2,vsum3,vsum4,vmin,vmax,vzero;
+ vector signed int vclip;
+ vector signed short vsample1,vsample2;
+ vector unsigned int vshift;
+ vclip = vec_xor(vclip,vclip);
+ vzero = vec_xor(vzero,vzero);
+ vshift = vec_splat_u32(-1); /* 31 */
+#ifdef __APPLE__
+ vmax = (vector float)(32767.0f);
+ vmin = (vector float)(-32768.0f);
+ vperm4 = (vector unsigned char)(0,1,18,19,2,3,22,23,4,5,26,27,6,7,30,31);
+#else
+ vmax = (vector float){32767.0f,32767.0f,32767.0f,32767.0f};
+ vmin = (vector float){-32768.0f,-32768.0f,-32768.0f,-32768.0f};
+ vperm4 = (vector unsigned char){0,1,18,19,2,3,22,23,4,5,26,27,6,7,30,31};
+#endif
+
+ vperm1 = vec_lvsl(0,window);
+ vperm2 = vec_lvsl(0,samples);
+ vperm3 = vec_lvsr(0,samples);
+ for (j=4;j;j--)
+ {
+ SYNTH_ALTIVEC(16);
+
+ vsum = vec_sub(v5,v6);
+ v9 = vec_sub(v7,v8);
+ vsum = vec_add(vsum,v9);
+
+ v3 = vec_round(vsum);
+ v3 = (vector float)vec_cts(v3,0);
+ v1 = (vector float)vec_cmpgt(vsum,vmax);
+ v2 = (vector float)vec_cmplt(vsum,vmin);
+ vsample1 = vec_ld(0,samples);
+ vsample2 = vec_ld(15,samples);
+ v3 = (vector float)vec_packs((vector signed int)v3,(vector signed int)v3);
+ v4 = (vector float)vec_perm(vsample1,vsample2,vperm2);
+ v5 = (vector float)vec_perm(v3,v4,vperm4);
+ v6 = (vector float)vec_perm(vsample2,vsample1,vperm2);
+ v7 = (vector float)vec_perm(v5,v6,vperm3);
+ v8 = (vector float)vec_perm(v6,v5,vperm3);
+ vec_st((vector signed short)v7,15,samples);
+ vec_st((vector signed short)v8,0,samples);
+ samples += 8;
+
+ v1 = (vector float)vec_sr((vector unsigned int)v1, vshift);
+ v2 = (vector float)vec_sr((vector unsigned int)v2, vshift);
+ v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
+ vclip = vec_sums((vector signed int)v1,vclip);
+ }
+
+ for (j=4;j;j--)
+ {
+ SYNTH_ALTIVEC(-16);
+
+ vsum = vec_add(v5,v6);
+ v9 = vec_add(v7,v8);
+ vsum = vec_add(vsum,v9);
+
+ v3 = vec_round(vsum);
+ v3 = (vector float)vec_cts(v3,0);
+ v1 = (vector float)vec_cmpgt(vsum,vmax);
+ v2 = (vector float)vec_cmplt(vsum,vmin);
+ vsample1 = vec_ld(0,samples);
+ vsample2 = vec_ld(15,samples);
+ v3 = (vector float)vec_packs((vector signed int)v3,(vector signed int)v3);
+ v4 = (vector float)vec_perm(vsample1,vsample2,vperm2);
+ v5 = (vector float)vec_perm(v3,v4,vperm4);
+ v6 = (vector float)vec_perm(vsample2,vsample1,vperm2);
+ v7 = (vector float)vec_perm(v5,v6,vperm3);
+ v8 = (vector float)vec_perm(v6,v5,vperm3);
+ vec_st((vector signed short)v7,15,samples);
+ vec_st((vector signed short)v8,0,samples);
+ samples += 8;
+
+ v1 = (vector float)vec_sr((vector unsigned int)v1, vshift);
+ v2 = (vector float)vec_sr((vector unsigned int)v2, vshift);
+ v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
+ vclip = vec_sums((vector signed int)v1,vclip);
+ }
+
+ vec_st(vclip,0,clip_tmp);
+ clip = clip_tmp[3];
+ }
+ if(final) fr->buffer.fill += 128;
+
+ return clip;
+}
+
+int synth_1to1_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int clip;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_altivec(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_altivec(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_altivec(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_altivec(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+
+ {
+ register int j;
+ real *window = fr->decwin + 16 - bo1;
+
+ ALIGNED(16) int clip_tmp[4];
+ vector float v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13;
+ vector unsigned char vperm1,vperm2;
+ vector float vsum,vsum2,vsum3,vsum4,vsum5,vsum6,vsum7,vsum8,vmin,vmax,vzero;
+ vector signed int vclip;
+ vector unsigned int vshift;
+ vector signed short vprev;
+ vclip = vec_xor(vclip,vclip);
+ vzero = vec_xor(vzero,vzero);
+ vshift = vec_splat_u32(-1); /* 31 */
+#ifdef __APPLE__
+ vmax = (vector float)(32767.0f);
+ vmin = (vector float)(-32768.0f);
+#else
+ vmax = (vector float){32767.0f,32767.0f,32767.0f,32767.0f};
+ vmin = (vector float){-32768.0f,-32768.0f,-32768.0f,-32768.0f};
+#endif
+
+ vperm1 = vec_lvsl(0,window);
+ vperm2 = vec_lvsr(0,samples);
+ vprev = vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
+ for (j=4;j;j--)
+ {
+ SYNTH_STEREO_ALTIVEC(16);
+
+ vsum = vec_sub(vsum,vsum2);
+ vsum2 = vec_sub(vsum5,vsum6);
+ vsum3 = vec_sub(vsum3,vsum4);
+ vsum4 = vec_sub(vsum7,vsum8);
+ vsum = vec_add(vsum,vsum3);
+ vsum2 = vec_add(vsum2,vsum4);
+
+ v1 = vec_round(vsum);
+ v2 = vec_round(vsum2);
+ v1 = (vector float)vec_cts(v1,0);
+ v2 = (vector float)vec_cts(v2,0);
+ v3 = vec_mergeh(v1, v2);
+ v4 = vec_mergel(v1, v2);
+ v5 = (vector float)vec_packs((vector signed int)v3,(vector signed int)v4);
+ v6 = (vector float)vec_perm(vprev,(vector signed short)v5,vperm2);
+ vprev = (vector signed short)v5;
+ v1 = (vector float)vec_cmpgt(vsum,vmax);
+ v2 = (vector float)vec_cmplt(vsum,vmin);
+ v3 = (vector float)vec_cmpgt(vsum2,vmax);
+ v4 = (vector float)vec_cmplt(vsum2,vmin);
+ vec_st((vector signed short)v6,0,samples);
+ samples += 8;
+
+ v1 = (vector float)vec_sr((vector unsigned int)v1, vshift);
+ v2 = (vector float)vec_sr((vector unsigned int)v2, vshift);
+ v3 = (vector float)vec_sr((vector unsigned int)v3, vshift);
+ v4 = (vector float)vec_sr((vector unsigned int)v4, vshift);
+ v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
+ v2 = (vector float)vec_add((vector unsigned int)v3,(vector unsigned int)v4);
+ vclip = vec_sums((vector signed int)v1,vclip);
+ vclip = vec_sums((vector signed int)v2,vclip);
+ }
+
+ for (j=4;j;j--)
+ {
+ SYNTH_STEREO_ALTIVEC(-16);
+
+ vsum = vec_add(vsum,vsum2);
+ vsum2 = vec_add(vsum5,vsum6);
+ vsum3 = vec_add(vsum3,vsum4);
+ vsum4 = vec_add(vsum7,vsum8);
+ vsum = vec_add(vsum,vsum3);
+ vsum2 = vec_add(vsum2,vsum4);
+
+ v1 = vec_round(vsum);
+ v2 = vec_round(vsum2);
+ v1 = (vector float)vec_cts(v1,0);
+ v2 = (vector float)vec_cts(v2,0);
+ v3 = vec_mergeh(v1, v2);
+ v4 = vec_mergel(v1, v2);
+ v5 = (vector float)vec_packs((vector signed int)v3,(vector signed int)v4);
+ v6 = (vector float)vec_perm(vprev,(vector signed short)v5,vperm2);
+ vprev = (vector signed short)v5;
+ v1 = (vector float)vec_cmpgt(vsum,vmax);
+ v2 = (vector float)vec_cmplt(vsum,vmin);
+ v3 = (vector float)vec_cmpgt(vsum2,vmax);
+ v4 = (vector float)vec_cmplt(vsum2,vmin);
+ vec_st((vector signed short)v6,0,samples);
+ samples += 8;
+
+ v1 = (vector float)vec_sr((vector unsigned int)v1, vshift);
+ v2 = (vector float)vec_sr((vector unsigned int)v2, vshift);
+ v3 = (vector float)vec_sr((vector unsigned int)v3, vshift);
+ v4 = (vector float)vec_sr((vector unsigned int)v4, vshift);
+ v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
+ v2 = (vector float)vec_add((vector unsigned int)v3,(vector unsigned int)v4);
+ vclip = vec_sums((vector signed int)v1,vclip);
+ vclip = vec_sums((vector signed int)v2,vclip);
+ }
+
+ if((size_t)samples & 0xf)
+ {
+ v1 = (vector float)vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
+ v2 = (vector float)vec_perm(vprev,(vector signed short)v1,vperm2);
+ vec_st((vector signed short)v2,0,samples);
+ }
+
+ vec_st(vclip,0,clip_tmp);
+ clip = clip_tmp[3];
+ }
+ fr->buffer.fill += 128;
+
+ return clip;
+}
+
+int synth_1to1_real_altivec(real *bandPtr,int channel,mpg123_handle *fr, int final)
+{
+ real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_altivec(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_altivec(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+
+ {
+ register int j;
+ real *window = fr->decwin + 16 - bo1;
+
+ vector float v1,v2,v3,v4,v5,v6,v7,v8,v9;
+ vector unsigned char vperm1,vperm2,vperm3,vperm4, vperm5;
+ vector float vsum,vsum2,vsum3,vsum4,vscale,vzero;
+ vector float vsample1,vsample2,vsample3;
+ vzero = vec_xor(vzero, vzero);
+#ifdef __APPLE__
+ vscale = (vector float)(1.0f/32768.0f);
+ vperm4 = (vector unsigned char)(0,1,2,3,20,21,22,23,4,5,6,7,28,29,30,31);
+ vperm5 = (vector unsigned char)(8,9,10,11,20,21,22,23,12,13,14,15,28,29,30,31);
+#else
+ vscale = (vector float){1.0f/32768.0f,1.0f/32768.0f,1.0f/32768.0f,1.0f/32768.0f};
+ vperm4 = (vector unsigned char){0,1,2,3,20,21,22,23,4,5,6,7,28,29,30,31};
+ vperm5 = (vector unsigned char){8,9,10,11,20,21,22,23,12,13,14,15,28,29,30,31};
+#endif
+
+ vperm1 = vec_lvsl(0,window);
+ vperm2 = vec_lvsl(0,samples);
+ vperm3 = vec_lvsr(0,samples);
+ for (j=4;j;j--)
+ {
+ SYNTH_ALTIVEC(16);
+
+ vsum = vec_sub(v5,v6);
+ v9 = vec_sub(v7,v8);
+ vsum = vec_add(vsum,v9);
+ vsum = vec_madd(vsum, vscale, vzero);
+
+ vsample1 = vec_ld(0,samples);
+ vsample2 = vec_ld(16,samples);
+ vsample3 = vec_ld(31,samples);
+ v1 = vec_perm(vsample1, vsample2, vperm2);
+ v2 = vec_perm(vsample2, vsample3, vperm2);
+ v1 = vec_perm(vsum, v1, vperm4);
+ v2 = vec_perm(vsum, v2, vperm5);
+ v3 = vec_perm(vsample3, vsample2, vperm2);
+ v4 = vec_perm(vsample2, vsample1, vperm2);
+ v5 = vec_perm(v2, v3, vperm3);
+ v6 = vec_perm(v1, v2, vperm3);
+ v7 = vec_perm(v4, v1, vperm3);
+ vec_st(v5,31,samples);
+ vec_st(v6,16,samples);
+ vec_st(v7,0,samples);
+ samples += 8;
+ }
+
+ for (j=4;j;j--)
+ {
+ SYNTH_ALTIVEC(-16);
+
+ vsum = vec_add(v5,v6);
+ v9 = vec_add(v7,v8);
+ vsum = vec_add(vsum,v9);
+ vsum = vec_madd(vsum, vscale, vzero);
+
+ vsample1 = vec_ld(0,samples);
+ vsample2 = vec_ld(16,samples);
+ vsample3 = vec_ld(31,samples);
+ v1 = vec_perm(vsample1, vsample2, vperm2);
+ v2 = vec_perm(vsample2, vsample3, vperm2);
+ v1 = vec_perm(vsum, v1, vperm4);
+ v2 = vec_perm(vsum, v2, vperm5);
+ v3 = vec_perm(vsample3, vsample2, vperm2);
+ v4 = vec_perm(vsample2, vsample1, vperm2);
+ v5 = vec_perm(v2, v3, vperm3);
+ v6 = vec_perm(v1, v2, vperm3);
+ v7 = vec_perm(v4, v1, vperm3);
+ vec_st(v5,31,samples);
+ vec_st(v6,16,samples);
+ vec_st(v7,0,samples);
+ samples += 8;
+ }
+ }
+ if(final) fr->buffer.fill += 256;
+
+ return 0;
+}
+
+int synth_1to1_fltst_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_altivec(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_altivec(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_altivec(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_altivec(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+
+ {
+ register int j;
+ real *window = fr->decwin + 16 - bo1;
+
+ vector float v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13;
+ vector unsigned char vperm1,vperm2;
+ vector float vsum,vsum2,vsum3,vsum4,vsum5,vsum6,vsum7,vsum8,vscale,vzero;
+ vector float vprev;
+ vzero = vec_xor(vzero,vzero);
+#ifdef __APPLE__
+ vscale = (vector float)(1.0f/32768.0f);
+#else
+ vscale = (vector float){1.0f/32768.0f,1.0f/32768.0f,1.0f/32768.0f,1.0f/32768.0f};
+#endif
+
+ vperm1 = vec_lvsl(0,window);
+ vperm2 = vec_lvsr(0,samples);
+ vprev = vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
+ for (j=4;j;j--)
+ {
+ SYNTH_STEREO_ALTIVEC(16);
+
+ vsum = vec_sub(vsum,vsum2);
+ vsum2 = vec_sub(vsum5,vsum6);
+ vsum3 = vec_sub(vsum3,vsum4);
+ vsum4 = vec_sub(vsum7,vsum8);
+ vsum = vec_add(vsum,vsum3);
+ vsum2 = vec_add(vsum2,vsum4);
+ vsum = vec_madd(vsum, vscale, vzero);
+ vsum2 = vec_madd(vsum2, vscale, vzero);
+
+ v1 = vec_mergeh(vsum, vsum2);
+ v2 = vec_mergel(vsum, vsum2);
+ v3 = vec_perm(vprev,v1,vperm2);
+ v4 = vec_perm(v1,v2,vperm2);
+ vprev = v2;
+ vec_st(v3,0,samples);
+ vec_st(v4,16,samples);
+ samples += 8;
+ }
+
+ for (j=4;j;j--)
+ {
+ SYNTH_STEREO_ALTIVEC(-16);
+
+ vsum = vec_add(vsum,vsum2);
+ vsum2 = vec_add(vsum5,vsum6);
+ vsum3 = vec_add(vsum3,vsum4);
+ vsum4 = vec_add(vsum7,vsum8);
+ vsum = vec_add(vsum,vsum3);
+ vsum2 = vec_add(vsum2,vsum4);
+ vsum = vec_madd(vsum, vscale, vzero);
+ vsum2 = vec_madd(vsum2, vscale, vzero);
+
+ v1 = vec_mergeh(vsum, vsum2);
+ v2 = vec_mergel(vsum, vsum2);
+ v3 = vec_perm(vprev,v1,vperm2);
+ v4 = vec_perm(v1,v2,vperm2);
+ vprev = v2;
+ vec_st(v3,0,samples);
+ vec_st(v4,16,samples);
+ samples += 8;
+ }
+
+ if((size_t)samples & 0xf)
+ {
+ v1 = (vector float)vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
+ v2 = (vector float)vec_perm(vprev,v1,vperm2);
+ vec_st(v2,0,samples);
+ }
+ }
+ fr->buffer.fill += 256;
+
+ return 0;
+}
+
+int synth_1to1_s32_altivec(real *bandPtr,int channel,mpg123_handle *fr, int final)
+{
+ int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int clip;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_altivec(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_altivec(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+
+ {
+ register int j;
+ real *window = fr->decwin + 16 - bo1;
+
+ ALIGNED(16) int clip_tmp[4];
+ vector float v1,v2,v3,v4,v5,v6,v7,v8,v9;
+ vector unsigned char vperm1,vperm2,vperm3,vperm4,vperm5;
+ vector float vsum,vsum2,vsum3,vsum4,vmax,vmin,vzero;
+ vector signed int vsample1,vsample2,vsample3;
+ vector unsigned int vshift;
+ vector signed int vclip;
+ vzero = vec_xor(vzero, vzero);
+ vclip = vec_xor(vclip, vclip);
+ vshift = vec_splat_u32(-1); /* 31 */
+#ifdef __APPLE__
+ vmax = (vector float)(32767.999f);
+ vmin = (vector float)(-32768.0f);
+ vperm4 = (vector unsigned char)(0,1,2,3,20,21,22,23,4,5,6,7,28,29,30,31);
+ vperm5 = (vector unsigned char)(8,9,10,11,20,21,22,23,12,13,14,15,28,29,30,31);
+#else
+ vmax = (vector float){32767.999f,32767.999f,32767.999f,32767.999f};
+ vmin = (vector float){-32768.0f,-32768.0f,-32768.0f,-32768.0f};
+ vperm4 = (vector unsigned char){0,1,2,3,20,21,22,23,4,5,6,7,28,29,30,31};
+ vperm5 = (vector unsigned char){8,9,10,11,20,21,22,23,12,13,14,15,28,29,30,31};
+#endif
+
+ vperm1 = vec_lvsl(0,window);
+ vperm2 = vec_lvsl(0,samples);
+ vperm3 = vec_lvsr(0,samples);
+ for (j=4;j;j--)
+ {
+ SYNTH_ALTIVEC(16);
+
+ vsum = vec_sub(v5,v6);
+ v9 = vec_sub(v7,v8);
+ v1 = vec_add(vsum,v9);
+ vsum = (vector float)vec_cts(v1,16);
+ v8 = (vector float)vec_cmpgt(v1,vmax);
+ v9 = (vector float)vec_cmplt(v1,vmin);
+
+ vsample1 = vec_ld(0,samples);
+ vsample2 = vec_ld(16,samples);
+ vsample3 = vec_ld(31,samples);
+ v1 = (vector float)vec_perm(vsample1, vsample2, vperm2);
+ v2 = (vector float)vec_perm(vsample2, vsample3, vperm2);
+ v1 = vec_perm(vsum, v1, vperm4);
+ v2 = vec_perm(vsum, v2, vperm5);
+ v3 = (vector float)vec_perm(vsample3, vsample2, vperm2);
+ v4 = (vector float)vec_perm(vsample2, vsample1, vperm2);
+ v5 = vec_perm(v2, v3, vperm3);
+ v6 = vec_perm(v1, v2, vperm3);
+ v7 = vec_perm(v4, v1, vperm3);
+ vec_st((vector signed int)v5,31,samples);
+ vec_st((vector signed int)v6,16,samples);
+ vec_st((vector signed int)v7,0,samples);
+ samples += 8;
+
+ v1 = (vector float)vec_sr((vector unsigned int)v8, vshift);
+ v2 = (vector float)vec_sr((vector unsigned int)v9, vshift);
+ v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
+ vclip = vec_sums((vector signed int)v1,vclip);
+ }
+
+ for (j=4;j;j--)
+ {
+ SYNTH_ALTIVEC(-16);
+
+ vsum = vec_add(v5,v6);
+ v9 = vec_add(v7,v8);
+ v1 = vec_add(vsum,v9);
+ vsum = (vector float)vec_cts(v1,16);
+ v8 = (vector float)vec_cmpgt(v1,vmax);
+ v9 = (vector float)vec_cmplt(v1,vmin);
+
+ vsample1 = vec_ld(0,samples);
+ vsample2 = vec_ld(16,samples);
+ vsample3 = vec_ld(31,samples);
+ v1 = (vector float)vec_perm(vsample1, vsample2, vperm2);
+ v2 = (vector float)vec_perm(vsample2, vsample3, vperm2);
+ v1 = vec_perm(vsum, v1, vperm4);
+ v2 = vec_perm(vsum, v2, vperm5);
+ v3 = (vector float)vec_perm(vsample3, vsample2, vperm2);
+ v4 = (vector float)vec_perm(vsample2, vsample1, vperm2);
+ v5 = vec_perm(v2, v3, vperm3);
+ v6 = vec_perm(v1, v2, vperm3);
+ v7 = vec_perm(v4, v1, vperm3);
+ vec_st((vector signed int)v5,31,samples);
+ vec_st((vector signed int)v6,16,samples);
+ vec_st((vector signed int)v7,0,samples);
+ samples += 8;
+
+ v1 = (vector float)vec_sr((vector unsigned int)v8, vshift);
+ v2 = (vector float)vec_sr((vector unsigned int)v9, vshift);
+ v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
+ vclip = vec_sums((vector signed int)v1,vclip);
+ }
+
+ vec_st(vclip,0,clip_tmp);
+ clip = clip_tmp[3];
+ }
+ if(final) fr->buffer.fill += 256;
+
+ return clip;
+}
+
+
+int synth_1to1_s32_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int clip;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_altivec(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_altivec(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_altivec(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_altivec(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+
+ {
+ register int j;
+ real *window = fr->decwin + 16 - bo1;
+
+ ALIGNED(16) int clip_tmp[4];
+ vector float v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13;
+ vector unsigned char vperm1,vperm2;
+ vector float vsum,vsum2,vsum3,vsum4,vsum5,vsum6,vsum7,vsum8,vmax,vmin,vzero;
+ vector float vprev;
+ vector unsigned int vshift;
+ vector signed int vclip;
+ vzero = vec_xor(vzero, vzero);
+ vclip = vec_xor(vclip, vclip);
+ vshift = vec_splat_u32(-1); /* 31 */
+#ifdef __APPLE__
+ vmax = (vector float)(32767.999f);
+ vmin = (vector float)(-32768.0f);
+#else
+ vmax = (vector float){32767.999f,32767.999f,32767.999f,32767.999f};
+ vmin = (vector float){-32768.0f,-32768.0f,-32768.0f,-32768.0f};
+#endif
+
+ vperm1 = vec_lvsl(0,window);
+ vperm2 = vec_lvsr(0,samples);
+ vprev = (vector float)vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
+ for (j=4;j;j--)
+ {
+ SYNTH_STEREO_ALTIVEC(16);
+
+ vsum = vec_sub(vsum,vsum2);
+ vsum2 = vec_sub(vsum5,vsum6);
+ vsum3 = vec_sub(vsum3,vsum4);
+ vsum4 = vec_sub(vsum7,vsum8);
+ v1 = vec_add(vsum,vsum3);
+ v2 = vec_add(vsum2,vsum4);
+ vsum = (vector float)vec_cts(v1,16);
+ vsum2 = (vector float)vec_cts(v2,16);
+ v5 = (vector float)vec_cmpgt(v1,vmax);
+ v6 = (vector float)vec_cmplt(v1,vmin);
+ v7 = (vector float)vec_cmpgt(v2,vmax);
+ v8 = (vector float)vec_cmplt(v2,vmin);
+
+ v1 = vec_mergeh(vsum, vsum2);
+ v2 = vec_mergel(vsum, vsum2);
+ v3 = vec_perm(vprev,v1,vperm2);
+ v4 = vec_perm(v1,v2,vperm2);
+ vprev = v2;
+ vec_st((vector signed int)v3,0,samples);
+ vec_st((vector signed int)v4,16,samples);
+ samples += 8;
+
+ v1 = (vector float)vec_sr((vector unsigned int)v5, vshift);
+ v2 = (vector float)vec_sr((vector unsigned int)v6, vshift);
+ v3 = (vector float)vec_sr((vector unsigned int)v7, vshift);
+ v4 = (vector float)vec_sr((vector unsigned int)v8, vshift);
+ v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
+ v2 = (vector float)vec_add((vector unsigned int)v3,(vector unsigned int)v4);
+ vclip = vec_sums((vector signed int)v1,vclip);
+ vclip = vec_sums((vector signed int)v2,vclip);
+ }
+
+ for (j=4;j;j--)
+ {
+ SYNTH_STEREO_ALTIVEC(-16);
+
+ vsum = vec_add(vsum,vsum2);
+ vsum2 = vec_add(vsum5,vsum6);
+ vsum3 = vec_add(vsum3,vsum4);
+ vsum4 = vec_add(vsum7,vsum8);
+ v1 = vec_add(vsum,vsum3);
+ v2 = vec_add(vsum2,vsum4);
+ vsum = (vector float)vec_cts(v1,16);
+ vsum2 = (vector float)vec_cts(v2,16);
+ v5 = (vector float)vec_cmpgt(v1,vmax);
+ v6 = (vector float)vec_cmplt(v1,vmin);
+ v7 = (vector float)vec_cmpgt(v2,vmax);
+ v8 = (vector float)vec_cmplt(v2,vmin);
+
+ v1 = vec_mergeh(vsum, vsum2);
+ v2 = vec_mergel(vsum, vsum2);
+ v3 = vec_perm(vprev,v1,vperm2);
+ v4 = vec_perm(v1,v2,vperm2);
+ vprev = v2;
+ vec_st((vector signed int)v3,0,samples);
+ vec_st((vector signed int)v4,16,samples);
+ samples += 8;
+
+ v1 = (vector float)vec_sr((vector unsigned int)v5, vshift);
+ v2 = (vector float)vec_sr((vector unsigned int)v6, vshift);
+ v3 = (vector float)vec_sr((vector unsigned int)v7, vshift);
+ v4 = (vector float)vec_sr((vector unsigned int)v8, vshift);
+ v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
+ v2 = (vector float)vec_add((vector unsigned int)v3,(vector unsigned int)v4);
+ vclip = vec_sums((vector signed int)v1,vclip);
+ vclip = vec_sums((vector signed int)v2,vclip);
+ }
+
+ if((size_t)samples & 0xf)
+ {
+ v1 = (vector float)vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
+ v2 = (vector float)vec_perm(vprev,v1,vperm2);
+ vec_st((vector signed int)v2,0,samples);
+ }
+
+ vec_st(vclip,0,clip_tmp);
+ clip = clip_tmp[3];
+ }
+ fr->buffer.fill += 256;
+
+ return clip;
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_arm.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_arm.S
new file mode 100644
index 00000000..c5ea88c6
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_arm.S
@@ -0,0 +1,278 @@
+/*
+ synth_arm: ARM optimized synth
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#define WINDOW r0
+#define B0 r1
+#define SAMPLES r2
+#define REG_CLIP r4
+#define REG_MAX r12
+
+/*
+ int synth_1to1_arm_asm(real *window, real *b0, short *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+ .code 32
+
+ .text
+ ALIGN4
+ .globl ASM_NAME(synth_1to1_arm_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_arm_asm), %function
+#endif
+ASM_NAME(synth_1to1_arm_asm):
+ stmfd sp!, {r4, r5, r6, r7, r8, r9, r10, lr}
+
+ add WINDOW, WINDOW, #64
+ sub WINDOW, WINDOW, r3, lsl #2
+ eor REG_CLIP, REG_CLIP, REG_CLIP
+ mov REG_MAX, #1073741824
+ sub REG_MAX, REG_MAX, #32768
+
+ mov r3, #16
+
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+1:
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mul r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mul r10, r8, r9
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #68
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+
+ sub r7, r7, r10
+
+ cmp r7, REG_MAX
+ movgt r7, REG_MAX
+ addgt REG_CLIP, REG_CLIP, #1
+ cmp r7, #-1073741824
+ movlt r7, #-1073741824
+ addlt REG_CLIP, REG_CLIP, #1
+ movs r7, r7, asr #15
+ adc r7, r7, #0
+ strh r7, [SAMPLES], #4
+
+ subs r3, r3, #1
+ bne 1b
+
+ add WINDOW, WINDOW, #4
+ add B0, B0, #4
+
+ ldr r8, [WINDOW], #8
+ ldr r9, [B0], #8
+ mul r7, r5, r6
+ ldr r5, [WINDOW], #8
+ ldr r6, [B0], #8
+ mul r10, r8, r9
+ ldr r8, [WINDOW], #8
+ ldr r9, [B0], #8
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #8
+ ldr r6, [B0], #8
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #8
+ ldr r9, [B0], #8
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #8
+ ldr r6, [B0], #8
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #72
+ ldr r9, [B0], #-120
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+
+ add r7, r7, r10
+
+ cmp r7, REG_MAX
+ movgt r7, REG_MAX
+ addgt REG_CLIP, REG_CLIP, #1
+ cmp r7, #-1073741824
+ movlt r7, #-1073741824
+ addlt REG_CLIP, REG_CLIP, #1
+ movs r7, r7, asr #15
+ adc r7, r7, #0
+ strh r7, [SAMPLES], #4
+
+ mov r3, #14
+
+1:
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mul r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mul r10, r8, r9
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #68
+ ldr r9, [B0], #-124
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+
+ add r7, r7, r10
+
+ cmp r7, REG_MAX
+ movgt r7, REG_MAX
+ addgt REG_CLIP, REG_CLIP, #1
+ cmp r7, #-1073741824
+ movlt r7, #-1073741824
+ addlt REG_CLIP, REG_CLIP, #1
+ movs r7, r7, asr #15
+ adc r7, r7, #0
+ strh r7, [SAMPLES], #4
+
+ subs r3, r3, #1
+ bne 1b
+
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mul r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mul r10, r8, r9
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW], #4
+ ldr r9, [B0], #4
+ mla r7, r5, r6, r7
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ mla r10, r8, r9, r10
+ ldr r8, [WINDOW]
+ ldr r9, [B0]
+ mla r7, r5, r6, r7
+ mla r10, r8, r9, r10
+
+ add r7, r7, r10
+
+ cmp r7, REG_MAX
+ movgt r7, REG_MAX
+ addgt REG_CLIP, REG_CLIP, #1
+ cmp r7, #-1073741824
+ movlt r7, #-1073741824
+ addlt REG_CLIP, REG_CLIP, #1
+ movs r7, r7, asr #15
+ adc r7, r7, #0
+ strh r7, [SAMPLES]
+
+ mov r0, REG_CLIP
+
+ ldmfd sp!, {r4, r5, r6, r7, r8, r9, r10, pc}
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_arm_accurate.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_arm_accurate.S
new file mode 100644
index 00000000..481aa1be
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_arm_accurate.S
@@ -0,0 +1,294 @@
+/*
+ synth_arm_accurate: ARM optimized synth (ISO compliant 16bit output version)
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#define WINDOW r0
+#define B0 r1
+#define SAMPLES r2
+#define REG_CLIP r4
+#define REG_MAX r14
+
+/*
+ int synth_1to1_arm_accurate_asm(real *window, real *b0, short *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+ .code 32
+
+ .text
+ ALIGN4
+ .globl ASM_NAME(synth_1to1_arm_accurate_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_arm_accurate_asm), %function
+#endif
+ASM_NAME(synth_1to1_arm_accurate_asm):
+ stmfd sp!, {r4, r5, r6, r7, r8, r9, r10, r11, lr}
+
+ add WINDOW, WINDOW, #64
+ sub WINDOW, WINDOW, r3, lsl #2
+ eor REG_CLIP, REG_CLIP, REG_CLIP
+ mov REG_MAX, #1073741824
+ sub REG_MAX, REG_MAX, #32768
+
+ mov r3, #16
+
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+1:
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smull r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smull r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #68
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+
+ mov r8, r8, lsr #24
+ mov r12, r12, lsr #24
+ orr r8, r8, r7, lsl #8
+ orr r12, r12, r11, lsl #8
+ sub r8, r8, r12
+
+ cmp r8, REG_MAX
+ movgt r8, REG_MAX
+ addgt REG_CLIP, REG_CLIP, #1
+ cmp r8, #-1073741824
+ movlt r8, #-1073741824
+ addlt REG_CLIP, REG_CLIP, #1
+ movs r8, r8, asr #15
+ adc r8, r8, #0
+ strh r8, [SAMPLES], #4
+
+ subs r3, r3, #1
+ bne 1b
+
+ add WINDOW, WINDOW, #4
+ add B0, B0, #4
+
+ ldr r9, [WINDOW], #8
+ ldr r10, [B0], #8
+ smull r8, r7, r5, r6
+ ldr r5, [WINDOW], #8
+ ldr r6, [B0], #8
+ smull r12, r11, r9, r10
+ ldr r9, [WINDOW], #8
+ ldr r10, [B0], #8
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #8
+ ldr r6, [B0], #8
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #8
+ ldr r10, [B0], #8
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #8
+ ldr r6, [B0], #8
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #72
+ ldr r10, [B0], #-120
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+
+ mov r8, r8, lsr #24
+ mov r12, r12, lsr #24
+ orr r8, r8, r7, lsl #8
+ orr r12, r12, r11, lsl #8
+ add r8, r8, r12
+
+ cmp r8, REG_MAX
+ movgt r8, REG_MAX
+ addgt REG_CLIP, REG_CLIP, #1
+ cmp r8, #-1073741824
+ movlt r8, #-1073741824
+ addlt REG_CLIP, REG_CLIP, #1
+ movs r8, r8, asr #15
+ adc r8, r8, #0
+ strh r8, [SAMPLES], #4
+
+ mov r3, #14
+
+1:
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smull r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smull r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #68
+ ldr r10, [B0], #-124
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+
+ mov r8, r8, lsr #24
+ mov r12, r12, lsr #24
+ orr r8, r8, r7, lsl #8
+ orr r12, r12, r11, lsl #8
+ add r8, r8, r12
+
+ cmp r8, REG_MAX
+ movgt r8, REG_MAX
+ addgt REG_CLIP, REG_CLIP, #1
+ cmp r8, #-1073741824
+ movlt r8, #-1073741824
+ addlt REG_CLIP, REG_CLIP, #1
+ movs r8, r8, asr #15
+ adc r8, r8, #0
+ strh r8, [SAMPLES], #4
+
+ subs r3, r3, #1
+ bne 1b
+
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smull r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smull r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #4
+ ldr r10, [B0], #4
+ smlal r8, r7, r5, r6
+ ldr r5, [WINDOW], #4
+ ldr r6, [B0], #4
+ smlal r12, r11, r9, r10
+ ldr r9, [WINDOW], #68
+ ldr r10, [B0], #-124
+ smlal r8, r7, r5, r6
+ smlal r12, r11, r9, r10
+
+ mov r8, r8, lsr #24
+ mov r12, r12, lsr #24
+ orr r8, r8, r7, lsl #8
+ orr r12, r12, r11, lsl #8
+ add r8, r8, r12
+
+ cmp r8, REG_MAX
+ movgt r8, REG_MAX
+ addgt REG_CLIP, REG_CLIP, #1
+ cmp r8, #-1073741824
+ movlt r8, #-1073741824
+ addlt REG_CLIP, REG_CLIP, #1
+ movs r8, r8, asr #15
+ adc r8, r8, #0
+ strh r8, [SAMPLES]
+
+ mov r0, REG_CLIP
+
+ ldmfd sp!, {r4, r5, r6, r7, r8, r9, r10, r11, pc}
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_i486.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_i486.c
new file mode 100644
index 00000000..01b0119d
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_i486.c
@@ -0,0 +1,252 @@
+/*
+ decode_i486.c: i486 decode
+
+ copyright 1998-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Fabrice Bellard
+
+ One has to see if the modification for non-static memory kills this optimization (cache locality?).
+*/
+
+/*
+ * Subband Synthesis for MPEG Audio.
+ *
+ * Version optimized for 80486 by using integer arithmetic,
+ * multiplications by shift and add, and by increasing locality in
+ * order to fit the 8KB L1 cache. This code should be compiled with gcc
+ * 2.7.2 or higher.
+ *
+ * Note: this version does not guaranty a good accuracy. The filter
+ * coefficients are quantified on 14 bits.
+ *
+ * (c) 1998 Fabrice Bellard
+ */
+
+#include "mpg123lib_intern.h"
+
+#define FIR16_1(pos,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15) \
+{\
+ int sum;\
+ sum=(c0)*b0[0]+(c1)*b0[1]+(c2)*b0[2]+(c3)*b0[3]+\
+ (c4)*b0[4]+(c5)*b0[5]+(c6)*b0[6]+(c7)*b0[7]+\
+ (c8)*b0[8]+(c9)*b0[9]+(c10)*b0[10]+(c11)*b0[11]+\
+ (c12)*b0[12]+(c13)*b0[13]+(c14)*b0[14]+(c15)*b0[15];\
+ sum=(sum+(1 << 13))>>14;\
+ if (sum<-32768) sum=-32768;\
+ else if (sum>32767) sum=32767;\
+ samples[2*(pos)]=sum;\
+ b0+=FIR_BUFFER_SIZE;\
+}
+
+#define FIR16_2(pos1,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,\
+ pos2,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15) \
+{\
+ int sum1,sum2,v;\
+\
+ v=b0[0];\
+ sum1=(c0)*v;\
+ sum2=(d0)*v;\
+ v=b0[1];\
+ sum1+=(c1)*v;\
+ sum2+=(d1)*v;\
+ v=b0[2];\
+ sum1+=(c2)*v;\
+ sum2+=(d2)*v;\
+ v=b0[3];\
+ sum1+=(c3)*v;\
+ sum2+=(d3)*v;\
+ v=b0[4];\
+ sum1+=(c4)*v;\
+ sum2+=(d4)*v;\
+ v=b0[5];\
+ sum1+=(c5)*v;\
+ sum2+=(d5)*v;\
+ v=b0[6];\
+ sum1+=(c6)*v;\
+ sum2+=(d6)*v;\
+ v=b0[7];\
+ sum1+=(c7)*v;\
+ sum2+=(d7)*v;\
+ v=b0[8];\
+ sum1+=(c8)*v;\
+ sum2+=(d8)*v;\
+ v=b0[9];\
+ sum1+=(c9)*v;\
+ sum2+=(d9)*v;\
+ v=b0[10];\
+ sum1+=(c10)*v;\
+ sum2+=(d10)*v;\
+ v=b0[11];\
+ sum1+=(c11)*v;\
+ sum2+=(d11)*v;\
+ v=b0[12];\
+ sum1+=(c12)*v;\
+ sum2+=(d12)*v;\
+ v=b0[13];\
+ sum1+=(c13)*v;\
+ sum2+=(d13)*v;\
+ v=b0[14];\
+ sum1+=(c14)*v;\
+ sum2+=(d14)*v;\
+ v=b0[15];\
+ sum1+=(c15)*v;\
+ sum2+=(d15)*v;\
+\
+ sum1=(sum1+(1<<13))>>14;\
+ sum2=(sum2+(1<<13))>>14;\
+\
+ if (sum1<-32768) sum1=-32768;\
+ else if (sum1>32767) sum1=32767;\
+ samples[(pos1)*2]=sum1;\
+\
+ if (sum2<-32768) sum2=-32768;\
+ else if (sum2>32767) sum2=32767;\
+ samples[(pos2)*2]=sum2;\
+ b0+=FIR_BUFFER_SIZE;\
+}
+
+int absynth_1to1_i486(real *bandPtr, int channel, mpg123_handle *fr, int nb_blocks)
+{
+ short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
+ int *b0,**buf;
+ int clip = 0;
+ int block,b,bo_start;
+
+ /* samples address */
+ samples+=channel;
+
+ bo_start=fr->i486bo[channel];
+ buf = fr->int_buffs[channel];
+
+ b=bo_start;
+ for(block=0;block<nb_blocks;block++) {
+
+ /* FIR offset */
+ b++;
+ if (b >= FIR_BUFFER_SIZE) {
+ int *p,*q;
+ int c,i,j;
+
+ /* we shift the buffers */
+ for(c=0;c<2;c++) {
+ p=&buf[c][0]+1;
+ q=p+(FIR_BUFFER_SIZE-FIR_SIZE);
+ for(i=0;i<17;i++) {
+ for(j=0;j<FIR_SIZE-1;j++) p[j]=q[j];
+ p+=FIR_BUFFER_SIZE;
+ q+=FIR_BUFFER_SIZE;
+ }
+ }
+ /* we update 'bo' accordingly */
+ b=fr->i486bo[channel]=FIR_SIZE;
+ }
+
+ if(b & 1) {
+ dct64_i486(buf[1]+b,buf[0]+b,bandPtr);
+ } else {
+ dct64_i486(buf[0]+b,buf[1]+b,bandPtr);
+ }
+ bandPtr+=32;
+ }
+ fr->i486bo[channel]=b;
+
+ /* filter bank: part 1 */
+ b=bo_start;
+ for(block=0;block<nb_blocks;block++) {
+ b++;
+ if (b >= FIR_BUFFER_SIZE) b=FIR_SIZE;
+ if(b & 1) {
+ b0 = buf[0] + b - (FIR_SIZE-1);
+ } else {
+ b0 = buf[1] + b - (FIR_SIZE-1);
+ }
+
+ FIR16_1(0,-7,53,-114,509,-1288,1643,-9372,18759,9372,1643,1288,509,114,53,7,0);
+ FIR16_2(1,-6,52,-100,515,-1197,1783,-8910,18748,9834,1489,1379,500,129,54,7,0,
+ 31,0,-7,54,-129,500,-1379,1489,-9834,18748,8910,1783,1197,515,100,52,6);
+ FIR16_2(2,-6,50,-86,520,-1106,1910,-8447,18714,10294,1322,1469,488,145,55,8,0,
+ 30,0,-8,55,-145,488,-1469,1322,-10294,18714,8447,1910,1106,520,86,50,6);
+ FIR16_2(3,-5,49,-73,521,-1015,2023,-7986,18657,10751,1140,1559,473,161,56,9,0,
+ 29,0,-9,56,-161,473,-1559,1140,-10751,18657,7986,2023,1015,521,73,49,5);
+ samples+=64;
+ }
+ samples-=64*nb_blocks;
+
+ /* filter bank: part 2 */
+
+ b=bo_start;
+ for(block=0;block<nb_blocks;block++) {
+ b++;
+ if (b >= FIR_BUFFER_SIZE) b=FIR_SIZE;
+ if(b & 1) {
+ b0 = buf[0] + b - (FIR_SIZE-1) + 4*FIR_BUFFER_SIZE;
+ } else {
+ b0 = buf[1] + b - (FIR_SIZE-1) + 4*FIR_BUFFER_SIZE;
+ }
+
+ FIR16_2(4,-4,47,-61,521,-926,2123,-7528,18578,11205,944,1647,455,177,56,10,0,
+ 28,0,-10,56,-177,455,-1647,944,-11205,18578,7528,2123,926,521,61,47,4);
+ FIR16_2(5,-4,45,-49,518,-837,2210,-7072,18477,11654,733,1733,434,194,57,11,0,
+ 27,0,-11,57,-194,434,-1733,733,-11654,18477,7072,2210,837,518,49,45,4);
+ FIR16_2(6,-4,44,-38,514,-751,2284,-6620,18353,12097,509,1817,411,212,57,12,0,
+ 26,0,-12,57,-212,411,-1817,509,-12097,18353,6620,2284,751,514,38,44,4);
+ FIR16_2(7,-3,42,-27,508,-665,2347,-6173,18208,12534,270,1899,383,229,56,13,0,
+ 25,0,-13,56,-229,383,-1899,270,-12534,18208,6173,2347,665,508,27,42,3);
+
+ samples+=64;
+ }
+ samples-=64*nb_blocks;
+
+ /* filter bank: part 3 */
+
+ b=bo_start;
+ for(block=0;block<nb_blocks;block++) {
+ b++;
+ if (b >= FIR_BUFFER_SIZE) b=FIR_SIZE;
+ if(b & 1) {
+ b0 = buf[0] + b - (FIR_SIZE-1) + 8*FIR_BUFFER_SIZE;
+ } else {
+ b0 = buf[1] + b - (FIR_SIZE-1) + 8*FIR_BUFFER_SIZE;
+ }
+
+ FIR16_2(8,-3,40,-18,500,-582,2398,-5732,18042,12963,17,1977,353,247,56,14,0,
+ 24,0,-14,56,-247,353,-1977,17,-12963,18042,5732,2398,582,500,18,40,3);
+ FIR16_2(9,-2,38,-9,490,-501,2437,-5297,17855,13383,-249,2052,320,266,55,15,0,
+ 23,0,-15,55,-266,320,-2052,-249,-13383,17855,5297,2437,501,490,9,38,2);
+ FIR16_2(10,-2,36,0,479,-423,2465,-4869,17647,13794,-530,2122,282,284,53,17,0,
+ 22,0,-17,53,-284,282,-2122,-530,-13794,17647,4869,2465,423,479,0,36,2);
+ FIR16_2(11,-2,34,7,467,-347,2483,-4449,17419,14194,-825,2188,242,302,52,18,0,
+ 21,0,-18,52,-302,242,-2188,-825,-14194,17419,4449,2483,347,467,-7,34,2);
+
+ samples+=64;
+ }
+ samples-=64*nb_blocks;
+
+ /* filter bank: part 4 */
+
+ b=bo_start;
+ for(block=0;block<nb_blocks;block++) {
+ b++;
+ if (b >= FIR_BUFFER_SIZE) b=FIR_SIZE;
+ if(b & 1) {
+ b0 = buf[0] + b - (FIR_SIZE-1) + 12*FIR_BUFFER_SIZE;
+ } else {
+ b0 = buf[1] + b - (FIR_SIZE-1) + 12*FIR_BUFFER_SIZE;
+ }
+
+ FIR16_2(12,-2,33,14,454,-273,2491,-4038,17173,14583,-1133,2249,198,320,50,19,0,
+ 20,0,-19,50,-320,198,-2249,-1133,-14583,17173,4038,2491,273,454,-14,33,2);
+ FIR16_2(13,-1,31,20,439,-203,2489,-3637,16907,14959,-1454,2304,151,339,47,21,-1,
+ 19,-1,-21,47,-339,151,-2304,-1454,-14959,16907,3637,2489,203,439,-20,31,1);
+ FIR16_2(14,-1,29,26,424,-136,2479,-3245,16623,15322,-1788,2354,100,357,44,22,-1,
+ 18,-1,-22,44,-357,100,-2354,-1788,-15322,16623,3245,2479,136,424,-26,29,1);
+ FIR16_2(15,-1,27,31,408,-72,2459,-2863,16322,15671,-2135,2396,46,374,40,24,-1,
+ 17,-1,-24,40,-374,46,-2396,-2135,-15671,16322,2863,2459,72,408,-31,27,1);
+ FIR16_1(16,-1,0,36,0,-11,0,-2493,0,16004,0,2431,0,391,0,26,0);
+
+ samples+=64;
+ }
+
+ return clip;
+}
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_i586.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_i586.S
new file mode 100644
index 00000000..37f0dbf0
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_i586.S
@@ -0,0 +1,343 @@
+/*
+ decode_i586: asm synth
+
+ copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Stefan Bieschewski
+
+ synth_1to1 works the same way as the c version of this
+ file. only two types of changes have been made:
+ - reordered floating point instructions to
+ prevent pipline stalls
+ - made WRITE_SAMPLE use integer instead of
+ (slower) floating point
+ all kinds of x86 processors should benefit from these
+ modifications.
+
+ useful sources of information on optimizing x86 code include:
+
+ Intel Architecture Optimization Manual
+ http://www.intel.com/design/pentium/manuals/242816.htm
+
+ Cyrix 6x86 Instruction Set Summary
+ ftp://ftp.cyrix.com/6x86/6x-dbch6.pdf
+
+ AMD-K5 Processor Software Development
+ http://www.amd.com/products/cpg/techdocs/appnotes/20007e.pdf
+
+ Stefan Bieschewski <stb@acm.org>
+
+ $Id: decode_i586.s 1 2004-09-18 13:30:08Z thomas $
+*/
+
+#include "mangle.h"
+
+.data
+#if !defined (__APPLE__) && !defined (__OS2__)
+.section .rodata
+#endif
+ ALIGN8
+.LC0:
+ .long 0x0,0x40dfffc0
+ ALIGN8
+.LC1:
+ .long 0x0,0xc0e00000
+ ALIGN8
+.text
+/* int synth_1to1_i586_asm(real *bandPtr, int channel, unsigned char *out, unsigned char *buffs, int *bo, real *decwin); */
+.globl ASM_NAME(synth_1to1_i586_asm)
+ASM_NAME(synth_1to1_i586_asm):
+ subl $12,%esp
+ pushl %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+/* stack: 0=ebx, 4=esi, 8=edi, 12=ebp, 16,20,24=local, 28=back, 32=bandPtr, 36=channel, 40=out, 44=buffs, 48=bo, 52=decwin */
+ movl 32(%esp),%eax /* *bandPtr */
+ movl 40(%esp),%esi /* *out */
+ movl 48(%esp),%edi /* *bo */
+ movl (%edi),%ebp /* store bo value in ebp */
+ xorl %edi,%edi
+ cmpl %edi,36(%esp)
+ jne .L48 /* if(!channel) */
+ decl %ebp /* bo-- */
+ andl $15,%ebp /* bo &= 0xf */
+ movl 48(%esp), %edi /* *bo */
+ movl %ebp,(%edi) /* write back bo */
+ xorl %edi,%edi /* restore %edi to 0; it's used later */
+ movl 44(%esp),%ecx /* use buffs */
+ jmp .L49
+.L48: /* if(channel) use buffs+2176 */
+ addl $2,%esi
+ movl 44(%esp),%ecx /* *buffs */
+ addl $2176,%ecx
+.L49:
+ testl $1,%ebp
+ je .L50
+ movl %ecx,%ebx
+ movl %ebp,16(%esp)
+ pushl %eax
+ movl 20(%esp),%edx
+ leal (%ebx,%edx,4),%eax
+ pushl %eax
+ movl 24(%esp),%eax
+ incl %eax
+ andl $15,%eax
+ leal 1088(,%eax,4),%eax
+ addl %ebx,%eax
+ jmp .L74
+.L50:
+ leal 1088(%ecx),%ebx
+ leal 1(%ebp),%edx
+ movl %edx,16(%esp)
+ pushl %eax
+ leal 1092(%ecx,%ebp,4),%eax
+ pushl %eax
+ leal (%ecx,%ebp,4),%eax
+.L74:
+ pushl %eax
+ call FUNC(dct64_i386)
+ addl $12,%esp
+/* stack now back on track */
+ movl 16(%esp),%edx
+ leal 0(,%edx,4),%edx
+ movl 52(%esp),%eax /* decwin */
+ addl $64,%eax
+ movl %eax,%ecx
+ subl %edx,%ecx
+ movl $16,%ebp
+.L55:
+ flds (%ecx)
+ fmuls (%ebx)
+ flds 4(%ecx)
+ fmuls 4(%ebx)
+ fxch %st(1)
+ flds 8(%ecx)
+ fmuls 8(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds 12(%ecx)
+ fmuls 12(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 16(%ecx)
+ fmuls 16(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds 20(%ecx)
+ fmuls 20(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 24(%ecx)
+ fmuls 24(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds 28(%ecx)
+ fmuls 28(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 32(%ecx)
+ fmuls 32(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds 36(%ecx)
+ fmuls 36(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 40(%ecx)
+ fmuls 40(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds 44(%ecx)
+ fmuls 44(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 48(%ecx)
+ fmuls 48(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds 52(%ecx)
+ fmuls 52(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 56(%ecx)
+ fmuls 56(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds 60(%ecx)
+ fmuls 60(%ebx)
+ fxch %st(2)
+ subl $4,%esp
+ faddp %st,%st(1)
+ fxch %st(1)
+ fsubrp %st,%st(1)
+ fistpl (%esp)
+ popl %eax
+ cmpl $32767,%eax
+ jg 1f
+ cmpl $-32768,%eax
+ jl 2f
+ movw %ax,(%esi)
+ jmp 4f
+1: movw $32767,(%esi)
+ jmp 3f
+2: movw $-32768,(%esi)
+3: incl %edi
+4:
+.L54:
+ addl $64,%ebx
+ subl $-128,%ecx
+ addl $4,%esi
+ decl %ebp
+ jnz .L55
+ flds (%ecx)
+ fmuls (%ebx)
+ flds 8(%ecx)
+ fmuls 8(%ebx)
+ flds 16(%ecx)
+ fmuls 16(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 24(%ecx)
+ fmuls 24(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 32(%ecx)
+ fmuls 32(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 40(%ecx)
+ fmuls 40(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 48(%ecx)
+ fmuls 48(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 56(%ecx)
+ fmuls 56(%ebx)
+ fxch %st(2)
+ subl $4,%esp
+ faddp %st,%st(1)
+ fxch %st(1)
+ faddp %st,%st(1)
+ fistpl (%esp)
+ popl %eax
+ cmpl $32767,%eax
+ jg 1f
+ cmpl $-32768,%eax
+ jl 2f
+ movw %ax,(%esi)
+ jmp 4f
+1: movw $32767,(%esi)
+ jmp 3f
+2: movw $-32768,(%esi)
+3: incl %edi
+4:
+.L62:
+ addl $-64,%ebx
+ addl $4,%esi
+ movl 16(%esp),%edx
+ leal -128(%ecx,%edx,8),%ecx
+ movl $15,%ebp
+.L68:
+ flds -4(%ecx)
+ fchs
+ fmuls (%ebx)
+ flds -8(%ecx)
+ fmuls 4(%ebx)
+ fxch %st(1)
+ flds -12(%ecx)
+ fmuls 8(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -16(%ecx)
+ fmuls 12(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -20(%ecx)
+ fmuls 16(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -24(%ecx)
+ fmuls 20(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -28(%ecx)
+ fmuls 24(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -32(%ecx)
+ fmuls 28(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -36(%ecx)
+ fmuls 32(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -40(%ecx)
+ fmuls 36(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -44(%ecx)
+ fmuls 40(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -48(%ecx)
+ fmuls 44(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -52(%ecx)
+ fmuls 48(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -56(%ecx)
+ fmuls 52(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -60(%ecx)
+ fmuls 56(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds (%ecx)
+ fmuls 60(%ebx)
+ fxch %st(2)
+ subl $4,%esp
+ fsubrp %st,%st(1)
+ fxch %st(1)
+ fsubrp %st,%st(1)
+ fistpl (%esp)
+ popl %eax
+ cmpl $32767,%eax
+ jg 1f
+ cmpl $-32768,%eax
+ jl 2f
+ movw %ax,(%esi)
+ jmp 4f
+1: movw $32767,(%esi)
+ jmp 3f
+2: movw $-32768,(%esi)
+3: incl %edi
+4:
+.L67:
+ addl $-64,%ebx
+ addl $-128,%ecx
+ addl $4,%esi
+ decl %ebp
+ jnz .L68
+ movl %edi,%eax
+ popl %ebx
+ popl %esi
+ popl %edi
+ popl %ebp
+ addl $12,%esp
+ ret
+
+#if defined(PIC) && defined(__APPLE__)
+ .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
+L_dct64_i386:
+ .indirect_symbol ASM_NAME(dct64_i386)
+ hlt ; hlt ; hlt ; hlt ; hlt
+#endif
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_i586_dither.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_i586_dither.S
new file mode 100644
index 00000000..7cbc35f2
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_i586_dither.S
@@ -0,0 +1,382 @@
+/*
+ decode_i586_dither: asm synth with dither noise
+
+ copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Stefan Bieschewski as decode_i586.s without dither
+
+ This version uses "circular" 64k dither noise.
+ (Patch by Adrian <adrian.bacon@xs4all.nl>)
+
+ Thomas learned something about assembler and the stack while making this one thread safe (removing static data).
+*/
+
+#include "mangle.h"
+
+.data
+#if !defined (__APPLE__) && !defined (__OS2__)
+ .section .rodata
+#endif
+ ALIGN8
+.LC0:
+ .long 0x0,0x40dfffc0
+ ALIGN8
+.LC1:
+ .long 0x0,0xc0e00000
+ ALIGN8
+.text
+/* int synth_1to1_i586_asm_dither(real *bandPtr, int channel, unsigned char *out, unsigned char *buffs, int bo_and_ditherindex[2], real *decwin, real* dithernoise); */
+.globl ASM_NAME(synth_1to1_i586_asm_dither)
+ASM_NAME(synth_1to1_i586_asm_dither):
+ subl $16,%esp
+ pushl %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+/* stack: 0(%esp)=%ebx 4=esi 8=edi 12=ebp 16,20,24,28=local 32=back 36=bandptr 40=channel 44=out 48=buffs 52=bo 56=decwin 60=dithernoise */
+#define BANDPTR 36(%esp)
+#define CHANNEL 40(%esp)
+#define OUT 44(%esp)
+#define BUFFS 48(%esp)
+#define BO 52(%esp)
+#define DECWIN 56(%esp)
+#define DITHERNOISE 60(%esp)
+/*#define DITHERNOISE $(ASM_NAME(dithernoise))*/
+#define LOC0 16(%esp)
+#define LOC1 20(%esp)
+#define LOC2 24(%esp)
+#define DITHERINDEX 28(%esp)
+/* During application of the dithering, we need the shifted locations because there's an additional value on the stack. */
+#define DITHERNOISE2 64(%esp)
+#define DITHERINDEX2 32(%esp)
+
+ movl BANDPTR,%eax
+ movl OUT,%esi
+ movl BO, %ebx
+ movl (%ebx),%ebp /* get bo value */
+ movl 4(%ebx),%edi; /* get the ditherindex behind bo */
+ movl %edi,DITHERINDEX
+ xorl %edi,%edi
+ cmpl %edi,CHANNEL
+ jne .L48
+ decl %ebp
+ andl $15,%ebp
+ movl %ebp,(%ebx) /* save bo back */
+ movl BUFFS,%ecx
+ jmp .L49
+.L48:
+/* In stereo mode , "rewind" dither pointer 32 samples , so 2nd channel */
+/* has same dither values. Tested OK for mono and stereo MP2 and MP3 */
+ subl $128,DITHERINDEX /* better move to %edi for the two calculations? */
+ andl $0x0003fffc,DITHERINDEX
+ addl $2,%esi
+ movl BUFFS,%ecx
+ addl $2176,%ecx
+.L49:
+/* now the call of dct64 is prepared, stuff pushed to the stack, but soon after it's removed again */
+ testl $1,%ebp
+ je .L50
+ movl %ecx,%ebx
+ movl %ebp,LOC0
+ pushl %eax
+ movl LOC1,%edx
+ leal (%ebx,%edx,4),%eax
+ pushl %eax
+ movl LOC2,%eax
+ incl %eax
+ andl $15,%eax
+ leal 1088(,%eax,4),%eax
+ addl %ebx,%eax
+ jmp .L74
+.L50:
+ leal 1088(%ecx),%ebx
+ leal 1(%ebp),%edx
+ movl %edx,LOC0
+ pushl %eax
+ leal 1092(%ecx,%ebp,4),%eax
+ pushl %eax
+ leal (%ecx,%ebp,4),%eax
+.L74:
+ pushl %eax
+ call FUNC(dct64_i386)
+ addl $12,%esp
+/* Now removed the parameters.
+ stack: 0(%esp)=%ebx 4=esi 8=edi 12=ebp 16,20,24,28=local 32=back 36=bandptr 40=channel 44=out 48=buffs 52=bo 56=decwin 60=dithernoise */
+ movl LOC0,%edx
+ leal 0(,%edx,4),%edx
+ /* movl ASM_VALUE(decwin)+64,%eax */
+ movl DECWIN,%eax
+ addl $64,%eax
+ movl %eax,%ecx
+ subl %edx,%ecx
+ movl $16,%ebp
+.L55:
+ flds (%ecx)
+ fmuls (%ebx)
+ flds 4(%ecx)
+ fmuls 4(%ebx)
+ fxch %st(1)
+ flds 8(%ecx)
+ fmuls 8(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds 12(%ecx)
+ fmuls 12(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 16(%ecx)
+ fmuls 16(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds 20(%ecx)
+ fmuls 20(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 24(%ecx)
+ fmuls 24(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds 28(%ecx)
+ fmuls 28(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 32(%ecx)
+ fmuls 32(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds 36(%ecx)
+ fmuls 36(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 40(%ecx)
+ fmuls 40(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds 44(%ecx)
+ fmuls 44(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 48(%ecx)
+ fmuls 48(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds 52(%ecx)
+ fmuls 52(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 56(%ecx)
+ fmuls 56(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds 60(%ecx)
+ fmuls 60(%ebx)
+ fxch %st(2)
+ subl $4,%esp
+ faddp %st,%st(1)
+ fxch %st(1)
+ fsubrp %st,%st(1)
+
+ addl $4,DITHERINDEX2
+ andl $0x0003fffc,DITHERINDEX2
+ movl DITHERNOISE2,%edi
+ addl DITHERINDEX2,%edi
+
+ fadds (%edi)
+
+/* fistpl and popl as a unit keep the stack unchanged */
+ fistpl (%esp)
+ popl %eax
+ cmpl $32767,%eax
+ jg 1f
+ cmpl $-32768,%eax
+ jl 2f
+ movw %ax,(%esi)
+ jmp 4f
+1: movw $32767,(%esi)
+ jmp 3f
+2: movw $-32768,(%esi)
+3:
+/* incl %edi */
+4:
+.L54:
+ addl $64,%ebx
+ subl $-128,%ecx
+ addl $4,%esi
+ decl %ebp
+ jnz .L55
+ flds (%ecx)
+ fmuls (%ebx)
+ flds 8(%ecx)
+ fmuls 8(%ebx)
+ flds 16(%ecx)
+ fmuls 16(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 24(%ecx)
+ fmuls 24(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 32(%ecx)
+ fmuls 32(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 40(%ecx)
+ fmuls 40(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 48(%ecx)
+ fmuls 48(%ebx)
+ fxch %st(2)
+ faddp %st,%st(1)
+ flds 56(%ecx)
+ fmuls 56(%ebx)
+ fxch %st(2)
+ subl $4,%esp
+ faddp %st,%st(1)
+ fxch %st(1)
+ faddp %st,%st(1)
+
+ addl $4,DITHERINDEX2
+ andl $0x0003fffc,DITHERINDEX2
+ movl DITHERNOISE2,%edi
+ addl DITHERINDEX2,%edi
+
+ fadds (%edi)
+/* fistpl and popl as a unit keep the stack unchanged */
+ fistpl (%esp)
+ popl %eax
+ cmpl $32767,%eax
+ jg 1f
+ cmpl $-32768,%eax
+ jl 2f
+ movw %ax,(%esi)
+ jmp 4f
+1: movw $32767,(%esi)
+ jmp 3f
+2: movw $-32768,(%esi)
+3:
+/* incl %edi */
+4:
+.L62:
+ addl $-64,%ebx
+ addl $4,%esi
+ movl LOC0,%edx
+ leal -128(%ecx,%edx,8),%ecx
+ movl $15,%ebp
+.L68:
+ flds -4(%ecx)
+ fchs
+ fmuls (%ebx)
+ flds -8(%ecx)
+ fmuls 4(%ebx)
+ fxch %st(1)
+ flds -12(%ecx)
+ fmuls 8(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -16(%ecx)
+ fmuls 12(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -20(%ecx)
+ fmuls 16(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -24(%ecx)
+ fmuls 20(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -28(%ecx)
+ fmuls 24(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -32(%ecx)
+ fmuls 28(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -36(%ecx)
+ fmuls 32(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -40(%ecx)
+ fmuls 36(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -44(%ecx)
+ fmuls 40(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -48(%ecx)
+ fmuls 44(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -52(%ecx)
+ fmuls 48(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -56(%ecx)
+ fmuls 52(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds -60(%ecx)
+ fmuls 56(%ebx)
+ fxch %st(2)
+ fsubrp %st,%st(1)
+ flds (%ecx)
+ fmuls 60(%ebx)
+ fxch %st(2)
+ subl $4,%esp
+ fsubrp %st,%st(1)
+ fxch %st(1)
+ fsubrp %st,%st(1)
+
+ addl $4,DITHERINDEX2
+ andl $0x0003fffc,DITHERINDEX2
+ movl DITHERNOISE2,%edi
+ addl DITHERINDEX2,%edi
+
+ fadds (%edi)
+/* fistpl and popl as a unit keep the stack unchanged */
+ fistpl (%esp)
+ popl %eax
+ cmpl $32767,%eax
+ jg 1f
+ cmpl $-32768,%eax
+ jl 2f
+ movw %ax,(%esi)
+ jmp 4f
+1: movw $32767,(%esi)
+ jmp 3f
+2: movw $-32768,(%esi)
+3:
+/* incl %edi */
+4:
+.L67:
+ addl $-64,%ebx
+ addl $-128,%ecx
+ addl $4,%esi
+ decl %ebp
+ jnz .L68
+/* return ipv edi 0 in eax */
+ movl $0,%eax
+/* save ditherindex */
+ movl BO,%ebx
+ movl DITHERINDEX,%esi
+ movl %esi,4(%ebx);
+/* stack: 0=ebx 4=esi 8=edi 12=ebp 16,20,24,28=local 32=back 36=bandptr 40=channel 44=out 48=buffs 52=bo */
+ popl %ebx
+ popl %esi
+ popl %edi
+ popl %ebp
+ addl $16,%esp
+/* The stack must be now: 0=back 4=bandptr 8=channel 12=out 16=buffs 20=bo */
+ ret
+
+#if defined(PIC) && defined(__APPLE__)
+ .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
+L_dct64_i386:
+ .indirect_symbol ASM_NAME(dct64_i386)
+ hlt ; hlt ; hlt ; hlt ; hlt
+#endif
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_mmx.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_mmx.S
new file mode 100644
index 00000000..e57e4f0f
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_mmx.S
@@ -0,0 +1,141 @@
+ /*
+ synth_mmx: MMX optimized synth
+
+ copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by the mysterious higway (apparently)
+
+ Thomas' notes about the LGPL transition:
+
+ Initially, I found the note "this code comes under GPL" in this file.
+ After asking Michael Hipp about legal status of the MMX files, he said
+ that he received them without any comment and thus I believe that the GPL
+ comment was made by Michael, since he made mpg123 GPL at some time - and
+ marked some files that way, but not all. The contributer accepted the
+ license terms of mpg123 back then, which included Michael deciding on
+ license issues.
+
+ Based on that thought, I now consider this file along with the other parts
+ of higway's MMX optimisation to be licensed under LGPL 2.1 by Michael's
+ decision.
+*/
+
+#include "mangle.h"
+
+.text
+
+.globl ASM_NAME(synth_1to1_MMX)
+/* int synth_1to1_MMX(real *bandPtr, int channel, short *out, short *buffs, int *bo, float *decwins); */
+ASM_NAME(synth_1to1_MMX):
+ pushl %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+/* stack: 0=ebx, 4=esi, 8=edi, 12=ebp, 16=back, 20=bandPtr, 24=channel, 28=out, 32=buffs, 36=bo, 40=decwins */
+ movl 24(%esp),%ecx
+ movl 28(%esp),%edi
+ movl $15,%ebx
+ movl 36(%esp),%edx
+ leal (%edi,%ecx,2),%edi
+ decl %ecx
+ movl 32(%esp),%esi
+ movl (%edx),%eax
+ jecxz 1f
+ decl %eax
+ andl %ebx,%eax
+ leal 1088(%esi),%esi
+ movl %eax,(%edx)
+1:
+ leal (%esi,%eax,2),%edx
+ movl %eax,%ebp
+ incl %eax
+ pushl 20(%esp)
+ andl %ebx,%eax
+ leal 544(%esi,%eax,2),%ecx
+ incl %ebx
+ testl $1, %eax
+ jnz 2f
+ xchgl %edx,%ecx
+ incl %ebp
+ leal 544(%esi),%esi
+2:
+ pushl %edx
+ pushl %ecx
+ call FUNC(dct64_MMX)
+ addl $12,%esp
+/* stack like before, pushed 3, incremented again */
+ leal 1(%ebx), %ecx
+ subl %ebp,%ebx
+ pushl %eax
+ movl 44(%esp),%eax /* decwins */
+ leal (%eax,%ebx,2), %edx
+ popl %eax
+3:
+ movq (%edx),%mm0
+ pmaddwd (%esi),%mm0
+ movq 8(%edx),%mm1
+ pmaddwd 8(%esi),%mm1
+ movq 16(%edx),%mm2
+ pmaddwd 16(%esi),%mm2
+ movq 24(%edx),%mm3
+ pmaddwd 24(%esi),%mm3
+ paddd %mm1,%mm0
+ paddd %mm2,%mm0
+ paddd %mm3,%mm0
+ movq %mm0,%mm1
+ psrlq $32,%mm1
+ paddd %mm1,%mm0
+ psrad $13,%mm0
+ packssdw %mm0,%mm0
+ movd %mm0,%eax
+ movw %ax, (%edi)
+
+ leal 32(%esi),%esi
+ leal 64(%edx),%edx
+ leal 4(%edi),%edi
+ loop 3b
+
+
+ subl $64,%esi
+ movl $15,%ecx
+4:
+ movq (%edx),%mm0
+ pmaddwd (%esi),%mm0
+ movq 8(%edx),%mm1
+ pmaddwd 8(%esi),%mm1
+ movq 16(%edx),%mm2
+ pmaddwd 16(%esi),%mm2
+ movq 24(%edx),%mm3
+ pmaddwd 24(%esi),%mm3
+ paddd %mm1,%mm0
+ paddd %mm2,%mm0
+ paddd %mm3,%mm0
+ movq %mm0,%mm1
+ psrlq $32,%mm1
+ paddd %mm0,%mm1
+ psrad $13,%mm1
+ packssdw %mm1,%mm1
+ psubd %mm0,%mm0
+ psubsw %mm1,%mm0
+ movd %mm0,%eax
+ movw %ax,(%edi)
+
+ subl $32,%esi
+ addl $64,%edx
+ leal 4(%edi),%edi
+ loop 4b
+ emms
+ popl %ebx
+ popl %esi
+ popl %edi
+ popl %ebp
+ ret
+
+#if defined(PIC) && defined(__APPLE__)
+ .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
+L_dct64_MMX:
+ .indirect_symbol ASM_NAME(dct64_MMX)
+ hlt ; hlt ; hlt ; hlt ; hlt
+#endif
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_mono.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_mono.h
new file mode 100644
index 00000000..907aa254
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_mono.h
@@ -0,0 +1,64 @@
+/*
+ monosynth.h: generic mono related synth functions
+
+ copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp, generalized by Thomas Orgis
+
+ This header is used multiple times to create different variants of these functions.
+ See decode.c and synth.h .
+ Hint: BLOCK, MONO_NAME, MONO2STEREO_NAME, SYNTH_NAME and SAMPLE_T do vary.
+
+ Thomas looked closely at the decode_1to1, decode_2to1 and decode_4to1 contents, seeing that they are too similar to be separate files.
+ This is what resulted...
+
+ Reason to separate this from synth.h:
+ There are decoders that have a special synth_1to1 but still can use these generic derivations for the mono stuff.
+ It generally makes a good deal of sense to set SYNTH_NAME to opt_synth_1to1(fr) (or opt_synth_2to1(fr), etc.).
+*/
+
+/* Mono synth, wrapping over SYNTH_NAME */
+int MONO_NAME(real *bandPtr, mpg123_handle *fr)
+{
+ SAMPLE_T samples_tmp[BLOCK];
+ SAMPLE_T *tmp1 = samples_tmp;
+ int i,ret;
+
+ /* save buffer stuff, trick samples_tmp into there, decode, restore */
+ unsigned char *samples = fr->buffer.data;
+ int pnt = fr->buffer.fill;
+ fr->buffer.data = (unsigned char*) samples_tmp;
+ fr->buffer.fill = 0;
+ ret = SYNTH_NAME(bandPtr, 0, fr, 0); /* decode into samples_tmp */
+ fr->buffer.data = samples; /* restore original value */
+
+ /* now append samples from samples_tmp */
+ samples += pnt; /* just the next mem in frame buffer */
+ for(i=0;i<(BLOCK/2);i++)
+ {
+ *( (SAMPLE_T *)samples) = *tmp1;
+ samples += sizeof(SAMPLE_T);
+ tmp1 += 2;
+ }
+ fr->buffer.fill = pnt + (BLOCK/2)*sizeof(SAMPLE_T);
+
+ return ret;
+}
+
+/* Mono to stereo synth, wrapping over SYNTH_NAME */
+int MONO2STEREO_NAME(real *bandPtr, mpg123_handle *fr)
+{
+ int i,ret;
+ unsigned char *samples = fr->buffer.data;
+
+ ret = SYNTH_NAME(bandPtr,0,fr,1);
+ samples += fr->buffer.fill - BLOCK*sizeof(SAMPLE_T);
+
+ for(i=0;i<(BLOCK/2);i++)
+ {
+ ((SAMPLE_T *)samples)[1] = ((SAMPLE_T *)samples)[0];
+ samples+=2*sizeof(SAMPLE_T);
+ }
+
+ return ret;
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon.S
new file mode 100644
index 00000000..eace315b
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon.S
@@ -0,0 +1,135 @@
+/*
+ synth_neon: ARM NEON optimized synth
+
+ copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#define WINDOW r0
+#define B0 r1
+#define SAMPLES r2
+
+/*
+ int synth_1to1_neon_asm(short *window, short *b0, short *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+#ifndef _M_ARM
+ .code 32
+#endif
+#ifndef __APPLE__
+ .fpu neon
+#endif
+
+ .text
+ GLOBAL_SYMBOL ASM_NAME(synth_1to1_neon_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_neon_asm), %function
+#endif
+ ALIGN4
+ASM_NAME(synth_1to1_neon_asm):
+ push {r4-r5, lr}
+ vpush {q4-q7}
+
+ add WINDOW, WINDOW, #32
+ sub WINDOW, WINDOW, r3, lsl #1
+
+ mov r3, #4
+ mov r4, #64
+1:
+ vld1.16 {d0-d3}, [WINDOW], r4
+ vld1.16 {d4-d7}, [B0, :128]!
+ vld1.16 {d8-d11}, [WINDOW], r4
+ vswp d1, d4
+ vld1.16 {d12-d15}, [B0, :128]!
+ vld1.16 {d16-d19}, [WINDOW], r4
+ vld1.16 {d20-d23}, [B0, :128]!
+ vswp d9, d12
+ vld1.16 {d24-d27}, [WINDOW], r4
+ vld1.16 {d28-d31}, [B0, :128]!
+ vswp d17, d20
+ vswp d25, d28
+ vmull.s16 q0, d0, d1
+ vmull.s16 q4, d8, d9
+ vmull.s16 q8, d16, d17
+ vmull.s16 q12, d24, d25
+ vmlal.s16 q0, d4, d5
+ vmlal.s16 q4, d12, d13
+ vmlal.s16 q8, d20, d21
+ vmlal.s16 q12, d28, d29
+ vmlal.s16 q0, d2, d6
+ vmlal.s16 q4, d10, d14
+ vmlal.s16 q8, d18, d22
+ vmlal.s16 q12, d26, d30
+ vmlal.s16 q0, d3, d7
+ vmlal.s16 q4, d11, d15
+ vmlal.s16 q8, d19, d23
+ vmlal.s16 q12, d27, d31
+ vpadd.i32 d0, d0, d1
+ vpadd.i32 d8, d8, d9
+ vpadd.i32 d16, d16, d17
+ vpadd.i32 d24, d24, d25
+ vpadd.i32 d0, d0, d8
+ vpadd.i32 d1, d16, d24
+
+ vld2.16 {d2,d3}, [SAMPLES]
+ vqrshrn.s32 d1, q0, #13
+ vst2.16 {d1,d3}, [SAMPLES]!
+
+ subs r3, r3, #1
+ bne 1b
+
+ mov r3, #4
+ mov r5, #-32
+1:
+ vld1.16 {d0-d3}, [WINDOW], r4
+ vld1.16 {d4-d7}, [B0, :128], r5
+ vld1.16 {d8-d11}, [WINDOW], r4
+ vswp d1, d4
+ vld1.16 {d12-d15}, [B0, :128], r5
+ vld1.16 {d16-d19}, [WINDOW], r4
+ vld1.16 {d20-d23}, [B0, :128], r5
+ vswp d9, d12
+ vld1.16 {d24-d27}, [WINDOW], r4
+ vld1.16 {d28-d31}, [B0, :128], r5
+ vswp d17, d20
+ vswp d25, d28
+ vmull.s16 q0, d0, d1
+ vmull.s16 q4, d8, d9
+ vmull.s16 q8, d16, d17
+ vmull.s16 q12, d24, d25
+ vmlal.s16 q0, d4, d5
+ vmlal.s16 q4, d12, d13
+ vmlal.s16 q8, d20, d21
+ vmlal.s16 q12, d28, d29
+ vmlal.s16 q0, d2, d6
+ vmlal.s16 q4, d10, d14
+ vmlal.s16 q8, d18, d22
+ vmlal.s16 q12, d26, d30
+ vmlal.s16 q0, d3, d7
+ vmlal.s16 q4, d11, d15
+ vmlal.s16 q8, d19, d23
+ vmlal.s16 q12, d27, d31
+ vpadd.i32 d0, d0, d1
+ vpadd.i32 d8, d8, d9
+ vpadd.i32 d16, d16, d17
+ vpadd.i32 d24, d24, d25
+ vpadd.i32 d0, d0, d8
+ vpadd.i32 d1, d16, d24
+
+ vld2.16 {d2,d3}, [SAMPLES]
+ vqrshrn.s32 d1, q0, #13
+ vst2.16 {d1,d3}, [SAMPLES]!
+
+ subs r3, r3, #1
+ bne 1b
+
+ mov r0, #0
+
+ vpop {q4-q7}
+ pop {r4-r5, pc}
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon64.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon64.S
new file mode 100644
index 00000000..68d43a52
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon64.S
@@ -0,0 +1,127 @@
+/*
+ synth_neon64: NEON optimized synth for AArch64
+
+ copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+maxmin_s16:
+ .word 32767
+ .word -32768
+ .text
+ ALIGN4
+ .globl ASM_NAME(synth_1to1_neon64_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_neon64_asm), %function
+#endif
+ASM_NAME(synth_1to1_neon64_asm):
+ add x0, x0, #32
+ sub x0, x0, x3, lsl #1
+ eor v31.16b, v31.16b, v31.16b
+ adrp x5, AARCH64_PCREL_HI(maxmin_s16)
+ add x5, x5, AARCH64_PCREL_LO(maxmin_s16)
+ ld2r {v28.4s,v29.4s}, [x5]
+
+ mov w4, #4
+ mov x5, #64
+1:
+ ld1 {v0.8h,v1.8h}, [x0], x5
+ ld1 {v2.8h,v3.8h}, [x0], x5
+ ld1 {v4.8h,v5.8h}, [x0], x5
+ ld1 {v6.8h,v7.8h}, [x0], x5
+ ld1 {v16.8h,v17.8h,v18.8h,v19.8h}, [x1], #64
+ ld1 {v20.8h,v21.8h,v22.8h,v23.8h}, [x1], #64
+
+ smull v24.4s, v0.4h, v16.4h
+ smull v25.4s, v2.4h, v18.4h
+ smull v26.4s, v4.4h, v20.4h
+ smull v27.4s, v6.4h, v22.4h
+ smlal2 v24.4s, v0.8h, v16.8h
+ smlal2 v25.4s, v2.8h, v18.8h
+ smlal2 v26.4s, v4.8h, v20.8h
+ smlal2 v27.4s, v6.8h, v22.8h
+ smlal v24.4s, v1.4h, v17.4h
+ smlal v25.4s, v3.4h, v19.4h
+ smlal v26.4s, v5.4h, v21.4h
+ smlal v27.4s, v7.4h, v23.4h
+ smlal2 v24.4s, v1.8h, v17.8h
+ smlal2 v25.4s, v3.8h, v19.8h
+ smlal2 v26.4s, v5.8h, v21.8h
+ smlal2 v27.4s, v7.8h, v23.8h
+
+ addp v0.4s, v24.4s, v25.4s
+ addp v1.4s, v26.4s, v27.4s
+ addp v0.4s, v0.4s, v1.4s
+ ld2 {v4.4h,v5.4h}, [x2]
+ sqrshrn v4.4h, v0.4s, #13
+ cmgt v2.4s, v0.4s, v28.4s
+ cmgt v3.4s, v29.4s, v0.4s
+ add v2.4s, v2.4s, v3.4s
+ add v31.4s, v31.4s, v2.4s
+ st2 {v4.4h,v5.4h}, [x2], #16
+
+ subs w4, w4, #1
+ b.ne 1b
+
+ mov w4, #4
+ mov x6, #-32
+2:
+ ld1 {v0.8h,v1.8h}, [x0], x5
+ ld1 {v2.8h,v3.8h}, [x0], x5
+ ld1 {v4.8h,v5.8h}, [x0], x5
+ ld1 {v6.8h,v7.8h}, [x0], x5
+ ld1 {v16.8h,v17.8h}, [x1], x6
+ ld1 {v18.8h,v19.8h}, [x1], x6
+ ld1 {v20.8h,v21.8h}, [x1], x6
+ ld1 {v22.8h,v23.8h}, [x1], x6
+
+ smull v24.4s, v0.4h, v16.4h
+ smull v25.4s, v2.4h, v18.4h
+ smull v26.4s, v4.4h, v20.4h
+ smull v27.4s, v6.4h, v22.4h
+ smlal2 v24.4s, v0.8h, v16.8h
+ smlal2 v25.4s, v2.8h, v18.8h
+ smlal2 v26.4s, v4.8h, v20.8h
+ smlal2 v27.4s, v6.8h, v22.8h
+ smlal v24.4s, v1.4h, v17.4h
+ smlal v25.4s, v3.4h, v19.4h
+ smlal v26.4s, v5.4h, v21.4h
+ smlal v27.4s, v7.4h, v23.4h
+ smlal2 v24.4s, v1.8h, v17.8h
+ smlal2 v25.4s, v3.8h, v19.8h
+ smlal2 v26.4s, v5.8h, v21.8h
+ smlal2 v27.4s, v7.8h, v23.8h
+
+ addp v0.4s, v24.4s, v25.4s
+ addp v1.4s, v26.4s, v27.4s
+ addp v0.4s, v0.4s, v1.4s
+ ld2 {v4.4h,v5.4h}, [x2]
+ sqrshrn v4.4h, v0.4s, #13
+ cmgt v2.4s, v0.4s, v28.4s
+ cmgt v3.4s, v29.4s, v0.4s
+ add v2.4s, v2.4s, v3.4s
+ add v31.4s, v31.4s, v2.4s
+ st2 {v4.4h,v5.4h}, [x2], #16
+
+ subs w4, w4, #1
+ b.ne 2b
+
+ AARCH64_DUP_2D(v0, v31, 1)
+ add v0.4s, v0.4s, v31.4s
+ AARCH64_DUP_4S(v1, v0, 1)
+ add v0.4s, v0.4s, v1.4s
+ umov w0, v0.s[0]
+ neg w0, w0
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon64_accurate.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon64_accurate.S
new file mode 100644
index 00000000..3cbb317a
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon64_accurate.S
@@ -0,0 +1,135 @@
+/*
+ synth_neon64_accurate: NEON optimized synth for AArch64 (MPEG compliant 16-bit output version)
+
+ copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+maxmin_s16:
+ .word 1191181824
+ .word -956301312
+ .text
+ ALIGN4
+ .globl ASM_NAME(synth_1to1_neon64_accurate_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_neon64_accurate_asm), %function
+#endif
+ASM_NAME(synth_1to1_neon64_accurate_asm):
+ add x0, x0, #64
+ sub x0, x0, x3, lsl #2
+ eor v31.16b, v31.16b, v31.16b
+ adrp x5, AARCH64_PCREL_HI(maxmin_s16)
+ add x5, x5, AARCH64_PCREL_LO(maxmin_s16)
+ ld2r {v28.4s,v29.4s}, [x5]
+
+ mov w4, #4
+ mov x5, #128
+1:
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], #64
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x1], #64
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v4.4s, v20.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v5.4s, v21.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v6.4s, v22.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v7.4s, v23.4s
+
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], #64
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x1], #64
+
+ fmul v26.4s, v0.4s, v16.4s
+ fmul v27.4s, v4.4s, v20.4s
+ fmla v26.4s, v1.4s, v17.4s
+ fmla v27.4s, v5.4s, v21.4s
+ fmla v26.4s, v2.4s, v18.4s
+ fmla v27.4s, v6.4s, v22.4s
+ fmla v26.4s, v3.4s, v19.4s
+ fmla v27.4s, v7.4s, v23.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ ld2 {v4.4h,v5.4h}, [x2]
+ fcvtns v1.4s, v0.4s
+ fcmgt v2.4s, v0.4s, v28.4s
+ fcmgt v3.4s, v29.4s, v0.4s
+ sqxtn v4.4h, v1.4s
+ add v2.4s, v2.4s, v3.4s
+ add v31.4s, v31.4s, v2.4s
+ st2 {v4.4h,v5.4h}, [x2], #16
+
+ subs w4, w4, #1
+ b.ne 1b
+
+ mov w4, #4
+ mov x6, #-64
+2:
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], x6
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x1], x6
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v4.4s, v20.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v5.4s, v21.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v6.4s, v22.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v7.4s, v23.4s
+
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], x6
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x1], x6
+
+ fmul v26.4s, v0.4s, v16.4s
+ fmul v27.4s, v4.4s, v20.4s
+ fmla v26.4s, v1.4s, v17.4s
+ fmla v27.4s, v5.4s, v21.4s
+ fmla v26.4s, v2.4s, v18.4s
+ fmla v27.4s, v6.4s, v22.4s
+ fmla v26.4s, v3.4s, v19.4s
+ fmla v27.4s, v7.4s, v23.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ ld2 {v4.4h,v5.4h}, [x2]
+ fcvtns v1.4s, v0.4s
+ fcmgt v2.4s, v0.4s, v28.4s
+ fcmgt v3.4s, v29.4s, v0.4s
+ sqxtn v4.4h, v1.4s
+ add v2.4s, v2.4s, v3.4s
+ add v31.4s, v31.4s, v2.4s
+ st2 {v4.4h,v5.4h}, [x2], #16
+
+ subs w4, w4, #1
+ b.ne 2b
+
+ AARCH64_DUP_2D(v0, v31, 1)
+ add v0.4s, v0.4s, v31.4s
+ AARCH64_DUP_4S(v1, v0, 1)
+ add v0.4s, v0.4s, v1.4s
+ umov w0, v0.s[0]
+ neg w0, w0
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon64_float.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon64_float.S
new file mode 100644
index 00000000..0cedae30
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon64_float.S
@@ -0,0 +1,118 @@
+/*
+ synth_neon64_float: NEON optimized synth for AArch64 (float output version)
+
+ copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+scale:
+ .word 939524096
+ .text
+ ALIGN4
+ .globl ASM_NAME(synth_1to1_real_neon64_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_real_neon64_asm), %function
+#endif
+ASM_NAME(synth_1to1_real_neon64_asm):
+ add x0, x0, #64
+ sub x0, x0, x3, lsl #2
+ adrp x5, AARCH64_PCREL_HI(scale)
+ add x5, x5, AARCH64_PCREL_LO(scale)
+ ld1r {v28.4s}, [x5]
+
+ mov w4, #4
+ mov x5, #128
+1:
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], #64
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x1], #64
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v4.4s, v20.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v5.4s, v21.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v6.4s, v22.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v7.4s, v23.4s
+
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], #64
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x1], #64
+
+ fmul v26.4s, v0.4s, v16.4s
+ fmul v27.4s, v4.4s, v20.4s
+ fmla v26.4s, v1.4s, v17.4s
+ fmla v27.4s, v5.4s, v21.4s
+ fmla v26.4s, v2.4s, v18.4s
+ fmla v27.4s, v6.4s, v22.4s
+ fmla v26.4s, v3.4s, v19.4s
+ fmla v27.4s, v7.4s, v23.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ ld2 {v4.4s,v5.4s}, [x2]
+ fmul v4.4s, v0.4s, v28.4s
+ st2 {v4.4s,v5.4s}, [x2], #32
+
+ subs w4, w4, #1
+ b.ne 1b
+
+ mov w4, #4
+ mov x6, #-64
+2:
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], x6
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x1], x6
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v4.4s, v20.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v5.4s, v21.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v6.4s, v22.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v7.4s, v23.4s
+
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], x6
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x1], x6
+
+ fmul v26.4s, v0.4s, v16.4s
+ fmul v27.4s, v4.4s, v20.4s
+ fmla v26.4s, v1.4s, v17.4s
+ fmla v27.4s, v5.4s, v21.4s
+ fmla v26.4s, v2.4s, v18.4s
+ fmla v27.4s, v6.4s, v22.4s
+ fmla v26.4s, v3.4s, v19.4s
+ fmla v27.4s, v7.4s, v23.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ ld2 {v4.4s,v5.4s}, [x2]
+ fmul v4.4s, v0.4s, v28.4s
+ st2 {v4.4s,v5.4s}, [x2], #32
+
+ subs w4, w4, #1
+ b.ne 2b
+
+ eor w0, w0, w0
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon64_s32.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon64_s32.S
new file mode 100644
index 00000000..917c9464
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon64_s32.S
@@ -0,0 +1,136 @@
+/*
+ synth_neon64_s32: NEON optimized synth for AArch64 (32-bit output version)
+
+ copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+maxmin_s32:
+ .word 1191182335
+ .word -956301312
+ .word 1199570944
+ .text
+ ALIGN4
+ .globl ASM_NAME(synth_1to1_s32_neon64_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_s32_neon64_asm), %function
+#endif
+ASM_NAME(synth_1to1_s32_neon64_asm):
+ add x0, x0, #64
+ sub x0, x0, x3, lsl #2
+ eor v31.16b, v31.16b, v31.16b
+ adrp x5, AARCH64_PCREL_HI(maxmin_s32)
+ add x5, x5, AARCH64_PCREL_LO(maxmin_s32)
+ ld3r {v28.4s,v29.4s,v30.4s}, [x5]
+
+ mov w4, #4
+ mov x5, #128
+1:
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], #64
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x1], #64
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v4.4s, v20.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v5.4s, v21.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v6.4s, v22.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v7.4s, v23.4s
+
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], #64
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x1], #64
+
+ fmul v26.4s, v0.4s, v16.4s
+ fmul v27.4s, v4.4s, v20.4s
+ fmla v26.4s, v1.4s, v17.4s
+ fmla v27.4s, v5.4s, v21.4s
+ fmla v26.4s, v2.4s, v18.4s
+ fmla v27.4s, v6.4s, v22.4s
+ fmla v26.4s, v3.4s, v19.4s
+ fmla v27.4s, v7.4s, v23.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ fmul v1.4s, v0.4s, v30.4s
+ ld2 {v4.4s,v5.4s}, [x2]
+ fcvtns v4.4s, v1.4s
+ fcmgt v2.4s, v0.4s, v28.4s
+ fcmgt v3.4s, v29.4s, v0.4s
+ add v2.4s, v2.4s, v3.4s
+ add v31.4s, v31.4s, v2.4s
+ st2 {v4.4s,v5.4s}, [x2], #32
+
+ subs w4, w4, #1
+ b.ne 1b
+
+ mov w4, #4
+ mov x6, #-64
+2:
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], x6
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x1], x6
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v4.4s, v20.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v5.4s, v21.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v6.4s, v22.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v7.4s, v23.4s
+
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], x6
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x1], x6
+
+ fmul v26.4s, v0.4s, v16.4s
+ fmul v27.4s, v4.4s, v20.4s
+ fmla v26.4s, v1.4s, v17.4s
+ fmla v27.4s, v5.4s, v21.4s
+ fmla v26.4s, v2.4s, v18.4s
+ fmla v27.4s, v6.4s, v22.4s
+ fmla v26.4s, v3.4s, v19.4s
+ fmla v27.4s, v7.4s, v23.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ fmul v1.4s, v0.4s, v30.4s
+ ld2 {v4.4s,v5.4s}, [x2]
+ fcvtns v4.4s, v1.4s
+ fcmgt v2.4s, v0.4s, v28.4s
+ fcmgt v3.4s, v29.4s, v0.4s
+ add v2.4s, v2.4s, v3.4s
+ add v31.4s, v31.4s, v2.4s
+ st2 {v4.4s,v5.4s}, [x2], #32
+
+ subs w4, w4, #1
+ b.ne 2b
+
+ AARCH64_DUP_2D(v0, v31, 1)
+ add v0.4s, v0.4s, v31.4s
+ AARCH64_DUP_4S(v1, v0, 1)
+ add v0.4s, v0.4s, v1.4s
+ umov w0, v0.s[0]
+ neg w0, w0
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon_accurate.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon_accurate.S
new file mode 100644
index 00000000..501223fa
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon_accurate.S
@@ -0,0 +1,183 @@
+/*
+ synth_neon_accurate: ARM NEON optimized synth (MPEG compliant 16-bit output version)
+
+ copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#define WINDOW r0
+#define B0 r1
+#define SAMPLES r2
+
+/*
+ int synth_1to1_real_neon_accurate_asm(real *window, real *b0, real *samples, int bo1);
+ return value: number of clipped samples (0)
+*/
+
+ .code 32
+#ifndef __APPLE__
+ .fpu neon
+#endif
+
+ .text
+ .globl ASM_NAME(synth_1to1_neon_accurate_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_neon_accurate_asm), %function
+#endif
+ASM_NAME(synth_1to1_neon_accurate_asm):
+ push {r4-r6, lr}
+ vpush {q4-q7}
+ mov r6, sp
+ sub sp, sp, #16
+ bic sp, #0xff
+
+ add WINDOW, WINDOW, #64
+ sub WINDOW, WINDOW, r3, lsl #2
+
+ mov r3, #4
+ mov r4, #128
+ mov r5, #64
+1:
+ vld1.32 {q0,q1}, [WINDOW], r4
+ vld1.32 {q2,q3}, [WINDOW], r4
+ vld1.32 {q4,q5}, [WINDOW], r4
+ vld1.32 {q6,q7}, [WINDOW]
+ sub WINDOW, WINDOW, #352
+ vld1.32 {q8,q9}, [B0, :128], r5
+ vld1.32 {q10,q11}, [B0, :128], r5
+ vld1.32 {q12,q13}, [B0, :128], r5
+ vld1.32 {q14,q15}, [B0, :128]
+ vswp q1, q4
+ vswp q3, q6
+ sub B0, B0, #160
+ vmul.f32 q0, q0, q8
+ vmul.f32 q2, q2, q10
+ vmul.f32 q1, q1, q12
+ vmul.f32 q3, q3, q14
+ vmla.f32 q0, q4, q9
+ vmla.f32 q2, q6, q11
+ vmla.f32 q1, q5, q13
+ vmla.f32 q3, q7, q15
+ vld1.32 {q4,q5}, [WINDOW], r4
+ vld1.32 {q6,q7}, [WINDOW], r4
+ vld1.32 {q8,q9}, [WINDOW], r4
+ vld1.32 {q10,q11}, [B0, :128], r5
+ vld1.32 {q12,q13}, [B0, :128], r5
+ vld1.32 {q14,q15}, [B0, :128], r5
+ vswp q5, q6
+ vswp q11, q12
+ vmla.f32 q0, q4, q10
+ vmla.f32 q2, q5, q11
+ vmla.f32 q1, q8, q14
+ vld1.32 {q4,q5}, [WINDOW]
+ vld1.32 {q10,q11}, [B0, :128]!
+ add WINDOW, WINDOW, #96
+ vmla.f32 q3, q4, q10
+ vmla.f32 q0, q6, q12
+ vmla.f32 q2, q7, q13
+ vmla.f32 q1, q9, q15
+ vmla.f32 q3, q5, q11
+ vmov.i32 q4, #0x4b000000
+ vmvn.i32 q5, #0xb9000000
+ vorr.i32 q4, #0x00400000
+ vpadd.f32 d0, d0, d1
+ vpadd.f32 d4, d4, d5
+ vpadd.f32 d2, d2, d3
+ vpadd.f32 d6, d6, d7
+ vld1.32 {q6}, [sp, :128]
+ vpadd.f32 d0, d0, d4
+ vpadd.f32 d1, d2, d6
+
+ vadd.f32 q3, q0, q4
+ vacgt.f32 q5, q0, q5
+ vld2.16 {d4,d5}, [SAMPLES]
+ vshl.i32 q3, q3, #10
+ vqshrn.s32 d3, q3, #10
+ vshr.u32 q5, q5, #31
+ vst2.16 {d3,d5}, [SAMPLES]!
+ vadd.i32 q5, q5, q6
+ vst1.32 {q5}, [sp, :128]
+
+ subs r3, r3, #1
+ bne 1b
+
+ mov r3, #4
+ mov r5, #-64
+1:
+ vld1.32 {q0,q1}, [WINDOW], r4
+ vld1.32 {q2,q3}, [WINDOW], r4
+ vld1.32 {q4,q5}, [WINDOW], r4
+ vld1.32 {q6,q7}, [WINDOW]
+ sub WINDOW, WINDOW, #352
+ vld1.32 {q8,q9}, [B0, :128], r5
+ vld1.32 {q10,q11}, [B0, :128], r5
+ vld1.32 {q12,q13}, [B0, :128], r5
+ vld1.32 {q14,q15}, [B0, :128]
+ vswp q1, q4
+ vswp q3, q6
+ add B0, B0, #224
+ vmul.f32 q0, q0, q8
+ vmul.f32 q2, q2, q10
+ vmul.f32 q1, q1, q12
+ vmul.f32 q3, q3, q14
+ vmla.f32 q0, q4, q9
+ vmla.f32 q2, q6, q11
+ vmla.f32 q1, q5, q13
+ vmla.f32 q3, q7, q15
+ vld1.32 {q4,q5}, [WINDOW], r4
+ vld1.32 {q6,q7}, [WINDOW], r4
+ vld1.32 {q8,q9}, [WINDOW], r4
+ vld1.32 {q10,q11}, [B0, :128], r5
+ vld1.32 {q12,q13}, [B0, :128], r5
+ vld1.32 {q14,q15}, [B0, :128], r5
+ vswp q5, q6
+ vswp q11, q12
+ vmla.f32 q0, q4, q10
+ vmla.f32 q2, q5, q11
+ vmla.f32 q1, q8, q14
+ vld1.32 {q4,q5}, [WINDOW]
+ vld1.32 {q10,q11}, [B0, :128]
+ add WINDOW, WINDOW, #96
+ sub B0, B0, #96
+ vmla.f32 q3, q4, q10
+ vmla.f32 q0, q6, q12
+ vmla.f32 q2, q7, q13
+ vmla.f32 q1, q9, q15
+ vmla.f32 q3, q5, q11
+ vmov.i32 q4, #0x4b000000
+ vmvn.i32 q5, #0xb9000000
+ vorr.i32 q4, #0x00400000
+ vpadd.f32 d0, d0, d1
+ vpadd.f32 d4, d4, d5
+ vpadd.f32 d2, d2, d3
+ vpadd.f32 d6, d6, d7
+ vld1.32 {q6}, [sp, :128]
+ vpadd.f32 d0, d0, d4
+ vpadd.f32 d1, d2, d6
+
+ vadd.f32 q3, q0, q4
+ vacgt.f32 q5, q0, q5
+ vld2.16 {d4,d5}, [SAMPLES]
+ vshl.i32 q3, q3, #10
+ vqshrn.s32 d3, q3, #10
+ vshr.u32 q5, q5, #31
+ vst2.16 {d3,d5}, [SAMPLES]!
+ vadd.i32 q5, q5, q6
+ vst1.32 {q5}, [sp, :128]
+
+ subs r3, r3, #1
+ bne 1b
+
+ vld1.32 {q0}, [sp, :128]
+ vpadd.i32 d0, d0, d1
+ vpadd.i32 d0, d0, d0
+ vmov.32 r0, d0[0]
+
+ mov sp, r6
+ vpop {q4-q7}
+ pop {r4-r6, pc}
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon_float.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon_float.S
new file mode 100644
index 00000000..15ead4e4
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon_float.S
@@ -0,0 +1,161 @@
+/*
+ synth_neon_float: ARM NEON optimized synth (float output version)
+
+ copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#define WINDOW r0
+#define B0 r1
+#define SAMPLES r2
+
+/*
+ int synth_1to1_real_neon_asm(real *window, real *b0, real *samples, int bo1);
+ return value: number of clipped samples (0)
+*/
+
+#ifndef _M_ARM
+ .code 32
+#endif
+#ifndef __APPLE__
+ .fpu neon
+#endif
+
+ .text
+ GLOBAL_SYMBOL ASM_NAME(synth_1to1_real_neon_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_real_neon_asm), %function
+#endif
+ ALIGN4
+ASM_NAME(synth_1to1_real_neon_asm):
+ push {r4-r5, lr}
+ vpush {q4-q7}
+
+ add WINDOW, WINDOW, #64
+ sub WINDOW, WINDOW, r3, lsl #2
+
+ mov r3, #4
+ mov r4, #128
+ mov r5, #64
+1:
+ vld1.32 {q0,q1}, [WINDOW], r4
+ vld1.32 {q2,q3}, [WINDOW], r4
+ vld1.32 {q4,q5}, [WINDOW], r4
+ vld1.32 {q6,q7}, [WINDOW]
+ sub WINDOW, WINDOW, #352
+ vld1.32 {q8,q9}, [B0, :128], r5
+ vld1.32 {q10,q11}, [B0, :128], r5
+ vld1.32 {q12,q13}, [B0, :128], r5
+ vld1.32 {q14,q15}, [B0, :128]
+ vswp q1, q4
+ vswp q3, q6
+ sub B0, B0, #160
+ vmul.f32 q0, q0, q8
+ vmul.f32 q2, q2, q10
+ vmul.f32 q1, q1, q12
+ vmul.f32 q3, q3, q14
+ vmla.f32 q0, q4, q9
+ vmla.f32 q2, q6, q11
+ vmla.f32 q1, q5, q13
+ vmla.f32 q3, q7, q15
+ vld1.32 {q4,q5}, [WINDOW], r4
+ vld1.32 {q6,q7}, [WINDOW], r4
+ vld1.32 {q8,q9}, [WINDOW], r4
+ vld1.32 {q10,q11}, [B0, :128], r5
+ vld1.32 {q12,q13}, [B0, :128], r5
+ vld1.32 {q14,q15}, [B0, :128], r5
+ vswp q5, q6
+ vswp q11, q12
+ vmla.f32 q0, q4, q10
+ vmla.f32 q2, q5, q11
+ vmla.f32 q1, q8, q14
+ vld1.32 {q4,q5}, [WINDOW]
+ vld1.32 {q10,q11}, [B0, :128]!
+ add WINDOW, WINDOW, #96
+ vmla.f32 q3, q4, q10
+ vmla.f32 q0, q6, q12
+ vmla.f32 q2, q7, q13
+ vmla.f32 q1, q9, q15
+ vmla.f32 q3, q5, q11
+ vld2.32 {q4,q5}, [SAMPLES]
+ vpadd.f32 d0, d0, d1
+ vpadd.f32 d4, d4, d5
+ vpadd.f32 d2, d2, d3
+ vpadd.f32 d6, d6, d7
+ vpadd.f32 d0, d0, d4
+ vpadd.f32 d1, d2, d6
+
+ vmov.i32 q1, #0x38000000
+ vmul.f32 q4, q0, q1
+ vst2.32 {q4,q5}, [SAMPLES]!
+
+ subs r3, r3, #1
+ bne 1b
+
+ mov r3, #4
+ mov r5, #-64
+1:
+ vld1.32 {q0,q1}, [WINDOW], r4
+ vld1.32 {q2,q3}, [WINDOW], r4
+ vld1.32 {q4,q5}, [WINDOW], r4
+ vld1.32 {q6,q7}, [WINDOW]
+ sub WINDOW, WINDOW, #352
+ vld1.32 {q8,q9}, [B0, :128], r5
+ vld1.32 {q10,q11}, [B0, :128], r5
+ vld1.32 {q12,q13}, [B0, :128], r5
+ vld1.32 {q14,q15}, [B0, :128]
+ vswp q1, q4
+ vswp q3, q6
+ add B0, B0, #224
+ vmul.f32 q0, q0, q8
+ vmul.f32 q2, q2, q10
+ vmul.f32 q1, q1, q12
+ vmul.f32 q3, q3, q14
+ vmla.f32 q0, q4, q9
+ vmla.f32 q2, q6, q11
+ vmla.f32 q1, q5, q13
+ vmla.f32 q3, q7, q15
+ vld1.32 {q4,q5}, [WINDOW], r4
+ vld1.32 {q6,q7}, [WINDOW], r4
+ vld1.32 {q8,q9}, [WINDOW], r4
+ vld1.32 {q10,q11}, [B0, :128], r5
+ vld1.32 {q12,q13}, [B0, :128], r5
+ vld1.32 {q14,q15}, [B0, :128], r5
+ vswp q5, q6
+ vswp q11, q12
+ vmla.f32 q0, q4, q10
+ vmla.f32 q2, q5, q11
+ vmla.f32 q1, q8, q14
+ vld1.32 {q4,q5}, [WINDOW]
+ vld1.32 {q10,q11}, [B0, :128]
+ add WINDOW, WINDOW, #96
+ sub B0, B0, #96
+ vmla.f32 q3, q4, q10
+ vmla.f32 q0, q6, q12
+ vmla.f32 q2, q7, q13
+ vmla.f32 q1, q9, q15
+ vmla.f32 q3, q5, q11
+ vld2.32 {q4,q5}, [SAMPLES]
+ vpadd.f32 d0, d0, d1
+ vpadd.f32 d4, d4, d5
+ vpadd.f32 d2, d2, d3
+ vpadd.f32 d6, d6, d7
+ vpadd.f32 d0, d0, d4
+ vpadd.f32 d1, d2, d6
+
+ vmov.i32 q1, #0x38000000
+ vmul.f32 q4, q0, q1
+ vst2.32 {q4,q5}, [SAMPLES]!
+
+ subs r3, r3, #1
+ bne 1b
+
+ mov r0, #0
+
+ vpop {q4-q7}
+ pop {r4-r5, pc}
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon_s32.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon_s32.S
new file mode 100644
index 00000000..7068baf3
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_neon_s32.S
@@ -0,0 +1,182 @@
+/*
+ synth_neon_s32: ARM NEON optimized synth (32-bit output version)
+
+ copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#define WINDOW r0
+#define B0 r1
+#define SAMPLES r2
+
+/*
+ int synth_1to1_s32_neon_asm(real *window, real *b0, int *samples, int bo1);
+ return value: number of clipped samples (0)
+*/
+
+#ifndef _M_ARM
+ .code 32
+#endif
+#ifndef __APPLE__
+ .fpu neon
+#endif
+
+ .text
+ GLOBAL_SYMBOL ASM_NAME(synth_1to1_s32_neon_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_s32_neon_asm), %function
+#endif
+ ALIGN4
+ASM_NAME(synth_1to1_s32_neon_asm):
+ push {r4-r6, lr}
+ vpush {q4-q7}
+ mov r6, sp
+ sub sp, sp, #16
+ mov r5, sp
+ and r5, r5, #0xf
+ sub sp, sp, r5
+
+ add WINDOW, WINDOW, #64
+ sub WINDOW, WINDOW, r3, lsl #2
+
+ mov r3, #4
+ mov r4, #128
+ mov r5, #64
+1:
+ vld1.32 {q0,q1}, [WINDOW], r4
+ vld1.32 {q2,q3}, [WINDOW], r4
+ vld1.32 {q4,q5}, [WINDOW], r4
+ vld1.32 {q6,q7}, [WINDOW]
+ sub WINDOW, WINDOW, #352
+ vld1.32 {q8,q9}, [B0, :128], r5
+ vld1.32 {q10,q11}, [B0, :128], r5
+ vld1.32 {q12,q13}, [B0, :128], r5
+ vld1.32 {q14,q15}, [B0, :128]
+ vswp q1, q4
+ vswp q3, q6
+ sub B0, B0, #160
+ vmul.f32 q0, q0, q8
+ vmul.f32 q2, q2, q10
+ vmul.f32 q1, q1, q12
+ vmul.f32 q3, q3, q14
+ vmla.f32 q0, q4, q9
+ vmla.f32 q2, q6, q11
+ vmla.f32 q1, q5, q13
+ vmla.f32 q3, q7, q15
+ vld1.32 {q4,q5}, [WINDOW], r4
+ vld1.32 {q6,q7}, [WINDOW], r4
+ vld1.32 {q8,q9}, [WINDOW], r4
+ vld1.32 {q10,q11}, [B0, :128], r5
+ vld1.32 {q12,q13}, [B0, :128], r5
+ vld1.32 {q14,q15}, [B0, :128], r5
+ vswp q5, q6
+ vswp q11, q12
+ vmla.f32 q0, q4, q10
+ vmla.f32 q2, q5, q11
+ vmla.f32 q1, q8, q14
+ vld1.32 {q4,q5}, [WINDOW]
+ vld1.32 {q10,q11}, [B0, :128]!
+ add WINDOW, WINDOW, #96
+ vmla.f32 q3, q4, q10
+ vmla.f32 q0, q6, q12
+ vmla.f32 q2, q7, q13
+ vmla.f32 q1, q9, q15
+ vmla.f32 q3, q5, q11
+ vmvn.i32 q5, #0xb9000000
+ vpadd.f32 d0, d0, d1
+ vpadd.f32 d4, d4, d5
+ vpadd.f32 d2, d2, d3
+ vpadd.f32 d6, d6, d7
+ vld1.32 {q6}, [sp, :128]
+ vpadd.f32 d0, d0, d4
+ vpadd.f32 d1, d2, d6
+
+ vcvt.s32.f32 q3, q0, #16
+ vacgt.f32 q5, q0, q5
+ vld2.32 {q1,q2}, [SAMPLES]
+ vshr.u32 q5, q5, #31
+ vmov q1, q3
+ vst2.32 {q1,q2}, [SAMPLES]!
+ vadd.i32 q5, q5, q6
+ vst1.32 {q5}, [sp, :128]
+
+ subs r3, r3, #1
+ bne 1b
+
+ mov r3, #4
+ mov r5, #-64
+1:
+ vld1.32 {q0,q1}, [WINDOW], r4
+ vld1.32 {q2,q3}, [WINDOW], r4
+ vld1.32 {q4,q5}, [WINDOW], r4
+ vld1.32 {q6,q7}, [WINDOW]
+ sub WINDOW, WINDOW, #352
+ vld1.32 {q8,q9}, [B0, :128], r5
+ vld1.32 {q10,q11}, [B0, :128], r5
+ vld1.32 {q12,q13}, [B0, :128], r5
+ vld1.32 {q14,q15}, [B0, :128]
+ vswp q1, q4
+ vswp q3, q6
+ add B0, B0, #224
+ vmul.f32 q0, q0, q8
+ vmul.f32 q2, q2, q10
+ vmul.f32 q1, q1, q12
+ vmul.f32 q3, q3, q14
+ vmla.f32 q0, q4, q9
+ vmla.f32 q2, q6, q11
+ vmla.f32 q1, q5, q13
+ vmla.f32 q3, q7, q15
+ vld1.32 {q4,q5}, [WINDOW], r4
+ vld1.32 {q6,q7}, [WINDOW], r4
+ vld1.32 {q8,q9}, [WINDOW], r4
+ vld1.32 {q10,q11}, [B0, :128], r5
+ vld1.32 {q12,q13}, [B0, :128], r5
+ vld1.32 {q14,q15}, [B0, :128], r5
+ vswp q5, q6
+ vswp q11, q12
+ vmla.f32 q0, q4, q10
+ vmla.f32 q2, q5, q11
+ vmla.f32 q1, q8, q14
+ vld1.32 {q4,q5}, [WINDOW]
+ vld1.32 {q10,q11}, [B0, :128]
+ add WINDOW, WINDOW, #96
+ sub B0, B0, #96
+ vmla.f32 q3, q4, q10
+ vmla.f32 q0, q6, q12
+ vmla.f32 q2, q7, q13
+ vmla.f32 q1, q9, q15
+ vmla.f32 q3, q5, q11
+ vmvn.i32 q5, #0xb9000000
+ vpadd.f32 d0, d0, d1
+ vpadd.f32 d4, d4, d5
+ vpadd.f32 d2, d2, d3
+ vpadd.f32 d6, d6, d7
+ vld1.32 {q6}, [sp, :128]
+ vpadd.f32 d0, d0, d4
+ vpadd.f32 d1, d2, d6
+
+ vcvt.s32.f32 q3, q0, #16
+ vacgt.f32 q5, q0, q5
+ vld2.32 {q1,q2}, [SAMPLES]
+ vshr.u32 q5, q5, #31
+ vmov q1, q3
+ vst2.32 {q1,q2}, [SAMPLES]!
+ vadd.i32 q5, q5, q6
+ vst1.32 {q5}, [sp, :128]
+
+ subs r3, r3, #1
+ bne 1b
+
+ vld1.32 {q0}, [sp, :128]
+ vpadd.i32 d0, d0, d1
+ vpadd.i32 d0, d0, d0
+ vmov.32 r0, d0[0]
+
+ mov sp, r6
+ vpop {q4-q7}
+ pop {r4-r6, pc}
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_ntom.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_ntom.h
new file mode 100644
index 00000000..4554d218
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_ntom.h
@@ -0,0 +1,213 @@
+/*
+ synth_ntom.h: ntom-resampling synth functions
+
+ This header is used multiple times to create different variants of this function.
+ Hint: MONO_NAME, MONO2STEREO_NAME, SYNTH_NAME and SAMPLE_T as well as WRITE_SAMPLE do vary.
+
+ copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp, generalized by Thomas Orgis
+
+ Well, this is very simple resampling... you may or may not like what you hear.
+ But it's cheap.
+ But still, we don't implement a non-autoincrement version of this one.
+*/
+
+/* Note: These mono functions would also work generically,
+ it's just that they need a runtime calculation for the conversion loop...
+ The fixed XtoY functions have the chance for loop unrolling... */
+
+int MONO_NAME(real *bandPtr, mpg123_handle *fr)
+{
+ SAMPLE_T samples_tmp[8*64];
+ SAMPLE_T *tmp1 = samples_tmp;
+ size_t i;
+ int ret;
+
+ size_t pnt = fr->buffer.fill;
+ unsigned char *samples = fr->buffer.data;
+ fr->buffer.data = (unsigned char*) samples_tmp;
+ fr->buffer.fill = 0;
+ ret = SYNTH_NAME(bandPtr, 0, fr, 1);
+ fr->buffer.data = samples;
+
+ samples += pnt;
+ for(i=0;i<(fr->buffer.fill/(2*sizeof(SAMPLE_T)));i++)
+ {
+ *( (SAMPLE_T *)samples) = *tmp1;
+ samples += sizeof(SAMPLE_T);
+ tmp1 += 2;
+ }
+ fr->buffer.fill = pnt + (fr->buffer.fill/2);
+
+ return ret;
+}
+
+
+int MONO2STEREO_NAME(real *bandPtr, mpg123_handle *fr)
+{
+ size_t i;
+ int ret;
+ size_t pnt1 = fr->buffer.fill;
+ unsigned char *samples = fr->buffer.data + pnt1;
+
+ ret = SYNTH_NAME(bandPtr, 0, fr, 1);
+
+ for(i=0;i<((fr->buffer.fill-pnt1)/(2*sizeof(SAMPLE_T)));i++)
+ {
+ ((SAMPLE_T *)samples)[1] = ((SAMPLE_T *)samples)[0];
+ samples+=2*sizeof(SAMPLE_T);
+ }
+
+ return ret;
+}
+
+
+int SYNTH_NAME(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ static const int step = 2;
+ SAMPLE_T *samples = (SAMPLE_T *) (fr->buffer.data + fr->buffer.fill);
+
+ real *b0, **buf; /* (*buf)[0x110]; */
+ int clip = 0;
+ int bo1;
+ int ntom;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ ntom = fr->ntom_val[1] = fr->ntom_val[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ ntom = fr->ntom_val[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ {
+ register int j;
+ real *window = fr->decwin + 16 - bo1;
+
+ for (j=16;j;j--,window+=0x10)
+ {
+ real sum;
+
+ ntom += fr->ntom_step;
+ if(ntom < NTOM_MUL)
+ {
+ window += 16;
+ b0 += 16;
+ continue;
+ }
+
+ sum = REAL_MUL_SYNTH(*window++, *b0++);
+ sum -= REAL_MUL_SYNTH(*window++, *b0++);
+ sum += REAL_MUL_SYNTH(*window++, *b0++);
+ sum -= REAL_MUL_SYNTH(*window++, *b0++);
+ sum += REAL_MUL_SYNTH(*window++, *b0++);
+ sum -= REAL_MUL_SYNTH(*window++, *b0++);
+ sum += REAL_MUL_SYNTH(*window++, *b0++);
+ sum -= REAL_MUL_SYNTH(*window++, *b0++);
+ sum += REAL_MUL_SYNTH(*window++, *b0++);
+ sum -= REAL_MUL_SYNTH(*window++, *b0++);
+ sum += REAL_MUL_SYNTH(*window++, *b0++);
+ sum -= REAL_MUL_SYNTH(*window++, *b0++);
+ sum += REAL_MUL_SYNTH(*window++, *b0++);
+ sum -= REAL_MUL_SYNTH(*window++, *b0++);
+ sum += REAL_MUL_SYNTH(*window++, *b0++);
+ sum -= REAL_MUL_SYNTH(*window++, *b0++);
+
+ while(ntom >= NTOM_MUL)
+ {
+ WRITE_SAMPLE(samples,sum,clip);
+ samples += step;
+ ntom -= NTOM_MUL;
+ }
+ }
+
+ ntom += fr->ntom_step;
+ if(ntom >= NTOM_MUL)
+ {
+ real sum;
+ sum = REAL_MUL_SYNTH(window[0x0], b0[0x0]);
+ sum += REAL_MUL_SYNTH(window[0x2], b0[0x2]);
+ sum += REAL_MUL_SYNTH(window[0x4], b0[0x4]);
+ sum += REAL_MUL_SYNTH(window[0x6], b0[0x6]);
+ sum += REAL_MUL_SYNTH(window[0x8], b0[0x8]);
+ sum += REAL_MUL_SYNTH(window[0xA], b0[0xA]);
+ sum += REAL_MUL_SYNTH(window[0xC], b0[0xC]);
+ sum += REAL_MUL_SYNTH(window[0xE], b0[0xE]);
+
+ while(ntom >= NTOM_MUL)
+ {
+ WRITE_SAMPLE(samples,sum,clip);
+ samples += step;
+ ntom -= NTOM_MUL;
+ }
+ }
+
+ b0-=0x10,window-=0x20;
+ window += bo1<<1;
+
+ for (j=15;j;j--,b0-=0x20,window-=0x10)
+ {
+ real sum;
+
+ ntom += fr->ntom_step;
+ if(ntom < NTOM_MUL)
+ {
+ window -= 16;
+ b0 += 16;
+ continue;
+ }
+
+ sum = REAL_MUL_SYNTH(-*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+ sum -= REAL_MUL_SYNTH(*(--window), *b0++);
+
+ while(ntom >= NTOM_MUL)
+ {
+ WRITE_SAMPLE(samples,sum,clip);
+ samples += step;
+ ntom -= NTOM_MUL;
+ }
+ }
+ }
+
+ fr->ntom_val[channel] = ntom;
+ if(final) fr->buffer.fill = ((unsigned char *) samples - fr->buffer.data - (channel ? sizeof(SAMPLE_T) : 0));
+
+ return clip;
+}
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_real.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_real.c
new file mode 100644
index 00000000..fe8cf867
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_real.c
@@ -0,0 +1,585 @@
+/*
+ synth_real.c: The functions for synthesizing real (float) samples, at the end of decoding.
+
+ copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp, heavily dissected and rearranged by Thomas Orgis
+*/
+
+#include "mpg123lib_intern.h"
+#include "sample.h"
+#include "debug.h"
+
+#ifdef REAL_IS_FIXED
+#error "Do not build this file with fixed point math!"
+#else
+/*
+ Part 3: All synth functions that produce float output.
+ What we need is just a special WRITE_SAMPLE. For the generic and i386 functions, that is.
+ The optimized synths would need to be changed internally to support float output.
+*/
+
+#define SAMPLE_T real
+#define WRITE_SAMPLE(samples,sum,clip) WRITE_REAL_SAMPLE(samples,sum,clip)
+
+/* Part 3a: All straight 1to1 decoding functions */
+#define BLOCK 0x40 /* One decoding block is 64 samples. */
+
+#define SYNTH_NAME synth_1to1_real
+#include "synth.h"
+#undef SYNTH_NAME
+
+/* Mono-related synths; they wrap over _some_ synth_1to1_real (could be generic, could be i386). */
+#define SYNTH_NAME fr->synths.plain[r_1to1][f_real]
+#define MONO_NAME synth_1to1_real_mono
+#define MONO2STEREO_NAME synth_1to1_real_m2s
+#include "synth_mono.h"
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+#ifdef OPT_X86
+#define NO_AUTOINCREMENT
+#define SYNTH_NAME synth_1to1_real_i386
+#include "synth.h"
+#undef SYNTH_NAME
+/* i386 uses the normal mono functions. */
+#undef NO_AUTOINCREMENT
+#endif
+
+#undef BLOCK
+
+/* At least one optimized real decoder... */
+#ifdef OPT_X86_64
+/* Assembler routines. */
+int synth_1to1_real_x86_64_asm(real *window, real *b0, real *samples, int bo1);
+int synth_1to1_real_s_x86_64_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
+void dct64_real_x86_64(real *out0, real *out1, real *samples);
+/* Hull for C mpg123 API */
+int synth_1to1_real_x86_64(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_real_x86_64(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_real_x86_64(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ synth_1to1_real_x86_64_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 256;
+
+ return 0;
+}
+
+int synth_1to1_real_stereo_x86_64(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_real_x86_64(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_real_x86_64(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_real_x86_64(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_real_x86_64(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ synth_1to1_real_s_x86_64_asm(fr->decwin, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 256;
+
+ return 0;
+}
+#endif
+
+#ifdef OPT_AVX
+/* Assembler routines. */
+#ifndef OPT_X86_64
+int synth_1to1_real_x86_64_asm(real *window, real *b0, real *samples, int bo1);
+#endif
+int synth_1to1_real_s_avx_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
+void dct64_real_avx(real *out0, real *out1, real *samples);
+/* Hull for C mpg123 API */
+int synth_1to1_real_avx(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_real_avx(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_real_avx(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ synth_1to1_real_x86_64_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 256;
+
+ return 0;
+}
+
+int synth_1to1_fltst_avx(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_real_avx(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_real_avx(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_real_avx(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_real_avx(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ synth_1to1_real_s_avx_asm(fr->decwin, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 256;
+
+ return 0;
+}
+#endif
+
+#if defined(OPT_SSE) || defined(OPT_SSE_VINTAGE)
+/* Assembler routines. */
+int synth_1to1_real_sse_asm(real *window, real *b0, real *samples, int bo1);
+int synth_1to1_real_s_sse_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
+void dct64_real_sse(real *out0, real *out1, real *samples);
+/* Hull for C mpg123 API */
+int synth_1to1_real_sse(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_real_sse(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_real_sse(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ synth_1to1_real_sse_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 256;
+
+ return 0;
+}
+
+int synth_1to1_real_stereo_sse(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_real_sse(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_real_sse(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_real_sse(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_real_sse(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ synth_1to1_real_s_sse_asm(fr->decwin, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 256;
+
+ return 0;
+}
+#endif
+
+#ifdef OPT_NEON
+/* Assembler routines. */
+int synth_1to1_real_neon_asm(real *window, real *b0, real *samples, int bo1);
+int synth_1to1_real_s_neon_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
+void dct64_real_neon(real *out0, real *out1, real *samples);
+/* Hull for C mpg123 API */
+int synth_1to1_real_neon(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_real_neon(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_real_neon(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ synth_1to1_real_neon_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 256;
+
+ return 0;
+}
+int synth_1to1_real_stereo_neon(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_real_neon(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_real_neon(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_real_neon(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_real_neon(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ synth_1to1_real_s_neon_asm(fr->decwin, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 256;
+
+ return 0;
+}
+#endif
+
+#ifdef OPT_NEON64
+/* Assembler routines. */
+int synth_1to1_real_neon64_asm(real *window, real *b0, real *samples, int bo1);
+int synth_1to1_real_s_neon64_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
+void dct64_real_neon64(real *out0, real *out1, real *samples);
+/* Hull for C mpg123 API */
+int synth_1to1_real_neon64(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_real_neon64(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_real_neon64(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ synth_1to1_real_neon64_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 256;
+
+ return 0;
+}
+int synth_1to1_fltst_neon64(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int bo1;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_real_neon64(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_real_neon64(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_real_neon64(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_real_neon64(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ synth_1to1_real_s_neon64_asm(fr->decwin, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 256;
+
+ return 0;
+}
+#endif
+
+#ifndef NO_DOWNSAMPLE
+
+/*
+ Part 3b: 2to1 synth. Only generic and i386.
+*/
+#define BLOCK 0x20 /* One decoding block is 32 samples. */
+
+#define SYNTH_NAME synth_2to1_real
+#include "synth.h"
+#undef SYNTH_NAME
+
+/* Mono-related synths; they wrap over _some_ synth_2to1_real (could be generic, could be i386). */
+#define SYNTH_NAME fr->synths.plain[r_2to1][f_real]
+#define MONO_NAME synth_2to1_real_mono
+#define MONO2STEREO_NAME synth_2to1_real_m2s
+#include "synth_mono.h"
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+#ifdef OPT_X86
+#define NO_AUTOINCREMENT
+#define SYNTH_NAME synth_2to1_real_i386
+#include "synth.h"
+#undef SYNTH_NAME
+/* i386 uses the normal mono functions. */
+#undef NO_AUTOINCREMENT
+#endif
+
+#undef BLOCK
+
+/*
+ Part 3c: 4to1 synth. Only generic and i386.
+*/
+#define BLOCK 0x10 /* One decoding block is 16 samples. */
+
+#define SYNTH_NAME synth_4to1_real
+#include "synth.h"
+#undef SYNTH_NAME
+
+/* Mono-related synths; they wrap over _some_ synth_4to1_real (could be generic, could be i386). */
+#define SYNTH_NAME fr->synths.plain[r_4to1][f_real]
+#define MONO_NAME synth_4to1_real_mono
+#define MONO2STEREO_NAME synth_4to1_real_m2s
+#include "synth_mono.h"
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+#ifdef OPT_X86
+#define NO_AUTOINCREMENT
+#define SYNTH_NAME synth_4to1_real_i386
+#include "synth.h"
+#undef SYNTH_NAME
+/* i386 uses the normal mono functions. */
+#undef NO_AUTOINCREMENT
+#endif
+
+#undef BLOCK
+
+#endif /* NO_DOWNSAMPLE */
+
+#ifndef NO_NTOM
+/*
+ Part 3d: ntom synth.
+ Same procedure as above... Just no extra play anymore, straight synth that may use an optimized dct64.
+*/
+
+/* These are all in one header, there's no flexibility to gain. */
+#define SYNTH_NAME synth_ntom_real
+#define MONO_NAME synth_ntom_real_mono
+#define MONO2STEREO_NAME synth_ntom_real_m2s
+#include "synth_ntom.h"
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+#endif
+
+#undef SAMPLE_T
+#undef WRITE_SAMPLE
+
+#endif /* non-fixed type */
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_s32.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_s32.c
new file mode 100644
index 00000000..b44d8e19
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_s32.c
@@ -0,0 +1,598 @@
+/*
+ synth_s32.c: The functions for synthesizing real (float) samples, at the end of decoding.
+
+ copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp, heavily dissected and rearranged by Thomas Orgis
+*/
+
+#include "mpg123lib_intern.h"
+#include "sample.h"
+#include "debug.h"
+
+#ifdef REAL_IS_FIXED
+#error "Do not build this file with fixed point math!"
+#else
+/*
+ Part 4: All synth functions that produce signed 32 bit output.
+ What we need is just a special WRITE_SAMPLE.
+*/
+
+#define SAMPLE_T int32_t
+#define WRITE_SAMPLE(samples,sum,clip) WRITE_S32_SAMPLE(samples,sum,clip)
+
+/* Part 4a: All straight 1to1 decoding functions */
+#define BLOCK 0x40 /* One decoding block is 64 samples. */
+
+#define SYNTH_NAME synth_1to1_s32
+#include "synth.h"
+#undef SYNTH_NAME
+
+/* Mono-related synths; they wrap over _some_ synth_1to1_s32 (could be generic, could be i386). */
+#define SYNTH_NAME fr->synths.plain[r_1to1][f_32]
+#define MONO_NAME synth_1to1_s32_mono
+#define MONO2STEREO_NAME synth_1to1_s32_m2s
+#include "synth_mono.h"
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+#ifdef OPT_X86
+#define NO_AUTOINCREMENT
+#define SYNTH_NAME synth_1to1_s32_i386
+#include "synth.h"
+#undef SYNTH_NAME
+/* i386 uses the normal mono functions. */
+#undef NO_AUTOINCREMENT
+#endif
+
+#ifdef OPT_X86_64
+/* Assembler routines. */
+int synth_1to1_s32_x86_64_asm(real *window, real *b0, int32_t *samples, int bo1);
+int synth_1to1_s32_s_x86_64_asm(real *window, real *b0l, real *b0r, int32_t *samples, int bo1);
+void dct64_real_x86_64(real *out0, real *out1, real *samples);
+/* Hull for C mpg123 API */
+int synth_1to1_s32_x86_64(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_real_x86_64(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_real_x86_64(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ clip = synth_1to1_s32_x86_64_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 256;
+
+ return clip;
+}
+
+
+int synth_1to1_s32_stereo_x86_64(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_real_x86_64(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_real_x86_64(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_real_x86_64(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_real_x86_64(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ clip = synth_1to1_s32_s_x86_64_asm(fr->decwin, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 256;
+
+ return clip;
+}
+#endif
+
+#ifdef OPT_AVX
+/* Assembler routines. */
+#ifndef OPT_x86_64
+int synth_1to1_s32_x86_64_asm(real *window, real *b0, int32_t *samples, int bo1);
+#endif
+int synth_1to1_s32_s_avx_asm(real *window, real *b0l, real *b0r, int32_t *samples, int bo1);
+void dct64_real_avx(real *out0, real *out1, real *samples);
+/* Hull for C mpg123 API */
+int synth_1to1_s32_avx(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_real_avx(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_real_avx(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ clip = synth_1to1_s32_x86_64_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 256;
+
+ return clip;
+}
+
+
+int synth_1to1_s32_stereo_avx(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_real_avx(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_real_avx(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_real_avx(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_real_avx(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ clip = synth_1to1_s32_s_avx_asm(fr->decwin, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 256;
+
+ return clip;
+}
+#endif
+
+#if defined(OPT_SSE) || defined(OPT_SSE_VINTAGE)
+/* Assembler routines. */
+int synth_1to1_s32_sse_asm(real *window, real *b0, int32_t *samples, int bo1);
+int synth_1to1_s32_s_sse_asm(real *window, real *b0l, real *b0r, int32_t *samples, int bo1);
+void dct64_real_sse(real *out0, real *out1, real *samples);
+/* Hull for C mpg123 API */
+int synth_1to1_s32_sse(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_real_sse(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_real_sse(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ clip = synth_1to1_s32_sse_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 256;
+
+ return clip;
+}
+
+
+int synth_1to1_s32_stereo_sse(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_real_sse(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_real_sse(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_real_sse(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_real_sse(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ clip = synth_1to1_s32_s_sse_asm(fr->decwin, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 256;
+
+ return clip;
+}
+#endif
+
+#ifdef OPT_NEON
+/* Assembler routines. */
+int synth_1to1_s32_neon_asm(real *window, real *b0, int32_t *samples, int bo1);
+int synth_1to1_s32_s_neon_asm(real *window, real *b0l, real *b0r, int32_t *samples, int bo1);
+void dct64_real_neon(real *out0, real *out1, real *samples);
+/* Hull for C mpg123 API */
+int synth_1to1_s32_neon(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_real_neon(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_real_neon(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ clip = synth_1to1_s32_neon_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 256;
+
+ return clip;
+}
+
+int synth_1to1_s32_stereo_neon(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_real_neon(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_real_neon(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_real_neon(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_real_neon(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ clip = synth_1to1_s32_s_neon_asm(fr->decwin, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 256;
+
+ return clip;
+}
+#endif
+
+#ifdef OPT_NEON64
+/* Assembler routines. */
+int synth_1to1_s32_neon64_asm(real *window, real *b0, int32_t *samples, int bo1);
+int synth_1to1_s32_s_neon64_asm(real *window, real *b0l, real *b0r, int32_t *samples, int bo1);
+void dct64_real_neon64(real *out0, real *out1, real *samples);
+/* Hull for C mpg123 API */
+int synth_1to1_s32_neon64(real *bandPtr,int channel, mpg123_handle *fr, int final)
+{
+ int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0, **buf;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
+#endif
+ if(!channel)
+ {
+ fr->bo--;
+ fr->bo &= 0xf;
+ buf = fr->real_buffs[0];
+ }
+ else
+ {
+ samples++;
+ buf = fr->real_buffs[1];
+ }
+
+ if(fr->bo & 0x1)
+ {
+ b0 = buf[0];
+ bo1 = fr->bo;
+ dct64_real_neon64(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
+ }
+ else
+ {
+ b0 = buf[1];
+ bo1 = fr->bo+1;
+ dct64_real_neon64(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
+ }
+
+ clip = synth_1to1_s32_neon64_asm(fr->decwin, b0, samples, bo1);
+
+ if(final) fr->buffer.fill += 256;
+
+ return clip;
+}
+
+int synth_1to1_s32st_neon64(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
+{
+ int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
+
+ real *b0l, *b0r, **bufl, **bufr;
+ int bo1;
+ int clip;
+#ifndef NO_EQUALIZER
+ if(fr->have_eq_settings)
+ {
+ do_equalizer(bandPtr_l,0,fr->equalizer);
+ do_equalizer(bandPtr_r,1,fr->equalizer);
+ }
+#endif
+ fr->bo--;
+ fr->bo &= 0xf;
+ bufl = fr->real_buffs[0];
+ bufr = fr->real_buffs[1];
+
+ if(fr->bo & 0x1)
+ {
+ b0l = bufl[0];
+ b0r = bufr[0];
+ bo1 = fr->bo;
+ dct64_real_neon64(bufl[1]+((fr->bo+1)&0xf),bufl[0]+fr->bo,bandPtr_l);
+ dct64_real_neon64(bufr[1]+((fr->bo+1)&0xf),bufr[0]+fr->bo,bandPtr_r);
+ }
+ else
+ {
+ b0l = bufl[1];
+ b0r = bufr[1];
+ bo1 = fr->bo+1;
+ dct64_real_neon64(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
+ dct64_real_neon64(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
+ }
+
+ clip = synth_1to1_s32_s_neon64_asm(fr->decwin, b0l, b0r, samples, bo1);
+
+ fr->buffer.fill += 256;
+
+ return clip;
+}
+#endif
+
+#undef BLOCK
+
+#ifndef NO_DOWNSAMPLE
+
+/*
+ Part 4b: 2to1 synth. Only generic and i386.
+*/
+#define BLOCK 0x20 /* One decoding block is 32 samples. */
+
+#define SYNTH_NAME synth_2to1_s32
+#include "synth.h"
+#undef SYNTH_NAME
+
+/* Mono-related synths; they wrap over _some_ synth_2to1_s32 (could be generic, could be i386). */
+#define SYNTH_NAME fr->synths.plain[r_2to1][f_32]
+#define MONO_NAME synth_2to1_s32_mono
+#define MONO2STEREO_NAME synth_2to1_s32_m2s
+#include "synth_mono.h"
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+#ifdef OPT_X86
+#define NO_AUTOINCREMENT
+#define SYNTH_NAME synth_2to1_s32_i386
+#include "synth.h"
+#undef SYNTH_NAME
+/* i386 uses the normal mono functions. */
+#undef NO_AUTOINCREMENT
+#endif
+
+#undef BLOCK
+
+/*
+ Part 4c: 4to1 synth. Only generic and i386.
+*/
+#define BLOCK 0x10 /* One decoding block is 16 samples. */
+
+#define SYNTH_NAME synth_4to1_s32
+#include "synth.h"
+#undef SYNTH_NAME
+
+/* Mono-related synths; they wrap over _some_ synth_4to1_s32 (could be generic, could be i386). */
+#define SYNTH_NAME fr->synths.plain[r_4to1][f_32]
+#define MONO_NAME synth_4to1_s32_mono
+#define MONO2STEREO_NAME synth_4to1_s32_m2s
+#include "synth_mono.h"
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+#ifdef OPT_X86
+#define NO_AUTOINCREMENT
+#define SYNTH_NAME synth_4to1_s32_i386
+#include "synth.h"
+#undef SYNTH_NAME
+/* i386 uses the normal mono functions. */
+#undef NO_AUTOINCREMENT
+#endif
+
+#undef BLOCK
+
+#endif /* NO_DOWNSAMPLE */
+
+#ifndef NO_NTOM
+/*
+ Part 4d: ntom synth.
+ Same procedure as above... Just no extra play anymore, straight synth that may use an optimized dct64.
+*/
+
+/* These are all in one header, there's no flexibility to gain. */
+#define SYNTH_NAME synth_ntom_s32
+#define MONO_NAME synth_ntom_s32_mono
+#define MONO2STEREO_NAME synth_ntom_s32_m2s
+#include "synth_ntom.h"
+#undef SYNTH_NAME
+#undef MONO_NAME
+#undef MONO2STEREO_NAME
+
+#endif
+
+#undef SAMPLE_T
+#undef WRITE_SAMPLE
+
+#endif /* non-fixed type */
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse.S
new file mode 100644
index 00000000..d01178b4
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse.S
@@ -0,0 +1,13 @@
+#include "mangle.h"
+#define MPL_DCT64 FUNC(dct64_sse)
+#define SYNTH_NAME ASM_NAME(synth_1to1_sse_asm)
+#include "synth_sse3d.h"
+
+#if defined(PIC) && defined(__APPLE__)
+ .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
+L_dct64_sse:
+ .indirect_symbol ASM_NAME(dct64_sse)
+ hlt ; hlt ; hlt ; hlt ; hlt
+#endif
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse3d.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse3d.h
new file mode 100644
index 00000000..5ebbd940
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse3d.h
@@ -0,0 +1,268 @@
+/*
+ decode_sse3d: Synth for SSE and extended 3DNow (yeah, the name is a relic)
+
+ copyright 2006-2007 by Zuxy Meng/the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by the mysterious higway for MMX (apparently)
+ then developed into SSE opt by Zuxy Meng, also building on Romain Dolbeau's AltiVec
+ Both have agreed to distribution under LGPL 2.1 .
+
+ Transformed back into standalone asm, with help of
+ gcc -S -DHAVE_CONFIG_H -I. -march=pentium -O3 -Wall -pedantic -fno-strict-aliasing -DREAL_IS_FLOAT -c -o decode_mmxsse.{S,c}
+
+ The difference between SSE and 3DNowExt is the dct64 function and the synth function name.
+ This template here uses the SYNTH_NAME and MPL_DCT64 macros for this - see decode_sse.S and decode_3dnowext.S...
+ That's not memory efficient since there's doubled code, but it's easier than giving another function pointer.
+ Maybe I'll change it in future, but now I need something that works.
+
+ Original comment from MPlayer source follows. Regarding the license history see
+ synth_mmx.S, which the original comment about this being licensed under GPL is
+ relating to.
+*/
+
+/*
+ * This code was taken from http://www.mpg123.org
+ * See ChangeLog of mpg123-0.59s-pre.1 for detail
+ * Applied to mplayer by Nick Kurshev <nickols_k@mail.ru>
+ *
+ * Local ChangeLog:
+ * - Partial loops unrolling and removing MOVW insn from loops
+*/
+
+#include "mangle.h"
+
+ .data
+ ALIGN8
+one_null:
+ .long -65536
+ .long -65536
+ ALIGN8
+null_one:
+ .long 65535
+ .long 65535
+
+ .text
+ ALIGN16
+ /* void SYNTH_NAME(real *bandPtr, int channel, short *samples, short *buffs, int *bo, float *decwins) */
+.globl SYNTH_NAME
+SYNTH_NAME:
+ pushl %ebp
+/* stack:0=ebp 4=back 8=bandptr 12=channel 16=samples 20=buffs 24=bo 28=decwins */
+ movl %esp, %ebp
+
+/* Now the old stack addresses are preserved via %epb. */
+#ifdef PIC
+ subl $8,%esp /* What has been called temp before. */
+#else
+ subl $4,%esp /* What has been called temp before. */
+#endif
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+
+#ifdef PIC
+ #undef _EBX_
+ #define _EBX_ %eax
+ GET_GOT
+#define EBXSAVE -4(%ebp)
+ movl _EBX_, EBXSAVE /* save PIC register */
+#endif
+
+#define TEMP 12(%esp)
+/* APP */
+ movl 12(%ebp),%ecx
+ movl 16(%ebp),%edi
+ movl $15,%ebx
+ movl 24(%ebp),%edx
+ leal (%edi,%ecx,2),%edi
+ decl %ecx
+ movl 20(%ebp),%esi
+ movl (%edx),%eax
+ jecxz 1f
+ decl %eax
+ andl %ebx,%eax
+ leal 1088(%esi),%esi
+ movl %eax,(%edx)
+1:
+ leal (%esi,%eax,2),%edx
+ movl %eax,TEMP
+ incl %eax
+ andl %ebx,%eax
+ leal 544(%esi,%eax,2),%ecx
+ incl %ebx
+ testl $1, %eax
+ jnz 2f
+ xchgl %edx,%ecx
+ incl TEMP
+ leal 544(%esi),%esi
+2:
+ pushl 8(%ebp)
+ pushl %edx
+ pushl %ecx
+ call MPL_DCT64
+ addl $12, %esp
+ leal 1(%ebx), %ecx
+ subl TEMP,%ebx
+ pushl %ecx
+ /* leal ASM_NAME(decwins)(%ebx,%ebx,1), %edx */
+ movl 28(%ebp),%ecx
+ leal (%ecx,%ebx,2), %edx
+ movl (%esp),%ecx /* restore, but leave value on stack */
+ shrl $1, %ecx
+#ifdef PIC
+ movl EBXSAVE, _EBX_
+#endif
+ ALIGN16
+3:
+ movq (%edx),%mm0
+ movq 64(%edx),%mm4
+ pmaddwd (%esi),%mm0
+ pmaddwd 32(%esi),%mm4
+ movq 8(%edx),%mm1
+ movq 72(%edx),%mm5
+ pmaddwd 8(%esi),%mm1
+ pmaddwd 40(%esi),%mm5
+ movq 16(%edx),%mm2
+ movq 80(%edx),%mm6
+ pmaddwd 16(%esi),%mm2
+ pmaddwd 48(%esi),%mm6
+ movq 24(%edx),%mm3
+ movq 88(%edx),%mm7
+ pmaddwd 24(%esi),%mm3
+ pmaddwd 56(%esi),%mm7
+ paddd %mm1,%mm0
+ paddd %mm5,%mm4
+ paddd %mm2,%mm0
+ paddd %mm6,%mm4
+ paddd %mm3,%mm0
+ paddd %mm7,%mm4
+ movq %mm0,%mm1
+ movq %mm4,%mm5
+ psrlq $32,%mm1
+ psrlq $32,%mm5
+ paddd %mm1,%mm0
+ paddd %mm5,%mm4
+ psrad $13,%mm0
+ psrad $13,%mm4
+ packssdw %mm0,%mm0
+ packssdw %mm4,%mm4
+ movq (%edi), %mm1
+ punpckldq %mm4, %mm0
+ pand LOCAL_VAR(one_null), %mm1
+ pand LOCAL_VAR(null_one), %mm0
+ por %mm0, %mm1
+ movq %mm1,(%edi)
+ leal 64(%esi),%esi
+ leal 128(%edx),%edx
+ leal 8(%edi),%edi
+ decl %ecx
+ jnz 3b
+ popl %ecx
+ andl $1, %ecx
+ jecxz 4f
+ movq (%edx),%mm0
+ pmaddwd (%esi),%mm0
+ movq 8(%edx),%mm1
+ pmaddwd 8(%esi),%mm1
+ movq 16(%edx),%mm2
+ pmaddwd 16(%esi),%mm2
+ movq 24(%edx),%mm3
+ pmaddwd 24(%esi),%mm3
+ paddd %mm1,%mm0
+ paddd %mm2,%mm0
+ paddd %mm3,%mm0
+ movq %mm0,%mm1
+ psrlq $32,%mm1
+ paddd %mm1,%mm0
+ psrad $13,%mm0
+ packssdw %mm0,%mm0
+ movd %mm0,%eax
+ movw %ax, (%edi)
+ leal 32(%esi),%esi
+ leal 64(%edx),%edx
+ leal 4(%edi),%edi
+4:
+ subl $64,%esi
+ movl $7,%ecx
+
+#ifdef PIC
+ movl EBXSAVE, _EBX_
+#endif
+ ALIGN16
+5:
+ movq (%edx),%mm0
+ movq 64(%edx),%mm4
+ pmaddwd (%esi),%mm0
+ pmaddwd -32(%esi),%mm4
+ movq 8(%edx),%mm1
+ movq 72(%edx),%mm5
+ pmaddwd 8(%esi),%mm1
+ pmaddwd -24(%esi),%mm5
+ movq 16(%edx),%mm2
+ movq 80(%edx),%mm6
+ pmaddwd 16(%esi),%mm2
+ pmaddwd -16(%esi),%mm6
+ movq 24(%edx),%mm3
+ movq 88(%edx),%mm7
+ pmaddwd 24(%esi),%mm3
+ pmaddwd -8(%esi),%mm7
+ paddd %mm1,%mm0
+ paddd %mm5,%mm4
+ paddd %mm2,%mm0
+ paddd %mm6,%mm4
+ paddd %mm3,%mm0
+ paddd %mm7,%mm4
+ movq %mm0,%mm1
+ movq %mm4,%mm5
+ psrlq $32,%mm1
+ psrlq $32,%mm5
+ paddd %mm0,%mm1
+ paddd %mm4,%mm5
+ psrad $13,%mm1
+ psrad $13,%mm5
+ packssdw %mm1,%mm1
+ packssdw %mm5,%mm5
+ psubd %mm0,%mm0
+ psubd %mm4,%mm4
+ psubsw %mm1,%mm0
+ psubsw %mm5,%mm4
+ movq (%edi), %mm1
+ punpckldq %mm4, %mm0
+ pand LOCAL_VAR(one_null), %mm1
+ pand LOCAL_VAR(null_one), %mm0
+ por %mm0, %mm1
+ movq %mm1,(%edi)
+ subl $64,%esi
+ addl $128,%edx
+ leal 8(%edi),%edi
+ decl %ecx
+ jnz 5b
+ movq (%edx),%mm0
+ pmaddwd (%esi),%mm0
+ movq 8(%edx),%mm1
+ pmaddwd 8(%esi),%mm1
+ movq 16(%edx),%mm2
+ pmaddwd 16(%esi),%mm2
+ movq 24(%edx),%mm3
+ pmaddwd 24(%esi),%mm3
+ paddd %mm1,%mm0
+ paddd %mm2,%mm0
+ paddd %mm3,%mm0
+ movq %mm0,%mm1
+ psrlq $32,%mm1
+ paddd %mm0,%mm1
+ psrad $13,%mm1
+ packssdw %mm1,%mm1
+ psubd %mm0,%mm0
+ psubsw %mm1,%mm0
+ movd %mm0,%eax
+ movw %ax,(%edi)
+ emms
+
+/* NO_APP */
+ popl %ebx
+ popl %esi
+ popl %edi
+ mov %ebp, %esp
+ popl %ebp
+ ret
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse_accurate.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse_accurate.S
new file mode 100644
index 00000000..57bcbd60
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse_accurate.S
@@ -0,0 +1,298 @@
+/*
+ synth_sse_accurate: SSE optimized synth (MPEG-compliant 16bit output version)
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+/* real *window; */
+#define WINDOW %ebx
+/* real *b0; */
+#define B0 %edx
+/* real *samples; */
+#define SAMPLES %esi
+
+#define MMREG_CLIP %mm7
+
+/*
+ int synth_1to1_sse_accurate_asm(real *window, real *b0, short *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+#if !defined ( __APPLE__) && !defined (__OS2__)
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+maxmin_s16:
+ .long 1191181824 /* 32767.0 */
+ .long 1191181824
+ .long 1191181824
+ .long 1191181824
+ .long -956301312 /* -32768.0 */
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .text
+ ALIGN16
+.globl ASM_NAME(synth_1to1_sse_accurate_asm)
+ASM_NAME(synth_1to1_sse_accurate_asm):
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %ebx
+ pushl %esi
+
+ pxor MMREG_CLIP, MMREG_CLIP
+
+ movl 8(%ebp), WINDOW
+ movl 12(%ebp), B0
+ movl 16(%ebp), SAMPLES
+ movl 20(%ebp), %eax
+ shll $2, %eax
+
+ leal 64(WINDOW), WINDOW
+ subl %eax, WINDOW
+
+ #undef _EBX_
+ #define _EBX_ %eax
+ GET_GOT
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm4
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ mulps 0(B0), %xmm0
+ mulps 16(B0), %xmm1
+ mulps 32(B0), %xmm2
+ mulps 48(B0), %xmm3
+ mulps 64(B0), %xmm4
+ mulps 80(B0), %xmm5
+ mulps 96(B0), %xmm6
+ mulps 112(B0), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm4, %xmm5
+ movaps %xmm0, %xmm4
+
+ leal 256(WINDOW), WINDOW
+ leal 128(B0), B0
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm6
+ movups 144(WINDOW), %xmm7
+ mulps (B0), %xmm0
+ mulps 16(B0), %xmm1
+ mulps 32(B0), %xmm2
+ mulps 48(B0), %xmm3
+ mulps 64(B0), %xmm6
+ mulps 80(B0), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm7, %xmm6
+ movups 160(WINDOW), %xmm1
+ movups 176(WINDOW), %xmm3
+ mulps 96(B0), %xmm1
+ mulps 112(B0), %xmm3
+ addps %xmm2, %xmm0
+ addps %xmm3, %xmm1
+ addps %xmm1, %xmm6
+ movaps %xmm6, %xmm7
+ movaps %xmm0, %xmm6
+
+ leal 256(WINDOW), WINDOW
+ leal 128(B0), B0
+
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ subps %xmm6, %xmm4
+ subps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+
+ movaps %xmm0, %xmm1
+ movaps %xmm0, %xmm2
+ pshufw $0xdd, (SAMPLES), %mm2
+ pshufw $0xdd, 8(SAMPLES), %mm3
+ cmpnleps LOCAL_VAR(maxmin_s16), %xmm1
+ cmpltps 16+LOCAL_VAR(maxmin_s16), %xmm2
+ cvtps2pi %xmm0, %mm0
+ movhlps %xmm0, %xmm0
+ cvtps2pi %xmm0, %mm1
+ packssdw %mm1, %mm0
+ movq %mm0, %mm1
+ punpcklwd %mm2, %mm0
+ punpckhwd %mm3, %mm1
+ movq %mm0, (SAMPLES)
+ movq %mm1, 8(SAMPLES)
+
+ cvtps2pi %xmm1, %mm0
+ cvtps2pi %xmm2, %mm1
+ movhlps %xmm1, %xmm1
+ movhlps %xmm2, %xmm2
+ cvtps2pi %xmm1, %mm2
+ cvtps2pi %xmm2, %mm3
+ packssdw %mm2, %mm0
+ packssdw %mm3, %mm1
+ psrlw $15, %mm0
+ psrlw $15, %mm1
+ paddw %mm1, %mm0
+ paddw %mm0, MMREG_CLIP
+
+ leal 16(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm4
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ mulps 0(B0), %xmm0
+ mulps 16(B0), %xmm1
+ mulps 32(B0), %xmm2
+ mulps 48(B0), %xmm3
+ mulps -64(B0), %xmm4
+ mulps -48(B0), %xmm5
+ mulps -32(B0), %xmm6
+ mulps -16(B0), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm4, %xmm5
+ movaps %xmm0, %xmm4
+
+ leal 256(WINDOW), WINDOW
+ leal -128(B0), B0
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm6
+ movups 144(WINDOW), %xmm7
+ mulps (B0), %xmm0
+ mulps 16(B0), %xmm1
+ mulps 32(B0), %xmm2
+ mulps 48(B0), %xmm3
+ mulps -64(B0), %xmm6
+ mulps -48(B0), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm7, %xmm6
+ movups 160(WINDOW), %xmm1
+ movups 176(WINDOW), %xmm3
+ mulps -32(B0), %xmm1
+ mulps -16(B0), %xmm3
+ addps %xmm2, %xmm0
+ addps %xmm3, %xmm1
+ addps %xmm1, %xmm6
+ movaps %xmm6, %xmm7
+ movaps %xmm0, %xmm6
+
+ leal 256(WINDOW), WINDOW
+ leal -128(B0), B0
+
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ addps %xmm6, %xmm4
+ addps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+
+ movaps %xmm0, %xmm1
+ movaps %xmm0, %xmm2
+ pshufw $0xdd, (SAMPLES), %mm2
+ pshufw $0xdd, 8(SAMPLES), %mm3
+ cmpnleps LOCAL_VAR(maxmin_s16), %xmm1
+ cmpltps 16+LOCAL_VAR(maxmin_s16), %xmm2
+ cvtps2pi %xmm0, %mm0
+ movhlps %xmm0, %xmm0
+ cvtps2pi %xmm0, %mm1
+ packssdw %mm1, %mm0
+ movq %mm0, %mm1
+ punpcklwd %mm2, %mm0
+ punpckhwd %mm3, %mm1
+ movq %mm0, (SAMPLES)
+ movq %mm1, 8(SAMPLES)
+
+ cvtps2pi %xmm1, %mm0
+ cvtps2pi %xmm2, %mm1
+ movhlps %xmm1, %xmm1
+ movhlps %xmm2, %xmm2
+ cvtps2pi %xmm1, %mm2
+ cvtps2pi %xmm2, %mm3
+ packssdw %mm2, %mm0
+ packssdw %mm3, %mm1
+ psrlw $15, %mm0
+ psrlw $15, %mm1
+ paddw %mm1, %mm0
+ paddw %mm0, MMREG_CLIP
+
+ leal 16(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ pshufw $0xee, MMREG_CLIP, %mm0
+ paddw MMREG_CLIP, %mm0
+ pshufw $0x55, %mm0, %mm1
+ paddw %mm1, %mm0
+ movd %mm0, %eax
+ andl $0xffff, %eax
+
+ popl %esi
+ popl %ebx
+ movl %ebp, %esp
+ popl %ebp
+
+ emms
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse_float.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse_float.S
new file mode 100644
index 00000000..ddf6e247
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse_float.S
@@ -0,0 +1,245 @@
+/*
+ synth_sse_float: SSE optimized synth (float output version)
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+/* real *window; */
+#define WINDOW %ebx
+/* real *b0; */
+#define B0 %edx
+/* real *samples; */
+#define SAMPLES %esi
+
+/*
+ int synth_1to1_real_sse_asm(real *window, real *b0, real *samples, int bo1);
+ return value: number of clipped samples (0)
+*/
+
+#if !defined ( __APPLE__) && !defined (__OS2__)
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+scale_sse:
+ .long 939524096
+ .long 939524096
+ .long 939524096
+ .long 939524096
+ .text
+ ALIGN16
+.globl ASM_NAME(synth_1to1_real_sse_asm)
+ASM_NAME(synth_1to1_real_sse_asm):
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %ebx
+ pushl %esi
+
+ movl 8(%ebp), WINDOW
+ movl 12(%ebp), B0
+ movl 16(%ebp), SAMPLES
+ movl 20(%ebp), %eax
+ shll $2, %eax
+
+ leal 64(WINDOW), WINDOW
+ subl %eax, WINDOW
+
+ #undef _EBX_
+ #define _EBX_ %eax
+ GET_GOT
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm4
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ mulps 0(B0), %xmm0
+ mulps 16(B0), %xmm1
+ mulps 32(B0), %xmm2
+ mulps 48(B0), %xmm3
+ mulps 64(B0), %xmm4
+ mulps 80(B0), %xmm5
+ mulps 96(B0), %xmm6
+ mulps 112(B0), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm4, %xmm5
+ movaps %xmm0, %xmm4
+
+ leal 256(WINDOW), WINDOW
+ leal 128(B0), B0
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm6
+ movups 144(WINDOW), %xmm7
+ mulps (B0), %xmm0
+ mulps 16(B0), %xmm1
+ mulps 32(B0), %xmm2
+ mulps 48(B0), %xmm3
+ mulps 64(B0), %xmm6
+ mulps 80(B0), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm7, %xmm6
+ movups 160(WINDOW), %xmm1
+ movups 176(WINDOW), %xmm3
+ mulps 96(B0), %xmm1
+ mulps 112(B0), %xmm3
+ addps %xmm2, %xmm0
+ addps %xmm3, %xmm1
+ addps %xmm1, %xmm6
+ movaps %xmm6, %xmm7
+ movaps %xmm0, %xmm6
+
+ leal 256(WINDOW), WINDOW
+ leal 128(B0), B0
+
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ subps %xmm6, %xmm4
+ subps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+
+ movups (SAMPLES), %xmm1
+ movups 16(SAMPLES), %xmm2
+ mulps LOCAL_VAR(scale_sse), %xmm0
+ shufps $0xdd, %xmm2, %xmm1
+ movaps %xmm0, %xmm2
+ unpcklps %xmm1, %xmm0
+ unpckhps %xmm1, %xmm2
+ movups %xmm0, (SAMPLES)
+ movups %xmm2, 16(SAMPLES)
+
+ leal 32(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm4
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ mulps 0(B0), %xmm0
+ mulps 16(B0), %xmm1
+ mulps 32(B0), %xmm2
+ mulps 48(B0), %xmm3
+ mulps -64(B0), %xmm4
+ mulps -48(B0), %xmm5
+ mulps -32(B0), %xmm6
+ mulps -16(B0), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm4, %xmm5
+ movaps %xmm0, %xmm4
+
+ leal 256(WINDOW), WINDOW
+ leal -128(B0), B0
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm6
+ movups 144(WINDOW), %xmm7
+ mulps (B0), %xmm0
+ mulps 16(B0), %xmm1
+ mulps 32(B0), %xmm2
+ mulps 48(B0), %xmm3
+ mulps -64(B0), %xmm6
+ mulps -48(B0), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm7, %xmm6
+ movups 160(WINDOW), %xmm1
+ movups 176(WINDOW), %xmm3
+ mulps -32(B0), %xmm1
+ mulps -16(B0), %xmm3
+ addps %xmm2, %xmm0
+ addps %xmm3, %xmm1
+ addps %xmm1, %xmm6
+ movaps %xmm6, %xmm7
+ movaps %xmm0, %xmm6
+
+ leal 256(WINDOW), WINDOW
+ leal -128(B0), B0
+
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ addps %xmm6, %xmm4
+ addps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+
+ movups (SAMPLES), %xmm1
+ movups 16(SAMPLES), %xmm2
+ mulps LOCAL_VAR(scale_sse), %xmm0
+ shufps $0xdd, %xmm2, %xmm1
+ movaps %xmm0, %xmm2
+ unpcklps %xmm1, %xmm0
+ unpckhps %xmm1, %xmm2
+ movups %xmm0, (SAMPLES)
+ movups %xmm2, 16(SAMPLES)
+
+ leal 32(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ xorl %eax, %eax
+
+ popl %esi
+ popl %ebx
+ movl %ebp, %esp
+ popl %ebp
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse_s32.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse_s32.S
new file mode 100644
index 00000000..7aba4a17
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_sse_s32.S
@@ -0,0 +1,310 @@
+/*
+ synth_sse_s32: SSE optimized synth (s32 output version)
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+/* real *window; */
+#define WINDOW %ebx
+/* real *b0; */
+#define B0 %edx
+/* real *samples; */
+#define SAMPLES %esi
+
+#define MMREG_CLIP %mm7
+
+/*
+ int synth_1to1_s32_sse_asm(real *window, real *b0, int32_t *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+#if !defined ( __APPLE__) && !defined (__OS2__)
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+scale_s32:
+ .long 1199570944 /* 65536.0 */
+ .long 1199570944
+ .long 1199570944
+ .long 1199570944
+ ALIGN16
+maxmin_s32:
+ .long 1191182335 /* 32767.999 */
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long -956301312 /* -32768.0 */
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .text
+ ALIGN16
+.globl ASM_NAME(synth_1to1_s32_sse_asm)
+ASM_NAME(synth_1to1_s32_sse_asm):
+ pushl %ebp
+ movl %esp, %ebp
+ pushl %ebx
+ pushl %esi
+
+ pxor MMREG_CLIP, MMREG_CLIP
+
+ movl 8(%ebp), WINDOW
+ movl 12(%ebp), B0
+ movl 16(%ebp), SAMPLES
+ movl 20(%ebp), %eax
+ shll $2, %eax
+
+ leal 64(WINDOW), WINDOW
+ subl %eax, WINDOW
+
+ #undef _EBX_
+ #define _EBX_ %eax
+ GET_GOT
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm4
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ mulps 0(B0), %xmm0
+ mulps 16(B0), %xmm1
+ mulps 32(B0), %xmm2
+ mulps 48(B0), %xmm3
+ mulps 64(B0), %xmm4
+ mulps 80(B0), %xmm5
+ mulps 96(B0), %xmm6
+ mulps 112(B0), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm4, %xmm5
+ movaps %xmm0, %xmm4
+
+ leal 256(WINDOW), WINDOW
+ leal 128(B0), B0
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm6
+ movups 144(WINDOW), %xmm7
+ mulps (B0), %xmm0
+ mulps 16(B0), %xmm1
+ mulps 32(B0), %xmm2
+ mulps 48(B0), %xmm3
+ mulps 64(B0), %xmm6
+ mulps 80(B0), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm7, %xmm6
+ movups 160(WINDOW), %xmm1
+ movups 176(WINDOW), %xmm3
+ mulps 96(B0), %xmm1
+ mulps 112(B0), %xmm3
+ addps %xmm2, %xmm0
+ addps %xmm3, %xmm1
+ addps %xmm1, %xmm6
+ movaps %xmm6, %xmm7
+ movaps %xmm0, %xmm6
+
+ leal 256(WINDOW), WINDOW
+ leal 128(B0), B0
+
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ subps %xmm6, %xmm4
+ subps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+
+ movaps %xmm0, %xmm1
+ movaps %xmm0, %xmm2
+ mulps LOCAL_VAR(scale_s32), %xmm0
+ cmpnleps LOCAL_VAR(maxmin_s32), %xmm1
+ cmpltps 16+LOCAL_VAR(maxmin_s32), %xmm2
+ cvtps2pi %xmm0, %mm0
+ movhlps %xmm0, %xmm0
+ cvtps2pi %xmm0, %mm1
+ cvtps2pi %xmm1, %mm2
+ movhlps %xmm1, %xmm1
+ cvtps2pi %xmm1, %mm3
+ psrad $31, %mm2
+ psrad $31, %mm3
+ pxor %mm2, %mm0
+ pxor %mm3, %mm1
+ movd %mm0, (SAMPLES)
+ psrlq $32, %mm0
+ movd %mm0, 8(SAMPLES)
+ movd %mm1, 16(SAMPLES)
+ psrlq $32, %mm1
+ movd %mm1, 24(SAMPLES)
+
+ cvtps2pi %xmm2, %mm0
+ movhlps %xmm2, %xmm2
+ cvtps2pi %xmm2, %mm1
+ packssdw %mm3, %mm2
+ packssdw %mm1, %mm0
+ psrlw $15, %mm2
+ psrlw $15, %mm0
+ paddw %mm2, %mm0
+ paddw %mm0, MMREG_CLIP
+
+ leal 32(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm4
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ mulps 0(B0), %xmm0
+ mulps 16(B0), %xmm1
+ mulps 32(B0), %xmm2
+ mulps 48(B0), %xmm3
+ mulps -64(B0), %xmm4
+ mulps -48(B0), %xmm5
+ mulps -32(B0), %xmm6
+ mulps -16(B0), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm4, %xmm5
+ movaps %xmm0, %xmm4
+
+ leal 256(WINDOW), WINDOW
+ leal -128(B0), B0
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm6
+ movups 144(WINDOW), %xmm7
+ mulps (B0), %xmm0
+ mulps 16(B0), %xmm1
+ mulps 32(B0), %xmm2
+ mulps 48(B0), %xmm3
+ mulps -64(B0), %xmm6
+ mulps -48(B0), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm7, %xmm6
+ movups 160(WINDOW), %xmm1
+ movups 176(WINDOW), %xmm3
+ mulps -32(B0), %xmm1
+ mulps -16(B0), %xmm3
+ addps %xmm2, %xmm0
+ addps %xmm3, %xmm1
+ addps %xmm1, %xmm6
+ movaps %xmm6, %xmm7
+ movaps %xmm0, %xmm6
+
+ leal 256(WINDOW), WINDOW
+ leal -128(B0), B0
+
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ addps %xmm6, %xmm4
+ addps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+
+ movaps %xmm0, %xmm1
+ movaps %xmm0, %xmm2
+ mulps LOCAL_VAR(scale_s32), %xmm0
+ cmpnleps LOCAL_VAR(maxmin_s32), %xmm1
+ cmpltps 16+LOCAL_VAR(maxmin_s32), %xmm2
+ cvtps2pi %xmm0, %mm0
+ movhlps %xmm0, %xmm0
+ cvtps2pi %xmm0, %mm1
+ cvtps2pi %xmm1, %mm2
+ movhlps %xmm1, %xmm1
+ cvtps2pi %xmm1, %mm3
+ psrad $31, %mm2
+ psrad $31, %mm3
+ pxor %mm2, %mm0
+ pxor %mm3, %mm1
+ movd %mm0, (SAMPLES)
+ psrlq $32, %mm0
+ movd %mm0, 8(SAMPLES)
+ movd %mm1, 16(SAMPLES)
+ psrlq $32, %mm1
+ movd %mm1, 24(SAMPLES)
+
+ cvtps2pi %xmm2, %mm0
+ movhlps %xmm2, %xmm2
+ cvtps2pi %xmm2, %mm1
+ packssdw %mm3, %mm2
+ packssdw %mm1, %mm0
+ psrlw $15, %mm2
+ psrlw $15, %mm0
+ paddw %mm2, %mm0
+ paddw %mm0, MMREG_CLIP
+
+ leal 32(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ pshufw $0xee, MMREG_CLIP, %mm0
+ paddw MMREG_CLIP, %mm0
+ pshufw $0x55, %mm0, %mm1
+ paddw %mm1, %mm0
+ movd %mm0, %eax
+ andl $0xffff, %eax
+
+ popl %esi
+ popl %ebx
+ movl %ebp, %esp
+ popl %ebp
+
+ emms
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_avx.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_avx.S
new file mode 100644
index 00000000..79fb6702
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_avx.S
@@ -0,0 +1,256 @@
+/*
+ synth_stereo_avx: AVX optimized synth for x86-64 (stereo specific version)
+
+ copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifdef IS_MSABI
+/* short *window; */
+#define WINDOW %r10
+/* short *b0l; */
+#define B0L %rdx
+/* short *b0r; */
+#define B0R %r8
+/* short *samples; */
+#define SAMPLES %r9
+#else
+/* short *window; */
+#define WINDOW %rdi
+/* short *b0l; */
+#define B0L %rsi
+/* short *b0r; */
+#define B0R %rdx
+/* short *samples; */
+#define SAMPLES %r9
+#endif
+
+/*
+ int synth_1to1_s_avx_asm(short *window, short *b0l, short *b0r, short *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+ ALIGN16
+.globl ASM_NAME(synth_1to1_s_avx_asm)
+ASM_NAME(synth_1to1_s_avx_asm):
+#ifdef IS_MSABI /* should save xmm6-15 */
+ push %rbp
+ mov %rsp, %rbp
+ sub $144, %rsp
+ movaps %xmm6, (%rsp)
+ movaps %xmm7, 16(%rsp)
+ movaps %xmm8, 32(%rsp)
+ movaps %xmm9, 48(%rsp)
+ movaps %xmm10, 64(%rsp)
+ movaps %xmm11, 80(%rsp)
+ movaps %xmm12, 96(%rsp)
+ movaps %xmm13, 112(%rsp)
+ movaps %xmm14, 128(%rsp)
+ movl 48(%rbp), %eax /* 5th argument; placed after 32-byte shadow space */
+#endif
+
+#ifdef IS_MSABI
+ shl $1, %eax
+ mov %rcx, WINDOW
+#else
+ mov %r8d, %eax
+ shl $1, %eax
+ movq %rcx, SAMPLES
+#endif
+ add $32, WINDOW
+ sub %rax, WINDOW
+
+ mov $64, %rax
+ movl $4, %ecx
+ vpxor %xmm14, %xmm14, %xmm14
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm8
+ movups 16(WINDOW), %xmm9
+ movups (WINDOW,%rax), %xmm10
+ movups 16(WINDOW,%rax), %xmm11
+ vpmaddwd (B0L), %xmm8, %xmm0
+ vpmaddwd 16(B0L), %xmm9, %xmm1
+ vpmaddwd (B0R), %xmm8, %xmm2
+ vpmaddwd 16(B0R), %xmm9, %xmm3
+ vpmaddwd 32(B0L), %xmm10, %xmm4
+ vpmaddwd 48(B0L), %xmm11, %xmm5
+ vpmaddwd 32(B0R), %xmm10, %xmm6
+ vpmaddwd 48(B0R), %xmm11, %xmm7
+ vpaddd %xmm1, %xmm0, %xmm8
+ vpaddd %xmm3, %xmm2, %xmm0
+ vpaddd %xmm5, %xmm4, %xmm9
+ vpaddd %xmm7, %xmm6, %xmm1
+ lea (WINDOW,%rax,2), WINDOW
+ add %rax, B0L
+ add %rax, B0R
+
+ movups (WINDOW), %xmm10
+ movups 16(WINDOW), %xmm11
+ movups (WINDOW,%rax), %xmm12
+ movups 16(WINDOW,%rax), %xmm13
+ vpmaddwd (B0L), %xmm10, %xmm2
+ vpmaddwd 16(B0L), %xmm11, %xmm3
+ vpmaddwd (B0R), %xmm10, %xmm4
+ vpmaddwd 16(B0R), %xmm11, %xmm5
+ vpmaddwd 32(B0L), %xmm12, %xmm6
+ vpmaddwd 48(B0L), %xmm13, %xmm10
+ vpmaddwd 32(B0R), %xmm12, %xmm7
+ vpmaddwd 48(B0R), %xmm13, %xmm11
+ vpaddd %xmm3, %xmm2, %xmm2
+ vpaddd %xmm5, %xmm4, %xmm3
+ vpaddd %xmm6, %xmm10, %xmm4
+ vpaddd %xmm7, %xmm11, %xmm5
+ lea (WINDOW,%rax,2), WINDOW
+ add %rax, B0L
+ add %rax, B0R
+
+ vpunpckldq %xmm0, %xmm8, %xmm6
+ vpunpckhdq %xmm0, %xmm8, %xmm0
+ vpunpckldq %xmm1, %xmm9, %xmm7
+ vpunpckhdq %xmm1, %xmm9, %xmm1
+ vpaddd %xmm6, %xmm0, %xmm0
+ vpaddd %xmm7, %xmm1, %xmm1
+ vpunpckldq %xmm3, %xmm2, %xmm6
+ vpunpckhdq %xmm3, %xmm2, %xmm2
+ vpunpckldq %xmm5, %xmm4, %xmm7
+ vpunpckhdq %xmm5, %xmm4, %xmm3
+ vpaddd %xmm6, %xmm2, %xmm2
+ vpaddd %xmm7, %xmm3, %xmm3
+
+ vpunpcklqdq %xmm1, %xmm0, %xmm4
+ vpunpckhqdq %xmm1, %xmm0, %xmm0
+ vpunpcklqdq %xmm3, %xmm2, %xmm5
+ vpunpckhqdq %xmm3, %xmm2, %xmm1
+ vpaddd %xmm0, %xmm4, %xmm0
+ vpaddd %xmm1, %xmm5, %xmm1
+ vpsrad $13, %xmm0, %xmm0
+ vpsrad $13, %xmm1, %xmm1
+ vpackssdw %xmm1, %xmm0, %xmm2
+ vpcmpeqd %xmm3, %xmm3, %xmm3
+ vpslld $16, %xmm0, %xmm0
+ vpslld $16, %xmm1, %xmm1
+ vpsrld $16, %xmm0, %xmm0
+ vpsrld $16, %xmm1, %xmm1
+ vpackusdw %xmm1, %xmm0, %xmm0
+ vpcmpeqw %xmm2, %xmm0, %xmm0
+ vpxor %xmm3, %xmm0, %xmm0
+ vpaddw %xmm0, %xmm14, %xmm14
+
+ movups %xmm2, (SAMPLES)
+ add $16, SAMPLES
+ dec %ecx
+ jnz 1b
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm8
+ movups 16(WINDOW), %xmm9
+ movups (WINDOW,%rax), %xmm10
+ movups 16(WINDOW,%rax), %xmm11
+ vpmaddwd (B0L), %xmm8, %xmm0
+ vpmaddwd 16(B0L), %xmm9, %xmm1
+ vpmaddwd (B0R), %xmm8, %xmm2
+ vpmaddwd 16(B0R), %xmm9, %xmm3
+ vpmaddwd -32(B0L), %xmm10, %xmm4
+ vpmaddwd -16(B0L), %xmm11, %xmm5
+ vpmaddwd -32(B0R), %xmm10, %xmm6
+ vpmaddwd -16(B0R), %xmm11, %xmm7
+ vpaddd %xmm1, %xmm0, %xmm8
+ vpaddd %xmm3, %xmm2, %xmm0
+ vpaddd %xmm5, %xmm4, %xmm9
+ vpaddd %xmm7, %xmm6, %xmm1
+ lea (WINDOW,%rax,2), WINDOW
+ sub %rax, B0L
+ sub %rax, B0R
+
+ movups (WINDOW), %xmm10
+ movups 16(WINDOW), %xmm11
+ movups (WINDOW,%rax), %xmm12
+ movups 16(WINDOW,%rax), %xmm13
+ vpmaddwd (B0L), %xmm10, %xmm2
+ vpmaddwd 16(B0L), %xmm11, %xmm3
+ vpmaddwd (B0R), %xmm10, %xmm4
+ vpmaddwd 16(B0R), %xmm11, %xmm5
+ vpmaddwd -32(B0L), %xmm12, %xmm6
+ vpmaddwd -16(B0L), %xmm13, %xmm10
+ vpmaddwd -32(B0R), %xmm12, %xmm7
+ vpmaddwd -16(B0R), %xmm13, %xmm11
+ vpaddd %xmm3, %xmm2, %xmm2
+ vpaddd %xmm5, %xmm4, %xmm3
+ vpaddd %xmm6, %xmm10, %xmm4
+ vpaddd %xmm7, %xmm11, %xmm5
+ lea (WINDOW,%rax,2), WINDOW
+ sub %rax, B0L
+ sub %rax, B0R
+
+ vpunpckldq %xmm0, %xmm8, %xmm6
+ vpunpckhdq %xmm0, %xmm8, %xmm0
+ vpunpckldq %xmm1, %xmm9, %xmm7
+ vpunpckhdq %xmm1, %xmm9, %xmm1
+ vpaddd %xmm6, %xmm0, %xmm0
+ vpaddd %xmm7, %xmm1, %xmm1
+ vpunpckldq %xmm3, %xmm2, %xmm6
+ vpunpckhdq %xmm3, %xmm2, %xmm2
+ vpunpckldq %xmm5, %xmm4, %xmm7
+ vpunpckhdq %xmm5, %xmm4, %xmm3
+ vpaddd %xmm6, %xmm2, %xmm2
+ vpaddd %xmm7, %xmm3, %xmm3
+
+ vpunpcklqdq %xmm1, %xmm0, %xmm4
+ vpunpckhqdq %xmm1, %xmm0, %xmm0
+ vpunpcklqdq %xmm3, %xmm2, %xmm5
+ vpunpckhqdq %xmm3, %xmm2, %xmm1
+ vpaddd %xmm0, %xmm4, %xmm0
+ vpaddd %xmm1, %xmm5, %xmm1
+ vpsrad $13, %xmm0, %xmm0
+ vpsrad $13, %xmm1, %xmm1
+ vpackssdw %xmm1, %xmm0, %xmm2
+ vpcmpeqd %xmm3, %xmm3, %xmm3
+ vpslld $16, %xmm0, %xmm0
+ vpslld $16, %xmm1, %xmm1
+ vpsrld $16, %xmm0, %xmm0
+ vpsrld $16, %xmm1, %xmm1
+ vpackusdw %xmm1, %xmm0, %xmm0
+ vpcmpeqw %xmm2, %xmm0, %xmm0
+ vpxor %xmm3, %xmm0, %xmm0
+ vpaddw %xmm0, %xmm14, %xmm14
+
+ movups %xmm2, (SAMPLES)
+ add $16, SAMPLES
+ dec %ecx
+ jnz 1b
+
+ pxor %xmm1, %xmm1
+ psubw %xmm14, %xmm1
+ pshufd $0x4e, %xmm1, %xmm0
+ paddw %xmm1, %xmm0
+ pshuflw $0x4e, %xmm0, %xmm1
+ paddw %xmm1, %xmm0
+ pshuflw $0x11, %xmm0, %xmm1
+ paddw %xmm1, %xmm0
+ movd %xmm0, %eax
+ and $0x7f, %eax
+
+#ifdef IS_MSABI
+ movaps (%rsp), %xmm6
+ movaps 16(%rsp), %xmm7
+ movaps 32(%rsp), %xmm8
+ movaps 48(%rsp), %xmm9
+ movaps 64(%rsp), %xmm10
+ movaps 80(%rsp), %xmm11
+ movaps 96(%rsp), %xmm12
+ movaps 112(%rsp), %xmm13
+ movaps 128(%rsp), %xmm14
+ mov %rbp, %rsp
+ pop %rbp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_avx_accurate.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_avx_accurate.S
new file mode 100644
index 00000000..6ba02516
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_avx_accurate.S
@@ -0,0 +1,286 @@
+/*
+ synth_stereo_avx_accurate: AVX optimized synth for x86-64 (stereo specific, MPEG-compliant 16bit output version)
+
+ copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifdef IS_MSABI
+/* real *window; */
+#define WINDOW %r10
+/* real *b0l; */
+#define B0L %rdx
+/* real *b0r; */
+#define B0R %r8
+/* real *samples; */
+#define SAMPLES %r9
+#else
+/* real *window; */
+#define WINDOW %rdi
+/* real *b0l; */
+#define B0L %rsi
+/* real *b0r; */
+#define B0R %rdx
+/* real *samples; */
+#define SAMPLES %r9
+#endif
+
+/*
+ int synth_1to1_s_avx_accurate_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+maxmin_avx:
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .text
+ ALIGN16
+ .globl ASM_NAME(synth_1to1_s_avx_accurate_asm)
+ASM_NAME(synth_1to1_s_avx_accurate_asm):
+#ifdef IS_MSABI /* should save xmm6-15 */
+ push %rbp
+ mov %rsp, %rbp
+ sub $144, %rsp
+ movaps %xmm6, (%rsp)
+ movaps %xmm7, 16(%rsp)
+ movaps %xmm8, 32(%rsp)
+ movaps %xmm9, 48(%rsp)
+ movaps %xmm10, 64(%rsp)
+ movaps %xmm11, 80(%rsp)
+ movaps %xmm12, 96(%rsp)
+ movaps %xmm13, 112(%rsp)
+ movaps %xmm14, 128(%rsp)
+ movl 48(%rbp), %eax /* 5th argument; placed after 32-byte shadow space */
+#endif
+
+#ifdef IS_MSABI
+ shl $2, %eax
+ mov %rcx, WINDOW
+#else
+ mov %r8d, %eax
+ shl $2, %eax
+ mov %rcx, SAMPLES
+#endif
+ add $64, WINDOW
+ sub %rax, WINDOW
+
+ mov $128, %rax
+ mov $4, %ecx
+ vpxor %xmm14, %xmm14, %xmm14
+
+ ALIGN16
+1:
+ vmovups (WINDOW), %ymm8
+ vmovups 32(WINDOW), %ymm9
+ vmovups (WINDOW,%rax), %ymm10
+ vmovups 32(WINDOW,%rax), %ymm11
+ vmulps (B0L), %ymm8, %ymm0
+ vmulps 32(B0L), %ymm9, %ymm1
+ vmulps (B0R), %ymm8, %ymm2
+ vmulps 32(B0R), %ymm9, %ymm3
+ vmulps 64(B0L), %ymm10, %ymm4
+ vmulps 96(B0L), %ymm11, %ymm5
+ vmulps 64(B0R), %ymm10, %ymm6
+ vmulps 96(B0R), %ymm11, %ymm7
+ vaddps %ymm1, %ymm0, %ymm8
+ vaddps %ymm3, %ymm2, %ymm0
+ vaddps %ymm5, %ymm4, %ymm9
+ vaddps %ymm7, %ymm6, %ymm1
+ lea (WINDOW,%rax,2), WINDOW
+ add %rax, B0L
+ add %rax, B0R
+
+ vmovups (WINDOW), %ymm10
+ vmovups 32(WINDOW), %ymm11
+ vmovups (WINDOW,%rax), %ymm12
+ vmovups 32(WINDOW,%rax), %ymm13
+ vmulps (B0L), %ymm10, %ymm2
+ vmulps 32(B0L), %ymm11, %ymm3
+ vmulps (B0R), %ymm10, %ymm4
+ vmulps 32(B0R), %ymm11, %ymm5
+ vmulps 64(B0L), %ymm12, %ymm6
+ vmulps 96(B0L), %ymm13, %ymm10
+ vmulps 64(B0R), %ymm12, %ymm7
+ vmulps 96(B0R), %ymm13, %ymm11
+ vaddps %ymm3, %ymm2, %ymm2
+ vaddps %ymm5, %ymm4, %ymm3
+ vaddps %ymm6, %ymm10, %ymm4
+ vaddps %ymm7, %ymm11, %ymm5
+ lea (WINDOW,%rax,2), WINDOW
+ add %rax, B0L
+ add %rax, B0R
+
+ vunpcklps %ymm0, %ymm8, %ymm6
+ vunpckhps %ymm0, %ymm8, %ymm0
+ vunpcklps %ymm1, %ymm9, %ymm7
+ vunpckhps %ymm1, %ymm9, %ymm1
+ vaddps %ymm6, %ymm0, %ymm0
+ vaddps %ymm7, %ymm1, %ymm1
+ vunpcklps %ymm3, %ymm2, %ymm6
+ vunpckhps %ymm3, %ymm2, %ymm2
+ vunpcklps %ymm5, %ymm4, %ymm7
+ vunpckhps %ymm5, %ymm4, %ymm3
+ vaddps %ymm6, %ymm2, %ymm2
+ vaddps %ymm7, %ymm3, %ymm3
+
+ vunpcklpd %ymm1, %ymm0, %ymm4
+ vunpckhpd %ymm1, %ymm0, %ymm0
+ vunpcklpd %ymm3, %ymm2, %ymm5
+ vunpckhpd %ymm3, %ymm2, %ymm1
+ vsubps %ymm0, %ymm4, %ymm0
+ vsubps %ymm1, %ymm5, %ymm1
+ vperm2f128 $0x20, %ymm1, %ymm0, %ymm2
+ vperm2f128 $0x31, %ymm1, %ymm0, %ymm3
+ vaddps %ymm3, %ymm2, %ymm0
+ vcmpnleps maxmin_avx(%rip), %ymm0, %ymm1
+ vcmpltps 32+maxmin_avx(%rip), %ymm0, %ymm2
+ vextractf128 $0x1, %ymm1, %xmm3
+ vextractf128 $0x1, %ymm2, %xmm4
+ vpackssdw %xmm2, %xmm1, %xmm1
+ vpackssdw %xmm4, %xmm3, %xmm3
+ vpaddw %xmm3, %xmm1, %xmm1
+ vpaddw %xmm1, %xmm14, %xmm14
+ vcvtps2dq %ymm0, %ymm0
+ vextractf128 $0x1, %ymm0, %xmm1
+ vpackssdw %xmm1, %xmm0, %xmm0
+
+ vmovups %xmm0, (SAMPLES)
+ add $16, SAMPLES
+ dec %ecx
+ jnz 1b
+
+ mov $4, %ecx
+
+ ALIGN16
+1:
+ vmovups (WINDOW), %ymm8
+ vmovups 32(WINDOW), %ymm9
+ vmovups (WINDOW,%rax), %ymm10
+ vmovups 32(WINDOW,%rax), %ymm11
+ vmulps (B0L), %ymm8, %ymm0
+ vmulps 32(B0L), %ymm9, %ymm1
+ vmulps (B0R), %ymm8, %ymm2
+ vmulps 32(B0R), %ymm9, %ymm3
+ vmulps -64(B0L), %ymm10, %ymm4
+ vmulps -32(B0L), %ymm11, %ymm5
+ vmulps -64(B0R), %ymm10, %ymm6
+ vmulps -32(B0R), %ymm11, %ymm7
+ vaddps %ymm1, %ymm0, %ymm8
+ vaddps %ymm3, %ymm2, %ymm0
+ vaddps %ymm5, %ymm4, %ymm9
+ vaddps %ymm7, %ymm6, %ymm1
+ lea (WINDOW,%rax,2), WINDOW
+ sub %rax, B0L
+ sub %rax, B0R
+
+ vmovups (WINDOW), %ymm10
+ vmovups 32(WINDOW), %ymm11
+ vmovups (WINDOW,%rax), %ymm12
+ vmovups 32(WINDOW,%rax), %ymm13
+ vmulps (B0L), %ymm10, %ymm2
+ vmulps 32(B0L), %ymm11, %ymm3
+ vmulps (B0R), %ymm10, %ymm4
+ vmulps 32(B0R), %ymm11, %ymm5
+ vmulps -64(B0L), %ymm12, %ymm6
+ vmulps -32(B0L), %ymm13, %ymm10
+ vmulps -64(B0R), %ymm12, %ymm7
+ vmulps -32(B0R), %ymm13, %ymm11
+ vaddps %ymm3, %ymm2, %ymm2
+ vaddps %ymm5, %ymm4, %ymm3
+ vaddps %ymm6, %ymm10, %ymm4
+ vaddps %ymm7, %ymm11, %ymm5
+ lea (WINDOW,%rax,2), WINDOW
+ sub %rax, B0L
+ sub %rax, B0R
+
+ vunpcklps %ymm0, %ymm8, %ymm6
+ vunpckhps %ymm0, %ymm8, %ymm0
+ vunpcklps %ymm1, %ymm9, %ymm7
+ vunpckhps %ymm1, %ymm9, %ymm1
+ vaddps %ymm6, %ymm0, %ymm0
+ vaddps %ymm7, %ymm1, %ymm1
+ vunpcklps %ymm3, %ymm2, %ymm6
+ vunpckhps %ymm3, %ymm2, %ymm2
+ vunpcklps %ymm5, %ymm4, %ymm7
+ vunpckhps %ymm5, %ymm4, %ymm3
+ vaddps %ymm6, %ymm2, %ymm2
+ vaddps %ymm7, %ymm3, %ymm3
+
+ vunpcklpd %ymm1, %ymm0, %ymm4
+ vunpckhpd %ymm1, %ymm0, %ymm0
+ vunpcklpd %ymm3, %ymm2, %ymm5
+ vunpckhpd %ymm3, %ymm2, %ymm1
+ vaddps %ymm0, %ymm4, %ymm0
+ vaddps %ymm1, %ymm5, %ymm1
+ vperm2f128 $0x20, %ymm1, %ymm0, %ymm2
+ vperm2f128 $0x31, %ymm1, %ymm0, %ymm3
+ vaddps %ymm3, %ymm2, %ymm0
+ vcmpnleps maxmin_avx(%rip), %ymm0, %ymm1
+ vcmpltps 32+maxmin_avx(%rip), %ymm0, %ymm2
+ vextractf128 $0x1, %ymm1, %xmm3
+ vextractf128 $0x1, %ymm2, %xmm4
+ vpackssdw %xmm2, %xmm1, %xmm1
+ vpackssdw %xmm4, %xmm3, %xmm3
+ vpaddw %xmm3, %xmm1, %xmm1
+ vpaddw %xmm1, %xmm14, %xmm14
+ vcvtps2dq %ymm0, %ymm0
+ vextractf128 $0x1, %ymm0, %xmm1
+ vpackssdw %xmm1, %xmm0, %xmm0
+
+ vmovups %xmm0, (SAMPLES)
+ add $16, SAMPLES
+ dec %ecx
+ jnz 1b
+
+ vzeroupper
+
+ pxor %xmm1, %xmm1
+ psubw %xmm14, %xmm1
+ pshufd $0x4e, %xmm1, %xmm0
+ paddw %xmm1, %xmm0
+ pshuflw $0x4e, %xmm0, %xmm1
+ paddw %xmm1, %xmm0
+ pshuflw $0x11, %xmm0, %xmm1
+ paddw %xmm1, %xmm0
+ movd %xmm0, %eax
+ and $0x7f, %eax
+
+#ifdef IS_MSABI
+ movaps (%rsp), %xmm6
+ movaps 16(%rsp), %xmm7
+ movaps 32(%rsp), %xmm8
+ movaps 48(%rsp), %xmm9
+ movaps 64(%rsp), %xmm10
+ movaps 80(%rsp), %xmm11
+ movaps 96(%rsp), %xmm12
+ movaps 112(%rsp), %xmm13
+ movaps 128(%rsp), %xmm14
+ mov %rbp, %rsp
+ pop %rbp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_avx_float.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_avx_float.S
new file mode 100644
index 00000000..955ec71d
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_avx_float.S
@@ -0,0 +1,243 @@
+/*
+ synth_stereo_avx_float: AVX optimized synth for x86-64 (stereo specific, float output version)
+
+ copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifdef IS_MSABI
+/* real *window; */
+#define WINDOW %r10
+/* real *b0l; */
+#define B0L %rdx
+/* real *b0r; */
+#define B0R %r8
+/* real *samples; */
+#define SAMPLES %r9
+#else
+/* real *window; */
+#define WINDOW %rdi
+/* real *b0l; */
+#define B0L %rsi
+/* real *b0r; */
+#define B0R %rdx
+/* real *samples; */
+#define SAMPLES %r9
+#endif
+
+/*
+ int synth_1to1_real_s_avx_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
+ return value: number of clipped samples (0)
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+scale_avx:
+ .long 939524096
+ .text
+ ALIGN16
+ .globl ASM_NAME(synth_1to1_real_s_avx_asm)
+ASM_NAME(synth_1to1_real_s_avx_asm):
+#ifdef IS_MSABI /* should save xmm6-15 */
+ push %rbp
+ mov %rsp, %rbp
+ sub $144, %rsp
+ movaps %xmm6, (%rsp)
+ movaps %xmm7, 16(%rsp)
+ movaps %xmm8, 32(%rsp)
+ movaps %xmm9, 48(%rsp)
+ movaps %xmm10, 64(%rsp)
+ movaps %xmm11, 80(%rsp)
+ movaps %xmm12, 96(%rsp)
+ movaps %xmm13, 112(%rsp)
+ movaps %xmm14, 128(%rsp)
+ movl 48(%rbp), %eax /* 5th argument; placed after 32-byte shadow space */
+#endif
+
+ vbroadcastss scale_avx(%rip), %ymm14
+
+#ifdef IS_MSABI
+ shl $2, %eax
+ mov %rcx, WINDOW
+#else
+ mov %r8d, %eax
+ shl $2, %eax
+ mov %rcx, SAMPLES
+#endif
+ add $64, WINDOW
+ sub %rax, WINDOW
+
+ mov $128, %rax
+ mov $4, %ecx
+
+ ALIGN16
+1:
+ vmovups (WINDOW), %ymm8
+ vmovups 32(WINDOW), %ymm9
+ vmovups (WINDOW,%rax), %ymm10
+ vmovups 32(WINDOW,%rax), %ymm11
+ vmulps (B0L), %ymm8, %ymm0
+ vmulps 32(B0L), %ymm9, %ymm1
+ vmulps (B0R), %ymm8, %ymm2
+ vmulps 32(B0R), %ymm9, %ymm3
+ vmulps 64(B0L), %ymm10, %ymm4
+ vmulps 96(B0L), %ymm11, %ymm5
+ vmulps 64(B0R), %ymm10, %ymm6
+ vmulps 96(B0R), %ymm11, %ymm7
+ vaddps %ymm1, %ymm0, %ymm8
+ vaddps %ymm3, %ymm2, %ymm0
+ vaddps %ymm5, %ymm4, %ymm9
+ vaddps %ymm7, %ymm6, %ymm1
+ lea (WINDOW,%rax,2), WINDOW
+ add %rax, B0L
+ add %rax, B0R
+
+ vmovups (WINDOW), %ymm10
+ vmovups 32(WINDOW), %ymm11
+ vmovups (WINDOW,%rax), %ymm12
+ vmovups 32(WINDOW,%rax), %ymm13
+ vmulps (B0L), %ymm10, %ymm2
+ vmulps 32(B0L), %ymm11, %ymm3
+ vmulps (B0R), %ymm10, %ymm4
+ vmulps 32(B0R), %ymm11, %ymm5
+ vmulps 64(B0L), %ymm12, %ymm6
+ vmulps 96(B0L), %ymm13, %ymm10
+ vmulps 64(B0R), %ymm12, %ymm7
+ vmulps 96(B0R), %ymm13, %ymm11
+ vaddps %ymm3, %ymm2, %ymm2
+ vaddps %ymm5, %ymm4, %ymm3
+ vaddps %ymm6, %ymm10, %ymm4
+ vaddps %ymm7, %ymm11, %ymm5
+ lea (WINDOW,%rax,2), WINDOW
+ add %rax, B0L
+ add %rax, B0R
+
+ vunpcklps %ymm0, %ymm8, %ymm6
+ vunpckhps %ymm0, %ymm8, %ymm0
+ vunpcklps %ymm1, %ymm9, %ymm7
+ vunpckhps %ymm1, %ymm9, %ymm1
+ vaddps %ymm6, %ymm0, %ymm0
+ vaddps %ymm7, %ymm1, %ymm1
+ vunpcklps %ymm3, %ymm2, %ymm6
+ vunpckhps %ymm3, %ymm2, %ymm2
+ vunpcklps %ymm5, %ymm4, %ymm7
+ vunpckhps %ymm5, %ymm4, %ymm3
+ vaddps %ymm6, %ymm2, %ymm2
+ vaddps %ymm7, %ymm3, %ymm3
+
+ vunpcklpd %ymm1, %ymm0, %ymm4
+ vunpckhpd %ymm1, %ymm0, %ymm0
+ vunpcklpd %ymm3, %ymm2, %ymm5
+ vunpckhpd %ymm3, %ymm2, %ymm1
+ vsubps %ymm0, %ymm4, %ymm0
+ vsubps %ymm1, %ymm5, %ymm1
+ vperm2f128 $0x20, %ymm1, %ymm0, %ymm2
+ vperm2f128 $0x31, %ymm1, %ymm0, %ymm3
+ vaddps %ymm3, %ymm2, %ymm0
+ vmulps %ymm14, %ymm0, %ymm0
+
+ vmovups %ymm0, (SAMPLES)
+ add $32, SAMPLES
+ dec %ecx
+ jnz 1b
+
+ mov $4, %ecx
+
+ ALIGN16
+1:
+ vmovups (WINDOW), %ymm8
+ vmovups 32(WINDOW), %ymm9
+ vmovups (WINDOW,%rax), %ymm10
+ vmovups 32(WINDOW,%rax), %ymm11
+ vmulps (B0L), %ymm8, %ymm0
+ vmulps 32(B0L), %ymm9, %ymm1
+ vmulps (B0R), %ymm8, %ymm2
+ vmulps 32(B0R), %ymm9, %ymm3
+ vmulps -64(B0L), %ymm10, %ymm4
+ vmulps -32(B0L), %ymm11, %ymm5
+ vmulps -64(B0R), %ymm10, %ymm6
+ vmulps -32(B0R), %ymm11, %ymm7
+ vaddps %ymm1, %ymm0, %ymm8
+ vaddps %ymm3, %ymm2, %ymm0
+ vaddps %ymm5, %ymm4, %ymm9
+ vaddps %ymm7, %ymm6, %ymm1
+ lea (WINDOW,%rax,2), WINDOW
+ sub %rax, B0L
+ sub %rax, B0R
+
+ vmovups (WINDOW), %ymm10
+ vmovups 32(WINDOW), %ymm11
+ vmovups (WINDOW,%rax), %ymm12
+ vmovups 32(WINDOW,%rax), %ymm13
+ vmulps (B0L), %ymm10, %ymm2
+ vmulps 32(B0L), %ymm11, %ymm3
+ vmulps (B0R), %ymm10, %ymm4
+ vmulps 32(B0R), %ymm11, %ymm5
+ vmulps -64(B0L), %ymm12, %ymm6
+ vmulps -32(B0L), %ymm13, %ymm10
+ vmulps -64(B0R), %ymm12, %ymm7
+ vmulps -32(B0R), %ymm13, %ymm11
+ vaddps %ymm3, %ymm2, %ymm2
+ vaddps %ymm5, %ymm4, %ymm3
+ vaddps %ymm6, %ymm10, %ymm4
+ vaddps %ymm7, %ymm11, %ymm5
+ lea (WINDOW,%rax,2), WINDOW
+ sub %rax, B0L
+ sub %rax, B0R
+
+ vunpcklps %ymm0, %ymm8, %ymm6
+ vunpckhps %ymm0, %ymm8, %ymm0
+ vunpcklps %ymm1, %ymm9, %ymm7
+ vunpckhps %ymm1, %ymm9, %ymm1
+ vaddps %ymm6, %ymm0, %ymm0
+ vaddps %ymm7, %ymm1, %ymm1
+ vunpcklps %ymm3, %ymm2, %ymm6
+ vunpckhps %ymm3, %ymm2, %ymm2
+ vunpcklps %ymm5, %ymm4, %ymm7
+ vunpckhps %ymm5, %ymm4, %ymm3
+ vaddps %ymm6, %ymm2, %ymm2
+ vaddps %ymm7, %ymm3, %ymm3
+
+ vunpcklpd %ymm1, %ymm0, %ymm4
+ vunpckhpd %ymm1, %ymm0, %ymm0
+ vunpcklpd %ymm3, %ymm2, %ymm5
+ vunpckhpd %ymm3, %ymm2, %ymm1
+ vaddps %ymm0, %ymm4, %ymm0
+ vaddps %ymm1, %ymm5, %ymm1
+ vperm2f128 $0x20, %ymm1, %ymm0, %ymm2
+ vperm2f128 $0x31, %ymm1, %ymm0, %ymm3
+ vaddps %ymm3, %ymm2, %ymm0
+ vmulps %ymm14, %ymm0, %ymm0
+
+ vmovups %ymm0, (SAMPLES)
+ add $32, SAMPLES
+ dec %ecx
+ jnz 1b
+
+ vzeroupper
+
+ xor %eax, %eax
+
+#ifdef IS_MSABI
+ movaps (%rsp), %xmm6
+ movaps 16(%rsp), %xmm7
+ movaps 32(%rsp), %xmm8
+ movaps 48(%rsp), %xmm9
+ movaps 64(%rsp), %xmm10
+ movaps 80(%rsp), %xmm11
+ movaps 96(%rsp), %xmm12
+ movaps 112(%rsp), %xmm13
+ movaps 128(%rsp), %xmm14
+ mov %rbp, %rsp
+ pop %rbp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_avx_s32.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_avx_s32.S
new file mode 100644
index 00000000..8f1e9a6a
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_avx_s32.S
@@ -0,0 +1,292 @@
+/*
+ synth_stereo_avx_s32: AVX optimized synth for x86-64 (stereo specific, s32 output version)
+
+ copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifdef IS_MSABI
+/* real *window; */
+#define WINDOW %r10
+/* real *b0l; */
+#define B0L %rdx
+/* real *b0r; */
+#define B0R %r8
+/* real *samples; */
+#define SAMPLES %r9
+#else
+/* real *window; */
+#define WINDOW %rdi
+/* real *b0l; */
+#define B0L %rsi
+/* real *b0r; */
+#define B0R %rdx
+/* real *samples; */
+#define SAMPLES %r9
+#endif
+
+/*
+ int synth_1to1_s32_s_avx_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+maxmin_avx:
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .long -956301312
+scale_avx:
+ .long 1199570944
+ .text
+ ALIGN16
+ .globl ASM_NAME(synth_1to1_s32_s_avx_asm)
+ASM_NAME(synth_1to1_s32_s_avx_asm):
+#ifdef IS_MSABI /* should save xmm6-15 */
+ push %rbp
+ mov %rsp, %rbp
+ sub $160, %rsp
+ movaps %xmm6, (%rsp)
+ movaps %xmm7, 16(%rsp)
+ movaps %xmm8, 32(%rsp)
+ movaps %xmm9, 48(%rsp)
+ movaps %xmm10, 64(%rsp)
+ movaps %xmm11, 80(%rsp)
+ movaps %xmm12, 96(%rsp)
+ movaps %xmm13, 112(%rsp)
+ movaps %xmm14, 128(%rsp)
+ movaps %xmm15, 144(%rsp)
+ movl 48(%rbp), %eax /* 5th argument; placed after 32-byte shadow space */
+#endif
+
+ vbroadcastss scale_avx(%rip), %ymm14
+
+#ifdef IS_MSABI
+ shl $2, %eax
+ mov %rcx, WINDOW
+#else
+ mov %r8d, %eax
+ shl $2, %eax
+ mov %rcx, SAMPLES
+#endif
+ add $64, WINDOW
+ sub %rax, WINDOW
+
+ mov $128, %rax
+ mov $4, %ecx
+ vpxor %xmm15, %xmm15, %xmm15
+
+ ALIGN16
+1:
+ vmovups (WINDOW), %ymm8
+ vmovups 32(WINDOW), %ymm9
+ vmovups (WINDOW,%rax), %ymm10
+ vmovups 32(WINDOW,%rax), %ymm11
+ vmulps (B0L), %ymm8, %ymm0
+ vmulps 32(B0L), %ymm9, %ymm1
+ vmulps (B0R), %ymm8, %ymm2
+ vmulps 32(B0R), %ymm9, %ymm3
+ vmulps 64(B0L), %ymm10, %ymm4
+ vmulps 96(B0L), %ymm11, %ymm5
+ vmulps 64(B0R), %ymm10, %ymm6
+ vmulps 96(B0R), %ymm11, %ymm7
+ vaddps %ymm1, %ymm0, %ymm8
+ vaddps %ymm3, %ymm2, %ymm0
+ vaddps %ymm5, %ymm4, %ymm9
+ vaddps %ymm7, %ymm6, %ymm1
+ lea (WINDOW,%rax,2), WINDOW
+ add %rax, B0L
+ add %rax, B0R
+
+ vmovups (WINDOW), %ymm10
+ vmovups 32(WINDOW), %ymm11
+ vmovups (WINDOW,%rax), %ymm12
+ vmovups 32(WINDOW,%rax), %ymm13
+ vmulps (B0L), %ymm10, %ymm2
+ vmulps 32(B0L), %ymm11, %ymm3
+ vmulps (B0R), %ymm10, %ymm4
+ vmulps 32(B0R), %ymm11, %ymm5
+ vmulps 64(B0L), %ymm12, %ymm6
+ vmulps 96(B0L), %ymm13, %ymm10
+ vmulps 64(B0R), %ymm12, %ymm7
+ vmulps 96(B0R), %ymm13, %ymm11
+ vaddps %ymm3, %ymm2, %ymm2
+ vaddps %ymm5, %ymm4, %ymm3
+ vaddps %ymm6, %ymm10, %ymm4
+ vaddps %ymm7, %ymm11, %ymm5
+ lea (WINDOW,%rax,2), WINDOW
+ add %rax, B0L
+ add %rax, B0R
+
+ vunpcklps %ymm0, %ymm8, %ymm6
+ vunpckhps %ymm0, %ymm8, %ymm0
+ vunpcklps %ymm1, %ymm9, %ymm7
+ vunpckhps %ymm1, %ymm9, %ymm1
+ vaddps %ymm6, %ymm0, %ymm0
+ vaddps %ymm7, %ymm1, %ymm1
+ vunpcklps %ymm3, %ymm2, %ymm6
+ vunpckhps %ymm3, %ymm2, %ymm2
+ vunpcklps %ymm5, %ymm4, %ymm7
+ vunpckhps %ymm5, %ymm4, %ymm3
+ vaddps %ymm6, %ymm2, %ymm2
+ vaddps %ymm7, %ymm3, %ymm3
+
+ vunpcklpd %ymm1, %ymm0, %ymm4
+ vunpckhpd %ymm1, %ymm0, %ymm0
+ vunpcklpd %ymm3, %ymm2, %ymm5
+ vunpckhpd %ymm3, %ymm2, %ymm1
+ vsubps %ymm0, %ymm4, %ymm0
+ vsubps %ymm1, %ymm5, %ymm1
+ vperm2f128 $0x20, %ymm1, %ymm0, %ymm2
+ vperm2f128 $0x31, %ymm1, %ymm0, %ymm3
+ vaddps %ymm3, %ymm2, %ymm0
+ vcmpnleps maxmin_avx(%rip), %ymm0, %ymm1
+ vcmpltps 32+maxmin_avx(%rip), %ymm0, %ymm2
+ vmulps %ymm14, %ymm0, %ymm0
+ vextractf128 $0x1, %ymm1, %xmm3
+ vextractf128 $0x1, %ymm2, %xmm4
+ vpackssdw %xmm2, %xmm1, %xmm5
+ vpackssdw %xmm4, %xmm3, %xmm3
+ vcvtps2dq %ymm0, %ymm0
+ vpaddw %xmm3, %xmm5, %xmm5
+ vpaddw %xmm5, %xmm15, %xmm15
+ vxorps %ymm1, %ymm0, %ymm0
+
+ vmovups %ymm0, (SAMPLES)
+ add $32, SAMPLES
+ dec %ecx
+ jnz 1b
+
+ mov $4, %ecx
+
+ ALIGN16
+1:
+ vmovups (WINDOW), %ymm8
+ vmovups 32(WINDOW), %ymm9
+ vmovups (WINDOW,%rax), %ymm10
+ vmovups 32(WINDOW,%rax), %ymm11
+ vmulps (B0L), %ymm8, %ymm0
+ vmulps 32(B0L), %ymm9, %ymm1
+ vmulps (B0R), %ymm8, %ymm2
+ vmulps 32(B0R), %ymm9, %ymm3
+ vmulps -64(B0L), %ymm10, %ymm4
+ vmulps -32(B0L), %ymm11, %ymm5
+ vmulps -64(B0R), %ymm10, %ymm6
+ vmulps -32(B0R), %ymm11, %ymm7
+ vaddps %ymm1, %ymm0, %ymm8
+ vaddps %ymm3, %ymm2, %ymm0
+ vaddps %ymm5, %ymm4, %ymm9
+ vaddps %ymm7, %ymm6, %ymm1
+ lea (WINDOW,%rax,2), WINDOW
+ sub %rax, B0L
+ sub %rax, B0R
+
+ vmovups (WINDOW), %ymm10
+ vmovups 32(WINDOW), %ymm11
+ vmovups (WINDOW,%rax), %ymm12
+ vmovups 32(WINDOW,%rax), %ymm13
+ vmulps (B0L), %ymm10, %ymm2
+ vmulps 32(B0L), %ymm11, %ymm3
+ vmulps (B0R), %ymm10, %ymm4
+ vmulps 32(B0R), %ymm11, %ymm5
+ vmulps -64(B0L), %ymm12, %ymm6
+ vmulps -32(B0L), %ymm13, %ymm10
+ vmulps -64(B0R), %ymm12, %ymm7
+ vmulps -32(B0R), %ymm13, %ymm11
+ vaddps %ymm3, %ymm2, %ymm2
+ vaddps %ymm5, %ymm4, %ymm3
+ vaddps %ymm6, %ymm10, %ymm4
+ vaddps %ymm7, %ymm11, %ymm5
+ lea (WINDOW,%rax,2), WINDOW
+ sub %rax, B0L
+ sub %rax, B0R
+
+ vunpcklps %ymm0, %ymm8, %ymm6
+ vunpckhps %ymm0, %ymm8, %ymm0
+ vunpcklps %ymm1, %ymm9, %ymm7
+ vunpckhps %ymm1, %ymm9, %ymm1
+ vaddps %ymm6, %ymm0, %ymm0
+ vaddps %ymm7, %ymm1, %ymm1
+ vunpcklps %ymm3, %ymm2, %ymm6
+ vunpckhps %ymm3, %ymm2, %ymm2
+ vunpcklps %ymm5, %ymm4, %ymm7
+ vunpckhps %ymm5, %ymm4, %ymm3
+ vaddps %ymm6, %ymm2, %ymm2
+ vaddps %ymm7, %ymm3, %ymm3
+
+ vunpcklpd %ymm1, %ymm0, %ymm4
+ vunpckhpd %ymm1, %ymm0, %ymm0
+ vunpcklpd %ymm3, %ymm2, %ymm5
+ vunpckhpd %ymm3, %ymm2, %ymm1
+ vaddps %ymm0, %ymm4, %ymm0
+ vaddps %ymm1, %ymm5, %ymm1
+ vperm2f128 $0x20, %ymm1, %ymm0, %ymm2
+ vperm2f128 $0x31, %ymm1, %ymm0, %ymm3
+ vaddps %ymm3, %ymm2, %ymm0
+ vcmpnleps maxmin_avx(%rip), %ymm0, %ymm1
+ vcmpltps 32+maxmin_avx(%rip), %ymm0, %ymm2
+ vmulps %ymm14, %ymm0, %ymm0
+ vextractf128 $0x1, %ymm1, %xmm3
+ vextractf128 $0x1, %ymm2, %xmm4
+ vpackssdw %xmm2, %xmm1, %xmm5
+ vpackssdw %xmm4, %xmm3, %xmm3
+ vcvtps2dq %ymm0, %ymm0
+ vpaddw %xmm3, %xmm5, %xmm5
+ vpaddw %xmm5, %xmm15, %xmm15
+ vxorps %ymm1, %ymm0, %ymm0
+
+ vmovups %ymm0, (SAMPLES)
+ add $32, SAMPLES
+ dec %ecx
+ jnz 1b
+
+ vzeroupper
+
+ pxor %xmm1, %xmm1
+ psubw %xmm15, %xmm1
+ pshufd $0x4e, %xmm1, %xmm0
+ paddw %xmm1, %xmm0
+ pshuflw $0x4e, %xmm0, %xmm1
+ paddw %xmm1, %xmm0
+ pshuflw $0x11, %xmm0, %xmm1
+ paddw %xmm1, %xmm0
+ movd %xmm0, %eax
+ and $0x7f, %eax
+
+#ifdef IS_MSABI
+ movaps (%rsp), %xmm6
+ movaps 16(%rsp), %xmm7
+ movaps 32(%rsp), %xmm8
+ movaps 48(%rsp), %xmm9
+ movaps 64(%rsp), %xmm10
+ movaps 80(%rsp), %xmm11
+ movaps 96(%rsp), %xmm12
+ movaps 112(%rsp), %xmm13
+ movaps 128(%rsp), %xmm14
+ movaps 144(%rsp), %xmm15
+ mov %rbp, %rsp
+ pop %rbp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon.S
new file mode 100644
index 00000000..abb2747e
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon.S
@@ -0,0 +1,187 @@
+/*
+ synth_stereo_neon: ARM NEON optimized synth (stereo specific version)
+
+ copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#define WINDOW r0
+#define B0L r1
+#define B0R r2
+#define SAMPLES r3
+
+/*
+ int synth_1to1_s_neon_asm(short *window, short *b0l, short *b0r, short *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+#ifndef _M_ARM
+ .code 32
+#endif
+#ifndef __APPLE__
+ .fpu neon
+#endif
+
+ .text
+ GLOBAL_SYMBOL ASM_NAME(synth_1to1_s_neon_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_s_neon_asm), %function
+#endif
+ ALIGN4
+ASM_NAME(synth_1to1_s_neon_asm):
+ push {r4-r6, lr}
+ vpush {q4-q7}
+
+ ldr r4, [sp, #80]
+ add WINDOW, WINDOW, #32
+ sub WINDOW, WINDOW, r4, lsl #1
+
+ mov r4, #4
+ mov r5, #64
+1:
+ vld1.16 {d0-d3}, [WINDOW], r5
+ vld1.16 {d4-d7}, [WINDOW], r5
+ vld1.16 {d8-d11}, [B0L, :128]!
+ vld1.16 {d12-d15}, [B0R, :128]!
+ vld1.16 {d16-d19}, [B0L, :128]!
+ vld1.16 {d20-d23}, [B0R, :128]!
+
+ vmull.s16 q12, d0, d8
+ vmull.s16 q13, d0, d12
+ vmull.s16 q14, d4, d16
+ vmull.s16 q15, d4, d20
+ vmlal.s16 q12, d1, d9
+ vmlal.s16 q13, d1, d13
+ vmlal.s16 q14, d5, d17
+ vmlal.s16 q15, d5, d21
+ vmlal.s16 q12, d2, d10
+ vmlal.s16 q13, d2, d14
+ vmlal.s16 q14, d6, d18
+ vmlal.s16 q15, d6, d22
+ vmlal.s16 q12, d3, d11
+ vmlal.s16 q13, d3, d15
+ vmlal.s16 q14, d7, d19
+ vmlal.s16 q15, d7, d23
+ vpadd.i32 d24, d24, d25
+ vpadd.i32 d26, d26, d27
+ vpadd.i32 d28, d28, d29
+ vpadd.i32 d30, d30, d31
+ vpadd.i32 d24, d24, d26
+ vpadd.i32 d25, d28, d30
+ vqrshrn.s32 d0, q12, #13
+ vst1.16 {d0}, [SAMPLES]!
+
+ vld1.16 {d0-d3}, [WINDOW], r5
+ vld1.16 {d4-d7}, [WINDOW], r5
+ vld1.16 {d8-d11}, [B0L, :128]!
+ vld1.16 {d12-d15}, [B0R, :128]!
+ vld1.16 {d16-d19}, [B0L, :128]!
+ vld1.16 {d20-d23}, [B0R, :128]!
+
+ vmull.s16 q12, d0, d8
+ vmull.s16 q13, d0, d12
+ vmull.s16 q14, d4, d16
+ vmull.s16 q15, d4, d20
+ vmlal.s16 q12, d1, d9
+ vmlal.s16 q13, d1, d13
+ vmlal.s16 q14, d5, d17
+ vmlal.s16 q15, d5, d21
+ vmlal.s16 q12, d2, d10
+ vmlal.s16 q13, d2, d14
+ vmlal.s16 q14, d6, d18
+ vmlal.s16 q15, d6, d22
+ vmlal.s16 q12, d3, d11
+ vmlal.s16 q13, d3, d15
+ vmlal.s16 q14, d7, d19
+ vmlal.s16 q15, d7, d23
+ vpadd.i32 d24, d24, d25
+ vpadd.i32 d26, d26, d27
+ vpadd.i32 d28, d28, d29
+ vpadd.i32 d30, d30, d31
+ vpadd.i32 d24, d24, d26
+ vpadd.i32 d25, d28, d30
+ vqrshrn.s32 d0, q12, #13
+ vst1.16 {d0}, [SAMPLES]!
+
+ subs r4, r4, #1
+ bne 1b
+
+ mov r4, #4
+ mov r6, #-32
+1:
+ vld1.16 {d0-d3}, [WINDOW], r5
+ vld1.16 {d4-d7}, [WINDOW], r5
+ vld1.16 {d8-d11}, [B0L, :128], r6
+ vld1.16 {d12-d15}, [B0R, :128], r6
+ vld1.16 {d16-d19}, [B0L, :128], r6
+ vld1.16 {d20-d23}, [B0R, :128], r6
+
+ vmull.s16 q12, d0, d8
+ vmull.s16 q13, d0, d12
+ vmull.s16 q14, d4, d16
+ vmull.s16 q15, d4, d20
+ vmlal.s16 q12, d1, d9
+ vmlal.s16 q13, d1, d13
+ vmlal.s16 q14, d5, d17
+ vmlal.s16 q15, d5, d21
+ vmlal.s16 q12, d2, d10
+ vmlal.s16 q13, d2, d14
+ vmlal.s16 q14, d6, d18
+ vmlal.s16 q15, d6, d22
+ vmlal.s16 q12, d3, d11
+ vmlal.s16 q13, d3, d15
+ vmlal.s16 q14, d7, d19
+ vmlal.s16 q15, d7, d23
+ vpadd.i32 d24, d24, d25
+ vpadd.i32 d26, d26, d27
+ vpadd.i32 d28, d28, d29
+ vpadd.i32 d30, d30, d31
+ vpadd.i32 d24, d24, d26
+ vpadd.i32 d25, d28, d30
+ vqrshrn.s32 d0, q12, #13
+ vst1.16 {d0}, [SAMPLES]!
+
+ vld1.16 {d0-d3}, [WINDOW], r5
+ vld1.16 {d4-d7}, [WINDOW], r5
+ vld1.16 {d8-d11}, [B0L, :128], r6
+ vld1.16 {d12-d15}, [B0R, :128], r6
+ vld1.16 {d16-d19}, [B0L, :128], r6
+ vld1.16 {d20-d23}, [B0R, :128], r6
+
+ vmull.s16 q12, d0, d8
+ vmull.s16 q13, d0, d12
+ vmull.s16 q14, d4, d16
+ vmull.s16 q15, d4, d20
+ vmlal.s16 q12, d1, d9
+ vmlal.s16 q13, d1, d13
+ vmlal.s16 q14, d5, d17
+ vmlal.s16 q15, d5, d21
+ vmlal.s16 q12, d2, d10
+ vmlal.s16 q13, d2, d14
+ vmlal.s16 q14, d6, d18
+ vmlal.s16 q15, d6, d22
+ vmlal.s16 q12, d3, d11
+ vmlal.s16 q13, d3, d15
+ vmlal.s16 q14, d7, d19
+ vmlal.s16 q15, d7, d23
+ vpadd.i32 d24, d24, d25
+ vpadd.i32 d26, d26, d27
+ vpadd.i32 d28, d28, d29
+ vpadd.i32 d30, d30, d31
+ vpadd.i32 d24, d24, d26
+ vpadd.i32 d25, d28, d30
+ vqrshrn.s32 d0, q12, #13
+ vst1.16 {d0}, [SAMPLES]!
+
+ subs r4, r4, #1
+ bne 1b
+
+ mov r0, #0
+
+ vpop {q4-q7}
+ pop {r4-r6, pc}
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon64.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon64.S
new file mode 100644
index 00000000..aeffa6c5
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon64.S
@@ -0,0 +1,185 @@
+/*
+ synth_stereo_neon64: NEON optimized synth for AArch64 (stereo specific version)
+
+ copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+maxmin_s16:
+ .word 32767
+ .word -32768
+ .text
+ ALIGN4
+ .globl ASM_NAME(synth_1to1_s_neon64_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_s_neon64_asm), %function
+#endif
+ASM_NAME(synth_1to1_s_neon64_asm):
+ add x0, x0, #32
+ sub x0, x0, x4, lsl #1
+ eor v30.16b, v30.16b, v30.16b
+ adrp x5, AARCH64_PCREL_HI(maxmin_s16)
+ add x5, x5, AARCH64_PCREL_LO(maxmin_s16)
+ ld2r {v28.4s,v29.4s}, [x5]
+
+ mov w4, #4
+ mov x5, #64
+1:
+ ld1 {v0.8h,v1.8h}, [x0], x5
+ ld1 {v2.8h,v3.8h}, [x0], x5
+ ld1 {v4.8h,v5.8h,v6.8h,v7.8h}, [x1], #64
+ ld1 {v16.8h,v17.8h,v18.8h,v19.8h}, [x2], #64
+
+ smull v24.4s, v0.4h, v4.4h
+ smull v25.4s, v0.4h, v16.4h
+ smull v26.4s, v2.4h, v6.4h
+ smull v27.4s, v2.4h, v18.4h
+ smlal2 v24.4s, v0.8h, v4.8h
+ smlal2 v25.4s, v0.8h, v16.8h
+ smlal2 v26.4s, v2.8h, v6.8h
+ smlal2 v27.4s, v2.8h, v18.8h
+ smlal v24.4s, v1.4h, v5.4h
+ smlal v25.4s, v1.4h, v17.4h
+ smlal v26.4s, v3.4h, v7.4h
+ smlal v27.4s, v3.4h, v19.4h
+ smlal2 v24.4s, v1.8h, v5.8h
+ smlal2 v25.4s, v1.8h, v17.8h
+ smlal2 v26.4s, v3.8h, v7.8h
+ smlal2 v27.4s, v3.8h, v19.8h
+
+ addp v0.4s, v24.4s, v25.4s
+ addp v1.4s, v26.4s, v27.4s
+ addp v0.4s, v0.4s, v1.4s
+ sqrshrn v31.4h, v0.4s, #13
+ cmgt v2.4s, v0.4s, v28.4s
+ cmgt v3.4s, v29.4s, v0.4s
+ add v2.4s, v2.4s, v3.4s
+ add v30.4s, v30.4s, v2.4s
+
+ ld1 {v0.8h,v1.8h}, [x0], x5
+ ld1 {v2.8h,v3.8h}, [x0], x5
+ ld1 {v4.8h,v5.8h,v6.8h,v7.8h}, [x1], #64
+ ld1 {v16.8h,v17.8h,v18.8h,v19.8h}, [x2], #64
+
+ smull v24.4s, v0.4h, v4.4h
+ smull v25.4s, v0.4h, v16.4h
+ smull v26.4s, v2.4h, v6.4h
+ smull v27.4s, v2.4h, v18.4h
+ smlal2 v24.4s, v0.8h, v4.8h
+ smlal2 v25.4s, v0.8h, v16.8h
+ smlal2 v26.4s, v2.8h, v6.8h
+ smlal2 v27.4s, v2.8h, v18.8h
+ smlal v24.4s, v1.4h, v5.4h
+ smlal v25.4s, v1.4h, v17.4h
+ smlal v26.4s, v3.4h, v7.4h
+ smlal v27.4s, v3.4h, v19.4h
+ smlal2 v24.4s, v1.8h, v5.8h
+ smlal2 v25.4s, v1.8h, v17.8h
+ smlal2 v26.4s, v3.8h, v7.8h
+ smlal2 v27.4s, v3.8h, v19.8h
+
+ addp v0.4s, v24.4s, v25.4s
+ addp v1.4s, v26.4s, v27.4s
+ addp v0.4s, v0.4s, v1.4s
+ sqrshrn2 v31.8h, v0.4s, #13
+ cmgt v2.4s, v0.4s, v28.4s
+ cmgt v3.4s, v29.4s, v0.4s
+ add v2.4s, v2.4s, v3.4s
+ add v30.4s, v30.4s, v2.4s
+ st1 {v31.4s}, [x3], #16
+
+ subs w4, w4, #1
+ b.ne 1b
+
+ mov w4, #4
+ mov x6, #-32
+2:
+ ld1 {v0.8h,v1.8h}, [x0], x5
+ ld1 {v2.8h,v3.8h}, [x0], x5
+ ld1 {v4.8h,v5.8h}, [x1], x6
+ ld1 {v6.8h,v7.8h}, [x1], x6
+ ld1 {v16.8h,v17.8h}, [x2], x6
+ ld1 {v18.8h,v19.8h}, [x2], x6
+
+ smull v24.4s, v0.4h, v4.4h
+ smull v25.4s, v0.4h, v16.4h
+ smull v26.4s, v2.4h, v6.4h
+ smull v27.4s, v2.4h, v18.4h
+ smlal2 v24.4s, v0.8h, v4.8h
+ smlal2 v25.4s, v0.8h, v16.8h
+ smlal2 v26.4s, v2.8h, v6.8h
+ smlal2 v27.4s, v2.8h, v18.8h
+ smlal v24.4s, v1.4h, v5.4h
+ smlal v25.4s, v1.4h, v17.4h
+ smlal v26.4s, v3.4h, v7.4h
+ smlal v27.4s, v3.4h, v19.4h
+ smlal2 v24.4s, v1.8h, v5.8h
+ smlal2 v25.4s, v1.8h, v17.8h
+ smlal2 v26.4s, v3.8h, v7.8h
+ smlal2 v27.4s, v3.8h, v19.8h
+
+ addp v0.4s, v24.4s, v25.4s
+ addp v1.4s, v26.4s, v27.4s
+ addp v0.4s, v0.4s, v1.4s
+ sqrshrn v31.4h, v0.4s, #13
+ cmgt v2.4s, v0.4s, v28.4s
+ cmgt v3.4s, v29.4s, v0.4s
+ add v2.4s, v2.4s, v3.4s
+ add v30.4s, v30.4s, v2.4s
+
+ ld1 {v0.8h,v1.8h}, [x0], x5
+ ld1 {v2.8h,v3.8h}, [x0], x5
+ ld1 {v4.8h,v5.8h}, [x1], x6
+ ld1 {v6.8h,v7.8h}, [x1], x6
+ ld1 {v16.8h,v17.8h}, [x2], x6
+ ld1 {v18.8h,v19.8h}, [x2], x6
+
+ smull v24.4s, v0.4h, v4.4h
+ smull v25.4s, v0.4h, v16.4h
+ smull v26.4s, v2.4h, v6.4h
+ smull v27.4s, v2.4h, v18.4h
+ smlal2 v24.4s, v0.8h, v4.8h
+ smlal2 v25.4s, v0.8h, v16.8h
+ smlal2 v26.4s, v2.8h, v6.8h
+ smlal2 v27.4s, v2.8h, v18.8h
+ smlal v24.4s, v1.4h, v5.4h
+ smlal v25.4s, v1.4h, v17.4h
+ smlal v26.4s, v3.4h, v7.4h
+ smlal v27.4s, v3.4h, v19.4h
+ smlal2 v24.4s, v1.8h, v5.8h
+ smlal2 v25.4s, v1.8h, v17.8h
+ smlal2 v26.4s, v3.8h, v7.8h
+ smlal2 v27.4s, v3.8h, v19.8h
+
+ addp v0.4s, v24.4s, v25.4s
+ addp v1.4s, v26.4s, v27.4s
+ addp v0.4s, v0.4s, v1.4s
+ sqrshrn2 v31.8h, v0.4s, #13
+ cmgt v2.4s, v0.4s, v28.4s
+ cmgt v3.4s, v29.4s, v0.4s
+ add v2.4s, v2.4s, v3.4s
+ add v30.4s, v30.4s, v2.4s
+ st1 {v31.4s}, [x3], #16
+
+ subs w4, w4, #1
+ b.ne 2b
+
+ AARCH64_DUP_2D(v0, v30, 1)
+ add v0.4s, v0.4s, v30.4s
+ AARCH64_DUP_4S(v1, v0, 1)
+ add v0.4s, v0.4s, v1.4s
+ umov w0, v0.s[0]
+ neg w0, w0
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon64_accurate.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon64_accurate.S
new file mode 100644
index 00000000..2e79fc64
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon64_accurate.S
@@ -0,0 +1,200 @@
+/*
+ synth_stereo_neon64_accurate: NEON optimized synth for AArch64 (stereo specific, MPEG-compliant 16bit output version)
+
+ copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+maxmin_s16:
+ .word 1191181824
+ .word -956301312
+ .text
+ ALIGN4
+ .globl ASM_NAME(synth_1to1_s_neon64_accurate_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_s_neon64_accurate_asm), %function
+#endif
+ASM_NAME(synth_1to1_s_neon64_accurate_asm):
+ add x0, x0, #64
+ sub x0, x0, x4, lsl #2
+ eor v30.16b, v30.16b, v30.16b
+ adrp x5, AARCH64_PCREL_HI(maxmin_s16)
+ add x5, x5, AARCH64_PCREL_LO(maxmin_s16)
+ ld2r {v28.4s,v29.4s}, [x5]
+ sub sp, sp, #32
+ st1 {v8.2s,v9.2s,v10.2s,v11.2s}, [sp]
+ sub sp, sp, #32
+ st1 {v12.2s,v13.2s,v14.2s,v15.2s}, [sp]
+
+ mov w4, #4
+ mov x5, #128
+1:
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], #64
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x2], #64
+ ld1 {v8.4s,v9.4s,v10.4s,v11.4s}, [x1], #64
+ ld1 {v12.4s,v13.4s,v14.4s,v15.4s}, [x2], #64
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v0.4s, v20.4s
+ fmul v26.4s, v4.4s, v8.4s
+ fmul v27.4s, v4.4s, v12.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v1.4s, v21.4s
+ fmla v26.4s, v5.4s, v9.4s
+ fmla v27.4s, v5.4s, v13.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v2.4s, v22.4s
+ fmla v26.4s, v6.4s, v10.4s
+ fmla v27.4s, v6.4s, v14.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v3.4s, v23.4s
+ fmla v26.4s, v7.4s, v11.4s
+ fmla v27.4s, v7.4s, v15.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ fcvtns v1.4s, v0.4s
+ fcmgt v2.4s, v0.4s, v28.4s
+ fcmgt v3.4s, v29.4s, v0.4s
+ sqxtn v31.4h, v1.4s
+ add v2.4s, v2.4s, v3.4s
+ add v30.4s, v30.4s, v2.4s
+
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], #64
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x2], #64
+ ld1 {v8.4s,v9.4s,v10.4s,v11.4s}, [x1], #64
+ ld1 {v12.4s,v13.4s,v14.4s,v15.4s}, [x2], #64
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v0.4s, v20.4s
+ fmul v26.4s, v4.4s, v8.4s
+ fmul v27.4s, v4.4s, v12.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v1.4s, v21.4s
+ fmla v26.4s, v5.4s, v9.4s
+ fmla v27.4s, v5.4s, v13.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v2.4s, v22.4s
+ fmla v26.4s, v6.4s, v10.4s
+ fmla v27.4s, v6.4s, v14.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v3.4s, v23.4s
+ fmla v26.4s, v7.4s, v11.4s
+ fmla v27.4s, v7.4s, v15.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ fcvtns v1.4s, v0.4s
+ fcmgt v2.4s, v0.4s, v28.4s
+ fcmgt v3.4s, v29.4s, v0.4s
+ AARCH64_SQXTN2_8H(v31, v1)
+ add v2.4s, v2.4s, v3.4s
+ add v30.4s, v30.4s, v2.4s
+ st1 {v31.4s}, [x3], #16
+
+ subs w4, w4, #1
+ b.ne 1b
+
+ mov w4, #4
+ mov x6, #-64
+2:
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], x6
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x2], x6
+ ld1 {v8.4s,v9.4s,v10.4s,v11.4s}, [x1], x6
+ ld1 {v12.4s,v13.4s,v14.4s,v15.4s}, [x2], x6
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v0.4s, v20.4s
+ fmul v26.4s, v4.4s, v8.4s
+ fmul v27.4s, v4.4s, v12.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v1.4s, v21.4s
+ fmla v26.4s, v5.4s, v9.4s
+ fmla v27.4s, v5.4s, v13.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v2.4s, v22.4s
+ fmla v26.4s, v6.4s, v10.4s
+ fmla v27.4s, v6.4s, v14.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v3.4s, v23.4s
+ fmla v26.4s, v7.4s, v11.4s
+ fmla v27.4s, v7.4s, v15.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ fcvtns v1.4s, v0.4s
+ fcmgt v2.4s, v0.4s, v28.4s
+ fcmgt v3.4s, v29.4s, v0.4s
+ sqxtn v31.4h, v1.4s
+ add v2.4s, v2.4s, v3.4s
+ add v30.4s, v30.4s, v2.4s
+
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], x6
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x2], x6
+ ld1 {v8.4s,v9.4s,v10.4s,v11.4s}, [x1], x6
+ ld1 {v12.4s,v13.4s,v14.4s,v15.4s}, [x2], x6
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v0.4s, v20.4s
+ fmul v26.4s, v4.4s, v8.4s
+ fmul v27.4s, v4.4s, v12.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v1.4s, v21.4s
+ fmla v26.4s, v5.4s, v9.4s
+ fmla v27.4s, v5.4s, v13.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v2.4s, v22.4s
+ fmla v26.4s, v6.4s, v10.4s
+ fmla v27.4s, v6.4s, v14.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v3.4s, v23.4s
+ fmla v26.4s, v7.4s, v11.4s
+ fmla v27.4s, v7.4s, v15.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ fcvtns v1.4s, v0.4s
+ fcmgt v2.4s, v0.4s, v28.4s
+ fcmgt v3.4s, v29.4s, v0.4s
+ AARCH64_SQXTN2_8H(v31, v1)
+ add v2.4s, v2.4s, v3.4s
+ add v30.4s, v30.4s, v2.4s
+ st1 {v31.4s}, [x3], #16
+
+ subs w4, w4, #1
+ b.ne 2b
+
+ AARCH64_DUP_2D(v0, v30, 1)
+ add v0.4s, v0.4s, v30.4s
+ AARCH64_DUP_4S(v1, v0, 1)
+ add v0.4s, v0.4s, v1.4s
+ umov w0, v0.s[0]
+ neg w0, w0
+
+ ld1 {v12.2s,v13.2s,v14.2s,v15.2s}, [sp], #32
+ ld1 {v8.2s,v9.2s,v10.2s,v11.2s}, [sp], #32
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon64_float.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon64_float.S
new file mode 100644
index 00000000..aec656c2
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon64_float.S
@@ -0,0 +1,174 @@
+/*
+ synth_stereo_neon64_float: NEON optimized synth for AArch64 (stereo specific, float output version)
+
+ copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+scale:
+ .word 939524096
+ .text
+ ALIGN4
+ .globl ASM_NAME(synth_1to1_real_s_neon64_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_real_s_neon64_asm), %function
+#endif
+ASM_NAME(synth_1to1_real_s_neon64_asm):
+ add x0, x0, #64
+ sub x0, x0, x4, lsl #2
+ adrp x5, AARCH64_PCREL_HI(scale)
+ add x5, x5, AARCH64_PCREL_LO(scale)
+ ld1r {v28.4s}, [x5]
+ sub sp, sp, #32
+ st1 {v8.2s,v9.2s,v10.2s,v11.2s}, [sp]
+ sub sp, sp, #32
+ st1 {v12.2s,v13.2s,v14.2s,v15.2s}, [sp]
+
+ mov w4, #4
+ mov x5, #128
+1:
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], #64
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x2], #64
+ ld1 {v8.4s,v9.4s,v10.4s,v11.4s}, [x1], #64
+ ld1 {v12.4s,v13.4s,v14.4s,v15.4s}, [x2], #64
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v0.4s, v20.4s
+ fmul v26.4s, v4.4s, v8.4s
+ fmul v27.4s, v4.4s, v12.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v1.4s, v21.4s
+ fmla v26.4s, v5.4s, v9.4s
+ fmla v27.4s, v5.4s, v13.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v2.4s, v22.4s
+ fmla v26.4s, v6.4s, v10.4s
+ fmla v27.4s, v6.4s, v14.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v3.4s, v23.4s
+ fmla v26.4s, v7.4s, v11.4s
+ fmla v27.4s, v7.4s, v15.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ fmul v0.4s, v0.4s, v28.4s
+ st1 {v0.4s}, [x3], #16
+
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], #64
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x2], #64
+ ld1 {v8.4s,v9.4s,v10.4s,v11.4s}, [x1], #64
+ ld1 {v12.4s,v13.4s,v14.4s,v15.4s}, [x2], #64
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v0.4s, v20.4s
+ fmul v26.4s, v4.4s, v8.4s
+ fmul v27.4s, v4.4s, v12.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v1.4s, v21.4s
+ fmla v26.4s, v5.4s, v9.4s
+ fmla v27.4s, v5.4s, v13.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v2.4s, v22.4s
+ fmla v26.4s, v6.4s, v10.4s
+ fmla v27.4s, v6.4s, v14.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v3.4s, v23.4s
+ fmla v26.4s, v7.4s, v11.4s
+ fmla v27.4s, v7.4s, v15.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ fmul v0.4s, v0.4s, v28.4s
+ st1 {v0.4s}, [x3], #16
+
+ subs w4, w4, #1
+ b.ne 1b
+
+ mov w4, #4
+ mov x6, #-64
+2:
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], x6
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x2], x6
+ ld1 {v8.4s,v9.4s,v10.4s,v11.4s}, [x1], x6
+ ld1 {v12.4s,v13.4s,v14.4s,v15.4s}, [x2], x6
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v0.4s, v20.4s
+ fmul v26.4s, v4.4s, v8.4s
+ fmul v27.4s, v4.4s, v12.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v1.4s, v21.4s
+ fmla v26.4s, v5.4s, v9.4s
+ fmla v27.4s, v5.4s, v13.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v2.4s, v22.4s
+ fmla v26.4s, v6.4s, v10.4s
+ fmla v27.4s, v6.4s, v14.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v3.4s, v23.4s
+ fmla v26.4s, v7.4s, v11.4s
+ fmla v27.4s, v7.4s, v15.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ fmul v0.4s, v0.4s, v28.4s
+ st1 {v0.4s}, [x3], #16
+
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], x6
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x2], x6
+ ld1 {v8.4s,v9.4s,v10.4s,v11.4s}, [x1], x6
+ ld1 {v12.4s,v13.4s,v14.4s,v15.4s}, [x2], x6
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v0.4s, v20.4s
+ fmul v26.4s, v4.4s, v8.4s
+ fmul v27.4s, v4.4s, v12.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v1.4s, v21.4s
+ fmla v26.4s, v5.4s, v9.4s
+ fmla v27.4s, v5.4s, v13.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v2.4s, v22.4s
+ fmla v26.4s, v6.4s, v10.4s
+ fmla v27.4s, v6.4s, v14.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v3.4s, v23.4s
+ fmla v26.4s, v7.4s, v11.4s
+ fmla v27.4s, v7.4s, v15.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ fmul v0.4s, v0.4s, v28.4s
+ st1 {v0.4s}, [x3], #16
+
+ subs w4, w4, #1
+ b.ne 2b
+
+ eor w0, w0, w0
+ ld1 {v12.2s,v13.2s,v14.2s,v15.2s}, [sp], #32
+ ld1 {v8.2s,v9.2s,v10.2s,v11.2s}, [sp], #32
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon64_s32.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon64_s32.S
new file mode 100644
index 00000000..52e1d66d
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon64_s32.S
@@ -0,0 +1,203 @@
+/*
+ synth_stereo_neon64_s32: NEON optimized synth for AArch64 (stereo specific, 32bit output version)
+
+ copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN16
+maxmin_s32:
+ .word 1191181824
+ .word -956301312
+ .word 1199570944
+ .text
+ ALIGN4
+ .globl ASM_NAME(synth_1to1_s32_s_neon64_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_s32_s_neon64_asm), %function
+#endif
+ASM_NAME(synth_1to1_s32_s_neon64_asm):
+ add x0, x0, #64
+ sub x0, x0, x4, lsl #2
+ eor v31.16b, v31.16b, v31.16b
+ adrp x5, AARCH64_PCREL_HI(maxmin_s32)
+ add x5, x5, AARCH64_PCREL_LO(maxmin_s32)
+ ld3r {v28.4s,v29.4s,v30.4s}, [x5]
+ sub sp, sp, #32
+ st1 {v8.2s,v9.2s,v10.2s,v11.2s}, [sp]
+ sub sp, sp, #32
+ st1 {v12.2s,v13.2s,v14.2s,v15.2s}, [sp]
+
+ mov w4, #4
+ mov x5, #128
+1:
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], #64
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x2], #64
+ ld1 {v8.4s,v9.4s,v10.4s,v11.4s}, [x1], #64
+ ld1 {v12.4s,v13.4s,v14.4s,v15.4s}, [x2], #64
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v0.4s, v20.4s
+ fmul v26.4s, v4.4s, v8.4s
+ fmul v27.4s, v4.4s, v12.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v1.4s, v21.4s
+ fmla v26.4s, v5.4s, v9.4s
+ fmla v27.4s, v5.4s, v13.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v2.4s, v22.4s
+ fmla v26.4s, v6.4s, v10.4s
+ fmla v27.4s, v6.4s, v14.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v3.4s, v23.4s
+ fmla v26.4s, v7.4s, v11.4s
+ fmla v27.4s, v7.4s, v15.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ fmul v1.4s, v0.4s, v30.4s
+ fcmgt v2.4s, v0.4s, v28.4s
+ fcmgt v3.4s, v29.4s, v0.4s
+ fcvtns v1.4s, v1.4s
+ add v2.4s, v2.4s, v3.4s
+ add v31.4s, v31.4s, v2.4s
+ st1 {v1.4s}, [x3], #16
+
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], #64
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x2], #64
+ ld1 {v8.4s,v9.4s,v10.4s,v11.4s}, [x1], #64
+ ld1 {v12.4s,v13.4s,v14.4s,v15.4s}, [x2], #64
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v0.4s, v20.4s
+ fmul v26.4s, v4.4s, v8.4s
+ fmul v27.4s, v4.4s, v12.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v1.4s, v21.4s
+ fmla v26.4s, v5.4s, v9.4s
+ fmla v27.4s, v5.4s, v13.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v2.4s, v22.4s
+ fmla v26.4s, v6.4s, v10.4s
+ fmla v27.4s, v6.4s, v14.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v3.4s, v23.4s
+ fmla v26.4s, v7.4s, v11.4s
+ fmla v27.4s, v7.4s, v15.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ fmul v1.4s, v0.4s, v30.4s
+ fcmgt v2.4s, v0.4s, v28.4s
+ fcmgt v3.4s, v29.4s, v0.4s
+ fcvtns v1.4s, v1.4s
+ add v2.4s, v2.4s, v3.4s
+ add v31.4s, v31.4s, v2.4s
+ st1 {v1.4s}, [x3], #16
+
+ subs w4, w4, #1
+ b.ne 1b
+
+ mov w4, #4
+ mov x6, #-64
+2:
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], x6
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x2], x6
+ ld1 {v8.4s,v9.4s,v10.4s,v11.4s}, [x1], x6
+ ld1 {v12.4s,v13.4s,v14.4s,v15.4s}, [x2], x6
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v0.4s, v20.4s
+ fmul v26.4s, v4.4s, v8.4s
+ fmul v27.4s, v4.4s, v12.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v1.4s, v21.4s
+ fmla v26.4s, v5.4s, v9.4s
+ fmla v27.4s, v5.4s, v13.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v2.4s, v22.4s
+ fmla v26.4s, v6.4s, v10.4s
+ fmla v27.4s, v6.4s, v14.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v3.4s, v23.4s
+ fmla v26.4s, v7.4s, v11.4s
+ fmla v27.4s, v7.4s, v15.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ fmul v1.4s, v0.4s, v30.4s
+ fcmgt v2.4s, v0.4s, v28.4s
+ fcmgt v3.4s, v29.4s, v0.4s
+ fcvtns v1.4s, v1.4s
+ add v2.4s, v2.4s, v3.4s
+ add v31.4s, v31.4s, v2.4s
+ st1 {v1.4s}, [x3], #16
+
+ ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], x5
+ ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x0], x5
+ ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x1], x6
+ ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x2], x6
+ ld1 {v8.4s,v9.4s,v10.4s,v11.4s}, [x1], x6
+ ld1 {v12.4s,v13.4s,v14.4s,v15.4s}, [x2], x6
+
+ fmul v24.4s, v0.4s, v16.4s
+ fmul v25.4s, v0.4s, v20.4s
+ fmul v26.4s, v4.4s, v8.4s
+ fmul v27.4s, v4.4s, v12.4s
+ fmla v24.4s, v1.4s, v17.4s
+ fmla v25.4s, v1.4s, v21.4s
+ fmla v26.4s, v5.4s, v9.4s
+ fmla v27.4s, v5.4s, v13.4s
+ fmla v24.4s, v2.4s, v18.4s
+ fmla v25.4s, v2.4s, v22.4s
+ fmla v26.4s, v6.4s, v10.4s
+ fmla v27.4s, v6.4s, v14.4s
+ fmla v24.4s, v3.4s, v19.4s
+ fmla v25.4s, v3.4s, v23.4s
+ fmla v26.4s, v7.4s, v11.4s
+ fmla v27.4s, v7.4s, v15.4s
+
+ faddp v0.4s, v24.4s, v25.4s
+ faddp v1.4s, v26.4s, v27.4s
+ faddp v0.4s, v0.4s, v1.4s
+ fmul v1.4s, v0.4s, v30.4s
+ fcmgt v2.4s, v0.4s, v28.4s
+ fcmgt v3.4s, v29.4s, v0.4s
+ fcvtns v1.4s, v1.4s
+ add v2.4s, v2.4s, v3.4s
+ add v31.4s, v31.4s, v2.4s
+ st1 {v1.4s}, [x3], #16
+
+ subs w4, w4, #1
+ b.ne 2b
+
+ AARCH64_DUP_2D(v0, v31, 1)
+ add v0.4s, v0.4s, v31.4s
+ AARCH64_DUP_4S(v1, v0, 1)
+ add v0.4s, v0.4s, v1.4s
+ umov w0, v0.s[0]
+ neg w0, w0
+
+ ld1 {v12.2s,v13.2s,v14.2s,v15.2s}, [sp], #32
+ ld1 {v8.2s,v9.2s,v10.2s,v11.2s}, [sp], #32
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon_accurate.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon_accurate.S
new file mode 100644
index 00000000..37a051c8
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon_accurate.S
@@ -0,0 +1,272 @@
+/*
+ synth_stereo_neon_accurate: ARM NEON optimized synth (stereo specific, MPEG compliant 16-bit output version)
+
+ copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#define WINDOW r0
+#define B0L r1
+#define B0R r2
+#define SAMPLES r3
+
+/*
+ int synth_1to1_s_neon_accurate_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+ .code 32
+#ifndef __APPLE__
+ .fpu neon
+#endif
+
+ .text
+ .globl ASM_NAME(synth_1to1_s_neon_accurate_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_s_neon_accurate_asm), %function
+#endif
+ASM_NAME(synth_1to1_s_neon_accurate_asm):
+ push {r4-r7, lr}
+ vpush {q4-q7}
+ ldr r4, [sp, #84]
+ mov r7, sp
+ sub sp, sp, #16
+ bic sp, #0xff
+
+ add WINDOW, WINDOW, #64
+ sub WINDOW, WINDOW, r4, lsl #2
+
+ mov r4, #4
+ mov r5, #128
+ mov r6, #64
+1:
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vmul.f32 q12, q0, q4
+ vmul.f32 q13, q0, q6
+ vmul.f32 q14, q2, q8
+ vmul.f32 q15, q2, q10
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ sub WINDOW, WINDOW, #96
+ sub B0L, B0L, #32
+ sub B0R, B0R, #32
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]!
+ vld1.32 {q10,q11}, [B0R, :128]!
+ vmla.f32 q12, q0, q4
+ vmla.f32 q13, q0, q6
+ vmla.f32 q14, q2, q8
+ vmla.f32 q15, q2, q10
+ add WINDOW, WINDOW, #96
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vpadd.f32 d26, d28, d29
+ vpadd.f32 d27, d30, d31
+ vmov.i32 q15, #0x4b000000
+ vmvn.i32 q14, #0xb9000000
+ vorr.i32 q15, #0x00400000
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vacgt.f32 q14, q12, q14
+ vadd.f32 q13, q12, q15
+ vld1.32 {q15}, [sp, :128]
+ vshr.u32 q14, q14, #31
+ vshl.i32 q13, q13, #10
+ vadd.i32 q14, q14, q15
+ vqshrn.s32 d26, q13, #10
+ vst1.32 {q14}, [sp, :128]
+ vst1.16 {d26}, [SAMPLES]!
+ vmul.f32 q12, q0, q4
+ vmul.f32 q13, q0, q6
+ vmul.f32 q14, q2, q8
+ vmul.f32 q15, q2, q10
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ sub WINDOW, WINDOW, #96
+ sub B0L, B0L, #32
+ sub B0R, B0R, #32
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]!
+ vld1.32 {q10,q11}, [B0R, :128]!
+ vmla.f32 q12, q0, q4
+ vmla.f32 q13, q0, q6
+ vmla.f32 q14, q2, q8
+ vmla.f32 q15, q2, q10
+ add WINDOW, WINDOW, #96
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vpadd.f32 d26, d28, d29
+ vpadd.f32 d27, d30, d31
+ vmov.i32 q15, #0x4b000000
+ vmvn.i32 q14, #0xb9000000
+ vorr.i32 q15, #0x00400000
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vacgt.f32 q14, q12, q14
+ vadd.f32 q13, q12, q15
+ vld1.32 {q15}, [sp, :128]
+ vshr.u32 q14, q14, #31
+ vshl.i32 q13, q13, #10
+ vadd.i32 q14, q14, q15
+ vqshrn.s32 d26, q13, #10
+ vst1.32 {q14}, [sp, :128]
+ vst1.16 {d26}, [SAMPLES]!
+
+ subs r4, r4, #1
+ bne 1b
+
+ mov r4, #4
+ mov r6, #-64
+1:
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vmul.f32 q12, q0, q4
+ vmul.f32 q13, q0, q6
+ vmul.f32 q14, q2, q8
+ vmul.f32 q15, q2, q10
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ sub WINDOW, WINDOW, #96
+ add B0L, B0L, #96
+ add B0R, B0R, #96
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vmla.f32 q12, q0, q4
+ vmla.f32 q13, q0, q6
+ vmla.f32 q14, q2, q8
+ vmla.f32 q15, q2, q10
+ add WINDOW, WINDOW, #96
+ sub B0L, B0L, #96
+ sub B0R, B0R, #96
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vpadd.f32 d26, d28, d29
+ vpadd.f32 d27, d30, d31
+ vmov.i32 q15, #0x4b000000
+ vmvn.i32 q14, #0xb9000000
+ vorr.i32 q15, #0x00400000
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vacgt.f32 q14, q12, q14
+ vadd.f32 q13, q12, q15
+ vld1.32 {q15}, [sp, :128]
+ vshr.u32 q14, q14, #31
+ vshl.i32 q13, q13, #10
+ vadd.i32 q14, q14, q15
+ vqshrn.s32 d26, q13, #10
+ vst1.32 {q14}, [sp, :128]
+ vst1.16 {d26}, [SAMPLES]!
+ vmul.f32 q12, q0, q4
+ vmul.f32 q13, q0, q6
+ vmul.f32 q14, q2, q8
+ vmul.f32 q15, q2, q10
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ sub WINDOW, WINDOW, #96
+ add B0L, B0L, #96
+ add B0R, B0R, #96
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vmla.f32 q12, q0, q4
+ vmla.f32 q13, q0, q6
+ vmla.f32 q14, q2, q8
+ vmla.f32 q15, q2, q10
+ add WINDOW, WINDOW, #96
+ sub B0L, B0L, #96
+ sub B0R, B0R, #96
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vpadd.f32 d26, d28, d29
+ vpadd.f32 d27, d30, d31
+ vmov.i32 q15, #0x4b000000
+ vmvn.i32 q14, #0xb9000000
+ vorr.i32 q15, #0x00400000
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vacgt.f32 q14, q12, q14
+ vadd.f32 q13, q12, q15
+ vld1.32 {q15}, [sp, :128]
+ vshr.u32 q14, q14, #31
+ vshl.i32 q13, q13, #10
+ vadd.i32 q14, q14, q15
+ vqshrn.s32 d26, q13, #10
+ vst1.32 {q14}, [sp, :128]
+ vst1.16 {d26}, [SAMPLES]!
+
+ subs r4, r4, #1
+ bne 1b
+
+ vld1.32 {q0}, [sp, :128]
+ vpadd.i32 d0, d0, d1
+ vpadd.i32 d0, d0, d0
+ vmov.32 r0, d0[0]
+
+ mov sp, r7
+ vpop {q4-q7}
+ pop {r4-r7, pc}
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon_float.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon_float.S
new file mode 100644
index 00000000..405fa280
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon_float.S
@@ -0,0 +1,232 @@
+/*
+ synth_stereo_neon_float: ARM NEON optimized synth (stereo specific, float output version)
+
+ copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#define WINDOW r0
+#define B0L r1
+#define B0R r2
+#define SAMPLES r3
+
+/*
+ int synth_1to1_real_s_neon_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
+ return value: number of clipped samples (0)
+*/
+
+#ifndef _M_ARM
+ .code 32
+#endif
+#ifndef __APPLE__
+ .fpu neon
+#endif
+
+ .text
+ GLOBAL_SYMBOL ASM_NAME(synth_1to1_real_s_neon_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_real_s_neon_asm), %function
+#endif
+ ALIGN4
+ASM_NAME(synth_1to1_real_s_neon_asm):
+ push {r4-r6, lr}
+ vpush {q4-q7}
+
+ ldr r4, [sp, #80]
+ add WINDOW, WINDOW, #64
+ sub WINDOW, WINDOW, r4, lsl #2
+
+ mov r4, #4
+ mov r5, #128
+ mov r6, #64
+1:
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vmul.f32 q12, q0, q4
+ vmul.f32 q13, q0, q6
+ vmul.f32 q14, q2, q8
+ vmul.f32 q15, q2, q10
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ sub WINDOW, WINDOW, #96
+ sub B0L, B0L, #32
+ sub B0R, B0R, #32
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]!
+ vld1.32 {q10,q11}, [B0R, :128]!
+ vmla.f32 q12, q0, q4
+ vmla.f32 q13, q0, q6
+ vmla.f32 q14, q2, q8
+ vmla.f32 q15, q2, q10
+ add WINDOW, WINDOW, #96
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vpadd.f32 d26, d28, d29
+ vpadd.f32 d27, d30, d31
+ vmov.i32 q14, #0x38000000
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vmul.f32 q15, q12, q14
+ vmul.f32 q12, q0, q4
+ vmul.f32 q13, q0, q6
+ vmul.f32 q14, q2, q8
+ vst1.32 {q15}, [SAMPLES]!
+ vmul.f32 q15, q2, q10
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ sub WINDOW, WINDOW, #96
+ sub B0L, B0L, #32
+ sub B0R, B0R, #32
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]!
+ vld1.32 {q10,q11}, [B0R, :128]!
+ vmla.f32 q12, q0, q4
+ vmla.f32 q13, q0, q6
+ vmla.f32 q14, q2, q8
+ vmla.f32 q15, q2, q10
+ add WINDOW, WINDOW, #96
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vpadd.f32 d26, d28, d29
+ vpadd.f32 d27, d30, d31
+ vmov.i32 q14, #0x38000000
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vmul.f32 q12, q12, q14
+ vst1.32 {q12}, [SAMPLES]!
+
+ subs r4, r4, #1
+ bne 1b
+
+ mov r4, #4
+ mov r6, #-64
+1:
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vmul.f32 q12, q0, q4
+ vmul.f32 q13, q0, q6
+ vmul.f32 q14, q2, q8
+ vmul.f32 q15, q2, q10
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ sub WINDOW, WINDOW, #96
+ add B0L, B0L, #96
+ add B0R, B0R, #96
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vmla.f32 q12, q0, q4
+ vmla.f32 q13, q0, q6
+ vmla.f32 q14, q2, q8
+ vmla.f32 q15, q2, q10
+ add WINDOW, WINDOW, #96
+ sub B0L, B0L, #96
+ sub B0R, B0R, #96
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vpadd.f32 d26, d28, d29
+ vpadd.f32 d27, d30, d31
+ vmov.i32 q14, #0x38000000
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vmul.f32 q15, q12, q14
+ vmul.f32 q12, q0, q4
+ vmul.f32 q13, q0, q6
+ vmul.f32 q14, q2, q8
+ vst1.32 {q15}, [SAMPLES]!
+ vmul.f32 q15, q2, q10
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ sub WINDOW, WINDOW, #96
+ add B0L, B0L, #96
+ add B0R, B0R, #96
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vmla.f32 q12, q0, q4
+ vmla.f32 q13, q0, q6
+ vmla.f32 q14, q2, q8
+ vmla.f32 q15, q2, q10
+ add WINDOW, WINDOW, #96
+ sub B0L, B0L, #96
+ sub B0R, B0R, #96
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vpadd.f32 d26, d28, d29
+ vpadd.f32 d27, d30, d31
+ vmov.i32 q14, #0x38000000
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vmul.f32 q12, q12, q14
+ vst1.32 {q12}, [SAMPLES]!
+
+ subs r4, r4, #1
+ bne 1b
+
+ mov r0, #0
+
+ vpop {q4-q7}
+ pop {r4-r6, pc}
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon_s32.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon_s32.S
new file mode 100644
index 00000000..dfb41147
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_neon_s32.S
@@ -0,0 +1,261 @@
+/*
+ synth_stereo_neon_s32: ARM NEON optimized synth (stereo specific, 32-bit output version)
+
+ copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#define WINDOW r0
+#define B0L r1
+#define B0R r2
+#define SAMPLES r3
+
+/*
+ int synth_1to1_s32_s_neon_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+#ifndef _M_ARM
+ .code 32
+#endif
+#ifndef __APPLE__
+ .fpu neon
+#endif
+
+ .text
+ GLOBAL_SYMBOL ASM_NAME(synth_1to1_s32_s_neon_asm)
+#ifdef __ELF__
+ .type ASM_NAME(synth_1to1_s32_s_neon_asm), %function
+#endif
+ ALIGN4
+ASM_NAME(synth_1to1_s32_s_neon_asm):
+ push {r4-r7, lr}
+ vpush {q4-q7}
+ ldr r4, [sp, #84]
+ mov r7, sp
+ sub sp, sp, #16
+ mov r5, sp
+ and r5, r5, #0xf
+ sub sp, sp, r5
+
+ add WINDOW, WINDOW, #64
+ sub WINDOW, WINDOW, r4, lsl #2
+
+ mov r4, #4
+ mov r5, #128
+ mov r6, #64
+1:
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vmul.f32 q12, q0, q4
+ vmul.f32 q13, q0, q6
+ vmul.f32 q14, q2, q8
+ vmul.f32 q15, q2, q10
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ sub WINDOW, WINDOW, #96
+ sub B0L, B0L, #32
+ sub B0R, B0R, #32
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]!
+ vld1.32 {q10,q11}, [B0R, :128]!
+ vmla.f32 q12, q0, q4
+ vmla.f32 q13, q0, q6
+ vmla.f32 q14, q2, q8
+ vmla.f32 q15, q2, q10
+ add WINDOW, WINDOW, #96
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vpadd.f32 d26, d28, d29
+ vpadd.f32 d27, d30, d31
+ vmvn.i32 q14, #0xb9000000
+ vld1.32 {q15}, [sp, :128]
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vacgt.f32 q14, q12, q14
+ vcvt.s32.f32 q13, q12, #16
+ vshr.u32 q14, q14, #31
+ vst1.32 {q13}, [SAMPLES]!
+ vadd.i32 q14, q14, q15
+ vst1.32 {q14}, [sp, :128]
+ vmul.f32 q12, q0, q4
+ vmul.f32 q13, q0, q6
+ vmul.f32 q14, q2, q8
+ vmul.f32 q15, q2, q10
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ sub WINDOW, WINDOW, #96
+ sub B0L, B0L, #32
+ sub B0R, B0R, #32
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]!
+ vld1.32 {q10,q11}, [B0R, :128]!
+ vmla.f32 q12, q0, q4
+ vmla.f32 q13, q0, q6
+ vmla.f32 q14, q2, q8
+ vmla.f32 q15, q2, q10
+ add WINDOW, WINDOW, #96
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vpadd.f32 d26, d28, d29
+ vpadd.f32 d27, d30, d31
+ vmvn.i32 q14, #0xb9000000
+ vld1.32 {q15}, [sp, :128]
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vacgt.f32 q14, q12, q14
+ vcvt.s32.f32 q13, q12, #16
+ vshr.u32 q14, q14, #31
+ vst1.32 {q13}, [SAMPLES]!
+ vadd.i32 q14, q14, q15
+ vst1.32 {q14}, [sp, :128]
+
+ subs r4, r4, #1
+ bne 1b
+
+ mov r4, #4
+ mov r6, #-64
+1:
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vmul.f32 q12, q0, q4
+ vmul.f32 q13, q0, q6
+ vmul.f32 q14, q2, q8
+ vmul.f32 q15, q2, q10
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ sub WINDOW, WINDOW, #96
+ add B0L, B0L, #96
+ add B0R, B0R, #96
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vmla.f32 q12, q0, q4
+ vmla.f32 q13, q0, q6
+ vmla.f32 q14, q2, q8
+ vmla.f32 q15, q2, q10
+ add WINDOW, WINDOW, #96
+ sub B0L, B0L, #96
+ sub B0R, B0R, #96
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vpadd.f32 d26, d28, d29
+ vpadd.f32 d27, d30, d31
+ vmvn.i32 q14, #0xb9000000
+ vld1.32 {q15}, [sp, :128]
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vacgt.f32 q14, q12, q14
+ vcvt.s32.f32 q13, q12, #16
+ vshr.u32 q14, q14, #31
+ vst1.32 {q13}, [SAMPLES]!
+ vadd.i32 q14, q14, q15
+ vst1.32 {q14}, [sp, :128]
+ vmul.f32 q12, q0, q4
+ vmul.f32 q13, q0, q6
+ vmul.f32 q14, q2, q8
+ vmul.f32 q15, q2, q10
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ sub WINDOW, WINDOW, #96
+ add B0L, B0L, #96
+ add B0R, B0R, #96
+ vld1.32 {q0,q1}, [WINDOW], r5
+ vld1.32 {q2,q3}, [WINDOW]
+ vld1.32 {q4,q5}, [B0L, :128], r6
+ vld1.32 {q6,q7}, [B0R, :128], r6
+ vld1.32 {q8,q9}, [B0L, :128]
+ vld1.32 {q10,q11}, [B0R, :128]
+ vmla.f32 q12, q0, q4
+ vmla.f32 q13, q0, q6
+ vmla.f32 q14, q2, q8
+ vmla.f32 q15, q2, q10
+ add WINDOW, WINDOW, #96
+ sub B0L, B0L, #96
+ sub B0R, B0R, #96
+ vmla.f32 q12, q1, q5
+ vmla.f32 q13, q1, q7
+ vmla.f32 q14, q3, q9
+ vmla.f32 q15, q3, q11
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vpadd.f32 d26, d28, d29
+ vpadd.f32 d27, d30, d31
+ vmvn.i32 q14, #0xb9000000
+ vld1.32 {q15}, [sp, :128]
+ vpadd.f32 d24, d24, d25
+ vpadd.f32 d25, d26, d27
+ vacgt.f32 q14, q12, q14
+ vcvt.s32.f32 q13, q12, #16
+ vshr.u32 q14, q14, #31
+ vst1.32 {q13}, [SAMPLES]!
+ vadd.i32 q14, q14, q15
+ vst1.32 {q14}, [sp, :128]
+
+ subs r4, r4, #1
+ bne 1b
+
+ vld1.32 {q0}, [sp, :128]
+ vpadd.i32 d0, d0, d1
+ vpadd.i32 d0, d0, d0
+ vmov.32 r0, d0[0]
+
+ mov sp, r7
+ vpop {q4-q7}
+ pop {r4-r7, pc}
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_sse_accurate.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_sse_accurate.S
new file mode 100644
index 00000000..c7b36b2e
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_sse_accurate.S
@@ -0,0 +1,512 @@
+/*
+ synth_stereo_sse_accurate: SSE optimized synth (stereo specific, MPEG-compliant 16bit output version)
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+/* real *window; */
+#define WINDOW %ebx
+/* real *b0l; */
+#define B0L %edx
+/* real *b0r; */
+#define B0R %esi
+/* real *samples; */
+#define SAMPLES %edi
+
+#define TEMP(n) (12+16*n)(%esp)
+#define MMREG_CLIP %mm7
+
+/*
+ int synth_1to1_s_sse_accurate_asm(real *window, real *b0l, real *b0r, short *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+#if !defined ( __APPLE__) && !defined (__OS2__)
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+maxmin_s16:
+ .long 1191181824 /* 32767.0 */
+ .long 1191181824
+ .long 1191181824
+ .long 1191181824
+ .long -956301312 /* -32768.0 */
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .text
+ ALIGN16
+.globl ASM_NAME(synth_1to1_s_sse_accurate_asm)
+ASM_NAME(synth_1to1_s_sse_accurate_asm):
+ pushl %ebp
+ movl %esp, %ebp
+ andl $-16, %esp
+ subl $128, %esp
+ pushl %ebx
+ pushl %esi
+ pushl %edi
+
+ pxor MMREG_CLIP, MMREG_CLIP
+
+ movl 8(%ebp), WINDOW
+ movl 12(%ebp), B0L
+ movl 16(%ebp), B0R
+ movl 20(%ebp), SAMPLES
+ movl 24(%ebp), %eax
+ shll $2, %eax
+
+ leal 64(WINDOW), WINDOW
+ subl %eax, WINDOW
+
+ #undef _EBX_
+ #define _EBX_ %eax
+ GET_GOT
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(0)
+ movaps %xmm4, TEMP(4)
+
+ leal 128(WINDOW), WINDOW
+ leal 64(B0L), B0L
+ leal 64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(1)
+ movaps %xmm4, TEMP(5)
+
+ leal 128(WINDOW), WINDOW
+ leal 64(B0L), B0L
+ leal 64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(2)
+ movaps %xmm4, TEMP(6)
+
+ leal 128(WINDOW), WINDOW
+ leal 64(B0L), B0L
+ leal 64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, %xmm7
+ movaps %xmm4, TEMP(7)
+
+ leal 128(WINDOW), WINDOW
+ leal 64(B0L), B0L
+ leal 64(B0R), B0R
+
+ movaps TEMP(0), %xmm4
+ movaps TEMP(1), %xmm5
+ movaps TEMP(2), %xmm6
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ subps %xmm6, %xmm4
+ subps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+ movaps %xmm0, %xmm2
+
+ movaps TEMP(4), %xmm4
+ movaps TEMP(5), %xmm5
+ movaps TEMP(6), %xmm6
+ movaps TEMP(7), %xmm7
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm2, %xmm5
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ subps %xmm6, %xmm4
+ subps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+
+ movaps %xmm5, %xmm1
+ movaps %xmm5, %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm0, %xmm4
+ cmpnleps LOCAL_VAR(maxmin_s16), %xmm1
+ cmpltps 16+LOCAL_VAR(maxmin_s16), %xmm2
+ cmpnleps LOCAL_VAR(maxmin_s16), %xmm3
+ cmpltps 16+LOCAL_VAR(maxmin_s16), %xmm4
+ cvtps2pi %xmm5, %mm0
+ cvtps2pi %xmm0, %mm1
+ movhlps %xmm5, %xmm5
+ movhlps %xmm0, %xmm0
+ cvtps2pi %xmm5, %mm2
+ cvtps2pi %xmm0, %mm3
+ packssdw %mm2, %mm0
+ packssdw %mm3, %mm1
+ movq %mm0, %mm2
+ punpcklwd %mm1, %mm0
+ punpckhwd %mm1, %mm2
+ movq %mm0, (SAMPLES)
+ movq %mm2, 8(SAMPLES)
+
+ cvtps2pi %xmm1, %mm2
+ cvtps2pi %xmm3, %mm3
+ movhlps %xmm1, %xmm1
+ movhlps %xmm3, %xmm3
+ cvtps2pi %xmm1, %mm4
+ cvtps2pi %xmm3, %mm5
+ packssdw %mm4, %mm2
+ packssdw %mm5, %mm3
+ psrlw $15, %mm2
+ psrlw $15, %mm3
+ cvtps2pi %xmm2, %mm0
+ cvtps2pi %xmm4, %mm1
+ movhlps %xmm2, %xmm2
+ movhlps %xmm4, %xmm4
+ cvtps2pi %xmm2, %mm4
+ cvtps2pi %xmm4, %mm5
+ packssdw %mm4, %mm0
+ packssdw %mm5, %mm1
+ psrlw $15, %mm0
+ psrlw $15, %mm1
+ paddw %mm3, %mm2
+ paddw %mm1, %mm0
+ paddw %mm2, %mm0
+ paddw %mm0, MMREG_CLIP
+
+ leal 16(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(0)
+ movaps %xmm4, TEMP(4)
+
+ leal 128(WINDOW), WINDOW
+ leal -64(B0L), B0L
+ leal -64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(1)
+ movaps %xmm4, TEMP(5)
+
+ leal 128(WINDOW), WINDOW
+ leal -64(B0L), B0L
+ leal -64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(2)
+ movaps %xmm4, TEMP(6)
+
+ leal 128(WINDOW), WINDOW
+ leal -64(B0L), B0L
+ leal -64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, %xmm7
+ movaps %xmm4, TEMP(7)
+
+ leal 128(WINDOW), WINDOW
+ leal -64(B0L), B0L
+ leal -64(B0R), B0R
+
+ movaps TEMP(0), %xmm4
+ movaps TEMP(1), %xmm5
+ movaps TEMP(2), %xmm6
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ addps %xmm6, %xmm4
+ addps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+ movaps %xmm0, %xmm2
+
+ movaps TEMP(4), %xmm4
+ movaps TEMP(5), %xmm5
+ movaps TEMP(6), %xmm6
+ movaps TEMP(7), %xmm7
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm2, %xmm5
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ addps %xmm6, %xmm4
+ addps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+
+ movaps %xmm5, %xmm1
+ movaps %xmm5, %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm0, %xmm4
+ cmpnleps LOCAL_VAR(maxmin_s16), %xmm1
+ cmpltps 16+LOCAL_VAR(maxmin_s16), %xmm2
+ cmpnleps LOCAL_VAR(maxmin_s16), %xmm3
+ cmpltps 16+LOCAL_VAR(maxmin_s16), %xmm4
+ cvtps2pi %xmm5, %mm0
+ cvtps2pi %xmm0, %mm1
+ movhlps %xmm5, %xmm5
+ movhlps %xmm0, %xmm0
+ cvtps2pi %xmm5, %mm2
+ cvtps2pi %xmm0, %mm3
+ packssdw %mm2, %mm0
+ packssdw %mm3, %mm1
+ movq %mm0, %mm2
+ punpcklwd %mm1, %mm0
+ punpckhwd %mm1, %mm2
+ movq %mm0, (SAMPLES)
+ movq %mm2, 8(SAMPLES)
+
+ cvtps2pi %xmm1, %mm2
+ cvtps2pi %xmm3, %mm3
+ movhlps %xmm1, %xmm1
+ movhlps %xmm3, %xmm3
+ cvtps2pi %xmm1, %mm4
+ cvtps2pi %xmm3, %mm5
+ packssdw %mm4, %mm2
+ packssdw %mm5, %mm3
+ psrlw $15, %mm2
+ psrlw $15, %mm3
+ cvtps2pi %xmm2, %mm0
+ cvtps2pi %xmm4, %mm1
+ movhlps %xmm2, %xmm2
+ movhlps %xmm4, %xmm4
+ cvtps2pi %xmm2, %mm4
+ cvtps2pi %xmm4, %mm5
+ packssdw %mm4, %mm0
+ packssdw %mm5, %mm1
+ psrlw $15, %mm0
+ psrlw $15, %mm1
+ paddw %mm3, %mm2
+ paddw %mm1, %mm0
+ paddw %mm2, %mm0
+ paddw %mm0, MMREG_CLIP
+
+ leal 16(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ pshufw $0xee, MMREG_CLIP, %mm0
+ paddw MMREG_CLIP, %mm0
+ pshufw $0x55, %mm0, %mm1
+ paddw %mm1, %mm0
+ movd %mm0, %eax
+ andl $0xffff, %eax
+
+ popl %edi
+ popl %esi
+ popl %ebx
+ movl %ebp, %esp
+ popl %ebp
+
+ emms
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_sse_float.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_sse_float.S
new file mode 100644
index 00000000..113b3547
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_sse_float.S
@@ -0,0 +1,420 @@
+/*
+ synth_sse_float: SSE optimized synth (stereo specific, float output version)
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+/* real *window; */
+#define WINDOW %ebx
+/* real *b0l; */
+#define B0L %edx
+/* real *b0r; */
+#define B0R %esi
+/* real *samples; */
+#define SAMPLES %edi
+
+#define TEMP(n) (12+16*n)(%esp)
+
+/*
+ int synth_1to1_real_s_sse_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
+ return value: number of clipped samples (0)
+*/
+
+#if !defined ( __APPLE__) && !defined (__OS2__)
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+scale_sse:
+ .long 939524096
+ .long 939524096
+ .long 939524096
+ .long 939524096
+ .text
+ ALIGN16
+.globl ASM_NAME(synth_1to1_real_s_sse_asm)
+ASM_NAME(synth_1to1_real_s_sse_asm):
+ pushl %ebp
+ movl %esp, %ebp
+ andl $-16, %esp
+ subl $128, %esp
+ pushl %ebx
+ pushl %esi
+ pushl %edi
+
+ movl 8(%ebp), WINDOW
+ movl 12(%ebp), B0L
+ movl 16(%ebp), B0R
+ movl 20(%ebp), SAMPLES
+ movl 24(%ebp), %eax
+ shll $2, %eax
+
+ leal 64(WINDOW), WINDOW
+ subl %eax, WINDOW
+
+ #undef _EBX_
+ #define _EBX_ %eax
+ GET_GOT
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(0)
+ movaps %xmm4, TEMP(4)
+
+ leal 128(WINDOW), WINDOW
+ leal 64(B0L), B0L
+ leal 64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(1)
+ movaps %xmm4, TEMP(5)
+
+ leal 128(WINDOW), WINDOW
+ leal 64(B0L), B0L
+ leal 64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(2)
+ movaps %xmm4, TEMP(6)
+
+ leal 128(WINDOW), WINDOW
+ leal 64(B0L), B0L
+ leal 64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, %xmm7
+ movaps %xmm4, TEMP(7)
+
+ leal 128(WINDOW), WINDOW
+ leal 64(B0L), B0L
+ leal 64(B0R), B0R
+
+ movaps TEMP(0), %xmm4
+ movaps TEMP(1), %xmm5
+ movaps TEMP(2), %xmm6
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ subps %xmm6, %xmm4
+ subps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+ movaps %xmm0, %xmm2
+
+ movaps TEMP(4), %xmm4
+ movaps TEMP(5), %xmm5
+ movaps TEMP(6), %xmm6
+ movaps TEMP(7), %xmm7
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm2, %xmm5
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ subps %xmm6, %xmm4
+ subps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+
+ mulps LOCAL_VAR(scale_sse), %xmm5
+ mulps LOCAL_VAR(scale_sse), %xmm0
+ movaps %xmm5, %xmm1
+ unpcklps %xmm0, %xmm5
+ unpckhps %xmm0, %xmm1
+ movups %xmm5, (SAMPLES)
+ movups %xmm1, 16(SAMPLES)
+
+ leal 32(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(0)
+ movaps %xmm4, TEMP(4)
+
+ leal 128(WINDOW), WINDOW
+ leal -64(B0L), B0L
+ leal -64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(1)
+ movaps %xmm4, TEMP(5)
+
+ leal 128(WINDOW), WINDOW
+ leal -64(B0L), B0L
+ leal -64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(2)
+ movaps %xmm4, TEMP(6)
+
+ leal 128(WINDOW), WINDOW
+ leal -64(B0L), B0L
+ leal -64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, %xmm7
+ movaps %xmm4, TEMP(7)
+
+ leal 128(WINDOW), WINDOW
+ leal -64(B0L), B0L
+ leal -64(B0R), B0R
+
+ movaps TEMP(0), %xmm4
+ movaps TEMP(1), %xmm5
+ movaps TEMP(2), %xmm6
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ addps %xmm6, %xmm4
+ addps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+ movaps %xmm0, %xmm2
+
+ movaps TEMP(4), %xmm4
+ movaps TEMP(5), %xmm5
+ movaps TEMP(6), %xmm6
+ movaps TEMP(7), %xmm7
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm2, %xmm5
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ addps %xmm6, %xmm4
+ addps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+
+ mulps LOCAL_VAR(scale_sse), %xmm5
+ mulps LOCAL_VAR(scale_sse), %xmm0
+ movaps %xmm5, %xmm1
+ unpcklps %xmm0, %xmm5
+ unpckhps %xmm0, %xmm1
+ movups %xmm5, (SAMPLES)
+ movups %xmm1, 16(SAMPLES)
+
+ leal 32(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ xorl %eax, %eax
+
+ popl %edi
+ popl %esi
+ popl %ebx
+ movl %ebp, %esp
+ popl %ebp
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_sse_s32.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_sse_s32.S
new file mode 100644
index 00000000..248cf9d8
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_sse_s32.S
@@ -0,0 +1,544 @@
+/*
+ synth_stereo_sse_s32: SSE optimized synth (stereo specific, s32 output version)
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+/* real *window; */
+#define WINDOW %ebx
+/* real *b0l; */
+#define B0L %edx
+/* real *b0r; */
+#define B0R %esi
+/* real *samples; */
+#define SAMPLES %edi
+
+#define TEMP(n) (12+16*n)(%esp)
+#define MMREG_CLIP %mm7
+
+/*
+ int synth_1to1_s32_s_sse_asm(real *window, real *b0l, real *b0r, int32_t *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+#if !defined ( __APPLE__) && !defined (__OS2__)
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+scale_s32:
+ .long 1199570944 /* 65536.0 */
+ .long 1199570944
+ .long 1199570944
+ .long 1199570944
+ ALIGN16
+maxmin_s32:
+ .long 1191182335 /* 32767.999 */
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long -956301312 /* -32768.0 */
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .text
+ ALIGN16
+.globl ASM_NAME(synth_1to1_s32_s_sse_asm)
+ASM_NAME(synth_1to1_s32_s_sse_asm):
+ pushl %ebp
+ movl %esp, %ebp
+ andl $-16, %esp
+ subl $128, %esp
+ pushl %ebx
+ pushl %esi
+ pushl %edi
+
+ pxor MMREG_CLIP, MMREG_CLIP
+
+ movl 8(%ebp), WINDOW
+ movl 12(%ebp), B0L
+ movl 16(%ebp), B0R
+ movl 20(%ebp), SAMPLES
+ movl 24(%ebp), %eax
+ shll $2, %eax
+
+ leal 64(WINDOW), WINDOW
+ subl %eax, WINDOW
+
+ #undef _EBX_
+ #define _EBX_ %eax
+ GET_GOT
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(0)
+ movaps %xmm4, TEMP(4)
+
+ leal 128(WINDOW), WINDOW
+ leal 64(B0L), B0L
+ leal 64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(1)
+ movaps %xmm4, TEMP(5)
+
+ leal 128(WINDOW), WINDOW
+ leal 64(B0L), B0L
+ leal 64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(2)
+ movaps %xmm4, TEMP(6)
+
+ leal 128(WINDOW), WINDOW
+ leal 64(B0L), B0L
+ leal 64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, %xmm7
+ movaps %xmm4, TEMP(7)
+
+ leal 128(WINDOW), WINDOW
+ leal 64(B0L), B0L
+ leal 64(B0R), B0R
+
+ movaps TEMP(0), %xmm4
+ movaps TEMP(1), %xmm5
+ movaps TEMP(2), %xmm6
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ subps %xmm6, %xmm4
+ subps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+ movaps %xmm0, %xmm2
+
+ movaps TEMP(4), %xmm4
+ movaps TEMP(5), %xmm5
+ movaps TEMP(6), %xmm6
+ movaps TEMP(7), %xmm7
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm2, %xmm5
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ subps %xmm6, %xmm4
+ subps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+
+ movaps %xmm5, %xmm1
+ movaps %xmm5, %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm0, %xmm4
+ mulps LOCAL_VAR(scale_s32), %xmm5
+ mulps LOCAL_VAR(scale_s32), %xmm0
+ cmpnleps LOCAL_VAR(maxmin_s32), %xmm1
+ cmpltps 16+LOCAL_VAR(maxmin_s32), %xmm2
+ cmpnleps LOCAL_VAR(maxmin_s32), %xmm3
+ cmpltps 16+LOCAL_VAR(maxmin_s32), %xmm4
+ cvtps2pi %xmm5, %mm0
+ cvtps2pi %xmm0, %mm1
+ cvtps2pi %xmm1, %mm2
+ cvtps2pi %xmm3, %mm3
+ psrad $31, %mm2
+ psrad $31, %mm3
+ pxor %mm2, %mm0
+ pxor %mm3, %mm1
+ movq %mm0, %mm4
+ punpckldq %mm1, %mm0
+ punpckhdq %mm1, %mm4
+ movq %mm0, (SAMPLES)
+ movq %mm4, 8(SAMPLES)
+ movhlps %xmm5, %xmm5
+ movhlps %xmm0, %xmm0
+ movhlps %xmm1, %xmm1
+ movhlps %xmm3, %xmm3
+ cvtps2pi %xmm5, %mm0
+ cvtps2pi %xmm0, %mm1
+ cvtps2pi %xmm1, %mm4
+ cvtps2pi %xmm3, %mm5
+ psrad $31, %mm4
+ psrad $31, %mm5
+ pxor %mm4, %mm0
+ pxor %mm5, %mm1
+ movq %mm0, %mm6
+ punpckldq %mm1, %mm0
+ punpckhdq %mm1, %mm6
+ movq %mm0, 16(SAMPLES)
+ movq %mm6, 24(SAMPLES)
+
+ packssdw %mm4, %mm2
+ packssdw %mm5, %mm3
+ psrlw $15, %mm2
+ psrlw $15, %mm3
+ cvtps2pi %xmm2, %mm0
+ cvtps2pi %xmm4, %mm1
+ movhlps %xmm2, %xmm2
+ movhlps %xmm4, %xmm4
+ cvtps2pi %xmm2, %mm4
+ cvtps2pi %xmm4, %mm5
+ packssdw %mm4, %mm0
+ packssdw %mm5, %mm1
+ psrlw $15, %mm0
+ psrlw $15, %mm1
+ paddw %mm3, %mm2
+ paddw %mm1, %mm0
+ paddw %mm2, %mm0
+ paddw %mm0, MMREG_CLIP
+
+ leal 32(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(0)
+ movaps %xmm4, TEMP(4)
+
+ leal 128(WINDOW), WINDOW
+ leal -64(B0L), B0L
+ leal -64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(1)
+ movaps %xmm4, TEMP(5)
+
+ leal 128(WINDOW), WINDOW
+ leal -64(B0L), B0L
+ leal -64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, TEMP(2)
+ movaps %xmm4, TEMP(6)
+
+ leal 128(WINDOW), WINDOW
+ leal -64(B0L), B0L
+ leal -64(B0R), B0R
+
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movaps %xmm0, %xmm4
+ movaps %xmm1, %xmm5
+ movaps %xmm2, %xmm6
+ movaps %xmm3, %xmm7
+ mulps 0(B0L), %xmm0
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 0(B0R), %xmm4
+ mulps 16(B0R), %xmm5
+ mulps 32(B0R), %xmm6
+ mulps 48(B0R), %xmm7
+ addps %xmm1, %xmm0
+ addps %xmm3, %xmm2
+ addps %xmm5, %xmm4
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm0
+ addps %xmm6, %xmm4
+ movaps %xmm0, %xmm7
+ movaps %xmm4, TEMP(7)
+
+ leal 128(WINDOW), WINDOW
+ leal -64(B0L), B0L
+ leal -64(B0R), B0R
+
+ movaps TEMP(0), %xmm4
+ movaps TEMP(1), %xmm5
+ movaps TEMP(2), %xmm6
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ addps %xmm6, %xmm4
+ addps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+ movaps %xmm0, %xmm2
+
+ movaps TEMP(4), %xmm4
+ movaps TEMP(5), %xmm5
+ movaps TEMP(6), %xmm6
+ movaps TEMP(7), %xmm7
+ movaps %xmm4, %xmm0
+ movaps %xmm6, %xmm1
+ unpcklps %xmm5, %xmm4
+ unpcklps %xmm7, %xmm6
+ unpckhps %xmm5, %xmm0
+ unpckhps %xmm7, %xmm1
+ movaps %xmm2, %xmm5
+ movaps %xmm4, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm6, %xmm4
+ movhlps %xmm2, %xmm6
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ addps %xmm6, %xmm4
+ addps %xmm1, %xmm0
+ addps %xmm4, %xmm0
+
+ movaps %xmm5, %xmm1
+ movaps %xmm5, %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm0, %xmm4
+ mulps LOCAL_VAR(scale_s32), %xmm5
+ mulps LOCAL_VAR(scale_s32), %xmm0
+ cmpnleps LOCAL_VAR(maxmin_s32), %xmm1
+ cmpltps 16+LOCAL_VAR(maxmin_s32), %xmm2
+ cmpnleps LOCAL_VAR(maxmin_s32), %xmm3
+ cmpltps 16+LOCAL_VAR(maxmin_s32), %xmm4
+ cvtps2pi %xmm5, %mm0
+ cvtps2pi %xmm0, %mm1
+ cvtps2pi %xmm1, %mm2
+ cvtps2pi %xmm3, %mm3
+ psrad $31, %mm2
+ psrad $31, %mm3
+ pxor %mm2, %mm0
+ pxor %mm3, %mm1
+ movq %mm0, %mm4
+ punpckldq %mm1, %mm0
+ punpckhdq %mm1, %mm4
+ movq %mm0, (SAMPLES)
+ movq %mm4, 8(SAMPLES)
+ movhlps %xmm5, %xmm5
+ movhlps %xmm0, %xmm0
+ movhlps %xmm1, %xmm1
+ movhlps %xmm3, %xmm3
+ cvtps2pi %xmm5, %mm0
+ cvtps2pi %xmm0, %mm1
+ cvtps2pi %xmm1, %mm4
+ cvtps2pi %xmm3, %mm5
+ psrad $31, %mm4
+ psrad $31, %mm5
+ pxor %mm4, %mm0
+ pxor %mm5, %mm1
+ movq %mm0, %mm6
+ punpckldq %mm1, %mm0
+ punpckhdq %mm1, %mm6
+ movq %mm0, 16(SAMPLES)
+ movq %mm6, 24(SAMPLES)
+
+ packssdw %mm4, %mm2
+ packssdw %mm5, %mm3
+ psrlw $15, %mm2
+ psrlw $15, %mm3
+ cvtps2pi %xmm2, %mm0
+ cvtps2pi %xmm4, %mm1
+ movhlps %xmm2, %xmm2
+ movhlps %xmm4, %xmm4
+ cvtps2pi %xmm2, %mm4
+ cvtps2pi %xmm4, %mm5
+ packssdw %mm4, %mm0
+ packssdw %mm5, %mm1
+ psrlw $15, %mm0
+ psrlw $15, %mm1
+ paddw %mm3, %mm2
+ paddw %mm1, %mm0
+ paddw %mm2, %mm0
+ paddw %mm0, MMREG_CLIP
+
+ leal 32(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ pshufw $0xee, MMREG_CLIP, %mm0
+ paddw MMREG_CLIP, %mm0
+ pshufw $0x55, %mm0, %mm1
+ paddw %mm1, %mm0
+ movd %mm0, %eax
+ andl $0xffff, %eax
+
+ popl %edi
+ popl %esi
+ popl %ebx
+ movl %ebp, %esp
+ popl %ebp
+
+ emms
+
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_x86_64.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_x86_64.S
new file mode 100644
index 00000000..3aa4dfe0
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_x86_64.S
@@ -0,0 +1,335 @@
+/*
+ synth_stereo_x86_64: SSE optimized synth for x86-64 (stereo specific version)
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifdef IS_MSABI
+/* short *window; */
+#define WINDOW %r10
+/* short *b0l; */
+#define B0L %rdx
+/* short *b0r; */
+#define B0R %r8
+/* short *samples; */
+#define SAMPLES %r9
+#else
+/* short *window; */
+#define WINDOW %rdi
+/* short *b0l; */
+#define B0L %rsi
+/* short *b0r; */
+#define B0R %rdx
+/* short *samples; */
+#define SAMPLES %r9
+#endif
+
+#define XMMREG_CLIP %xmm15
+#define XMMREG_MAX %xmm14 /* {32767, 32767, 32767, 32767} */
+#define XMMREG_MIN %xmm13 /* {-32769, -32769, -32769, -32769} : not -32768 because SSE doesn't have "less than" comparison... */
+#define XMMREG_FULL %xmm12 /* {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF} */
+
+/*
+ int synth_1to1_s_x86_64_asm(short *window, short *b0l, short *b0r, short *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+ASM_NAME(maxmin_x86_64):
+ .long 32767
+ .long 32767
+ .long 32767
+ .long 32767
+ .long -32769
+ .long -32769
+ .long -32769
+ .long -32769
+ .text
+ ALIGN16
+.globl ASM_NAME(synth_1to1_s_x86_64_asm)
+ASM_NAME(synth_1to1_s_x86_64_asm):
+#ifdef IS_MSABI /* should save xmm6-15 */
+ movl 40(%rsp), %eax /* 5th argument; placed after 32-byte shadow space */
+ subq $168, %rsp /* stack alignment + 10 xmm registers */
+ movaps %xmm6, (%rsp)
+ movaps %xmm7, 16(%rsp)
+ movaps %xmm8, 32(%rsp)
+ movaps %xmm9, 48(%rsp)
+ movaps %xmm10, 64(%rsp)
+ movaps %xmm11, 80(%rsp)
+ movaps %xmm12, 96(%rsp)
+ movaps %xmm13, 112(%rsp)
+ movaps %xmm14, 128(%rsp)
+ movaps %xmm15, 144(%rsp)
+#endif
+
+#ifdef IS_MSABI
+ shlq $32, %rax
+ shrq $31, %rax
+ movq %rcx, %r10
+#else
+ movq %r8, %rax
+ shlq $32, %rax
+ shrq $31, %rax
+ movq %rcx, %r9
+#endif
+ leaq 32(WINDOW), WINDOW
+ subq %rax, WINDOW
+
+ leaq ASM_NAME(maxmin_x86_64)(%rip), %rax
+ movaps (%rax), XMMREG_MAX
+ movaps 16(%rax), XMMREG_MIN
+ pxor XMMREG_CLIP, XMMREG_CLIP
+ pcmpeqd XMMREG_FULL, XMMREG_FULL
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 64(WINDOW), %xmm2
+ movups 80(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm4
+ movups 144(WINDOW), %xmm5
+ movups 192(WINDOW), %xmm6
+ movups 208(WINDOW), %xmm7
+ movaps %xmm0, %xmm8
+ movaps %xmm1, %xmm9
+ movaps %xmm2, %xmm10
+ movaps %xmm3, %xmm11
+ pmaddwd (B0L), %xmm0
+ pmaddwd 16(B0L), %xmm1
+ pmaddwd 32(B0L), %xmm2
+ pmaddwd 48(B0L), %xmm3
+ pmaddwd (B0R), %xmm8
+ pmaddwd 16(B0R), %xmm9
+ pmaddwd 32(B0R), %xmm10
+ pmaddwd 48(B0R), %xmm11
+ paddd %xmm1, %xmm0
+ paddd %xmm3, %xmm2
+ paddd %xmm9, %xmm8
+ paddd %xmm11, %xmm10
+ movaps %xmm4, %xmm1
+ movaps %xmm5, %xmm9
+ movaps %xmm6, %xmm3
+ movaps %xmm7, %xmm11
+ pmaddwd 64(B0L), %xmm4
+ pmaddwd 80(B0L), %xmm5
+ pmaddwd 96(B0L), %xmm6
+ pmaddwd 112(B0L), %xmm7
+ pmaddwd 64(B0R), %xmm1
+ pmaddwd 80(B0R), %xmm9
+ pmaddwd 96(B0R), %xmm3
+ pmaddwd 112(B0R), %xmm11
+ paddd %xmm5, %xmm4
+ paddd %xmm7, %xmm6
+ paddd %xmm1, %xmm9
+ paddd %xmm3, %xmm11
+
+ movaps %xmm0, %xmm1
+ movaps %xmm4, %xmm3
+ movaps %xmm8, %xmm5
+ movaps %xmm9, %xmm7
+ punpckldq %xmm2, %xmm0
+ punpckldq %xmm6, %xmm4
+ punpckhdq %xmm2, %xmm1
+ punpckhdq %xmm6, %xmm3
+ punpckldq %xmm10, %xmm8
+ punpckldq %xmm11, %xmm9
+ punpckhdq %xmm10, %xmm5
+ punpckhdq %xmm11, %xmm7
+ movaps %xmm0, %xmm2
+ movaps %xmm1, %xmm6
+ movaps %xmm8, %xmm10
+ movaps %xmm5, %xmm11
+ movlhps %xmm4, %xmm0
+ movhlps %xmm2, %xmm4
+ movlhps %xmm3, %xmm1
+ movhlps %xmm6, %xmm3
+ movlhps %xmm9, %xmm8
+ movhlps %xmm10, %xmm9
+ movlhps %xmm7, %xmm5
+ movhlps %xmm11, %xmm7
+ paddd %xmm4, %xmm0
+ paddd %xmm3, %xmm1
+ paddd %xmm9, %xmm8
+ paddd %xmm7, %xmm5
+ paddd %xmm1, %xmm0
+ paddd %xmm5, %xmm8
+ psrad $13, %xmm0
+ psrad $13, %xmm8
+
+ movaps %xmm0, %xmm1
+ movaps %xmm0, %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm8, %xmm4
+ punpckldq %xmm8, %xmm0
+ punpckhdq %xmm8, %xmm1
+ packssdw %xmm1, %xmm0
+ movups %xmm0, (SAMPLES)
+
+ pcmpgtd XMMREG_MAX, %xmm2
+ pcmpgtd XMMREG_MIN, %xmm3
+ pcmpgtd XMMREG_MAX, %xmm4
+ pcmpgtd XMMREG_MIN, %xmm8
+ packssdw %xmm4, %xmm2
+ packssdw %xmm8, %xmm3
+ pxor XMMREG_FULL, %xmm3
+ psrlw $15, %xmm2
+ psrlw $15, %xmm3
+ paddw %xmm3, %xmm2
+ paddw %xmm2, XMMREG_CLIP
+
+ leaq 256(WINDOW), WINDOW
+ leaq 128(B0L), B0L
+ leaq 128(B0R), B0R
+ leaq 16(SAMPLES), SAMPLES
+
+ decl %ecx
+ jnz 1b
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm0
+ movups 16(WINDOW), %xmm1
+ movups 64(WINDOW), %xmm2
+ movups 80(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm4
+ movups 144(WINDOW), %xmm5
+ movups 192(WINDOW), %xmm6
+ movups 208(WINDOW), %xmm7
+ movaps %xmm0, %xmm8
+ movaps %xmm1, %xmm9
+ movaps %xmm2, %xmm10
+ movaps %xmm3, %xmm11
+ pmaddwd (B0L), %xmm0
+ pmaddwd 16(B0L), %xmm1
+ pmaddwd -32(B0L), %xmm2
+ pmaddwd -16(B0L), %xmm3
+ pmaddwd (B0R), %xmm8
+ pmaddwd 16(B0R), %xmm9
+ pmaddwd -32(B0R), %xmm10
+ pmaddwd -16(B0R), %xmm11
+ paddd %xmm1, %xmm0
+ paddd %xmm3, %xmm2
+ paddd %xmm9, %xmm8
+ paddd %xmm11, %xmm10
+ movaps %xmm4, %xmm1
+ movaps %xmm5, %xmm9
+ movaps %xmm6, %xmm3
+ movaps %xmm7, %xmm11
+ pmaddwd -64(B0L), %xmm4
+ pmaddwd -48(B0L), %xmm5
+ pmaddwd -96(B0L), %xmm6
+ pmaddwd -80(B0L), %xmm7
+ pmaddwd -64(B0R), %xmm1
+ pmaddwd -48(B0R), %xmm9
+ pmaddwd -96(B0R), %xmm3
+ pmaddwd -80(B0R), %xmm11
+ paddd %xmm5, %xmm4
+ paddd %xmm7, %xmm6
+ paddd %xmm1, %xmm9
+ paddd %xmm3, %xmm11
+
+ movaps %xmm0, %xmm1
+ movaps %xmm4, %xmm3
+ movaps %xmm8, %xmm5
+ movaps %xmm9, %xmm7
+ punpckldq %xmm2, %xmm0
+ punpckldq %xmm6, %xmm4
+ punpckhdq %xmm2, %xmm1
+ punpckhdq %xmm6, %xmm3
+ punpckldq %xmm10, %xmm8
+ punpckldq %xmm11, %xmm9
+ punpckhdq %xmm10, %xmm5
+ punpckhdq %xmm11, %xmm7
+ movaps %xmm0, %xmm2
+ movaps %xmm1, %xmm6
+ movaps %xmm8, %xmm10
+ movaps %xmm5, %xmm11
+ movlhps %xmm4, %xmm0
+ movhlps %xmm2, %xmm4
+ movlhps %xmm3, %xmm1
+ movhlps %xmm6, %xmm3
+ movlhps %xmm9, %xmm8
+ movhlps %xmm10, %xmm9
+ movlhps %xmm7, %xmm5
+ movhlps %xmm11, %xmm7
+ paddd %xmm4, %xmm0
+ paddd %xmm3, %xmm1
+ paddd %xmm9, %xmm8
+ paddd %xmm7, %xmm5
+ paddd %xmm1, %xmm0
+ paddd %xmm5, %xmm8
+ psrad $13, %xmm0
+ psrad $13, %xmm8
+
+ movaps %xmm0, %xmm1
+ movaps %xmm0, %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm8, %xmm4
+ punpckldq %xmm8, %xmm0
+ punpckhdq %xmm8, %xmm1
+ packssdw %xmm1, %xmm0
+ movups %xmm0, (SAMPLES)
+
+ pcmpgtd XMMREG_MAX, %xmm2
+ pcmpgtd XMMREG_MIN, %xmm3
+ pcmpgtd XMMREG_MAX, %xmm4
+ pcmpgtd XMMREG_MIN, %xmm8
+ packssdw %xmm4, %xmm2
+ packssdw %xmm8, %xmm3
+ pxor XMMREG_FULL, %xmm3
+ psrlw $15, %xmm2
+ psrlw $15, %xmm3
+ paddw %xmm3, %xmm2
+ paddw %xmm2, XMMREG_CLIP
+
+ leaq 256(WINDOW), WINDOW
+ leaq -128(B0L), B0L
+ leaq -128(B0R), B0R
+ leaq 16(SAMPLES), SAMPLES
+
+ decl %ecx
+ jnz 1b
+
+ movhlps XMMREG_CLIP, %xmm0
+ paddw XMMREG_CLIP, %xmm0
+ pshuflw $0x55, %xmm0, %xmm1
+ pshuflw $0xaa, %xmm0, %xmm2
+ pshuflw $0xff, %xmm0, %xmm3
+ paddw %xmm1, %xmm0
+ paddw %xmm2, %xmm0
+ paddw %xmm3, %xmm0
+
+ movd %xmm0, %eax
+ andl $0xffff, %eax
+
+#ifdef IS_MSABI
+ movaps (%rsp), %xmm6
+ movaps 16(%rsp), %xmm7
+ movaps 32(%rsp), %xmm8
+ movaps 48(%rsp), %xmm9
+ movaps 64(%rsp), %xmm10
+ movaps 80(%rsp), %xmm11
+ movaps 96(%rsp), %xmm12
+ movaps 112(%rsp), %xmm13
+ movaps 128(%rsp), %xmm14
+ movaps 144(%rsp), %xmm15
+ addq $168, %rsp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_x86_64_accurate.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_x86_64_accurate.S
new file mode 100644
index 00000000..e9a9911b
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_x86_64_accurate.S
@@ -0,0 +1,454 @@
+/*
+ synth_stereo_x86_64_accurate: SSE optimized synth for x86-64 (stereo specific, MPEG-compliant 16bit output version)
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifdef IS_MSABI
+/* short *window; */
+#define WINDOW %rsi
+/* short *b0l; */
+#define B0L %rdx
+/* short *b0r; */
+#define B0R %r8
+/* short *samples; */
+#define SAMPLES %r9
+#else
+/* real *window; */
+#define WINDOW %rdi
+/* real *b0l; */
+#define B0L %rsi
+/* real *b0r; */
+#define B0R %rdx
+/* real *samples; */
+#define SAMPLES %r8
+#endif
+
+#define XMMREG_MAX (%r10) /* {32767.0, 32767.0, 32767.0, 32767.0} */
+#define XMMREG_MIN (%r11) /* {-32768.0, -32768.0, -32768.0, -32768.0} */
+#define TEMP_CLIP (%rsp)
+
+/*
+ int synth_1to1_s_x86_64_accurate_asm(real *window, real *b0l, real *b0r, short *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+ASM_NAME(maxmin_s16):
+ .long 1191181824
+ .long 1191181824
+ .long 1191181824
+ .long 1191181824
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .text
+ ALIGN16
+.globl ASM_NAME(synth_1to1_s_x86_64_accurate_asm)
+ASM_NAME(synth_1to1_s_x86_64_accurate_asm):
+#ifdef IS_MSABI /* should save xmm6-15 */
+ movl 40(%rsp), %eax /* 5th argument; placed after 32-byte shadow space */
+ pushq %rsi
+ subq $176, %rsp /* 10 xmm registers + temp */
+ movaps %xmm6, 16(%rsp)
+ movaps %xmm7, 32(%rsp)
+ movaps %xmm8, 48(%rsp)
+ movaps %xmm9, 64(%rsp)
+ movaps %xmm10, 80(%rsp)
+ movaps %xmm11, 96(%rsp)
+ movaps %xmm12, 112(%rsp)
+ movaps %xmm13, 128(%rsp)
+ movaps %xmm14, 144(%rsp)
+ movaps %xmm15, 160(%rsp)
+#else
+ subq $24, %rsp /* stack alignment + temp */
+#endif
+
+ leaq ASM_NAME(maxmin_s16)(%rip), %r10
+ leaq 16(%r10), %r11
+ xorps %xmm0, %xmm0
+ movaps %xmm0, TEMP_CLIP
+
+#ifdef IS_MSABI
+ shlq $32, %rax
+ shrq $30, %rax
+ movq %rcx, %rsi
+#else
+ movq %r8, %rax
+ shlq $32, %rax
+ shrq $30, %rax
+ movq %rcx, %r8
+#endif
+ leaq 64(WINDOW), WINDOW
+ subq %rax, WINDOW
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm8
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm9
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ movaps %xmm8, %xmm0
+ movaps %xmm1, %xmm4
+ movaps %xmm2, %xmm10
+ movaps %xmm3, %xmm11
+ movaps %xmm9, %xmm12
+ movaps %xmm5, %xmm13
+ movaps %xmm6, %xmm14
+ movaps %xmm7, %xmm15
+ mulps (B0L), %xmm8
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 64(B0L), %xmm9
+ mulps 80(B0L), %xmm5
+ mulps 96(B0L), %xmm6
+ mulps 112(B0L), %xmm7
+ mulps (B0R), %xmm0
+ mulps 16(B0R), %xmm4
+ mulps 32(B0R), %xmm10
+ mulps 48(B0R), %xmm11
+ mulps 64(B0R), %xmm12
+ mulps 80(B0R), %xmm13
+ mulps 96(B0R), %xmm14
+ mulps 112(B0R), %xmm15
+
+ addps %xmm1, %xmm8
+ addps %xmm2, %xmm3
+ addps %xmm4, %xmm0
+ addps %xmm11, %xmm10
+ addps %xmm5, %xmm9
+ addps %xmm7, %xmm6
+ addps %xmm13, %xmm12
+ addps %xmm15, %xmm14
+ addps %xmm3, %xmm8
+ addps %xmm6, %xmm9
+ addps %xmm10, %xmm0
+ addps %xmm12, %xmm14
+ movaps %xmm0, %xmm12
+ movaps %xmm14, %xmm13
+ leaq 256(WINDOW), WINDOW
+ leaq 128(B0L), B0L
+ leaq 128(B0R), B0R
+
+ movups (WINDOW), %xmm10
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm11
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ movaps %xmm10, %xmm0
+ movaps %xmm1, %xmm4
+ movaps %xmm2, %xmm14
+ movaps %xmm3, %xmm15
+ mulps (B0L), %xmm10
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps (B0R), %xmm0
+ mulps 16(B0R), %xmm4
+ mulps 32(B0R), %xmm14
+ mulps 48(B0R), %xmm15
+ addps %xmm1, %xmm10
+ addps %xmm2, %xmm3
+ addps %xmm4, %xmm0
+ addps %xmm15, %xmm14
+ movaps %xmm11, %xmm1
+ movaps %xmm5, %xmm2
+ movaps %xmm6, %xmm4
+ movaps %xmm7, %xmm15
+ mulps 64(B0L), %xmm11
+ mulps 80(B0L), %xmm5
+ mulps 96(B0L), %xmm6
+ mulps 112(B0L), %xmm7
+ mulps 64(B0R), %xmm1
+ mulps 80(B0R), %xmm2
+ mulps 96(B0R), %xmm4
+ mulps 112(B0R), %xmm15
+ addps %xmm5, %xmm11
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm1
+ addps %xmm15, %xmm4
+
+ addps %xmm3, %xmm10
+ addps %xmm6, %xmm11
+ addps %xmm0, %xmm14
+ addps %xmm4, %xmm1
+ movaps %xmm1, %xmm15
+ leaq 256(WINDOW), WINDOW
+ leaq 128(B0L), B0L
+ leaq 128(B0R), B0R
+
+ movaps %xmm8, %xmm0
+ movaps %xmm10, %xmm1
+ movaps %xmm12, %xmm4
+ movaps %xmm14, %xmm5
+ unpcklps %xmm9, %xmm8
+ unpcklps %xmm11, %xmm10
+ unpckhps %xmm9, %xmm0
+ unpckhps %xmm11, %xmm1
+ unpcklps %xmm13, %xmm12
+ unpcklps %xmm15, %xmm14
+ unpckhps %xmm13, %xmm4
+ unpckhps %xmm15, %xmm5
+ movaps %xmm8, %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm12, %xmm6
+ movaps %xmm4, %xmm7
+ movlhps %xmm10, %xmm8
+ movhlps %xmm2, %xmm10
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ movlhps %xmm14, %xmm12
+ movhlps %xmm6, %xmm14
+ movlhps %xmm5, %xmm4
+ movhlps %xmm7, %xmm5
+ subps %xmm10, %xmm8
+ subps %xmm1, %xmm0
+ subps %xmm14, %xmm12
+ subps %xmm5, %xmm4
+ addps %xmm8, %xmm0
+ addps %xmm12, %xmm4
+
+ movaps %xmm0, %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm4, %xmm5
+ movaps %xmm4, %xmm6
+ cmpnleps XMMREG_MAX, %xmm2
+ cmpltps XMMREG_MIN, %xmm3
+ cmpnleps XMMREG_MAX, %xmm5
+ cmpltps XMMREG_MIN, %xmm6
+ cvtps2dq %xmm0, %xmm0
+ cvtps2dq %xmm4, %xmm4
+ movaps %xmm0, %xmm1
+ unpcklps %xmm4, %xmm0
+ unpckhps %xmm4, %xmm1
+ packssdw %xmm1, %xmm0
+ movups %xmm0, (SAMPLES)
+
+ packssdw %xmm5, %xmm2
+ packssdw %xmm6, %xmm3
+ psrlw $15, %xmm2
+ psrlw $15, %xmm3
+ paddw %xmm3, %xmm2
+ paddw TEMP_CLIP, %xmm2
+ movaps %xmm2, TEMP_CLIP
+
+ leaq 16(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm8
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm9
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ movaps %xmm8, %xmm0
+ movaps %xmm1, %xmm4
+ movaps %xmm2, %xmm10
+ movaps %xmm3, %xmm11
+ movaps %xmm9, %xmm12
+ movaps %xmm5, %xmm13
+ movaps %xmm6, %xmm14
+ movaps %xmm7, %xmm15
+ mulps (B0L), %xmm8
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps -64(B0L), %xmm9
+ mulps -48(B0L), %xmm5
+ mulps -32(B0L), %xmm6
+ mulps -16(B0L), %xmm7
+ mulps (B0R), %xmm0
+ mulps 16(B0R), %xmm4
+ mulps 32(B0R), %xmm10
+ mulps 48(B0R), %xmm11
+ mulps -64(B0R), %xmm12
+ mulps -48(B0R), %xmm13
+ mulps -32(B0R), %xmm14
+ mulps -16(B0R), %xmm15
+
+ addps %xmm1, %xmm8
+ addps %xmm2, %xmm3
+ addps %xmm4, %xmm0
+ addps %xmm11, %xmm10
+ addps %xmm5, %xmm9
+ addps %xmm7, %xmm6
+ addps %xmm13, %xmm12
+ addps %xmm15, %xmm14
+ addps %xmm3, %xmm8
+ addps %xmm6, %xmm9
+ addps %xmm10, %xmm0
+ addps %xmm12, %xmm14
+ movaps %xmm0, %xmm12
+ movaps %xmm14, %xmm13
+ leaq 256(WINDOW), WINDOW
+ leaq -128(B0L), B0L
+ leaq -128(B0R), B0R
+
+ movups (WINDOW), %xmm10
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm11
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ movaps %xmm10, %xmm0
+ movaps %xmm1, %xmm4
+ movaps %xmm2, %xmm14
+ movaps %xmm3, %xmm15
+ mulps (B0L), %xmm10
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps (B0R), %xmm0
+ mulps 16(B0R), %xmm4
+ mulps 32(B0R), %xmm14
+ mulps 48(B0R), %xmm15
+ addps %xmm1, %xmm10
+ addps %xmm2, %xmm3
+ addps %xmm4, %xmm0
+ addps %xmm15, %xmm14
+ movaps %xmm11, %xmm1
+ movaps %xmm5, %xmm2
+ movaps %xmm6, %xmm4
+ movaps %xmm7, %xmm15
+ mulps -64(B0L), %xmm11
+ mulps -48(B0L), %xmm5
+ mulps -32(B0L), %xmm6
+ mulps -16(B0L), %xmm7
+ mulps -64(B0R), %xmm1
+ mulps -48(B0R), %xmm2
+ mulps -32(B0R), %xmm4
+ mulps -16(B0R), %xmm15
+ addps %xmm5, %xmm11
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm1
+ addps %xmm15, %xmm4
+
+ addps %xmm3, %xmm10
+ addps %xmm6, %xmm11
+ addps %xmm0, %xmm14
+ addps %xmm4, %xmm1
+ movaps %xmm1, %xmm15
+ leaq 256(WINDOW), WINDOW
+ leaq -128(B0L), B0L
+ leaq -128(B0R), B0R
+
+ movaps %xmm8, %xmm0
+ movaps %xmm10, %xmm1
+ movaps %xmm12, %xmm4
+ movaps %xmm14, %xmm5
+ unpcklps %xmm9, %xmm8
+ unpcklps %xmm11, %xmm10
+ unpckhps %xmm9, %xmm0
+ unpckhps %xmm11, %xmm1
+ unpcklps %xmm13, %xmm12
+ unpcklps %xmm15, %xmm14
+ unpckhps %xmm13, %xmm4
+ unpckhps %xmm15, %xmm5
+ movaps %xmm8, %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm12, %xmm6
+ movaps %xmm4, %xmm7
+ movlhps %xmm10, %xmm8
+ movhlps %xmm2, %xmm10
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ movlhps %xmm14, %xmm12
+ movhlps %xmm6, %xmm14
+ movlhps %xmm5, %xmm4
+ movhlps %xmm7, %xmm5
+ addps %xmm10, %xmm8
+ addps %xmm1, %xmm0
+ addps %xmm14, %xmm12
+ addps %xmm5, %xmm4
+ addps %xmm8, %xmm0
+ addps %xmm12, %xmm4
+
+ movaps %xmm0, %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm4, %xmm5
+ movaps %xmm4, %xmm6
+ cmpnleps XMMREG_MAX, %xmm2
+ cmpltps XMMREG_MIN, %xmm3
+ cmpnleps XMMREG_MAX, %xmm5
+ cmpltps XMMREG_MIN, %xmm6
+ cvtps2dq %xmm0, %xmm0
+ cvtps2dq %xmm4, %xmm4
+ movaps %xmm0, %xmm1
+ unpcklps %xmm4, %xmm0
+ unpckhps %xmm4, %xmm1
+ packssdw %xmm1, %xmm0
+ movups %xmm0, (SAMPLES)
+
+ packssdw %xmm5, %xmm2
+ packssdw %xmm6, %xmm3
+ psrlw $15, %xmm2
+ psrlw $15, %xmm3
+ paddw %xmm3, %xmm2
+ paddw TEMP_CLIP, %xmm2
+ movaps %xmm2, TEMP_CLIP
+
+ leaq 16(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ movaps TEMP_CLIP, %xmm4
+ movhlps %xmm4, %xmm0
+ paddw %xmm4, %xmm0
+ pshuflw $0x55, %xmm0, %xmm1
+ pshuflw $0xaa, %xmm0, %xmm2
+ pshuflw $0xff, %xmm0, %xmm3
+ paddw %xmm1, %xmm0
+ paddw %xmm2, %xmm0
+ paddw %xmm3, %xmm0
+
+ movd %xmm0, %eax
+ andl $0xffff, %eax
+
+#ifdef IS_MSABI
+ movaps 16(%rsp), %xmm6
+ movaps 32(%rsp), %xmm7
+ movaps 48(%rsp), %xmm8
+ movaps 64(%rsp), %xmm9
+ movaps 80(%rsp), %xmm10
+ movaps 96(%rsp), %xmm11
+ movaps 112(%rsp), %xmm12
+ movaps 128(%rsp), %xmm13
+ movaps 144(%rsp), %xmm14
+ movaps 160(%rsp), %xmm15
+ addq $176, %rsp
+ popq %rsi
+#else
+ addq $24, %rsp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_x86_64_float.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_x86_64_float.S
new file mode 100644
index 00000000..a1b381a3
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_x86_64_float.S
@@ -0,0 +1,396 @@
+/*
+ synth_stereo_x86_64_float: SSE optimized synth for x86-64 (stereo specific, float output version)
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifdef IS_MSABI
+/* short *window; */
+#define WINDOW %r10
+/* short *b0l; */
+#define B0L %rdx
+/* short *b0r; */
+#define B0R %r8
+/* short *samples; */
+#define SAMPLES %r9
+#else
+/* real *window; */
+#define WINDOW %rdi
+/* real *b0l; */
+#define B0L %rsi
+/* real *b0r; */
+#define B0R %rdx
+/* real *samples; */
+#define SAMPLES %r9
+#endif
+
+#define XMMREG_SCALE (%r11) /* {1/32768.0, 1/32768.0, 1/32768.0, 1/32768.0} */
+
+/*
+ int synth_1to1_real_s_x86_64_asm(real *window, real *b0l, real *b0r, real *samples, int bo1);
+ return value: number of clipped samples (0)
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+ASM_NAME(scale_x86_64):
+ .long 939524096
+ .long 939524096
+ .long 939524096
+ .long 939524096
+ .text
+ ALIGN16
+.globl ASM_NAME(synth_1to1_real_s_x86_64_asm)
+ASM_NAME(synth_1to1_real_s_x86_64_asm):
+#ifdef IS_MSABI /* should save xmm6-15 */
+ movl 40(%rsp), %eax /* 5th argument; placed after 32-byte shadow space */
+ subq $168, %rsp /* stack alignment + 10 xmm registers */
+ movaps %xmm6, (%rsp)
+ movaps %xmm7, 16(%rsp)
+ movaps %xmm8, 32(%rsp)
+ movaps %xmm9, 48(%rsp)
+ movaps %xmm10, 64(%rsp)
+ movaps %xmm11, 80(%rsp)
+ movaps %xmm12, 96(%rsp)
+ movaps %xmm13, 112(%rsp)
+ movaps %xmm14, 128(%rsp)
+ movaps %xmm15, 144(%rsp)
+#endif
+
+ leaq ASM_NAME(scale_x86_64)(%rip), %r11
+
+#ifdef IS_MSABI
+ shlq $32, %rax
+ shrq $30, %rax
+ movq %rcx, %r10
+#else
+ movq %r8, %rax
+ shlq $32, %rax
+ shrq $30, %rax
+ movq %rcx, %r9
+#endif
+ leaq 64(WINDOW), WINDOW
+ subq %rax, WINDOW
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm8
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm9
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ movaps %xmm8, %xmm0
+ movaps %xmm1, %xmm4
+ movaps %xmm2, %xmm10
+ movaps %xmm3, %xmm11
+ movaps %xmm9, %xmm12
+ movaps %xmm5, %xmm13
+ movaps %xmm6, %xmm14
+ movaps %xmm7, %xmm15
+ mulps (B0L), %xmm8
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 64(B0L), %xmm9
+ mulps 80(B0L), %xmm5
+ mulps 96(B0L), %xmm6
+ mulps 112(B0L), %xmm7
+ mulps (B0R), %xmm0
+ mulps 16(B0R), %xmm4
+ mulps 32(B0R), %xmm10
+ mulps 48(B0R), %xmm11
+ mulps 64(B0R), %xmm12
+ mulps 80(B0R), %xmm13
+ mulps 96(B0R), %xmm14
+ mulps 112(B0R), %xmm15
+
+ addps %xmm1, %xmm8
+ addps %xmm2, %xmm3
+ addps %xmm4, %xmm0
+ addps %xmm11, %xmm10
+ addps %xmm5, %xmm9
+ addps %xmm7, %xmm6
+ addps %xmm13, %xmm12
+ addps %xmm15, %xmm14
+ addps %xmm3, %xmm8
+ addps %xmm6, %xmm9
+ addps %xmm10, %xmm0
+ addps %xmm12, %xmm14
+ movaps %xmm0, %xmm12
+ movaps %xmm14, %xmm13
+ leaq 256(WINDOW), WINDOW
+ leaq 128(B0L), B0L
+ leaq 128(B0R), B0R
+
+ movups (WINDOW), %xmm10
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm11
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ movaps %xmm10, %xmm0
+ movaps %xmm1, %xmm4
+ movaps %xmm2, %xmm14
+ movaps %xmm3, %xmm15
+ mulps (B0L), %xmm10
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps (B0R), %xmm0
+ mulps 16(B0R), %xmm4
+ mulps 32(B0R), %xmm14
+ mulps 48(B0R), %xmm15
+ addps %xmm1, %xmm10
+ addps %xmm2, %xmm3
+ addps %xmm4, %xmm0
+ addps %xmm15, %xmm14
+ movaps %xmm11, %xmm1
+ movaps %xmm5, %xmm2
+ movaps %xmm6, %xmm4
+ movaps %xmm7, %xmm15
+ mulps 64(B0L), %xmm11
+ mulps 80(B0L), %xmm5
+ mulps 96(B0L), %xmm6
+ mulps 112(B0L), %xmm7
+ mulps 64(B0R), %xmm1
+ mulps 80(B0R), %xmm2
+ mulps 96(B0R), %xmm4
+ mulps 112(B0R), %xmm15
+ addps %xmm5, %xmm11
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm1
+ addps %xmm15, %xmm4
+
+ addps %xmm3, %xmm10
+ addps %xmm6, %xmm11
+ addps %xmm0, %xmm14
+ addps %xmm4, %xmm1
+ movaps %xmm1, %xmm15
+ leaq 256(WINDOW), WINDOW
+ leaq 128(B0L), B0L
+ leaq 128(B0R), B0R
+
+ movaps %xmm8, %xmm0
+ movaps %xmm10, %xmm1
+ movaps %xmm12, %xmm4
+ movaps %xmm14, %xmm5
+ unpcklps %xmm9, %xmm8
+ unpcklps %xmm11, %xmm10
+ unpckhps %xmm9, %xmm0
+ unpckhps %xmm11, %xmm1
+ unpcklps %xmm13, %xmm12
+ unpcklps %xmm15, %xmm14
+ unpckhps %xmm13, %xmm4
+ unpckhps %xmm15, %xmm5
+ movaps %xmm8, %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm12, %xmm6
+ movaps %xmm4, %xmm7
+ movlhps %xmm10, %xmm8
+ movhlps %xmm2, %xmm10
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ movlhps %xmm14, %xmm12
+ movhlps %xmm6, %xmm14
+ movlhps %xmm5, %xmm4
+ movhlps %xmm7, %xmm5
+ subps %xmm10, %xmm8
+ subps %xmm1, %xmm0
+ subps %xmm14, %xmm12
+ subps %xmm5, %xmm4
+ addps %xmm8, %xmm0
+ addps %xmm12, %xmm4
+
+ mulps XMMREG_SCALE, %xmm0
+ mulps XMMREG_SCALE, %xmm4
+ movaps %xmm0, %xmm1
+ unpcklps %xmm4, %xmm0
+ unpckhps %xmm4, %xmm1
+ movups %xmm0, (SAMPLES)
+ movups %xmm1, 16(SAMPLES)
+
+ leaq 32(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm8
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm9
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ movaps %xmm8, %xmm0
+ movaps %xmm1, %xmm4
+ movaps %xmm2, %xmm10
+ movaps %xmm3, %xmm11
+ movaps %xmm9, %xmm12
+ movaps %xmm5, %xmm13
+ movaps %xmm6, %xmm14
+ movaps %xmm7, %xmm15
+ mulps (B0L), %xmm8
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps -64(B0L), %xmm9
+ mulps -48(B0L), %xmm5
+ mulps -32(B0L), %xmm6
+ mulps -16(B0L), %xmm7
+ mulps (B0R), %xmm0
+ mulps 16(B0R), %xmm4
+ mulps 32(B0R), %xmm10
+ mulps 48(B0R), %xmm11
+ mulps -64(B0R), %xmm12
+ mulps -48(B0R), %xmm13
+ mulps -32(B0R), %xmm14
+ mulps -16(B0R), %xmm15
+
+ addps %xmm1, %xmm8
+ addps %xmm2, %xmm3
+ addps %xmm4, %xmm0
+ addps %xmm11, %xmm10
+ addps %xmm5, %xmm9
+ addps %xmm7, %xmm6
+ addps %xmm13, %xmm12
+ addps %xmm15, %xmm14
+ addps %xmm3, %xmm8
+ addps %xmm6, %xmm9
+ addps %xmm10, %xmm0
+ addps %xmm12, %xmm14
+ movaps %xmm0, %xmm12
+ movaps %xmm14, %xmm13
+ leaq 256(WINDOW), WINDOW
+ leaq -128(B0L), B0L
+ leaq -128(B0R), B0R
+
+ movups (WINDOW), %xmm10
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm11
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ movaps %xmm10, %xmm0
+ movaps %xmm1, %xmm4
+ movaps %xmm2, %xmm14
+ movaps %xmm3, %xmm15
+ mulps (B0L), %xmm10
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps (B0R), %xmm0
+ mulps 16(B0R), %xmm4
+ mulps 32(B0R), %xmm14
+ mulps 48(B0R), %xmm15
+ addps %xmm1, %xmm10
+ addps %xmm2, %xmm3
+ addps %xmm4, %xmm0
+ addps %xmm15, %xmm14
+ movaps %xmm11, %xmm1
+ movaps %xmm5, %xmm2
+ movaps %xmm6, %xmm4
+ movaps %xmm7, %xmm15
+ mulps -64(B0L), %xmm11
+ mulps -48(B0L), %xmm5
+ mulps -32(B0L), %xmm6
+ mulps -16(B0L), %xmm7
+ mulps -64(B0R), %xmm1
+ mulps -48(B0R), %xmm2
+ mulps -32(B0R), %xmm4
+ mulps -16(B0R), %xmm15
+ addps %xmm5, %xmm11
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm1
+ addps %xmm15, %xmm4
+
+ addps %xmm3, %xmm10
+ addps %xmm6, %xmm11
+ addps %xmm0, %xmm14
+ addps %xmm4, %xmm1
+ movaps %xmm1, %xmm15
+ leaq 256(WINDOW), WINDOW
+ leaq -128(B0L), B0L
+ leaq -128(B0R), B0R
+
+ movaps %xmm8, %xmm0
+ movaps %xmm10, %xmm1
+ movaps %xmm12, %xmm4
+ movaps %xmm14, %xmm5
+ unpcklps %xmm9, %xmm8
+ unpcklps %xmm11, %xmm10
+ unpckhps %xmm9, %xmm0
+ unpckhps %xmm11, %xmm1
+ unpcklps %xmm13, %xmm12
+ unpcklps %xmm15, %xmm14
+ unpckhps %xmm13, %xmm4
+ unpckhps %xmm15, %xmm5
+ movaps %xmm8, %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm12, %xmm6
+ movaps %xmm4, %xmm7
+ movlhps %xmm10, %xmm8
+ movhlps %xmm2, %xmm10
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ movlhps %xmm14, %xmm12
+ movhlps %xmm6, %xmm14
+ movlhps %xmm5, %xmm4
+ movhlps %xmm7, %xmm5
+ addps %xmm10, %xmm8
+ addps %xmm1, %xmm0
+ addps %xmm14, %xmm12
+ addps %xmm5, %xmm4
+ addps %xmm8, %xmm0
+ addps %xmm12, %xmm4
+
+ mulps XMMREG_SCALE, %xmm0
+ mulps XMMREG_SCALE, %xmm4
+ movaps %xmm0, %xmm1
+ unpcklps %xmm4, %xmm0
+ unpckhps %xmm4, %xmm1
+ movups %xmm0, (SAMPLES)
+ movups %xmm1, 16(SAMPLES)
+
+ leaq 32(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ xorl %eax, %eax
+
+#ifdef IS_MSABI
+ movaps (%rsp), %xmm6
+ movaps 16(%rsp), %xmm7
+ movaps 32(%rsp), %xmm8
+ movaps 48(%rsp), %xmm9
+ movaps 64(%rsp), %xmm10
+ movaps 80(%rsp), %xmm11
+ movaps 96(%rsp), %xmm12
+ movaps 112(%rsp), %xmm13
+ movaps 128(%rsp), %xmm14
+ movaps 144(%rsp), %xmm15
+ addq $168, %rsp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_x86_64_s32.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_x86_64_s32.S
new file mode 100644
index 00000000..a05c8961
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_stereo_x86_64_s32.S
@@ -0,0 +1,473 @@
+/*
+ synth_stereo_x86_64_s32: SSE optimized synth for x86-64 (stereo specific, s32 output version)
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifdef IS_MSABI
+/* short *window; */
+#define WINDOW %rsi
+/* short *b0l; */
+#define B0L %rdx
+/* short *b0r; */
+#define B0R %r8
+/* short *samples; */
+#define SAMPLES %rdi
+#else
+/* real *window; */
+#define WINDOW %rdi
+/* real *b0l; */
+#define B0L %rsi
+/* real *b0r; */
+#define B0R %rdx
+/* real *samples; */
+#define SAMPLES %r8
+#endif
+
+#define XMMREG_SCALE (%r9) /* {65536.0, 65536.0, 65536.0, 65536.0} */
+#define XMMREG_MAX (%r10) /* {32767.999, 32767.999, 32767.999, 32767.999} */
+#define XMMREG_MIN (%r11) /* {-32768.0, -32768.0, -32768.0, -32768.0} */
+#define TEMP_CLIP (%rsp)
+
+/*
+ int synth_1to1_s32_s_x86_64_asm(real *window, real *b0l, real *b0r, int32_t *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+ASM_NAME(scale_s32):
+ .long 1199570944
+ .long 1199570944
+ .long 1199570944
+ .long 1199570944
+ ALIGN16
+ASM_NAME(maxmin_s32):
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .text
+ ALIGN16
+.globl ASM_NAME(synth_1to1_s32_s_x86_64_asm)
+ASM_NAME(synth_1to1_s32_s_x86_64_asm):
+#ifdef IS_MSABI /* should save xmm6-15 */
+ movl 40(%rsp), %eax /* 5th argument; placed after 32-byte shadow space */
+ pushq %rsi
+ pushq %rdi
+ subq $184, %rsp /* stack alignment + 10 xmm registers + temp */
+ movaps %xmm6, 16(%rsp)
+ movaps %xmm7, 32(%rsp)
+ movaps %xmm8, 48(%rsp)
+ movaps %xmm9, 64(%rsp)
+ movaps %xmm10, 80(%rsp)
+ movaps %xmm11, 96(%rsp)
+ movaps %xmm12, 112(%rsp)
+ movaps %xmm13, 128(%rsp)
+ movaps %xmm14, 144(%rsp)
+ movaps %xmm15, 160(%rsp)
+#else
+ subq $24, %rsp /* stack alignment + temp */
+#endif
+
+#ifdef IS_MSABI
+ shlq $32, %rax
+ shrq $30, %rax
+ movq %rcx, %rsi
+ movq %r9, %rdi
+#else
+ movq %r8, %rax
+ shlq $32, %rax
+ shrq $30, %rax
+ movq %rcx, %r8
+#endif
+ leaq 64(WINDOW), WINDOW
+ subq %rax, WINDOW
+
+ leaq ASM_NAME(scale_s32)(%rip), %r9
+ leaq ASM_NAME(maxmin_s32)(%rip), %r10
+ leaq 16(%r10), %r11
+ xorps %xmm0, %xmm0
+ movaps %xmm0, TEMP_CLIP
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm8
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm9
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ movaps %xmm8, %xmm0
+ movaps %xmm1, %xmm4
+ movaps %xmm2, %xmm10
+ movaps %xmm3, %xmm11
+ movaps %xmm9, %xmm12
+ movaps %xmm5, %xmm13
+ movaps %xmm6, %xmm14
+ movaps %xmm7, %xmm15
+ mulps (B0L), %xmm8
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps 64(B0L), %xmm9
+ mulps 80(B0L), %xmm5
+ mulps 96(B0L), %xmm6
+ mulps 112(B0L), %xmm7
+ mulps (B0R), %xmm0
+ mulps 16(B0R), %xmm4
+ mulps 32(B0R), %xmm10
+ mulps 48(B0R), %xmm11
+ mulps 64(B0R), %xmm12
+ mulps 80(B0R), %xmm13
+ mulps 96(B0R), %xmm14
+ mulps 112(B0R), %xmm15
+
+ addps %xmm1, %xmm8
+ addps %xmm2, %xmm3
+ addps %xmm4, %xmm0
+ addps %xmm11, %xmm10
+ addps %xmm5, %xmm9
+ addps %xmm7, %xmm6
+ addps %xmm13, %xmm12
+ addps %xmm15, %xmm14
+ addps %xmm3, %xmm8
+ addps %xmm6, %xmm9
+ addps %xmm10, %xmm0
+ addps %xmm12, %xmm14
+ movaps %xmm0, %xmm12
+ movaps %xmm14, %xmm13
+ leaq 256(WINDOW), WINDOW
+ leaq 128(B0L), B0L
+ leaq 128(B0R), B0R
+
+ movups (WINDOW), %xmm10
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm11
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ movaps %xmm10, %xmm0
+ movaps %xmm1, %xmm4
+ movaps %xmm2, %xmm14
+ movaps %xmm3, %xmm15
+ mulps (B0L), %xmm10
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps (B0R), %xmm0
+ mulps 16(B0R), %xmm4
+ mulps 32(B0R), %xmm14
+ mulps 48(B0R), %xmm15
+ addps %xmm1, %xmm10
+ addps %xmm2, %xmm3
+ addps %xmm4, %xmm0
+ addps %xmm15, %xmm14
+ movaps %xmm11, %xmm1
+ movaps %xmm5, %xmm2
+ movaps %xmm6, %xmm4
+ movaps %xmm7, %xmm15
+ mulps 64(B0L), %xmm11
+ mulps 80(B0L), %xmm5
+ mulps 96(B0L), %xmm6
+ mulps 112(B0L), %xmm7
+ mulps 64(B0R), %xmm1
+ mulps 80(B0R), %xmm2
+ mulps 96(B0R), %xmm4
+ mulps 112(B0R), %xmm15
+ addps %xmm5, %xmm11
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm1
+ addps %xmm15, %xmm4
+
+ addps %xmm3, %xmm10
+ addps %xmm6, %xmm11
+ addps %xmm0, %xmm14
+ addps %xmm4, %xmm1
+ movaps %xmm1, %xmm15
+ leaq 256(WINDOW), WINDOW
+ leaq 128(B0L), B0L
+ leaq 128(B0R), B0R
+
+ movaps %xmm8, %xmm0
+ movaps %xmm10, %xmm1
+ movaps %xmm12, %xmm4
+ movaps %xmm14, %xmm5
+ unpcklps %xmm9, %xmm8
+ unpcklps %xmm11, %xmm10
+ unpckhps %xmm9, %xmm0
+ unpckhps %xmm11, %xmm1
+ unpcklps %xmm13, %xmm12
+ unpcklps %xmm15, %xmm14
+ unpckhps %xmm13, %xmm4
+ unpckhps %xmm15, %xmm5
+ movaps %xmm8, %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm12, %xmm6
+ movaps %xmm4, %xmm7
+ movlhps %xmm10, %xmm8
+ movhlps %xmm2, %xmm10
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ movlhps %xmm14, %xmm12
+ movhlps %xmm6, %xmm14
+ movlhps %xmm5, %xmm4
+ movhlps %xmm7, %xmm5
+ subps %xmm10, %xmm8
+ subps %xmm1, %xmm0
+ subps %xmm14, %xmm12
+ subps %xmm5, %xmm4
+ addps %xmm8, %xmm0
+ addps %xmm12, %xmm4
+
+ movaps %xmm0, %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm4, %xmm5
+ movaps %xmm4, %xmm6
+ mulps XMMREG_SCALE, %xmm0
+ mulps XMMREG_SCALE, %xmm4
+ cmpnleps XMMREG_MAX, %xmm2
+ cmpltps XMMREG_MIN, %xmm3
+ cmpnleps XMMREG_MAX, %xmm5
+ cmpltps XMMREG_MIN, %xmm6
+ cvtps2dq %xmm0, %xmm0
+ cvtps2dq %xmm4, %xmm4
+ xorps %xmm2, %xmm0
+ xorps %xmm5, %xmm4
+ movaps %xmm0, %xmm1
+ unpcklps %xmm4, %xmm0
+ unpckhps %xmm4, %xmm1
+ movups %xmm0, (SAMPLES)
+ movups %xmm1, 16(SAMPLES)
+
+ packssdw %xmm5, %xmm2
+ packssdw %xmm6, %xmm3
+ psrlw $15, %xmm2
+ psrlw $15, %xmm3
+ paddw %xmm3, %xmm2
+ paddw TEMP_CLIP, %xmm2
+ movaps %xmm2, TEMP_CLIP
+
+ leaq 32(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (WINDOW), %xmm8
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm9
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ movaps %xmm8, %xmm0
+ movaps %xmm1, %xmm4
+ movaps %xmm2, %xmm10
+ movaps %xmm3, %xmm11
+ movaps %xmm9, %xmm12
+ movaps %xmm5, %xmm13
+ movaps %xmm6, %xmm14
+ movaps %xmm7, %xmm15
+ mulps (B0L), %xmm8
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps -64(B0L), %xmm9
+ mulps -48(B0L), %xmm5
+ mulps -32(B0L), %xmm6
+ mulps -16(B0L), %xmm7
+ mulps (B0R), %xmm0
+ mulps 16(B0R), %xmm4
+ mulps 32(B0R), %xmm10
+ mulps 48(B0R), %xmm11
+ mulps -64(B0R), %xmm12
+ mulps -48(B0R), %xmm13
+ mulps -32(B0R), %xmm14
+ mulps -16(B0R), %xmm15
+
+ addps %xmm1, %xmm8
+ addps %xmm2, %xmm3
+ addps %xmm4, %xmm0
+ addps %xmm11, %xmm10
+ addps %xmm5, %xmm9
+ addps %xmm7, %xmm6
+ addps %xmm13, %xmm12
+ addps %xmm15, %xmm14
+ addps %xmm3, %xmm8
+ addps %xmm6, %xmm9
+ addps %xmm10, %xmm0
+ addps %xmm12, %xmm14
+ movaps %xmm0, %xmm12
+ movaps %xmm14, %xmm13
+ leaq 256(WINDOW), WINDOW
+ leaq -128(B0L), B0L
+ leaq -128(B0R), B0R
+
+ movups (WINDOW), %xmm10
+ movups 16(WINDOW), %xmm1
+ movups 32(WINDOW), %xmm2
+ movups 48(WINDOW), %xmm3
+ movups 128(WINDOW), %xmm11
+ movups 144(WINDOW), %xmm5
+ movups 160(WINDOW), %xmm6
+ movups 176(WINDOW), %xmm7
+ movaps %xmm10, %xmm0
+ movaps %xmm1, %xmm4
+ movaps %xmm2, %xmm14
+ movaps %xmm3, %xmm15
+ mulps (B0L), %xmm10
+ mulps 16(B0L), %xmm1
+ mulps 32(B0L), %xmm2
+ mulps 48(B0L), %xmm3
+ mulps (B0R), %xmm0
+ mulps 16(B0R), %xmm4
+ mulps 32(B0R), %xmm14
+ mulps 48(B0R), %xmm15
+ addps %xmm1, %xmm10
+ addps %xmm2, %xmm3
+ addps %xmm4, %xmm0
+ addps %xmm15, %xmm14
+ movaps %xmm11, %xmm1
+ movaps %xmm5, %xmm2
+ movaps %xmm6, %xmm4
+ movaps %xmm7, %xmm15
+ mulps -64(B0L), %xmm11
+ mulps -48(B0L), %xmm5
+ mulps -32(B0L), %xmm6
+ mulps -16(B0L), %xmm7
+ mulps -64(B0R), %xmm1
+ mulps -48(B0R), %xmm2
+ mulps -32(B0R), %xmm4
+ mulps -16(B0R), %xmm15
+ addps %xmm5, %xmm11
+ addps %xmm7, %xmm6
+ addps %xmm2, %xmm1
+ addps %xmm15, %xmm4
+
+ addps %xmm3, %xmm10
+ addps %xmm6, %xmm11
+ addps %xmm0, %xmm14
+ addps %xmm4, %xmm1
+ movaps %xmm1, %xmm15
+ leaq 256(WINDOW), WINDOW
+ leaq -128(B0L), B0L
+ leaq -128(B0R), B0R
+
+ movaps %xmm8, %xmm0
+ movaps %xmm10, %xmm1
+ movaps %xmm12, %xmm4
+ movaps %xmm14, %xmm5
+ unpcklps %xmm9, %xmm8
+ unpcklps %xmm11, %xmm10
+ unpckhps %xmm9, %xmm0
+ unpckhps %xmm11, %xmm1
+ unpcklps %xmm13, %xmm12
+ unpcklps %xmm15, %xmm14
+ unpckhps %xmm13, %xmm4
+ unpckhps %xmm15, %xmm5
+ movaps %xmm8, %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm12, %xmm6
+ movaps %xmm4, %xmm7
+ movlhps %xmm10, %xmm8
+ movhlps %xmm2, %xmm10
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ movlhps %xmm14, %xmm12
+ movhlps %xmm6, %xmm14
+ movlhps %xmm5, %xmm4
+ movhlps %xmm7, %xmm5
+ addps %xmm10, %xmm8
+ addps %xmm1, %xmm0
+ addps %xmm14, %xmm12
+ addps %xmm5, %xmm4
+ addps %xmm8, %xmm0
+ addps %xmm12, %xmm4
+
+ movaps %xmm0, %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm4, %xmm5
+ movaps %xmm4, %xmm6
+ mulps XMMREG_SCALE, %xmm0
+ mulps XMMREG_SCALE, %xmm4
+ cmpnleps XMMREG_MAX, %xmm2
+ cmpltps XMMREG_MIN, %xmm3
+ cmpnleps XMMREG_MAX, %xmm5
+ cmpltps XMMREG_MIN, %xmm6
+ cvtps2dq %xmm0, %xmm0
+ cvtps2dq %xmm4, %xmm4
+ xorps %xmm2, %xmm0
+ xorps %xmm5, %xmm4
+ movaps %xmm0, %xmm1
+ unpcklps %xmm4, %xmm0
+ unpckhps %xmm4, %xmm1
+ movups %xmm0, (SAMPLES)
+ movups %xmm1, 16(SAMPLES)
+
+ packssdw %xmm5, %xmm2
+ packssdw %xmm6, %xmm3
+ psrlw $15, %xmm2
+ psrlw $15, %xmm3
+ paddw %xmm3, %xmm2
+ paddw TEMP_CLIP, %xmm2
+ movaps %xmm2, TEMP_CLIP
+
+ leaq 32(SAMPLES), SAMPLES
+ decl %ecx
+ jnz 1b
+
+ movaps TEMP_CLIP, %xmm4
+ movhlps %xmm4, %xmm0
+ paddw %xmm4, %xmm0
+ pshuflw $0x55, %xmm0, %xmm1
+ pshuflw $0xaa, %xmm0, %xmm2
+ pshuflw $0xff, %xmm0, %xmm3
+ paddw %xmm1, %xmm0
+ paddw %xmm2, %xmm0
+ paddw %xmm3, %xmm0
+
+ movd %xmm0, %eax
+ andl $0xffff, %eax
+
+#ifdef IS_MSABI
+ movaps 16(%rsp), %xmm6
+ movaps 32(%rsp), %xmm7
+ movaps 48(%rsp), %xmm8
+ movaps 64(%rsp), %xmm9
+ movaps 80(%rsp), %xmm10
+ movaps 96(%rsp), %xmm11
+ movaps 112(%rsp), %xmm12
+ movaps 128(%rsp), %xmm13
+ movaps 144(%rsp), %xmm14
+ movaps 160(%rsp), %xmm15
+ addq $184, %rsp
+ popq %rdi
+ popq %rsi
+#else
+ addq $24, %rsp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_x86_64.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_x86_64.S
new file mode 100644
index 00000000..eac72374
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_x86_64.S
@@ -0,0 +1,244 @@
+/*
+ synth_x86_64: SSE optimized synth for x86-64
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifdef IS_MSABI
+/* short *window; */
+#define ARG0 %r10
+/* short *b0; */
+#define ARG1 %rdx
+/* short *samples; */
+#define ARG2 %r8
+/* int bo1; */
+#define ARG3 %r9
+#else
+/* short *window; */
+#define ARG0 %rdi
+/* short *b0; */
+#define ARG1 %rsi
+/* short *samples; */
+#define ARG2 %rdx
+/* int bo1; */
+#define ARG3 %rcx
+#endif
+
+#define XMMREG_CLIP %xmm15
+#define XMMREG_MAX %xmm14 /* {32767, 32767, 32767, 32767} */
+#define XMMREG_MIN %xmm13 /* {-32769, -32769, -32769, -32769} : not -32768 because SSE doesn't have "less than" comparison... */
+#define XMMREG_FULL %xmm12 /* {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF} */
+
+/*
+ int synth_1to1_x86_64_asm(short *window, short *b0, short *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+ASM_NAME(maxmin_x86_64):
+ .long 32767
+ .long 32767
+ .long 32767
+ .long 32767
+ .long -32769
+ .long -32769
+ .long -32769
+ .long -32769
+ .text
+ ALIGN16
+.globl ASM_NAME(synth_1to1_x86_64_asm)
+ASM_NAME(synth_1to1_x86_64_asm):
+#ifdef IS_MSABI /* should save xmm6-15 */
+ movq %rcx, ARG0
+ subq $104, %rsp /* stack alignment + 6 xmm registers */
+ movaps %xmm6, (%rsp)
+ movaps %xmm7, 16(%rsp)
+ movaps %xmm12, 32(%rsp)
+ movaps %xmm13, 48(%rsp)
+ movaps %xmm14, 64(%rsp)
+ movaps %xmm15, 80(%rsp)
+#endif
+
+ leaq ASM_NAME(maxmin_x86_64)(%rip), %rax
+ movaps (%rax), XMMREG_MAX
+ movaps 16(%rax), XMMREG_MIN
+ pxor XMMREG_CLIP, XMMREG_CLIP
+ pcmpeqd XMMREG_FULL, XMMREG_FULL
+
+ andq $0xf, ARG3
+ shlq $1, ARG3
+ leaq 32(ARG0), ARG0
+ subq ARG3, ARG0
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (ARG0), %xmm0
+ movups 16(ARG0), %xmm1
+ movups 64(ARG0), %xmm2
+ movups 80(ARG0), %xmm3
+ movups 128(ARG0), %xmm4
+ movups 144(ARG0), %xmm5
+ movups 192(ARG0), %xmm6
+ movups 208(ARG0), %xmm7
+ pmaddwd (ARG1), %xmm0
+ pmaddwd 16(ARG1), %xmm1
+ pmaddwd 32(ARG1), %xmm2
+ pmaddwd 48(ARG1), %xmm3
+ pmaddwd 64(ARG1), %xmm4
+ pmaddwd 80(ARG1), %xmm5
+ pmaddwd 96(ARG1), %xmm6
+ pmaddwd 112(ARG1), %xmm7
+
+ paddd %xmm1, %xmm0
+ paddd %xmm3, %xmm2
+ paddd %xmm5, %xmm4
+ paddd %xmm7, %xmm6
+
+ movaps %xmm0, %xmm1
+ movaps %xmm4, %xmm3
+ punpckldq %xmm2, %xmm0
+ punpckldq %xmm6, %xmm4
+ punpckhdq %xmm2, %xmm1
+ punpckhdq %xmm6, %xmm3
+ movaps %xmm0, %xmm5
+ movaps %xmm1, %xmm7
+ movlhps %xmm4, %xmm0
+ movhlps %xmm5, %xmm4
+ movlhps %xmm3, %xmm1
+ movhlps %xmm7, %xmm3
+ paddd %xmm4, %xmm0
+ paddd %xmm3, %xmm1
+ paddd %xmm1, %xmm0
+ psrad $13, %xmm0
+
+ movups (ARG2), %xmm3
+ movaps %xmm0, %xmm1
+ movaps %xmm0, %xmm2
+ packssdw %xmm0, %xmm0
+ pcmpgtd XMMREG_MAX, %xmm1
+ pcmpgtd XMMREG_MIN, %xmm2
+ movhlps %xmm3, %xmm4
+ pshuflw $0xdd, %xmm3, %xmm3
+ pshuflw $0xdd, %xmm4, %xmm4
+ psrlq $32, %xmm3
+ psllq $32, %xmm4
+ por %xmm4, %xmm3
+ punpcklwd %xmm3, %xmm0
+ movups %xmm0, (ARG2)
+
+ pxor XMMREG_FULL, %xmm2
+ psrld $31, %xmm1
+ psrld $31, %xmm2
+ paddd %xmm2, %xmm1
+ paddd %xmm1, XMMREG_CLIP
+
+ leaq 256(ARG0), ARG0
+ leaq 128(ARG1), ARG1
+ leaq 16(ARG2), ARG2
+
+ decl %ecx
+ jnz 1b
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (ARG0), %xmm0
+ movups 16(ARG0), %xmm1
+ movups 64(ARG0), %xmm2
+ movups 80(ARG0), %xmm3
+ movups 128(ARG0), %xmm4
+ movups 144(ARG0), %xmm5
+ movups 192(ARG0), %xmm6
+ movups 208(ARG0), %xmm7
+ pmaddwd (ARG1), %xmm0
+ pmaddwd 16(ARG1), %xmm1
+ pmaddwd -32(ARG1), %xmm2
+ pmaddwd -16(ARG1), %xmm3
+ pmaddwd -64(ARG1), %xmm4
+ pmaddwd -48(ARG1), %xmm5
+ pmaddwd -96(ARG1), %xmm6
+ pmaddwd -80(ARG1), %xmm7
+
+ paddd %xmm1, %xmm0
+ paddd %xmm3, %xmm2
+ paddd %xmm5, %xmm4
+ paddd %xmm7, %xmm6
+
+ movaps %xmm0, %xmm1
+ movaps %xmm4, %xmm3
+ punpckldq %xmm2, %xmm0
+ punpckldq %xmm6, %xmm4
+ punpckhdq %xmm2, %xmm1
+ punpckhdq %xmm6, %xmm3
+ movaps %xmm0, %xmm5
+ movaps %xmm1, %xmm7
+ movlhps %xmm4, %xmm0
+ movhlps %xmm5, %xmm4
+ movlhps %xmm3, %xmm1
+ movhlps %xmm7, %xmm3
+ paddd %xmm4, %xmm0
+ paddd %xmm3, %xmm1
+ paddd %xmm1, %xmm0
+ psrad $13, %xmm0
+
+ movups (ARG2), %xmm3
+ movaps %xmm0, %xmm1
+ movaps %xmm0, %xmm2
+ packssdw %xmm0, %xmm0
+ pcmpgtd XMMREG_MAX, %xmm1
+ pcmpgtd XMMREG_MIN, %xmm2
+ movhlps %xmm3, %xmm4
+ pshuflw $0xdd, %xmm3, %xmm3
+ pshuflw $0xdd, %xmm4, %xmm4
+ psrlq $32, %xmm3
+ psllq $32, %xmm4
+ por %xmm4, %xmm3
+ punpcklwd %xmm3, %xmm0
+ movups %xmm0, (ARG2)
+
+ pxor XMMREG_FULL, %xmm2
+ psrld $31, %xmm1
+ psrld $31, %xmm2
+ paddd %xmm2, %xmm1
+ paddd %xmm1, XMMREG_CLIP
+
+ leaq 256(ARG0), ARG0
+ leaq -128(ARG1), ARG1
+ leaq 16(ARG2), ARG2
+
+ decl %ecx
+ jnz 1b
+
+ pshuflw $0xee, XMMREG_CLIP, %xmm0
+ movhlps XMMREG_CLIP, %xmm1
+ pshuflw $0xee, %xmm1, %xmm2
+ paddd %xmm0, XMMREG_CLIP
+ paddd %xmm1, XMMREG_CLIP
+ paddd %xmm2, XMMREG_CLIP
+
+ movd XMMREG_CLIP, %eax
+
+#ifdef IS_MSABI
+ movaps (%rsp), %xmm6
+ movaps 16(%rsp), %xmm7
+ movaps 32(%rsp), %xmm12
+ movaps 48(%rsp), %xmm13
+ movaps 64(%rsp), %xmm14
+ movaps 80(%rsp), %xmm15
+ addq $104, %rsp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_x86_64_accurate.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_x86_64_accurate.S
new file mode 100644
index 00000000..d841e8e0
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_x86_64_accurate.S
@@ -0,0 +1,301 @@
+/*
+ synth_x86_64_accurate: SSE optimized synth for x86-64 (MPEG-compliant 16bit output version)
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifdef IS_MSABI
+/* short *window; */
+#define ARG0 %r10
+/* short *b0; */
+#define ARG1 %rdx
+/* short *samples; */
+#define ARG2 %r8
+/* int bo1; */
+#define ARG3 %r9
+#else
+/* real *window; */
+#define ARG0 %rdi
+/* real *b0; */
+#define ARG1 %rsi
+/* real *samples; */
+#define ARG2 %rdx
+/* int bo1; */
+#define ARG3 %rcx
+#endif
+
+#define XMMREG_MAX %xmm15 /* {32767.0, 32767.0, 32767.0, 32767.0} */
+#define XMMREG_MIN %xmm14 /* {-32768.0, -32768.0, -32768.0, -32768.0} */
+#define XMMREG_CLIP %xmm13
+
+/*
+ int synth_1to1_x86_64_accurate_asm(real *window, real *b0, short *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+ASM_NAME(maxmin_s16):
+ .long 1191181824
+ .long 1191181824
+ .long 1191181824
+ .long 1191181824
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .text
+ ALIGN16
+.globl ASM_NAME(synth_1to1_x86_64_accurate_asm)
+ASM_NAME(synth_1to1_x86_64_accurate_asm):
+#ifdef IS_MSABI /* should save xmm6-15 */
+ movq %rcx, ARG0
+ subq $152, %rsp /* stack alignment + 9 xmm registers */
+ movaps %xmm6, (%rsp)
+ movaps %xmm7, 16(%rsp)
+ movaps %xmm8, 32(%rsp)
+ movaps %xmm9, 48(%rsp)
+ movaps %xmm10, 64(%rsp)
+ movaps %xmm11, 80(%rsp)
+ movaps %xmm13, 96(%rsp)
+ movaps %xmm14, 112(%rsp)
+ movaps %xmm15, 128(%rsp)
+#endif
+
+ leaq ASM_NAME(maxmin_s16)(%rip), %rax
+ movaps (%rax), XMMREG_MAX
+ movaps 16(%rax), XMMREG_MIN
+
+ xorps XMMREG_CLIP, XMMREG_CLIP
+
+ andq $0xf, ARG3
+ shlq $2, ARG3
+ leaq 64(ARG0), ARG0
+ subq ARG3, ARG0
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (ARG0), %xmm8
+ movups 16(ARG0), %xmm1
+ movups 32(ARG0), %xmm2
+ movups 48(ARG0), %xmm3
+ movups 128(ARG0), %xmm9
+ movups 144(ARG0), %xmm5
+ movups 160(ARG0), %xmm6
+ movups 176(ARG0), %xmm7
+ mulps (ARG1), %xmm8
+ mulps 16(ARG1), %xmm1
+ mulps 32(ARG1), %xmm2
+ mulps 48(ARG1), %xmm3
+ mulps 64(ARG1), %xmm9
+ mulps 80(ARG1), %xmm5
+ mulps 96(ARG1), %xmm6
+ mulps 112(ARG1), %xmm7
+
+ addps %xmm1, %xmm8
+ addps %xmm2, %xmm3
+ addps %xmm5, %xmm9
+ addps %xmm7, %xmm6
+ addps %xmm3, %xmm8
+ addps %xmm6, %xmm9
+ leaq 256(ARG0), ARG0
+ leaq 128(ARG1), ARG1
+
+ movups (ARG0), %xmm10
+ movups 16(ARG0), %xmm1
+ movups 32(ARG0), %xmm2
+ movups 48(ARG0), %xmm3
+ movups 128(ARG0), %xmm11
+ movups 144(ARG0), %xmm5
+ movups 160(ARG0), %xmm6
+ movups 176(ARG0), %xmm7
+ mulps (ARG1), %xmm10
+ mulps 16(ARG1), %xmm1
+ mulps 32(ARG1), %xmm2
+ mulps 48(ARG1), %xmm3
+ mulps 64(ARG1), %xmm11
+ mulps 80(ARG1), %xmm5
+ mulps 96(ARG1), %xmm6
+ mulps 112(ARG1), %xmm7
+
+ addps %xmm1, %xmm10
+ addps %xmm2, %xmm3
+ addps %xmm5, %xmm11
+ addps %xmm7, %xmm6
+ addps %xmm3, %xmm10
+ addps %xmm6, %xmm11
+ leaq 256(ARG0), ARG0
+ leaq 128(ARG1), ARG1
+
+ movaps %xmm8, %xmm0
+ movaps %xmm10, %xmm1
+ unpcklps %xmm9, %xmm8
+ unpcklps %xmm11, %xmm10
+ unpckhps %xmm9, %xmm0
+ unpckhps %xmm11, %xmm1
+ movaps %xmm8, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm10, %xmm8
+ movhlps %xmm2, %xmm10
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ subps %xmm10, %xmm8
+ subps %xmm1, %xmm0
+ addps %xmm8, %xmm0
+
+ movups (ARG2), %xmm3
+ movaps %xmm0, %xmm1
+ movaps %xmm0, %xmm2
+ cmpnleps XMMREG_MAX, %xmm1
+ cmpltps XMMREG_MIN, %xmm2
+ cvtps2dq %xmm0, %xmm0
+ packssdw %xmm0, %xmm0
+ movhlps %xmm3, %xmm4
+ pshuflw $0xdd, %xmm3, %xmm3
+ pshuflw $0xdd, %xmm4, %xmm4
+ psrlq $32, %xmm3
+ psllq $32, %xmm4
+ por %xmm4, %xmm3
+ punpcklwd %xmm3, %xmm0
+ movups %xmm0, (ARG2)
+
+ psrld $31, %xmm1
+ psrld $31, %xmm2
+ paddd %xmm2, %xmm1
+ paddd %xmm1, XMMREG_CLIP
+
+ leaq 16(ARG2), ARG2
+ decl %ecx
+ jnz 1b
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (ARG0), %xmm8
+ movups 16(ARG0), %xmm1
+ movups 32(ARG0), %xmm2
+ movups 48(ARG0), %xmm3
+ movups 128(ARG0), %xmm9
+ movups 144(ARG0), %xmm5
+ movups 160(ARG0), %xmm6
+ movups 176(ARG0), %xmm7
+ mulps (ARG1), %xmm8
+ mulps 16(ARG1), %xmm1
+ mulps 32(ARG1), %xmm2
+ mulps 48(ARG1), %xmm3
+ mulps -64(ARG1), %xmm9
+ mulps -48(ARG1), %xmm5
+ mulps -32(ARG1), %xmm6
+ mulps -16(ARG1), %xmm7
+
+ addps %xmm1, %xmm8
+ addps %xmm2, %xmm3
+ addps %xmm5, %xmm9
+ addps %xmm7, %xmm6
+ addps %xmm3, %xmm8
+ addps %xmm6, %xmm9
+ leaq 256(ARG0), ARG0
+ leaq -128(ARG1), ARG1
+
+ movups (ARG0), %xmm10
+ movups 16(ARG0), %xmm1
+ movups 32(ARG0), %xmm2
+ movups 48(ARG0), %xmm3
+ movups 128(ARG0), %xmm11
+ movups 144(ARG0), %xmm5
+ movups 160(ARG0), %xmm6
+ movups 176(ARG0), %xmm7
+ mulps (ARG1), %xmm10
+ mulps 16(ARG1), %xmm1
+ mulps 32(ARG1), %xmm2
+ mulps 48(ARG1), %xmm3
+ mulps -64(ARG1), %xmm11
+ mulps -48(ARG1), %xmm5
+ mulps -32(ARG1), %xmm6
+ mulps -16(ARG1), %xmm7
+
+ addps %xmm1, %xmm10
+ addps %xmm2, %xmm3
+ addps %xmm5, %xmm11
+ addps %xmm7, %xmm6
+ addps %xmm3, %xmm10
+ addps %xmm6, %xmm11
+ leaq 256(ARG0), ARG0
+ leaq -128(ARG1), ARG1
+
+ movaps %xmm8, %xmm0
+ movaps %xmm10, %xmm1
+ unpcklps %xmm9, %xmm8
+ unpcklps %xmm11, %xmm10
+ unpckhps %xmm9, %xmm0
+ unpckhps %xmm11, %xmm1
+ movaps %xmm8, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm10, %xmm8
+ movhlps %xmm2, %xmm10
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ addps %xmm10, %xmm8
+ addps %xmm1, %xmm0
+ addps %xmm8, %xmm0
+
+ movups (ARG2), %xmm3
+ movaps %xmm0, %xmm1
+ movaps %xmm0, %xmm2
+ cmpnleps XMMREG_MAX, %xmm1
+ cmpltps XMMREG_MIN, %xmm2
+ cvtps2dq %xmm0, %xmm0
+ packssdw %xmm0, %xmm0
+ movhlps %xmm3, %xmm4
+ pshuflw $0xdd, %xmm3, %xmm3
+ pshuflw $0xdd, %xmm4, %xmm4
+ psrlq $32, %xmm3
+ psllq $32, %xmm4
+ por %xmm4, %xmm3
+ punpcklwd %xmm3, %xmm0
+ movups %xmm0, (ARG2)
+
+ psrld $31, %xmm1
+ psrld $31, %xmm2
+ paddd %xmm2, %xmm1
+ paddd %xmm1, XMMREG_CLIP
+
+ leaq 16(ARG2), ARG2
+ decl %ecx
+ jnz 1b
+
+ pshuflw $0xee, XMMREG_CLIP, %xmm0
+ movhlps XMMREG_CLIP, %xmm1
+ pshuflw $0xee, %xmm1, %xmm2
+ paddd %xmm0, XMMREG_CLIP
+ paddd %xmm1, XMMREG_CLIP
+ paddd %xmm2, XMMREG_CLIP
+
+ movd XMMREG_CLIP, %eax
+
+#ifdef IS_MSABI
+ movaps (%rsp), %xmm6
+ movaps 16(%rsp), %xmm7
+ movaps 32(%rsp), %xmm8
+ movaps 48(%rsp), %xmm9
+ movaps 64(%rsp), %xmm10
+ movaps 80(%rsp), %xmm11
+ movaps 96(%rsp), %xmm13
+ movaps 112(%rsp), %xmm14
+ movaps 128(%rsp), %xmm15
+ addq $152, %rsp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_x86_64_float.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_x86_64_float.S
new file mode 100644
index 00000000..a26ee6b0
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_x86_64_float.S
@@ -0,0 +1,259 @@
+/*
+ synth_x86_64_float: SSE optimized synth for x86-64 (float output version)
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifdef IS_MSABI
+/* short *window; */
+#define ARG0 %r10
+/* short *b0; */
+#define ARG1 %rdx
+/* short *samples; */
+#define ARG2 %r8
+/* int bo1; */
+#define ARG3 %r9
+#else
+/* real *window; */
+#define ARG0 %rdi
+/* real *b0; */
+#define ARG1 %rsi
+/* real *samples; */
+#define ARG2 %rdx
+/* int bo1; */
+#define ARG3 %rcx
+#endif
+
+#define XMMREG_SCALE %xmm15 /* {1/32768.0, 1/32768.0, 1/32768.0, 1/32768.0} */
+
+/*
+ int synth_1to1_real_x86_64_asm(real *window, real *b0, real *samples, int bo1);
+ return value: number of clipped samples (0)
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+ASM_NAME(scale_x86_64):
+ .long 939524096
+ .long 939524096
+ .long 939524096
+ .long 939524096
+ .text
+ ALIGN16
+.globl ASM_NAME(synth_1to1_real_x86_64_asm)
+ASM_NAME(synth_1to1_real_x86_64_asm):
+#ifdef IS_MSABI /* should save xmm6-15 */
+ movq %rcx, ARG0
+ subq $120, %rsp /* stack alignment + 7 xmm registers */
+ movaps %xmm6, (%rsp)
+ movaps %xmm7, 16(%rsp)
+ movaps %xmm8, 32(%rsp)
+ movaps %xmm9, 48(%rsp)
+ movaps %xmm10, 64(%rsp)
+ movaps %xmm11, 80(%rsp)
+ movaps %xmm15, 96(%rsp)
+#endif
+
+ leaq ASM_NAME(scale_x86_64)(%rip), %rax
+ movaps (%rax), XMMREG_SCALE
+
+ andq $0xf, ARG3
+ shlq $2, ARG3
+ leaq 64(ARG0), ARG0
+ subq ARG3, ARG0
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (ARG0), %xmm8
+ movups 16(ARG0), %xmm1
+ movups 32(ARG0), %xmm2
+ movups 48(ARG0), %xmm3
+ movups 128(ARG0), %xmm9
+ movups 144(ARG0), %xmm5
+ movups 160(ARG0), %xmm6
+ movups 176(ARG0), %xmm7
+ mulps (ARG1), %xmm8
+ mulps 16(ARG1), %xmm1
+ mulps 32(ARG1), %xmm2
+ mulps 48(ARG1), %xmm3
+ mulps 64(ARG1), %xmm9
+ mulps 80(ARG1), %xmm5
+ mulps 96(ARG1), %xmm6
+ mulps 112(ARG1), %xmm7
+
+ addps %xmm1, %xmm8
+ addps %xmm2, %xmm3
+ addps %xmm5, %xmm9
+ addps %xmm7, %xmm6
+ addps %xmm3, %xmm8
+ addps %xmm6, %xmm9
+ leaq 256(ARG0), ARG0
+ leaq 128(ARG1), ARG1
+
+ movups (ARG0), %xmm10
+ movups 16(ARG0), %xmm1
+ movups 32(ARG0), %xmm2
+ movups 48(ARG0), %xmm3
+ movups 128(ARG0), %xmm11
+ movups 144(ARG0), %xmm5
+ movups 160(ARG0), %xmm6
+ movups 176(ARG0), %xmm7
+ mulps (ARG1), %xmm10
+ mulps 16(ARG1), %xmm1
+ mulps 32(ARG1), %xmm2
+ mulps 48(ARG1), %xmm3
+ mulps 64(ARG1), %xmm11
+ mulps 80(ARG1), %xmm5
+ mulps 96(ARG1), %xmm6
+ mulps 112(ARG1), %xmm7
+
+ addps %xmm1, %xmm10
+ addps %xmm2, %xmm3
+ addps %xmm5, %xmm11
+ addps %xmm7, %xmm6
+ addps %xmm3, %xmm10
+ addps %xmm6, %xmm11
+ leaq 256(ARG0), ARG0
+ leaq 128(ARG1), ARG1
+
+ movaps %xmm8, %xmm0
+ movaps %xmm10, %xmm1
+ unpcklps %xmm9, %xmm8
+ unpcklps %xmm11, %xmm10
+ unpckhps %xmm9, %xmm0
+ unpckhps %xmm11, %xmm1
+ movaps %xmm8, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm10, %xmm8
+ movhlps %xmm2, %xmm10
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ subps %xmm10, %xmm8
+ subps %xmm1, %xmm0
+ addps %xmm8, %xmm0
+
+ movups (ARG2), %xmm1
+ movups 16(ARG2), %xmm2
+ mulps XMMREG_SCALE, %xmm0
+ shufps $0xdd, %xmm2, %xmm1
+ movaps %xmm0, %xmm2
+ unpcklps %xmm1, %xmm0
+ unpckhps %xmm1, %xmm2
+ movups %xmm0, (ARG2)
+ movups %xmm2, 16(ARG2)
+
+ leaq 32(ARG2), ARG2
+ decl %ecx
+ jnz 1b
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (ARG0), %xmm8
+ movups 16(ARG0), %xmm1
+ movups 32(ARG0), %xmm2
+ movups 48(ARG0), %xmm3
+ movups 128(ARG0), %xmm9
+ movups 144(ARG0), %xmm5
+ movups 160(ARG0), %xmm6
+ movups 176(ARG0), %xmm7
+ mulps (ARG1), %xmm8
+ mulps 16(ARG1), %xmm1
+ mulps 32(ARG1), %xmm2
+ mulps 48(ARG1), %xmm3
+ mulps -64(ARG1), %xmm9
+ mulps -48(ARG1), %xmm5
+ mulps -32(ARG1), %xmm6
+ mulps -16(ARG1), %xmm7
+
+ addps %xmm1, %xmm8
+ addps %xmm2, %xmm3
+ addps %xmm5, %xmm9
+ addps %xmm7, %xmm6
+ addps %xmm3, %xmm8
+ addps %xmm6, %xmm9
+ leaq 256(ARG0), ARG0
+ leaq -128(ARG1), ARG1
+
+ movups (ARG0), %xmm10
+ movups 16(ARG0), %xmm1
+ movups 32(ARG0), %xmm2
+ movups 48(ARG0), %xmm3
+ movups 128(ARG0), %xmm11
+ movups 144(ARG0), %xmm5
+ movups 160(ARG0), %xmm6
+ movups 176(ARG0), %xmm7
+ mulps (ARG1), %xmm10
+ mulps 16(ARG1), %xmm1
+ mulps 32(ARG1), %xmm2
+ mulps 48(ARG1), %xmm3
+ mulps -64(ARG1), %xmm11
+ mulps -48(ARG1), %xmm5
+ mulps -32(ARG1), %xmm6
+ mulps -16(ARG1), %xmm7
+
+ addps %xmm1, %xmm10
+ addps %xmm2, %xmm3
+ addps %xmm5, %xmm11
+ addps %xmm7, %xmm6
+ addps %xmm3, %xmm10
+ addps %xmm6, %xmm11
+ leaq 256(ARG0), ARG0
+ leaq -128(ARG1), ARG1
+
+ movaps %xmm8, %xmm0
+ movaps %xmm10, %xmm1
+ unpcklps %xmm9, %xmm8
+ unpcklps %xmm11, %xmm10
+ unpckhps %xmm9, %xmm0
+ unpckhps %xmm11, %xmm1
+ movaps %xmm8, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm10, %xmm8
+ movhlps %xmm2, %xmm10
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ addps %xmm10, %xmm8
+ addps %xmm1, %xmm0
+ addps %xmm8, %xmm0
+
+ movups (ARG2), %xmm1
+ movups 16(ARG2), %xmm2
+ mulps XMMREG_SCALE, %xmm0
+ shufps $0xdd, %xmm2, %xmm1
+ movaps %xmm0, %xmm2
+ unpcklps %xmm1, %xmm0
+ unpckhps %xmm1, %xmm2
+ movups %xmm0, (ARG2)
+ movups %xmm2, 16(ARG2)
+
+ leaq 32(ARG2), ARG2
+ decl %ecx
+ jnz 1b
+
+ xorl %eax, %eax
+
+#ifdef IS_MSABI
+ movaps (%rsp), %xmm6
+ movaps 16(%rsp), %xmm7
+ movaps 32(%rsp), %xmm8
+ movaps 48(%rsp), %xmm9
+ movaps 64(%rsp), %xmm10
+ movaps 80(%rsp), %xmm11
+ movaps 96(%rsp), %xmm15
+ addq $120, %rsp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_x86_64_s32.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_x86_64_s32.S
new file mode 100644
index 00000000..7f964a84
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synth_x86_64_s32.S
@@ -0,0 +1,312 @@
+/*
+ synth_x86_64_s32: SSE optimized synth for x86-64 (s32 output version)
+
+ copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Taihei Monma
+*/
+
+#include "mangle.h"
+
+#ifdef IS_MSABI
+/* short *window; */
+#define ARG0 %r10
+/* short *b0; */
+#define ARG1 %rdx
+/* short *samples; */
+#define ARG2 %r8
+/* int bo1; */
+#define ARG3 %r9
+#else
+/* real *window; */
+#define ARG0 %rdi
+/* real *b0; */
+#define ARG1 %rsi
+/* real *samples; */
+#define ARG2 %rdx
+/* int bo1; */
+#define ARG3 %rcx
+#endif
+
+#define XMMREG_SCALE %xmm15 /* {65536.0, 65536.0, 65536.0, 65536.0} */
+#define XMMREG_MAX %xmm14 /* {32767.999, 32767.999, 32767.999, 32767.999} */
+#define XMMREG_MIN %xmm13 /* {-32768.0, -32768.0, -32768.0, -32768.0} */
+#define XMMREG_CLIP %xmm12
+
+/*
+ int synth_1to1_s32_x86_64_asm(real *window, real *b0, int32_t *samples, int bo1);
+ return value: number of clipped samples
+*/
+
+#ifndef __APPLE__
+ .section .rodata
+#else
+ .data
+#endif
+ ALIGN32
+ASM_NAME(scale_s32):
+ .long 1199570944
+ .long 1199570944
+ .long 1199570944
+ .long 1199570944
+ ALIGN16
+ASM_NAME(maxmin_s32):
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long 1191182335
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .long -956301312
+ .text
+ ALIGN16
+.globl ASM_NAME(synth_1to1_s32_x86_64_asm)
+ASM_NAME(synth_1to1_s32_x86_64_asm):
+#ifdef IS_MSABI /* should save xmm6-15 */
+ movq %rcx, ARG0
+ subq $168, %rsp /* stack alignment + 10 xmm registers */
+ movaps %xmm6, (%rsp)
+ movaps %xmm7, 16(%rsp)
+ movaps %xmm8, 32(%rsp)
+ movaps %xmm9, 48(%rsp)
+ movaps %xmm10, 64(%rsp)
+ movaps %xmm11, 80(%rsp)
+ movaps %xmm12, 96(%rsp)
+ movaps %xmm13, 112(%rsp)
+ movaps %xmm14, 128(%rsp)
+ movaps %xmm15, 144(%rsp)
+#endif
+
+ leaq ASM_NAME(scale_s32)(%rip), %rax
+ movaps (%rax), XMMREG_SCALE
+ leaq ASM_NAME(maxmin_s32)(%rip), %rax
+ movaps (%rax), XMMREG_MAX
+ movaps 16(%rax), XMMREG_MIN
+
+ xorps XMMREG_CLIP, XMMREG_CLIP
+
+ andq $0xf, ARG3
+ shlq $2, ARG3
+ leaq 64(ARG0), ARG0
+ subq ARG3, ARG0
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (ARG0), %xmm8
+ movups 16(ARG0), %xmm1
+ movups 32(ARG0), %xmm2
+ movups 48(ARG0), %xmm3
+ movups 128(ARG0), %xmm9
+ movups 144(ARG0), %xmm5
+ movups 160(ARG0), %xmm6
+ movups 176(ARG0), %xmm7
+ mulps (ARG1), %xmm8
+ mulps 16(ARG1), %xmm1
+ mulps 32(ARG1), %xmm2
+ mulps 48(ARG1), %xmm3
+ mulps 64(ARG1), %xmm9
+ mulps 80(ARG1), %xmm5
+ mulps 96(ARG1), %xmm6
+ mulps 112(ARG1), %xmm7
+
+ addps %xmm1, %xmm8
+ addps %xmm2, %xmm3
+ addps %xmm5, %xmm9
+ addps %xmm7, %xmm6
+ addps %xmm3, %xmm8
+ addps %xmm6, %xmm9
+ leaq 256(ARG0), ARG0
+ leaq 128(ARG1), ARG1
+
+ movups (ARG0), %xmm10
+ movups 16(ARG0), %xmm1
+ movups 32(ARG0), %xmm2
+ movups 48(ARG0), %xmm3
+ movups 128(ARG0), %xmm11
+ movups 144(ARG0), %xmm5
+ movups 160(ARG0), %xmm6
+ movups 176(ARG0), %xmm7
+ mulps (ARG1), %xmm10
+ mulps 16(ARG1), %xmm1
+ mulps 32(ARG1), %xmm2
+ mulps 48(ARG1), %xmm3
+ mulps 64(ARG1), %xmm11
+ mulps 80(ARG1), %xmm5
+ mulps 96(ARG1), %xmm6
+ mulps 112(ARG1), %xmm7
+
+ addps %xmm1, %xmm10
+ addps %xmm2, %xmm3
+ addps %xmm5, %xmm11
+ addps %xmm7, %xmm6
+ addps %xmm3, %xmm10
+ addps %xmm6, %xmm11
+ leaq 256(ARG0), ARG0
+ leaq 128(ARG1), ARG1
+
+ movaps %xmm8, %xmm0
+ movaps %xmm10, %xmm1
+ unpcklps %xmm9, %xmm8
+ unpcklps %xmm11, %xmm10
+ unpckhps %xmm9, %xmm0
+ unpckhps %xmm11, %xmm1
+ movaps %xmm8, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm10, %xmm8
+ movhlps %xmm2, %xmm10
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ subps %xmm10, %xmm8
+ subps %xmm1, %xmm0
+ addps %xmm8, %xmm0
+
+ movups (ARG2), %xmm1
+ movups 16(ARG2), %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm0, %xmm4
+ mulps XMMREG_SCALE, %xmm0
+ cmpnleps XMMREG_MAX, %xmm3
+ cmpltps XMMREG_MIN, %xmm4
+ cvtps2dq %xmm0, %xmm0
+ xorps %xmm3, %xmm0
+ shufps $0xdd, %xmm2, %xmm1
+ movaps %xmm0, %xmm2
+ unpcklps %xmm1, %xmm0
+ unpckhps %xmm1, %xmm2
+ movups %xmm0, (ARG2)
+ movups %xmm2, 16(ARG2)
+
+ psrld $31, %xmm3
+ psrld $31, %xmm4
+ paddd %xmm4, %xmm3
+ paddd %xmm3, XMMREG_CLIP
+
+ leaq 32(ARG2), ARG2
+ decl %ecx
+ jnz 1b
+
+ movl $4, %ecx
+
+ ALIGN16
+1:
+ movups (ARG0), %xmm8
+ movups 16(ARG0), %xmm1
+ movups 32(ARG0), %xmm2
+ movups 48(ARG0), %xmm3
+ movups 128(ARG0), %xmm9
+ movups 144(ARG0), %xmm5
+ movups 160(ARG0), %xmm6
+ movups 176(ARG0), %xmm7
+ mulps (ARG1), %xmm8
+ mulps 16(ARG1), %xmm1
+ mulps 32(ARG1), %xmm2
+ mulps 48(ARG1), %xmm3
+ mulps -64(ARG1), %xmm9
+ mulps -48(ARG1), %xmm5
+ mulps -32(ARG1), %xmm6
+ mulps -16(ARG1), %xmm7
+
+ addps %xmm1, %xmm8
+ addps %xmm2, %xmm3
+ addps %xmm5, %xmm9
+ addps %xmm7, %xmm6
+ addps %xmm3, %xmm8
+ addps %xmm6, %xmm9
+ leaq 256(ARG0), ARG0
+ leaq -128(ARG1), ARG1
+
+ movups (ARG0), %xmm10
+ movups 16(ARG0), %xmm1
+ movups 32(ARG0), %xmm2
+ movups 48(ARG0), %xmm3
+ movups 128(ARG0), %xmm11
+ movups 144(ARG0), %xmm5
+ movups 160(ARG0), %xmm6
+ movups 176(ARG0), %xmm7
+ mulps (ARG1), %xmm10
+ mulps 16(ARG1), %xmm1
+ mulps 32(ARG1), %xmm2
+ mulps 48(ARG1), %xmm3
+ mulps -64(ARG1), %xmm11
+ mulps -48(ARG1), %xmm5
+ mulps -32(ARG1), %xmm6
+ mulps -16(ARG1), %xmm7
+
+ addps %xmm1, %xmm10
+ addps %xmm2, %xmm3
+ addps %xmm5, %xmm11
+ addps %xmm7, %xmm6
+ addps %xmm3, %xmm10
+ addps %xmm6, %xmm11
+ leaq 256(ARG0), ARG0
+ leaq -128(ARG1), ARG1
+
+ movaps %xmm8, %xmm0
+ movaps %xmm10, %xmm1
+ unpcklps %xmm9, %xmm8
+ unpcklps %xmm11, %xmm10
+ unpckhps %xmm9, %xmm0
+ unpckhps %xmm11, %xmm1
+ movaps %xmm8, %xmm2
+ movaps %xmm0, %xmm3
+ movlhps %xmm10, %xmm8
+ movhlps %xmm2, %xmm10
+ movlhps %xmm1, %xmm0
+ movhlps %xmm3, %xmm1
+ addps %xmm10, %xmm8
+ addps %xmm1, %xmm0
+ addps %xmm8, %xmm0
+
+ movups (ARG2), %xmm1
+ movups 16(ARG2), %xmm2
+ movaps %xmm0, %xmm3
+ movaps %xmm0, %xmm4
+ mulps XMMREG_SCALE, %xmm0
+ cmpnleps XMMREG_MAX, %xmm3
+ cmpltps XMMREG_MIN, %xmm4
+ cvtps2dq %xmm0, %xmm0
+ xorps %xmm3, %xmm0
+ shufps $0xdd, %xmm2, %xmm1
+ movaps %xmm0, %xmm2
+ unpcklps %xmm1, %xmm0
+ unpckhps %xmm1, %xmm2
+ movups %xmm0, (ARG2)
+ movups %xmm2, 16(ARG2)
+
+ psrld $31, %xmm3
+ psrld $31, %xmm4
+ paddd %xmm4, %xmm3
+ paddd %xmm3, XMMREG_CLIP
+
+ leaq 32(ARG2), ARG2
+ decl %ecx
+ jnz 1b
+
+ pshuflw $0xee, XMMREG_CLIP, %xmm0
+ movhlps XMMREG_CLIP, %xmm1
+ pshuflw $0xee, %xmm1, %xmm2
+ paddd %xmm0, XMMREG_CLIP
+ paddd %xmm1, XMMREG_CLIP
+ paddd %xmm2, XMMREG_CLIP
+
+ movd XMMREG_CLIP, %eax
+
+#ifdef IS_MSABI
+ movaps (%rsp), %xmm6
+ movaps 16(%rsp), %xmm7
+ movaps 32(%rsp), %xmm8
+ movaps 48(%rsp), %xmm9
+ movaps 64(%rsp), %xmm10
+ movaps 80(%rsp), %xmm11
+ movaps 96(%rsp), %xmm12
+ movaps 112(%rsp), %xmm13
+ movaps 128(%rsp), %xmm14
+ movaps 144(%rsp), %xmm15
+ addq $168, %rsp
+#endif
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synths.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synths.h
new file mode 100644
index 00000000..fb2c8294
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/synths.h
@@ -0,0 +1,52 @@
+#ifndef MPG123_SYNTH_H
+#define MPG123_SYNTH_H
+
+/* This is included inside frame.h, which is included in mpg123lib_intern.h,
+ at the appropriate place.
+ Explicit header inclusions here would cause circular dependencies. */
+
+/* The handle needs these types for selecting the decoding routine at runtime.
+ Not just for optimization, mainly for XtoY, mono/stereo. */
+typedef int (*func_synth)(real *,int, mpg123_handle *,int );
+typedef int (*func_synth_mono)(real *, mpg123_handle *);
+typedef int (*func_synth_stereo)(real *, real *, mpg123_handle *);
+enum synth_channel { c_plain=0, c_stereo, c_m2s, c_mono, c_limit };
+enum synth_resample
+{
+ r_none=-1
+ ,r_1to1=0
+# ifndef NO_DOWNSAMPLE
+ ,r_2to1
+ ,r_4to1
+# endif
+# ifndef NO_NTOM
+ ,r_ntom
+# endif
+ ,r_limit
+};
+enum synth_format
+{
+ f_none=-1
+# ifndef NO_16BIT
+ ,f_16
+# endif
+# ifndef NO_8BIT
+ ,f_8
+# endif
+# ifndef NO_REAL
+ ,f_real
+# endif
+# ifndef NO_32BIT
+ ,f_32
+# endif
+ ,f_limit
+};
+struct synth_s
+{
+ func_synth plain[r_limit][f_limit];
+ func_synth_stereo stereo[r_limit][f_limit];
+ func_synth_mono mono2stereo[r_limit][f_limit];
+ func_synth_mono mono[r_limit][f_limit];
+};
+
+#endif
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/tabinit.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/tabinit.c
new file mode 100644
index 00000000..ae7fac38
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/tabinit.c
@@ -0,0 +1,345 @@
+/*
+ tabinit.c: initialize tables...
+
+ copyright ?-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Michael Hipp
+*/
+
+#include "mpg123lib_intern.h"
+#include "debug.h"
+
+// The (normally precomputed) cos tables.
+#include "costabs.h"
+#ifdef RUNTIME_TABLES
+#include "init_costabs.h"
+#else
+const
+#endif
+real *pnts[] = { cos64,cos32,cos16,cos8,cos4 };
+
+static const long intwinbase[] = {
+ 0, -1, -1, -1, -1, -1, -1, -2, -2, -2,
+ -2, -3, -3, -4, -4, -5, -5, -6, -7, -7,
+ -8, -9, -10, -11, -13, -14, -16, -17, -19, -21,
+ -24, -26, -29, -31, -35, -38, -41, -45, -49, -53,
+ -58, -63, -68, -73, -79, -85, -91, -97, -104, -111,
+ -117, -125, -132, -139, -147, -154, -161, -169, -176, -183,
+ -190, -196, -202, -208, -213, -218, -222, -225, -227, -228,
+ -228, -227, -224, -221, -215, -208, -200, -189, -177, -163,
+ -146, -127, -106, -83, -57, -29, 2, 36, 72, 111,
+ 153, 197, 244, 294, 347, 401, 459, 519, 581, 645,
+ 711, 779, 848, 919, 991, 1064, 1137, 1210, 1283, 1356,
+ 1428, 1498, 1567, 1634, 1698, 1759, 1817, 1870, 1919, 1962,
+ 2001, 2032, 2057, 2075, 2085, 2087, 2080, 2063, 2037, 2000,
+ 1952, 1893, 1822, 1739, 1644, 1535, 1414, 1280, 1131, 970,
+ 794, 605, 402, 185, -45, -288, -545, -814, -1095, -1388,
+ -1692, -2006, -2330, -2663, -3004, -3351, -3705, -4063, -4425, -4788,
+ -5153, -5517, -5879, -6237, -6589, -6935, -7271, -7597, -7910, -8209,
+ -8491, -8755, -8998, -9219, -9416, -9585, -9727, -9838, -9916, -9959,
+ -9966, -9935, -9863, -9750, -9592, -9389, -9139, -8840, -8492, -8092,
+ -7640, -7134, -6574, -5959, -5288, -4561, -3776, -2935, -2037, -1082,
+ -70, 998, 2122, 3300, 4533, 5818, 7154, 8540, 9975, 11455,
+ 12980, 14548, 16155, 17799, 19478, 21189, 22929, 24694, 26482, 28289,
+ 30112, 31947, 33791, 35640, 37489, 39336, 41176, 43006, 44821, 46617,
+ 48390, 50137, 51853, 53534, 55178, 56778, 58333, 59838, 61289, 62684,
+ 64019, 65290, 66494, 67629, 68692, 69679, 70590, 71420, 72169, 72835,
+ 73415, 73908, 74313, 74630, 74856, 74992, 75038 };
+
+#ifdef OPT_MMXORSSE
+#if !defined(OPT_X86_64) && !defined(OPT_NEON) && !defined(OPT_NEON64) && !defined(OPT_AVX)
+void make_decode_tables_mmx_asm(long scaleval, float* decwin_mmx, float *decwins);
+void make_decode_tables_mmx(mpg123_handle *fr)
+{
+ debug("MMX decode tables");
+ /* Take care: The scale should be like before, when we didn't have float output all around. */
+ make_decode_tables_mmx_asm((long)((fr->lastscale < 0 ? fr->p.outscale : fr->lastscale)*SHORT_SCALE), fr->decwin_mmx, fr->decwins);
+ debug("MMX decode tables done");
+}
+#else
+
+/* This mimics round() as defined in C99. We stay C89. */
+static int rounded(double f)
+{
+ return (int)(f>0 ? floor(f+0.5) : ceil(f-0.5));
+}
+
+/* x86-64 doesn't use asm version */
+void make_decode_tables_mmx(mpg123_handle *fr)
+{
+ int i,j,val;
+ int idx = 0;
+ short *ptr = (short *)fr->decwins;
+ /* Scale is always based on 1.0 . */
+ double scaleval = -0.5*(fr->lastscale < 0 ? fr->p.outscale : fr->lastscale);
+ debug1("MMX decode tables with scaleval %g", scaleval);
+ for(i=0,j=0;i<256;i++,j++,idx+=32)
+ {
+ if(idx < 512+16)
+ fr->decwin_mmx[idx+16] = fr->decwin_mmx[idx] = DOUBLE_TO_REAL((double) intwinbase[j] * scaleval);
+
+ if(i % 32 == 31)
+ idx -= 1023;
+ if(i % 64 == 63)
+ scaleval = - scaleval;
+ }
+
+ for( /* i=256 */ ;i<512;i++,j--,idx+=32)
+ {
+ if(idx < 512+16)
+ fr->decwin_mmx[idx+16] = fr->decwin_mmx[idx] = DOUBLE_TO_REAL((double) intwinbase[j] * scaleval);
+
+ if(i % 32 == 31)
+ idx -= 1023;
+ if(i % 64 == 63)
+ scaleval = - scaleval;
+ }
+
+ for(i=0; i<512; i++) {
+ if(i&1) val = rounded(fr->decwin_mmx[i]*0.5);
+ else val = rounded(fr->decwin_mmx[i]*-0.5);
+ if(val > 32767) val = 32767;
+ else if(val < -32768) val = -32768;
+ ptr[i] = val;
+ }
+ for(i=512; i<512+32; i++) {
+ if(i&1) val = rounded(fr->decwin_mmx[i]*0.5);
+ else val = 0;
+ if(val > 32767) val = 32767;
+ else if(val < -32768) val = -32768;
+ ptr[i] = val;
+ }
+ for(i=0; i<512; i++) {
+ val = rounded(fr->decwin_mmx[511-i]*-0.5);
+ if(val > 32767) val = 32767;
+ else if(val < -32768) val = -32768;
+ ptr[512+32+i] = val;
+ }
+ debug("decode tables done");
+}
+#endif
+#endif
+
+#ifdef REAL_IS_FIXED
+/* Need saturating multiplication that keeps table values in 32 bit range,
+ with the option to swap sign at will (so -2**31 is out).
+ This code is far from the decoder core and so assembly optimization might
+ be overkill. */
+static int32_t sat_mul32(int32_t a, int32_t b)
+{
+ int64_t prod = (int64_t)a * (int64_t)b;
+ /* TODO: record the clipping? An extra flag? */
+ if(prod > 2147483647L) return 2147483647L;
+ if(prod < -2147483647L) return -2147483647L;
+ return (int32_t)prod;
+}
+#endif
+
+void make_decode_tables(mpg123_handle *fr)
+{
+ int i,j;
+ int idx = 0;
+ double scaleval;
+#ifdef REAL_IS_FIXED
+ real scaleval_long;
+#endif
+ /* Scale is always based on 1.0 . */
+ scaleval = -0.5*(fr->lastscale < 0 ? fr->p.outscale : fr->lastscale);
+ debug1("decode tables with scaleval %g", scaleval);
+#ifdef REAL_IS_FIXED
+ scaleval_long = DOUBLE_TO_REAL_15(scaleval);
+ debug1("decode table with fixed scaleval %li", (long)scaleval_long);
+ if(scaleval_long > 28618 || scaleval_long < -28618)
+ {
+ /* TODO: Limit the scaleval itself or limit the multiplication afterwards?
+ The former basically disables significant amplification for fixed-point
+ decoders, but avoids (possibly subtle) distortion. */
+ /* This would limit the amplification instead:
+ scaleval_long = scaleval_long < 0 ? -28618 : 28618; */
+ if(NOQUIET) warning("Desired amplification may introduce distortion.");
+ }
+#endif
+ for(i=0,j=0;i<256;i++,j++,idx+=32)
+ {
+ if(idx < 512+16)
+#ifdef REAL_IS_FIXED
+ fr->decwin[idx+16] = fr->decwin[idx] =
+ REAL_SCALE_WINDOW(sat_mul32(intwinbase[j],scaleval_long));
+#else
+ fr->decwin[idx+16] = fr->decwin[idx] = DOUBLE_TO_REAL((double) intwinbase[j] * scaleval);
+#endif
+
+ if(i % 32 == 31)
+ idx -= 1023;
+ if(i % 64 == 63)
+#ifdef REAL_IS_FIXED
+ scaleval_long = - scaleval_long;
+#else
+ scaleval = - scaleval;
+#endif
+ }
+
+ for( /* i=256 */ ;i<512;i++,j--,idx+=32)
+ {
+ if(idx < 512+16)
+#ifdef REAL_IS_FIXED
+ fr->decwin[idx+16] = fr->decwin[idx] =
+ REAL_SCALE_WINDOW(sat_mul32(intwinbase[j],scaleval_long));
+#else
+ fr->decwin[idx+16] = fr->decwin[idx] = DOUBLE_TO_REAL((double) intwinbase[j] * scaleval);
+#endif
+
+ if(i % 32 == 31)
+ idx -= 1023;
+ if(i % 64 == 63)
+#ifdef REAL_IS_FIXED
+ scaleval_long = - scaleval_long;
+#else
+ scaleval = - scaleval;
+#endif
+ }
+#if defined(OPT_X86_64) || defined(OPT_ALTIVEC) || defined(OPT_SSE) || defined(OPT_SSE_VINTAGE) || defined(OPT_ARM) || defined(OPT_NEON) || defined(OPT_NEON64) || defined(OPT_AVX)
+ if( fr->cpu_opts.type == x86_64
+ || fr->cpu_opts.type == altivec
+ || fr->cpu_opts.type == sse
+ || fr->cpu_opts.type == sse_vintage
+ || fr->cpu_opts.type == arm
+ || fr->cpu_opts.type == neon
+ || fr->cpu_opts.type == neon64
+ || fr->cpu_opts.type == avx )
+ { /* for float SSE / AltiVec / ARM decoder */
+ for(i=512; i<512+32; i++)
+ {
+ fr->decwin[i] = (i&1) ? fr->decwin[i] : 0;
+ }
+ for(i=0; i<512; i++)
+ {
+ fr->decwin[512+32+i] = -fr->decwin[511-i];
+ }
+#if defined(OPT_NEON) || defined(OPT_NEON64)
+ if(fr->cpu_opts.type == neon || fr->cpu_opts.type == neon64)
+ {
+ for(i=0; i<512; i+=2)
+ {
+ fr->decwin[i] = -fr->decwin[i];
+ }
+ }
+#endif
+ }
+#endif
+ debug("decode tables done");
+}
+
+#ifndef NO_8BIT
+int make_conv16to8_table(mpg123_handle *fr)
+{
+ int i;
+ int mode = fr->af.dec_enc;
+
+ /*
+ * ????: 8.0 is right but on SB cards '2.0' is a better value ???
+ */
+ const double mul = 8.0;
+
+ if(!fr->conv16to8_buf){
+ fr->conv16to8_buf = (unsigned char *) malloc(8192);
+ if(!fr->conv16to8_buf) {
+ fr->err = MPG123_ERR_16TO8TABLE;
+ if(NOQUIET) error("Can't allocate 16 to 8 converter table!");
+ return -1;
+ }
+ fr->conv16to8 = fr->conv16to8_buf + 4096;
+ }
+
+ switch(mode)
+ {
+ case MPG123_ENC_ULAW_8:
+ {
+ double m=127.0 / log(256.0);
+ int c1;
+
+ for(i=-4096;i<4096;i++)
+ {
+ /* dunno whether this is a valid transformation rule ?!?!? */
+ if(i < 0)
+ c1 = 127 - (int) (log( 1.0 - 255.0 * (double) i*mul / 32768.0 ) * m);
+ else
+ c1 = 255 - (int) (log( 1.0 + 255.0 * (double) i*mul / 32768.0 ) * m);
+ if(c1 < 0 || c1 > 255)
+ {
+ if(NOQUIET) error2("Converror %d %d",i,c1);
+ return -1;
+ }
+ if(c1 == 0)
+ c1 = 2;
+ fr->conv16to8[i] = (unsigned char) c1;
+ }
+ }
+ break;
+ case MPG123_ENC_SIGNED_8:
+ for(i=-4096;i<4096;i++)
+ fr->conv16to8[i] = i>>5;
+ break;
+ case MPG123_ENC_UNSIGNED_8:
+ for(i=-4096;i<4096;i++)
+ fr->conv16to8[i] = (i>>5)+128;
+ break;
+ case MPG123_ENC_ALAW_8:
+ {
+ /*
+ Let's believe Wikipedia (http://en.wikipedia.org/wiki/G.711) that this
+ is the correct table:
+
+ s0000000wxyza... n000wxyz [0-31] -> [0-15]
+ s0000001wxyza... n001wxyz [32-63] -> [16-31]
+ s000001wxyzab... n010wxyz [64-127] -> [32-47]
+ s00001wxyzabc... n011wxyz [128-255] -> [48-63]
+ s0001wxyzabcd... n100wxyz [256-511] -> [64-79]
+ s001wxyzabcde... n101wxyz [512-1023] -> [80-95]
+ s01wxyzabcdef... n110wxyz [1024-2047] -> [96-111]
+ s1wxyzabcdefg... n111wxyz [2048-4095] -> [112-127]
+
+ Let's extend to -4096, too.
+ Also, bytes are xored with 0x55 for transmission.
+
+ Since it sounds OK, I assume it is fine;-)
+ */
+ for(i=0; i<64; ++i)
+ fr->conv16to8[i] = ((unsigned int)i)>>1;
+ for(i=64; i<128; ++i)
+ fr->conv16to8[i] = ((((unsigned int)i)>>2) & 0xf) | (2<<4);
+ for(i=128; i<256; ++i)
+ fr->conv16to8[i] = ((((unsigned int)i)>>3) & 0xf) | (3<<4);
+ for(i=256; i<512; ++i)
+ fr->conv16to8[i] = ((((unsigned int)i)>>4) & 0xf) | (4<<4);
+ for(i=512; i<1024; ++i)
+ fr->conv16to8[i] = ((((unsigned int)i)>>5) & 0xf) | (5<<4);
+ for(i=1024; i<2048; ++i)
+ fr->conv16to8[i] = ((((unsigned int)i)>>6) & 0xf) | (6<<4);
+ for(i=2048; i<4096; ++i)
+ fr->conv16to8[i] = ((((unsigned int)i)>>7) & 0xf) | (7<<4);
+
+ for(i=-4095; i<0; ++i)
+ fr->conv16to8[i] = fr->conv16to8[-i] | 0x80;
+
+ fr->conv16to8[-4096] = fr->conv16to8[-4095];
+
+ for(i=-4096;i<4096;i++)
+ {
+ /* fr->conv16to8[i] = - i>>5; */
+ /* fprintf(stderr, "table %i %i\n", i<<AUSHIFT, fr->conv16to8[i]); */
+ fr->conv16to8[i] ^= 0x55;
+ }
+ }
+ break;
+ default:
+ fr->err = MPG123_ERR_16TO8TABLE;
+ if(NOQUIET) error("Unknown 8 bit encoding choice.");
+ return -1;
+ break;
+ }
+
+ return 0;
+}
+#endif
+
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/tabinit_mmx.S b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/tabinit_mmx.S
new file mode 100644
index 00000000..63586a7a
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/tabinit_mmx.S
@@ -0,0 +1,229 @@
+/*
+ tabinit_mmx: make_decode_tables_mmx
+
+ copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by the mysterious higway (apparently)
+
+ See synth_mmx.S about license history.
+*/
+
+#include "mangle.h"
+
+.data
+ ALIGN32
+.globl ASM_NAME(costab_mmxsse)
+ASM_NAME(costab_mmxsse):
+ .long 1056974725
+ .long 1057056395
+ .long 1057223771
+ .long 1057485416
+ .long 1057855544
+ .long 1058356026
+ .long 1059019886
+ .long 1059897405
+ .long 1061067246
+ .long 1062657950
+ .long 1064892987
+ .long 1066774581
+ .long 1069414683
+ .long 1073984175
+ .long 1079645762
+ .long 1092815430
+ .long 1057005197
+ .long 1057342072
+ .long 1058087743
+ .long 1059427869
+ .long 1061799040
+ .long 1065862217
+ .long 1071413542
+ .long 1084439708
+ .long 1057128951
+ .long 1058664893
+ .long 1063675095
+ .long 1076102863
+ .long 1057655764
+ .long 1067924853
+ .long 1060439283
+ ALIGN32
+intwinbase:
+ .short 0, -1, -1, -1, -1, -1, -1, -2
+ .short -2, -2, -2, -3, -3, -4, -4, -5
+ .short -5, -6, -7, -7, -8, -9, -10, -11
+ .short -13, -14, -16, -17, -19, -21, -24, -26
+ .short -29, -31, -35, -38, -41, -45, -49, -53
+ .short -58, -63, -68, -73, -79, -85, -91, -97
+ .short -104, -111, -117, -125, -132, -139, -147, -154
+ .short -161, -169, -176, -183, -190, -196, -202, -208
+ .short -213, -218, -222, -225, -227, -228, -228, -227
+ .short -224, -221, -215, -208, -200, -189, -177, -163
+ .short -146, -127, -106, -83, -57, -29, 2, 36
+ .short 72, 111, 153, 197, 244, 294, 347, 401
+ .short 459, 519, 581, 645, 711, 779, 848, 919
+ .short 991, 1064, 1137, 1210, 1283, 1356, 1428, 1498
+ .short 1567, 1634, 1698, 1759, 1817, 1870, 1919, 1962
+ .short 2001, 2032, 2057, 2075, 2085, 2087, 2080, 2063
+ .short 2037, 2000, 1952, 1893, 1822, 1739, 1644, 1535
+ .short 1414, 1280, 1131, 970, 794, 605, 402, 185
+ .short -45, -288, -545, -814, -1095, -1388, -1692, -2006
+ .short -2330, -2663, -3004, -3351, -3705, -4063, -4425, -4788
+ .short -5153, -5517, -5879, -6237, -6589, -6935, -7271, -7597
+ .short -7910, -8209, -8491, -8755, -8998, -9219, -9416, -9585
+ .short -9727, -9838, -9916, -9959, -9966, -9935, -9863, -9750
+ .short -9592, -9389, -9139, -8840, -8492, -8092, -7640, -7134
+ .short -6574, -5959, -5288, -4561, -3776, -2935, -2037, -1082
+ .short -70, 998, 2122, 3300, 4533, 5818, 7154, 8540
+ .short 9975, 11455, 12980, 14548, 16155, 17799, 19478, 21189
+ .short 22929, 24694, 26482, 28289, 30112, 31947,-26209,-24360
+ .short -22511,-20664,-18824,-16994,-15179,-13383,-11610, -9863
+ .short -8147, -6466, -4822, -3222, -1667, -162, 1289, 2684
+ .short 4019, 5290, 6494, 7629, 8692, 9679, 10590, 11420
+ .short 12169, 12835, 13415, 13908, 14313, 14630, 14856, 14992
+ .short 15038
+
+intwindiv:
+ .long 0x47800000 # 65536.0
+.text
+ ALIGN32
+/* void make_decode_tables_mmx_asm(long scaleval, float* decwin_mmx, float *decwins); */
+.globl ASM_NAME(make_decode_tables_mmx_asm)
+ASM_NAME(make_decode_tables_mmx_asm):
+ pushl %ebp
+ mov %esp,%ebp
+ sub $12,%esp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+
+ GET_GOT
+ lea LOCAL_VAR(intwinbase),%edi
+ mov LOCAL_VAR(intwindiv),%ecx
+ mov %edi,-4(%ebp)
+ lea 444(%edi),%eax
+ mov %eax,-8(%ebp)
+ mov %ecx,-12(%ebp)
+
+/* stack: -12(%ebp)=*intwindiv, -8(%ebp)=intwinbase+444, -4(%ebp)=intwinbase, ... ,
+ 4(%ebp)=back, 8(%ebp)=scaleval, 12(%ebp)=decwin_mmx, 16(%ebp)=decwins */
+#define INTWINDIV -12(%ebp)
+#define INTWINBASE_PLUS_444 -8(%ebp)
+#define INTWINBASE -4(%ebp)
+#define SCALEVAL 8(%ebp)
+#define DECWIN_MMX 12(%ebp)
+#define DECWINS 16(%ebp)
+
+ xorl %ecx,%ecx
+ xorl %ebx,%ebx
+ movl $32,%esi
+
+ negl SCALEVAL /* scaleval */
+ pushl $2 /* intwinbase step */
+.L00:
+ cmpl $528,%ecx
+ jnc .L02
+ movswl (%edi),%eax
+ cmpl INTWINBASE_PLUS_444,%edi
+ jc .L01
+ addl $60000,%eax
+.L01:
+ pushl %eax
+ fildl (%esp)
+ fdivs INTWINDIV
+ fimull SCALEVAL /* scaleval */
+/* eax used to be popped the line before... I'll just use it here a bit */
+ movl DECWIN_MMX,%eax /* decwin_mmx */
+ fsts (%eax,%ecx,4)
+ fstps 64(%eax,%ecx,4)
+ popl %eax
+.L02:
+ leal -1(%esi),%edx
+ andl %ebx,%edx
+ cmpl $31,%edx
+ jnz .L03
+ addl $-1023,%ecx
+ testl %esi,%ebx
+ jz .L03
+ negl SCALEVAL
+.L03:
+ addl %esi,%ecx
+ addl (%esp),%edi
+ incl %ebx
+ cmpl INTWINBASE,%edi
+ jz .L04
+ cmpl $256,%ebx
+ jnz .L00
+ negl (%esp)
+ jmp .L00
+.L04:
+ popl %eax
+
+ xorl %ecx,%ecx
+ xorl %ebx,%ebx
+ pushl $2 /* paired with popl above */
+.L05:
+ cmpl $528,%ecx
+ jnc .L11
+ movswl (%edi),%eax
+ cmpl INTWINBASE_PLUS_444,%edi
+ jc .L06
+ addl $60000,%eax
+.L06:
+ cltd
+ imull SCALEVAL
+ shrdl $17,%edx,%eax
+ cmpl $32767,%eax
+ movl $1055,%edx
+ jle .L07
+ movl $32767,%eax
+ jmp .L08
+.L07:
+ cmpl $-32767,%eax
+ jge .L08
+ movl $-32767,%eax
+.L08:
+/* going to use ebx for decwins, watch the jumps */
+ pushl %ebx
+ movl DECWINS,%ebx
+ cmpl $512,%ecx
+ jnc .L09
+ subl %ecx,%edx
+ movw %ax,(%ebx,%edx,2) /* decwins */
+ movw %ax,-32(%ebx,%edx,2)
+.L09:
+ testl $1,%ecx
+ jnz .L10
+ negl %eax
+.L10:
+ movw %ax,(%ebx,%ecx,2)
+ movw %ax,32(%ebx,%ecx,2)
+ popl %ebx /* that has to match the pushl before */
+.L11:
+ leal -1(%esi),%edx
+ andl %ebx,%edx
+ cmpl $31,%edx
+ jnz .L12
+ addl $-1023,%ecx
+ testl %esi,%ebx
+ jz .L12
+ negl SCALEVAL
+.L12:
+ addl %esi,%ecx
+ addl (%esp),%edi
+ incl %ebx
+ cmpl INTWINBASE,%edi
+ jz .L13
+ cmpl $256,%ebx
+ jnz .L05
+ negl (%esp)
+ jmp .L05
+.L13:
+ popl %eax
+
+ popl %ebx
+ popl %esi
+ popl %edi
+ mov %ebp,%esp
+ pop %ebp
+ ret
+
+NONEXEC_STACK
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/testcpu.c b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/testcpu.c
new file mode 100644
index 00000000..bacd6c1c
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/testcpu.c
@@ -0,0 +1,35 @@
+/*
+ testcpu: standalone CPU flags tester
+
+ copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
+ initially written by Thomas Orgis
+*/
+
+#include <stdio.h>
+#include "getcpuflags.h"
+
+int main()
+{
+ int family;
+ struct cpuflags flags;
+ if(!getcpuflags(&flags)){ printf("CPU won't do cpuid (some old i386 or i486)\n"); return 0; }
+ family = (flags.id & 0xf00)>>8;
+ printf("family: %i\n", family);
+ printf("stdcpuflags: 0x%08x\n", flags.std);
+ printf("std2cpuflags: 0x%08x\n", flags.std2);
+ printf("extcpuflags: 0x%08x\n", flags.ext);
+ if(cpu_i586(flags))
+ {
+ printf("A i586 or better cpu with:");
+ if(cpu_mmx(flags)) printf(" mmx");
+ if(cpu_3dnow(flags)) printf(" 3dnow");
+ if(cpu_3dnowext(flags)) printf(" 3dnowext");
+ if(cpu_sse(flags)) printf(" sse");
+ if(cpu_sse2(flags)) printf(" sse2");
+ if(cpu_sse3(flags)) printf(" sse3");
+ printf("\n");
+ }
+ else printf("I guess you have some i486\n");
+ return 0;
+}
diff --git a/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/true.h b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/true.h
new file mode 100644
index 00000000..b38675ff
--- /dev/null
+++ b/Src/external_dependencies/openmpt-trunk/include/mpg123/src/libmpg123/true.h
@@ -0,0 +1,15 @@
+/*
+ true: a trivial truth
+
+ copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
+ see COPYING and AUTHORS files in distribution or http:#mpg123.org
+*/
+
+#ifndef MPG123_H_TRUE
+#define MPG123_H_TRUE
+
+#define MAYBE -1
+#define FALSE 0
+#define TRUE 1
+
+#endif