From bafb747d2df70b2ce30ec099c78d3a19ab7bda0a Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 21 Oct 2021 11:39:48 +0200 Subject: [PATCH] libs: Import upstream code from mpg123 1.29.1. Signed-off-by: Alexandre Julliard --- configure | 26 + configure.ac | 2 + libs/mpg123/AUTHORS | 176 + libs/mpg123/LICENSE | 19 + libs/mpg123/Makefile.in | 31 + libs/mpg123/config.h | 529 ++ libs/mpg123/src/compat/compat.c | 508 ++ libs/mpg123/src/compat/compat.h | 301 + libs/mpg123/src/compat/compat_str.c | 105 + libs/mpg123/src/compat/wpathconv.h | 120 + libs/mpg123/src/intsym.h | 370 ++ libs/mpg123/src/libmpg123/abi_align.h | 41 + libs/mpg123/src/libmpg123/costabs.h | 81 + libs/mpg123/src/libmpg123/dct64.c | 175 + libs/mpg123/src/libmpg123/debug.h | 132 + libs/mpg123/src/libmpg123/decode.h | 292 + libs/mpg123/src/libmpg123/dither.c | 3 + libs/mpg123/src/libmpg123/dither.h | 23 + libs/mpg123/src/libmpg123/dither_impl.h | 119 + libs/mpg123/src/libmpg123/equalizer.c | 17 + libs/mpg123/src/libmpg123/fmt123.h | 159 + libs/mpg123/src/libmpg123/format.c | 776 +++ libs/mpg123/src/libmpg123/frame.c | 1066 ++++ libs/mpg123/src/libmpg123/frame.h | 431 ++ libs/mpg123/src/libmpg123/gapless.h | 119 + libs/mpg123/src/libmpg123/getbits.h | 103 + libs/mpg123/src/libmpg123/getcpuflags.h | 101 + libs/mpg123/src/libmpg123/huffman.h | 340 ++ libs/mpg123/src/libmpg123/icy.c | 34 + libs/mpg123/src/libmpg123/icy.h | 38 + libs/mpg123/src/libmpg123/icy2utf8.c | 440 ++ libs/mpg123/src/libmpg123/icy2utf8.h | 10 + libs/mpg123/src/libmpg123/id3.c | 1470 +++++ libs/mpg123/src/libmpg123/id3.h | 43 + libs/mpg123/src/libmpg123/index.c | 132 + libs/mpg123/src/libmpg123/index.h | 59 + libs/mpg123/src/libmpg123/l12tabs.h | 1224 ++++ libs/mpg123/src/libmpg123/l2tables.h | 167 + libs/mpg123/src/libmpg123/l3bandgain.h | 94 + libs/mpg123/src/libmpg123/l3tabs.h | 5285 ++++++++++++++++++ libs/mpg123/src/libmpg123/layer1.c | 250 + libs/mpg123/src/libmpg123/layer2.c | 380 ++ libs/mpg123/src/libmpg123/layer3.c | 1943 +++++++ libs/mpg123/src/libmpg123/lfs_wrap.c | 781 +++ libs/mpg123/src/libmpg123/libmpg123.c | 1879 +++++++ libs/mpg123/src/libmpg123/mpeghead.h | 89 + libs/mpg123/src/libmpg123/mpg123.h | 2001 +++++++ libs/mpg123/src/libmpg123/mpg123lib_intern.h | 342 ++ libs/mpg123/src/libmpg123/newhuffman.h | 824 +++ libs/mpg123/src/libmpg123/ntom.c | 148 + libs/mpg123/src/libmpg123/optimize.c | 1164 ++++ libs/mpg123/src/libmpg123/optimize.h | 388 ++ libs/mpg123/src/libmpg123/parse.c | 1385 +++++ libs/mpg123/src/libmpg123/parse.h | 25 + libs/mpg123/src/libmpg123/reader.h | 140 + libs/mpg123/src/libmpg123/readers.c | 1257 +++++ libs/mpg123/src/libmpg123/sample.h | 195 + libs/mpg123/src/libmpg123/stringbuf.c | 250 + libs/mpg123/src/libmpg123/swap_bytes_impl.h | 103 + libs/mpg123/src/libmpg123/synth.c | 1192 ++++ libs/mpg123/src/libmpg123/synth.h | 196 + libs/mpg123/src/libmpg123/synth_8bit.c | 142 + libs/mpg123/src/libmpg123/synth_8bit.h | 86 + libs/mpg123/src/libmpg123/synth_mono.h | 64 + libs/mpg123/src/libmpg123/synth_ntom.h | 213 + libs/mpg123/src/libmpg123/synth_real.c | 585 ++ libs/mpg123/src/libmpg123/synth_s32.c | 598 ++ libs/mpg123/src/libmpg123/synths.h | 52 + libs/mpg123/src/libmpg123/tabinit.c | 345 ++ libs/mpg123/src/libmpg123/true.h | 15 + 70 files changed, 32193 insertions(+) create mode 100644 libs/mpg123/AUTHORS create mode 100644 libs/mpg123/LICENSE create mode 100644 libs/mpg123/Makefile.in create mode 100644 libs/mpg123/config.h create mode 100644 libs/mpg123/src/compat/compat.c create mode 100644 libs/mpg123/src/compat/compat.h create mode 100644 libs/mpg123/src/compat/compat_str.c create mode 100644 libs/mpg123/src/compat/wpathconv.h create mode 100644 libs/mpg123/src/intsym.h create mode 100644 libs/mpg123/src/libmpg123/abi_align.h create mode 100644 libs/mpg123/src/libmpg123/costabs.h create mode 100644 libs/mpg123/src/libmpg123/dct64.c create mode 100644 libs/mpg123/src/libmpg123/debug.h create mode 100644 libs/mpg123/src/libmpg123/decode.h create mode 100644 libs/mpg123/src/libmpg123/dither.c create mode 100644 libs/mpg123/src/libmpg123/dither.h create mode 100644 libs/mpg123/src/libmpg123/dither_impl.h create mode 100644 libs/mpg123/src/libmpg123/equalizer.c create mode 100644 libs/mpg123/src/libmpg123/fmt123.h create mode 100644 libs/mpg123/src/libmpg123/format.c create mode 100644 libs/mpg123/src/libmpg123/frame.c create mode 100644 libs/mpg123/src/libmpg123/frame.h create mode 100644 libs/mpg123/src/libmpg123/gapless.h create mode 100644 libs/mpg123/src/libmpg123/getbits.h create mode 100644 libs/mpg123/src/libmpg123/getcpuflags.h create mode 100644 libs/mpg123/src/libmpg123/huffman.h create mode 100644 libs/mpg123/src/libmpg123/icy.c create mode 100644 libs/mpg123/src/libmpg123/icy.h create mode 100644 libs/mpg123/src/libmpg123/icy2utf8.c create mode 100644 libs/mpg123/src/libmpg123/icy2utf8.h create mode 100644 libs/mpg123/src/libmpg123/id3.c create mode 100644 libs/mpg123/src/libmpg123/id3.h create mode 100644 libs/mpg123/src/libmpg123/index.c create mode 100644 libs/mpg123/src/libmpg123/index.h create mode 100644 libs/mpg123/src/libmpg123/l12tabs.h create mode 100644 libs/mpg123/src/libmpg123/l2tables.h create mode 100644 libs/mpg123/src/libmpg123/l3bandgain.h create mode 100644 libs/mpg123/src/libmpg123/l3tabs.h create mode 100644 libs/mpg123/src/libmpg123/layer1.c create mode 100644 libs/mpg123/src/libmpg123/layer2.c create mode 100644 libs/mpg123/src/libmpg123/layer3.c create mode 100644 libs/mpg123/src/libmpg123/lfs_wrap.c create mode 100644 libs/mpg123/src/libmpg123/libmpg123.c create mode 100644 libs/mpg123/src/libmpg123/mpeghead.h create mode 100644 libs/mpg123/src/libmpg123/mpg123.h create mode 100644 libs/mpg123/src/libmpg123/mpg123lib_intern.h create mode 100644 libs/mpg123/src/libmpg123/newhuffman.h create mode 100644 libs/mpg123/src/libmpg123/ntom.c create mode 100644 libs/mpg123/src/libmpg123/optimize.c create mode 100644 libs/mpg123/src/libmpg123/optimize.h create mode 100644 libs/mpg123/src/libmpg123/parse.c create mode 100644 libs/mpg123/src/libmpg123/parse.h create mode 100644 libs/mpg123/src/libmpg123/reader.h create mode 100644 libs/mpg123/src/libmpg123/readers.c create mode 100644 libs/mpg123/src/libmpg123/sample.h create mode 100644 libs/mpg123/src/libmpg123/stringbuf.c create mode 100644 libs/mpg123/src/libmpg123/swap_bytes_impl.h create mode 100644 libs/mpg123/src/libmpg123/synth.c create mode 100644 libs/mpg123/src/libmpg123/synth.h create mode 100644 libs/mpg123/src/libmpg123/synth_8bit.c create mode 100644 libs/mpg123/src/libmpg123/synth_8bit.h create mode 100644 libs/mpg123/src/libmpg123/synth_mono.h create mode 100644 libs/mpg123/src/libmpg123/synth_ntom.h create mode 100644 libs/mpg123/src/libmpg123/synth_real.c create mode 100644 libs/mpg123/src/libmpg123/synth_s32.c create mode 100644 libs/mpg123/src/libmpg123/synths.h create mode 100644 libs/mpg123/src/libmpg123/tabinit.c create mode 100644 libs/mpg123/src/libmpg123/true.h diff --git a/configure b/configure index 909ac1e414d..4e64db49eed 100755 --- a/configure +++ b/configure @@ -703,6 +703,8 @@ TIFF_PE_LIBS TIFF_PE_CFLAGS PNG_PE_LIBS PNG_PE_CFLAGS +MPG123_PE_LIBS +MPG123_PE_CFLAGS LCMS2_PE_LIBS LCMS2_PE_CFLAGS JXR_PE_LIBS @@ -1786,6 +1788,7 @@ enable_jpeg enable_jxr enable_lcms2 enable_mfuuid +enable_mpg123 enable_png enable_strmiids enable_tiff @@ -1934,6 +1937,8 @@ JXR_PE_CFLAGS JXR_PE_LIBS LCMS2_PE_CFLAGS LCMS2_PE_LIBS +MPG123_PE_CFLAGS +MPG123_PE_LIBS PNG_PE_CFLAGS PNG_PE_LIBS TIFF_PE_CFLAGS @@ -2724,6 +2729,11 @@ Some influential environment variables: version LCMS2_PE_LIBS Linker flags for the PE lcms2, overriding the bundled version + MPG123_PE_CFLAGS + C compiler flags for the PE mpg123, overriding the bundled + version + MPG123_PE_LIBS + Linker flags for the PE mpg123, overriding the bundled version PNG_PE_CFLAGS C compiler flags for the PE png, overriding the bundled version PNG_PE_LIBS Linker flags for the PE png, overriding the bundled version @@ -10737,6 +10747,19 @@ fi $as_echo "$as_me:${as_lineno-$LINENO}: lcms2 cflags: $LCMS2_PE_CFLAGS" >&5 $as_echo "$as_me:${as_lineno-$LINENO}: lcms2 libs: $LCMS2_PE_LIBS" >&5 +if ${MPG123_PE_CFLAGS:+false} :; then : + MPG123_PE_CFLAGS="-I\$(top_srcdir)/libs/mpg123/src/libmpg123" +else + enable_mpg123=no +fi +if ${MPG123_PE_LIBS:+false} :; then : + MPG123_PE_LIBS=mpg123 +else + enable_mpg123=no +fi +$as_echo "$as_me:${as_lineno-$LINENO}: mpg123 cflags: $MPG123_PE_CFLAGS" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: mpg123 libs: $MPG123_PE_LIBS" >&5 + if ${PNG_PE_CFLAGS:+false} :; then : PNG_PE_CFLAGS="-I\$(top_srcdir)/libs/png" else @@ -18847,6 +18870,8 @@ JXR_PE_CFLAGS = $JXR_PE_CFLAGS JXR_PE_LIBS = $JXR_PE_LIBS LCMS2_PE_CFLAGS = $LCMS2_PE_CFLAGS LCMS2_PE_LIBS = $LCMS2_PE_LIBS +MPG123_PE_CFLAGS = $MPG123_PE_CFLAGS +MPG123_PE_LIBS = $MPG123_PE_LIBS PNG_PE_CFLAGS = $PNG_PE_CFLAGS PNG_PE_LIBS = $PNG_PE_LIBS TIFF_PE_CFLAGS = $TIFF_PE_CFLAGS @@ -20142,6 +20167,7 @@ wine_fn_config_makefile libs/jpeg enable_jpeg wine_fn_config_makefile libs/jxr enable_jxr wine_fn_config_makefile libs/lcms2 enable_lcms2 wine_fn_config_makefile libs/mfuuid enable_mfuuid +wine_fn_config_makefile libs/mpg123 enable_mpg123 wine_fn_config_makefile libs/png enable_png wine_fn_config_makefile libs/strmiids enable_strmiids wine_fn_config_makefile libs/tiff enable_tiff diff --git a/configure.ac b/configure.ac index 3b71bfe38c6..047e2b82638 100644 --- a/configure.ac +++ b/configure.ac @@ -1057,6 +1057,7 @@ WINE_EXTLIB_FLAGS(GSM, gsm, gsm, "-I\$(top_srcdir)/libs/gsm/inc") WINE_EXTLIB_FLAGS(JPEG, jpeg, jpeg, "-I\$(top_srcdir)/libs/jpeg") WINE_EXTLIB_FLAGS(JXR, jxr, jxr, "-I\$(top_srcdir)/libs/jxr/jxrgluelib -I\$(top_srcdir)/libs/jxr/image/sys") WINE_EXTLIB_FLAGS(LCMS2, lcms2, lcms2, "-I\$(top_srcdir)/libs/lcms2/include") +WINE_EXTLIB_FLAGS(MPG123, mpg123, mpg123, "-I\$(top_srcdir)/libs/mpg123/src/libmpg123") WINE_EXTLIB_FLAGS(PNG, png, "png \$(ZLIB_PE_LIBS)", "-I\$(top_srcdir)/libs/png") WINE_EXTLIB_FLAGS(TIFF, tiff, tiff, "-I\$(top_srcdir)/libs/tiff/libtiff") WINE_EXTLIB_FLAGS(XML2, libxml2, xml2, "-I\$(top_srcdir)/libs/xml2/include -DLIBXML_STATIC") @@ -3693,6 +3694,7 @@ WINE_CONFIG_MAKEFILE(libs/jpeg) WINE_CONFIG_MAKEFILE(libs/jxr) WINE_CONFIG_MAKEFILE(libs/lcms2) WINE_CONFIG_MAKEFILE(libs/mfuuid) +WINE_CONFIG_MAKEFILE(libs/mpg123) WINE_CONFIG_MAKEFILE(libs/png) WINE_CONFIG_MAKEFILE(libs/strmiids) WINE_CONFIG_MAKEFILE(libs/tiff) diff --git a/libs/mpg123/AUTHORS b/libs/mpg123/AUTHORS new file mode 100644 index 00000000000..3321f0bafc0 --- /dev/null +++ b/libs/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 + Patrick Dehne + Jonathan Yong <10walls@gmail.com> + Taihei Momma + +Co-initiator of the revived mpg123 project, but not that involved anymore: + Nicholas J Humfrey + +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): + +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 : ports/cmake (optional CMake build) +Won-Kyu Park : patch to get rid of asm textrels (x86 PIC) +Michael Weiser : update of coreaudio output to AudioComponents API +Bent Bisballe Nyeng : patch for MPG123_NO_PEEK_END and MPG123_FORCE_SEEKABLE +Eric S. Raymond : man page fixes +Tobias Weber : patch for --disable-equalizer +Hans de Goede : patch to skip APE tags +Stephan Vedder : MSVC++ 2013 port update +Rajeev V. Pillai : pointing out/patching issues in HTTP code and behaviour of mpg123 remote/terminal control +Jarno Lehtinen : tinyalsa output +Anthony Wells : initial version of ID3v2 APIC patch +David Wohlferd : Win32 WaveOut buffer destructor fix. +Mike Gorchak : QNX native audio output (QSA) +Dan McGee : various patches (also for test suite) +Jonathan Yong (jon_y) <10walls@gmail.com>: win32 hacking, win32 wasapi audio. +Malcolm Boczek : Common language runtime wrapper +Elbert Pol (TeLLie) : OS/2 port fixup +Jeroen Valkonet : motivate pitch control, suggestive patch for pitch command in generic control interface +Andy Hefner : patch for that second UTF16 issue +Taihei Monma : A whole lot of new/improved assembler code, including Altivec! +Christian Weisgerber , Brad Smith: sndio output +Patrick Dehne (P4tr3ck) : more MSVC++ porting, patch to handle missing bit reservoirs +Thorsten Glaser : icy2utf8, suggest utf8 locale stuff +Dan Smith : ABI fixes for ensuring stack alignment (esp. for MinGW-built DLL with MSVC) +Michael Ryzhykh : mpg123.spec.in +Stefan Lenselink : initial aRts output +Sergej Kvachonok : 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 : extended 3dnow (from mplayer) +Zuxy Meng : SSE (from mplayer) +Honza : idea and prototype patch for ICY meta data support +Petr Baudis : patches: term sigcont, id3 display unicode fallback and condensed output +Petr Salinger : i486 enhancement +mpdavig@users.sourceforge.net: linux-ppc-nas Makefile.legacy entry +Adrian Bacon : patched decode_i586_dither (noise shaped float/int rounding) +Cool Feet Audio project : realtime equalizer control +Steve Grundell : clean stdout in control mode with stdout decoding +Romain Dolbeau : Altivec support (taken from mplayer) +higway : MMX Patch +Clemens Ladisch : ALSA 0.9/1.0 support + +Debian Daniel Kobras era: + +Steve Kemp +Dan Olson +Syuuhei Kashiyama +Rupert Levene +Andreas Dilger +Erik B. Andersen +Chris Butler +Martin Sjogren +Chet Hosey +Roland Rosenfeld + + +Debian Colin Watson era: + +Helge Deller +Chet Hosey +Christopher C. Chimelis +Roland Rosenfeld +Marcelo E. Magallon + + +Initial Debianers: + +Tommi Virtanen +Paul Haggart + + +Contributions/ideas Michael Hipp era: + +Mikko Tommila: DCT9 +Oliver Fromme +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 : DCT36/manual unroll idea +Thomas Woerner: SGI Audio +Damien Clermonte: HP-UX audio fixes +Niclas Lindstrom : OS2 port +Stefan Bieschewski : Pentium optimizations, decode_i586.s +Martin Denn : NAS port +Niklas Beisert : MPEG 2.5 tables + and : NetBSD Patch(es) +Kevin Brintnall : BSD patch +Tony Million: win32 port +Steven Tiger Lang: advanced shuffle +Eric B. Mitchell: esd port +Ryan R. Prosser : esd port for Solaris +Andreas Neuhaus: initial generic control interface + +(additionally fetched from changelog:) + +Ralf Hildebrandt : audio_alib changes +: BSDOS 4.0 with gcc added to Makefile +Bertrand Petit : frontend changes +Erik Mouw : SGI audio fix for non RAD machines +Daniel O'Connor : freebsd-esd make-entry +D. Skarda <0rfelyus@atrey.karlin.mff.cuni.cz>: enhanced head_check +Wilson, Jeff D : xterm-title +Robert Bihlmeyer : esd changes +Hannu Napari's : SGI audio patches +: native AIX support +: playlist patch +Gilles Zunino : SGI audio patches +Matthew Parslow : esdserver patch +: equalizer patch (equalfile setting) +Ducroquet Erwan : HPUX/ALib support +Shane Wegner : genrepatch +Samuel Audet : wav-File patch +"J. Dean Brederson" : SGI-RAD support +Chou Ye-chi : sajberplay/FreeBSD patch +Fabrice Bellard : 486 optimizations +A. Hermansen and J. Kysela : ALSA output +KIMURA Takuhiro : K6-3DNow +Petr Stehlik : MINT +Andy : float2int speed up proposal +Brian Foutz : TK3Play +Thomas Niederreiter : RIFF header fix +Stefan Gybas : m68k patch +Grant Erickson : Linux PPC patch +Peter Berger : BSDi patch +Henrik P Johnson : HTTP auth +Steven Tiger Lang : advanced shuffle +"Brian J. Swetland" : front-end (remote) patch + +Tillmann Steinbrecher : shuffle patch +M.Stekelenburg : i386-getbits +Antti Andreimann : outburst patch +Hur TaeSung : 'http accept' patch + +(from post-0.59 changes that yet have to go into new trunk:) + +Hans Schwengeler : audio_dec additions +Wojciech BaraƱski's Mp3Play (check the tools folder): Mp3Play frontend +Daniel Koukola: audio_oss.c patch +Munechika SUMIKAWA : IPv6 +TEMNOTA : HTTP,FTP patch/playlist fix +Peter Surda : VBR patch +Ben : ARM startup time improvements +Dave MacKenzie : init_output() patch +pasky's : close-on-stop patch diff --git a/libs/mpg123/LICENSE b/libs/mpg123/LICENSE new file mode 100644 index 00000000000..e0a9dde4194 --- /dev/null +++ b/libs/mpg123/LICENSE @@ -0,0 +1,19 @@ +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. diff --git a/libs/mpg123/Makefile.in b/libs/mpg123/Makefile.in new file mode 100644 index 00000000000..7ce4a883fe7 --- /dev/null +++ b/libs/mpg123/Makefile.in @@ -0,0 +1,31 @@ +EXTLIB = libmpg123.a +EXTRAINCL = -I$(srcdir)/src -I$(srcdir)/src/compat -I$(srcdir)/src/libmpg123 +EXTRADEFS = -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT -DNO_CATCHSIGNAL + +C_SRCS = \ + src/compat/compat.c \ + src/compat/compat_str.c \ + src/libmpg123/dct64.c \ + src/libmpg123/dither.c \ + src/libmpg123/equalizer.c \ + src/libmpg123/format.c \ + src/libmpg123/frame.c \ + src/libmpg123/icy.c \ + src/libmpg123/icy2utf8.c \ + src/libmpg123/id3.c \ + src/libmpg123/index.c \ + src/libmpg123/layer1.c \ + src/libmpg123/layer2.c \ + src/libmpg123/layer3.c \ + src/libmpg123/lfs_wrap.c \ + src/libmpg123/libmpg123.c \ + src/libmpg123/ntom.c \ + src/libmpg123/optimize.c \ + src/libmpg123/parse.c \ + src/libmpg123/readers.c \ + src/libmpg123/stringbuf.c \ + src/libmpg123/synth.c \ + src/libmpg123/synth_8bit.c \ + src/libmpg123/synth_real.c \ + src/libmpg123/synth_s32.c \ + src/libmpg123/tabinit.c diff --git a/libs/mpg123/config.h b/libs/mpg123/config.h new file mode 100644 index 00000000000..77986b2a513 --- /dev/null +++ b/libs/mpg123/config.h @@ -0,0 +1,529 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if your architecture wants/needs/can use attribute_align_arg and + alignment checks. It is for 32bit x86... */ +/* #undef ABI_ALIGN_FUN */ + +/* Define to use proper rounding. */ +#define ACCURATE_ROUNDING 1 + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define if .balign is present. */ +#define ASMALIGN_BALIGN 1 + +/* Define if .align just takes byte count. */ +/* #undef ASMALIGN_BYTE */ + +/* Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. */ +/* #undef ASMALIGN_EXP */ + +/* Define if __attribute__((aligned(16))) shall be used */ +#define CCALIGN 1 + +/* Define if debugging is enabled. */ +/* #undef DEBUG */ + +/* The default audio output module(s) to use */ +#define DEFAULT_OUTPUT_MODULE "pulse,win32,win32_wasapi,sdl" + +/* Define if building with dynamcally linked libmpg123 */ +/* #undef DYNAMIC_BUILD */ + +/* Use EFBIG as substitude for EOVERFLOW, mingw.org may lack the latter */ +/* #undef EOVERFLOW */ + +/* Define if FIFO support is enabled. */ +#define FIFO 1 + +/* Define if frame index should be used. */ +#define FRAME_INDEX 1 + +/* Define if gapless is enabled. */ +#define GAPLESS 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ALC_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ALIB_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_AL_ALC_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_AL_AL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_AL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARPA_INET_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ASM_AUDIOIO_H */ + +/* Define to 1 if you have the `atoll' function. */ +#define HAVE_ATOLL 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_AUDIOS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CORESERVICES_CORESERVICES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CULIB_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the `dlclose' function. */ +/* #undef HAVE_DLCLOSE */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define to 1 if you have the `dlopen' function. */ +/* #undef HAVE_DLOPEN */ + +/* Define to 1 if you have the `dlsym' function. */ +/* #undef HAVE_DLSYM */ + +/* Define to 1 if you have the `getaddrinfo' function. */ +/* #undef HAVE_GETADDRINFO */ + +/* Define to 1 if you have the `getuid' function. */ +/* #undef HAVE_GETUID */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `iswprint' function. */ +#define HAVE_ISWPRINT 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LANGINFO_H */ + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `mx' library (-lmx). */ +/* #undef HAVE_LIBMX */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_SOUNDCARD_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACHINE_SOUNDCARD_H */ + +/* Define to 1 if you have the `mbstowcs' function. */ +#define HAVE_MBSTOWCS 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkfifo' function. */ +/* #undef HAVE_MKFIFO */ + +/* Define to 1 if you have the `mmap' function. */ +/* #undef HAVE_MMAP */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETDB_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IN_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* Define to 1 if you have the `nl_langinfo' function. */ +/* #undef HAVE_NL_LANGINFO */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OPENAL_ALC_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OPENAL_AL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OS2ME_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OS2_H */ + +/* Define to 1 if you have the `random' function. */ +/* #undef HAVE_RANDOM */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SCHED_H 1 + +/* Define to 1 if you have the `sched_setscheduler' function. */ +/* #undef HAVE_SCHED_SETSCHEDULER */ + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `setpriority' function. */ +/* #undef HAVE_SETPRIORITY */ + +/* Define to 1 if you have the `setuid' function. */ +/* #undef HAVE_SETUID */ + +/* Define to 1 if you have the `shmat' function. */ +/* #undef HAVE_SHMAT */ + +/* Define to 1 if you have the `shmctl' function. */ +/* #undef HAVE_SHMCTL */ + +/* Define to 1 if you have the `shmdt' function. */ +/* #undef HAVE_SHMDT */ + +/* Define to 1 if you have the `shmget' function. */ +/* #undef HAVE_SHMGET */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SNDIO_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SUN_AUDIOIO_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_AUDIOIO_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_AUDIO_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_IOCTL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_IPC_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_RESOURCE_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SELECT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SHM_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SIGNAL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SOCKET_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SOUNDCARD_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_TIME_H 1 */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_WAIT_H */ + +/* Define this if you have the POSIX termios library */ +/* #undef HAVE_TERMIOS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the `wcstombs' function. */ +#define HAVE_WCSTOMBS 1 + +/* Define to 1 if you have the `wcswidth' function. */ +/* #undef HAVE_WCSWIDTH */ + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WINDOWS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WS2TCPIP_H 1 + +/* Define to indicate that float storage follows IEEE754. */ +#define IEEE_FLOAT 1 + +/* size of the frame index seek table */ +#define INDEX_SIZE 1000 + +/* Define if IPV6 support is enabled. */ +#define IPV6 1 + +/* Define this to the size of native offset type in bits, used for LFS alias + functions. */ +#define LFS_ALIAS_BITS 32 + +/* Define to the extension used for runtime loadable modules, say, ".so". */ +#define LT_MODULE_EXT ".dll" + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Define to the shared library suffix, say, ".dylib". */ +/* #undef LT_SHARED_EXT */ + +/* Define to the shared archive member specification, say "(shr.o)". */ +/* #undef LT_SHARED_LIB_MEMBER */ + +/* Define if network support is enabled. */ +/* #undef NETWORK */ + +/* Define to disable 16 bit integer output. */ +/* #undef NO_16BIT */ + +/* Define to disable 32 bit and 24 bit integer output. */ +/* #undef NO_32BIT */ + +/* Define to disable 8 bit integer output. */ +/* #undef NO_8BIT */ + +/* Define to disable downsampled decoding. */ +/* #undef NO_DOWNSAMPLE */ + +/* Define to disable equalizer. */ +/* #undef NO_EQUALIZER */ + +/* Define to disable error messages in combination with a return value (the + return is left intact). */ +/* #undef NO_ERETURN */ + +/* Define to disable error messages. */ +/* #undef NO_ERRORMSG */ + +/* Define to disable feeder and buffered readers. */ +/* #undef NO_FEEDER */ + +/* Define to disable ICY handling. */ +/* #undef NO_ICY */ + +/* Define to disable ID3v2 parsing. */ +/* #undef NO_ID3V2 */ + +/* Define to disable layer I. */ +/* #undef NO_LAYER1 */ + +/* Define to disable layer II. */ +/* #undef NO_LAYER2 */ + +/* Define to disable layer III. */ +/* #undef NO_LAYER3 */ + +/* Define to disable analyzer info. */ +/* #undef NO_MOREINFO */ + +/* Define to disable ntom resampling. */ +/* #undef NO_NTOM */ + +/* Define to disable real output. */ +/* #undef NO_REAL */ + +/* Define to disable string functions. */ +/* #undef NO_STRING */ + +/* Define for post-processed 32 bit formats. */ +/* #undef NO_SYNTH32 */ + +/* Define to disable warning messages. */ +/* #undef NO_WARNING */ + +/* Name of package */ +#define PACKAGE "mpg123" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "maintainer@mpg123.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "mpg123" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "mpg123 1.29.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "mpg123" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.29.1" + +/* Define if portaudio v18 API is wanted. */ +/* #undef PORTAUDIO18 */ + +/* Define for calculating tables at runtime. */ +/* #undef RUNTIME_TABLES */ + +/* The size of `int32_t', as computed by sizeof. */ +#define SIZEOF_INT32_T 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `off64_t', as computed by sizeof. */ +#define SIZEOF_OFF64_T 8 + +/* The size of `off_t', as computed by sizeof. */ +#define SIZEOF_OFF_T 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + +/* The size of `ssize_t', as computed by sizeof. */ +#define SIZEOF_SSIZE_T 4 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to not duplicate some code for likely cases in libsyn123. */ +/* #undef SYN123_NO_CASES */ + +/* Define if modules are enabled */ +#define USE_MODULES 1 + +/* Define for new Huffman decoding scheme. */ +#define USE_NEW_HUFFTABLE 1 + +/* Define to use yasm for assemble AVX sources. */ +/* #undef USE_YASM_FOR_AVX */ + +/* Version number of package */ +#define VERSION "1.29.1" + +/* Define to use Win32 named pipes */ +#define WANT_WIN32_FIFO 1 + +/* Define to use Win32 sockets */ +#define WANT_WIN32_SOCKETS 1 + +/* Define to use Unicode for Windows */ +#define WANT_WIN32_UNICODE 1 + +/* Windows UWP build */ +/* #undef WINDOWS_UWP */ + +/* Windows Vista and later APIs */ +/* #undef WINVER */ + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Define for extreme debugging. */ +/* #undef XDEBUG */ + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#define _FILE_OFFSET_BITS 64 + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Windows Vista and later APIs */ +/* #undef _WIN32_WINNT */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `short' if does not define. */ +/* #undef int16_t */ + +/* Define to `int' if does not define. */ +/* #undef int32_t */ + +/* Define to `long long' if does not define. */ +/* #undef int64_t */ + +/* Define to the native offset type (long or actually off_t). */ +#define lfs_alias_t long + +/* Define to `long int' if does not define. */ +/* #undef off_t */ + +/* Define to `unsigned long' if does not define. */ +/* #undef size_t */ + +/* Define to `long' if does not define. */ +/* #undef ssize_t */ + +/* Define to `unsigned short' if does not define. */ +/* #undef uint16_t */ + +/* Define to `unsigned int' if does not define. */ +/* #undef uint32_t */ + +/* Define to `unsigned long' if does not define. */ +/* #undef uintptr_t */ diff --git a/libs/mpg123/src/compat/compat.c b/libs/mpg123/src/compat/compat.c new file mode 100644 index 00000000000..a810b5f36f7 --- /dev/null +++ b/libs/mpg123/src/compat/compat.c @@ -0,0 +1,508 @@ +/* + 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 + +#if(defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_APP)) +#define WINDOWS_UWP +#endif + +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_DIRENT_H +# include +#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 +#include +#include +#include +#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); +} + +#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) + 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) + { + bytes -= part; + got += part; + } else if(errno != EINTR) + 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/libs/mpg123/src/compat/compat.h b/libs/mpg123/src/compat/compat.h new file mode 100644 index 00000000000..3e81919e3f0 --- /dev/null +++ b/libs/mpg123/src/compat/compat.h @@ -0,0 +1,301 @@ +/* + 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 + +#ifdef HAVE_STDLIB_H +/* realloc, size_t */ +#include +#endif + +#include +#include + +#ifdef HAVE_SIGNAL_H +#include +#else +#ifdef HAVE_SYS_SIGNAL_H +#include +#endif +#endif + +#ifdef HAVE_UNISTD_H +#include +#endif + +/* Types, types, types. */ +/* Do we actually need these two in addition to sys/types.h? As replacement? */ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_INTTYPES_H +#include +#endif +#ifdef HAVE_STDINT_H +#include +#endif +/* We want SIZE_MAX, etc. */ +#ifdef HAVE_LIMITS_H +#include +#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 + +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_STRINGS_H +#include +#endif + +#ifdef OS2 +#include +#endif + +#ifdef HAVE_SYS_TIME_H +#include +#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 +#endif + +/* compat_open makes little sense without */ +#include + +/* 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 + +#if !defined(MPG123_DEF_SSIZE_T) +#define MPG123_DEF_SSIZE_T +#include +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); + +/* 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. */ + +#ifdef WANT_WIN32_UNICODE +/** + * 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_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); + +/* That one comes from Tellie on OS/2, needed in resolver. */ +#ifdef __KLIBC__ +typedef int socklen_t; +#endif + +/* 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/libs/mpg123/src/compat/compat_str.c b/libs/mpg123/src/compat/compat_str.c new file mode 100644 index 00000000000..735f7b63127 --- /dev/null +++ b/libs/mpg123/src/compat/compat_str.c @@ -0,0 +1,105 @@ +/* + 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". */ +#ifdef WANT_WIN32_UNICODE +#include +#include +#include +#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 */ + +#ifdef WANT_WIN32_UNICODE +int win32_wide_utf8(const wchar_t * const wptr, char **mbptr, size_t * buflen) +{ + size_t len; + char *buf; + int ret = 0; + + len = WideCharToMultiByte(CP_UTF8, 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_UTF8, 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_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/libs/mpg123/src/compat/wpathconv.h b/libs/mpg123/src/compat/wpathconv.h new file mode 100644 index 00000000000..78b4294c2cf --- /dev/null +++ b/libs/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/libs/mpg123/src/intsym.h b/libs/mpg123/src/intsym.h new file mode 100644 index 00000000000..7b9b0fb5ce1 --- /dev/null +++ b/libs/mpg123/src/intsym.h @@ -0,0 +1,370 @@ +#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_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/libs/mpg123/src/libmpg123/abi_align.h b/libs/mpg123/src/libmpg123/abi_align.h new file mode 100644 index 00000000000..9ae46f429ab --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/costabs.h b/libs/mpg123/src/libmpg123/costabs.h new file mode 100644 index 00000000000..38d0ef89939 --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/dct64.c b/libs/mpg123/src/libmpg123/dct64.c new file mode 100644 index 00000000000..a49d308b166 --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/debug.h b/libs/mpg123/src/libmpg123/debug.h new file mode 100644 index 00000000000..83f2ba9562e --- /dev/null +++ b/libs/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 + + 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 +#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/libs/mpg123/src/libmpg123/decode.h b/libs/mpg123/src/libmpg123/decode.h new file mode 100644 index 00000000000..e32940c9942 --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/dither.c b/libs/mpg123/src/libmpg123/dither.c new file mode 100644 index 00000000000..329a4de703d --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/dither.h b/libs/mpg123/src/libmpg123/dither.h new file mode 100644 index 00000000000..6a6cb3e4794 --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/dither_impl.h b/libs/mpg123/src/libmpg123/dither_impl.h new file mode 100644 index 00000000000..30dbdd135a5 --- /dev/null +++ b/libs/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 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=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/libs/mpg123/src/libmpg123/equalizer.c b/libs/mpg123/src/libmpg123/equalizer.c new file mode 100644 index 00000000000..bc5d5d93538 --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/fmt123.h b/libs/mpg123/src/libmpg123/fmt123.h new file mode 100644 index 00000000000..d7772e1e575 --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/format.c b/libs/mpg123/src/libmpg123/format.c new file mode 100644 index 00000000000..a482e65ad17 --- /dev/null +++ b/libs/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; iforce_rate != 0 && mp->force_rate == r) return MPG123_RATES; +#endif + + return -1; +} + +static int enc2num(int encoding) +{ + int i; + for(i=0;ichannels-1; + int rn = rate2num(p, nf->rate); + if(rn >= 0) for(i=f0;iaudio_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=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=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; ifill = 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; idata; + uint16_t *usamples = (uint16_t*)buf->data; + size_t count = buf->fill/sizeof(int16_t); + + for(i=0; idata; + 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/libs/mpg123/src/libmpg123/frame.c b/libs/mpg123/src/libmpg123/frame.c new file mode 100644 index 00000000000..b14908f2319 --- /dev/null +++ b/libs/mpg123/src/libmpg123/frame.c @@ -0,0 +1,1066 @@ +/* + 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(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/libs/mpg123/src/libmpg123/frame.h b/libs/mpg123/src/libmpg123/frame.h new file mode 100644 index 00000000000..e34ea16f14e --- /dev/null +++ b/libs/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 +#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/libs/mpg123/src/libmpg123/gapless.h b/libs/mpg123/src/libmpg123/gapless.h new file mode 100644 index 00000000000..a98b86bc3ac --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/getbits.h b/libs/mpg123/src/libmpg123/getbits.h new file mode 100644 index 00000000000..6d0d548e3aa --- /dev/null +++ b/libs/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]<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/libs/mpg123/src/libmpg123/getcpuflags.h b/libs/mpg123/src/libmpg123/getcpuflags.h new file mode 100644 index 00000000000..ec95a737ffd --- /dev/null +++ b/libs/mpg123/src/libmpg123/getcpuflags.h @@ -0,0 +1,101 @@ +/* + 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 +// 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)); +#if ((defined OPT_X86) || (defined OPT_X86_64) || (defined OPT_NEON) || (defined OPT_NEON64)) && (defined OPT_MULTI) + return getcpuflags(cf); +#else + return 0; +#endif +} +#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/libs/mpg123/src/libmpg123/huffman.h b/libs/mpg123/src/libmpg123/huffman.h new file mode 100644 index 00000000000..576fbd884c6 --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/icy.c b/libs/mpg123/src/libmpg123/icy.c new file mode 100644 index 00000000000..1c287e78b6f --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/icy.h b/libs/mpg123/src/libmpg123/icy.h new file mode 100644 index 00000000000..a5fd64ea071 --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/icy2utf8.c b/libs/mpg123/src/libmpg123/icy2utf8.c new file mode 100644 index 00000000000..71605d2ac67 --- /dev/null +++ b/libs/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 + * + * 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 + +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/libs/mpg123/src/libmpg123/icy2utf8.h b/libs/mpg123/src/libmpg123/icy2utf8.h new file mode 100644 index 00000000000..aeec0121309 --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/id3.c b/libs/mpg123/src/libmpg123/id3.c new file mode 100644 index 00000000000..1629c9fdc3d --- /dev/null +++ b/libs/mpg123/src/libmpg123/id3.c @@ -0,0 +1,1470 @@ +/* + 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) + { + size_t i; + // Look through list of existing texts and return an existing entry + // if it should be overwritten. + for(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) +{ + size_t i; + + if(!description) + return NULL; + + // Return entry to overwrite, if appropriate. + for(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; itexts; ++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; icomments; ++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= 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!) $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; iid3v2_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= 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>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/libs/mpg123/src/libmpg123/id3.h b/libs/mpg123/src/libmpg123/id3.h new file mode 100644 index 00000000000..3a566949110 --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/index.c b/libs/mpg123/src/libmpg123/index.c new file mode 100644 index 00000000000..f8d94de509e --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/index.h b/libs/mpg123/src/libmpg123/index.h new file mode 100644 index 00000000000..3e1ca648a5c --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/l12tabs.h b/libs/mpg123/src/libmpg123/l12tabs.h new file mode 100644 index 00000000000..8b49c6e754b --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/l2tables.h b/libs/mpg123/src/libmpg123/l2tables.h new file mode 100644 index 00000000000..d06b029c89f --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/l3bandgain.h b/libs/mpg123/src/libmpg123/l3bandgain.h new file mode 100644 index 00000000000..05cab97c224 --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/l3tabs.h b/libs/mpg123/src/libmpg123/l3tabs.h new file mode 100644 index 00000000000..7b410925c86 --- /dev/null +++ b/libs/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/libs/mpg123/src/libmpg123/layer1.c b/libs/mpg123/src/libmpg123/layer1.c new file mode 100644 index 00000000000..c5bfc75d982 --- /dev/null +++ b/libs/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;istereo == 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;imuls[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;imuls[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;imuls[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;isynth_mono)(fraction[single], fr); + else + clip += (fr->synth_stereo)(fraction[0], fraction[1], fr); + } + + return clip; +} + + diff --git a/libs/mpg123/src/libmpg123/layer2.c b/libs/mpg123/src/libmpg123/layer2.c new file mode 100644 index 00000000000..0f2071b5a5b --- /dev/null +++ b/libs/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<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<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<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<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;ibits; + for(j=0;jbits; + 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;ibits; + 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;isampling_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>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/libs/mpg123/src/libmpg123/layer3.c b/libs/mpg123/src/libmpg123/layer3.c new file mode 100644 index 00000000000..a25ef09820a --- /dev/null +++ b/libs/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; chch[ch].gr[0].scfsi = -1; + si->ch[ch].gr[1].scfsi = getbits(fr, 4); + } + + for (gr=0; grch[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;iscalefac_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))<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(; sbmaxb; 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(; sbmaxb; 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(;sbch[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;grlayer3.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;ilsf); + + 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;imaxb;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;imaxb;i++) + *in0++ = *in1++; + } + break; + } + } + +#ifndef NO_MOREINFO + if(fr->pinfo) + fill_pinfo_side(fr, &sideinfo, gr, stereo1); +#endif + + for(ch=0;chaf.encoding != MPG123_ENC_SIGNED_16 || fr->down_sample != 0) + { +#endif + for(ss=0;sssynth_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/libs/mpg123/src/libmpg123/lfs_wrap.c b/libs/mpg123/src/libmpg123/lfs_wrap.c new file mode 100644 index 00000000000..a01f302b20d --- /dev/null +++ b/libs/mpg123/src/libmpg123/lfs_wrap.c @@ -0,0 +1,781 @@ +/* + 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 +#include +#include +#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; + + 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; + + 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; + + 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; ierr = 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/libs/mpg123/src/libmpg123/libmpg123.c b/libs/mpg123/src/libmpg123/libmpg123.c new file mode 100644 index 00000000000..5a34932d373 --- /dev/null +++ b/libs/mpg123/src/libmpg123/libmpg123.c @@ -0,0 +1,1879 @@ +/* + 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) +{ +#ifndef NO_EQUALIZER + if(mh == NULL) return MPG123_BAD_HANDLE; + 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); +} + +double attribute_align_arg mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band) +{ + double ret = 0.; +#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