[
  {
    "path": ".gitignore",
    "content": "*.d\n*.o\n*.dll\n*.so\n*.a\n/dcadec\n/dcacut\n*.exe\n*.pc\n/test/decoded/\n/test/stddev\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"test/samples\"]\n\tpath = test/samples\n\turl = https://github.com/foo86/dcadec-samples.git\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "v0.2.0 - Jan 04, 2016\n=====================\n- Fixed installation of shared library symlink.\n- Switched LFE channel interpolation to FIR filter by default.\n- Added command line option and context flag to select IIR filter for LFE\n  channel interpolation.\n- Fixed two bugs that could cause decoder to crash when processing invalid\n  input.\n- Fixed handling of sync loss when decoding MA streams with multiple frequency\n  bands.\n- Fixed decoding of MA streams with multiple frequency bands when sampling\n  frequency of the first band is not 96 kHz.\n- Fixed decoding to standard output on Windows causing junk to be appended\n  after normal PCM data.\n\n\nv0.1.0 - Nov 27, 2015\n=====================\n- Initial public release.\n"
  },
  {
    "path": "COPYING.LGPLv2.1",
    "content": "                  GNU LESSER GENERAL PUBLIC LICENSE\n                       Version 2.1, February 1999\n\n Copyright (C) 1991, 1999 Free Software Foundation, Inc.\n 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n[This is the first released version of the Lesser GPL.  It also counts\n as the successor of the GNU Library Public License, version 2, hence\n the version number 2.1.]\n\n                            Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicenses are intended to guarantee your freedom to share and change\nfree software--to make sure the software is free for all its users.\n\n  This license, the Lesser General Public License, applies to some\nspecially designated software packages--typically libraries--of the\nFree Software Foundation and other authors who decide to use it.  You\ncan use it too, but we suggest you first think carefully about whether\nthis license or the ordinary General Public License is the better\nstrategy to use in any particular case, based on the explanations below.\n\n  When we speak of free software, we are referring to freedom of use,\nnot price.  Our General Public Licenses are designed to make sure that\nyou have the freedom to distribute copies of free software (and charge\nfor this service if you wish); that you receive source code or can get\nit if you want it; that you can change the software and use pieces of\nit in new free programs; and that you are informed that you can do\nthese things.\n\n  To protect your rights, we need to make restrictions that forbid\ndistributors to deny you these rights or to ask you to surrender these\nrights.  These restrictions translate to certain responsibilities for\nyou if you distribute copies of the library or if you modify it.\n\n  For example, if you distribute copies of the library, whether gratis\nor for a fee, you must give the recipients all the rights that we gave\nyou.  You must make sure that they, too, receive or can get the source\ncode.  If you link other code with the library, you must provide\ncomplete object files to the recipients, so that they can relink them\nwith the library after making changes to the library and recompiling\nit.  And you must show them these terms so they know their rights.\n\n  We protect your rights with a two-step method: (1) we copyright the\nlibrary, and (2) we offer you this license, which gives you legal\npermission to copy, distribute and/or modify the library.\n\n  To protect each distributor, we want to make it very clear that\nthere is no warranty for the free library.  Also, if the library is\nmodified by someone else and passed on, the recipients should know\nthat what they have is not the original version, so that the original\nauthor's reputation will not be affected by problems that might be\nintroduced by others.\n\f\n  Finally, software patents pose a constant threat to the existence of\nany free program.  We wish to make sure that a company cannot\neffectively restrict the users of a free program by obtaining a\nrestrictive license from a patent holder.  Therefore, we insist that\nany patent license obtained for a version of the library must be\nconsistent with the full freedom of use specified in this license.\n\n  Most GNU software, including some libraries, is covered by the\nordinary GNU General Public License.  This license, the GNU Lesser\nGeneral Public License, applies to certain designated libraries, and\nis quite different from the ordinary General Public License.  We use\nthis license for certain libraries in order to permit linking those\nlibraries into non-free programs.\n\n  When a program is linked with a library, whether statically or using\na shared library, the combination of the two is legally speaking a\ncombined work, a derivative of the original library.  The ordinary\nGeneral Public License therefore permits such linking only if the\nentire combination fits its criteria of freedom.  The Lesser General\nPublic License permits more lax criteria for linking other code with\nthe library.\n\n  We call this license the \"Lesser\" General Public License because it\ndoes Less to protect the user's freedom than the ordinary General\nPublic License.  It also provides other free software developers Less\nof an advantage over competing non-free programs.  These disadvantages\nare the reason we use the ordinary General Public License for many\nlibraries.  However, the Lesser license provides advantages in certain\nspecial circumstances.\n\n  For example, on rare occasions, there may be a special need to\nencourage the widest possible use of a certain library, so that it becomes\na de-facto standard.  To achieve this, non-free programs must be\nallowed to use the library.  A more frequent case is that a free\nlibrary does the same job as widely used non-free libraries.  In this\ncase, there is little to gain by limiting the free library to free\nsoftware only, so we use the Lesser General Public License.\n\n  In other cases, permission to use a particular library in non-free\nprograms enables a greater number of people to use a large body of\nfree software.  For example, permission to use the GNU C Library in\nnon-free programs enables many more people to use the whole GNU\noperating system, as well as its variant, the GNU/Linux operating\nsystem.\n\n  Although the Lesser General Public License is Less protective of the\nusers' freedom, it does ensure that the user of a program that is\nlinked with the Library has the freedom and the wherewithal to run\nthat program using a modified version of the Library.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.  Pay close attention to the difference between a\n\"work based on the library\" and a \"work that uses the library\".  The\nformer contains code derived from the library, whereas the latter must\nbe combined with the library in order to run.\n\f\n                  GNU LESSER GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License Agreement applies to any software library or other\nprogram which contains a notice placed by the copyright holder or\nother authorized party saying it may be distributed under the terms of\nthis Lesser General Public License (also called \"this License\").\nEach licensee is addressed as \"you\".\n\n  A \"library\" means a collection of software functions and/or data\nprepared so as to be conveniently linked with application programs\n(which use some of those functions and data) to form executables.\n\n  The \"Library\", below, refers to any such software library or work\nwhich has been distributed under these terms.  A \"work based on the\nLibrary\" means either the Library or any derivative work under\ncopyright law: that is to say, a work containing the Library or a\nportion of it, either verbatim or with modifications and/or translated\nstraightforwardly into another language.  (Hereinafter, translation is\nincluded without limitation in the term \"modification\".)\n\n  \"Source code\" for a work means the preferred form of the work for\nmaking modifications to it.  For a library, complete source code means\nall the source code for all modules it contains, plus any associated\ninterface definition files, plus the scripts used to control compilation\nand installation of the library.\n\n  Activities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning a program using the Library is not restricted, and output from\nsuch a program is covered only if its contents constitute a work based\non the Library (independent of the use of the Library in a tool for\nwriting it).  Whether that is true depends on what the Library does\nand what the program that uses the Library does.\n\n  1. You may copy and distribute verbatim copies of the Library's\ncomplete source code as you receive it, in any medium, provided that\nyou conspicuously and appropriately publish on each copy an\nappropriate copyright notice and disclaimer of warranty; keep intact\nall the notices that refer to this License and to the absence of any\nwarranty; and distribute a copy of this License along with the\nLibrary.\n\n  You may charge a fee for the physical act of transferring a copy,\nand you may at your option offer warranty protection in exchange for a\nfee.\n\f\n  2. You may modify your copy or copies of the Library or any portion\nof it, thus forming a work based on the Library, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) The modified work must itself be a software library.\n\n    b) You must cause the files modified to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    c) You must cause the whole of the work to be licensed at no\n    charge to all third parties under the terms of this License.\n\n    d) If a facility in the modified Library refers to a function or a\n    table of data to be supplied by an application program that uses\n    the facility, other than as an argument passed when the facility\n    is invoked, then you must make a good faith effort to ensure that,\n    in the event an application does not supply such function or\n    table, the facility still operates, and performs whatever part of\n    its purpose remains meaningful.\n\n    (For example, a function in a library to compute square roots has\n    a purpose that is entirely well-defined independent of the\n    application.  Therefore, Subsection 2d requires that any\n    application-supplied function or table used by this function must\n    be optional: if the application does not supply it, the square\n    root function must still compute square roots.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Library,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Library, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote\nit.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Library.\n\nIn addition, mere aggregation of another work not based on the Library\nwith the Library (or with a work based on the Library) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may opt to apply the terms of the ordinary GNU General Public\nLicense instead of this License to a given copy of the Library.  To do\nthis, you must alter all the notices that refer to this License, so\nthat they refer to the ordinary GNU General Public License, version 2,\ninstead of to this License.  (If a newer version than version 2 of the\nordinary GNU General Public License has appeared, then you can specify\nthat version instead if you wish.)  Do not make any other change in\nthese notices.\n\f\n  Once this change is made in a given copy, it is irreversible for\nthat copy, so the ordinary GNU General Public License applies to all\nsubsequent copies and derivative works made from that copy.\n\n  This option is useful when you wish to copy part of the code of\nthe Library into a program that is not a library.\n\n  4. You may copy and distribute the Library (or a portion or\nderivative of it, under Section 2) in object code or executable form\nunder the terms of Sections 1 and 2 above provided that you accompany\nit with the complete corresponding machine-readable source code, which\nmust be distributed under the terms of Sections 1 and 2 above on a\nmedium customarily used for software interchange.\n\n  If distribution of object code is made by offering access to copy\nfrom a designated place, then offering equivalent access to copy the\nsource code from the same place satisfies the requirement to\ndistribute the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  5. A program that contains no derivative of any portion of the\nLibrary, but is designed to work with the Library by being compiled or\nlinked with it, is called a \"work that uses the Library\".  Such a\nwork, in isolation, is not a derivative work of the Library, and\ntherefore falls outside the scope of this License.\n\n  However, linking a \"work that uses the Library\" with the Library\ncreates an executable that is a derivative of the Library (because it\ncontains portions of the Library), rather than a \"work that uses the\nlibrary\".  The executable is therefore covered by this License.\nSection 6 states terms for distribution of such executables.\n\n  When a \"work that uses the Library\" uses material from a header file\nthat is part of the Library, the object code for the work may be a\nderivative work of the Library even though the source code is not.\nWhether this is true is especially significant if the work can be\nlinked without the Library, or if the work is itself a library.  The\nthreshold for this to be true is not precisely defined by law.\n\n  If such an object file uses only numerical parameters, data\nstructure layouts and accessors, and small macros and small inline\nfunctions (ten lines or less in length), then the use of the object\nfile is unrestricted, regardless of whether it is legally a derivative\nwork.  (Executables containing this object code plus portions of the\nLibrary will still fall under Section 6.)\n\n  Otherwise, if the work is a derivative of the Library, you may\ndistribute the object code for the work under the terms of Section 6.\nAny executables containing that work also fall under Section 6,\nwhether or not they are linked directly with the Library itself.\n\f\n  6. As an exception to the Sections above, you may also combine or\nlink a \"work that uses the Library\" with the Library to produce a\nwork containing portions of the Library, and distribute that work\nunder terms of your choice, provided that the terms permit\nmodification of the work for the customer's own use and reverse\nengineering for debugging such modifications.\n\n  You must give prominent notice with each copy of the work that the\nLibrary is used in it and that the Library and its use are covered by\nthis License.  You must supply a copy of this License.  If the work\nduring execution displays copyright notices, you must include the\ncopyright notice for the Library among them, as well as a reference\ndirecting the user to the copy of this License.  Also, you must do one\nof these things:\n\n    a) Accompany the work with the complete corresponding\n    machine-readable source code for the Library including whatever\n    changes were used in the work (which must be distributed under\n    Sections 1 and 2 above); and, if the work is an executable linked\n    with the Library, with the complete machine-readable \"work that\n    uses the Library\", as object code and/or source code, so that the\n    user can modify the Library and then relink to produce a modified\n    executable containing the modified Library.  (It is understood\n    that the user who changes the contents of definitions files in the\n    Library will not necessarily be able to recompile the application\n    to use the modified definitions.)\n\n    b) Use a suitable shared library mechanism for linking with the\n    Library.  A suitable mechanism is one that (1) uses at run time a\n    copy of the library already present on the user's computer system,\n    rather than copying library functions into the executable, and (2)\n    will operate properly with a modified version of the library, if\n    the user installs one, as long as the modified version is\n    interface-compatible with the version that the work was made with.\n\n    c) Accompany the work with a written offer, valid for at\n    least three years, to give the same user the materials\n    specified in Subsection 6a, above, for a charge no more\n    than the cost of performing this distribution.\n\n    d) If distribution of the work is made by offering access to copy\n    from a designated place, offer equivalent access to copy the above\n    specified materials from the same place.\n\n    e) Verify that the user has already received a copy of these\n    materials or that you have already sent this user a copy.\n\n  For an executable, the required form of the \"work that uses the\nLibrary\" must include any data and utility programs needed for\nreproducing the executable from it.  However, as a special exception,\nthe materials to be distributed need not include anything that is\nnormally distributed (in either source or binary form) with the major\ncomponents (compiler, kernel, and so on) of the operating system on\nwhich the executable runs, unless that component itself accompanies\nthe executable.\n\n  It may happen that this requirement contradicts the license\nrestrictions of other proprietary libraries that do not normally\naccompany the operating system.  Such a contradiction means you cannot\nuse both them and the Library together in an executable that you\ndistribute.\n\f\n  7. You may place library facilities that are a work based on the\nLibrary side-by-side in a single library together with other library\nfacilities not covered by this License, and distribute such a combined\nlibrary, provided that the separate distribution of the work based on\nthe Library and of the other library facilities is otherwise\npermitted, and provided that you do these two things:\n\n    a) Accompany the combined library with a copy of the same work\n    based on the Library, uncombined with any other library\n    facilities.  This must be distributed under the terms of the\n    Sections above.\n\n    b) Give prominent notice with the combined library of the fact\n    that part of it is a work based on the Library, and explaining\n    where to find the accompanying uncombined form of the same work.\n\n  8. You may not copy, modify, sublicense, link with, or distribute\nthe Library except as expressly provided under this License.  Any\nattempt otherwise to copy, modify, sublicense, link with, or\ndistribute the Library is void, and will automatically terminate your\nrights under this License.  However, parties who have received copies,\nor rights, from you under this License will not have their licenses\nterminated so long as such parties remain in full compliance.\n\n  9. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Library or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Library (or any work based on the\nLibrary), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Library or works based on it.\n\n  10. Each time you redistribute the Library (or any work based on the\nLibrary), the recipient automatically receives a license from the\noriginal licensor to copy, distribute, link with or modify the Library\nsubject to these terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties with\nthis License.\n\f\n  11. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Library at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Library by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Library.\n\nIf any portion of this section is held invalid or unenforceable under any\nparticular circumstance, the balance of the section is intended to apply,\nand the section as a whole is intended to apply in other circumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  12. If the distribution and/or use of the Library is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Library under this License may add\nan explicit geographical distribution limitation excluding those countries,\nso that distribution is permitted only in or among countries not thus\nexcluded.  In such case, this License incorporates the limitation as if\nwritten in the body of this License.\n\n  13. The Free Software Foundation may publish revised and/or new\nversions of the Lesser General Public License from time to time.\nSuch new versions will be similar in spirit to the present version,\nbut may differ in detail to address new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Library\nspecifies a version number of this License which applies to it and\n\"any later version\", you have the option of following the terms and\nconditions either of that version or of any later version published by\nthe Free Software Foundation.  If the Library does not specify a\nlicense version number, you may choose any version ever published by\nthe Free Software Foundation.\n\f\n  14. If you wish to incorporate parts of the Library into other free\nprograms whose distribution conditions are incompatible with these,\nwrite to the author to ask for permission.  For software which is\ncopyrighted by the Free Software Foundation, write to the Free\nSoftware Foundation; we sometimes make exceptions for this.  Our\ndecision will be guided by the two goals of preserving the free status\nof all derivatives of our free software and of promoting the sharing\nand reuse of software generally.\n\n                            NO WARRANTY\n\n  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\nWARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\nEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\nOTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY\nKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\nLIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\nTHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\nWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\nAND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\nFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\nCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\nLIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\nRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\nFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\nSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGES.\n\n                     END OF TERMS AND CONDITIONS\n\f\n           How to Apply These Terms to Your New Libraries\n\n  If you develop a new library, and you want it to be of the greatest\npossible use to the public, we recommend making it free software that\neveryone can redistribute and change.  You can do so by permitting\nredistribution under these terms (or, alternatively, under the terms of the\nordinary General Public License).\n\n  To apply these terms, attach the following notices to the library.  It is\nsafest to attach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least the\n\"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the library's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\nAlso add information on how to contact you by electronic and paper mail.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the library, if\nnecessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the\n  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\n\n  <signature of Ty Coon>, 1 April 1990\n  Ty Coon, President of Vice\n\nThat's all there is to it!\n"
  },
  {
    "path": "Makefile",
    "content": "VERSION = 0.2.0\n\nAPI_MAJOR = 0\nAPI_MINOR = 1\nAPI_PATCH = 0\n\nCFLAGS := -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wall -Wextra -O3 -ffast-math -g -MMD $(CFLAGS)\n\nPREFIX ?= /usr/local\nBINDIR ?= $(PREFIX)/bin\nLIBDIR ?= $(PREFIX)/lib\nINCLUDEDIR ?= $(PREFIX)/include\n\nSRC_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))\nvpath %.c $(SRC_DIR)\nvpath %.h $(SRC_DIR)\nvpath %.pc.in $(SRC_DIR)\n\n-include .config\n\nifdef CONFIG_DEBUG\n    CFLAGS += -D_DEBUG\nelse\n    CFLAGS += -DNDEBUG\nendif\n\nifdef CONFIG_WINDOWS\n    EXESUF ?= .exe\n    DLLSUF ?= .dll\n    LIBSUF ?= .a\nelse\n    DLLSUF ?= .so\n    LIBSUF ?= .a\n    LIBS ?= -lm\n    ifdef CONFIG_SHARED\n        SONAMESUF ?= .$(API_MAJOR).$(API_MINOR).$(API_PATCH)\n        SONAMESUF_MAJOR ?= .$(API_MAJOR)\n        SONAME ?= libdcadec$(DLLSUF)$(SONAMESUF_MAJOR)\n    endif\nendif\n\nifdef CONFIG_SHARED\n    OUT_LIB ?= libdcadec/libdcadec$(DLLSUF)$(SONAMESUF)\nelse\n    OUT_LIB ?= libdcadec/libdcadec$(LIBSUF)\nendif\n\nOUT_DEC ?= dcadec$(EXESUF)\nOUT_CUT ?= dcacut$(EXESUF)\n\nOUT_DEV ?= test/stddev$(EXESUF)\nSRC_DEV ?= test/stddev.c\nCFLAGS_DEV ?= -O2 -Wall -Wextra\n\nSRC_LIB = \\\nlibdcadec/bitstream.c \\\nlibdcadec/core_decoder.c \\\nlibdcadec/dca_context.c \\\nlibdcadec/dmix_tables.c \\\nlibdcadec/exss_parser.c \\\nlibdcadec/idct_fixed.c \\\nlibdcadec/idct_float.c \\\nlibdcadec/interpolator.c \\\nlibdcadec/interpolator_fixed.c \\\nlibdcadec/interpolator_float.c \\\nlibdcadec/lbr_decoder.c \\\nlibdcadec/ta.c \\\nlibdcadec/xll_decoder.c\nINC_LIB = \\\nlibdcadec/dca_context.h\n\nifndef CONFIG_SMALL\nSRC_LIB += libdcadec/dca_frame.c\nSRC_LIB += libdcadec/dca_stream.c\nSRC_LIB += libdcadec/dca_waveout.c\nINC_LIB += libdcadec/dca_frame.h\nINC_LIB += libdcadec/dca_stream.h\nINC_LIB += libdcadec/dca_waveout.h\nendif\n\nOBJ_LIB = $(SRC_LIB:.c=.o)\nDEP_LIB = $(SRC_LIB:.c=.d)\n\nSRC_DEC = dcadec.c\nOBJ_DEC = $(SRC_DEC:.c=.o)\nDEP_DEC = $(SRC_DEC:.c=.d)\n\nSRC_CUT = dcacut.c\nOBJ_CUT = $(SRC_CUT:.c=.o)\nDEP_CUT = $(SRC_CUT:.c=.d)\n\ndefault: $(OUT_LIB) $(OUT_DEC)\n\nlib: $(OUT_LIB)\n\nall: $(OUT_LIB) $(OUT_DEC) $(OUT_CUT)\n\n-include $(DEP_LIB) $(DEP_DEC) $(DEP_CUT)\n\n$(OBJ_LIB): | objdir\n$(OBJ_DEC): | objdir\n$(OBJ_CUT): | objdir\n\nobjdir:\n\tmkdir -p libdcadec\n\nifdef CONFIG_SHARED\n    CFLAGS_DLL = $(CFLAGS) -DDCADEC_SHARED -DDCADEC_INTERNAL\n    LDFLAGS_DLL = $(LDFLAGS) -shared\n\n    ifdef CONFIG_WINDOWS\n        IMP_LIB = libdcadec/libdcadec$(DLLSUF)$(LIBSUF)\n        IMP_DEF = libdcadec/libdcadec.def\n        EXTRA_LIB = $(IMP_LIB) $(IMP_DEF)\n        LDFLAGS_DLL += -static-libgcc\n        LDFLAGS_DLL += -Wl,--nxcompat,--dynamicbase\n        LDFLAGS_DLL += -Wl,--output-def,$(IMP_DEF)\n        LDFLAGS_DLL += -Wl,--out-implib,$(IMP_LIB)\n    else\n        CFLAGS_DLL += -fPIC -fvisibility=hidden\n        ifdef SONAME\n            LDFLAGS_DLL += -Wl,-soname,$(SONAME)\n            EXTRA_LIB += libdcadec/libdcadec$(DLLSUF)\n            EXTRA_LIB += libdcadec/libdcadec$(DLLSUF)$(SONAMESUF_MAJOR)\n        endif\n        IMP_LIB = -Llibdcadec -ldcadec\n    endif\n\nlibdcadec/%.o: libdcadec/%.c\n\t$(CC) -c $(CFLAGS_DLL) -o $@ $<\n\n$(OUT_LIB): $(OBJ_LIB)\n\t$(CC) $(LDFLAGS_DLL) -o $@ $(OBJ_LIB) $(LIBS)\nifdef SONAME\n\tln -sf $(@F) libdcadec/libdcadec$(DLLSUF)\n\tln -sf $(@F) libdcadec/libdcadec$(DLLSUF)$(SONAMESUF_MAJOR)\nendif\n\n$(OUT_DEC): $(OBJ_DEC) $(OUT_LIB)\n\t$(CC) $(LDFLAGS) -o $@ $(OBJ_DEC) $(IMP_LIB) $(LIBS)\n\n$(OUT_CUT): $(OBJ_CUT) $(OUT_LIB)\n\t$(CC) $(LDFLAGS) -o $@ $(OBJ_CUT) $(IMP_LIB) $(LIBS)\n\nelse\n\n$(OUT_LIB): $(OBJ_LIB)\n\t$(AR) crsu $@ $(OBJ_LIB)\n\n$(OUT_DEC): $(OBJ_DEC) $(OUT_LIB)\n\t$(CC) $(LDFLAGS) -o $@ $(OBJ_DEC) $(OUT_LIB) $(LIBS)\n\n$(OUT_CUT): $(OBJ_CUT) $(OUT_LIB)\n\t$(CC) $(LDFLAGS) -o $@ $(OBJ_CUT) $(OUT_LIB) $(LIBS)\n\nendif\n\n$(OUT_DEV): $(SRC_DEV)\n\t$(CC) $(LDFLAGS) -o $@ $(CFLAGS_DEV) $< $(LIBS)\n\ncheck: $(OUT_DEC) $(OUT_DEV)\n\tcd test && ./test.sh\n\nclean:\n\t$(RM) $(OUT_LIB) $(OBJ_LIB) $(DEP_LIB) $(EXTRA_LIB)\n\t$(RM) $(OUT_DEC) $(OBJ_DEC) $(DEP_DEC)\n\t$(RM) $(OUT_CUT) $(OBJ_CUT) $(DEP_CUT)\n\t$(RM) dcadec.pc\n\t$(RM) $(OUT_DEV)\n\t$(RM) -r test/decoded\n\n.PHONY: dcadec.pc\ndcadec.pc: dcadec.pc.in\n\tsed 's,%PREFIX%,$(PREFIX),;s,%LIBDIR%,$(LIBDIR),;s,%INCLUDEDIR%,$(INCLUDEDIR),;s,%VERSION%,$(VERSION),' $< > $@\n\ninstall-lib: $(OUT_LIB) dcadec.pc\n\tinstall -d -m 755 $(DESTDIR)$(LIBDIR) $(DESTDIR)$(LIBDIR)/pkgconfig $(DESTDIR)$(INCLUDEDIR)/libdcadec\n\tinstall -m 644 $(OUT_LIB) $(DESTDIR)$(LIBDIR)\n\tinstall -m 644 $(addprefix $(SRC_DIR)/, $(INC_LIB)) $(DESTDIR)$(INCLUDEDIR)/libdcadec\n\tinstall -m 644 dcadec.pc $(DESTDIR)$(LIBDIR)/pkgconfig\nifdef SONAME\n\tln -sf libdcadec$(DLLSUF)$(SONAMESUF) $(DESTDIR)$(LIBDIR)/libdcadec$(DLLSUF)\n\tln -sf libdcadec$(DLLSUF)$(SONAMESUF) $(DESTDIR)$(LIBDIR)/libdcadec$(DLLSUF)$(SONAMESUF_MAJOR)\nendif\n\ninstall-dec: $(OUT_DEC)\n\tinstall -d -m 755 $(DESTDIR)$(BINDIR)\n\tinstall -m 755 $(OUT_DEC) $(DESTDIR)$(BINDIR)\n\ninstall: install-lib install-dec\n"
  },
  {
    "path": "README.md",
    "content": "dcadec\n======\n\ndcadec is a free DTS Coherent Acoustics decoder with support for HD extensions.\n\nSupported features:\n\n* Decoding of standard DTS core streams with up to 5.1 channels\n* Decoding of DTS-ES streams with discrete back channel\n* Decoding of High Resolution streams with up to 7.1 channels and extended bitrate\n* Decoding of 96/24 core streams\n* Lossless decoding of Master Audio streams with up to 7.1 channels, 192 kHz\n* Downmixing to stereo and 5.1 using embedded coefficients\n\n__This program is deprecated!__\n\nThis decoder has been fully integrated into FFmpeg master branch and further\ndevelopment will continue there. Using [FFmpeg](https://ffmpeg.org/) for DTS\ndecoding is now recommended.\n\nUsage\n-----\n\nHelp screen of the program is reproduced below.\n```\nUsage: ./dcadec [-26bcfhlmnPqSx] <input.dts> [output.wav]\ndcadec is a free DTS Coherent Acoustics decoder. Supported options:\n\n-2  Extract embedded 2.0 downmix if present, otherwise extract 5.1 downmix.\n\n-6  Extract embedded 5.1 downmix.\n\n-b  Force fixed point DTS core interpolation. Developer option, degrades sound\n    quality.\n\n-c  Force decoding of DTS core only without extensions.\n\n-f  Use FIR filter for floating point DTS core LFE channel interpolation.\n\n-h  Show this help message.\n\n-i  Use IIR filter for floating point DTS core LFE channel interpolation.\n\n-l  Enable lenient decoding mode. Attempt to recover from errors by skipping\n    non-decodable parts of the stream.\n\n-m  Write a mono WAV file for each native DTS channel. Output file name must\n    include `%s' sub-string that will be replaced with DTS channel name.\n\n-n  No-act mode. Parse DTS bitstream without writing WAV file(s).\n\n-P  Disable progress indicator.\n\n-q  Be quiet. Disables informational messages and progress indicator. Warnings\n    and errors are still printed.\n\n-S  Don't strip padding samples for streams within DTS-HD container.\n\n-x  Force use of X96 synthesis filter for DTS core interpolation. Developer\n    option, degrades sound quality.\n\nWhen run without output file name argument, prints information about DTS file\nto stdout and exits.\n\nSingle dash in place of input or output file name argument means to read from\nstdin or write to stdout, respectively.\n\ndcadec comes with ABSOLUTELY NO WARRANTY. This is free software, and you are\nwelcome to redistribute it under certain conditions; see GNU Lesser General\nPublic License version 2.1 for details.\n```\n\nExamples\n--------\n\nSome dcadec usage examples follow.\n\n* Decode DTS file to WAV:  \n\n  ```\n  $ ./dcadec input.dts output.wav\n  ```\n\n* Decode DTS file to multiple mono WAVs:  \n\n  ```\n  $ ./dcadec -m input.dts output_%s.wav\n  ```\n\n* Decode DTS file and play with mpv:  \n\n  ```\n  $ ./dcadec input.dts - | mpv -\n  ```\n\n* Decode DTS file and re-encode to FLAC:  \n\n  ```\n  $ ./dcadec input.dts - | flac --ignore-chunk-sizes -o output.flac -\n  ```\n\n* Demux DTS track #1 from MKV file, decode and re-encode to FLAC:\n\n  ```\n  $ mkvextract tracks input.mkv -r /dev/null 1:/dev/stdout | \\\n  ./dcadec - - | flac --ignore-chunk-sizes -o output.flac -\n  ```\n"
  },
  {
    "path": "dcacut.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <stdint.h>\n#include <stdbool.h>\n#include <string.h>\n#include <limits.h>\n#include <errno.h>\n\n#include \"libdcadec/dca_stream.h\"\n\nint main(int argc, char **argv)\n{\n    if (argc < 3) {\n        fprintf(stderr, \"Usage: %s <input.dts> <output.dts> [first] [last]\\n\", argv[0]);\n        return 1;\n    }\n\n    unsigned long first_packet = 0;\n    unsigned long last_packet = ULONG_MAX;\n\n    if (argc > 3)\n        first_packet = strtoul(argv[3], NULL, 0);\n    if (argc > 4)\n        last_packet = strtoul(argv[4], NULL, 0);\n    if (last_packet < first_packet) {\n        fprintf(stderr, \"Invalid packet range\\n\");\n        return 1;\n    }\n\n    struct dcadec_stream *stream = dcadec_stream_open(argv[1], 0);\n    if (!stream) {\n        fprintf(stderr, \"Couldn't open input file\\n\");\n        return 1;\n    }\n\n    FILE *fp = fopen(argv[2], \"wb\");\n    if (!fp) {\n        fprintf(stderr, \"Couldn't open output file\\n\");\n        dcadec_stream_close(stream);\n        return 1;\n    }\n\n    unsigned long packet_in = 0;\n    unsigned long packet_out = 0;\n\n    int ret;\n\n    while (true) {\n        uint8_t *packet;\n        size_t size;\n\n        ret = dcadec_stream_read(stream, &packet, &size);\n        if (ret < 0) {\n            fprintf(stderr, \"Error %d reading packet\\n\", ret);\n            break;\n        }\n        if (ret == 0)\n            break;\n\n        if (packet_in >= first_packet) {\n            if (fwrite(packet, size, 1, fp) != 1) {\n                fprintf(stderr, \"Error %d writing packet\\n\", errno);\n                ret = -1;\n                break;\n            }\n            packet_out++;\n        }\n\n        if (++packet_in > last_packet)\n            break;\n    }\n\n    if (packet_out) {\n        fprintf(stderr, \"Wrote %lu packets\\n\", packet_out);\n    } else {\n        fprintf(stderr, \"Didn't write a single packet!\\n\");\n        ret = -1;\n    }\n\n    fclose(fp);\n    dcadec_stream_close(stream);\n    return !!ret;\n}\n"
  },
  {
    "path": "dcadec.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <stdint.h>\n#include <stdbool.h>\n#include <string.h>\n#include <inttypes.h>\n\n#ifdef _MSC_VER\n#include \"getopt.h\"\n#else\n#include <unistd.h>\n#endif\n\n#ifdef _WIN32\n#define WIN32_LEAN_AND_MEAN\n#include <windows.h>\n#else\n#include <signal.h>\n#endif\n\n#include \"libdcadec/dca_stream.h\"\n#include \"libdcadec/dca_context.h\"\n#include \"libdcadec/dca_waveout.h\"\n\nstatic void print_help(const char *name)\n{\n    fprintf(stderr,\n\"Usage: %s [-26bcfhilmnPqSx] <input.dts> [output.wav]\\n\"\n\"dcadec is a free DTS Coherent Acoustics decoder. Supported options:\\n\"\n\"\\n\"\n\"-2  Extract embedded 2.0 downmix if present, otherwise extract 5.1 downmix.\\n\"\n\"\\n\"\n\"-6  Extract embedded 5.1 downmix.\\n\"\n\"\\n\"\n\"-b  Force fixed point DTS core interpolation. Developer option, degrades sound\\n\"\n\"    quality.\\n\"\n\"\\n\"\n\"-c  Force decoding of DTS core only without extensions.\\n\"\n\"\\n\"\n\"-f  Use FIR filter for floating point DTS core LFE channel interpolation.\\n\"\n\"\\n\"\n\"-h  Show this help message.\\n\"\n\"\\n\"\n\"-i  Use IIR filter for floating point DTS core LFE channel interpolation.\\n\"\n\"\\n\"\n\"-l  Enable lenient decoding mode. Attempt to recover from errors by skipping\\n\"\n\"    non-decodable parts of the stream.\\n\"\n\"\\n\"\n\"-m  Write a mono WAV file for each native DTS channel. Output file name must\\n\"\n\"    include `%%s' sub-string that will be replaced with DTS channel name.\\n\"\n\"\\n\"\n\"-n  No-act mode. Parse DTS bitstream without writing WAV file(s).\\n\"\n\"\\n\"\n\"-P  Disable progress indicator.\\n\"\n\"\\n\"\n\"-q  Be quiet. Disables informational messages and progress indicator. Warnings\\n\"\n\"    and errors are still printed.\\n\"\n\"\\n\"\n\"-S  Don't strip padding samples for streams within DTS-HD container.\\n\"\n\"\\n\"\n\"-x  Force use of X96 synthesis filter for DTS core interpolation. Developer\\n\"\n\"    option, degrades sound quality.\\n\"\n\"\\n\"\n\"When run without output file name argument, prints information about DTS file\\n\"\n\"to stdout and exits.\\n\"\n\"\\n\"\n\"Single dash in place of input or output file name argument means to read from\\n\"\n\"stdin or write to stdout, respectively.\\n\"\n\"\\n\"\n\"dcadec comes with ABSOLUTELY NO WARRANTY. This is free software, and you are\\n\"\n\"welcome to redistribute it under certain conditions; see GNU Lesser General\\n\"\n\"Public License version 2.1 for details.\\n\", name);\n}\n\nstatic const char * const spkr_pair_names[] = {\n    \"C\",    \"LR\",     \"LsRs\",   \"LFE\",\n    \"Cs\",   \"LhRh\",   \"LsrRsr\", \"Ch\",\n    \"Oh\",   \"LcRc\",   \"LwRw\",   \"LssRss\",\n    \"LFE2\", \"LhsRhs\", \"Chr\",    \"LhrRhr\"\n};\n\nstatic char *make_spkr_mask_str(int mask)\n{\n    static char buf[128];\n\n    if (!mask)\n        return \"???\";\n\n    buf[0] = 0;\n    for (size_t i = 0; i < sizeof(spkr_pair_names) / sizeof(spkr_pair_names[0]); i++) {\n        if (mask & (1 << i)) {\n            if (buf[0])\n                strcat(buf, \" \");\n            strcat(buf, spkr_pair_names[i]);\n        }\n    }\n\n    return buf;\n}\n\nstatic void print_info(struct dcadec_context *context, FILE *fp)\n{\n    struct dcadec_exss_info *exss = dcadec_context_get_exss_info(context);\n\n    if (exss && exss->profile == DCADEC_PROFILE_DS) {\n        dcadec_context_free_exss_info(exss);\n        exss = NULL;\n    }\n\n    if (exss) {\n        if (exss->profile & DCADEC_PROFILE_HD_MA)\n            fprintf(fp, \"DTS-HD Master Audio\");\n        else if (exss->profile & DCADEC_PROFILE_HD_HRA)\n            fprintf(fp, \"DTS-HD High Resolution Audio\");\n        else if (exss->profile & DCADEC_PROFILE_DS_ES)\n            fprintf(fp, \"DTS-ES Discrete\");\n        else if (exss->profile & DCADEC_PROFILE_DS_96_24)\n            fprintf(fp, \"DTS 96/24\");\n        else if (exss->profile & DCADEC_PROFILE_EXPRESS)\n            fprintf(fp, \"DTS Express\");\n        else\n            fprintf(fp, \"Unknown Extension Profile\");\n        fprintf(fp, \": %d ch (%s), %.f kHz, %d bit\\n\",\n            exss->nchannels, make_spkr_mask_str(exss->spkr_mask),\n            exss->sample_rate / 1000.0f, exss->bits_per_sample);\n        dcadec_context_free_exss_info(exss);\n    }\n\n    struct dcadec_core_info *core = dcadec_context_get_core_info(context);\n    if (core) {\n        if (exss)\n            fprintf(fp, \"(\");\n        fprintf(fp, \"DTS Core Audio: %d.%d ch, %.f kHz, %d bit\",\n            core->nchannels, !!core->lfe_present, core->sample_rate / 1000.f,\n            core->source_pcm_res);\n        if (core->es_format)\n            fprintf(fp, \", ES\");\n        if (core->bit_rate > 0)\n            fprintf(fp, \", %.f kbps\", core->bit_rate / 1000.0f);\n        if (exss)\n            fprintf(fp, \")\");\n        fprintf(fp, \"\\n\");\n        dcadec_context_free_core_info(core);\n    }\n}\n\nstatic bool interrupted;\n\n#ifdef _WIN32\nstatic BOOL WINAPI console_ctrl_handler(DWORD dwCtrlType)\n{\n    (void)dwCtrlType;\n    interrupted = true;\n    return TRUE;\n}\n#else\nstatic void signal_handler(int sig)\n{\n    (void)sig;\n    interrupted = true;\n}\n#endif\n\nstatic void my_log_cb(int level, const char *file, int line,\n                      const char *message, void *cbarg)\n{\n    (void)cbarg;\n\n    if (level > DCADEC_LOG_WARNING)\n        return;\n\n    const char *prefix = \"UNKNOWN\";\n\n    switch (level) {\n    case DCADEC_LOG_ERROR:\n        prefix = \"ERROR\";\n        break;\n    case DCADEC_LOG_WARNING:\n        prefix = \"WARNING\";\n        break;\n    }\n\n    fprintf(stderr, \"%s: %s+%d: %s\\n\", prefix, file, line, message);\n}\n\nint main(int argc, char **argv)\n{\n    int flags = DCADEC_FLAG_STRICT;\n    int wave_flags = 0;\n    bool parse_only = false;\n    bool no_progress = false;\n    bool quiet = false;\n    bool no_strip = false;\n\n    int opt;\n    while ((opt = getopt(argc, argv, \"26bcfhilmnPqSsx\")) != -1) {\n        switch (opt) {\n        case '2':\n            flags |= DCADEC_FLAG_KEEP_DMIX_2CH;\n            break;\n        case '6':\n            flags |= DCADEC_FLAG_KEEP_DMIX_6CH;\n            break;\n        case 'b':\n            flags |= DCADEC_FLAG_CORE_BIT_EXACT;\n            break;\n        case 'c':\n            flags |= DCADEC_FLAG_CORE_ONLY;\n            break;\n        case 'f':\n            flags &= ~DCADEC_FLAG_CORE_LFE_IIR;\n            flags |= DCADEC_FLAG_CORE_LFE_FIR;\n            break;\n        case 'h':\n            print_help(argv[0]);\n            return 0;\n        case 'i':\n            flags &= ~DCADEC_FLAG_CORE_LFE_FIR;\n            flags |= DCADEC_FLAG_CORE_LFE_IIR;\n            break;\n        case 'l':\n            flags &= ~DCADEC_FLAG_STRICT;\n            break;\n        case 'm':\n            flags |= DCADEC_FLAG_NATIVE_LAYOUT;\n            wave_flags |= DCADEC_WAVEOUT_FLAG_MONO;\n            break;\n        case 'n':\n            parse_only = true;\n            break;\n        case 'P':\n            no_progress = true;\n            break;\n        case 'q':\n            quiet = true;\n            break;\n        case 'S':\n            no_strip = true;\n            break;\n        case 'x':\n            flags |= DCADEC_FLAG_CORE_SYNTH_X96;\n            break;\n        default:\n            print_help(argv[0]);\n            return 1;\n        }\n    }\n\n    no_progress |= quiet;\n\n    if (optind >= argc) {\n        print_help(argv[0]);\n        return 1;\n    }\n\n    char *fn = argv[optind];\n    struct dcadec_stream *stream = dcadec_stream_open(strcmp(fn, \"-\") ? fn : NULL, 0);\n    if (!stream) {\n        fprintf(stderr, \"Couldn't open input file\\n\");\n        return 1;\n    }\n\n    uint8_t *packet;\n    size_t size;\n    int ret;\n\n    if ((ret = dcadec_stream_read(stream, &packet, &size)) < 0) {\n        fprintf(stderr, \"Error reading packet: %s\\n\", dcadec_strerror(ret));\n        dcadec_stream_close(stream);\n        return 1;\n    }\n\n    if (ret == 0) {\n        fprintf(stderr, \"This doesn't look like a valid DTS bit stream\\n\");\n        dcadec_stream_close(stream);\n        return 1;\n    }\n\n    struct dcadec_context *context = dcadec_context_create(flags);\n    if (!context) {\n        fprintf(stderr, \"Couldn't create decoder context\\n\");\n        dcadec_stream_close(stream);\n        return 1;\n    }\n\n    dcadec_context_set_log_cb(context, my_log_cb, NULL);\n\n    if ((ret = dcadec_context_parse(context, packet, size)) < 0) {\n        fprintf(stderr, \"Error parsing packet: %s\\n\", dcadec_strerror(ret));\n        dcadec_context_destroy(context);\n        dcadec_stream_close(stream);\n        return 1;\n    }\n\n    if (ret > 0)\n        fprintf(stderr, \"WARNING: %s at frame 0\\n\", dcadec_strerror(ret));\n\n    if (!quiet)\n        print_info(context, optind + 1 >= argc ? stdout : stderr);\n\n    struct dcadec_waveout *waveout = NULL;\n    if (!parse_only) {\n        if (optind + 1 >= argc) {\n            dcadec_context_destroy(context);\n            dcadec_stream_close(stream);\n            return 0;\n        }\n\n        fn = argv[optind + 1];\n        waveout = dcadec_waveout_open(strcmp(fn, \"-\") ? fn : NULL, wave_flags);\n        if (!waveout) {\n            fprintf(stderr, \"Couldn't open output file\\n\");\n            dcadec_context_destroy(context);\n            dcadec_stream_close(stream);\n            return 1;\n        }\n\n    }\n\n    int last_progress = -1;\n\n#ifdef _WIN32\n    SetConsoleCtrlHandler(&console_ctrl_handler, TRUE);\n#else\n    signal(SIGINT, &signal_handler);\n#endif\n\n    uint32_t ndelayframes = 0;\n    uint64_t npcmsamples = UINT64_MAX;\n    uint64_t ntotalframes = 0;\n    uint64_t nskippedframes = 0;\n    uint64_t nlossyframes = 0;\n\n    if (!parse_only && !no_strip) {\n        struct dcadec_stream_info *info = dcadec_stream_get_info(stream);\n        if (info) {\n            if (info->nframesamples)\n                ndelayframes = info->ndelaysamples / info->nframesamples;\n            if (info->npcmsamples)\n                npcmsamples = info->npcmsamples;\n            dcadec_stream_free_info(info);\n        }\n    }\n\n    if (!quiet) {\n        const bool core_only = (flags & DCADEC_FLAG_CORE_ONLY);\n        fprintf(stderr, \"%s%s...\\n\",\n                waveout ? \"Decoding\" : \"Parsing\",\n                core_only ? \" (core only)\" : \"\");\n    }\n\n    while (!interrupted) {\n        if (waveout) {\n            int **samples, nsamples, channel_mask, sample_rate, bits_per_sample;\n            if ((ret = dcadec_context_filter(context, &samples, &nsamples,\n                                             &channel_mask, &sample_rate,\n                                             &bits_per_sample, NULL)) < 0) {\n                fprintf(stderr, \"Error filtering frame: %s\\n\", dcadec_strerror(ret));\n                if (flags & DCADEC_FLAG_STRICT) {\n                    break;\n                } else {\n                    nskippedframes++;\n                    goto next_packet;\n                }\n            }\n\n            if (ndelayframes) {\n                ndelayframes--;\n                goto next_packet;\n            }\n\n            if (ret > 0) {\n                fprintf(stderr, \"WARNING: %s at frame %\" PRIu64 \"\\n\", dcadec_strerror(ret), ntotalframes);\n                nlossyframes++;\n            }\n\n            if ((uint64_t)nsamples > npcmsamples)\n                nsamples = (int)npcmsamples;\n\n            if ((ret = dcadec_waveout_write(waveout, samples, nsamples,\n                                            channel_mask, sample_rate,\n                                            bits_per_sample)) < 0) {\n                fprintf(stderr, \"Error writing WAV file: %s\\n\", dcadec_strerror(ret));\n                if ((flags & DCADEC_FLAG_STRICT) || ret != -DCADEC_EOUTCHG) {\n                    break;\n                } else {\n                    nskippedframes++;\n                    goto next_packet;\n                }\n            }\n\n            npcmsamples -= nsamples;\n        }\n\nnext_packet:\n        ntotalframes++;\n\n        if ((ret = dcadec_stream_read(stream, &packet, &size)) < 0) {\n            fprintf(stderr, \"Error reading packet: %s\\n\", dcadec_strerror(ret));\n            break;\n        }\n\n        if (!no_progress) {\n            int progress = dcadec_stream_progress(stream);\n            if (progress != last_progress) {\n                fprintf(stderr, \"Progress: %d%%\\r\", progress);\n                last_progress = progress;\n            }\n        }\n\n        if (ret == 0)\n            break;\n\n        if ((ret = dcadec_context_parse(context, packet, size)) < 0) {\n            fprintf(stderr, \"Error parsing packet: %s\\n\", dcadec_strerror(ret));\n            if (flags & DCADEC_FLAG_STRICT) {\n                break;\n            } else {\n                nskippedframes++;\n                goto next_packet;\n            }\n        }\n\n        if (ret > 0)\n            fprintf(stderr, \"WARNING: %s at frame %\" PRIu64 \"\\n\", dcadec_strerror(ret), ntotalframes);\n    }\n\n    if (!quiet) {\n        if (last_progress != -1)\n            fprintf(stderr, \"\\n\");\n        if (interrupted)\n            fprintf(stderr, \"Interrupted.\\n\");\n        else if (ret == 0)\n            fprintf(stderr, \"Completed.\\n\");\n        if (nskippedframes)\n            fprintf(stderr, \"*** %\" PRIu64 \" frames skipped ***\\n\", nskippedframes);\n        if (nlossyframes)\n            fprintf(stderr, \"*** %\" PRIu64 \" frames not lossless ***\\n\", nlossyframes);\n    }\n\n    dcadec_waveout_close(waveout);\n    dcadec_context_destroy(context);\n    dcadec_stream_close(stream);\n    return !!ret;\n}\n"
  },
  {
    "path": "dcadec.pc.in",
    "content": "prefix=%PREFIX%\nlibdir=%LIBDIR%\nincludedir=%INCLUDEDIR%\n\nName: dcadec\nDescription: a free DTS Coherent Acoustics decoder with support for HD extensions\nVersion: %VERSION%\nLibs: -L${libdir} -ldcadec\nCflags: -I${includedir}\n"
  },
  {
    "path": "getopt.c",
    "content": "/*\n * Copyright © 2005-2014 Rich Felker, et al.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include \"getopt.h\"\n\nchar *optarg;\nint optind = 1, opterr = 1, optopt;\nstatic int optpos;\n\nint getopt(int argc, char * const argv[], const char *optstring)\n{\n    if (optind < 1) {\n        optpos = 0;\n        optind = 1;\n    }\n\n    if (optind >= argc || !argv[optind])\n        return -1;\n\n    if (argv[optind][0] != '-') {\n        if (optstring[0] == '-') {\n            optarg = argv[optind++];\n            return 1;\n        }\n        return -1;\n    }\n\n    if (!argv[optind][1])\n        return -1;\n\n    if (argv[optind][1] == '-' && !argv[optind][2]) {\n        optind++;\n        return -1;\n    }\n\n    if (!optpos)\n        optpos++;\n    optopt = argv[optind][optpos++];\n\n    if (!argv[optind][optpos]) {\n        optind++;\n        optpos = 0;\n    }\n\n    if (optstring[0] == '-' || optstring[0] == '+')\n        optstring++;\n\n    char *p = strchr(optstring, optopt);\n    if (!p) {\n        if (optstring[0] != ':' && opterr)\n            fprintf(stderr, \"%s: unrecognized option: %c\\n\", argv[0], optopt);\n        return '?';\n    }\n\n    if (p[1] == ':') {\n        if (p[2] == ':') {\n            optarg = NULL;\n        } else if (optind >= argc) {\n            if (optstring[0] == ':')\n                return ':';\n            if (opterr)\n                fprintf(stderr, \"%s: option requires an argument: %c\\n\", argv[0], optopt);\n            return '?';\n        }\n        if (p[2] != ':' || optpos) {\n            optarg = argv[optind++] + optpos;\n            optpos = 0;\n        }\n    }\n\n    return optopt;\n}\n"
  },
  {
    "path": "getopt.h",
    "content": "/*\n * Copyright © 2005-2014 Rich Felker, et al.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n#ifndef GETOPT_H\n#define GETOPT_H\n\nextern char *optarg;\nextern int optind, opterr, optopt;\n\nint getopt(int argc, char * const argv[], const char *optstring);\n\n#endif\n"
  },
  {
    "path": "libdcadec/bitstream.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"common.h\"\n#include \"bitstream.h\"\n\nstatic inline uint32_t bits_peek(struct bitstream *bits)\n{\n    if (bits->index >= bits->total)\n        return 0;\n\n    int pos = bits->index >> 5;\n    int shift = bits->index & 31;\n\n    uint32_t v = DCA_32BE(bits->data[pos]);\n    if (shift) {\n        v <<= shift;\n        v |= DCA_32BE(bits->data[pos + 1]) >> (32 - shift);\n    }\n\n    return v;\n}\n\nbool bits_get1(struct bitstream *bits)\n{\n    if (bits->index >= bits->total)\n        return false;\n\n    uint32_t v = DCA_32BE(bits->data[bits->index >> 5]);\n    v <<= bits->index & 31;\n    v >>= 32 - 1;\n\n    bits->index++;\n    return v;\n}\n\nint bits_get(struct bitstream *bits, int n)\n{\n    uint32_t v = bits_peek(bits);\n    v >>= 32 - n;\n\n    bits->index += n;\n    return v;\n}\n\nint bits_get_signed(struct bitstream *bits, int n)\n{\n    int32_t v = bits_peek(bits);\n    v >>= 32 - n;\n\n    bits->index += n;\n    return v;\n}\n\nint bits_get_signed_linear(struct bitstream *bits, int n)\n{\n    if (n == 0)\n        return 0;\n\n    unsigned int v = bits_get(bits, n);\n    return (v >> 1) ^ -(v & 1);\n}\n\nstatic int bits_get_unsigned_rice(struct bitstream *bits, int k)\n{\n    unsigned int unary = 0;\n\n    while (bits->index < bits->total) {\n        uint32_t v = bits_peek(bits);\n        if (v) {\n            int z = dca_clz(v);\n            bits->index += z + 1;\n            unary += z;\n            break;\n        }\n        bits->index += 32;\n        unary += 32;\n    }\n\n    return k > 0 ? (unary << k) | bits_get(bits, k) : unary;\n}\n\nint bits_get_signed_rice(struct bitstream *bits, int k)\n{\n    unsigned int v = bits_get_unsigned_rice(bits, k);\n    return (v >> 1) ^ -(v & 1);\n}\n\nint bits_get_unsigned_vlc(struct bitstream *bits, const struct huffman *h)\n{\n    uint32_t v = bits_peek(bits);\n\n    for (int i = 0; i < h->size; i++) {\n        if (v >> (32 - h->len[i]) == h->code[i]) {\n            bits->index += h->len[i];\n            return i;\n        }\n    }\n\n    return BITS_INVALID_VLC_UN;\n}\n\nint bits_get_signed_vlc(struct bitstream *bits, const struct huffman *h)\n{\n    unsigned int v = bits_get_unsigned_vlc(bits, h);\n    return ((v >> 1) ^ ((v & 1) - 1)) + 1;\n}\n\nstatic uint16_t crc16(const uint8_t *data, int size)\n{\n    static const uint16_t crctab[16] = {\n        0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,\n        0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef\n    };\n\n    uint16_t res = 0xffff;\n    for (int i = 0; i < size; i++) {\n        res = (res << 4) ^ crctab[(data[i] >> 4) ^ (res >> 12)];\n        res = (res << 4) ^ crctab[(data[i] & 15) ^ (res >> 12)];\n    }\n\n    return res;\n}\n\nint bits_check_crc(struct bitstream *bits, int p1, int p2)\n{\n    if (((p1 | p2) & 7) || p1 < 0 || p2 > bits->total || p2 - p1 < 16)\n        return -DCADEC_EBADREAD;\n    if (crc16((uint8_t *)bits->data + p1 / 8, (p2 - p1) / 8))\n        return -DCADEC_EBADCRC;\n    return 0;\n}\n\nvoid bits_get_array(struct bitstream *bits, int *array, int size, int n)\n{\n    for (int i = 0; i < size; i++)\n        array[i] = bits_get(bits, n);\n}\n\nvoid bits_get_signed_array(struct bitstream *bits, int *array, int size, int n)\n{\n    for (int i = 0; i < size; i++)\n        array[i] = bits_get_signed(bits, n);\n}\n\nvoid bits_get_signed_linear_array(struct bitstream *bits, int *array, int size, int n)\n{\n    if (n == 0)\n        memset(array, 0, sizeof(*array) * size);\n    else for (int i = 0; i < size; i++)\n        array[i] = bits_get_signed_linear(bits, n);\n}\n\nvoid bits_get_signed_rice_array(struct bitstream *bits, int *array, int size, int k)\n{\n    for (int i = 0; i < size; i++)\n        array[i] = bits_get_signed_rice(bits, k);\n}\n\nint bits_get_signed_vlc_array(struct bitstream *bits, int *array, int size, const struct huffman *h)\n{\n    for (int i = 0; i < size; i++)\n        if ((array[i] = bits_get_signed_vlc(bits, h)) == BITS_INVALID_VLC_SI)\n            return -DCADEC_EBADDATA;\n    return 0;\n}\n"
  },
  {
    "path": "libdcadec/bitstream.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef BITSTREAM_H\n#define BITSTREAM_H\n\n#include \"huffman.h\"\n\n#define BITS_INVALID_VLC_UN  32768\n#define BITS_INVALID_VLC_SI -16384\n\nstruct bitstream {\n    uint32_t    *data;\n    int         total;\n    int         index;\n};\n\nstatic inline void bits_init(struct bitstream *bits, uint8_t *data, int size)\n{\n    assert(data && !((uintptr_t)data & 3));\n    assert(size > 0 && size < INT_MAX / 8);\n    bits->data = (uint32_t *)data;\n    bits->total = size * 8;\n    bits->index = 0;\n}\n\nbool bits_get1(struct bitstream *bits);\nint bits_get(struct bitstream *bits, int n);\nint bits_get_signed(struct bitstream *bits, int n);\nint bits_get_signed_linear(struct bitstream *bits, int n);\nint bits_get_signed_rice(struct bitstream *bits, int k);\nint bits_get_unsigned_vlc(struct bitstream *bits, const struct huffman *h);\nint bits_get_signed_vlc(struct bitstream *bits, const struct huffman *h);\n\nstatic inline void bits_skip(struct bitstream *bits, int n)\n{\n    assert(n >= 0);\n    bits->index += n;\n}\n\nstatic inline void bits_skip1(struct bitstream *bits)\n{\n    bits->index++;\n}\n\nstatic inline int bits_seek(struct bitstream *bits, int n)\n{\n    if (n < bits->index || n > bits->total)\n        return -DCADEC_EBADREAD;\n    bits->index = n;\n    return 0;\n}\n\nstatic inline int bits_align1(struct bitstream *bits)\n{\n    bits->index = DCA_ALIGN(bits->index, 8);\n    return bits->index;\n}\n\nstatic inline int bits_align4(struct bitstream *bits)\n{\n    bits->index = DCA_ALIGN(bits->index, 32);\n    return bits->index;\n}\n\nint bits_check_crc(struct bitstream *bits, int p1, int p2);\nvoid bits_get_array(struct bitstream *bits, int *array, int size, int n);\nvoid bits_get_signed_array(struct bitstream *bits, int *array, int size, int n);\nvoid bits_get_signed_linear_array(struct bitstream *bits, int *array, int size, int n);\nvoid bits_get_signed_rice_array(struct bitstream *bits, int *array, int size, int k);\nint bits_get_signed_vlc_array(struct bitstream *bits, int *array, int size, const struct huffman *h);\n\n#endif\n"
  },
  {
    "path": "libdcadec/common.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef COMMON_H\n#define COMMON_H\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <stdint.h>\n#include <stdbool.h>\n#include <stdarg.h>\n#include <string.h>\n#include <math.h>\n#include <errno.h>\n#include <assert.h>\n#include <limits.h>\n\n#include \"compiler.h\"\n#include \"dca_context.h\"\n#include \"ta.h\"\n\n#if AT_LEAST_GCC(3, 4)\n#define dca_clz(x)  __builtin_clz(x)\n#else\nstatic inline int dca_clz(uint32_t x)\n{\n    int r = 0;\n\n    assert(x);\n    if (x & 0xffff0000) { x >>= 16; r |= 16; }\n    if (x & 0x0000ff00) { x >>=  8; r |=  8; }\n    if (x & 0x000000f0) { x >>=  4; r |=  4; }\n    if (x & 0x0000000c) { x >>=  2; r |=  2; }\n    if (x & 0x00000002) { x >>=  1; r |=  1; }\n\n    return 31 - r;\n}\n#endif\n\n#if (defined __GNUC__) && (defined __POPCNT__)\n#define dca_popcount(x) __builtin_popcount(x)\n#else\nstatic inline int dca_popcount(uint32_t x)\n{\n    x -= (x >> 1) & 0x55555555;\n    x = (x & 0x33333333) + ((x >> 2) & 0x33333333);\n    x = (x + (x >> 4)) & 0x0f0f0f0f;\n    x += x >> 8;\n    return (x + (x >> 16)) & 0x3f;\n}\n#endif\n\n#define dca_countof(x)  (sizeof(x) / sizeof((x)[0]))\n\n#if AT_LEAST_GCC(4, 8)\n#define dca_bswap16(x)  __builtin_bswap16(x)\n#else\nstatic inline uint16_t dca_bswap16(uint16_t x)\n{\n    return (x << 8) | (x >> 8);\n}\n#endif\n\n#if AT_LEAST_GCC(4, 3)\n#define dca_bswap32(x)  __builtin_bswap32(x)\n#define dca_bswap64(x)  __builtin_bswap64(x)\n#else\nstatic inline uint32_t dca_bswap32(uint32_t x)\n{\n    x = ((x & 0x00ff00ff) << 8) | ((x & 0xff00ff00) >> 8);\n    return (x << 16) | (x >> 16);\n}\n\nstatic inline uint64_t dca_bswap64(uint64_t x)\n{\n    x = ((x & 0x00ff00ff00ff00ff) <<  8) | ((x & 0xff00ff00ff00ff00) >>  8);\n    x = ((x & 0x0000ffff0000ffff) << 16) | ((x & 0xffff0000ffff0000) >> 16);\n    return (x << 32) | (x >> 32);\n}\n#endif\n\n#define DCA_BSWAP16_C(x)    ((((x) & 0x00ff)   <<  8) | (((x) & 0xff00)  >>  8))\n#define DCA_BSWAP32_C(x)    ((DCA_BSWAP16_C(x) << 16) | (DCA_BSWAP16_C(x >> 16)))\n#define DCA_BSWAP64_C(x)    ((DCA_BSWAP32_C(x) << 32) | (DCA_BSWAP32_C(x >> 32)))\n\n#if HAVE_BIGENDIAN\n#define DCA_16LE(x) dca_bswap16(x)\n#define DCA_32LE(x) dca_bswap32(x)\n#define DCA_64LE(x) dca_bswap64(x)\n#define DCA_16BE(x) ((uint16_t)(x))\n#define DCA_32BE(x) ((uint32_t)(x))\n#define DCA_64BE(x) ((uint64_t)(x))\n#define DCA_16LE_C(x)   DCA_BSWAP16_C(x)\n#define DCA_32LE_C(x)   DCA_BSWAP32_C(x)\n#define DCA_64LE_C(x)   DCA_BSWAP64_C(x)\n#define DCA_16BE_C(x)   (x)\n#define DCA_32BE_C(x)   (x)\n#define DCA_64BE_C(x)   (x)\n#else\n#define DCA_16LE(x) ((uint16_t)(x))\n#define DCA_32LE(x) ((uint32_t)(x))\n#define DCA_64LE(x) ((uint64_t)(x))\n#define DCA_16BE(x) dca_bswap16(x)\n#define DCA_32BE(x) dca_bswap32(x)\n#define DCA_64BE(x) dca_bswap64(x)\n#define DCA_16LE_C(x)   (x)\n#define DCA_32LE_C(x)   (x)\n#define DCA_64LE_C(x)   (x)\n#define DCA_16BE_C(x)   DCA_BSWAP16_C(x)\n#define DCA_32BE_C(x)   DCA_BSWAP32_C(x)\n#define DCA_64BE_C(x)   DCA_BSWAP64_C(x)\n#endif\n\n#define DCA_MIN(a, b)   ((a) < (b) ? (a) : (b))\n#define DCA_MAX(a, b)   ((a) > (b) ? (a) : (b))\n\n#define DCA_ALIGN(value, align) \\\n    (((value) + (align) - 1) & ~((align) - 1))\n\n#define DCA_SET_BIT(map, bit) \\\n    ((map)[(bit) >> 3] |= 1 << ((bit) & 7))\n\n#define DCA_TEST_BIT(map, bit) \\\n    ((map)[(bit) >> 3] >> ((bit) & 7) & 1)\n\n#define DCA_MEM16BE(data) \\\n    (((uint32_t)(data)[0] <<  8) | (data)[1])\n\n#define DCA_MEM24BE(data) \\\n    (((uint32_t)(data)[0] << 16) | DCA_MEM16BE(&(data)[1]))\n\n#define DCA_MEM32BE(data) \\\n    (((uint32_t)(data)[0] << 24) | DCA_MEM24BE(&(data)[1]))\n\n#define DCA_MEM40BE(data) \\\n    (((uint64_t)(data)[0] << 32) | DCA_MEM32BE(&(data)[1]))\n\n#define DCA_MEM16LE(data) \\\n    (((uint32_t)(data)[1] <<  8) | (data)[0])\n\n#define DCA_MEM24LE(data) \\\n    (((uint32_t)(data)[2] << 16) | DCA_MEM16LE(data))\n\n#define DCA_MEM32LE(data) \\\n    (((uint32_t)(data)[3] << 24) | DCA_MEM24LE(data))\n\n#define DCA_MEM40LE(data) \\\n    (((uint64_t)(data)[4] << 32) | DCA_MEM32LE(data))\n\nstatic inline uint32_t DCA_MEM32NE(const void *data)\n{\n    uint32_t res;\n    memcpy(&res, data, sizeof(res));\n    return res;\n}\n\nvoid dca_format_log(struct dcadec_context *dca, int level,\n                    const char *file, int line, const char *fmt, ...)\n    __attribute__((format(printf, 5, 6)));\n\n#define DCADEC_LOG_ONCE     0x80000000\n\n#define dca_log(obj, lvl, ...) \\\n    dca_format_log((obj)->ctx, DCADEC_LOG_##lvl, __FILE__, __LINE__, __VA_ARGS__)\n\n#define dca_log_once(obj, lvl, ...) \\\n    dca_format_log((obj)->ctx, DCADEC_LOG_##lvl | DCADEC_LOG_ONCE, __FILE__, __LINE__, __VA_ARGS__)\n\n#define DCADEC_FLAG_KEEP_DMIX_MASK  \\\n    (DCADEC_FLAG_KEEP_DMIX_2CH | DCADEC_FLAG_KEEP_DMIX_6CH)\n\n#define SPEAKER_LAYOUT_MONO         (SPEAKER_MASK_C)\n#define SPEAKER_LAYOUT_STEREO       (SPEAKER_MASK_L | SPEAKER_MASK_R)\n#define SPEAKER_LAYOUT_2POINT1      (SPEAKER_LAYOUT_STEREO | SPEAKER_MASK_LFE1)\n#define SPEAKER_LAYOUT_3_0          (SPEAKER_LAYOUT_STEREO | SPEAKER_MASK_C)\n#define SPEAKER_LAYOUT_2_1          (SPEAKER_LAYOUT_STEREO | SPEAKER_MASK_Cs)\n#define SPEAKER_LAYOUT_3_1          (SPEAKER_LAYOUT_3_0 | SPEAKER_MASK_Cs)\n#define SPEAKER_LAYOUT_2_2          (SPEAKER_LAYOUT_STEREO | SPEAKER_MASK_Ls | SPEAKER_MASK_Rs)\n#define SPEAKER_LAYOUT_5POINT0      (SPEAKER_LAYOUT_3_0 | SPEAKER_MASK_Ls | SPEAKER_MASK_Rs)\n#define SPEAKER_LAYOUT_7POINT0_WIDE (SPEAKER_LAYOUT_5POINT0 | SPEAKER_MASK_Lw | SPEAKER_MASK_Rw)\n#define SPEAKER_LAYOUT_7POINT1_WIDE (SPEAKER_LAYOUT_7POINT0_WIDE | SPEAKER_MASK_LFE1)\n\nenum WaveTag {\n    TAG_RIFF    = 0x46464952,\n    TAG_WAVE    = 0x45564157,\n    TAG_data    = 0x61746164,\n    TAG_fmt     = 0x20746d66\n};\n\n// WAVEFORMATEXTENSIBLE speakers\nenum WaveSpeaker {\n    WAVESPKR_FL,  WAVESPKR_FR,  WAVESPKR_FC,  WAVESPKR_LFE,\n    WAVESPKR_BL,  WAVESPKR_BR,  WAVESPKR_FLC, WAVESPKR_FRC,\n    WAVESPKR_BC,  WAVESPKR_SL,  WAVESPKR_SR,  WAVESPKR_TC,\n    WAVESPKR_TFL, WAVESPKR_TFC, WAVESPKR_TFR, WAVESPKR_TBL,\n    WAVESPKR_TBC, WAVESPKR_TBR,\n\n    WAVESPKR_COUNT\n};\n\n// Table 6-22: Loudspeaker masks\nenum SpeakerMask {\n    SPEAKER_MASK_C      = 0x00000001,\n    SPEAKER_MASK_L      = 0x00000002,\n    SPEAKER_MASK_R      = 0x00000004,\n    SPEAKER_MASK_Ls     = 0x00000008,\n    SPEAKER_MASK_Rs     = 0x00000010,\n    SPEAKER_MASK_LFE1   = 0x00000020,\n    SPEAKER_MASK_Cs     = 0x00000040,\n    SPEAKER_MASK_Lsr    = 0x00000080,\n    SPEAKER_MASK_Rsr    = 0x00000100,\n    SPEAKER_MASK_Lss    = 0x00000200,\n    SPEAKER_MASK_Rss    = 0x00000400,\n    SPEAKER_MASK_Lc     = 0x00000800,\n    SPEAKER_MASK_Rc     = 0x00001000,\n    SPEAKER_MASK_Lh     = 0x00002000,\n    SPEAKER_MASK_Ch     = 0x00004000,\n    SPEAKER_MASK_Rh     = 0x00008000,\n    SPEAKER_MASK_LFE2   = 0x00010000,\n    SPEAKER_MASK_Lw     = 0x00020000,\n    SPEAKER_MASK_Rw     = 0x00040000,\n    SPEAKER_MASK_Oh     = 0x00080000,\n    SPEAKER_MASK_Lhs    = 0x00100000,\n    SPEAKER_MASK_Rhs    = 0x00200000,\n    SPEAKER_MASK_Chr    = 0x00400000,\n    SPEAKER_MASK_Lhr    = 0x00800000,\n    SPEAKER_MASK_Rhr    = 0x01000000,\n    SPEAKER_MASK_Cl     = 0x02000000,\n    SPEAKER_MASK_Ll     = 0x04000000,\n    SPEAKER_MASK_Rl     = 0x08000000,\n    SPEAKER_MASK_RSV1   = 0x10000000,\n    SPEAKER_MASK_RSV2   = 0x20000000,\n    SPEAKER_MASK_RSV3   = 0x40000000,\n    SPEAKER_MASK_RSV4   = 0x80000000\n};\n\n// Table 6-22: Loudspeaker masks\nenum Speaker {\n    SPEAKER_C,    SPEAKER_L,    SPEAKER_R,    SPEAKER_Ls,\n    SPEAKER_Rs,   SPEAKER_LFE1, SPEAKER_Cs,   SPEAKER_Lsr,\n    SPEAKER_Rsr,  SPEAKER_Lss,  SPEAKER_Rss,  SPEAKER_Lc,\n    SPEAKER_Rc,   SPEAKER_Lh,   SPEAKER_Ch,   SPEAKER_Rh,\n    SPEAKER_LFE2, SPEAKER_Lw,   SPEAKER_Rw,   SPEAKER_Oh,\n    SPEAKER_Lhs,  SPEAKER_Rhs,  SPEAKER_Chr,  SPEAKER_Lhr,\n    SPEAKER_Rhr,  SPEAKER_Cl,   SPEAKER_Ll,   SPEAKER_Rl,\n    SPEAKER_RSV1, SPEAKER_RSV2, SPEAKER_RSV3, SPEAKER_RSV4,\n\n    SPEAKER_COUNT\n};\n\n// Table 7-1: Sync words\nenum SyncWord {\n    SYNC_WORD_CORE      = 0x7ffe8001,\n    SYNC_WORD_CORE_LE   = 0xfe7f0180,\n    SYNC_WORD_CORE_LE14 = 0xff1f00e8,\n    SYNC_WORD_CORE_BE14 = 0x1fffe800,\n    SYNC_WORD_REV1AUX   = 0x9a1105a0,\n    SYNC_WORD_REV2AUX   = 0x7004c070,\n    SYNC_WORD_XCH       = 0x5a5a5a5a,\n    SYNC_WORD_XXCH      = 0x47004a03,\n    SYNC_WORD_X96       = 0x1d95f262,\n    SYNC_WORD_XBR       = 0x655e315e,\n    SYNC_WORD_LBR       = 0x0a801921,\n    SYNC_WORD_XLL       = 0x41a29547,\n    SYNC_WORD_EXSS      = 0x64582025,\n    SYNC_WORD_EXSS_LE   = 0x58642520,\n    SYNC_WORD_CORE_EXSS = 0x02b09261,\n};\n\n// Table 7-10: Loudspeaker bit mask for speaker activity\nenum SpeakerPair {\n    SPEAKER_PAIR_C      = 0x0001,\n    SPEAKER_PAIR_LR     = 0x0002,\n    SPEAKER_PAIR_LsRs   = 0x0004,\n    SPEAKER_PAIR_LFE1   = 0x0008,\n    SPEAKER_PAIR_Cs     = 0x0010,\n    SPEAKER_PAIR_LhRh   = 0x0020,\n    SPEAKER_PAIR_LsrRsr = 0x0040,\n    SPEAKER_PAIR_Ch     = 0x0080,\n    SPEAKER_PAIR_Oh     = 0x0100,\n    SPEAKER_PAIR_LcRc   = 0x0200,\n    SPEAKER_PAIR_LwRw   = 0x0400,\n    SPEAKER_PAIR_LssRss = 0x0800,\n    SPEAKER_PAIR_LFE2   = 0x1000,\n    SPEAKER_PAIR_LhsRhs = 0x2000,\n    SPEAKER_PAIR_Chr    = 0x4000,\n    SPEAKER_PAIR_LhrRhr = 0x8000,\n    SPEAKER_PAIR_ALL_1  = 0x5199,\n    SPEAKER_PAIR_ALL_2  = 0xae66\n};\n\nstatic inline int count_chs_for_mask(int mask)\n{\n    return dca_popcount(mask) + dca_popcount(mask & SPEAKER_PAIR_ALL_2);\n}\n\n// Table 7-11: Representation type\nenum RepresentationType {\n    REPR_TYPE_LtRt  = 2,\n    REPR_TYPE_LhRh  = 3\n};\n\n// Table 7-15: Core/extension mask\nenum ExtensionMask {\n    CSS_CORE    = 0x001,\n    CSS_XXCH    = 0x002,\n    CSS_X96     = 0x004,\n    CSS_XCH     = 0x008,\n    EXSS_CORE   = 0x010,\n    EXSS_XBR    = 0x020,\n    EXSS_XXCH   = 0x040,\n    EXSS_X96    = 0x080,\n    EXSS_LBR    = 0x100,\n    EXSS_XLL    = 0x200,\n    EXSS_RSV1   = 0x400,\n    EXSS_RSV2   = 0x800\n};\n\n// Table 8-8: Downmix type\nenum DownMixType {\n    DMIX_TYPE_1_0,\n    DMIX_TYPE_LoRo,\n    DMIX_TYPE_LtRt,\n    DMIX_TYPE_3_0,\n    DMIX_TYPE_2_1,\n    DMIX_TYPE_2_2,\n    DMIX_TYPE_3_1,\n\n    DMIX_TYPE_COUNT\n};\n\n#endif\n"
  },
  {
    "path": "libdcadec/compiler.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef COMPILER_H\n#define COMPILER_H\n\n#ifdef _MSC_VER\n#define inline      __inline\n#define restrict    __restrict\n\n#define fseeko  _fseeki64\n#define ftello  _ftelli64\n#define STDIN_FILENO    0\n#define STDOUT_FILENO   1\n\ntypedef __int64 off_t;\n#endif\n\n#ifndef __GNUC__\n#define __attribute__(x)\n#endif\n\n#define AT_LEAST_GCC(major, minor)  \\\n    (defined __GNUC__) && ((__GNUC__ > (major)) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))\n\n#ifndef HAVE_BIGENDIAN\n# if (defined __GNUC__)\n#  if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__\n#   define HAVE_BIGENDIAN   0\n#  elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__\n#   define HAVE_BIGENDIAN   1\n#  else\n#   error Unsupported byte order\n#  endif\n# elif (defined _MSC_VER)\n#  define HAVE_BIGENDIAN    0\n# else\n#  error Unsupported compiler. Define HAVE_BIGENDIAN macro to specify endianness.\n# endif\n#endif\n\n#endif\n"
  },
  {
    "path": "libdcadec/core_decoder.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"common.h\"\n#include \"bitstream.h\"\n#include \"interpolator.h\"\n#include \"idct.h\"\n#include \"fixed_math.h\"\n#include \"core_decoder.h\"\n#include \"exss_parser.h\"\n#include \"dmix_tables.h\"\n\n#include \"core_tables.h\"\n#include \"core_huffman.h\"\n#include \"core_vectors.h\"\n\nenum HeaderType {\n    HEADER_CORE,\n    HEADER_XCH,\n    HEADER_XXCH\n};\n\nenum AudioMode {\n    AMODE_MONO,             // Mode 0: A (mono)\n    AMODE_MONO_DUAL,        // Mode 1: A + B (dual mono)\n    AMODE_STEREO,           // Mode 2: L + R (stereo)\n    AMODE_STEREO_SUMDIFF,   // Mode 3: (L+R) + (L-R) (sum-diff)\n    AMODE_STEREO_TOTAL,     // Mode 4: LT + RT (left and right total)\n    AMODE_3F,               // Mode 5: C + L + R\n    AMODE_2F1R,             // Mode 6: L + R + S\n    AMODE_3F1R,             // Mode 7: C + L + R + S\n    AMODE_2F2R,             // Mode 8: L + R + SL + SR\n    AMODE_3F2R,             // Mode 9: C + L + R + SL + SR\n\n    AMODE_COUNT\n};\n\nenum ExtAudioType {\n    EXT_AUDIO_XCH   = 0,\n    EXT_AUDIO_X96   = 2,\n    EXT_AUDIO_XXCH  = 6\n};\n\nenum LFEFlag {\n    LFE_FLAG_NONE,\n    LFE_FLAG_128,\n    LFE_FLAG_64,\n    LFE_FLAG_INVALID\n};\n\nstatic const int8_t prm_ch_to_spkr_map[AMODE_COUNT][5] = {\n    { SPEAKER_C,        -1,         -1,         -1,         -1 },\n    { SPEAKER_L, SPEAKER_R,         -1,         -1,         -1 },\n    { SPEAKER_L, SPEAKER_R,         -1,         -1,         -1 },\n    { SPEAKER_L, SPEAKER_R,         -1,         -1,         -1 },\n    { SPEAKER_L, SPEAKER_R,         -1,         -1,         -1 },\n    { SPEAKER_C, SPEAKER_L, SPEAKER_R ,         -1,         -1 },\n    { SPEAKER_L, SPEAKER_R, SPEAKER_Cs,         -1          -1 },\n    { SPEAKER_C, SPEAKER_L, SPEAKER_R , SPEAKER_Cs,         -1 },\n    { SPEAKER_L, SPEAKER_R, SPEAKER_Ls, SPEAKER_Rs,         -1 },\n    { SPEAKER_C, SPEAKER_L, SPEAKER_R,  SPEAKER_Ls, SPEAKER_Rs }\n};\n\nstatic const uint8_t audio_mode_ch_mask[AMODE_COUNT] = {\n    SPEAKER_LAYOUT_MONO,\n    SPEAKER_LAYOUT_STEREO,\n    SPEAKER_LAYOUT_STEREO,\n    SPEAKER_LAYOUT_STEREO,\n    SPEAKER_LAYOUT_STEREO,\n    SPEAKER_LAYOUT_3_0,\n    SPEAKER_LAYOUT_2_1,\n    SPEAKER_LAYOUT_3_1,\n    SPEAKER_LAYOUT_2_2,\n    SPEAKER_LAYOUT_5POINT0\n};\n\n// 5.3.1 - Bit stream header\nstatic int parse_frame_header(struct core_decoder *core)\n{\n    // Frame type\n    bool normal_frame = bits_get1(&core->bits);\n\n    // Deficit sample count\n    if (bits_get(&core->bits, 5) != NUM_PCMBLOCK_SAMPLES - 1) {\n        core_err(\"Invalid deficit sample count\");\n        return normal_frame ? -DCADEC_EBADDATA : -DCADEC_ENOSUP;\n    }\n\n    // CRC present flag\n    core->crc_present = bits_get1(&core->bits);\n\n    // Number of PCM sample blocks\n    core->npcmblocks = bits_get(&core->bits, 7) + 1;\n    if (core->npcmblocks & (NUM_SUBBAND_SAMPLES - 1)) {\n        core_err(\"Invalid number of PCM sample blocks (%d)\", core->npcmblocks);\n        return (core->npcmblocks < 6 || normal_frame) ? -DCADEC_EBADDATA : -DCADEC_ENOSUP;\n    }\n\n    // Primary frame byte size\n    core->frame_size = bits_get(&core->bits, 14) + 1;\n    if (core->frame_size < 96) {\n        core_err(\"Invalid core frame size\");\n        return -DCADEC_EBADDATA;\n    }\n\n    // Audio channel arrangement\n    core->audio_mode = bits_get(&core->bits, 6);\n    if (core->audio_mode >= AMODE_COUNT) {\n        core_err(\"Unsupported audio channel arrangement (%d)\", core->audio_mode);\n        return -DCADEC_ENOSUP;\n    }\n\n    // Core audio sampling frequency\n    core->sample_rate = sample_rates[bits_get(&core->bits, 4)];\n    if (!core->sample_rate) {\n        core_err(\"Invalid core audio sampling frequency\");\n        return -DCADEC_EBADDATA;\n    }\n\n    // Transmission bit rate\n    core->bit_rate = bit_rates[bits_get(&core->bits, 5)];\n    if (core->bit_rate == -1) {\n        core_err(\"Invalid transmission bit rate\");\n        return -DCADEC_EBADDATA;\n    }\n\n    // Reserved field\n    bits_skip1(&core->bits);\n\n    // Embedded dynamic range flag\n    core->drc_present = bits_get1(&core->bits);\n\n    // Embedded time stamp flag\n    core->ts_present = bits_get1(&core->bits);\n\n    // Auxiliary data flag\n    core->aux_present = bits_get1(&core->bits);\n\n    // HDCD mastering flag\n    bits_skip1(&core->bits);\n\n    // Extension audio descriptor flag\n    core->ext_audio_type = bits_get(&core->bits, 3);\n\n    // Extended coding flag\n    core->ext_audio_present = bits_get1(&core->bits);\n\n    // Audio sync word insertion flag\n    core->sync_ssf = bits_get1(&core->bits);\n\n    // Low frequency effects flag\n    core->lfe_present = bits_get(&core->bits, 2);\n    if (core->lfe_present == LFE_FLAG_INVALID) {\n        core_err(\"Invalid low frequency effects flag\");\n        return -DCADEC_EBADDATA;\n    }\n\n    // Predictor history flag switch\n    core->predictor_history = bits_get1(&core->bits);\n\n    // Header CRC check bytes\n    if (core->crc_present)\n        bits_skip(&core->bits, 16);\n\n    // Multirate interpolator switch\n    core->filter_perfect = bits_get1(&core->bits);\n\n    // Encoder software revision\n    bits_skip(&core->bits, 4);\n\n    // Copy history\n    bits_skip(&core->bits, 2);\n\n    // Source PCM resolution\n    int pcmr_index = bits_get(&core->bits, 3);\n    core->source_pcm_res = sample_res[pcmr_index];\n    if (!core->source_pcm_res) {\n        core_err(\"Invalid source PCM resolution\");\n        return -DCADEC_EBADDATA;\n    }\n    core->es_format = !!(pcmr_index & 1);\n\n    // Front sum/difference flag\n    core->sumdiff_front = bits_get1(&core->bits);\n\n    // Surround sum/difference flag\n    core->sumdiff_surround = bits_get1(&core->bits);\n\n    // Dialog normalization / unspecified\n    bits_skip(&core->bits, 4);\n\n    return 0;\n}\n\n// 5.3.2 - Primary audio coding header\nstatic int parse_coding_header(struct core_decoder *core, enum HeaderType header, int xch_base)\n{\n    int ch, n, ret, header_size = 0, header_pos = core->bits.index;\n\n    switch (header) {\n    case HEADER_CORE:\n        // Number of subframes\n        core->nsubframes = bits_get(&core->bits, 4) + 1;\n\n        // Number of primary audio channels\n        core->nchannels = bits_get(&core->bits, 3) + 1;\n        if (core->nchannels != audio_mode_nch[core->audio_mode]) {\n            core_err(\"Invalid number of primary audio channels (%d) for audio \"\n                     \"channel arrangement (%d)\", core->nchannels, core->audio_mode);\n            return -DCADEC_EBADDATA;\n        }\n        assert(core->nchannels <= MAX_CHANNELS - 2);\n\n        core->ch_mask = audio_mode_ch_mask[core->audio_mode];\n\n        // Add LFE channel if present\n        if (core->lfe_present)\n            core->ch_mask |= SPEAKER_MASK_LFE1;\n        break;\n\n    case HEADER_XCH:\n        core->nchannels = audio_mode_nch[core->audio_mode] + 1;\n        assert(core->nchannels <= MAX_CHANNELS - 1);\n        core->ch_mask |= SPEAKER_MASK_Cs;\n        break;\n\n    case HEADER_XXCH:\n        // Channel set header length\n        header_size = bits_get(&core->bits, 7) + 1;\n\n        // Check CRC\n        if (core->xxch_crc_present && (ret = bits_check_crc(&core->bits, header_pos, header_pos + header_size * 8)) < 0) {\n            core_err(\"Invalid XXCH channel set header checksum\");\n            return ret;\n        }\n\n        // Number of channels in a channel set\n        int nchannels = bits_get(&core->bits, 3) + 1;\n        if (nchannels > MAX_CHANNELS_XXCH) {\n            core_err_once(\"Unsupported number of XXCH channels (%d)\", nchannels);\n            return -DCADEC_ENOSUP;\n        }\n        core->nchannels = audio_mode_nch[core->audio_mode] + nchannels;\n        assert(core->nchannels <= MAX_CHANNELS);\n\n        // Loudspeaker layout mask\n        unsigned int mask = bits_get(&core->bits, core->xxch_mask_nbits - SPEAKER_Cs);\n        core->xxch_spkr_mask = mask << SPEAKER_Cs;\n\n        if (dca_popcount(core->xxch_spkr_mask) != nchannels) {\n            core_err(\"Invalid XXCH speaker layout mask (%#x)\", core->xxch_spkr_mask);\n            return -DCADEC_EBADDATA;\n        }\n\n        if (core->xxch_core_mask & core->xxch_spkr_mask) {\n            core_err(\"XXCH speaker layout mask (%#x) overlaps with core (%#x)\",\n                     core->xxch_spkr_mask, core->xxch_core_mask);\n            return -DCADEC_EBADDATA;\n        }\n\n        // Combine core and XXCH masks together\n        core->ch_mask = core->xxch_core_mask | core->xxch_spkr_mask;\n\n        // Downmix coefficients present in stream\n        if (bits_get1(&core->bits)) {\n            // Downmix already performed by encoder\n            core->xxch_dmix_embedded = bits_get1(&core->bits);\n\n            // Downmix scale factor\n            unsigned int index = bits_get(&core->bits, 6) * 4 - 44;\n            if (index >= dca_countof(dmix_table_inv)) {\n                core_err(\"Invalid XXCH downmix scale index\");\n                return -DCADEC_EBADDATA;\n            }\n            core->xxch_dmix_scale_inv = dmix_table_inv[index];\n\n            // Downmix channel mapping mask\n            for (ch = 0; ch < nchannels; ch++) {\n                mask = bits_get(&core->bits, core->xxch_mask_nbits);\n                if ((mask & core->xxch_core_mask) != mask) {\n                    core_err(\"Invalid XXCH downmix channel mapping mask (%#x)\", mask);\n                    return -DCADEC_EBADDATA;\n                }\n                core->xxch_dmix_mask[ch] = mask;\n            }\n\n            // Downmix coefficients\n            int *coeff_ptr = core->xxch_dmix_coeff;\n            for (ch = 0; ch < nchannels; ch++) {\n                for (n = 0; n < core->xxch_mask_nbits; n++) {\n                    if (core->xxch_dmix_mask[ch] & (1U << n)) {\n                        int code = bits_get(&core->bits, 7);\n                        int sign = (code >> 6) - 1;\n                        if (code &= 63) {\n                            unsigned int index = code * 4 - 4;\n                            if (index >= dca_countof(dmix_table)) {\n                                core_err(\"Invalid XXCH downmix coefficient index\");\n                                return -DCADEC_EBADDATA;\n                            }\n                            *coeff_ptr++ = (dmix_table[index] ^ sign) - sign;\n                        } else {\n                            *coeff_ptr++ = 0;\n                        }\n                    }\n                }\n            }\n        } else {\n            core->xxch_dmix_embedded = false;\n        }\n\n        break;\n    }\n\n    // Subband activity count\n    for (ch = xch_base; ch < core->nchannels; ch++) {\n        core->nsubbands[ch] = bits_get(&core->bits, 5) + 2;\n        if (core->nsubbands[ch] > MAX_SUBBANDS) {\n            core_err(\"Invalid subband activity count\");\n            return -DCADEC_EBADDATA;\n        }\n    }\n\n    // High frequency VQ start subband\n    for (ch = xch_base; ch < core->nchannels; ch++)\n        core->subband_vq_start[ch] = bits_get(&core->bits, 5) + 1;\n\n    // Joint intensity coding index\n    for (ch = xch_base; ch < core->nchannels; ch++) {\n        if ((n = bits_get(&core->bits, 3)) && header == HEADER_XXCH)\n            n += xch_base - 1;\n        if (n > core->nchannels) {\n            core_err(\"Invalid joint intensity coding index\");\n            return -DCADEC_EBADDATA;\n        }\n        core->joint_intensity_index[ch] = n;\n    }\n\n    // Transient mode code book\n    for (ch = xch_base; ch < core->nchannels; ch++)\n        core->transition_mode_sel[ch] = bits_get(&core->bits, 2);\n\n    // Scale factor code book\n    for (ch = xch_base; ch < core->nchannels; ch++) {\n        core->scale_factor_sel[ch] = bits_get(&core->bits, 3);\n        if (core->scale_factor_sel[ch] == 7) {\n            core_err(\"Invalid scale factor code book\");\n            return -DCADEC_EBADDATA;\n        }\n    }\n\n    // Bit allocation quantizer select\n    for (ch = xch_base; ch < core->nchannels; ch++) {\n        core->bit_allocation_sel[ch] = bits_get(&core->bits, 3);\n        if (core->bit_allocation_sel[ch] == 7) {\n            core_err(\"Invalid bit allocation quantizer select\");\n            return -DCADEC_EBADDATA;\n        }\n    }\n\n    // Quantization index codebook select\n    for (n = 0; n < NUM_CODE_BOOKS; n++)\n        for (ch = xch_base; ch < core->nchannels; ch++)\n            core->quant_index_sel[ch][n] = bits_get(&core->bits, quant_index_sel_nbits[n]);\n\n    // Scale factor adjustment index\n    for (n = 0; n < NUM_CODE_BOOKS; n++)\n        for (ch = xch_base; ch < core->nchannels; ch++)\n            if (core->quant_index_sel[ch][n] < quant_index_group_size[n])\n                core->scale_factor_adj[ch][n] = scale_factor_adj[bits_get(&core->bits, 2)];\n\n    if (header == HEADER_XXCH) {\n        // Reserved\n        // Byte align\n        // CRC16 of channel set header\n        if ((ret = bits_seek(&core->bits, header_pos + header_size * 8)) < 0) {\n            core_err(\"Read past end of XXCH channel set header\");\n            return ret;\n        }\n    } else {\n        // Audio header CRC check word\n        if (core->crc_present)\n            bits_skip(&core->bits, 16);\n    }\n\n    return 0;\n}\n\nstatic int parse_scale(struct core_decoder *core, int *scale_index, int sel)\n{\n    // Select the root square table\n    const int32_t *scale_table;\n    size_t scale_size;\n    if (sel > 5) {\n        scale_table = scale_factors_7bit;\n        scale_size = dca_countof(scale_factors_7bit);\n    } else {\n        scale_table = scale_factors_6bit;\n        scale_size = dca_countof(scale_factors_6bit);\n    }\n\n    if (sel < 5)\n        // If Huffman code was used, the difference of scales was encoded\n        *scale_index += bits_get_signed_vlc(&core->bits, &scale_factor_huff[sel]);\n    else\n        *scale_index = bits_get(&core->bits, sel + 1);\n\n    // Look up scale factor from the root square table\n    if ((unsigned int)*scale_index >= scale_size) {\n        core_err(\"Invalid scale factor index\");\n        return -DCADEC_EBADDATA;\n    }\n\n    return scale_table[*scale_index];\n}\n\nstatic int parse_joint_scale(struct core_decoder *core, int sel)\n{\n    int scale_index;\n\n    if (sel < 5)\n        scale_index = bits_get_signed_vlc(&core->bits, &scale_factor_huff[sel]);\n    else\n        scale_index = bits_get(&core->bits, sel + 1);\n\n    // Bias by 64\n    scale_index += 64;\n\n    // Look up joint scale factor\n    if ((unsigned int)scale_index >= dca_countof(joint_scale_factors)) {\n        core_err(\"Invalid joint scale factor index\");\n        return -DCADEC_EBADDATA;\n    }\n\n    return joint_scale_factors[scale_index];\n}\n\n// 5.4.1 - Primary audio coding side information\nstatic int parse_subframe_header(struct core_decoder *core, int sf,\n                                 enum HeaderType header, int xch_base)\n{\n    int ch, band, ret;\n\n    if (header == HEADER_CORE) {\n        // Subsubframe count\n        core->nsubsubframes[sf] = bits_get(&core->bits, 2) + 1;\n\n        // Partial subsubframe sample count\n        bits_skip(&core->bits, 3);\n    }\n\n    // Prediction mode\n    for (ch = xch_base; ch < core->nchannels; ch++)\n        for (band = 0; band < core->nsubbands[ch]; band++)\n            core->prediction_mode[ch][band] = bits_get1(&core->bits);\n\n    // Prediction coefficients VQ address\n    for (ch = xch_base; ch < core->nchannels; ch++)\n        for (band = 0; band < core->nsubbands[ch]; band++)\n            if (core->prediction_mode[ch][band])\n                core->prediction_vq_index[ch][band] = bits_get(&core->bits, 12);\n\n    // Bit allocation index\n    for (ch = xch_base; ch < core->nchannels; ch++) {\n        // Select codebook\n        int sel = core->bit_allocation_sel[ch];\n        // Not high frequency VQ subbands\n        for (band = 0; band < core->subband_vq_start[ch]; band++) {\n            int abits;\n            if (sel < 5)\n                abits = bits_get_unsigned_vlc(&core->bits, &bit_allocation_huff[sel]) + 1;\n            else\n                abits = bits_get(&core->bits, sel - 1);\n            if (abits >= 27) {\n                core_err(\"Invalid bit allocation index\");\n                return -DCADEC_EBADDATA;\n            }\n            core->bit_allocation[ch][band] = abits;\n        }\n    }\n\n    // Transition mode\n    for (ch = xch_base; ch < core->nchannels; ch++) {\n        // Clear transition mode for all subbands\n        memset(core->transition_mode[sf][ch], 0, sizeof(core->transition_mode[0][0]));\n\n        // Transient possible only if more than one subsubframe\n        if (core->nsubsubframes[sf] > 1) {\n            // Select codebook\n            int sel = core->transition_mode_sel[ch];\n            // Not high frequency VQ subbands\n            for (band = 0; band < core->subband_vq_start[ch]; band++) {\n                // Present only if bits allocated\n                if (core->bit_allocation[ch][band]) {\n                    int trans_ssf = bits_get_unsigned_vlc(&core->bits, &transition_mode_huff[sel]);\n                    if (trans_ssf >= 4) {\n                        core_err(\"Invalid transition mode index\");\n                        return -DCADEC_EBADDATA;\n                    }\n                    core->transition_mode[sf][ch][band] = trans_ssf;\n                }\n            }\n        }\n    }\n\n    // Scale factors\n    for (ch = xch_base; ch < core->nchannels; ch++) {\n        // Select codebook\n        int sel = core->scale_factor_sel[ch];\n\n        // Clear accumulation\n        int scale_index = 0;\n\n        // Extract scales for subbands up to VQ\n        for (band = 0; band < core->subband_vq_start[ch]; band++) {\n            if (core->bit_allocation[ch][band]) {\n                if ((ret = parse_scale(core, &scale_index, sel)) < 0)\n                    return ret;\n                core->scale_factors[ch][band][0] = ret;\n                if (core->transition_mode[sf][ch][band]) {\n                    if ((ret = parse_scale(core, &scale_index, sel)) < 0)\n                        return ret;\n                    core->scale_factors[ch][band][1] = ret;\n                }\n            } else {\n                core->scale_factors[ch][band][0] = 0;\n            }\n        }\n\n        // High frequency VQ subbands\n        for (band = core->subband_vq_start[ch]; band < core->nsubbands[ch]; band++) {\n            if ((ret = parse_scale(core, &scale_index, sel)) < 0)\n                return ret;\n            core->scale_factors[ch][band][0] = ret;\n        }\n    }\n\n    // Joint subband codebook select\n    for (ch = xch_base; ch < core->nchannels; ch++) {\n        // Only if joint subband coding is enabled\n        if (core->joint_intensity_index[ch]) {\n            core->joint_scale_sel[ch] = bits_get(&core->bits, 3);\n            if (core->joint_scale_sel[ch] == 7) {\n                core_err(\"Invalid joint scale factor code book\");\n                return -DCADEC_EBADDATA;\n            }\n        }\n    }\n\n    // Scale factors for joint subband coding\n    for (ch = xch_base; ch < core->nchannels; ch++) {\n        // Only if joint subband coding is enabled\n        if (core->joint_intensity_index[ch]) {\n            // Select codebook\n            int sel = core->joint_scale_sel[ch];\n            // Get source channel\n            int src_ch = core->joint_intensity_index[ch] - 1;\n            for (band = core->nsubbands[ch]; band < core->nsubbands[src_ch]; band++) {\n                if ((ret = parse_joint_scale(core, sel)) < 0)\n                    return ret;\n                core->joint_scale_factors[ch][band] = ret;\n            }\n        }\n    }\n\n    // Dynamic range coefficient\n    if (core->drc_present && header == HEADER_CORE)\n        bits_skip(&core->bits, 8);\n\n    // Side information CRC check word\n    if (core->crc_present)\n        bits_skip(&core->bits, 16);\n\n    return 0;\n}\n\nstatic int parse_block_codes(struct core_decoder *core, int *audio, int abits)\n{\n    // Extract the block code indices from the bit stream\n    int code1 = bits_get(&core->bits, block_code_nbits[abits]);\n    int code2 = bits_get(&core->bits, block_code_nbits[abits]);\n    int levels = quant_levels[abits];\n    int offset = (levels - 1) / 2;\n    int n;\n\n    // Look up samples from the block code book\n    for (n = 0; n < NUM_SUBBAND_SAMPLES / 2; n++) {\n        audio[n] = (code1 % levels) - offset;\n        code1 /= levels;\n    }\n    for (; n < NUM_SUBBAND_SAMPLES; n++) {\n        audio[n] = (code2 % levels) - offset;\n        code2 /= levels;\n    }\n\n    if (code1 || code2) {\n        core_err(\"Failed to decode block codes\");\n        return -DCADEC_EBADDATA;\n    }\n\n    return 0;\n}\n\nstatic int parse_huffman_codes(struct core_decoder *core, int *audio, int abits, int sel)\n{\n    int ret;\n\n    // Extract Huffman codes from the bit stream\n    if ((ret = bits_get_signed_vlc_array(&core->bits, audio, NUM_SUBBAND_SAMPLES,\n                                         &quant_index_group_huff[abits - 1][sel])) < 0) {\n        core_err(\"Failed to decode huffman codes\");\n        return ret;\n    }\n\n    return 1;\n}\n\nstatic inline int extract_audio(struct core_decoder *core, int *audio, int abits, int ch)\n{\n    assert(abits >= 0 && abits < 27);\n\n    if (abits == 0) {\n        // No bits allocated\n        memset(audio, 0, NUM_SUBBAND_SAMPLES * sizeof(*audio));\n        return 0;\n    }\n\n    if (abits <= NUM_CODE_BOOKS) {\n        int sel = core->quant_index_sel[ch][abits - 1];\n        if (sel < quant_index_group_size[abits - 1]) {\n            // Huffman codes\n            return parse_huffman_codes(core, audio, abits, sel);\n        }\n        if (abits <= 7) {\n            // Block codes\n            return parse_block_codes(core, audio, abits);\n        }\n    }\n\n    // No further encoding\n    bits_get_signed_array(&core->bits, audio, NUM_SUBBAND_SAMPLES, abits - 3);\n    return 0;\n}\n\nstatic inline void dequantize(int *output, const int *input, int step_size,\n                              int scale, bool residual)\n{\n    // Account for quantizer step size\n    int64_t step_scale = (int64_t)step_size * scale;\n    int shift = 0;\n\n    // Limit scale factor resolution to 22 bits\n    if (step_scale > (1 << 23)) {\n        shift = 32 - dca_clz(step_scale >> 23);\n        step_scale >>= shift;\n    }\n\n    // Scale the samples\n    if (residual) {\n        for (int n = 0; n < NUM_SUBBAND_SAMPLES; n++)\n            output[n] += clip23(norm__(input[n] * step_scale, 22 - shift));\n    } else {\n        for (int n = 0; n < NUM_SUBBAND_SAMPLES; n++)\n            output[n]  = clip23(norm__(input[n] * step_scale, 22 - shift));\n    }\n}\n\n// 5.5 - Primary audio data arrays\nstatic int parse_subframe_audio(struct core_decoder *core, int sf, enum HeaderType header,\n                                int xch_base, int *sub_pos, int *lfe_pos)\n{\n    int ssf, ch, band, ofs;\n\n    // Number of subband samples in this subframe\n    int nsamples = core->nsubsubframes[sf] * NUM_SUBBAND_SAMPLES;\n    if (*sub_pos + nsamples > core->npcmblocks) {\n        core_err(\"Subband sample buffer overflow\");\n        return -DCADEC_EBADDATA;\n    }\n\n    // VQ encoded subbands\n    for (ch = xch_base; ch < core->nchannels; ch++) {\n        for (band = core->subband_vq_start[ch]; band < core->nsubbands[ch]; band++) {\n            // Extract the VQ address from the bit stream\n            int vq_index = bits_get(&core->bits, 10);\n\n            // Get the scale factor\n            int scale = core->scale_factors[ch][band][0];\n\n            // Look up the VQ code book for 32 subband samples\n            const int8_t *vq_samples = high_freq_samples[vq_index];\n\n            // Scale and take the samples\n            int *samples = core->subband_samples[ch][band] + *sub_pos;\n            for (int n = 0; n < nsamples; n++)\n                samples[n] = clip23(mul4(scale, vq_samples[n]));\n        }\n    }\n\n    // Low frequency effect data\n    if (core->lfe_present && header == HEADER_CORE) {\n        // Number of LFE samples in this subframe\n        int nlfesamples = 2 * core->lfe_present * core->nsubsubframes[sf];\n        assert(nlfesamples <= MAX_LFE_SAMPLES);\n\n        // Extract LFE samples from the bit stream\n        int audio[MAX_LFE_SAMPLES];\n        bits_get_signed_array(&core->bits, audio, nlfesamples, 8);\n\n        // Extract scale factor index from the bit stream\n        unsigned int scale_index = bits_get(&core->bits, 8);\n        if (scale_index >= dca_countof(scale_factors_7bit)) {\n            core_err(\"Invalid LFE scale factor index\");\n            return -DCADEC_EBADDATA;\n        }\n\n        // Look up the 7-bit root square quantization table\n        int scale = scale_factors_7bit[scale_index];\n\n        // Account for quantizer step size which is 0.035\n        int step_scale = mul23(4697620, scale);\n\n        // Scale the LFE samples\n        int *samples = core->lfe_samples + *lfe_pos;\n        for (int n = 0; n < nlfesamples; n++)\n            samples[n] = clip23((audio[n] * step_scale) >> 4);\n\n        // Advance LFE sample pointer for the next subframe\n        *lfe_pos += nlfesamples;\n    }\n\n    // Audio data\n    for (ssf = 0, ofs = *sub_pos; ssf < core->nsubsubframes[sf]; ssf++) {\n        for (ch = xch_base; ch < core->nchannels; ch++) {\n            // Not high frequency VQ subbands\n            for (band = 0; band < core->subband_vq_start[ch]; band++) {\n                int abits = core->bit_allocation[ch][band];\n                int audio[NUM_SUBBAND_SAMPLES];\n                int ret, step_size, trans_ssf, scale;\n\n                // Extract bits from the bit stream\n                if ((ret = extract_audio(core, audio, abits, ch)) < 0)\n                    return ret;\n\n                // Select quantization step size table\n                // Look up quantization step size\n                if (core->bit_rate == -2)\n                    step_size = step_size_lossless[abits];\n                else\n                    step_size = step_size_lossy[abits];\n\n                // Identify transient location\n                trans_ssf = core->transition_mode[sf][ch][band];\n\n                // Determine proper scale factor\n                if (trans_ssf == 0 || ssf < trans_ssf)\n                    scale = core->scale_factors[ch][band][0];\n                else\n                    scale = core->scale_factors[ch][band][1];\n\n                // Adjustment of scale factor\n                // Only when SEL indicates Huffman code\n                if (ret > 0) {\n                    int64_t adj = core->scale_factor_adj[ch][abits - 1];\n                    scale = clip23((adj * scale) >> 22);\n                }\n\n                dequantize(core->subband_samples[ch][band] + ofs,\n                           audio, step_size, scale, false);\n            }\n        }\n\n        // DSYNC\n        if ((ssf == core->nsubsubframes[sf] - 1 || core->sync_ssf)\n            && bits_get(&core->bits, 16) != 0xffff) {\n            core_err(\"DSYNC check failed\");\n            return -DCADEC_EBADDATA;\n        }\n\n        ofs += NUM_SUBBAND_SAMPLES;\n    }\n\n    // Inverse ADPCM\n    for (ch = xch_base; ch < core->nchannels; ch++) {\n        for (band = 0; band < core->nsubbands[ch]; band++) {\n            // Only if prediction mode is on\n            if (core->prediction_mode[ch][band]) {\n                int *samples = core->subband_samples[ch][band] + *sub_pos;\n\n                // Extract the VQ index\n                int vq_index = core->prediction_vq_index[ch][band];\n\n                // Look up the VQ table for prediction coefficients\n                const int16_t *vq_coeffs = adpcm_coeffs[vq_index];\n                for (int m = 0; m < nsamples; m++) {\n                    int64_t err = INT64_C(0);\n                    for (int n = 0; n < NUM_ADPCM_COEFFS; n++)\n                        err += (int64_t)samples[m - n - 1] * vq_coeffs[n];\n                    samples[m] = clip23(samples[m] + clip23(norm13(err)));\n                }\n            }\n        }\n    }\n\n    // Joint subband coding\n    for (ch = xch_base; ch < core->nchannels; ch++) {\n        // Only if joint subband coding is enabled\n        if (core->joint_intensity_index[ch]) {\n            // Get source channel\n            int src_ch = core->joint_intensity_index[ch] - 1;\n            for (band = core->nsubbands[ch]; band < core->nsubbands[src_ch]; band++) {\n                int *src = core->subband_samples[src_ch][band] + *sub_pos;\n                int *dst = core->subband_samples[    ch][band] + *sub_pos;\n                int scale = core->joint_scale_factors[ch][band];\n                for (int n = 0; n < nsamples; n++)\n                    dst[n] = clip23(mul17(src[n], scale));\n            }\n        }\n    }\n\n    // Advance subband sample pointer for the next subframe\n    *sub_pos += nsamples;\n    return 0;\n}\n\nstatic void erase_adpcm_history(struct core_decoder *core)\n{\n    // Erase ADPCM history from previous frame if\n    // predictor history switch was disabled\n    for (int ch = 0; ch < MAX_CHANNELS; ch++)\n        for (int band = 0; band < MAX_SUBBANDS; band++)\n            memset(core->subband_samples[ch][band] - NUM_ADPCM_COEFFS, 0, NUM_ADPCM_COEFFS * sizeof(int));\n}\n\nstatic int alloc_sample_buffer(struct core_decoder *core)\n{\n    int nchsamples = NUM_ADPCM_COEFFS + core->npcmblocks;\n    int nframesamples = nchsamples * MAX_CHANNELS * MAX_SUBBANDS;\n    int nlfesamples = MAX_LFE_HISTORY + core->npcmblocks / 2;\n\n    // Reallocate subband sample buffer\n    int ret;\n    if ((ret = ta_zalloc_fast(core, &core->subband_buffer, nframesamples + nlfesamples, sizeof(int))) < 0)\n        return -DCADEC_ENOMEM;\n    if (ret > 0) {\n        for (int ch = 0; ch < MAX_CHANNELS; ch++)\n            for (int band = 0; band < MAX_SUBBANDS; band++)\n                core->subband_samples[ch][band] = core->subband_buffer +\n                    (ch * MAX_SUBBANDS + band) * nchsamples + NUM_ADPCM_COEFFS;\n        core->lfe_samples = core->subband_buffer + nframesamples;\n    }\n\n    if (!core->predictor_history)\n        erase_adpcm_history(core);\n\n    return 0;\n}\n\nstatic int parse_frame_data(struct core_decoder *core, enum HeaderType header, int xch_base)\n{\n    int ret;\n    if ((ret = parse_coding_header(core, header, xch_base)) < 0)\n        return ret;\n\n    int sub_pos = 0;\n    int lfe_pos = MAX_LFE_HISTORY;\n    for (int sf = 0; sf < core->nsubframes; sf++) {\n        if ((ret = parse_subframe_header(core, sf, header, xch_base)) < 0)\n            return ret;\n        if ((ret = parse_subframe_audio(core, sf, header, xch_base, &sub_pos, &lfe_pos)) < 0)\n            return ret;\n    }\n\n    for (int ch = xch_base; ch < core->nchannels; ch++) {\n        // Number of active subbands for this channel\n        int nsubbands = core->nsubbands[ch];\n        if (core->joint_intensity_index[ch])\n            nsubbands = DCA_MAX(nsubbands, core->nsubbands[core->joint_intensity_index[ch] - 1]);\n\n        // Update history for ADPCM\n        for (int band = 0; band < nsubbands; band++) {\n            int *samples = core->subband_samples[ch][band] - NUM_ADPCM_COEFFS;\n            memcpy(samples, samples + core->npcmblocks, NUM_ADPCM_COEFFS * sizeof(int));\n        }\n\n        // Clear inactive subbands\n        for (int band = nsubbands; band < MAX_SUBBANDS; band++) {\n            int *samples = core->subband_samples[ch][band] - NUM_ADPCM_COEFFS;\n            memset(samples, 0, (NUM_ADPCM_COEFFS + core->npcmblocks) * sizeof(int));\n        }\n    }\n\n    return 0;\n}\n\nstatic int map_prm_ch_to_spkr(struct core_decoder *core, int ch)\n{\n    // Try to map this channel to core first\n    int pos = audio_mode_nch[core->audio_mode];\n    if (ch < pos) {\n        int spkr = prm_ch_to_spkr_map[core->audio_mode][ch];\n        if (core->ext_audio_mask & (CSS_XXCH | EXSS_XXCH)) {\n            if (core->xxch_core_mask & (1U << spkr))\n                return spkr;\n            if (spkr == SPEAKER_Ls && (core->xxch_core_mask & SPEAKER_MASK_Lss))\n                return SPEAKER_Lss;\n            if (spkr == SPEAKER_Rs && (core->xxch_core_mask & SPEAKER_MASK_Rss))\n                return SPEAKER_Rss;\n            return -1;\n        }\n        return spkr;\n    }\n\n    // Then XCH\n    if ((core->ext_audio_mask & CSS_XCH) && ch == pos)\n        return SPEAKER_Cs;\n\n    // Then XXCH\n    if (core->ext_audio_mask & (CSS_XXCH | EXSS_XXCH))\n        for (int spkr = SPEAKER_Cs; spkr < core->xxch_mask_nbits; spkr++)\n            if (core->xxch_spkr_mask & (1U << spkr))\n                if (pos++ == ch)\n                    return spkr;\n\n    // No mapping\n    return -1;\n}\n\nint core_filter(struct core_decoder *core, int flags)\n{\n    int x96_nchannels = 0;\n\n    // Externally set CORE_SYNTH_X96 flags implies that X96 synthesis should be\n    // enabled, yet actual X96 subband data should be discarded. This is a special\n    // case for lossless residual decoder that apparently ignores X96 data.\n    if (!(flags & DCADEC_FLAG_CORE_SYNTH_X96) && (core->ext_audio_mask & (CSS_X96 | EXSS_X96))) {\n        x96_nchannels = core->x96_nchannels;\n        flags |= DCADEC_FLAG_CORE_SYNTH_X96;\n    }\n\n    // X96 synthesis enabled flag\n    bool synth_x96 = !!(flags & DCADEC_FLAG_CORE_SYNTH_X96);\n\n    // Output sample rate\n    core->output_rate = core->sample_rate << synth_x96;\n\n    // Number of PCM samples in this frame\n    core->npcmsamples = (core->npcmblocks * NUM_PCMBLOCK_SAMPLES) << synth_x96;\n\n    // Reallocate PCM output buffer\n    if (ta_zalloc_fast(core, &core->output_buffer, core->npcmsamples * dca_popcount(core->ch_mask), sizeof(int)) < 0)\n        return -DCADEC_ENOMEM;\n\n    int *ptr = core->output_buffer;\n    for (int spkr = 0; spkr < SPEAKER_COUNT; spkr++) {\n        if (core->ch_mask & (1U << spkr)) {\n            core->output_samples[spkr] = ptr;\n            ptr += core->npcmsamples;\n        } else {\n            core->output_samples[spkr] = NULL;\n        }\n    }\n\n    // Handle change of certain filtering parameters\n    int diff = core->filter_flags ^ flags;\n\n    if (diff & (DCADEC_FLAG_CORE_BIT_EXACT | DCADEC_FLAG_CORE_SYNTH_X96)) {\n        for (int ch = 0; ch < MAX_CHANNELS; ch++) {\n            ta_free(core->subband_dsp[ch]);\n            core->subband_dsp[ch] = NULL;\n        }\n    }\n\n    if (diff & (DCADEC_FLAG_CORE_BIT_EXACT | DCADEC_FLAG_CORE_LFE_IIR))\n        memset(core->lfe_samples, 0, MAX_LFE_HISTORY * sizeof(int));\n\n    if (diff & DCADEC_FLAG_CORE_SYNTH_X96)\n        core->output_history_lfe = 0;\n\n    core->filter_flags = flags;\n\n    if (!core->subband_dsp_idct[synth_x96] && !(core->subband_dsp_idct[synth_x96] = idct_init(core, 5 + synth_x96, 0.25)))\n        return -DCADEC_ENOMEM;\n\n    // Filter primary channels\n    for (int ch = 0; ch < core->nchannels; ch++) {\n        // Allocate subband DSP\n        if (!core->subband_dsp[ch] && !(core->subband_dsp[ch] = interpolator_create(core->subband_dsp_idct[synth_x96], flags)))\n            return -DCADEC_ENOMEM;\n\n        // Map this primary channel to speaker\n        int spkr = map_prm_ch_to_spkr(core, ch);\n        if (spkr < 0)\n            return -DCADEC_EINVAL;\n\n        // Get the pointer to high frequency subbands for this channel, if present\n        int **subband_samples_hi;\n        if (ch < x96_nchannels)\n            subband_samples_hi = core->x96_subband_samples[ch];\n        else\n            subband_samples_hi = NULL;\n\n        // Filter bank reconstruction\n        core->subband_dsp[ch]->interpolate(core->subband_dsp[ch],\n                                           core->output_samples[spkr],\n                                           core->subband_samples[ch],\n                                           subband_samples_hi,\n                                           core->npcmblocks,\n                                           core->filter_perfect);\n    }\n\n    // Filter LFE channel\n    if (core->lfe_present) {\n        bool dec_select = (core->lfe_present == LFE_FLAG_128);\n        interpolate_lfe_cb interpolate;\n\n        // Select LFE DSP\n        if (flags & DCADEC_FLAG_CORE_BIT_EXACT) {\n            if (dec_select) {\n                core_err(\"Fixed point mode doesn't support LFF=1\");\n                return -DCADEC_EINVAL;\n            }\n            interpolate = interpolate_lfe_fixed_fir;\n        } else if (flags & DCADEC_FLAG_CORE_LFE_IIR) {\n            interpolate = interpolate_lfe_float_iir;\n        } else if (dec_select) {\n            interpolate = interpolate_lfe_float_fir_2x;\n        } else {\n            interpolate = interpolate_lfe_float_fir;\n        }\n\n        // Offset output buffer for X96\n        int *samples = core->output_samples[SPEAKER_LFE1];\n        if (synth_x96)\n            samples += core->npcmsamples / 2;\n\n        // Interpolation of LFE channel\n        interpolate(samples, core->lfe_samples, core->npcmblocks, dec_select);\n\n        if (synth_x96) {\n            // Filter 96 kHz oversampled LFE PCM to attenuate high frequency\n            // (47.6 - 48.0 kHz) components of interpolation image\n            int history = core->output_history_lfe;\n            int *samples2 = core->output_samples[SPEAKER_LFE1];\n            int nsamples = core->npcmsamples / 2;\n            for (int n = 0; n < nsamples; n++) {\n                int64_t res1 = INT64_C(2097471) * samples[n] + INT64_C(6291137) * history;\n                int64_t res2 = INT64_C(6291137) * samples[n] + INT64_C(2097471) * history;\n                history = samples[n];\n                samples2[2 * n    ] = clip23(norm23(res1));\n                samples2[2 * n + 1] = clip23(norm23(res2));\n            }\n\n            // Update LFE PCM history\n            core->output_history_lfe = history;\n        }\n    }\n\n    if (!(flags & DCADEC_FLAG_KEEP_DMIX_MASK)) {\n        int nsamples = core->npcmsamples;\n\n        // Undo embedded XCH downmix\n        if (core->es_format && (core->ext_audio_mask & CSS_XCH) && core->audio_mode >= AMODE_2F2R) {\n            int *samples_ls = core->output_samples[SPEAKER_Ls];\n            int *samples_rs = core->output_samples[SPEAKER_Rs];\n            int *samples_cs = core->output_samples[SPEAKER_Cs];\n            for (int n = 0; n < nsamples; n++) {\n                int cs = mul23(samples_cs[n], 5931520);\n                samples_ls[n] = clip23(samples_ls[n] - cs);\n                samples_rs[n] = clip23(samples_rs[n] - cs);\n            }\n        }\n\n        // Undo embedded XXCH downmix\n        if ((core->ext_audio_mask & (CSS_XXCH | EXSS_XXCH)) && core->xxch_dmix_embedded) {\n            int xch_base = audio_mode_nch[core->audio_mode];\n            assert(core->nchannels - xch_base <= MAX_CHANNELS_XXCH);\n\n            // Undo embedded core downmix pre-scaling\n            int scale_inv = core->xxch_dmix_scale_inv;\n            if (scale_inv != (1 << 16)) {\n                for (int spkr = 0; spkr < core->xxch_mask_nbits; spkr++) {\n                    if (core->xxch_core_mask & (1U << spkr)) {\n                        int *samples = core->output_samples[spkr];\n                        for (int n = 0; n < nsamples; n++)\n                            samples[n] = mul16(samples[n], scale_inv);\n                    }\n                }\n            }\n\n            // Undo downmix\n            int *coeff_ptr = core->xxch_dmix_coeff;\n            for (int ch = xch_base; ch < core->nchannels; ch++) {\n                int spkr1 = map_prm_ch_to_spkr(core, ch);\n                if (spkr1 < 0)\n                    return -DCADEC_EINVAL;\n                for (int spkr2 = 0; spkr2 < core->xxch_mask_nbits; spkr2++) {\n                    if (core->xxch_dmix_mask[ch - xch_base] & (1U << spkr2)) {\n                        int coeff = mul16(*coeff_ptr++, scale_inv);\n                        if (coeff) {\n                            int *src = core->output_samples[spkr1];\n                            int *dst = core->output_samples[spkr2];\n                            for (int n = 0; n < nsamples; n++)\n                                dst[n] -= mul15(src[n], coeff);\n                        }\n                    }\n                }\n            }\n\n            // Clip core channels\n            for (int spkr = 0; spkr < core->xxch_mask_nbits; spkr++) {\n                if (core->xxch_core_mask & (1U << spkr)) {\n                    int *samples = core->output_samples[spkr];\n                    for (int n = 0; n < nsamples; n++)\n                        samples[n] = clip23(samples[n]);\n                }\n            }\n        }\n    }\n\n    if (!(core->ext_audio_mask & (CSS_XXCH | CSS_XCH | EXSS_XXCH))) {\n        int nsamples = core->npcmsamples;\n\n        // Front sum/difference decoding\n        if ((core->sumdiff_front && core->audio_mode > AMODE_MONO)\n            || core->audio_mode == AMODE_STEREO_SUMDIFF) {\n            int *samples_l = core->output_samples[SPEAKER_L];\n            int *samples_r = core->output_samples[SPEAKER_R];\n            for (int n = 0; n < nsamples; n++) {\n                int res1 = samples_l[n] + samples_r[n];\n                int res2 = samples_l[n] - samples_r[n];\n                samples_l[n] = clip23(res1);\n                samples_r[n] = clip23(res2);\n            }\n        }\n\n        // Surround sum/difference decoding\n        if (core->sumdiff_surround && core->audio_mode >= AMODE_2F2R) {\n            int *samples_ls = core->output_samples[SPEAKER_Ls];\n            int *samples_rs = core->output_samples[SPEAKER_Rs];\n            for (int n = 0; n < nsamples; n++) {\n                int res1 = samples_ls[n] + samples_rs[n];\n                int res2 = samples_ls[n] - samples_rs[n];\n                samples_ls[n] = clip23(res1);\n                samples_rs[n] = clip23(res2);\n            }\n        }\n    }\n\n    return 0;\n}\n\nstatic int parse_xch_frame(struct core_decoder *core)\n{\n    if (core->ch_mask & SPEAKER_MASK_Cs) {\n        core_err(\"XCH with Cs speaker already present\");\n        return -DCADEC_EBADDATA;\n    }\n\n    int ret;\n    if ((ret = parse_frame_data(core, HEADER_XCH, core->nchannels)) < 0)\n        return ret;\n\n    // Seek to the end of core frame, don't trust XCH frame size\n    return bits_seek(&core->bits, core->frame_size * 8);\n}\n\nstatic int parse_xxch_frame(struct core_decoder *core)\n{\n    int header_pos = core->bits.index;\n\n    // XXCH sync word\n    if (bits_get(&core->bits, 32) != SYNC_WORD_XXCH) {\n        core_err(\"Invalid XXCH sync word\");\n        return -DCADEC_ENOSYNC;\n    }\n\n    // XXCH frame header length\n    int header_size = bits_get(&core->bits, 6) + 1;\n\n    // Check XXCH frame header CRC\n    int ret;\n    if ((ret = bits_check_crc(&core->bits, header_pos + 32, header_pos + header_size * 8)) < 0) {\n        core_err(\"Invalid XXCH frame header checksum\");\n        return ret;\n    }\n\n    // CRC presence flag for channel set header\n    core->xxch_crc_present = bits_get1(&core->bits);\n\n    // Number of bits for loudspeaker mask\n    core->xxch_mask_nbits = bits_get(&core->bits, 5) + 1;\n    if (core->xxch_mask_nbits <= SPEAKER_Cs) {\n        core_err(\"Invalid number of bits for XXCH speaker mask (%d)\", core->xxch_mask_nbits);\n        return -DCADEC_EBADDATA;\n    }\n\n    // Number of channel sets\n    int xxch_nchsets = bits_get(&core->bits, 2) + 1;\n    if (xxch_nchsets > 1) {\n        core_err_once(\"Unsupported number of XXCH channel sets (%d)\", xxch_nchsets);\n        return -DCADEC_ENOSUP;\n    }\n\n    // Channel set 0 data byte size\n    int xxch_frame_size = bits_get(&core->bits, 14) + 1;\n\n    // Core loudspeaker activity mask\n    core->xxch_core_mask = bits_get(&core->bits, core->xxch_mask_nbits);\n\n    // Validate the core mask\n    int mask = core->ch_mask;\n\n    if ((mask & SPEAKER_MASK_Ls) && (core->xxch_core_mask & SPEAKER_MASK_Lss))\n        mask = (mask & ~SPEAKER_MASK_Ls) | SPEAKER_MASK_Lss;\n\n    if ((mask & SPEAKER_MASK_Rs) && (core->xxch_core_mask & SPEAKER_MASK_Rss))\n        mask = (mask & ~SPEAKER_MASK_Rs) | SPEAKER_MASK_Rss;\n\n    if (mask != core->xxch_core_mask) {\n        core_err(\"XXCH core speaker activity mask (%#x) disagrees \"\n                 \"with core (%#x)\", core->xxch_core_mask, mask);\n        return -DCADEC_EBADDATA;\n    }\n\n    // Reserved\n    // Byte align\n    // CRC16 of XXCH frame header\n    if ((ret = bits_seek(&core->bits, header_pos + header_size * 8)) < 0) {\n        core_err(\"Read past end of XXCH frame header\");\n        return ret;\n    }\n\n    // Parse XXCH channel set 0\n    if ((ret = parse_frame_data(core, HEADER_XXCH, core->nchannels)) < 0)\n        return ret;\n\n    if ((ret = bits_seek(&core->bits, header_pos + header_size * 8 + xxch_frame_size * 8)) < 0)\n        core_err(\"Read past end of XXCH channel set\");\n    return ret;\n}\n\nstatic int parse_xbr_subframe(struct core_decoder *core, int xbr_base_ch, int xbr_nchannels,\n                              int *xbr_nsubbands, bool xbr_transition_mode, int sf, int *sub_pos)\n{\n    int     xbr_nabits[MAX_CHANNELS];\n    int     xbr_bit_allocation[MAX_CHANNELS][MAX_SUBBANDS];\n    int     xbr_scale_nbits[MAX_CHANNELS];\n    int     xbr_scale_factors[MAX_CHANNELS][MAX_SUBBANDS][2];\n    int     ssf, ch, band, ofs;\n\n    // Number of subband samples in this subframe\n    int nsamples = core->nsubsubframes[sf] * NUM_SUBBAND_SAMPLES;\n    if (*sub_pos + nsamples > core->npcmblocks) {\n        core_err(\"Subband sample buffer overflow\");\n        return -DCADEC_EBADDATA;\n    }\n\n    // Number of bits for XBR bit allocation index\n    for (ch = xbr_base_ch; ch < xbr_nchannels; ch++)\n        xbr_nabits[ch] = bits_get(&core->bits, 2) + 2;\n\n    // XBR bit allocation index\n    for (ch = xbr_base_ch; ch < xbr_nchannels; ch++)\n        for (band = 0; band < xbr_nsubbands[ch]; band++)\n            xbr_bit_allocation[ch][band] = bits_get(&core->bits, xbr_nabits[ch]);\n\n    // Number of bits for scale indices\n    for (ch = xbr_base_ch; ch < xbr_nchannels; ch++) {\n        xbr_scale_nbits[ch] = bits_get(&core->bits, 3);\n        if (!xbr_scale_nbits[ch]) {\n            core_err(\"Invalid number of bits for XBR scale factor index\");\n            return -DCADEC_EBADDATA;\n        }\n    }\n\n    // XBR scale factors\n    for (ch = xbr_base_ch; ch < xbr_nchannels; ch++) {\n        // Select the root square table\n        const int32_t *scale_table;\n        size_t scale_size;\n        if (core->scale_factor_sel[ch] > 5) {\n            scale_table = scale_factors_7bit;\n            scale_size = dca_countof(scale_factors_7bit);\n        } else {\n            scale_table = scale_factors_6bit;\n            scale_size = dca_countof(scale_factors_6bit);\n        }\n\n        // Parse scale factor indices\n        // Look up scale factors from the root square table\n        for (band = 0; band < xbr_nsubbands[ch]; band++) {\n            if (xbr_bit_allocation[ch][band] > 0) {\n                unsigned int scale_index = bits_get(&core->bits, xbr_scale_nbits[ch]);\n                if (scale_index >= scale_size) {\n                    core_err(\"Invalid XBR scale factor index\");\n                    return -DCADEC_EBADDATA;\n                }\n                xbr_scale_factors[ch][band][0] = scale_table[scale_index];\n                if (xbr_transition_mode && core->transition_mode[sf][ch][band]) {\n                    scale_index = bits_get(&core->bits, xbr_scale_nbits[ch]);\n                    if (scale_index >= scale_size) {\n                        core_err(\"Invalid XBR scale factor index\");\n                        return -DCADEC_EBADDATA;\n                    }\n                    xbr_scale_factors[ch][band][1] = scale_table[scale_index];\n                }\n            }\n        }\n    }\n\n    // Audio data\n    for (ssf = 0, ofs = *sub_pos; ssf < core->nsubsubframes[sf]; ssf++) {\n        for (ch = xbr_base_ch; ch < xbr_nchannels; ch++) {\n            for (band = 0; band < xbr_nsubbands[ch]; band++) {\n                int abits = xbr_bit_allocation[ch][band];\n                int audio[NUM_SUBBAND_SAMPLES];\n                int ret, step_size, trans_ssf, scale;\n\n                // Extract bits from the bit stream\n                if (abits > 7) {\n                    // No further encoding\n                    bits_get_signed_array(&core->bits, audio, NUM_SUBBAND_SAMPLES, abits - 3);\n                } else if (abits > 0) {\n                    // Block codes\n                    if ((ret = parse_block_codes(core, audio, abits)) < 0)\n                        return ret;\n                } else {\n                    // No bits allocated\n                    continue;\n                }\n\n                // Look up quantization step size\n                step_size = step_size_lossless[abits];\n\n                // Identify transient location\n                if (xbr_transition_mode)\n                    trans_ssf = core->transition_mode[sf][ch][band];\n                else\n                    trans_ssf = 0;\n\n                // Determine proper scale factor\n                if (trans_ssf == 0 || ssf < trans_ssf)\n                    scale = xbr_scale_factors[ch][band][0];\n                else\n                    scale = xbr_scale_factors[ch][band][1];\n\n                dequantize(core->subband_samples[ch][band] + ofs,\n                           audio, step_size, scale, true);\n            }\n        }\n\n        // DSYNC\n        if ((ssf == core->nsubsubframes[sf] - 1 || core->sync_ssf)\n            && bits_get(&core->bits, 16) != 0xffff) {\n            core_err(\"XBR-DSYNC check failed\");\n            return -DCADEC_EBADDATA;\n        }\n\n        ofs += NUM_SUBBAND_SAMPLES;\n    }\n\n    // Advance subband sample pointer for the next subframe\n    *sub_pos += nsamples;\n    return 0;\n}\n\nstatic int parse_xbr_frame(struct core_decoder *core)\n{\n    int     xbr_frame_size[MAX_EXSS_CHSETS];\n    int     xbr_nchannels[MAX_EXSS_CHSETS];\n    int     xbr_nsubbands[MAX_EXSS_CHSETS * MAX_CHANNELS_CHSET];\n\n    int header_pos = core->bits.index;\n\n    // XBR sync word\n    if (bits_get(&core->bits, 32) != SYNC_WORD_XBR) {\n        core_err(\"Invalid XBR sync word\");\n        return -DCADEC_ENOSYNC;\n    }\n\n    // XBR frame header length\n    int header_size = bits_get(&core->bits, 6) + 1;\n\n    // Check XBR frame header CRC\n    int ret;\n    if ((ret = bits_check_crc(&core->bits, header_pos + 32, header_pos + header_size * 8)) < 0) {\n        core_err(\"Invalid XBR frame header checksum\");\n        return ret;\n    }\n\n    // Number of channel sets\n    int xbr_nchsets = bits_get(&core->bits, 2) + 1;\n\n    // Channel set data byte size\n    for (int i = 0; i < xbr_nchsets; i++)\n        xbr_frame_size[i] = bits_get(&core->bits, 14) + 1;\n\n    // Transition mode flag\n    bool xbr_transition_mode = bits_get1(&core->bits);\n\n    // Channel set headers\n    for (int i = 0, ch2 = 0; i < xbr_nchsets; i++) {\n        xbr_nchannels[i] = bits_get(&core->bits, 3) + 1;\n        int xbr_band_nbits = bits_get(&core->bits, 2) + 5;\n        for (int ch1 = 0; ch1 < xbr_nchannels[i]; ch1++, ch2++) {\n            xbr_nsubbands[ch2] = bits_get(&core->bits, xbr_band_nbits) + 1;\n            if (xbr_nsubbands[ch2] > MAX_SUBBANDS) {\n                core_err(\"Invalid number of active XBR subbands (%d)\", xbr_nsubbands[ch2]);\n                return -DCADEC_EBADDATA;\n            }\n        }\n    }\n\n    // Reserved\n    // Byte align\n    // CRC16 of XBR frame header\n    if ((ret = bits_seek(&core->bits, header_pos + header_size * 8)) < 0) {\n        core_err(\"Read past end of XBR frame header\");\n        return ret;\n    }\n\n    // Channel set data\n    int xbr_base_ch = 0;\n    for (int i = 0; i < xbr_nchsets; i++) {\n        header_pos = core->bits.index;\n\n        if (xbr_base_ch + xbr_nchannels[i] <= core->nchannels) {\n            int sub_pos = 0;\n            for (int sf = 0; sf < core->nsubframes; sf++) {\n                if ((ret = parse_xbr_subframe(core, xbr_base_ch,\n                                              xbr_base_ch + xbr_nchannels[i],\n                                              xbr_nsubbands, xbr_transition_mode,\n                                              sf, &sub_pos)) < 0)\n                    return ret;\n            }\n        }\n\n        xbr_base_ch += xbr_nchannels[i];\n\n        if ((ret = bits_seek(&core->bits, header_pos + xbr_frame_size[i] * 8)) < 0) {\n            core_err(\"Read past end of XBR channel set\");\n            return ret;\n        }\n    }\n\n    return 0;\n}\n\n// Modified ISO/IEC 9899 linear congruential generator\n// Returns pseudorandom integer in range [-2^30, 2^30 - 1]\nstatic int rand_x96(struct core_decoder *core)\n{\n    core->x96_rand = 1103515245U * core->x96_rand + 12345U;\n    return (core->x96_rand & 0x7fffffff) - 0x40000000;\n}\n\nstatic int parse_x96_subframe_audio(struct core_decoder *core, int sf, int xch_base, int *sub_pos)\n{\n    int ssf, ch, band, ofs;\n\n    // Number of subband samples in this subframe\n    int nsamples = core->nsubsubframes[sf] * NUM_SUBBAND_SAMPLES;\n    if (*sub_pos + nsamples > core->npcmblocks) {\n        core_err(\"Subband sample buffer overflow\");\n        return -DCADEC_EBADDATA;\n    }\n\n    // VQ encoded or unallocated subbands\n    for (ch = xch_base; ch < core->x96_nchannels; ch++) {\n        for (band = core->x96_subband_start; band < core->nsubbands[ch]; band++) {\n            // Get the sample pointer\n            int *samples = core->x96_subband_samples[ch][band] + *sub_pos;\n\n            // Get the scale factor\n            int scale = core->x96_scale_factors[ch][band];\n\n            int abits = core->bit_allocation[ch][band];\n            if (abits == 0) {   // No bits allocated for subband\n                if (scale <= 1) {\n                    memset(samples, 0, nsamples * sizeof(int));\n                } else {\n                    // Generate scaled random samples as required by specification\n                    for (int n = 0; n < nsamples; n++)\n                        samples[n] = mul31(rand_x96(core), scale);\n                }\n            } else if (abits == 1) {    // VQ encoded subband\n                for (ssf = 0; ssf < (core->nsubsubframes[sf] + 1) / 2; ssf++) {\n                    // Extract the VQ address from the bit stream\n                    int vq_index = bits_get(&core->bits, 10);\n\n                    // Look up the VQ code book for up to 16 subband samples\n                    const int8_t *vq_samples = high_freq_samples[vq_index];\n\n                    // Number of VQ samples to look up\n                    int vq_nsamples = DCA_MIN(nsamples - ssf * 16, 16);\n\n                    // Scale and take the samples\n                    for (int n = 0; n < vq_nsamples; n++)\n                        *samples++ = clip23(mul4(scale, vq_samples[n]));\n                }\n            }\n        }\n    }\n\n    // Audio data\n    for (ssf = 0, ofs = *sub_pos; ssf < core->nsubsubframes[sf]; ssf++) {\n        for (ch = xch_base; ch < core->x96_nchannels; ch++) {\n            for (band = core->x96_subband_start; band < core->nsubbands[ch]; band++) {\n                int abits = core->bit_allocation[ch][band] - 1;\n                int audio[NUM_SUBBAND_SAMPLES];\n                int ret, step_size, scale;\n\n                // Not VQ encoded or unallocated subbands\n                if (abits < 1)\n                    continue;\n\n                // Extract bits from the bit stream\n                if ((ret = extract_audio(core, audio, abits, ch)) < 0)\n                    return ret;\n\n                // Select quantization step size table\n                // Look up quantization step size\n                if (core->bit_rate == -2)\n                    step_size = step_size_lossless[abits];\n                else\n                    step_size = step_size_lossy[abits];\n\n                // Determine proper scale factor\n                scale = core->x96_scale_factors[ch][band];\n\n                dequantize(core->x96_subband_samples[ch][band] + ofs,\n                           audio, step_size, scale, false);\n            }\n        }\n\n        // DSYNC\n        if ((ssf == core->nsubsubframes[sf] - 1 || core->sync_ssf)\n            && bits_get(&core->bits, 16) != 0xffff) {\n            core_err(\"X96-DSYNC check failed\");\n            return -DCADEC_EBADDATA;\n        }\n\n        ofs += NUM_SUBBAND_SAMPLES;\n    }\n\n    // Inverse ADPCM\n    for (ch = xch_base; ch < core->x96_nchannels; ch++) {\n        for (band = core->x96_subband_start; band < core->nsubbands[ch]; band++) {\n            // Only if prediction mode is on\n            if (core->prediction_mode[ch][band]) {\n                int *samples = core->x96_subband_samples[ch][band] + *sub_pos;\n\n                // Extract the VQ index\n                int vq_index = core->prediction_vq_index[ch][band];\n\n                // Look up the VQ table for prediction coefficients\n                const int16_t *vq_coeffs = adpcm_coeffs[vq_index];\n                for (int m = 0; m < nsamples; m++) {\n                    int64_t err = INT64_C(0);\n                    for (int n = 0; n < NUM_ADPCM_COEFFS; n++)\n                        err += (int64_t)samples[m - n - 1] * vq_coeffs[n];\n                    samples[m] = clip23(samples[m] + clip23(norm13(err)));\n                }\n            }\n        }\n    }\n\n    // Joint subband coding\n    for (ch = xch_base; ch < core->x96_nchannels; ch++) {\n        // Only if joint subband coding is enabled\n        if (core->joint_intensity_index[ch]) {\n            // Get source channel\n            int src_ch = core->joint_intensity_index[ch] - 1;\n            for (band = core->nsubbands[ch]; band < core->nsubbands[src_ch]; band++) {\n                int *src = core->x96_subband_samples[src_ch][band] + *sub_pos;\n                int *dst = core->x96_subband_samples[    ch][band] + *sub_pos;\n                int scale = core->joint_scale_factors[ch][band];\n                for (int n = 0; n < nsamples; n++)\n                    dst[n] = clip23(mul17(src[n], scale));\n            }\n        }\n    }\n\n    // Advance subband sample pointer for the next subframe\n    *sub_pos += nsamples;\n    return 0;\n}\n\nstatic void erase_x96_adpcm_history(struct core_decoder *core)\n{\n    // Erase ADPCM history from previous frame if\n    // predictor history switch was disabled\n    for (int ch = 0; ch < MAX_CHANNELS; ch++)\n        for (int band = 0; band < MAX_SUBBANDS_X96; band++)\n            memset(core->x96_subband_samples[ch][band] - NUM_ADPCM_COEFFS, 0, NUM_ADPCM_COEFFS * sizeof(int));\n}\n\nstatic int alloc_x96_sample_buffer(struct core_decoder *core)\n{\n    int nchsamples = NUM_ADPCM_COEFFS + core->npcmblocks;\n    int nframesamples = nchsamples * MAX_CHANNELS * MAX_SUBBANDS_X96;\n\n    // Reallocate subband sample buffer\n    int ret;\n    if ((ret = ta_zalloc_fast(core, &core->x96_subband_buffer, nframesamples, sizeof(int))) < 0)\n        return -DCADEC_ENOMEM;\n    if (ret > 0) {\n        for (int ch = 0; ch < MAX_CHANNELS; ch++)\n            for (int band = 0; band < MAX_SUBBANDS_X96; band++)\n                core->x96_subband_samples[ch][band] = core->x96_subband_buffer +\n                    (ch * MAX_SUBBANDS_X96 + band) * nchsamples + NUM_ADPCM_COEFFS;\n    }\n\n    if (!core->predictor_history)\n        erase_x96_adpcm_history(core);\n\n    return 0;\n}\n\nstatic int parse_x96_subframe_header(struct core_decoder *core, int xch_base)\n{\n    int ch, band, ret;\n\n    // Prediction mode\n    for (ch = xch_base; ch < core->x96_nchannels; ch++)\n        for (band = core->x96_subband_start; band < core->nsubbands[ch]; band++)\n            core->prediction_mode[ch][band] = bits_get1(&core->bits);\n\n    // Prediction coefficients VQ address\n    for (ch = xch_base; ch < core->x96_nchannels; ch++)\n        for (band = core->x96_subband_start; band < core->nsubbands[ch]; band++)\n            if (core->prediction_mode[ch][band])\n                core->prediction_vq_index[ch][band] = bits_get(&core->bits, 12);\n\n    // Bit allocation index\n    for (ch = xch_base; ch < core->x96_nchannels; ch++) {\n        // Select codebook\n        int sel = core->bit_allocation_sel[ch];\n\n        const struct huffman *huff;\n        unsigned int abits_max;\n\n        // Reuse quantization index code books for bit allocation index\n        if (core->x96_high_res) {\n            huff = &quant_index_huff_7[sel];\n            abits_max = 15;\n        } else {\n            huff = &quant_index_huff_5[sel];\n            abits_max = 7;\n        }\n\n        // Clear accumulation\n        int abits = 0;\n\n        for (band = core->x96_subband_start; band < core->nsubbands[ch]; band++) {\n            if (sel < 7)\n                // If Huffman code was used, the difference of abits was encoded\n                abits += bits_get_signed_vlc(&core->bits, huff);\n            else\n                abits = bits_get(&core->bits, 3 + core->x96_high_res);\n\n            if ((unsigned int)abits > abits_max) {\n                core_err(\"Invalid X96 bit allocation index\");\n                return -DCADEC_EBADDATA;\n            }\n\n            core->bit_allocation[ch][band] = abits;\n        }\n    }\n\n    // Scale factors\n    for (ch = xch_base; ch < core->x96_nchannels; ch++) {\n        // Select codebook\n        int sel = core->scale_factor_sel[ch];\n\n        // Clear accumulation\n        int scale_index = 0;\n\n        // Extract scales for subbands\n        // Transmitted even for unallocated subbands\n        for (band = core->x96_subband_start; band < core->nsubbands[ch]; band++) {\n            if ((ret = parse_scale(core, &scale_index, sel)) < 0)\n                return ret;\n            core->x96_scale_factors[ch][band] = ret;\n        }\n    }\n\n    // Joint subband codebook select\n    for (ch = xch_base; ch < core->x96_nchannels; ch++) {\n        // Only if joint subband coding is enabled\n        if (core->joint_intensity_index[ch]) {\n            core->joint_scale_sel[ch] = bits_get(&core->bits, 3);\n            if (core->joint_scale_sel[ch] == 7) {\n                core_err(\"Invalid X96 joint scale factor code book\");\n                return -DCADEC_EBADDATA;\n            }\n        }\n    }\n\n    // Scale factors for joint subband coding\n    for (ch = xch_base; ch < core->x96_nchannels; ch++) {\n        // Only if joint subband coding is enabled\n        if (core->joint_intensity_index[ch]) {\n            // Select codebook\n            int sel = core->joint_scale_sel[ch];\n            // Get source channel\n            int src_ch = core->joint_intensity_index[ch] - 1;\n            for (band = core->nsubbands[ch]; band < core->nsubbands[src_ch]; band++) {\n                if ((ret = parse_joint_scale(core, sel)) < 0)\n                    return ret;\n                core->joint_scale_factors[ch][band] = ret;\n            }\n        }\n    }\n\n    // Side information CRC check word\n    if (core->crc_present)\n        bits_skip(&core->bits, 16);\n\n    return 0;\n}\n\nstatic int parse_x96_coding_header(struct core_decoder *core, bool exss, int xch_base)\n{\n    int ch, n, ret, header_size = 0, header_pos = core->bits.index;\n\n    if (exss) {\n        // Channel set header length\n        header_size = bits_get(&core->bits, 7) + 1;\n\n        // Check CRC\n        if (core->x96_crc_present && (ret = bits_check_crc(&core->bits, header_pos, header_pos + header_size * 8)) < 0) {\n            core_err(\"Invalid X96 channel set header checksum\");\n            return ret;\n        }\n    }\n\n    // High resolution flag\n    core->x96_high_res = bits_get1(&core->bits);\n\n    // First encoded subband\n    if (core->x96_rev_no < 8) {\n        core->x96_subband_start = bits_get(&core->bits, 5);\n        if (core->x96_subband_start > 27) {\n            core_err(\"Invalid X96 subband start index (%d)\", core->x96_subband_start);\n            return -DCADEC_EBADDATA;\n        }\n    } else {\n        core->x96_subband_start = MAX_SUBBANDS;\n    }\n\n    // Subband activity count\n    for (ch = xch_base; ch < core->x96_nchannels; ch++) {\n        core->nsubbands[ch] = bits_get(&core->bits, 6) + 1;\n        if (core->nsubbands[ch] < MAX_SUBBANDS) {\n            core_err(\"Invalid X96 subband activity count (%d)\", core->nsubbands[ch]);\n            return -DCADEC_EBADDATA;\n        }\n    }\n\n    // Joint intensity coding index\n    for (ch = xch_base; ch < core->x96_nchannels; ch++) {\n        if ((n = bits_get(&core->bits, 3)) && xch_base)\n            n += xch_base - 1;\n        if (n > core->x96_nchannels) {\n            core_err(\"Invalid X96 joint intensity coding index\");\n            return -DCADEC_EBADDATA;\n        }\n        core->joint_intensity_index[ch] = n;\n    }\n\n    // Scale factor code book\n    for (ch = xch_base; ch < core->x96_nchannels; ch++) {\n        core->scale_factor_sel[ch] = bits_get(&core->bits, 3);\n        if (core->scale_factor_sel[ch] >= 6) {\n            core_err(\"Invalid X96 scale factor code book\");\n            return -DCADEC_EBADDATA;\n        }\n    }\n\n    // Bit allocation quantizer select\n    for (ch = xch_base; ch < core->x96_nchannels; ch++)\n        core->bit_allocation_sel[ch] = bits_get(&core->bits, 3);\n\n    // Quantization index codebook select\n    for (n = 0; n < 6 + 4 * core->x96_high_res; n++)\n        for (ch = xch_base; ch < core->x96_nchannels; ch++)\n            core->quant_index_sel[ch][n] = bits_get(&core->bits, quant_index_sel_nbits[n]);\n\n    if (exss) {\n        // Reserved\n        // Byte align\n        // CRC16 of channel set header\n        if ((ret = bits_seek(&core->bits, header_pos + header_size * 8)) < 0) {\n            core_err(\"Read past end of X96 channel set header\");\n            return ret;\n        }\n    } else {\n        if (core->crc_present)\n            bits_skip(&core->bits, 16);\n    }\n\n    return 0;\n}\n\nstatic int parse_x96_frame_data(struct core_decoder *core, bool exss, int xch_base)\n{\n    int ret;\n    if ((ret = parse_x96_coding_header(core, exss, xch_base)) < 0)\n        return ret;\n\n    int sub_pos = 0;\n    for (int sf = 0; sf < core->nsubframes; sf++) {\n        if ((ret = parse_x96_subframe_header(core, xch_base)) < 0)\n            return ret;\n        if ((ret = parse_x96_subframe_audio(core, sf, xch_base, &sub_pos)) < 0)\n            return ret;\n    }\n\n    for (int ch = xch_base; ch < core->x96_nchannels; ch++) {\n        // Number of active subbands for this channel\n        int nsubbands = core->nsubbands[ch];\n        if (core->joint_intensity_index[ch])\n            nsubbands = DCA_MAX(nsubbands, core->nsubbands[core->joint_intensity_index[ch] - 1]);\n\n        // Update history for ADPCM\n        // Clear inactive subbands\n        for (int band = 0; band < MAX_SUBBANDS_X96; band++) {\n            int *samples = core->x96_subband_samples[ch][band] - NUM_ADPCM_COEFFS;\n            if (band >= core->x96_subband_start && band < nsubbands)\n                memcpy(samples, samples + core->npcmblocks, NUM_ADPCM_COEFFS * sizeof(int));\n            else\n                memset(samples, 0, (NUM_ADPCM_COEFFS + core->npcmblocks) * sizeof(int));\n        }\n    }\n\n    return 0;\n}\n\nstatic int parse_x96_frame(struct core_decoder *core)\n{\n    // Revision number\n    core->x96_rev_no = bits_get(&core->bits, 4);\n    if (core->x96_rev_no < 1 || core->x96_rev_no > 8) {\n        core_err_once(\"Unsupported X96 revision (%d)\", core->x96_rev_no);\n        return -DCADEC_ENOSUP;\n    }\n\n    core->x96_crc_present = false;\n    core->x96_nchannels = core->nchannels;\n\n    int ret;\n    if ((ret = alloc_x96_sample_buffer(core)) < 0)\n        return ret;\n\n    if ((ret = parse_x96_frame_data(core, false, 0)) < 0)\n        return ret;\n\n    // Seek to the end of core frame\n    return bits_seek(&core->bits, core->frame_size * 8);\n}\n\nstatic int parse_x96_frame_exss(struct core_decoder *core)\n{\n    int     x96_frame_size[MAX_EXSS_CHSETS];\n    int     x96_nchannels[MAX_EXSS_CHSETS];\n\n    int header_pos = core->bits.index;\n\n    // X96 sync word\n    if (bits_get(&core->bits, 32) != SYNC_WORD_X96) {\n        core_err(\"Invalid X96 sync word\");\n        return -DCADEC_ENOSYNC;\n    }\n\n    // X96 frame header length\n    int header_size = bits_get(&core->bits, 6) + 1;\n\n    // Check X96 frame header CRC\n    int ret;\n    if ((ret = bits_check_crc(&core->bits, header_pos + 32, header_pos + header_size * 8)) < 0) {\n        core_err(\"Invalid X96 frame header checksum\");\n        return ret;\n    }\n\n    // Revision number\n    core->x96_rev_no = bits_get(&core->bits, 4);\n    if (core->x96_rev_no < 1 || core->x96_rev_no > 8) {\n        core_err_once(\"Unsupported X96 revision (%d)\", core->x96_rev_no);\n        return -DCADEC_ENOSUP;\n    }\n\n    // CRC presence flag for channel set header\n    core->x96_crc_present = bits_get1(&core->bits);\n\n    // Number of channel sets\n    int x96_nchsets = bits_get(&core->bits, 2) + 1;\n\n    // Channel set data byte size\n    for (int i = 0; i < x96_nchsets; i++)\n        x96_frame_size[i] = bits_get(&core->bits, 12) + 1;\n\n    // Number of channels in channel set\n    for (int i = 0; i < x96_nchsets; i++)\n        x96_nchannels[i] = bits_get(&core->bits, 3) + 1;\n\n    // Reserved\n    // Byte align\n    // CRC16 of X96 frame header\n    if ((ret = bits_seek(&core->bits, header_pos + header_size * 8)) < 0) {\n        core_err(\"Read past end of X96 frame header\");\n        return ret;\n    }\n\n    if ((ret = alloc_x96_sample_buffer(core)) < 0)\n        return ret;\n\n    core->x96_nchannels = 0;\n\n    // Channel set data\n    int x96_base_ch = 0;\n    for (int i = 0; i < x96_nchsets; i++) {\n        header_pos = core->bits.index;\n\n        if (x96_base_ch + x96_nchannels[i] <= core->nchannels) {\n            core->x96_nchannels = x96_base_ch + x96_nchannels[i];\n            if ((ret = parse_x96_frame_data(core, true, x96_base_ch)) < 0)\n                return ret;\n        }\n\n        x96_base_ch += x96_nchannels[i];\n\n        if ((ret = bits_seek(&core->bits, header_pos + x96_frame_size[i] * 8)) < 0) {\n            core_err(\"Read past end of X96 channel set\");\n            return ret;\n        }\n    }\n\n    return 0;\n}\n\nstatic int parse_aux_data(struct core_decoder *core)\n{\n    // Auxiliary data byte count (can't be trusted)\n    bits_skip(&core->bits, 6);\n\n    // 4-byte align\n    int aux_pos = bits_align4(&core->bits);\n\n    // Auxiliary data sync word\n    uint32_t sync = bits_get(&core->bits, 32);\n    if (sync != SYNC_WORD_REV1AUX) {\n        core_err(\"Invalid auxiliary data sync word (%#x)\", sync);\n        return -DCADEC_ENOSYNC;\n    }\n\n    // Auxiliary decode time stamp flag\n    if (bits_get1(&core->bits)) {\n        bits_skip(&core->bits,  3); // 4-bit align\n        bits_skip(&core->bits,  8); // MSB\n        bits_skip(&core->bits,  4); // Marker\n        bits_skip(&core->bits, 28); // LSB\n        bits_skip(&core->bits,  4); // Marker\n    }\n\n    // Auxiliary dynamic downmix flag\n    core->prim_dmix_embedded = bits_get1(&core->bits);\n\n    if (core->prim_dmix_embedded) {\n        // Auxiliary primary channel downmix type\n        core->prim_dmix_type = bits_get(&core->bits, 3);\n        if (core->prim_dmix_type >= DMIX_TYPE_COUNT) {\n            core_err(\"Invalid primary channel set downmix type\");\n            return -DCADEC_EBADDATA;\n        }\n\n        // Size of downmix coefficients matrix\n        int m = dmix_primary_nch[core->prim_dmix_type];\n        int n = audio_mode_nch[core->audio_mode] + !!core->lfe_present;\n\n        // Dynamic downmix code coefficients\n        int *coeff_ptr = core->prim_dmix_coeff;\n        for (int i = 0; i < m * n; i++) {\n            int code = bits_get(&core->bits, 9);\n            int sign = (code >> 8) - 1;\n            if (code &= 0xff) {\n                unsigned int index = code - 1;\n                if (index >= dca_countof(dmix_table)) {\n                    core_err(\"Invalid downmix coefficient index\");\n                    return -DCADEC_EBADDATA;\n                }\n                *coeff_ptr++ = (dmix_table[index] ^ sign) - sign;\n            } else {\n                *coeff_ptr++ = 0;\n            }\n        }\n    }\n\n    // Byte align\n    bits_align1(&core->bits);\n\n    // CRC16 of auxiliary data\n    bits_skip(&core->bits, 16);\n\n    // Check CRC\n    int ret;\n    if ((ret = bits_check_crc(&core->bits, aux_pos + 32, core->bits.index)) < 0)\n        core_err(\"Invalid auxiliary data checksum\");\n    return ret;\n}\n\n#define CHECK_SYNC(pos, msg) \\\n    if (!pos) { \\\n        if (flags & DCADEC_FLAG_STRICT) { \\\n            core_err(msg); \\\n            return -DCADEC_ENOSYNC; \\\n        } \\\n        core_warn_once(msg); \\\n        status = DCADEC_WCOREEXTFAILED; \\\n    }\n\nstatic int parse_optional_info(struct core_decoder *core, int flags)\n{\n    int status = 0;\n\n    // Time code stamp\n    if (core->ts_present)\n        bits_skip(&core->bits, 32);\n\n    // Auxiliary data\n    if (core->aux_present && (flags & DCADEC_FLAG_KEEP_DMIX_2CH)) {\n        int ret;\n        if ((ret = parse_aux_data(core)) < 0) {\n            if (flags & DCADEC_FLAG_STRICT)\n                return ret;\n            status = DCADEC_WCOREAUXFAILED;\n            core->prim_dmix_embedded = false;\n        }\n    } else {\n        core->prim_dmix_embedded = false;\n    }\n\n    // Core extensions\n    if (core->ext_audio_present && !(flags & DCADEC_FLAG_CORE_ONLY)) {\n        int sync_pos = DCA_MIN(core->frame_size / 4, core->bits.total / 32) - 1;\n        int last_pos = core->bits.index / 32;\n\n        // Search for extension sync words aligned on 4-byte boundary\n        switch (core->ext_audio_type) {\n        case EXT_AUDIO_XCH:\n            if (flags & DCADEC_FLAG_KEEP_DMIX_MASK)\n                break;\n\n            // The distance between XCH sync word and end of the core frame\n            // must be equal to XCH frame size. Off by one error is allowed for\n            // compatibility with legacy bitstreams. Minimum XCH frame size is\n            // 96 bytes. AMODE and PCHS are further checked to reduce\n            // probability of alias sync detection.\n            for (; sync_pos >= last_pos; sync_pos--) {\n                if (core->bits.data[sync_pos] == DCA_32BE_C(SYNC_WORD_XCH)) {\n                    core->bits.index = (sync_pos + 1) * 32;\n                    int frame_size = bits_get(&core->bits, 10) + 1;\n                    int dist = core->frame_size - sync_pos * 4;\n                    if (frame_size >= 96\n                        && (frame_size == dist || frame_size - 1 == dist)\n                        && bits_get(&core->bits, 7) == 0x08) {\n                        core->xch_pos = core->bits.index;\n                        break;\n                    }\n                }\n            }\n\n            CHECK_SYNC(core->xch_pos, \"XCH sync word not found\")\n            break;\n\n        case EXT_AUDIO_X96:\n            // The distance between X96 sync word and end of the core frame\n            // must be equal to X96 frame size. Minimum X96 frame size is 96\n            // bytes.\n            for (; sync_pos >= last_pos; sync_pos--) {\n                if (core->bits.data[sync_pos] == DCA_32BE_C(SYNC_WORD_X96)) {\n                    core->bits.index = (sync_pos + 1) * 32;\n                    int frame_size = bits_get(&core->bits, 12) + 1;\n                    int dist = core->frame_size - sync_pos * 4;\n                    if (frame_size >= 96 && frame_size == dist) {\n                        core->x96_pos = core->bits.index;\n                        break;\n                    }\n                }\n            }\n\n            CHECK_SYNC(core->x96_pos, \"X96 sync word not found\")\n            break;\n\n        case EXT_AUDIO_XXCH:\n            if (flags & DCADEC_FLAG_KEEP_DMIX_MASK)\n                break;\n\n            // XXCH frame header CRC must be valid. Minimum XXCH frame header\n            // size is 11 bytes.\n            for (; sync_pos >= last_pos; sync_pos--) {\n                if (core->bits.data[sync_pos] == DCA_32BE_C(SYNC_WORD_XXCH)) {\n                    core->bits.index = (sync_pos + 1) * 32;\n                    int hdr_size = bits_get(&core->bits, 6) + 1;\n                    if (hdr_size >= 11 &&\n                        !bits_check_crc(&core->bits, (sync_pos + 1) * 32,\n                                        sync_pos * 32 + hdr_size * 8)) {\n                        core->xxch_pos = sync_pos * 32;\n                        break;\n                    }\n                }\n            }\n\n            CHECK_SYNC(core->xxch_pos, \"XXCH sync word not found\")\n            break;\n\n        default:\n            core_warn_once(\"Stream with unknown extended audio type (%d)\",\n                           core->ext_audio_type);\n            break;\n        }\n    }\n\n    return status;\n}\n\nint core_parse(struct core_decoder *core, uint8_t *data, int size,\n               int flags, struct exss_asset *asset)\n{\n    core->ext_audio_mask = 0;\n    core->xch_pos = core->xxch_pos = core->x96_pos = 0;\n\n    if (asset) {\n        bits_init(&core->bits, data + asset->core_offset, asset->core_size);\n        if (bits_get(&core->bits, 32) != SYNC_WORD_CORE_EXSS)\n            return -DCADEC_ENOSYNC;\n    } else {\n        bits_init(&core->bits, data, size);\n        bits_skip(&core->bits, 32);\n    }\n\n    int status = 0, ret;\n    if ((ret = parse_frame_header(core)) < 0)\n        return ret;\n    if ((ret = alloc_sample_buffer(core)) < 0)\n        return ret;\n    if ((ret = parse_frame_data(core, HEADER_CORE, 0)) < 0)\n        return ret;\n    if ((ret = parse_optional_info(core, flags)) < 0)\n        return ret;\n    if (ret > 0)\n        status = ret;\n\n    // Workaround for DTS in WAV\n    if (!asset && core->frame_size > size && core->frame_size < size + 4) {\n        core_warn_once(\"Stream with excessive core frame size\");\n        core->frame_size = size;\n    }\n\n    if ((ret = bits_seek(&core->bits, core->frame_size * 8)) < 0)\n        return ret;\n    return status;\n}\n\nint core_parse_exss(struct core_decoder *core, uint8_t *data,\n                    int flags, struct exss_asset *asset)\n{\n    struct bitstream temp = core->bits;\n    int exss_mask = asset ? asset->extension_mask : 0;\n    int status = 0, ret = 0, ext = 0;\n\n    // Parse (X)XCH unless downmixing\n    if (!(flags & DCADEC_FLAG_KEEP_DMIX_MASK)) {\n        if (exss_mask & EXSS_XXCH) {\n            bits_init(&core->bits, data + asset->xxch_offset, asset->xxch_size);\n            ret = parse_xxch_frame(core);\n            ext = EXSS_XXCH;\n        } else if (core->xxch_pos) {\n            core->bits.index = core->xxch_pos;\n            ret = parse_xxch_frame(core);\n            ext = CSS_XXCH;\n        } else if (core->xch_pos) {\n            core->bits.index = core->xch_pos;\n            ret = parse_xch_frame(core);\n            ext = CSS_XCH;\n        }\n\n        // Revert to primary channel set in case (X)XCH parsing fails\n        if (ret < 0) {\n            if (flags & DCADEC_FLAG_STRICT)\n                return ret;\n            status = DCADEC_WCOREEXTFAILED;\n            core->nchannels = audio_mode_nch[core->audio_mode];\n            core->ch_mask = audio_mode_ch_mask[core->audio_mode];\n            if (core->lfe_present)\n                core->ch_mask |= SPEAKER_MASK_LFE1;\n        } else {\n            core->ext_audio_mask |= ext;\n        }\n    }\n\n    // Parse XBR\n    if (exss_mask & EXSS_XBR) {\n        bits_init(&core->bits, data + asset->xbr_offset, asset->xbr_size);\n        if ((ret = parse_xbr_frame(core)) < 0) {\n            if (flags & DCADEC_FLAG_STRICT)\n                return ret;\n            status = DCADEC_WCOREEXTFAILED;\n        } else {\n            core->ext_audio_mask |= EXSS_XBR;\n        }\n    }\n\n    // Parse X96\n    if (exss_mask & EXSS_X96) {\n        bits_init(&core->bits, data + asset->x96_offset, asset->x96_size);\n        if ((ret = parse_x96_frame_exss(core)) < 0) {\n            if (flags & DCADEC_FLAG_STRICT)\n                return ret;\n            status = DCADEC_WCOREEXTFAILED;\n        } else {\n            core->ext_audio_mask |= EXSS_X96;\n        }\n    } else if (core->x96_pos) {\n        core->bits = temp;\n        core->bits.index = core->x96_pos;\n        if ((ret = parse_x96_frame(core)) < 0) {\n            if (flags & DCADEC_FLAG_STRICT)\n                return ret;\n            status = DCADEC_WCOREEXTFAILED;\n        } else {\n            core->ext_audio_mask |= CSS_X96;\n        }\n    }\n\n    return status;\n}\n\nvoid core_clear(struct core_decoder *core)\n{\n    if (core) {\n        if (core->subband_buffer) {\n            erase_adpcm_history(core);\n            memset(core->lfe_samples, 0, MAX_LFE_HISTORY * sizeof(int));\n        }\n        if (core->x96_subband_buffer)\n            erase_x96_adpcm_history(core);\n        for (int ch = 0; ch < MAX_CHANNELS; ch++)\n            interpolator_clear(core->subband_dsp[ch]);\n        core->output_history_lfe = 0;\n    }\n}\n\nstruct dcadec_core_info *core_get_info(struct core_decoder *core)\n{\n    struct dcadec_core_info *info = ta_znew(NULL, struct dcadec_core_info);\n    if (!info)\n        return NULL;\n    info->nchannels = audio_mode_nch[core->audio_mode];\n    info->audio_mode = core->audio_mode;\n    info->lfe_present = core->lfe_present;\n    info->sample_rate = core->sample_rate;\n    info->source_pcm_res = core->source_pcm_res;\n    info->es_format = core->es_format;\n    info->bit_rate = core->bit_rate;\n    info->npcmblocks = core->npcmblocks;\n    info->ext_audio_present = core->ext_audio_present;\n    info->ext_audio_type = core->ext_audio_type;\n    return info;\n}\n\nstatic int make_spkr_pair_mask(int mask1)\n{\n    int mask2 = 0;\n\n#define MAP(m1, m2)  if ((mask1 & (m1)) == (m1))    mask2 |= (m2);\n    MAP(SPEAKER_MASK_C,                         SPEAKER_PAIR_C)\n    MAP(SPEAKER_MASK_L   | SPEAKER_MASK_R,      SPEAKER_PAIR_LR)\n    MAP(SPEAKER_MASK_Ls  | SPEAKER_MASK_Rs,     SPEAKER_PAIR_LsRs)\n    MAP(SPEAKER_MASK_LFE1,                      SPEAKER_PAIR_LFE1)\n    MAP(SPEAKER_MASK_Cs,                        SPEAKER_PAIR_Cs)\n    MAP(SPEAKER_MASK_Lh  | SPEAKER_MASK_Rh,     SPEAKER_PAIR_LhRh)\n    MAP(SPEAKER_MASK_Lsr | SPEAKER_MASK_Rsr,    SPEAKER_PAIR_LsrRsr)\n    MAP(SPEAKER_MASK_Ch,                        SPEAKER_PAIR_Ch)\n    MAP(SPEAKER_MASK_Oh,                        SPEAKER_PAIR_Oh)\n    MAP(SPEAKER_MASK_Lc  | SPEAKER_MASK_Rc,     SPEAKER_PAIR_LcRc)\n    MAP(SPEAKER_MASK_Lw  | SPEAKER_MASK_Rw,     SPEAKER_PAIR_LwRw)\n    MAP(SPEAKER_MASK_Lss | SPEAKER_MASK_Rss,    SPEAKER_PAIR_LssRss)\n    MAP(SPEAKER_MASK_LFE2,                      SPEAKER_PAIR_LFE2)\n    MAP(SPEAKER_MASK_Lhs | SPEAKER_MASK_Rhs,    SPEAKER_PAIR_LhsRhs)\n    MAP(SPEAKER_MASK_Chr,                       SPEAKER_PAIR_Chr)\n    MAP(SPEAKER_MASK_Lhr | SPEAKER_MASK_Rhr,    SPEAKER_PAIR_LhrRhr)\n#undef MAP\n\n    return mask2;\n}\n\nstruct dcadec_exss_info *core_get_info_exss(struct core_decoder *core)\n{\n    struct dcadec_exss_info *info = ta_znew(NULL, struct dcadec_exss_info);\n    if (!info)\n        return NULL;\n\n    info->nchannels = core->nchannels + !!core->lfe_present;\n    info->sample_rate = core->sample_rate << !!(core->ext_audio_mask & CSS_X96);\n    info->bits_per_sample = core->source_pcm_res;\n\n    if (core->ext_audio_mask & (CSS_XXCH | CSS_XCH))\n        info->profile = DCADEC_PROFILE_DS_ES;\n    else if (core->ext_audio_mask & CSS_X96)\n        info->profile = DCADEC_PROFILE_DS_96_24;\n    else\n        info->profile = DCADEC_PROFILE_DS;\n\n    info->embedded_6ch = !!(core->ext_audio_mask & (CSS_XXCH | CSS_XCH));\n    info->spkr_mask = make_spkr_pair_mask(core->ch_mask);\n\n    if (core->audio_mode == AMODE_STEREO_TOTAL)\n        info->matrix_encoding = DCADEC_MATRIX_ENCODING_SURROUND;\n\n    return info;\n}\n"
  },
  {
    "path": "libdcadec/core_decoder.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef CORE_DECODER_H\n#define CORE_DECODER_H\n\n#include \"bitstream.h\"\n\n#define MAX_CHANNELS            7\n#define MAX_SUBBANDS            32\n#define MAX_LFE_SAMPLES         16\n#define MAX_SUBFRAMES           16\n#define NUM_SUBBAND_SAMPLES     8\n#define NUM_PCMBLOCK_SAMPLES    32\n#define NUM_ADPCM_COEFFS        4\n#define NUM_CODE_BOOKS          10\n\n#define MAX_SUBBANDS_X96        64\n\n#define MAX_CHANNELS_CORE       6\n#define MAX_CHANNELS_DMIX       4\n#define MAX_CHANNELS_XXCH       2\n#define MAX_CHANNELS_CHSET      8\n\n#define MAX_EXSS_CHSETS         4\n\n#define core_err(...)   dca_log(core, ERROR, __VA_ARGS__)\n#define core_warn(...)  dca_log(core, WARNING, __VA_ARGS__)\n\n#define core_err_once(...)     dca_log_once(core, ERROR, __VA_ARGS__)\n#define core_warn_once(...)    dca_log_once(core, WARNING, __VA_ARGS__)\n\nstruct exss_asset;\n\nstruct core_decoder {\n    struct dcadec_context   *ctx;   ///< Parent context\n    struct bitstream        bits;   ///< Bitstream reader\n\n    // Bit stream header\n    bool    crc_present;        ///< CRC present flag\n    int     npcmblocks;         ///< Number of PCM sample blocks\n    int     frame_size;         ///< Primary frame byte size\n    int     audio_mode;         ///< Audio channel arrangement\n    int     sample_rate;        ///< Core audio sampling frequency\n    int     bit_rate;           ///< Transmission bit rate\n    bool    drc_present;        ///< Embedded dynamic range flag\n    bool    ts_present;         ///< Embedded time stamp flag\n    bool    aux_present;        ///< Auxiliary data flag\n    int     ext_audio_type;     ///< Extension audio descriptor flag\n    bool    ext_audio_present;  ///< Extended coding flag\n    bool    sync_ssf;           ///< Audio sync word insertion flag\n    int     lfe_present;        ///< Low frequency effects flag\n    bool    predictor_history;  ///< Predictor history flag switch\n    bool    filter_perfect;     ///< Multirate interpolator switch\n    int     source_pcm_res;     ///< Source PCM resolution\n    bool    es_format;          ///< Extended surround (ES) mastering flag\n    bool    sumdiff_front;      ///< Front sum/difference flag\n    bool    sumdiff_surround;   ///< Surround sum/difference flag\n\n    // Primary audio coding header\n    int         nsubframes;     ///< Number of subframes\n    int         nchannels;      ///< Number of primary audio channels (incl. extension channels)\n    int         ch_mask;        ///< Speaker layout mask (incl. LFE and extension channels)\n    int8_t      nsubbands[MAX_CHANNELS];                ///< Subband activity count\n    int8_t      subband_vq_start[MAX_CHANNELS];         ///< High frequency VQ start subband\n    int8_t      joint_intensity_index[MAX_CHANNELS];    ///< Joint intensity coding index\n    int8_t      transition_mode_sel[MAX_CHANNELS];      ///< Transient mode code book\n    int8_t      scale_factor_sel[MAX_CHANNELS];         ///< Scale factor code book\n    int8_t      bit_allocation_sel[MAX_CHANNELS];       ///< Bit allocation quantizer select\n    int8_t      quant_index_sel[MAX_CHANNELS][NUM_CODE_BOOKS];  ///< Quantization index codebook select\n    int32_t     scale_factor_adj[MAX_CHANNELS][NUM_CODE_BOOKS]; ///< Scale factor adjustment\n\n    // Primary audio coding side information\n    int8_t      nsubsubframes[MAX_SUBFRAMES];   ///< Subsubframe count for each subframe\n    int8_t      prediction_mode[MAX_CHANNELS][MAX_SUBBANDS_X96];            ///< Prediction mode\n    int16_t     prediction_vq_index[MAX_CHANNELS][MAX_SUBBANDS_X96];        ///< Prediction coefficients VQ address\n    int8_t      bit_allocation[MAX_CHANNELS][MAX_SUBBANDS_X96];             ///< Bit allocation index\n    int8_t      transition_mode[MAX_SUBFRAMES][MAX_CHANNELS][MAX_SUBBANDS]; ///< Transition mode\n    union {\n        int32_t     scale_factors[MAX_CHANNELS][MAX_SUBBANDS][2];               ///< Scale factors (2x for transients)\n        int32_t     x96_scale_factors[MAX_CHANNELS][MAX_SUBBANDS_X96];          ///< X96 scale factors\n    };\n    int8_t      joint_scale_sel[MAX_CHANNELS];                              ///< Joint subband codebook select\n    int32_t     joint_scale_factors[MAX_CHANNELS][MAX_SUBBANDS_X96];        ///< Scale factors for joint subband coding\n\n    // Auxiliary data\n    bool    prim_dmix_embedded; ///< Auxiliary dynamic downmix flag\n    int     prim_dmix_type;     ///< Auxiliary primary channel downmix type\n    int     prim_dmix_coeff[MAX_CHANNELS_DMIX * MAX_CHANNELS_CORE]; ///< Dynamic downmix code coefficients\n\n    // Core extensions\n    int     ext_audio_mask;     ///< Bit mask of fully decoded core extensions\n\n    // XCH extension data\n    int     xch_pos;    ///< Bit position of XCH frame in core substream\n\n    // XXCH extension data\n    bool    xxch_crc_present;       ///< CRC presence flag for XXCH channel set header\n    int     xxch_mask_nbits;        ///< Number of bits for loudspeaker mask\n    int     xxch_core_mask;         ///< Core loudspeaker activity mask\n    int     xxch_spkr_mask;         ///< Loudspeaker layout mask\n    bool    xxch_dmix_embedded;     ///< Downmix already performed by encoder\n    int     xxch_dmix_scale_inv;    ///< Downmix scale factor\n    int     xxch_dmix_mask[MAX_CHANNELS_XXCH];  ///< Downmix channel mapping mask\n    int     xxch_dmix_coeff[MAX_CHANNELS_XXCH * MAX_CHANNELS_CORE];     ///< Downmix coefficients\n    int     xxch_pos;   ///< Bit position of XXCH frame in core substream\n\n    // X96 extension data\n    int     x96_rev_no;         ///< X96 revision number\n    bool    x96_crc_present;    ///< CRC presence flag for X96 channel set header\n    int     x96_nchannels;      ///< Number of primary channels in X96 extension\n    bool    x96_high_res;       ///< X96 high resolution flag\n    int     x96_subband_start;  ///< First encoded subband in X96 extension\n    int     x96_rand;           ///< Random seed for generating samples for unallocated X96 subbands\n    int     x96_pos;            ///< Bit position of X96 frame in core substream\n\n    int     *x96_subband_buffer;    ///< X96 subband sample buffer base\n    int     *x96_subband_samples[MAX_CHANNELS][MAX_SUBBANDS_X96];   ///< X96 subband samples\n\n    // Core subband buffer and filter banks\n    int                 *subband_buffer;    ///< Subband sample buffer base\n    int                 *subband_samples[MAX_CHANNELS][MAX_SUBBANDS];   ///< Subband samples\n    struct interpolator *subband_dsp[MAX_CHANNELS]; ///< Filter banks\n    struct idct_context *subband_dsp_idct[2];       ///< IDCT context\n    int                 *lfe_samples;   ///< Buffer for decimated LFE samples\n\n    // PCM output data\n    int     *output_buffer;                 ///< PCM output buffer base\n    int     *output_samples[SPEAKER_COUNT]; ///< PCM output speaker map\n    int     output_history_lfe;             ///< LFE PCM history for X96 filter\n\n    int     npcmsamples;    ///< Number of PCM samples per channel\n    int     output_rate;    ///< Output sample rate (1x or 2x header rate)\n\n    int     filter_flags;   ///< Previous filtering flags for detecting changes\n};\n\nint core_parse(struct core_decoder *core, uint8_t *data, int size,\n               int flags, struct exss_asset *asset);\nint core_parse_exss(struct core_decoder *core, uint8_t *data,\n                    int flags, struct exss_asset *asset);\nint core_filter(struct core_decoder *core, int flags);\nvoid core_clear(struct core_decoder *core) __attribute__((cold));\nstruct dcadec_core_info *core_get_info(struct core_decoder *core) __attribute__((cold));\nstruct dcadec_exss_info *core_get_info_exss(struct core_decoder *core) __attribute__((cold));\n\n#endif\n"
  },
  {
    "path": "libdcadec/core_huffman.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n//\n// Table A3\n//\nstatic const uint8_t A3_len[] = {\n     1,  2,  2\n};\n\nstatic const uint16_t A3_code[] = {\n    0x0000, 0x0002, 0x0003\n};\n\n//\n// Table A4\n//\nstatic const uint8_t A4_len[] = {\n     1,  2,  3,  3\n};\n\nstatic const uint16_t A4_code[] = {\n    0x0000, 0x0002, 0x0006, 0x0007\n};\n\n//\n// Table B4\n//\nstatic const uint8_t B4_len[] = {\n     2,  3,  3,  1\n};\n\nstatic const uint16_t B4_code[] = {\n    0x0002, 0x0006, 0x0007, 0x0000\n};\n\n//\n// Table C4\n//\nstatic const uint8_t C4_len[] = {\n     3,  3,  1,  2\n};\n\nstatic const uint16_t C4_code[] = {\n    0x0006, 0x0007, 0x0000, 0x0002\n};\n\n//\n// Table D4\n//\nstatic const uint8_t D4_len[] = {\n     2,  2,  2,  2\n};\n\nstatic const uint16_t D4_code[] = {\n    0x0000, 0x0001, 0x0002, 0x0003\n};\n\n//\n// Table A5\n//\nstatic const uint8_t A5_len[] = {\n     1,  2,  3,  4,  4\n};\n\nstatic const uint16_t A5_code[] = {\n    0x0000, 0x0002, 0x0006, 0x000e, 0x000f\n};\n\n//\n// Table B5\n//\nstatic const uint8_t B5_len[] = {\n     2,  2,  2,  3,  3\n};\n\nstatic const uint16_t B5_code[] = {\n    0x0002, 0x0000, 0x0001, 0x0006, 0x0007\n};\n\n//\n// Table C5\n//\nstatic const uint8_t C5_len[] = {\n     1,  3,  3,  3,  3\n};\n\nstatic const uint16_t C5_code[] = {\n    0x0000, 0x0004, 0x0005, 0x0006, 0x0007\n};\n\n//\n// Table A7\n//\nstatic const uint8_t A7_len[] = {\n     1,  3,  3,  3,  4,  5,  5\n};\n\nstatic const uint16_t A7_code[] = {\n    0x0000, 0x0006, 0x0005, 0x0004, 0x000e, 0x001f, 0x001e\n};\n\n//\n// Table B7\n//\nstatic const uint8_t B7_len[] = {\n     2,  2,  2,  3,  4,  5,  5\n};\n\nstatic const uint16_t B7_code[] = {\n    0x0003, 0x0001, 0x0000, 0x0004, 0x000b, 0x0015, 0x0014\n};\n\n//\n// Table C7\n//\nstatic const uint8_t C7_len[] = {\n     2,  2,  2,  4,  4,  4,  4\n};\n\nstatic const uint16_t C7_code[] = {\n    0x0003, 0x0002, 0x0001, 0x0003, 0x0002, 0x0001, 0x0000\n};\n\n//\n// Table A9\n//\nstatic const uint8_t A9_len[] = {\n     1,  3,  3,  4,  4,  4,  5,  6,  6\n};\n\nstatic const uint16_t A9_code[] = {\n    0x0000, 0x0007, 0x0005, 0x000d, 0x0009, 0x0008, 0x0019, 0x0031, 0x0030\n};\n\n//\n// Table B9\n//\nstatic const uint8_t B9_len[] = {\n     2,  2,  3,  3,  3,  5,  5,  5,  5\n};\n\nstatic const uint16_t B9_code[] = {\n    0x0002, 0x0000, 0x0007, 0x0003, 0x0002, 0x001b, 0x001a, 0x0019, 0x0018\n};\n\n//\n// Table C9\n//\nstatic const uint8_t C9_len[] = {\n     2,  2,  3,  3,  3,  4,  5,  6,  6\n};\n\nstatic const uint16_t C9_code[] = {\n    0x0002, 0x0000, 0x0007, 0x0006, 0x0002, 0x0006, 0x000f, 0x001d, 0x001c\n};\n\n//\n// Table A12\n//\nstatic const uint8_t A12_len[] = {\n     1,  2,  3,  4,  5,  6,  8,  8,  9,\n     9,  9,  9\n};\n\nstatic const uint16_t A12_code[] = {\n    0x0000, 0x0002, 0x0006, 0x000e, 0x001e, 0x003e, 0x00ff, 0x00fe, 0x01fb,\n    0x01fa, 0x01f9, 0x01f8\n};\n\n//\n// Table B12\n//\nstatic const uint8_t B12_len[] = {\n     1,  2,  3,  5,  5,  6,  7,  7,  7,\n     7,  7,  7\n};\n\nstatic const uint16_t B12_code[] = {\n    0x0001, 0x0000, 0x0002, 0x000f, 0x000c, 0x001d, 0x0039, 0x0038, 0x0037,\n    0x0036, 0x0035, 0x0034\n};\n\n//\n// Table C12\n//\nstatic const uint8_t C12_len[] = {\n     2,  3,  3,  3,  3,  4,  4,  4,  5,\n     6,  7,  7\n};\n\nstatic const uint16_t C12_code[] = {\n    0x0000, 0x0007, 0x0005, 0x0004, 0x0002, 0x000d, 0x000c, 0x0006, 0x000f,\n    0x001d, 0x0039, 0x0038\n};\n\n//\n// Table D12\n//\nstatic const uint8_t D12_len[] = {\n     2,  2,  2,  3,  4,  5,  6,  7,  8,\n     9, 10, 10\n};\n\nstatic const uint16_t D12_code[] = {\n    0x0003, 0x0002, 0x0000, 0x0002, 0x0006, 0x000e, 0x001e, 0x003e, 0x007e,\n    0x00fe, 0x01ff, 0x01fe\n};\n\n//\n// Table E12\n//\nstatic const uint8_t E12_len[] = {\n     1,  2,  3,  4,  5,  7,  7,  8,  8,\n     8,  9,  9\n};\n\nstatic const uint16_t E12_code[] = {\n    0x0001, 0x0000, 0x0002, 0x0006, 0x000e, 0x003f, 0x003d, 0x007c, 0x0079,\n    0x0078, 0x00fb, 0x00fa\n};\n\n//\n// Table A13\n//\nstatic const uint8_t A13_len[] = {\n     1,  3,  4,  4,  4,  4,  5,  5,  6,\n     6,  6,  7,  7\n};\n\nstatic const uint16_t A13_code[] = {\n    0x0000, 0x0004, 0x000f, 0x000d, 0x000c, 0x000a, 0x001d, 0x0016, 0x0039,\n    0x002f, 0x002e, 0x0071, 0x0070\n};\n\n//\n// Table B13\n//\nstatic const uint8_t B13_len[] = {\n     2,  3,  3,  3,  4,  4,  4,  4,  5,\n     5,  5,  6,  6\n};\n\nstatic const uint16_t B13_code[] = {\n    0x0000, 0x0006, 0x0005, 0x0002, 0x000f, 0x0009, 0x0007, 0x0006, 0x001d,\n    0x0011, 0x0010, 0x0039, 0x0038\n};\n\n//\n// Table C13\n//\nstatic const uint8_t C13_len[] = {\n     3,  3,  3,  3,  3,  4,  4,  4,  4,\n     5,  5,  5,  5\n};\n\nstatic const uint16_t C13_code[] = {\n    0x0005, 0x0004, 0x0003, 0x0002, 0x0000, 0x000f, 0x000e, 0x000c, 0x0003,\n    0x001b, 0x001a, 0x0005, 0x0004\n};\n\n//\n// Table A17\n//\nstatic const uint8_t A17_len[] = {\n     2,  3,  3,  3,  3,  4,  4,  4,  5,\n     6,  7,  8,  9, 10, 11, 12, 12\n};\n\nstatic const uint16_t A17_code[] = {\n    0x0001, 0x0007, 0x0006, 0x0004, 0x0001, 0x000b, 0x000a, 0x0000, 0x0003,\n    0x0004, 0x000b, 0x0014, 0x002b, 0x0054, 0x00ab, 0x0155, 0x0154\n};\n\n//\n// Table B17\n//\nstatic const uint8_t B17_len[] = {\n     2,  3,  3,  3,  4,  4,  4,  5,  5,\n     5,  5,  6,  6,  6,  7,  8,  8\n};\n\nstatic const uint16_t B17_code[] = {\n    0x0000, 0x0006, 0x0005, 0x0002, 0x000f, 0x0009, 0x0008, 0x001d, 0x001c,\n    0x000e, 0x000d, 0x001e, 0x0019, 0x0018, 0x003f, 0x007d, 0x007c\n};\n\n//\n// Table C17\n//\nstatic const uint8_t C17_len[] = {\n     3,  3,  3,  3,  4,  4,  4,  4,  4,\n     5,  5,  5,  5,  5,  6,  7,  7\n};\n\nstatic const uint16_t C17_code[] = {\n    0x0006, 0x0004, 0x0003, 0x0000, 0x000f, 0x000b, 0x000a, 0x0004, 0x0003,\n    0x001d, 0x001c, 0x000a, 0x0005, 0x0004, 0x0017, 0x002d, 0x002c\n};\n\n//\n// Table D17\n//\nstatic const uint8_t D17_len[] = {\n     1,  3,  3,  4,  4,  5,  5,  6,  6,\n     7,  7,  8,  8,  9,  9,  9,  9\n};\n\nstatic const uint16_t D17_code[] = {\n    0x0000, 0x0007, 0x0006, 0x000b, 0x000a, 0x0013, 0x0012, 0x0023, 0x0022,\n    0x0043, 0x0042, 0x0083, 0x0082, 0x0103, 0x0102, 0x0101, 0x0100\n};\n\n//\n// Table E17\n//\nstatic const uint8_t E17_len[] = {\n     1,  3,  3,  4,  5,  5,  5,  6,  6,\n     6,  6,  7,  7,  8,  8,  8,  8\n};\n\nstatic const uint16_t E17_code[] = {\n    0x0000, 0x0005, 0x0004, 0x000c, 0x001f, 0x001c, 0x001b, 0x003c, 0x003b,\n    0x0035, 0x0034, 0x007a, 0x0075, 0x00f7, 0x00f6, 0x00e9, 0x00e8\n};\n\n//\n// Table F17\n//\nstatic const uint8_t F17_len[] = {\n     3,  3,  3,  3,  3,  4,  4,  4,  4,\n     5,  5,  6,  6,  6,  7,  8,  8\n};\n\nstatic const uint16_t F17_code[] = {\n    0x0006, 0x0005, 0x0004, 0x0002, 0x0001, 0x000f, 0x000e, 0x0006, 0x0001,\n    0x000e, 0x0001, 0x001f, 0x001e, 0x0000, 0x0003, 0x0005, 0x0004\n};\n\n//\n// Table G17\n//\nstatic const uint8_t G17_len[] = {\n     2,  3,  3,  3,  3,  4,  4,  5,  5,\n     6,  6,  7,  7,  8,  8,  8,  8\n};\n\nstatic const uint16_t G17_code[] = {\n    0x0002, 0x0007, 0x0006, 0x0001, 0x0000, 0x0005, 0x0004, 0x000e, 0x000d,\n    0x001e, 0x0019, 0x003e, 0x0031, 0x007f, 0x007e, 0x0061, 0x0060\n};\n\n//\n// Table A25\n//\nstatic const uint8_t A25_len[] = {\n     3,  3,  3,  3,  3,  4,  4,  4,  4,\n     5,  5,  6,  6,  7,  7,  8,  8,  8,\n     9, 10, 11, 12, 13, 14, 14\n};\n\nstatic const uint16_t A25_code[] = {\n    0x0006, 0x0004, 0x0003, 0x0001, 0x0000, 0x000f, 0x000e, 0x0005, 0x0004,\n    0x0016, 0x0015, 0x002f, 0x002e, 0x0053, 0x0052, 0x00a3, 0x00a2, 0x00a0,\n    0x0143, 0x0284, 0x050b, 0x0a14, 0x142b, 0x2855, 0x2854\n};\n\n//\n// Table B25\n//\nstatic const uint8_t B25_len[] = {\n     3,  3,  3,  4,  4,  4,  4,  4,  4,\n     5,  5,  5,  5,  6,  6,  6,  6,  6,\n     6,  7,  7,  7,  8,  9,  9\n};\n\nstatic const uint16_t B25_code[] = {\n    0x0005, 0x0002, 0x0001, 0x000f, 0x000e, 0x0009, 0x0008, 0x0006, 0x0001,\n    0x001a, 0x0019, 0x000f, 0x000e, 0x0037, 0x0036, 0x0031, 0x0030, 0x0001,\n    0x0000, 0x0006, 0x0005, 0x0004, 0x000f, 0x001d, 0x001c\n};\n\n//\n// Table C25\n//\nstatic const uint8_t C25_len[] = {\n     3,  4,  4,  4,  4,  4,  4,  4,  4,\n     4,  4,  5,  5,  5,  5,  5,  6,  6,\n     6,  6,  7,  7,  7,  8,  8\n};\n\nstatic const uint16_t C25_code[] = {\n    0x0001, 0x000f, 0x000e, 0x000c, 0x000b, 0x0009, 0x0008, 0x0006, 0x0005,\n    0x0001, 0x0000, 0x001a, 0x0015, 0x000f, 0x000e, 0x0008, 0x0037, 0x0029,\n    0x0028, 0x0012, 0x006d, 0x006c, 0x0027, 0x004d, 0x004c\n};\n\n//\n// Table D25\n//\nstatic const uint8_t D25_len[] = {\n     2,  3,  3,  3,  3,  4,  4,  5,  5,\n     6,  6,  7,  7,  8,  8,  9,  9, 10,\n    10, 11, 11, 12, 12, 12, 12\n};\n\nstatic const uint16_t D25_code[] = {\n    0x0002, 0x0007, 0x0006, 0x0001, 0x0000, 0x0005, 0x0004, 0x000d, 0x000c,\n    0x001d, 0x001c, 0x003e, 0x003d, 0x007e, 0x0079, 0x00ff, 0x00fe, 0x01e3,\n    0x01e2, 0x03c3, 0x03c2, 0x0783, 0x0782, 0x0781, 0x0780\n};\n\n//\n// Table E25\n//\nstatic const uint8_t E25_len[] = {\n     2,  3,  3,  4,  4,  4,  4,  5,  5,\n     5,  5,  6,  6,  6,  6,  7,  7,  7,\n     7,  7,  7,  8,  8,  8,  8\n};\n\nstatic const uint16_t E25_code[] = {\n    0x0003, 0x0003, 0x0002, 0x000b, 0x000a, 0x0001, 0x0000, 0x0011, 0x0010,\n    0x0005, 0x0004, 0x0026, 0x0025, 0x000e, 0x000d, 0x004f, 0x004e, 0x0048,\n    0x001f, 0x0019, 0x0018, 0x0093, 0x0092, 0x003d, 0x003c\n};\n\n//\n// Table F25\n//\nstatic const uint8_t F25_len[] = {\n     3,  3,  4,  4,  4,  4,  4,  4,  4,\n     4,  4,  5,  5,  5,  5,  6,  6,  7,\n     7,  8,  8,  8,  9, 10, 10\n};\n\nstatic const uint16_t F25_code[] = {\n    0x0001, 0x0000, 0x000f, 0x000e, 0x000d, 0x000b, 0x000a, 0x0008, 0x0007,\n    0x0005, 0x0004, 0x0018, 0x0013, 0x000d, 0x000c, 0x0025, 0x0024, 0x0066,\n    0x0065, 0x00cf, 0x00ce, 0x00c8, 0x0193, 0x0325, 0x0324\n};\n\n//\n// Table G25\n//\nstatic const uint8_t G25_len[] = {\n     2,  3,  3,  3,  4,  4,  4,  5,  5,\n     5,  6,  6,  6,  7,  7,  7,  7,  8,\n     8,  9,  9, 10, 10, 10, 10\n};\n\nstatic const uint16_t G25_code[] = {\n    0x0001, 0x0006, 0x0005, 0x0000, 0x000f, 0x0008, 0x0003, 0x001c, 0x0013,\n    0x0004, 0x003b, 0x0024, 0x000b, 0x0074, 0x004b, 0x0015, 0x0014, 0x0095,\n    0x0094, 0x01d6, 0x01d5, 0x03af, 0x03ae, 0x03a9, 0x03a8\n};\n\n//\n// Table A33\n//\nstatic const uint8_t A33_len[] = {\n     3,  3,  3,  4,  4,  4,  4,  4,  4,\n     4,  5,  5,  5,  6,  6,  6,  6,  7,\n     7,  8,  8,  9,  9, 10, 10, 11, 11,\n    12, 12, 13, 13, 13, 13\n};\n\nstatic const uint16_t A33_code[] = {\n    0x0002, 0x0001, 0x0000, 0x000e, 0x000d, 0x000c, 0x000b, 0x0009, 0x0008,\n    0x0006, 0x001f, 0x0014, 0x000f, 0x003d, 0x003c, 0x001d, 0x001c, 0x0055,\n    0x0054, 0x00ae, 0x00ad, 0x015f, 0x015e, 0x02b3, 0x02b2, 0x0563, 0x0562,\n    0x0ac3, 0x0ac2, 0x1583, 0x1582, 0x1581, 0x1580\n};\n\n//\n// Table B33\n//\nstatic const uint8_t B33_len[] = {\n     3,  4,  4,  4,  4,  4,  4,  4,  4,\n     5,  5,  5,  5,  5,  5,  5,  5,  6,\n     6,  6,  6,  7,  7,  7,  7,  7,  7,\n     8,  8,  8,  9, 10, 10\n};\n\nstatic const uint16_t B33_code[] = {\n    0x0001, 0x000f, 0x000e, 0x000b, 0x000a, 0x0008, 0x0007, 0x0004, 0x0001,\n    0x001b, 0x001a, 0x0013, 0x0012, 0x000c, 0x000b, 0x0001, 0x0000, 0x0032,\n    0x0031, 0x001a, 0x0015, 0x0067, 0x0066, 0x0060, 0x0037, 0x0029, 0x0028,\n    0x00c2, 0x006d, 0x006c, 0x0187, 0x030d, 0x030c\n};\n\n//\n// Table C33\n//\nstatic const uint8_t C33_len[] = {\n     4,  4,  4,  4,  4,  4,  4,  4,  4,\n     5,  5,  5,  5,  5,  5,  5,  5,  5,\n     6,  6,  6,  6,  6,  6,  6,  7,  7,\n     7,  7,  7,  8,  9,  9\n};\n\nstatic const uint16_t C33_code[] = {\n    0x000d, 0x000b, 0x000a, 0x0008, 0x0007, 0x0004, 0x0003, 0x0002, 0x0001,\n    0x001e, 0x001d, 0x0019, 0x0018, 0x0013, 0x0012, 0x000b, 0x000a, 0x0000,\n    0x003f, 0x003e, 0x0039, 0x001b, 0x001a, 0x0018, 0x0003, 0x0071, 0x0070,\n    0x0032, 0x0005, 0x0004, 0x0067, 0x00cd, 0x00cc\n};\n\n//\n// Table D33\n//\nstatic const uint8_t D33_len[] = {\n     2,  3,  3,  3,  4,  4,  4,  5,  5,\n     5,  6,  6,  6,  7,  7,  7,  7,  8,\n     8,  9,  9, 10, 10, 11, 11, 12, 12,\n    13, 13, 14, 14, 14, 14\n};\n\nstatic const uint16_t D33_code[] = {\n    0x0001, 0x0006, 0x0005, 0x0000, 0x000f, 0x0008, 0x0003, 0x001c, 0x0013,\n    0x0004, 0x003b, 0x0024, 0x000b, 0x0074, 0x004b, 0x0015, 0x0014, 0x0095,\n    0x0094, 0x01d5, 0x01d4, 0x03ad, 0x03ac, 0x075d, 0x075c, 0x0ebd, 0x0ebc,\n    0x1d7f, 0x1d7e, 0x3afb, 0x3afa, 0x3af9, 0x3af8\n};\n\n//\n// Table E33\n//\nstatic const uint8_t E33_len[] = {\n     2,  3,  3,  4,  4,  4,  5,  5,  5,\n     5,  5,  6,  6,  6,  6,  7,  7,  7,\n     7,  7,  7,  7,  7,  8,  8,  8,  8,\n     8,  8,  9,  9,  9,  9\n};\n\nstatic const uint16_t E33_code[] = {\n    0x0002, 0x0002, 0x0001, 0x000c, 0x0007, 0x0000, 0x001f, 0x001b, 0x001a,\n    0x0003, 0x0002, 0x003b, 0x003a, 0x001b, 0x001a, 0x007b, 0x007a, 0x0078,\n    0x0073, 0x0070, 0x0033, 0x0031, 0x0030, 0x00f2, 0x00e5, 0x00e3, 0x00e2,\n    0x0065, 0x0064, 0x01e7, 0x01e6, 0x01c9, 0x01c8\n};\n\n//\n// Table F33\n//\nstatic const uint8_t F33_len[] = {\n     4,  4,  4,  4,  4,  4,  4,  4,  4,\n     4,  4,  5,  5,  5,  5,  5,  5,  6,\n     6,  6,  6,  6,  6,  7,  7,  8,  8,\n     9,  9,  9, 10, 11, 11\n};\n\nstatic const uint16_t F33_code[] = {\n    0x000d, 0x000c, 0x000b, 0x0009, 0x0008, 0x0007, 0x0006, 0x0004, 0x0003,\n    0x0001, 0x0000, 0x001e, 0x001d, 0x0015, 0x0014, 0x000a, 0x0005, 0x003f,\n    0x003e, 0x0038, 0x0017, 0x0009, 0x0008, 0x002d, 0x002c, 0x00e6, 0x00e5,\n    0x01cf, 0x01ce, 0x01c8, 0x0393, 0x0725, 0x0724\n};\n\n//\n// Table G33\n//\nstatic const uint8_t G33_len[] = {\n     3,  3,  3,  4,  4,  4,  4,  4,  4,\n     5,  5,  5,  5,  6,  6,  6,  6,  7,\n     7,  7,  7,  8,  8,  8,  8,  8,  9,\n     9,  9,  9,  9, 10, 10\n};\n\nstatic const uint16_t G33_code[] = {\n    0x0006, 0x0003, 0x0002, 0x000f, 0x000e, 0x0009, 0x0008, 0x0001, 0x0000,\n    0x0016, 0x0015, 0x0006, 0x0005, 0x002e, 0x0029, 0x000e, 0x0009, 0x005e,\n    0x0051, 0x001e, 0x0011, 0x00bf, 0x00be, 0x003f, 0x003e, 0x0020, 0x0143,\n    0x0141, 0x0140, 0x0043, 0x0042, 0x0285, 0x0284\n};\n\n//\n// Table A65\n//\nstatic const uint8_t A65_len[] = {\n     4,  4,  4,  4,  4,  4,  5,  5,  5,\n     5,  5,  5,  5,  5,  5,  5,  5,  5,\n     5,  5,  6,  6,  6,  6,  6,  6,  6,\n     7,  7,  7,  7,  7,  7,  8,  8,  8,\n     8,  9,  9,  9,  9, 10, 10, 10, 10,\n    11, 11, 11, 11, 11, 12, 12, 12, 13,\n    13, 13, 13, 14, 14, 15, 15, 16, 16,\n    16, 16\n};\n\nstatic const uint16_t A65_code[] = {\n    0x0006, 0x0005, 0x0004, 0x0002, 0x0001, 0x0000, 0x001f, 0x001d, 0x001c,\n    0x001b, 0x001a, 0x0018, 0x0017, 0x0015, 0x0014, 0x0012, 0x0011, 0x000e,\n    0x0007, 0x0006, 0x003d, 0x0032, 0x002d, 0x0026, 0x0021, 0x001f, 0x001e,\n    0x0078, 0x0067, 0x0059, 0x0058, 0x0041, 0x0040, 0x00cd, 0x00cc, 0x009d,\n    0x009c, 0x01e6, 0x01e5, 0x013e, 0x013d, 0x03cf, 0x03ce, 0x027f, 0x027e,\n    0x0793, 0x0792, 0x0790, 0x04f3, 0x04f0, 0x0f23, 0x09e4, 0x09e3, 0x1e45,\n    0x1e44, 0x13c5, 0x13c4, 0x2795, 0x2794, 0x4f2d, 0x4f2c, 0x9e5f, 0x9e5e,\n    0x9e5d, 0x9e5c\n};\n\n//\n// Table B65\n//\nstatic const uint8_t B65_len[] = {\n     4,  4,  4,  5,  5,  5,  5,  5,  5,\n     5,  5,  5,  5,  5,  5,  5,  5,  6,\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     6,  6,  6,  6,  6,  7,  7,  7,  7,\n     7,  7,  7,  7,  7,  7,  7,  8,  8,\n     8,  8,  8,  8,  8,  8,  8,  8,  9,\n     9,  9,  9,  9,  9, 10, 10, 10, 11,\n    12, 12\n};\n\nstatic const uint16_t B65_code[] = {\n    0x0004, 0x0002, 0x0001, 0x001e, 0x001d, 0x001a, 0x0019, 0x0017, 0x0016,\n    0x0013, 0x0012, 0x0010, 0x000f, 0x000c, 0x000b, 0x0007, 0x0006, 0x003f,\n    0x003e, 0x0038, 0x0037, 0x0031, 0x0030, 0x0029, 0x0028, 0x0022, 0x001d,\n    0x001a, 0x0015, 0x0014, 0x0003, 0x0000, 0x0073, 0x006d, 0x006c, 0x0056,\n    0x0055, 0x0046, 0x0039, 0x0038, 0x0037, 0x0004, 0x0003, 0x00e5, 0x00e4,\n    0x00af, 0x00ae, 0x008f, 0x008e, 0x006c, 0x000b, 0x000a, 0x0005, 0x0153,\n    0x0152, 0x0150, 0x00db, 0x0009, 0x0008, 0x02a2, 0x01b5, 0x01b4, 0x0547,\n    0x0a8d, 0x0a8c\n};\n\n//\n// Table C65\n//\nstatic const uint8_t C65_len[] = {\n     5,  5,  5,  5,  5,  5,  5,  5,  5,\n     5,  5,  5,  5,  5,  5,  5,  5,  5,\n     5,  6,  6,  6,  6,  6,  6,  6,  6,\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     7,  7,  7,  7,  7,  7,  7,  7,  7,\n     7,  7,  7,  7,  8,  8,  8,  8,  8,\n     8,  8,  9,  9,  9,  9, 10, 10, 10,\n    11, 11\n};\n\nstatic const uint16_t C65_code[] = {\n    0x001c, 0x0019, 0x0018, 0x0017, 0x0016, 0x0013, 0x0012, 0x0010, 0x000f,\n    0x000d, 0x000c, 0x000a, 0x0009, 0x0007, 0x0006, 0x0004, 0x0003, 0x0001,\n    0x0000, 0x003e, 0x003d, 0x003b, 0x003a, 0x0036, 0x0035, 0x002b, 0x002a,\n    0x0028, 0x0023, 0x001d, 0x001c, 0x0011, 0x0010, 0x000b, 0x000a, 0x0004,\n    0x007f, 0x0079, 0x0078, 0x006e, 0x0069, 0x0053, 0x0052, 0x0044, 0x002f,\n    0x002e, 0x002d, 0x000b, 0x000a, 0x00fc, 0x00df, 0x00d1, 0x00d0, 0x008a,\n    0x0059, 0x0058, 0x01fb, 0x01bd, 0x01bc, 0x0116, 0x03f5, 0x03f4, 0x022f,\n    0x045d, 0x045c\n};\n\n//\n// Table D65\n//\nstatic const uint8_t D65_len[] = {\n     3,  3,  3,  4,  4,  4,  4,  5,  5,\n     5,  5,  5,  5,  6,  6,  6,  6,  6,\n     6,  7,  7,  7,  7,  7,  7,  8,  8,\n     8,  8,  8,  8,  8,  9,  9,  9,  9,\n     9, 10, 10, 10, 10, 10, 10, 11, 11,\n    11, 11, 12, 12, 12, 12, 13, 13, 13,\n    13, 13, 14, 14, 14, 15, 15, 15, 15,\n    15, 15\n};\n\nstatic const uint16_t D65_code[] = {\n    0x0004, 0x0001, 0x0000, 0x000d, 0x000c, 0x0007, 0x0006, 0x001f, 0x001e,\n    0x0017, 0x0016, 0x000b, 0x000a, 0x003b, 0x003a, 0x002b, 0x002a, 0x0013,\n    0x0012, 0x0073, 0x0072, 0x0053, 0x0052, 0x0023, 0x0022, 0x00e3, 0x00e2,\n    0x00a3, 0x00a2, 0x00a0, 0x0043, 0x0040, 0x01c3, 0x01c0, 0x0143, 0x0084,\n    0x0083, 0x0384, 0x0383, 0x0284, 0x010b, 0x0105, 0x0104, 0x0705, 0x0704,\n    0x0215, 0x0214, 0x0e15, 0x0e14, 0x0a16, 0x0a15, 0x1c2f, 0x1c2e, 0x142f,\n    0x142e, 0x1428, 0x385b, 0x2853, 0x2852, 0x70b5, 0x70b4, 0x70b3, 0x70b2,\n    0x70b1, 0x70b0\n};\n\n//\n// Table E65\n//\nstatic const uint8_t E65_len[] = {\n     3,  3,  4,  4,  4,  5,  5,  5,  5,\n     5,  5,  5,  5,  6,  6,  6,  6,  6,\n     6,  6,  6,  6,  6,  7,  7,  7,  7,\n     7,  7,  7,  7,  7,  7,  8,  8,  8,\n     8,  8,  8,  8,  8,  8,  8,  8,  8,\n     9,  9,  9,  9,  9,  9,  9,  9,  9,\n     9,  9,  9, 10, 10, 10, 10, 10, 10,\n    10, 10\n};\n\nstatic const uint16_t E65_code[] = {\n    0x0004, 0x0000, 0x000f, 0x0007, 0x0006, 0x001d, 0x001c, 0x0017, 0x0016,\n    0x000a, 0x0009, 0x0006, 0x0005, 0x0036, 0x0035, 0x0030, 0x002b, 0x0028,\n    0x0017, 0x0010, 0x000f, 0x0009, 0x0008, 0x0069, 0x0068, 0x0064, 0x0063,\n    0x0054, 0x0053, 0x002d, 0x002c, 0x001d, 0x001c, 0x00dd, 0x00dc, 0x00ce,\n    0x00cd, 0x00ca, 0x00c5, 0x00ab, 0x00aa, 0x00a4, 0x0047, 0x0045, 0x0044,\n    0x01be, 0x01bd, 0x019f, 0x019e, 0x0198, 0x0197, 0x0189, 0x0188, 0x014b,\n    0x014a, 0x008d, 0x008c, 0x037f, 0x037e, 0x0379, 0x0378, 0x0333, 0x0332,\n    0x032d, 0x032c\n};\n\n//\n// Table F65\n//\nstatic const uint8_t F65_len[] = {\n     3,  3,  3,  4,  4,  4,  4,  4,  4,\n     5,  5,  5,  5,  6,  6,  6,  6,  7,\n     7,  7,  7,  8,  8,  8,  8,  9,  9,\n     9,  9, 10, 10, 10, 11, 11, 11, 11,\n    12, 12, 12, 12, 12, 13, 13, 13, 13,\n    14, 14, 14, 14, 14, 14, 14, 14, 14,\n    14, 14, 14, 14, 14, 14, 14, 14, 14,\n    14, 14\n};\n\nstatic const uint16_t F65_code[] = {\n    0x0006, 0x0003, 0x0002, 0x000f, 0x000e, 0x0009, 0x0008, 0x0001, 0x0000,\n    0x0015, 0x0014, 0x0005, 0x0004, 0x002d, 0x002c, 0x000d, 0x000c, 0x005d,\n    0x005c, 0x001d, 0x001c, 0x00bd, 0x00bc, 0x003d, 0x003c, 0x017d, 0x017c,\n    0x007d, 0x007c, 0x02fd, 0x02fc, 0x00fc, 0x05ff, 0x05fc, 0x01ff, 0x01fa,\n    0x0bfd, 0x0bfb, 0x0bfa, 0x03f7, 0x03f6, 0x17f8, 0x07fb, 0x07f3, 0x07f2,\n    0x2ff3, 0x2ff2, 0x0ff5, 0x0ff4, 0x0ff3, 0x0ff2, 0x0ff1, 0x0ff0, 0x0fef,\n    0x0fee, 0x0fed, 0x0fec, 0x0feb, 0x0fea, 0x0fe9, 0x0fe8, 0x0fe3, 0x0fe2,\n    0x0fe1, 0x0fe0\n};\n\n//\n// Table G65\n//\nstatic const uint8_t G65_len[] = {\n     4,  4,  4,  4,  4,  4,  4,  4,  5,\n     5,  5,  5,  5,  5,  5,  5,  6,  6,\n     6,  6,  6,  6,  6,  6,  7,  7,  7,\n     7,  7,  7,  7,  7,  8,  8,  8,  8,\n     8,  8,  8,  8,  8,  9,  9,  9,  9,\n     9,  9,  9,  9, 10, 10, 10, 10, 10,\n    10, 10, 10, 11, 11, 11, 11, 11, 11,\n    11, 11\n};\n\nstatic const uint16_t G65_code[] = {\n    0x000e, 0x000b, 0x000a, 0x0008, 0x0006, 0x0004, 0x0003, 0x0000, 0x001f,\n    0x001a, 0x0019, 0x0012, 0x000f, 0x000a, 0x0005, 0x0002, 0x003d, 0x0036,\n    0x0031, 0x0026, 0x001d, 0x0016, 0x0009, 0x0006, 0x0079, 0x006e, 0x0061,\n    0x004e, 0x0039, 0x002e, 0x0011, 0x000e, 0x00f1, 0x00df, 0x00de, 0x009f,\n    0x009e, 0x005f, 0x005e, 0x001f, 0x001e, 0x01e0, 0x0183, 0x0180, 0x00e3,\n    0x00e1, 0x00e0, 0x0041, 0x0040, 0x03c2, 0x0305, 0x0303, 0x0302, 0x01c4,\n    0x0087, 0x0085, 0x0084, 0x0787, 0x0786, 0x0609, 0x0608, 0x038b, 0x038a,\n    0x010d, 0x010c\n};\n\n//\n// Table SA129\n//\nstatic const uint8_t SA129_len[] = {\n     2,  3,  3,  3,  4,  4,  4,  5,  5,\n     5,  6,  6,  6,  7,  7,  8,  8,  8,\n     8,  9,  9, 10, 10, 11, 11, 11, 11,\n    12, 12, 13, 13, 13, 13, 13, 13, 13,\n    13, 13, 13, 13, 13, 13, 13, 13, 13,\n    13, 13, 13, 13, 14, 14, 14, 14, 14,\n    14, 14, 14, 14, 14, 14, 14, 14, 14,\n    14, 14, 14, 14, 14, 14, 14, 14, 14,\n    14, 14, 14, 14, 14, 14, 14, 14, 14,\n    14, 14, 14, 14, 14, 14, 14, 14, 14,\n    14, 14, 14, 14, 14, 14, 14, 14, 14,\n    14, 14, 14, 14, 14, 14, 14, 14, 14,\n    14, 14, 14, 14, 14, 14, 14, 14, 14,\n    14, 14, 14, 14, 14, 14, 14, 14, 14,\n    14, 14, 14\n};\n\nstatic const uint16_t SA129_code[] = {\n    0x0001, 0x0006, 0x0005, 0x0000, 0x000f, 0x0008, 0x0003, 0x001c, 0x0013,\n    0x0004, 0x003b, 0x0024, 0x000b, 0x004b, 0x004a, 0x00e9, 0x00e8, 0x0029,\n    0x0028, 0x0057, 0x0056, 0x03a9, 0x03a8, 0x0755, 0x0754, 0x0155, 0x0154,\n    0x02ae, 0x02ad, 0x055f, 0x055e, 0x0559, 0x0558, 0x054f, 0x054e, 0x054d,\n    0x054c, 0x054b, 0x054a, 0x0549, 0x0548, 0x0547, 0x0546, 0x0545, 0x0544,\n    0x0543, 0x0542, 0x0541, 0x0540, 0x3aff, 0x3afe, 0x3afd, 0x3afc, 0x3afb,\n    0x3afa, 0x3af9, 0x3af8, 0x3af7, 0x3af6, 0x3af5, 0x3af4, 0x3af3, 0x3af2,\n    0x3af1, 0x3af0, 0x3aef, 0x3aee, 0x3aed, 0x3aec, 0x3aeb, 0x3aea, 0x3ae9,\n    0x3ae8, 0x3ae7, 0x3ae6, 0x3ae5, 0x3ae4, 0x3ae3, 0x3ae2, 0x3ae1, 0x3ae0,\n    0x3adf, 0x3ade, 0x3add, 0x3adc, 0x3adb, 0x3ada, 0x3ad9, 0x3ad8, 0x3ad7,\n    0x3ad6, 0x3ad5, 0x3ad4, 0x3ad3, 0x3ad2, 0x3ad1, 0x3ad0, 0x3acf, 0x3ace,\n    0x3acd, 0x3acc, 0x3acb, 0x3aca, 0x3ac9, 0x3ac8, 0x3ac7, 0x3ac6, 0x3ac5,\n    0x3ac4, 0x3ac3, 0x3ac2, 0x3ac1, 0x3ac0, 0x3abf, 0x3abe, 0x3abd, 0x3abc,\n    0x3abb, 0x3aba, 0x3ab9, 0x3ab8, 0x3ab7, 0x3ab6, 0x3ab5, 0x3ab4, 0x3ab3,\n    0x3ab2, 0x3ab1, 0x3ab0\n};\n\n//\n// Table SB129\n//\nstatic const uint8_t SB129_len[] = {\n     3,  3,  3,  4,  4,  4,  4,  4,  4,\n     4,  5,  5,  5,  6,  6,  6,  6,  7,\n     7,  8,  8,  9, 10, 11, 11, 12, 12,\n    13, 13, 14, 14, 14, 14, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15\n};\n\nstatic const uint16_t SB129_code[] = {\n    0x0003, 0x0002, 0x0001, 0x000f, 0x000e, 0x000c, 0x000b, 0x000a, 0x0009,\n    0x0000, 0x001b, 0x0011, 0x0010, 0x0035, 0x0034, 0x0005, 0x0004, 0x000d,\n    0x000c, 0x001d, 0x001c, 0x003c, 0x007f, 0x00fd, 0x00fc, 0x01eb, 0x01ea,\n    0x03d3, 0x03d2, 0x07a3, 0x07a2, 0x07a1, 0x07a0, 0x0fbf, 0x0fbe, 0x0fbd,\n    0x0fbc, 0x0fbb, 0x0fba, 0x0fb9, 0x0fb8, 0x0fb7, 0x0fb6, 0x0fb5, 0x0fb4,\n    0x0fb3, 0x0fb2, 0x0fb1, 0x0fb0, 0x0faf, 0x0fae, 0x0fad, 0x0fac, 0x0fab,\n    0x0faa, 0x0fa9, 0x0fa8, 0x0fa7, 0x0fa6, 0x0fa5, 0x0fa4, 0x0fa3, 0x0fa2,\n    0x0fa1, 0x0fa0, 0x0f9f, 0x0f9e, 0x0f9d, 0x0f9c, 0x0f9b, 0x0f9a, 0x0f99,\n    0x0f98, 0x0f97, 0x0f96, 0x0f95, 0x0f94, 0x0f93, 0x0f92, 0x0f91, 0x0f90,\n    0x0f8f, 0x0f8e, 0x0f8d, 0x0f8c, 0x0f8b, 0x0f8a, 0x0f89, 0x0f88, 0x0f87,\n    0x0f86, 0x0f85, 0x0f84, 0x0f83, 0x0f82, 0x0f81, 0x0f80, 0x0f7f, 0x0f7e,\n    0x0f7d, 0x0f7c, 0x0f7b, 0x0f7a, 0x0f79, 0x0f78, 0x0f77, 0x0f76, 0x0f75,\n    0x0f74, 0x0f73, 0x0f72, 0x0f71, 0x0f70, 0x0f6f, 0x0f6e, 0x0f6d, 0x0f6c,\n    0x0f6b, 0x0f6a, 0x0f69, 0x0f68, 0x0f67, 0x0f66, 0x0f65, 0x0f64, 0x0f63,\n    0x0f62, 0x0f61, 0x0f60\n};\n\n//\n// Table SC129\n//\nstatic const uint8_t SC129_len[] = {\n     3,  3,  3,  4,  4,  4,  4,  5,  5,\n     5,  5,  5,  5,  6,  6,  6,  6,  6,\n     6,  7,  7,  7,  7,  7,  7,  8,  8,\n     8,  8,  8,  8,  9,  9,  9,  9,  9,\n     9, 10, 10, 10, 10, 10, 11, 11, 11,\n    11, 11, 12, 12, 12, 12, 12, 12, 13,\n    13, 13, 13, 13, 14, 14, 14, 14, 14,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15\n};\n\nstatic const uint16_t SC129_code[] = {\n    0x0004, 0x0001, 0x0000, 0x000d, 0x000c, 0x0007, 0x0006, 0x001f, 0x001e,\n    0x0017, 0x0016, 0x000b, 0x000a, 0x003b, 0x003a, 0x002b, 0x002a, 0x0013,\n    0x0012, 0x0073, 0x0072, 0x0053, 0x0052, 0x0023, 0x0022, 0x00e3, 0x00e2,\n    0x00a2, 0x00a1, 0x0042, 0x0041, 0x01c2, 0x01c1, 0x0141, 0x0140, 0x0081,\n    0x0080, 0x0381, 0x0380, 0x028c, 0x010f, 0x010c, 0x070f, 0x051c, 0x051b,\n    0x021c, 0x021b, 0x0e1c, 0x0e1b, 0x0a35, 0x0a34, 0x0435, 0x0434, 0x1c3a,\n    0x1c35, 0x0877, 0x0876, 0x0874, 0x3877, 0x3869, 0x3868, 0x10eb, 0x10ea,\n    0x70ed, 0x70ec, 0x70cf, 0x70ce, 0x70cd, 0x70cc, 0x70cb, 0x70ca, 0x70c9,\n    0x70c8, 0x70c7, 0x70c6, 0x70c5, 0x70c4, 0x70c3, 0x70c2, 0x70c1, 0x70c0,\n    0x51ff, 0x51fe, 0x51fd, 0x51fc, 0x51fb, 0x51fa, 0x51f9, 0x51f8, 0x51f7,\n    0x51f6, 0x51f5, 0x51f4, 0x51f3, 0x51f2, 0x51f1, 0x51f0, 0x51ef, 0x51ee,\n    0x51ed, 0x51ec, 0x51eb, 0x51ea, 0x51e9, 0x51e8, 0x51e7, 0x51e6, 0x51e5,\n    0x51e4, 0x51e3, 0x51e2, 0x51e1, 0x51e0, 0x51df, 0x51de, 0x51dd, 0x51dc,\n    0x51db, 0x51da, 0x51d9, 0x51d8, 0x51d7, 0x51d6, 0x51d5, 0x51d4, 0x51d3,\n    0x51d2, 0x51d1, 0x51d0\n};\n\n//\n// Table SD129\n//\nstatic const uint8_t SD129_len[] = {\n     2,  3,  3,  4,  4,  4,  4,  5,  5,\n     5,  5,  6,  6,  6,  6,  7,  7,  7,\n     7,  8,  8,  8,  8,  9,  9,  9, 10,\n    10, 10, 10, 11, 11, 11, 12, 12, 12,\n    12, 12, 13, 13, 13, 14, 14, 14, 14,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15, 15, 15, 15, 15, 15, 15,\n    15, 15, 15\n};\n\nstatic const uint16_t SD129_code[] = {\n    0x0000, 0x0005, 0x0004, 0x000f, 0x000e, 0x0007, 0x0006, 0x001a, 0x0019,\n    0x000a, 0x0009, 0x0036, 0x0031, 0x0016, 0x0011, 0x006e, 0x0061, 0x002e,\n    0x0021, 0x00c1, 0x00c0, 0x0041, 0x0040, 0x01bc, 0x00bf, 0x00bc, 0x037f,\n    0x037a, 0x017d, 0x017a, 0x06fd, 0x02f9, 0x02f8, 0x0df9, 0x0df8, 0x05ef,\n    0x05ee, 0x05ec, 0x1bef, 0x1bd8, 0x0bdb, 0x37dd, 0x37dc, 0x17b5, 0x17b4,\n    0x6fb7, 0x6fb6, 0x6fb5, 0x6fb4, 0x6fb3, 0x6fb2, 0x6fb1, 0x6fb0, 0x6faf,\n    0x6fae, 0x6fad, 0x6fac, 0x6fab, 0x6faa, 0x6fa9, 0x6fa8, 0x6fa7, 0x6fa6,\n    0x6fa5, 0x6fa4, 0x6fa3, 0x6fa2, 0x6fa1, 0x6fa0, 0x6f9f, 0x6f9e, 0x6f9d,\n    0x6f9c, 0x6f9b, 0x6f9a, 0x6f99, 0x6f98, 0x6f97, 0x6f96, 0x6f95, 0x6f94,\n    0x6f93, 0x6f92, 0x6f91, 0x6f90, 0x6f8f, 0x6f8e, 0x6f8d, 0x6f8c, 0x6f8b,\n    0x6f8a, 0x6f89, 0x6f88, 0x6f87, 0x6f86, 0x6f85, 0x6f84, 0x6f83, 0x6f82,\n    0x6f81, 0x6f80, 0x6f7f, 0x6f7e, 0x6f7d, 0x6f7c, 0x6f7b, 0x6f7a, 0x6f79,\n    0x6f78, 0x6f77, 0x6f76, 0x6f75, 0x6f74, 0x6f73, 0x6f72, 0x6f71, 0x6f70,\n    0x6f6f, 0x6f6e, 0x6f6d, 0x6f6c, 0x6f6b, 0x6f6a, 0x6f69, 0x6f68, 0x6f67,\n    0x6f66, 0x6f65, 0x6f64\n};\n\n//\n// Table SE129\n//\nstatic const uint8_t SE129_len[] = {\n     4,  4,  4,  4,  4,  4,  4,  5,  5,\n     5,  5,  5,  5,  5,  5,  5,  5,  6,\n     6,  6,  6,  6,  6,  6,  6,  7,  7,\n     7,  7,  7,  7,  7,  7,  8,  8,  8,\n     8,  8,  8,  8,  8,  9,  9,  9,  9,\n     9,  9,  9,  9, 10, 10, 10, 10, 10,\n    10, 10, 10, 11, 11, 11, 11, 11, 11,\n    11, 12, 12, 12, 12, 12, 12, 12, 12,\n    12, 13, 13, 13, 13, 13, 13, 13, 13,\n    14, 14, 14, 14, 14, 14, 14, 14, 15,\n    15, 15, 15, 15, 15, 15, 15, 16, 16,\n    16, 16, 16, 16, 16, 16, 16, 16, 16,\n    16, 16, 16, 16, 16, 16, 16, 16, 16,\n    16, 16, 16, 16, 16, 16, 16, 16, 16,\n    16, 16, 16\n};\n\nstatic const uint16_t SE129_code[] = {\n    0x000e, 0x000b, 0x000a, 0x0007, 0x0006, 0x0003, 0x0002, 0x001f, 0x001e,\n    0x0019, 0x0018, 0x0011, 0x0010, 0x0009, 0x0008, 0x0001, 0x0000, 0x0035,\n    0x0034, 0x0025, 0x0024, 0x0015, 0x0014, 0x0005, 0x0004, 0x006d, 0x006c,\n    0x004d, 0x004c, 0x002d, 0x002c, 0x000d, 0x000c, 0x00dd, 0x00dc, 0x009d,\n    0x009c, 0x005d, 0x005c, 0x001d, 0x001c, 0x01bd, 0x01bc, 0x013d, 0x013c,\n    0x00bd, 0x00bc, 0x003d, 0x003c, 0x037c, 0x027f, 0x027d, 0x027c, 0x017d,\n    0x017c, 0x007d, 0x007c, 0x06fc, 0x06fb, 0x04fc, 0x02ff, 0x02fc, 0x00ff,\n    0x00fc, 0x0dff, 0x0dfb, 0x0dfa, 0x09fb, 0x09fa, 0x05fb, 0x05fa, 0x01fb,\n    0x01fa, 0x1bf8, 0x1beb, 0x1be8, 0x0bfb, 0x0bf9, 0x0bf8, 0x03f9, 0x03f8,\n    0x37fa, 0x37f9, 0x37d3, 0x37d2, 0x17f4, 0x07f7, 0x07f6, 0x07f5, 0x6ff7,\n    0x6ff6, 0x6fa9, 0x6fa8, 0x2feb, 0x2fea, 0x0fe9, 0x0fe8, 0xdfe3, 0xdfe2,\n    0xdfe1, 0xdfe0, 0xdfdf, 0xdfde, 0xdfdd, 0xdfdc, 0xdfdb, 0xdfda, 0xdfd9,\n    0xdfd8, 0xdfd7, 0xdfd6, 0xdfd5, 0xdfd4, 0xdfd3, 0xdfd2, 0xdfd1, 0xdfd0,\n    0xdfcf, 0xdfce, 0xdfcd, 0xdfcc, 0xdfcb, 0xdfca, 0xdfc9, 0xdfc8, 0xdf57,\n    0xdf56, 0xdf55, 0xdf54\n};\n\n//\n// Table A129\n//\nstatic const uint8_t A129_len[] = {\n     4,  4,  4,  4,  5,  5,  5,  5,  5,\n     5,  5,  6,  6,  6,  6,  6,  6,  6,\n     6,  6,  6,  6,  6,  6,  6,  7,  7,\n     7,  7,  7,  7,  7,  7,  7,  7,  7,\n     7,  7,  7,  7,  7,  7,  7,  8,  8,\n     8,  8,  8,  8,  8,  8,  8,  8,  8,\n     8,  8,  8,  8,  8,  8,  8,  8,  8,\n     8,  8,  8,  8,  9,  9,  9,  9,  9,\n     9,  9,  9,  9,  9,  9,  9,  9,  9,\n     9,  9,  9,  9,  9,  9,  9,  9,  9,\n     9, 10, 10, 10, 10, 10, 10, 10, 10,\n    10, 10, 10, 10, 10, 10, 10, 10, 10,\n    10, 10, 10, 10, 10, 10, 10, 10, 10,\n    11, 11, 11, 11, 11, 11, 11, 11, 11,\n    11, 11, 11\n};\n\nstatic const uint16_t A129_code[] = {\n    0x0008, 0x000a, 0x0009, 0x0000, 0x001f, 0x0018, 0x0017, 0x000c, 0x000b,\n    0x0005, 0x0004, 0x003c, 0x003a, 0x0036, 0x0035, 0x002d, 0x002c, 0x001c,\n    0x001b, 0x0013, 0x0012, 0x000e, 0x000d, 0x0006, 0x0005, 0x007a, 0x0077,\n    0x0071, 0x0070, 0x0068, 0x0067, 0x0064, 0x003f, 0x003c, 0x003b, 0x0034,\n    0x002b, 0x0028, 0x0023, 0x0020, 0x001f, 0x000f, 0x000e, 0x00f7, 0x00f6,\n    0x00e7, 0x00e6, 0x00df, 0x00de, 0x00d3, 0x00d2, 0x00cb, 0x00ca, 0x007b,\n    0x007a, 0x0074, 0x006b, 0x0054, 0x0053, 0x0044, 0x0043, 0x003c, 0x0033,\n    0x0031, 0x0030, 0x0011, 0x0010, 0x01da, 0x01d9, 0x01ca, 0x01c9, 0x01ba,\n    0x01b9, 0x019b, 0x019a, 0x00fb, 0x00fa, 0x00f8, 0x00eb, 0x00d5, 0x00d4,\n    0x00aa, 0x00a5, 0x008b, 0x008a, 0x0084, 0x007b, 0x0065, 0x0064, 0x0025,\n    0x0024, 0x03b6, 0x03b1, 0x0397, 0x0396, 0x0390, 0x0377, 0x0371, 0x0370,\n    0x0332, 0x0331, 0x01f3, 0x01f2, 0x01d5, 0x01d4, 0x0157, 0x0156, 0x0149,\n    0x0148, 0x010b, 0x010a, 0x00f5, 0x00f4, 0x004f, 0x004e, 0x004d, 0x004c,\n    0x076f, 0x076e, 0x0761, 0x0760, 0x0723, 0x0722, 0x06ed, 0x06ec, 0x0667,\n    0x0666, 0x0661, 0x0660\n};\n\n//\n// Table B129\n//\nstatic const uint8_t B129_len[] = {\n     5,  5,  5,  5,  5,  5,  6,  6,  6,\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     6,  6,  6,  6,  6,  6,  6,  6,  7,\n     7,  7,  7,  7,  7,  7,  7,  7,  7,\n     7,  7,  7,  7,  7,  7,  7,  7,  7,\n     7,  7,  7,  7,  7,  7,  7,  7,  7,\n     8,  8,  8,  8,  8,  8,  8,  8,  8,\n     8,  8,  8,  8,  8,  8,  8,  8,  8,\n     8,  8,  8,  8,  8,  8,  9,  9,  9,\n     9,  9,  9,  9,  9,  9,  9,  9,  9,\n     9,  9,  9,  9, 10, 10, 10, 10, 10,\n    10, 10, 10, 10, 10, 10, 11, 11, 11,\n    11, 11, 11, 11, 12, 12, 12, 12, 12,\n    13, 14, 14\n};\n\nstatic const uint16_t B129_code[] = {\n    0x000a, 0x0007, 0x0006, 0x0004, 0x0003, 0x0000, 0x003f, 0x003c, 0x003b,\n    0x0039, 0x0038, 0x0035, 0x0034, 0x0032, 0x0031, 0x002e, 0x002d, 0x002b,\n    0x002a, 0x0027, 0x0026, 0x0023, 0x0022, 0x0020, 0x001f, 0x001c, 0x001b,\n    0x0019, 0x0018, 0x0016, 0x0013, 0x0010, 0x000b, 0x0005, 0x0004, 0x007d,\n    0x007c, 0x007a, 0x0075, 0x006e, 0x006d, 0x0067, 0x0066, 0x0060, 0x005f,\n    0x0059, 0x0058, 0x0051, 0x0050, 0x004a, 0x0049, 0x0042, 0x003d, 0x003b,\n    0x003a, 0x0034, 0x002f, 0x0025, 0x0024, 0x0015, 0x0014, 0x0006, 0x0005,\n    0x00f7, 0x00f6, 0x00df, 0x00de, 0x00d9, 0x00d8, 0x00bd, 0x00bc, 0x00a6,\n    0x00a5, 0x0097, 0x0096, 0x0090, 0x0087, 0x0079, 0x0078, 0x006a, 0x005d,\n    0x0047, 0x0046, 0x0044, 0x000f, 0x0009, 0x0008, 0x01d2, 0x01d1, 0x0187,\n    0x0186, 0x0184, 0x014f, 0x0149, 0x0148, 0x010d, 0x010c, 0x00d7, 0x00d6,\n    0x00b8, 0x008b, 0x001d, 0x001c, 0x03a6, 0x03a1, 0x030b, 0x030a, 0x029c,\n    0x0247, 0x0246, 0x0245, 0x0173, 0x0172, 0x0114, 0x074f, 0x0741, 0x0740,\n    0x053a, 0x0489, 0x0488, 0x022b, 0x0e9d, 0x0e9c, 0x0a76, 0x0455, 0x0454,\n    0x14ef, 0x29dd, 0x29dc\n};\n\n//\n// Table C129\n//\nstatic const uint8_t C129_len[] = {\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     6,  7,  7,  7,  7,  7,  7,  7,  7,\n     7,  7,  7,  7,  7,  7,  7,  7,  7,\n     7,  7,  7,  7,  7,  7,  7,  7,  7,\n     7,  7,  7,  7,  7,  7,  7,  7,  7,\n     7,  7,  8,  8,  8,  8,  8,  8,  8,\n     8,  8,  8,  8,  8,  8,  8,  8,  8,\n     8,  8,  8,  8,  8,  8,  8,  8,  9,\n     9,  9,  9,  9,  9,  9,  9,  9,  9,\n     9,  9,  9,  9, 10, 10, 10, 10, 10,\n    10, 10, 10, 10, 11, 11, 11, 11, 11,\n    12, 13, 13\n};\n\nstatic const uint16_t C129_code[] = {\n    0x003a, 0x0037, 0x0036, 0x0034, 0x0033, 0x0031, 0x0030, 0x002e, 0x002d,\n    0x002b, 0x002a, 0x0028, 0x0027, 0x0025, 0x0024, 0x0022, 0x0021, 0x001e,\n    0x001d, 0x001b, 0x001a, 0x0018, 0x0017, 0x0015, 0x0014, 0x0012, 0x0011,\n    0x000e, 0x000d, 0x000c, 0x000b, 0x0008, 0x0007, 0x0006, 0x0005, 0x0003,\n    0x0002, 0x007f, 0x007e, 0x007c, 0x007b, 0x0079, 0x0078, 0x0076, 0x0073,\n    0x0071, 0x0070, 0x006a, 0x0065, 0x005f, 0x005e, 0x0058, 0x0053, 0x004d,\n    0x004c, 0x0046, 0x0041, 0x0040, 0x003f, 0x0038, 0x0033, 0x002d, 0x002c,\n    0x0027, 0x0026, 0x001f, 0x001e, 0x0014, 0x0013, 0x0012, 0x0009, 0x0003,\n    0x0002, 0x0000, 0x00fb, 0x00f5, 0x00f4, 0x00ee, 0x00e5, 0x00d7, 0x00d6,\n    0x00c8, 0x00b3, 0x00a5, 0x00a4, 0x008f, 0x008e, 0x007c, 0x0073, 0x0065,\n    0x0064, 0x0042, 0x0041, 0x002b, 0x002a, 0x0011, 0x0010, 0x0002, 0x01f5,\n    0x01df, 0x01de, 0x01c8, 0x0193, 0x0165, 0x0164, 0x00fb, 0x00fa, 0x00e4,\n    0x0087, 0x0081, 0x0080, 0x0006, 0x03e9, 0x03e8, 0x0393, 0x0325, 0x0324,\n    0x01ca, 0x010d, 0x010c, 0x000f, 0x0725, 0x0724, 0x0396, 0x001d, 0x001c,\n    0x072f, 0x0e5d, 0x0e5c\n};\n\n//\n// Table D129\n//\nstatic const uint8_t D129_len[] = {\n     4,  4,  4,  4,  4,  5,  5,  5,  5,\n     5,  5,  5,  5,  5,  5,  5,  6,  6,\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     7,  7,  7,  7,  7,  7,  7,  7,  7,\n     7,  7,  8,  8,  8,  8,  8,  8,  8,\n     8,  8,  8,  8,  9,  9,  9,  9,  9,\n     9,  9,  9,  9,  9,  9,  9, 10, 10,\n    10, 10, 10, 10, 10, 10, 10, 10, 11,\n    11, 11, 11, 11, 11, 11, 11, 11, 11,\n    12, 12, 12, 12, 12, 12, 12, 12, 12,\n    12, 12, 12, 13, 13, 13, 13, 13, 13,\n    13, 13, 14, 14, 14, 14, 14, 14, 14,\n    14, 14, 14, 15, 15, 15, 15, 15, 15,\n    16, 16, 16, 16, 16, 16, 16, 16, 16,\n    16, 16, 16\n};\n\nstatic const uint16_t D129_code[] = {\n    0x0009, 0x0006, 0x0005, 0x0002, 0x0001, 0x001e, 0x001d, 0x001a, 0x0019,\n    0x0016, 0x0015, 0x0010, 0x000f, 0x0008, 0x0007, 0x0000, 0x003f, 0x0038,\n    0x0037, 0x0030, 0x002f, 0x0028, 0x0023, 0x001c, 0x0013, 0x000c, 0x0003,\n    0x007c, 0x0073, 0x006c, 0x0063, 0x005c, 0x0053, 0x0044, 0x003b, 0x0024,\n    0x001b, 0x0004, 0x00fb, 0x00e4, 0x00db, 0x00c4, 0x00bb, 0x00a4, 0x008b,\n    0x0074, 0x004b, 0x0034, 0x000b, 0x01f5, 0x01f4, 0x01b5, 0x01b4, 0x0175,\n    0x0174, 0x0115, 0x0114, 0x0095, 0x0094, 0x0015, 0x0014, 0x0395, 0x0394,\n    0x0315, 0x0314, 0x0295, 0x0294, 0x01d5, 0x01d4, 0x00d6, 0x00d5, 0x072e,\n    0x072d, 0x062e, 0x062d, 0x052e, 0x052d, 0x03ae, 0x03ad, 0x01af, 0x01ae,\n    0x0e5f, 0x0e5e, 0x0c5f, 0x0c5e, 0x0c58, 0x0a5f, 0x0a58, 0x075f, 0x0758,\n    0x0353, 0x0351, 0x0350, 0x1cb2, 0x1cb1, 0x18b2, 0x14bd, 0x0ebd, 0x0ebc,\n    0x0eb2, 0x06a5, 0x3967, 0x3966, 0x3960, 0x3167, 0x2979, 0x2978, 0x2964,\n    0x1d67, 0x0d49, 0x0d48, 0x72c2, 0x62cd, 0x52cb, 0x52ca, 0x3acd, 0x3acc,\n    0xe587, 0xe586, 0xc599, 0xc598, 0xa59f, 0xa59e, 0xa59d, 0xa59c, 0xa59b,\n    0xa59a, 0xa599, 0xa598\n};\n\n//\n// Table E129\n//\nstatic const uint8_t E129_len[] = {\n     5,  5,  5,  5,  5,  5,  5,  5,  5,\n     5,  5,  5,  6,  6,  6,  6,  6,  6,\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     6,  6,  6,  7,  7,  7,  7,  7,  7,\n     7,  7,  7,  7,  7,  7,  7,  7,  7,\n     7,  8,  8,  8,  8,  8,  8,  8,  8,\n     8,  8,  8,  9,  9,  9,  9,  9,  9,\n     9,  9,  9,  9, 10, 10, 10, 10, 10,\n    10, 10, 10, 10, 11, 11, 11, 11, 11,\n    11, 11, 11, 12, 12, 12, 12, 12, 12,\n    13, 13, 13, 13, 13, 13, 14, 14, 14,\n    14, 14, 14, 15, 15, 15, 15, 15, 15,\n    16, 16, 16, 16, 16, 16, 16, 16, 16,\n    16, 16, 16\n};\n\nstatic const uint16_t E129_code[] = {\n    0x000c, 0x000b, 0x000a, 0x0009, 0x0008, 0x0007, 0x0006, 0x0004, 0x0003,\n    0x0002, 0x0001, 0x0000, 0x003f, 0x003d, 0x003c, 0x003b, 0x003a, 0x0038,\n    0x0037, 0x0035, 0x0034, 0x0033, 0x0032, 0x002f, 0x002e, 0x002d, 0x002c,\n    0x002a, 0x0029, 0x0026, 0x0025, 0x0024, 0x0023, 0x0020, 0x001f, 0x001d,\n    0x001c, 0x001a, 0x000b, 0x007d, 0x007c, 0x006d, 0x006c, 0x0062, 0x0061,\n    0x0057, 0x0056, 0x004f, 0x004e, 0x0044, 0x0043, 0x003c, 0x0037, 0x0015,\n    0x0014, 0x00e6, 0x00e5, 0x00c6, 0x00c1, 0x00a3, 0x00a2, 0x008b, 0x008a,\n    0x007b, 0x007a, 0x006c, 0x01cf, 0x01c9, 0x01c8, 0x0181, 0x0180, 0x0141,\n    0x0140, 0x010a, 0x0109, 0x00da, 0x039d, 0x031e, 0x031d, 0x0286, 0x0285,\n    0x0217, 0x0216, 0x0210, 0x01b7, 0x0738, 0x063f, 0x0638, 0x050f, 0x0508,\n    0x0423, 0x036d, 0x036c, 0x0c7d, 0x0c7c, 0x0a1d, 0x0a1c, 0x0845, 0x0844,\n    0x1ce6, 0x1ce5, 0x18e6, 0x18e5, 0x1426, 0x1425, 0x39cf, 0x39ce, 0x31cf,\n    0x31ce, 0x284e, 0x2849, 0x7393, 0x7392, 0x7390, 0x6393, 0x5091, 0x5090,\n    0xe723, 0xe722, 0xc724, 0xa13d, 0xc725, 0xa13e, 0xc722, 0xa13f, 0xc723,\n    0xc720, 0xc721, 0xa13c\n};\n\n//\n// Table F129\n//\nstatic const uint8_t F129_len[] = {\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     7,  7,  7,  7,  7,  7,  7,  7,  7,\n     7,  7,  7,  7,  7,  7,  7,  7,  7,\n     7,  7,  7,  7,  7,  7,  8,  8,  8,\n     8,  8,  8,  8,  8,  8,  8,  8,  8,\n     8,  8,  8,  8,  8,  9,  9,  9,  9,\n     9,  9,  9,  9,  9,  9,  9,  9,  9,\n     9, 10, 10, 10, 10, 10, 10, 10, 10,\n    10, 10, 10, 11, 11, 11, 11, 11, 11,\n    12, 12, 12, 12, 12, 12, 13, 13, 13,\n    14, 15, 15\n};\n\nstatic const uint16_t F129_code[] = {\n    0x0038, 0x0037, 0x0036, 0x0034, 0x0033, 0x0032, 0x0031, 0x0030, 0x002f,\n    0x002e, 0x002d, 0x002c, 0x002b, 0x0029, 0x0028, 0x0027, 0x0026, 0x0024,\n    0x0023, 0x0022, 0x0021, 0x001f, 0x001e, 0x001d, 0x001c, 0x001a, 0x0019,\n    0x0017, 0x0016, 0x0015, 0x0014, 0x0012, 0x0011, 0x000f, 0x000e, 0x000c,\n    0x000b, 0x0009, 0x0008, 0x0007, 0x0006, 0x0003, 0x0002, 0x0001, 0x0000,\n    0x007d, 0x007c, 0x007b, 0x007a, 0x0078, 0x0077, 0x0074, 0x0073, 0x0072,\n    0x006b, 0x0054, 0x004b, 0x0041, 0x0040, 0x0036, 0x0031, 0x0027, 0x0026,\n    0x001b, 0x001a, 0x0014, 0x000b, 0x000a, 0x0009, 0x00fe, 0x00fd, 0x00f3,\n    0x00f2, 0x00eb, 0x00ea, 0x00d5, 0x00d4, 0x0095, 0x0094, 0x006e, 0x0061,\n    0x0042, 0x0041, 0x002b, 0x002a, 0x0010, 0x01ff, 0x01f9, 0x01f8, 0x01da,\n    0x01d9, 0x0157, 0x0156, 0x0154, 0x00df, 0x00c0, 0x0087, 0x0081, 0x0080,\n    0x0022, 0x03fd, 0x03b7, 0x03b6, 0x03b0, 0x02ab, 0x01bd, 0x01bc, 0x010d,\n    0x010c, 0x0047, 0x0046, 0x07f8, 0x0763, 0x0554, 0x0307, 0x0306, 0x0305,\n    0x0ff3, 0x0ff2, 0x0ec4, 0x0aab, 0x0609, 0x0608, 0x1d8a, 0x1555, 0x1554,\n    0x3b17, 0x762d, 0x762c\n};\n\n//\n// Table G129\n//\nstatic const uint8_t G129_len[] = {\n     4,  5,  5,  5,  5,  5,  5,  5,  5,\n     5,  5,  5,  5,  5,  5,  6,  6,  6,\n     6,  6,  6,  6,  6,  6,  6,  6,  6,\n     6,  6,  6,  6,  7,  7,  7,  7,  7,\n     7,  7,  7,  7,  7,  7,  7,  7,  7,\n     7,  7,  7,  8,  8,  8,  8,  8,  8,\n     8,  8,  8,  8,  8,  8,  8,  8,  8,\n     9,  9,  9,  9,  9,  9,  9,  9,  9,\n     9,  9,  9,  9,  9,  9,  9, 10, 10,\n    10, 10, 10, 10, 10, 10, 10, 10, 10,\n    10, 10, 10, 10, 10, 11, 11, 11, 11,\n    11, 11, 11, 11, 11, 11, 11, 11, 11,\n    11, 11, 11, 12, 12, 12, 12, 12, 12,\n    12, 12, 12, 12, 12, 12, 12, 12, 13,\n    13, 13, 13\n};\n\nstatic const uint16_t G129_code[] = {\n    0x0000, 0x001d, 0x001c, 0x0019, 0x0018, 0x0015, 0x0014, 0x0011, 0x0010,\n    0x000d, 0x000c, 0x0009, 0x0008, 0x0005, 0x0004, 0x003f, 0x003e, 0x0037,\n    0x0036, 0x002f, 0x002e, 0x0027, 0x0026, 0x001f, 0x001e, 0x0017, 0x0016,\n    0x000f, 0x000e, 0x0007, 0x0006, 0x007b, 0x007a, 0x006b, 0x006a, 0x005b,\n    0x005a, 0x004b, 0x004a, 0x003b, 0x003a, 0x002b, 0x002a, 0x001b, 0x001a,\n    0x000b, 0x000a, 0x0008, 0x00f3, 0x00f0, 0x00d3, 0x00d0, 0x00b3, 0x00b0,\n    0x0093, 0x0090, 0x0073, 0x0070, 0x0053, 0x0050, 0x0033, 0x0030, 0x0013,\n    0x01e4, 0x01e3, 0x01a5, 0x01a4, 0x0165, 0x0164, 0x0125, 0x0124, 0x00e5,\n    0x00e4, 0x00e2, 0x00a5, 0x00a2, 0x0065, 0x0062, 0x0025, 0x03ca, 0x03c5,\n    0x0347, 0x0346, 0x02c7, 0x02c6, 0x02c4, 0x0247, 0x0244, 0x01c7, 0x0149,\n    0x0148, 0x00c9, 0x00c8, 0x00c6, 0x0049, 0x0796, 0x0789, 0x068b, 0x068a,\n    0x0688, 0x058b, 0x048d, 0x048c, 0x048a, 0x038d, 0x028f, 0x028e, 0x028c,\n    0x018f, 0x0091, 0x0090, 0x0f2e, 0x0f11, 0x0d13, 0x0d12, 0x0b15, 0x0b14,\n    0x0917, 0x0916, 0x0719, 0x0718, 0x051b, 0x051a, 0x031d, 0x031c, 0x1e5f,\n    0x1e5e, 0x1e21, 0x1e20\n};\n\n//\n// Code books\n//\nstatic const struct huffman transition_mode_huff[] = {\n    { A4_len, A4_code, 4 },\n    { B4_len, B4_code, 4 },\n    { C4_len, C4_code, 4 },\n    { D4_len, D4_code, 4 }\n};\n\nstatic const struct huffman scale_factor_huff[] = {\n    { SA129_len, SA129_code, 129 },\n    { SB129_len, SB129_code, 129 },\n    { SC129_len, SC129_code, 129 },\n    { SD129_len, SD129_code, 129 },\n    { SE129_len, SE129_code, 129 }\n};\n\nstatic const struct huffman bit_allocation_huff[] = {\n    { A12_len, A12_code, 12 },\n    { B12_len, B12_code, 12 },\n    { C12_len, C12_code, 12 },\n    { D12_len, D12_code, 12 },\n    { E12_len, E12_code, 12 }\n};\n\nstatic const struct huffman quant_index_huff_0[] = {\n    { A3_len, A3_code, 3 }\n};\n\nstatic const struct huffman quant_index_huff_1[] = {\n    { A5_len, A5_code, 5 },\n    { B5_len, B5_code, 5 },\n    { C5_len, C5_code, 5 }\n};\n\nstatic const struct huffman quant_index_huff_2[] = {\n    { A7_len, A7_code, 7 },\n    { B7_len, B7_code, 7 },\n    { C7_len, C7_code, 7 }\n};\n\nstatic const struct huffman quant_index_huff_3[] = {\n    { A9_len, A9_code, 9 },\n    { B9_len, B9_code, 9 },\n    { C9_len, C9_code, 9 }\n};\n\nstatic const struct huffman quant_index_huff_4[] = {\n    { A13_len, A13_code, 13 },\n    { B13_len, B13_code, 13 },\n    { C13_len, C13_code, 13 }\n};\n\nstatic const struct huffman quant_index_huff_5[] = {\n    { A17_len, A17_code, 17 },\n    { B17_len, B17_code, 17 },\n    { C17_len, C17_code, 17 },\n    { D17_len, D17_code, 17 },\n    { E17_len, E17_code, 17 },\n    { F17_len, F17_code, 17 },\n    { G17_len, G17_code, 17 }\n};\n\nstatic const struct huffman quant_index_huff_6[] = {\n    { A25_len, A25_code, 25 },\n    { B25_len, B25_code, 25 },\n    { C25_len, C25_code, 25 },\n    { D25_len, D25_code, 25 },\n    { E25_len, E25_code, 25 },\n    { F25_len, F25_code, 25 },\n    { G25_len, G25_code, 25 }\n};\n\nstatic const struct huffman quant_index_huff_7[] = {\n    { A33_len, A33_code, 33 },\n    { B33_len, B33_code, 33 },\n    { C33_len, C33_code, 33 },\n    { D33_len, D33_code, 33 },\n    { E33_len, E33_code, 33 },\n    { F33_len, F33_code, 33 },\n    { G33_len, G33_code, 33 }\n};\n\nstatic const struct huffman quant_index_huff_8[] = {\n    { A65_len, A65_code, 65 },\n    { B65_len, B65_code, 65 },\n    { C65_len, C65_code, 65 },\n    { D65_len, D65_code, 65 },\n    { E65_len, E65_code, 65 },\n    { F65_len, F65_code, 65 },\n    { G65_len, G65_code, 65 }\n};\n\nstatic const struct huffman quant_index_huff_9[] = {\n    { A129_len, A129_code, 129 },\n    { B129_len, B129_code, 129 },\n    { C129_len, C129_code, 129 },\n    { D129_len, D129_code, 129 },\n    { E129_len, E129_code, 129 },\n    { F129_len, F129_code, 129 },\n    { G129_len, G129_code, 129 }\n};\n\nstatic const struct huffman * const quant_index_group_huff[] = {\n    quant_index_huff_0,\n    quant_index_huff_1,\n    quant_index_huff_2,\n    quant_index_huff_3,\n    quant_index_huff_4,\n    quant_index_huff_5,\n    quant_index_huff_6,\n    quant_index_huff_7,\n    quant_index_huff_8,\n    quant_index_huff_9\n};\n\nstatic const uint8_t quant_index_group_size[] = {\n    1, 3, 3, 3, 3, 7, 7, 7, 7, 7\n};\n"
  },
  {
    "path": "libdcadec/core_tables.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n// Table 5-4: Audio channel arrangement\nstatic const uint8_t audio_mode_nch[16] = {\n    1, 2, 2, 2, 2, 3, 3, 4, 4, 5, 6, 6, 6, 7, 8, 8\n};\n\n// Table 5-5: Core audio sampling frequencies\nstatic const int32_t sample_rates[16] = {\n    0,      8000,   16000,  32000,\n    0,      0,      11025,  22050,\n    44100,  0,      0,      12000,\n    24000,  48000,  0,      0\n};\n\n// Table 5-7: Rate parameter versus targeted bit-rate\nstatic const int32_t bit_rates[32] = {\n     32000,   56000,  64000,  96000, 112000, 128000, 192000, 224000,\n    256000,  320000, 384000, 448000, 512000, 576000, 640000, 768000,\n    960000, 1024000,1152000,1280000,1344000,1408000,1411200,1472000,\n    1536000,     -1,     -1,     -1,     -1,     0,      -1,     -2\n};\n\n// Table 5-17: Quantization resolution of source PCM samples\nstatic const uint8_t sample_res[8] = {\n    16, 16, 20, 20, 0, 24, 24, 0\n};\n\n// Table 5-26: Selection of quantization levels and codebooks\nstatic const int32_t quant_levels[32] = {\n          0,       3,       5,     7,      9,     13,     17,      25,\n         32,      64,     128,   256,    512,   1024,   2048,    4096,\n       8192,   16384,   32768, 65536, 131072, 262144, 524288, 1048576,\n    2097152, 4194304, 8388608,    -1,     -1,     -1,     -1,      -1\n};\n\n// Table 5-26: Selection of quantization levels and codebooks\nstatic const uint8_t quant_index_sel_nbits[10] = {\n    1, 2, 2, 2, 2, 3, 3, 3, 3, 3\n};\n\n// Table 5-27: Scale factor adjustment index\nstatic const int32_t scale_factor_adj[4] = {\n    4194304, 4718592, 5242880, 6029312\n};\n\n// Annex D.1.1 - 6 bit quantization (nominal 2,2 dB step)\nstatic const int32_t scale_factors_6bit[64] = {\n          1,       2,       2,       3,       3,       4,       6,       7,\n         10,      12,      16,      20,      26,      34,      44,      56,\n         72,      93,     120,     155,     200,     257,     331,     427,\n        550,     708,     912,    1175,    1514,    1950,    2512,    3236,\n       4169,    5370,    6918,    8913,   11482,   14791,   19055,   24547,\n      31623,   40738,   52481,   67608,   87096,  112202,  144544,  186209,\n     239883,  309030,  398107,  512861,  660693,  851138, 1096478, 1412538,\n    1819701, 2344229, 3019952, 3890451, 5011872, 6456542, 8317638,       0\n};\n\n// Annex D.1.2 - 7 bit quantization (nominal 1,1 dB step)\nstatic const int32_t scale_factors_7bit[128] = {\n          1,       1,       2,       2,       2,       2,       3,       3,\n          3,       4,       4,       5,       6,       7,       7,       8,\n         10,      11,      12,      14,      16,      18,      20,      23,\n         26,      30,      34,      38,      44,      50,      56,      64,\n         72,      82,      93,     106,     120,     136,     155,     176,\n        200,     226,     257,     292,     331,     376,     427,     484,\n        550,     624,     708,     804,     912,    1035,    1175,    1334,\n       1514,    1718,    1950,    2213,    2512,    2851,    3236,    3673,\n       4169,    4732,    5370,    6095,    6918,    7852,    8913,   10116,\n      11482,   13032,   14791,   16788,   19055,   21627,   24547,   27861,\n      31623,   35892,   40738,   46238,   52481,   59566,   67608,   76736,\n      87096,   98855,  112202,  127350,  144544,  164059,  186209,  211349,\n     239883,  272270,  309030,  350752,  398107,  451856,  512861,  582103,\n     660693,  749894,  851138,  966051, 1096478, 1244515, 1412538, 1603245,\n    1819701, 2065380, 2344229, 2660725, 3019952, 3427678, 3890451, 4415704,\n    5011872, 5688529, 6456542, 7328245, 8317638,       0,       0,       0\n};\n\n// Annex D.2.1 - Lossy quantization\nstatic const int32_t step_size_lossy[32] = {\n         0, 6710886, 4194304, 3355443, 2474639, 2097152, 1761608, 1426063,\n    796918,  461373,  251658,  146801,   79692,   46137,   27263,   16777,\n     10486,    5872,    3355,    1887,    1258,     713,     336,     168,\n        84,      42,      21,      -1,      -1,      -1,      -1,      -1\n};\n\n// Annex D.2.2 - Lossless quantization\nstatic const int32_t step_size_lossless[32] = {\n         0, 4194304, 2097152, 1384120, 1048576, 696254, 524288, 348127,\n    262144,  131072,   65431,   33026,   16450,   8208,   4100,   2049,\n      1024,     512,     256,     128,      64,     32,     16,      8,\n         4,       2,       1,      -1,      -1,     -1,     -1,     -1\n};\n\n// Annex D.3 - Scale factor for joint intensity coding\nstatic const int32_t joint_scale_factors[129] = {\n       3288,    3490,    3691,    3909,    4144,    4387,    4647,    4924,\n       5218,    5528,    5855,    6199,    6568,    6963,    7374,    7810,\n       8271,    8758,    9278,    9831,   10410,   11031,   11685,   12373,\n      13103,   13883,   14705,   15578,   16500,   17482,   18514,   19613,\n      20770,   22003,   23312,   24688,   26156,   27699,   29343,   31080,\n      32925,   34871,   36943,   39133,   41448,   43906,   46506,   49258,\n      52177,   55273,   58544,   62017,   65691,   69584,   73711,   78073,\n      82703,   87602,   92795,   98289,  104111,  110285,  116820,  123740,\n     131072,  138840,  147069,  155776,  165012,  174785,  185145,  196117,\n     207735,  220042,  233086,  246894,  261523,  277017,  293434,  310823,\n     329236,  348748,  369409,  391303,  414490,  439043,  465064,  492621,\n     521805,  552725,  585475,  620170,  656920,  695843,  737073,  780745,\n     827008,  876014,  927923,  982902, 1041144, 1102834, 1168181, 1237404,\n    1310720, 1388382, 1470649, 1557790, 1650098, 1747876, 1851441, 1961147,\n    2077355, 2200441, 2330825, 2468935, 2615232, 2770195, 2934335, 3108206,\n    3292378, 3487463, 3694108, 3913000, 4144862, 4390455, 4650611, 4926176,\n    5218066\n};\n\n// Annex D.6 - Block code books\nstatic const uint8_t block_code_nbits[8] = {\n    0, 7, 10, 12, 13, 15, 17, 19\n};\n"
  },
  {
    "path": "libdcadec/core_vectors.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\nstatic const int16_t adpcm_coeffs[4096][4] = {\n    {   9928,  -2618,  -1093,  -1263 },\n    {  11077,  -2876,  -1747,   -308 },\n    {  10503,  -1082,  -1426,  -1167 },\n    {   9337,  -2403,  -1495,    274 },\n    {  10698,  -2529,   -532,  -1122 },\n    {  10368,  -3974,  -1264,   -750 },\n    {  10070,  -3667,    346,    863 },\n    {  10278,  -3093,    311,   -576 },\n    {   9894,  -1330,  -1428,   -860 },\n    {  10544,  -1923,  -1058,   -971 },\n    {  10996,  -1632,   -841,  -1404 },\n    {  11832,  -3465,   1658,  -1990 },\n    {  10852,   -688,  -2658,   -499 },\n    {  10546,  -1749,   -147,  -1733 },\n    {  10801,  -1004,   -708,  -1453 },\n    {  10588,   -441,  -2113,   -952 },\n    {  10141,  -3331,   -582,  -1432 },\n    {   9608,  -2590,    383,    258 },\n    {  11422,  -3265,    229,  -1544 },\n    {  10460,  -1338,   -713,  -1568 },\n    {  10306,  -1721,  -1660,   -603 },\n    {   9580,  -1812,  -1235,  -1061 },\n    {  11471,  -2285,  -1617,   -607 },\n    {  10081,  -2225,  -1408,   -868 },\n    {  10715,  -2624,  -1367,   -704 },\n    {  10616,  -1871,  -2770,    -35 },\n    {   9352,  -2340,  -1024,  -1566 },\n    {  11065,  -1458,  -1926,   -735 },\n    {  11334,  -2056,  -1041,  -1144 },\n    {   9825,  -2048,   -794,  -1536 },\n    {  11850,  -2695,  -1123,   -867 },\n    {  10654,  -2226,  -1891,   -373 },\n    {  10024,  -1557,   -808,  -1069 },\n    {  11142,  -1266,  -3238,    128 },\n    {  11729,  -3282,   -514,  -1011 },\n    {  11402,  -2094,  -2335,   -189 },\n    {  10195,  -3658,    181,  -1875 },\n    {  11431,  -2626,   -404,  -1377 },\n    {  11001,  -3868,   -619,  -1077 },\n    {  10894,  -2559,    274,  -1758 },\n    {   9633,  -1482,  -2253,   -773 },\n    {  11245,  -3321,    830,  -1972 },\n    {   9768,  -2701,   -199,  -1859 },\n    {  10500,  -2042,    525,  -2043 },\n    {  11669,  -4069,    293,  -1468 },\n    {   9192,  -1991,   -583,    -61 },\n    {  10057,  -3220,  -2015,   -473 },\n    {   9497,  -2315,  -2490,   -467 },\n    {  10455,  -3069,  -1194,  -1007 },\n    {   9994,  -1936,    -60,  -1225 },\n    {   9295,  -2156,  -1761,  -1134 },\n    {  10085,  -3748,  -1026,    197 },\n    {   9334,  -2360,    804,   -351 },\n    {  11561,  -2553,   1352,  -2313 },\n    {  12837,  -3998,   1195,  -1958 },\n    {  10114,  -1100,  -2414,   -394 },\n    {   9341,  -2530,    315,    755 },\n    {  10131,  -3164,   1411,   -674 },\n    {   9535,   -905,  -1551,    579 },\n    {  11717,  -1519,  -3051,     91 },\n    {   9824,  -2911,  -2775,    192 },\n    {   9662,  -2934,   -561,   1450 },\n    {  11085,  -3392,  -1298,   -659 },\n    {   8955,  -2102,  -1899,    703 },\n    {   8607,  -1742,  -4348,    814 },\n    {   7640,  -2063,  -3617,     52 },\n    {   7074,   -826,  -4325,   4375 },\n    {   7714,    584,  -4238,   1927 },\n    {   6355,   -952,  -4912,   3127 },\n    {   7069,   -660,  -6413,   4087 },\n    {   8313,   -132,  -2964,   -876 },\n    {   6952,  -1422,  -3962,    -24 },\n    {   9299,   -734,  -3088,   -263 },\n    {   9484,   -574,  -4513,    466 },\n    {   7246,    -91,  -3735,   -704 },\n    {   8325,  -1417,  -3090,   -530 },\n    {   6469,  -1226,  -4757,    829 },\n    {   6652,   -368,  -5682,   1393 },\n    {   7971,  -1278,  -2284,   1205 },\n    {   7229,   -699,  -3556,   1840 },\n    {   7994,   1284,  -2729,    732 },\n    {   9005,   -698,  -4522,   2189 },\n    {   6963,    197,  -2727,    380 },\n    {   8527,    135,  -3991,   -213 },\n    {   8840,    934,  -3014,   -567 },\n    {  10125,    418,  -3284,   -371 },\n    {   6367,    361,  -2318,   2554 },\n    {   7892,    172,  -5247,   4673 },\n    {   6674,    387,  -5424,   4398 },\n    {   6240,    684,  -4047,   1219 },\n    {  11170,   -794,  -5081,   1195 },\n    {  11765,   -648,  -6265,   2052 },\n    {  10845,   -775,  -3837,    366 },\n    {  12496,   -689,  -8260,   3562 },\n    {   7893,  -1166,  -4972,    988 },\n    {   8592,   1052,  -5986,   3087 },\n    {   7277,   1874,  -5685,   3579 },\n    {   6900,   2016,  -4809,   3491 },\n    {   8530,  -2405,  -3250,   1986 },\n    {   9426,    494,  -7067,   5038 },\n    {  10285,    564,  -8210,   5370 },\n    {   8749,  -2207,  -3980,   2852 },\n    {   9653,  -2686,  -4300,   1400 },\n    {   9770,  -2286,  -5663,   4233 },\n    {   8490,     -4,  -7048,   4496 },\n    {   7697,  -1209,  -5328,   3183 },\n    {   6451,    801,  -4324,   -554 },\n    {   7387,   1806,  -5265,    545 },\n    {   7450,  -2302,  -4445,   1418 },\n    {   8817,  -1370,  -5827,   2168 },\n    {  10324,  -2406,  -5629,   2579 },\n    {   8863,  -2578,  -3537,    467 },\n    {   6901,  -1624,  -3169,   3392 },\n    {   7846,    156,  -6948,   3381 },\n    {   7928,  -1115,  -5972,   4816 },\n    {   6089,   -599,  -4368,   -320 },\n    {   7833,   1246,  -3960,   -621 },\n    {   8931,   2521,  -6768,   2052 },\n    {   8900,   1944,  -4126,     40 },\n    {   7661,    -34,  -2855,   2480 },\n    {   5873,    474,  -3262,   3712 },\n    {   7535,   -234,  -4699,    216 },\n    {   5856,    143,  -5142,     73 },\n    {   8944,   -106,  -5874,   3663 },\n    {   7134,    426,  -5879,   2895 },\n    {  10199,   1011,  -4762,    369 },\n    {   8454,    264,  -5971,   1291 },\n    {   7822,  -2449,  -4333,   4540 },\n    {   6200,  -2758,  -2632,   1497 },\n    {   6070,  -4315,  -2699,    414 },\n    {   7047,  -3739,  -3210,   1060 },\n    {   5675,  -3801,  -2717,   -407 },\n    {   4789,  -4063,  -2628,   -744 },\n    {   4023,  -3366,  -3133,   -726 },\n    {   4296,  -2407,  -3381,   -513 },\n    {   4388,  -2931,  -2820,   1512 },\n    {   4559,  -4233,  -1941,   1976 },\n    {   6702,  -3208,  -1755,   1680 },\n    {   4416,  -3521,  -1052,   2984 },\n    {   7154,  -4266,  -1203,   3732 },\n    {   3625,  -4242,  -3244,   1395 },\n    {   6518,  -2856,  -1304,   2887 },\n    {   6170,  -1949,  -3014,   3973 },\n    {   5189,  -2451,  -4020,   3477 },\n    {   6218,  -2988,  -1921,   3844 },\n    {   4827,  -3688,  -1928,   3343 },\n    {   6668,  -3991,  -2805,   3095 },\n    {   5297,  -3115,  -3684,   2390 },\n    {   5354,  -4614,  -2662,   1504 },\n    {   4196,  -3091,  -4147,   1135 },\n    {   3540,  -2893,  -4007,    100 },\n    {   5569,  -1602,  -4007,   1909 },\n    {   4341,  -2091,  -4272,    252 },\n    {   5559,  -2878,  -3832,    498 },\n    {   4548,  -4479,  -2898,    -27 },\n    {   5176,  -2494,  -4635,   1476 },\n    {   3294,  -3485,  -3738,    716 },\n    {   4920,  -1229,  -4195,   -365 },\n    {   3257,  -3518,  -3349,   2862 },\n    {   5286,  -1948,  -3485,   -778 },\n    {   6502,  -3051,   -152,   2854 },\n    {   5864,  -4192,  -1076,   3451 },\n    {   4656,  -3122,  -3448,    179 },\n    {   5907,   -754,  -1596,   3116 },\n    {   7229,  -3680,  -1590,   2892 },\n    {   5107,  -3888,  -3364,    806 },\n    {   6764,  -2635,  -3450,    134 },\n    {   5258,  -2827,  -2844,  -1052 },\n    {   5798,  -1725,  -4305,    205 },\n    {   5404,  -1213,  -3362,    449 },\n    {   6224,  -2738,  -3046,   -581 },\n    {   4223,  -2438,  -2725,   3745 },\n    {   4751,  -3411,  -2123,    116 },\n    {   3868,  -3000,  -3954,   2297 },\n    {   6819,  -2899,  -4277,   2825 },\n    {   4207,  -4754,  -2808,    865 },\n    {   4804,  -1494,  -1997,   4688 },\n    {   5282,  -2213,   -548,   3559 },\n    {   5580,  -1912,   -566,   4370 },\n    {   6168,  -2857,   -672,   4053 },\n    {   6583,  -4515,  -2850,   1670 },\n    {   6511,  -3093,  -3988,   1421 },\n    {   4646,  -1790,  -1443,   3650 },\n    {   5915,   -924,  -2020,    896 },\n    {   7814,  -4181,  -3152,   2007 },\n    {   6190,  -2238,  -4817,   2279 },\n    {   4737,  -4034,  -3288,   1835 },\n    {   8161,  -3633,  -3423,   3137 },\n    {   7415,  -2351,  -2088,   4290 },\n    {   4106,  -2517,    -62,   2905 },\n    {   4909,  -3145,   -614,   4112 },\n    {   4938,  -3281,   -397,   1100 },\n    {   -173,    919,   1589,  -5363 },\n    {    -13,    796,   -295,  -6655 },\n    {  -1860,   -829,   1141,  -4555 },\n    {   2298,   -838,   -664,  -5005 },\n    {   -884,  -1097,   2074,  -4613 },\n    {   -101,    281,   2846,  -4535 },\n    {   1166,    453,   2429,  -5910 },\n    {    879,   -664,   2370,  -5452 },\n    {   1415,   -370,  -1699,  -4727 },\n    {  -1413,   1277,   -669,  -6649 },\n    {   2133,    304,   -968,  -4624 },\n    {    380,    586,  -2087,  -4892 },\n    {   1336,    275,    -82,  -5789 },\n    {  -2459,   1057,    -34,  -5416 },\n    {   2278,  -1758,    866,  -5653 },\n    {   1945,  -2295,   -149,  -5302 },\n    {   1287,  -3525,    996,  -5255 },\n    {   2297,    803,   1177,  -6067 },\n    {    187,   -180,   -619,  -6202 },\n    {   -793,  -2537,   1554,  -5057 },\n    {  -2703,   -204,   -629,  -5853 },\n    {  -1007,   -146,    313,  -5582 },\n    {    830,    357,    869,  -6363 },\n    {   -228,   -575,  -3177,  -4433 },\n    {  -1001,  -1553,   -142,  -5708 },\n    {  -1644,   1683,   1721,  -4533 },\n    {    893,   1924,    -15,  -5791 },\n    {   2195,   2061,   -262,  -5471 },\n    {   3031,    270,    311,  -5096 },\n    {   1912,   1638,  -1523,  -4677 },\n    {  -3142,    -55,    253,  -4914 },\n    {    356,  -1680,    343,  -6123 },\n    {  -2241,  -1734,   -976,  -5939 },\n    {  -2196,  -2893,    547,  -4938 },\n    {  -1245,    126,  -1916,  -5419 },\n    {   -249,  -3755,  -1422,  -5594 },\n    {    575,  -2683,  -1926,  -4566 },\n    {   -762,   1885,    192,  -5880 },\n    {   -811,  -2562,  -1068,  -6013 },\n    {  -2264,  -3086,   -976,  -4775 },\n    {     70,  -1215,   2880,  -4410 },\n    {    714,  -3760,   2916,  -4691 },\n    {   -244,  -3404,   1740,  -4493 },\n    {    684,  -5137,   -328,  -5608 },\n    {   -529,  -3825,  -1786,  -4535 },\n    {   -713,  -4743,  -1118,  -5546 },\n    {   2718,  -3788,   1798,  -5708 },\n    {  -1639,  -3679,  -1564,  -6095 },\n    {   1693,  -2642,  -1389,  -4539 },\n    {    505,  -1573,  -1651,  -4878 },\n    {   -835,  -2256,  -1941,  -5352 },\n    {   1464,   -411,   1993,  -6441 },\n    {    493,  -3184,   -145,  -6148 },\n    {  -1413,    499,  -1617,  -6479 },\n    {   -294,   1722,  -1419,  -5725 },\n    {  -2937,  -1528,   -175,  -4624 },\n    {   -594,  -5911,    -56,  -6146 },\n    {   -300,  -4275,   1156,  -5947 },\n    {    552,  -2643,   2669,  -3959 },\n    {    905,  -4158,   1789,  -5809 },\n    {   1336,  -2009,   2108,  -5903 },\n    {   1555,  -3600,   1110,  -6759 },\n    {  -1294,  -3464,     77,  -6084 },\n    {  -1139,  -4006,  -1270,  -4181 },\n    {  -5094,  -3296,   1092,  -2847 },\n    {  -5503,  -2883,   1984,  -2067 },\n    {  -4671,  -4218,  -1417,  -4132 },\n    {  -3763,  -3818,   1262,  -3082 },\n    {  -5132,  -3430,   2928,   -728 },\n    {  -5957,  -2877,   1251,  -2446 },\n    {  -4425,  -2319,   -212,  -4276 },\n    {  -6201,  -1993,   1774,  -2182 },\n    {  -5500,  -3836,   2201,  -1396 },\n    {  -6934,  -2334,   2366,  -1293 },\n    {  -6124,  -4140,   1337,  -1977 },\n    {  -6553,  -4186,   1756,  -1325 },\n    {  -5126,  -1258,    744,  -3656 },\n    {  -5167,  -1390,   1581,  -2895 },\n    {  -4525,  -3398,   2429,  -1865 },\n    {  -4076,  -3183,   2027,  -2510 },\n    {  -6191,  -3274,   1838,  -1814 },\n    {  -4454,  -2753,   2723,  -1185 },\n    {  -6655,  -4797,    251,  -2595 },\n    {  -6332,  -2232,   1832,    217 },\n    {  -5869,  -1698,    134,    340 },\n    {  -6614,  -1045,   2126,  -1932 },\n    {  -4859,  -2107,   2010,  -2435 },\n    {  -6274,  -1622,   2808,  -1374 },\n    {  -3119,  -3209,    521,  -3988 },\n    {  -5676,  -2082,   -420,  -2711 },\n    {  -7073,  -3623,    696,  -2343 },\n    {  -5986,  -4224,    572,  -2454 },\n    {  -4340,  -4521,    882,  -2771 },\n    {  -6178,  -1933,    535,  -1444 },\n    {  -4923,  -4163,   1744,  -2066 },\n    {  -6410,  -1519,   1058,  -2683 },\n    {  -5077,  -1185,    856,  -2216 },\n    {  -7091,  -2444,    687,  -2597 },\n    {  -5284,  -2165,   3239,   -993 },\n    {  -4763,  -1497,    197,  -3179 },\n    {  -4128,  -4958,   -396,  -3578 },\n    {  -5054,  -3878,   -647,  -2672 },\n    {  -7005,  -3348,   1679,  -1579 },\n    {  -5767,  -1017,   2582,  -1915 },\n    {  -7069,  -2787,   1331,  -2070 },\n    {  -5532,  -2296,    706,  -2950 },\n    {  -5059,  -3543,   -821,  -3637 },\n    {  -6639,  -1835,   1016,   -696 },\n    {  -5611,  -5220,   -694,  -3371 },\n    {  -5994,  -2803,   2933,   -729 },\n    {  -5948,   -619,   1596,  -2676 },\n    {  -5486,  -4419,    153,  -3265 },\n    {  -4329,  -3440,   1646,  -1439 },\n    {  -4083,  -3978,    177,  -3569 },\n    {  -4289,  -2599,   1224,  -3075 },\n    {  -5707,  -3253,   1912,   -759 },\n    {  -6606,  -3437,   2562,   -571 },\n    {  -5254,  -2444,    769,   -352 },\n    {  -6545,  -3154,    582,  -1103 },\n    {  -5328,  -2241,   2566,  -1775 },\n    {  -7216,  -1936,   1538,  -1983 },\n    {  -3730,  -2451,    426,  -3869 },\n    {  -5110,  -1385,   2031,  -1169 },\n    {  -6470,  -2715,    269,  -3123 },\n    {  -5806,  -2480,    -97,  -3832 },\n    {  -3683,  -4916,   -490,  -4330 },\n    {  -6341,  -2083,   -669,   -115 },\n    {  -4913,  -4079,   -837,  -4673 },\n    {  -3274,  -2497,   2334,  -2652 },\n    {  -1286,  -1731,   2550,  -3756 },\n    {  -3375,   -877,    926,  -3977 },\n    {  -2525,  -2079,   2879,  -2625 },\n    {  -5308,   -504,   3111,  -1607 },\n    {  -4904,    460,   4093,  -1232 },\n    {  -1993,   1616,   4656,  -1913 },\n    {  -3481,  -1176,   3119,  -2236 },\n    {  -4132,  -1502,   2339,  -2545 },\n    {  -2542,   1151,   3569,  -2550 },\n    {  -4381,    430,   3147,  -2082 },\n    {  -3888,    867,   3899,  -1657 },\n    {  -2861,   1290,   4202,  -1979 },\n    {  -3893,   -253,   2363,  -2764 },\n    {  -1705,    688,   3827,  -2923 },\n    {  -2223,   2312,   3700,  -3148 },\n    {  -1986,   -720,   5021,   -795 },\n    {  -3177,    242,   1952,  -3352 },\n    {  -1854,   1509,   2528,  -3815 },\n    {  -3173,     97,   5019,   -706 },\n    {  -2689,   -145,   1375,  -3915 },\n    {  -4838,   -385,   2488,  -2427 },\n    {  -4557,   -355,   1603,  -3060 },\n    {  -3522,   1832,   3292,  -2674 },\n    {  -3769,    780,   2378,  -2704 },\n    {  -4323,  -1932,   3414,  -1169 },\n    {  -2740,   1158,   2729,  -3273 },\n    {  -3647,    210,   1464,  -2892 },\n    {  -2342,  -2097,   1513,  -3727 },\n    {  -4422,  -1242,   3130,  -1833 },\n    {  -1308,  -1039,   4290,  -1875 },\n    {  -1754,  -2535,   3298,  -2314 },\n    {  -4102,   -186,   4037,  -1094 },\n    {  -1008,   1570,   3290,    171 },\n    {  -3322,  -2621,   2791,  -1536 },\n    {  -2539,  -2597,   3442,  -1672 },\n    {  -3411,  -2015,   3670,  -1174 },\n    {  -2097,    730,   5581,  -1399 },\n    {  -1510,    -74,   4820,  -2004 },\n    {  -4086,   -868,   4425,   -771 },\n    {   -956,   -986,   3640,  -2925 },\n    {  -2087,  -1250,   3464,  -2458 },\n    {  -3308,  -2411,   1334,  -3667 },\n    {  -2264,   -389,   4004,  -1854 },\n    {   -680,    239,   4058,  -3388 },\n    {  -1357,     30,   2993,  -3658 },\n    {  -3601,   -552,   1177,  -1136 },\n    {  -2641,    442,   4374,  -1625 },\n    {  -2525,    770,   1640,  -3895 },\n    {  -3172,   -891,   3893,  -1608 },\n    {  -2996,     13,   3277,  -2414 },\n    {   -899,   1055,   4470,  -2501 },\n    {   -422,   -584,   3475,  -3787 },\n    {  -1978,   -593,   2566,  -3415 },\n    {  -3150,  -1280,   2362,  -3047 },\n    {  -3592,    224,   1026,  -3932 },\n    {  -4840,  -1189,   3633,   -879 },\n    {  -3952,  -2255,   2916,  -1826 },\n    {  -1695,     28,   1810,   -349 },\n    {   -745,  -2484,   3308,  -3293 },\n    {  -1016,   1563,   5365,  -1823 },\n    {  -2172,  -1787,   4266,  -1287 },\n    {  -1241,  -1951,   3982,  -2413 },\n    {  -2009,  -2639,   2330,  -3480 },\n    {   5105,  -1618,  -2588,  -2015 },\n    {   6497,  -1523,  -3218,   -910 },\n    {   6526,  -2305,  -2029,  -1790 },\n    {   5289,    -99,  -3436,   -400 },\n    {   5781,  -1623,  -1577,  -2617 },\n    {   5259,   -670,  -3125,  -1700 },\n    {   6343,  -1256,   -331,  -3222 },\n    {   7967,   -678,  -2195,  -1462 },\n    {   6119,   -695,  -2988,  -1538 },\n    {   6108,    494,  -3359,  -1548 },\n    {   5067,    969,  -2328,  -2707 },\n    {   7595,   -435,  -1497,  -2056 },\n    {   6929,   -719,  -2420,  -1665 },\n    {   5190,    584,  -2982,  -2103 },\n    {   6106,   -444,  -1411,  -2739 },\n    {   5584,    289,  -1804,  -2803 },\n    {   5276,    227,  -1180,  -3361 },\n    {   7544,  -1525,  -1834,  -1725 },\n    {   5986,  -1470,  -2606,  -1701 },\n    {   5096,   -765,  -1712,  -3006 },\n    {   5423,   -149,  -3933,  -1157 },\n    {   7651,     26,  -2445,  -1507 },\n    {   4745,   -464,  -1735,  -2362 },\n    {   5352,  -1011,  -1094,  -1999 },\n    {   6300,   -672,   -542,  -1950 },\n    {   6675,  -1020,  -1318,  -1059 },\n    {   7218,  -2036,   -603,  -2462 },\n    {   7755,  -1514,  -2430,  -1229 },\n    {   5041,    449,  -1056,  -2405 },\n    {   6710,  -2277,  -1344,  -2284 },\n    {   6824,  -1347,  -2254,    251 },\n    {   6068,  -1857,   -983,  -1316 },\n    {   5603,  -2177,  -2730,  -1477 },\n    {   5838,  -1059,  -3604,   -970 },\n    {   5076,   -789,   -335,  -2413 },\n    {   6191,  -1634,  -2000,  -2129 },\n    {   5092,  -1292,  -2543,  -1034 },\n    {   5305,    435,  -1710,  -1850 },\n    {   6140,    561,  -2176,  -2380 },\n    {   6752,    348,  -2496,  -1890 },\n    {   6405,    273,  -1098,  -2778 },\n    {   6942,  -1340,   -496,  -1381 },\n    {   5238,   -687,  -2454,  -2349 },\n    {   6959,   -882,  -1833,  -2061 },\n    {   6292,   -253,  -2125,  -2199 },\n    {   5838,   -574,   -759,  -3215 },\n    {   6954,  -1484,   -640,  -2771 },\n    {   7498,  -1706,  -1210,  -2154 },\n    {   6772,  -1003,  -1235,  -2532 },\n    {   6014,    228,  -2154,  -1108 },\n    {   6943,  -2178,  -2644,  -1122 },\n    {   7262,   -763,  -3056,  -1090 },\n    {   6273,  -1478,  -1072,    177 },\n    {   4734,    425,  -2912,    357 },\n    {   7129,    168,  -1537,  -2327 },\n    {   7204,   -434,   -746,  -2660 },\n    {   6879,     57,  -3087,  -1310 },\n    {   4623,   -610,   -718,  -3459 },\n    {   6565,   -543,  -1998,   -339 },\n    {   4752,   -277,  -2066,  -1405 },\n    {   7435,  -1416,  -1904,   -505 },\n    {   4076,    150,  -1222,  -3556 },\n    {   7082,    -28,  -1456,  -1174 },\n    {   5941,   -446,  -1326,  -1158 },\n    {   3870,  -1648,  -2474,  -2589 },\n    {    858,     37,  -3387,  -3721 },\n    {   3557,  -1503,  -1664,  -3383 },\n    {   3336,  -1972,  -3079,  -2216 },\n    {   3186,     60,  -4185,   -863 },\n    {   3456,   -773,  -3066,  -2457 },\n    {   4131,   -913,  -2060,  -2601 },\n    {   4431,   -691,  -4114,   -972 },\n    {   3461,   -334,  -3680,  -1751 },\n    {   2006,   -459,  -2214,  -3827 },\n    {   1322,     32,  -2816,  -3203 },\n    {   4425,  -1897,  -2791,  -1946 },\n    {   4504,     23,  -3421,  -1909 },\n    {   3090,   -885,  -2366,  -3264 },\n    {   3209,  -2363,  -3730,   -834 },\n    {   3312,  -1471,  -3641,  -1579 },\n    {   4184,  -1669,  -3323,  -1248 },\n    {   2190,   -931,  -3302,  -2944 },\n    {   2947,   -229,  -4791,  -1195 },\n    {   2020,  -1626,  -2700,  -3125 },\n    {   2214,   -326,  -4352,  -1683 },\n    {   3286,  -2619,  -2412,  -2458 },\n    {   1000,  -2571,  -4129,  -2158 },\n    {   2496,  -2627,  -3611,  -1433 },\n    {   2043,  -2191,  -2167,  -3827 },\n    {   2571,  -2544,  -1915,  -3222 },\n    {   2022,  -1501,  -3856,  -2165 },\n    {   2685,  -1180,  -1461,  -4038 },\n    {   1610,  -2313,  -4391,  -1173 },\n    {   2340,  -2490,  -4215,   -516 },\n    {   1742,  -2615,  -3632,  -2146 },\n    {    523,  -1293,  -4246,  -2442 },\n    {   3725,  -2723,  -3014,  -1576 },\n    {   3554,  -1381,  -4200,   -824 },\n    {   1291,  -1594,  -4777,  -1430 },\n    {   1452,    515,  -2960,  -3830 },\n    {   4264,   -894,  -3305,  -1826 },\n    {   2606,  -1452,  -4522,   -966 },\n    {   1196,   -830,  -4807,  -1816 },\n    {   1054,   -775,  -2616,  -4071 },\n    {   4206,    415,  -4344,  -1132 },\n    {   3044,    491,  -4126,  -1934 },\n    {    988,   -901,  -3353,  -3443 },\n    {   1729,  -3063,  -2267,  -3370 },\n    {   3915,    912,  -2989,  -2387 },\n    {   3781,    300,  -2457,  -3050 },\n    {   2712,    924,  -1350,  -1206 },\n    {   4230,    405,  -2343,    665 },\n    {   1878,   -873,   -225,    -29 },\n    {   3510,     56,  -1334,  -3420 },\n    {   2850,   1447,  -2651,  -3150 },\n    {   1510,   -706,  -4125,  -2483 },\n    {   3115,    793,  -1692,  -3894 },\n    {   2667,    213,  -2973,  -2786 },\n    {   1184,  -2384,  -3051,  -3173 },\n    {   2139,    796,  -2079,  -3697 },\n    {   1464,  -1483,  -3726,  -2754 },\n    {   2407,  -1148,  -3915,  -1569 },\n    {   2612,  -1779,  -3217,  -2271 },\n    {   2406,  -2870,  -2937,  -2496 },\n    {   2140,    126,  -3646,  -2758 },\n    {   2952,  -1036,    268,  -1423 },\n    {     93,  -1931,  -3841,  -3535 },\n    {    389,  -2953,  -3383,  -3343 },\n    {   8652,  -5511,  -1662,    565 },\n    {   7427,  -2791,  -2535,   -842 },\n    {   8541,  -4253,  -1407,   -988 },\n    {   8018,  -3203,  -2998,    105 },\n    {   7231,  -3926,   -958,   1308 },\n    {   7331,  -3690,   -363,   2586 },\n    {   6803,  -3646,  -2226,   -903 },\n    {   8163,  -2811,   -477,  -2235 },\n    {   9356,  -3818,  -1685,   -684 },\n    {   8466,  -2854,   -302,   -698 },\n    {   8458,  -3224,    517,    279 },\n    {   8074,  -2619,  -1326,   2596 },\n    {   8779,  -2761,  -2527,   -441 },\n    {   6533,  -2887,   -899,   -696 },\n    {   7394,  -2305,  -1642,   -120 },\n    {   8281,  -3780,    -22,   1305 },\n    {   9158,  -4413,   -779,    901 },\n    {   9031,  -5240,  -1109,   1678 },\n    {   8717,  -3650,    410,  -1075 },\n    {   7317,  -3197,   -818,  -2264 },\n    {   7934,  -2385,  -1214,  -1886 },\n    {   8256,  -4441,   -291,   -587 },\n    {   7358,  -3395,   1090,   -270 },\n    {   9446,  -4910,  -1343,   -473 },\n    {   8187,  -4726,   -808,   1166 },\n    {   7504,  -3845,    -47,    267 },\n    {   8029,  -2146,  -1283,   -383 },\n    {   7461,  -2705,   -853,    783 },\n    {   9367,  -3636,   -645,   -354 },\n    {   8955,  -3473,   -308,  -1947 },\n    {   8676,  -2683,  -2099,   1485 },\n    {   7481,  -3003,   -871,   -444 },\n    {   8015,  -2839,  -1673,   1175 },\n    {   6947,  -4643,  -1527,  -1047 },\n    {   7622,  -2575,   -137,   -960 },\n    {   9388,  -4279,   -707,  -1322 },\n    {   8382,  -5259,  -1283,   -565 },\n    {   6856,  -4138,  -1030,    630 },\n    {   8659,  -2571,  -1124,  -1666 },\n    {   8763,  -3807,   -537,   2543 },\n    {   8049,  -3578,  -2186,   -604 },\n    {   8272,  -2351,  -1985,  -1214 },\n    {   6855,  -3796,  -1527,  -1631 },\n    {   7178,  -2896,  -1600,  -1756 },\n    {   7040,  -2888,    -89,  -1586 },\n    {   6261,  -3403,   -264,    998 },\n    {   7756,  -4699,  -1543,   -834 },\n    {   7682,  -4622,   -758,  -1721 },\n    {   8839,  -4232,  -2932,   1959 },\n    {   9363,  -4679,  -1956,     39 },\n    {   7883,  -3616,  -1414,  -1432 },\n    {   8828,  -3188,  -1356,  -1312 },\n    {   7746,  -3987,   -121,  -2424 },\n    {   9262,  -3256,   -693,    818 },\n    {   7670,  -3420,   -148,   3504 },\n    {   7344,  -3183,    608,   1595 },\n    {   8976,  -4139,  -1848,   1304 },\n    {   6708,  -4131,     33,   -852 },\n    {   7840,  -4429,  -2275,     79 },\n    {   8980,  -3858,  -2838,    453 },\n    {   7815,  -4604,  -2563,    944 },\n    {   8372,  -4422,  -1783,   3071 },\n    {   8623,  -5128,  -1754,   2888 },\n    {   7462,  -3281,    889,    920 },\n    {   8416,    -59,  -1320,  -1825 },\n    {   7928,  -1488,   -414,  -2499 },\n    {   8110,   -977,  -1047,  -2042 },\n    {   8278,   -687,  -1597,  -1550 },\n    {   7988,   -174,   -977,  -2106 },\n    {   8609,  -1547,  -1628,  -1527 },\n    {   9000,  -1798,   -946,  -1761 },\n    {   8954,   -872,  -1404,  -1594 },\n    {   8939,    466,   -748,  -1212 },\n    {   9549,   -329,   -177,  -1360 },\n    {   9411,    -18,  -1126,  -1568 },\n    {   8859,   -782,   -488,  -1338 },\n    {   8955,   -218,    -43,  -1209 },\n    {   9131,    -69,   -453,  -1001 },\n    {   9069,  -1519,  -1091,  -1199 },\n    {   9247,  -1309,   -566,  -1146 },\n    {   8528,  -1617,   -287,  -1313 },\n    {   7763,   -745,   -149,  -2040 },\n    {   8294,   -343,    257,  -2633 },\n    {  10149,   -893,   -552,  -1649 },\n    {   9398,   -915,    218,  -2042 },\n    {   9703,  -1194,   -675,  -1592 },\n    {   9586,   -700,   -427,  -1710 },\n    {   8930,    497,  -1445,  -1218 },\n    {   9285,  -1323,   -163,  -1552 },\n    {   8431,  -1289,   -985,  -1404 },\n    {   8965,   -655,    653,  -1483 },\n    {   9542,  -1001,   -951,  -1128 },\n    {   9205,   -647,    -37,   -882 },\n    {   8603,    -56,    514,  -1793 },\n    {   9300,    -12,  -1324,   -567 },\n    {   8773,    238,   -184,  -1456 },\n    {   9941,  -1306,    -69,  -1792 },\n    {   9360,    279,   -376,  -1919 },\n    {   9180,   -285,     95,  -2170 },\n    {   9922,   -501,   -970,  -1570 },\n    {   8341,  -1493,   -856,  -2092 },\n    {   8780,   -981,   -850,  -1014 },\n    {   9721,   -548,  -1504,  -1094 },\n    {   9973,  -1493,    482,  -2105 },\n    {   8707,   -333,  -1027,  -1087 },\n    {   9098,   -469,   -315,  -1723 },\n    {   8879,  -1050,   -661,  -2020 },\n    {   8857,    602,   -866,  -1918 },\n    {   8945,  -1025,  -2154,  -1071 },\n    {   8484,  -1930,   -468,  -2179 },\n    {   9177,  -1903,   -224,  -2112 },\n    {   8652,   -137,  -2097,  -1214 },\n    {   9063,   -973,  -1405,   -772 },\n    {   9328,   -456,    662,  -2469 },\n    {  10101,   -697,    127,  -2113 },\n    {   9685,    811,  -2359,  -1024 },\n    {   8586,    -94,   -460,  -1982 },\n    {   7924,   -141,   -509,  -2513 },\n    {   7773,   -669,   -107,  -2835 },\n    {   8636,  -1064,    -46,  -2409 },\n    {   9748,    596,  -1815,  -1349 },\n    {   8924,    304,    547,  -2614 },\n    {   9442,    746,  -1153,  -1679 },\n    {   9454,   -278,   -529,  -1976 },\n    {   8488,    561,    -32,  -2160 },\n    {  10083,    -63,  -1544,  -1364 },\n    {   9390,  -1278,    568,  -1131 },\n    {   9740,    -49,  -2253,   -910 },\n    {   3636,  -2391,  -1115,  -3614 },\n    {   6014,  -3204,  -1902,  -1808 },\n    {   5787,  -3497,  -1116,  -2590 },\n    {   4365,  -3046,  -1632,  -2668 },\n    {   4733,  -2192,  -2029,  -2468 },\n    {   5412,  -2753,  -1633,  -2464 },\n    {   4455,  -3375,   -767,  -3399 },\n    {   4456,  -1644,   -983,  -2841 },\n    {   4039,  -2523,     38,  -3967 },\n    {   3406,  -2662,     72,  -4757 },\n    {   4279,  -2005,   1055,  -4399 },\n    {   4321,  -1377,   -860,  -3786 },\n    {   3743,  -5739,   -651,  -3047 },\n    {   3528,  -5510,    361,  -4060 },\n    {   6496,  -4886,   -136,  -2689 },\n    {   4513,  -5254,    551,  -4010 },\n    {   6557,  -3413,    -92,  -3063 },\n    {   4186,  -2059,    187,     47 },\n    {   6210,  -4117,  -1256,  -1985 },\n    {   6038,  -4343,    351,  -2124 },\n    {   4305,  -4780,  -2077,  -1897 },\n    {   4480,  -3815,  -2228,  -1533 },\n    {   5582,  -3689,   1221,  -3429 },\n    {   5532,  -4874,   1195,  -2765 },\n    {   6518,  -2853,   -905,  -2568 },\n    {   5467,  -2192,    470,  -4115 },\n    {   4139,  -1577,    240,  -3493 },\n    {   5281,  -1926,   -729,  -3340 },\n    {   5214,  -2870,   1359,  -4289 },\n    {   3046,  -3510,  -1536,  -3214 },\n    {   5433,  -2881,  -1230,  -1184 },\n    {   4861,  -3932,  -1071,  -2791 },\n    {   5693,  -4234,  -1906,  -1502 },\n    {   4004,  -3935,  -1804,  -2383 },\n    {   3728,  -3792,    681,  -4773 },\n    {   3621,  -3030,  -1951,  -2598 },\n    {   5133,  -3903,     44,  -3700 },\n    {   3561,  -3451,   1183,  -5301 },\n    {   5026,  -2762,  -2341,  -1780 },\n    {   5841,  -2492,   -467,  -3210 },\n    {   5591,  -1791,    497,  -2472 },\n    {   5054,  -3898,  -1822,  -2097 },\n    {   5813,  -2792,     83,  -1469 },\n    {   4432,  -4497,   1670,  -5193 },\n    {   5338,  -4653,  -1109,  -2200 },\n    {   3239,  -4401,   -648,  -3655 },\n    {   2147,  -3598,  -1200,  -4242 },\n    {   4417,  -2271,  -1552,  -3210 },\n    {   6494,  -4360,    852,  -3565 },\n    {   2393,  -6358,   -856,  -4524 },\n    {   4959,  -4196,   -847,  -1403 },\n    {   4924,  -5438,   -226,  -3026 },\n    {   4254,  -5303,  -1306,  -2424 },\n    {   4121,  -3126,  -2334,  -1981 },\n    {   3437,  -4443,  -1464,  -2953 },\n    {   3203,  -3459,   -529,  -4339 },\n    {   5896,  -5945,    543,  -3246 },\n    {   1987,  -4733,   -220,  -4863 },\n    {   4358,  -4431,   -514,  -3081 },\n    {   4583,  -2416,   -492,  -2287 },\n    {   2943,  -5035,    419,  -4927 },\n    {   5358,  -5129,    987,  -4309 },\n    {   4460,  -3392,   1752,  -5634 },\n    {   3415,  -4633,   1507,  -5945 },\n    {    811,  -4692,   -445,   2333 },\n    {   1009,  -5613,  -1857,   1360 },\n    {   1338,  -2712,  -2720,   3036 },\n    {   1002,  -3754,  -2582,   2344 },\n    {    750,  -4608,  -2334,    714 },\n    {   2043,  -3207,  -2822,   2173 },\n    {   -140,  -4654,  -2953,    357 },\n    {    -54,  -4026,  -2376,   2695 },\n    {   1858,  -5022,   -717,   2287 },\n    {   2064,  -3894,   -722,   3255 },\n    {   2727,  -4558,   -332,   2603 },\n    {   1810,  -5378,    283,   1826 },\n    {   3935,  -4326,    762,   3383 },\n    {   -767,  -4697,  -2510,   1922 },\n    {   2146,  -4312,  -3090,   1641 },\n    {     54,  -5881,  -2114,    921 },\n    {   1992,  -5766,   -640,   1574 },\n    {   1200,  -5371,  -1114,   1828 },\n    {   2973,  -5337,     34,   2266 },\n    {   1531,  -5018,  -2817,   1192 },\n    {   3078,  -4570,    117,   1990 },\n    {    924,  -4286,  -1388,   2713 },\n    {    142,  -5058,  -2848,   1487 },\n    {   -106,  -6180,   -881,    842 },\n    {    673,  -5433,   -229,   1596 },\n    {    783,  -5710,  -2784,    562 },\n    {   1935,  -5729,  -2009,    856 },\n    {   -410,  -3375,  -3326,   2734 },\n    {    234,  -3000,  -2628,   3260 },\n    {    733,  -3405,  -3806,   1589 },\n    {    771,  -4285,  -3544,   1314 },\n    {   1192,  -3563,  -3960,   2178 },\n    {    206,  -5555,  -1250,   1546 },\n    {   -130,  -3815,  -1210,   3041 },\n    {    646,  -3940,   -393,   2992 },\n    {   -184,  -4931,  -1767,   1925 },\n    {   2746,  -5120,  -2275,   1464 },\n    {   2440,  -3731,  -3352,   2729 },\n    {   -490,  -4942,  -3779,    997 },\n    {     68,  -2636,  -4167,   3778 },\n    {     48,  -3986,  -4118,   2106 },\n    {   -978,  -5486,  -1336,   1390 },\n    {   1126,  -5297,   -855,    640 },\n    {   -472,  -3975,  -3622,   1557 },\n    {   2456,  -5344,  -1523,   1648 },\n    {   -774,  -5652,  -2417,   1147 },\n    {    995,  -6122,   -812,   1132 },\n    {   3282,  -4571,  -1763,   2175 },\n    {   3655,  -3862,   -676,   3568 },\n    {   3038,  -3647,  -1672,   3381 },\n    {   2595,  -2964,  -2772,   3263 },\n    {   4176,  -3353,  -1148,   4354 },\n    {   1603,  -3442,  -1500,   3444 },\n    {    828,  -6226,  -1783,    678 },\n    {   1421,  -3333,  -3080,   3403 },\n    {   1121,  -4727,  -1924,   1984 },\n    {   -186,  -5083,   -682,   1796 },\n    {    819,  -2778,  -3488,    530 },\n    {    421,  -2873,  -3832,   2596 },\n    {   2164,  -4263,  -1605,   2282 },\n    {    585,  -4437,   -682,   -491 },\n    {   -644,  -4452,  -1157,   2325 },\n    {   1991,  -4299,    210,   2834 },\n    {   2135,  -3632,  -2113,    665 },\n    {  -7482,  -2724,  -2662,  -1380 },\n    {  -6983,  -2166,  -3756,  -3509 },\n    {  -7085,  -1439,  -2397,  -3112 },\n    {  -7760,  -3049,  -3319,  -2822 },\n    {  -8413,  -2760,  -4406,  -3298 },\n    {  -5995,  -3943,  -1260,  -3750 },\n    {  -7879,  -1554,  -3464,  -2606 },\n    {  -6314,  -2034,  -3878,  -1681 },\n    {  -8849,  -2084,  -1399,  -1231 },\n    {  -7153,  -2602,  -1384,   -817 },\n    {  -8041,  -2571,   -407,  -2785 },\n    {  -7246,  -2233,  -1578,    260 },\n    {  -7336,  -3883,  -4061,  -1342 },\n    {  -7619,  -3908,  -2342,    382 },\n    {  -8684,  -3724,  -1662,   -727 },\n    {  -7850,  -2922,  -1770,  -3449 },\n    {  -6766,  -2034,  -1293,  -1988 },\n    {  -6895,  -2116,   -968,  -3744 },\n    {  -7136,  -5147,  -2618,  -2809 },\n    {  -8224,  -3724,  -2519,  -1589 },\n    {  -6711,  -2750,  -3021,   -219 },\n    {  -8059,  -1638,  -1102,  -3175 },\n    {  -8710,  -4839,  -3963,  -3143 },\n    {  -9363,  -4965,  -3257,  -1002 },\n    {  -6099,  -1751,  -3157,   -395 },\n    {  -6453,  -3216,  -4597,   -483 },\n    {  -7879,  -5477,   -839,  -2638 },\n    {  -7202,  -4038,   -526,  -2856 },\n    {  -8022,  -1228,  -1910,  -1646 },\n    {  -9117,  -1393,  -1582,  -2535 },\n    {  -9095,  -2693,   -636,  -2605 },\n    {  -9076,  -2580,  -3481,  -2519 },\n    {  -8327,  -4859,  -2422,     83 },\n    {  -8368,  -2129,  -2324,  -2173 },\n    {  -8554,  -4563,  -3842,  -2007 },\n    { -10462,  -4261,  -1934,  -2084 },\n    {  -9717,  -3187,  -2294,  -1896 },\n    {  -9625,  -3889,  -3020,  -3224 },\n    {  -9857,  -4955,  -4239,  -2184 },\n    {  -9752,  -2351,  -2277,  -3129 },\n    {  -7219,  -1302,  -2639,  -1603 },\n    {  -7477,  -4360,  -3718,   -559 },\n    {  -5680,  -2033,  -2326,  -3078 },\n    { -10190,  -5548,  -4643,  -3601 },\n    {  -9431,  -4121,   -879,  -2479 },\n    {  -8365,  -5450,  -2020,  -1439 },\n    {  -6289,  -5178,  -1605,  -3845 },\n    {  -8319,  -3866,   -687,  -2792 },\n    {  -8131,  -1031,  -3608,  -3947 },\n    { -10510,  -2560,  -1199,  -2082 },\n    { -11015,  -3640,  -2748,  -3041 },\n    {  -8762,  -5022,  -5231,  -1162 },\n    { -10153,  -2715,  -4648,  -4859 },\n    {  -7930,  -5205,  -1900,  -3600 },\n    {  -9561,  -3548,  -4812,  -3722 },\n    {  -7663,  -4709,  -1180,  -1475 },\n    {  -9073,  -5707,  -1815,  -2980 },\n    {  -8602,  -2363,  -2675,  -3770 },\n    {  -9967,  -5614,  -3575,  -3838 },\n    {  -8324,  -1005,  -2131,  -3254 },\n    { -10331,  -5737,  -2550,  -2940 },\n    {  -8234,  -3354,  -3361,  -4479 },\n    {  -8140,  -1951,  -4526,  -4545 },\n    {  -6679,  -2662,  -2284,  -4182 },\n    {  -1122,  -1514,  -6427,   -212 },\n    {     54,  -1660,  -5424,  -1404 },\n    {    254,  -2778,  -5222,    846 },\n    {   -267,  -1661,  -6577,    814 },\n    {   -305,  -2021,  -5759,   1484 },\n    {  -1791,  -2446,  -6867,    -86 },\n    {  -2929,  -3158,  -6603,  -1799 },\n    {  -1391,  -3189,  -5557,  -1053 },\n    {  -1602,   -884,  -6767,  -1213 },\n    {   -361,   -318,  -6219,    -44 },\n    {  -4078,  -2635,  -5523,   -433 },\n    {   -956,    478,  -4382,   1470 },\n    {  -3300,  -2462,  -6021,  -2721 },\n    {    708,  -2434,  -5085,   -540 },\n    {  -2435,  -3607,  -5647,  -2110 },\n    {   -491,  -1134,  -4681,  -2886 },\n    {     87,  -3435,  -4641,  -1194 },\n    {   -586,  -2927,  -4784,    366 },\n    {  -1394,  -2326,  -6021,    350 },\n    {     97,  -2519,  -4678,  -2120 },\n    {  -1547,  -1907,  -5069,  -2993 },\n    {    268,  -3724,  -4719,    127 },\n    {   -827,  -1190,  -5912,   1144 },\n    {  -3959,  -2322,  -6898,  -1974 },\n    {  -2728,  -2228,  -6426,   -562 },\n    {   -456,   -666,  -5785,  -1609 },\n    {    531,  -1096,  -5731,   -656 },\n    {  -3569,   -688,  -3915,    110 },\n    {  -4752,  -1725,  -4393,   -377 },\n    {  -3210,  -3315,  -6960,   -840 },\n    {   -688,  -3416,  -4971,   1221 },\n    {  -1833,     77,  -6491,  -2434 },\n    {   -239,   -255,  -6850,   -886 },\n    {  -2112,  -1490,  -6291,  -2689 },\n    {  -1544,  -4579,  -5198,  -1261 },\n    {  -2771,  -4014,  -5520,    683 },\n    {  -1635,  -2829,  -5512,   1214 },\n    {   -958,  -2582,  -4823,   2360 },\n    {  -2077,  -4566,  -4642,    365 },\n    {  -3112,  -4214,  -5960,   -823 },\n    {  -2467,  -2510,  -4858,   1467 },\n    {  -1561,  -3399,  -5822,    211 },\n    {   -775,  -1081,  -4424,   2636 },\n    {  -1263,     25,  -6378,  -1392 },\n    {  -3476,   -366,  -5417,  -1393 },\n    {  -3176,  -1476,  -4149,   1466 },\n    {  -2479,    518,  -4448,   -257 },\n    {  -2992,    158,  -4660,  -1279 },\n    {  -1320,  -3872,  -4479,   1147 },\n    {  -1475,   -312,  -5318,    539 },\n    {  -3527,  -1679,  -5860,  -1681 },\n    {  -3397,  -3438,  -5593,   1866 },\n    {  -4089,  -2439,  -4763,   1275 },\n    {   -748,  -4513,  -4687,    -48 },\n    {  -2166,  -4531,  -4691,  -2856 },\n    {  -2385,   -853,  -6035,   -627 },\n    {  -1194,  -4091,  -4472,  -1963 },\n    {   -682,  -3234,  -4084,  -3033 },\n    {  -3255,  -5015,  -5328,    -12 },\n    {  -2313,  -3436,  -4601,   -155 },\n    {  -2792,  -1038,  -6947,  -2019 },\n    {  -1244,  -1526,  -5771,  -1882 },\n    {  -4679,  -3731,  -5506,    283 },\n    {  -3062,    -66,  -3558,   -758 },\n    {  -4895,  -1187,   4751,   3728 },\n    {  -7600,  -2752,   3320,   4613 },\n    {  -5703,  -2975,   3944,   2659 },\n    {  -4972,  -1257,   -246,   2952 },\n    {  -4221,  -2487,   1702,   4295 },\n    {  -2900,  -1529,   2458,   4935 },\n    {  -5061,    407,   2416,   4050 },\n    {  -6931,  -3478,   2761,   2213 },\n    {  -6037,  -3921,   3192,   1866 },\n    {  -6113,   -811,   2407,   3782 },\n    {  -5878,  -1716,   1207,   3478 },\n    {  -5953,  -2853,   2207,   2712 },\n    {  -6807,  -3223,   2749,   3595 },\n    {  -3272,  -3157,   1389,   3788 },\n    {  -5368,  -1904,   1980,   5077 },\n    {  -7235,  -1398,   3075,   4548 },\n    {  -4765,  -3487,   2755,   2796 },\n    {  -7658,  -4435,   2694,   2582 },\n    {  -6997,  -4282,    456,   3832 },\n    {  -5563,  -3115,    -63,   3713 },\n    {  -4244,  -4220,   1450,   2767 },\n    {  -3801,  -2194,    190,   4303 },\n    {  -5458,  -4119,   1958,   2274 },\n    {  -7300,  -3469,   3514,   3193 },\n    {  -4594,  -2067,    775,   4752 },\n    {  -3389,  -1654,   1464,   5412 },\n    {  -4845,  -3483,    964,   3437 },\n    {  -6007,  -2818,   1666,   4659 },\n    {  -8709,  -5007,   1757,   3287 },\n    {  -5833,  -4389,   1025,   3171 },\n    {  -5788,  -1780,   3944,   3661 },\n    {  -4430,   -920,   1938,   4753 },\n    {  -7066,  -1857,   4591,   4538 },\n    {  -3549,   -513,   1427,   5317 },\n    {  -7517,  -1220,   2883,   3049 },\n    {  -7605,  -2687,   1874,   2735 },\n    {  -8718,  -4035,   2676,   3730 },\n    {  -7990,  -3907,   1185,   2607 },\n    {  -6058,  -1744,   3349,   5157 },\n    {  -5954,    565,   3161,   3250 },\n    {  -6478,   -612,   1930,   2271 },\n    {  -6535,  -1445,     -2,   1618 },\n    {  -8963,  -4151,   1192,   4044 },\n    {  -7227,  -3570,   1600,   4234 },\n    {  -4674,     79,    595,   3015 },\n    {  -3974,    430,   2727,   5137 },\n    {  -5299,      9,   3714,   4779 },\n    {  -6779,  -2699,     -8,   2436 },\n    {  -7016,  -1145,   1293,   2310 },\n    {  -6955,  -3312,   1534,   1801 },\n    {  -4025,    740,   1850,   4054 },\n    {  -9589,  -3460,   4154,   5270 },\n    {  -4404,  -1181,   4298,   5173 },\n    {  -7356,  -4583,    -18,   2644 },\n    {  -6516,  -1235,   4439,   6234 },\n    {  -3453,   -301,   4344,   4464 },\n    {  -4643,   1530,   3315,   4340 },\n    {  -4575,  -2557,   3754,   3682 },\n    {  -3643,  -3501,   2051,   2997 },\n    {  -5412,  -2475,   2301,   1579 },\n    {  -5846,    259,   1360,   2348 },\n    {  -5258,  -1358,   1050,    838 },\n    {  -5542,   -219,   6377,   5750 },\n    {  -5713,  -2952,    922,    899 },\n    {  -2049,  -1135,   5206,   1033 },\n    {  -1693,  -1886,   4835,   -106 },\n    {  -2344,  -3504,   4232,    -13 },\n    {  -2475,  -2334,   5043,   1126 },\n    {   -787,  -2549,   3880,   2138 },\n    {  -3159,  -2341,   4830,   2887 },\n    {  -1780,  -1009,   6240,   2061 },\n    {  -4327,  -3363,   2818,    886 },\n    {  -3376,  -2743,   4104,    207 },\n    {  -3250,  -4640,   2718,   1498 },\n    {   -382,  -1075,   4382,   3460 },\n    {  -2416,  -4168,   3530,    816 },\n    {  -1756,  -2708,   4861,    622 },\n    {  -1879,  -2097,   5156,   2889 },\n    {  -2496,  -2418,   3722,   2671 },\n    {  -2717,  -3252,   3341,   1944 },\n    {  -4063,  -4091,   3306,    267 },\n    {  -3549,  -3808,   3747,    842 },\n    {  -2635,    546,   5794,   1894 },\n    {  -1857,  -1121,   4383,   3964 },\n    {  -2226,  -2166,   3489,   3678 },\n    {  -3492,   -660,   5323,   1063 },\n    {  -3033,  -3130,   4382,   1828 },\n    {  -2703,   -625,   6369,   2851 },\n    {  -1656,  -2842,   4584,   -528 },\n    {  -4781,  -2622,   4390,   2097 },\n    {   -413,  -2045,   5081,   3035 },\n    {  -3810,  -2662,   4532,   1095 },\n    {  -3144,  -1858,   5215,   1880 },\n    {  -3562,  -1795,   4928,    670 },\n    {  -4800,  -1509,   5189,   1859 },\n    {  -1085,  -3832,   4169,    900 },\n    {  -1969,  -3270,   2857,   2878 },\n    {  -4267,  -4140,   3176,   1805 },\n    {  -5145,  -3727,   3524,   1168 },\n    {  -1346,  -1876,   5501,   1748 },\n    {  -4998,  -2945,   3699,    338 },\n    {  -3458,  -3096,   3406,   -635 },\n    {  -1751,  -3209,   3508,    395 },\n    {  -2507,    170,   5987,    705 },\n    {  -3756,  -1072,   5647,   3536 },\n    {  -2870,  -1439,   5026,   3212 },\n    {  -3913,  -3225,   3669,   2144 },\n    {  -3739,    226,   5747,    764 },\n    {  -2052,   -820,   5266,   3093 },\n    {  -3214,  -3820,   2409,   2391 },\n    {  -4398,  -2588,   3501,   -218 },\n    {  -4484,  -1763,   4180,   -198 },\n    {  -3368,  -1525,   4362,   -134 },\n    {  -2407,    224,   4905,   3533 },\n    {  -1369,  -2937,   4728,   1788 },\n    {  -4848,  -1707,   4159,    851 },\n    {  -3454,  -1749,   4281,   3230 },\n    {  -1990,  -3853,   3487,   1735 },\n    {  -3117,     92,   6155,   4075 },\n    {  -2676,  -2472,   4078,   -589 },\n    {  -1547,  -2012,   2626,   1835 },\n    {  -4275,   -588,   4824,    725 },\n    {   -601,  -2249,   3736,   3548 },\n    {  -4060,    -61,   5333,   3097 },\n    {  -4303,      7,   6551,   3054 },\n    {  -5003,  -1029,   5786,   3319 },\n    {  -2810,   -728,   5392,    199 },\n    {  -1232,   -200,   5228,   3121 },\n    {   2621,    165,  -6255,    298 },\n    {   3669,    537,  -6844,   1564 },\n    {   1598,  -1190,  -6235,   2523 },\n    {   2164,    -32,  -6894,   1383 },\n    {    853,  -1597,  -6069,   1449 },\n    {   1377,  -1661,  -5266,    108 },\n    {   2660,     48,  -5172,   -517 },\n    {   1903,   -391,  -5677,   1010 },\n    {   3792,    206,  -5274,    -11 },\n    {   1239,   2776,  -2929,   2721 },\n    {   4071,    149,  -7259,   3125 },\n    {   1436,   -480,  -6156,   -196 },\n    {   1373,  -1960,  -5005,   3122 },\n    {   3413,  -1271,  -5176,   3283 },\n    {   3060,    -68,  -6495,   2238 },\n    {   2700,  -2075,  -4681,     91 },\n    {   2928,  -1728,  -5168,   1858 },\n    {   4424,    828,  -4471,     88 },\n    {   2672,  -2604,  -4038,   2753 },\n    {   5223,   -123,  -6749,   2295 },\n    {   4237,   -420,  -5538,   1353 },\n    {   4744,  -1281,  -4097,   4708 },\n    {   1103,  -2764,  -4751,   2024 },\n    {   3747,  -1913,  -3911,   3960 },\n    {   2470,  -1416,  -5542,    615 },\n    {   4847,  -1354,  -5334,   1733 },\n    {   5336,     88,  -7593,   4007 },\n    {   2388,  -2880,  -4807,   1037 },\n    {   4495,   1391,  -5685,   -139 },\n    {   5253,   1637,  -6450,   1533 },\n    {   1199,    795,  -5515,   1261 },\n    {   1397,  -1259,  -4252,   3838 },\n    {    746,     70,  -6640,    604 },\n    {   1584,    166,  -4972,   3072 },\n    {    380,   -999,  -5397,   2267 },\n    {   2974,   1707,  -3242,   5360 },\n    {   5202,   -403,  -5453,   2832 },\n    {   3718,  -1731,  -4760,    714 },\n    {   4150,   -975,  -4792,     61 },\n    {   2925,   -818,  -4841,     15 },\n    {   5301,    577,  -4006,   3259 },\n    {   5265,   1986,  -5679,   3028 },\n    {   3752,   1928,  -4509,   3729 },\n    {   3278,   1925,  -6370,   1247 },\n    {   5107,   1721,  -4853,   3127 },\n    {   3279,   2982,  -2515,   4005 },\n    {   4622,    668,  -6204,    759 },\n    {   6034,    317,  -5763,   4818 },\n    {   -558,     57,  -3785,   2817 },\n    {   4476,   1616,  -3965,   4536 },\n    {   5953,   2056,  -8215,   2715 },\n    {   4387,   2613,  -7463,    868 },\n    {   5834,   1088,  -4736,   4924 },\n    {   6473,   -856,  -6991,   4172 },\n    {   4959,   -293,  -5162,     76 },\n    {   2731,   -843,  -6119,   3847 },\n    {   3245,   1202,  -6833,    616 },\n    {   2553,   1383,  -3829,   3859 },\n    {   4332,   2099,  -3480,   3622 },\n    {   2110,   2683,  -2728,   3990 },\n    {    876,   1167,  -3290,   3466 },\n    {   3991,   1709,  -2410,   4077 },\n    {   5105,    939,  -2584,   3256 },\n    {   4719,    688,  -1566,   3040 },\n    {  -3632,   4335,   1266,  -3303 },\n    {  -4956,   3207,   1312,  -2806 },\n    {  -4669,   2627,   2663,  -2435 },\n    {  -4282,   3708,   2303,  -3038 },\n    {  -4536,   2297,   -175,  -3350 },\n    {  -5234,   2503,   -139,   -880 },\n    {  -3978,   1512,   1092,  -3619 },\n    {  -4519,   4649,   1363,  -2455 },\n    {  -5118,   3132,   1961,  -1577 },\n    {  -5196,   3379,   -182,  -1378 },\n    {  -6420,   4486,   2397,  -1993 },\n    {  -5030,   5046,   1292,  -1118 },\n    {  -4559,   2573,   -927,  -1406 },\n    {  -3501,   3730,    691,  -4930 },\n    {  -4364,   2758,   1007,  -3909 },\n    {  -4026,   2839,  -1559,  -2340 },\n    {  -5037,   4053,    836,  -1571 },\n    {  -4727,   5136,   1110,  -3588 },\n    {  -5245,   2799,   -999,  -2164 },\n    {  -4954,   1501,    422,  -3963 },\n    {  -5994,   2726,   1462,  -2833 },\n    {  -5621,   5159,   2038,  -2512 },\n    {  -4991,   2291,   1917,  -3151 },\n    {  -5469,   4382,   -148,  -2978 },\n    {  -5858,   1983,    807,  -2720 },\n    {  -4709,   3556,    952,   -467 },\n    {  -2489,   2362,   1714,  -4230 },\n    {  -4717,   5004,  -1180,  -3672 },\n    {  -5914,   3653,   1359,  -1317 },\n    {  -5506,   2995,    780,  -1059 },\n    {  -5287,   3945,   2480,  -2293 },\n    {  -3849,   4358,    322,  -1770 },\n    {  -3911,   3570,    252,  -3185 },\n    {  -3660,   5128,    158,  -3719 },\n    {  -4599,   3277,   -503,  -2727 },\n    {  -3673,   3760,  -1252,  -3339 },\n    {  -5161,   2337,    388,  -1943 },\n    {  -3529,   2216,   2156,  -3080 },\n    {  -4309,   4331,   1808,  -1460 },\n    {  -4782,   3820,    480,  -2504 },\n    {  -4166,   3544,   -378,  -1567 },\n    {  -5572,   2466,   -418,  -2909 },\n    {  -6096,   2930,    119,  -1878 },\n    {  -5963,   3554,   1011,  -2233 },\n    {  -6433,   4335,    935,  -2930 },\n    {  -5004,   3314,  -1352,  -3430 },\n    {  -6042,   3463,  -1008,  -3940 },\n    {  -4671,   2214,   -640,  -5040 },\n    {  -2795,   3759,   1412,  -3803 },\n    {  -3647,   4436,    729,   -515 },\n    {  -3594,   1033,     56,  -4148 },\n    {  -2908,   3027,   2889,  -3485 },\n    {  -3338,   2234,    313,  -4285 },\n    {  -3825,   4497,   -561,  -2634 },\n    {  -6167,   3012,    -48,  -3149 },\n    {  -4828,   3515,   -969,  -4475 },\n    {  -5789,   2757,   -539,  -4173 },\n    {  -2452,   3067,    564,  -4249 },\n    {  -4921,   1358,   1331,  -2889 },\n    {  -3127,   4239,  -1045,  -1523 },\n    {  -4780,   2326,  -1118,  -3446 },\n    {  -3908,   5546,    152,  -2622 },\n    {  -6972,   2976,    337,  -2809 },\n    {  -4839,   4613,    -35,  -4077 },\n    {  -1408,   4822,  -1149,  -4997 },\n    {   -981,   4979,   -912,  -6304 },\n    {  -2098,   5689,   -888,  -2878 },\n    {  -3343,   4814,   -657,  -4434 },\n    {  -2461,   3601,   -967,  -4869 },\n    {  -2652,   3944,     87,  -5520 },\n    {  -1104,   6076,    174,  -6407 },\n    {    355,   5370,  -1721,  -5869 },\n    {   1242,   4497,  -1107,  -5091 },\n    {    -89,   4002,  -1491,  -5182 },\n    {   1059,   5693,  -1591,  -4905 },\n    {   1323,   4682,  -2078,  -4768 },\n    {    818,   3996,   -549,  -5468 },\n    {   -287,   4529,    929,  -5543 },\n    {   -919,   5519,  -2791,  -2844 },\n    {  -1407,   5679,  -3289,  -3974 },\n    {   -189,   6530,  -3547,  -4002 },\n    {   -900,   7039,  -3371,  -4855 },\n    {  -2983,   7211,   -363,  -4835 },\n    {   -814,   6503,   -104,  -5106 },\n    {  -2386,   6896,    809,  -4919 },\n    {    845,   4492,    352,  -6621 },\n    {  -1998,   7237,  -1646,  -4231 },\n    {  -3380,   6251,    471,  -4577 },\n    {  -1908,   7059,     84,  -5726 },\n    {   -340,   6346,   -803,  -6265 },\n    {  -2279,   5834,    -47,  -4633 },\n    {  -1532,   5286,  -1748,  -1901 },\n    {  -2757,   6188,   -453,  -3415 },\n    {  -1255,   6405,  -2043,  -6357 },\n    {    918,   5581,   -121,  -5667 },\n    {   1840,   5336,   -821,  -5034 },\n    {  -2475,   4992,  -1825,  -3104 },\n    {  -2413,   5606,  -1789,  -4298 },\n    {    132,   5128,  -2389,  -4442 },\n    {    223,   6400,  -2653,  -4742 },\n    {   -673,   5012,    680,  -4582 },\n    {  -1657,   6624,   -349,  -3596 },\n    {   -755,   6289,  -1860,  -3978 },\n    {   -572,   6894,  -1946,  -5207 },\n    {  -1141,   4756,  -2665,  -5586 },\n    {  -1073,   4269,   -431,  -4030 },\n    {    186,   5761,    916,  -5868 },\n    {  -1907,   4836,   1017,  -5106 },\n    {   -963,   3363,  -1248,  -6348 },\n    {  -3262,   4774,  -1818,  -5858 },\n    {    847,   3812,  -2538,  -4302 },\n    {  -1223,   5903,   1360,  -5479 },\n    {  -1094,   6923,  -1244,  -2381 },\n    {    267,   6276,   -709,  -2846 },\n    {   -157,   5840,   1124,  -4266 },\n    {    889,   3206,   -910,  -5305 },\n    {  -1736,   3344,    582,  -4838 },\n    {  -2357,   5676,  -2695,  -6277 },\n    {  -1916,   6901,   -986,  -5397 },\n    {  -3062,   6028,   -695,  -5687 },\n    {   1836,   3566,  -1357,  -5226 },\n    {  -2176,   4938,    646,  -3872 },\n    {  -2199,   3055,   -208,  -6124 },\n    {   -236,   3032,   -821,  -5325 },\n    {  -3989,   7277,   -565,  -3899 },\n    {   -595,   4362,     74,  -5975 },\n    {    684,   5874,   -841,  -4424 },\n    {  -2731,   6305,  -2389,  -5465 },\n    {  -5775,   1325,    -56,  -2528 },\n    {  -7029,   -534,  -1890,  -3278 },\n    {  -5798,    -15,  -2734,  -2210 },\n    {  -5504,  -1198,   -353,  -3659 },\n    {  -5079,    960,   -894,  -4336 },\n    {  -6073,    -36,   -133,  -3014 },\n    {  -5782,   -259,  -1025,  -3986 },\n    {  -6843,   1262,   -807,  -1639 },\n    {  -5263,   -918,  -3290,   -579 },\n    {  -4840,    461,  -2158,   -533 },\n    {  -6014,    -50,   -620,    504 },\n    {  -5843,    241,  -1359,   -282 },\n    {  -5898,    577,    769,  -3271 },\n    {  -6833,   -946,   -466,  -3347 },\n    {  -6026,   1459,   -512,   -729 },\n    {  -7361,    747,   -388,  -1110 },\n    {  -6391,   2142,  -1160,  -2513 },\n    {  -6995,    304,    498,  -2673 },\n    {  -6757,    679,   -386,   -433 },\n    {  -5222,   1688,  -1093,  -1032 },\n    {  -5019,    575,    184,  -3627 },\n    {  -4237,    628,  -3507,  -1243 },\n    {  -7479,   -456,  -1722,  -1486 },\n    {  -6464,    713,  -1273,  -1153 },\n    {  -6255,   1682,   -606,  -3607 },\n    {  -7033,   1497,    -71,  -1955 },\n    {  -6694,   1556,  -1721,  -3214 },\n    {  -6114,   -356,    813,  -2575 },\n    {  -5308,    632,  -1851,  -1636 },\n    {  -5742,   -911,  -1733,    383 },\n    {  -6083,   -387,  -2313,   -879 },\n    {  -6535,   -530,  -1505,  -2083 },\n    {  -4896,   1223,  -2750,  -1816 },\n    {  -6392,   -463,  -3247,  -2093 },\n    {  -5373,   1264,  -2706,  -3042 },\n    {  -3894,  -1390,  -1020,   -891 },\n    {  -6179,   1168,  -1966,  -1922 },\n    {  -5162,   1668,  -1617,  -1916 },\n    {  -6453,    920,  -1169,  -2432 },\n    {  -6130,   2005,   -536,  -1519 },\n    {  -6552,    -98,   -518,  -1938 },\n    {  -7528,    355,  -1101,  -1772 },\n    {  -5745,    610,   -247,  -1360 },\n    {  -7003,    177,  -2064,  -1958 },\n    {  -6956,   -570,  -2220,  -4225 },\n    {  -7830,    791,  -1394,  -2774 },\n    {  -7634,    480,  -3171,  -4224 },\n    {  -7913,   1154,   -350,  -2381 },\n    {  -5063,   1704,  -1804,  -2977 },\n    {  -4887,   -524,  -2703,    188 },\n    {  -5551,    406,  -1620,  -3063 },\n    {  -7109,   1342,    381,  -3021 },\n    {  -6846,    631,   -458,  -3398 },\n    {  -4606,   -605,     11,  -3930 },\n    {  -8134,   -225,  -1738,  -2648 },\n    {  -7043,    402,  -2734,  -3059 },\n    {  -7417,   1825,  -2545,  -4389 },\n    {  -6971,   -236,  -1031,   -665 },\n    {  -5752,   2111,  -1632,  -3808 },\n    {  -7660,    -78,   -624,  -3135 },\n    {  -6358,    619,  -1951,  -3911 },\n    {  -8134,    408,  -1935,  -3695 },\n    {  -6335,   1911,  -2368,  -4505 },\n    {  -7116,   2163,   -344,  -2753 },\n    {   2357,   4488,   2220,  -5682 },\n    {   1385,   3206,   2300,  -5305 },\n    {   1419,   2557,   5203,  -3516 },\n    {    262,   4315,   3920,  -1847 },\n    {   3316,   3187,   1612,  -5609 },\n    {   1729,   2350,   1673,  -6068 },\n    {   1603,   6126,   1467,  -2839 },\n    {  -1339,   3316,   3691,  -3530 },\n    {   -563,   4618,   3180,  -4548 },\n    {    463,   4624,   3111,  -5614 },\n    {   1246,   5455,   3356,  -5720 },\n    {    480,   2149,   5422,  -2893 },\n    {   1768,   4827,    913,  -5579 },\n    {   -149,   5381,   4366,  -3297 },\n    {    985,   3672,   2644,    -92 },\n    {   -258,   2911,   5817,  -2213 },\n    {   3428,   3289,   3351,  -3541 },\n    {   -666,   3295,   4727,  -2869 },\n    {     35,   6641,   4160,  -4052 },\n    {    623,   6787,   3156,  -4560 },\n    {   2654,   4360,   4676,  -4632 },\n    {   1386,   5246,   4834,  -4497 },\n    {   3488,   4574,   3856,  -5946 },\n    {    383,   4481,   4168,  -4110 },\n    {   1753,   3652,   4288,  -3326 },\n    {   1344,   4905,   2508,  -4660 },\n    {   1580,   4106,   3104,  -2224 },\n    {   2027,   5038,   1683,  -1554 },\n    {    446,   3699,   5872,  -3013 },\n    {   4637,   4087,   3578,  -5018 },\n    {   2629,   3560,   5331,  -4900 },\n    {   1527,   6674,   2523,  -4131 },\n    {  -1437,   2804,   2528,  -4464 },\n    {   -229,   3355,   2016,  -5537 },\n    {   3666,   3418,   4374,  -4581 },\n    {   1192,   3799,    923,  -6596 },\n    {   2040,   2956,    448,  -5322 },\n    {   2468,   5768,   4029,  -5869 },\n    {   3438,   6516,   3529,  -6667 },\n    {   2737,   5495,    680,  -5535 },\n    {   3896,   5727,   1801,  -4958 },\n    {   4988,   4957,   3592,  -6518 },\n    {   -542,   4416,   5794,  -2787 },\n    {   4136,   4354,   2064,  -4696 },\n    {   3067,   5936,   1207,  -3396 },\n    {   2789,   4966,   2405,  -3854 },\n    {   1731,   3270,   3251,  -1063 },\n    {   1767,   5537,   2084,  -2349 },\n    {    465,   3116,   4532,   -837 },\n    {   1499,   2627,   4610,  -2212 },\n    {    122,   3095,   3642,  -3552 },\n    {   2542,   2866,   2705,  -6402 },\n    {   3134,   4323,    698,  -4785 },\n    {    731,   1859,   3112,  -5242 },\n    {   2553,   2980,   3241,  -4846 },\n    {   1329,   5310,   1607,  -6624 },\n    {   2468,   1858,   3476,  -1034 },\n    {   -172,   4996,   2000,  -5562 },\n    {   2621,   4220,   1574,  -3386 },\n    {   -333,   1832,   3362,  -4117 },\n    {   2169,   6762,   3065,  -6225 },\n    {   2844,   5528,   3223,  -4765 },\n    {    526,   5175,   1644,  -4267 },\n    {   2922,   4426,   2414,  -2610 },\n    {    452,   1399,  -4516,  -2636 },\n    {   2872,   1720,  -4667,  -1435 },\n    {   1279,    702,  -5424,  -1984 },\n    {   2187,    870,  -5021,  -1341 },\n    {    583,   -144,  -4628,  -2464 },\n    {      3,   2237,  -5284,  -2827 },\n    {    -19,   1005,  -5460,  -1819 },\n    {   2897,   2084,  -5885,   -515 },\n    {   -400,   3370,  -5527,  -2947 },\n    {   1505,   2593,  -5518,  -1802 },\n    {   1341,   4534,  -5094,  -1899 },\n    {   3241,   3670,  -5493,  -1252 },\n    {  -1287,    921,  -5994,  -1675 },\n    {    627,    408,  -6652,   -364 },\n    {   -260,   1127,  -4849,  -3247 },\n    {    371,   3400,  -5976,  -2285 },\n    {   1533,   1566,  -6373,   -610 },\n    {   2462,   4274,  -6184,  -1254 },\n    {   1782,   3363,  -6222,  -1381 },\n    {    572,   4650,  -5673,  -2754 },\n    {   2674,   3414,  -4460,  -2154 },\n    {   3614,   3820,  -6883,   -398 },\n    {   1136,     -1,  -5511,  -1112 },\n    {  -1773,   1137,  -5647,  -2377 },\n    {   -753,   2104,  -6085,  -2565 },\n    {   -204,   3025,  -4731,  -1418 },\n    {  -1486,   1438,  -4380,   -216 },\n    {    302,    858,  -5786,   -264 },\n    {   3486,   1495,  -5234,   -783 },\n    {    888,   2327,  -3423,  -3720 },\n    {   -259,    772,  -6596,  -1311 },\n    {  -1197,   2073,  -5174,  -1826 },\n    {   1500,   3470,  -4462,  -2645 },\n    {   3072,   1960,  -3277,  -2264 },\n    {   1841,    952,  -4324,  -2340 },\n    {   1994,   2200,  -3940,  -2923 },\n    {  -1782,   1699,  -4667,  -1075 },\n    {  -1464,   2906,  -3468,   -375 },\n    {    366,   2380,  -3747,   1467 },\n    {   -545,   1645,  -4619,    376 },\n    {   1724,   2350,  -2374,  -3512 },\n    {   3184,   2628,  -2996,  -3275 },\n    {    734,   2010,  -6239,  -1479 },\n    {    524,   3756,  -4496,  -3263 },\n    {   1492,   3570,  -3494,  -3600 },\n    {   -932,    618,  -5389,  -2894 },\n    {   -133,   2161,  -4083,  -3267 },\n    {    786,    774,  -3279,  -3731 },\n    {   1078,    803,  -3843,  -3007 },\n    {   -332,   3405,  -3347,     40 },\n    {    -17,      6,  -4005,  -3690 },\n    {   -189,   4372,  -4488,  -2561 },\n    {   -450,   3846,  -3790,  -1370 },\n    {    362,   2212,  -5272,    -15 },\n    {  -1529,    791,  -6802,  -2296 },\n    {   2145,   4241,  -4474,    376 },\n    {   1813,   2426,  -2932,  -2726 },\n    {   -542,   4557,  -3140,  -1080 },\n    {   1192,   3784,  -4371,    -20 },\n    {   2784,   5188,  -6399,  -1394 },\n    {    431,   4561,  -3673,  -1398 },\n    {   1382,   3096,  -4083,   1253 },\n    {   1209,   4224,  -2930,   1500 },\n    {   2798,   2684,  -6676,   -606 },\n    {  -2396,   1510,  -5381,  -2713 },\n    {  -2625,   2542,  -4032,  -2880 },\n    {  -1231,   3967,  -4098,  -2886 },\n    {  -1393,   2374,  -3862,  -4525 },\n    {  -2495,   1665,  -1637,  -5445 },\n    {  -3854,   1759,  -1750,  -4944 },\n    {  -2373,   1668,  -2856,  -6251 },\n    {  -2668,   1981,   -886,  -4557 },\n    {  -2927,   4427,  -3451,  -6172 },\n    {  -1925,   2596,  -4696,  -2527 },\n    {  -3202,   2847,  -3928,  -5896 },\n    {  -3332,   1665,  -5025,  -3412 },\n    {  -3212,   3115,  -4155,  -4062 },\n    {  -1013,   3205,  -5133,  -3751 },\n    {  -2022,   4595,  -3947,  -5611 },\n    {  -3556,   1755,  -3715,  -2300 },\n    {  -1784,   4114,  -2723,  -1773 },\n    {  -3586,   4081,  -2733,  -4942 },\n    {  -1608,   3685,  -4154,  -4573 },\n    {  -3368,   4042,  -4452,  -6227 },\n    {  -1407,   3881,  -5729,  -3719 },\n    {  -2751,   3281,  -5077,  -4999 },\n    {  -3791,   2410,  -4906,  -5288 },\n    {   -730,   2303,  -4217,  -3755 },\n    {  -1812,   2311,  -5492,  -3709 },\n    {   -610,   4336,  -3915,  -3783 },\n    {  -2841,   4337,  -4278,  -4430 },\n    {  -1662,   4666,  -4661,  -3964 },\n    {   -589,   5209,  -4923,  -3682 },\n    {  -4155,   2234,  -4076,  -4218 },\n    {  -3951,   2770,  -2665,  -2805 },\n    {  -2302,   3228,  -3717,  -1908 },\n    {  -3129,   4373,  -2264,  -2851 },\n    {   -447,   1363,  -3578,  -4323 },\n    {  -2648,   4237,  -3159,  -3071 },\n    {  -4072,   3241,  -3541,  -4605 },\n    {  -4507,   3458,  -2339,  -3838 },\n    {  -1646,    997,  -4926,  -3970 },\n    {  -3025,   1614,  -3940,  -1242 },\n    {  -1337,   1756,  -3163,  -5529 },\n    {  -3203,   1865,  -3282,  -4354 },\n    {  -1646,   2118,  -2203,  -6018 },\n    {    174,   1871,  -2707,  -4639 },\n    {  -2607,   1485,  -4778,  -4750 },\n    {  -2199,   3991,  -3134,  -4879 },\n    {  -2962,   3323,  -2816,  -2419 },\n    {  -5286,   2495,  -4548,  -5395 },\n    {  -2810,   3710,  -2274,  -4211 },\n    {   -330,   3006,  -2993,  -4678 },\n    {  -1187,   2411,  -2743,  -5196 },\n    {   -664,   4033,  -3101,  -5641 },\n    {  -1458,   3602,  -2816,  -5371 },\n    {  -4116,   4923,  -3321,  -5630 },\n    {  -4165,   2528,  -2592,  -4798 },\n    {  -2759,   3080,  -2333,  -5719 },\n    {  -5157,   3011,  -5526,  -6348 },\n    {  -3095,   2126,  -5881,  -4234 },\n    {  -4377,   3849,  -3600,  -6099 },\n    {  -1994,   4947,  -5235,  -4753 },\n    {  -1067,    600,  -3258,  -5133 },\n    {  -4992,   3302,  -2208,  -5051 },\n    {  -3377,   2981,  -1655,  -4815 },\n    {  -3325,   2446,  -1787,  -6116 },\n    {  -2341,   2737,  -3240,  -6347 },\n    {  -2258,  -3732,   3710,  -1235 },\n    {  -1558,  -3849,   2694,  -3012 },\n    {   -599,  -4837,   3050,  -2951 },\n    {  -2246,  -5433,   2798,  -1910 },\n    {  -2255,  -4989,   3260,    270 },\n    {  -3026,  -5353,   2693,  -1036 },\n    {  -1151,  -6097,   1097,  -3782 },\n    {  -3391,  -6012,   2130,  -1303 },\n    {  -2850,  -4422,   3375,   -480 },\n    {  -1138,  -3779,   1491,  -4162 },\n    {   -551,  -3892,   3787,  -2082 },\n    {  -3221,  -3676,   3144,  -1202 },\n    {  -3023,  -5196,   2650,    605 },\n    {  -1756,  -5729,   2646,    321 },\n    {  -2693,  -4409,    494,  -4797 },\n    {  -1913,  -4573,   3372,  -1730 },\n    {  -1277,  -3604,   4061,   -993 },\n    {   -420,  -4993,   1351,  -4796 },\n    {  -3052,  -5333,   1435,  -1242 },\n    {   -602,  -5034,   3869,  -1141 },\n    {  -2436,  -4680,   1665,  -3019 },\n    {  -2657,  -3658,   1459,  -3391 },\n    {  -1220,  -6246,   2749,   -525 },\n    {  -3838,  -4844,   2265,  -1735 },\n    {  -1247,  -5679,   3356,  -1417 },\n    {   -917,  -5448,   3342,    105 },\n    {  -1756,  -6839,   2276,  -2350 },\n    {   -412,  -5206,   1764,  -3539 },\n    {  -1439,  -6915,   1442,  -3750 },\n    {  -1381,  -4439,   3863,   -282 },\n    {  -3482,  -4953,   2726,   -336 },\n    {  -1376,  -5931,   1714,  -1987 },\n    {  -1716,  -4405,   2608,    105 },\n    {  -1590,  -5191,   2652,  -2704 },\n    {  -2149,  -6442,   2453,  -1263 },\n    {  -3426,  -3832,   2334,  -1829 },\n    {  -2747,  -5948,   2362,   -173 },\n    {  -2435,  -3267,   2966,  -1710 },\n    {  -3979,  -4282,   2705,   -775 },\n    {   -356,  -4238,   2544,  -4343 },\n    {  -1363,  -6471,   2817,  -1836 },\n    {  -2878,  -5117,    218,  -3149 },\n    {  -3539,  -5196,   1710,  -2356 },\n    {  -2888,  -4537,   2746,  -1701 },\n    {  -1870,  -4439,   1496,  -4121 },\n    {  -1486,  -3388,   3349,  -2145 },\n    {  -3333,  -4138,   1467,  -2876 },\n    {   -345,  -5340,   1012,  -1190 },\n    {  -1672,  -4992,   2289,  -1029 },\n    {  -2146,  -5528,   3038,   -635 },\n    {   -316,  -3656,   3426,  -3152 },\n    {  -2695,  -5812,   2336,  -2050 },\n    {  -2067,  -6052,    737,  -3258 },\n    {  -2664,  -4205,   -350,  -1266 },\n    {   -617,  -5406,     80,  -4853 },\n    {  -2418,  -3825,   1853,  -1326 },\n    {  -1961,  -4339,    583,  -4315 },\n    {  -1495,  -5141,   -133,  -5205 },\n    {  -3208,  -6440,   1691,  -2069 },\n    {  -2632,  -3633,   2325,  -2761 },\n    {  -2624,  -5670,   1252,  -3676 },\n    {  -3687,  -5608,    687,  -2833 },\n    {  -3320,  -5707,     16,  -3877 },\n    {  -2738,  -6112,     84,  -5135 },\n    {   2277,  -5661,   3076,    843 },\n    {   1555,  -5769,   2821,  -5236 },\n    {    536,  -6381,    603,  -4910 },\n    {    734,  -4609,   3314,  -4092 },\n    {   1836,  -4547,   3267,  -4322 },\n    {    -13,  -5976,   3752,  -1607 },\n    {   1423,  -6318,   2336,    398 },\n    {    365,  -7779,   1498,   -534 },\n    {   2104,  -8366,   2946,  -1345 },\n    {    143,  -5545,   1898,  -3756 },\n    {    655,  -6852,   1430,    148 },\n    {      4,  -6653,   2397,    -59 },\n    {   2346,  -5996,   4562,   -934 },\n    {   1229,  -7104,   2963,   -598 },\n    {   -528,  -7048,   2887,  -1790 },\n    {   1451,  -6857,   3900,  -1637 },\n    {    554,  -6018,   3336,      9 },\n    {   3278,  -5758,   4034,    129 },\n    {   3541,  -7145,   4905,  -1575 },\n    {   2339,  -6907,   3464,   -301 },\n    {   2775,  -7301,   1667,  -3894 },\n    {    539,  -7887,    991,  -4156 },\n    {   2115,  -7421,   3131,  -3075 },\n    {   2803,  -8546,   2564,  -5836 },\n    {   2869,  -5833,   1620,  -4561 },\n    {   2591,  -7281,   3215,  -4719 },\n    {  -1228,  -8477,    706,  -4782 },\n    {   1967,  -5243,   4813,  -1940 },\n    {    701,  -7010,   2273,  -3893 },\n    {    915,  -8470,   1918,  -5620 },\n    {    -94,  -6715,    156,  -3873 },\n    {   1074,  -5607,   4389,  -1017 },\n    {   2739,  -6551,   1227,  -3521 },\n    {    725,  -7835,   2701,  -1291 },\n    {   -493,  -7475,   2263,  -1075 },\n    {   -412,  -6508,   2984,   -744 },\n    {    665,  -5451,   3725,  -2692 },\n    {   1499,  -8129,   3564,  -2072 },\n    {   2870,  -6333,   4487,  -2108 },\n    {    706,  -5007,   3911,   -152 },\n    {   -482,  -8660,   1483,  -2900 },\n    {   2481,  -6596,   2518,  -1715 },\n    {   1403,  -6414,   1398,  -5387 },\n    {    652,  -6267,    583,  -5942 },\n    {    694,  -7540,    646,  -6272 },\n    {   2275,  -7614,    256,  -5015 },\n    {   1416,  -9727,   1900,  -3153 },\n    {   2760,  -6433,   3875,  -3771 },\n    {   2325, -11196,   2182,  -5155 },\n    {   1223, -11061,   1377,  -5097 },\n    {    108, -10603,    307,  -4952 },\n    {   -118,  -8268,   1650,  -1572 },\n    {   1839,  -7943,   1755,   -612 },\n    {   2501,  -9056,    981,  -2969 },\n    {   2902,  -8476,   1491,  -5780 },\n    {   1995, -11175,   1585,  -3643 },\n    {    696,  -8212,    828,  -2474 },\n    {   1526,  -8649,   1380,  -1210 },\n    {    461,  -7253,   3222,  -2229 },\n    {   2966,  -8641,   4121,  -3271 },\n    {    833,  -6039,   2361,  -1086 },\n    {   3565,  -7312,   1980,  -5427 },\n    {   2850,  -8671,   3760,  -1846 },\n    {   2643,  -7281,   2163,   -173 },\n    {   3463,  -3706,  -3132,   -923 },\n    {   1315,  -3825,  -3443,      2 },\n    {   2594,  -4083,  -3815,    670 },\n    {   1826,  -4291,  -2741,   -155 },\n    {    868,  -3749,  -4175,   -298 },\n    {   2008,  -4237,  -3897,   -517 },\n    {   1242,  -3493,  -4335,  -1335 },\n    {    -88,  -4142,  -3390,  -1529 },\n    {   2176,  -3488,  -3822,   -975 },\n    {   1706,  -5188,  -3415,   -637 },\n    {   2717,  -6159,  -2333,   -882 },\n    {   1276,  -3978,  -4361,    537 },\n    {   2471,  -5556,  -2866,   -208 },\n    {    799,  -4673,  -4086,     56 },\n    {   1901,  -4786,  -3533,    270 },\n    {   3036,  -3902,  -3606,   -333 },\n    {   2249,  -3317,  -4319,   -144 },\n    {   2594,  -4207,  -2105,  -2930 },\n    {   4008,  -4774,  -2626,   -902 },\n    {   1038,  -3659,  -3496,  -2454 },\n    {   2725,  -3597,  -3298,  -1535 },\n    {   1662,  -5803,  -2813,    175 },\n    {    705,  -3757,  -3441,  -1484 },\n    {   1860,  -5987,  -2821,   -886 },\n    {   3786,  -4918,  -2199,  -1929 },\n    {   3683,  -4235,  -2547,  -1287 },\n    {   2531,  -4896,  -2956,  -1593 },\n    {   1005,  -5585,  -3324,   -180 },\n    {   1625,  -5229,  -1756,  -3642 },\n    {   1494,  -5041,  -2989,  -2685 },\n    {   2718,  -4655,  -3224,   -867 },\n    {   2374,  -6640,  -1745,  -2975 },\n    {   2133,  -6436,  -2477,  -1499 },\n    {   1833,  -4418,  -3523,  -1512 },\n    {   1128,  -4910,  -2658,  -1106 },\n    {    689,  -4777,  -2831,  -2085 },\n    {   3593,  -5280,  -2627,   -315 },\n    {   3264,  -3771,  -2673,  -1861 },\n    {   3202,  -5602,  -2409,    402 },\n    {    552,  -4618,  -2221,  -3002 },\n    {   3095,  -5356,  -2666,  -1083 },\n    {   3401,  -4609,  -3146,     45 },\n    {   3051,  -4662,  -2192,  -2232 },\n    {   2798,  -5552,  -2462,  -1941 },\n    {   2354,  -5815,  -2223,  -2619 },\n    {    192,  -3708,  -2807,  -2658 },\n    {   1886,  -4226,  -1862,  -3529 },\n    {   2526,  -3976,  -2819,  -2332 },\n    {   1577,  -3870,  -2711,  -2806 },\n    {   1288,  -5588,  -3382,  -1403 },\n    {   2711,  -5399,  -1564,  -3253 },\n    {   1459,  -5492,  -2222,   -322 },\n    {   2823,  -5091,  -2886,    776 },\n    {   3559,  -5821,  -2109,  -1360 },\n    {   1587,  -6331,  -2760,  -1909 },\n    {   2139,  -5213,  -2874,  -2120 },\n    {   1318,  -4337,  -3695,  -2098 },\n    {    821,  -4471,  -1849,   -565 },\n    {   3329,  -4782,  -1725,    -89 },\n    {    582,  -4914,  -4105,  -1119 },\n    {    417,  -4144,  -4072,  -2529 },\n    {   -199,  -3803,  -2765,  -4042 },\n    {   2731,  -4283,  -2143,      1 },\n    {   2911,  -6187,  -1951,  -2116 },\n    {   1573,  -6094,   -493,  -2838 },\n    {   2081,  -6927,   -864,  -3211 },\n    {   1058,  -7826,     79,   -364 },\n    {   3147,  -5570,   -684,   -978 },\n    {   3572,  -5856,   1060,   1824 },\n    {   1143,  -6702,  -1478,    338 },\n    {   2341,  -7220,    -88,    260 },\n    {   3639,  -6861,    668,    815 },\n    {   2227,  -6268,  -1706,    446 },\n    {   3390,  -6082,   -353,   1302 },\n    {   1123,  -7556,  -1237,   -430 },\n    {   1729,  -7742,    729,   -218 },\n    {   1457,  -6774,    587,    579 },\n    {    505,  -6919,   -569,    371 },\n    {   1106,  -7245,     78,    158 },\n    {   2755,  -6745,  -1122,    338 },\n    {   3069,  -6040,  -1415,    986 },\n    {   2174,  -7064,  -1430,   -283 },\n    {   1390,  -8626,   -446,  -3031 },\n    {   3534,  -6890,   -431,    547 },\n    {   2267,  -9618,    475,  -2994 },\n    {   3672,  -7673,     75,   -115 },\n    {   2131,  -7560,  -1206,   -750 },\n    {   2972,  -7477,   -685,   -262 },\n    {   1604,  -6637,   -672,    699 },\n    {   1666,  -7577,   -577,   -240 },\n    {   1591,  -6554,  -2158,    -94 },\n    {   2348,  -6286,   -353,   1123 },\n    {   2017,  -8810,   -412,  -1805 },\n    {   2892,  -6713,  -1765,   -554 },\n    {   2500,  -6828,  -1995,  -1197 },\n    {   3877,  -6639,   -224,  -1655 },\n    {   2392,  -7872,    -91,   -333 },\n    {   3562,  -7370,   -532,  -2836 },\n    {   2552,  -7614,    164,  -1805 },\n    {    990,  -6104,    218,    438 },\n    {    910,  -7861,    312,  -1195 },\n    {   1472,  -6327,    372,   -640 },\n    {   1576,  -7143,  -1983,   -843 },\n    {    422,  -7625,   -457,   -278 },\n    {   1797,  -8532,    405,  -1011 },\n    {   1088,  -7396,   -238,  -2277 },\n    {   3209,  -6753,  -1431,  -2072 },\n    {   2617,  -6839,    100,  -2573 },\n    {   2575,  -8573,   -387,  -3188 },\n    {   3618,  -6971,  -1190,   -321 },\n    {   2205,  -7361,  -1695,  -2008 },\n    {   2985,  -6297,   1464,   1179 },\n    {   2804,  -7310,   1053,    338 },\n    {   1362,  -6074,  -1163,   -840 },\n    {   3336,  -6325,  -1794,     21 },\n    {   2836,  -8109,    818,   -329 },\n    {   2791,  -5879,    560,   1546 },\n    {   2392,  -6064,    135,    100 },\n    {   1838,  -6194,    596,   1085 },\n    {   1926,  -7515,   -414,  -4901 },\n    {   3225,  -7298,  -1202,  -1189 },\n    {   3960,  -7558,   -659,   -719 },\n    {   3442,  -6647,  -1692,  -1095 },\n    {   3381,  -6441,    262,   -886 },\n    {   1431,  -8150,  -1186,  -1406 },\n    {    340,  -8498,   -150,   -899 },\n    {   3004,  -8149,   -260,   -953 },\n    {   2749,  -6611,    563,    873 },\n    {  -6647,  -1325,  -4517,  -4691 },\n    {  -6005,  -1657,  -4089,  -3797 },\n    {  -3157,    588,  -5213,  -3068 },\n    {  -3311,  -1425,  -6329,  -3726 },\n    {  -5866,   -819,  -3857,  -2744 },\n    {  -5001,  -1799,  -1075,  -4621 },\n    {  -5330,  -2650,  -2672,  -4664 },\n    {  -4930,   -539,  -2363,  -4010 },\n    {  -2984,     10,  -3863,  -5749 },\n    {  -1055,  -2106,  -3713,  -4267 },\n    {  -5476,   -502,  -4279,  -6504 },\n    {  -5231,  -1543,  -5018,  -6425 },\n    {  -5134,   -363,  -3165,  -5109 },\n    {  -3953,   -771,  -4107,  -6393 },\n    {  -2159,   -563,  -3652,  -5342 },\n    {  -3888,  -2321,   -919,  -5057 },\n    {  -1236,   -597,  -4235,  -4193 },\n    {  -4053,    675,  -3083,  -6174 },\n    {  -2793,  -1089,  -5396,  -3460 },\n    {  -3000,    -44,  -2209,  -6575 },\n    {  -3336,  -1531,  -4313,  -5160 },\n    {  -2127,    128,  -4851,  -3692 },\n    {  -3321,    136,  -2067,  -5660 },\n    {  -5215,   1404,  -4374,  -4356 },\n    {  -2747,    400,  -6340,  -3691 },\n    {  -3926,   -599,  -5361,  -5006 },\n    {  -2875,  -2592,  -5143,  -4092 },\n    {  -4991,  -1958,  -5322,  -4891 },\n    {  -4965,  -1318,  -6652,  -5333 },\n    {  -4920,  -1691,  -3388,  -5561 },\n    {  -3644,  -3354,  -2688,  -5982 },\n    {  -5076,   -919,  -4563,  -2984 },\n    {  -6114,    250,  -3884,  -3915 },\n    {  -4014,    744,  -3973,  -1924 },\n    {  -5543,  -1041,  -5557,  -3847 },\n    {  -4711,  -1352,  -5649,  -2603 },\n    {  -3362,    775,  -5305,  -4879 },\n    {  -5001,    107,  -3554,  -2888 },\n    {  -6258,  -1651,  -6356,  -6566 },\n    {  -4529,    407,  -5003,  -3865 },\n    {  -5154,    550,  -5278,  -5465 },\n    {  -4195,   -467,  -1894,  -3129 },\n    {  -5022,   1127,  -3349,  -3314 },\n    {  -6075,   1250,  -4313,  -5641 },\n    {  -2677,  -2283,  -2312,  -5903 },\n    {  -4113,    193,  -1195,  -4833 },\n    {  -3940,  -1048,  -1389,  -5079 },\n    {  -3703,    917,  -4043,  -4451 },\n    {  -3366,  -4231,  -1534,  -5488 },\n    {  -3326,  -3583,  -2091,  -4903 },\n    {  -5144,   1254,  -2532,  -4949 },\n    {  -5982,   -870,  -2545,  -4555 },\n    {  -3925,   -157,  -5367,  -2281 },\n    {  -6419,   -746,  -5668,  -4371 },\n    {  -5787,    518,  -7096,  -5805 },\n    {  -4258,    954,  -6453,  -4321 },\n    {  -4771,   -695,  -4158,  -1639 },\n    {  -7078,   -760,  -5195,  -5877 },\n    {  -7348,     83,  -4101,  -4586 },\n    {  -2430,    184,  -2874,  -1679 },\n    {  -2284,  -3943,  -2924,  -5034 },\n    {  -1804,  -1785,  -3002,  -4710 },\n    {  -4399,  -2772,  -1815,  -4637 },\n    {  -6340,  -2626,  -2824,  -5191 },\n    {  -4998,  -5168,  -3480,   1905 },\n    {  -3958,  -5492,  -1599,   1579 },\n    {  -2471,  -3755,   -276,   3182 },\n    {  -3033,  -5779,  -1063,   1554 },\n    {  -2936,  -4829,  -1290,   2386 },\n    {  -1835,  -5073,  -3051,   1299 },\n    {  -1724,  -3771,  -3935,   2324 },\n    {  -5070,  -2550,  -3692,    768 },\n    {  -4326,  -5333,   -297,   1878 },\n    {  -3472,  -5619,  -3094,    992 },\n    {  -3027,  -4384,  -3038,   2265 },\n    {  -3201,  -5332,     67,   2200 },\n    {  -1681,  -4373,  -1947,   2461 },\n    {  -3221,  -3329,  -4238,   2564 },\n    {  -1262,  -2968,  -2915,   3227 },\n    {  -3419,  -1878,  -3373,   2110 },\n    {  -2244,  -5583,  -2012,   1288 },\n    {  -1971,  -5266,   -990,   1812 },\n    {  -2975,  -2778,   -452,   4063 },\n    {  -2198,  -1165,  -3298,   2965 },\n    {  -4782,  -4894,  -4767,    664 },\n    {  -6002,  -3950,  -2806,   2025 },\n    {  -3142,  -3162,  -2859,   3295 },\n    {  -3262,  -3340,  -4123,   1596 },\n    {  -4014,  -3918,  -1955,   3361 },\n    {  -1700,  -3463,  -1346,   3449 },\n    {  -4245,  -4445,  -4743,   1644 },\n    {  -4180,  -3969,   -401,   3281 },\n    {  -2782,  -5240,  -4117,   1156 },\n    {  -5744,  -4040,  -1439,   3470 },\n    {  -5063,  -4663,   -323,   3172 },\n    {  -4531,  -3319,   -844,   3988 },\n    {  -6226,  -5125,  -2064,   2976 },\n    {  -3115,  -3267,  -1531,   3898 },\n    {  -4628,  -4421,  -2864,   2808 },\n    {  -4559,  -2989,  -3442,   2024 },\n    {  -1775,  -4487,   -656,   2477 },\n    {  -2664,  -1865,  -1884,   4081 },\n    {  -1828,  -2575,  -3894,   3378 },\n    {  -6441,  -3677,  -2025,   1677 },\n    {  -4141,  -2156,  -1191,   3474 },\n    {  -4802,  -1623,  -1727,   2160 },\n    {  -5474,  -2745,  -1475,   2498 },\n    {  -3664,  -1056,  -1975,   2491 },\n    {  -4672,  -3062,  -2235,   2933 },\n    {  -4205,  -5960,  -2849,   1517 },\n    {  -4995,  -5708,  -1739,   1805 },\n    {  -4892,  -6080,  -4793,    872 },\n    {  -4270,  -4172,  -4263,   2185 },\n    {  -4687,  -1470,  -2905,   1023 },\n    {  -6446,  -5017,  -3919,   1000 },\n    {  -6046,  -5538,  -3943,   2006 },\n    {  -6028,  -3750,  -3953,    771 },\n    {  -5959,  -4582,  -5024,    824 },\n    {  -5818,  -2576,  -2249,   1326 },\n    {  -5659,  -5345,  -1119,   2500 },\n    {  -3346,  -4155,    606,   2749 },\n    {  -5680,  -4827,  -2501,   1838 },\n    {  -6193,  -2543,  -1295,    840 },\n    {  -6871,  -4925,  -3512,   1801 },\n    {  -5605,  -1788,  -1895,    779 },\n    {  -3922,  -5712,  -4644,    510 },\n    {  -4745,  -3869,  -4533,     99 },\n    {  -2984,  -4907,   -399,   1497 },\n    {   1847,   -478,   3061,  -5812 },\n    {   4450,  -1116,   3609,  -6570 },\n    {   3139,     99,   3007,  -5532 },\n    {   2590,  -3782,   3138,  -4770 },\n    {   1881,   1204,   5778,  -3404 },\n    {   3631,   2060,   5566,  -5038 },\n    {   3461,   1961,   5167,  -3800 },\n    {   2947,    273,   4536,  -4389 },\n    {   4453,  -1730,   5788,  -4370 },\n    {   4032,   1805,   2666,  -4534 },\n    {   3487,   -944,   2313,  -6028 },\n    {   1313,     34,   4210,  -4067 },\n    {   5632,  -1502,   5825,  -5855 },\n    {   7736,   -547,   4879,  -5476 },\n    {   4906,  -1512,   4760,  -5760 },\n    {   3843,    447,   1091,  -4958 },\n    {   2982,  -1135,   5442,  -4386 },\n    {   3579,    271,   3031,  -6770 },\n    {   3932,   -211,   4688,  -5507 },\n    {   4411,   1720,   2387,  -5584 },\n    {   5379,   -479,   4575,  -6280 },\n    {   3613,   -362,   2012,  -4885 },\n    {   3744,  -2013,   4493,  -5073 },\n    {   5693,    109,   4379,  -3362 },\n    {   5475,   -621,   5317,  -3985 },\n    {   6411,   -673,   5708,  -4752 },\n    {   4933,   -796,   7262,  -4290 },\n    {   2804,    444,   6276,  -3655 },\n    {   4120,   -517,   6078,  -4531 },\n    {   5119,    841,   3486,  -3910 },\n    {   4738,   1539,   3525,  -2970 },\n    {   5086,    370,   5895,  -5640 },\n    {   4235,   2716,   4589,  -5044 },\n    {   3691,    682,   6199,  -4700 },\n    {   6111,   -570,   6271,  -6528 },\n    {   2611,   1277,   3756,  -4802 },\n    {   4395,    970,   3807,  -5879 },\n    {   5225,   2299,   3242,  -4333 },\n    {   5144,   1778,   4946,  -5545 },\n    {   2989,  -3016,   3247,  -5495 },\n    {   2983,    920,   2071,  -6059 },\n    {   5270,   -903,   4434,  -2350 },\n    {   6415,   -585,   3970,  -3554 },\n    {   3866,   -197,   5216,  -2884 },\n    {   3767,  -1298,   6702,  -3315 },\n    {   6299,   2620,   5284,  -6824 },\n    {   6654,    646,   3653,  -4927 },\n    {   4770,   3047,   5160,  -6287 },\n    {   5364,    434,   2919,  -5207 },\n    {   2998,   1344,   4801,  -2456 },\n    {   3896,   1013,   3773,  -1864 },\n    {   2115,    655,   2999,  -6344 },\n    {   5170,   -981,   2849,  -4464 },\n    {   2735,  -2159,   2717,  -5776 },\n    {   2430,  -1952,   4392,  -4559 },\n    {   6143,  -1180,   3659,  -4746 },\n    {   4978,  -1483,   1726,  -4875 },\n    {   3486,  -2383,   3306,  -4301 },\n    {   1434,  -1372,   4171,  -4770 },\n    {   3354,  -2627,   1525,  -5093 },\n    {   6790,   2386,   3995,  -5909 },\n    {   1475,  -2674,   3451,  -4204 },\n    {   1999,  -3494,   3693,  -5556 },\n    {   4764,  -2848,   2856,  -5589 },\n    {  -3677,   5131,   2827,  -2934 },\n    {  -2844,   7078,   2852,  -3580 },\n    {  -3902,   6434,   4118,  -1911 },\n    {  -1769,   7530,   3492,  -3541 },\n    {  -1937,   5679,   -447,  -1127 },\n    {  -2456,   4680,   4196,  -2407 },\n    {  -2778,   8241,   1698,  -4288 },\n    {  -2876,   6104,   5182,  -2387 },\n    {  -2802,   7341,   4463,  -2938 },\n    {  -1025,   6267,   4752,  -3201 },\n    {  -2349,   5413,   2041,  -3794 },\n    {  -2252,   8225,   2856,  -4269 },\n    {  -1465,   4967,   4976,  -2500 },\n    {   -636,   7565,   3517,  -4233 },\n    {  -1905,   5618,   3904,  -2942 },\n    {   -302,   6816,   3343,  -3316 },\n    {  -2210,   4156,   2817,  -3511 },\n    {   -717,   6568,   1863,  -2951 },\n    {  -3873,   5682,   2164,   -575 },\n    {  -2878,   5835,    440,  -2597 },\n    {  -3228,   7701,   2610,  -2514 },\n    {  -3608,   8888,   3377,  -2468 },\n    {  -2582,   9717,   2519,  -3126 },\n    {  -5238,   6202,   2866,  -2831 },\n    {  -3428,   7370,   3056,   -335 },\n    {  -1681,   8836,   1210,  -2010 },\n    {  -3276,   6724,   1156,  -3930 },\n    {   -894,   8149,    827,  -1258 },\n    {  -2965,   8631,   2549,  -1320 },\n    {  -3961,   6902,   3581,     55 },\n    {  -1894,   7745,   1750,   -841 },\n    {   -821,   6844,    850,   -676 },\n    {   -608,   6948,     -4,  -1376 },\n    {    615,   6524,   1089,  -1147 },\n    {  -2972,   5668,   1091,   -489 },\n    {   -157,   4649,   2904,   -413 },\n    {    673,   5121,   1498,    -66 },\n    {   -390,   5902,   1611,   -245 },\n    {  -2349,   5478,   4772,  -1320 },\n    {     88,   6798,   1972,  -1859 },\n    {  -1213,   5120,   2991,    200 },\n    {  -2347,   6040,   2839,    376 },\n    {   -578,   5976,   3364,  -1796 },\n    {  -1391,   5872,   3002,   -965 },\n    {   -564,   4496,   3946,  -1186 },\n    {  -2299,   6386,   3135,  -2176 },\n    {  -2131,   5641,   2011,   1223 },\n    {   -772,   5807,   1124,    895 },\n    {  -2837,   6758,   2297,   -740 },\n    {  -3091,   6298,   1415,  -2126 },\n    {  -4197,   6036,   1843,  -3022 },\n    {    -41,   6459,     92,    344 },\n    {  -2241,   6860,   2095,  -4396 },\n    {  -1931,   7088,   2117,  -2135 },\n    {  -2375,   4422,   1688,  -3169 },\n    {  -1742,   6674,   1538,   -119 },\n    {  -4818,   7749,   4192,  -1577 },\n    {  -2004,   5672,    193,   -430 },\n    {  -3825,   6042,   2128,  -1898 },\n    {  -1108,   8033,   2119,  -3013 },\n    {  -2370,   5453,   1721,    266 },\n    {  -1570,   7134,    614,  -2638 },\n    {  -1519,   8752,   3503,  -4330 },\n    {  -2050,   3845,   2907,  -1126 },\n    {   5085,   4412,   -335,  -1923 },\n    {   3618,   1423,   -613,  -4012 },\n    {   4481,   3729,    589,  -4631 },\n    {   4270,   3216,  -1763,  -3168 },\n    {   4241,   1796,  -1701,  -2796 },\n    {   4787,   2338,   -487,  -3639 },\n    {   2915,   3429,   -621,  -4753 },\n    {   5175,   1660,  -1265,  -3223 },\n    {   4280,   4057,   -684,  -4079 },\n    {   4980,   4419,  -1455,  -2719 },\n    {   5436,   2464,    387,  -4197 },\n    {   4507,   4018,   1121,  -3314 },\n    {   6020,   2401,   -413,  -3201 },\n    {   4200,   3789,   -333,  -2813 },\n    {   5229,   2493,  -1194,  -1878 },\n    {   5851,   2695,   -492,  -2292 },\n    {   5743,   3288,   -697,  -1221 },\n    {   5692,   2612,    979,  -2227 },\n    {   5085,   2067,   1046,  -1214 },\n    {   3163,   2240,  -2098,  -3435 },\n    {   5228,   1898,    145,  -2397 },\n    {   5860,   3976,   -418,  -2872 },\n    {   6008,   3399,   1027,  -3506 },\n    {   4126,   2035,   1865,   -893 },\n    {   5375,   3596,    511,  -2362 },\n    {   1937,   1493,   -852,   -122 },\n    {   3473,   4849,    547,  -2603 },\n    {   4631,   2977,   1141,  -1768 },\n    {   6149,   3050,    -71,  -1886 },\n    {   4069,   4353,   -289,  -1429 },\n    {   2884,   1225,  -1388,    365 },\n    {   5485,   2518,   -235,   -571 },\n    {   1216,   4375,   1443,    398 },\n    {   4988,   3106,    107,  -1435 },\n    {   4511,   2801,    307,   -444 },\n    {   3235,   4386,    327,   -676 },\n    {   2055,   3708,   1657,   -305 },\n    {   5839,   2374,    290,  -1385 },\n    {   5110,   3305,   1936,  -4206 },\n    {   6416,   2920,    338,  -2736 },\n    {   3350,   2824,  -1269,  -3881 },\n    {   4840,   1815,    464,    186 },\n    {   2399,   3332,    238,   1238 },\n    {   3516,   1363,   1582,    688 },\n    {   3582,   1874,    154,  -4770 },\n    {   3261,   2878,    886,    283 },\n    {   3877,   2658,   -327,    884 },\n    {   4151,   3436,   2173,  -2923 },\n    {   3592,   3674,   1281,  -1295 },\n    {   4561,   3730,  -1114,  -1747 },\n    {   4595,   3625,   -558,   -575 },\n    {   2577,   2348,   2267,    120 },\n    {   5242,   3299,     32,  -3412 },\n    {   4264,   3637,    709,  -2320 },\n    {   6556,   3570,   -838,  -2472 },\n    {   5745,   4014,   -940,  -1973 },\n    {   5629,   4475,    477,  -3328 },\n    {   5269,   3199,   1682,  -3085 },\n    {   4432,   2416,   1145,  -3299 },\n    {   4465,   2505,   2162,  -2186 },\n    {   4643,   4941,    -88,  -2885 },\n    {   4568,   5231,    552,  -3915 },\n    {   5667,   3075,  -1406,  -2963 },\n    {   5418,   5259,   -771,  -2818 },\n    {   -256,  -7875,    511,   -471 },\n    {  -1813,  -7971,   -424,   -396 },\n    {   -306,  -7006,    862,    282 },\n    {  -2306,  -6422,  -1440,    508 },\n    {   -245,  -6787,    375,   -100 },\n    {  -1309,  -6065,    -20,    779 },\n    {  -1656,  -6047,   -641,   1307 },\n    {  -1496,  -6522,    964,    726 },\n    {  -2291,  -6588,   -202,    795 },\n    {   -762,  -7522,   1454,   -558 },\n    {  -2270,  -7004,   -834,   -580 },\n    {  -1139,  -7078,    259,    362 },\n    {  -2535,  -7568,  -1040,     49 },\n    {  -3786,  -7280,    934,   -476 },\n    {  -3336,  -6368,    606,   1056 },\n    {  -3602,  -6924,     52,    714 },\n    {  -2278,  -6550,   1674,    204 },\n    {  -2855,  -5765,    930,   1530 },\n    {  -2889,  -7325,   -215,    305 },\n    {  -2749,  -6080,   -237,   1452 },\n    {   -985,  -6667,   1577,    400 },\n    {  -2036,  -6083,    380,   1267 },\n    {  -2077,  -7460,    380,    -30 },\n    {  -1775,  -7175,   1540,   -386 },\n    {  -3065,  -6927,    989,    168 },\n    {  -2836,  -7602,    117,  -3392 },\n    {  -1058,  -6396,    593,  -3078 },\n    {   -844,  -6062,    999,   -236 },\n    {  -3261,  -6951,   1491,   -720 },\n    {  -2186,  -8484,     75,  -1287 },\n    {  -2882,  -7756,    456,   -510 },\n    {  -1800,  -6879,    960,  -1183 },\n    {  -2554,  -7241,   1614,  -1474 },\n    {  -2608,  -5305,    392,    851 },\n    {  -2973,  -6562,   -859,    858 },\n    {  -2640,  -5989,   1031,   -416 },\n    {   -977,  -8366,    705,  -1434 },\n    {  -1213,  -7409,    -77,  -1390 },\n    {  -1335,  -6657,   2125,   -123 },\n    {  -2544,  -6862,   1852,   -737 },\n    {  -3235,  -6422,   1752,   -103 },\n    {  -1300,  -7557,    939,   -348 },\n    {  -3476,  -7579,    202,   -109 },\n    {  -2482,  -6572,    753,    619 },\n    {  -2554,  -8136,   -648,   -429 },\n    {  -1012,  -7870,     -3,   -421 },\n    {  -3604,  -6247,     32,  -3102 },\n    {  -1486,  -7271,   2013,  -1021 },\n    {   -578,  -6799,   -523,    405 },\n    {  -2841,  -5948,   1644,    911 },\n    {  -2411,  -7473,   1084,   -484 },\n    {  -2238,  -6033,    294,  -1059 },\n    {  -3459,  -6470,   -201,   -790 },\n    {  -2027,  -6009,   1833,    805 },\n    {  -1433,  -8047,   1531,  -1754 },\n    {  -3258,  -7884,    763,  -1422 },\n    {  -1544,  -6928,   -729,    478 },\n    {  -2314,  -8415,     74,  -3757 },\n    {  -3201,  -5684,     95,  -2214 },\n    {  -2423,  -8694,    725,  -3631 },\n    {  -3545,  -7071,   1162,  -1798 },\n    {   -294,  -9662,    403,  -2274 },\n    {  -2290,  -5460,   1196,    402 },\n    {  -1603,  -6713,    903,  -2363 },\n    {   4121,   2491,  -3142,  -2482 },\n    {   4500,   3305,  -3671,  -1567 },\n    {   5973,   3172,  -1348,   -534 },\n    {   4830,   3379,  -1549,    643 },\n    {   5214,   3938,  -2641,  -2302 },\n    {   4639,   4826,  -5532,   -847 },\n    {   5639,   2731,  -2170,   -963 },\n    {   6084,   3487,  -3525,  -1346 },\n    {   5971,   3154,  -2190,  -2316 },\n    {   5618,   4865,  -6927,    116 },\n    {   5345,   3568,  -7391,    709 },\n    {   5429,   5078,  -3811,  -1524 },\n    {   6960,   2037,  -3515,  -1096 },\n    {   7092,   2531,  -4557,   -588 },\n    {   6061,   4247,  -5651,   -478 },\n    {   4595,   3684,  -4907,   -827 },\n    {   7497,   3213,  -3048,   -424 },\n    {   5996,   2137,  -3098,  -1745 },\n    {   6198,   5199,  -2223,  -2274 },\n    {   6888,   2851,  -2768,  -1675 },\n    {   6114,   4210,  -2316,   -954 },\n    {   7127,   4242,  -3041,  -1408 },\n    {   6126,   3668,  -1517,  -1427 },\n    {   6245,   6129,  -4225,  -1186 },\n    {   6816,   3213,  -2101,   -964 },\n    {   5345,   5276,  -2643,   -847 },\n    {   6592,   4665,  -4338,    484 },\n    {   6746,   3751,  -3443,    124 },\n    {   5453,   1980,  -2738,   2606 },\n    {   4662,   2179,  -4226,  -1059 },\n    {   5571,   3208,  -3554,    174 },\n    {   5256,   4447,  -1815,  -1481 },\n    {   5400,   2570,  -1210,    235 },\n    {   7056,   2549,  -2674,    318 },\n    {   4574,   4340,  -2892,   -130 },\n    {   6203,   4587,  -3273,   -305 },\n    {   5103,   1925,  -2715,  -2137 },\n    {   3905,   4296,  -1700,    247 },\n    {   4421,   4605,  -3299,    811 },\n    {   5671,   1273,  -3870,   -924 },\n    {   5486,   1805,  -4901,    133 },\n    {   6437,   2578,  -1828,   -106 },\n    {   5530,   5253,  -5058,   1223 },\n    {   4816,   2025,  -1215,   1443 },\n    {   3457,   3525,  -2456,   3217 },\n    {   3316,   2595,  -1108,   2459 },\n    {   3068,   3810,  -2207,   1926 },\n    {   6351,   5436,  -6470,    600 },\n    {   6324,   4240,  -5365,   2416 },\n    {   4851,   4774,  -4075,   1878 },\n    {   4900,   3679,  -5198,   1078 },\n    {   8347,   3633,  -4565,   -171 },\n    {   5244,   5718,  -3853,    173 },\n    {   3960,   3492,  -2939,   2105 },\n    {   6070,   3473,  -2351,    161 },\n    {   8228,   3034,  -3360,   -901 },\n    {   7006,   3985,  -1940,  -1926 },\n    {   7123,   4681,  -4301,   -878 },\n    {   5122,   4097,  -1851,   -449 },\n    {   6200,   2060,  -2251,   1049 },\n    {   7106,   3844,  -7209,   2625 },\n    {   7108,   3370,  -6734,    533 },\n    {   6859,   2849,  -3992,   1360 },\n    {   5458,   2278,  -3253,   1131 },\n    {  -1072,  -2109,   4783,  -1073 },\n    {   -319,  -2604,   4257,  -2418 },\n    {   2466,   1300,   3476,   -314 },\n    {   2847,  -1502,   5296,   -141 },\n    {   1667,  -1273,   5559,  -2725 },\n    {   2877,  -3402,   6434,    204 },\n    {     53,  -2637,   5275,  -1181 },\n    {   1091,  -2215,   5803,  -1549 },\n    {   2397,   -922,   4327,   1182 },\n    {    219,  -3747,   4647,  -1564 },\n    {    -29,  -2705,   4812,   1277 },\n    {   1499,  -2608,   5648,   1407 },\n    {   2139,  -2399,   4202,   2791 },\n    {   -426,  -2064,   5528,    151 },\n    {   2560,  -2803,   6179,  -2806 },\n    {   4537,  -2479,   3797,   1095 },\n    {    888,  -3357,   5341,   -415 },\n    {   4460,  -1814,   5388,  -1227 },\n    {   3920,  -3268,   6364,   -703 },\n    {   3343,  -4698,   4410,    784 },\n    {    309,  -1897,   6306,   1223 },\n    {    958,  -3318,   4254,  -3167 },\n    {    -99,   1596,   6018,  -1983 },\n    {   -429,   -853,   6407,    878 },\n    {   1170,  -1322,   6290,   -417 },\n    {   2288,   -505,   6303,  -1999 },\n    {   3312,  -1674,   6749,  -2494 },\n    {   -415,  -3401,   4721,   -371 },\n    {   -189,  -1210,   4844,  -2002 },\n    {    888,  -4142,   4377,    130 },\n    {   2469,  -4381,   5398,  -2492 },\n    {   2879,  -2912,   5094,  -2598 },\n    {   -717,   -617,   5650,   -685 },\n    {   1470,  -3863,   5352,  -1684 },\n    {   3935,    -96,   3823,   -730 },\n    {   3769,   -430,   3168,    694 },\n    {   2556,    385,   3539,    512 },\n    {     77,  -1415,   5111,   2655 },\n    {   2724,  -2158,   6715,   -822 },\n    {   1832,   1001,   5385,  -1900 },\n    {    900,   2198,   4464,   -559 },\n    {    441,     69,   5921,  -1743 },\n    {  -1161,    738,   6732,   -308 },\n    {    257,   2035,   4091,    736 },\n    {   1607,   1288,   4355,    -23 },\n    {    -13,   1316,   4180,   1672 },\n    {   1511,   1336,   3057,   1435 },\n    {   2189,  -3813,   4530,    939 },\n    {   3632,   -706,   2646,   1375 },\n    {   4266,  -3761,   4241,   1077 },\n    {   3101,   -427,   5273,  -1202 },\n    {   2293,    276,   4810,   -313 },\n    {   3430,  -1851,   3101,   2045 },\n    {   3453,  -2979,   5142,    942 },\n    {   1683,  -3281,   4802,   2002 },\n    {   3954,  -4715,   5611,    578 },\n    {   1272,   -155,   5085,    454 },\n    {    128,   -194,   5095,   1409 },\n    {    820,    880,   5797,  -2658 },\n    {  -1095,    656,   5774,   1095 },\n    {    813,  -1669,   4320,  -3251 },\n    {   -119,    518,   6372,   -651 },\n    {   2922,  -4299,   6115,   -877 },\n    {   4205,  -4273,   4004,   2642 },\n    {  -1211,  -3892,    224,   3127 },\n    {    -34,  -4371,   1321,   2318 },\n    {     77,  -6326,   1201,    828 },\n    {   3995,  -3775,   1958,   3233 },\n    {    178,  -3301,   1985,   3318 },\n    {   2330,  -3801,   1033,   3195 },\n    {   1413,  -5536,    826,   1709 },\n    {   2468,  -3499,   3653,   3631 },\n    {    741,  -4617,   1723,   2008 },\n    {   1246,  -3043,   2978,   3949 },\n    {   -343,  -4308,   2258,   2189 },\n    {   -682,  -4640,    454,   2272 },\n    {   1236,  -4829,   2491,   1642 },\n    {   -512,  -3766,   1182,   3052 },\n    {    119,  -3939,   3712,    971 },\n    {  -1145,  -4624,   1360,   2281 },\n    {    101,  -4746,   2866,   1255 },\n    {  -1500,  -5455,    539,   1637 },\n    {   -969,  -5909,   1414,   1128 },\n    {  -1261,  -4939,   -231,   2022 },\n    {   -226,  -5345,   1207,    705 },\n    {   2712,  -5109,   3205,   1866 },\n    {   -476,  -5913,    273,   1208 },\n    {  -2039,  -4464,    624,   2545 },\n    {  -2351,  -3930,   2019,   2673 },\n    {  -2675,  -4849,   1522,   1990 },\n    {  -1524,  -3461,   1446,   3204 },\n    {    477,  -5314,   1710,   1577 },\n    {    656,  -3729,   2346,   2511 },\n    {    550,  -5917,   1975,   1040 },\n    {   1728,  -4704,   3067,   1058 },\n    {     -9,  -5247,    506,   1760 },\n    {   -574,  -5135,   1675,   1672 },\n    {   2129,  -3781,   3444,   2313 },\n    {   1144,  -4439,   2214,   2529 },\n    {   1292,  -4160,   3185,   1833 },\n    {   2445,  -3262,   2534,   3227 },\n    {   2266,  -4401,   2023,   2400 },\n    {   -587,  -3602,   3408,   2067 },\n    {   -885,  -4951,   3228,   1174 },\n    {   -728,  -2711,   2807,   3552 },\n    {   1019,  -3043,   3195,   2954 },\n    {   1888,  -4615,   1140,   2454 },\n    {    660,  -5616,    754,    800 },\n    {  -1975,  -5371,   1649,   1585 },\n    {  -1544,  -5436,   2422,   1081 },\n    {   -422,  -5882,   2390,    750 },\n    {   1336,  -5557,   2441,   1230 },\n    {    136,  -4001,    267,   2854 },\n    {   -522,  -3289,   2226,   2728 },\n    {   -971,  -4580,   2471,    708 },\n    {    704,  -5306,   3300,   1001 },\n    {    325,  -3464,   3555,   2398 },\n    {    794,  -3686,    848,   3169 },\n    {    660,  -3017,   4584,   3242 },\n    {  -1486,  -3978,   2170,   1644 },\n    {  -1615,  -4650,   2688,   1844 },\n    {    750,  -4578,    538,   2239 },\n    {   1668,  -5849,   1455,   1031 },\n    {   3486,  -4681,   2030,   2183 },\n    {   2642,  -5429,   1696,   1761 },\n    {   4491,  -4502,   3538,   2767 },\n    {   3545,  -4528,   3514,   2982 },\n    {   3269,  -3676,   2758,   3966 },\n    {   5572,   1146,    209,  -3379 },\n    {   7459,   1053,    593,  -1896 },\n    {   4480,    200,   -310,  -4259 },\n    {   5577,   -939,    242,  -3992 },\n    {   8142,    442,   1257,  -3083 },\n    {   5442,   1261,   1424,  -3236 },\n    {   6260,   -183,   3125,  -2532 },\n    {   7179,    889,   1618,  -2548 },\n    {   6416,    932,   2379,  -2487 },\n    {   7094,   2560,    961,  -3392 },\n    {   7322,    463,   2732,  -3735 },\n    {   6632,   1577,   1912,  -3272 },\n    {   6312,   1349,   3028,  -3460 },\n    {   6105,    386,   1213,   -977 },\n    {   5478,   1158,   1114,   -486 },\n    {   6493,    410,   1686,  -2180 },\n    {   6378,   1881,   1333,  -2240 },\n    {   5711,    812,   1958,  -1300 },\n    {   6844,    877,    730,  -1189 },\n    {   6824,   -245,   2249,  -2000 },\n    {   7515,   1521,   1251,  -3058 },\n    {   6697,   1051,   1300,  -1749 },\n    {   6476,   1425,    811,  -2773 },\n    {   7350,    465,    -76,  -2849 },\n    {   6975,   2095,    567,  -2492 },\n    {   4691,   1736,   2660,  -2289 },\n    {   7837,   1456,    340,  -2767 },\n    {   7930,    507,    838,  -2074 },\n    {   6106,   1502,    766,  -1110 },\n    {   4891,   -659,    835,  -3954 },\n    {   7250,    141,   1369,  -1523 },\n    {   7651,     67,   1651,  -2298 },\n    {   7364,   -305,    601,  -3132 },\n    {   7179,    193,   2491,  -2871 },\n    {   6504,   -272,   2167,  -1322 },\n    {   4456,    983,   2300,   -421 },\n    {   4817,    457,   1695,    371 },\n    {   6914,    555,    850,  -3159 },\n    {   5904,   1030,    202,  -1959 },\n    {   6258,    880,   2233,  -4503 },\n    {   6029,     10,   2130,  -3600 },\n    {   6449,    985,   1129,  -3963 },\n    {   6616,    -18,   -111,  -3285 },\n    {   4496,    775,    817,  -4276 },\n    {   6134,   2338,   1470,  -2973 },\n    {   6911,    152,    430,  -1946 },\n    {   4053,    991,   3218,  -1193 },\n    {   5435,   1285,   3124,  -2412 },\n    {   5507,   1836,   1935,  -1988 },\n    {   5240,    689,   2189,  -2670 },\n    {   6638,   1719,    606,  -1799 },\n    {   5556,   -180,    129,  -2595 },\n    {   5644,   1918,   1281,  -4316 },\n    {   6410,   1088,   -282,  -3117 },\n    {   6503,   1841,    312,  -3514 },\n    {   6947,     20,   1358,  -3886 },\n    {   5464,   2109,   2398,  -3194 },\n    {   5616,   -407,   2140,   -498 },\n    {   6121,   2707,   2379,  -4096 },\n    {   7303,   1846,   2266,  -4095 },\n    {   5444,    470,   2718,  -1553 },\n    {   5817,   -645,   3285,  -1349 },\n    {   5625,   1427,   1103,  -1991 },\n    {   6041,   -806,   1196,  -2943 },\n    {   3050,  -5722,   4070,  -5460 },\n    {   3420,  -4386,   4078,  -5155 },\n    {   6020,  -3982,   7268,  -2689 },\n    {   7502,  -4317,   7894,  -3973 },\n    {   4156,  -3558,   5247,  -4316 },\n    {   4725,  -4401,   7290,  -1540 },\n    {   6688,  -5122,   8216,  -3210 },\n    {   9176,  -6576,   9276,  -4963 },\n    {   8706,  -5708,   7987,  -4621 },\n    {   7060,  -3535,   6532,  -3308 },\n    {   5600,  -2719,   5363,  -1568 },\n    {   4661,  -2803,   6263,  -4716 },\n    {   3673,  -3636,   6147,  -3433 },\n    {   5305,  -2585,   6073,  -2638 },\n    {   7614,  -1962,   6079,  -5266 },\n    {   6760,  -3366,   7382,  -4322 },\n    {   6385,  -3883,   4797,  -1353 },\n    {   8182,  -5120,   4298,  -4641 },\n    {   9130,  -6198,   4975,  -3063 },\n    {   7421,  -5436,   5576,  -3713 },\n    {   3483,  -4898,   5443,  -2745 },\n    {   4907,  -5643,   6390,  -4105 },\n    {   8119,  -7008,   7992,  -6764 },\n    {   6528,  -6122,   6967,  -5590 },\n    {   5890,  -4190,   6624,  -5688 },\n    {   6815,  -7934,   7275,  -5456 },\n    {   5434,  -4306,   5169,  -5378 },\n    {   4364,  -6436,   5376,  -2604 },\n    {   8152,  -3404,   5913,  -5048 },\n    {   7983,  -4863,   4262,  -2461 },\n    {   8023,  -6188,   6238,  -5062 },\n    {   6753,  -3692,   3935,  -3723 },\n    {   6826,  -4760,   3284,  -4051 },\n    {   7224,  -7423,   4492,  -3875 },\n    {   6904,  -2590,   6587,  -6248 },\n    {   6106,  -1944,   7345,  -5506 },\n    {   4956,  -2990,   7808,  -3146 },\n    {   6908,  -6885,   5949,  -1288 },\n    {   7162,  -6058,   3419,  -3401 },\n    {   7015,  -7080,   6907,  -3018 },\n    {   6971,  -6832,   5646,  -3273 },\n    {   8014,  -5546,   5471,  -1544 },\n    {   6792,  -2220,   5105,  -2879 },\n    {   8494,  -3974,   4408,  -3999 },\n    {   9591,  -4866,   6027,  -4558 },\n    {   5264,  -5161,   6101,   -738 },\n    {   5803,  -6141,   5197,  -5231 },\n    {   4657,  -6822,   3232,  -5189 },\n    {   4791,  -5135,   3809,  -4665 },\n    {   6108,  -5103,   2379,  -3873 },\n    {   4680,  -3909,   3234,  -5093 },\n    {   5802,  -3853,   3795,  -4984 },\n    {   4360,  -7483,   4802,  -3877 },\n    {   5429,  -7517,   5911,  -3717 },\n    {   6866,  -2280,   4880,  -4634 },\n    {  10131,  -4628,   4414,  -4092 },\n    {  10811,  -5189,   7746,  -5337 },\n    {   5663,  -8941,   5287,  -5680 },\n    {   8023,  -5991,   7403,  -2796 },\n    {   9669,  -6919,   6525,  -4932 },\n    {   7275,  -3796,   4962,  -2547 },\n    {   8848,  -4806,   5677,  -3080 },\n    {   8128,  -4308,   7749,  -6569 },\n    {   4032,  -5196,   2282,  -6239 },\n    {   6593,    700,   -229,    304 },\n    {   8260,    539,    -66,  -1259 },\n    {   6605,    176,   -814,   -109 },\n    {   8057,      0,     -1,   -136 },\n    {   7382,    -38,   -484,  -1129 },\n    {   8373,   -929,    682,   -454 },\n    {   7674,    690,  -1278,    546 },\n    {   7326,   -517,    406,  -1283 },\n    {   7612,  -1715,  -1167,   1175 },\n    {   8590,    441,   -782,   -710 },\n    {   8572,  -1202,   -291,    260 },\n    {   7308,   -147,  -1785,    414 },\n    {   6787,   -353,   -672,    934 },\n    {   5177,   -133,    179,     82 },\n    {   4161,    -34,    447,   1497 },\n    {   5997,   -902,   1533,   -121 },\n    {   5727,   -871,  -1370,    945 },\n    {   8386,   -252,    293,   -823 },\n    {   6573,  -1354,    682,    616 },\n    {   7650,  -2096,    725,    457 },\n    {   8122,     78,    636,  -1400 },\n    {   8421,    428,  -1620,    131 },\n    {   7341,  -1292,   -717,    186 },\n    {   7998,    -49,   -720,    266 },\n    {   5987,   -351,    669,    844 },\n    {   7314,  -1620,    250,   -603 },\n    {   7219,  -1562,   -572,   1994 },\n    {   8682,   -358,   -290,   -388 },\n    {   5810,    155,   -178,   1199 },\n    {   7246,    -12,   1042,   -786 },\n    {   7357,   -923,   1468,   -475 },\n    {   7801,    621,   -212,   -724 },\n    {   5346,   -514,   1210,   1356 },\n    {   8459,     36,   -127,   -779 },\n    {   6878,  -2429,    854,   1750 },\n    {   7280,  -1401,  -1353,   2845 },\n    {   7579,  -2148,  -1463,   2087 },\n    {   6637,    946,   -872,    750 },\n    {   4807,  -1100,   1289,   2602 },\n    {   4495,    219,   1551,   1128 },\n    {   7639,    506,    446,  -1107 },\n    {   6359,    188,   1009,   -115 },\n    {   6641,  -1820,   1655,    723 },\n    {   5394,  -2382,   1604,   2542 },\n    {   6021,  -2644,   2396,   1407 },\n    {   4698,    882,    245,   1525 },\n    {   8103,    573,   -798,   -349 },\n    {   8045,   -519,    997,  -1092 },\n    {   7571,   -122,    227,   -338 },\n    {   5347,  -1200,    630,   1718 },\n    {   7070,    790,    218,   -544 },\n    {   7440,    728,   -527,    -20 },\n    {   6402,   -355,    197,   -736 },\n    {   4031,    771,    866,   1895 },\n    {   6009,    896,    445,    -31 },\n    {   5160,   1098,   -856,   1784 },\n    {   7980,   -886,  -1293,   1396 },\n    {   6318,  -1361,   2423,    252 },\n    {   7547,   -699,    133,    506 },\n    {   8562,  -2344,    940,    264 },\n    {   5890,   1187,  -1425,   2194 },\n    {   6558,   -645,  -1311,   2621 },\n    {   4634,  -1671,   2075,   1623 },\n    {   5614,    105,   -816,   2376 },\n    {   6646,   1558,  -1365,    630 },\n    {   6998,   1150,  -2117,   -990 },\n    {   6555,   2311,  -1093,  -1783 },\n    {   6682,   1430,  -2391,  -1940 },\n    {   7861,   1555,  -2977,  -1188 },\n    {   6745,   1723,   -459,  -2085 },\n    {   7504,   1229,  -1666,  -2060 },\n    {   7937,    671,  -2128,  -1529 },\n    {   7139,    991,   -735,  -2632 },\n    {   6867,   1592,  -1303,  -2324 },\n    {   6401,   2230,  -1732,  -2508 },\n    {   7201,   2184,  -2169,  -1988 },\n    {   6636,   2190,   -995,  -2840 },\n    {   7620,   2306,  -2089,   -651 },\n    {   7584,   1875,  -1438,   -631 },\n    {   9214,   1561,  -2464,  -1139 },\n    {   6154,   1318,  -1237,  -2917 },\n    {   7917,   2847,  -1797,  -1599 },\n    {   8309,   2029,  -2555,   -465 },\n    {   8204,   1282,   -584,  -2405 },\n    {   8440,   1035,  -1147,  -1137 },\n    {   7107,   1858,    -60,  -1568 },\n    {   6781,   2912,   -873,  -1463 },\n    {   7603,   1316,   -319,  -1249 },\n    {   7833,   1335,    -78,  -1849 },\n    {   7930,   1141,  -1016,   -695 },\n    {   7883,   1610,  -1017,  -1314 },\n    {   8069,   1409,  -1811,   -196 },\n    {   8319,   1031,   -582,  -1590 },\n    {   5948,   1537,  -2153,  -2373 },\n    {   8684,   1171,  -1871,   -850 },\n    {   8357,   2484,  -2411,  -1292 },\n    {   6516,   2092,   -193,  -1167 },\n    {   6112,   1697,     22,   -525 },\n    {   7161,    703,   -602,  -1879 },\n    {   6047,   2351,   -807,   -219 },\n    {   8072,   1854,  -1817,  -1553 },\n    {   6956,   1304,     76,  -1011 },\n    {   6607,   1481,   -544,   -162 },\n    {   6958,   2541,   -265,  -1938 },\n    {   6416,   2514,   -777,   -850 },\n    {   7272,   2110,   -899,  -1171 },\n    {   7741,   2153,   -283,  -2614 },\n    {   6482,   2041,  -1758,  -1221 },\n    {   6762,    940,  -1862,  -2281 },\n    {   5610,   1194,  -1691,  -1561 },\n    {   7833,   2164,   -823,  -1952 },\n    {   5460,   1438,   -848,   1189 },\n    {   6011,   1377,   -771,  -1557 },\n    {   7679,    544,  -1134,  -2214 },\n    {   7209,   1292,  -2714,  -1564 },\n    {   5567,   1200,   -404,   -169 },\n    {   5853,   1461,  -1465,   -518 },\n    {   6782,    689,   -844,   -860 },\n    {   7330,   1337,  -1152,    -71 },\n    {   7189,   1506,   -653,   -685 },\n    {   6860,   2116,  -1403,   -240 },\n    {   8804,   1516,  -1391,  -1760 },\n    {   7210,   2689,  -1498,   -989 },\n    {   7030,   3022,  -1441,  -2083 },\n    {   5649,   1836,   -407,    525 },\n    {   7451,   3099,   -717,  -2464 },\n    {   7384,   1656,  -2007,    398 },\n    {   6504,    707,  -1919,   -134 },\n    {  -1851,   3639,  -2279,   -695 },\n    {  -4037,   1644,    -77,   1329 },\n    {  -4025,   1960,  -1565,   -567 },\n    {  -3430,   2495,   -795,    368 },\n    {  -4771,   2480,    993,    756 },\n    {  -3431,   2058,  -2539,   -971 },\n    {  -3802,   3418,    380,    217 },\n    {  -3074,   3350,  -1652,  -1056 },\n    {  -3705,    326,  -1650,   1535 },\n    {  -3122,   1281,  -1192,   1607 },\n    {  -4601,   1367,   -968,     53 },\n    {  -3808,    958,     44,   2560 },\n    {  -2079,   2530,  -1485,   1166 },\n    {  -3707,    343,  -2889,    180 },\n    {  -5249,   1431,    -31,    688 },\n    {  -4990,    125,   -704,   1270 },\n    {  -2771,   1334,  -2446,    746 },\n    {  -2292,    994,  -1527,   2630 },\n    {  -1261,   3070,  -2519,    268 },\n    {  -2544,   3890,  -1057,   -552 },\n    {  -4421,    255,  -1980,    530 },\n    {  -2951,    454,    -13,   3643 },\n    {  -2262,   1815,   -370,   2880 },\n    {  -2383,   3657,   -649,    576 },\n    {  -3541,   -161,  -1389,   2550 },\n    {  -4241,   1575,   1325,   2561 },\n    {  -2767,   4037,   1221,   1578 },\n    {  -3748,   2697,   1148,   1801 },\n    {  -4686,   2385,   -220,      0 },\n    {  -1531,   1645,  -2751,   1327 },\n    {    -45,   4032,   -799,   2298 },\n    {  -2915,   2280,    709,   2495 },\n    {  -1199,   3278,   -406,   2346 },\n    {  -2471,    116,  -2706,   2060 },\n    {  -2440,   2173,  -2894,   -344 },\n    {  -3375,   2287,   1781,   3226 },\n    {  -2153,   3568,   1827,   2918 },\n    {   -862,   2267,  -1626,   2527 },\n    {  -2698,   1135,    301,   4239 },\n    {  -2364,   2123,   1010,   3710 },\n    {  -2447,   3281,    -81,   1408 },\n    {  -2660,   4735,    472,    258 },\n    {  -1053,   3097,   2682,   2398 },\n    {  -3366,  -1037,  -1152,   -868 },\n    {   -643,   4242,   2212,   1259 },\n    {    971,   3991,    934,    643 },\n    {  -1617,   2002,   2139,   2195 },\n    {  -4897,    972,    784,   1719 },\n    {  -1275,   2992,   1039,   3821 },\n    {   -392,   4973,   -209,   1821 },\n    {  -1028,   4718,  -1479,   -137 },\n    {     50,   3914,    553,   2210 },\n    {    678,   4364,    359,   1303 },\n    {   -582,   4911,    514,   1671 },\n    {   1276,   3914,  -1252,   2934 },\n    {  -1496,   3984,    857,   2330 },\n    {    772,   4744,   -655,   2332 },\n    {   -799,   5283,   -439,    624 },\n    {   1341,   2937,    650,   2027 },\n    {  -1739,   4892,   1275,   1702 },\n    {   -892,   2596,   -151,   3951 },\n    {  -3532,   1090,   1292,     32 },\n    {    321,   3146,   2647,   1475 },\n    {    264,   4199,  -1591,   1317 },\n    {   -452,  -2357,   2266,   4192 },\n    {   3022,  -1033,  -2389,   5678 },\n    {  -1162,  -1342,   3543,   4990 },\n    {   -474,  -1477,  -1223,   5016 },\n    {   -699,  -2857,    900,   3835 },\n    {   -461,  -2255,   -117,   4626 },\n    {   1204,  -2062,  -1211,   4403 },\n    {   2192,  -3035,   -337,   3966 },\n    {    108,   -831,    279,   5643 },\n    {   1457,   -620,  -2908,   5276 },\n    {  -2527,    -78,   1085,   5460 },\n    {  -1978,  -1918,   -949,   4733 },\n    {     32,    367,  -1904,   5166 },\n    {   1890,  -1665,    440,   4752 },\n    {   -518,   -348,   2816,   4891 },\n    {   3695,  -2490,  -1374,   4603 },\n    {    246,  -1965,   3549,   3969 },\n    {   1100,  -3111,    656,   3737 },\n    {  -1379,    870,   -414,   4575 },\n    {    628,   -357,  -1227,   6179 },\n    {  -1129,  -1318,  -2457,   4576 },\n    {   -425,    -98,    -73,   6336 },\n    {    367,   -887,   2990,   4207 },\n    {   2091,  -1251,   2444,   3557 },\n    {  -1759,  -1610,   2046,   5273 },\n    {   3210,   1414,    -20,   2616 },\n    {   3303,  -2636,   1005,   4237 },\n    {   -327,  -3107,   -640,   3687 },\n    {   -197,    764,    572,   5486 },\n    {    646,   -767,   1388,   5464 },\n    {    104,   2742,   -228,   3907 },\n    {   -236,   1829,   -579,   4585 },\n    {  -2150,   -474,  -1525,   4006 },\n    {    -23,  -2632,  -2400,   3892 },\n    {    -12,  -1739,  -2910,   4867 },\n    {  -2310,   -368,   -102,   4583 },\n    {  -1991,  -2061,    533,   4531 },\n    {   3884,  -1446,   -153,   4393 },\n    {   1568,     14,   -289,   5268 },\n    {  -1376,   -253,  -2797,   3417 },\n    {   3193,  -2577,   2475,   3566 },\n    {   3418,    617,   1350,   1857 },\n    {   3792,    -24,   -272,   3370 },\n    {    153,   1159,   2906,   2877 },\n    {    511,   2162,   1548,   2741 },\n    {    262,    819,  -2791,   3734 },\n    {   4232,  -2015,   1486,   3477 },\n    {   2943,  -1110,  -1014,   5480 },\n    {   2842,    369,    703,   3476 },\n    {   3011,   1634,   -933,   3553 },\n    {   4412,  -1548,   -942,   5021 },\n    {  -1405,    593,   2372,   5267 },\n    {   2093,   2129,    896,   2365 },\n    {   4845,  -1980,      0,   3823 },\n    {  -2140,     81,   3278,   5637 },\n    {   1484,   2665,   -324,   3653 },\n    {     10,    192,   1620,   5291 },\n    {   2152,    738,  -2269,   5000 },\n    {   2102,   2748,  -1652,   4707 },\n    {   2855,  -2131,   -387,   5188 },\n    {   1173,    676,   1338,   3277 },\n    {   2340,  -2329,  -2064,   4095 },\n    {    861,  -2024,   1296,   5055 },\n    {   2189,   3225,   -695,   2626 },\n    {   6196,  -7079,   1943,   -822 },\n    {   4547,  -4813,   3261,   1856 },\n    {   4243,  -6904,   3443,    448 },\n    {   4581,  -7503,    946,    506 },\n    {   6626,  -7754,   3427,    470 },\n    {   3407,  -9088,   3269,  -1496 },\n    {   4079,  -6464,   2304,    777 },\n    {   5621,  -9336,   2684,   -768 },\n    {   5351,  -6464,   5238,   -214 },\n    {   5961,  -8007,   1724,  -3091 },\n    {   4213,  -8067,    603,   -246 },\n    {   7208,  -7403,   3168,  -1738 },\n    {   6098,  -7700,    329,  -1379 },\n    {   6525,  -6735,   4248,  -1072 },\n    {   6073,  -6241,   2167,  -2378 },\n    {   4609,  -9218,   3051,  -1033 },\n    {   6813,  -7283,   1581,  -1897 },\n    {   6126,  -6275,   2789,    681 },\n    {   4423,  -6538,   1621,  -1692 },\n    {   6272,  -8298,   3167,  -1855 },\n    {   6172,  -8558,   4498,  -1169 },\n    {   4844,  -8588,   1647,   -366 },\n    {   6209,  -8807,   1581,   -369 },\n    {   5389,  -8059,    550,   -192 },\n    {   6654,  -9775,   2504,  -1063 },\n    {   7103,  -7998,    806,    530 },\n    {   5662,  -6736,   1565,  -3620 },\n    {   4165,  -9564,   4191,  -2131 },\n    {   4526,  -7181,    576,  -2875 },\n    {   4633,  -8623,   2807,  -4742 },\n    {   3709,  -7794,   1815,     34 },\n    {   3634,  -8622,   2313,   -826 },\n    {   6991,  -8447,   2063,  -3198 },\n    {   7757,  -9486,   2255,   -558 },\n    {   4149,  -7778,   4728,  -1696 },\n    {   5767,  -7427,   1113,    707 },\n    {   4592,  -6261,   2329,   1864 },\n    {   3159, -10498,   1677,  -4273 },\n    {   3534,  -9010,   2437,  -3565 },\n    {   4479, -10821,   2715,  -4942 },\n    {   3207,  -9805,   3054,  -3886 },\n    {   4627,  -8189,   3018,  -2354 },\n    {   5527, -10566,   3244,  -2749 },\n    {   4346, -10127,   3335,  -3084 },\n    {   6132, -10085,   3316,  -1308 },\n    {   5629,  -9704,   2178,  -3058 },\n    {   3603,  -8538,   1246,   -624 },\n    {   3737,  -8488,    395,  -3167 },\n    {   5465, -11414,   2810,  -4640 },\n    {   5306,  -7745,   2721,  -3988 },\n    {   7000,  -9111,   1695,  -1409 },\n    {   6663,  -7741,   2466,  -4079 },\n    {   4083,  -7175,   1836,  -4831 },\n    {   3613,  -9926,   1342,  -3455 },\n    {   6588,  -8033,    457,   -258 },\n    {   4720,  -8102,     17,  -1209 },\n    {   7414,  -8709,   1294,   -344 },\n    {   5437, -10030,   4043,  -1704 },\n    {   4862,  -9281,   1558,  -1431 },\n    {   6800,  -6403,   5113,    862 },\n    {   4623,  -8242,   2667,   -228 },\n    {   5919,  -5083,   3348,   2135 },\n    {   5985,  -8889,   2733,  -5105 },\n    {   5029,  -5767,   4407,    719 },\n    {    354,  -6158,   -838,  -3001 },\n    {    351,  -5943,  -2104,  -1534 },\n    {   -633,  -7190,    -25,  -4798 },\n    {  -1595,  -7235,  -3812,  -1400 },\n    {    103,  -6197,  -2933,    -78 },\n    {  -1722,  -5020,  -3441,  -4333 },\n    {  -1963,  -5644,  -4365,   -270 },\n    {   -846,  -5743,  -3477,    196 },\n    {   -191,  -5348,  -4054,   -469 },\n    {  -2515,  -7754,  -3495,   -818 },\n    {  -2090,  -6710,  -2701,    117 },\n    {   -546,  -7036,  -1398,    163 },\n    {   -278,  -7091,  -2662,   -536 },\n    {   -622,  -7962,  -2731,  -1464 },\n    {  -1555,  -8118,  -3612,  -2057 },\n    {  -1094,  -6280,  -2314,    505 },\n    {  -2556,  -8538,  -4024,  -2247 },\n    {    109,  -7134,  -3107,  -1823 },\n    {   -900,  -6954,  -3340,   -717 },\n    {   -605,  -7113,  -3656,  -2154 },\n    {    837,  -6263,  -3211,  -2177 },\n    {   -417,  -5810,  -3871,  -1469 },\n    {  -1318,  -5649,  -4207,  -3198 },\n    {    413,  -6765,  -2082,    -33 },\n    {  -3101,  -6450,  -4362,   -766 },\n    {    755,  -6489,  -2967,   -846 },\n    {   1117,  -7106,  -2452,  -1352 },\n    {  -1202,  -8387,  -3072,  -2897 },\n    {   -365,  -4894,  -3561,  -2937 },\n    {  -2372,  -8776,   -265,  -4441 },\n    {  -1224,  -8678,   -896,  -5074 },\n    {   -755, -10096,   -600,  -6623 },\n    {    300,  -8206,   -225,  -4568 },\n    {  -1176,  -6824,  -2633,  -3527 },\n    {  -2006,  -5443,  -1526,  -5849 },\n    {  -1115,  -5540,  -2363,  -4785 },\n    {   1059,  -6812,  -2543,  -2654 },\n    {  -1976,  -6861,  -3062,  -5508 },\n    {   -379,  -5328,  -2321,  -3624 },\n    {  -2108,  -5860,  -4518,  -1915 },\n    {   -379,  -7885,  -1329,   -594 },\n    {    774,  -5389,   -581,  -5213 },\n    {  -2601,  -5083,  -1849,  -4921 },\n    {   -176,  -5580,     74,  -5075 },\n    {   -204,  -6780,   -190,  -6232 },\n    {    418,  -7594,  -1987,   -820 },\n    {  -1873,  -8529,  -2926,  -1609 },\n    {   1340,  -6362,   -919,  -4975 },\n    {    577,  -7990,  -2044,  -1873 },\n    {  -2572,  -7413,  -1745,  -2224 },\n    {  -2037,  -7030,  -1461,  -7138 },\n    {  -2559,  -8756,  -2039,  -5836 },\n    {  -2079,  -6764,  -1209,  -5669 },\n    {  -1613,  -7801,  -2006,   -685 },\n    {  -1865,  -6583,   -722,  -3529 },\n    {   -589,  -6358,  -1377,  -1003 },\n    {   -540,  -7514,  -1331,  -3542 },\n    {    419,  -6192,  -1677,  -4927 },\n    {  -2786,  -8763,  -2966,  -5065 },\n    {  -2172,  -8411,  -1726,  -4675 },\n    {  -3382,  -9833,  -3497,  -5722 },\n    {  -2433, -10169,  -2077,  -5775 },\n    {   -424,  -9451,  -1096,  -3658 },\n    {   -537,  -8522,   -910,  -1897 },\n    {  -5550,   2807,   1683,   -693 },\n    {  -6395,    635,   3573,  -1246 },\n    {  -7544,   2280,   2140,     44 },\n    {  -8751,   1136,   2951,   -794 },\n    {  -5605,   2709,   2052,    916 },\n    {  -7650,    654,    869,    135 },\n    {  -6939,    967,   1409,    870 },\n    {  -7834,   2123,   3310,    974 },\n    {  -6935,   2818,   1274,  -1678 },\n    {  -5605,   2233,   1013,    471 },\n    {  -7095,   1849,   1648,    198 },\n    {  -6636,   1634,    712,    -37 },\n    {  -7279,    978,    296,   -315 },\n    {  -7664,   3504,   3292,   -216 },\n    {  -7836,   1209,   1221,   -257 },\n    {  -7913,   2201,   1765,  -1529 },\n    {  -7077,   3783,   2632,  -1407 },\n    {  -5565,   1645,   1410,   -622 },\n    {  -6494,   2879,   1181,   -759 },\n    {  -7073,   3137,   3010,    550 },\n    {  -7249,   1839,    847,   -805 },\n    {  -6630,   2197,    282,  -1096 },\n    {  -8836,   1573,   1988,  -1090 },\n    {  -7809,   1274,    836,  -1198 },\n    {  -7895,   2970,   3511,  -1097 },\n    {  -6960,   1664,   1356,  -2442 },\n    {  -6582,   2866,   2273,    307 },\n    {  -7221,    821,   2851,  -1435 },\n    {  -6015,   1703,   2001,  -2367 },\n    {  -8082,   1034,   2103,    239 },\n    {  -5952,   1912,    301,   -465 },\n    {  -6099,    841,    379,    567 },\n    {  -6343,     50,    494,    658 },\n    {  -6586,    983,    591,   -893 },\n    {  -5500,    869,   2187,  -2479 },\n    {  -6482,     60,   1545,   -979 },\n    {  -6705,    515,   1974,    -53 },\n    {  -6460,   1755,   1325,  -1275 },\n    {  -6093,   2617,   2465,   -623 },\n    {  -7330,   2161,    594,  -2115 },\n    {  -7324,    762,   1593,  -2004 },\n    {  -6385,    679,   1510,  -2514 },\n    {  -6159,    241,   2976,  -1631 },\n    {  -8583,   3030,   4045,   -162 },\n    {  -6299,     66,   2209,  -2103 },\n    {  -5428,   1279,   3267,  -1846 },\n    {  -6438,   1335,   2728,  -1631 },\n    {  -8012,   1070,   2428,  -1151 },\n    {  -6201,   2781,   2349,  -1918 },\n    {  -5918,   1139,   3121,   -148 },\n    {  -6314,   2481,   3137,  -1808 },\n    {  -7180,   1722,   2435,  -1602 },\n    {  -6750,   1829,   3763,  -1145 },\n    {  -6713,   1777,   2221,   1212 },\n    {  -7479,   1835,   3627,   -479 },\n    {  -7299,     10,   2406,  -1593 },\n    {  -8249,   3129,    996,  -2870 },\n    {  -8374,   1534,   1333,  -1882 },\n    {  -7507,   3353,   1598,  -2299 },\n    {  -7379,   2701,   2326,  -1167 },\n    {  -8440,   2276,   2796,   -542 },\n    { -10348,   1527,   2649,  -1165 },\n    {  -8184,   3614,   2574,  -1738 },\n    {  -5539,   1574,   1733,   1138 },\n    {   9404,  -7652,     67,     79 },\n    {   8654,  -3972,   1358,    -60 },\n    {   8617,  -4794,    117,   2318 },\n    {   7886,  -4505,   1784,   1200 },\n    {   8636,  -6125,   3879,  -1003 },\n    {   9654,  -6836,   1816,    205 },\n    {   9374,  -6553,    913,   1875 },\n    {   8020,  -6150,   1134,   2390 },\n    {   7786,  -4970,   2078,  -1857 },\n    {   8691,  -6119,    711,    708 },\n    {   9039,  -5568,   2944,  -1902 },\n    {   9955,  -5048,   1433,   -601 },\n    {   8089,  -6927,   3093,  -2846 },\n    {   8487,  -7024,   2415,     19 },\n    {   9388,  -5287,   3577,  -2655 },\n    {   8591,  -7371,   2300,   -996 },\n    {   9104,  -4763,   1453,  -2558 },\n    {   7615,  -5457,    596,    164 },\n    {   9860,  -7047,   3433,   -614 },\n    {   8756,  -4404,   2235,   -964 },\n    {   9462,  -4660,    299,  -1822 },\n    {  10119,  -5550,   2689,  -1273 },\n    {  10915,  -7471,   2705,  -1007 },\n    {  11433,  -7090,   1410,  -1198 },\n    {   9882,  -7431,   2965,  -1895 },\n    {   7628,  -5219,    769,  -2661 },\n    {   8169,  -5318,   2262,     70 },\n    {   8846,  -6320,   1939,   -754 },\n    {   7147,  -5593,   1248,   -971 },\n    {  10652,  -5485,    935,    137 },\n    {   7778,  -6533,   2564,  -1932 },\n    {   8878,  -5173,   1214,   -361 },\n    {   9828,  -4943,    282,    510 },\n    {  10042,  -6134,   3895,  -1914 },\n    {   7965,  -6630,   3566,   -433 },\n    {   8573,  -4502,   3574,  -1209 },\n    {   8398,  -4801,   1031,  -1347 },\n    {  10136,  -7772,   2612,   1547 },\n    {   9890,  -7280,   1768,  -1083 },\n    {   8407,  -6585,   -706,    -58 },\n    {   7976,  -7582,    229,   -131 },\n    {  10481,  -8866,   1166,   -147 },\n    {  10914,  -4342,   3189,  -2412 },\n    {  10440,  -5198,   -104,  -1109 },\n    {  11227,  -6530,   2381,  -2449 },\n    {   8487,  -8064,   1086,    230 },\n    {   9975,  -6123,   -857,   -134 },\n    {   8339,  -6498,   1232,  -2337 },\n    {  11042,  -4506,   1119,  -2098 },\n    {  12563,  -5592,   1837,  -2062 },\n    {  11801,  -5590,    632,  -1296 },\n    {  10152,  -5617,   1511,  -1917 },\n    {   7800,  -6473,     51,  -1337 },\n    {   7941,  -5560,   2438,  -3270 },\n    {   6554,  -3834,   2100,   1476 },\n    {   9065,  -5520,   -226,  -1120 },\n    {  10794,  -7120,   -243,    122 },\n    {  10429,  -6968,    272,   -806 },\n    {   8942,  -8914,   1442,   -392 },\n    {   9969,  -5051,   2033,  -2953 },\n    {   7275,  -4152,   3058,    -64 },\n    {  11127,  -5488,   4589,  -3227 },\n    {   9626,  -6666,   2739,  -2958 },\n    {   6943,  -5362,   4470,   1008 },\n    {  -7456,   -967,   2936,  -1002 },\n    {  -8622,   -333,   6962,   2606 },\n    {  -7486,  -3392,   3668,   1287 },\n    {  -8053,   -827,   5148,   1097 },\n    {  -6610,    454,   4952,     96 },\n    {  -7701,  -1982,   3161,   -468 },\n    {  -7307,  -1132,   4071,    -36 },\n    {  -8125,   -271,   5199,   3862 },\n    {  -9182,  -1950,   2813,   1878 },\n    {  -9855,   -952,   4794,   3010 },\n    {  -7241,   1431,   4202,   2468 },\n    {  -9646,    157,   4766,   1046 },\n    {  -9371,   1230,   6009,   2958 },\n    { -11514,    -64,   8630,   5248 },\n    {  -6766,    565,   2766,   2140 },\n    {  -8426,     -9,   2852,   1271 },\n    { -11291,  -1113,   5087,   2937 },\n    {  -8297,   2092,   4495,   1264 },\n    {  -9983,    735,   3809,    -51 },\n    {  -9048,  -1000,   3191,   -308 },\n    {  -7331,  -1987,   2655,   1391 },\n    {  -7144,    -21,   4333,   2161 },\n    {  -6032,  -1540,   3543,    896 },\n    {  -7987,  -1036,   1985,   1529 },\n    {  -9264,   2004,   5194,    290 },\n    { -11308,   -840,   5754,   1654 },\n    {  -9130,  -2398,   4292,   2973 },\n    {  -6248,    838,   3563,   1223 },\n    {  -6819,  -2760,   3511,    119 },\n    {  -7213,  -2006,   4364,    762 },\n    {  -5431,  -1047,   4533,    166 },\n    {  -7098,   -641,   2021,    639 },\n    {  -8628,  -2249,   3588,    399 },\n    {  -6352,  -1498,   3560,   -648 },\n    {  -7033,  -2190,   4870,   2562 },\n    {  -7405,    -46,   3772,   -581 },\n    {  -6104,    796,   5143,   1965 },\n    {  -5787,    943,   5784,   3030 },\n    {  -8367,   1465,   7192,   4097 },\n    {  -8259,    789,   5694,   1963 },\n    { -10614,  -1899,   5748,   2645 },\n    {  -8258,   -805,   3698,   2275 },\n    {  -6877,   -972,   6431,   3160 },\n    {  -6483,    363,   7018,   3129 },\n    {  -6283,  -1358,   5191,   1524 },\n    {  -8853,  -3157,   4119,   1741 },\n    {  -6086,   -267,   3883,   -835 },\n    {  -7254,   1032,   6613,   4017 },\n    { -11470,  -3350,   4649,   3426 },\n    {  -6743,    481,   6148,   1239 },\n    {  -5394,   -166,   5309,   3165 },\n    {  -7958,   1068,   4268,   -240 },\n    { -10520,   2256,   7916,   2828 },\n    {  -5132,     -4,   5739,   1176 },\n    {  -8643,    120,   3255,   -629 },\n    {  -9631,   1974,   8870,   4362 },\n    { -10663,  -1221,   3733,    589 },\n    {  -8224,  -1843,   5806,   2655 },\n    {  -8282,   1255,   8647,   3478 },\n    { -12311,  -1505,   9043,   6256 },\n    { -11312,   -856,   7136,   4681 },\n    { -11944,   -722,   7941,   3309 },\n    {  -7868,   -463,   6846,   4196 },\n    {  -8679,   -241,   7410,   5347 },\n    {   6759,  -4680,   -508,   1220 },\n    {   5176,  -6111,    944,    121 },\n    {   6843,  -5667,  -1368,   -533 },\n    {   5616,  -5884,  -1471,   -695 },\n    {   6030,  -5089,  -1808,   -940 },\n    {   7444,  -5463,    -52,   1881 },\n    {   4207,  -6079,   -506,   1571 },\n    {   6785,  -4410,   -649,   3084 },\n    {   4838,  -5214,   2026,   2998 },\n    {   4201,  -5790,    645,   1811 },\n    {   6930,  -5129,  -1940,   1698 },\n    {   6332,  -4627,    692,   3027 },\n    {   6285,  -4314,   -106,   3644 },\n    {   6255,  -5450,  -1975,    742 },\n    {   4199,  -4676,   -459,   1796 },\n    {   5592,  -5500,   1345,   1300 },\n    {   4358,  -5556,  -2236,    114 },\n    {   4620,  -5875,  -1563,    888 },\n    {   4892,  -7550,   -327,   -419 },\n    {   4734,  -7085,      7,    613 },\n    {   3883,  -5562,  -1969,   1080 },\n    {   5610,  -4990,   -204,    834 },\n    {   4117,  -6482,  -1271,    341 },\n    {   6585,  -5107,    892,   1169 },\n    {   6632,  -3683,    302,   3002 },\n    {   6326,  -5351,   -983,  -1250 },\n    {   4382,  -7192,   -730,   -158 },\n    {   5227,  -6540,   -451,   1123 },\n    {   5468,  -6472,   -870,  -1471 },\n    {   5191,  -6402,  -1365,   -127 },\n    {   7407,  -6317,   -973,   -336 },\n    {   4611,  -6530,   -820,  -1980 },\n    {   4963,  -5159,  -2050,   -966 },\n    {   4414,  -5691,   -211,   -998 },\n    {   5954,  -5873,    750,  -1749 },\n    {   4394,  -4796,  -1268,    254 },\n    {   7161,  -6214,  -1010,    689 },\n    {   4965,  -3598,   2372,   1711 },\n    {   6248,  -6180,    981,    864 },\n    {   6473,  -5336,    525,   -600 },\n    {   4591,  -6864,  -1131,   -900 },\n    {   6314,  -6440,  -1021,   -375 },\n    {   5838,  -6209,  -1199,    944 },\n    {   5308,  -5283,  -2100,   1267 },\n    {   4342,  -5860,  -1637,  -1356 },\n    {   5680,  -4388,  -1227,   -104 },\n    {   4900,  -4098,   1449,   4046 },\n    {   4677,  -4284,   -106,   3190 },\n    {   7574,  -6173,   -848,   1859 },\n    {   6493,  -7207,   -131,    726 },\n    {   5513,  -5261,  -2117,      4 },\n    {   6191,  -7352,   -193,   -505 },\n    {   5885,  -4333,    324,   -134 },\n    {   6162,  -6081,   -312,  -2044 },\n    {   4216,  -6200,  -1810,   -572 },\n    {   5652,  -7035,   -696,   -197 },\n    {   7131,  -7189,   -366,    -60 },\n    {   5032,  -4803,  -1514,   2832 },\n    {   7386,  -4610,   -606,   3489 },\n    {   4211,  -5031,   1221,   3047 },\n    {   4050,  -4653,   1584,   1469 },\n    {   6852,  -5302,  -1861,    206 },\n    {   7736,  -4816,  -1794,   3359 },\n    {   6290,  -3439,   1522,   2454 },\n    {   1768,   5990,  -5560,  -2594 },\n    {   3903,   5326,  -1530,  -1501 },\n    {   2472,   3738,  -2117,  -4240 },\n    {   3260,   5448,   -904,  -4733 },\n    {   1435,   7297,  -3676,  -4102 },\n    {   4096,   5951,   -656,  -3312 },\n    {   2178,   6009,  -3146,  -3724 },\n    {   3787,   5493,  -5473,  -1633 },\n    {   2998,   7286,  -3334,  -3571 },\n    {   2894,   6576,  -4708,  -2804 },\n    {    830,   6163,  -4286,  -3348 },\n    {   4755,   5569,  -1730,  -2739 },\n    {   4604,   6065,  -3562,  -2605 },\n    {   2749,   5141,  -3986,  -2775 },\n    {   3942,   4875,  -2143,  -3340 },\n    {   2819,   8517,  -2004,  -2724 },\n    {   2146,   6298,   -689,  -3093 },\n    {   5196,   6504,  -3393,  -1475 },\n    {   1851,   8386,  -1748,  -1420 },\n    {   3474,   8572,  -3534,  -2688 },\n    {   4503,   7560,  -3561,  -2245 },\n    {   4433,   6219,  -2393,  -1575 },\n    {   3506,   7248,  -2275,  -1977 },\n    {   3490,   7409,  -3147,   -604 },\n    {   4214,   6447,  -3520,    516 },\n    {    619,   7034,   -829,  -1705 },\n    {   1732,   7395,   -356,  -2208 },\n    {   1226,   5204,  -3294,  -3732 },\n    {   2027,   5619,  -1813,  -4146 },\n    {   3078,   5877,     47,  -2651 },\n    {   1654,   5458,    424,   -682 },\n    {   3163,   5464,  -2026,   -270 },\n    {   2884,   5375,   -685,   -530 },\n    {   2950,   7286,    -35,  -2967 },\n    {   1986,   5066,   -597,    482 },\n    {   3459,   4308,  -3845,  -2333 },\n    {   3155,   7037,  -1346,  -4345 },\n    {   2193,   6696,   -717,  -1319 },\n    {   3677,   5089,  -3892,   -487 },\n    {   2186,   5136,  -4186,  -1492 },\n    {    773,   5796,   -917,    817 },\n    {   2489,   6546,  -3570,  -2117 },\n    {   1223,   6469,  -1362,    -33 },\n    {    271,   6061,  -1466,  -1725 },\n    {   2540,   5171,  -1847,   1032 },\n    {   2548,   5251,  -2697,   1677 },\n    {    771,   7600,   -768,   -632 },\n    {   4710,   6647,  -4736,  -1275 },\n    {   1369,   5917,  -2971,  -1056 },\n    {    163,   5239,  -3499,  -2275 },\n    {   2104,   4285,  -3211,  -3286 },\n    {   1107,   7411,  -1972,  -1671 },\n    {   2196,   7262,  -2310,  -1926 },\n    {   -244,   6439,  -1745,   -839 },\n    {   3293,   3832,  -2890,  -3000 },\n    {    419,   6443,   -379,   -407 },\n    {   3077,   4930,  -1156,  -2869 },\n    {   2131,   5874,  -2330,    224 },\n    {    690,   6538,  -2212,  -2841 },\n    {   1602,   4421,  -2515,   1542 },\n    {   3318,   9373,  -3032,  -3477 },\n    {   5646,   7462,  -5153,  -1463 },\n    {   4139,   7137,  -1539,  -3321 },\n    {   3481,   9077,  -1645,  -3653 },\n    {  -7747,    375,   -106,   -543 },\n    {  -8587,  -1379,   -586,   -461 },\n    { -10146,   -892,   2094,    694 },\n    {  -8103,    382,    504,   -325 },\n    {  -8548,    -92,     94,   -656 },\n    {  -7460,     38,    152,    388 },\n    {  -8266,   -271,   -459,   -883 },\n    {  -7935,   -664,  -1026,   -802 },\n    {  -8341,   -109,    853,    161 },\n    {  -8802,  -1355,   1099,    630 },\n    {  -8957,     -6,   1108,   -669 },\n    {  -7260,  -1520,    -43,   -407 },\n    {  -7555,   -174,    668,  -2562 },\n    {  -9014,   -126,    227,  -1191 },\n    {  -8184,    769,    290,  -1375 },\n    {  -9476,     55,    962,  -1528 },\n    {  -8679,    541,    755,  -1030 },\n    {  -9842,  -1626,    838,  -1588 },\n    {  -8513,   -702,    788,  -1998 },\n    { -10101,  -1558,   -366,  -1841 },\n    {  -8135,     78,   1479,  -1813 },\n    {  -9128,   -454,    313,  -1786 },\n    {  -7554,  -1084,    831,  -2442 },\n    {  -7576,   -701,   2068,  -1665 },\n    {  -7791,  -1481,   1587,  -1808 },\n    {  -6701,   -596,    -97,    802 },\n    {  -7418,    -15,    684,   -963 },\n    {  -7127,   -477,   -139,   -426 },\n    {  -8097,   -110,    -36,   -264 },\n    {  -7620,  -1922,   -590,   -101 },\n    {  -7647,  -1201,    279,    660 },\n    {  -7856,  -1974,    758,  -2271 },\n    {  -8496,   -167,   2232,  -1143 },\n    {  -8506,  -1359,    624,   -740 },\n    {  -7274,  -1052,   1062,   -139 },\n    {  -7800,   -217,     91,  -1794 },\n    {  -7030,  -1694,   -955,    615 },\n    {  -9020,  -1864,    101,  -2182 },\n    {  -9400,   -740,    598,   -667 },\n    {  -8448,  -1184,   2024,  -1272 },\n    {  -8812,   -570,   -897,  -2384 },\n    { -10559,  -1286,    538,  -1536 },\n    {  -8728,   -888,  -1089,  -1397 },\n    {  -7080,  -1185,    636,  -1252 },\n    {  -9880,    233,   2344,   -782 },\n    {  -7952,  -1326,   -378,  -1947 },\n    {  -7207,   -378,   1408,  -2237 },\n    {  -8467,  -1545,    902,  -1987 },\n    {  -9163,  -1474,    924,  -1739 },\n    {  -8159,   -992,    -77,  -2744 },\n    {  -8343,    148,   -423,  -1573 },\n    {  -9105,   -649,   -254,  -1214 },\n    {  -8939,    456,    281,  -1905 },\n    {  -8837,    179,   -394,  -2634 },\n    {  -9145,    757,   1547,  -1319 },\n    {  -9775,   -723,    441,  -1680 },\n    {  -8910,   -686,   1529,  -1525 },\n    {  -9492,  -1134,   2064,   -938 },\n    {  -6111,   -943,    677,    -31 },\n    {  -7411,   -613,   -814,     46 },\n    {  -9479,   -922,   -430,  -2061 },\n    { -11298,  -1268,   1318,  -1117 },\n    {  -8190,    832,    671,  -2214 },\n    { -10453,   -550,   1672,   -886 },\n    {   1044,   9353,  -1651,  -5423 },\n    {   1034,   8149,   -455,  -6166 },\n    {    761,   8293,  -3214,  -4838 },\n    {    938,   8077,    164,  -5130 },\n    {   1295,   8673,   2582,  -5490 },\n    {   -314,   7973,  -2395,  -5231 },\n    {   -507,   9012,  -2497,  -5775 },\n    {   2396,   8314,  -1022,  -4673 },\n    {  -1516,   8501,   1950,  -4969 },\n    {   -308,   7401,   1549,  -4866 },\n    {   -112,   8340,   3003,  -4920 },\n    {    -50,   9315,   1371,  -5666 },\n    {   -659,   9449,   2496,  -5547 },\n    {   2573,   9148,  -2270,  -4783 },\n    {    830,   7104,   -438,  -3907 },\n    {    522,  10672,   -677,  -6483 },\n    {  -1190,  10108,   -510,  -6518 },\n    {   -427,   8271,   -579,  -6315 },\n    {   1602,   8113,  -1927,  -4418 },\n    {  -2266,   8180,    448,  -5190 },\n    {  -1633,   8816,   -226,  -5771 },\n    {    759,   9481,   -105,  -5813 },\n    {   2254,   6679,   -466,  -5662 },\n    {    -88,   6946,    895,  -5958 },\n    {  -1705,  10009,   1394,  -5574 },\n    {    748,   7943,    540,  -6692 },\n    {   1411,   7009,    232,  -6145 },\n    {    697,   7290,  -1221,  -5342 },\n    {  -1764,  10580,   1944,  -3981 },\n    {  -1334,   9124,   1195,  -3903 },\n    {   -905,  10067,    635,  -5039 },\n    {    664,  10680,     49,  -4625 },\n    {   1374,   9536,   -777,  -3591 },\n    {    252,   9698,   -597,  -2931 },\n    {    824,   9164,  -1014,  -2144 },\n    {   2438,  10569,  -2289,  -4424 },\n    {   2101,   7102,    507,  -3614 },\n    {    294,   8051,   -432,  -1518 },\n    {   -665,  10337,    547,  -2852 },\n    {   1168,  11989,   -492,  -5427 },\n    {   1344,   6416,    302,  -5061 },\n    {  -1727,  12264,   1507,  -4543 },\n    {    674,  10889,   -902,  -3605 },\n    {   -582,   9504,    300,  -3618 },\n    {    641,   7654,    689,  -2109 },\n    {   2065,   9243,    508,  -4367 },\n    {   1055,   8373,    688,  -3144 },\n    {   -641,   8185,    986,  -3307 },\n    {   1120,   7426,   1785,  -3757 },\n    {   1660,   8070,   -593,  -3104 },\n    {   2002,   9467,  -1722,  -3475 },\n    {   2361,   8368,    100,  -3709 },\n    {   -772,   7845,   -613,  -4988 },\n    {   1485,   7430,   1896,  -6127 },\n    {   -432,   7823,   -947,  -2882 },\n    {    313,  11122,   -760,  -4871 },\n    {    412,   8412,   -283,  -4231 },\n    {   1585,  10402,  -1884,  -3267 },\n    {    321,   6952,    773,  -3016 },\n    {   -105,   9014,    121,  -2249 },\n    {   1585,  10313,   -977,  -4812 },\n    {   1619,  11869,   1306,  -6876 },\n    {  -1168,   8886,    -81,  -2500 },\n    {   -395,  10886,    733,  -6490 },\n    {  -4949,   4274,   3992,  -1054 },\n    {  -4241,   5299,   4262,  -1584 },\n    {  -2710,   3862,   4552,  -1673 },\n    {  -4608,   2472,   3672,  -1715 },\n    {  -2843,   2816,   4003,  -2326 },\n    {  -5229,   2964,   5636,     90 },\n    {  -4924,   3442,   5015,  -1096 },\n    {  -1281,   3313,   5537,  -2066 },\n    {  -3808,   1939,   4351,   -919 },\n    {  -1915,   2585,   4939,  -1614 },\n    {  -3470,   1843,   5562,   -682 },\n    {  -3800,    870,   5827,    144 },\n    {  -4985,   1452,   4728,   -709 },\n    {  -3745,   2750,   7220,    259 },\n    {  -1875,   1900,   6514,   -826 },\n    {  -4329,   1574,   7192,   1304 },\n    {  -5408,   1444,   6208,    631 },\n    {  -3327,   5312,   5707,  -1541 },\n    {  -6966,   3334,   4034,   1028 },\n    {  -7484,   4245,   4218,   -212 },\n    {  -6567,   5839,   4539,   -512 },\n    {  -5715,   5935,   3747,  -1186 },\n    {  -6410,   4881,   3356,  -1610 },\n    {  -5146,   2590,   2850,   2172 },\n    {  -5196,   4095,   2569,   -373 },\n    {  -5043,   6025,   4318,    692 },\n    {  -5525,   4884,   3513,    370 },\n    {  -6804,   7533,   5812,   -488 },\n    {  -5657,   2480,   4061,   1234 },\n    {  -3155,   1472,   6071,   1188 },\n    {  -3427,   5217,   3442,    858 },\n    {  -4698,   3013,   5517,   2586 },\n    {  -4449,   2226,   5418,   3580 },\n    {  -6395,   3547,   5487,   2028 },\n    {  -3500,   5019,   4787,      1 },\n    {  -4038,   2578,   3073,   3151 },\n    {  -2750,   1955,   4469,   3856 },\n    {  -5696,   1659,   6118,   2469 },\n    {  -4350,   1241,   6840,   3126 },\n    {  -5565,   5058,   5196,   1314 },\n    {  -1642,   4190,   3948,    607 },\n    {  -1233,   4108,   4850,   -640 },\n    {   -997,   3428,   3239,   1378 },\n    {  -6488,   2741,   6926,   2792 },\n    {  -4188,   3763,   4235,   2018 },\n    {  -3210,   3224,   5646,   1427 },\n    {  -5526,   6909,   5070,   -627 },\n    {  -2815,   3994,   3425,   1903 },\n    {  -2163,   2734,   5423,    145 },\n    {  -4149,   4247,   2355,    734 },\n    {   -410,   2521,   4138,    -16 },\n    {  -2411,   2385,   4927,   2105 },\n    {  -6077,   3591,   3114,    594 },\n    {  -4186,   4834,   5926,  -1004 },\n    {  -7315,   3369,   5966,    448 },\n    {  -7042,   5721,   5771,    238 },\n    {  -4466,   3907,   3535,  -1751 },\n    {  -2116,   3970,   6163,  -1392 },\n    {  -7239,   2143,   8407,   3630 },\n    {  -5431,   4486,   6486,    -42 },\n    {  -1874,   1617,   6333,    519 },\n    {  -6478,   2629,   4634,   -505 },\n    {  -7784,   2342,   7216,   1365 },\n    {  -1154,   1432,   4831,   1544 },\n    {  -4964,  -5801,   1797,    506 },\n    {  -4436,  -6905,   1059,  -1237 },\n    {  -5400,  -6886,    884,   -290 },\n    {  -6259,  -7103,    523,   -227 },\n    {  -4819,  -6450,   1412,   -450 },\n    {  -4056,  -6213,   1725,   -943 },\n    {  -5642,  -6091,   1357,    605 },\n    {  -4196,  -5678,   2187,   -173 },\n    {  -4726,  -5126,   2470,    321 },\n    {  -6642,  -5091,   1507,  -1005 },\n    {  -5304,  -5250,   1944,   1579 },\n    {  -7179,  -5520,   1468,   -425 },\n    {  -6033,  -4895,   1876,   -955 },\n    {  -6595,  -5143,   2207,   1291 },\n    {  -4224,  -4943,   1846,   1792 },\n    {  -7128,  -6950,    539,    724 },\n    {  -4369,  -4901,   2590,   1103 },\n    {  -7413,  -5696,   1712,   1440 },\n    {  -5885,  -6821,    418,    871 },\n    {  -6828,  -5599,    710,  -1563 },\n    {  -6123,  -5817,   1358,   1631 },\n    {  -5291,  -5622,    578,   2138 },\n    {  -7171,  -6004,    347,   2208 },\n    {  -6083,  -5251,   2132,    425 },\n    {  -4329,  -5721,    407,  -2993 },\n    {  -5326,  -5056,   1119,  -1837 },\n    {  -5485,  -5856,    185,  -2389 },\n    {  -6529,  -5178,    403,   -697 },\n    {  -6719,  -4412,   2726,    871 },\n    {  -5126,  -5629,   1835,   -771 },\n    {  -5622,  -4361,   2973,    858 },\n    {  -5282,  -5895,     45,   -335 },\n    {  -4357,  -5656,   1696,  -1558 },\n    {  -7139,  -6659,    627,   -409 },\n    {  -4415,  -6328,     35,   1306 },\n    {  -7639,  -6110,   1134,    197 },\n    {  -3626,  -5592,   2019,    901 },\n    {  -3547,  -5064,   1176,   1738 },\n    {  -5075,  -3899,   2087,    266 },\n    {  -4086,  -6311,   1479,    360 },\n    {  -6210,  -5220,   -199,  -1477 },\n    {  -3910,  -5063,   1356,    -15 },\n    {  -7616,  -4977,    461,   2401 },\n    {  -6118,  -6131,   1258,   -563 },\n    {  -6127,  -4968,   1286,    -27 },\n    {  -4121,  -5852,   1113,   1476 },\n    {  -5157,  -4881,   1162,   -662 },\n    {  -4637,  -5031,   1179,    709 },\n    {  -5509,  -5452,   -397,   1224 },\n    {  -4597,  -6861,    646,    467 },\n    {  -6247,  -4043,    468,    278 },\n    {  -5336,  -6465,    874,  -1472 },\n    {  -6998,  -6346,     78,  -1798 },\n    {  -4915,  -4530,   2756,   -203 },\n    {  -6048,  -4373,   1468,   1052 },\n    {  -4273,  -7100,    942,   -323 },\n    {  -6552,  -4287,   2351,     69 },\n    {  -6954,  -4613,    722,   1521 },\n    {  -4201,  -5361,    763,  -1562 },\n    {  -6881,  -5596,   -748,    669 },\n    {  -6695,  -3547,    -34,   1299 },\n    {  -3981,  -5728,     84,    111 },\n    {  -4663,  -4809,   2173,  -1031 },\n    {  -6599,  -6077,   1303,    256 },\n    {  -7596,  -4265,  -5791,  -4140 },\n    {  -6610,  -2758,  -5288,  -3936 },\n    {  -5880,  -3865,  -6563,  -3088 },\n    {  -7228,  -5510,  -7677,  -3912 },\n    {  -8854,  -6553,  -8318,  -5361 },\n    {  -9362,  -5249,  -6413,  -4319 },\n    {  -4418,  -3110,  -6368,  -4358 },\n    {  -5544,  -4203,  -6863,  -5013 },\n    {  -3056,  -4316,  -5567,  -3181 },\n    {  -3078,  -5999,  -5051,  -2657 },\n    {  -5884,  -6292,  -5756,  -4013 },\n    {  -4825,  -4549,  -5535,  -4053 },\n    {  -4443,  -6126,  -5316,  -1368 },\n    {  -3972,  -6341,  -6098,  -2686 },\n    {  -5751,  -2781,  -5398,  -6230 },\n    {  -4466,  -6135,  -5570,  -3679 },\n    {  -4291,  -5992,  -3564,  -5189 },\n    {  -7189,  -4429,  -7279,  -6082 },\n    {  -5076,  -4433,  -2748,  -5366 },\n    {  -6225,  -2825,  -6833,  -5663 },\n    {  -2989,  -4792,  -3960,  -4492 },\n    {  -7836,  -7773,  -7722,  -5741 },\n    {  -6559,  -5703,  -5844,  -5589 },\n    {  -7612,  -5438,  -4136,  -3774 },\n    {  -4218,  -4176,  -6591,  -2333 },\n    {  -4837,  -5063,  -6581,    322 },\n    {  -6590,  -5990,  -2980,  -3847 },\n    {  -5558,  -2971,  -5489,  -1932 },\n    {  -7001,  -5323,  -4975,  -1697 },\n    {  -4694,  -2688,  -6904,  -3044 },\n    {  -8511,  -5379,  -5767,  -2549 },\n    {  -7548,  -5412,  -6522,  -2572 },\n    {  -6597,  -4973,  -6423,  -1274 },\n    {  -6415,  -4022,  -5168,  -1072 },\n    {  -5528,  -5530,  -7218,  -2345 },\n    {  -4845,  -4805,  -5943,  -1227 },\n    {  -6049,  -7150,  -6744,  -2161 },\n    {  -9061,  -7299,  -8542,  -4375 },\n    {  -5010,  -5546,  -5416,    -82 },\n    {  -4135,  -4205,  -5109,  -3373 },\n    {  -3311,  -5869,  -4007,  -5061 },\n    {  -5993,  -6472,  -3962,  -4718 },\n    {  -2966,  -5832,  -2821,  -6305 },\n    {  -4851,  -5152,  -2067,  -3930 },\n    {  -3620,  -4441,  -3362,  -5836 },\n    {  -4469,  -5221,  -4534,  -5592 },\n    {  -4022,  -6335,  -4321,  -6107 },\n    {  -4899,  -4503,  -3084,  -3725 },\n    {  -4490,  -8276,  -4620,  -6236 },\n    {  -6591,  -4342,  -7365,  -4063 },\n    {  -6498,  -5057,  -5553,    485 },\n    {  -6060,  -2714,  -7093,  -4144 },\n    {  -6199,  -7774,  -7094,  -4057 },\n    {  -7536,  -6424,  -6415,  -4265 },\n    {  -7439,  -2454,  -6348,  -4827 },\n    {  -5333,  -7565,  -4417,  -4639 },\n    {  -4353,  -7103,  -4197,  -2689 },\n    {  -5229,  -6549,  -5129,  -6804 },\n    {  -6129,  -7701,  -5236,  -4836 },\n    {  -6797,  -3983,  -3884,  -4406 },\n    {  -6624,  -4467,  -4745,  -5052 },\n    {  -3324,  -7596,  -2720,  -6553 },\n    {  -5473,  -6284,  -1704,  -4511 },\n    {  -4131,  -7263,  -3180,  -5196 },\n    {  -7116,  -5565,  -3469,    685 },\n    {  -6002,  -6021,  -3858,    576 },\n    {  -3144,  -8203,  -1291,   -434 },\n    {  -6096,  -7027,  -4004,   1353 },\n    {  -3943,  -7709,  -2344,    -36 },\n    {  -4510,  -6767,  -2642,    631 },\n    {  -3657, -11541,  -2570,  -3984 },\n    {  -5959,  -8854,  -1333,   -867 },\n    {  -6699,  -8866,  -1606,   -344 },\n    {  -3836,  -7961,  -2334,  -2028 },\n    {  -3430,  -8045,  -3037,   -672 },\n    {  -3868,  -9184,  -3635,  -1819 },\n    {  -4258,  -9060,  -2621,  -1008 },\n    {  -3595,  -8693,  -2022,   -752 },\n    {  -4573,  -8048,  -3166,  -2622 },\n    {  -4852,  -7903,  -1405,    256 },\n    {  -4591,  -7057,  -1560,    965 },\n    {  -6963,  -7655,   -980,    808 },\n    {  -5179,  -6641,  -3356,   1196 },\n    {  -7102,  -6941,  -2798,   2123 },\n    {  -6867,  -5834,  -3320,   -770 },\n    {  -5977,  -7369,  -2500,   -778 },\n    {  -6160,  -6400,   -934,  -2543 },\n    {  -6741,  -7608,   -355,  -1289 },\n    {  -6856,  -6466,  -1433,  -1643 },\n    {  -4786,  -6292,  -4970,    376 },\n    {  -5407,  -8866,  -2255,   -400 },\n    {  -3814,  -6506,  -1387,  -3620 },\n    {  -4998,  -6137,  -1200,  -4092 },\n    {  -5123,  -9557,  -2849,  -1306 },\n    {  -4259,  -6444,  -4395,   -338 },\n    {  -5221,  -6810,   -883,   1225 },\n    {  -6137,  -6215,  -2165,    554 },\n    {  -3895,  -6557,  -3176,  -1829 },\n    {  -3886,  -8188,    -87,   -954 },\n    {  -7243,  -6707,  -2216,   -316 },\n    {  -5592,  -7606,     85,   -432 },\n    {  -3957,  -7945,   -504,   -144 },\n    {  -4617,  -7624,    218,   -312 },\n    {  -4797,  -8737,   -844,  -1051 },\n    {  -4478,  -8516,  -1401,   -454 },\n    {  -4557,  -7058,   -302,  -2332 },\n    {  -6623,  -7736,   -271,    -50 },\n    {  -3157,  -7532,  -1111,  -2207 },\n    {  -3590,  -7300,  -1271,    517 },\n    {  -4442,  -7306,   -507,    590 },\n    {  -6458,  -7524,  -2807,    666 },\n    {  -4991,  -8466,  -3363,   -785 },\n    {  -7474,  -7541,  -1056,  -1839 },\n    {  -7501,  -8316,   -938,   -180 },\n    {  -5329,  -7739,   -579,  -2341 },\n    {  -4549,  -7063,   -176,  -3539 },\n    {  -5191,  -8612,  -1504,  -4250 },\n    {  -3083,  -7058,  -2251,     32 },\n    {  -4003,  -7043,  -1093,   -791 },\n    {  -5523,  -8093,   -678,   -114 },\n    {  -3022, -10265,  -2070,  -3109 },\n    {  -3905,  -6274,   -182,  -3652 },\n    {  -3269,  -9217,   -551,  -2650 },\n    {  -3138,  -9314,  -1726,  -1704 },\n    {  -4420, -10339,  -1744,  -3459 },\n    {  -4163,  -8609,  -2298,  -4113 },\n    {  -5566,  -6505,  -1241,   -463 },\n    {  -3130,  -9746,  -2352,  -4884 },\n    {  -7825,  -3439,   1451,  -1468 },\n    {  -8451,  -3318,   2360,   -435 },\n    {  -8462,  -4130,   1438,  -1024 },\n    {  -9425,  -4564,   1328,   -689 },\n    { -11014,  -3202,   2278,   2080 },\n    {  -8269,  -2761,   -146,   -440 },\n    {  -7497,  -2618,   -166,    413 },\n    {  -8250,  -3060,    522,  -2133 },\n    {  -8365,  -5366,   1347,   -451 },\n    {  -8589,  -3979,   2943,    714 },\n    {  -8111,  -2572,   1272,  -1748 },\n    {  -7830,  -5193,    605,  -1484 },\n    {  -8119,  -4736,   2141,    256 },\n    {  -7724,  -4769,   1463,   -812 },\n    {  -7363,  -3911,   2540,      4 },\n    {  -7974,  -3397,   2363,   1366 },\n    {  -7359,  -4204,   1752,   -958 },\n    {  -7622,  -3505,    660,    916 },\n    {  -9934,  -3665,   3165,    828 },\n    {  -8721,  -4162,     62,   1718 },\n    {  -9433,  -4768,   2722,   1234 },\n    {  -7960,  -4496,    138,   1528 },\n    {  -8198,  -3454,   -443,    631 },\n    {  -7756,  -2246,    655,   1137 },\n    {  -8841,  -3145,   1113,    829 },\n    {  -7817,  -3298,   1251,    230 },\n    {  -9413,  -2733,    323,  -1862 },\n    {  -9408,  -4168,   1270,   1549 },\n    {  -9037,  -3892,   -942,    283 },\n    {  -8255,  -3849,   1301,   1762 },\n    {  -9057,  -3987,    -41,   -682 },\n    {  -9441,  -4187,   2019,   -111 },\n    {  -9740,  -3178,   1602,   -871 },\n    {  -8344,  -2474,   1461,   1506 },\n    {  -9752,  -2925,   1996,   1243 },\n    {  -9199,  -3796,    180,    537 },\n    {  -9060,  -2405,   1140,  -1562 },\n    {  -9348,  -2376,    309,   -162 },\n    { -10786,  -3182,     -5,  -1500 },\n    {  -8142,  -4540,   -434,   -826 },\n    {  -7528,  -2341,   1104,    -73 },\n    {  -9360,  -2658,   3062,     56 },\n    {  -8267,  -2335,   2000,  -1193 },\n    { -12169,  -3154,   1287,   -640 },\n    { -11398,  -2120,    946,  -1163 },\n    {  -8940,  -4559,    328,  -1696 },\n    { -11025,  -4213,   2813,    840 },\n    {  -9224,  -3581,   2224,   2039 },\n    {  -8943,  -3337,   1248,  -1298 },\n    {  -7900,  -4042,    485,  -2080 },\n    {  -9221,  -1947,   2191,   -880 },\n    { -10762,  -1800,   2516,   -324 },\n    { -10095,  -2238,    981,  -1335 },\n    { -11908,  -2808,   3255,    645 },\n    { -10640,  -4105,   1283,   -595 },\n    {  -7663,  -2863,   2467,   -797 },\n    { -10712,  -3854,   3710,   1538 },\n    { -10823,  -2893,   1408,   -801 },\n    {  -9874,  -3832,    256,  -1638 },\n    { -10394,  -3391,   2315,    -94 },\n    { -11525,  -4079,   4153,   2122 },\n    {  -9546,  -2088,   1541,    481 },\n    {  -8731,  -2433,   1042,   2160 },\n    {  -7852,  -3977,  -1370,   1677 },\n    {   7072,  -3420,   1398,  -1741 },\n    {   6180,  -1976,   1280,  -3557 },\n    {   7692,  -1793,   2844,  -1700 },\n    {   8363,  -1773,   3104,  -2679 },\n    {   9213,  -3266,   3756,  -3542 },\n    {   9650,  -2644,   1426,  -1318 },\n    {   7712,  -2796,   3686,  -1975 },\n    {   7316,  -3517,   2821,   -622 },\n    {   7434,  -2594,   2305,  -2264 },\n    {   7237,  -1797,    255,  -3114 },\n    {   8663,  -1983,   1338,  -3056 },\n    {   6616,   -952,   4059,  -2652 },\n    {   8823,  -1327,   1362,  -1356 },\n    {   9938,  -1722,   1287,  -2362 },\n    {   7207,  -1057,   1913,  -1315 },\n    {   7508,  -1585,    870,  -1982 },\n    {   8217,  -3680,   1417,  -3170 },\n    {   8329,  -2541,   1684,   -585 },\n    {   8062,  -2335,    252,  -2800 },\n    {   8204,  -4108,   3097,  -2569 },\n    {   7701,  -3367,    576,  -3008 },\n    {   7350,   -786,   2414,  -2129 },\n    {   6948,  -2568,   1607,   -225 },\n    {   7684,  -2387,   1308,  -3449 },\n    {   8306,  -3458,   2394,  -1454 },\n    {   8438,  -2781,   1043,  -1362 },\n    {   9175,  -2076,   2144,  -1987 },\n    {   8347,  -2709,   3489,  -4301 },\n    {   5696,  -2377,   2870,    851 },\n    {   8825,  -1243,   2219,  -2603 },\n    {   8801,  -1614,    584,  -2513 },\n    {   8413,   -384,   1421,  -2244 },\n    {   9228,  -3050,   3279,  -2164 },\n    {   6342,  -2698,   3547,   -107 },\n    {  10053,  -2476,   2837,  -3168 },\n    {   7439,   -604,   3177,  -3991 },\n    {   7749,  -1064,   4329,  -4855 },\n    {   8655,  -2177,   2252,  -3519 },\n    {   8490,   -228,   1958,  -3233 },\n    {  10513,  -2968,   1911,  -2340 },\n    {   8146,   -862,   1884,  -1723 },\n    {   7788,   -666,   3004,  -2891 },\n    {   7785,  -1620,   4133,  -3417 },\n    {  10262,  -3731,   3455,  -2971 },\n    {   8570,   -905,   4519,  -4649 },\n    {   9129,  -2562,    463,  -2465 },\n    {   9451,  -3587,   1904,  -3056 },\n    {   6549,  -2236,   3010,  -4523 },\n    {   7175,  -2684,   2967,  -3458 },\n    {   9872,  -3278,   1054,  -2472 },\n    {   9153,   -931,   1217,  -2565 },\n    {   8789,  -3469,    753,  -2568 },\n    {   6683,  -3791,   1797,  -3968 },\n    {   6801,  -1977,   2311,   -452 },\n    {   6336,  -1572,   2612,  -3264 },\n    {   7996,  -1008,    730,  -2964 },\n    {   7521,  -1059,   1573,  -3694 },\n    {   8148,  -3973,   2600,  -3572 },\n    {   7765,  -1532,   2528,  -3856 },\n    {   7404,  -3918,   4472,   -143 },\n    {   8894,  -1398,   3299,  -3685 },\n    {   5768,  -2041,   1487,   -637 },\n    {   5131,  -2865,   2463,   -811 },\n    {   6439,  -1568,   3500,  -1550 },\n    {  -8878,  -6798,  -5319,  -1452 },\n    {  -6332,  -9713,  -3112,   -990 },\n    {  -8444,  -6316,  -3694,   -687 },\n    {  -6123, -10840,  -3637,  -4358 },\n    {  -4784,  -9580,  -4577,  -2581 },\n    {  -6108, -10515,  -4859,  -2524 },\n    {  -7605,  -7518,  -2327,  -2797 },\n    {  -9662,  -8775,  -2467,  -2010 },\n    {  -6494,  -7523,  -4715,   -118 },\n    {  -8290,  -8982,  -1672,   -317 },\n    {  -8798, -11051,  -3888,  -1426 },\n    {  -6273,  -6623,  -6791,   -142 },\n    {  -8313,  -7668,  -2141,  -1275 },\n    {  -6453,  -8412,  -3589,  -4102 },\n    {  -6747,  -7750,  -5690,  -2498 },\n    {  -7814,  -6693,  -3174,  -2446 },\n    { -10383, -10130,  -3931,  -2364 },\n    { -10606,  -8467,  -5539,  -2772 },\n    {  -9475,  -6671,  -3305,  -2271 },\n    {  -8982,  -9457,  -5635,  -4005 },\n    { -10111,  -7965,  -6515,  -4180 },\n    {  -7301,  -6479,  -5364,    720 },\n    {  -9543,  -8999,  -7921,   -912 },\n    {  -9534,  -8562,  -3469,   -384 },\n    {  -7601, -10344,  -3205,  -1127 },\n    {  -8088,  -8620,  -4954,  -2888 },\n    {  -8202,  -8406,  -7038,  -3775 },\n    {  -7312,  -8324,  -3334,  -1775 },\n    {  -8566,  -9262,  -8071,  -4174 },\n    {  -7068, -11300,  -5573,  -2907 },\n    {  -8295,  -8952,  -4366,  -1544 },\n    { -11104, -10210,  -2285,   -384 },\n    {  -5213,  -7520,  -5008,  -1339 },\n    {  -5889,  -7940,  -5987,  -1385 },\n    { -10816,  -8201,  -4153,  -1485 },\n    { -10277,  -8919,  -6315,  -1652 },\n    {  -5888, -10320,  -3821,  -1733 },\n    { -10497,  -7181,  -6083,  -3032 },\n    {  -7721,  -9724,  -6591,  -5336 },\n    {  -5688,  -7894,  -3486,  -2552 },\n    { -10014, -10500,  -3247,   -820 },\n    {  -6301,  -8765,  -4506,  -2923 },\n    {  -8261,  -7847,  -6213,  -1552 },\n    { -10212,  -7481,  -8113,  -3954 },\n    {  -6938, -10874,  -6074,  -4703 },\n    {  -7183, -10968,  -4446,  -1773 },\n    {  -7120,  -9193,  -1966,  -2509 },\n    {  -6234,  -9263,  -2313,  -4284 },\n    {  -8503,  -9857,  -2429,   -608 },\n    {  -9372,  -7844,  -8391,  -2120 },\n    {  -7951,  -7157,  -6535,    -11 },\n    {  -7256,  -9473,  -2172,   -660 },\n    { -10063,  -9612,  -2515,    -15 },\n    {  -6684,  -9134,  -6109,  -4206 },\n    {  -8204, -11932,  -5220,  -2306 },\n    {  -9710,  -6706,  -4115,  -3275 },\n    {  -6855,  -7078,  -2409,  -4447 },\n    {  -7344,  -7673,  -4479,  -4116 },\n    {  -8851,  -6842,  -4927,  -2948 },\n    {  -8927, -10452,  -5633,  -2194 },\n    {  -8627,  -9002,  -7176,  -1575 },\n    {  -8209,  -9722,  -7021,  -3324 },\n    {  -3770, -10249,  -3623,  -4816 },\n    {  -8183,  -7465,  -4090,    646 },\n    {  -8163,  -7149,    200,    498 },\n    {  -8289,  -6266,    686,   -206 },\n    { -10030,  -6241,  -1032,  -1864 },\n    {  -8793,  -8327,   -773,   -169 },\n    {  -9149,  -6215,    969,    -15 },\n    {  -8303,  -5859,     -7,   2006 },\n    {  -9682,  -7283,    255,   1322 },\n    {  -9293,  -7227,     71,   -231 },\n    {  -8525,  -6215,    287,   -837 },\n    { -10477,  -5379,   1159,   1449 },\n    { -10726,  -7856,   -130,    102 },\n    {  -8694,  -7461,  -1210,    690 },\n    {  -9367,  -5324,   1103,   3170 },\n    { -10686,  -8055,   -831,   1633 },\n    {  -9201,  -6873,  -2704,   2258 },\n    {  -8421,  -5358,  -1405,    226 },\n    {  -9066,  -5830,   -307,  -1571 },\n    { -11150,  -7381,  -2746,   -900 },\n    {  -9978,  -5925,  -2006,   -437 },\n    {  -9464,  -4741,   -273,   1061 },\n    { -10543,  -6684,  -1113,   1660 },\n    { -10073,  -5576,   1083,   -269 },\n    {  -8826,  -5763,   1600,   1486 },\n    { -10445,  -9071,  -1253,    -64 },\n    { -12085,  -5799,      2,    769 },\n    { -12939,  -6663,   1650,   1437 },\n    { -10932,  -6434,  -1252,   -649 },\n    { -11650,  -7826,  -2053,    710 },\n    { -12122,  -6733,  -1889,   -731 },\n    {  -9093,  -6095,  -2463,   -842 },\n    { -10977,  -4364,    469,    420 },\n    { -11488,  -6908,   -521,    893 },\n    {  -9669,  -5478,   -842,    337 },\n    { -10606,  -5203,   -632,  -1361 },\n    { -10198,  -6284,   1662,   1277 },\n    { -10135,  -5292,   2435,   3493 },\n    { -11027,  -6561,    655,     56 },\n    { -10977,  -5030,   1127,   -358 },\n    { -12766,  -3986,   1348,   -335 },\n    { -14244,  -7731,    264,    317 },\n    { -15124, -10309,   -508,   1447 },\n    { -12821,  -8638,   -608,    137 },\n    { -13076,  -8693,  -2852,   -431 },\n    { -11156,  -5546,  -2252,  -1600 },\n    {  -8692,  -7366,   -819,  -1223 },\n    { -12507,  -9816,  -1714,   -121 },\n    { -10712,  -6666,    544,   3349 },\n    { -12462,  -5890,  -2491,  -2318 },\n    { -12468,  -7226,    437,    232 },\n    { -11300,  -5226,   2068,    687 },\n    { -11994,  -8320,   -626,   2728 },\n    { -12222,  -5476,   1142,     18 },\n    { -10277,  -8122,  -2418,   2003 },\n    { -13418,  -6115,  -3563,  -2802 },\n    { -14759,  -9834,  -1243,     21 },\n    { -13699,  -5665,   1525,    507 },\n    { -16269,  -9476,   -701,    163 },\n    { -12677,  -5437,   -247,  -1019 },\n    { -11827,  -4295,   -181,  -1243 },\n    { -12847,  -4496,   2984,   1123 },\n    { -13860,  -7915,  -1166,   -547 },\n    { -12276,  -8145,  -2290,  -1527 },\n    { -11417,  -4830,   2983,   1854 },\n    { -11793,  -6002,   1163,   1940 },\n    {  11443,  -4920,  -3235,   3151 },\n    {  11300,  -6616,  -1506,   1175 },\n    {   9198,  -4628,  -2060,   2390 },\n    {  10532,  -4027,   -643,    912 },\n    {   9902,  -3573,  -1606,   1327 },\n    {   9653,  -3536,  -2240,   1869 },\n    {   9948,  -5171,   -423,   2662 },\n    {  12316,  -4004,  -1989,    281 },\n    {  12125,  -4800,  -1265,   -163 },\n    {  10650,  -2617,  -2337,   1462 },\n    {   9909,  -4968,  -2376,    916 },\n    {  12944,  -4647,  -1958,    460 },\n    {  12988,  -5283,  -1141,     41 },\n    {  12321,  -2915,  -3621,   1025 },\n    {  11449,  -2894,  -2728,    351 },\n    {  12087,  -3041,  -2002,    -32 },\n    {  11558,  -4031,  -1343,   -399 },\n    {  12983,  -3740,  -3516,   1245 },\n    {  12099,  -2515,  -2752,    225 },\n    {  12515,  -3465,  -2701,    550 },\n    {  14683,  -5022,  -5272,   2996 },\n    {  12260,  -3383,  -1215,   -528 },\n    {  13810,  -5422,  -2443,   1166 },\n    {  13421,  -5378,  -1886,    721 },\n    {  12961,  -4259,  -2594,    796 },\n    {  12266,  -2104,  -4768,   1591 },\n    {  13523,  -4710,  -3045,   1342 },\n    {  12437,  -2099,  -5610,   2117 },\n    {  11850,  -2183,  -3497,    661 },\n    {  12275,  -3936,   -597,   -697 },\n    {  12459,  -5253,   -517,   -544 },\n    {  12835,  -4094,  -1322,   -168 },\n    {  14360,  -5677,  -3305,   1859 },\n    {  13905,  -4552,  -4309,   2117 },\n    {  11559,  -3412,  -1847,    -81 },\n    {  13379,  -3167,  -5764,   2746 },\n    {  11910,  -1634,  -4342,   1052 },\n    {  12662,  -4742,     71,   -974 },\n    {  13057,  -3254,  -4424,   1705 },\n    {  15046,  -5706,  -4851,   3019 },\n    {  14162,  -4142,  -5514,   2843 },\n    {  12764,  -1845,  -6684,   2888 },\n    {  13714,  -2374,  -7838,   3857 },\n    {  13295,  -1663,  -8293,   4073 },\n    {  10032,  -4152,  -3403,   1421 },\n    {  10942,  -5386,  -2222,    950 },\n    {  10532,  -6385,  -1750,   1925 },\n    {  10273,  -5972,  -1534,    643 },\n    {  10605,  -4782,  -1695,     27 },\n    {  10988,  -5153,  -1123,   -341 },\n    {  11629,  -5884,  -1060,     48 },\n    {  10441,  -4045,  -2431,    311 },\n    {  10788,  -3595,  -4171,   1807 },\n    {  12110,  -5686,  -2127,    976 },\n    {  11746,  -4773,  -2639,    891 },\n    {  11541,  -5299,  -3031,   1732 },\n    {  11416,  -2559,  -5359,   2198 },\n    {  11583,  -5376,   -704,    677 },\n    {  10416,  -3214,  -3516,    872 },\n    {   9651,  -5435,  -1618,   3255 },\n    {   9973,  -5133,   -996,   3923 },\n    {  11707,  -4643,   -430,   -796 },\n    {  10994,  -2709,  -3587,   2302 },\n    {  10716,  -5118,   -645,    270 },\n    {  14100, -10314,   1095,   1531 },\n    {  12944,  -8049,   1105,   -741 },\n    {  13276,  -7035,   -511,    274 },\n    {  14008,  -7254,   -283,    139 },\n    {  11594,  -6536,    -91,   1671 },\n    {  11732,  -8645,    746,     15 },\n    {  14613,  -7085,  -1578,   1183 },\n    {  13083,  -6224,   -750,     -4 },\n    {  13988,  -6256,  -1592,    820 },\n    {  14678,  -8683,    441,    126 },\n    {  15571,  -8872,   -521,   1139 },\n    {  15642,  -9533,    341,    697 },\n    {  15960,  -9586,   -168,   1121 },\n    {  15464, -10239,   1433,     -1 },\n    {  14934,  -7887,  -1046,   1080 },\n    {  15252,  -7630,  -1899,   1628 },\n    {  15485,  -8384,  -1234,   1484 },\n    {  15962,  -8638,  -1815,   1931 },\n    {  16501, -10664,    398,   1167 },\n    {  16146, -10145,    411,    918 },\n    {  14573,  -7475,   -697,    601 },\n    {  14302,  -7996,     28,    257 },\n    {  14769,  -6792,  -2286,   1574 },\n    {  14144,  -6137,  -2169,   1257 },\n    {  14770,  -6271,  -3111,   1933 },\n    {  14110,  -8312,   1083,   -531 },\n    {  15235,  -6991,  -2993,   2174 },\n    {  13222,  -5805,    547,   -891 },\n    {  14796,  -8762,   1254,   -246 },\n    {  16040,  -9181,  -1005,   1551 },\n    {  16487, -10086,   -373,   1420 },\n    {  15077,  -9479,    966,     51 },\n    {  13026,  -6468,    932,  -1080 },\n    {  12703,  -6152,    -33,   -573 },\n    {  15641,  -6810,  -4128,   2874 },\n    {  13282,  -7673,   1583,  -1283 },\n    {  12373,  -7150,   1512,   -917 },\n    {  12992,  -7751,   -678,    783 },\n    {  10907,  -6858,   -313,   2597 },\n    {  13026,  -8963,    125,   2152 },\n    {  12770,  -9946,   1957,   -505 },\n    {  12482,  -6849,  -1268,    833 },\n    {  13790,  -6181,   -138,   -279 },\n    {  12709,  -8382,   2044,    227 },\n    {  12244,  -6630,    203,   -457 },\n    {  14209,  -6816,  -1032,    632 },\n    {  15134,  -8267,   -288,    640 },\n    {  13619,  -6157,  -1090,    356 },\n    {  14044,  -7413,    725,   -484 },\n    {  12958,  -7753,   2585,  -1980 },\n    {  13188,  -8396,   2306,  -1558 },\n    {  14379,  -9980,   2132,   -688 },\n    {  14275,  -9857,   1162,    179 },\n    {  13690,  -8648,   1621,   -889 },\n    {  11770,  -6829,   -746,    278 },\n    {  12732,  -8202,    286,     90 },\n    {  13630, -10146,   1867,   -207 },\n    {  12072,  -8740,   1299,   -645 },\n    {  12852,  -9492,   1226,     62 },\n    {  11792,  -7382,    -54,   -116 },\n    {  13779,  -9014,    487,    351 },\n    {  11951,  -7729,    121,    834 },\n    {  11970,  -9781,   2276,     -4 },\n    {  12680,  -7984,   2787,   -787 },\n    {  13300, -14488,   6408,  -1927 },\n    {  13635, -15355,   9153,  -3073 },\n    {  12804, -13566,   5517,  -1625 },\n    {  16624, -10854,   1690,     28 },\n    {  20387, -18532,   6162,   -261 },\n    {  16515, -12642,   3392,   -519 },\n    {  15800, -11095,   2151,   -202 },\n    {  16824, -11790,   1651,    599 },\n    {  17604, -13213,   2563,    538 },\n    {  17892, -14177,   3562,    147 },\n    {  16987, -11399,    869,   1052 },\n    {  17003, -12456,   2442,    265 },\n    {  21657, -21806,   9198,  -1250 },\n    {  16825, -13341,   3980,   -686 },\n    {  17525, -12714,   1887,    805 },\n    {  16419, -11034,   1216,    617 },\n    {  20931, -19939,   7469,   -684 },\n    {  18452, -15390,   4573,   -191 },\n    {  14778, -10077,   2841,  -1209 },\n    {  17402, -13319,   3042,    160 },\n    {  19365, -17922,   7087,  -1061 },\n    {  16298, -11941,   2810,   -351 },\n    {  19087, -16176,   4775,    -84 },\n    {  17666, -12289,    938,   1224 },\n    {  18581, -15894,   5132,   -430 },\n    {  19823, -16717,   4142,    545 },\n    {  19960, -19423,   8400,  -1492 },\n    {  18973, -16817,   5906,   -594 },\n    {  19079, -15431,   3528,    503 },\n    {  16667, -12485,   4467,  -1302 },\n    {  19791, -17797,   6196,   -529 },\n    {  20005, -17606,   5354,    -20 },\n    {  20123, -18599,   6886,   -728 },\n    {  19068, -14805,   2394,   1105 },\n    {  14443, -13723,   5631,  -2029 },\n    {  14730, -14231,   5631,  -1450 },\n    {  16089, -15959,   7271,  -2029 },\n    {  13473, -11200,   3236,   -924 },\n    {  14413, -10902,   2347,   -267 },\n    {  17666, -18662,  11381,  -3496 },\n    {  14749, -11042,   3305,   -275 },\n    {  15304, -10486,   1869,   -240 },\n    {  14809, -12126,   3369,   -616 },\n    {  16896, -16561,   7307,  -1845 },\n    {  15782, -14336,   5380,  -1264 },\n    {  16395, -15520,   6415,  -1588 },\n    {  13681, -11114,   2584,   -320 },\n    {  14244, -12326,   4480,  -1632 },\n    {  15247, -13119,   4265,   -898 },\n    {  13987, -12091,   3469,   -597 },\n    {  13941, -12770,   4240,   -839 },\n    {  13771, -13627,   5252,  -1384 },\n    {  15010, -16074,   7592,  -2249 },\n    {  15852, -17226,   8619,  -2655 },\n    {  18921, -16916,   6875,  -1501 },\n    {  14909, -11678,   2768,   -295 },\n    {  18988, -18353,   8424,  -2070 },\n    {  15457, -15080,   6218,  -1513 },\n    {  14916, -15512,   6949,  -1883 },\n    {  18108, -14702,   4681,   -701 },\n    {  17600, -15733,   5616,   -775 },\n    {  14070, -13683,   6472,  -2626 },\n    {  13832, -11914,   5201,  -2232 },\n    {  18846, -19009,   9192,  -1961 },\n    { -11981, -10994,  -6324,  -2264 },\n    { -10976,  -9047,  -6546,  -3828 },\n    { -11288, -10532,  -7014,  -4191 },\n    { -10139, -10189,  -7799,  -2688 },\n    { -10555,  -9988,  -9181,  -2040 },\n    { -11596, -11339, -10022,  -2707 },\n    { -13400, -13395, -11306,  -4206 },\n    {  -9774, -12281,  -7466,  -4133 },\n    { -10842, -13125,  -8777,  -4956 },\n    { -11964, -15082,  -9779,  -5095 },\n    {  -9382, -10188,  -9053,  -4927 },\n    { -11562, -11296,  -3651,   -985 },\n    {  -9287, -10083,  -7918,  -4069 },\n    { -12821, -16556, -11410,  -6195 },\n    { -12628,  -8959,  -4521,  -1113 },\n    { -13845, -11581,  -3649,   -681 },\n    { -12685, -10269,  -5483,  -1275 },\n    { -14988, -12874,  -5107,  -1189 },\n    { -13761, -11367,  -6202,  -1804 },\n    { -13225, -11249,  -7820,  -3354 },\n    { -14809, -11992,  -3202,   -312 },\n    { -15620, -15519, -10210,  -3433 },\n    { -12954, -10200,  -3139,   -611 },\n    { -11536,  -9981,  -5284,   -923 },\n    { -13034, -12417,  -4612,  -1098 },\n    { -16911, -15505,  -6123,  -1352 },\n    { -17396, -17685,  -8330,  -2171 },\n    { -14120, -10764,  -2265,    -99 },\n    { -12598,  -7367,  -5406,  -3530 },\n    { -14143, -12793, -10909,  -5226 },\n    { -14692, -16871, -11626,  -5554 },\n    { -12581, -11197,  -9194,  -3837 },\n    { -16752, -16726,  -9746,  -2808 },\n    { -10600, -10358,  -6560,  -1227 },\n    { -14573, -13312,  -8957,  -3393 },\n    { -10172,  -8463,  -8579,  -3387 },\n    { -11418, -12421,  -5522,  -1842 },\n    { -11855, -14204,  -6669,  -2625 },\n    { -13308,  -8191,  -3941,  -2194 },\n    { -10007, -12266,  -5022,  -1811 },\n    { -13532, -15771,  -9497,  -3175 },\n    { -11760, -11148, -10339,  -5529 },\n    { -12149, -12763, -11198,  -3697 },\n    { -12029, -12119,  -8555,  -1792 },\n    { -16995, -19957, -11447,  -3471 },\n    { -13144, -14504,  -9988,  -3191 },\n    {  -9938, -11064,  -6139,  -3162 },\n    {  -8873, -11550,  -8294,  -6550 },\n    {  -9303, -13010,  -6150,  -2711 },\n    { -15463, -10469,  -1766,   -170 },\n    { -15985, -11693,  -3007,   -650 },\n    { -17142, -10671,  -1434,     47 },\n    { -16063, -13858,  -4817,  -1058 },\n    { -19446, -19599,  -9594,  -2464 },\n    { -20076, -18744,  -8313,  -1889 },\n    { -15047, -16085,  -7590,  -2250 },\n    { -13481, -16195,  -8552,  -2998 },\n    { -13829, -14869,  -6704,  -1932 },\n    { -16357, -18484,  -9802,  -2959 },\n    { -10551,  -8393,  -9303,  -5070 },\n    { -11345,  -9156,  -5641,  -3107 },\n    { -13217, -13449,  -9270,  -4541 },\n    { -11988, -13732,  -9995,  -6374 },\n    { -11007,  -9519,  -5168,  -4107 },\n    {   9930,  -7858,   8061,  -4375 },\n    {   8274,  -7867,   5992,  -2096 },\n    {   9692,  -9675,   7621,  -3670 },\n    {   9589,  -8110,   6509,  -3010 },\n    {  12617, -11976,  10122,  -5360 },\n    {  11867,  -8895,   7948,  -5323 },\n    {  10388, -10482,   9234,  -4324 },\n    {   8188,  -8220,   7810,  -2737 },\n    {  10407,  -8787,   4806,  -1930 },\n    {  10348,  -8845,   9233,  -6614 },\n    {   9422,  -7091,   4820,  -2878 },\n    {   9758,  -9796,   5584,  -2256 },\n    {  10188,  -7994,   5347,  -3343 },\n    {  11133,  -7455,   4015,  -2306 },\n    {  10676, -10744,   6093,  -2629 },\n    {  11522, -12184,   7848,  -3375 },\n    {   8805,  -9883,   5317,  -3071 },\n    {   9498,  -9654,   6555,  -3592 },\n    {  10488,  -8008,   4066,  -1252 },\n    {  11261,  -8930,   6068,  -2738 },\n    {  12180, -10397,   5027,  -1531 },\n    {   9138,  -8531,   3601,  -1959 },\n    {   8107,  -8380,   4970,  -2061 },\n    {   9737, -13248,   6438,  -2617 },\n    {  11178, -10423,   2622,   -522 },\n    {   9572, -12372,   5199,  -2019 },\n    {  12057, -12144,   4147,  -1099 },\n    {   9047,  -9925,   2516,   -665 },\n    {  10790,  -8030,   5882,  -4386 },\n    {   7199,  -8426,   6337,  -2841 },\n    {   7778,  -8285,   3529,  -3442 },\n    {   7559, -10569,   3484,  -1332 },\n    {   9404,  -8115,   7484,  -5541 },\n    {   7792, -11976,   5546,  -2573 },\n    {   9313, -10264,   7661,  -5195 },\n    {   6701, -10725,   4370,  -1784 },\n    {   4918, -11361,   4507,  -4527 },\n    {   5147, -12305,   3978,  -5556 },\n    {   6525,  -9899,   4481,  -3129 },\n    {   7538, -12855,   6060,  -4826 },\n    {   8659, -12111,   7159,  -4430 },\n    {   8440, -11304,   4547,  -1747 },\n    {   9216, -10918,   3507,  -1195 },\n    {   6165,  -9254,   4771,  -4677 },\n    {   9163, -11019,   5637,  -4935 },\n    {  13441, -11509,   6676,  -2434 },\n    {   7912,  -9398,   6663,  -4048 },\n    {  11723, -13745,   8131,  -4148 },\n    {   6065, -10257,   5005,  -6327 },\n    {  11618, -12417,   5336,  -1894 },\n    {   8891, -13924,   8407,  -6131 },\n    {   9622, -12563,   7908,  -5109 },\n    {  11479, -10315,   8349,  -3991 },\n    {  11676, -14103,   6611,  -2330 },\n    {  11951,  -8953,   3829,  -1550 },\n    {  10486,  -8044,  10493,  -5920 },\n    {  11801, -10769,   9763,  -5305 },\n    {   6109,  -8676,   5827,  -1346 },\n    {   7030,  -9611,   5624,  -5761 },\n    {  12808, -12886,   8683,  -4148 },\n    {  13213, -10464,   6381,  -3189 },\n    {  11796, -13681,  10703,  -6075 },\n    {   9639,  -7949,   9625,  -3944 },\n    {   8538,  -6997,   5309,    453 }\n};\n\nstatic const int8_t high_freq_samples[1024][32] = {\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0\n    },\n    {\n         -4,  -2,   2,   1, -16, -10,   1,   3,\n          1,   0,   6,   1,  -3,   7,   1, -22,\n          2,  -4,  -3,  11,  14,   6,  -1,   1,\n        -13,  29, -28,  10,  10,  -8,   0,  -9\n    },\n    {\n         -8,   8,  -7,  10,  -3, -12,  -5,  -8,\n          1,  -2,   9,  -2,  -5, -18,   1,   9,\n         -8,  -8,   3,  41,   7,  -9,  -9,  22,\n        -42, -29,  14, -18, -14, -32,   1, -15\n    },\n    {\n        -16,   8,  15,  16, -16,   5,   2,   7,\n         -6, -16,  -7,   1,   1,  -3,  -2,   0,\n          8,  20, -26, -11,   2, -17,   0,  -3,\n        -34, -37,  10,  44,  -2,  22,   2,  -4\n    },\n    {\n          7,  14,   5,   6,  15,  -1,   3,  -3,\n         -9, -23,  -5, -14,   8,  -1, -14,  -6,\n         -5,  -8,  54,  31,  -6,  18,   2, -19,\n         -2, -11, -30,  -6, -19,   2,  -2, -14\n    },\n    {\n          1,   2,  -2,  -1,  -3,  -3,   1,  -5,\n          1,  -3,  -4,  -8,   5,  -4,   0,   1,\n          3,   7,  -5,  -4,  -3, -12,   3,  -2,\n         -3,  12, -53, -51,   6,  -1,   6,   8\n    },\n    {\n          0,  -1,   5,   1,  -6,  -8,   7,   5,\n        -18,  -4,  -1,   1,   0,  -3,  -3, -14,\n         -1,  -6,   0, -14,  -1,  -1,   5,  -3,\n        -11,   1, -20,  10,   2,  19,  -2,  -2\n    },\n    {\n          2,   4,   3,   0,   5,   0,   3,   1,\n         -2,   0,  -6,  -3,  -4,  -5,  -3,  -3,\n         -7,   0, -34,   4, -43,  17,   0, -53,\n        -13,  -7,  24,  14,   5, -18,   9, -20\n    },\n    {\n          1,   0,  -3,   2,   3,  -5,  -2,   7,\n        -21,   5, -25,  23,  11, -28,   2,   1,\n        -11,   9,  13,  -6, -12,   5,   7,   2,\n          4, -11,  -6,  -1,   8,   0,   1,  -2\n    },\n    {\n          2,  -4,  -6,  -4,   0,  -5, -29,  13,\n         -6, -22,  -3, -43,  12, -41,   5,  24,\n         18,  -9, -36,  -6,   4,  -7,  -4,  13,\n          4, -15,  -1,  -5,   1,   2,  -5,   4\n    },\n    {\n          0,  -1,  13,  -6,  -5,   1,   0,  -3,\n          1,  -5,  19, -22,  31, -27,   4, -15,\n         -6,  15,   9, -13,   1,  -9,  10, -17,\n          4,  -1,  -1,   4,   2,   0,  -3,  -5\n    },\n    {\n         -7,   3,  -8,  13,  19, -12,   8, -19,\n         -3,  -2, -24,  31,  14,   0,   7, -13,\n        -18,   0,   3,   6,  13,  -2,   1, -12,\n        -21,   9,  -2,  30,  21, -14,   2, -14\n    },\n    {\n         -3,  -7,   8,  -1,  -2,  -9,   6,   1,\n         -7,   7,  13,   3,  -1, -10,  30,   4,\n        -10,  12,   5,   6, -13,  -7,  -4,  -2,\n         -2,   7,  -3,  -6,   3,   4,   1,   2\n    },\n    {\n         -8,   9,   2,  -3,  -5,   2,   0,   9,\n          3,   7,  -4, -16, -13,   3,  23, -27,\n         18,  46, -38,   6,   4,  43,  -1,   0,\n          8,  -7,  -4,  -1,  11,  -7,   6,  -3\n    },\n    {\n          1,   1,  18,  -8,  -6,   0,   3,   4,\n         22,  -3,  -4,  -2,  -4, -11,  40,  -7,\n         -3, -13, -14,  -7, -10,  14,   7,   5,\n        -14,  11,  -5,   7,  21,  -2,   9,  -3\n    },\n    {\n          0,   0,  -2,   4,  -2,   0,   2,   0,\n         -1,   2,  -1,   0,   0,   2,   2,   2,\n         -1,   1,  -3,  -1, -15,  -2, -63, -27,\n        -21, -47, -14,   1, -14,  10,   0,   2\n    },\n    {\n          1,   0,  -4,   0,  -3,  -9,   4,   2,\n          6,  -6,   0,  -5,  11,  -7, -15,   6,\n         -7,  -6,   3,   7, -15,  -5,  23, -13,\n         -6,  12,  -8,   9,   2,  -3,   3,   4\n    },\n    {\n          6,   0,   3,   0,  -2,  -4,   2,   1,\n          1,  -1,   1,  -2,  -1,  -4, -22, -15,\n        -46, -66,  10,  20,   2, -17,  12,  -6,\n          1,  -2,  -2,   0,   1,  -5,   1,   2\n    },\n    {\n         -1,   0,   0,   1,   0,  -4,   0,   1,\n        -10,  -3,  -8,   5,   7, -11,   2, -11,\n         29, -25,  11,  10,   0,  -1,   5,  -7,\n         -2,  -5,  -2,   4,   4,  -3,   5,  -2\n    },\n    {\n          1,  -1,  -1,  -3,  -2,   1,  -8,  -3,\n          2,  -2,   4,  -5,  -1,  -7,  -2,   1,\n        -14,  -7,   3, -30, -15, -14,   3,  -4,\n         -1,   3, -13,  -1,  -3,   1,   2,   3\n    },\n    {\n         -1,  -2,  -3,   2,   2,  -3,   3,   1,\n         -3,   2,   0,  -4,   6,   5,  -5,  10,\n        -57,   3,  22, -50,   1,  -2,  -5,  -6,\n         -1,   5,   1,   2,   2,   1,  -2,   2\n    },\n    {\n          2,   0,  -1,  -7,   2,   1,   3,   2,\n          0,   4,   3,  -2,   3,  -3,   4,  -4,\n         24, -35,  -3,  38,  -6,  -5,  15,  20,\n          3,  16,  -7,  -5,   0,  -4,  -5,   0\n    },\n    {\n          0,   1,   0,   0,   0,  -1,  -1,   1,\n          1,  -1,   1,  -2,   0,   0,   0,   0,\n          0,  -1,  -2,  -1,  -5,  -2, -43,  -3,\n         46, -52, -10,   7,  -8,  11,  -2,  -1\n    },\n    {\n          0,   0,  -1,   0,  -1,   2, -41,  33,\n        -44, -48, -15, -26,  -9,   6,   3,   3,\n         -3,   2,   2,   2,   2,  -1,  -1,  -2,\n          1,   3,   0,   0,   5,   2,   3,   1\n    },\n    {\n         -4,   1,   6,   1,  -6,  -1,  -2,   1,\n        -14,  -4,   0,  -5,  -2,   2,  -2,   0,\n         -6,   1,   0,   8, -21,  32,  -3, -36,\n         -6,  -2,  -1,  -7,   3,   0,   1,  -6\n    },\n    {\n         -3,  -2,   3,   0,   2,   2,   8,  -4,\n         -4,   6,   2,   1,   3,  -6,   4,   3,\n         13,   0, -12,  -1,  25, -20,  -2, -23,\n        -15,   7,  -3, -11,  -3,   6,  -1,   0\n    },\n    {\n          0,   0,  -3,  -1,   0,   0,  -2,  -1,\n         -2,  -2,   1,  -1,   0,   0,  10,   3,\n         -2,   3,   3,  -7,  -6,  -5,   0,  -4,\n        -60, -16,  -6,  38,   5,   6,  -5,   0\n    },\n    {\n          0,   1,   0,   0,   0,   0,   0,   0,\n          1,  -1,  -1,   0,   1,   0,   0,   1,\n          0,   0,  -1,   0,  -8,   2,  -9,  10,\n         40,  31, -56, -21,   4,  20,  -4,   7\n    },\n    {\n         -2,  -2,   0,   4,  -3,  -1,   7,   3,\n          1,   3,  -8,   0,   3,   1,   2,   5,\n          1,  -2,  14,   5,   4,   5,   5,   5,\n         -5,   9, -66,   0, -20,  -2,  -8,   4\n    },\n    {\n         -2,  -1,   4,  -1,  -8,  -2,  -4,  -1,\n         -3,  -3,   2,  -7,  -3,   5,   7,  -2,\n         45,  31, -17, -16,  -2,  -2,  -1, -22,\n          1,  -1,  -3,   3,   5,  -3,   5,  -1\n    },\n    {\n         -4,   0,   7,   5,   8,   7,   2,   9,\n         -9,  -9,  -7, -11,  -3,  -8,  17,  -4,\n         34,  32,  18,  22,   1,   2,   1,  -7,\n         -5,   6,  -1,   6,   4,  10,  -2,  -7\n    },\n    {\n          6,   0,  14,   9,   6,  -1,  -2,  -3,\n          4,  -6,  -8,   4,   7,  -1,  28,  38,\n         15,  -1,  16, -11,   5,   8,   4, -10,\n          3, -10, -17,   5,   3,   3,   3,   1\n    },\n    {\n          1,   1,   2,  -1,   2,   1,   0,   0,\n         -1,   0,   0,  -2,   1,  -3,   0,   1,\n          2,  -2,  -4,  -2,   0,  -1,   1,  -3,\n          1,   1,   1,  -1,   8,   8,  66,  33\n    },\n    {\n         -5,   2,  -3,  -7,   2,  -8,  -4,  10,\n         17, -18,  -7,   4,  -4,  -7,  -6,  -6,\n         -5,   5, -12,   2,   0,   6,   8,  -2,\n          1,   4, -11,   2,   1,   8,  31,  19\n    },\n    {\n          6,   9,  16,  -6,  -6,  -1,  -2,  -3,\n        -11,  -2,   7,   7,  17,   3,   4,  10,\n          2,   5, -13,   8,   7,   1,   4,   5,\n          7,   6,   7,  -8,   9,  -8,  33,   6\n    },\n    {\n          3,  -1,   1,   0,  -7,  -5,   0,  14,\n         -7,   1,  -7,   1,   2,  -4,   7,  10,\n        -16,  12,   1,  -6,   3,   8,  -1,  10,\n        -13,  -6, -12, -23,  12,  -3,  30,  14\n    },\n    {\n         -2, -15,   0,   8,   3, -19,   5,  -3,\n          2,   3,  13,   7,  14,  -3, -10,   0,\n          8,   5,  -6, -16,  -8,  -8,  14,   2,\n         -1,   1,  -9, -11,  11,  -5,  27,   9\n    },\n    {\n         -8,   6,  -4,   4,  -4,  -1,   5,   4,\n          1,  -7,  -5,  -4, -15,   1,   9,   0,\n          8,   4,   1, -17,  11,  -2, -19,  -1,\n         -6,  -8,   3, -12,   3, -17,  33, -10\n    },\n    {\n         -3,  -1,   2,   7,   7,  -2,   9,   8,\n        -18,  -1, -13, -10,  -3,  -3,  11,   8,\n         -2, -12,  -8,   1,   4,   9,  14,  10,\n         -3,   0,   2,   1,  -2,   3,  31,  10\n    },\n    {\n         -3, -10,   8,  -1,  -5, -11,   7,  -5,\n          3,   6,   1,   4, -16,  10,   5,  -4,\n         -2, -10,  -1,  13,   6,  -5,  -7,  12,\n          7,  -3, -17,   1,  12,  -4,  29,   8\n    },\n    {\n          1,   2,   5,   2,  -6,  -7,   0,  -1,\n          6,  -1,  10,   6,  -4,   5,   2,   2,\n         -2,  -8,  -6, -11,  14, -13,  27,   3,\n         -2, -12,   5, -16,   2, -26,  20,  15\n    },\n    {\n         -1,  -3,  -5,  -3,  -3,   6,  -1,   3,\n         -5,   1,   7,   2,   1,   0,  -1,  -1,\n          0,  -1,   9,   7,  -6,  -3,   4,  -5,\n         -4,   8,  -8, -25,  -8,  -4,  34,  23\n    },\n    {\n         -1,  -2,   1,   1,  -1,  -2,  -1,   1,\n         -1,   0,   0,   0,   0,  -2,  -1,   1,\n          0,   2,   1,  -1,   4,   0,   0,   1,\n         -1,   0,   5,   3,  12,  -9,  68, -16\n    },\n    {\n         10,   0,  -8,  14,  -6,   1, -12,   0,\n          0,  -3,  -5, -11,  -6,  12,   9, -10,\n         -3,   5,   0,   7,  11,   2,   4,  -3,\n         -8,  -3,   7,   4,   3,  -3,  34,   4\n    },\n    {\n        -12,  13,  -5,   7, -11,  -2,  -1,   1,\n         -4, -14, -21,   3,  -3,  -3,  -4,  -7,\n         -9,  -4,   3, -17,  -2, -13,  10,  -2,\n         12,  -4,   0,  -9,   1,  -5,  31,  10\n    },\n    {\n        -10,   6,   5,   6,   4,  -7,  10,   0,\n        -28,  -3,   0, -11,  -1,  -5,  16, -10,\n        -16,   7,  20,   2,  -4,   2,  -5,   0,\n         15,   6,   5, -10,   7,  -9,  20,   4\n    },\n    {\n          1,  -7,  -2,  -7,   4,  -3,  -2,  -7,\n         -1, -14,   6, -16,   4,  -5,  -4,  -6,\n         -5,   0,  -2,   2,  -6,   9,  -5,   4,\n        -18,   8, -10,   8,  15,   0,  32,   1\n    },\n    {\n         -5,   7,  -3,   7,  15,  -4,   0, -16,\n          9,   5,  -5,   5,   4,  -3, -12,  -9,\n        -18,  10,   2,   2,  -3,   7,   3,  -1,\n          6,  -9, -10,   3,  15,  -4,  35,  -7\n    },\n    {\n         -1, -10,   2,   2,  -4,  -2,  10,   2,\n         -1,   2,  -2,   1,  -1, -14, -11,   3,\n         -8,   5,  -8,  -2,   6,  -1,  -7,   1,\n          7,   5,   7,   8,  30,  -4,  30,  14\n    },\n    {\n          2,  -2,   1,   2,   3,  -8,   3,   0,\n         -2,   0,  -9,   2,   1,   4,  -6,  -1,\n         -2,   5,   0,   1,  -2,  12,   6,  -3,\n          9,  -3,   4, -12,  21, -39,  24,  -2\n    },\n    {\n          3,   5,   1,  -2,  -2,  -2,  -3,   6,\n         -8,  -2, -11,  -8,  -1,   4,   2,   2,\n         -4, -10,  12,  -5, -11,   1, -15, -34,\n        -11,  -7, -11,  -1,   7, -14,  38,  -1\n    },\n    {\n         -4,   4,   8,   9,   8,   1,  -5,  -9,\n          4,  -2,  15,  -4,  11, -15,  20,  -1,\n         -1,  -3,   4,  -9,  -2,  -2,  -2,   8,\n          6,  12,  -5,   0,  11, -12,  27,  -4\n    },\n    {\n          0,   8,  -4,   3, -11,   6, -11,   2,\n          3,   0,   5,  -8,  -7,  -6,  -9, -21,\n          4, -11,  -1, -16,  -7,  16,  -3,   7,\n         -7,   4,  -5,   0,  11,  -7,  31,   3\n    },\n    {\n          1,   3,   4,  11, -11,  -2,  -3,  -6,\n          6,   5,   0,   3,  -9,  -6,   4,  -4,\n          0,   4,  -8,  13,  -6, -13,  -1,  -5,\n         -1,   4,   0,   0,   9, -22,  24,  18\n    },\n    {\n         -7,   3,  10, -13,  -6,   6,  -6,   6,\n         22,   1,   0, -14,   2,   3,   7,  -1,\n          8,  20,  -1,   5,  -4,  13,   9,  -9,\n         -9,   6,   0,  -4,   0,  -8,  31,  -4\n    },\n    {\n         -3,  -4,   0,   1,   7,   3,  -7,   0,\n          5,  -2,   1,   3,   3,   1,  -5,  -2,\n          5,   2, -11,   4,   0,  -1,  12,   0,\n         -3, -13,  15,   8,  -6, -27,  34,   0\n    },\n    {\n         -3,  -3,  10,  -4,   2,  -1,  -3,   0,\n         -1,  -1,  -4,   2,   6,  -2,  12,   1,\n          3,  -6,  -7,  -6,  -5,   4, -19,  -6,\n         -8, -34,  -4,  -8,  10,  -7,  23,  10\n    },\n    {\n         -7,   0,  -1,  -6,   8,   4,  -4,   2,\n         -5,  -8,  -7,  -9,  -8,   5,   9,   7,\n         -6,   1, -12, -12,  -1, -16,   5,   0,\n         16,   3,  -7,  -8,  27,  -4,  23,  15\n    },\n    {\n         -8,   4,   8,   5,   6,  11,  -3,   5,\n          3,  -1, -11,   6,  -5,   0,   2,  -6,\n         -3,  -6,   4,  -1,   5,  -5, -12,  -6,\n          7,  -5,   9,   3,   6,  -7,  29,   1\n    },\n    {\n          1,   3,  -2,  -2,  -6,  -2,   1,   6,\n         -6,  -3,   1,   2,   3,   4,   1,   5,\n         -1,   0,   4,   2,  11,   6,   2,  -3,\n         13,  -9, -19,  18, -15, -10,  36,  21\n    },\n    {\n         -3,  -3,   2,  -1,  -7,   6,  -4,   1,\n         -3,  -1,  -2,   2,   3,  -7,  -3,   0,\n         -2,   0,  -2,   6, -19,   3,  -8,   2,\n         -6,   7,  -1,   0,  29,  -6,  28, -10\n    },\n    {\n         -5,   1,  -3,  -7, -12,  -4,   1,   1,\n         -1,  13, -10,  -1,  -9,  -5, -13,   6,\n         13,   3,  -4,   2,   3,  11,   2,   6,\n        -25, -16,  -6,   0,  14,  -1,  27,  16\n    },\n    {\n         -6,  -1,  -7,  -5,  -2,  -5,  -5,  -1,\n          9,   1,   0,   3,  -8, -12,  -6,   5,\n         -6,   5,   3,  -9,   1,   4,  -7, -10,\n         -9,  -7, -17,  -5, -15, -23,  25,   3\n    },\n    {\n         -8,  -2,   9,  -3,  -4,   3,  -1,   8,\n         -7,  -7,  -5,  -4,  -2,   9,   4,  -1,\n         -7,  -4,  -5, -16,   3,  -6,  18, -13,\n         -9,  16, -15,   8,  15, -10,  24,   5\n    },\n    {\n          1, -38,   2,  34,   9,  10,  11,   2,\n          2,  -6,   3,   2,  -2,   5,   4,  -7,\n         -1,   1,   4,   0,   3,   1,  -8,  -1,\n         -6,   5,   4,   2,  -4,   5,   2,  -1\n    },\n    {\n          1, -22,  15,  18,  -2,  10, -16,  -9,\n         -8, -11,   8,   4,   0,   7, -14,  -5,\n         -1,  -7,  12,  17,   9,   5,  -7,  -4,\n        -12,  -6,   7,   0,   7,   2,  -2,   1\n    },\n    {\n        -11, -29,   7,  10,  19,  -1,  -8,  -9,\n          7,   1,   9,   6,   8,  -7, -14,   8,\n         -3, -11, -13,   0,  -7, -23,  -2,  -8,\n         12,   9,   2,  14,  19,   1,  -1,   5\n    },\n    {\n        -24, -27, -11,  36,   2,   6,  -3,   4,\n         -6,   8,   0,  12,  -1,  -4,  -6,   3,\n          4,  -1,   2,  -3,  -2,   3,   2,  -1,\n         -2,  -4,   0,  -1,  -2,   7,   2,   3\n    },\n    {\n         -9, -24,  11,  13, -10, -12,  12,  -2,\n          7,   4,   8,  13,  -3,  -3,   2,   9,\n         -3,  -4,   4,  13,   5,  13,  -6,  -3,\n          1,  15,   7,  -3,   0,  19,  -2,  -9\n    },\n    {\n         -8, -15,   7,  14,  -4,  -5,   2, -18,\n        -19,  -2,   2,  17,  16,   6, -10,  10,\n         -9,  14,  -1,  -5,  -1,  -6,  -7,   2,\n          9,  11,  13,   6,  -5, -12,   3,   2\n    },\n    {\n        -10, -37,  13,   1,   3, -14,   0, -20,\n          4,  -3,   8,   2,  -2,  -3,  -9,  -5,\n         -3, -17,  -1,  13, -11,   2,  -6,   4,\n          4,   0,   3,   1,  -9,  -4,  -5,  -4\n    },\n    {\n         -2, -22,  -5,  46,  -8,   5,   9, -11,\n          8,   7,   7,  -1,  -1,  -2,  -7,   2,\n         -3,   3,  -1,  -2,   7,   0,   2,  -1,\n          1,  -2,  -2,  -3,   6,   0,  -4,  -6\n    },\n    {\n        -16, -27,  15,  16,  -4,  14,  -7, -26,\n          2,  -2,   6,   5,  -3,  11,   0,   2,\n          3,   9,  -7,  -1,   2,  -4,  -4,  -1,\n          6,  10,   1,   1,  -3,  -2,   3,   0\n    },\n    {\n         -3, -22,  10,  26,   1,   2,  -3,   3,\n         17,  -3,  -7,   9,   1, -21,  -4,   5,\n          3,   0,  -7,  -6,   3,   3,  -8,  -7,\n         -9,   3,   7,   1,  -8,  12,   6,  -7\n    },\n    {\n         -9, -25,   3,  18,   9,  -6, -11,   0,\n         -5, -12,   9,  -8,  -7,  -6,  -6,  22,\n          2,  -6,  -3,  15,   3,   2,  -2,   9,\n         14, -10,  -7,  15,  13,   6,  -2,  11\n    },\n    {\n          5, -20,  -5,  28,  11,  10,  -4,  -4,\n          0,  -7,   3,   5,   2,  -5,  -8,   2,\n          6,  10,   9,  -9, -18,   3,  14,   1,\n          3,  -3,  -1,  -6,   7,   7,   2,  -1\n    },\n    {\n         -8, -30,   7,  12,  10,   8,   7, -13,\n        -16,   0,   1,  -1,  -6, -11, -15,   4,\n          1,  -2,  10, -15,   1,  11,  -2,   8,\n          9,  -7,  -7,   9,  -5,   2,   7, -18\n    },\n    {\n        -10, -32,  10,  11,   3,  -1,   3,  -5,\n          5,   2,  14,  -6,   3,   1,   5, -15,\n        -11,   6,  20,   4,   0, -12,  -7,   3,\n          1,  -1,  10,   6,  -1,  -9,  -4,  -1\n    },\n    {\n          1, -25, -14,  12, -11,   9,   9, -16,\n        -24, -17,  22,  -9,  11, -30,  -3,  -4,\n          6,  -7,   9,   2,  -1,  -5,  -6,   2,\n         -1,  -1,  10,   1,  -3,   3,   4,   8\n    },\n    {\n        -14, -26,  -6,   9,   8,  17, -11, -24,\n         -7,  -4,  -8,  -2,  10,   2,   2,  -1,\n          2,  13,  12,  -7,   4,  -6, -10,   6,\n          6, -13, -11,  -7, -16,   0,  -2,   5\n    },\n    {\n         -4, -30, -13,  12,  16,  -6,  12, -16,\n        -13,   5,  15,  -2,  -2, -10,  -7,   7,\n         11,  -1,  -4,  -2,  -4,   7,   4,  -8,\n          1,   3,   0,  11,   3,  -2,  -5,   4\n    },\n    {\n         -4, -21,  20,  22,   2,  20,  -8,   1,\n        -12,  -5,  -9,   4, -10, -17,  -3,  -8,\n         -3,   3, -12,   1,  -3,   0,   7,   4,\n          7,   7,  -3,   7,   5,   3,   1,  -5\n    },\n    {\n        -12, -20,   2,  29,  11,  -6,   9,  -7,\n         -6,  -4,   0,   6,  17, -13,  -2, -10,\n        -17,  -1, -18,   2,   0,  14,  -6,   1,\n          0,   3,   2, -10,   1,  -5,  -2,   5\n    },\n    {\n         16, -37,  -1,  26,  -2, -14,   1,  -5,\n        -14,   2,   2,   3,   6,   1,   1,   4,\n          0,  -1,   0,  -2,  -2,   4,   9,  -6,\n          0,  -2,  10,  -7,  -2,   4,   1,   0\n    },\n    {\n         -9, -24, -12,   5,   5,   3, -17, -14,\n          4,   3,   2,  -4,  10, -22,  -8,  -3,\n          6,   1,  12,  -8,   4,   1,   9,  -1,\n         18,  -3,   6,   5,   3,  -5,   9,  -5\n    },\n    {\n        -14, -33,  -2,  20, -13, -10,   2,  -7,\n         -1,  11,  -9,  -8,  18,  -3,   1,   8,\n          0,  -2,  10,   7,  -2, -13,   9,  -3,\n         -4,   5,  -2,  -2,  -1,  -5,   1,  -7\n    },\n    {\n        -10, -23,   8,  14,   1,   7,   1,  -3,\n         -7,   4,   1,   1,   8,  -7,  15, -14,\n         13,  14,   2,   5, -13,  -5,  -8,  -1,\n          6,   3,   6,   9,   6,  15,  14,   5\n    },\n    {\n        -13, -25, -10,  13, -17, -24,  -7, -13,\n         -6, -10,  -8,   2,   0, -13, -10,  -4,\n         -8,   4,  -9,   9,  -4,   4,  -3,  -3,\n          3,   3,  -5,  -9,   1,  -2,  11,   2\n    },\n    {\n        -12, -23,   1,  18, -11,  -2,   5,   9,\n         -5,   5,  14,  -9,  -3,  -2,  -6,   2,\n         -2,  11, -13,   1,  -3,  11,  -9,  -4,\n         -2,  -6,   8,  10,   1,   4,   2,   1\n    },\n    {\n         -5, -18,  16,  22,   2,   0,   8,  -6,\n         -9,  -7,  10, -16,  23,  10, -11,  -1,\n          7,   2,   7,   2,   1,  -5,   6,   1,\n          0,  -4,   9,   2,  -3,   1,   0,  -4\n    },\n    {\n         -3, -26,  14,  11,   2,  -9,  17,  -2,\n         -1,  -5, -16,  -9,  -5,  10, -13,   1,\n          6,  12,  10,  11,   0,   0,  -3, -14,\n          6,  -2,   0,   4,  -5,  -1,  -7,  -1\n    },\n    {\n        -10, -33,   1,   8,  11,  -5,   1,  -6,\n          7,   4,   5,   6,   1,  -2, -10,  -5,\n         -6,  12, -11,   5, -10,   4,  12,  -1,\n         -1,  -3,   4,  -1,   9,   0,  16, -17\n    },\n    {\n        -14, -37,   7,   7,  -2,   5,  -8, -11,\n          2, -13,   4, -19,   1,   8,   8,   4,\n         -9,   2,  -4,   3,  12,   2,   4,  -4,\n         -8,   8,   1,   4,   8,  -1,   6,  -2\n    },\n    {\n         -6, -30,  18,  17,   1, -22,  -3,   4,\n         -7, -10,   7,   0,  -8,   8,  -1,   4,\n          2,   8,   6,  -2,   2,   7,   4,   4,\n          3,  -6,   2,   1,  -3,   1,  -1,  -5\n    },\n    {\n        -17, -18,  -3,  22,  -8,   1,   9,  -2,\n        -17,  20,  -5,  -5, -12,  -5,   4,  -5,\n         -9,   8,  -2,  16,  -3,   0,  19,  -8,\n          8,   1,   2,  -4,   0,  11,   0,  -3\n    },\n    {\n         -9, -23,   3,  10,   4,   4,  -3,  -2,\n         -2,  -2,   1, -22,  11,   0,  -2,   5,\n         -2,  14,  -9, -11,  -4,   7,   5,  32,\n          1,  -3,  -7,   0,  21,  -9,   7,  -6\n    },\n    {\n          0,   0,   0,   2,  -1,   1,   0,   1,\n          3,   0,   0,   1,   0,   1,   0,   1,\n         -3,   0,  -1,  -2,   0,  -1,  -1,  -3,\n         -1,   1,  -4,   1,  -1,  -5, -69, -19\n    },\n    {\n         -3,  -5,  -8, -12,   4,  -3, -19, -11,\n         -5,   0, -14,   7,  18,  -6,   7,  22,\n          8,  14,  15,  10,   3,  -1,  -3,   5,\n         -1,   7,  -7,   1,  -6,   3, -26, -11\n    },\n    {\n         -1,  -6,   4,  -4,  -5, -16,   0,  -6,\n         -3,  11,   1,   0,   9,   5,  16,   3,\n         -4, -33,  -4,   4,  -7,   0,   1,   6,\n        -11,  -2, -13,  -2, -18,  20, -25, -16\n    },\n    {\n          4,   0,  -1,   0,  -5,   1,   0,   2,\n          0,  11, -10,   4, -10,   7,  16,   2,\n         16,  15,   2,  -1,   2,   9,   2,   8,\n         -3,  -5,  -2,   0,  -3,   0, -33,  -2\n    },\n    {\n         -3, -15,  10,  10,  -9,  -1,   7,   3,\n          5,  -5,  -8,  -8,  -3,  15,  -9,   4,\n         12,  13, -13, -14,  10,  -6,   9,  22,\n        -27,  23,  -1,   5, -24,   2, -30,   5\n    },\n    {\n          0,  -2,   7,  -5,  -5,   3,   5,   3,\n         -3,  -5,   2,   1,  -4,   3,  -3,  -1,\n          1,  -2,  10,  22,  -3,  -4,  -2,  -2,\n         -7,   3,   8,   1,  14,   4, -37,   9\n    },\n    {\n         -3,  -4,  -1,   1,  -4,   0,   6,   2,\n          6,  -7, -10, -10,  -1,  -4,  11,  -3,\n          7,  -6,   4, -12,  -1,   5,   1,  -7,\n         10,  -6,  17,  -4,   8,   3, -40,  13\n    },\n    {\n          2,  12,   4,  -7,  14,  -3,  16,  -2,\n         18,   2,  13,   5,   5,   1,  11,  -1,\n          0,   9,   2,  -6,  -1,   2,  -6,   2,\n         -5,   3,   5,   1,  -1,   1, -32,  -7\n    },\n    {\n        -16,  11,   7,  -4,   2,  -5,  -9,   9,\n         11,  11,  15, -13, -11,  11,   9,   4,\n          3,  -8, -10,  12,  12,   0,   0, -16,\n         -9,  13,   2,   9,   4, -13, -33,   3\n    },\n    {\n          6,   4,   5,   4,   3,  -1,   5,   6,\n          4,   2, -11,  -1, -15, -11,  -1,   1,\n         11,  -3,  -2,  24,  -4,  -6, -25, -10,\n        -15,  -8,   0,   0,  -5,   4, -30,   2\n    },\n    {\n         10,  -3,  -6,   1,  -9,  -5,   6,   9,\n        -10,  -3,   8,  -1,   4,  -1,  11, -11,\n          3,   9,  11,  -3,   6, -17,   5,  -8,\n        -33,   9, -13,  19,  -2,   9, -25,   2\n    },\n    {\n          0,   0,  -1,  -3,   0,  -2,   1,   0,\n          0,   2,   1,   0,  -2,   0,  -1,   2,\n          0,  -1,   4,  -1,   2,  -3,   4,  -2,\n          3,   3,   1,   0, -15,  12, -63,  27\n    },\n    {\n         -2,  14,   9,  -1,   3,   0,   1,   1,\n        -19,  15,   3,   4,   0, -10,   1,  -5,\n          3,   0,  -5, -10,   2, -16,  -4,   8,\n        -12,  -6,   7,  -5, -10,  -1, -33,  -4\n    },\n    {\n          0,   3,   1,   3,   1,   2,   4,   4,\n          9,  -6,  -8,  -5,   1, -12,   3,   8,\n        -10,   6,  -1,   1,  13,  -5,  -5,   2,\n         -4,  13, -18, -10,  -7,  -9, -33,  10\n    },\n    {\n         -6,  -3, -12,   5,  -1,  11,  -6,   0,\n         -2,   1,   2,  -7,   3,   1,   3,  -2,\n          1,   8, -10,   7,  -1,  -3,   3,   0,\n         13,   1,   6,   7, -16,  -7, -39,   8\n    },\n    {\n         -6,  -1,  11,   6,  -3,   8,   3,  -5,\n          3,   0,  -5,  -2,  -6,  -3,  -4,   2,\n         -3,  13, -11,   1,   7,   5,  19,  -5,\n         -3, -15,  -1,   7,  -1,   6, -33,   8\n    },\n    {\n         -7,   3,  -4,  -3,  -4,   1,   6,  -5,\n         -5,   6,  -8,  -1,  -7,   4,  -1,  -6,\n         -2,   1,   7,   0,   1,   1,  -5,   2,\n         -2,   0, -13,  -2, -31, -14, -39, -12\n    },\n    {\n        -10,   9,   0,  -3,   1,  -1,  -1,   0,\n          1,  -5,  -1,  -4,  -2,   5,   2,  -7,\n         18,  -8,  -2, -19,  -7,  -7, -12, -14,\n        -11,  -1,  -9, -13,  -7, -12, -31,  -9\n    },\n    {\n         -3, -16,  10,   9,   1, -10, -12,   2,\n         -2,   2,   7,  -3,  -3,   1,  -4,  -5,\n         -9,   5,   7,   3,  -1,   4, -11,  -8,\n          4,  13, -10,  13,  10,  -4, -36,   1\n    },\n    {\n         -7, -12,   4, -20,  -7,  -7,   2,  11,\n         -1,  -2,   3, -12,   1,   0,  -6,  -7,\n          6,   4,  13,   3,  -3,   4,   3,  -6,\n        -12,   5,  -5, -22, -13,  -8, -37,  -6\n    },\n    {\n         -7,   5,   3,   5,   7,   9, -14,  -3,\n         10,  17,  -1,   1, -12,   5,  -6,   0,\n         -4,  -9,   0, -11, -14,   3,  13,   6,\n        -25,  -8, -12,   4, -10,  18, -30,  -1\n    },\n    {\n        -10,   6, -10,   6,   6,   1, -10,   0,\n         -7,   5,  -2,  17, -18,  -4,   0,  -3,\n        -16,  -6,  -3,  -8,   5,   1,  -4,   6,\n         -7,  16,   6,  10,  -1,   0, -32, -11\n    },\n    {\n         -1,   9,   9,  -5,   4,   9,   6,   9,\n         -4,  -2,   7,  11,   4,   2,  -5,  -4,\n         -6,   0,   2,  -3,  -1,   5,  10,   0,\n         12, -10, -18,  -3,  -1,  14, -33,   2\n    },\n    {\n          4,  -8, -18,  -4,  -5, -11,   4, -10,\n         -4,   9,  13, -12,   1,  -6,   1,   2,\n          4,  -9,   8,   3,  -6,  21,  13,  -1,\n         -2,   1,  -2,   6,  -7,   0, -30,   1\n    },\n    {\n          6,  -1,   2,  -3,  -1,  -4,   6,  -4,\n          0,   4,   2,   2,  -9,   2,   6,   3,\n         -2,   4,  -1,   9,  -6,   0,   7,  -8,\n          5,  19,  -2,   9,  -5,   2, -33,  -8\n    },\n    {\n          2,   1,  12,  -5,  -8,   8,   3,  -2,\n         -4,   1,  -2,   5,  -4,  -9,  -8,  -8,\n          7, -11,  -4,   6, -10,   7,  -1,  -1,\n         -2,  -1,  16,  32,  -7,  20, -33,  -6\n    },\n    {\n        -18,   2,   6,  13,   9,   9,  -1,   3,\n        -17,  24,  -2,  -6,  28,   8,  -2,   6,\n          3, -10, -34, -16, -13,  -4, -15, -11,\n        -12,  -3, -10,   4,  -8,   4, -31,  -4\n    },\n    {\n        -11,   0,  18,   2, -16,  -9, -13,  -2,\n         -2, -12,  -3, -22,  30,   0,   8,   3,\n          9,  -4, -16,   1,   0, -11,  15,  -2,\n         -4,   6,  -5,   6,   1,   2, -25, -12\n    },\n    {\n         14,  -1,   5,   7,   3, -15,  -8,   1,\n          5,  -2,  12,  13,  11, -25,   3,   1,\n          0,  -2,  -4, -16, -23,   0,  -5, -17,\n          7,   5,  -9,   6,  -5,   2, -32,  -7\n    },\n    {\n          3,  -1,   6,  14,   2, -12,  -9,  -9,\n          4,   7,   4,   6,   5,  -8,   4,   2,\n          4,   5,  -2,   8,   8,  -6,   0,  10,\n        -20,  -1,   3,  -1,   8,  23, -33,  -5\n    },\n    {\n         -3,  11,  -6,   3,  -4,   5,   7,   3,\n          4,   5,  -2,   3,  -1,  30,   6,   1,\n          8,  -6,   0,   0,  -9,   6,  -9,   4,\n          2,   9,  -6,   1, -12,   0, -34,  18\n    },\n    {\n        -17,  13,   0,   1,   9,  -4, -11,   0,\n          7,   0, -10,  -4,  -1,   6,  -6,   4,\n          1,   6,  -9,   3,  -5,  -6, -11,   2,\n         -4,  14,  23,  -3,   2,   5, -30,  12\n    },\n    {\n        -14,   5, -27,   2,   0,   7,   1,   4,\n         30,   8,   7,   5,   1,  -1,   0,   5,\n          8, -10,  48, -11,  12,  33,   6,   8,\n        -15,  20,  -2,  -5,  32,   5, -19,  10\n    },\n    {\n        -16,  -4, -12,  -7,  -2,   0,   8,  -6,\n        -20, -18,  16,  -3,   0,  31,  -2,  11,\n          2,  -9,  49, -19, -12, -23,  10,  26,\n         16,  -2,   4, -21, -14,  13, -11,  -9\n    },\n    {\n         -5,  -9,  -1,   3,  -5, -21,   2,  10,\n          0,   0,  10, -21,  -7,   7, -26,  -9,\n         22,  32,  58,  11,  -3,  11,  -5,  -8,\n        -13,   6,  -5,  -9,   1,  10,  14,  -8\n    },\n    {\n          7,   7,  10,   3,  -2,  -1, -11, -11,\n         -6, -43,  -3,  14, -19, -18,  19,  18,\n        -32,  10,  45,  -6,   6,  21, -20, -12,\n          2,   4,   6,   6,  -4,   3,   3,   1\n    },\n    {\n         21,  22,  -3,  -2, -11,  -6,  -1,  -2,\n          8,   8,  32, -21,   7,  28,  -4,  -6,\n         -3,  -2,  50,   2,   2,  27,  -5,  -8,\n         12,   7,  -5,  -1,  -4, -17,  27,   6\n    },\n    {\n         13,   7,   2,  -6, -12,   2, -10,  -5,\n        -17,  11,   4,  17, -12,  -2,   5, -17,\n         37, -16,  48, -14, -18,  29,   8,  24,\n         11,  -5,  -9,  11,  -1,   1, -13,  -3\n    },\n    {\n          1,   1,  -1,   2,   0,   0,   0,  -1,\n          1,  -1,   7,   2,  -3,   3,   0,   6,\n          2,  10,  54, -25,   7,  54,  -5,  -6,\n         -1, -15,   9,  13, -24, -15, -12,   3\n    },\n    {\n         21,   5,   8,   3,  -3,  -4,  -2,  -4,\n          3, -11,  -5,  -8,   9,  16,   8,  -9,\n        -10,  -3,  46, -46,   2,   1, -10,  10,\n         17,  11, -20, -36,  10,  14,   0,  -5\n    },\n    {\n          7, -13,  -6,  -9, -24,  45,   2,   8,\n          8,   0,  17,  20,  12, -24,   1,  -7,\n        -15,  -3,  46, -13,  -2,  20,   1, -13,\n        -11, -13,   2,  15,   1,  10,  -1,   3\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,  -1,   0,  -2,  -1,\n        -16,  -9,  31, -69, -34,  26,   7,  17,\n         -1,  -6,  -1,   0,   0,   0,   0,   0\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,  -4,\n         -5, -20,  18, -82,  22,   3,  -7,   9,\n          4,   6,   2,  -4,  -1,   0,  -2,   2\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   1,   0,   4,  -1,\n         15,  -5,  62, -36,   4,  52,  -7,   5,\n          0,   6,   1,   2,   1,   1,  -1,   0\n    },\n    {\n          3, -19,  19, -20,  13,  -4, -11,   8,\n          8, -16,  10,   1, -14,  30,   1, -33,\n         10, -11,  45, -30,   3,  -4,  -3, -13,\n          7,  12,   3, -22,   3,  -2,  -4,  -2\n    },\n    {\n         -1,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   1,   0,   0,   2,   1,\n         11,   8,  70,  48, -10,  21,   4,   9,\n         -9,  -9,  -4,  -6,   0,  -1,   0,   0\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   2,   0,\n          2,  -1,  80,   2, -15, -36, -10,  -5,\n         -2,   8,  -2,   2,   0,   0,   0,   0\n    },\n    {\n         10,   8,  -8,  -8, -24,  12,  -1,   0,\n         20,   9,  -1,  -2,   2,  -2,  12, -10,\n         -2, -13,  35, -43,  44,  15, -10, -25,\n          4,  10,  -3,  -5,  -5,   7,  -1,   3\n    },\n    {\n          1,   1,   1,   1,   0,   0,   1,   0,\n          0,   0,   0,   0,   0,   0,  -2,  -1,\n        -18,   9,  49, -72,   7,  -8,   7,  -5,\n          2,   3,   2,  -2,   1,  -2,  -3,   1\n    },\n    {\n         -1,   4,  -3,  10,  19,   4,   3,  20,\n          6, -24,   6,   9,   8,  15,  18,  18,\n        -36,  19,  57, -11,   4,  -3,   8,   7,\n          2,  -3,  -2,  -9, -15,  -2,  12,  -4\n    },\n    {\n         20,   3,  11,  -9,  -4,  22,  42, -25,\n          1,   5, -10, -19,   0,   9, -16,   5,\n          2,  10,  44, -29,  17,  -3,  -9,  -2,\n         -1,   8,  14,  -7,  -1,  16,  -5,   1\n    },\n    {\n         -7,  16, -11,  12,   6,  33, -15,  14,\n        -23,   2, -26,   8,   2,  10,   0,  -5,\n          8,  -8,  38, -38,  -4,   5,   5,   5,\n          1,  22, -15,   7,   6,   0,   4,  28\n    },\n    {\n         -1, -12,   2,  10,  -2,   0,   7,  17,\n         12,  22,  -4,  10,  25,  29,   5,  18,\n          4,   1,  27, -39,  31,  17,   2,   2,\n         22, -23,  13,  16,   1,  -7,  -4,  -5\n    },\n    {\n          0,   1,   0,   0,   0,   0,   0,   0,\n          0,   0,  -1,   0,  -2,   0, -14,   0,\n         -7, -11,  49, -22,  -4,  19,  17, -39,\n          4, -29,  10,   2,  36,  -4,  23,  -1\n    },\n    {\n         -2,  -2,  -2,  -2,   1,  15,  -5,  -7,\n        -16,  -8, -19,  16,  -3, -20,  36,  -9,\n         -3,  20,  39, -20,   0,   2,  27, -16,\n         10,  10, -14, -22, -16,  -3,  13,  -8\n    },\n    {\n          5,  -9,   6, -25,   7,  37,  13, -10,\n         -5,   3,  -5,   7,  18, -22,  -7,   9,\n         -5,  -4,  50, -11,  -4,  -5,  -5,   8,\n         -4,  -2,  -4, -27,  14,  20,   7,  -9\n    },\n    {\n          0, -14, -10, -27, -14, -17,  -6,  26,\n         10,   2,  14, -12,  -5,   0,   8,   9,\n          0, -28,  55,  -7, -12,  -7,   4, -10,\n         10,   7, -12,  11,   3,   5,   9,  -8\n    },\n    {\n          2,  23,   4,  -2,  -1, -20,  -2,  14,\n         10,  -9,  -9, -24,  10,   0,  11, -12,\n         12,  11,  49, -25,  -2,  29,   7, -13,\n         21, -10,  11, -17,   3,   1,  -8,   5\n    },\n    {\n          3,   0, -14,  -6,  18,  -2,  17,  -9,\n        -19,   9,  -5,   9,  14,   6,  19,  -3,\n         27,   1,  41, -21,  20, -15,  33,   0,\n         26,  14,   7,  10,   3,  20,  -3, -12\n    },\n    {\n         -1,  16,  15,  -8,   3,  -8,  -8,  21,\n         -5, -16, -29,   4,   1,  -6,  -4, -28,\n          2,  31,  37, -26,  -2,  13,  24,   8,\n         -9,  -6, -29,  10,   7,   2,   7,   8\n    },\n    {\n        -10, -10,  11,  13, -32,   2,  16,   9,\n         14,  23, -15, -13,  24,  13,   4, -27,\n         14,  12,  31, -18,  17,  23,  -2,  -7,\n        -14,   9, -17,  -6, -10,  20,   9,   6\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   2,   0,\n          5,   1,  89,   8,  10,  -6,   2,  -1,\n          0,   0,   0,   0,   0,   0,   0,   0\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   2,  -1,\n          4,  -7,  64, -50,   7,  37,   2,   5,\n          0,   0,   0,   0,   0,   0,   0,   0\n    },\n    {\n         -2,   5,   3,  -4,  -4,  -3,   2,  -3,\n          3,  -3,   5,   4,   1,  -6,  -1,   1,\n          6,  -2,  50, -35,  -7,  43,   7,  -7,\n         -5, -26,  24,  21,   3, -15,   5,   6\n    },\n    {\n         -8,  21, -19,  33,  -8,  22, -11,  17,\n          3,   0,   0,  -2,   1,  -3,   6,  -1,\n         10,  -8,   4, -11,  -4,  -5,   0,   8,\n         -4,   3,   1,  -4,   4,   2,   8,   4\n    },\n    {\n         -7,   5, -20,   9, -22,   3, -14,   1,\n          6,  13,  23,  -2,  -4,  -7,   2,   0,\n         11,   4,   6,   3,  -7, -11,  -7,   4,\n          5,   5, -12,   8,   2,   4,   7,  -3\n    },\n    {\n         -7,   6,  -4,  20, -20,  16,  -2,   7,\n          6,  16,  11,  12,  -7,  -7,   5,   3,\n         -9,  -4,   1,   2,   5,   2,   1,  -9,\n         -2, -17,  -4,   6, -10,   7,  -7,  -6\n    },\n    {\n         -9,  18, -17,  12, -24,   1,  -1,   4,\n         14,   9,   4,   3,   2,   8, -12, -14,\n          4,  -8,  -4,   7,   7,   6,  -1,  13,\n         -9,  -4,  -1,   1,   0,  -4,  15,   8\n    },\n    {\n        -25,   2, -11,   6,  -5,  24, -28,  -5,\n          8,  12,  -2,   6,   8,  -3,   8,  -9,\n         -1,  -5,  -1,  -5,   6,  -1,  -1,  -1,\n         -4,   8, -12,  -2, -13,   7,   2,   1\n    },\n    {\n        -14,  14, -18,  20, -10,  12,  -2,   9,\n          1,   0,  12,  -2,  15, -10,  26, -17,\n         16, -11,  10, -10,   9,  -2,   4,  -8,\n          2,  -3,   4,   4,   2,  -3,  -5,   1\n    },\n    {\n        -18,  12, -18,  21,  -6,  12,  -6,  13,\n        -25,  18,   1,  11,  -9,  -5,   0,  10,\n         -5,   3,  -3,   8,  -9,   7,   4,   2,\n         -9,   0,   5,   0,   2,  -3,   9,  -8\n    },\n    {\n         -4,  16,   1,  18, -30,   9,   1,   6,\n         -8,  13,  13, -12,  -6,  -1,  13,   7,\n          6,   2, -15,  -3,   5,   5,   1,  -6,\n          1,  -5,   0,   2, -16,   0,   3,  -4\n    },\n    {\n        -21,   1,  -2,   6, -43,  18,  -1,   5,\n         -1,   4,   6,  -2,  -1,  -3,  -1,  -3,\n          0,   1,   2,  -9,   0,  -1,   0,  -2,\n          0,  -1,  -1,  -2,   6,   0,   1,  -2\n    },\n    {\n        -23,  10,   4,   7, -32, -11, -18,   2,\n         -2,  -7,  -6,  -3,  -3, -12,  19,   3,\n         -5,  -6,  16,  -6,  16,   2,  16,  16,\n          8,  -2,  13,   8, -15, -11,   2,  10\n    },\n    {\n         -8,   2, -13,   2, -29,  24, -20,  19,\n          1,  10,  -4,  10,   1,   2,  -9,  11,\n         -1,  -2,   9,  -5,  19,  -7,  16,  -9,\n         -2, -18,  11,   1,   1,   0,   7,  -3\n    },\n    {\n         -6,   3,   4,  13, -26,  10, -10,  28,\n         -7,  28,   1,   7,   0, -14,   5,   7,\n          4,  -4,   3,  -2,   3,   3, -11,   7,\n          6,   4,   0,  -1,   2,  -1,  -3,   2\n    },\n    {\n         -6,  16, -31,  13, -10,  17,  -6,   4,\n        -14,   4,   4,  -1, -10,  12,  -5,   1,\n        -14,  15,   0,  -8,   1,  -5,   3,   3,\n          9,  -5,   7, -20,   7,   4,  11,  -5\n    },\n    {\n        -19,   3, -17,  14, -12,  16, -22,  18,\n         14,   8,  -2,   4,  10,  12, -14,   4,\n         -3,   2,   3,   7,  -7,   7,  -6,   2,\n         -2,  -4,  -5,   0,  -5,  -2,   2,   1\n    },\n    {\n         -9,  -7, -11,  24, -36,  -9, -11,   5,\n          7, -12, -13,  18,  -2,  20,   1,  -4,\n         -1, -10,  15,  -6,  14,   1,   0,   2,\n          1,   2,  -9, -16, -11,   7,  13,   0\n    },\n    {\n        -24,  24, -18,  18, -22,  14, -11,  13,\n        -12,  11, -10,  11,  -7,  11,  -5,  -4,\n         -1,   1,   5,   2,   3,  -1,   1,  -5,\n          7,  -4,   5,  -6,   8,  -7,   8,  -6\n    },\n    {\n         -6,  18, -22,  22,   5,  11,  -1,   6,\n         19,  22,   8,   4,  -8,  20,  -2,  15,\n         -6, -18,   0, -33,  -9, -12,  -1,   6,\n          5,   2,   5,   5,  -5, -17,  -3,  -3\n    },\n    {\n          1,  11, -16,   9, -18,  11,  -4,  18,\n         20,  26, -10,   8,   1, -11,   8,  -4,\n          0,   7,   3,   5,   2,   2,  10,  -2,\n         -4,   4,  -4,  -2,   1,  -4,  -5,  -1\n    },\n    {\n        -10,   6,  -1,  18, -17,  27,  -3,  10,\n         -2,  12,  -7,  -9,   1,   1,  -1,   7,\n        -12,  -1,  -7,  -6,  -1,   8,   3, -15,\n          8,   9,   3,  -7,   4,  -1,   1,  -1\n    },\n    {\n        -14,   6, -16,  22,   2,   5,   0,   5,\n        -18,  11,   6,  -3,  22, -20,  -9,  -3,\n          6,  -6,  -7, -15,   1,  15,  -8,  11,\n          8,  -3,  -8,   1,  -8,   2,   6,  -2\n    },\n    {\n        -21,   5, -19,  19,  -7,   4,  -7,   0,\n         -8,   6,  12,   5,  -3, -22, -13,  -6,\n         -1,  -3,  -2, -14,   6,  -3,   1,  -8,\n         -7,  -5,  -6,  11,  -3, -10,  -5,   2\n    },\n    {\n         -1,   9, -12,  15,  -6,   6, -19,  14,\n         -9,  11,   3,  12, -17,  -3,   8,  -4,\n         -3,  -4,   1,  -5,   4,   5,  -7, -15,\n         -7,  15,  -6,  -5,   1,  -5,  -3,   1\n    },\n    {\n        -12,  20, -15,  20, -14,   3, -14,   9,\n         -6,  33, -13,   6,  -2,   8,  -6,   7,\n         -5,  -6,  -3,  -3,   0,   8,  -3,  -3,\n          1,  -2,   2,   2,   6,  -5,  -5,  -2\n    },\n    {\n         -7,  12, -18,  12, -18,  10,  -4,   8,\n          2,   4,   8,   9,   0,   3,  -8,   3,\n          6, -12,  -4,   1,  25,  -5,  -9,   6,\n         -7,   0,  -9,  -7,   3,  -5,  -4,  -4\n    },\n    {\n        -18,  12, -10,  11, -22,   0, -15,   5,\n         -2,   2,  -3,   6,  -4,  -4,  -3, -15,\n         -2,  -3,  21,   6, -12, -11,  19,   3,\n          3, -14,   7,   0, -11, -22, -10,   0\n    },\n    {\n        -15,   2, -30,  15, -17,  13, -16,   8,\n         -7,  10,  -8,   2,  11,   3,  10,  -7,\n          7, -22,  12, -10,   3, -12,   6, -10,\n         12, -10,   7,  -8,   5,   2,   9,   1\n    },\n    {\n         -9,  11, -14,   6, -10,  21,   5,  12,\n         -5,   5,   7,  21,   6,   2,  -2,  -1,\n         -1,   4,   2, -20, -18,  -1, -14,   3,\n         -1,   4,  -7,  10,   1,  11,   4,  -4\n    },\n    {\n        -22,   8, -30,  13, -21,  -4,   4,  -1,\n         12,   9,  -2,  -3,   2,  -6,   4, -13,\n         -2,   8,   8,   1,  -7,   3,  -4,  -5,\n         -1,  -7,  -2,   8,   8,   7,   8,   0\n    },\n    {\n         -6,  -4, -35,  16, -13,  15, -11,  14,\n         -7,   9,  -1,  11,   7,   0,  13,  10,\n         -1,   8,   1,   1,  -2,   8,  -1,   2,\n          2,   3, -10,  -1,   7, -13,  -3,  -7\n    },\n    {\n        -15,   7, -16,  14, -18,  17,  -6,  14,\n          3,   4,   7,  -3,  10, -22,   5, -15,\n          4,  -4, -11,  15, -15,  11, -11,  20,\n          1,   0,   2,   1,  11,  -3,  11,  -7\n    },\n    {\n        -12,   3,   5,  16, -37,  -1,  15,  15,\n        -15,  10,   3, -10,   1,  15,   7, -15,\n        -13,   8,   9,  -3,   2,  12,  -8,   2,\n         -5,   0,  -3,   4,   5,  -9,  -4,   5\n    },\n    {\n        -16,  26,  -4,  14, -22,  26,   6,  -3,\n         -8,   4,  21,   6,  16,  -4, -11,   7,\n        -10,   3,   3,   7,  -4,   2,  -9,   8,\n         -2,   2,   5,  -2,  -4,  -2,   7,  -1\n    },\n    {\n         -7, -10,   4,   3,   2,  -4, -12, -10,\n         -4,  -5,  16,  19, -16,   1,   2,  -9,\n        -10,   0,   9,   7,  -8,   3,  12,   8,\n         -6, -11, -13,  -1,  -3, -20,   6,  -5\n    },\n    {\n        -14, -17,   3,  -5,  14, -12, -12,   8,\n         -6, -25,  21,  21,  10,  -8, -12,   4,\n         10,  -4,   3,  -9,  11,   9,   0,   4,\n          2, -15,   1, -14,   4,   1,   0,  -4\n    },\n    {\n         -4,  -9,  -3,  -1,   6,   3,  -6,   6,\n        -10,  -4,  14,   8,   2,  -3, -12, -19,\n          0,  11, -20,   1,   6,  -2, -27,  -6,\n         10, -17, -14, -17,  -9,   8,  -8,   3\n    },\n    {\n        -12, -13,  16,  -4,  -2,  12,  -7, -11,\n          2, -13,   3,   7, -16, -18,  -1, -12,\n         -2,   1, -12,  -9,  -2,  -6,   2,   9,\n        -22,  -3,  -4, -14,  -7,   7,  -1,   2\n    },\n    {\n         -7,  -8,  -8,  15,  15,  18,  15,  16,\n         -4, -37,  11,  15, -12,  -1,  -3,   3,\n          6,   6,   0,  -5,  -3,  -5,   9,   1,\n          1, -11,  -1,  -8,  -6,   2,   3,   0\n    },\n    {\n         -6,   7,  -5, -12,  13,  10, -18,  -4,\n         -3, -21,   6,  16, -15,  -7, -12,  -9,\n          1, -12,  -1,  10,  -2,  -1,  -3,   4,\n         -4,   1, -16,  -1,  12,  -9,   5,   9\n    },\n    {\n        -14,  -5,   9,   3,   4,  26, -28,   3,\n         -6, -24,   4,   5,   3,  13,   5,  -1,\n          3,  -1,   3,   1,   1,  -5,   3,   0,\n         -7,  -8,  -7,  -3,   3,  -5,   4,   0\n    },\n    {\n         -4,   2, -10,  -6,  25,  26,  -6,  10,\n         -6,  -8,  15,  11,  -6,  -3,   2,  -7,\n          5,  14,   9,  -1,   0, -12,   4,  -4,\n        -10,   1,  -3,   3,  -2,  -2,  -6,  -1\n    },\n    {\n        -10,   8, -15, -10,  19,  17,  -8,   0,\n         -3,  -7,   7,   5, -13,  -1,   7,  -7,\n          1,  13, -12, -13,  17, -12,   1,  26,\n        -18,  -3,  -5,  -6,   4,   5,   8,   1\n    },\n    {\n          2,  -5,   3,   0,   0,   0,   2,  -3,\n         -2,  -5,   7,  13,  -4,   9,   0,  -5,\n          4,  -1, -11,  -8,  -4,   0, -13,   2,\n        -47, -23,  -8, -11,  -4,   4,  -2,  -3\n    },\n    {\n        -18,  -4,   4,   5,  -1,  17, -12,  -8,\n          1, -12,   7,  20, -12,   3,  -2, -11,\n         16,  12,  -6,   1, -13, -16,  -6,  -3,\n         -3,  -5,   4, -12,  -5,  -9,  10,   1\n    },\n    {\n        -11,   0,   4,   7,   7,   8,   3,  -1,\n          3, -19,  32,   8, -19,  -8,   2,   4,\n        -12,  15, -16,   3,   1,   9,  -2,   1,\n         -2,   8,   5,   6,  -4,  -1,  11,  -8\n    },\n    {\n          3,  -1,   4,  -2,  14,  32,  -9, -23,\n        -10, -12,  22,  15,  -1,  -2,  10,   0,\n          4,   6,  -8,   4, -15,  -2,  -1,  -4,\n          0,  -8,   4,   1,  -8,   3,   4,   1\n    },\n    {\n        -17, -12,   6,  -8,  16,  13, -20,  -8,\n         -1, -16,  10,  21, -19,  11,  -9,  -5,\n          7,  18,  -6,   7,  -7, -18,  13,   2,\n         -2,   8, -12,  -9,   2,   4,  -5,  16\n    },\n    {\n          4,   0,  17, -11,  12,   7, -12,   5,\n         -1, -25,  30,  -8,  -7,  -6,  -4,  -7,\n          9,   8,   7,   3,   3, -16,   8,   0,\n         -2,  -2, -18,  -3,  -4,  -5,   1,   4\n    },\n    {\n         -3,  -6,   6, -16,  17,   6,  -3,   2,\n         -9, -17,  12,  11,  11,   2, -20,   8,\n          1,   1,   0,   2,  -2,  -6, -21, -13,\n         -9, -15,  -1,  -8,  -6,  -8,   0,  -2\n    },\n    {\n        -11,  -7,   6,  -9,   3,   6,   8,  16,\n          4,  -5,  23,  26, -10,  -3,   4,   0,\n          2,   2,  -4,   4,  -2, -12,  12,  10,\n        -11,   0, -10, -16,   3,   0,   0, -10\n    },\n    {\n         -5, -16,  10,  -6,  27,  13,  -3,   4,\n         -2, -13,  15,   5,   2,   5,   3,  -4,\n         13,  12, -11,  -7,   0,   1,  11,  12,\n          2,  13, -15,  -8,   9,  -2,   3,   8\n    },\n    {\n         -5,  -8,   4,   3,   9,   3, -11,  10,\n         14, -25,  14,   8,  -2,   5, -12, -21,\n          2,  10,  -7,   2,  -3,   2,   0,   2,\n         -1,  -3,  -5,  -6,  -1, -16,   2,   8\n    },\n    {\n         -1,   5,   1, -11,   5,   9,  -7,   8,\n        -13, -12,   4,  12,  -4,   1,  -1,  -1,\n         27,  29,  10,  15,   2,  -6,  -3,   4,\n        -21,  10,  -9, -11,  -6,  -1,  -9,  -3\n    },\n    {\n         -6,  -3,  -1,  -6,  11,  -5,   0,  -2,\n         -5, -31,  11,   3,  -1,   5,  -3,   4,\n          5,   7, -10,   5, -10, -13,   4,  12,\n        -15,  -2,   2,  -7,   1,  -9,  -3, -10\n    },\n    {\n         -3,  -7,  17,  -8,  -5,  36,   8,  -7,\n         -8, -20,  12,   8,   1,  -1,   3,   0,\n          1,   4, -10,   3,   1,   4,  -2,  -3,\n         -2,  -3, -10,   4,  -1,  -7,   3,   2\n    },\n    {\n        -13,  -3,  -5,   9,  22,   6, -23,   3,\n        -10,  -7,  17,  17,  18, -14,  -8,  -8,\n          2,   4,  -8,   2,  -3,  -8,   6,   4,\n         -1,   7,   0,   0,  -3,   0, -12,  -3\n    },\n    {\n         -3, -10, -15,  -3,   9,   3, -23,  -9,\n        -13, -18,  12,  13,  -2,   0,   1,   8,\n         -1,   2,  -7, -12,  -5,  14,   2,   1,\n        -22,   6, -10,  -8,  -9,  28,  -7, -14\n    },\n    {\n         -3,   1,   2,  -1,  13,   7,  -2,  -7,\n          1,  -3,   6,   9,  -3,  -2,   4,  -2,\n          2,   1, -10,  -2,  -2, -22,  -2,  -7,\n        -10,  -5, -11, -27, -12, -16,   4,  -7\n    },\n    {\n          2,  -6,  -3,   1,   8,   0,  -2,  12,\n         -3,  -4,  58,  15, -10,  -4,  -2,   2,\n         -2,   0,  -2,  -6,   2,   4,  -1,   1,\n         -4,   1,  -1,  -5,  -4,  -3,   3,   1\n    },\n    {\n         10,  -1,   0,   5,  21,   7, -14,   6,\n         -3, -16,  15,  17, -16,  13,   3,  -6,\n         -4,   6, -12,  -5,   1,  -4,  -7,  -8,\n          2,   3,  -6,   6,  -1,  -8,   5,   4\n    },\n    {\n         -6,  -2,  -8, -11,  15,  10,   0,   8,\n         -6, -15,  33,   8,  -2,  18, -15, -11,\n          5,  -1,   0,  15, -15,  -4,  -4,  -1,\n         10,   7, -13,   4,  -4,   0,   8,   3\n    },\n    {\n         -7,  -2,   0,  -2,   0,  -2,  -4,  -5,\n        -14, -16,  12,  38,   7,  12,   6,  -4,\n          0,  -1,   0,   3,  -2,  -6,   0,   2,\n         -9,   1,   0,  -1,   0,  -2,   4,   1\n    },\n    {\n         -8,  -4,  18,   1,  14,   5, -12,  -3,\n         20, -17,   5,  19, -11,  -8,  11,  -3,\n          3,   9,  -7,  -8,   9, -17,   2,  15,\n        -10, -11,   5,  -5,   7,  15,  -6,  -2\n    },\n    {\n         -7,   2,  38,   5,  19,  16,  -5,   4,\n        -13, -20,   0,   4,  -4,   6,   4,   2,\n         -7,   6,  -8,  -2,  -5,  -7,   6,   3,\n         -4,  -3,  -2,  -3,   7,  -6,  -4,   0\n    },\n    {\n        -11, -12,   8, -15,  -3,  14,  -7, -22,\n        -11,   2,  22,  14, -19,   2, -19,  -6,\n          1,   3, -18,  14,   2,  -6,  -2,  -8,\n         -3,  -6,   5,  -7,  -8,  -4,   1,   1\n    },\n    {\n          8,   7,  25, -21,  12,  -6,  -5,  -4,\n        -10,   6,   0,  10,   1, -12,  18,  -5,\n        -15,   4,   1,  14,  -1,   5,   8,  -7,\n          1,  -7,  -3,   9,  10,   1,  -1,   0\n    },\n    {\n          9,  10,  32, -15,   8,   2,  11,  -7,\n        -18,  -8,   2,  -6,  -9, -16,  -3,   3,\n         -1,   3,   1,  -5,   4,  -2,   1,  -8,\n          0,  -6,  -3, -11,   1,   5,   0,   0\n    },\n    {\n         14,   0,  23, -25,  22,   3,   7,  10,\n          0,  -2,   7,   8,   0,  10,   0,   0,\n          3,   2,   3, -10,   0,  10,   0,  -7,\n          0,  10,  -1,  -5,  -7,   1,  -1,   2\n    },\n    {\n         12,   0,  25, -18,  -5,  -4,  13, -10,\n          3,  -6,   7,  21,   0, -16,   3, -10,\n         -6,   5,  -7,  -3,   2,   5,   3,  -6,\n          4,   9,  -8,  12,  -2,   3,   2,   4\n    },\n    {\n         31,  15,  27, -20,  10,  -7,  15, -10,\n          9,  -8,   4,  -5,   3,  -3,   5,   6,\n         11,  -2, -12,  -2,   6,  -2,   1,   2,\n         -1,  -1,   1,   1,   3,   1,   1,   2\n    },\n    {\n         12,  -4,  13, -23,  12,  -6,   2,   4,\n         -3,  13,   6,  -7,   5, -19,  -7,  18,\n          1,  -7,   7,   1,  16,  -7,   3,   0,\n          3,   0, -12,   8, -11,   9,   4,   7\n    },\n    {\n         29,   1,   3, -22,  -5,   6,   0,  12,\n        -14,  11,   1,   6,  -3,   4,   6,  -2,\n          4, -13,  12,   1,   1,   3, -11,   9,\n        -10,  -1,  -7,  16, -11,  -1,   3,   9\n    },\n    {\n          4,   4,  36, -23,  -5,  -8, -15,   1,\n         -6,   3,  13,  -1,  -5,  -7,   4,   9,\n          2, -11,  -3,   5,   1,   3,  -6,  -1,\n         -4,  -4,  -2,   2,   3,  -1,  -5,  -2\n    },\n    {\n         19,  10,   6, -17,   2,  -4,  -2,  -4,\n         -3,  13,   2,   2, -13,  -7,  -3, -11,\n          9,  -6,   1,  -9,  -5,   4,  -5,  -9,\n        -18,  -7, -11,   9,   4, -11,   8,   4\n    },\n    {\n         16,  -3,   9, -16,  18,  -2, -12, -16,\n        -11,  11, -18,  16, -13,   6,   2,   8,\n          3,   8,  -4, -16,  10, -11,  -1,  -3,\n         -8,   5,  -9,  -4,   9,  -4,   0,  -3\n    },\n    {\n         14,  15,   3, -23,  -5,   7,  -8,  -6,\n          2,  17,   2,  12,  -8, -12,  13,  -1,\n         -9,   3,   1,   1,  19,  15,   4,  -1,\n          1,   2,  -3,   2,  -3,   1,   5,   3\n    },\n    {\n         32,   5, -10, -47,  -5,  -1,   4,  11,\n         -7,   0,   2,  -2,   1,  -7,   6,  -4,\n          6,   2,  -4,  -2,   2,  -2,   0,  -4,\n          1,  -6,  -5,   2,  -2,  -1,  -3,  -4\n    },\n    {\n         20,   8,  10, -21,  -7,  -9, -16,  12,\n          1,   4,   6,  -5,   9, -11,  -7,   4,\n        -11,  28,  -3,   2,   4,  -6,  10,  -8,\n         -5,  -5,  -9,   9,  -2,  -1,   6,  -5\n    },\n    {\n         38,   3,  23, -25,  -6, -18,   3, -10,\n         -8,   6, -10,   1, -10,   2,   2,   0,\n         -7,   2,  -4,   5,  -1,   8,  -3,   0,\n          3,   3,  -1,   1,   0,  -4,  -4,   0\n    },\n    {\n         20,   5,  16, -22,  24, -18,   2, -12,\n        -14,  -7,  -3,  10,   2,   7, -10,   2,\n         -8,   1,   8,  -1,   4,   1,   4,  -2,\n          5,  -9, -18,  -8, -13,   5, -11,  10\n    },\n    {\n         14,   8, -12, -16,   9, -11,  -3,  -6,\n        -25,  -7,   6,   5,  -7, -16,  10,   2,\n         -7,  -1,  -9,  -3,  16,   4,   3,   3,\n         -3,  -3, -15,  13,  -3,   4,  13,  -7\n    },\n    {\n         16,  -9,  19, -23,   7, -19,  -3,  -5,\n        -15,  11, -21,  21, -16,  18,  -1,   6,\n         10, -10,  18, -14,  16, -15,   6,  -5,\n         -9,   5, -17,  13, -10,  13,   0,  10\n    },\n    {\n          8,  -4,   4, -24,   8, -21, -18,   9,\n        -11,   4,  -6,  17,   5,  -9,  -2,  -2,\n          2,  15,  -2,  -3,  -2,   1,   7, -13,\n         15, -10,  -8, -11,   3,   3,  -1,  -1\n    },\n    {\n         14,  17,   6, -32,   5, -17,  -2,   0,\n         15,  -1,  -5,  16,   1,  -5,  -2,   9,\n         -3,   8,   4,  -2,  -2,  -4,  -3,   1,\n          0,   7,  -3,   4,  -5,   0,  -7,   2\n    },\n    {\n         24,   6,  22, -12,   8,   3, -14,   4,\n         -7,   8,   6,   5,   6,   1,   6, -12,\n         15,  10,   4,  11,   9,   6,  -7,  -4,\n         10,  -9,   2,  -1,  -5,  11,  15,   3\n    },\n    {\n         17,  12,   3, -23,   5,  -1,  -2,   1,\n         -9,  -1,  -3,   1,   8,   1,  -5,  17,\n         11,   0,  -2, -11,   7,   4,   0, -27,\n         -7,   1,   2,  -8,   9,   7,   5,   3\n    },\n    {\n         12,  10,  12, -10,  -4,   5,  -1,   2,\n        -24,   5,  -8,   2,   6, -17,  19,   5,\n         12,  -2,  16,  -7,  -6, -14,   4,   1,\n         -3,  13, -16,   5,  -1,   4,   1,   1\n    },\n    {\n         31,   9,  11, -17,  10,  -3,  -7,   7,\n          1,   2,   2,   4,  -3,  -1,  11,   4,\n         -5,  -8,   1,   4,  15,  -6, -28,   1,\n          8,   3,  -6,   5,  17,  -2,   2,  -4\n    },\n    {\n         11,  19,  16, -26,   0,  -7,  -7,   2,\n        -13, -15, -12,   9,  -3,  27,   8,   4,\n         -6,   1,   4,  -6,  11,  -1,  -6,  -7,\n         -3,   0,  -6,   4,  -6,  -7,  -3,  -1\n    },\n    {\n         10,  18,  16, -32,  19,  -9,  -4,  -3,\n         -7,   8,   8,  -3, -11,  -2,  -6, -16,\n         13,  13,  -6,  -1,  10,  -2,  -2,  -9,\n          0,  -3,   9,   4,  11,  -2,  -6,   6\n    },\n    {\n          9,   4,  19, -33,   4,   7, -12,  36,\n         -3,  -1,   8,  -2,   2,  -8,  -9,  -4,\n         -8,   0,   1,  -1,   0,  -4,  -4,   3,\n          0,   3,   6,   0,  -6,   2,   0,  -2\n    },\n    {\n         25,   7,  15, -12,   2, -24,  -1,  24,\n         -4,   4,   9,   0,  -2,  -9,   4,   6,\n          3,  13,  -3,   1,   5,  -1,  -3,  -5,\n         -1,   7,  -2,   3,   4,   4,   1,   0\n    },\n    {\n         19,   6,   8, -20,   9,  -9,   5,  -4,\n        -13,   7,  11,  -3,   5, -13,  -9,   6,\n        -11,  -1,   0,   4,  11,  26,   3,   6,\n         -7,  12,   6,  -3,   1,  -9,   7,   1\n    },\n    {\n         15,   6,  19, -23,  -3,  -9,   3,  16,\n         -6,  -4,   6,  -5, -10,   1,  16, -14,\n          2,   0,   2, -13,  -3,   8,  -6,   3,\n          1,   1,   2,  -5,  12,  -4,  -8,  -3\n    },\n    {\n         14,   4,  16, -20,   1,  12,   0,   6,\n         -3,   9,   4,  16,  10, -16,   5,   7,\n          5,  -4,  -4, -18,  -3, -11,  -4,   4,\n         -7,   3,  13,   7,   3,   3,   2,  -7\n    },\n    {\n         22,   3,  -1, -30,  18,  -3,  -9,   9,\n         -2,  11, -16,  -2, -14,  12,   0,   4,\n         -5,   4,  -1,   3, -20,  12,   4, -10,\n         -2,  -2, -12, -12,  10,   6,  11,  -3\n    },\n    {\n         15,   7,   2, -21,   5,   4,   9,  -9,\n        -33,   7,   7,   3,  -6, -14,  -8,  10,\n         12,   0,   2,  -1,   5,   4,  -2,   0,\n         -7,   0,   2,   4,   0,   1,  -3,   8\n    },\n    {\n         -7,   0,  12,   3,   0,  -6,   8,  -4,\n          0,   2,  14, -15,   2,  -7, -31,  -3,\n         14,   0,  14, -15,  -1,  -4, -15,  10,\n          1,  -3,   1,   2,   5,   2,  -8,   1\n    },\n    {\n         -2,   5,   1,   0,  -3,   3,   3,  -6,\n         -1,   2,  -4,   1, -19,   0, -11,  18,\n         11,  10,  21,   5,   6,   2,  10,   3,\n         -6,   0,  -2,  13,   5,  -1,  -2,   9\n    },\n    {\n         -9,   1,  -5,   0,   0, -15,   8,   4,\n          8,   3,   8,  12, -13,  -2, -39,  -2,\n          4,  -4,   5,  -3,  -4,   3,  -3,   3,\n         10,   5,   3,   2,  -3,   5,  -2,   8\n    },\n    {\n         -9,   6,   6,  -8,  12, -12,  23, -18,\n          4, -15,  -5,   2, -20,  13,  -7,   7,\n          7, -12,  14, -12,   6,   1,   1,  -3,\n         -8,   9,   0,   1,  -7,   3,   7,  -6\n    },\n    {\n        -18,  13,   4,   3, -10, -30, -10,  -6,\n        -14,   1,  -7,  -4, -35,   5, -25,  11,\n          9,   8,  19,  -4,  -7,  -3, -18,  -8,\n          1,   5,  10,  -4, -14,  -9,   3,  -4\n    },\n    {\n         -6,  -1,   4,  -9,  -9,   4,  20,   0,\n          0,   3,  11,   7, -16, -17, -20,  11,\n         -6, -14,   1,   4,  19,   2,  -8,   6,\n        -15,   3,   6,  -5, -14,   3,   7,   2\n    },\n    {\n          1,   6,  -2,  -8,  -5,  -3,   3,  -8,\n         21,   1,   3,  16, -14,  -2,  -9,  -4,\n         13,  -2,  18,  14,  14,  19, -13,   5,\n        -10,   2,  -3,   3,   5,   5,   1,  -1\n    },\n    {\n         -1,  -5,  -6,  -2, -11,  -7,   5,  -4,\n          5,  -1,   0,   3,  -3,   2, -19,  18,\n         16,   4,  14, -22,  -2, -11, -22,   1,\n         -1,  11,   1,   2,  11, -10,   7, -12\n    },\n    {\n          1,   4,   5,  -1,  -9,  -5,   1,  12,\n          5,   6,  12,   9, -24,  23,   1,  20,\n         14, -11,  13,   5,  -2,  -2,   5,   6,\n          2,   1,  -9,   6,  10,   5,  -4,  11\n    },\n    {\n         -1,  -1,   1,   7,  -3,  -4,   8, -16,\n         15,  -1,  -7,   9, -22, -11, -11,  10,\n         16,   9,  -2,   4,  13,  10,   6,  16,\n          4,   7,   1,  -8,  -7, -14,  -7,   4\n    },\n    {\n          1,   3,  -6,   0,  15,  -9,  -4,   0,\n          4,   6,  12,   9,  -6,  -5, -22,  17,\n          7, -11,  15,  -5,   1,   3, -19,   0,\n        -15,  -3,  16,   5,   5,  -7, -11,  12\n    },\n    {\n         -2,  -1,  13,   2,   4, -24,  37,  -5,\n         -2,  -6,  12,   7,  -2, -23,  -4,   9,\n          2,  -3,   3,   2,   3,   3, -14,  11,\n          0,  -4,  -2,  -2,   3,  10, -10,   4\n    },\n    {\n          2,   9,   8,  -6, -28,  14,  28, -11,\n         18, -11,   0,   2,  -2,   4, -12,   3,\n          6,   0,   7,  -7,  -6,   2,   5,  -1,\n         -1,  -1,   5,   2,   3,   0,  -3,   9\n    },\n    {\n         -7,  14,   5, -10,  -3,   7,   4,  -5,\n          7,  -8,  -7,   4, -12,  14, -16,  25,\n          3,   0,   1,  -5,  12, -10,   0, -10,\n          0,  12,  12,  17,  12,  10,  -1,   0\n    },\n    {\n         -4,  -2,   5,  -2, -17,  -3,   5,  -5,\n          7, -17,   1,   5,  -4,   4, -20,   0,\n         11, -15,  13,  -8,  10,   1,   1,   5,\n        -12,   9,  -8,   0,   6,  -1, -11,   4\n    },\n    {\n         -3,  12,  13, -15,  -7,  -7,   0,   5,\n         33,   3,   3,  -6, -13,  -7, -15,  10,\n          3,   3,   3,  -5,   2,   7,  -1,   0,\n        -12,   2,  11,  -6,  -9,   0,   5,  11\n    },\n    {\n         -8,   5,  10,  -7, -14,  -4,  13,   0,\n         18,  -3,  -6,   7,   1,  -6,   0,  21,\n          8,  -7,  10,  -8,  -3,  17,  -9,   0,\n         -5,   1,   4,   8,  -3,  11,  -5,   0\n    },\n    {\n         -8,   8,  -3,  -8,   8, -11,  16, -16,\n         17,   0,   8,  16, -17,  10, -16,  10,\n         -8,   6,  11,   0,  10,   7,   4,   5,\n          7,  -5,  -5,  -6,  -7,  -5,  -1,  16\n    },\n    {\n         -6,   0,   6,   1,  -8,  -8,   8,  -7,\n         -5, -10, -11,   8, -19,   6,  -7,  13,\n          5,  -3,   4,  -8,   7,  -1, -18,   9,\n          0,  -5,   6,  26,   3,   8,   2,   4\n    },\n    {\n         -2,  -2,  23,  -2, -20,   2,   7,  -7,\n         -6, -15,   3,   9, -19,  -2, -10,   7,\n         -2,   7,   9,  11,   0,   4,  -4,   6,\n          9,  -2,   4,  -3,   4,   3,   2,   8\n    },\n    {\n         -6,  12,  10, -10,  -7,   4,  17,  11,\n         -6,   1,  12,  11, -18,   8, -12,   4,\n          1,  13,   6, -13,  23,   9,  -5,   8,\n         -2,  -5,   1,   3,   0,  -2,  -4,   4\n    },\n    {\n          7,   1,   7, -17,  -8,   8,  -1,  -7,\n          5,  -6,   4,  -3, -16,   9, -24,  18,\n         -3,  10,  13, -11,  -6, -11,  -4,  10,\n          0,  11,   8,   2,   6,  -5, -11,   4\n    },\n    {\n         -4,   1,  -5, -10,   0,  -3,   9,  -2,\n          4,  -1,   1,   5, -41, -10,  -7,   4,\n         -3,   3,   1,   0, -12,   4,  -3,   0,\n          2,  -1,  -2,  -5,   3,   2,  -7,   5\n    },\n    {\n         -2,   1,   4,   4,  -3,  -6,   1,   0,\n         12,  -5,  11,   0, -17,  -3,  -1,  11,\n          4,   1,  27, -12,   0, -14,   2, -15,\n         -3,  -9,   0,  -7,  -3,  15,  -8,   6\n    },\n    {\n         -6,   4,   9,   2,   4,   3,   7, -10,\n         28,   1,  -2,  48,   7,   0, -10,  10,\n          1,  -9,   2,  -1,   0,   3,  -5,   5,\n         -4,  -2,   7,   7,   1,   3,   2,   5\n    },\n    {\n         -3,   3,  -1,   3,  -9,   0,  -1,   3,\n          2,  -6,  39, -14, -12,   5, -19,  21,\n          7,  -6,   4,  -1,  -4,   0,  -4,   1,\n          0,  -9,   1,  10,   0,  -2,   0,   7\n    },\n    {\n          4,   2, -29,  12,   5,  -3,  16,  -6,\n         15, -13,  -4,  -1, -13,  22, -16,  17,\n         16,   4,   9,  -4,   4,  -6,  -4,  11,\n         -8,   7,   8,   4,   3,  -3,  -7, -13\n    },\n    {\n          0,   3,   3,  -6,  -4,   0,   9,   0,\n          5,   0,  10,  10,   4, -13, -12,  16,\n         23,  -4, -12,  -6,  -4,  20,   2,   0,\n         -4,  23,   1,   8,  11,  -4,  -5,  15\n    },\n    {\n         -6,   4, -15,  -9,  -1, -19,  12, -30,\n        -17,  -4,   1, -13, -13,   4,  -3,  26,\n          5, -25,  11, -14,  -6, -13,   0,  -7,\n          9,   2,   8,  -1,  -8,   1,  -8,  13\n    },\n    {\n          1,   6,   1,  -4,  -4,   1,   2,   0,\n         -3,   2,  10,   6,  -6,  -2, -11,   4,\n         32,  15,  15, -47,  -8,   3, -12,   4,\n         -5,   4,  -1,   0,  -5,   5,   1,  -7\n    },\n    {\n          2,  -1,   0,   0,  -1,  -6,   0,  -6,\n          4,  -4,   5,   9,  -5,   1,  -3,  51,\n          4,  -5,   4, -14,  -1,  -4,  -3,   1,\n         -4,  -1,   0,   2,  -8,   0,   1,   2\n    },\n    {\n          0,   4,  -2,  -7,  -2,  -9,   6,  -8,\n         11,  -3,  -6,   3, -11,  -8, -12,   8,\n         11,   5,  19,   3, -24,  19, -14,  11,\n         -5, -18,  -8, -12,  -5,  -4,  -1,   4\n    },\n    {\n         16,   9,  10,  14, -18,  -2, -18, -27,\n         10,  -5,  12,  14,   4,   0,  -2,  -6,\n        -12,  -7,  -1,   3,   4,   7,  11,  10,\n          5,  -5,  -7, -16,  -3,  -6,   6,   9\n    },\n    {\n          7,  15,  -9,  10, -19,   4,  -5, -37,\n         -2,  -4,   8,   2,   4,  -1,   1,   9,\n         -5,  -5, -12,   1,  -1,  -8,   3,  -3,\n          4,   6,   9,   3,   3,  -1,   2,   4\n    },\n    {\n         13,  17,   3,   9,  -7,  -7, -15, -17,\n         -8, -13,  -4,  -8,  19,   2,  16,  25,\n          7,  15,   2,  16,  -5,  -6, -10,  -9,\n         -7,  -6,  -2,  -7,   7,   2,   4,   5\n    },\n    {\n         24,   7,   9,   8, -13,  -2,   0,  -4,\n          1, -13,   3,   6,   7,  10,  -4,  15,\n          5,   7,  -4,   5,  -5,   3,  13,  -7,\n          5,  15, -11,  -2,   7,   5,   8,   6\n    },\n    {\n         17,   6, -15,  23,  -2,  -1,  -6,  -2,\n          0,  -4,  11,  -3,  12,  15,   6,  -8,\n        -15,  10,  -9,   7,  -1, -11,   2,  -8,\n         -4,   3,   4, -10,   4,   4,  11,   1\n    },\n    {\n         21,  12,  -3,   6,  -8,   8, -11,  -8,\n         -5,  -5,   3,   7,  -1,  -5,  12,  15,\n        -10, -11,   3,  15,   8,   4,   2, -15,\n          0,  14,   1,  -8,  -1,   3,  10,  -7\n    },\n    {\n         16,  12,   5,  13,  -6,  15, -23,   0,\n        -17,  -9,   0,   4,  -9,  13,   6,  18,\n          0,   0,  -4,  -1,   0,  14,   5,  -1,\n          8,  -4,  -8,  -6,   5,  -2,  -2,   0\n    },\n    {\n         14,  16,  -1,  12, -15,  -9,  -6, -20,\n          4,   6,   8,   9,   3,   1,  -9,  -4,\n         -1, -11,   9,  11, -12,   1, -14,  -7,\n          2,  -8,  11,   9,  -4,  10,   4, -16\n    },\n    {\n         13,  10,   3,   7,   0,  -8, -33,  -6,\n          4,  -4,  19,  -2,  14,   6,   5,   7,\n          6,  -3,  -1, -10, -10,  -9,   4,  -3,\n          5,   9,   2,   2,  10,   9,  -2,  -3\n    },\n    {\n         11,  10,  25,  18,  -1,  -6, -21, -21,\n        -11, -16,   6,   5,  14,   4,   8,   7,\n          0, -10,  -7,  -9,  -5,  -4,   3,  -1,\n          1,   6,  -1,   6,  -2,   2,  -3,  -9\n    },\n    {\n         15,   9,   5,  22, -17,  15,  -9,   7,\n          7,  -9,  13,   9,  10,  -1,   8,  -3,\n         -2,   6,   1,  17,   8, -14,   7,  -3,\n         12,   9,   1,   0,   1,  -5,  17, -18\n    },\n    {\n         25,  19, -17,  12,  -4, -10,   1, -13,\n        -19,  -7,  -3,   9,   6,  -2,   3,   1,\n          4,  -2, -11, -14,  -1,  -7,  -5,  -9,\n          7,  -1,  -3,   4,  -5,   1,   0,  -1\n    },\n    {\n         20,   8,  -3, -10, -24,   3,  -6,  -2,\n          0, -12,  14,   6,   7,  11,   4,   7,\n        -12,  -5,  -8, -10,   5,  -1,  -4,   4,\n         16,   7, -14,   6,  -1,  -2,  -7, -11\n    },\n    {\n         16,  18,  17,   1, -15,  -6,  -5,  -3,\n         -1, -19,   8,  -2,   2,   8,  12, -19,\n        -12,   8,   0,  -3,  -1,  -1,   4, -14,\n          9,  -1, -12,  -1,  -7,  10,  -3,   5\n    },\n    {\n         18,  12,  -7,   7,   0,  -3, -13,   0,\n         -1,  -4,   9,  -2,   6,  -1,   0,   1,\n         15, -21,   1,  -8,  25, -19,  13,  -9,\n          2,  12,   5,  -7,  -3,  -1,  -3,   1\n    },\n    {\n         13,  16,  -4,   9,  -2,   2,  -1, -19,\n         -7,  -4,  18,  -6,  14,  18,  -5,   4,\n         -6,  -3, -19, -14,  -1, -12,  10,   6,\n          7,  17, -12, -13, -10,  -4,   5,   4\n    },\n    {\n         27,  17,   4,  14,  -9,  -2,  -4,  -8,\n          0,  -6,  14, -11,  -7,   2,  -3,  -3,\n         -2,  -3, -13,  12,  16,   1,  -5,  -9,\n        -10, -11,  -2,   3,  -7,   5,  11,  -7\n    },\n    {\n          7,  17, -16,  -2, -14, -28,  -7,  -8,\n         15, -10,   7,  15,   8,  17,  13,  -1,\n          4,  -7, -12, -11,   0,   0,   2,   3,\n         -3,   7,  -6,   6,   1, -16,   1,  -2\n    },\n    {\n         23,  11,  -9,  15, -23,  -4,  -6,  -4,\n          2,  -9,  -7,   9,  -8,   3, -13,  -4,\n          8,  18,  -6,  -2,   1,  -5,   6, -14,\n         -5,  -2,  -6,  -5,  -3,  -2,   4,  -5\n    },\n    {\n         12,  13,  18,  18, -35,   2,   7, -17,\n          3, -11,   6,   9,  -3,  -2,  10,  -4,\n          3,   3,  -2,  -7,   0,   2,  -4,   0,\n         -4,   0,  -6,   5,  10,   4,  -3,  -1\n    },\n    {\n         19,  11,   1,  20, -14,   4,  -9, -13,\n         -2,  11,   0,  17,  -1,  -1,  -1,  -1,\n         -5,  -8,   0,   5,  -1,  -8,   5,  -1,\n          3,   2, -12,  21,  -2, -24,   5,   7\n    },\n    {\n         15,  15, -15,  17, -14, -22,   3,  -4,\n        -11,  -3,  -7,   1,  18,  10,   1,  10,\n         -6,  -3,   8,   2,  -7,   0,  -2,   1,\n          1,   2,  -9,  -2,   1,   2,  -3,   4\n    },\n    {\n         45,  13,   8,  17,  -5,   2, -16,   2,\n          8,  -2,   8, -15,   4,   5,  -1,   7,\n         -6,  -2,  -6,   2,  -3,   0,   0,  -9,\n         -1,   7,   2,   3,  -3,  -3,  -1,   5\n    },\n    {\n          1,  18,  -8,  18, -12, -10,   3,   4,\n        -22, -12,  20,   8,  -3,   9,   2,  10,\n        -10,  -3,   9,   3,   6,  -3,  10,  -1,\n         -3,   2,  -2,   4,   2,   3,  -3, -18\n    },\n    {\n          9,  10,  -5,   9, -35, -21, -18, -16,\n         -1, -12,  -6,  -7, -15, -19,  12,   4,\n          4,   9,  -7,   2,  14,   1,   4,   0,\n         -1,   6,  -7,   2,   1,   1,  -4,   4\n    },\n    {\n         31,   8, -17,  35,  -8,   1,  -5,  -6,\n         -7,  -6,  10,  -2,  -3,   6,   9,   3,\n         -6,  -2,   3,   3,   5,  -3,   0,   6,\n          0,   1,  -5,  -3,  -2,  -4,  -1,   0\n    },\n    {\n         18,   4,  -8,   7,  -8, -15,  -1, -16,\n         12,  18,   3,  19,   2,   4,   8,   8,\n          0,  -5,  -8, -12,  10,  -5,   0,   1,\n          0,   4,  -3,  16,  11,  11,  -2,  -6\n    },\n    {\n         27,  15, -17, -10, -23, -22,  -1, -14,\n         -4,  -7,  20,  -2,  -7,   6,  15,  -5,\n         32,   4,   9, -11,  -3,  -8,  11,  -4,\n         -1,  -4,  -8,  -6,  -4,  -5,  -2,  -7\n    },\n    {\n         22,   4,  -7,   2, -15, -11, -17, -10,\n          2,   0,  15,  11,   7,  12,  -8,   6,\n        -10, -18,  -6, -12,   7,   3,  22,   3,\n         -7,  14,  -5,  -2, -13,  -7,  -1,  -7\n    },\n    {\n         18,  13,   9,  24,  -4, -19,  -9, -11,\n         13,   8,   2,   4,  -1,   8,  14,  10,\n        -12,   0,   0,   5,  10,   5,   4,  -1,\n          5,   1,  -1,  11,   2,  -4,   0,  -9\n    },\n    {\n         15,  19,  -5,   1,  -4, -10,  -8, -27,\n          6,   8,   5,  10,   4,  11,   5,  -5,\n        -11,   0, -11, -14,  -4,  -9,  -8,  -8,\n          6,  -9,   4,  -5,  -1,   1,   5,  -4\n    },\n    {\n         18,   1, -13,  14, -14,   9, -15,  -7,\n         12,   1,  13,  -4, -20,  12,  10,  12,\n        -12,   7,   1, -13,  10,  -6,   5,  -3,\n          4,   8,  10, -13,  -3,  -6,   9,  -3\n    },\n    {\n         19, -14,   5,  -8,  -6,   2,  -5,   5,\n         -3,  -1, -28,  11,  18,  -6,  -4,  -2,\n         11,  14, -43, -42,   9,   2,  20, -23,\n          6,  32,   0,   5,   0,   6,   9,   5\n    },\n    {\n          8,  11, -14,  -1,   7,  12,  -7,   2,\n        -16,   2,  10,  -3,  -1,  -7,  -7,  -1,\n          1, -10, -60, -23, -18,  42, -13,   9,\n         18, -11,   0,   1,   0,   2,  -5,   1\n    },\n    {\n         -5,  -1,   2,   0,   3,  -3,   3,  -2,\n         -6,   0,  -3,  -3,   7,   2,   0,  -2,\n         -2,   3, -34, -15,  37,  47,  10,  20,\n          9,   1,   3, -21, -25, -33, -14,   8\n    },\n    {\n          5,   6,   2,  -2,  -2,  -2,   6,   5,\n         -5,   7,  -3,   1,  -5, -13,   9,   3,\n        -17, -19,  -2, -79, -12,  -7,  -8,  -6,\n         -2,  -2,  -1,  -1,  -7, -13,   6,  -1\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   1,  -1,\n          0,   3,   4, -87,   6, -11,  16,  -9,\n         -1,   8,   0,   5,   0,   1,   2,   1\n    },\n    {\n         -5,   6,   2, -24,   5,  -9,  -7,   0,\n          7,   3,  -3,  16, -14, -16,   0,  18,\n         15,  -9, -14, -28, -17,  53,  14,  -6,\n        -28,  -1,  -3, -10,  -7, -14,  19, -15\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,  -3,   0,\n        -13,   0, -53,   3, -22,  63,  19,  16,\n          1, -11,   0,  -3,   0,  -3,   0,   1\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,  -1,  -1,\n         -1,  -6, -43, -43,  -2,  65, -13,  -4,\n          9,   1,   1,   2,   1,   0,   0,   1\n    },\n    {\n          0,   1,   0,   0,  -1,   0,   1,   1,\n          0,   0,   1,   2,  -1,  -1,  -3,  -1,\n        -23,   1, -61, -55,   3, -28,  -6,  -4,\n         -4,   8,   2,   1,   1,  -1,   0,   0\n    },\n    {\n          0,   1,  -1,   1,  -1,   0,  -1,   0,\n          1,  -1,   0,   1,  -1,   0,  -9,  -4,\n        -48, -19, -52, -46,  11, -12,   5, -14,\n          0, -10,   0,   0,  -1,  -2,  -1,   0\n    },\n    {\n          0,  -3,  -1,  -4,   2,  -1,  -7,   3,\n          1,   3,  -1,   1,  -3,   0,  -7,   0,\n          3,  -7, -61, -51,  -4, -21, -16, -21,\n        -11,  14,  -7,   8,   3,  -5,   1,   2\n    },\n    {\n          0,   0,   0,   1,   0,   0,  -1,   0,\n          0,   0,   0,   0,   1,  -1,   9,  -3,\n         56, -11,  -6, -67,  -1,  13,   0,   7,\n          1,  -9,  -1,  -1,   0,   0,   1,   0\n    },\n    {\n         14,   9,  -2,  14, -10, -10,   9,  -5,\n          1,  -8, -23,  30,   8,  -7,  23,   8,\n          2,  10,  -1, -27, -17,  57,  22,   4,\n         -5,   2, -12,  -6,   2,  -7,  -4,  -9\n    },\n    {\n          1,   5,  12,  -2,  -2,  -3,   2,  -3,\n          6,   0,   4,  -2,  -8,  -6,   0,  16,\n        -15,  29, -55, -29, -24,  29,   3,  10,\n          6,  13,  10,  -5,  21,  11, -14,   5\n    },\n    {\n          4,   2,  26,  -6,  10,  11, -23, -10,\n        -27, -20,   3, -24, -11, -10, -13,  25,\n        -10,   5,  -9, -36,  -7,  43,   3, -13,\n          6,  13,  -2,   0,   1,   3,  -3,  -4\n    },\n    {\n         -1,   0,  -1,   0,   0,   0,   0,  -1,\n          1,   0,  -1,   0,   0,   0,  -1,   1,\n        -12,  12, -26, -64, -15,  29,  37,  -7,\n         -3, -12,  -5,  14,   8,  -8, -10,  -2\n    },\n    {\n         19,  -4, -11, -16,   8,  14,   5,  19,\n          3,  22, -11, -21,  -1,  -6, -11,  11,\n         10, -24, -23, -40,  -8,  20,  17,   5,\n         13,  -6,   3,  14, -20,  -8,   3,  28\n    },\n    {\n          2, -12,  10, -14, -18,  26, -22,   4,\n         -2,   5, -21,   8,   3,   1,  19,   0,\n        -12,  24, -14, -40,  15,  29, -15,   6,\n         15,   1, -19,   2,   4,   7, -12,  -3\n    },\n    {\n          0,  17,  13,   7,  -5, -11,   2, -19,\n          3,  38, -21,  -3,  -6,  -4,   7,   1,\n          1,  -5, -40, -10,  -2,  35,   8,   8,\n        -10,  -8,  -9,  33,   4,   4,   0,  -2\n    },\n    {\n         -2, -12,   7,  29, -24,   2,  16,  -1,\n         -7,  16,  10,  -2,  -2,  -2,  13,  -2,\n        -37,  15, -22, -40, -11,  33,  10,  -1,\n          8,  10,   6,   8,   9,   0, -12,   2\n    },\n    {\n         15,  -8,  -9,  -2,   7, -17,   7,  19,\n         14,   4,  12,  27,  11,  10,   4,  11,\n        -15,  14, -13, -48,   5,  18,   0,  -9,\n        -36, -11,   2,   4,   5,   5, -15, -12\n    },\n    {\n        -12,   0,   3,   4,   7,  -5,   5, -14,\n        -24, -18,  -6, -15,  -8, -20,   1,  -7,\n        -33, -28, -40, -38, -18, -10,  -5,  17,\n        -12,   4,   3,  -5,   5, -13,   4,  -7\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,  -1,  -1,\n         -3,  -9, -49, -60,  -5,  45,  -1,   6,\n          0,   0,   0,   0,   0,   0,   0,   0\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,  -1,  -1,\n         -3,  -9, -49, -60,  -5,  45,  -1,   6,\n          0,   0,   0,   0,   0,   0,   0,   0\n    },\n    {\n          0,   0,   0,   0,   0,   1,   0,   0,\n          0,   0,   0,   0,  -1,   0,   0,   0,\n          3,  -2,   9, -29, -11,  55,   8,  32,\n        -36, -13,  -7,  37,   4,  11,   0,   3\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          4,  -1, -39,  -4, -30,  63,  28, -17,\n         -6,  10,   7, -14,  -9,  11,   9,   7\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,  -1,\n         13,  -2, -50, -32,  22,  51,   4,   7,\n          6,  11, -20, -13,   9,  -5,  21,  -4\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,  -1,  -1,\n         -3,  -9, -49, -60,  -5,  45,  -1,   6,\n          0,   0,   0,   0,   0,   0,   0,   0\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,  -1,  -1,\n         -3,  -9, -49, -60,  -5,  45,  -1,   6,\n          0,   0,   0,   0,   0,   0,   0,   0\n    },\n    {\n          0,   0,   0,   0,   0,   1,   0,   0,\n          0,   0,   0,   0,  -1,   0,   0,   0,\n          3,  -2,   9, -29, -11,  55,   8,  32,\n        -36, -13,  -7,  37,   4,  11,   0,   3\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          4,  -1, -39,  -4, -30,  63,  28, -17,\n         -6,  10,   7, -14,  -9,  11,   9,   7\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,  -1,\n         13,  -2, -50, -32,  22,  51,   4,   7,\n          6,  11, -20, -13,   9,  -5,  21,  -4\n    },\n    {\n         -8,   2,   1,  22, -31,  -6, -25,  -3,\n         -3,   1, -15, -11,  -2,  -3,   4, -13,\n         -9,  15, -18,  37,  -7, -37,  12, -13,\n        -11, -25, -10, -11, -22,   7,  16,   7\n    },\n    {\n         14,  10,   4, -10,  -1,  -5,  -7,  -3,\n         16,  13,  -5, -15,   5,  11,  -1,   8,\n        -27,   7, -12,  49,  17, -22,   9,  -2,\n         -9,  -1,   2, -15,  -1,  41, -18, -17\n    },\n    {\n         -4,  -9, -15,  -3,   3,   4,   4,   2,\n          7,  -3,  -7,  -8,  -5,  17, -19,  -7,\n         36,  -9, -38,  17,   1, -48,  11, -18,\n        -13,  -2,  -8,   4, -10,  -5,  21,  11\n    },\n    {\n         15, -13,   4,   2,   1,  -5,  -2,   1,\n        -10,   7,  -1,   3,  -6,   0,  11, -11,\n          8,  20, -17,  51, -17, -41,   2,  15,\n          4,   8,  -2,  16, -32,  -1,  17,   6\n    },\n    {\n         -8,   8, -18,  -5,   4,   6,  -3,   8,\n          0,  -4,   2,   0,  -1,  -4,   5,   8,\n         30,  30,  -8,  70,   2,   8,   2,   0,\n          7,   1,  13,  -1,  -6,  -7, -11,   2\n    },\n    {\n         -8,  -7,   9, -10, -13,   6, -11, -14,\n         13,  25, -26,   5,   2,  -5,  -5,   5,\n         -8,   4,   0,  33,  12, -38,  -4,   6,\n         13,   6,  25,  34,  -1,  25, -19,  -5\n    },\n    {\n         18,   3, -17,   4,  -8,   7,  20,   1,\n         -1,   5,  -5,  -2,  -8,   8, -35,  15,\n         24,  43,  -5,  51,   5, -12,  -3,   1,\n         -2,   3,  -3,  -3,  -9,   8,  -9,   2\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   1,\n          2,  10,  24,  76,  -2, -22,  11,  -1,\n          4,  33,   4,   1,  -1,   1,   2,   0\n    },\n    {\n          0,  -1,   0,   1,   0,   1,   0,   1,\n          0,   0,   0,   0,   0,   1,   2,   0,\n         24,  13,  32,  70,  26,   5, -21,  -9,\n         -6, -15,   2,  -2,   2,   4,   1,   1\n    },\n    {\n          5,  -4, -11,   4,  -4,  22,  10,  -2,\n         13, -11,  -4, -21, -17,   0,  -7,   4,\n         10, -34,  11,  52,   2, -46,  -5,   0,\n          0,  -1,   2,   4,  -9,   1,   1,  -7\n    },\n    {\n          0,   1,   1,   0,  -1,   0,   1,   0,\n          1,   1,   0,   1,   0,   0,  -3,   1,\n         -8,   9,  -1,  64, -13, -61,  -3,   3,\n         -5,  10,   1,   3,  -1,  -1,  -1,  -1\n    },\n    {\n          0,   1,   0,  -1,   0,  -1,   0,   0,\n          1,   0,   0,   0,   1,   1,   2,   1,\n         10,  -2, -31,  79, -10,  27,   0,  -1,\n          3,   8,   1,   1,   0,  -1,   0,  -1\n    },\n    {\n          3,  12,  10,  26, -19,  10,  -9,   6,\n         -4, -15,  10,   3, -16,   6,  11, -19,\n          3,  10,  18,  44,   5, -30,   5,  -9,\n         21,   4,  20,  10,  14, -25,   8, -17\n    },\n    {\n          0,   0,   0,   1,  -1,   0,  -1,   0,\n          1,   0,   1,   1,   0,   0,  -6,  -2,\n          8,  -8,  13,  69,  26, -19, -25, -17,\n         16,   6, -12,  22,   2,  -6,   9,   5\n    },\n    {\n          0,  -1,   0,   1,   0,  -1,  -1,   0,\n          0,   1,  -2,   1,   0,   0,  -4,  -1,\n        -34, -15, -33,  56,   9, -42,   9,  10,\n          6,   9,  -8, -11,   0,  -6,  15,   5\n    },\n    {\n         10,   2, -14,  -3, -15, -35,  -1,   7,\n        -18,  14,   8,  -1, -15, -26,   6, -15,\n        -18,  22,   9,  33,   0, -32,  -9,   3,\n        -11,   7,   4,  -1,   5,  30,   9,   1\n    },\n    {\n          4,  15,   0,   6,  -5, -11,   9,   6,\n          6,   6,  14,   2,  -1,  10, -24, -25,\n         -2,  -4,  -1,  37,   2, -29,  14,  -9,\n         22,  17,  -2,  33,  10, -25,  11, -11\n    },\n    {\n          0,   5,   2,  18, -12,  21,  22,  33,\n         -7,  21,  -9,  -7,   7, -15,  -7,  16,\n          7,   0, -14,  44,  10, -25,   5,  -4,\n         15,  -8,  10,  -4,   5,   9,  -1,  16\n    },\n    {\n          3,  13,  12,  12,   8,  25, -23,   8,\n        -22,  -3, -18,  -8,  15,  12,   9,  19,\n          0,   0,  -9,  49, -27, -15,  -9, -15,\n         12,  -8, -16,  -7,  13,   5,  13,   2\n    },\n    {\n         12,  -6,   7,  -2,  20,  -9, -14,  12,\n         13,  -5, -17,  22,  -8,  -4,   2,   7,\n        -13,  -2, -15,  43,  -5, -30,  27,   4,\n         10, -27,   5,  27, -10, -10, -18,   0\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   1,\n         -1,  10, -18,  70,  -2, -52,  -1,  -7,\n          0,   0,   0,   0,   0,   0,   0,   0\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   1,\n         -1,  10, -18,  70,  -2, -52,  -1,  -7,\n          0,   0,   0,   0,   0,   0,   0,   0\n    },\n    {\n         15, -13, -20,  16,   2,  13,   5, -11,\n         -8,  -5,  -3,   2,  24, -23,  30,  -7,\n         11,  30, -15,  43,   5, -15,  15,  -3,\n        -14,   1, -23,   8,   3,   9,   4, -11\n    },\n    {\n          0,  -1,   0,   1,   0,  -1,  -1,   0,\n          0,   1,  -2,   1,   0,   0,  -4,  -1,\n        -34, -15, -33,  56,   9, -42,   9,  10,\n          6,   9,  -8, -11,   0,  -6,  15,   5\n    },\n    {\n         10,   2, -14,  -3, -15, -35,  -1,   7,\n        -18,  14,   8,  -1, -15, -26,   6, -15,\n        -18,  22,   9,  33,   0, -32,  -9,   3,\n        -11,   7,   4,  -1,   5,  30,   9,   1\n    },\n    {\n          4,  15,   0,   6,  -5, -11,   9,   6,\n          6,   6,  14,   2,  -1,  10, -24, -25,\n         -2,  -4,  -1,  37,   2, -29,  14,  -9,\n         22,  17,  -2,  33,  10, -25,  11, -11\n    },\n    {\n          0,   5,   2,  18, -12,  21,  22,  33,\n         -7,  21,  -9,  -7,   7, -15,  -7,  16,\n          7,   0, -14,  44,  10, -25,   5,  -4,\n         15,  -8,  10,  -4,   5,   9,  -1,  16\n    },\n    {\n          3,  13,  12,  12,   8,  25, -23,   8,\n        -22,  -3, -18,  -8,  15,  12,   9,  19,\n          0,   0,  -9,  49, -27, -15,  -9, -15,\n         12,  -8, -16,  -7,  13,   5,  13,   2\n    },\n    {\n         12,  -6,   7,  -2,  20,  -9, -14,  12,\n         13,  -5, -17,  22,  -8,  -4,   2,   7,\n        -13,  -2, -15,  43,  -5, -30,  27,   4,\n         10, -27,   5,  27, -10, -10, -18,   0\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   1,\n         -1,  10, -18,  70,  -2, -52,  -1,  -7,\n          0,   0,   0,   0,   0,   0,   0,   0\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   1,\n         -1,  10, -18,  70,  -2, -52,  -1,  -7,\n          0,   0,   0,   0,   0,   0,   0,   0\n    },\n    {\n         15, -13, -20,  16,   2,  13,   5, -11,\n         -8,  -5,  -3,   2,  24, -23,  30,  -7,\n         11,  30, -15,  43,   5, -15,  15,  -3,\n        -14,   1, -23,   8,   3,   9,   4, -11\n    },\n    {\n         16, -18,   7,  -4,  31, -15,  -9, -13,\n         20, -12,  -6,   0,  12,  -6,  -2,   4,\n          3,  -3,  -1,   0,   1,   3,   3,  -2,\n          1,   6,   4,   0,  -3,   2,  -5,   1\n    },\n    {\n         38,  -5, -13,  -4,   8, -15,  11,   1,\n          2,  -4,  -1,   9,  13,   4, -12,  -7,\n          0,  -2,   7,   2,  -6,  -2,  -3,  -2,\n          3,  -4,   6,  15,   1,   1, -11,  -2\n    },\n    {\n         47, -22,   9, -26,   3,  -5,   2,  -7,\n          4,  -2,   2,  -2,   3,   0,   3,  -4,\n          3,  -3,   2,  -3,   7,  -3,  -1,   1,\n          1,  -5,   5,   0,   2,  -5,  -3,  -2\n    },\n    {\n         14, -16,   2,  -6,   7,  -2,  -7,  -4,\n         -4,  -7,  14,  -3,   7, -19, -14, -17,\n        -29,   6,  26,  16,  -5,  13,  -4,  -1,\n         21,  14,   1,   3,  -6,   0,  -7,  -1\n    },\n    {\n         29, -11,   5,  -3,   4,  11,   4, -10,\n          1, -22,  -3, -10,   5,   4,   2,   8,\n         -2,  -7, -12, -12,  -8,  -3, -18,  -2,\n         -9,  -5,  -1,  -3,   2, -14, -14,   7\n    },\n    {\n         28, -12,   5,   3,   9,  -7,   0,  -2,\n          2,   1,   4,   0,  -7,  -3,  -2,   4,\n          4,  14,   8,  -1,  -4,  14,  -7,  17,\n         -2,  -2,  -9,   2,  19,  -7,   9,  -8\n    },\n    {\n         31, -18, -22,   8,  15,  -5, -10, -15,\n          1,  10,   6,   7,   6,  -8,   2,  -1,\n         12,  -3,   3,  -1,   1,   5,  -6,  -4,\n          0,   1,   7, -10,  -2,   4,  -3,  -4\n    },\n    {\n         53, -30,  -4,  12,   2,   3,  -3,  -3,\n          0,   1,   6,   5,  -5,  -4,  -7,   1,\n          0,   2,   1,   3,   1,   5,   0,   2,\n          2,  -1,   0,   4,   2,   0,  -2,   0\n    },\n    {\n         27, -18,  -3,  -2,   4,  -8,   3,  -2,\n        -11,   2,  10,  -8,  -8,  -4,   0,  -2,\n          8,   0,   9,   0, -16,  11,   1,  -6,\n         13,  -3, -10, -13, -15,  25,   1,   0\n    },\n    {\n         35,  -5,  -1,  -8,  23,  11, -14,  -3,\n          2,  -2,   8,  -6,  17,  -2,   7,   0,\n         -2,  10, -17,  13,  -2,  -2,  11,  11,\n        -14,   2,  -2,  -3,  -8,  -1, -12,  -5\n    },\n    {\n         29,  -9,   7,   3,   2, -10,   0,   3,\n          9,   0,  -3,   5,   1, -10,  10,  -5,\n          3,   6, -20,  -9,  -6,  -4,   1,   0,\n         12,  17,  -8,   9,   3,  -1,  -9,   0\n    },\n    {\n         15, -16,  18, -19,  16, -15,  17, -18,\n         13, -16,  17, -14,  15,  -9,  13, -17,\n          9,  -7,   4,  -5,   3,  -4,  -3,   0,\n         -6,   7,  -9,   7,  -2,   7,  -9,   9\n    },\n    {\n         21, -10,   7,  -2,  12,  -7,  13, -17,\n         11,  -2,  20,   3,   5, -11,  -6,  -6,\n        -15,   0,  -9,   5, -11,   7,  -1,   7,\n          8, -10,  -9,   3,  -5,   9,  -8,  -2\n    },\n    {\n         23, -22,  15,  -5,  16,  -4,  -3, -12,\n          9,   3,  -1,  -2,  -8,   2,  -2, -16,\n          3,   4,  -2,  -6,  -7,  12,  -8,   2,\n        -14,   2,  -7,  11,  -2,   6,  -4,  -1\n    },\n    {\n         34, -17,  -4,   8,   4,  -6,   1,   8,\n          4,  16,   3,   6,  12,  -1,  -1, -15,\n          6,   4,  -7,  -6,   6,   0,   2,   1,\n         -2,   2,   3,   3,  -3,  -2,   8,  -6\n    },\n    {\n         18, -18,   2,  -2,  10,   1,  18, -23,\n         -3, -10,   0,   4,  20, -19,  -3,  -4,\n          2,   8,   6,   1,  -3,   1,   1,   3,\n          5,  -1, -11,   3,  -7,   5,  -1,   1\n    },\n    {\n         15, -14,   2,   3,  10,  -8,  12, -13,\n         13, -15,   6,  -8,  -4, -10,  14,  -9,\n         24,   2,  -7, -18,  13, -11,   8,  14,\n         -6,  -2,   3,  -1,  -4,   7,  -7,  -4\n    },\n    {\n         20, -12,  13,   5,  -1, -10,  15,  -6,\n          8,  -1,  -3, -10,  17,   0,  -6, -19,\n          2,  -1,   8,  -3, -16,   0,  -3,   2,\n         -2,   0,   8,  -9,   0,   1, -10,  -9\n    },\n    {\n         32,   0,  -9,  -5,  -1,   5,  13, -11,\n          8,   3,  11, -11,   0,  -8,  -2, -14,\n          7,  10,   6,  -5,   1,  10,   2,  12,\n        -10,   4,   4,   6,   4,   0,  -7, -10\n    },\n    {\n         16, -14,  10,  -7,  11, -11,  11, -11,\n         18, -13,   8, -15,  16, -11,  13,  -9,\n          8,  -7,  12, -11,   7,  -6,   3,  -5,\n          9,  -5,   4,  -1,   7,  -4,   8,  -3\n    },\n    {\n         24, -27,  -1,   5,   8,  -5,  12,   7,\n          4,  -3,   3,  -1,  -9, -11, -13,  -5,\n         10,   0, -13,   7,   1,  -5,   4,  -9,\n          7,  -3,  13,   2,  -5,  -3, -17,  -2\n    },\n    {\n         23, -19,  15,   1, -10, -18, -12,  -6,\n          8,  -3,  12,   0, -12, -10,  -4,  -4,\n          8, -10,   4,   2,  -2,  -8,  13,  -3,\n         -2,  -6,   2,  -3,   5,  -2,   2,  11\n    },\n    {\n         25, -12,   4,   2,  24,  -3,   3,  -6,\n         14,  11,   0, -21,  -3,  -3,   1,  -8,\n          7,   0,   0,   3,   3,  -6,  -7,   6,\n          2,   1,  -4,   5,  -1,  10,  -2,   9\n    },\n    {\n         24,  -8,  -6,   7,  16, -12,  13,  -1,\n         11, -21,   2,  -6,   3, -12,   0,   9,\n          4,  11,  -7,   1,   4,   1,  -8,   3,\n          3,  -6,   3,   3,   0,  -8,   8,   4\n    },\n    {\n         25, -21,  13,  14,  13, -18,   4,  -3,\n          0,  -5,  -4,   5,  -3,   0,   4,  12,\n          7,   3,   5,  -5,   2,  -2,   3, -10,\n          2,  -9, -15,   6,   1,   7,  -5,   1\n    },\n    {\n         23, -16,  -2,  10,   4,  -1,   3,   1,\n         32,   3,  -5,  -2,   9,  10,  -1,  -4,\n         -6,   2,   9,  -1,  14,  12,  -6,  -1,\n        -17,  -2,  -4,  -9,  -7,  -6,  -8,   3\n    },\n    {\n         50,  -8,   5,   2, -11,  10,   0,   0,\n          6,  -3,   7,   0,  -3,  -2,  -3,   0,\n          6,  -4,   2,  -5,  -9,   0,   3,  10,\n          1,  -7,  -2,  -3,  -6,  -9,   1,  -2\n    },\n    {\n         28, -17,   0,  -2,   2,  -9,   1,   5,\n         -4,  -1,   0,   0,  19, -27,   5, -12,\n          7, -14,  -3,  -6,  10,  -2,  -4,  -2,\n          4,  -5,  -2,  -7,   1,   7,  -9,   4\n    },\n    {\n         22, -19,  -6,  -6,   3, -22,   3,   5,\n         20,  -8, -14,  -5,   1,   1,  20,   2,\n         16,   6,   3,  14,   4,   3,   5,   1,\n          5,  -7, -10,  -6,   3,  -6,   1, -14\n    },\n    {\n         29, -14,  -8,  13,   8, -10,  -6,   4,\n          4,  -6,   5,  -7,   1,  12,  14,  11,\n         -7,   1,   2,  -9, -11,  -9,   0,   4,\n         -1,   7,  10,   4,   4,  20,  -1, -11\n    },\n    {\n         18,  -9,   4,   1,   7, -29,  12,   1,\n         -1,  -9,  -2,  -1,  -2,   2,   9,  -8,\n        -13,   5,   4, -13,  -4,   2,  -5,  -7,\n         -6,  14, -10, -34,  -3,   1,  -3, -13\n    },\n    {\n         38,  -9,  24,   8,  11,   4,  -6, -11,\n         -2, -12,   1,   1, -11,  -8,  -5,  -2,\n        -15,  -8,   8,   0,   1,  -7,   5,   4,\n         -1,   8,  -2,  11,  -3,  -1,  -5,  -5\n    },\n    {\n        -20,  11,  -4,  24, -11,   1,  15,   4,\n          0, -28, -10,  -1,  10,  10,  -6,   5,\n         -6,   2,   7,  -2,   1,  -2,  -6,  -3,\n         -7,   1,   2,  12,  -1,   7,   0,  -2\n    },\n    {\n         -9,  10, -23,  27,  -4, -17,  20,  -6,\n         14, -17,   5,  -1,   5,  -9,  -7,   5,\n         -6,   4,  -2,   9,   0,   8,   0,   1,\n         -3,  -3,  -5,  -8,   5,  -2,  -2,  12\n    },\n    {\n        -10,  19,   4,   9,   1, -16,  17,  -2,\n          9, -29, -16, -11,  -4,   7,  -5,   4,\n         -1,  -3,   3,   2,   3,  -4,   5, -12,\n         -2,   6,   5,  -4,   4,   1,   4,  10\n    },\n    {\n        -20,  10, -24,  14,  -5,  11,   9,   0,\n         16, -20,  10,  -5,  -6,  -6,  -1,   2,\n         -4,   5, -16,   8,  -2,   5,   5, -11,\n          9, -11,   4, -11,  -1,  -1,   4,   3\n    },\n    {\n         -9,  11,   3,  19,  24,   4,   5, -14,\n         30, -17,  -4,  -2, -17,   7,   2,   3,\n          1,   3,  -7,  -4,   2,  -3,   1,   4,\n         -1,  -1,   3, -12,  -2,   3,  -3,  10\n    },\n    {\n        -19,  18,  11,  19,  19,  19,  10,   4,\n         13,   6,   5,   4,   8,   3,  -2,  12,\n         -6,  -2,   7,  -6,  15,  12,  16,  16,\n         18,  -3,  -4, -20,   0,  10,  -9,  -3\n    },\n    {\n        -21,   9,  20,  12,   0,  -3,   5,  -9,\n         15, -13,   5,  -5,  -6,  24,   2,   9,\n         -5,   2,  -7,   2,   5,   7,  -5,   2,\n         15,   3,   1,  -1,  -4,  -2,   7,   0\n    },\n    {\n        -18,  16,  13,  15,   2, -10,  14, -11,\n          4, -11,   5,  12,  12,  20,   8,  30,\n          2,  11,  -9,   7,   0,  -3, -16,  -5,\n         -6,   5,  -4, -21,   0,   5,   6,   1\n    },\n    {\n        -26,   8, -13,   9,   6, -10,   2, -11,\n          7,  -4,   6, -19, -11,  -6, -12,  16,\n          0,   5,  -7,   8,   5,   6,  17,  -9,\n         10, -10,   5,  -3, -11,   2,   4,  10\n    },\n    {\n        -11,  17,  -3,  22,  -5,  18,   3,   1,\n          4,  -5,  14, -27,   5,  -7,  -4,  -5,\n        -10,  11,   1,  15,   1,   1,  -6,  -5,\n         10, -22,  -7,  -7, -15,  13,  -4,   5\n    },\n    {\n        -17,  14,  -7,  13,   3,   0,  13,  -6,\n          9, -14, -22,  -1,   1,  19,  14,  -3,\n          4, -13, -13,   2,  -4,   8,  -2,  -2,\n         13, -12,  13, -12,  -7,  -5,  -3,   6\n    },\n    {\n        -17,  17,  -1,  33,   6,   3,   9, -16,\n          3, -14,  -8,   6, -17,   8,   3,  13,\n          8,  -6,   3,   1,  -2,   0,  -2,   8,\n          4,   9,  13, -10,   4, -17,   0,  -6\n    },\n    {\n        -20,   7,   7,  21,   1,  -3,   7,  -3,\n         -2, -12,   9,  -7,   2,  -3,  14,   1,\n         -1,  -7,  12, -10,   5, -20,  11,  -2,\n          0, -24, -17,   6,   6,  -4,   3,  -1\n    },\n    {\n         -8,  10,   6,   7,  -1,  -6,  28,  -6,\n         10, -33,   1, -20,   0, -12,  10,   1,\n         -6,   8,  -3,  -1, -10,   8,   5,   0,\n         10,  -2,   8,  16,  -5,  -3,  -7,   4\n    },\n    {\n        -17,  13,   3,  15,   1,  -5,  27,  -5,\n          6,  -6,  12,   2,  -4,   8,  -1,  -3,\n         -2,  12, -15,   3,   4,   1,   2,  -9,\n          0, -16, -21,   2,  -4,  16,  -7,   4\n    },\n    {\n        -15,  20,   8,  17,   5, -14,  15, -11,\n         21, -11,  13, -13,   2, -15, -13,   1,\n         -5,   5,   2,  10,  -9,   4,  -1,   3,\n          2,  -4,  13,  -5,   1,  -4,   5,  -3\n    },\n    {\n        -21,   8,   2,  16,  -1,   2,  15, -16,\n         13, -12, -12,  -7,  -8,   2,  -7,  11,\n         -8,   5,   2,  -7,  16,  -4,   1,  -7,\n          3, -15,   6,  -5,  -8,   2,  -8,   5\n    },\n    {\n        -15,  17,  -6,   3,  -3,   3,   9,  -7,\n         14, -23,  11,   1,  -1,   4,   7,   6,\n         -1, -14,   7,   6,  -8,   5,   1, -15,\n         10,  -9,   2,  -3,  -1,   4, -10,  -4\n    },\n    {\n        -10,  18,   3,  11,   1,   4,  14, -14,\n          7,  -4,  15, -10,  10, -11,  10,  -4,\n          5, -14,  10,   4,  15, -12,  15, -13,\n         20, -15,  14, -15,   8, -11,   4,  -6\n    },\n    {\n         -7,  23,   2,  20,   7,   8,  19,  -5,\n          9, -16,  -8, -17,  -5,   1,   5,  -6,\n         -8,   1,  -6,  -4,  10,   6,   6,   2,\n        -11,  -4,   0,   2,   4,   7,   9,  -4\n    },\n    {\n        -15,  20,  -5,  22,  11,  -8,   9,  -5,\n         10, -13,  -8,   8,   2,  -2,  -3,   7,\n          6,  10,   1,   2,  -5,  -9,   1,  10,\n         16, -22,  -7,   0,   7,   7,   6,   1\n    },\n    {\n        -26,  19,  -5,   3,   5,  25,  18,  -5,\n          9, -14,  -8,  -6,  -2,  -6,   2,   3,\n         -8,  -2,  -7,   7,  -3,   7,   3,   4,\n         -8,   0,   1,  -8,  -4,  -2,  -2,   1\n    },\n    {\n        -20,  14, -10,   6,  -3,   7,   8, -32,\n         -2,  -7,  -2, -10,  16, -12,  -9,  15,\n         -2,  -5,  -6,   2,  -7,   5,   9,   1,\n          6,  -7,  -1,   0,  -2,  -4,  -7,   3\n    },\n    {\n        -14,  16,   4,  11,  -8,   1,  23,  -4,\n         17, -13, -10,   1,  12,   9,  12,  -4,\n          7,  -1,  -1,   5,  -8,  -6,   3,   3,\n         -6,  -3, -18,   0,  18,  20,   4,  -2\n    },\n    {\n        -33,  19, -10,  30,  15,   2,  -3,  -1,\n         -4, -14,   7,  -7,  -1,   7,  -8,   9,\n         -1,  -3,  -5,   2,   2,   4,   0,   5,\n          0,   0,   2,   3,   3,  -3,  -3,   4\n    },\n    {\n         -6,  20,   0,   5,  17, -10,  18, -17,\n          9, -16,   4, -13,  -6,   2, -14,  14,\n        -28,   9, -12,  25,  -4,   7,   7,  -8,\n          6,  -6,  -2, -10,   2, -11,  -1,   2\n    },\n    {\n        -12,  14,  12,  52,  -3,   5,  -5,   4,\n          8, -13,   2,  -5,  -4,   2,  -2,  -1,\n         -2,   3,   3,   5,   2,   3,   0,   1,\n         -5,   2,  -4,  -3,   1,  -5,  -2,   0\n    },\n    {\n        -13,   6,   9,  24,   0,   8,  14, -15,\n         18,  -9, -11,  -8,   3,  15,  -2,  -4,\n         -9,   4,  -3,  12,  14, -13,  11,  -4,\n          2,  -4,   0,  -6,  -6,  -6, -14,  -1\n    },\n    {\n        -10,  28,   3,  12,   9,   3,  11, -28,\n          6, -11,  -7,   4,   0,   7,   8,  -9,\n          0,  -6,   0, -16,   4,   7,   4,   4,\n          7,   3,   4,  -7,   0,  -3, -10,   6\n    },\n    {\n        -11,  14,  -2,  19,  -1,  -1,   7,   9,\n         -2, -27,  10, -14,  15,  -4,  12,  -4,\n          2,  -2,  -6,  12,  -6,   0,  -5,  -4,\n         -5,   1,   3, -11,   5,  -9,   3,  -8\n    },\n    {\n        -18,   7,  13,  16,  -4,   3,   9, -10,\n         10, -10,  -3, -22,  -4, -12,   3, -16,\n          0,  -3, -16,   8, -11,   1,  10,  -7,\n         15,   3,   0,  -1, -13,   8,   1,   6\n    },\n    {\n        -20,  10, -10,  10,   8,  -1,   6,   0,\n         16, -12,   9, -10,  -1,  -5,  -4, -13,\n         13,  16,  -8,  12,  -2,  14,  18,  13,\n          0, -16,   2,  -5,  -5,  -5,  -4,   3\n    },\n    {\n        -14,   5,  -7, -17,   5, -13,  23,  20,\n         -4,  -1,   1,  -6,  13,   5,  -1,   4,\n        -14,  -2,  -7,   8,   3,   2,   2,  -7,\n          2,  -1,   4,   7,   3,  -9,  -1,  -5\n    },\n    {\n        -19,   3, -24, -28,  -9,  -7,  19,   3,\n          2,  19,   7,   5, -13,   8, -15, -17,\n          3, -11,   4,  13,   3,   2,  -1,  -3,\n         -4,  -4,   2,   0,  -5,  -6,   6,   2\n    },\n    {\n        -17,  18, -30, -20,  -2,  -3,   1,  15,\n         -1, -11,   6,  -4,  11,  11,  -4,  -5,\n        -10,   0,   0,   1,   3,  -7,   8,   2,\n          5,   1,   5,  -5,   1,   6,   4,   1\n    },\n    {\n         -6,   1, -30, -25,  -1,  -8,  -2,  -9,\n        -17,  16,   3,  -1,  -2,  -9,  -6,  -7,\n         -3,  12,   6,  -4, -10,   0,  10,  -8,\n         -6,  -5,  -3, -11,  -4,   0,  -1,  -3\n    },\n    {\n         -1,  -1, -34, -28,   1, -10,   2,   9,\n          4,  16,   2,   6,  14,  17,   0,   7,\n         -4,   4,   4,   4,   0,   1,  -1,  -5,\n          8,   1,  -4,   1,  -9,  -2,   5,   6\n    },\n    {\n        -11,  14,   1, -31,  -7, -24,   9,   7,\n          6,   5, -13,   1,  -1,   3,   4,  -1,\n         -2,  -8,  -6,   3,   5,  -4,  -6,   7,\n         -2,   5,   3,   3,   0,   0,  -5,   2\n    },\n    {\n        -25,   8, -11, -18,   1,  -4,   8,  -3,\n         -4,  15,   6,  -5,   8,   2,   3,   4,\n         -4,   5,   6,   8,  -7,   6,   1, -11,\n        -15, -13,   9,  -4, -14,  10,  12,   7\n    },\n    {\n        -20,  11, -15, -25,   3,   4,  18,  13,\n         -4,  -5,  -9,  -1,  -5,  -2,  -2,  -7,\n         16,   5,  -4,  -5,  -7,  -2,  -3,  -9,\n         11,  -2,   0,  -7, -17,  -6, -11,   6\n    },\n    {\n        -11,  18,  -5, -20, -15,  -3,   9,  11,\n        -20,  12,   5,   5,  11,  -3,   7,   1,\n         10,  -6,  -3,  -3,   3,   3,  14,  -7,\n         10, -17,   9, -11,  -2,  -6,   7, -12\n    },\n    {\n        -20,   8, -14, -17,  -9, -13,  -3,   0,\n        -27, -14,  -3, -14,   4,   3,   6,  -6,\n          7,   4,  23,   9,  11,   9,   3,  -4,\n          9,   2,   4,  -1,  -6,   1,  -8, -11\n    },\n    {\n         -9,  14,   2, -37,  -7,  13,   6, -11,\n         -6,   9,  18, -11,  -6,   2,  12,   4,\n         -1,   3,   1,  -2,  -2,   1,  -9,  -4,\n         -2,  -3,   3,   5,  -6,   0,  -2,  -8\n    },\n    {\n        -29,   8,  -1, -13,  -2,   8,  23,   2,\n        -10,   7,  13,  -6,  -5,  11,  13,   0,\n        -10, -13,  11, -12, -10,   6,   4,   6,\n          4,   3,   6,  -5,  -9,  -2,  -1,   3\n    },\n    {\n        -18,   6, -10, -55,  -4, -11,  -2,   0,\n          1,  -3,  -9,  -6,   3,  -2,  -1,   6,\n          3,  -1,   3,   1,  -4,  -7,  -2,   6,\n          3,  -2,  -1,  -3,  -2,   0,   4,   1\n    },\n    {\n        -14,   5,   3, -21,  -8, -16,  -4,  -2,\n        -11,  27,  15, -20,   3,   0,   1,   1,\n          2,  -5,  -5,   4,   1,  -9,   5,  -3,\n          3,   0,  -4,  -2, -11,  -4,  -3,   7\n    },\n    {\n        -17,  -1,  -9, -17,  -8, -18,  12, -13,\n         -9,  13,  -3,   3,   3,  -3,   1,  -2,\n          0,  16,  -9,   6,  12,   9,   5,  11,\n          2, -15,   1,  -4, -16,   7,  -4, -12\n    },\n    {\n        -18,   8,  -6, -11,  -8,  -7,  13,   7,\n          1,   6,   8,  -1,  21,  -4,  14,  15,\n         18,  -4,  -3,  15,   0,   9,   4,   7,\n          3,  -1,   9,  -2,   0,   7,  -8,   2\n    },\n    {\n        -10,   7, -18, -29,   3,  12,  12,   9,\n         11,   4,  -1, -15,   1,  -1,   8,  -2,\n         -2,  10, -15,  -1,   0,   6,  12,  -6,\n         -1,  10,  -6,  -3, -11,  -4,   9,  -6\n    },\n    {\n        -14,  14,  -9, -21, -12,  -2,  -1,  -7,\n         -5, -10,   5,  -8,   0,   6,   9, -11,\n         11,  -3,  -5,   3,   8,  15,  -2,  -4,\n        -22,   4,  -6,  12,   2,  13,   6,  -7\n    },\n    {\n        -12,  11,  -5, -29, -25,   4,  12, -13,\n        -11,  -7,   4,   2,   2,  -5,   5,   8,\n          7,  -5,  -5,   6,   3, -10,   1,  -6,\n          6,  -6,  -5,  -1,  -2,  -4,   7,   6\n    },\n    {\n        -15,  11,  -5, -16,   0, -13,  26, -23,\n         -6,  -3,   5,  -2,  -2,  21,  -6,  -3,\n         -5,  -1,   6,  -1,   0, -13,   2,  -3,\n         -9,  -1,  -4,  -3,   5,  -4,  12, -16\n    },\n    {\n         -9,   9,  -1, -17,  -3,  -6,  12,   6,\n        -18,  -2,  11, -14,  -6,   3,  14, -12,\n        -11,  -5,  14,   2,   5,  -8,  -4, -11,\n          2,  -5,  16,   6,  -7,  -4,   8,  13\n    },\n    {\n        -13,   5,   3, -28, -14,   0,   6,  23,\n          5,   4,  -1, -17,   1,  -3,   0,   0,\n          5,   4,   0, -18,  14,  10,   4,   2,\n          5,  -2,   4,  -3,   2,   0,   2,   0\n    },\n    {\n        -15,   4, -13, -16,  -3, -12,  -2,   2,\n          7,  10,   9,   3,  11,   4,  23,  14,\n          9,  16,   4,   1, -12,  -3,   4,  -7,\n        -15,  -7, -10, -14,  -6,  -8,  -1,  -6\n    },\n    {\n         -7,  10,  -5, -10,  -3, -13,  16,  -1,\n        -12,   7,  -3, -12,   2,  13,  13,   2,\n         17,  15, -13,   1,  -5,  -2,   3,  -1,\n          1,  -3,   6,  -3, -12, -16,   7,  -7\n    },\n    {\n        -11,  -5, -12, -30,  -6, -22,   1,   4,\n         -6,  -3,  12,   6,   7,   0,  16,   6,\n         -2,   0, -22,  -2,  -9,   2, -13,   8,\n          6,  -8,   4,  -7,  -1,  -6,   4,   6\n    },\n    {\n        -14,   5,   1, -27,  -4,   2,   1,  14,\n        -11,  -7,  -8,  -4,   1,   8,   0,  -6,\n        -13,  11, -12,  -7,  -5,   1,  10,   7,\n          3,  -2,   0,   6,  -8,   2,  10,  -1\n    },\n    {\n        -10,  10, -25, -13, -20,  -4,  19,   3,\n         13,   5,   5,   7,  -8,   2,   4,   2,\n          3,  -1,  -1,  -9,  14,  10,   9,  14,\n          3,   3,  -6,   0,  -5,   4,   1,  -1\n    },\n    {\n         -9,  15, -18, -17,   4, -11,   6,   7,\n        -12,   8,  -1, -11,   2,   3,   7,  16,\n         -3,  -9,   7, -12,  23,   0,   6,   7,\n        -14,  -9,   8,   1,  -2,   6,  -2,  -1\n    },\n    {\n         -6,   9, -16, -26, -14, -11,   9,  -6,\n          5,  -2,  13,  17,  21,   7,  18, -19,\n          6, -23,  -2, -15,  -2,   2, -10,  -8,\n          2,   1,  -2,   4,  -3,  -4,  -5,  -4\n    },\n    {\n          0,   6,  -5, -28, -17, -32,   2, -10,\n         11,   3,  -5,   9,  10,   3,  11,  11,\n         -3,  12,  -2,   2,   4,  -6,   9,  -4,\n         -4,  -4,  -4,  -9,   2,   0,   2,   4\n    },\n    {\n          0,  -8, -18, -34,  -9,  -7,  -4, -11,\n         10,  15,  11,  -1,  -8,  15,   6, -13,\n          9,   2,  -4, -12,   0,  -1,  19,  12,\n          6,   5,   0,  -3, -10, -12,   3,  -5\n    },\n    {\n        -10,   6,  -9, -17, -12, -11,   9,  -6,\n         11,  11,  18,  -7,   0,  16,   4,   2,\n         -6,   3, -12,  -1,   0,   1,  -5, -22,\n         -2, -12,   0,   6,  17,   5,   5,   6\n    },\n    {\n         12,  -5,   7,   1,  -5,  -2,  -1,   2,\n          2,  -4,  -3,  -3,  -3,  -2, -29,  11,\n          5, -13, -73,  24,  12,   4, -14, -10,\n          5,   1,   0, -11,  -7,  -7,   7,   3\n    },\n    {\n         10,  -3,  -1,  -3,   4, -11,  -5,  -2,\n         -8,   7,   9,   2,  -8,  -6,   6,   7,\n         21,  17, -54,  47, -14, -10,  14,  19,\n         13,  21,  -4,   3,   1,   2,  -4,   2\n    },\n    {\n        -12,   4, -16, -12,   5,  -9,  -4,  19,\n         -7, -22, -22, -17,   3,   0,  -6,   8,\n         23,  -4, -55, -28,   2, -26,   2,   1,\n          4,   0, -13,   6,   0,  10,  -7, -11\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   3,  -1,\n         35,  -1, -67, -35, -24, -24,  -6,   2,\n          2,  -2,   1,   3,   2,   0,  -1,   1\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   1,   0,   5,   0,\n         41,  -4, -73, -15,  18,   4,  17,   8,\n         -1, -16,  -1,  -2,   1,   0,   0,   0\n    },\n    {\n         -4,  -4,   4,   6,  -1,   2, -16, -10,\n        -15, -10,  21,  -2,  -6,  -2,  14,  -7,\n         10,  -5, -55,  34, -12,  11, -13,  -2,\n          2,  28, -26,   0,   7,   4,  21,  -7\n    },\n    {\n          2,   1,  15, -22,  10,  -3,  14,  -6,\n         -2,  15,  -2,  -7,  20,   6, -15,  -7,\n         23,  10, -60,   8,  -4,  29, -22,   2,\n        -13,   9, -10,  12,  -1,  -3,   4,   7\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,  -1,   0,  -1,  -2,  11,  -5,\n        -21, -11, -60, -27, -17, -39,   6,  36,\n          0,  -8,   2,   2,   0,   0,  -2,   3\n    },\n    {\n          2,  -5,   9, -17,  -1,   2,  -3,  -6,\n          8,  12,   7,  -6, -33, -11, -14, -40,\n         10,  36, -46,   0, -19,   5,   0, -10,\n          3,  12,  -6,  -8,   6, -12,  -7,   1\n    },\n    {\n          1,   1,   0,   0,   0,   0,   1,   0,\n          0,   0,  -1,   0,   1,   0,  -2,   0,\n          4,  -2, -87,  -3,  -2,   2,  -2,  20,\n          2,   6,  -1,   6,   0,   0,   2,  -1\n    },\n    {\n          1,   0,   0,   0,   0,  -1,   0,   0,\n          0,   0,   0,   0,  -1,   0,   0,   1,\n          1,   7, -76,  41,  -7, -24,   0,  -6,\n          3,   6,   0,  -2,  -1,   1,   0,   0\n    },\n    {\n          0,  -3,   4,   2,   3,   2,   2,   0,\n          3,  -1,   4,   0,  -1,   4,  -2,  -4,\n        -32, -11, -64, -29,  -9, -43,   2, -11,\n         -1,  -7,   0,  -4,  -2,  -2,  -2,   2\n    },\n    {\n         10, -20,   3,  -3,  13,  13,   0,  -4,\n          2,   7,  -8,   7,  -2,   2, -20, -20,\n        -19,   3, -47, -18, -16,  -6, -15, -42,\n        -17,  14,  -6,   8,  12, -10,  11, -12\n    },\n    {\n         -3,  -2,  -2,  -1,  -1,   4,  -3,  -1,\n         -6,  -2,   3,   2,  -3,   6,  -1,  -9,\n         10,  13, -68,  -9,  26,   3,   5,   3,\n        -21,  10, -15,  21, -22,  19,  11, -14\n    },\n    {\n          1,   5,  18, -19, -29, -13,  -2,  18,\n        -10,  20,   2,  10, -10,  11,   1,   8,\n        -16, -17, -41,  10, -14, -25,   0, -14,\n        -19,  17,   7, -12,  14, -11,  14,   5\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   3,  -1, -43,   5,\n          6, -12, -48,  19,   8, -38,  -8,  -3,\n         22, -21, -10,  15,  20,  -9,  -5,   8\n    },\n    {\n          0,   0,   0,   0,  -1,   1,  -1,   0,\n          0,   0,   0,   0,   0,   0,   6,  -3,\n         22, -14, -71, -24,  -2, -33,  23,   7,\n         -8,   7,  -3,   2,  -4,   1,  -8,  -2\n    },\n    {\n          1,   0,  -1,   2,   0,  -2,   0,   0,\n         -1,   0,   4,   0,  26,  -1,  10, -11,\n        -17, -32, -58,  14, -14, -11,  -2,  15,\n          2,  -8,  12,  10,  -9,  13, -33, -14\n    },\n    {\n         15, -17, -19,   7,  -8, -15, -32, -22,\n          7,  12,  18,   0,   0, -15,  -4,  16,\n         37,  -2, -46,  11,   2,  -8, -10,  -8,\n         14,   9,  -4,   5,   7, -17,   4,   3\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,  -2,   0,\n         -5,   3, -85,  23,  -9, -17,  -2,  -2,\n          0,   0,   0,   0,   0,   0,   0,   0\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,  -2,   0,\n         -5,   3, -85,  23,  -9, -17,  -2,  -2,\n          0,   0,   0,   0,   0,   0,   0,   0\n    },\n    {\n          1,   0,   0,   0,   0,  -1,   0,   0,\n          0,   0,   0,   0,  -1,   0,   0,   1,\n          1,   7, -76,  41,  -7, -24,   0,  -6,\n          3,   6,   0,  -2,  -1,   1,   0,   0\n    },\n    {\n          0,  -3,   4,   2,   3,   2,   2,   0,\n          3,  -1,   4,   0,  -1,   4,  -2,  -4,\n        -32, -11, -64, -29,  -9, -43,   2, -11,\n         -1,  -7,   0,  -4,  -2,  -2,  -2,   2\n    },\n    {\n         10, -20,   3,  -3,  13,  13,   0,  -4,\n          2,   7,  -8,   7,  -2,   2, -20, -20,\n        -19,   3, -47, -18, -16,  -6, -15, -42,\n        -17,  14,  -6,   8,  12, -10,  11, -12\n    },\n    {\n         -3,  -2,  -2,  -1,  -1,   4,  -3,  -1,\n         -6,  -2,   3,   2,  -3,   6,  -1,  -9,\n         10,  13, -68,  -9,  26,   3,   5,   3,\n        -21,  10, -15,  21, -22,  19,  11, -14\n    },\n    {\n          1,   5,  18, -19, -29, -13,  -2,  18,\n        -10,  20,   2,  10, -10,  11,   1,   8,\n        -16, -17, -41,  10, -14, -25,   0, -14,\n        -19,  17,   7, -12,  14, -11,  14,   5\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   3,  -1, -43,   5,\n          6, -12, -48,  19,   8, -38,  -8,  -3,\n         22, -21, -10,  15,  20,  -9,  -5,   8\n    },\n    {\n          0,   0,   0,   0,  -1,   1,  -1,   0,\n          0,   0,   0,   0,   0,   0,   6,  -3,\n         22, -14, -71, -24,  -2, -33,  23,   7,\n         -8,   7,  -3,   2,  -4,   1,  -8,  -2\n    },\n    {\n          1,   0,  -1,   2,   0,  -2,   0,   0,\n         -1,   0,   4,   0,  26,  -1,  10, -11,\n        -17, -32, -58,  14, -14, -11,  -2,  15,\n          2,  -8,  12,  10,  -9,  13, -33, -14\n    },\n    {\n         15, -17, -19,   7,  -8, -15, -32, -22,\n          7,  12,  18,   0,   0, -15,  -4,  16,\n         37,  -2, -46,  11,   2,  -8, -10,  -8,\n         14,   9,  -4,   5,   7, -17,   4,   3\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,  -2,   0,\n         -5,   3, -85,  23,  -9, -17,  -2,  -2,\n          0,   0,   0,   0,   0,   0,   0,   0\n    },\n    {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,  -2,   0,\n         -5,   3, -85,  23,  -9, -17,  -2,  -2,\n          0,   0,   0,   0,   0,   0,   0,   0\n    },\n    {\n         16,  65,  -2,  -2,   4,   3,   0,  -7,\n          3,   1,   3,   1,   0,   5,   1,  -5,\n          0,   2,  -1,   3,   0,   0,  -1,  -2,\n          6,   0,  -2,   0,   0,  -1,   1,   1\n    },\n    {\n          5,  37,  -4,   8,  -4,  -1,   9,  17,\n          6,  -7,   5,  -1,  11,   6,  -4,   7,\n         -2,   4,   1,  -3,  11,   3,   3,  -9,\n          6,   0,  -2,  -4,  -5,   4, -12, -11\n    },\n    {\n         15,  24, -14,   2,   6,  17,  26,   5,\n          8,  11,  -9,  -7,  -6,  -8,   3,  -5,\n          9,  10,  -3,  10,   0,   1,   4,  -9,\n          4,   9,   3,   0,   4,   0,  -5,   3\n    },\n    {\n          9,  36,  -9,  -8,   7,   7,   4,   3,\n         -1, -16,  -2,   7,  -5,  -6,   6,  12,\n        -11, -12,   9,  -1,  -3,  -9,  12,   6,\n         -6,   2,   2,   5,   0,   5,   6,  -6\n    },\n    {\n         25,  39,  -5,  24,   3,  10,   3,  -6,\n         13,  -8,   3,  -7,   2, -10,  -5,   2,\n         -2,   3,   5,  -2,   1,   5,  -2,   3,\n         -4,   1,  -5,  -4,   0,   1,  -2,   0\n    },\n    {\n         16,  27,  -1,   0, -14,   6,   4,  -5,\n          7,  -2,  -6,   0,  -3,  -5,   2,  -1,\n         -1, -19,   5,  -8,   0,  11,  12,   5,\n          0,   3,  10,   6, -14,  14, -13, -15\n    },\n    {\n         12,  23, -14,   2,   1,   4,  -3,  16,\n          7,  -8,   2,  -8,   8,   6,  -8,  -7,\n         -3,   0,   2,   8, -13,   7,  13,  -6,\n         -4,   6, -13, -16,  14,  11,  -7,   5\n    },\n    {\n         16,  28,  -7,  -1,   6,  -3,   9,   0,\n         -7,   3,   0,   3, -12,  20,   8,   9,\n          8,  23,   8, -13,  -2,   4,   9,   3,\n         -5,  13,   5,  -2,  12,  14,   5,  -1\n    },\n    {\n         19,  37,  19,   5,   7,   5,  10,   5,\n         19,  10,  14,   0,   2,   5,   1,  -4,\n         -4,   2,   2,  -5,  -2,  -1,   2,  -6,\n         -4,  -4,  -5,  -3,   2,  -2,  -2,  -2\n    },\n    {\n         24,  21,   1, -11, -10,  17, -14,  14,\n          6,  -1,  -6,  -1,   0, -13,  -1, -12,\n         -2,  -5,   6,  -4, -12,  14,   5,  -2,\n         -8,  -8,  15,  -7, -30, -12,   4,   0\n    },\n    {\n         11,  26,  -3,   3,   5,  -1,  -2,   3,\n         -2,  10,  15,  -4,  10, -28,  10, -17,\n         -8,   1,   2,  -7,  -1,  -6, -15,  -1,\n          4,   5,  -7,   9,   0,  -5,  -4,   4\n    },\n    {\n         18,  32,   1,   2,  -7,   4,  15,   2,\n         -9,  -2,  12, -11,   7,  11,  13,   2,\n          0,   5,   9, -10,  16,   3,  -3,   5,\n         -9, -23,   2,  -2,  -1,   5,   2,  11\n    },\n    {\n         35,  24, -20,   2,   4,  -1,   5,  14,\n        -10,  -9,   8,  -7,   0,   5,  -7,  -7,\n         11,   1,   5,   3,   2,   0,  -2,   3,\n          0,   1,   4,   0,  -2,  -8,   0,  -4\n    },\n    {\n          9,  35,  -1,   2,  -1, -19,  -3,  12,\n         -1,   8,   8, -13,  -1,  -2,   2,   5,\n         -8,  -1,  13,  -2,  11,   1,   0, -10,\n          0,  -3,  -7,   2,   1, -12,   3,  12\n    },\n    {\n         20,  27, -12, -12,   7,   4,  -1, -13,\n         -1,  -9,   2,  13, -11,   5,   7,  -9,\n          9,   1,   1,   8,  -9,   0,  -6,   7,\n          4,   2,  -2,   7,   3,  -2,   1,  -9\n    },\n    {\n          8,  37, -20,  -5,   0, -21,  10,  -8,\n          3,  19,  -9,   7,  -3,  -8,  10,  -2,\n          0,   5,   6,  -4,  -2,  -1,   0,  -7,\n          6,   1,   0,   4,  -5,   6,  -8,   2\n    },\n    {\n          8,  27,   1,  -3,  -5,   1,   6,   0,\n         15,   2,  17,  -1,   3, -17,  10,   5,\n          5,  -6,  -6,   6, -10,  18,  -5,   0,\n          0,  13,   7,  10,  -5,  -6,  -2,  -4\n    },\n    {\n         14,  29, -20,  -4,  -3,   1,  -5,  -1,\n          2,  12, -10,  -3,   4, -18,   4,  14,\n         -4,  -1,  -9,  15,  -2,   2,  -5,  -3,\n          2,   9,  -2, -14,  -3,   4,  -4,  -7\n    },\n    {\n         23,  23, -23, -11,  27,   4,   4,  -1,\n          7,   0,  -5,   9,   2, -11,   3,   7,\n         -2,  -5,   2,  -7,  -7,  13,  -3,  -6,\n          2,   3,   3,  -4,  -1,  -8,   5,  -2\n    },\n    {\n         16,  26,  -6,   8,  -9,  -1,  -2,  -1,\n         -8,   4,  -2,   0, -12,   9,  -1,   0,\n        -17,  -9,  30,  -5, -15, -16, -13,   0,\n         10, -11,  -7,  -3,  -1,   0, -11,  -2\n    },\n    {\n         12,  32,  -4,  -5,  10,  19, -10,   4,\n        -12,   5,  -6,   9, -12,  -6,  -6,  -8,\n          4,   1,   3,   0,   8,   0,  -3,  -4,\n         -7,  -4,  10,   8,   6,   5,  -1,   4\n    },\n    {\n         46,  42,  -3, -14,  -2,  -6,   6,  -2,\n         -5,  -1,  -3,  -3,   1,  -1,   3,   1,\n          1,   4,  -1,   2,   3,   1,  -2,   6,\n          0,  -1,  -2,   4,  -2,  -1,   2,   2\n    },\n    {\n          9,  33, -13,   4, -11,   3,  -8,  22,\n         12,  -2,   4,   0, -16,   5,   4,  -1,\n          7,  -6,  -9,   1,   7,   5,   0,  -5,\n          5,  -1,  10,   3,  -2,  -1,   3,  -2\n    },\n    {\n          9,  30,   6,  -3,   6,   1,  -7,   5,\n         11,  14,   7,   1,   0,   2,   2,  -1,\n          8,   7,  -6, -13, -10,  -2,   1,  -6,\n         10,   7,   6,   5,  -2,  -5,  -1, -16\n    },\n    {\n          9,  28, -11, -10,   9, -10,  15,   8,\n          4,   9,  -4,  -7,   0,  -5,   9,   8,\n         -7,   2, -15, -23,   4,  -4,   4,  16,\n         -8,  -3,   0,  -8,  14,   5,  -3,  15\n    },\n    {\n         17,  26,  -5,  -5,  -1,  -8,  20,  18,\n         -7,  -2,   4,  -7,  -8,  -5,  -4,  16,\n          0,   0,  -7,  -2, -13,  -5,  -2,   3,\n         12,   1,   3,  -5,   2,   2,   0,  -1\n    },\n    {\n         11,  37,   7, -23,   6,  -1,  15,  13,\n          4,  -9,   7,   5,   3,  -3,  -5,  -8,\n         -2,   3,  -5,  -1,  -8,   7,   2,  13,\n          1,   3,   0,  -3,  -1,   2,   0,  -2\n    },\n    {\n         21,  33,   7,  20,  21, -10,   6,  -5,\n         -5,  -6,  -9,   2,  10,   0,   8,  -4,\n         10,   2,  -2,  -2,   0, -10,  -6,  -2,\n          0,  -5,   3, -11,   3,  -9,  -3,   1\n    },\n    {\n          6,  30, -15,  -8,  16,   1,   4,   6,\n          4,   5,   8,  -3,   8,  -9,  -1,  -6,\n          8,   2,  -2,   4,  -2,   5,  11, -21,\n          3, -10,  16, -11,  24,  10,  14,  -6\n    },\n    {\n         15,  36,  -3,  -9, -20,  12,   0,  -7,\n        -18,  -4,  -8,  -9,   9,  -7,  -3,  -1,\n          2,   7,  -5,  -8,   6,   2,   2,  -1,\n          7,   1,   1,  -3,   3,  -4,  -8,   1\n    },\n    {\n         16,  34,  21,   3,  -9,  10,   7,   9,\n         -7,   1,  -4,  -9,  -4,  -5,  -5,   3,\n          3, -19,   1,   5,   4,  -2,  -6,  -5,\n        -10, -11,  -8,  -2,   2,  -5,  -8,  -7\n    },\n    {\n         28,  29,  -3,  18,  -2,   0,  -6,  12,\n         -2,  10, -11,  -4, -13, -12,  -6,  -4,\n          0,   4,  -1,  -8,   6,   4,  12,  11,\n         10,  10,  -3,  -6,   1,   2,   1,   7\n    },\n    {\n          3,   8,  22,  -8,   3,  36,  -8,  -1,\n          9,   6, -13, -14,   8,  -1,   1,   2,\n         -2,  -8,   0,   3,   1,   2,  -1,   5,\n         -1,  -8,   0,  -2,   2,   2,  -1,   1\n    },\n    {\n          0,   6,   0,   0,   4,  13,  -7, -16,\n         -6,  15, -14, -21,  -9, -10, -10,  -6,\n        -21,   5,   4,   2,  12,   4,  12,  11,\n         -4,  -6,  -6, -10,  -7, -18,   1,   4\n    },\n    {\n         -1,   3,  10,   1,  -1,  15,   4,  -7,\n        -16,   3,   0, -22,  10,   2,  -3,  -2,\n         13,   5,  -8,  16,  -5,   4,   0, -11,\n        -10, -22,   0,  -4, -17,   5,   2,   1\n    },\n    {\n         12,   8,  -4,  -9,  14,  40, -21,   0,\n          1, -15, -10, -12,  12,   6, -10,   2,\n          8,   6, -12, -10, -11,   1,   0, -11,\n          2,   1,  13,   0,   6,   3,   8,   4\n    },\n    {\n        -10,   3,   5,  -4,  -3,   3,   0,  -9,\n          2,   8, -22, -23,  17,   8, -17,  -3,\n         14,  -8,  -4,   1,  -8,   3,   0,   5,\n         -1,  -3,  -2,  -4,   1, -10,   0,  -2\n    },\n    {\n          0,  -1,   5,  -7,   4,  12,  -2,   0,\n         -7,   2, -16, -15,  12,  21,  -7,  -4,\n          7,  -7, -11, -15,  -7,  -9,  -5,  -8,\n          0,  -6,   8,  -3,  -8,  22,  -7,  -9\n    },\n    {\n          7,  19,   4,  -9,  24,  22,   2,  -6,\n          8,  13, -14, -20,  -4,  11,   8,  -4,\n         -1,   2,   0,  -7,   5, -17,  -3,   3,\n         -6,   5,   3,   4,  -5,  -7,  -3,  14\n    },\n    {\n         -2,   6,   2,   8,  -2,   5,  -4,  -2,\n        -10,   3, -45, -30,  -3,  -3, -12,  -4,\n         -3,  -3,  -1,   9,  -6,  -6,   5,  -4,\n          0,   5,  -1,  -2,  -1,   0,  -6,  -1\n    },\n    {\n         -3,  14, -16, -10,  10,   0,  -2, -40,\n         -9,  12,   2, -19,  15,  -4,   4,   3,\n          3,  -4,   7,   1,  -4,  -5,   0,   4,\n         -1,   0,  -9,  -2,  -4,  -1,  -2,   0\n    },\n    {\n          7,  16,   2,  -7,   8,   2,   0,   1,\n          5,  21, -10, -26,   7,   2,  -9,  -7,\n         -3, -16,   8,   5,   5,  -6,  10,   4,\n        -14,  -6,   5,   3,  -2,  -2,  -4,   1\n    },\n    {\n         -9,  14,  -1,   3,   3,  11,   1,  -5,\n         -3,  13, -16, -18,  20,   6,  -5,   0,\n         -3,   2,   8,   4, -19,  -9,  12,   0,\n         -8,   2,   2,   1,   6,  13,  -7, -11\n    },\n    {\n          2,   5,  16,  -4,  19,  15,   4,   0,\n        -11,   7, -10, -10, -16,  18, -11, -12,\n         -9,  -4,   7,  -4,  -4, -17,   1,   1,\n         -8,  -3,  -3,   5,  -2,  -6, -11,  -5\n    },\n    {\n          2,  12,   0,  -9, -10,  14,   6,   2,\n         -3,   2, -12, -28,  12,   1,  -1,   2,\n          0,  -3,  -4,   7,  16,   5,  -7,   8,\n         -4,  -3,  -1,   3, -12,   4, -17,  -5\n    },\n    {\n         -4,   7,  11,   6,   1,  14,  -4,  -6,\n          5,   5,  -6, -24,  23,  -9, -15,  13,\n         -7,  -9, -15,  10,  -1,   8,  -5,   1,\n         12,   6,   2,   0,   4,  -2,   9, -10\n    },\n    {\n          1,   5,  11,   3,   6,  12,  -3,   8,\n        -21,   5,  -7, -20,  12,  -2,  -9,  -3,\n         17,  -7,  -8,  -9, -14,   3, -13,  18,\n         -8,   9,   2,  -8,   4,  -8,  -5,  -2\n    },\n    {\n         -3,  -3,  -1,   5,  -2,  15,   3,   2,\n          1,  -8,   1, -39,  -6,  13, -13,   0,\n         -2,  -5,  -6,  -3,   0,  -5,  -2,  15,\n         -9,   5,  -3,  -6,  -2,   7,   0, -13\n    },\n    {\n          2,   8,   5, -12, -13,  22,   8, -16,\n         11,   5,  -2, -32,  -2,  -4,  11,   5,\n          5,  -6,   1,   3,   1,   5,   3,   6,\n         -5,   4,   4,  -8,   8,   4,   1,   3\n    },\n    {\n         13,   9,   5,  -4,   9,  18, -11,   2,\n         -1,  15, -10, -19,  -2,  14,   0, -10,\n          1,   1, -18,   3,   2,  -6,  -8,  20,\n          7,  -8,  16,   9,   9, -13,  -3,  -2\n    },\n    {\n        -13,  11,  11,  -9, -10,  13,  -3, -18,\n          2,  10,   5, -21,   6,  15, -11, -21,\n          3,  14,   0, -12,   9,  -1,  -2,  -4,\n          3,  -3,  -9,  -8,  -5,  -2,  -8,   2\n    },\n    {\n          3,   3,  11,   4,   0,  13,   1,  -8,\n         10,  13,  -6, -26,   2,  12,  -3,  -5,\n         12,  -2,   1,   8,  -7, -17, -19,   5,\n         10,   7,  -3,   2,  -3,   0,   5,   0\n    },\n    {\n          5,   0,   3,  -3,  -9,   5, -15,  -5,\n         -5,  17,  -5, -31,   0,  13,  13,   5,\n         -1,  -6, -14,   7,  -8,   9, -14,  -2,\n        -16,  -4,  -4,  -6,   6,  -6, -10,   6\n    },\n    {\n         13,   3,   1,   7,  -3,   4,  -1,  -2,\n         -1,   4,  -8, -32,  -1,  -4,   0,   3,\n        -10,   7,  10, -10,   4,  -1,   6,   2,\n        -16,  -9,   4,   3,  13, -23,  -3,  -4\n    },\n    {\n          4,  11,  -4,  -9,   4,  11, -12, -12,\n        -12,   6,   1, -28,  -3,  14,  18,  -2,\n        -12,   7,  15,  -3,  -5,  -7,  -3,   2,\n         -6,   4,   4,  -2,  -5,  -3,   2, -13\n    },\n    {\n          8,   7,  -7,   0,  13,   7,  -8,  -7,\n          8,  36, -10, -22,   3,  23,  -3, -10,\n         -3,  11,   1,  -7,   3,   3,  -1,  -7,\n         -4,   2,   3,   2,   5,   3,  -4,  -1\n    },\n    {\n         -1,   1,  13,   1,  -6,  -1,  -6,  -9,\n        -18,  17,  -5, -37,  -1,  -1,  -6,  -4,\n          1,  -6, -15,   2,  17,  -9,   0,  -3,\n          0,   4,   0,  -5,   0,   4,   1,  -5\n    },\n    {\n          0,  14,   5,   0,  -7,   2,  -6,  17,\n         -6,  -9,   7, -16,  -5,  23, -14, -13,\n          8, -15,  11,  10, -11, -13, -33,  -5,\n         -2,   1,   6,   8,   0, -13,  -9,   5\n    },\n    {\n         11,   7,  -2,  -8,   9,  11,  25, -14,\n          7,   3,  -1, -33,  14,   8,  -6, -19,\n          3,   3,   2,  -1,  -3,  -1,  -2, -10,\n         -3,   1,   2,   1,   4,   2,  -3,   4\n    },\n    {\n         -2,   8,   4,  -2,   9,  13,  -4,  -2,\n        -15,  -3,  19, -37,   9,  25,  -9,   2,\n         -5,  -2,  -2,  -4,   4,   2,   2,   0,\n          3,   3,   3,   5,  -2,  -3,  -4,  -3\n    },\n    {\n         10,  13,  -1, -15,   4,   6, -18,  -4,\n         25,   1, -23, -17,  15,  13,  -8,  -8,\n          7,   4,  -5,   3,   6,   9,  -7,   6,\n          0,  -5,   8,   0,  -6,  -1,  -2,  -2\n    },\n    {\n          1,   3,   9,  -5,  27,  15,  -9, -31,\n         -1,  23,  -2,  -9,   1,   8,  -1,  -7,\n         -2,  -8,  -4,  -4,  -2,  -1,   3,   5,\n          0,   0,  -1,   1,  -7,   7,  -3,  -3\n    },\n    {\n         -8,   7,   3,  -6,   8,   3, -11,  -2,\n         36,  14,   1, -30,   6,  10, -12,  -6,\n         -6,  -2,  -4,  -3,  -5,   0,   9,   4,\n         -5,  -5,  -8,  12,   4,  -3,   1,  -8\n    },\n    {\n         -2,   9,  33,   0,  12,  -3,  -7,  -4,\n         -4,  -1,   6, -25,  11,  -6,  -9, -11,\n         -2,  -4,  -2,   6,  -1,  -3,  -6,  15,\n         -6,   3,  10,  -4,   1,   0,   5,   8\n    },\n    {\n        -22, -21,  -9, -19,  -5,  -7, -12, -15,\n         -8,   9, -19,  14,  -7,  -4,   5,  -8,\n         -2,   7,   1,  -3,   4,  -4,   6,  11,\n          2,   6,  -3,  -5,   2,  -2,   0,  -3\n    },\n    {\n        -32, -13,   3, -24,   3,  -8,   4,   1,\n        -10,  14, -15,   0,   4,   6,  -1,   6,\n          7,  -1,   6,   4,  -3, -17,   1,   4,\n         -6,  -1,   1,   0,   3,   3,  -7,  -4\n    },\n    {\n        -32, -11,   7,  -8, -12,  13,  -5, -22,\n         -4,  12, -16,   2,   0,   4,   0,   1,\n          0,   6,  -5,  -8,   2,   6,   5,   0,\n         -3,  -6,   5,   6,   5,   5,  13,  -4\n    },\n    {\n        -44, -33,   6,  -4,   2,   0,  -9,  10,\n          3,   4,   7,   0,  -1,   7,   5,   1,\n          1,  -3,   1,   6,  -1,   0,   2,   3,\n         -4,   0,   0,   1,   0,  -1,  -2,  -1\n    },\n    {\n        -30, -18, -24,  -8,   5,   0,  -2,  14,\n          7,   0,   1,  12,   6,   4,  -9,   7,\n          5,   7, -11,  -5,   1,  -8,  -1,   2,\n          2,  -9,   7,  -1,   7,   5,   6,   6\n    },\n    {\n        -22, -20, -13,  -9,  20,  -3,  10,  -8,\n          6,  -4,   2,  -7,  10,   8,   0,  -1,\n          2,  -3,   6, -19,   2,   4,   3,   3,\n         -7,   2,  -1,  -6,   1,   1,   6,  -2\n    },\n    {\n        -27,  -8,  -1,   3,  -1, -11,  24,   4,\n         -1,   1,  -8,   8,   5, -11,  15,  -3,\n        -15,  -1,  -1, -13,  -1,   1,  -5,   5,\n          2,   3,  -9,   0,   4,   3,  -7,   6\n    },\n    {\n        -33, -16,  -1,  -8,  10, -23,   6,  13,\n         -1,  -3,  -9,   0,   5,  -7,  -5, -12,\n         -2,   3,   3,   6,  -2,  -3,   2,  -3,\n          9,  -6,  -3,  -2,   0,   5,  -3,  -4\n    },\n    {\n        -22, -17,  11,  -3,   3,   1,  -1,  -5,\n         17,   2, -15,  -2,  10,  -9,   6,  14,\n        -16, -12,  20,  -1,  -7,   6,  -3, -12,\n          1,  10, -10,  -1,   7,  -3,  -1,  10\n    },\n    {\n        -28, -13,   1,  -3,  -1,  -1,   0,   3,\n          3,   5,   1,  10, -10,  -3,   7,   2,\n          4,  19,  -1,  -1,  10,   5,  -8,   1,\n         11, -15,  -4,  -3,  -5,   4, -13,   3\n    },\n    {\n        -22, -13,  42, -20,   5, -13,   7, -11,\n          1,   1,  -1,   1,   6,   3,   6, -11,\n          3,   3,  -2,   0,  -4,   4,  -3,  -1,\n         -5,   2,   0,   0,  -9,  -1,   4,   4\n    },\n    {\n        -26, -15,  -2,  -6,  -4,  -2,  16,   8,\n         21,   8,   1,  -3, -10,   7,  -8, -12,\n         -5,  12,  -9,   3,  -2,  -3,  18,   1,\n        -12, -15,  -4,   5,  -3,   0,  12,   7\n    },\n    {\n        -26, -16,   5,   6,  14,  -3,  15,   6,\n          1,  -7, -13,  16, -15,   5,  11,  -2,\n          9,  -7,  -4,  -2,   0,   0,  -2,   7,\n         -8,  -6,  -5,   2,   7,  -3,   2,  12\n    },\n    {\n        -31, -17,  -8, -30,   4,  14,   6,  -6,\n          6, -11,   0,   3,  -4,   0,   0,  -4,\n          0,  -4,   1,   4,   3,   4,   0,  -5,\n          3,   2,   2,   0,   2,   1,   3,   5\n    },\n    {\n        -61, -10,   4,  10,   4,   7,   0,  -3,\n          0,   1,   0,  -3,   0,   1,   0,  -2,\n         -1,   1,   2,  -2,   4,  -3,   1,   1,\n         -1,   1,  -2,  -4,  -4,   4,   0,   0\n    },\n    {\n        -28, -13,  -8,  -4,   3,  -3,   2,   1,\n         11,  14,   3,   9,   1,  13,   3,   5,\n         -3,  -2,  -2, -12, -14,  -9, -11, -15,\n        -12,  -5,  -4, -12,   3,  -3,   0,  -5\n    },\n    {\n        -41,   0,  12, -24,  13,   4,   5,  16,\n         -5,  -4,   0,   0,  13,  -4,   1,  -9,\n          9,  -6,  -1,   6,  -2,   5,   2,   9,\n          6,  -9,  -8,   8,  -2,  -3,  -6,  -4\n    },\n    {\n        -26, -19,  -2, -15,   4, -14,   6,   0,\n         26,  20,   8,   9,   9,   3,  -4,  -5,\n         -8,   1,   0,  -1,   5,   9,   3,   4,\n          4,   7,   1,   3,  -2,  -2, -10,   0\n    },\n    {\n        -29, -18,   9,  -4,   1,  -5, -14, -12,\n          5, -10,  -5,   4,  -5,   0,  -1,  -1,\n          4,  -5,   7, -16, -11,   2,   7, -15,\n          2,  -4,   6,  -4,  -6,   7,  -3,   7\n    },\n    {\n        -27, -16,   9, -14,   3,  -8,   9,   0,\n          7,  -4,  -3,  -7,   0, -10,  -1,   2,\n          1,  -2,  15, -10,  14,   7,   6,  17,\n          3,  -4,   3, -10,   8,  -8,   3,  11\n    },\n    {\n        -21, -20,  -8,  -8,   4,   5,  -3,  -2,\n          0,  -5,  14, -10,  11,  -4,  13,   0,\n          5, -11,  19, -18,  18,   3,  -5,  -3,\n         -4,  -8,  11, -10,  10,   3,   4,  -9\n    },\n    {\n        -35, -15,  13, -12,   4,   0,  -2,  -4,\n        -12,  -3,  -8, -24,  -7,   1,   7,   8,\n         -3,   0,  -2,  -1,   3,  -2,  -2,  -6,\n          8,   1,   0,   1,  -6,  -1,   2,  -6\n    },\n    {\n        -19, -14,  13, -10,   9,  -1,   1,   3,\n        -12,   5, -16,   7,  13,   9,   4,  -4,\n          6,  -5,   4,   9,  -3,  17,  -4,  12,\n        -11,  -6,  -5,  -6,  13,   2,   7,  -9\n    },\n    {\n        -34,  -8,  -4,   1,   2,  -1,   3,   6,\n        -20, -11,   8,  -1,   4,   2,  -9,   4,\n         -4,  -5,  16,  10,  -4,  14, -13,   1,\n         -6,   0,   2, -10,   0,  -3,  -3,   7\n    },\n    {\n        -36, -10,  -8,  -3,   2,  -2,  14,  -4,\n         -1,  -7,  -4,  10,  -1,  -3,  15, -11,\n          0,   2,   3,  -1,   4,   0,   8,  -1,\n          0,  18, -11,  -5,  15,  -5,  13, -12\n    },\n    {\n        -22, -13,  14, -20,  15,  25,  16,  10,\n          8,  -2, -10,  -5,  -1,  -8,  11,   8,\n         -1,  -2,  -4,   1,   2,  -1,  -7,   0,\n          0,   0,  -3,   0,   2,  -1,   0,   2\n    },\n    {\n        -31, -22,   7,   6,  -2,   5, -20,  14,\n         -6,   7,   0,  14,   3,  -7,   3,  -6,\n         -2,   1,  -3,  -5,   1, -10,   1, -24,\n          6,  -2,   3,  -7,   1,  -7,   8,   7\n    },\n    {\n        -25, -20,  -3,  -9,  10,   6,  12,   7,\n          5,   4,  -3,   6,  -1,  -5,  -6,  -8,\n          3,   5,   6,   5, -10,  10,  -4, -15,\n        -15,  -2,  -9,   2,  18,   1,   8,  12\n    },\n    {\n        -24, -19,  -2,  -4,  -7,  11,   6,   9,\n         16,   2,  -7,  18,   6,  -7,   6,   6,\n         -2,  -9,   3,  12,  -2,   3,  -1,   6,\n          7,   8,   0,   8, -11,   8,   4,   2\n    },\n    {\n        -26, -20, -12, -12,  -2,  -3,   1,  -5,\n         -1,  -2,   0,   3,   7,   9,  -2,   2,\n          9,  22,  13,   4,  -4,  -1,  -2, -14,\n          5,  15,  -8,  -5,  -7, -11, -14,  -6\n    },\n    {\n        -21, -18,  -1,  -4,   0,   3,   7,  -2,\n         10,   8,  -8,  -1,  15,   1,  -9,   3,\n          1,   3,  -5,  -2,   2,   4,   0,  -1,\n         10,   2, -19,  -8,   8,  30,  -7,   8\n    },\n    {\n        -25,  -6,  26,   4,  -8,   4,  -2,  21,\n          5,  -4, -16,   5,  13,   4, -10,  -1,\n         -6,  -2,   2, -10, -13,   1,   3,  -3,\n         -6,  -8,   2,  11,   1,  -7,   0,   5\n    },\n    {\n          0,  -1,  -2,  19, -12, -48,  -6,  11,\n          8,  -2,  -4,  -2,  -7,   5,  -3,   2,\n         -2,  -1,  -1,  -7,   0,  -3,  -3,  -4,\n         -4,   4,   1,   3,  -3,  -1,  -2,  -5\n    },\n    {\n        -11,  -8, -28,  18,  16, -24,  -8,  19,\n          4,   8, -12,   9,  -4,  -2,   4,  -7,\n          6,   2,   3,   3,  -4,   0,   1,  -6,\n         -4,  -2,   2,   6,   0,  -3,   1, -16\n    },\n    {\n         -9,  -5, -26,   7,  -3, -37, -16,  -2,\n          2,  -7,   4, -13,   0,  -4,  -6,  -5,\n         -6,  -4,   0,   3,   4,  -3,  -4,  -4,\n          4,  -3,   9,  -4,  -2,   2,   7,  -4\n    },\n    {\n          2,   9, -18,   7,  29, -24,  -1,   7,\n         14,  10,   3,  -3,  -2,  -5,   6, -10,\n         -6,  -3,  -8,   0,   5,   1,   4,   3,\n        -12,   2,   6,   1,   3,   4,   1,  -3\n    },\n    {\n        -20,   2,   8,  20,  -9, -24,  -4,  18,\n          3,  11,  -1, -11,   6,   9,  -1,  -3,\n          1,  -1, -15,   3,  15,   9,   3,   2,\n        -13,   2,  -8,   8,   1,  -1,   1,  -8\n    },\n    {\n        -12,   5, -11,   6,  19, -26, -17,  -6,\n          4,  14,   6,  -8,   9,   5,  -6,  -5,\n          2,  -1,  20,   1, -11, -10, -18,  20,\n         -7,   0,  -3,   4,   2,   0,  10,   4\n    },\n    {\n        -15,   1,  -2,  13,  -8, -21, -22,   4,\n          4,   3,   3,  -7, -31,   4, -10, -14,\n          0,   8,   4,   5,   8,  11,   2,  -8,\n          6,   7,   0,  -2,   6,   8,   8,   7\n    },\n    {\n        -13, -10,  -9,  12,  19, -16,  -3,  -2,\n          9,   2,  11, -29,  -1,   9,   4,  -3,\n          1, -10, -10,  16,   1,   7,  -7,  -6,\n         -4,  -1,  -5,   3,   6,   0,   3,   1\n    },\n    {\n        -17,  -1,  -5,  19,  12,  -9, -21,  -5,\n          2,  12,  -7,  -7,  -3,   8,   7,  -2,\n          6,  -9,  -9,   1,  -4,   1,   1,   3,\n        -14,   2,  -8,   0,  10,   1, -12,  -6\n    },\n    {\n        -13,  -5,   8,  15,   0, -20,  -2,  20,\n          8,  -8,   8, -19,  12,  10,   2, -11,\n          0,  12,   1, -11,   0, -11, -15,   5,\n        -11,   2,   4,  -4, -11,   5,  -4,  -5\n    },\n    {\n          3, -11,  -7,   8,   0, -17, -26,  15,\n         19,  -7,  10,  -9,  -5,  -5,  14, -25,\n          0,  -8,   2,  -9,  -3,   9,   1,  -6,\n          4,  -4,   3,  -9,  -1,   6,   2,   2\n    },\n    {\n        -12,   5,   5,   9,  14, -18, -19,   4,\n          2,  16,  14, -21, -15,  -9,  -1,  16,\n         12, -11, -10,  -5,  -7,   4,  15,  -8,\n         -5,  -1,   1,  14,  13,  -7,  -1,  -4\n    },\n    {\n        -10,  -5,  -1,   8,   7, -23, -10,  14,\n          6,  11,  10, -16,  -3,  16,   6,   0,\n          0,   9,   6,  -2,  -7,   1,  22,   5,\n          3,  -8,   0,   3,  -2, -10,   3,   0\n    },\n    {\n         -2, -14,   2,  16,  15, -17, -17,   6,\n         19,   4, -10, -15,  -1,  15,  11, -14,\n         -8,   5,   8,   8,  -2,  -8, -11,  10,\n         10,  -8, -14,   2,  13,   4,  -2, -12\n    },\n    {\n        -10,   3,   6,   4,  19, -23, -19,   1,\n          4,  -9, -30,   3,  -6,  18,   0,   2,\n          0, -11,   0,   3,   7,  -2,   8,   5,\n          2,  -3,   6,  -9,   1,  -4,   7,  -6\n    },\n    {\n          9,   5,  -2,  21,  20, -33, -13,   7,\n        -10,   8,   8, -15,  -6,  -4,   1,   5,\n          3,   7,  -2,  -9,  -1,   4,  -6,   1,\n          0,   9,  -1,  -5,   2,   1,  -3,   3\n    },\n    {\n         -9,  -3,   3,  15,  -3, -30,  -7,  -7,\n        -25,   6,   2,  -6,   1,  19,   1, -12,\n          1,  -8, -13,   9,  13,   1,   8,   2,\n          5,  15,  -2,   3,  -9,   0,  -4,   4\n    },\n    {\n         -6, -12, -17,  25,  22, -13, -10,   9,\n          2,  11,  -7, -16,   4,   6,   1,   0,\n          0,  18,  -4,  -5,   4,  -2,  -1,  -5,\n          0,  -4,   6,   1,   6,  -1,   7,   0\n    },\n    {\n         -1,   0, -10,   8,   8, -27,   0,  -2,\n         29,  16,  -2,  -4,   9,  -1,   2,   0,\n          6,  10,   6,   4,   2,  -7,   9, -18,\n          3,   3,   3, -10,  17,  10,   9,  -6\n    },\n    {\n         -3, -12,  -6,  11,  20, -32,   5,  21,\n          3,  -4,  -9,   2, -10,   1,   7,  -4,\n          5,   0,   0,  -1,  -8,  -9,  -7,   4,\n        -10,   5,   0,   2,  -5,   4,   9,   1\n    },\n    {\n         -5,  -1,  -5,   1,   2, -19, -13,   1,\n          6,  12,   2, -16, -17,  11,  10,  13,\n         16, -12, -11,   3,  -6,   0,   6,   4,\n         -3,   1,   8,   2,   5, -11,   3, -14\n    },\n    {\n        -19,   5,  10,  11,   2, -23,  -9,  16,\n         -2,   7,   0, -11,  -7,  10,   6,  -7,\n         26, -15,  -4,   8,   6,  -4,   7,  -9,\n        -15,   1,   8,  -4,   4,   2, -12,  16\n    },\n    {\n        -11,   1,  11,  -4,   1, -31, -13,  -1,\n          8,   5,   4,  -2,   0,  13,   7, -17,\n          7, -10,  -6,   1,   4,  -1,   2,  -9,\n         -4,   9,   3,   3,  -4,  -5,   3,   4\n    },\n    {\n         -3,   1,  10,  -1,   0, -15, -22,   4,\n         40, -11,  -4,  -3, -14,   9,  11,  -1,\n          9,  -1,  -6,   6,   3,  -6,   0,   0,\n        -12,   7,  -2,   0,   9,   3,   1,   3\n    },\n    {\n         -1,  -1,  -1,  14,   8, -24, -14,  -8,\n          5,   8,   5, -12, -17,   8,   2,   7,\n         10,  -8,   0,   4,  -6,  -6, -10,   8,\n          4, -12,   3,  -9, -12,   5,   4,  -3\n    },\n    {\n         -5,   1, -11,   8,   9, -24,   0,   2,\n          2,  14, -12, -13,   1,   6,   7,   0,\n          7,  -6,   9,  26,  11, -14,   8,  10,\n          1,   9,   0,  11,  -2,   6,   2, -10\n    },\n    {\n        -13,   1,   4,  34,  19, -17, -15,   0,\n          3,  -2,  -7,  -1,   0,  -3,  -3,  -1,\n          1,  -1, -10,   8,   5,   0,  -8,   4,\n        -17,   9,  -2,   0,   0,   6,   2,  -3\n    },\n    {\n         -6,  -4,   1,   2,   2, -14, -29,   0,\n          9,  34,  -3,  -5, -14,   6, -10,  -9,\n         -5,  -1,   0,   3,   3,   0,   1,  -1,\n         -2,  -1,  -1,  -3,  -3,  -4,   3,  -3\n    },\n    {\n         -4,   6,   3,  14,  14,  -8, -29,  31,\n         11,  14,  -4,  -5,  -6,  10,   6,  -9,\n         -1, -11,  -7,   1,   7,   4,   1,  -6,\n          4,   0,  10,  -7,  -5,  -1,   2,   4\n    },\n    {\n         -4,  -4,  -2,  14,   6, -32,  -6, -14,\n         14,  -5, -11,  10, -18,  -4,   6,  -8,\n          9,   5,  -4,   1,  -4,   5,  -2,  -9,\n          3,   5,   2, -10,  -6, -17,   3,  17\n    },\n    {\n        -16,   9,  21,  19,   4, -20, -17,  14,\n          9,  15,  -6, -17,  -1,   1,   6,  -3,\n          1,   1,   8,  -3,  -6,   6,   9,   4,\n          9,  -9,  -5,   1,  -1,   0,  -1,   2\n    },\n    {\n         -7,  -5,   3,  19,   1, -20,  -9,  14,\n         21,  -7, -18,  -9,  26,  -7, -17,  -7,\n         12,   6,   0,  -9,  -6,  14,   9,  -9,\n         -8,   4,  15,  -7,  -9,  -1,   9,   1\n    },\n    {\n        -20,  30,  -6,  11,  24,  -4,   0,  -6,\n         -2,   8,  -4,  12,  -8, -17,   0,   5,\n         -4,   1,  -1,   3,  -3,   5,   3,   3,\n          7,  -2,  -3,  -2,   4,   0,   0,  -1\n    },\n    {\n        -35,  17,   6,   1,  -9,  -1, -16,   3,\n        -20, -13,   8,   7,  -4,  -7,  -4, -20,\n          7,  12,  -5,   5,  -5, -11,  12,  -1,\n         15,  -9,  -6,  16,  -4,  -9, -13,   4\n    },\n    {\n        -21,  36, -19,   9,   0,  -7,  -8,   9,\n         -4,  -3,   3,   0,   7,  -8,  -2,  -2,\n        -11,  13,  -1,   5,  -3,   7,   2,   3,\n         -1,  -2,  -5,   1,  -1,  -2,  -5,  -3\n    },\n    {\n        -12,  33,  -4,   1, -12,  -9,   0, -13,\n         -1,   2,  -8,   4, -10,   6, -16,  -7,\n         -1,  -4, -10,  15,  -1,   0,  -5,  -8,\n          5,   5,  -3,   0,   2,  -7,   1,  -7\n    },\n    {\n        -14,  32,   5,  -7, -15,   3,  -5,   8,\n         14,   5,   9,  13,   3,  18,  -3,   7,\n          4, -10, -10,  10,  -1,   2,   0,  -2,\n        -11,   5,  -3,  -4,   2,   2,   7,   4\n    },\n    {\n        -14,  34,   1,  20,  -1, -12,   0,  -3,\n         -7,  -4,   7,  18,   9,  -3,  14,  -7,\n         -9, -20,  -7,  -4, -13,  12,   1,  12,\n          5,  -6,   2,  -4,   0, -15,   1,   3\n    },\n    {\n        -21,  23,   7,  -8,   3, -13,  -3,   0,\n         -6,  -2,  -7,   6, -12,   9,  -6,  -2,\n         -2,  -4,  -1,   6,   9,   5,  -9,  15,\n          0,   8,  -8,   7,   6, -15,   3,  -5\n    },\n    {\n        -27,  32,  -1,  -4,  -2,   4, -10,  12,\n         -3,   8,  13,   7,   0, -15,   4,  -2,\n          3,   5,   7,  -4,   9, -12,  -1,  -2,\n         -1,  -4,   0,  -4,   2,  -5,   6,  -6\n    },\n    {\n        -17,  29,  15,   0,  -1,  -4, -10,  13,\n         12,  -1,  -8, -10, -10,   4,   7,  -2,\n          6,  -5, -13,  19,   6,   1,  -7,   2,\n         -9,  -2,  12,  -4,  -8,  -3,   2,   4\n    },\n    {\n        -38,  27,  16, -15,  -6,   3,  -7,  -4,\n          0,  -1,   6,  -2,  -3,  -6,   6,  -6,\n         -3,   0,   2,   0,  -4,   6,   1,  -1,\n          0,   4,  -1,   3,   4,   1,  -2,   5\n    },\n    {\n        -33,  40,  -4,   2,   1,   0,   0, -10,\n        -14,   0,  -7,   4,  -1,   3,  -2,   5,\n          7,   6,  -1,   4,   1,   3,   1,  -7,\n          1,  -4,   5,   7,   0,   4,   3,  -4\n    },\n    {\n        -20,  25,  12,  -4,  16,  -4,   2,   2,\n        -14,  -2,  -3,  29,  -1,   1,   3,   1,\n          9,  -5,   2,  -8,  -3,   1,  -7,  -2,\n         -7,   1,   0,   4,  16,  -2,  -1,  -1\n    },\n    {\n        -10,  30,  17,   3,  -5,  -2,   0,  -5,\n        -22,   4,   5,   5,  -3, -18,  -6,  10,\n         -5,  -7,   2,   8,   7,  -7, -11,  -2,\n          0,  -3,   3,   2,  11,  -4,   4,  -4\n    },\n    {\n        -11,  30,  11,   4,  -3,  -8,   1,  -2,\n          4,  18,   3,   1,  -1,   0,  -8,  -4,\n         -3,  10,  13,  14,   5,  -5,   1,   1,\n        -10,   2,  15,   4,   9,  -1,  -5,  -3\n    },\n    {\n        -17,  32,  18, -18,  -3,  -5,   6,  10,\n          1, -15,  -5,   9,   8, -12, -10,  -6,\n         11,   9,  -5,  -8,  -7,  10,   5, -10,\n        -14,  -4,  -3,   1,   9, -11,   2,   1\n    },\n    {\n        -13,  28, -11,  -1,   2, -16,  -2,   7,\n        -24,   0,   3,   6,   3,  -1,  -8,  -7,\n        -12,   2,   2, -20,  10,   4,   0, -13,\n         -2,  -2,   1,   8, -14,   0,   4,   1\n    },\n    {\n        -14,  23,  12,   8,   8, -26,   2,  -4,\n        -14,  13, -14,  15,   3,  -9,  -1, -13,\n        -10,  -2, -10,   6, -16,  12,   8,   0,\n          9, -10,  -7,  -4,  -4,   7,  -8,   8\n    },\n    {\n        -20,  45,  10, -14,   4,  16,   8,  -9,\n          1,  -8,  10,   5,  -7,  -2,   2,  -5,\n         -1,   0,  -5,   4,  -6,  -2,   4,   1,\n          3,   4,  -4,   2,  -2,  -2,   5,   1\n    },\n    {\n        -20,  26,  -4,   1,   7,   4,  -8,   1,\n         -5, -13,   2,  13,  -7,  -3,   6,  -6,\n         22,   0,   5,  11,  -4, -11,   8,  -9,\n          2,  -2,  -4,  -2,   2, -13,  -4,  -8\n    },\n    {\n        -28,  18,  17,   3,  -8, -23, -16,  -6,\n          5, -10,  14,  10,   5,  -1,  -8,   4,\n         -2,  13,  -3,  -2,   3,   4,   3,  -2,\n         -3,  -4,   0,   1,   3,   4,   0,   4\n    },\n    {\n        -12,  32,  -6, -16,  18,  12, -16,   0,\n          7,  13,  -4,   5,  -8,  -1,  -3,   4,\n          6,  -2,  -1, -13,   4,  -1,   3,  12,\n         -3, -10,   1,   6,   8, -11,  -2,   4\n    },\n    {\n        -18,  26,   2,   5,   0,  -9, -17,  14,\n          5,   1,   7,  -3,  -8,  -3,  11,   7,\n         -5, -12,  -8,   7,   0,  -7,   2, -12,\n         -9,  13, -11,   9,   6, -11,  -5,  11\n    },\n    {\n        -24,  22, -15,  -9,   8,   1,  -7, -12,\n         -9,   3,  11,  15,  14, -11,  12, -15,\n         -5,   7,  -2,   0,  -8,   3,   3,  -1,\n          2,  11, -11,  14,  -6,  13,   1,  -6\n    },\n    {\n        -20,  28,  18,  -4,  -6,  -5,  12,  14,\n          2,  10, -13,  -6,  -8,  -6, -13,  -1,\n        -26,  22,  -3, -14,   6,   0,  10, -15,\n        -13,  -9,   6,  -7,   1,  -5,  -4,  -1\n    },\n    {\n        -19,  26,  -8,  -3, -14,  -6,  -9,  -4,\n         -8,  15,  -8,   3, -12,  -4,  -2,  -7,\n         -5,   3,  13,  -3,  -4, -25,   4,  -1,\n          5, -12,  -1, -13,   5,   2,   0,   6\n    },\n    {\n        -18,  43,  14,  -8,   1, -23,  -2,  -2,\n          1,   3,  -7,   0,   0,   8,  -1,  -3,\n         -5,   1,   5,   2,   0,  -2,  -2,  -2,\n          1,  -1,  -1,  -7,   0,   3,  -3,   9\n    },\n    {\n        -11,  30,  10, -14,   3,   1,  10, -11,\n          1,  -7,  -4,  14,   2,   1,  -9,   1,\n        -11,  -2,  -7,   5, -11,   1,   3,  14,\n          1, -16,  -8,   3,  -5,   7,  -4,   4\n    },\n    {\n        -18,  24,   6,   3,   8,   7, -22,  -7,\n         -7,   3,  -8,   4,  23,   9,   3,  -1,\n          3,   6,   7,  -1,  -7,   6,   4,   1,\n         -3,   1,  -6,  -1,   2,  -7,   3,   3\n    },\n    {\n        -15,  38,  -7,  -1, -11,   2, -17, -24,\n         24,   8,   7,  -4,  -5,   2,   2,  -7,\n          1,   4,   0,  -9,   5,   0,  -1,   1,\n         -1,  -5,  -6,   3,   0,   7,   8,  -3\n    },\n    {\n        -14,  22,   1,  -5,   9, -12,  -9,  -5,\n         -6,   5,   7,   8,  -1,  -4,  -9,  -3,\n        -33, -16,  -9,  -1,  12, -11,  17,  -7,\n         -3,  -1,  -7,   3,   2,  -3,  16,  -4\n    },\n    {\n        -14,  20,   6,   4, -10,  -4,  -4,  -4,\n          1,  -7,   2,   6,   8, -12,   4,   1,\n         -1,  12,  10,   3, -14, -10,  -3,  18,\n         -2,  33,  -5, -17,  17,  -5,   9,   7\n    },\n    {\n        -12,  23,  13,   0, -11,  -8, -11,  12,\n         -5,  -9, -16,  11,   6,   4,  12,  -5,\n          5, -13,   7, -12,  -3,   1,   2,  12,\n          1,  -4,  -1,   5,   4,  11, -12,  -3\n    },\n    {\n         15,   2,  14,   7,   1,   2,   1,  12,\n         10,  23,   4,   6, -20, -10,   4,  26,\n         -6,  13,   4,   3,   2, -11,   5,  -7,\n        -10,   4,   9,   1,  10,  -4,  11,   4\n    },\n    {\n         17,  15,  31,  17,  18,  16,  11,  24,\n          2,   4,   2,   3,  -8,  -3,   7,  -3,\n         -5,  -7,  -2,  -6,  -4,  -5,  -4,  -1,\n         -4,  -2,  -5,  -6,   2,  -1,   4,  -2\n    },\n    {\n         16,   8,  15,  14,   3,   7,  21,   9,\n          8,  15,  21,   6,   8,  12,   5,  -5,\n          7,  -3,  10,   2,  -3,   8,   6,   0,\n          5,   5,   6,  -3,   2,   4,   0,  -5\n    },\n    {\n          5,  -4,   6,  12,   6,  13,  24,  17,\n         -5,  17,  -1,  -6,  -7, -10,  -8, -18,\n          3,  -2,   2,   7, -15, -11,  12,  -3,\n         -2,  -2,  -4,  -7,   2,   0,   5,   5\n    },\n    {\n         10,  -6,   8,  11,  12,  20,  22, -11,\n         -3,  15,  -3,  15,  -2,  -2,   0,   2,\n          5,  -8,   4,  -5,  -9,  -4,  -1,   2,\n         -1,  -3,   1,   3,  13,  -1,   9,   7\n    },\n    {\n         -5,   8,   5,  11,  14,  -5,  14,  -9,\n          2,  35,   8,  15,   1,  -2,   2,  -2,\n          4,  -9,  -3, -14, -12,  -2,  -2,  -4,\n         -2,  -8,  -3,   1,  -6,   3,  10,   0\n    },\n    {\n         16,   0,  -6,  15,  -3,   4,   4,   3,\n          3,  20,   5,  -4,  10,   9,  -9,  -3,\n        -10,  -2,  -7,  11, -11, -10,  17,  -1,\n          3, -15,   2,   9, -15, -10,  16,  10\n    },\n    {\n         14,   4,  -7,  19,   3,   0,  19,   8,\n         16,  34,  -9,   6, -13,  -1,   6,   5,\n         -1,  -2,   4,   3,   2,   1,   1,  -1,\n          0,  -7,   2,  -1,   1,   0,   6,  -1\n    },\n    {\n          1,   6,   9,  13,   9,  10,  15,  16,\n         10,  18,  13,  17,   3,  -1,  -7,   2,\n        -15, -11, -10,  -4, -13,  -6, -17, -13,\n         -6, -14,   1, -10,   6,   4,  -1,  -1\n    },\n    {\n         13,   1,   7,  10,  14,  13,  -7,   5,\n          5,  28,  14,  14,  -2,   2,   3,  -3,\n        -13,  -4,  10,  -9,  19,  -4,  -3,   4,\n         -5,  -5,   0,   5,  -5,   0,   3,  -4\n    },\n    {\n          1,   0,   6,  22,   9,  18,  18,  -3,\n          5,  10,  12,  -2,   1,  -3,  -8, -12,\n          9, -10,  -7,   1,  -1,  19,   0,   2,\n         -8, -11, -10,   9,   6,  11,   0,   3\n    },\n    {\n         10,  11,  19,  44,   0,  14,   1,  -7,\n          6,  22,   2,  -1,   9,   2,   0,  -4,\n          4,   0,  -6,  -6,   3,   0,   0,  -2,\n          2,  -5,   1,  -2,   0,   1,   1,   1\n    },\n    {\n          5,   7,   0,  32,  30,  26,   5,   4,\n         -7,  -3,  15,  -6,   3, -10,   7,   6,\n         -8,  -7,   2, -13,  -5,  -1,  -3,   7,\n          3,  -2,  -8,   0,   6,   4,   5,   0\n    },\n    {\n          9,   8,  -2,   4,   2,  11,   4,  29,\n         -5,  14,   8,  -5, -14,   8,   0,   9,\n          8, -10,   5, -15,  -6,  -9,   9,  -1,\n         18, -16,   9, -21,  -3, -13,  -2,   8\n    },\n    {\n         25,   7,  -9,  23,  20,  18,   6,  16,\n         -9,   8,   8,  -5,  11,  13,  -8,   7,\n          4,  10,  -2,  -1,  -7,  -9,  -7,  -9,\n         -4,   1,   1,  -5, -10,   8,   4,  -5\n    },\n    {\n          9,   2,  16,  14,  -5,  14,   1,   0,\n        -21,  17,  -1,   9,  12,  -3,  -3,   4,\n         -4,  14,  10,   3,   0, -10,   7,   4,\n          4, -11,   2,   4,  -1,  -3,   9,  -1\n    },\n    {\n         17,   8,  11,  26,  15,  -3,  14,  -1,\n         12,   9,  10,  -8,   8, -18, -11,  -3,\n        -14,  -7,   7,  -3,  -3,  -4,   1,  -7,\n         -3,   2,  -3,  16,  10,   0,   9,   6\n    },\n    {\n          9,   8,   3,   8,  18,  14,  11,   1,\n         10,   6,   1,  -4, -16,  -2,  14,  -2,\n          1,   8,  12,  14,   3,  -3,   8,   8,\n         12, -15,   3,  -3,   3,  -2,  14,  10\n    },\n    {\n         22,  -3, -11,  13,  -7,  11,   4,  11,\n          3,  14,   0,  -6,  -2,  -9,   4,   2,\n         -2,   0,  -5, -27, -10,   3,  -1,   5,\n          8, -24,  -3, -11,  -3,   2,  11,  -1\n    },\n    {\n         19,   2,   8,  36,   5,  -6,   3,  15,\n         -3,  -4,  -5,  14, -10,   1, -12, -10,\n         -3,  -4,   3,  -2,   1,  -8,   4,   3,\n          5,  -3,   0,   4,   8,  -2,   8,   4\n    },\n    {\n          8,  14,  15,   9,  -4,  10,   5,  11,\n          9,  10,   8,   9, -15,  15,   6,  -8,\n        -10, -13,   5,  -8, -20, -13,  -6, -11,\n         -1,  -3,  -6,  -4,  -1,   0,  13,  15\n    },\n    {\n         -2,  -1,   9,  12,   2,   2,  13,   3,\n        -23,  33,  15,   2,  -4,  -1,   3,   8,\n          8,   6,   6,  -7,   8,   6,   9,  -1,\n          3,  -8,   0,  -4,   1,  -8,  11,  -1\n    },\n    {\n          6,   5,  -6,  16,   2,  -3,  31,  21,\n         -9,  12,   0,  -1,  -4,   1, -12,   3,\n        -13, -18,   2, -11,  -9,   2,  -8,  -6,\n         11,  -3,  -1,   0,  -1,   0,  13,   5\n    },\n    {\n          5,  -1,   2,   0,  25,   5,  10,  16,\n         -5,  21,  14,  12,  13,   2,  -5,   5,\n          5,  -3,  -2, -14,   0, -12,   7,  11,\n         -1,  -7,  19,  -1,  -1,  -1,   8,  -1\n    },\n    {\n         10,   7,   3,  11,   0,   8,  22,   3,\n          3,  19,  -4,  12,  15,   9,   5,  15,\n          2,   1,   2, -10, -10,   0,   2,  -1,\n          0,   1, -12,  -1,  21,  16,   9,  -7\n    },\n    {\n         11,  -4,  -5,  24,  -7,  11,  20,  11,\n        -15,  18,   5, -13, -15,   0,  -5,   9,\n          1,   0,  -1,  -9,   4,  -8,   6,  -8,\n          1,  -2,  -7,  20,   9,   3,   9,   3\n    },\n    {\n         20,   0, -12,  -6,   9,  31,   9,  12,\n          8,  27,  15,   7, -16,   5,  -3,  -7,\n         -1,  -9,  -2,  -7,  -3,   4,  -8,  -3,\n          3,  -6,  -2,  -2,  -3,  -6,  -1,   2\n    },\n    {\n          6,  -6,  48,   8,  -3,  19,  12,  11,\n         -7,   2,   3,   0,  -1,   1,   8,  -4,\n          4,  -6,   0,  -4,  -4,  -3,   3,   6,\n          3, -13,  -8,   5,  -3,  -7,   8,   5\n    },\n    {\n          7,  -2,   6,  11,  12,   2,  14,   4,\n         -5,  12,   2,   9,   4,   2,   0,  -1,\n          2,   0, -15,  -9, -16,  -2,   8, -17,\n         -5, -22, -19,  -5,  -1, -10,   1,  -2\n    },\n    {\n         11,  -9,   3,  12,   6,   6,   1,  17,\n         -6,  19,  14,   7,  -7,  -1,  -1,  -9,\n          9, -11, -17,   0,  -6,  16,   0,   1,\n          9, -24,   3,   3,  -9,  -3,   3,  -2\n    },\n    {\n          9,   0,   1,   8,   1,   7,   2,  -5,\n         -3,   8,  -1,   7,   2,   6,  -3,  -6,\n          5,  -2,   6,  -2,  -4,  -3,   0,  -3,\n         13, -50,   1,  -2,   2,   4,   4,   3\n    },\n    {\n          7,   0,  26,  21,  -4,   2,  17,   8,\n          7,  11,  -7,   1,  -1, -15,  -1, -15,\n        -11,  -4, -17,  -4,   1,  -7,   3,   6,\n          3,  -9,   2,   3,   6,  10,   6,  12\n    },\n    {\n          1,  -2,   2,  -1, -10,  -4,   6,  -3,\n         -5,  -2,  -8,   2,   2,   2,   8,   0,\n          1,   1,   6,   0,  11,  13,   3,   4,\n          0, -12,  11,  -5,  19,  20,   2,   5\n    },\n    {\n          5,   3, -13,  -2,   1, -12,  11,  -7,\n        -12,   7,  10,   0,   7,   0,  -2,   4,\n         -6,  -9, -11, -12, -23,  12,  10,  -3,\n          0,   6,  19,  -1,  24,  18,   9,  12\n    },\n    {\n          6,  -3,   2,   5,   2,   2,  -2,  -5,\n         -8, -11,  -4,   3,  -8,  -4,   5,  -3,\n        -16,  -4,   3, -12,  -4,   3,  32,   7,\n          2,   8,  32, -18,  -1,  12,   1,   7\n    },\n    {\n          0,  -8,  -1,   0,  -8,   7,  -8,  -1,\n         -1,   4, -12,  -1,   3,   0,   1, -18,\n          8,   8, -14, -10, -11,  19,   9,   5,\n         -7,   6,   8,  -4,  26,  12,  -1,   6\n    },\n    {\n          3,   5, -14,   7,  14,   8,  20, -13,\n        -16, -10,  -2,  17,  -7,   4,  -8,  -9,\n         14,  -5,   3,  -4, -12,   7,  14, -10,\n        -19, -20,  35,   8,  13,  14,  -2,   9\n    },\n    {\n         -2,  -4,  -1,   1,  -3,   0,  -1,   1,\n          2,   2,   6,   0,   0,   4,   5,  -2,\n          3,   3,   3,  -2,  -7,  -3,  -3,  -1,\n          6,  -2,  29,  22,  13,  34,   0,  14\n    },\n    {\n         -3,  -9,   3,   1,   5,  -4,   2,   0,\n          7,  -9,   0,   2,  -5,  -3,   0,   6,\n         -1,  -1,  -1,   2,   2,   4,   8,   7,\n         20,  -6,   7,  16,  33,  20,   6,  -1\n    },\n    {\n        -11,   1,  -3,  -3, -11,   3,  -9, -25,\n         -1, -16,   4,  -8,  15,   1,  -2,   7,\n          8,  23,   2,  18, -13,  16,   3,  -7,\n          6,   3,  16,  -8,  12,  16,   3,   4\n    },\n    {\n          0,   5,   5,  -5,   1,  -1,   2,  -3,\n         -2,   1, -13,   2,   2,  10,   6,   7,\n         18,  18,   7,   9,   8,   9,  21,  14,\n          7,  12,  15,  14,  15,  12,  11,   5\n    },\n    {\n          1,  -5,  11,  -2,  17,   8,   3,   0,\n         -1,   6,  11,  -7,   6,   6,   7,   5,\n        -15,  14,   1,  11,   4,  10,  12,   1,\n          2,   4,  30,   1,  11,   1,   6,  13\n    },\n    {\n          2,   4,   3,  -7,   5,   8, -11,   7,\n         -5,   9, -10,   6,   8, -10,  -3,  10,\n          1, -29,  -4, -26,   5,  -8,  13,   4,\n          3,   6,  35,   1,   3,   6,   3,   0\n    },\n    {\n         -2,   1,   0,   0,  -1,  -3,  -7,  -3,\n         -9,  -3,  -1,  -6,   3,   4,   4,   0,\n          5,  -1,  -2,  -2,  -1,  -4, -10,   8,\n          0,  -6,  10,  -4,  46,  12,   2,  28\n    },\n    {\n          4,  -1,   4,   1,   0,   4,  -2,  -2,\n         -2,  -1,   2,  -4,   1,   5,   0,  -3,\n          1,   1,  -2,   0,   1,  -2,  -1,  -1,\n          3,  -6,  35, -11,  13,  53,  -3,  -1\n    },\n    {\n         -5,  -2,   0, -13, -16,   5, -12, -11,\n          1, -30,   3, -18, -24,  -8,  -5, -19,\n          1,  -3,  -8,   7,  -7,  -8,  15, -19,\n          4,  10,  30,  24,   6,   1,  -9,  10\n    },\n    {\n         -4,   8,  -7,  -4,  -6,  12,  -1,  -9,\n         -4,   2,  -9,   3,   2,  -2,   4,   2,\n         22,   9,   4,  -5,   0,   5,  -2,  -9,\n         -3,   1,  18, -12,  18,  16,   4,  16\n    },\n    {\n         -5,  -8,  -3,  -5,  -3,   6,  -7,  -3,\n         -2,  -5,  -3,   1,   2,   2,   4,  -6,\n         10,   3,  12,  -3,  20,   0,  27,  -4,\n         16,   5,  18,  -3,  23,   4,  12,  11\n    },\n    {\n          0,   1,   0,   1,  -2,   1,   2,   1,\n         -1,   0,  -2,   2,  -2,  -4,   1,  -2,\n         -2,  -1,  -5,  -2,   0,   0,  -2,   2,\n          9,   7,  63,   5,  12,  -1,   1,   0\n    },\n    {\n          4,  -3,  -7,  -5, -11,  -5, -12, -10,\n        -10, -12, -15, -12, -14, -14,   1,   1,\n         10, -10,  16,   6,   2,   9,  11,   9,\n          9,   8,  12,  -1,  13,  12,   6,   3\n    },\n    {\n          7,  -3,  -2,   4,   6,  -8,   2,  -3,\n        -12,  -5,  -9,  -8, -10,  15,  -2,  -4,\n          8,   9,   7, -13, -18,  34,  -5,   7,\n         12,  22,  16, -11,  13,  25, -15, -11\n    },\n    {\n         -3,  -2,   0,  -4,   1,   0,  -3, -13,\n         -7,  13,  12,  -7, -10,  13,  19,   6,\n         16,  15, -12, -15,  -3,  34,   1,   5,\n          1,  -9,  11,  21,   8,  17,  -5,  -6\n    },\n    {\n          3,  -5,   0,  -4,   0,   4, -11,   4,\n         -7,  -3,  -1,  -8,   3,  -2,   2,   1,\n         11,   5,   6,  14,  -3,   2,  -4,  -7,\n          0,  31,  15,  -2,  24,  11,   5,   4\n    },\n    {\n         -1,  -4,  -9,   5,  -8, -18,  -4,  -9,\n        -20, -18,   7, -14, -16,   3,   8,  -3,\n         29,  11, -13, -13,   7,   1,  17,   6,\n          6,  21,  11,   1,  14,  -8,   2,   5\n    },\n    {\n         -3,   8, -10,  -6,  12,   2,   1,   3,\n          3,   3,   3,  -6,  -8, -14,  15,  -5,\n         16,   4,  16,   0,   7,  -1,   0,  16,\n          2,   1,  22,   4,  19,  13, -11,   1\n    },\n    {\n          2,  -3,  10,  20,  -4,  -1,  -8,   5,\n         -8,  -9,  -6,  -2,  -4,  -7,   8, -10,\n          0,   8,  -6,   1,  -8,  14,  13,   5,\n         17,  -6,  26,  -1,   7,  -1,   0,  12\n    },\n    {\n         -4,  -7, -31,  -2,  -7,  -1,   5,  -5,\n         -5, -12,   4,  -7,  -6,   3,  15,  -2,\n          5,  -2,   7,  -1,  10,   7,   8,  -1,\n         14,  20,  14,   9,  16,  16,   8,  24\n    },\n    {\n         -7,   0,  -3,  -6,   1,   3, -13,  -6,\n         -4,  -4,  -5,  -9,  -1, -10,  -4,  -8,\n          2,   0,  -1,   1,  24,  24,  21,  31,\n          5,   2,  11,  12,   7,   4,   3,   6\n    },\n    {\n         -3,  -5,   6,  -4,  -3,  -1,   2,  -1,\n         -2,   1,   0,  -8,  -1,   2,   0,  -4,\n          6,  22,  -1,  -5,   8,  12,  -1,  -2,\n         28,  27,  20, -27,  14,   1,   2,  -3\n    },\n    {\n          1,  -5,  -2,  -2,   6,  -2,   9,   1,\n         -2,  -5,   3,   4,  11,   5,   2,   8,\n         -3,  -1,   1,  -2,  -3,  -5,   5,   8,\n         49,  12,   8,  -3,   9,  20,  12,  17\n    },\n    {\n         -6,   0,   1,   7,   0,   9,  -2,  -4,\n          8,   0,  -2, -10,   0,   7,  21,  -1,\n          0,   1,  17,  -7,  -5,   2,   4,  16,\n         -2,  17,  14, -20,  15,  14,   4,  15\n    },\n    {\n          0,   3,  -4,   9,  -4,   0,   6,   4,\n         -6,  -6,  -5,  -7,   2,  -9, -10,  -2,\n         -5,   0,  -3, -21,   9,  14, -11,  13,\n         29,   2,  25,   4,  22,  -1,   2,  -3\n    },\n    {\n          2,  12, -11,   2,  16,   9,  -4,   7,\n          1, -10, -15,  11,  -4,   3,  -2,   4,\n          4,  -5, -10,   1,   4,  19, -15,   6,\n         -4,  -2,  30,  -7,  11,  21, -12,   5\n    },\n    {\n         -2,  -3,  -2,   4,  -1,  -5,  -3,  -7,\n         -5,   1,   0,  -6,   1,  -6,   7,   0,\n          8,  -7,  -3,  -2,   2,  14,   2,  -3,\n        -26,  -1,  26,  22,  32,   1,  -2,   6\n    },\n    {\n          1, -38,  -1, -20,  -2,  -3,  -6,  -4,\n          2,   2,   7,   0,   3,   5,   3,  10,\n          6,   1,  -3,  -5,   7,   5,  -5,  -4,\n          8,   3,   1, -14,  -1,  -9,  -5,  -4\n    },\n    {\n         -5, -26,  -7, -19, -10,  -5, -11,   5,\n        -11, -25,  -8, -14,  -9, -16,  -8,  -6,\n        -17, -14,  -1,  -1,   6,   2,   2,   2,\n          3,   0,   2,   8,  -8,   3,   0,  -3\n    },\n    {\n         17, -49,  -3, -23,  -1,  11,   7,   3,\n          4,  -4,   0,   0,  -1,   4,   2,   4,\n         -2,  -4,   2,  -2,  -1,  -2,   2,   0,\n          0,  -1,   0,   0,   1,   2,   0,   0\n    },\n    {\n          4, -34,  -6,  -9,   1,  21,  -7,   3,\n         -2,  -1,  -3,  18,   2, -16,   7,  -3,\n          8,   7,  -5,   7,   2,   4,   8,  -6,\n         -7,  -2,  -5,  -1,   4,   1,   2,  -4\n    },\n    {\n          5, -29,  13,  -2, -14,   3,   1,  18,\n        -15,   4,  -8,   8, -10,   8,   2,   1,\n         -8,  15,   3, -10,  -4,  -4,  -2,   0,\n         -3,  -4,   2,  -3,  -4,  -3,  12,  -6\n    },\n    {\n         13, -20,   3, -18, -17,   4, -14,  13,\n         28,  11,  -8,  -6,  16,   6,   0,  10,\n          3,   4,  -9,  13,   5,  -7,  12,  -5,\n          0,  -7,   5,   1,   3,   3,   2,   1\n    },\n    {\n          3, -27,  -5, -11, -21, -11, -12,   0,\n         -5,   7, -22,   1,   3,   5,   0,  -5,\n          8,   7,   1,  -5,  -7,   2,  -5,   4,\n          1,   3,  -8,  -2,   0,   4,  -2,   6\n    },\n    {\n         31, -45,   0,  -1, -12,   1,   2,  -6,\n          4,   3,  -1,   3,   3,   0,   5,   3,\n         -5,  12,   4,   6,   2,   1,  -2,   1,\n          3,   2,   5,   2,   2,   2,   3,  -1\n    },\n    {\n          9, -45,   6,   5,  -1, -17,  -2,  18,\n         -3,   2,   0,   1,   0,  -1,  10,   8,\n         -7,  -2,  -5,  -8,   6,  -1,   0,   4,\n          6,  -3,  12,  -1,  -2,   0,   5,  -7\n    },\n    {\n          3, -26,  -2, -12, -12,   2, -10,  16,\n         -3,  12,   4,   5,  11,   8, -16, -17,\n         -2,  -3,  -3,   2,   5,  -9,  13,   1,\n         10,  11,   3,   5,  -2,   2,   2,  -7\n    },\n    {\n          8, -26,  32,  -7,  -5,  22,   2,  14,\n        -10,  -8,  -7,   3,   3,   7,   0,  -5,\n          0,  -1,  -3,   0,   8,   4,  -5,  -7,\n          6,  -1,   4,   8,   1,   1,   7,  -6\n    },\n    {\n          4, -31,   2, -14,   2,   0,   1,   8,\n         -6,  -1,  17,  -3,  13,  -6,   5, -10,\n         -2, -10,  -2, -10,  -3,   7,   1,   5,\n         -8,   8, -14,  -3, -15,   7, -10,  -6\n    },\n    {\n         16, -27,  13,  -4, -23,   7,  -9,   6,\n         -7,   5,   4,   2,  -1,  -3,  23, -18,\n          7,   0,  -3,   4,  -3,   9,  -6,  -2,\n         -1,   8,  -6,   2,   6,  -3,   2,  -2\n    },\n    {\n         -1, -35,  -2,  -8,  11,  -1,  -7,  -3,\n         -2,  11,   7,   6,  -6, -10,   9,   6,\n         -3,  -5,  -6,  -3,   9,  16, -16,  -9,\n        -20,  12,   3,   5,  -3,   1,  -9,   4\n    },\n    {\n          2, -24,   1, -12, -16,   5,  -4,   3,\n         -4,  -1, -11, -11,  -8, -14,  14,  10,\n         -8,  20,   8,  -3, -11,   1,   1,  -4,\n         -4,  -7,  -3,  15,   2,  -6,  -2,   7\n    },\n    {\n          9, -21,   2, -19,  -7,  -5,  -8,  25,\n          3,  17,   5,  -3,   9, -12,   8,   2,\n         -4,   3,   3,   1,  11,  -9,  -4,  -3,\n          4,   3, -22,   6,   4,   6,  11,  -5\n    },\n    {\n         16, -23,  13, -17, -21, -12,   5,   9,\n        -20,   7,   6,  -6,   0,   2,  -9,   6,\n         -6, -13,  -7,  -1,   5,  -3,   5,  -7,\n        -10,   1,   0,   8,  -9,  11,   0,  -8\n    },\n    {\n         10, -26,  -9,  -7, -19,  -4,   6,  16,\n         -7,   5,  -4,   4,   8,   0,   4,  -1,\n          6,  -7,   1,  -8, -11,  10, -14,   0,\n        -16,   6,  -3,   5,  -1,  14,  12,   1\n    },\n    {\n          8, -27,  12, -14,  -1,  -1, -19,  10,\n        -11,  21, -14,   9,  -8,  -3,   8,  -1,\n         12, -13,   3,  -4,  -2,   0,  -9,   0,\n         -7,   2,  -3,  12,   1,  -3,   3,   1\n    },\n    {\n         18, -20, -14, -14, -16,  -3, -24,   6,\n        -17,   2,  -3, -11,   2,  -3,  12,  10,\n         10,   1,  10,   7,   8,   5,   5,   4,\n         -1,   7,   2,   2,   0,   4,   7,   0\n    },\n    {\n          0, -30,   9, -16, -18,  15,  12,  -3,\n          4,  -4,  -5, -11,  -4, -12, -10,   0,\n          2,  -2,  -4,  -1,   2,   0,  -1,  -6,\n          2,  -3,   4,  -5,   7,   3,   5,   7\n    },\n    {\n         25, -24,  -1,  -6,  -9,   6, -13,  -2,\n          3,  15,  -3,  11,   4,  -8, -11,   2,\n          0,  -9,  -2,   7,   4,   8,   5,  -8,\n          5,   6,  -1, -11, -15,  -5,   0,  11\n    },\n    {\n          0, -34,  -7, -11,  -7,   9,  -3,  19,\n          4,  -8,   3, -11,  11,  -3,  -9,  12,\n          9,   9,   2,   1,  -7,   1,  -3,   0,\n         -6,  -2,  -1,   3,   0,  -7,  -2,  -5\n    },\n    {\n          6, -34,  -4,  -5,  -3,  -9,   2,   9,\n         -1,   9,  -5,  -3, -26, -12,   8,  -6,\n         -7,  11,  -8,   4,   4,   1,  -1,   0,\n          8,   9,  -4,   7,  -1,   1,  -3,  -1\n    },\n    {\n          3, -30,   5,   6, -10,   3,  -7,   6,\n          3,   3, -26, -19,  -3,   1,   7,   5,\n         -4,  -5,   6,  10,  13, -10,   4,  -7,\n         -4,   5,  -3,   9,  -6,   3,   9,   5\n    },\n    {\n          4, -24,   9, -19,   2,  -4,  -5,   8,\n         -3,   2,   0, -15,  -1,   9,  -4,  22,\n          6,   9,   3,   7,  11,  -9,   0,  -3,\n          4,   5,  -5,  10,  -8,   5,  -7,  -3\n    },\n    {\n          8, -27,   7,  -3,  -1,   2,  -9,  13,\n          7,  12,  -4,  -6,  -6,   5,   0,   7,\n          5,   1,  15,  -3,  -4,   0,  -5,  -2,\n          7,  -5,  -7,   1,  -2,  13,  -8,  13\n    },\n    {\n         17, -22, -15, -11,  -8,  16, -14,  18,\n          2,  -1,  14,  -7,  14,  -6,  -6,  -7,\n         -8,  17,   6,   4,   4,  -7,  -5,  -9,\n        -14,  -6,  -1,   9,  -3,   1,   6,  -5\n    },\n    {\n         25, -30,   2, -12, -13,  18, -18,  16,\n          8,  -3,  10,  -8,  -3,  -1,  -6,   3,\n         -5,  -7,   4,   6,   7,   1,   1, -11,\n         -5,   6,   2,  -4,   9,  -1,  -5,  -2\n    },\n    {\n          7, -23,   7, -15,  -1,  -3,  -1,   0,\n        -10,  12,   2,   5,  -4,   0,   4,   6,\n         -1,   5,  -9,  -1,  -1,  -7,   1,  17,\n          9, -17, -16,   8,   4, -14,  11,  14\n    },\n    {\n          0, -31,   7, -13,   3, -11,  -7,   6,\n          1, -11,   8,  -7,  15,  -3,  16, -11,\n         -1, -15,  16,  -3,   5,   0,  -2,  -2,\n         -6,  11,   5,   6,   5,  -5,   6,   3\n    },\n    {\n         13, -24,  -2, -20, -10,   7,  -3,  -1,\n         15,   2,   6,  -5,  -7, -10, -20,   1,\n         -4,  14,   8,  -2,   3, -13,  -3,   1,\n         -4,   1,  -3,   2,   8,  -7,  16,  -4\n    },\n    {\n          1,  -2,  -2,  -3,  -4,  -7,   0,   3,\n          6,   7,   3,   2,   1,  -2,  -1,   0,\n         -6,   4,   2,  -4,  -3,  -4,   5,   9,\n          5,   0,  -3,  -3,  -4,  -7, -31, -50\n    },\n    {\n         -1,  -3,   7,   2,  -1,   2,   4,   6,\n          0,  10,  -2,   0, -20,  -6,  -3,   9,\n        -20, -22,  -1,  -1,  15,   9, -12,  10,\n        -13, -20,  12,   3,   5,   6,  -7, -26\n    },\n    {\n          0,   4,  -2, -14, -12,   6, -13,  11,\n        -10,   3,  22,   6,  16,  -2,  -5,   1,\n         -3, -11,   0,  -7,   5,  -5,   0,   1,\n         -1,  -6,   8,   8,  10,   9,  -5, -27\n    },\n    {\n         -5,  10,  -2,   7,   9,  -9,   5,  -9,\n          5,   4, -15,  14,   1,   3, -10,   5,\n          0,  -2,   7,   3, -13,   6,   9,  -6,\n          5, -14, -17,  -1,  11,  14,  -2, -26\n    },\n    {\n          0,   6,  -3,   0,  -8,   6,   0,   1,\n          4,  -8,   2,  -5,   4,   7,  15,  11,\n          9,  19,  -2,  14,  -8,   7,  -1,   3,\n         -3,  -3, -10,  -2,  12,  -2, -12, -29\n    },\n    {\n        -12,  -5,   0,  -3,  -2,   6,   3,  -3,\n          2,  -2,   1,  11,   2,  -7,   5,   1,\n          2,  -2, -14,   0,  -1,  -5,   3,   8,\n        -28, -26,   6,  -6,   3,   8, -10, -27\n    },\n    {\n         -1,  -3,   6,   2,   4,  15,   1,   0,\n          2,  -2,  -2,  13,   3,   6,   0,   6,\n         -1,  -4,  -1,  -5,   8,  -1,   5,  -5,\n        -15,  11,  -8,  -5,  14,  -6, -14, -29\n    },\n    {\n         -5,  -6,   0,   1,   0,   6,  -3,   2,\n         -5,  -1,   5,  -3,   2, -10,   3,   4,\n          3,   0,  13,  -3,  -1,   4,  -4,  -6,\n          2,   9,   8,   2,  -3,  28, -11, -31\n    },\n    {\n          1,  -4, -10,  -9,  -4,  -3, -15,  -6,\n          1,   5,  -3,  -6,   5,  -6, -22,  27,\n        -13,   5,   3,  -7,  -4,  20,  -7, -12,\n         -1, -24,  -4, -13,  -8, -11, -15, -21\n    },\n    {\n         -6,  -4,  19,  -6,   2,  11,  -6,   1,\n         -3, -10,   9,  -9,  12, -10,   2,   1,\n         -9,   1,  15,   7,  -5,   5, -29, -35,\n          4, -30,   9,   9,  19,  17,   2, -17\n    },\n    {\n         -3,   3,  -3,   1,   2,   5,  -1,   5,\n         -2,  -3,   1,  -3,  -8,   3,  -4,  -2,\n         -4,  -1,  12,   0,   2,  -8,  -6,  -4,\n         16,  -1, -14,  -2,  25,  -6, -15, -36\n    },\n    {\n          0,  -1,   3,  -4,  -4,  -1,   7,  -4,\n          8,   0,  10,   9,  -4,   1,  10,  -1,\n         -3, -13,  -5,  -4,  -1,  -4,   8,  11,\n         14,  -7,  -5,  16,  12,  13,  -1, -28\n    },\n    {\n          1,  -2,   2,  -3,  -8,  10,   4,   9,\n         12,   3,   5,   0,   8,  -3,  -6,   2,\n         16, -11,  11,   0,   1,   6,   1,  18,\n        -10, -16,  -1,  -4,   5, -14, -15, -20\n    },\n    {\n          1, -12,   5,   4,  -7,   8,  -1, -17,\n         -2,  -9, -14, -11,   6,  -9,   5,  -4,\n          3,  -2,   7,  18,  -5,   5,   6,  -1,\n        -11,  -2, -10,  -3,   8,  -3,  -2, -32\n    },\n    {\n        -12,   5,  20,  -5,  -6, -11,  -6,  -6,\n        -13,   4,  -6,  19,  -8,   2,   3,  -9,\n         -4,  -4,  -1,   9,  -1,  21,  -1,   7,\n         15, -10,  -1,  -3,   9,  -3,   2, -24\n    },\n    {\n          0,  -3,   2,  -6,   4,  -1,  -9,  -2,\n         -1,  -3,   6,  -1,  -5,  -6,  -5,  -8,\n          0,  -2,  -6,   9,  -4,   3,   2, -13,\n          1,  -7,  23, -13,   4,  -3, -15, -33\n    },\n    {\n         -7,   2, -15,  11, -10,  14,   0, -11,\n          3,  -1,  12,  -4,  -4,   9,  11, -13,\n        -13,  -3, -14,   1,   3,   6,  -5,   8,\n          0,   5,   5, -10,   4,   5,  -6, -30\n    },\n    {\n         -6,   4,   0,  -5,   4,   1,  -1,  -1,\n          3,   6,   5,  -2,  -5,   0,  -2,   5,\n         -4,  -2,  -4,  -2,   4,   7,  -7,  -1,\n          1,  -4,  -3, -19,  37,  12,  10, -40\n    },\n    {\n         -7,   2,  -7, -12,  17,  11,  -7,   2,\n          2,   3,   1,  -1,   3,   4,  -2,  -5,\n          9,  -9,   6,   4,   9,  12,  11,  -5,\n          2,  -1,   0,   9,   5,  -7,  -2, -24\n    },\n    {\n         -7,   6,   1,   3,   1,   0,   6,   0,\n          4, -12,  -2,  -2,   1,  -9,  10,  -2,\n         11,  -1,  21, -12,  15,  -5,  10,  -5,\n          5,  -5,  14,  -6,   5,  -7,  -3, -29\n    },\n    {\n         -2,   0,  -5,  -2,  -3,   1,  -3,   0,\n          4,   2,   3,   0,   2,  -2,   7,  -2,\n          3,  -5,   2,  -1,   6,  -4,   0,  -3,\n          8, -11,  19,  -8,  22, -34,  13, -35\n    },\n    {\n         -1,  -3,  -1,   9,  11,  -3,  -3,  -1,\n          7,  18,  11,  -5,   2, -12, -11,  18,\n          9,  -5,   1,  -6,  -9,  12,   1,  -3,\n         -3,  -9, -14,   9,   9,   8,  -6, -26\n    },\n    {\n          0,   5,  -5,  -1,  -1,  -2,   4,   6,\n          8,   2,  -1,  -2,   5,   1,  -5,  -4,\n          1,   1,  18,   1,   7, -10,   3,  -2,\n         12,  -1, -15,   9,  12, -14,  13, -38\n    },\n    {\n          3,   0,  -8,  -1,   0,   8,  -9,  -3,\n         -8,  16,   3,  16,  -5,  -9,   0,  -1,\n         -7,  -1,  -4,  13,   7,   0,   1,   2,\n         -1, -16,   0,  -2,   1,   8,  -8, -28\n    },\n    {\n          7,   9,  -5,  -3,  -2,   2,   0,   3,\n         11,  -6,  -4,  -2,  -2,  -5,  28, -18,\n         -6,   2,  15, -10, -15, -10,  -2,   0,\n         -2,  -2,   4,  -3,   7,  11,   5, -30\n    },\n    {\n          9,   0,  -7,  -1,  -4,  -7,   2,   2,\n          9,  -2,   2,   3,  -8,  -6,  -6,   3,\n        -10,   4,  10,   5,  21,  -4,  14, -18,\n          1,   3, -10,  -2,   6,  14,  -8, -26\n    },\n    {\n        -14,  -1,   2,   3,  -3,   7,   1, -22,\n         -1,  -1,   0,   1,  12, -14,   3,  -5,\n          0,  10,  -3,   1,  -5,  12,  -3,  10,\n         -8, -22, -11, -13,  -7, -10, -13, -25\n    },\n    {\n         -2,  -5,  -4,  -4,  -9, -18,   9,  -3,\n         -5,  17,  13,   5,   6,  11,   3,   8,\n         20,   4,   2,   9,   8,   5,   6,   1,\n          7,  -7,  -6,  -2,  -7,   0, -17, -23\n    },\n    {\n         -5,  -5,   2,   0,   6,   2,  -2,   2,\n         -3,   4,   4,   0,  -5,  -2,  -4,   6,\n          8,  10,  -1,   1,  -5,   5, -14,  -2,\n        -11,   8,   6,  25,   7,  -1,   0, -43\n    },\n    {\n         -4,   0,   4,  -2,   7,   0,   3,  17,\n          5,   2,  -5,   1,  21,   3,  -2, -10,\n        -16,  -9,   7, -12,   9,  -8,   2,   5,\n         -5, -10,  -2, -11,  -5,  -1,  -9, -30\n    },\n    {\n         -2,   3,   1,  -4,  -1,   0,   8,   1,\n         12,   4,  -1,  -1,   3, -17,  13,   9,\n          0,   7,  -6,  -5,   9,   1,   5,   4,\n        -10, -18,   0,  14,  11,  -4, -16, -28\n    },\n    {\n         -1,   0,   2,  -1,   4,   1,  -1,   1,\n         -1,  -2,  -1,  -2,   3,   0,   0,  -1,\n         -1,   1,   2,  -2,   3,   3,  -2,   4,\n         -2,  -1,  -6,   1,  -1,  -1,   6, -70\n    },\n    {\n          7,   3, -11,  -1,  12,  -4, -14,   4,\n          4,  -4,   4,  -2,   2, -12,  -4,  15,\n        -17,  -4,  -3,   6,   8,  -5,  22, -22,\n          5, -11,  15,  -4,   4,  -1, -21,  -1\n    },\n    {\n         10,  -2, -13,  11,   4,  14,   4,   9,\n          8,   8,  19,  15,  14,  15,   5,  10,\n          8,  15,  -5,   4,  14,  -8,   1,   1,\n          2,   1,  -1,  -3,  21,   8, -29,  13\n    },\n    {\n         -6,   0,  -6,   6,  -1,   2,   8,  -4,\n         -5,   4,  -4,  -5,   0,  -2,  -4,   0,\n          9,  -2,   1,  -2,  26, -19,  21, -10,\n          4,   1,  -8,   5,  22, -10, -13,  15\n    },\n    {\n         11,  -5,   1,   0,   6,   3,   7,  -2,\n         -2,  -3,  -5,  -1,  -2,  -6,   1,   1,\n         -8,  -5, -13,  13,  -2,  -3,  -1,  -9,\n        -28,   4,   2, -11,  18, -20, -24,   9\n    },\n    {\n          7,   4,  -3,   6,   6,  -6,  -7,  -5,\n         -7,  -4,  -4,   0,  -7,  -5,  -6,  -5,\n          2, -13, -12,   2,   0,   5,  18,  15,\n        -13,  -7,  13, -20,  16, -10, -19,   6\n    },\n    {\n          5,  -8,  -1,   5,  10,   2,  -1, -10,\n        -11,  23,   8,  -5,  -8,   4,  -5,  -4,\n         -5,  -5, -11,  -8,   5,   1,   7,  -9,\n         -9,  -6,  12,  14,  17, -12, -22,   3\n    },\n    {\n         -5,  -8,  -3,   3,  12,  -1,   0,  -4,\n         -5,   1,   1,   6,   1,   5,  -5,   7,\n         -2,   7,   1,   6,   6,   2,   0,  -5,\n         17,  -4,  -5, -24,  13, -20, -27,  14\n    },\n    {\n         -1,   2,  -3,   1,  -3,   1,  -3,   0,\n         -2,   3,  -2,   1,   2,  -1,  -2,  -1,\n         -2,  -5,   5,  -2,   0,  -7,   1,  -6,\n          8,   8,  11,  -5,  24, -43, -13,   2\n    },\n    {\n         -2,   4,   7,  -3,  -4,   4,  13,  -4,\n          0,   0,  -2,   9,   0,  -3,  -6,   1,\n         -7,   1,  -1,  10,   0,   5,  -1, -24,\n         25, -15,   7,   2,  22, -10, -21,   0\n    },\n    {\n         -5,   2,   6,  -2,  13,   3,   5, -12,\n        -11,  16,   6,  10,  -5,   0,  -3,   6,\n          5,  -5,  -5,  10,  12,  10,  11,  -7,\n          8, -14,   2, -15,  13, -14,  -8,  -3\n    },\n    {\n          5,   6,  -7,  -5,   5,   2,   9,   5,\n          0,  -1,  -4,   2,   8,   0,   3,   5,\n        -12,   3,  -3,  -6,   2,  -1,  -5,  14,\n         11, -20, -21, -25,  24,  -1, -10,   6\n    },\n    {\n         -5,   5,  -2,   9,   4,  -4,  -1,  -6,\n         11,  -6,   5,   0,   2,  -3,   6,  -1,\n        -17, -18,  -4, -13,   9,  -1,   9,  -7,\n         -4,  -8,   2,  -3,  12, -31, -18,   5\n    },\n    {\n         -7, -11,   6,  -8,   4,  -3, -12,   0,\n         -1,  -6,  -3,   0,   5,   9,   7,   2,\n          1,  -8,  -6,   8,   2,  -5,   7,  -1,\n         16, -10,  16, -12,  18,  -1, -25, -12\n    },\n    {\n          3, -12,   1,   2,  -2, -18,  -8, -15,\n        -10,  -9,   2,  -7,  11, -11,   2,  -1,\n         -1,  -1,  -9,  -6,   3, -14,  -2,  -1,\n          2, -13,  -7,  -9,  19,  -5, -17,   2\n    },\n    {\n          7,   1,  -8,   7,  17, -13, -10,   5,\n          7,   1,  -6,   4,   9,  -4,   0,   3,\n          8,   1, -14,  -9,   4,   7,  -9,   0,\n          6,  -5, -12,  -2,  25,  -2, -19,   1\n    },\n    {\n          7,  -3,   6,  -3,   1,   6,  -7,   0,\n         10,   0,   4,  -5, -17,  -4,   4,  -1,\n          0,  -3,  -7,  19,  24,  -1,  21,   8,\n         10,   9,   8,  -1,  23,  -2, -18,  -2\n    },\n    {\n          3,  -3,   0,   5,   8,  -2,  -9,   2,\n          9,   6,  19,   8,   2,   6,  -9,  -2,\n         -4,  -3,  -8,   7,  -7,  -8,   5,   4,\n         26,  -6,   7,  18,  24,   0, -13,   4\n    },\n    {\n          0, -13, -11,  -1,   3,  -9,   5,   4,\n         -7,   3,   0,   2,  -1,   4,  -5,   2,\n          9,  -2, -11,  15,   1, -21,   1,  -1,\n          0,   4, -14,  -4,  24, -16, -13,   1\n    },\n    {\n          1,  -9,  -8,   0,   0,  -4,  11,  -1,\n         14,  16,   0,  17,  -2,  -9, -12,   0,\n         -1, -14,  -9, -14,   0,  -2,  19,   4,\n          6,   4,   4, -11,   8, -17, -19,  -5\n    },\n    {\n         -3,   1,   2,  12,  -4, -18,  -1,  -4,\n         -7,  14,  -3,   2,   0,  -7,  -8,  12,\n         -5,  -9,  14,  12,  -9,  -2,   4,  -6,\n          4,  18,  -1, -25,  22,   2, -23,  -5\n    },\n    {\n         -2,   0,   0,   0,   1,   3,   5,  -1,\n          5,  -2,  -2,   2,  -3,   0,   1,   2,\n          0,  -1,   2,  -1,  -9,  -6,  -7,  -4,\n         -2,   4,  -7,  -5,  64,  -3, -25,   4\n    },\n    {\n         12,  -2,  -3,   0,   8,  -9,  13,  -7,\n          6,  -3, -12,  12,  15,  -9,  -4,   2,\n          9,  -4, -12,   3,  14,   1,   7, -15,\n         15,   0,  -6, -12,   0,  -3, -20,   6\n    },\n    {\n          2,  -1,  -4,   5,   9,   6,  -7,   2,\n         -2,  -7,  -2,   0,  -1, -18,  -4,  -6,\n        -15,  -5,  11,   5, -10,  -1,   2,   7,\n         12, -19,  -7,   8,  21,  -4, -15,   4\n    },\n    {\n          4,   2,   5,   5,  -5,   1,   3,   2,\n         -8,  13,   0,  -5,  -2, -14, -11,   6,\n          2,  17,   8, -13,  26,  -2,   5, -15,\n         -4, -14,  12,  -9,  13, -21, -23,  -4\n    },\n    {\n          2,  -3,  -2,  -3,   3,  -2,   6,   9,\n         -9,  13,   4,   2,  12,  -3,  -3,   1,\n        -17, -22,  -3,   4,   3,  -2,   1,  -9,\n          1,  -6,  11, -13,  14,   0, -15,   6\n    },\n    {\n        -16,  -4,  17,  -2, -20, -11,  11,  10,\n          5,  -8,  16,   2, -17, -14,  11,  11,\n         -6, -11,  -7,  12,  12, -10,  -6,   5,\n          8,  -4,  -2,  -5,  28,   3, -13,   4\n    },\n    {\n          0,  -3,   3,  -7,   6,   8, -12,  20,\n        -19,  18, -11,  10,  -5,   0,  -9,  11,\n          3,   0,  -2,   9,  -7,  -5,  18,   3,\n         -2, -16,   1,   6,  12,  -7, -16,   1\n    },\n    {\n          4,   1,   5,  -5,  15,   2,  -8,   3,\n          5, -11,  15,  -3,   8,  -8,  -1,   7,\n          4,   7,  -2,   6,  -9,   5,  12,   2,\n         33,  -2,  -6, -18,   4,   0, -18,  11\n    },\n    {\n          3,  -1,   1,  -1,   0,   1,   4,  -1,\n         -5,   0,   1,   0,   4,   2,  -1,   4,\n         -3,   2,   0,  -2,   4,   6,  -1,   6,\n         42,  19,  -4, -37,  19,   1, -15,  -4\n    },\n    {\n          2,   0,  -5,   0,  10,   0,   0,  -5,\n          3,   0,   0,  -3,  -3,   0,   2,  -4,\n        -10,   2,  -6,   4,   4,   1,  27,  -7,\n         17, -34,   5,  -9,  15, -16,  -7,  -5\n    },\n    {\n         -2,   7,   7,  -2,   9,  -2, -15,  11,\n         11,   7,   5,   1,  15,   1,  -9,  31,\n          2, -15,   2,   4,   3,   4,  -1,  -8,\n          2,  -7,   6, -17,  11, -14, -11,   2\n    },\n    {\n          1,   1, -11,   9,   9,  -6, -14, -11,\n        -10,   8,  -3,  11,  16,  -9,  -8, -13,\n         -8,   9,   0,   6,   6,  -2,  13,  -8,\n         -2,   3,  13,  -3,  10,  -6, -17,   4\n    },\n    {\n         14,   5,   4,  -6, -12,  10,  -7,   8,\n         21,  -8, -30,  15,  -2,   1,  11,  -9,\n         -5,   1,   0,  -1,  -1,  -6,  -2,   3,\n         -5,   7,   9,   5,  -5,   2,   0,   1\n    },\n    {\n         -1,   2,  20, -17, -15,   3,   3,   7,\n         11, -17, -13,  -6,  -3,  18,  17, -15,\n         -4,  -4,  -5,  22,  14, -14,  -2, -10,\n         -7,  11,   8,  -7,  -3,   0,  -7,  11\n    },\n    {\n          7, -11,  -7,  -8, -14,  22,   5,   2,\n          6,  13, -12,  -2,  10,   3,   0, -21,\n         -4,  20,   3,  10,  21, -10, -12,   8,\n         11,   2,  -5,   2,   1,   3,  -1,  15\n    },\n    {\n         -1,  -2,  -1,  -2, -13,   8,  -4,   0,\n          7,  -2, -17,   8,  18,   5,   3,   8,\n         -8,  -2,   3,  -4,  14, -18, -13,  14,\n         15, -13,  -1,  -2,   4,  11,   1,  12\n    },\n    {\n         13,  -6,  -4, -16, -17,  16,  21,  -2,\n          5, -11,  -9,  19,  21, -17,  -3, -17,\n          3,  12,   8, -12,  -6,   1,  -7,   9,\n          9,  -7,  -5,  -1,  -3,   5,  -6,  -4\n    },\n    {\n         11,   5,  12, -20,  -6,  10,   4,  12,\n          8,  -5, -10,  15,  13,  14,  10, -15,\n        -13,   1,   6,  14,  15, -17, -13,   4,\n         -5,  10,   7,  -6,  -8,  -3,  -4,  12\n    },\n    {\n         25,  -1,   7,  -5,  -7,  11,   1,  17,\n         13, -15, -14,  -4,   5,   3,   8,  -3,\n         -2,   2,   0,   6,  16, -12,  -6,  -4,\n          4,  -3,   7, -10,  -3,  -7, -13,   7\n    },\n    {\n         -8,  10,  -3, -13,   5,   2,   4,   9,\n          9, -17, -13,   2,  11,   1,   6,  -4,\n          8, -10,   4,   1,  19, -15,  -4,  12,\n         31,   7,  -5, -17,  -4,   9,  -2,   7\n    },\n    {\n         14,  -6,  -6,  -6, -14,  13,  17,  -5,\n          4, -14,  -9,   7,   7,  -9,   3, -16,\n        -15,  11,  11,   6,   4, -11, -19,   3,\n          5,   8,  13, -14, -14,   3,  -4,  12\n    },\n    {\n         -2,  -4,  10,  -4,  -7,  -1,  27,   5,\n          2, -16, -18,   4,  12,  -2,  -3,  -2,\n         -1,   1,  -8, -12,   3,  -4,   8,  15,\n          2,   4,   9, -13, -14,   9,  -7,   5\n    },\n    {\n          4,   2, -10,  -5,  -7,   2,   1,   4,\n         -1,  -6, -15,   6,   1,  10,   5, -10,\n         -9,  -1,  13,  -3,   5, -21, -11,   8,\n          8,   5,  27, -21, -18,  -5,  -1,  15\n    },\n    {\n         11,   1, -16,  -8, -11,   0,   5,  -8,\n        -12, -13, -17,  22,   4,  -6,  -1, -18,\n        -10,   0,  19,   2,  -2,  -8,  -7,  -3,\n          2,  -2,  -9, -17,  -5,   4,   4,  10\n    },\n    {\n          8,  -6, -19,  -5,  -4,  12,  14,  15,\n         10,  -9,  -1,  -9,  19,  12,   0,  -1,\n          2,   4,   7,   9,  16, -16, -14,   9,\n         -4,   3,   1,   0,  -2,  10,  -1,  -1\n    },\n    {\n         12,  -8,  12,  -9,   0,  25,   7,   9,\n          2, -31,  -9,  -4,  15,   4,  -5,   1,\n        -10,  11,   8,  10,   0,  -6,   5,  11,\n         -1,  -6,   4, -10,  -9,   6,   4,   5\n    },\n    {\n         14,   6, -17,  -2,  17,  12,  -9,   2,\n          0, -25, -14,   5,  20,  14,   8, -20,\n          5,   2,  -2,  -3,   9, -13,  -3,  -1,\n         -6,   3,   7,  -6,   0,   2,   3,   1\n    },\n    {\n          8,   4, -15,  -3,  10,  18,  -4,  13,\n          8, -22, -10,   9,  19, -15,   7,  -5,\n        -13,  12,  -4,   9,   2,  -9,  -6,   0,\n          2,   1,  -9,  -6,   6,   1,  -1,  11\n    },\n    {\n          4,   1,   4,  -5, -10,  18,   7,   2,\n         -4,  -9, -11,   0,  32,  -7,   4, -16,\n         -1,   0,   6,   3,   6,  -3, -14,  16,\n          9,  -2,   7,  -1,   0,  -5,   5,  -3\n    },\n    {\n         -3,   2,   3,  -8,  -6,   4,   6,   2,\n          4, -12, -15,   2,   8,   8,   9,  -3,\n        -18,   6,  34,  11,  12, -15,  -1,   2,\n          9,   2,  -4,  -4,   2,   4,   2,  -3\n    },\n    {\n         18,  -6, -12,  -8,  -1,  15,  20,  -4,\n         -1, -11,  -5,   6,   6, -11, -15,  -7,\n          3,   7,  10,   2,   8, -10,  -5,   8,\n         15,  -5,   5, -17, -13,  13,  11,   7\n    },\n    {\n          8,  -4,  -6,  -1, -14,  -3,   6,  -2,\n          1,  -5,  -1,  10,  10, -15,   5,   0,\n        -10,  -4,  -3,   7,  -4, -19, -15,  27,\n         11,  18,   3, -19,  -2,   6,   0,  12\n    },\n    {\n         12,   0,  -5,   0,   4,  -5,   1,   5,\n         10,  -7, -11,  21,  29,   1,  -2,   1,\n         -4, -11,  -1,  13,  11, -20,  -1,   4,\n          4,   4,  -5,   6, -13,  -2,  11,   9\n    },\n    {\n          2,  -7,  -7,  -3, -10,  -1,  20,  12,\n          1, -19, -19,  -1,   5,   4,  -7, -25,\n         14,   1,  -3,   2,  12,  -4,  -3,  -3,\n         -2,   6,   1,   0,   3,   2,   5,  -1\n    },\n    {\n         12,  -8,   3, -12, -10,  10,  13,   0,\n         23, -14, -18,  10,   0,  15,   3, -12,\n         -3,  -5,   5,  -4,   2, -14, -10,   8,\n          2,   9,  -1, -11,  -3,   5,  13,   2\n    },\n    {\n          9,  -6,   7,  -7, -30,  17,   6,  13,\n          1, -14,   0,  -1,   6,  -9,   8,   3,\n         -4,   0,  -1,  -7,  -5, -13, -19,  -3,\n         -4,   4,  -6,  -2, -13,   1,  -2,   3\n    },\n    {\n         10,   1,   3, -18, -26,  17,   4, -16,\n          4,  -3, -13,  -4,  -6, -11,  -4, -21,\n          7,   8,   2,   5,  13,  -6,   1,   5,\n          8,   7,   9,  -6,  -6,   1,  -1,   2\n    },\n    {\n         -3,  -1,   0,  -2,  -2,   0,  -1,   3,\n          4, -14,  -8,  -9,  13,   2,  50, -23,\n         -8,   8,   7,  11,  16,   3,  -7,   0,\n         -2,   6,   5,  -1,   1,  -2,   4,   3\n    },\n    {\n          1,   3,   1,   1,  -6,   3,   6,   6,\n          2,  -2,  -3,  10,   2,  -8,  -5,  -5,\n          5,   4,   4,  -2,  10,  -8, -40,  -1,\n         21,   8,   3,  -4,  -1,  13,   4,   7\n    },\n    {\n          2,   0,  -4,  -8,   5,   2,   7,  -5,\n          5,  -8,  -4,  -1,  12,   2,  12, -13,\n         -9,   0,   1, -12,   9, -43,   1,  -5,\n         12,   1,   3,   6,   1,  -1,   3,  -2\n    },\n    {\n          6,  -2,  -1,   1,   0,   4,   8,  14,\n          4,  -7, -23,  -5,  23, -17,  -6, -15,\n         -8,   7,  10,  -1,   7, -16,   4,  -6,\n          2,   3,  -3,  -3,  -1,   8,  -1,   4\n    },\n    {\n         10,   4,  -4,   1,   7,  -3,   2,  11,\n          4,  -6,  -3,   8,   5,   4,   1, -45,\n         -6,  -4,   4,   2,   1, -14, -10,   1,\n          1,   6,   2,  -8,  -1,  -3,   3,   3\n    },\n    {\n          1,  -1,   2,  -3,  -8,   9,   3,   3,\n         -2,  -5,  -8,   8,   7,  -7,  -4,  -6,\n          5,  -9,  11,  -2,  46,  -5,  -1,   9,\n         -2,   0,   3,  -5,  -3,  -5,   7,   0\n    },\n    {\n         -4,   1,  -2,  -1, -11,  11,   8,  -3,\n         -2, -10,   0,   4,   9,   9, -17, -17,\n        -34,  -4,  -5,  -7,  -3, -12,  -3,  11,\n         18,   3,  -2,  -5, -18,  -5,  -3,   6\n    },\n    {\n          7,  -5,  -3,   1,  -4,  -3,  -5,  -1,\n          2,   5,  -2,   3, -10,  12, -18,  -5,\n        -10,  12,  -9,   4,  -6,   2,   0,  16,\n        -17,  15,  14, -12, -10,  -2,  -9,  -1\n    },\n    {\n          4,  -5,  -3,  -5,  -3,  -1,   7,  18,\n         -7,  12,   3,   5,  -8,  -4, -20,   1,\n        -25,   1,  -8,  13, -10,   8, -19,  -1,\n         -8,  10,   6,  -9,  -1,   0,  12,   4\n    },\n    {\n         -4,   5,   0,  -1,   2,   5,  -8,  -2,\n         -6,   4,  -8,   9,   3,   2,  -7,   4,\n        -25,  13, -23,  10,  14,  15, -11,   3,\n        -18,   4,  16,  -4,   1, -10, -10,   3\n    },\n    {\n          5,  -3,  -1,  -3,   4,   1,  -3,  -4,\n         -5,   1, -12,  14,  -7,  11, -15,   6,\n         -6,  24,  -4,  13,  -1,  15, -13,   8,\n          3,   7,  -5,   2,   2,   0,   3,  -7\n    },\n    {\n         -3,   1,   0,   8,   6,  -1,   6,   5,\n         -5,  -2, -12,   4,   0,  -2,  -3,   5,\n         -6,   0,  -8,   9, -10,   4, -28,  12,\n        -20,  11, -13,   7, -18,   1, -11,   1\n    },\n    {\n          1,  -4, -15,   5,   0, -13,  -5,  13,\n        -11,   4,  -4,  -5,   5, -14, -16,   0,\n        -14,   5, -20,  12,  10,  -7,  -5,   6,\n          6,  22,   6,  -4,  -2,   3,   8,  11\n    },\n    {\n         13, -11,  -2,  16,  16,  -7,   0,  20,\n         -7,  -1,   0,   5,  -9,  12,  -2,  -5,\n        -22,   5, -10,  12,  -6,  11,   9,  21,\n         -8,  15,   4,   0,  -8,  -4,  -4,  10\n    },\n    {\n         18,  -4, -13,   0,   1, -15,  -1,  -3,\n          2,  10,  -1,   6,   1,  -4, -20,  -5,\n         -8,   6,  -8,  17,  -5,   5, -10,   8,\n        -22,   6,  -5,  -2,   8, -17,   8,   2\n    },\n    {\n          1,  -2,  -9,   6, -31,  -8,  -8,   8,\n          0,   5,  -9,  -4,   2,   3, -12,  11,\n        -18,  10,  -5,   3, -11,  13,  -6,  11,\n         -3,  12,  -7,   3,  -9,  -1,   2,  11\n    },\n    {\n         -9,  -6,  21,  -8, -15,   4, -11,  12,\n        -11,  17,  -1,   2,  -6,   0, -15,  13,\n        -12,  19,   0,   2,  -6,  -3,  -9,  10,\n          3,  17,  -2,   5, -10,  -3,   0,   1\n    },\n    {\n          4,  -6,   5, -10,   1,  -5,   1,   0,\n          0,   0,   2,   7,  -2,   2,  -2,   0,\n         -4,   3,  -4,   1, -12,   6, -49,  16,\n        -10,  13,   0,  -2,   8,   6,   1,   8\n    },\n    {\n          5,  -8,  -7,   9,  13,  -5,   7,   0,\n         10,  11,  -4,  -3,  -1,  13, -14,   6,\n        -15,  -6, -14,  16,  15,   1, -18,  -4,\n        -20,  20,  -7,  -1,  -9,  -2, -10,  10\n    },\n    {\n        -12,   4,   0,  10,   0,   3,   8,   4,\n        -27,  -1,  -2,  19,  -4,   2, -13,   3,\n          1,   9, -12,   1, -22,  19,  -5,   4,\n         -9,  12,   2,  -9,  -8,  11,  -3,   7\n    },\n    {\n          4,  -5,  11,  -6,  17, -17,   5,  -4,\n         -2,  -6,   1,  -5,   2,   4, -14,   6,\n        -20,  19, -20,  12, -21,   5, -14,  13,\n         -2,  11,   4,  -3,   0, -10,  -4,  -2\n    },\n    {\n         -2,  -1,  -3,   8,  -9,  -7, -22,  -3,\n        -24,  13,  -2,  10, -15,   5,  -9,   4,\n         -7,   0,  -5,  15,  -8,  11, -13,   6,\n         -4,  19,  -8,  12,  -4,   6,   9,   7\n    },\n    {\n          2,  -3,   2,  -1,   0,   3,   1,   2,\n          1,  -4,  -2,  -3,   1,   5, -12,   6,\n        -16,  14, -23,  10, -14,  17, -15,  16,\n         -2,   9, -25,   9, -10,  16,   4,   9\n    },\n    {\n         -3,   7,  -8,  -3,   2,   2,  -4,  -8,\n         -9,  10,   3, -11,  25, -10, -28,  27,\n         -9,   7, -13,   9,  -2,   4, -12,  -8,\n        -14,   6,   7, -10,   3,   3,  -3,   5\n    },\n    {\n         -8,  -3,   1, -10,   8,  -3,  -9,  -4,\n         13,   7,   2,   4, -10,   4,   3,   7,\n        -18,   2, -22,  15,   4,  20,  -7,   5,\n         -6,  13,  -1,   4,  -7,  -6,   6,  13\n    },\n    {\n         -2,   3,   0,   2,  -4,  -2,   0,   0,\n          1,   2,  -2,  -5,   0,   1,  -4,   0,\n         -2,  -3,   1,   2,  -1,   2,  -8,  -1,\n        -24,  68,  -3,   8,   3,   3,  -1,  -1\n    },\n    {\n        -15,  -2,  -9,  -7,  -1,   8, -14,   8,\n          3,   6,   0,  -1,  -8,   8, -23,   2,\n        -14,  17, -15,   8,  -4,   7, -18,   0,\n         -8,  -3,  -1,  -4, -10,   4,  -1,   4\n    },\n    {\n          8,   0,   2,  -7,   0,   5,   1,   3,\n        -11,   4,  -8,  14,   3,  20,   1,  26,\n        -11,  13, -13,  20,  -2,   0,  -8,   2,\n         -6,   6,  -1,   9,   3,  -6,  -3,  10\n    },\n    {\n          5,   0,  -1,  -7,  10,   1,  -3,   5,\n          4,   7,  -5,  -1,  -3,  -1,  12,  -3,\n        -15,   7,  -9,  22, -19,   8,  -9,   4,\n        -23,  13, -14,   6,  -6, -14,  -4,   7\n    },\n    {\n         14,  -5,  -8, -10,  25,   3, -23,  -7,\n        -28,   0,  -1,  -9,   4,   1, -13,  20,\n         -8,  10, -16,   8,  12, -13, -21,   5,\n        -13,  11,  -2,   1,  12,  -7,   2, -10\n    },\n    {\n         -5,  -4,   9,   5,  -6,  35,  -7,   8,\n         15,   2,  -1,  -9,  -6,   2, -18,   7,\n        -15,   6,  -3,   2,   8,  12, -30,   7,\n         -4,  20,   2,   6,  13,  -6,  -4,   0\n    },\n    {\n          1,   8,  -9,   9,  -5,  12,  -9,  16,\n         -9,  16, -17,  14, -13,  15, -18,  14,\n        -15,  17, -12,  14, -13,   7, -16,  13,\n         -9,   5, -11,  10,  -9,   6, -12,  13\n    },\n    {\n        -10,  -4,   5,   3,   1,   6,   8, -14,\n         -5,  15,   7,   4,   8,   7, -22,   8,\n         -7,  -8, -15,  26,   1,  13,  -3,  17,\n         -5,   9,  -2,   4,  -6,   3,  -8,   9\n    },\n    {\n          8,  -3,   2,   3,   3,   1,  -2,  -1,\n        -11,   8,  -4,   0,  -6,  -5,  -1,  13,\n        -37,   9,   1,  -6, -10,  -2, -10,  11,\n          8,  13,  -3,  -2,  -6,   8,  -4,  13\n    },\n    {\n          3,   2,  -3,  -4,  -4,   7,  -8,   9,\n         -8,   9, -20,  12, -19,  15, -18,  17,\n        -15,   7,  -1,  20, -11,   6,  -6,   3,\n          1,   9,   2, -14,  -2,  -2,   2,   1\n    },\n    {\n         -7,   1,  -1,  -3,  -6,   4,   4,  -3,\n          3,  -1,   5,  -4,   3,   2,  -1,   9,\n        -59,   5,  -4,  30,   3,   3,  -2,  -3,\n         -1,   2,   2,   1,  -1,  -1,  -2,   1\n    },\n    {\n          0,  -3,   2,   0,  -1,  -8,   0,   2,\n         -3,   4,  -4,   1,  10,   6,  -6,   8,\n         -7,   4,  10,  11, -41,  27, -20,   3,\n         -3,   8,   1,  11,  -5,  -8,   0,   4\n    },\n    {\n          5,   1,   4,  -2,   1,   2,  -1,   6,\n         -7,   2,  11,   4,   0,   0,  -8,   7,\n        -10,   0,   0,   8,   2,  10,  -1,   1,\n         -2,  44,  -2, -21, -12,  -3,  -1,   2\n    },\n    {\n         -4,   4,  -2,  -2,   6,  -8,   2,   1,\n        -10,  14,   8,   6,   5,   1,  -2,   4,\n        -13,   4,   2,   5,  10,  -2, -21,  32,\n         -3,  18,   9,  -6,  -9,  -9,  10,   2\n    },\n    {\n          9, -16,  -6,  -2,   1,   4,  22,   2,\n         -2,   1,  -3,  -2,  -9,   3,  16,  19,\n        -24,  -6,  -6,  -5,  -8,  -7,   8,  -7,\n         -1, -12,   5,  -3,   0,   4,   2,  -3\n    },\n    {\n         10,   3, -16,  -4,  -1,  13,   4,   4,\n          1,  -3,   1,  -6, -14,  18,   3,   8,\n         -8, -28, -16,   4,   4,   2,  12,   7,\n          9,  -4,  -4,   5,  -1,  -1,   2,   2\n    },\n    {\n         -5, -13, -22,  -3,  -8,  21,  -2,  -9,\n         21,  -4,  -9,   5,  -8,  15,   5,   1,\n         -5,  -9,  -7,  -2,  -5,  -5,  -1,  -5,\n         -5,  -5,   3,  10,  -4,   0,  -7,  -2\n    },\n    {\n          5, -10, -18,   2,  20,   4,  13, -10,\n          8, -15, -11,  -3,  -1,  16,  10,   9,\n         -8,   6,   7,  -5,   6,  11,   5,  17,\n         -4,   7, -11,   5,  -3,  -6,   2,   1\n    },\n    {\n          3,  -5, -19,   1,   1,  -3,  -2, -25,\n        -11, -17,   0, -13,  -4,  10,  10,   2,\n         -5,   4,   0,   3,  -3,  -5, -10,  -2,\n         13, -22,   0,   3, -11,  -5,   7,  -1\n    },\n    {\n         12, -14, -29,   6,  -1,  10,   7, -17,\n        -12,  14,   3,   9,  -9,   9,   7,   6,\n         -3, -13,   0,   5,   3,  -1,  -6,  -1,\n          0,   2,   4, -12,  -5,  -1,   2,  11\n    },\n    {\n         12, -15,  -7,  -2, -12,  17,  20, -16,\n         -2, -12,  -6,  15,  -6,  12,  11,   9,\n          7,  -6,   7,  -4, -19,   6,   2,   2,\n          3, -11, -10,  -4,  -5,  -3,   3,   2\n    },\n    {\n         11, -22,  -6,   0,   8,  18,   3, -11,\n         -4,  -7, -15, -17, -12,   6,  16,   4,\n         -9,   4,  -5,   3,   6, -16,  10,  -7,\n         -7,  -3,   5,   0,   1, -15,  -4,   5\n    },\n    {\n         12, -22, -16,   5,  -6,   8,  12,  -4,\n         -9, -17, -11,   3,   5,   8, -17,   0,\n         11,  -4, -13,  -6,   2,  -1,  -1,   3,\n          3, -11, -12,  -1,   1,   1,  12,  -2\n    },\n    {\n          8, -10, -33,  -5,  -3,  -6,   1,  -7,\n         -8,  -4,  -6,  -1,   5,  -4,  -6, -12,\n        -16,  -8,  11,   8, -14,   7,  12,  11,\n          4, -14,  -3,   6,  -7,  -5,  -3,   3\n    },\n    {\n          0,  -8,  -7,   2,  -4,  24,   2,  -9,\n        -11,  -3,  -7,  11, -12,  17,   1,  -1,\n          3,  -5,  -7,  12,   4,  11,   0,   3,\n          2, -18,  -3,   4,   7,  -6,   3,  15\n    },\n    {\n         10, -15, -16,  -2,  -4,  -9,   7, -15,\n         -6,   2, -16,  13,  -8,   7,  19, -21,\n         -4, -12,  -9,  -3,  -3,   6,  11,  -3,\n         -1, -19,   3,  -7,  -9,  -4,   3,  -6\n    },\n    {\n         -5, -10, -21,   0,  -3,  -7,  18, -21,\n         15,  -5, -12,  -4, -13,   2,   6,  -9,\n         -9, -11,  -4,  13,  -3,   6,   4,  -1,\n          7,  -9,  -4,   9,   5,   2,   6,   3\n    },\n    {\n         15,  -1, -27,  -2,  10,   3,   7,  -8,\n          9,  -2,   7,   1,  -2,  -5,  18,   9,\n        -11, -17,  -2,   7,  -9,  11,  10,   0,\n         -8,   6, -16,  -3,   2,  -7,   3,  11\n    },\n    {\n          4,  -9, -39,  19,   6, -13,  13,  -5,\n         -5, -15,  -2,   9,   0,   4,  14,   6,\n        -10,  -4,  -5,   2,  -4,  -2,   5, -11,\n          3,   3,  -2,  -2,  -7,   9,   7, -10\n    },\n    {\n          5, -11,  -8,  10,  -2,  12,  16,   0,\n         12,  -2,  -6,   8,  14,   8,   7,   1,\n         18, -30,   4,  10,  -4,  -6,   2, -11,\n          9, -10,  -8,   5,   0,   0,  -7,   6\n    },\n    {\n         -1, -16, -10,  11,   0,  13,  12,  -4,\n         -4,  -5, -21,  12,   4,  13,  14,  -7,\n          6, -16, -13,   8,   2,   9,  15, -12,\n          1,  -9, -22,  10,  -9,   9,   9,  -7\n    },\n    {\n          4, -12, -27,   1,  -2,  11,  15,   3,\n         14, -14,  -9,   0,  -9,  16,  22,  10,\n         16, -10,   5,  -5,  -9,   1,   1,   6,\n          6,  -4,   2, -17,  -5,  -6, -15,  -1\n    },\n    {\n          7, -12, -17,   1,  -9,   5,  20,  -7,\n          3,  23,  -8,  -8,  -8,  -1,  13,  17,\n         -7, -13,   4,  -4,   7,  14,   8,  11,\n         -3,  -3,   4,   0,   4,   6,  -1,  -9\n    },\n    {\n          7, -15, -15,  -4,  10,  12,   3, -13,\n          6,  14,   9,  -8, -15,  14,  23,  -5,\n        -10,  -5,   1,  15, -10,  -7,   1,   9,\n          4, -13, -10,  10,   7,  -3,   2,   3\n    },\n    {\n          4, -10, -14,   0,   3,   4,   0,  -9,\n         -3,  -4, -11,   2, -17,   8,   2,  15,\n          6, -12, -12,  15,  -5,  17,  18,   3,\n         -3,  -3,  -4,  -6,  -8,  13,   4,  10\n    },\n    {\n         -2, -18, -26,  10,  -4,  10,  13,   4,\n         -4, -16,  -7, -17,  -3,   5,  -4,   2,\n        -15, -10,  -1,  -8,  -7,  -3,   2,   2,\n          8, -10,  -7,   2,   2,  -4,   4,  -1\n    },\n    {\n          4, -19,  -5,  -1,  -1,  -6,   2,  -8,\n         10, -16, -28,  -6,   8,  -1,  11,  28,\n          2, -10,  -4,   6,  -6,   6,  11,  15,\n         -4,  -2,   7,   3,   7,  -7,   4,   1\n    },\n    {\n         -3,  -6, -10,  -5,  13,  18,  10, -15,\n         -5,  -3, -13,   5,   1,   2,  18,  -5,\n        -10, -10,  -7,   4,   2,   1,   5,   4,\n          2,   5,   4,   8,  -9, -17,   7,   7\n    },\n    {\n         20, -12,  -2,  -4,   5,  14,   7, -11,\n         -1, -16,  -6,  -4, -11,  17,  14,   0,\n         -8, -10,  -8,  10,   3,   5,  10, -16,\n          3,  -8, -14,  10,   3,   9,   0,   3\n    },\n    {\n         12, -10, -36,   0,   7,  15,   2, -16,\n          2,  -1,   0,  -1,   5,   4,   5,  -3,\n          1, -10,   5,  -1, -15,  -3, -12,  12,\n          2,   5,  -1,   5,   6,  -3,  -2,   2\n    },\n    {\n         17, -15, -31,  23,  -4,  15,  -2,  -3,\n          6,  -7,  -5,   1, -12,   4,   6,   8,\n        -10,   8,   3,   5,  -4,   1,   5,   3,\n         -1,  -4,  -3,   1,  10,  -4,  -2,  -2\n    },\n    {\n          6, -18,  -5,  12,  10,  12,  14, -11,\n         15,   2,  -9,  -6,  -5,  -2,  -9,   4,\n         -5, -28,  -4,  14,   0, -16,   9,  14,\n         -1,   3,  -4,  -4,   2,   1,   0,   4\n    },\n    {\n         -5, -14, -31,   8,  16,   7,  13, -13,\n          5,   6, -16,  10,  -5,   2,  -2,   2,\n         14,  -5,   8,  -5,   7, -16,   6, -13,\n         -5,   0,  -5,   8,  -3,  -1,   4,   3\n    },\n    {\n          1,  -2,  -1,   0,   6,   5,   2,  -4,\n         -3,  -1,   0,   1,   4,   2,  43,  28,\n        -12, -35,  -2,  -2,  -7,  -1,   0,   2,\n         -1,  -2,  -2,   1,  -4,   0,  -2,   3\n    },\n    {\n          2,  -9, -22,  12,   3,   3,  -7,  -4,\n        -19, -22, -14,  -4,  -1,  21,   9,  -3,\n        -15, -16, -13,   1, -11,   4,  -9,   1,\n         -7,  -1,  -1,   0,  -2,   9, -13,  -3\n    },\n    {\n         -1,  -3, -23,   0,   2,  12,   3,  -9,\n         -4,   7,   3,   9, -10,   1,  27,  28,\n          0,   9, -15,  -2,  -2,   1,   6,   8,\n         -8,   7,  -3,  20,   0,   0,  -1,  -6\n    },\n    {\n         -1,  11,   8,  -2,   1,   5,  -6,  -1,\n          4,   2,  -4,   0,  -1,  -5,   4,  -6,\n        -10, -12,  19,   1,  -7,   9,  -8,  -9,\n        -16, -11,  -2,  12,  14,   4,   4,  34\n    },\n    {\n         17,   7,  -6,   1,   4, -10,  -5,   4,\n        -11,   3, -18,   4,  14, -13,  -3,   1,\n          0,   0, -11,   0,   7, -17,  -4,   4,\n        -11,  -6,  -8,  18,   0,   0,   0,  26\n    },\n    {\n         -6,  -7,  -1,  -1,  11,  -8,   1,   3,\n          2,  11,  -6,  -6,  10,  -3,   1,  -3,\n          7,   4, -12,  -8,   0,  -9,   8, -22,\n         -5,   0,  -6,  22,  -2,  11, -13,  24\n    },\n    {\n         -3,   4,   0,   3,   9,  10,  -1,   3,\n         -9, -12,   1,  -5,  18,   0,  -3,   8,\n         25,  15,  -8,   2,   2,  -2,   4,   8,\n          9,  -1,  -5,  10,  -3,   1,  -1,  23\n    },\n    {\n         -5,   2,  -9,  -1,  -3,   0,   3,  -1,\n        -10,  -4,   0, -13,  16,   9,  -1, -14,\n          2,   6,  -2,  -6,  -5,  -2,  -7,   7,\n          5,   3,  11,  -2, -14,   0,  -9,  30\n    },\n    {\n          4,   6,   6,   5,  -3,  -1,   4,   5,\n         10,   0,   5,  -4,   7, -11,  14,  14,\n          7,  34,  -9,   0, -10,  22,  -7,  -1,\n          7,  -9,   2,  -8,   0,  -7,  -5,  29\n    },\n    {\n         -4,   3,  -1,  -4,  -3,   5,   1,  -4,\n          0,   2,   4,   2,   1,  -1, -10,   1,\n          6,  -6,  -4,   1,   4,  -3,  -3,  -5,\n          0,   3,   7, -12,   0,  -2, -10,  55\n    },\n    {\n          5,   9,  -1,   0,   4,   9, -21,  -9,\n          4,   2,   6,  -7,  11,  -7,   1,  -5,\n          0,  -4,   2,  -3, -13,  -8,   0,  -9,\n         -4,   2,  16,  -2, -15,  -7, -11,  31\n    },\n    {\n          8,   2,  -1,   0,   3,  -5,  -5,   5,\n          1,  -1,  -9,   1,   0,  -6,  -2,  -1,\n          5,   2,   0,   0,  12,  20, -19,   1,\n          8, -12, -11,   0,   6,  -5,   2,  31\n    },\n    {\n         -1,  -1,  -2,   1,  -1,   3,  -9,  -5,\n          8,  -2,   5,  -1,   0,  -2,   4,  -2,\n         -3, -12,   0,  -2,   3,   0,   9,   4,\n         -1,  21,  -8,   3,  -4,   9,  -6,  30\n    },\n    {\n         -4,   0,  -7,  17,  10, -12,  -2, -10,\n        -12,  -3,  10,   0,  11,  -4, -13,  -3,\n          5,   6,  10,   7,  -8,   0,  -7, -13,\n          1,   0,  -2,   7, -12,   4,  -3,  24\n    },\n    {\n        -13,   9,   4,  -2,   2,  -4, -14,  -1,\n         -3,  -5, -10,   4,  13,  -2,   5,  13,\n          8,   3,  -2,   1,   5,  -6,   7, -18,\n        -10,   1,  -1,   5,   4,   1,   0,  25\n    },\n    {\n         -5,  -1,  18,  12,   8,   8, -16,  -1,\n          1,   1,   1,  -4,  -5,   3,   3,   4,\n          4, -11, -12, -16,  -6,   2,  12, -13,\n          0,   9,   7,   9,  -9,   0, -10,  24\n    },\n    {\n         -4,   1,  -3,   0,   2,  -4,   4,   1,\n          5,   0,  -3,   2,  -3,  -2,   2,  -1,\n          1,   4,  -1,  -2,  -2,   1,  -1,  -1,\n         -4,  -1,  -4,  -2,  -6,   6,  12,  69\n    },\n    {\n          8,   5,  11,   0, -15,  -4,  13,   6,\n          0,  -4,   9,   1,  -5,  -3,  15,   0,\n          1,   6,  -5,   0,   1,   6,   5,   8,\n          0,   7,   1,  -1,  -4, -11,  -9,  41\n    },\n    {\n         -4,  -9,  32,  -6,   0,   7,  -4,   6,\n         -6,   1,  -6,  -2,   4,  -8,  -5,  -3,\n        -16,  -1,  -2,  -6,   1,  15,   0,  21,\n          3,  -3,  -4,   3, -12,  16,   2,  27\n    },\n    {\n         -6,  -5,   1,  -9,  -5,   3,   7,  -3,\n          5,   5,  14,  13,  20,  -7,  -1,  12,\n         -1,  10, -11, -11,  -7,  -4, -14,   7,\n        -14,  13,  22,  18,  -1,   0,  14,  28\n    },\n    {\n         -8,   3,  -2,   0,   5,   6,  -1,  -4,\n          1,   3,  -7,   3,   1, -15,   4,  -9,\n         22, -10,  -9,  -4,   1,   8,  -4,   9,\n        -15,   2,  -6,  -4, -16,  12, -10,  23\n    },\n    {\n          0,   0,   2,   0,  -1,   3,  -3,  -1,\n          3,  -5,   7,   1,   5,  -5,  -8,   1,\n         13, -15,  -5,  -7,  12,  -6,  -2,   3,\n         10,  -5,  -8,  17,  -5, -11, -14,  23\n    },\n    {\n         -7,  -4,   6,  -4,   5,  -6,  -5,   2,\n         -4,  11,   9,  -4,   2,  -2,  -4,   6,\n         15,   3,  -3,  18, -15,  -2,  -6,   3,\n          3, -20,  17,  11,  -4,   2,   3,  29\n    },\n    {\n          6,   1,  -6,   2,   3,   0,   0,  -3,\n          3,   3,  -1,   3,  -4,  -6,  -6,  -7,\n         -3,  -2,  -7,  -2,  -4,   5,   3,  -5,\n        -20, -13,  -4,  10, -14, -29,  14,  37\n    },\n    {\n          3,   4,   3,  -6,  -4,   5,   0,   3,\n          2,   3,   0,  -2,   4,   0,  -3,  -5,\n         -4,   4,  -4,   4,   4,   3,   1,  -4,\n         -4,  -9, -14,  20, -30,   3, -18,  33\n    },\n    {\n          0,   2,   5,  -2,  -4,  -2,  -1,   2,\n         -6,  -3,  -2,  -2,   2,  -5,  -1,   4,\n          3,   2,  -3,   0,  -1,  -1, -10,  -7,\n          2,  -4, -18,   2, -37,  -1,  12,  40\n    },\n    {\n         -7,   2,  -1,   0,  -2,   4,  -8,   1,\n         -4,  12,   7,   4,  15,  -7,   1,  -9,\n         18,   0,  12, -17,  -3,  -1,   0,   0,\n          0,   2,  -6,   0,  -4,  -3,  -1,  26\n    },\n    {\n         -6,   4,   8,  -5,  -6,  -2,   2,  -1,\n          1,  -1, -15,   8,   7,  -1, -17,  -4,\n          1,   5,   6, -11,  -6,  14,  17,  -5,\n        -15,  11,   8,   0,  -3, -15,  -6,  28\n    },\n    {\n         -1,   0,   0,   0,   1,   0,  -1,   0,\n          1,   3,   2,  -2,   3,  -1,  -1,   2,\n          2,  -1,  -1,  -7,   1,   2,  -9,   0,\n         -1,  -4, -18,   7, -10,  49, -13,  32\n    },\n    {\n         -1,  -3,   4,   1,   2,  -5,   1,  -7,\n         -1,   5,  -9,   4,   4,  25,   1,  -1,\n          2,  -5,   2,  -7,  17,  -2,  10,  -5,\n          0,   2, -15,   3,  -9,   7,  -9,  30\n    },\n    {\n         -5,  -1,   0,   2,   1,  -1,   2,   5,\n        -33,   3,  -5,  14,  11,   7,   5,  -3,\n          2,  -8,  -4,  -2,  -7,  -6,   4,  -8,\n         -1,  -8,   2,  -2,  -8,  -1,  -4,  27\n    },\n    {\n         -1,   0,  -1,  -2,   1,  -1,  -2,  -1,\n          2,   0,   1,   2,   2,   4,   1,   3,\n          4,   2,   1,  -7,  -4,   1,  -3,  -4,\n        -35, -25,  17,  10,  -3, -26,  -7,  32\n    },\n    {\n         -5,   1,   6,  -2,   6,   6,  -9,   3,\n         -1,  -4,   5,  -4,  -2,  -2,  -9,   2,\n         -5,   2,   2,   4,   3,   5,  -5, -16,\n        -31, -12, -11,   2, -19,  20,  -2,  21\n    },\n    {\n         -5,   2,   7,  -7,  -7,   5,  -7,   2,\n          0,   0,  -4,   3,  -1,   0,  -1,  -2,\n          0,  -3,   5, -11,  -8,  -3,  -7,  -7,\n         28, -11,  -7,   0, -16, -11,  -4,  29\n    },\n    {\n          2,   1,  -3,  -2,  -1,   3,   4,   0,\n          1,   0,  -1,  -5,   4,  -5, -12,   2,\n         -2,  -5, -22,  -2,  -1,  11,   8,  -7,\n        -12,   0, -34,   6,  -5,  11,  -8,  19\n    },\n    {\n         -1,  -3,   5,  11,  18,  -2,  -2,  -5,\n         -2,   4,  -1,   8,   5,  -6,   1,  -1,\n          2,   8,   4,  -5,  -8,  -2,   5, -18,\n          7,  12,   7,  19, -18,   2,  -6, -13\n    },\n    {\n          9,   0,   0,   5,   4,   3,  -6,   4,\n          1,  -4,   5,  -1,  -4,   8,   8,   6,\n         -8,  -6,   0,   6,  -3,   3,   5,  -3,\n         17,  31,  16,  10, -13,   0,  -9, -19\n    },\n    {\n         12, -10,   2,  -2,  -2,  -1,  -3,   6,\n        -12,  -5,  -2,  14, -16,   4,  12,  12,\n         17,   4,   7, -16,   7,  -6,  11,   7,\n          7,   2, -25,  23, -24,   5,  -7,  -9\n    },\n    {\n         10,   4,  13,  10,  10,   3,  -6,   3,\n          3,   2,  -1,  -6,   8,   4,  10,   0,\n          1,   2,  -4,   2,  -3,  -8,   0,  -1,\n          9,   9, -10,  -3, -29,   1,  -1, -27\n    },\n    {\n          2,   2,   0,   7,   9,  -2, -10,  -1,\n         -1,   1,  -9,  -5,   8,   4,   1,   2,\n        -10,   1,  13,  12,  -3,  15,  -9,   2,\n         -7,   1, -10,  23, -20, -18,  -9, -15\n    },\n    {\n         -3,  -5,  -1,   8,   0,  -5,  -1,   4,\n          7,  -1,  -7,   2,  -8,  -5,  11,   7,\n         -6,   3,  -3,  -9,   7,   9, -22,   1,\n          6,  -4,  14,  27, -25, -14,   3,  -5\n    },\n    {\n          1,   3,   8,   4,   7,   6,  12, -17,\n        -15,   1,  -8, -10,   7, -14,  -8,   6,\n         -2,  -2, -11, -11,  -7,  13,  -2,  -2,\n          4,   5,  -5,  13, -23,  -6, -17,  -8\n    },\n    {\n         -5,   4, -14,  -5,  -4,  -5,   6,   5,\n         -8,  -5,  -2, -11,  -7, -12,   3, -11,\n          2,  -6,   4, -10,  -5,  -7,  14,   5,\n         23,  11,   7,  12, -16,  -6,  -4, -16\n    },\n    {\n          5,   6,   2,   5,  -2,  -5,  -5,  -6,\n         -5, -19, -13,  -1,  -3, -13,   5,   0,\n          6,  -2,  -2,  -6,  -7,  -7,  -1,  -9,\n          4,  14,  17, -12, -27,   3,   0,  -1\n    },\n    {\n          7,  -1,   9, -10,   8,   2,  -7,  -2,\n          5,   2,  -3,  -7,   3,   0,   6,   4,\n         12,   5,  11,  14, -13,  -1,   8,   1,\n         13,   9,  12,  12, -18, -14, -11, -16\n    },\n    {\n         -7,  -5,  -6,  -5,   0,  -1,  -3,   2,\n          2,   1,   4,   9,   2,   3,   5,  -2,\n          2,   1,   8,   0,   3,   0,  -2,   2,\n          1,   7,  29,   0, -36,  -5,  -9, -21\n    },\n    {\n         14,  -6,  -9,   0,  -1,  -8,  -8, -11,\n          2,   2,  -9, -12,  12,  -4,   5,   3,\n         -5,  -9,  11,  -1,  -3,  12, -21,  -3,\n         12,   5,   3,  11, -18, -15,   1,  -2\n    },\n    {\n         -1,   3,  -9,  -3,   7,  -7, -18,   2,\n          4,  12, -10,   2,   8,  -3, -14,  13,\n         17,  -5,   5,  -9,  13,  -3,  -7, -18,\n         17,  -2,   5,   7, -20,  -3,  -6, -11\n    },\n    {\n         -3,   3,   3,  -1,   1,  -6,  -5,   1,\n          5,  -3, -14,  -6,  -5,  -8,  14,  -6,\n          7,  -1,   5,   1,  15,  -1,  -7,  -4,\n          6, -11,   9,  -2, -37,  16,  -7,  -3\n    },\n    {\n         -1,   0,   6,   1,  -3,  -9,   0,  11,\n         -8,   2,  -2,   0,   5,   2,  12, -10,\n         10,  13,   2,   7,  -6,   2, -10, -10,\n         21,  -5,   5,   5, -12, -23,   3, -14\n    },\n    {\n          6,   0,  -2,   1,   0,   1,   0,  -4,\n          1,   1,   8,  -2,   2,  -5,  -2,   1,\n          8,  -4,  -1,  -1,   4,  -1,   2,   6,\n         32,   1,  -5, -20, -40,  -4, -18, -14\n    },\n    {\n          2,   2,  -7,  -2,   4,   4,  -1,   2,\n          0,  -2,  -4,  -7,   3,   5,   0,  -5,\n          1,   2,  -6,   4,  -1,  -2,  -1, -15,\n          8,   3,   9,  46,  -7, -18,   6, -11\n    },\n    {\n          5,   5,  16,  21,   3, -11,  -4,  11,\n        -12,   2,   4, -12,  -1,  11,   8,   1,\n         -4,  11, -11, -21,   1,   1, -11,   3,\n         13,   1,   5,  12, -25,   1,  -3,  -2\n    },\n    {\n          1,   6,  -7,   4,   2,   3,   1,  -5,\n          8,   9, -15,   3,  -3, -14,  17,   4,\n         -8,  14,  -2,  -8,  -4,   5,   8,  -7,\n          8,   9,   7,   6, -29, -17,   8,   4\n    },\n    {\n         -7,  -7,   4,   0,  13,   1,   0,   4,\n          4, -16, -10,  -7,   5,   9, -15, -10,\n        -10,   8,  -4,  -1, -11,  -1, -10, -15,\n          3,   3,  14,  10, -19,   2, -18, -12\n    },\n    {\n         -4,   0,   2,   0,   5,  -2,  -9,   0,\n          4,  -4,   2,  -1,  -2,   2,  -4,   9,\n          2,  -6,  -4,  -2,  -1,  -3,  -3,  -1,\n          2,   5,  -1,  11, -24, -44,  -9, -15\n    },\n    {\n         -1, -10,   6,  21,  11,  15,  -7,  10,\n        -14,  -9,  -8,  -8,   4,   6,  19,   1,\n         -6,   1,  -5, -17,  -8, -10,   9,   5,\n         11,  18,  -1,  10, -16,  -7,  -9,  -8\n    },\n    {\n          3,  -5,   0,   0,  -2,  -2,  -6,   4,\n         -4,   1,  -1,   0,   7,  -3,   4,  -4,\n         -7,   7,  17, -20,   6,   4,   1,  -6,\n        -12,  31,  13,  19, -14, -10,  -7,  -2\n    },\n    {\n         -2,   6, -10,   3,   9,   6, -14,  15,\n          2,  -5,   2, -11,   9,  -8,   4,   6,\n         20, -15,  -3,  -3,  -1,  32, -21,   6,\n          1,   9,  11,  17, -19,   6,  -1,  -3\n    },\n    {\n          8,  10,  -2,   0,  -8, -16,   7,   7,\n          6,  10,   4, -14,   7,  -6,  21,  -7,\n         10,   5,   5,   0,  -7,   2,  -6,   0,\n         -7,  11,  -9,  15, -20,  -7, -11,   2\n    },\n    {\n          0,  -7,   5,   2,   0,  -3,  -6,  -4,\n         -2,  -1,  -4,  -5, -13,  -1,  27,  -9,\n         -6, -11,  -7,   1,  11,  -4,  -4, -14,\n         -2,  11,   6,  10, -19,  -6, -15,   2\n    },\n    {\n          0,   7,  -1,   2,  -7, -15,  -2,  -3,\n         13,  -5,  -5,  12,   3,   0,   5,  -5,\n        -22,   2,   7,  22,  13,   0,  -1,   2,\n          3,   2,  -7,   7, -27,  -4,  -4, -12\n    },\n    {\n         11,   1, -16,   6, -15,   1,   3,   2,\n          0,   2,  -3,   2,   5,  -2,  -5,   9,\n          5,  -3,   3,  -2, -11,   3,   9,   6,\n          9,   3,  -1,  12, -41,   8,  -6,   9\n    },\n    {\n          3,  -7,   3,   2,   5,   5,   0,  -1,\n          1,   3,  -5,  -2, -13,   7,  -1,  -2,\n         -2,  -6,   4,  -6,   0,   2,  -2,   2,\n          4,   1,  -4,   1, -47, -21,   7,  -6\n    },\n    {\n          3,  16,  -7,  13,  -4,  -2,  10,  -3,\n         -1,  18, -13,   7, -13,  -4,   8,   4,\n          8,   9,  -5,  13,   8,  -5,   3,  -6,\n          7,  18,  -8,  10, -25,  -3, -12, -12\n    },\n    {\n          1,  -1,  -1,   0,   2,   5,  -5,  -3,\n          0,  -5,  -1,   0,  -4,  -8,  -2,   3,\n          2,  -2, -17,  -6,  -4,   1,  33,  -6,\n        -20,  -6,   8,  31, -26,  -8,  -1,  -4\n    },\n    {\n          3,  -3,  -3,   5,  -3,  -2,   1,   7,\n          0,   3,   6,   3,   6,  -2,   9,  15,\n        -10,  -3, -15,  -5,  -3,  -4,  -6, -30,\n         17,  -8,  -2,   2, -20,   0,  -8,  -2\n    },\n    {\n         -2,  -1,  -1,  -1,   3,  -5,  -2,  -3,\n          4,  -2,   0,   5,   8,  -3,   1,  -4,\n          1,   1,  -3,   4,   4, -14,   3,  11,\n         -5,   3,  -3,   7,  -3,  13,  23, -16\n    },\n    {\n          2,  -6,   1,  -3,   5,   0,  -6, -11,\n         -7,  -4,  -1,   2,  -7,  -1,  -1,   7,\n          1,  -2,   6,  12,  -6,   8, -13,  17,\n         25, -23, -19,  -7, -12,   9,  16, -17\n    },\n    {\n          9,   4,   4,   4,  -3,  -1,   6,  -2,\n         -3,   0,  13,  -4,  -7,  14,   1,  -7,\n          0,  -5,   3, -19,  -3,   5,   3,   9,\n         -1,   9, -13,  13, -17,   4,  21, -26\n    },\n    {\n          0,  -5,   0,   0,  -4,  -5,   2,  -6,\n         -4,   5,  -7,  10,   0,   2,   0,  -2,\n         -2,   0,   4,  -6,   7,  -2,   6,   5,\n         -5,   2, -12,   1, -29,  29,  27,  12\n    },\n    {\n          9, -10, -22,   6,  -1,  -1,   9, -14,\n        -12,  -2,   1,  -1,  10, -11, -16,   0,\n          3,  11,  13, -14,  -9,  -2,  -1,   6,\n          4, -14,   0, -10,  -2,  16,  17, -11\n    },\n    {\n          2,   0,  -1,  -2,   4,   3,  -6,  -2,\n          1,  -1,   1,   3,  -4,   1,   3,  -4,\n         -1,  -1,   4,  -1,   1,   0,   1,   6,\n         -5,  -7,   2,   1, -47,  -3,  50, -17\n    },\n    {\n          8,  -4, -11,  -7,  11,  11,  14,  -7,\n         12,  -7,   6,   2,  13,  -6,  -3,  -2,\n        -14,   6,   6,   6,   0,   2,  -1,   5,\n        -20,   2,  -1,   4,  -5,   6,  21, -11\n    },\n    {\n         -2,  -9,   3,   0,  -6,   7,   8,  -8,\n          1,  -3,   4,   1,   5,  -2,  -3,  -7,\n          4,   7, -12,  -9,  -2,  10,  -6,  13,\n          6,   5,  20,   2, -15,   9,  28,  -7\n    },\n    {\n          0,  -5,  -6,  -6,  -6,   1,  -6,   6,\n         -2,   4,   8,  -3,  12,  -1,  -4,  -2,\n          6,  16, -14,   9, -14,  -2,  -8, -27,\n         -3,  18,  -1,  -7,  -3,   8,  23, -23\n    },\n    {\n          1,   4,  -9,  -1,  -5,  10,  -2,   1,\n        -11,   1,  -9,   4,   7,  14,  -9,  -2,\n         -3,   2,  -5,  -1,  -6, -10,  -7,  11,\n         20,   2,   3, -19,   3,  15,  30,  -9\n    },\n    {\n          7,   2, -14,  -4,   0,  -2,   5,   2,\n          5,  -2,   8,  -3,  -7,   6,   6, -11,\n        -14,   1,  10,  -1,  -7,  -8,   1,  10,\n          3,  -6, -15, -12, -17,   4,  30,  -6\n    },\n    {\n          4,   2,   1,  -2,   3,   0,   1,   0,\n          2,   0,   1,   6,  -7,   0,   3,   4,\n          4,  -4,  -2,  -5,  -2,   2,  -1,  -2,\n          0,  -2, -11,  -7,  -3,  42,  24, -14\n    },\n    {\n          4,   1,   3,   2,   0,  -2,  -3,  -2,\n          2,  -1,   4,  11,  -2,   2,   3,  -4,\n         -5,   9,   2,  -4,  -9,   5,   8,  -1,\n         -7,   1,  24, -13, -28,  20,  15, -22\n    },\n    {\n         -3,   7,   6,   3,  -2,  -5, -10,  -2,\n         -2,  -1,  -6,  -6,  -2, -14, -16,  -6,\n         -5,   0,  18,   0,   9,   1,   7, -13,\n         -5,  -6,  -9,  11, -15,   9,  22, -11\n    },\n    {\n          9,  -2,   6,   5,   2,   9, -10,   1,\n          1,   5,  -4,  12,   2,   2, -10,  -7,\n         -4,  -6,   7,   9,   6,  15,   6,   6,\n        -10,  10,   5, -13,  -5,   6,  24, -12\n    },\n    {\n          1,   3,  -3,  -3,   8,   1,  -6,   2,\n         -5,  -3,   7,   2,  14,   6,   9,  -6,\n         -5,  -4,  27,   7,  -3,   8,  -6,   3,\n         -8,   8,  22,  -5,  -6,  -2,  22, -17\n    },\n    {\n         -2,  -2,   3,  10,   9,   9,  12, -15,\n         -1, -11, -13,   3,  -2,   1,  -3, -11,\n          7,   9,  16,  -3, -10,  -5,  -5,   1,\n          8,  -3,   9,   9,  -5,   3,  31, -12\n    },\n    {\n          7,  -5,  10,  -4,  -8,   2,  16,  -2,\n         10,  10,  -3,  -2,   3,  -8,  -3,   3,\n        -13,  -6,  15,  20,  -9,  -3, -12,   1,\n         -2, -16,   8,   8,  -1,  16,  22,  -5\n    },\n    {\n          5,  -3, -15,  -2,  12,  -8,   8,  -5,\n          2,  -8,  20, -18,  14,  -4,   3,   3,\n          7, -13, -16,   1, -10,   7,  16,   7,\n          4, -14,  -4,  -5,  -9,   8,  23,  -6\n    },\n    {\n          5,  -4,  -5,  -4,   1,   8,   4,  -7,\n         -5,   8,  10,   6,  -6, -10,  -2,   6,\n          9, -17, -14,  11,  12,  -3, -13,  -7,\n          2,  18,   3, -25, -16,  18,  22,  -5\n    },\n    {\n          5,   6,  -7, -20,  -4,   2,   8,   4,\n        -24,  -4,   1,   4,  -5,  -2,   1, -10,\n         -2,   9,   3,  -4,  -3,  -4,  -4,  -4,\n         10,  10,   3,   0,  -6,  25,  21, -11\n    },\n    {\n          0,   7,  -1,  14,  -6,  -4, -10,   5,\n          4,   4,   4,  -5,   3,   4,  -1,  -7,\n          8, -19,   0,   6,   2,   3, -18,  -3,\n         -6,   2,   8,  14, -26,  22,  27, -13\n    },\n    {\n         -2,  -6,   7,  -5,  12,  -7,   8,  -1,\n          3,  -2,   4,   1,   8,  -2,   0,  14,\n          6,  -5,   6,  -4,  -7,   7, -21,   8,\n          1,   8,  -9,  -4,  -3,  11,  25, -13\n    },\n    {\n          4,   4,  -1,  -6,   4,   9,  -8,   1,\n         -3, -10,  -2,   0,  15,  -9, -16,  11,\n          1,   1,   6,   3,  -9,  -5,  16,  26,\n          1, -14,   1,  -3, -14,   7,  15,  -9\n    },\n    {\n        -12,  -2,  -9, -13,   2,   6,  14,   0,\n          1,   0,  -1, -13,   0,  10,  -1,   6,\n          9,  -7,   8,   8,  19,   6,  -1,   9,\n         10,  -4,   1,  -7, -22,  -2,  29,  -7\n    },\n    {\n          2,   4,  13, -12,  -8,  -4,  -5,  13,\n         12,  -5,  -3,  -3,  -4,   1,  -1,  10,\n         15,  -6,  -1, -11, -30,   4,  15,  -1,\n          9,  -7,   0,  -2,  -7,  10,  25, -16\n    },\n    {\n          7, -15,  -7,  -7,  -1,  -5,  -5, -11,\n        -20,  10,   3, -10,  -3,   5,  20,  -4,\n          0,  -2,  -2,  17,   2,   0,  -3,   3,\n          6,   5,  -1, -12,  -3,  15,  22, -16\n    },\n    {\n          4,  -1,   3,   4,  -5,   0,  -1,  -5,\n        -24, -29,   4,  -9,   1,  -3,   0,   0,\n          0,  -4,   7,  -4,  -4,  -4,   3,   1,\n         -6,   5,  -3,  -5, -10,   3,  25, -10\n    },\n    {\n         -2,  -1,  -1,   4,   4,  -1,   2,   0,\n         -4,  -4,   2,  -1,  -3,  -1,  -2,  -2,\n          1,  -3,  -5,  -1,   2,  -3,  -4,  -4,\n         -3,   5,  -9,   1, -11,   7,  46, -46\n    },\n    {\n          0,  -9,   3,   4,   4,   3,  -5,  -6,\n          5,  -4,   4,  -2,   1,   7,  -4, -10,\n         13,   1,   3,  -6,   4,  -4,   7,   2,\n        -19, -25,  -3, -16, -12,  16,  20,  -1\n    },\n    {\n         18,   6,   4, -12,   0, -14,   9,  -6,\n         -1,  -4,  -5,   2,   1,  12,   4,   2,\n          7,   0,   2,   5, -11,  -5,  -2,   2,\n         -4,  10,   0,  -9,  -7,   9,  25,  -8\n    },\n    {\n          5,   0,  -6,   5,   6,   3,   3, -10,\n         -5,   1,  -1,   4,   3, -11,  -8,   5,\n          4,  -5,   5,  -5,  -7,  -5,  11,   5,\n         20,  -8, -16,  21,  -4,  27,  23,  -5\n    }\n};\n"
  },
  {
    "path": "libdcadec/dca_context.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"common.h\"\n#include \"core_decoder.h\"\n#include \"exss_parser.h\"\n#include \"xll_decoder.h\"\n#include \"lbr_decoder.h\"\n#include \"fixed_math.h\"\n\n#define MAX_PACKET_SIZE     0x104000\n\n#define PACKET_CORE     0x01\n#define PACKET_EXSS     0x02\n#define PACKET_XLL      0x04\n#define PACKET_LBR      0x08\n\n#define PACKET_FILTERED     0x100\n#define PACKET_RECOVERY     0x200\n\n#define dca_warn_once(...) \\\n    dca_format_log(dca, DCADEC_LOG_WARNING | DCADEC_LOG_ONCE, __FILE__, __LINE__, __VA_ARGS__)\n\nstruct dcadec_context {\n    dcadec_log_cb   log_cb;         ///< Logging callback function\n    void            *log_cbarg;     ///< Logging callback argument\n    int             log_shown;      ///< Bitmask of logging levels shown once\n\n    int     flags;  ///< Context flags passed to dcadec_context_create()\n    int     packet; ///< Packet flags set by dcadec_context_parse()\n\n    struct core_decoder *core;  ///< Core decoder context\n    struct exss_parser  *exss;  ///< EXSS parser context\n    struct xll_decoder  *xll;   ///< XLL decoder context\n    struct lbr_decoder  *lbr;   ///< LBR decoder context\n\n    bool    has_residual_encoded;   ///< XLL residual encoded channels present\n    bool    core_residual_valid;    ///< Core valid for residual decoding\n\n    int     *dmix_sample_buffer;    ///< Primary channel set downmixing buffer\n\n    int     status;             ///< Filtering status\n    int     nframesamples;      ///< Number of PCM samples per channel\n    int     sample_rate;        ///< Sample rate in Hz\n    int     bits_per_sample;    ///< PCM resolution in bits\n    int     profile;            ///< Type of DTS profile decoded\n    int     channel_mask;       ///< Channel or speaker mask\n    int     *samples[SPEAKER_COUNT];    ///< Sample buffer pointers\n};\n\nstatic const uint8_t dca2wav_norm[] = {\n    WAVESPKR_FC,  WAVESPKR_FL,  WAVESPKR_FR,  WAVESPKR_SL,\n    WAVESPKR_SR,  WAVESPKR_LFE, WAVESPKR_BC,  WAVESPKR_BL,\n    WAVESPKR_BR,  WAVESPKR_SL,  WAVESPKR_SR,  WAVESPKR_FLC,\n    WAVESPKR_FRC, WAVESPKR_TFL, WAVESPKR_TFC, WAVESPKR_TFR,\n    WAVESPKR_LFE, WAVESPKR_FLC, WAVESPKR_FRC, WAVESPKR_TC,\n    WAVESPKR_TFL, WAVESPKR_TFR, WAVESPKR_TBC, WAVESPKR_TBL,\n    WAVESPKR_TBR, WAVESPKR_BC,  WAVESPKR_BL,  WAVESPKR_BR\n};\n\nstatic const uint8_t dca2wav_wide[] = {\n    WAVESPKR_FC,  WAVESPKR_FL,  WAVESPKR_FR,  WAVESPKR_BL,\n    WAVESPKR_BR,  WAVESPKR_LFE, WAVESPKR_BC,  WAVESPKR_BL,\n    WAVESPKR_BR,  WAVESPKR_SL,  WAVESPKR_SR,  WAVESPKR_FLC,\n    WAVESPKR_FRC, WAVESPKR_TFL, WAVESPKR_TFC, WAVESPKR_TFR,\n    WAVESPKR_LFE, WAVESPKR_SL,  WAVESPKR_SR , WAVESPKR_TC,\n    WAVESPKR_TFL, WAVESPKR_TFR, WAVESPKR_TBC, WAVESPKR_TBL,\n    WAVESPKR_TBR, WAVESPKR_BC,  WAVESPKR_BL,  WAVESPKR_BR\n};\n\nvoid dca_format_log(struct dcadec_context *dca, int level,\n                    const char *file, int line, const char *fmt, ...)\n{\n    char buffer[1024];\n    va_list ap;\n\n    if (!dca || !dca->log_cb)\n        return;\n\n    if (level & DCADEC_LOG_ONCE) {\n        level &= ~DCADEC_LOG_ONCE;\n        if (dca->log_shown & (1 << level))\n            return;\n        dca->log_shown |= 1 << level;\n    }\n\n    va_start(ap, fmt);\n    vsnprintf(buffer, sizeof(buffer), fmt, ap);\n    va_end(ap);\n\n    dca->log_cb(level, file, line, buffer, dca->log_cbarg);\n}\n\nstatic int reorder_samples(struct dcadec_context *dca, int **dca_samples, int dca_mask)\n{\n    int nchannels = 0;\n\n    if (dca->flags & DCADEC_FLAG_NATIVE_LAYOUT) {\n        for (int dca_ch = 0; dca_ch < SPEAKER_COUNT; dca_ch++) {\n            if (dca_mask & (1U << dca_ch)) {\n                if (!dca_samples[dca_ch])\n                    return -DCADEC_EINVAL;\n                dca->samples[nchannels++] = dca_samples[dca_ch];\n            }\n        }\n        dca->channel_mask = dca_mask;\n    } else {\n        int wav_mask = 0;\n        int *wav_samples[WAVESPKR_COUNT] = { NULL };\n        const uint8_t *dca2wav;\n        if (dca_mask == SPEAKER_LAYOUT_7POINT0_WIDE ||\n            dca_mask == SPEAKER_LAYOUT_7POINT1_WIDE)\n            dca2wav = dca2wav_wide;\n        else\n            dca2wav = dca2wav_norm;\n        for (size_t dca_ch = 0; dca_ch < sizeof(dca2wav_norm); dca_ch++) {\n            if (dca_mask & (1 << dca_ch)) {\n                if (!dca_samples[dca_ch])\n                    return -DCADEC_EINVAL;\n                int wav_ch = dca2wav[dca_ch];\n                if (!wav_samples[wav_ch]) {\n                    wav_samples[wav_ch] = dca_samples[dca_ch];\n                    wav_mask |= 1 << wav_ch;\n                }\n            }\n        }\n        for (int wav_ch = 0; wav_ch < WAVESPKR_COUNT; wav_ch++) {\n            if (wav_mask & (1 << wav_ch)) {\n                dca->samples[nchannels++] = wav_samples[wav_ch];\n            }\n        }\n        dca->channel_mask = wav_mask;\n    }\n\n    return nchannels;\n}\n\nstatic bool shift_and_clip__(int *samples, int nsamples, int shift, int bits)\n{\n    bool clipped = false;\n\n    for (int n = 0; n < nsamples; n++) {\n        int s = samples[n] * (1 << shift);\n#ifdef __ARM_FEATURE_SAT\n        s = clip__(s, bits);\n#else\n        if ((s + (1 << bits)) & ~((1 << (bits + 1)) - 1)) {\n            s = (s >> 31) ^ ((1 << bits) - 1);\n            clipped = true;\n        }\n#endif\n        samples[n] = s;\n    }\n\n    return clipped;\n}\n\nstatic bool shift_and_clip(struct dcadec_context *dca, int nchannels,\n                           int storage_bit_res, int pcm_bit_res)\n{\n    int shift = storage_bit_res - pcm_bit_res;\n    int nsamples = dca->nframesamples;\n\n    if (dca->flags & DCADEC_FLAG_DONT_CLIP) {\n        if (shift)\n            for (int ch = 0; ch < nchannels; ch++)\n                for (int n = 0; n < nsamples; n++)\n                    dca->samples[ch][n] *= 1 << shift;\n        return false;\n    }\n\n    bool clipped = false;\n    switch (storage_bit_res) {\n    case 24:\n        for (int ch = 0; ch < nchannels; ch++)\n            clipped |= shift_and_clip__(dca->samples[ch], nsamples, shift, 23);\n        break;\n    case 16:\n        for (int ch = 0; ch < nchannels; ch++)\n            clipped |= shift_and_clip__(dca->samples[ch], nsamples, shift, 15);\n        break;\n    default:\n        assert(0);\n        break;\n    }\n\n    return clipped;\n}\n\nstatic int get_dmix_coeff(int nchannels, int spkr, int ch)\n{\n    switch (spkr) {\n    case SPEAKER_C:\n    case SPEAKER_Cs:\n        return (nchannels == 1) ? 23170 : 16423;\n    case SPEAKER_L:\n        return (ch == 0) ? 23170 : 0;\n    case SPEAKER_R:\n        return (ch == 1) ? 23170 : 0;\n    case SPEAKER_Ls:\n        return (ch == 0) ? 16423 : 0;\n    case SPEAKER_Rs:\n        return (ch == 1) ? 16423 : 0;\n    default:\n        return 0;\n    }\n}\n\nstatic int down_mix_prim_chset(struct dcadec_context *dca,\n                               bool dmix_embedded, int dmix_type,\n                               int *dmix_coeff_cur, int *dmix_coeff_pre,\n                               int **samples, int nsamples, int *ch_mask)\n{\n    // No action if already 2.0\n    if (*ch_mask == SPEAKER_LAYOUT_STEREO)\n        return 0;\n\n    if (dmix_embedded && dmix_type != DMIX_TYPE_LoRo) {\n        dca_warn_once(\"Unsupported primary channel set downmix type (%d)\", dmix_type);\n        dmix_embedded = false;\n    }\n\n    if (!dmix_embedded) {\n        // Remove LFE channel if 2.1\n        if (*ch_mask == SPEAKER_LAYOUT_2POINT1) {\n            *ch_mask = SPEAKER_LAYOUT_STEREO;\n            return 0;\n        }\n\n        // Unless both KEEP_DMIX flags are set, perform 2.0 downmix only when\n        // custom matrix is present\n        if (!(dca->flags & DCADEC_FLAG_KEEP_DMIX_6CH))\n            return 0;\n    }\n\n    assert(nsamples > 1);\n\n    // Reallocate downmix sample buffer\n    if (ta_alloc_fast(dca, &dca->dmix_sample_buffer, 2 * nsamples, sizeof(int)) < 0)\n        return -DCADEC_ENOMEM;\n\n    memset(dca->dmix_sample_buffer, 0, 2 * nsamples * sizeof(int));\n\n    int nchannels = dca_popcount(*ch_mask);\n    int nsamples_log2 = 31 - dca_clz(nsamples);\n\n    // Perform downmix\n    for (int spkr = 0, pos = 0; spkr < SPEAKER_COUNT; spkr++) {\n        if (!(*ch_mask & (1U << spkr)))\n            continue;\n\n        int *src = samples[spkr];\n        int *dst = dca->dmix_sample_buffer;\n\n        for (int ch = 0; ch < 2; ch++) {\n            int coeff_cur, coeff_pre;\n\n            // Use custom matrix if present. Otherwise use default matrix that\n            // covers all supported core audio channel arrangements.\n            if (dmix_embedded) {\n                coeff_cur = dmix_coeff_cur[ch * nchannels + pos];\n                coeff_pre = dmix_coeff_pre[ch * nchannels + pos];\n            } else {\n                coeff_cur = coeff_pre = get_dmix_coeff(nchannels, spkr, ch);\n            }\n\n            int delta = coeff_cur - coeff_pre;\n            if (delta) {\n                // Downmix coefficient interpolation\n                int ramp = 1 << (nsamples_log2 - 1);\n                for (int n = 0; n < nsamples; n++, ramp += delta)\n                    dst[n] += mul15(src[n], coeff_pre + (ramp >> nsamples_log2));\n            } else if (coeff_cur) {\n                for (int n = 0; n < nsamples; n++)\n                    dst[n] += mul15(src[n], coeff_cur);\n            }\n\n            dst += nsamples;\n        }\n\n        pos++;\n    }\n\n    samples[SPEAKER_L] = dca->dmix_sample_buffer;\n    samples[SPEAKER_R] = dca->dmix_sample_buffer + nsamples;\n    *ch_mask = SPEAKER_LAYOUT_STEREO;\n    return 1;\n}\n\nstatic int filter_core_frame(struct dcadec_context *dca)\n{\n    struct core_decoder *core = dca->core;\n\n    // Filter core frame\n    int ret;\n    if ((ret = core_filter(core, dca->flags)) < 0) {\n        dca->core_residual_valid = false;\n        return ret;\n    }\n\n    dca->core_residual_valid = !!(dca->flags & DCADEC_FLAG_CORE_BIT_EXACT);\n\n    // Downmix core channels to Lo/Ro\n    if (dca->flags & DCADEC_FLAG_KEEP_DMIX_2CH) {\n        if ((ret = down_mix_prim_chset(dca,\n                                       core->prim_dmix_embedded,\n                                       core->prim_dmix_type,\n                                       core->prim_dmix_coeff,\n                                       core->prim_dmix_coeff,\n                                       core->output_samples,\n                                       core->npcmsamples,\n                                       &core->ch_mask)) < 0)\n            return ret;\n    }\n\n    // Reorder sample buffer pointers\n    int nchannels;\n    if ((nchannels = reorder_samples(dca, core->output_samples, core->ch_mask)) <= 0)\n        return -DCADEC_EINVAL;\n\n    dca->nframesamples = core->npcmsamples;\n    dca->sample_rate = core->output_rate;\n    dca->bits_per_sample = 24;\n\n    // Set profile\n    if (core->ext_audio_mask & (EXSS_XBR | EXSS_XXCH | EXSS_X96))\n        dca->profile = DCADEC_PROFILE_HD_HRA;\n    else if (core->ext_audio_mask & (CSS_XXCH | CSS_XCH))\n        dca->profile = DCADEC_PROFILE_DS_ES;\n    else if (core->ext_audio_mask & CSS_X96)\n        dca->profile = DCADEC_PROFILE_DS_96_24;\n    else\n        dca->profile = DCADEC_PROFILE_DS;\n\n    // Perform clipping after Lo/Ro downmix\n    if (ret > 0)\n        shift_and_clip(dca, nchannels, 24, 24);\n\n    return 0;\n}\n\nstatic int map_spkr_to_core_spkr(struct core_decoder *core, int spkr)\n{\n    if (core->ch_mask & (1U << spkr))\n        return spkr;\n    if (spkr == SPEAKER_Lss && (core->ch_mask & SPEAKER_MASK_Ls))\n        return SPEAKER_Ls;\n    if (spkr == SPEAKER_Rss && (core->ch_mask & SPEAKER_MASK_Rs))\n        return SPEAKER_Rs;\n    return -1;\n}\n\nstatic bool is_hier_dmix_chset(struct xll_chset *c)\n{\n    return !c->primary_chset && c->dmix_embedded && c->hier_chset;\n}\n\nstatic struct xll_chset *find_next_hier_dmix_chset(struct xll_chset *c)\n{\n    struct xll_decoder *xll = c->decoder;\n\n    if (c->hier_chset)\n        while (++c < &xll->chset[xll->nchsets])\n            if (is_hier_dmix_chset(c))\n                return c;\n\n    return NULL;\n}\n\nstatic void prescale_down_mix(struct xll_chset *c, struct xll_chset *o)\n{\n    int *coeff_ptr = c->dmix_coeff_cur;\n    for (int i = 0; i < c->hier_m; i++) {\n        int scale = o->dmix_scale_cur[i];\n        int scale_inv = o->dmix_scale_inv_cur[i];\n        c->dmix_scale_cur[i] = mul15(c->dmix_scale_cur[i], scale);\n        c->dmix_scale_inv_cur[i] = mul16(c->dmix_scale_inv_cur[i], scale_inv);\n        for (int j = 0; j < c->nchannels; j++) {\n            int coeff = mul16(*coeff_ptr, scale_inv);\n            *coeff_ptr++ = mul15(coeff, o->dmix_scale_cur[c->hier_m + j]);\n        }\n    }\n}\n\nstruct downmix {\n    int *samples[XLL_MAX_BANDS][SPEAKER_COUNT];\n    int *deci_history[SPEAKER_COUNT];\n};\n\nstatic void undo_down_mix(struct xll_chset *c, struct downmix *dmix, int band)\n{\n    struct xll_decoder *xll = c->decoder;\n    struct xll_band *b = &c->bands[band];\n    int nsamples = xll->nframesamples;\n    int nsamples_log2 = xll->nframesamples_log2;\n\n    if (!b->dmix_embedded)\n        return;\n\n    for (int i = 0; i < c->hier_m; i++) {\n        for (int j = 0; j < c->nchannels; j++) {\n            int coeff_cur = c->dmix_coeff_cur[i * c->nchannels + j];\n            int coeff_pre = c->dmix_coeff_pre[i * c->nchannels + j];\n            int delta = coeff_cur - coeff_pre;\n\n            // Undo downmix of channel samples\n            int *src = b->msb_sample_buffer[j];\n            int *dst = dmix->samples[band][i];\n\n            if (delta) {\n                // Downmix coefficient interpolation\n                int ramp = 1 << (nsamples_log2 - 1);\n                for (int k = 0; k < nsamples; k++, ramp += delta)\n                    dst[k] -= mul15(src[k], coeff_pre + (ramp >> nsamples_log2));\n            } else if (coeff_cur) {\n                for (int k = 0; k < nsamples; k++)\n                    dst[k] -= mul15(src[k], coeff_cur);\n            }\n\n            // Undo downmix of decimator history\n            if (band == XLL_BAND_1 && coeff_pre)\n                for (int k = 1; k < XLL_DECI_HISTORY; k++)\n                    dmix->deci_history[i][k] -=\n                        mul15(c->deci_history[j][k], coeff_pre);\n        }\n    }\n}\n\nstatic void scale_down_mix(struct xll_chset *c, struct downmix *dmix, int band)\n{\n    struct xll_decoder *xll = c->decoder;\n    struct xll_band *b = &c->bands[band];\n    int nsamples = xll->nframesamples;\n    int nsamples_log2 = xll->nframesamples_log2;\n\n    if (!b->dmix_embedded)\n        return;\n\n    for (int i = 0; i < c->hier_m; i++) {\n        int scale_cur = c->dmix_scale_cur[i];\n        int scale_pre = c->dmix_scale_pre[i];\n        int delta = scale_cur - scale_pre;\n\n        // Scale down channel samples\n        int *buf = dmix->samples[band][i];\n\n        if (delta) {\n            // Scaling coefficient interpolation\n            int ramp = 1 << (nsamples_log2 - 1);\n            for (int k = 0; k < nsamples; k++, ramp += delta)\n                buf[k] = mul15(buf[k], scale_pre + (ramp >> nsamples_log2));\n        } else if (scale_cur != (1 << 15)) {\n            for (int k = 0; k < nsamples; k++)\n                buf[k] = mul15(buf[k], scale_cur);\n        }\n\n        // Scale down decimator history\n        if (band == XLL_BAND_1 && scale_pre != (1 << 15))\n            for (int k = 1; k < XLL_DECI_HISTORY; k++)\n                dmix->deci_history[i][k] =\n                    mul15(dmix->deci_history[i][k], scale_pre);\n    }\n}\n\nstatic int hier_down_mix(struct xll_decoder *xll)\n{\n    struct downmix dmix;\n    struct xll_chset *c;\n    int i, nchannels = 0;\n\n    // Build channel vectors for active channel sets that are part of hierarchy\n    for (i = 0, c = xll->chset; i < xll->nactivechsets; i++, c++) {\n        if (!c->hier_chset)\n            continue;\n\n        if (nchannels + c->nchannels > SPEAKER_COUNT)\n            return -DCADEC_EINVAL;\n\n        for (int ch = 0; ch < c->nchannels; ch++) {\n            dmix.samples[XLL_BAND_0][nchannels] =\n                c->bands[XLL_BAND_0].msb_sample_buffer[ch];\n            dmix.samples[XLL_BAND_1][nchannels] =\n                c->bands[XLL_BAND_1].msb_sample_buffer[ch];\n            dmix.deci_history[nchannels] = c->deci_history[ch];\n            nchannels++;\n        }\n    }\n\n    // Walk through hierarchial downmix embedded channel sets\n    for (i = 0, c = xll->chset; i < xll->nchsets; i++, c++) {\n        if (!is_hier_dmix_chset(c))\n            continue;\n\n        // Stop once enough channels are decoded for downmixed output\n        if (c->hier_m > nchannels)\n            c->hier_m = nchannels;\n        if (c->hier_m == nchannels) {\n            // Scale down preceding channels in all frequency bands\n            scale_down_mix(c, &dmix, XLL_BAND_0);\n            if (c->nfreqbands > 1)\n                scale_down_mix(c, &dmix, XLL_BAND_1);\n            break;\n        }\n\n        // Undo downmix of preceding channels in all frequency bands\n        undo_down_mix(c, &dmix, XLL_BAND_0);\n        if (c->nfreqbands > 1)\n            undo_down_mix(c, &dmix, XLL_BAND_1);\n    }\n\n    return 0;\n}\n\nstatic int validate_hd_ma_frame(struct dcadec_context *dca)\n{\n    struct xll_decoder *xll = dca->xll;\n    struct xll_chset *p = &xll->chset[0], *c;\n    int i;\n\n    // Validate the first (primary) channel set\n    if (!p->primary_chset) {\n        xll_err_once(\"The first channel set must be primary\");\n        return -DCADEC_ENOSUP;\n    }\n\n    if (!p->ch_mask_enabled && p->nchannels != 2) {\n        xll_err_once(\"Unsupported number of channels with channel mask \"\n                     \"disabled for primary channel set (%d)\", p->nchannels);\n        return -DCADEC_ENOSUP;\n    }\n\n    if (p->storage_bit_res != 16 && p->storage_bit_res != 24) {\n        xll_err_once(\"Unsupported storage bit resolution for \"\n                     \"primary channel set (%d)\", p->storage_bit_res);\n        return -DCADEC_ENOSUP;\n    }\n\n    if (p->pcm_bit_res > p->storage_bit_res) {\n        xll_err(\"Invalid PCM bit resolution for primary channel set (%d > %d)\",\n                p->pcm_bit_res, p->storage_bit_res);\n        return -DCADEC_EINVAL;\n    }\n\n    // Validate channel sets\n    dca->has_residual_encoded = false;\n    for (i = 0, c = xll->chset; i < xll->nactivechsets; i++, c++) {\n        if (i > 0) {\n            if (c->primary_chset) {\n                xll_err_once(\"Multiple primary channel sets are not supported\");\n                return -DCADEC_ENOSUP;\n            }\n\n            if (!c->ch_mask_enabled) {\n                xll_err_once(\"Secondary channel sets with channel mask \"\n                             \"disabled are not supported\");\n                return -DCADEC_ENOSUP;\n            }\n\n            if (c->dmix_embedded && !c->hier_chset) {\n                xll_err_once(\"Channel sets with embedded parallel downmix \"\n                             \"are not supported\");\n                return -DCADEC_ENOSUP;\n            }\n\n            if (c->freq != p->freq || c->pcm_bit_res != p->pcm_bit_res\n                || c->storage_bit_res != p->storage_bit_res\n                || c->nfreqbands != p->nfreqbands) {\n                xll_err_once(\"Channel sets with different audio \"\n                             \"characteristics are not supported\");\n                return -DCADEC_ENOSUP;\n            }\n        }\n\n        if (c->interpolate) {\n            xll_err_once(\"Channel sets with sampling frequency modifier \"\n                         \"are not supported\");\n            return -DCADEC_ENOSUP;\n        }\n\n        dca->has_residual_encoded |= c->residual_encode != (1 << c->nchannels) - 1;\n    }\n\n    // Verify that core is compatible if there are residual encoded channel sets\n    if (dca->has_residual_encoded) {\n        if (!(dca->packet & PACKET_CORE)) {\n            xll_err(\"Residual encoded channels are present without core\");\n            return -DCADEC_EINVAL;\n        }\n\n        int rate = dca->core->sample_rate;\n        int nsamples = dca->core->npcmblocks * NUM_PCMBLOCK_SAMPLES;\n\n        // Double sampling frequency if needed\n        if (p->freq == 96000 && rate == 48000) {\n            rate *= 2;\n            nsamples *= 2;\n        }\n\n        if (p->freq != rate) {\n            xll_err_once(\"Sample rate mismatch between core (%d) and XLL (%d)\",\n                         rate, p->freq);\n            return -DCADEC_ENOSUP;\n        }\n\n        if (xll->nframesamples != nsamples) {\n            xll_err(\"Number of samples per frame mismatch between core (%d) \"\n                    \"and XLL (%d)\", nsamples, xll->nframesamples);\n            return -DCADEC_EINVAL;\n        }\n    }\n\n    return 0;\n}\n\nstatic void force_lossy_output(struct core_decoder *core, struct xll_chset *c)\n{\n    // Clear all band data\n    xll_clear_band_data(c, XLL_BAND_0);\n    if (c->nfreqbands > 1)\n        xll_clear_band_data(c, XLL_BAND_1);\n\n    // Replace non-residual encoded channels with lossy counterparts\n    for (int ch = 0; ch < c->nchannels; ch++) {\n        if (!(c->residual_encode & (1 << ch)))\n            continue;\n        int spkr = xll_map_ch_to_spkr(c, ch);\n        if (spkr < 0)\n            continue;\n        int core_spkr = map_spkr_to_core_spkr(core, spkr);\n        if (core_spkr < 0)\n            continue;\n        c->residual_encode &= ~(1 << ch);\n    }\n}\n\nstatic int filter_residual_core_frame(struct dcadec_context *dca)\n{\n    struct core_decoder *core = dca->core;\n    struct xll_decoder *xll = dca->xll;\n    int i, ret, flags = DCADEC_FLAG_CORE_BIT_EXACT | DCADEC_FLAG_KEEP_DMIX_6CH;\n    struct xll_chset *c;\n\n    // Double sampling frequency if needed\n    if (xll->chset->freq == 96000 && core->sample_rate == 48000)\n        flags |= DCADEC_FLAG_CORE_SYNTH_X96;\n\n    // Filter core frame\n    if ((ret = core_filter(core, flags)) < 0) {\n        dca->core_residual_valid = false;\n        return ret;\n    }\n\n    // Force lossy downmixed output if this is the first core frame since\n    // the last time history was cleared, or XLL decoder is recovering from sync loss\n    if ((dca->has_residual_encoded && !dca->core_residual_valid && xll->nchsets > 1) ||\n        (dca->packet & PACKET_RECOVERY)) {\n        for (i = 0, c = xll->chset; i < xll->nchsets; i++, c++) {\n            if (i < xll->nactivechsets)\n                force_lossy_output(core, c);\n\n            if (!c->primary_chset)\n                c->dmix_embedded = false;\n        }\n\n        xll->scalable_lsbs = false;\n        xll->fixed_lsb_width = 0;\n    }\n\n    dca->core_residual_valid = true;\n    return 0;\n}\n\nstatic int combine_residual_core_frame(struct dcadec_context *dca,\n                                       struct xll_chset *c)\n{\n    struct core_decoder *core = dca->core;\n    struct xll_decoder *xll = dca->xll;\n    int nsamples = xll->nframesamples;\n    int nsamples_log2 = xll->nframesamples_log2;\n\n    if (c->freq != core->output_rate)\n        return -DCADEC_EINVAL;\n\n    if (nsamples != core->npcmsamples)\n        return -DCADEC_EINVAL;\n\n    // See if this channel set is downmixed and find the next channel set in\n    // hierarchy. If downmixed, undo core pre-scaling before combining with\n    // residual (residual is not scaled).\n    struct xll_chset *o = find_next_hier_dmix_chset(c);\n\n    // Reduce core bit width and combine with residual\n    for (int ch = 0; ch < c->nchannels; ch++) {\n        if (c->residual_encode & (1 << ch))\n            continue;\n\n        int spkr = xll_map_ch_to_spkr(c, ch);\n        if (spkr < 0)\n            return -DCADEC_EINVAL;\n\n        int core_spkr = map_spkr_to_core_spkr(core, spkr);\n        if (core_spkr < 0)\n            return -DCADEC_EINVAL;\n\n        int shift = 24 - c->pcm_bit_res;\n        // Account for LSB width\n        if (xll->scalable_lsbs)\n            shift += xll_get_lsb_width(c, XLL_BAND_0, ch);\n        if (shift > 24)\n            return -DCADEC_EINVAL;\n        int round = shift > 0 ? 1 << (shift - 1) : 0;\n\n        int *dst = c->bands[XLL_BAND_0].msb_sample_buffer[ch];\n        int *src = core->output_samples[core_spkr];\n        if (o) {\n            // Undo embedded core downmix pre-scaling\n            int scale_inv_cur = o->dmix_scale_inv_cur[c->hier_m + ch];\n            int scale_inv_pre = o->dmix_scale_inv_pre[c->hier_m + ch];\n            int delta = scale_inv_cur - scale_inv_pre;\n\n            if (delta) {\n                // Scaling coefficient interpolation\n                int ramp = 1 << (nsamples_log2 - 1);\n                for (int n = 0; n < nsamples; n++, ramp += delta) {\n                    int scale_inv = scale_inv_pre + (ramp >> nsamples_log2);\n                    dst[n] += clip23((mul16(src[n], scale_inv) + round) >> shift);\n                }\n            } else {\n                for (int n = 0; n < nsamples; n++)\n                    dst[n] += clip23((mul16(src[n], scale_inv_cur) + round) >> shift);\n            }\n        } else {\n            // No downmix scaling\n            for (int n = 0; n < nsamples; n++)\n                dst[n] += (src[n] + round) >> shift;\n        }\n    }\n\n    return 0;\n}\n\nstatic int filter_hd_ma_frame(struct dcadec_context *dca)\n{\n    struct xll_decoder *xll = dca->xll;\n    struct xll_chset *p = &xll->chset[0], *c;\n    int ret, i;\n\n    // Filter core frame if present\n    if (dca->packet & PACKET_CORE)\n        if ((ret = filter_residual_core_frame(dca)) < 0)\n            return ret;\n\n    // Prepare downmixing coefficients for all channel sets\n    for (i = xll->nchsets - 1, c = &xll->chset[i]; i >= 0; i--, c--) {\n        // Pre-scale by next channel set in hierarchy\n        if (is_hier_dmix_chset(c)) {\n            struct xll_chset *o = find_next_hier_dmix_chset(c);\n            if (o)\n                prescale_down_mix(c, o);\n        }\n\n        // Flip buffers and mark downmix coefficients valid for the next frame\n        c->dmix_coeffs_signature = XLL_DMIX_SIGNATURE(c);\n        c->dmix_coeffs_parity ^= true;\n    }\n\n    // Process frequency bands for active channel sets\n    for (i = 0, c = xll->chset; i < xll->nactivechsets; i++, c++) {\n        xll_filter_band_data(c, XLL_BAND_0);\n\n        // Check for residual encoded channel set\n        if (c->residual_encode != (1 << c->nchannels) - 1)\n            if ((ret = combine_residual_core_frame(dca, c)) < 0)\n                return ret;\n\n        // Assemble MSB and LSB parts after combining with core\n        if (xll->scalable_lsbs)\n            xll_assemble_msbs_lsbs(c, XLL_BAND_0);\n\n        if (c->nfreqbands > 1) {\n            xll_filter_band_data(c, XLL_BAND_1);\n            xll_assemble_msbs_lsbs(c, XLL_BAND_1);\n        }\n    }\n\n    // Undo hierarchial downmix and/or apply scaling\n    if (xll->nchsets > 1 && (ret = hier_down_mix(xll)) < 0)\n        return ret;\n\n    // Assemble frequency bands 0 and 1 for active channel sets\n    if (xll->nfreqbands > 1 && (ret = xll_assemble_freq_bands(xll)) < 0)\n        return ret;\n\n    // Output speaker map and channel mask\n    int *spkr_map[SPEAKER_COUNT] = { NULL };\n    int ch_mask = 0;\n\n    // Fake up channel mask for primary channel set if needed for LtRt decoding\n    if (!p->ch_mask_enabled) {\n        if (p->nchannels == 2)\n            p->ch_mask = SPEAKER_LAYOUT_STEREO;\n        else\n            return -DCADEC_EINVAL;\n    }\n\n    // Build the output speaker map\n    for (i = 0, c = xll->chset; i < xll->nactivechsets; i++, c++) {\n        for (int ch = 0; ch < c->nchannels; ch++) {\n            int spkr = xll_map_ch_to_spkr(c, ch);\n            if (spkr < 0)\n                return -DCADEC_EINVAL;\n            if (spkr_map[spkr])\n                return -DCADEC_EINVAL;\n            spkr_map[spkr] = c->out_sample_buffer[ch];\n        }\n        ch_mask |= c->ch_mask;\n    }\n\n    // Normalize to regular 5.1 layout if downmixing\n    if (dca->flags & DCADEC_FLAG_KEEP_DMIX_MASK) {\n        if (ch_mask & SPEAKER_MASK_Lss) {\n            spkr_map[SPEAKER_Ls] = spkr_map[SPEAKER_Lss];\n            ch_mask = (ch_mask & ~SPEAKER_MASK_Lss) | SPEAKER_MASK_Ls;\n        }\n        if (ch_mask & SPEAKER_MASK_Rss) {\n            spkr_map[SPEAKER_Rs] = spkr_map[SPEAKER_Rss];\n            ch_mask = (ch_mask & ~SPEAKER_MASK_Rss) | SPEAKER_MASK_Rs;\n        }\n    }\n\n    // Downmix primary channel set to Lo/Ro\n    if (dca->flags & DCADEC_FLAG_KEEP_DMIX_2CH) {\n        if ((ret = down_mix_prim_chset(dca,\n                                       p->dmix_embedded,\n                                       p->dmix_type,\n                                       p->dmix_coeff_cur,\n                                       p->dmix_coeff_pre,\n                                       spkr_map,\n                                       xll->nframesamples << (xll->nfreqbands - 1),\n                                       &ch_mask)) < 0)\n            return ret;\n    }\n\n    // Reorder sample buffer pointers\n    int nchannels;\n    if ((nchannels = reorder_samples(dca, spkr_map, ch_mask)) <= 0)\n        return -DCADEC_EINVAL;\n\n    dca->nframesamples = xll->nframesamples << (xll->nfreqbands - 1);\n    dca->sample_rate = p->freq << (xll->nfreqbands - 1);\n    dca->bits_per_sample = p->storage_bit_res;\n    dca->profile = DCADEC_PROFILE_HD_MA;\n\n    // Shift and clip samples to account for storage bit width\n    bool clipped = shift_and_clip(dca, nchannels, p->storage_bit_res, p->pcm_bit_res);\n\n    // Warn if this frame has not been decoded losslessly\n    if ((dca->packet & PACKET_RECOVERY) || xll->nfailedsegs > 0)\n        return DCADEC_WXLLLOSSY;\n\n    // Warn if clipping was detected in lossless output\n    if (clipped && !(dca->flags & DCADEC_FLAG_KEEP_DMIX_MASK))\n        return DCADEC_WXLLCLIPPED;\n\n    return 0;\n}\n\nstatic int filter_lbr_frame(struct dcadec_context *dca)\n{\n    struct lbr_decoder *lbr = dca->lbr;\n    int ret;\n\n    if ((ret = lbr_filter(lbr)) < 0)\n        return ret;\n\n    if ((ret = reorder_samples(dca, lbr->output_samples, lbr->output_mask)) <= 0)\n        return -DCADEC_EINVAL;\n\n    dca->nframesamples = 1024 << lbr->freq_range;\n    dca->sample_rate = lbr->sample_rate;\n    dca->bits_per_sample = 24;\n    dca->profile = DCADEC_PROFILE_EXPRESS;\n\n    shift_and_clip(dca, ret, 24, 24);\n    return 0;\n}\n\nstatic int alloc_core_decoder(struct dcadec_context *dca)\n{\n    if (!dca->core) {\n        if (!(dca->core = ta_znew(dca, struct core_decoder)))\n            return -DCADEC_ENOMEM;\n        dca->core->ctx = dca;\n        dca->core->x96_rand = 1;\n    }\n    return 0;\n}\n\nstatic int alloc_exss_parser(struct dcadec_context *dca)\n{\n    if (!dca->exss) {\n        if (!(dca->exss = ta_znew(dca, struct exss_parser)))\n            return -DCADEC_ENOMEM;\n        dca->exss->ctx = dca;\n    }\n    return 0;\n}\n\nstatic int alloc_xll_decoder(struct dcadec_context *dca)\n{\n    if (!dca->xll) {\n        if (!(dca->xll = ta_znew(dca, struct xll_decoder)))\n            return -DCADEC_ENOMEM;\n        dca->xll->ctx = dca;\n        dca->xll->flags = dca->flags;\n    }\n    return 0;\n}\n\nstatic int alloc_lbr_decoder(struct dcadec_context *dca)\n{\n    if (!dca->lbr) {\n        if (!(dca->lbr = ta_znew(dca, struct lbr_decoder)))\n            return -DCADEC_ENOMEM;\n        dca->lbr->ctx = dca;\n        dca->lbr->ctx_flags = dca->flags;\n        dca->lbr->lbr_rand = 1;\n    }\n    return 0;\n}\n\nDCADEC_API int dcadec_context_parse(struct dcadec_context *dca, uint8_t *data, size_t size)\n{\n    int status = 0, ret;\n\n    if (!dca || !data || size < 4 || size > MAX_PACKET_SIZE || ((uintptr_t)data & 3))\n        return -DCADEC_EINVAL;\n\n    int prev_packet = dca->packet;\n    dca->packet = 0;\n\n    // Parse backward compatible core sub-stream\n    if (DCA_MEM32NE(data) == DCA_32BE_C(SYNC_WORD_CORE)) {\n        if ((ret = alloc_core_decoder(dca)) < 0)\n            return ret;\n        if ((ret = core_parse(dca->core, data, size, dca->flags, NULL)) < 0) {\n            dca->core_residual_valid = false;\n            return ret;\n        }\n        if (ret > status)\n            status = ret;\n\n        dca->packet |= PACKET_CORE;\n\n        // EXXS data must be aligned on 4-byte boundary by the caller\n        size_t frame_size = DCA_ALIGN(dca->core->frame_size, 4);\n        if (size - 4 > frame_size) {\n            data += frame_size;\n            size -= frame_size;\n        }\n    }\n\n    struct exss_asset *asset = NULL;\n\n    // Parse extension sub-stream (EXSS)\n    if (DCA_MEM32NE(data) == DCA_32BE_C(SYNC_WORD_EXSS)) {\n        if ((ret = alloc_exss_parser(dca)) < 0)\n            return ret;\n        if ((ret = exss_parse(dca->exss, data, size)) < 0) {\n            if (dca->flags & DCADEC_FLAG_STRICT)\n                return ret;\n            status = DCADEC_WEXSSFAILED;\n        } else {\n            dca->packet |= PACKET_EXSS;\n            asset = &dca->exss->assets[0];\n        }\n    }\n\n    // Parse coding components in the first EXSS asset\n    if (dca->packet & PACKET_EXSS) {\n        // Parse core component in EXSS\n        if (!(dca->packet & PACKET_CORE) && (asset->extension_mask & EXSS_CORE)) {\n            if ((ret = alloc_core_decoder(dca)) < 0)\n                return ret;\n            if ((ret = core_parse(dca->core, data, size, dca->flags, asset)) < 0) {\n                dca->core_residual_valid = false;\n                return ret;\n            }\n            if (ret > status)\n                status = ret;\n\n            dca->packet |= PACKET_CORE;\n        }\n\n        // Parse XLL component in EXSS\n        if (!(dca->flags & DCADEC_FLAG_CORE_ONLY) && (asset->extension_mask & EXSS_XLL)) {\n            if ((ret = alloc_xll_decoder(dca)) < 0)\n                return ret;\n            if ((ret = xll_parse(dca->xll, data, asset)) < 0) {\n                // Conceal XLL synchronization error\n                if (ret == -DCADEC_ENOSYNC &&\n                    (prev_packet & PACKET_XLL) &&\n                    (dca->packet & PACKET_CORE)) {\n                    dca->packet |= PACKET_XLL | PACKET_RECOVERY;\n                    status = DCADEC_WXLLSYNCERR;\n                } else {\n                    if (dca->flags & DCADEC_FLAG_STRICT)\n                        return ret;\n                    status = DCADEC_WXLLFAILED;\n                }\n            } else {\n                dca->packet |= PACKET_XLL;\n                if (dca->xll->nfailedsegs)\n                    status = DCADEC_WXLLBANDERR;\n            }\n        }\n\n        // Parse LBR component in EXSS\n        if (!(dca->flags & DCADEC_FLAG_CORE_ONLY) && (asset->extension_mask & EXSS_LBR)) {\n            if ((ret = alloc_lbr_decoder(dca)) < 0)\n                return ret;\n            if ((ret = lbr_parse(dca->lbr, data, size, asset)) < 0) {\n                if (dca->flags & DCADEC_FLAG_STRICT)\n                    return ret;\n            } else {\n                dca->packet |= PACKET_LBR;\n            }\n        }\n    }\n\n    if (!dca->packet)\n        return -DCADEC_ENOSYNC;\n\n    // Parse core extensions in EXSS or backward compatible core sub-stream\n    if (!(dca->flags & DCADEC_FLAG_CORE_ONLY) && (dca->packet & PACKET_CORE)) {\n        if ((ret = core_parse_exss(dca->core, data, dca->flags, asset)) < 0)\n            return ret;\n        if (ret > status)\n            status = ret;\n    }\n\n    return status;\n}\n\nDCADEC_API struct dcadec_core_info *dcadec_context_get_core_info(struct dcadec_context *dca)\n{\n    if (dca && (dca->packet & PACKET_CORE))\n        return core_get_info(dca->core);\n    return NULL;\n}\n\nDCADEC_API void dcadec_context_free_core_info(struct dcadec_core_info *info)\n{\n    ta_free(info);\n}\n\nDCADEC_API struct dcadec_exss_info *dcadec_context_get_exss_info(struct dcadec_context *dca)\n{\n    if (dca) {\n        if (dca->packet & PACKET_EXSS)\n            return exss_get_info(dca->exss);\n        if (dca->packet & PACKET_CORE)\n            return core_get_info_exss(dca->core);\n    }\n    return NULL;\n}\n\nDCADEC_API void dcadec_context_free_exss_info(struct dcadec_exss_info *info)\n{\n    ta_free(info);\n}\n\nDCADEC_API int dcadec_context_filter(struct dcadec_context *dca, int ***samples,\n                                     int *nsamples, int *channel_mask,\n                                     int *sample_rate, int *bits_per_sample,\n                                     int *profile)\n{\n    int ret;\n\n    if (!dca)\n        return -DCADEC_EINVAL;\n\n    if (!(dca->packet & PACKET_FILTERED)) {\n        if (dca->packet & PACKET_LBR) {\n            if ((ret = filter_lbr_frame(dca)) < 0)\n                return ret;\n        } else if (dca->packet & PACKET_XLL) {\n            if ((ret = validate_hd_ma_frame(dca)) < 0) {\n                if (dca->flags & DCADEC_FLAG_STRICT)\n                    return ret;\n                if (!(dca->packet & PACKET_CORE))\n                    return ret;\n                if ((ret = filter_core_frame(dca)) < 0)\n                    return ret;\n                ret = DCADEC_WXLLCONFERR;\n            } else {\n                if ((ret = filter_hd_ma_frame(dca)) < 0)\n                    return ret;\n            }\n        } else if (dca->packet & PACKET_CORE) {\n            if ((ret = filter_core_frame(dca)) < 0)\n                return ret;\n        } else {\n            return -DCADEC_EINVAL;\n        }\n        dca->status = ret;\n        dca->packet |= PACKET_FILTERED;\n    }\n\n    if (samples)\n        *samples = dca->samples;\n    if (nsamples)\n        *nsamples = dca->nframesamples;\n    if (channel_mask)\n        *channel_mask = dca->channel_mask;\n    if (sample_rate)\n        *sample_rate = dca->sample_rate;\n    if (bits_per_sample)\n        *bits_per_sample = dca->bits_per_sample;\n    if (profile)\n        *profile = dca->profile;\n    return dca->status;\n}\n\nDCADEC_API void dcadec_context_clear(struct dcadec_context *dca)\n{\n    if (dca) {\n        core_clear(dca->core);\n        xll_clear(dca->xll);\n        lbr_clear(dca->lbr);\n        dca->core_residual_valid = false;\n    }\n}\n\nDCADEC_API struct dcadec_context *dcadec_context_create(int flags)\n{\n    struct dcadec_context *dca = ta_znew(NULL, struct dcadec_context);\n    if (dca)\n        dca->flags = flags;\n    return dca;\n}\n\nDCADEC_API void dcadec_context_destroy(struct dcadec_context *dca)\n{\n    ta_free(dca);\n}\n\nDCADEC_API void dcadec_context_set_log_cb(struct dcadec_context *dca,\n                                          dcadec_log_cb log_cb,\n                                          void *log_cbarg)\n{\n    if (dca) {\n        dca->log_cb = log_cb;\n        dca->log_cbarg = log_cbarg;\n        dca->log_shown = 0;\n    }\n}\n\nDCADEC_API const char *dcadec_strerror(int errnum)\n{\n    static const char * const errors[] = {\n        \"Invalid argument\",\n        \"Invalid bitstream format\",\n        \"CRC check failed\",\n        \"Bitstream navigation error\",\n        \"Synchronization error\",\n        \"Unsupported feature\",\n        \"Memory allocation error\",\n        \"PCM output overflow\",\n        \"I/O error\",\n        \"PCM output parameters changed\"\n    };\n\n    static const char * const warnings[] = {\n        \"Failed to parse core auxiliary data\",\n        \"Failed to parse core extension\",\n        \"Failed to parse EXSS\",\n        \"Failed to parse XLL\",\n        \"XLL synchronization error\",\n        \"XLL frequency band error\",\n        \"XLL configuration error\",\n        \"Clipping detected in XLL output\",\n        \"XLL output not lossless\"\n    };\n\n    if (errnum < 0) {\n        unsigned int err = -errnum - 1;\n        if (err < dca_countof(errors))\n            return errors[err];\n        else\n            return \"Unspecified error\";\n    } else if (errnum > 0) {\n        unsigned int warn = errnum - 1;\n        if (warn < dca_countof(warnings))\n            return warnings[warn];\n        else\n            return \"Unspecified warning\";\n    } else {\n        return \"No error\";\n    }\n}\n\nDCADEC_API unsigned int dcadec_version(void)\n{\n    return DCADEC_API_VERSION;\n}\n"
  },
  {
    "path": "libdcadec/dca_context.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef DCA_CONTEXT_H\n#define DCA_CONTEXT_H\n\n#include <stdlib.h>\n#include <stdint.h>\n#include <stdbool.h>\n\n/**@{*/\n/** Make compact version code that can be compared easily */\n#define DCADEC_VERSION_CODE(major, minor, patch) \\\n    (((major) << 24) | ((minor) << 12) | (patch) | 0U)\n\n/**\n * Version of libdcadec API. Major number gets bumped at each API change that\n * breaks backward compatibility. Minor number gets bumped at each API change\n * that remains compatible. Patch is reserved for non-API related changes.\n */\n#define DCADEC_API_VERSION_MAJOR    0\n#define DCADEC_API_VERSION_MINOR    1\n#define DCADEC_API_VERSION_PATCH    0\n\n#define DCADEC_API_VERSION \\\n    DCADEC_VERSION_CODE(DCADEC_API_VERSION_MAJOR, \\\n                        DCADEC_API_VERSION_MINOR, \\\n                        DCADEC_API_VERSION_PATCH)\n/**@}*/\n\n/**@{*/\n#if (defined _WIN32)\n#define DCADEC_SHARED_EXPORT    __declspec(dllexport)\n#define DCADEC_SHARED_IMPORT    __declspec(dllimport)\n#elif (__GNUC__ >= 4)\n#define DCADEC_SHARED_EXPORT    __attribute__((visibility(\"default\")))\n#define DCADEC_SHARED_IMPORT    __attribute__((visibility(\"default\")))\n#else\n#define DCADEC_SHARED_EXPORT\n#define DCADEC_SHARED_IMPORT\n#endif\n\n#ifdef DCADEC_SHARED\n#ifdef DCADEC_INTERNAL\n#define DCADEC_API  DCADEC_SHARED_EXPORT\n#else\n#define DCADEC_API  DCADEC_SHARED_IMPORT\n#endif\n#else\n#define DCADEC_API\n#endif\n/**@}*/\n\n/**@{*/\n#define DCADEC_EINVAL       1   /**< Invalid argument */\n#define DCADEC_EBADDATA     2   /**< Invalid bitstream format */\n#define DCADEC_EBADCRC      3   /**< CRC check failed */\n#define DCADEC_EBADREAD     4   /**< Bitstream navigation error */\n#define DCADEC_ENOSYNC      5   /**< Synchronization error */\n#define DCADEC_ENOSUP       6   /**< Unsupported feature */\n#define DCADEC_ENOMEM       7   /**< Memory allocation error */\n#define DCADEC_EOVERFLOW    8   /**< PCM output overflow */\n#define DCADEC_EIO          9   /**< I/O error */\n#define DCADEC_EOUTCHG     10   /**< PCM output parameters changed */\n#define DCADEC_EFAIL       32   /**< Unspecified error */\n/**@}*/\n\n/**@{*/\n#define DCADEC_WCOREAUXFAILED   1   /**< Failed to parse core auxiliary data */\n#define DCADEC_WCOREEXTFAILED   2   /**< Failed to parse core extension */\n#define DCADEC_WEXSSFAILED      3   /**< Failed to parse EXSS */\n#define DCADEC_WXLLFAILED       4   /**< Failed to parse XLL */\n#define DCADEC_WXLLSYNCERR      5   /**< XLL synchronization error */\n#define DCADEC_WXLLBANDERR      6   /**< XLL frequency band error */\n#define DCADEC_WXLLCONFERR      7   /**< XLL configuration error */\n#define DCADEC_WXLLCLIPPED      8   /**< Clipping detected in XLL output */\n#define DCADEC_WXLLLOSSY        9   /**< XLL output not lossless */\n/**@}*/\n\n/**@{*/\n/** Decode DTS core only without extensions */\n#define DCADEC_FLAG_CORE_ONLY           0x01\n\n/** Force bit exact DTS core decoding */\n#define DCADEC_FLAG_CORE_BIT_EXACT      0x02\n\n/**\n * Force DTS core synthesis using X96 filter, with high frequency subbands set\n * to zero. If actual X96 data is present, it is discarded when this flag is\n * set. Effectively doubles output sample rate.\n */\n#define DCADEC_FLAG_CORE_SYNTH_X96      0x04\n\n/** Use IIR filter for floating point DTS core LFE channel interpolation */\n#define DCADEC_FLAG_CORE_LFE_IIR        0x08\n\n/** Use FIR filter for floating point DTS core LFE channel interpolation */\n#define DCADEC_FLAG_CORE_LFE_FIR        0x10\n\n/**\n * Extract embedded 2.0 downmix if present (or perform 5.1 to 2.0 downmix if\n * custom downmixing coefficients are present), otherwise extract 5.1 downmix.\n */\n#define DCADEC_FLAG_KEEP_DMIX_2CH       0x20\n\n/** Extract embedded 5.1 downmix (always present for 6.1 and 7.1 content) */\n#define DCADEC_FLAG_KEEP_DMIX_6CH       0x40\n\n/** Output native DTS channel layout, not WAVEFORMATEXTENSIBLE layout */\n#define DCADEC_FLAG_NATIVE_LAYOUT       0x80\n\n/** Don't conceal errors */\n#define DCADEC_FLAG_STRICT              0x100\n\n/** Don't clip returned PCM samples to output bit depth */\n#define DCADEC_FLAG_DONT_CLIP           0x200\n/**@}*/\n\n/**@{*/\n#define DCADEC_PROFILE_UNKNOWN  0       /**< Unknown Profile */\n#define DCADEC_PROFILE_DS       0x01    /**< Digital Surround */\n#define DCADEC_PROFILE_DS_96_24 0x02    /**< Digital Surround 96/24 */\n#define DCADEC_PROFILE_DS_ES    0x04    /**< Digital Surround ES */\n#define DCADEC_PROFILE_HD_HRA   0x08    /**< High Resolution Audio */\n#define DCADEC_PROFILE_HD_MA    0x10    /**< Master Audio */\n#define DCADEC_PROFILE_EXPRESS  0x20    /**< Express */\n/**@}*/\n\n/**@{*/\n/** Not matrix encoded */\n#define DCADEC_MATRIX_ENCODING_NONE         0\n\n/**< Encoded for matrix surround decoding */\n#define DCADEC_MATRIX_ENCODING_SURROUND     1\n\n/**< Audio processed for headphone playback */\n#define DCADEC_MATRIX_ENCODING_HEADPHONE    2\n/**@}*/\n\n/**@{*/\n#define DCADEC_LOG_ERROR    0\n#define DCADEC_LOG_WARNING  1\n#define DCADEC_LOG_INFO     2\n#define DCADEC_LOG_VERBOSE  3\n#define DCADEC_LOG_DEBUG    4\n/**@}*/\n\n/**\n * Size in bytes of empty padding that must be present after the end of input\n * buffer. libdcadec may overread the input buffer up to this number of bytes.\n */\n#define DCADEC_BUFFER_PADDING   8\n\nstruct dcadec_context;\n\nstruct dcadec_core_info {\n    int     nchannels;      /**< Number of primary audio channels */\n    int     audio_mode;     /**< Core audio channel arrangement (AMODE) */\n    int     lfe_present;    /**< LFE channel presence flag (can be 0, 1 or 2) */\n    int     sample_rate;    /**< Core audio sample rate in Hz */\n    int     source_pcm_res; /**< Source PCM resolution in bits */\n    bool    es_format;      /**< Extended surround (ES) mastering flag */\n    int     bit_rate;       /**< Core stream bit rate in bytes per second,\n                                 zero or negative if unavailable */\n    int     npcmblocks;     /**< Number of audio sample blocks in a frame */\n    bool    ext_audio_present;  /**< Extended audio present */\n    int     ext_audio_type;     /**< Extended audio type (only meaningful\n                                     when ext_audio_present is true) */\n};\n\nstruct dcadec_exss_info {\n    int nchannels;          /**< Number of audio channels encoded among all\n                                 extension sub-streams */\n    int sample_rate;        /**< Maximum encoded audio sample rate in Hz */\n    int bits_per_sample;    /**< Highest encoded PCM resolution in bits */\n    int profile;            /**< Type of DTS profile encoded */\n    bool embedded_stereo;   /**< 2.0 downmix has been embedded into the stream */\n    bool embedded_6ch;      /**< 5.1 downmix has been embedded into the stream */\n    int spkr_mask;          /**< Speaker activity mask, zero if unavailable */\n    int matrix_encoding;    /**< Matrix encoding type */\n};\n\ntypedef void (*dcadec_log_cb)(int level, const char *file, int line,\n                              const char *message, void *cbarg);\n\n/**\n * Parse DTS packet. Packet data must be already converted into 16-bit\n * big-endian format. Caller must have already established byte stream\n * synchronization. Packet must start with a valid 32-bit sync word. EXSS frame\n * must be aligned on 4-byte boundary if present in the packet.\n *\n * @param dca   Pointer to decoder context.\n *\n * @param data  Pointer to packet data buffer. Buffer must be aligned on 4-byte\n *              boundary and padded at the end with DCADEC_BUFFER_PADDING bytes.\n *\n * @param size  Size in bytes of packet data. Size should not include padding.\n *\n * @return      0 or positive warning code on success, negative error code on\n *              failure.\n */\nDCADEC_API int dcadec_context_parse(struct dcadec_context *dca, uint8_t *data, size_t size);\n\n/**\n * Get information about DTS core payload of the parsed packet.\n *\n * @param dca   Pointer to decoder context.\n *\n * @return      Pointer to DTS core information structure on success,\n *              NULL on failure. Returned data should be freed with\n *              dcadec_context_free_core_info() function.\n */\nDCADEC_API struct dcadec_core_info *dcadec_context_get_core_info(struct dcadec_context *dca);\n\n/**\n * Free DTS core information structure.\n *\n * @param info  Pointer to DTS core information structure.\n */\nDCADEC_API void dcadec_context_free_core_info(struct dcadec_core_info *info);\n\n/**\n * Get information about extension sub-stream (EXSS) payload of the parsed\n * packet. When no EXSS is present information about extended audio in core\n * sub-stream is returned.\n *\n * @param dca   Pointer to decoder context.\n *\n * @return      Pointer to EXSS information structure on success,\n *              NULL on failure. Returned data should be freed with\n *              dcadec_context_free_exss_info() function.\n */\nDCADEC_API struct dcadec_exss_info *dcadec_context_get_exss_info(struct dcadec_context *dca);\n\n/**\n * Free EXSS information structure.\n *\n * @param info  Pointer to EXSS information structure.\n */\nDCADEC_API void dcadec_context_free_exss_info(struct dcadec_exss_info *info);\n\n/**\n * Filter the parsed packet and return per-channel PCM data. All parameters\n * except decoder context are optional and can be NULL. This function should be\n * called at least once after each successfull call to dcadec_context_parse().\n * Multiple calls per packet are allowed and return the same data.\n *\n * @param dca       Pointer to decoder context.\n *\n * @param samples   Filled with address of array of pointers to planes\n *                  containing PCM data for active channels. This data is valid\n *                  until the next call to dcadec_context_parse() or _destroy().\n *                  Returned array is tightly packed, there are no gaps for\n *                  missing channels. Use channel_mask to determine total number\n *                  of channels and size of returned array. By default channels\n *                  are ordered according to WAVEFORMATEXTENSIBLE specification,\n *                  but if DCADEC_FLAG_NATIVE_LAYOUT flag was set when creating\n *                  decoder context, returned channels are in native DTS order.\n *\n * @param nsamples  Filled with number of PCM samples in each returned plane.\n *\n * @param channel_mask  Filled with bit mask indicating active channels. 1 at\n *                      the given bit position (counting from the least\n *                      significant bit) means that the channel is present in\n *                      the array of pointers to planes, 0 otherwise. Number of\n *                      bits set to 1 indicates the total number of planes\n *                      returned.\n *\n * @param sample_rate       Filled with decoded audio sample rate in Hz.\n *\n * @param bits_per_sample   Filled with decoded audio PCM resolution in bits.\n *\n * @param profile           Filled with type of DTS profile actually decoded.\n *                          This can be different from encoded profile since\n *                          certain extensions may be not decoded.\n *\n * @return                  0 or positive warning code on success, negative\n *                          error code on failure. Return value of 0 indicates\n *                          that no errors affecting audio integrity were\n *                          detected. When profile indicates Master Audio,\n *                          positive return value indicates that audio has not\n *                          been losslessly reconstructed for at least some part\n *                          of this frame.\n */\nDCADEC_API int dcadec_context_filter(struct dcadec_context *dca, int ***samples,\n                                     int *nsamples, int *channel_mask,\n                                     int *sample_rate, int *bits_per_sample,\n                                     int *profile);\n\n/**\n * Clear all inter-frame history of the decoder. Call this before parsing\n * packets out of sequence, e.g. after seeking to the arbitrary position within\n * the DTS stream.\n *\n * @param dca   Pointer to decoder context.\n */\nDCADEC_API void dcadec_context_clear(struct dcadec_context *dca);\n\n/**\n * Create DTS decoder context.\n *\n * @param flags Any number of DCADEC_FLAG_* constants OR'ed together.\n *\n * @return      Pointer to decoder context on success, NULL on failure.\n */\nDCADEC_API struct dcadec_context *dcadec_context_create(int flags);\n\n/**\n * Destroy DTS decoder context.\n *\n * @param dca   Pointer to decoder context.\n */\nDCADEC_API void dcadec_context_destroy(struct dcadec_context *dca);\n\n/**\n * Set or clear logging callback for decoder context.\n *\n * @param dca       Pointer to decoder context.\n *\n * @param log_cb    Pointer to logging callback function. Pass NULL to disable\n *                  logging.\n *\n * @param log_cbarg Opaque pointer that will be passed through to callback\n *                  function.\n */\nDCADEC_API void dcadec_context_set_log_cb(struct dcadec_context *dca,\n                                          dcadec_log_cb log_cb,\n                                          void *log_cbarg);\n\n/**\n * Convert negative libdcadec error code or positive warning code into string.\n *\n * @param errnum    Error or warning code returned by libdcadec function.\n *\n * @return          Constant string describing error or warning code.\n */\nDCADEC_API const char *dcadec_strerror(int errnum);\n\n/**\n * Get libdcadec API version.\n *\n * @return  API version code of the currently running libdcadec.\n */\nDCADEC_API unsigned int dcadec_version(void);\n\n#endif\n"
  },
  {
    "path": "libdcadec/dca_frame.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"common.h\"\n#include \"bitstream.h\"\n#include \"dca_frame.h\"\n\n#define SRC_OP(E) \\\n    uint16_t src_0 = DCA_16##E(_src[0]); \\\n    uint16_t src_1 = DCA_16##E(_src[1]); \\\n    uint16_t src_2 = DCA_16##E(_src[2]); \\\n    uint16_t src_3 = DCA_16##E(_src[3]); \\\n    uint16_t src_4 = DCA_16##E(_src[4]); \\\n    uint16_t src_5 = DCA_16##E(_src[5]); \\\n    uint16_t src_6 = DCA_16##E(_src[6]); \\\n    uint16_t src_7 = DCA_16##E(_src[7]);\n\n#define DST_OP \\\n    _dst[0] = DCA_16BE((src_0 <<  2) | ((src_1 & 0x3fff) >> 12)); \\\n    _dst[1] = DCA_16BE((src_1 <<  4) | ((src_2 & 0x3fff) >> 10)); \\\n    _dst[2] = DCA_16BE((src_2 <<  6) | ((src_3 & 0x3fff) >>  8)); \\\n    _dst[3] = DCA_16BE((src_3 <<  8) | ((src_4 & 0x3fff) >>  6)); \\\n    _dst[4] = DCA_16BE((src_4 << 10) | ((src_5 & 0x3fff) >>  4)); \\\n    _dst[5] = DCA_16BE((src_5 << 12) | ((src_6 & 0x3fff) >>  2)); \\\n    _dst[6] = DCA_16BE((src_6 << 14) | ((src_7 & 0x3fff) >>  0));\n\nDCADEC_API int dcadec_frame_convert_bitstream(uint8_t *dst, size_t *dst_size,\n                                              const uint8_t *src, size_t src_size)\n{\n    const uint16_t *_src = (const uint16_t *)src;\n    uint16_t *_dst = (uint16_t *)dst;\n    size_t count;\n\n    if (!dst || !dst_size || !src || src_size < 4 || ((uintptr_t)_dst & 3))\n        return -DCADEC_EINVAL;\n\n    if ((uintptr_t)_src & 1)\n        _src = memcpy(_dst, _src, src_size);\n\n    switch (DCA_MEM32NE(_src)) {\n    case DCA_32BE_C(SYNC_WORD_CORE):\n    case DCA_32BE_C(SYNC_WORD_EXSS):\n        if (_src != _dst)\n            memcpy(_dst, _src, src_size);\n        *dst_size = src_size;\n        return DCADEC_BITSTREAM_BE16;\n\n    case DCA_32BE_C(SYNC_WORD_CORE_LE):\n    case DCA_32BE_C(SYNC_WORD_EXSS_LE):\n        count = (src_size + 1) / 2;\n        while (count--)\n            *_dst++ = dca_bswap16(*_src++);\n        *dst_size = src_size;\n        return DCADEC_BITSTREAM_LE16;\n\n    case DCA_32BE_C(SYNC_WORD_CORE_BE14):\n        count = (src_size + 15) / 16;\n        while (count--) {\n            SRC_OP(BE)\n            DST_OP\n            _src += 8;\n            _dst += 7;\n        }\n        *dst_size = src_size - src_size / 8;\n        return DCADEC_BITSTREAM_BE14;\n\n    case DCA_32BE_C(SYNC_WORD_CORE_LE14):\n        count = (src_size + 15) / 16;\n        while (count--) {\n            SRC_OP(LE)\n            DST_OP\n            _src += 8;\n            _dst += 7;\n        }\n        *dst_size = src_size - src_size / 8;\n        return DCADEC_BITSTREAM_LE14;\n\n    default:\n        return -DCADEC_ENOSYNC;\n    }\n}\n\n#undef SRC_OP\n#undef DST_OP\n\nDCADEC_API int dcadec_frame_parse_header(const uint8_t *data, size_t *size)\n{\n    struct bitstream bits;\n    uint8_t header[DCADEC_FRAME_HEADER_SIZE];\n    size_t header_size, frame_size;\n\n    if (!data || !size)\n        return -DCADEC_EINVAL;\n\n    int ret;\n    if ((ret = dcadec_frame_convert_bitstream(header, &header_size,\n                                              data, DCADEC_FRAME_HEADER_SIZE)) < 0)\n        return ret;\n\n    bits_init(&bits, header, header_size);\n\n    switch (bits_get(&bits, 32)) {\n    case SYNC_WORD_CORE: {\n        bool normal_frame = bits_get1(&bits);\n        int deficit_samples = bits_get(&bits, 5) + 1;\n        if (normal_frame && deficit_samples != 32)\n            return -DCADEC_ENOSYNC;\n        bits_skip1(&bits);\n        int npcmblocks = bits_get(&bits, 7) + 1;\n        if ((npcmblocks & 7) && (npcmblocks < 6 || normal_frame))\n            return -DCADEC_ENOSYNC;\n        frame_size = bits_get(&bits, 14) + 1;\n        if (frame_size < 96)\n            return -DCADEC_ENOSYNC;\n        if (ret & DCADEC_BITSTREAM_BE14)\n            *size = frame_size * 8 / 14 * 2;\n        else\n            *size = frame_size;\n        return DCADEC_FRAME_TYPE_CORE;\n    }\n\n    case SYNC_WORD_EXSS: {\n        bits_skip(&bits, 10);\n        bool wide_hdr = bits_get1(&bits);\n        header_size = bits_get(&bits, 8 + 4 * wide_hdr) + 1;\n        if ((header_size & 3) || header_size < DCADEC_FRAME_HEADER_SIZE)\n            return -DCADEC_ENOSYNC;\n        frame_size = bits_get(&bits, 16 + 4 * wide_hdr) + 1;\n        if ((frame_size & 3) || frame_size < header_size)\n            return -DCADEC_ENOSYNC;\n        *size = frame_size;\n        return DCADEC_FRAME_TYPE_EXSS;\n    }\n\n    default:\n        return -DCADEC_ENOSYNC;\n    }\n}\n\nDCADEC_API size_t dcadec_frame_buffer_size(size_t size)\n{\n    size_t padding = -size & (DCADEC_FRAME_BUFFER_ALIGN - 1);\n    if (padding < DCADEC_BUFFER_PADDING)\n        padding = DCADEC_BUFFER_PADDING;\n    if (padding > SIZE_MAX - size)\n        padding = SIZE_MAX - size;\n    return size + padding;\n}\n"
  },
  {
    "path": "libdcadec/dca_frame.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef DCA_FRAME_H\n#define DCA_FRAME_H\n\n#include \"dca_context.h\"\n\n/**\n * Minimum size alignment, in bytes, of source and destination buffers that must\n * be passed to dcadec_frame_convert_bitstream().\n */\n#define DCADEC_FRAME_BUFFER_ALIGN   16\n\n/**\n * Minimum size of data buffer, in bytes, that must be passed to\n * dcadec_frame_parse_header().\n */\n#define DCADEC_FRAME_HEADER_SIZE    16\n\n/**@{*/\n#define DCADEC_BITSTREAM_BE16   0\n#define DCADEC_BITSTREAM_LE16   1\n#define DCADEC_BITSTREAM_BE14   2\n#define DCADEC_BITSTREAM_LE14   3\n/**@}*/\n\n/**@{*/\n#define DCADEC_FRAME_TYPE_CORE  0   /**< Backward compatible DTS core */\n#define DCADEC_FRAME_TYPE_EXSS  1   /**< Extension sub-stream (EXSS) */\n/**@}*/\n\n/**\n * Convert the raw input frame into native 16-bit big-endian format understood\n * by dcadec_context_parse(). Can operate in-place when destination buffer\n * is the same as source buffer. In all other cases destination and source\n * buffers must not overlap.\n *\n * @param dst       Pointer to destination buffer. Destination buffer size\n *                  must be no less than source buffer size, including\n *                  padding to the next multiple of DCADEC_FRAME_BUFFER_ALIGN.\n *                  Destination buffer must be aligned on 4-byte boundary in\n *                  memory.\n *\n * @param dst_size  Filled with resulting frame size after conversion, in bytes.\n *\n * @param src       Pointer to source buffer that must start with a valid sync\n *                  word. Source buffer size must be no less than src_size bytes\n *                  plus padding to the next multiple of\n *                  DCADEC_FRAME_BUFFER_ALIGN. Source buffer can have any\n *                  alignment in memory.\n *\n * @param src_size  Size of raw frame data prior to conversion, in bytes. Size\n *                  should not include padding.\n *\n * @return          Detected bitstream format on success, negative error code\n *                  on failure.\n */\nDCADEC_API int dcadec_frame_convert_bitstream(uint8_t *dst, size_t *dst_size,\n                                              const uint8_t *src, size_t src_size);\n\n/**\n * Check that the passed data buffer starts with a valid sync word and satisfies\n * the basic requirements to be a valid DTS core or EXSS frame header.\n *\n * @param data      Pointer to data buffer that possibly contains the frame\n *                  header. The first DCADEC_FRAME_HEADER_SIZE bytes are read\n *                  from the buffer.\n *\n * @param size      Filled with raw frame size, in bytes. Frame size includes\n *                  sync word and header bytes.\n *\n * @return          Detected frame type on success, negative error code\n *                  on failure.\n */\nDCADEC_API int dcadec_frame_parse_header(const uint8_t *data, size_t *size);\n\n/**\n * Given the raw frame size returned by dcadec_frame_parse_header(), calculate\n * minimum required buffer size for performing bitstream format conversion and\n * (possibly) parsing the frame.\n *\n * It is recommended to use this function instead of calculating buffer size\n * manually based on DCADEC_FRAME_BUFFER_ALIGN and DCADEC_BUFFER_PADDING\n * constants since padding requirements may change in the future and older\n * headers might not reflect this.\n *\n * @param size      Raw frame size, in bytes.\n *\n * @return          Buffer size, in bytes, padded to the minimum value that\n *                  satisfies both dcadec_frame_convert_bitstream() alignment\n *                  requirement and dcadec_context_parse() padding requirement.\n */\nDCADEC_API size_t dcadec_frame_buffer_size(size_t size);\n\n#endif\n"
  },
  {
    "path": "libdcadec/dca_stream.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"common.h\"\n#include \"bitstream.h\"\n#include \"dca_frame.h\"\n#include \"dca_stream.h\"\n\n#ifdef _WIN32\n#include <windows.h>\n#include <fcntl.h>\n#include <io.h>\n#else\n#include <unistd.h>\n#endif\n\n#define BUFFER_ALIGN    4096\n\n#define AUPR_HDR    UINT64_C(0x415550522D484452)\n#define DTSHDHDR    UINT64_C(0x4454534844484452)\n#define STRMDATA    UINT64_C(0x5354524D44415441)\n\n#if (defined _WIN32)\n#define DCA_FGETC   _fgetc_nolock\n#elif (defined _BSD_SOURCE)\n#define DCA_FGETC   fgetc_unlocked\n#else\n#define DCA_FGETC   fgetc\n#endif\n\nstruct dcadec_stream {\n    FILE    *fp;    ///< Input file\n\n    off_t   stream_size;    ///< Size of stream data\n    off_t   stream_start;   ///< Starting position of stream data in file\n    off_t   stream_end;     ///< Ending position of stream data in file\n\n    bool        aupr_present;           ///< Audio presentation header flag\n    uint32_t    aupr_sample_rate;       ///< Audio sample rate in Hz\n    uint32_t    aupr_nframes;           ///< Number of encoded frames\n    uint32_t    aupr_nframesamples;     ///< Number of PCM samples in each encoded frame\n    uint64_t    aupr_npcmsamples;       ///< Number of PCM samples in original audio\n    uint32_t    aupr_ch_mask;           ///< Channel mask in EXSS format\n    uint32_t    aupr_ndelaysamples;     ///< Codec delay in PCM samples\n\n    uint8_t     *buffer;        ///< Packet buffer\n    size_t      packet_size;    ///< Size of packet\n    uint32_t    backup_sync;    ///< Backed-up sync word\n\n    bool    core_plus_exss;     ///< Whether previous packet was core plus extension substream\n};\n\n// Check for DTS-HD container format. Such files have an extra `blackout'\n// frame at the end that we don't wont to parse. Called only if the stream\n// is seekable.\nstatic int parse_hd_hdr(struct dcadec_stream *stream)\n{\n    uint64_t header[2];\n\n    if (fread(header, sizeof(header), 1, stream->fp) != 1)\n        return fseeko(stream->fp, 0, SEEK_SET);\n\n    if (header[0] != DCA_64BE_C(DTSHDHDR))\n        return fseeko(stream->fp, 0, SEEK_SET);\n\n    while (true) {\n        uint64_t size = DCA_64BE(header[1]);\n        if (size > INT64_MAX)\n            return -1;\n\n        switch (header[0]) {\n        case DCA_64BE_C(STRMDATA): {\n            off_t pos = ftello(stream->fp);\n            if (pos < 0)\n                return -1;\n            stream->stream_size = size;\n            stream->stream_start = pos;\n            stream->stream_end = pos + size;\n            return 1;\n        }\n\n        case DCA_64BE_C(AUPR_HDR): {\n            uint8_t data[21];\n\n            if (size < sizeof(data))\n                return -1;\n            if (fread(data, sizeof(data), 1, stream->fp) != 1)\n                return -1;\n            if (fseeko(stream->fp, size - sizeof(data), SEEK_CUR) < 0)\n                return -1;\n\n            stream->aupr_present = true;\n\n            // Sample rate in Hz\n            stream->aupr_sample_rate = DCA_MEM24BE(&data[3]);\n\n            // Number of frames\n            stream->aupr_nframes = DCA_MEM32BE(&data[6]);\n\n            // Number of PCM samples per frame\n            stream->aupr_nframesamples = DCA_MEM16BE(&data[10]);\n\n            // Number of PCM samples encoded\n            stream->aupr_npcmsamples = DCA_MEM40BE(&data[12]);\n\n            // EXSS channel mask\n            stream->aupr_ch_mask = DCA_MEM16BE(&data[17]);\n\n            // Codec delay in samples\n            stream->aupr_ndelaysamples = DCA_MEM16BE(&data[19]);\n            break;\n        }\n\n        default:\n            if (fseeko(stream->fp, size, SEEK_CUR) < 0)\n                return -1;\n            break;\n        }\n\n        if (fread(header, sizeof(header), 1, stream->fp) != 1)\n            return -1;\n    }\n\n    return -1;\n}\n\nstatic int parse_wav_hdr(struct dcadec_stream *stream)\n{\n    uint32_t header[2];\n\n    if (fread(header, sizeof(header), 1, stream->fp) != 1)\n        goto rewind;\n\n    if (header[0] != DCA_32LE_C(TAG_RIFF))\n        goto rewind;\n\n    if (fread(header, sizeof(header[0]), 1, stream->fp) != 1)\n        goto rewind;\n\n    if (header[0] != DCA_32LE_C(TAG_WAVE))\n        goto rewind;\n\n    while (true) {\n        if (fread(header, sizeof(header), 1, stream->fp) != 1)\n            return -1;\n\n        uint32_t size = DCA_32LE(header[1]);\n\n        if (header[0] == DCA_32LE_C(TAG_data)) {\n            off_t pos = ftello(stream->fp);\n            if (pos < 0)\n                return -1;\n            if (size) {\n                stream->stream_size = size;\n                stream->stream_start = pos;\n                stream->stream_end = pos + size;\n            }\n            return 1;\n        }\n\n        if (fseeko(stream->fp, size, SEEK_CUR) < 0)\n            return -1;\n    }\n\n    return -1;\n\nrewind:\n    return fseeko(stream->fp, 0, SEEK_SET);\n}\n\nDCADEC_API struct dcadec_stream *dcadec_stream_open(const char *name, int flags)\n{\n    (void)flags;\n\n    struct dcadec_stream *stream = ta_znew(NULL, struct dcadec_stream);\n    if (!stream)\n        return NULL;\n\n    if (name) {\n        if (!(stream->fp = fopen(name, \"rb\")))\n            goto fail1;\n    } else {\n        int fd;\n#ifdef _WIN32\n        if ((fd = _dup(STDIN_FILENO)) < 0)\n            goto fail1;\n        if (_setmode(fd, _O_BINARY) < 0) {\n            _close(fd);\n            goto fail1;\n        }\n        if (!(stream->fp = _fdopen(fd, \"rb\"))) {\n            _close(fd);\n            goto fail1;\n        }\n#else\n        if ((fd = dup(STDIN_FILENO)) < 0)\n            goto fail1;\n        if (!(stream->fp = fdopen(fd, \"rb\"))) {\n            close(fd);\n            goto fail1;\n        }\n#endif\n    }\n\n    bool can_seek = true;\n#ifdef _WIN32\n    can_seek = GetFileType((HANDLE)_get_osfhandle(_fileno(stream->fp))) == FILE_TYPE_DISK;\n#endif\n\n    if (can_seek && !fseeko(stream->fp, 0, SEEK_END)) {\n        off_t pos = ftello(stream->fp);\n        if (pos > 0)\n            stream->stream_size = pos;\n        if (fseeko(stream->fp, 0, SEEK_SET) < 0)\n            goto fail2;\n        if (pos > 0) {\n            int ret;\n            if ((ret = parse_hd_hdr(stream)) < 0 ||\n                (!ret && parse_wav_hdr(stream) < 0))\n                goto fail2;\n        }\n    }\n\n    if (!(stream->buffer = ta_zalloc_size(stream, BUFFER_ALIGN * 2)))\n        goto fail2;\n\n    return stream;\n\nfail2:\n    fclose(stream->fp);\nfail1:\n    ta_free(stream);\n    return NULL;\n}\n\nDCADEC_API void dcadec_stream_close(struct dcadec_stream *stream)\n{\n    if (stream) {\n        fclose(stream->fp);\n        ta_free(stream);\n    }\n}\n\nstatic uint8_t *prepare_packet_buffer(struct dcadec_stream *stream, size_t size)\n{\n    size_t old_size = ta_get_size(stream->buffer);\n    size_t new_size = DCA_ALIGN(stream->packet_size + size, BUFFER_ALIGN);\n\n    if (old_size < new_size) {\n        uint8_t *buf = ta_realloc_size(stream, stream->buffer, new_size);\n        if (buf) {\n            memset(buf + old_size, 0, new_size - old_size);\n            stream->buffer = buf;\n        } else {\n            return NULL;\n        }\n    }\n\n    return stream->buffer + stream->packet_size;\n}\n\nstatic int read_frame(struct dcadec_stream *stream, uint32_t *sync_p)\n{\n    uint8_t header[DCADEC_FRAME_HEADER_SIZE], *buf;\n    size_t frame_size;\n    int ret;\n\n    // Stop at position indicated by STRMDATA if known\n    if (stream->stream_end > 0 && ftello(stream->fp) >= stream->stream_end)\n        return 0;\n\n    // Start with a backed up sync word. If there is none, advance one byte at\n    // a time until proper sync word is read from the input byte stream.\n    uint32_t sync = stream->backup_sync;\n    while (sync != SYNC_WORD_CORE\n        && sync != SYNC_WORD_EXSS\n        && sync != SYNC_WORD_CORE_LE\n        && sync != SYNC_WORD_EXSS_LE\n        && sync != SYNC_WORD_CORE_LE14\n        && sync != SYNC_WORD_CORE_BE14) {\n        int c = DCA_FGETC(stream->fp);\n        if (c == EOF)\n            return 0;\n        sync = (sync << 8) | c;\n    }\n\n    // Tried to read the second (EXSS) frame and it was core again. Back up\n    // the sync word just read and return.\n    if ((sync != SYNC_WORD_EXSS && sync != SYNC_WORD_EXSS_LE) && !sync_p) {\n        stream->backup_sync = sync;\n        return -DCADEC_ENOSYNC;\n    }\n\n    // Clear backed up sync word\n    stream->backup_sync = 0;\n\n    // Restore sync word\n    header[0] = (sync >> 24) & 0xff;\n    header[1] = (sync >> 16) & 0xff;\n    header[2] = (sync >>  8) & 0xff;\n    header[3] = (sync >>  0) & 0xff;\n\n    // Read the frame header\n    if (fread(header + 4, sizeof(header) - 4, 1, stream->fp) != 1)\n        return 0;\n\n    // Parse and validate the frame header\n    if ((ret = dcadec_frame_parse_header(header, &frame_size)) < 0)\n        return ret;\n\n    // Reallocate packet buffer\n    if (!(buf = prepare_packet_buffer(stream, dcadec_frame_buffer_size(frame_size))))\n        return -DCADEC_ENOMEM;\n\n    // Restore frame header\n    memcpy(buf, header, sizeof(header));\n\n    // Read the rest of the frame\n    if (fread(buf + sizeof(header), frame_size - sizeof(header), 1, stream->fp) != 1)\n        return 0;\n\n    // Convert the frame in place\n    if ((ret = dcadec_frame_convert_bitstream(buf, &frame_size, buf, frame_size)) < 0)\n        return ret;\n\n    // Align frame size to 4-byte boundary\n    stream->packet_size += DCA_ALIGN(frame_size, 4);\n\n    if (sync_p)\n        *sync_p = sync;\n    return 1;\n}\n\nDCADEC_API int dcadec_stream_read(struct dcadec_stream *stream, uint8_t **data, size_t *size)\n{\n    uint32_t sync;\n    int ret;\n\n    if (!stream || !data || !size)\n        return -DCADEC_EINVAL;\n\n    // Loop until valid DTS core or standalone EXSS frame is read or EOF is\n    // reached\n    while (true) {\n        ret = read_frame(stream, &sync);\n        if (ret == 1)\n            break;\n        if (ret == 0)\n            return ferror(stream->fp) ? -DCADEC_EIO : 0;\n        if (ret < 0 && ret != -DCADEC_ENOSYNC)\n            return ret;\n    }\n\n    // Check for EXSS that may follow core frame and try to concatenate both\n    // frames into single packet\n    if (sync == SYNC_WORD_CORE || sync == SYNC_WORD_CORE_LE) {\n        ret = read_frame(stream, NULL);\n        if (ret < 0 && ret != -DCADEC_ENOSYNC)\n            return ret;\n        // If the previous frame was core + EXSS, skip the incomplete (core\n        // only) frame at end of file\n        if (ret == 0 && stream->core_plus_exss)\n            return 0;\n        stream->core_plus_exss = (ret == 1);\n    } else {\n        stream->core_plus_exss = false;\n    }\n\n    *data = stream->buffer;\n    *size = stream->packet_size;\n\n    stream->packet_size = 0;\n    return 1;\n}\n\nDCADEC_API int dcadec_stream_progress(struct dcadec_stream *stream)\n{\n    if (stream && stream->stream_size > 0) {\n        off_t pos = ftello(stream->fp);\n        if (pos < stream->stream_start)\n            return 0;\n        if (pos >= stream->stream_start + stream->stream_size)\n            return 100;\n        return (int)((pos - stream->stream_start) * 100 / stream->stream_size);\n    }\n    return -1;\n}\n\nDCADEC_API struct dcadec_stream_info *dcadec_stream_get_info(struct dcadec_stream *stream)\n{\n    if (!stream || !stream->aupr_present)\n        return NULL;\n    struct dcadec_stream_info *info = ta_znew(NULL, struct dcadec_stream_info);\n    if (!info)\n        return NULL;\n\n    info->stream_size = stream->stream_size;\n    info->sample_rate = stream->aupr_sample_rate;\n    info->nframes = stream->aupr_nframes;\n    info->nframesamples = stream->aupr_nframesamples;\n    info->npcmsamples = stream->aupr_npcmsamples;\n    info->ch_mask = stream->aupr_ch_mask;\n    info->ndelaysamples = stream->aupr_ndelaysamples;\n    return info;\n}\n\nDCADEC_API void dcadec_stream_free_info(struct dcadec_stream_info *info)\n{\n    ta_free(info);\n}\n"
  },
  {
    "path": "libdcadec/dca_stream.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef DCA_STREAM_H\n#define DCA_STREAM_H\n\n#include \"dca_context.h\"\n\nstruct dcadec_stream;\n\nstruct dcadec_stream_info {\n    uint64_t    stream_size;    /**< Size of encoded DTS stream data, in bytes */\n    uint32_t    sample_rate;    /**< Audio sample rate in Hz */\n    uint32_t    nframes;        /**< Total number of encoded frames */\n    uint32_t    nframesamples;  /**< Number of PCM samples in each encoded frame */\n    uint64_t    npcmsamples;    /**< Total number of PCM samples in original audio */\n    uint32_t    ch_mask;        /**< Channel mask in EXSS format */\n    uint32_t    ndelaysamples;  /**< Codec delay in PCM samples */\n};\n\n/**\n * Open DTS stream from file or standard input.\n *\n * @param name  Name of the file to be opened. Pass NULL to open standard input.\n *\n * @param flags Currently unused, should be 0.\n *\n * @return      Stream handle on success, NULL on failure.\n */\nDCADEC_API struct dcadec_stream *dcadec_stream_open(const char *name, int flags);\n\n/**\n * Close DTS stream.\n *\n * @param stream    Stream handle.\n */\nDCADEC_API void dcadec_stream_close(struct dcadec_stream *stream);\n\n/**\n * Establish synchronization and read the next packet from DTS stream.\n *\n * @param stream    Stream handle.\n *\n * @param data  Filled with pointer to packet data. This data is only\n *              valid until the next call to dcadec_stream_read() or\n *              dcadec_stream_close() functions. Packet data is padded\n *              with DCADEC_BUFFER_PADDING bytes at the end and can be\n *              directly passed to dcadec_context_parse() function.\n *\n * @param size  Filled with size of packet data, in bytes.\n *\n * @return      Positive value on success, 0 on EOF, negative error code on\n *              failure.\n */\nDCADEC_API int dcadec_stream_read(struct dcadec_stream *stream, uint8_t **data, size_t *size);\n\n/**\n * Return DTS stream progress percentage based on current file position.\n *\n * @param stream    Stream handle.\n *\n * @return      Progress value in range 0-100 on success, -1 on failure.\n */\nDCADEC_API int dcadec_stream_progress(struct dcadec_stream *stream);\n\n/**\n * Get audio presentation information from DTS-HD container. For raw DTS streams\n * this function always fails.\n *\n * @param stream    Stream handle.\n *\n * @return      Pointer to information structure on success,\n *              NULL on failure. Returned data should be freed with\n *              dcadec_stream_free_info() function.\n */\nDCADEC_API struct dcadec_stream_info *dcadec_stream_get_info(struct dcadec_stream *stream);\n\n/**\n * Free audio presentation information structure.\n *\n * @param info  Pointer to information structure.\n */\nDCADEC_API void dcadec_stream_free_info(struct dcadec_stream_info *info);\n\n#endif\n"
  },
  {
    "path": "libdcadec/dca_waveout.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"common.h\"\n#include \"dca_waveout.h\"\n\n#ifdef _WIN32\n#include <windows.h>\n#include <fcntl.h>\n#include <io.h>\n#else\n#include <unistd.h>\n#endif\n\nstruct dcadec_waveout {\n    FILE        *fp[SPEAKER_COUNT]; ///< Output file(s)\n    uint64_t    size;       ///< Size of PCM data written\n    uint8_t     *buffer;    ///< PCM data conversion buffer\n    char        *pattern;   ///< Filename pattern for writing multiple mono files\n    int         flags;      ///< Option flags passed to dcadec_waveout_open()\n\n    int         channel_mask;       ///< WAVEFORMATEXTENSIBLE channel mask\n    int         nchannels;          ///< Number of channels\n    int         sample_rate;        ///< Audio sample rate\n    int         bits_per_sample;    ///< Audio PCM resolution\n    int         bytes_per_sample;   ///< Number of bytes per sample\n    int         block_align;        ///< Alignment of PCM data block\n};\n\nstatic const char * const dca_speaker_names[] = {\n    \"C\",    \"L\",    \"R\",    \"Ls\",\n    \"Rs\",   \"LFE\",  \"Cs\",   \"Lsr\",\n    \"Rsr\",  \"Lss\",  \"Rss\",  \"Lc\",\n    \"Rc\",   \"Lh\",   \"Ch\",   \"Rh\",\n    \"LFE2\", \"Lw\",   \"Rw\",   \"Oh\",\n    \"Lhs\",  \"Rhs\",  \"Chr\",  \"Lhr\",\n    \"Rhr\",  \"Cl\",   \"Ll\",   \"Rl\",\n    \"RSV1\", \"RSV2\", \"RSV3\", \"RSV4\"\n};\n\nstruct header_buf {\n    uint8_t data[68];\n    size_t  size;\n};\n\nstatic void write_u16(struct header_buf *buf, int v)\n{\n    assert(buf->size <= sizeof(buf->data) - 2);\n    buf->data[buf->size + 0] = (v >> 0) & 0xff;\n    buf->data[buf->size + 1] = (v >> 8) & 0xff;\n    buf->size += 2;\n}\n\nstatic void write_u32(struct header_buf *buf, int v)\n{\n    assert(buf->size <= sizeof(buf->data) - 4);\n    buf->data[buf->size + 0] = (v >>  0) & 0xff;\n    buf->data[buf->size + 1] = (v >>  8) & 0xff;\n    buf->data[buf->size + 2] = (v >> 16) & 0xff;\n    buf->data[buf->size + 3] = (v >> 24) & 0xff;\n    buf->size += 4;\n}\n\nstatic int write_header(struct dcadec_waveout *wave, FILE *fp)\n{\n    bool extensible = !(wave->flags & DCADEC_WAVEOUT_FLAG_MONO);\n\n    struct header_buf buf;\n    buf.size = 0;\n\n    write_u32(&buf, TAG_RIFF);\n    if (wave->size && wave->size <= UINT32_MAX - (36 + 24 * extensible))\n        write_u32(&buf, (uint32_t)(wave->size + 36 + 24 * extensible));\n    else\n        write_u32(&buf, 0);\n\n    write_u32(&buf, TAG_WAVE);\n\n    write_u32(&buf, TAG_fmt);\n    write_u32(&buf, 16 + 24 * extensible);\n\n    // wFormatTag\n    write_u16(&buf, extensible ? 0xfffe : 0x0001);\n\n    // nChannels\n    write_u16(&buf, extensible ? wave->nchannels : 1);\n\n    // nSamplesPerSec\n    write_u32(&buf, wave->sample_rate);\n\n    // nAvgBytesPerSec\n    write_u32(&buf, wave->sample_rate * wave->block_align);\n\n    // nBlockAlign\n    write_u16(&buf, wave->block_align);\n\n    // wBitsPerSample\n    write_u16(&buf, wave->bytes_per_sample << 3);\n\n    if (extensible) {\n        // cbSize\n        write_u16(&buf, 22);\n\n        // wValidBitsPerSample\n        write_u16(&buf, wave->bits_per_sample);\n\n        // dwChannelMask\n        write_u32(&buf, wave->channel_mask);\n\n        // SubFormat\n        write_u32(&buf, 1);\n        write_u32(&buf, 0x00100000);\n        write_u32(&buf, 0xaa000080);\n        write_u32(&buf, 0x719b3800);\n    }\n\n    write_u32(&buf, TAG_data);\n    if (wave->size <= UINT32_MAX)\n        write_u32(&buf, (uint32_t)wave->size);\n    else\n        write_u32(&buf, 0);\n\n    if (fwrite(buf.data, buf.size, 1, fp) != 1)\n        return -DCADEC_EIO;\n\n    return 0;\n}\n\nstatic int write_data(struct dcadec_waveout *wave, FILE *fp,\n                      int **samples, int nsamples, int nchannels)\n{\n    int limit = 1 << (wave->bits_per_sample - 1);\n    int mask = ~((1 << wave->bits_per_sample) - 1);\n    int bps = wave->bytes_per_sample;\n    int nclipped = 0;\n\n    uint8_t *dst = wave->buffer;\n    for (int i = 0; i < nsamples; i++) {\n        for (int j = 0; j < nchannels; j++) {\n            int sample = samples[j][i];\n\n            if ((sample + limit) & mask) {\n                sample = (sample >> 31) ^ (limit - 1);\n                nclipped++;\n            }\n\n            switch (bps) {\n            case 4:\n                dst[0] = (sample >>  0) & 0xff;\n                dst[1] = (sample >>  8) & 0xff;\n                dst[2] = (sample >> 16) & 0xff;\n                dst[3] = (sample >> 24) & 0xff;\n                break;\n            case 3:\n                dst[0] = (sample >>  0) & 0xff;\n                dst[1] = (sample >>  8) & 0xff;\n                dst[2] = (sample >> 16) & 0xff;\n                break;\n            case 2:\n                dst[0] = (sample >>  0) & 0xff;\n                dst[1] = (sample >>  8) & 0xff;\n                break;\n            case 1:\n                dst[0] = (sample >>  0) & 0xff;\n                break;\n            default:\n                return -DCADEC_EINVAL;\n            }\n\n            dst += bps;\n        }\n    }\n\n    if (nclipped && !(wave->flags & DCADEC_WAVEOUT_FLAG_CLIP))\n        return -DCADEC_EOVERFLOW;\n\n    if (fwrite(wave->buffer, wave->block_align, nsamples, fp) != (size_t)nsamples)\n        return -DCADEC_EIO;\n\n    return nclipped;\n}\n\nDCADEC_API int dcadec_waveout_write(struct dcadec_waveout *wave, int **samples,\n                                    int nsamples, int channel_mask,\n                                    int sample_rate, int bits_per_sample)\n{\n    int ret, nclipped;\n\n    if (nsamples == 0)\n        return 0;\n    if (nsamples < 0)\n        return -DCADEC_EINVAL;\n    if (!wave)\n        return -DCADEC_EINVAL;\n    if (!samples)\n        return -DCADEC_EINVAL;\n    if (!channel_mask)\n        return -DCADEC_EINVAL;\n    if (sample_rate < 8000 || sample_rate > 384000)\n        return -DCADEC_EINVAL;\n    if (bits_per_sample < 8 || bits_per_sample > 32)\n        return -DCADEC_EINVAL;\n\n    if (!wave->size) {\n        wave->channel_mask = channel_mask;\n        wave->nchannels = dca_popcount(channel_mask);\n        wave->sample_rate = sample_rate;\n        wave->bits_per_sample = bits_per_sample;\n        wave->bytes_per_sample = (bits_per_sample + 7) >> 3;\n\n        if (wave->flags & DCADEC_WAVEOUT_FLAG_MONO) {\n            wave->block_align = wave->bytes_per_sample;\n            for (int i = 0, j = 0; i < SPEAKER_COUNT; i++) {\n                if (!(wave->channel_mask & (1U << i)))\n                    continue;\n\n                if (!wave->fp[j]) {\n                    char name[1024];\n                    sprintf(name, wave->pattern, dca_speaker_names[i]);\n                    if (!(wave->fp[j] = fopen(name, \"wb\")))\n                        return -DCADEC_EIO;\n                }\n\n                if ((ret = write_header(wave, wave->fp[j])) < 0)\n                    return ret;\n\n                j++;\n            }\n        } else {\n            wave->block_align = wave->nchannels * wave->bytes_per_sample;\n            if ((ret = write_header(wave, wave->fp[0])) < 0)\n                return ret;\n        }\n    } else {\n        if (channel_mask != wave->channel_mask)\n            return -DCADEC_EOUTCHG;\n        if (sample_rate != wave->sample_rate)\n            return -DCADEC_EOUTCHG;\n        if (bits_per_sample != wave->bits_per_sample)\n            return -DCADEC_EOUTCHG;\n    }\n\n    if (ta_alloc_fast(wave, &wave->buffer, nsamples, wave->block_align) < 0)\n        return -DCADEC_ENOMEM;\n\n    if (wave->flags & DCADEC_WAVEOUT_FLAG_MONO) {\n        nclipped = 0;\n        for (int i = 0; i < wave->nchannels; i++) {\n            if ((ret = write_data(wave, wave->fp[i], &samples[i], nsamples, 1)) < 0)\n                return ret;\n            nclipped += ret;\n        }\n    } else {\n        if ((ret = write_data(wave, wave->fp[0], samples, nsamples, wave->nchannels)) < 0)\n            return ret;\n        nclipped = ret;\n    }\n\n    wave->size += nsamples * wave->block_align;\n    return nclipped;\n}\n\nDCADEC_API struct dcadec_waveout *dcadec_waveout_open(const char *name, int flags)\n{\n    if (flags & DCADEC_WAVEOUT_FLAG_MONO) {\n        if (!name || strlen(name) >= 1020)\n            return NULL;\n        char *p = strchr(name, '%');\n        if (!p || p[1] != 's' || strchr(p + 2, '%'))\n            return NULL;\n    }\n\n    struct dcadec_waveout *wave = ta_znew(NULL, struct dcadec_waveout);\n    if (!wave)\n        return NULL;\n\n    if (name) {\n        if (flags & DCADEC_WAVEOUT_FLAG_MONO) {\n            if (!(wave->pattern = ta_strdup(wave, name)))\n                goto fail;\n        } else {\n            if (!(wave->fp[0] = fopen(name, \"wb\")))\n                goto fail;\n        }\n    } else {\n        int fd;\n#ifdef _WIN32\n        if ((fd = _dup(STDOUT_FILENO)) < 0)\n            goto fail;\n        if (_setmode(fd, _O_BINARY) < 0) {\n            _close(fd);\n            goto fail;\n        }\n        if (!(wave->fp[0] = _fdopen(fd, \"wb\"))) {\n            _close(fd);\n            goto fail;\n        }\n#else\n        if ((fd = dup(STDOUT_FILENO)) < 0)\n            goto fail;\n        if (!(wave->fp[0] = fdopen(fd, \"wb\"))) {\n            close(fd);\n            goto fail;\n        }\n#endif\n    }\n\n    wave->flags = flags;\n    return wave;\n\nfail:\n    ta_free(wave);\n    return NULL;\n}\n\nDCADEC_API void dcadec_waveout_close(struct dcadec_waveout *wave)\n{\n    if (!wave)\n        return;\n\n    for (int i = 0; i < SPEAKER_COUNT; i++) {\n        if (wave->fp[i]) {\n            bool can_seek = true;\n#ifdef _WIN32\n            can_seek = GetFileType((HANDLE)_get_osfhandle(_fileno(wave->fp[i]))) == FILE_TYPE_DISK;\n#endif\n            if (wave->size && can_seek && !fseeko(wave->fp[i], 0, SEEK_SET))\n                write_header(wave, wave->fp[i]);\n            fclose(wave->fp[i]);\n        }\n    }\n\n    ta_free(wave);\n}\n"
  },
  {
    "path": "libdcadec/dca_waveout.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef WAVEOUT_H\n#define WAVEOUT_H\n\n#include \"dca_context.h\"\n\n/**@{*/\n/** Write a mono WAV file for each native DTS channel */\n#define DCADEC_WAVEOUT_FLAG_MONO    0x01\n\n/** Clip instead of raising PCM overflow error */\n#define DCADEC_WAVEOUT_FLAG_CLIP    0x02\n/**@}*/\n\nstruct dcadec_waveout;\n\n/**\n * Write the block of PCM samples to WAV file. The first call to this function\n * writes the WAV header. Subsequent calls must have audio parameters identical\n * to the first call, excluding nsamples parameter which can change between\n * calls.\n *\n * @param wave    Writer handle.\n *\n * @param samples   Array of pointers to planes containing PCM data for active\n *                  channels. Normally, channels must be ordered according to\n *                  WAVEFORMATEXTENSIBLE specification. However, when\n *                  DCADEC_WAVEOUT_FLAG_MONO is set, native DTS channel layout\n *                  should be provided.\n *\n * @param nsamples  Number of PCM samples in each plane.\n *\n * @param channel_mask  Bit mask indicating active channels. Number of bits set\n *                      to 1 indicates the total number of planes to write.\n *\n * @param sample_rate       Audio sample rate in Hz.\n *\n * @param bits_per_sample   Audio PCM resolution in bits.\n *\n * @return      0 on success, negative error code on failure. Positive return\n *              value indicates number of out-of-range PCM samples that were\n *              clipped.\n */\nDCADEC_API int dcadec_waveout_write(struct dcadec_waveout *wave, int **samples,\n                                    int nsamples, int channel_mask,\n                                    int sample_rate, int bits_per_sample);\n/**\n * Open WAV writer to file or standard output.\n *\n * @param name  Name of the file to be opened. Pass NULL to open standard\n *              output. When DCADEC_WAVEOUT_FLAG_MONO is set, name must be\n *              non-NULL and must include `%s' sub-string that will be replaced\n *              with DTS channel name.\n *\n * @param flags Any number of DCADEC_WAVEOUT_FLAG_* constants OR'ed together.\n *\n * @return      Writer handle on success, NULL on failure.\n */\nDCADEC_API struct dcadec_waveout *dcadec_waveout_open(const char *name, int flags);\n\n/**\n * Close WAV writer. This function updates the WAV header if possible.\n *\n * @param wave    Writer handle.\n */\nDCADEC_API void dcadec_waveout_close(struct dcadec_waveout *wave);\n\n#endif\n"
  },
  {
    "path": "libdcadec/dmix_tables.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <stdint.h>\n\nconst uint16_t dmix_table[241] = {\n       33,    35,    37,    39,    41,    44,    46,    49,\n       52,    55,    58,    62,    65,    69,    73,    78,\n       82,    87,    92,    98,   104,   110,   116,   123,\n      130,   138,   146,   155,   164,   174,   184,   195,\n      207,   219,   232,   246,   260,   276,   292,   309,\n      328,   347,   368,   389,   413,   437,   463,   490,\n      519,   550,   583,   617,   654,   693,   734,   777,\n      823,   872,   924,   978,  1036,  1066,  1098,  1130,\n     1163,  1197,  1232,  1268,  1305,  1343,  1382,  1422,\n     1464,  1506,  1550,  1596,  1642,  1690,  1740,  1790,\n     1843,  1896,  1952,  2009,  2068,  2128,  2190,  2254,\n     2320,  2388,  2457,  2529,  2603,  2679,  2757,  2838,\n     2920,  3006,  3093,  3184,  3277,  3372,  3471,  3572,\n     3677,  3784,  3894,  4008,  4125,  4246,  4370,  4497,\n     4629,  4764,  4903,  5046,  5193,  5345,  5501,  5662,\n     5827,  5912,  5997,  6084,  6172,  6262,  6353,  6445,\n     6538,  6633,  6729,  6827,  6925,  7026,  7128,  7231,\n     7336,  7442,  7550,  7659,  7771,  7883,  7997,  8113,\n     8231,  8350,  8471,  8594,  8719,  8845,  8973,  9103,\n     9235,  9369,  9505,  9643,  9783,  9924, 10068, 10214,\n    10362, 10512, 10665, 10819, 10976, 11135, 11297, 11460,\n    11627, 11795, 11966, 12139, 12315, 12494, 12675, 12859,\n    13045, 13234, 13426, 13621, 13818, 14018, 14222, 14428,\n    14637, 14849, 15064, 15283, 15504, 15729, 15957, 16188,\n    16423, 16661, 16902, 17147, 17396, 17648, 17904, 18164,\n    18427, 18694, 18965, 19240, 19519, 19802, 20089, 20380,\n    20675, 20975, 21279, 21587, 21900, 22218, 22540, 22867,\n    23170, 23534, 23875, 24221, 24573, 24929, 25290, 25657,\n    26029, 26406, 26789, 27177, 27571, 27970, 28376, 28787,\n    29205, 29628, 30057, 30493, 30935, 31383, 31838, 32300,\n    32768\n};\n\nconst uint32_t dmix_table_inv[201] = {\n    6553600, 6186997, 5840902, 5514167, 5205710, 4914507, 4639593, 4380059,\n    4135042, 3903731, 3685360, 3479204, 3284581, 3100844, 2927386, 2763630,\n    2609035, 2463088, 2325305, 2195230, 2072430, 2013631, 1956500, 1900990,\n    1847055, 1794651, 1743733, 1694260, 1646190, 1599484, 1554103, 1510010,\n    1467168, 1425542, 1385096, 1345798, 1307615, 1270515, 1234468, 1199444,\n    1165413, 1132348, 1100221, 1069005, 1038676, 1009206,  980573,  952752,\n     925721,  899456,  873937,  849141,  825049,  801641,  778897,  756798,\n     735326,  714463,  694193,  674497,  655360,  636766,  618700,  601146,\n     584090,  567518,  551417,  535772,  520571,  505801,  491451,  477507,\n     463959,  450796,  438006,  425579,  413504,  401772,  390373,  379297,\n     368536,  363270,  358080,  352964,  347920,  342949,  338049,  333219,\n     328458,  323765,  319139,  314579,  310084,  305654,  301287,  296982,\n     292739,  288556,  284433,  280369,  276363,  272414,  268522,  264685,\n     260904,  257176,  253501,  249879,  246309,  242790,  239321,  235901,\n     232531,  229208,  225933,  222705,  219523,  216386,  213295,  210247,\n     207243,  204282,  201363,  198486,  195650,  192855,  190099,  187383,\n     184706,  182066,  179465,  176901,  174373,  171882,  169426,  167005,\n     164619,  162267,  159948,  157663,  155410,  153190,  151001,  148844,\n     146717,  144621,  142554,  140517,  138510,  136531,  134580,  132657,\n     130762,  128893,  127052,  125236,  123447,  121683,  119944,  118231,\n     116541,  114876,  113235,  111617,  110022,  108450,  106901,  105373,\n     103868,  102383,  100921,   99479,   98057,   96656,   95275,   93914,\n      92682,   91249,   89946,   88660,   87394,   86145,   84914,   83701,\n      82505,   81326,   80164,   79019,   77890,   76777,   75680,   74598,\n      73533,   72482,   71446,   70425,   69419,   68427,   67450,   66486,\n      65536\n};\n\nconst uint8_t dmix_primary_nch[7] = {\n    1, 2, 2, 3, 3, 4, 4\n};\n"
  },
  {
    "path": "libdcadec/dmix_tables.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef DMIX_TABLES_H\n#define DMIX_TABLES_H\n\nextern const uint16_t dmix_table[241];\nextern const uint32_t dmix_table_inv[201];\nextern const uint8_t dmix_primary_nch[7];\n\n#endif\n"
  },
  {
    "path": "libdcadec/exss_parser.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"common.h\"\n#include \"exss_parser.h\"\n\n// Table 8-5: Sample rate decoding\nconst uint32_t exss_sample_rates[16] = {\n      8000,  16000,  32000,  64000,\n    128000,  22050,  44100,  88200,\n    176400, 352800,  12000,  24000,\n     48000,  96000, 192000, 384000\n};\n\nstatic void parse_xll_parameters(struct exss_asset *asset)\n{\n    struct exss_parser *exss = asset->parser;\n\n    // Size of XLL data in extension substream\n    asset->xll_size = bits_get(&exss->bits, exss->exss_size_nbits) + 1;\n    // XLL sync word present flag\n    asset->xll_sync_present = bits_get1(&exss->bits);\n    if (asset->xll_sync_present) {\n        // Peak bit rate smoothing buffer size\n        bits_skip(&exss->bits, 4);\n        // Number of bits for XLL decoding delay\n        int xll_delay_nbits = bits_get(&exss->bits, 5) + 1;\n        // Initial XLL decoding delay in frames\n        asset->xll_delay_nframes = bits_get(&exss->bits, xll_delay_nbits);\n        // Number of bytes offset to XLL sync\n        asset->xll_sync_offset = bits_get(&exss->bits, exss->exss_size_nbits);\n    } else {\n        asset->xll_delay_nframes = 0;\n        asset->xll_sync_offset = 0;\n    }\n}\n\nstatic void parse_lbr_parameters(struct exss_asset *asset)\n{\n    struct exss_parser *exss = asset->parser;\n\n    // Size of LBR component in extension substream\n    asset->lbr_size = bits_get(&exss->bits, 14) + 1;\n    // LBR sync word present flag\n    if (bits_get1(&exss->bits))\n        // LBR sync distance\n        bits_skip(&exss->bits, 2);\n}\n\nstatic int parse_descriptor(struct exss_asset *asset)\n{\n    struct exss_parser *exss = asset->parser;\n    int i, j, ret, descr_pos = exss->bits.index;\n\n    // Size of audio asset descriptor in bytes\n    int descr_size = bits_get(&exss->bits, 9) + 1;\n\n    // Audio asset identifier\n    asset->asset_index = bits_get(&exss->bits, 3);\n\n    //\n    // Per stream static metadata\n    //\n\n    if (exss->static_fields_present) {\n        // Asset type descriptor presence\n        if (bits_get1(&exss->bits))\n            // Asset type descriptor\n            bits_skip(&exss->bits, 4);\n\n        // Language descriptor presence\n        if (bits_get1(&exss->bits))\n            // Language descriptor\n            bits_skip(&exss->bits, 24);\n\n        // Additional textual information presence\n        if (bits_get1(&exss->bits)) {\n            // Byte size of additional text info\n            int text_size = bits_get(&exss->bits, 10) + 1;\n            // Additional textual information string\n            bits_skip(&exss->bits, text_size * 8);\n        }\n\n        // PCM bit resolution\n        asset->pcm_bit_res = bits_get(&exss->bits, 5) + 1;\n\n        // Maximum sample rate\n        asset->max_sample_rate = exss_sample_rates[bits_get(&exss->bits, 4)];\n\n        // Total number of channels\n        asset->nchannels_total = bits_get(&exss->bits, 8) + 1;\n\n        // One to one map channel to speakers\n        asset->one_to_one_map_ch_to_spkr = bits_get1(&exss->bits);\n        if (asset->one_to_one_map_ch_to_spkr) {\n            // Embedded stereo flag\n            if (asset->nchannels_total > 2)\n                asset->embedded_stereo = bits_get1(&exss->bits);\n\n            // Embedded 6 channels flag\n            if (asset->nchannels_total > 6)\n                asset->embedded_6ch = bits_get1(&exss->bits);\n\n            // Speaker mask enabled flag\n            asset->spkr_mask_enabled = bits_get1(&exss->bits);\n\n            int spkr_mask_nbits = 0;\n            if (asset->spkr_mask_enabled) {\n                // Number of bits for speaker activity mask\n                spkr_mask_nbits = (bits_get(&exss->bits, 2) + 1) << 2;\n                // Loudspeaker activity mask\n                asset->spkr_mask = bits_get(&exss->bits, spkr_mask_nbits);\n            }\n\n            // Number of speaker remapping sets\n            int spkr_remap_nsets = bits_get(&exss->bits, 3);\n            if (spkr_remap_nsets && !spkr_mask_nbits) {\n                exss_err(\"Speaker mask disabled yet there are remapping sets\");\n                return -DCADEC_EBADDATA;\n            }\n\n            // Standard loudspeaker layout mask\n            int nspeakers[8];\n            for (i = 0; i < spkr_remap_nsets; i++)\n                nspeakers[i] = count_chs_for_mask(bits_get(&exss->bits, spkr_mask_nbits));\n\n            for (i = 0; i < spkr_remap_nsets; i++) {\n                // Number of channels to be decoded for speaker remapping\n                int nch_for_remaps = bits_get(&exss->bits, 5) + 1;\n                for (j = 0; j < nspeakers[i]; j++) {\n                    // Decoded channels to output speaker mapping mask\n                    int remap_ch_mask = bits_get(&exss->bits, nch_for_remaps);\n                    // Loudspeaker remapping codes\n                    int ncodes = dca_popcount(remap_ch_mask);\n                    bits_skip(&exss->bits, ncodes * 5);\n                }\n            }\n        } else {\n            asset->embedded_stereo = false;\n            asset->embedded_6ch = false;\n            asset->spkr_mask_enabled = false;\n            asset->spkr_mask = 0;\n\n            // Representation type\n            asset->representation_type = bits_get(&exss->bits, 3);\n        }\n    }\n\n    //\n    // DRC, DNC and mixing metadata\n    //\n\n    // Dynamic range coefficient presence flag\n    bool drc_present = bits_get1(&exss->bits);\n\n    // Code for dynamic range coefficient\n    if (drc_present)\n        bits_skip(&exss->bits, 8);\n\n    // Dialog normalization presence flag\n    if (bits_get1(&exss->bits))\n        // Dialog normalization code\n        bits_skip(&exss->bits, 5);\n\n    // DRC for stereo downmix\n    if (drc_present && asset->embedded_stereo)\n        bits_skip(&exss->bits, 8);\n\n    // Mixing metadata presence flag\n    if (exss->mix_metadata_enabled && bits_get1(&exss->bits)) {\n        // External mixing flag\n        bits_skip1(&exss->bits);\n\n        // Post mixing / replacement gain adjustment\n        bits_skip(&exss->bits, 6);\n\n        // DRC prior to mixing\n        if (bits_get(&exss->bits, 2) == 3)\n            // Custom code for mixing DRC\n            bits_skip(&exss->bits, 8);\n        else\n            // Limit for mixing DRC\n            bits_skip(&exss->bits, 3);\n\n        // Scaling type for channels of main audio\n        // Scaling parameters of main audio\n        if (bits_get1(&exss->bits))\n            for (i = 0; i < exss->nmixoutconfigs; i++)\n                bits_skip(&exss->bits, 6 * exss->nmixoutchs[i]);\n        else\n            bits_skip(&exss->bits, 6 * exss->nmixoutconfigs);\n\n        int nchannels_dmix = asset->nchannels_total;\n        if (asset->embedded_6ch)\n            nchannels_dmix += 6;\n        if (asset->embedded_stereo)\n            nchannels_dmix += 2;\n        for (i = 0; i < exss->nmixoutconfigs; i++) {\n            for (j = 0; j < nchannels_dmix; j++) {\n                if (!exss->nmixoutchs[i]) {\n                    exss_err(\"Invalid speaker layout mask for mixing configuration\");\n                    return -DCADEC_EBADDATA;\n                }\n                // Mix output mask\n                int mix_map_mask = bits_get(&exss->bits, exss->nmixoutchs[i]);\n                // Mixing coefficients\n                int nmixcoefs = dca_popcount(mix_map_mask);\n                bits_skip(&exss->bits, 6 * nmixcoefs);\n            }\n        }\n    }\n\n    //\n    // Decoder navigation data\n    //\n\n    // Coding mode for the asset\n    asset->coding_mode = bits_get(&exss->bits, 2);\n\n    // Coding components used in asset\n    switch (asset->coding_mode) {\n    case 0: // Coding mode that may contain multiple coding components\n        asset->extension_mask = bits_get(&exss->bits, 12);\n        if (asset->extension_mask & EXSS_CORE) {\n            // Size of core component in extension substream\n            asset->core_size = bits_get(&exss->bits, 14) + 1;\n            // Core sync word present flag\n            if (bits_get1(&exss->bits))\n                // Core sync distance\n                bits_skip(&exss->bits, 2);\n        }\n        if (asset->extension_mask & EXSS_XBR)\n            // Size of XBR extension in extension substream\n            asset->xbr_size = bits_get(&exss->bits, 14) + 1;\n        if (asset->extension_mask & EXSS_XXCH)\n            // Size of XXCH extension in extension substream\n            asset->xxch_size = bits_get(&exss->bits, 14) + 1;\n        if (asset->extension_mask & EXSS_X96)\n            // Size of X96 extension in extension substream\n            asset->x96_size = bits_get(&exss->bits, 12) + 1;\n        if (asset->extension_mask & EXSS_LBR)\n            parse_lbr_parameters(asset);\n        if (asset->extension_mask & EXSS_XLL)\n            parse_xll_parameters(asset);\n        if (asset->extension_mask & EXSS_RSV1)\n            bits_skip(&exss->bits, 16);\n        if (asset->extension_mask & EXSS_RSV2)\n            bits_skip(&exss->bits, 16);\n        break;\n\n    case 1: // Loss-less coding mode without CBR component\n        asset->extension_mask = EXSS_XLL;\n        parse_xll_parameters(asset);\n        break;\n\n    case 2: // Low bit rate mode\n        asset->extension_mask = EXSS_LBR;\n        parse_lbr_parameters(asset);\n        break;\n\n    case 3: // Auxiliary coding mode\n        asset->extension_mask = 0;\n        // Size of auxiliary coded data\n        bits_skip(&exss->bits, 14);\n        // Auxiliary codec identification\n        bits_skip(&exss->bits, 8);\n        // Aux sync word present flag\n        if (bits_get1(&exss->bits))\n            // Aux sync distance\n            bits_skip(&exss->bits, 3);\n        break;\n    }\n\n    if (asset->extension_mask & EXSS_XLL)\n        // DTS-HD stream ID\n        asset->hd_stream_id = bits_get(&exss->bits, 3);\n\n    // One to one mixing flag\n    // Per channel main audio scaling flag\n    // Main audio scaling codes\n    // Decode asset in secondary decoder flag\n    // Revision 2 DRC metadata\n    // Reserved\n    // Zero pad\n    if ((ret = bits_seek(&exss->bits, descr_pos + descr_size * 8)) < 0)\n        exss_err(\"Read past end of asset descriptor\");\n    return ret;\n}\n\nstatic int set_exss_offsets(struct exss_asset *asset)\n{\n    int offs = asset->asset_offset;\n    int size = asset->asset_size;\n\n    if (asset->extension_mask & EXSS_CORE) {\n        asset->core_offset = offs;\n        if (offs & 3 || asset->core_size > size)\n            return -DCADEC_EBADREAD;\n        offs += asset->core_size;\n        size -= asset->core_size;\n    }\n\n    if (asset->extension_mask & EXSS_XBR) {\n        asset->xbr_offset = offs;\n        if (offs & 3 || asset->xbr_size > size)\n            return -DCADEC_EBADREAD;\n        offs += asset->xbr_size;\n        size -= asset->xbr_size;\n    }\n\n    if (asset->extension_mask & EXSS_XXCH) {\n        asset->xxch_offset = offs;\n        if (offs & 3 || asset->xxch_size > size)\n            return -DCADEC_EBADREAD;\n        offs += asset->xxch_size;\n        size -= asset->xxch_size;\n    }\n\n    if (asset->extension_mask & EXSS_X96) {\n        asset->x96_offset = offs;\n        if (offs & 3 || asset->x96_size > size)\n            return -DCADEC_EBADREAD;\n        offs += asset->x96_size;\n        size -= asset->x96_size;\n    }\n\n    if (asset->extension_mask & EXSS_LBR) {\n        asset->lbr_offset = offs;\n        if (offs & 3 || asset->lbr_size > size)\n            return -DCADEC_EBADREAD;\n        offs += asset->lbr_size;\n        size -= asset->lbr_size;\n    }\n\n    if (asset->extension_mask & EXSS_XLL) {\n        asset->xll_offset = offs;\n        if (offs & 3 || asset->xll_size > size)\n            return -DCADEC_EBADREAD;\n        offs += asset->xll_size;\n        size -= asset->xll_size;\n    }\n\n    return 0;\n}\n\nint exss_parse(struct exss_parser *exss, uint8_t *data, int size)\n{\n    int i, j, ret;\n\n    bits_init(&exss->bits, data, size);\n\n    // Extension substream sync word\n    bits_skip(&exss->bits, 32);\n\n    // User defined bits\n    bits_skip(&exss->bits, 8);\n\n    // Extension substream index\n    exss->exss_index = bits_get(&exss->bits, 2);\n\n    // Flag indicating short or long header size\n    bool wide_hdr = bits_get1(&exss->bits);\n\n    // Extension substream header length\n    int header_size = bits_get(&exss->bits, 8 + 4 * wide_hdr) + 1;\n\n    // Check CRC\n    if ((ret = bits_check_crc(&exss->bits, 32 + 8, header_size * 8)) < 0) {\n        exss_err(\"Invalid EXSS header checksum\");\n        return ret;\n    }\n\n    exss->exss_size_nbits = 16 + 4 * wide_hdr;\n\n    // Number of bytes of extension substream\n    exss->exss_size = bits_get(&exss->bits, exss->exss_size_nbits) + 1;\n    if (exss->exss_size > size) {\n        exss_err(\"Packet too short for EXSS frame\");\n        return -DCADEC_EBADDATA;\n    }\n\n    // Per stream static fields presence flag\n    exss->static_fields_present = bits_get1(&exss->bits);\n    if (exss->static_fields_present) {\n        // Reference clock code\n        bits_skip(&exss->bits, 2);\n\n        // Extension substream frame duration\n        bits_skip(&exss->bits, 3);\n\n        // Timecode presence flag\n        if (bits_get1(&exss->bits)) {\n            // Timecode data\n            bits_skip(&exss->bits, 32);\n            bits_skip(&exss->bits, 4);\n        }\n\n        // Number of defined audio presentations\n        exss->npresents = bits_get(&exss->bits, 3) + 1;\n\n        // Number of audio assets in extension substream\n        exss->nassets = bits_get(&exss->bits, 3) + 1;\n\n        // Reject unsupported features for now\n        if (exss->npresents > 1 || exss->nassets > 1) {\n            exss_err_once(\"Multiple audio presentations \"\n                          \"and/or assets are not supported\");\n            return -DCADEC_ENOSUP;\n        }\n\n        // Active extension substream mask for audio presentation\n        int active_exss_mask[8];\n        for (i = 0; i < exss->npresents; i++)\n            active_exss_mask[i] = bits_get(&exss->bits, exss->exss_index + 1);\n\n        // Active audio asset mask\n        for (i = 0; i < exss->npresents; i++)\n            for (j = 0; j <= exss->exss_index; j++)\n                if (active_exss_mask[i] & (1 << j))\n                    bits_skip(&exss->bits, 8);\n\n        // Mixing metadata enable flag\n        exss->mix_metadata_enabled = bits_get1(&exss->bits);\n        if (exss->mix_metadata_enabled) {\n            // Mixing metadata adjustment level\n            bits_skip(&exss->bits, 2);\n\n            // Number of bits for mixer output speaker activity mask\n            int spkr_mask_nbits = (bits_get(&exss->bits, 2) + 1) << 2;\n\n            // Number of mixing configurations\n            exss->nmixoutconfigs = bits_get(&exss->bits, 2) + 1;\n\n            // Speaker layout mask for mixer output channels\n            for (i = 0; i < exss->nmixoutconfigs; i++)\n                exss->nmixoutchs[i] = count_chs_for_mask(bits_get(&exss->bits, spkr_mask_nbits));\n        }\n    } else {\n        exss->npresents = 1;\n        exss->nassets = 1;\n    }\n\n    // Reallocate assets\n    if (ta_zalloc_fast(exss, &exss->assets, exss->nassets, sizeof(struct exss_asset)) < 0)\n        return -DCADEC_ENOMEM;\n\n    // Size of encoded asset data in bytes\n    int offset = header_size;\n    for (i = 0; i < exss->nassets; i++) {\n        exss->assets[i].asset_offset = offset;\n        exss->assets[i].asset_size = bits_get(&exss->bits, exss->exss_size_nbits) + 1;\n        offset += exss->assets[i].asset_size;\n        if (offset > exss->exss_size) {\n            exss_err(\"Asset out of bounds\");\n            return -DCADEC_EBADDATA;\n        }\n    }\n\n    // Audio asset descriptor\n    for (i = 0; i < exss->nassets; i++) {\n        exss->assets[i].parser = exss;\n        if ((ret = parse_descriptor(&exss->assets[i])) < 0)\n            return ret;\n        if ((ret = set_exss_offsets(&exss->assets[i])) < 0) {\n            exss_err(\"Invalid extension size in asset descriptor\");\n            return ret;\n        }\n    }\n\n    // Backward compatible core present\n    // Backward compatible core substream index\n    // Backward compatible core asset index\n    // Reserved\n    // Byte align\n    // CRC16 of extension substream header\n    if ((ret = bits_seek(&exss->bits, header_size * 8)) < 0)\n        exss_err(\"Read past end of EXSS header\");\n    return ret;\n}\n\nstruct dcadec_exss_info *exss_get_info(struct exss_parser *exss)\n{\n    struct dcadec_exss_info *info = ta_znew(NULL, struct dcadec_exss_info);\n    if (!info)\n        return NULL;\n\n    struct exss_asset *asset = &exss->assets[0];\n\n    info->nchannels = asset->nchannels_total;\n    info->sample_rate = asset->max_sample_rate;\n    info->bits_per_sample = asset->pcm_bit_res;\n\n    if (asset->extension_mask & EXSS_XLL)\n        info->profile = DCADEC_PROFILE_HD_MA;\n    else if (asset->extension_mask & (EXSS_XBR | EXSS_XXCH | EXSS_X96))\n        info->profile = DCADEC_PROFILE_HD_HRA;\n    else if (asset->extension_mask & EXSS_LBR)\n        info->profile = DCADEC_PROFILE_EXPRESS;\n    else\n        info->profile = DCADEC_PROFILE_UNKNOWN;\n\n    info->embedded_stereo = asset->embedded_stereo;\n    info->embedded_6ch = asset->embedded_6ch;\n\n    if (asset->spkr_mask_enabled)\n        info->spkr_mask = asset->spkr_mask;\n    else if (asset->nchannels_total == 2)\n        info->spkr_mask = SPEAKER_PAIR_LR;\n\n    if (!asset->one_to_one_map_ch_to_spkr) {\n        if (asset->representation_type == REPR_TYPE_LtRt)\n            info->matrix_encoding = DCADEC_MATRIX_ENCODING_SURROUND;\n        else if (asset->representation_type == REPR_TYPE_LhRh)\n            info->matrix_encoding = DCADEC_MATRIX_ENCODING_HEADPHONE;\n    }\n\n    return info;\n}\n"
  },
  {
    "path": "libdcadec/exss_parser.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef EXSS_PARSER_H\n#define EXSS_PARSER_H\n\n#include \"bitstream.h\"\n\n#define exss_err(...)   dca_log(exss, ERROR, __VA_ARGS__)\n\n#define exss_err_once(...)  dca_log_once(exss, ERROR, __VA_ARGS__)\n\nstruct exss_parser;\n\nstruct exss_asset {\n    struct exss_parser  *parser;    ///< Parent context\n\n    int     asset_offset;   ///< Offset to asset data from start of substream\n    int     asset_size;     ///< Size of encoded asset data\n    int     asset_index;    ///< Audio asset identifier\n\n    int     pcm_bit_res;                ///< PCM bit resolution\n    int     max_sample_rate;            ///< Maximum sample rate\n    int     nchannels_total;            ///< Total number of channels\n    bool    one_to_one_map_ch_to_spkr;  ///< One to one channel to speaker mapping flag\n    bool    embedded_stereo;            ///< Embedded stereo flag\n    bool    embedded_6ch;               ///< Embedded 6 channels flag\n    bool    spkr_mask_enabled;          ///< Speaker mask enabled flag\n    int     spkr_mask;                  ///< Loudspeaker activity mask\n    int     representation_type;        ///< Representation type\n\n    int     coding_mode;        ///< Coding mode for the asset\n    int     extension_mask;     ///< Coding components used in asset\n\n    int     core_offset;    ///< Offset to core component from start of substream\n    int     core_size;      ///< Size of core component in extension substream\n\n    int     xbr_offset;     ///< Offset to XBR extension from start of substream\n    int     xbr_size;       ///< Size of XBR extension in extension substream\n\n    int     xxch_offset;    ///< Offset to XXCH extension from start of substream\n    int     xxch_size;      ///< Size of XXCH extension in extension substream\n\n    int     x96_offset;     ///< Offset to X96 extension from start of substream\n    int     x96_size;       ///< Size of X96 extension in extension substream\n\n    int     lbr_offset;     ///< Offset to LBR component from start of substream\n    int     lbr_size;       ///< Size of LBR component in extension substream\n\n    int     xll_offset;         ///< Offset to XLL data from start of substream\n    int     xll_size;           ///< Size of XLL data in extension substream\n    bool    xll_sync_present;   ///< XLL sync word present flag\n    int     xll_delay_nframes;  ///< Initial XLL decoding delay in frames\n    int     xll_sync_offset;    ///< Number of bytes offset to XLL sync\n\n    int     hd_stream_id;   ///< DTS-HD stream ID\n};\n\nstruct exss_parser {\n    struct dcadec_context   *ctx;   ///< Parent context\n    struct bitstream        bits;   ///< Bitstream reader\n\n    int     exss_index;         ///< Extension substream index\n    int     exss_size_nbits;    ///< Number of bits for extension substream size\n    int     exss_size;          ///< Number of bytes of extension substream\n\n    bool    static_fields_present;  ///< Per stream static fields presence flag\n    int     npresents;  ///< Number of defined audio presentations\n    int     nassets;    ///< Number of audio assets in extension substream\n\n    bool    mix_metadata_enabled;   ///< Mixing metadata enable flag\n    int     nmixoutconfigs;         ///< Number of mixing configurations\n    int     nmixoutchs[4];          ///< Speaker layout mask for mixer output channels\n\n    struct exss_asset   *assets;    ///< Audio asset descriptors\n};\n\nextern const uint32_t exss_sample_rates[16];\n\nint exss_parse(struct exss_parser *exss, uint8_t *data, int size);\nstruct dcadec_exss_info *exss_get_info(struct exss_parser *exss) __attribute__((cold));\n\n#endif\n"
  },
  {
    "path": "libdcadec/fir_fixed.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n//  floor(fir_float.band_fir_perfect[i] * SQRT2 * (1 << 28) + 0.5), (i & 63) <  16\n// -floor(fir_float.band_fir_perfect[i] * SQRT2 * (1 << 28) + 0.5), (i & 63) >= 16\nstatic const int32_t band_fir_perfect[512] = {\n           0,        0,       -3,      -10,\n         -35,     -105,     -218,     -141,\n        -170,     -216,     -239,     -254,\n        -257,     -251,     -235,     -212,\n        -267,     -317,     -362,     -400,\n        -425,     -434,     -427,     -373,\n        -339,     -593,     -321,     -120,\n         -39,      -16,        0,        1,\n           1,        1,       -3,       -1,\n          -6,      -38,      -93,     -496,\n        -723,     -970,    -1235,    -1501,\n       -1753,    -1978,    -2163,    -2295,\n       -2891,    -2915,    -2860,    -2726,\n       -2517,    -2243,    -1915,    -1590,\n       -1192,     -252,     -117,      -22,\n          -6,      -13,       12,       14,\n          32,       25,      469,      942,\n        1403,     1421,     1239,     2838,\n        3539,     4259,     5002,     5716,\n        6365,     6908,     7311,     7545,\n       11680,    12355,    12785,    12951,\n       12841,    12453,    11803,    10864,\n        9762,     7099,     6725,     5954,\n        4284,     2584,      215,      379,\n         557,      701,      -29,     -687,\n       -1578,    -2749,    -4076,    -7933,\n      -10049,   -12133,   -14039,   -15752,\n      -17213,   -18400,   -19291,   -19878,\n       -1444,    -3005,    -4523,    -5927,\n       -7143,    -8093,    -8713,    -8939,\n       -8700,    -9481,    -7515,    -5279,\n       -2725,       61,     5763,     6113,\n        7571,     6735,    17126,    20165,\n       23328,    26775,    30310,    32639,\n       35464,    38064,    40423,    42512,\n       44261,    45632,    46578,    46974,\n      -45572,   -45008,   -43753,   -41661,\n      -38655,   -34660,   -29587,   -23375,\n      -15998,    -7631,     2472,    13757,\n       26188,    39942,    49789,    67293,\n       84699,   101701,   127325,   148404,\n      170391,   193280,   217044,   241451,\n      266537,   292144,   318161,   344417,\n      370786,   397082,   423133,   448757,\n      475085,   499136,   522007,   543516,\n      563424,   581467,   597422,   611005,\n      621975,   630083,   634996,   636457,\n      634311,   628147,   619871,   604524,\n      585077,   561301,   529204,   494129,\n      453552,   407189,   354920,   296502,\n      231916,   161012,    83700,      -86,\n      -90377,  -187193,  -290528,  -400329,\n      516487,   639054,   767835,   902710,\n     1043512,  1190048,  1342100,  1499418,\n     1661729,  1828700,  2000071,  2175433,\n     2354437,  2536630,  2721120,  2908704,\n     3098059,  3288764,  3480801,  3672922,\n     3864970,  4056432,  4246767,  4435454,\n     4621921,  4805642,  4986073,  5162677,\n     5334921,  5502279,  5664239,  5820300,\n     5969913,  6112723,  6248225,  6375985,\n     6495593,  6606663,  6708832,  6801769,\n     6885168,  6958762,  7022294,  7075566,\n     7118382,  7150633,  7172314,  7183082,\n     7183082,  7172314,  7150633,  7118382,\n     7075566,  7022294,  6958762,  6885168,\n     6801769,  6708832,  6606663,  6495593,\n     6375985,  6248225,  6112723,  5969913,\n    -5820300, -5664239, -5502279, -5334921,\n    -5162677, -4986073, -4805642, -4621921,\n    -4435454, -4246767, -4056432, -3864970,\n    -3672922, -3480801, -3288764, -3098059,\n    -2908704, -2721120, -2536630, -2354437,\n    -2175433, -2000071, -1828700, -1661729,\n    -1499418, -1342100, -1190048, -1043512,\n     -902710,  -767835,  -639054,  -516487,\n     -400329,  -290528,  -187193,   -90377,\n         -86,    83700,   161012,   231916,\n      296502,   354920,   407189,   453552,\n      494129,   529204,   561301,   585077,\n      604524,   619871,   628147,   634311,\n      636457,   634996,   630083,   621975,\n      611005,   597422,   581467,   563424,\n      543516,   522007,   499136,   475085,\n     -448757,  -423133,  -397082,  -370786,\n     -344417,  -318161,  -292144,  -266537,\n     -241451,  -217044,  -193280,  -170391,\n     -148404,  -127325,  -101701,   -84699,\n      -67293,   -49789,   -39942,   -26188,\n      -13757,    -2472,     7631,    15998,\n       23375,    29587,    34660,    38655,\n       41661,    43753,    45008,    45572,\n       46974,    46578,    45632,    44261,\n       42512,    40423,    38064,    35464,\n       32639,    30310,    26775,    23328,\n       20165,    17126,     6735,     7571,\n        6113,     5763,       61,    -2725,\n       -5279,    -7515,    -9481,    -8700,\n       -8939,    -8713,    -8093,    -7143,\n       -5927,    -4523,    -3005,    -1444,\n       19878,    19291,    18400,    17213,\n       15752,    14039,    12133,    10049,\n        7933,     4076,     2749,     1578,\n         687,       29,     -701,     -557,\n        -379,     -215,    -2584,    -4284,\n       -5954,    -6725,    -7099,    -9762,\n      -10864,   -11803,   -12453,   -12841,\n      -12951,   -12785,   -12355,   -11680,\n        7545,     7311,     6908,     6365,\n        5716,     5002,     4259,     3539,\n        2838,     1239,     1421,     1403,\n         942,      469,       25,       32,\n          14,       12,      -13,       -6,\n         -22,     -117,     -252,    -1192,\n       -1590,    -1915,    -2243,    -2517,\n       -2726,    -2860,    -2915,    -2891,\n        2295,     2163,     1978,     1753,\n        1501,     1235,      970,      723,\n         496,       93,       38,        6,\n           1,        3,       -1,       -1,\n          -1,        0,       16,       39,\n         120,      321,      593,      339,\n         373,      427,      434,      425,\n         400,      362,      317,      267,\n        -212,     -235,     -251,     -257,\n        -254,     -239,     -216,     -170,\n        -141,     -218,     -105,      -35,\n         -10,       -3,        0,        0\n};\n\n//  floor(fir_float.band_fir_nonperfect[i] * SQRT2 * (1 << 28) + 0.5), (i & 63) <  16\n// -floor(fir_float.band_fir_nonperfect[i] * SQRT2 * (1 << 28) + 0.5), (i & 63) >= 16\nstatic const int32_t band_fir_nonperfect[512] = {\n         -53,      -64,      -77,      -91,\n        -107,     -124,     -144,     -165,\n        -189,     -215,     -244,     -277,\n        -313,     -353,     -397,     -447,\n         502,      563,      631,      706,\n         789,      881,      983,     1095,\n        1218,     1354,     1502,     1665,\n        1843,     2036,     2247,     2475,\n        2723,     2990,     3277,     3586,\n        3916,     4270,     4646,     5046,\n        5470,     5918,     6390,     6886,\n        7405,     7947,     8510,     9094,\n        9698,    10319,    10955,    11605,\n       12265,    12933,    13605,    14277,\n       14945,    15604,    16250,    16877,\n       17480,    18051,    18585,    19075,\n       19513,    19891,    20202,    20436,\n       20587,    20643,    20597,    20439,\n       20160,    19749,    19198,    18496,\n       17634,    16603,    15393,    13996,\n      -12403,   -10605,    -8595,    -6366,\n       -3911,    -1225,     1697,     4860,\n        8265,    11916,    15812,    19953,\n       24337,    28961,    33819,    38904,\n       44210,    49725,    55437,    61334,\n       67398,    73614,    79961,    86417,\n       92960,    99563,   106198,   112837,\n      119446,   125994,   132443,   138758,\n      144898,   150823,   156491,   161858,\n      166879,   171507,   175697,   179400,\n      182566,   185149,   187097,   188363,\n      188899,   188654,   187581,   185635,\n      182770,   178943,   174112,   168238,\n      161285,   153218,   144007,   133624,\n      122046,   109254,    95232,    79969,\n       63462,    45709,    26715,     6492,\n       14943,    37567,    61350,    86256,\n      112242,   139258,   167246,   196143,\n      225877,   256368,   287532,   319275,\n      351496,   384088,   416936,   449919,\n      482909,   515770,   548362,   580539,\n      612148,   643030,   673024,   701963,\n      729674,   755985,   780717,   803690,\n      824721,   843628,   860226,   874332,\n      885761,   894330,   899861,   902174,\n      901096,   896456,   888088,   875832,\n      859535,   839050,   814237,   784966,\n      751116,   712574,   669239,   621021,\n      567840,   509632,   446341,   377927,\n      304365,   225641,   141757,    52732,\n      -41403,  -140599,  -244793,  -353905,\n     -467840,  -586486,  -709716,  -837385,\n      969336,  1105393,  1245366,  1389049,\n     1536224,  1686655,  1840096,  1996285,\n     2154949,  2315802,  2478547,  2642877,\n     2808475,  2975015,  3142163,  3309579,\n     3476914,  3643818,  3809934,  3974901,\n     4138360,  4299948,  4459303,  4616064,\n     4769873,  4920374,  5067219,  5210063,\n     5348569,  5482406,  5611255,  5734805,\n     5852757,  5964823,  6070729,  6170216,\n     6263037,  6348961,  6427777,  6499286,\n     6563310,  6619688,  6668279,  6708963,\n     6741632,  6766206,  6782623,  6790843,\n     6790843,  6782623,  6766206,  6741632,\n     6708963,  6668279,  6619688,  6563310,\n     6499286,  6427777,  6348961,  6263037,\n     6170216,  6070729,  5964823,  5852757,\n    -5734805, -5611255, -5482406, -5348569,\n    -5210063, -5067219, -4920374, -4769873,\n    -4616064, -4459303, -4299948, -4138360,\n    -3974901, -3809934, -3643818, -3476914,\n    -3309579, -3142163, -2975015, -2808475,\n    -2642877, -2478547, -2315802, -2154949,\n    -1996285, -1840096, -1686655, -1536224,\n    -1389049, -1245366, -1105393,  -969336,\n     -837385,  -709716,  -586486,  -467840,\n     -353905,  -244793,  -140599,   -41403,\n       52732,   141757,   225641,   304365,\n      377927,   446341,   509632,   567840,\n      621021,   669239,   712574,   751116,\n      784966,   814237,   839050,   859535,\n      875832,   888088,   896456,   901096,\n      902174,   899861,   894330,   885761,\n     -874332,  -860226,  -843628,  -824721,\n     -803690,  -780717,  -755985,  -729674,\n     -701963,  -673024,  -643030,  -612148,\n     -580539,  -548362,  -515770,  -482909,\n     -449919,  -416936,  -384088,  -351496,\n     -319275,  -287532,  -256368,  -225877,\n     -196143,  -167246,  -139258,  -112242,\n      -86256,   -61350,   -37567,   -14943,\n        6492,    26715,    45709,    63462,\n       79969,    95232,   109254,   122046,\n      133624,   144007,   153218,   161285,\n      168238,   174112,   178943,   182770,\n      185635,   187581,   188654,   188899,\n      188363,   187097,   185149,   182566,\n      179400,   175697,   171507,   166879,\n      161858,   156491,   150823,   144898,\n     -138758,  -132443,  -125994,  -119446,\n     -112837,  -106198,   -99563,   -92960,\n      -86417,   -79961,   -73614,   -67398,\n      -61334,   -55437,   -49725,   -44210,\n      -38904,   -33819,   -28961,   -24337,\n      -19953,   -15812,   -11916,    -8265,\n       -4860,    -1697,     1225,     3911,\n        6366,     8595,    10605,    12403,\n       13996,    15393,    16603,    17634,\n       18496,    19198,    19749,    20160,\n       20439,    20597,    20643,    20587,\n       20436,    20202,    19891,    19513,\n       19075,    18585,    18051,    17480,\n       16877,    16250,    15604,    14945,\n       14277,    13605,    12933,    12265,\n       11605,    10955,    10319,     9698,\n       -9094,    -8510,    -7947,    -7405,\n       -6886,    -6390,    -5918,    -5470,\n       -5046,    -4646,    -4270,    -3916,\n       -3586,    -3277,    -2990,    -2723,\n       -2475,    -2247,    -2036,    -1843,\n       -1665,    -1502,    -1354,    -1218,\n       -1095,     -983,     -881,     -789,\n        -706,     -631,     -563,     -502,\n        -447,     -397,     -353,     -313,\n        -277,     -244,     -215,     -189,\n        -165,     -144,     -124,     -107,\n         -91,      -77,      -64,      -53\n};\n\nstatic const int32_t lfe_fir_64[256] = {\n     6103,   52170, -558064, 1592440, 6290049, 1502534, -546669, 53047,\n     1930,   51089, -568920, 1683709, 6286575, 1414057, -534782, 53729,\n     2228,   49794, -579194, 1776276, 6279634, 1327070, -522445, 54228,\n     2552,   48275, -588839, 1870070, 6269231, 1241632, -509702, 54550,\n     2904,   46523, -597808, 1965017, 6255380, 1157798, -496595, 54708,\n     3287,   44529, -606054, 2061044, 6238099, 1075621, -483164, 54710,\n     3704,   42282, -613529, 2158071, 6217408,  995149, -469451, 54566,\n     4152,   39774, -620186, 2256019, 6193332,  916430, -455494, 54285,\n     4631,   36995, -625976, 2354805, 6165900,  839507, -441330, 53876,\n     5139,   33937, -630850, 2454343, 6135146,  764419, -426998, 53348,\n     5682,   30591, -634759, 2554547, 6101107,  691203, -412531, 52711,\n     6264,   26948, -637655, 2655326, 6063824,  619894, -397966, 51972,\n     6886,   23001, -639488, 2756591, 6023343,  550521, -383335, 51140,\n     7531,   18741, -640210, 2858248, 5979711,  483113, -368671, 50224,\n     8230,   14162, -639772, 2960201, 5932981,  417692, -354003, 49231,\n     8959,    9257, -638125, 3062355, 5883210,  354281, -339362, 48168,\n     9727,    4018, -635222, 3164612, 5830457,  292897, -324777, 47044,\n    10535,   -1558, -631014, 3266872, 5774785,  233555, -310273, 45866,\n    11381,   -7480, -625455, 3369035, 5716260,  176267, -295877, 44640,\n    12267,  -13750, -618499, 3471000, 5654952,  121042, -281613, 43373,\n    13190,  -20372, -610098, 3572664, 5590933,   67886, -267505, 42072,\n    14152,  -27352, -600209, 3673924, 5524280,   16800, -253574, 40743,\n    15153,  -34691, -588788, 3774676, 5455069,  -32214, -239840, 39391,\n    16192,  -42390, -575791, 3874816, 5383383,  -79159, -226323, 38022,\n    17267,  -50453, -561178, 3974239, 5309305, -124041, -213041, 36642,\n    18377,  -58879, -544906, 4072841, 5232922, -166869, -200010, 35256,\n    19525,  -67667, -526937, 4170517, 5154321, -207653, -187246, 33866,\n    20704,  -76817, -507233, 4267162, 5073593, -246406, -174764, 32480,\n    21915,  -86327, -485757, 4362672, 4990831, -283146, -162575, 31101,\n    23157,  -96193, -462476, 4456942, 4906129, -317890, -150692, 29732,\n    24426, -106412, -437356, 4549871, 4819584, -350658, -139125, 28376,\n    25721, -116977, -410365, 4641355, 4731293, -381475, -127884, 27038\n};\n\n//  floor(fir_float.band_fir_x96[i] * (1 << 29) + 0.5), (i & 127) <  32\n// -floor(fir_float.band_fir_x96[i] * (1 << 29) + 0.5), (i & 127) >= 32\nstatic const int32_t band_fir_x96[1024] = {\n         -38,      -38,      -43,      -48,\n         -52,      -57,      -62,      -67,\n         -73,      -79,      -85,      -91,\n         -98,     -105,     -113,     -121,\n        -129,     -138,     -147,     -157,\n        -167,     -178,     -190,     -202,\n        -215,     -228,     -242,     -257,\n        -273,     -289,     -307,     -325,\n         345,      365,      387,      410,\n         433,      459,      485,      513,\n         543,      574,      606,      640,\n         676,      714,      753,      795,\n         839,      884,      932,      983,\n        1035,     1090,     1148,     1208,\n        1271,     1336,     1405,     1476,\n        1550,     1628,     1709,     1793,\n        1880,     1971,     2065,     2163,\n        2265,     2370,     2479,     2592,\n        2709,     2830,     2955,     3084,\n        3217,     3354,     3496,     3642,\n        3791,     3946,     4104,     4267,\n        4433,     4604,     4780,     4959,\n        5143,     5330,     5522,     5717,\n        5916,     6119,     6326,     6536,\n        6749,     6966,     7186,     7408,\n        7633,     7861,     8090,     8322,\n        8556,     8791,     9027,     9264,\n        9501,     9739,     9977,    10214,\n       10450,    10685,    10918,    11149,\n       11377,    11603,    11825,    12042,\n       12255,    12463,    12665,    12861,\n       13050,    13231,    13405,    13569,\n       13724,    13869,    14002,    14125,\n       14235,    14331,    14415,    14483,\n       14536,    14573,    14594,    14596,\n       14580,    14544,    14488,    14412,\n       14313,    14191,    14046,    13877,\n       13682,    13461,    13213,    12937,\n       12632,    12298,    11934,    11538,\n       11111,    10650,    10156,     9628,\n       -9065,    -8466,    -7830,    -7158,\n       -6447,    -5698,    -4910,    -4083,\n       -3215,    -2306,    -1357,     -366,\n         668,     1743,     2861,     4022,\n        5226,     6474,     7764,     9098,\n       10476,    11897,    13361,    14868,\n       16418,    18011,    19645,    21322,\n       23039,    24798,    26596,    28433,\n       30309,    32222,    34172,    36158,\n       38177,    40231,    42315,    44431,\n       46575,    48747,    50945,    53167,\n       55411,    57676,    59959,    62258,\n       64571,    66897,    69231,    71573,\n       73919,    76268,    78615,    80959,\n       83296,    85624,    87939,    90239,\n       92519,    94778,    97011,    99215,\n      101386,   103521,   105616,   107668,\n      109673,   111626,   113524,   115362,\n      117138,   118847,   120484,   122045,\n      123527,   124925,   126234,   127451,\n      128571,   129591,   130504,   131308,\n      131997,   132568,   133016,   133338,\n      133528,   133582,   133495,   133265,\n      132886,   132355,   131668,   130820,\n      129807,   128626,   127274,   125746,\n      124038,   122148,   120071,   117806,\n      115348,   112694,   109843,   106790,\n      103534,   100071,    96401,    92520,\n       88426,    84119,    79597,    74857,\n       69900,    64723,    59327,    53711,\n       47875,    41818,    35542,    29045,\n       22330,    15397,     8247,      881,\n        6697,    14487,    22487,    30692,\n       39101,    47711,    56517,    65516,\n       74704,    84076,    93628,   103355,\n      113251,   123311,   133528,   143897,\n      154410,   165061,   175843,   186747,\n      197766,   208892,   220116,   231429,\n      242822,   254285,   265810,   277384,\n      288999,   300644,   312306,   323976,\n      335641,   347289,   358909,   370488,\n      382013,   393471,   404848,   416133,\n      427310,   438366,   449286,   460057,\n      470663,   481090,   491323,   501347,\n      511147,   520707,   530011,   539044,\n      547790,   556233,   564357,   572146,\n      579584,   586654,   593341,   599627,\n      605498,   610936,   615925,   620449,\n      624491,   628037,   631069,   633571,\n      635529,   636925,   637745,   637972,\n      637593,   636592,   634953,   632662,\n      629705,   626068,   621737,   616698,\n      610938,   604443,   597202,   589202,\n      580431,   570877,   560530,   549378,\n      537411,   524620,   510994,   496525,\n      481205,   465026,   447979,   430058,\n      411256,   391569,   370989,   349514,\n      327137,   303857,   279670,   254573,\n      228564,   201644,   173811,   145065,\n      115408,    84840,    53365,    20984,\n      -12298,   -46478,   -81550,  -117508,\n     -154347,  -192060,  -230638,  -270073,\n     -310356,  -351478,  -393427,  -436192,\n     -479762,  -524124,  -569264,  -615168,\n      661821,   709209,   757314,   806121,\n      855611,   905766,   956569,  1007998,\n     1060035,  1112658,  1165846,  1219578,\n     1273830,  1328580,  1383805,  1439479,\n     1495578,  1552077,  1608950,  1666171,\n     1723714,  1781550,  1839653,  1897995,\n     1956546,  2015279,  2074163,  2133170,\n     2192270,  2251432,  2310626,  2369822,\n     2428988,  2488093,  2547106,  2605996,\n     2664731,  2723279,  2781607,  2839685,\n     2897481,  2954962,  3012096,  3068851,\n     3125195,  3181097,  3236524,  3291445,\n     3345829,  3399643,  3452858,  3505441,\n     3557362,  3608591,  3659098,  3708853,\n     3757825,  3805987,  3853309,  3899763,\n     3945322,  3989957,  4033642,  4076350,\n     4118055,  4158733,  4198357,  4236904,\n     4274351,  4310673,  4345850,  4379859,\n     4412678,  4444289,  4474670,  4503803,\n     4531671,  4558255,  4583539,  4607508,\n     4630146,  4651438,  4671373,  4689936,\n     4707117,  4722905,  4737290,  4750262,\n     4761813,  4771936,  4780625,  4787874,\n     4793679,  4798036,  4800943,  4802396,\n     4802396,  4800943,  4798036,  4793679,\n     4787874,  4780625,  4771936,  4761813,\n     4750262,  4737290,  4722905,  4707117,\n     4689936,  4671373,  4651438,  4630146,\n     4607508,  4583539,  4558255,  4531671,\n     4503803,  4474670,  4444289,  4412678,\n     4379859,  4345850,  4310673,  4274351,\n     4236904,  4198357,  4158733,  4118055,\n    -4076350, -4033642, -3989957, -3945322,\n    -3899763, -3853309, -3805987, -3757825,\n    -3708853, -3659098, -3608591, -3557362,\n    -3505441, -3452858, -3399643, -3345829,\n    -3291445, -3236524, -3181097, -3125195,\n    -3068851, -3012096, -2954962, -2897481,\n    -2839685, -2781607, -2723279, -2664731,\n    -2605996, -2547106, -2488093, -2428988,\n    -2369822, -2310626, -2251432, -2192270,\n    -2133170, -2074163, -2015279, -1956546,\n    -1897995, -1839653, -1781550, -1723714,\n    -1666171, -1608950, -1552077, -1495578,\n    -1439479, -1383805, -1328580, -1273830,\n    -1219578, -1165846, -1112658, -1060035,\n    -1007998,  -956569,  -905766,  -855611,\n     -806121,  -757314,  -709209,  -661821,\n     -615168,  -569264,  -524124,  -479762,\n     -436192,  -393427,  -351478,  -310356,\n     -270073,  -230638,  -192060,  -154347,\n     -117508,   -81550,   -46478,   -12298,\n       20984,    53365,    84840,   115408,\n      145065,   173811,   201644,   228564,\n      254573,   279670,   303857,   327137,\n      349514,   370989,   391569,   411256,\n      430058,   447979,   465026,   481205,\n      496525,   510994,   524620,   537411,\n      549378,   560530,   570877,   580431,\n      589202,   597202,   604443,   610938,\n      616698,   621737,   626068,   629705,\n      632662,   634953,   636592,   637593,\n      637972,   637745,   636925,   635529,\n      633571,   631069,   628037,   624491,\n     -620449,  -615925,  -610936,  -605498,\n     -599627,  -593341,  -586654,  -579584,\n     -572146,  -564357,  -556233,  -547790,\n     -539044,  -530011,  -520707,  -511147,\n     -501347,  -491323,  -481090,  -470663,\n     -460057,  -449286,  -438366,  -427310,\n     -416133,  -404848,  -393471,  -382013,\n     -370488,  -358909,  -347289,  -335641,\n     -323976,  -312306,  -300644,  -288999,\n     -277384,  -265810,  -254285,  -242822,\n     -231429,  -220116,  -208892,  -197766,\n     -186747,  -175843,  -165061,  -154410,\n     -143897,  -133528,  -123311,  -113251,\n     -103355,   -93628,   -84076,   -74704,\n      -65516,   -56517,   -47711,   -39101,\n      -30692,   -22487,   -14487,    -6697,\n         881,     8247,    15397,    22330,\n       29045,    35542,    41818,    47875,\n       53711,    59327,    64723,    69900,\n       74857,    79597,    84119,    88426,\n       92520,    96401,   100071,   103534,\n      106790,   109843,   112694,   115348,\n      117806,   120071,   122148,   124038,\n      125746,   127274,   128626,   129807,\n      130820,   131668,   132355,   132886,\n      133265,   133495,   133582,   133528,\n      133338,   133016,   132568,   131997,\n      131308,   130504,   129591,   128571,\n      127451,   126234,   124925,   123527,\n      122045,   120484,   118847,   117138,\n      115362,   113524,   111626,   109673,\n      107668,   105616,   103521,   101386,\n      -99215,   -97011,   -94778,   -92519,\n      -90239,   -87939,   -85624,   -83296,\n      -80959,   -78615,   -76268,   -73919,\n      -71573,   -69231,   -66897,   -64571,\n      -62258,   -59959,   -57676,   -55411,\n      -53167,   -50945,   -48747,   -46575,\n      -44431,   -42315,   -40231,   -38177,\n      -36158,   -34172,   -32222,   -30309,\n      -28433,   -26596,   -24798,   -23039,\n      -21322,   -19645,   -18011,   -16418,\n      -14868,   -13361,   -11897,   -10476,\n       -9098,    -7764,    -6474,    -5226,\n       -4022,    -2861,    -1743,     -668,\n         366,     1357,     2306,     3215,\n        4083,     4910,     5698,     6447,\n        7158,     7830,     8466,     9065,\n        9628,    10156,    10650,    11111,\n       11538,    11934,    12298,    12632,\n       12937,    13213,    13461,    13682,\n       13877,    14046,    14191,    14313,\n       14412,    14488,    14544,    14580,\n       14596,    14594,    14573,    14536,\n       14483,    14415,    14331,    14235,\n       14125,    14002,    13869,    13724,\n       13569,    13405,    13231,    13050,\n       12861,    12665,    12463,    12255,\n       12042,    11825,    11603,    11377,\n       11149,    10918,    10685,    10450,\n       10214,     9977,     9739,     9501,\n        9264,     9027,     8791,     8556,\n        8322,     8090,     7861,     7633,\n        7408,     7186,     6966,     6749,\n       -6536,    -6326,    -6119,    -5916,\n       -5717,    -5522,    -5330,    -5143,\n       -4959,    -4780,    -4604,    -4433,\n       -4267,    -4104,    -3946,    -3791,\n       -3642,    -3496,    -3354,    -3217,\n       -3084,    -2955,    -2830,    -2709,\n       -2592,    -2479,    -2370,    -2265,\n       -2163,    -2065,    -1971,    -1880,\n       -1793,    -1709,    -1628,    -1550,\n       -1476,    -1405,    -1336,    -1271,\n       -1208,    -1148,    -1090,    -1035,\n        -983,     -932,     -884,     -839,\n        -795,     -753,     -714,     -676,\n        -640,     -606,     -574,     -543,\n        -513,     -485,     -459,     -433,\n        -410,     -387,     -365,     -345,\n        -325,     -307,     -289,     -273,\n        -257,     -242,     -228,     -215,\n        -202,     -190,     -178,     -167,\n        -157,     -147,     -138,     -129,\n        -121,     -113,     -105,      -98,\n         -91,      -85,      -79,      -73,\n         -67,      -62,      -57,      -52,\n         -48,      -43,      -38,      -38\n};\n"
  },
  {
    "path": "libdcadec/fir_float.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#define SCALE(x)    ((x) * M_SQRT2 * 128)\n\n// Annex D.8 - 32-band interpolation FIR, perfect reconstruction\nstatic const double band_fir_perfect[512] = {\n     SCALE( 1.140033200E-10),  SCALE( 7.138742100E-11),\n     SCALE(-8.358679600E-09),  SCALE(-2.529296600E-08),\n     SCALE(-9.130198800E-08),  SCALE(-2.771560000E-07),\n     SCALE(-5.746147600E-07),  SCALE(-3.712986200E-07),\n     SCALE(-4.468735700E-07),  SCALE(-5.697322600E-07),\n     SCALE(-6.300390500E-07),  SCALE(-6.677818900E-07),\n     SCALE(-6.770656500E-07),  SCALE(-6.601852300E-07),\n     SCALE(-6.193701600E-07),  SCALE(-5.586146700E-07),\n    -SCALE( 7.034745600E-07), -SCALE( 8.348606100E-07),\n    -SCALE( 9.544782800E-07), -SCALE( 1.052683900E-06),\n    -SCALE( 1.119829700E-06), -SCALE( 1.144180200E-06),\n    -SCALE( 1.124542400E-06), -SCALE( 9.822894700E-07),\n    -SCALE( 8.920065800E-07), -SCALE( 1.560941800E-06),\n    -SCALE( 8.454480100E-07), -SCALE( 3.167104300E-07),\n    -SCALE( 1.028149000E-07), -SCALE( 4.147967800E-08),\n    -SCALE(-6.821591800E-10), -SCALE(-1.611726200E-09),\n    -SCALE(-2.668096400E-09), -SCALE(-3.377455500E-09),\n    -SCALE( 6.820855300E-09), -SCALE( 3.715261200E-09),\n    -SCALE( 1.643020800E-08), -SCALE( 1.007547900E-07),\n    -SCALE( 2.448299500E-07), -SCALE( 1.306777300E-06),\n    -SCALE( 1.904890000E-06), -SCALE( 2.555774300E-06),\n    -SCALE( 3.253336000E-06), -SCALE( 3.953604500E-06),\n    -SCALE( 4.617880200E-06), -SCALE( 5.210775600E-06),\n    -SCALE( 5.696789700E-06), -SCALE( 6.046428700E-06),\n    -SCALE( 7.614387900E-06), -SCALE( 7.678809700E-06),\n    -SCALE( 7.533601500E-06), -SCALE( 7.179758900E-06),\n    -SCALE( 6.629955000E-06), -SCALE( 5.908209500E-06),\n    -SCALE( 5.044609200E-06), -SCALE( 4.187209700E-06),\n    -SCALE( 3.139397100E-06), -SCALE( 6.650809100E-07),\n    -SCALE( 3.073465500E-07), -SCALE( 5.699348500E-08),\n    -SCALE( 1.510238900E-08), -SCALE( 3.384827600E-08),\n    -SCALE(-3.227406600E-08), -SCALE(-3.772031200E-08),\n     SCALE( 8.454083600E-08),  SCALE( 6.479789100E-08),\n     SCALE( 1.236415900E-06),  SCALE( 2.480143600E-06),\n     SCALE( 3.694976800E-06),  SCALE( 3.742137100E-06),\n     SCALE( 3.262621300E-06),  SCALE( 7.476824700E-06),\n     SCALE( 9.321632700E-06),  SCALE( 1.121856000E-05),\n     SCALE( 1.317522400E-05),  SCALE( 1.505747500E-05),\n     SCALE( 1.676702500E-05),  SCALE( 1.819741000E-05),\n     SCALE( 1.925789500E-05),  SCALE( 1.987389300E-05),\n    -SCALE(-3.076839000E-05), -SCALE(-3.254459900E-05),\n    -SCALE(-3.367812600E-05), -SCALE(-3.411568400E-05),\n    -SCALE(-3.382472000E-05), -SCALE(-3.280414400E-05),\n    -SCALE(-3.109003600E-05), -SCALE(-2.861654300E-05),\n    -SCALE(-2.571454500E-05), -SCALE(-1.870056200E-05),\n    -SCALE(-1.771374800E-05), -SCALE(-1.568432200E-05),\n    -SCALE(-1.128458200E-05), -SCALE(-6.805568100E-06),\n    -SCALE(-5.671807300E-07), -SCALE(-9.974569000E-07),\n    -SCALE(-1.466421500E-06), -SCALE(-1.846174800E-06),\n    -SCALE( 7.763173700E-08), -SCALE( 1.809597500E-06),\n    -SCALE( 4.157326000E-06), -SCALE( 7.240269200E-06),\n    -SCALE( 1.073666400E-05), -SCALE( 2.089583800E-05),\n    -SCALE( 2.647159500E-05), -SCALE( 3.196094400E-05),\n    -SCALE( 3.698112500E-05), -SCALE( 4.149260300E-05),\n    -SCALE( 4.534151200E-05), -SCALE( 4.846834800E-05),\n    -SCALE( 5.081695700E-05), -SCALE( 5.236303900E-05),\n    -SCALE( 3.803557300E-06), -SCALE( 7.916183300E-06),\n    -SCALE( 1.191309700E-05), -SCALE( 1.561346600E-05),\n    -SCALE( 1.881671400E-05), -SCALE( 2.131957100E-05),\n    -SCALE( 2.295038200E-05), -SCALE( 2.354812700E-05),\n    -SCALE( 2.291622100E-05), -SCALE( 2.497457200E-05),\n    -SCALE( 1.979628700E-05), -SCALE( 1.390508100E-05),\n    -SCALE( 7.179248900E-06), -SCALE(-1.614022200E-07),\n    -SCALE(-1.518084500E-05), -SCALE(-1.610369300E-05),\n     SCALE( 1.994364800E-05),  SCALE( 1.774116500E-05),\n     SCALE( 4.511232400E-05),  SCALE( 5.311715600E-05),\n     SCALE( 6.144976200E-05),  SCALE( 7.052899300E-05),\n     SCALE( 7.984114900E-05),  SCALE( 8.597821200E-05),\n     SCALE( 9.341758200E-05),  SCALE( 1.002681400E-04),\n     SCALE( 1.064814700E-04),  SCALE( 1.119841200E-04),\n     SCALE( 1.165901700E-04),  SCALE( 1.202018700E-04),\n     SCALE( 1.226936800E-04),  SCALE( 1.237377900E-04),\n    -SCALE( 1.200453700E-04), -SCALE( 1.185602000E-04),\n    -SCALE( 1.152534400E-04), -SCALE( 1.097435100E-04),\n    -SCALE( 1.018237000E-04), -SCALE( 9.130172200E-05),\n    -SCALE( 7.793692700E-05), -SCALE( 6.157321800E-05),\n    -SCALE( 4.214289700E-05), -SCALE( 2.010055900E-05),\n    -SCALE(-6.512868000E-06), -SCALE(-3.623958500E-05),\n    -SCALE(-6.898332300E-05), -SCALE(-1.052143400E-04),\n    -SCALE(-1.311540500E-04), -SCALE(-1.772621900E-04),\n    -SCALE(-2.231129500E-04), -SCALE(-2.678985000E-04),\n    -SCALE(-3.353960600E-04), -SCALE(-3.909221300E-04),\n    -SCALE(-4.488403900E-04), -SCALE(-5.091327500E-04),\n    -SCALE(-5.717321000E-04), -SCALE(-6.360244700E-04),\n    -SCALE(-7.021067600E-04), -SCALE(-7.695597500E-04),\n    -SCALE(-8.380918900E-04), -SCALE(-9.072555100E-04),\n    -SCALE(-9.767158300E-04), -SCALE(-1.045985500E-03),\n    -SCALE(-1.114606900E-03), -SCALE(-1.182107000E-03),\n    -SCALE(-1.251459700E-03), -SCALE(-1.314813200E-03),\n    -SCALE(-1.375058300E-03), -SCALE(-1.431717500E-03),\n    -SCALE(-1.484159500E-03), -SCALE(-1.531686400E-03),\n    -SCALE(-1.573715600E-03), -SCALE(-1.609496400E-03),\n    -SCALE(-1.638393400E-03), -SCALE(-1.659751400E-03),\n    -SCALE(-1.672691700E-03), -SCALE(-1.676540900E-03),\n    -SCALE(-1.670887400E-03), -SCALE(-1.654649800E-03),\n    -SCALE(-1.632849400E-03), -SCALE(-1.592423900E-03),\n     SCALE( 1.541196600E-03),  SCALE( 1.478566700E-03),\n     SCALE( 1.394017000E-03),  SCALE( 1.301623400E-03),\n     SCALE( 1.194737700E-03),  SCALE( 1.072608600E-03),\n     SCALE( 9.349224800E-04),  SCALE( 7.810380900E-04),\n     SCALE( 6.109076600E-04),  SCALE( 4.241331700E-04),\n     SCALE( 2.204804700E-04),  SCALE(-2.272228400E-07),\n     SCALE(-2.380696500E-04),  SCALE(-4.930996000E-04),\n     SCALE(-7.653038000E-04),  SCALE(-1.054538000E-03),\n    -SCALE(-1.360519200E-03), -SCALE(-1.683383000E-03),\n    -SCALE(-2.022614600E-03), -SCALE(-2.377899500E-03),\n    -SCALE(-2.748797700E-03), -SCALE(-3.134797500E-03),\n    -SCALE(-3.535329200E-03), -SCALE(-3.949734800E-03),\n    -SCALE(-4.377291000E-03), -SCALE(-4.817122000E-03),\n    -SCALE(-5.268542300E-03), -SCALE(-5.730478300E-03),\n    -SCALE(-6.202005100E-03), -SCALE(-6.681936000E-03),\n    -SCALE(-7.167914500E-03), -SCALE(-7.662045500E-03),\n    -SCALE(-8.160839200E-03), -SCALE(-8.663190500E-03),\n    -SCALE(-9.169050700E-03), -SCALE(-9.675131500E-03),\n    -SCALE(-1.018101800E-02), -SCALE(-1.068536400E-02),\n    -SCALE(-1.118674000E-02), -SCALE(-1.168377500E-02),\n    -SCALE(-1.217496400E-02), -SCALE(-1.265891600E-02),\n    -SCALE(-1.313420500E-02), -SCALE(-1.359941000E-02),\n    -SCALE(-1.405313100E-02), -SCALE(-1.449398400E-02),\n    -SCALE(-1.492061500E-02), -SCALE(-1.533170500E-02),\n    -SCALE(-1.572581500E-02), -SCALE(-1.610200000E-02),\n    -SCALE(-1.645893800E-02), -SCALE(-1.679548100E-02),\n    -SCALE(-1.711054800E-02), -SCALE(-1.740312600E-02),\n    -SCALE(-1.767225900E-02), -SCALE(-1.791707200E-02),\n    -SCALE(-1.813675700E-02), -SCALE(-1.833061700E-02),\n    -SCALE(-1.849797400E-02), -SCALE(-1.863830100E-02),\n    -SCALE(-1.875108700E-02), -SCALE(-1.883604000E-02),\n    -SCALE(-1.889315300E-02), -SCALE(-1.892151600E-02),\n     SCALE( 1.892151600E-02),  SCALE( 1.889315300E-02),\n     SCALE( 1.883604000E-02),  SCALE( 1.875108700E-02),\n     SCALE( 1.863830100E-02),  SCALE( 1.849797400E-02),\n     SCALE( 1.833061700E-02),  SCALE( 1.813675700E-02),\n     SCALE( 1.791707200E-02),  SCALE( 1.767225900E-02),\n     SCALE( 1.740312600E-02),  SCALE( 1.711054800E-02),\n     SCALE( 1.679548100E-02),  SCALE( 1.645893800E-02),\n     SCALE( 1.610200000E-02),  SCALE( 1.572581500E-02),\n    -SCALE( 1.533170500E-02), -SCALE( 1.492061500E-02),\n    -SCALE( 1.449398400E-02), -SCALE( 1.405313100E-02),\n    -SCALE( 1.359941000E-02), -SCALE( 1.313420500E-02),\n    -SCALE( 1.265891600E-02), -SCALE( 1.217496400E-02),\n    -SCALE( 1.168377500E-02), -SCALE( 1.118674000E-02),\n    -SCALE( 1.068536400E-02), -SCALE( 1.018101800E-02),\n    -SCALE( 9.675131500E-03), -SCALE( 9.169050700E-03),\n    -SCALE( 8.663190500E-03), -SCALE( 8.160839200E-03),\n    -SCALE( 7.662045500E-03), -SCALE( 7.167914500E-03),\n    -SCALE( 6.681936000E-03), -SCALE( 6.202005100E-03),\n    -SCALE( 5.730478300E-03), -SCALE( 5.268542300E-03),\n    -SCALE( 4.817122000E-03), -SCALE( 4.377291000E-03),\n    -SCALE( 3.949734800E-03), -SCALE( 3.535329200E-03),\n    -SCALE( 3.134797500E-03), -SCALE( 2.748797700E-03),\n    -SCALE( 2.377899500E-03), -SCALE( 2.022614600E-03),\n    -SCALE( 1.683383000E-03), -SCALE( 1.360519200E-03),\n    -SCALE( 1.054538000E-03), -SCALE( 7.653038000E-04),\n    -SCALE( 4.930996000E-04), -SCALE( 2.380696500E-04),\n    -SCALE( 2.272228400E-07), -SCALE(-2.204804700E-04),\n    -SCALE(-4.241331700E-04), -SCALE(-6.109076600E-04),\n    -SCALE(-7.810380900E-04), -SCALE(-9.349224800E-04),\n    -SCALE(-1.072608600E-03), -SCALE(-1.194737700E-03),\n    -SCALE(-1.301623400E-03), -SCALE(-1.394017000E-03),\n    -SCALE(-1.478566700E-03), -SCALE(-1.541196600E-03),\n     SCALE( 1.592423900E-03),  SCALE( 1.632849400E-03),\n     SCALE( 1.654649800E-03),  SCALE( 1.670887400E-03),\n     SCALE( 1.676540900E-03),  SCALE( 1.672691700E-03),\n     SCALE( 1.659751400E-03),  SCALE( 1.638393400E-03),\n     SCALE( 1.609496400E-03),  SCALE( 1.573715600E-03),\n     SCALE( 1.531686400E-03),  SCALE( 1.484159500E-03),\n     SCALE( 1.431717500E-03),  SCALE( 1.375058300E-03),\n     SCALE( 1.314813200E-03),  SCALE( 1.251459700E-03),\n    -SCALE( 1.182107000E-03), -SCALE( 1.114606900E-03),\n    -SCALE( 1.045985500E-03), -SCALE( 9.767158300E-04),\n    -SCALE( 9.072555100E-04), -SCALE( 8.380918900E-04),\n    -SCALE( 7.695597500E-04), -SCALE( 7.021067600E-04),\n    -SCALE( 6.360244700E-04), -SCALE( 5.717321000E-04),\n    -SCALE( 5.091327500E-04), -SCALE( 4.488403900E-04),\n    -SCALE( 3.909221300E-04), -SCALE( 3.353960600E-04),\n    -SCALE( 2.678985000E-04), -SCALE( 2.231129500E-04),\n    -SCALE( 1.772621900E-04), -SCALE( 1.311540500E-04),\n    -SCALE( 1.052143400E-04), -SCALE( 6.898332300E-05),\n    -SCALE( 3.623958500E-05), -SCALE( 6.512868000E-06),\n    -SCALE(-2.010055900E-05), -SCALE(-4.214289700E-05),\n    -SCALE(-6.157321800E-05), -SCALE(-7.793692700E-05),\n    -SCALE(-9.130172200E-05), -SCALE(-1.018237000E-04),\n    -SCALE(-1.097435100E-04), -SCALE(-1.152534400E-04),\n    -SCALE(-1.185602000E-04), -SCALE(-1.200453700E-04),\n    -SCALE(-1.237377900E-04), -SCALE(-1.226936800E-04),\n    -SCALE(-1.202018700E-04), -SCALE(-1.165901700E-04),\n    -SCALE(-1.119841200E-04), -SCALE(-1.064814700E-04),\n    -SCALE(-1.002681400E-04), -SCALE(-9.341758200E-05),\n    -SCALE(-8.597821200E-05), -SCALE(-7.984114900E-05),\n    -SCALE(-7.052899300E-05), -SCALE(-6.144976200E-05),\n    -SCALE(-5.311715600E-05), -SCALE(-4.511232400E-05),\n    -SCALE(-1.774116500E-05), -SCALE(-1.994364800E-05),\n     SCALE( 1.610369300E-05),  SCALE( 1.518084500E-05),\n     SCALE( 1.614022200E-07),  SCALE(-7.179248900E-06),\n     SCALE(-1.390508100E-05),  SCALE(-1.979628700E-05),\n     SCALE(-2.497457200E-05),  SCALE(-2.291622100E-05),\n     SCALE(-2.354812700E-05),  SCALE(-2.295038200E-05),\n     SCALE(-2.131957100E-05),  SCALE(-1.881671400E-05),\n     SCALE(-1.561346600E-05),  SCALE(-1.191309700E-05),\n     SCALE(-7.916183300E-06),  SCALE(-3.803557300E-06),\n    -SCALE(-5.236303900E-05), -SCALE(-5.081695700E-05),\n    -SCALE(-4.846834800E-05), -SCALE(-4.534151200E-05),\n    -SCALE(-4.149260300E-05), -SCALE(-3.698112500E-05),\n    -SCALE(-3.196094400E-05), -SCALE(-2.647159500E-05),\n    -SCALE(-2.089583800E-05), -SCALE(-1.073666400E-05),\n    -SCALE(-7.240269200E-06), -SCALE(-4.157326000E-06),\n    -SCALE(-1.809597500E-06), -SCALE(-7.763173700E-08),\n    -SCALE( 1.846174800E-06), -SCALE( 1.466421500E-06),\n    -SCALE( 9.974569000E-07), -SCALE( 5.671807300E-07),\n    -SCALE( 6.805568100E-06), -SCALE( 1.128458200E-05),\n    -SCALE( 1.568432200E-05), -SCALE( 1.771374800E-05),\n    -SCALE( 1.870056200E-05), -SCALE( 2.571454500E-05),\n    -SCALE( 2.861654300E-05), -SCALE( 3.109003600E-05),\n    -SCALE( 3.280414400E-05), -SCALE( 3.382472000E-05),\n    -SCALE( 3.411568400E-05), -SCALE( 3.367812600E-05),\n    -SCALE( 3.254459900E-05), -SCALE( 3.076839000E-05),\n    -SCALE(-1.987389300E-05), -SCALE(-1.925789500E-05),\n    -SCALE(-1.819741000E-05), -SCALE(-1.676702500E-05),\n    -SCALE(-1.505747500E-05), -SCALE(-1.317522400E-05),\n    -SCALE(-1.121856000E-05), -SCALE(-9.321632700E-06),\n    -SCALE(-7.476824700E-06), -SCALE(-3.262621300E-06),\n    -SCALE(-3.742137100E-06), -SCALE(-3.694976800E-06),\n    -SCALE(-2.480143600E-06), -SCALE(-1.236415900E-06),\n    -SCALE(-6.479789100E-08), -SCALE(-8.454083600E-08),\n     SCALE( 3.772031200E-08),  SCALE( 3.227406600E-08),\n     SCALE(-3.384827600E-08),  SCALE(-1.510238900E-08),\n     SCALE(-5.699348500E-08),  SCALE(-3.073465500E-07),\n     SCALE(-6.650809100E-07),  SCALE(-3.139397100E-06),\n     SCALE(-4.187209700E-06),  SCALE(-5.044609200E-06),\n     SCALE(-5.908209500E-06),  SCALE(-6.629955000E-06),\n     SCALE(-7.179758900E-06),  SCALE(-7.533601500E-06),\n     SCALE(-7.678809700E-06),  SCALE(-7.614387900E-06),\n    -SCALE(-6.046428700E-06), -SCALE(-5.696789700E-06),\n    -SCALE(-5.210775600E-06), -SCALE(-4.617880200E-06),\n    -SCALE(-3.953604500E-06), -SCALE(-3.253336000E-06),\n    -SCALE(-2.555774300E-06), -SCALE(-1.904890000E-06),\n    -SCALE(-1.306777300E-06), -SCALE(-2.448299500E-07),\n    -SCALE(-1.007547900E-07), -SCALE(-1.643020800E-08),\n    -SCALE(-3.715261200E-09), -SCALE(-6.820855300E-09),\n    -SCALE( 3.377455500E-09), -SCALE( 2.668096400E-09),\n    -SCALE( 1.611726200E-09), -SCALE( 6.821591800E-10),\n    -SCALE(-4.147967800E-08), -SCALE(-1.028149000E-07),\n    -SCALE(-3.167104300E-07), -SCALE(-8.454480100E-07),\n    -SCALE(-1.560941800E-06), -SCALE(-8.920065800E-07),\n    -SCALE(-9.822894700E-07), -SCALE(-1.124542400E-06),\n    -SCALE(-1.144180200E-06), -SCALE(-1.119829700E-06),\n    -SCALE(-1.052683900E-06), -SCALE(-9.544782800E-07),\n    -SCALE(-8.348606100E-07), -SCALE(-7.034745600E-07),\n    -SCALE( 5.586146700E-07), -SCALE( 6.193701600E-07),\n    -SCALE( 6.601852300E-07), -SCALE( 6.770656500E-07),\n    -SCALE( 6.677818900E-07), -SCALE( 6.300390500E-07),\n    -SCALE( 5.697322600E-07), -SCALE( 4.468735700E-07),\n    -SCALE( 3.712986200E-07), -SCALE( 5.746147600E-07),\n    -SCALE( 2.771560000E-07), -SCALE( 9.130198800E-08),\n    -SCALE( 2.529296600E-08), -SCALE( 8.358679600E-09),\n    -SCALE(-7.138742100E-11), -SCALE(-1.140033200E-10)\n};\n\n// Annex D.8 - 32-band interpolation FIR, non-perfect reconstruction\nstatic const double band_fir_nonperfect[512] = {\n     SCALE(-1.390191784E-07),  SCALE(-1.693738625E-07),\n     SCALE(-2.030677564E-07),  SCALE(-2.404238444E-07),\n     SCALE(-2.818143514E-07),  SCALE(-3.276689142E-07),\n     SCALE(-3.784752209E-07),  SCALE(-4.347855338E-07),\n     SCALE(-4.972276315E-07),  SCALE(-5.665120852E-07),\n     SCALE(-6.434325428E-07),  SCALE(-7.288739425E-07),\n     SCALE(-8.238164355E-07),  SCALE(-9.293416952E-07),\n     SCALE(-1.046637067E-06),  SCALE(-1.176999604E-06),\n    -SCALE(-1.321840614E-06), -SCALE(-1.482681114E-06),\n    -SCALE(-1.661159786E-06), -SCALE(-1.859034001E-06),\n    -SCALE(-2.078171747E-06), -SCALE(-2.320550948E-06),\n    -SCALE(-2.588257530E-06), -SCALE(-2.883470643E-06),\n    -SCALE(-3.208459020E-06), -SCALE(-3.565570978E-06),\n    -SCALE(-3.957220997E-06), -SCALE(-4.385879038E-06),\n    -SCALE(-4.854050530E-06), -SCALE(-5.364252502E-06),\n    -SCALE(-5.918994248E-06), -SCALE(-6.520755960E-06),\n    -SCALE(-7.171964626E-06), -SCALE(-7.874960829E-06),\n    -SCALE(-8.631964192E-06), -SCALE(-9.445050637E-06),\n    -SCALE(-1.031611009E-05), -SCALE(-1.124680875E-05),\n    -SCALE(-1.223855270E-05), -SCALE(-1.329243969E-05),\n    -SCALE(-1.440921824E-05), -SCALE(-1.558924305E-05),\n    -SCALE(-1.683242772E-05), -SCALE(-1.813820381E-05),\n    -SCALE(-1.950545993E-05), -SCALE(-2.093250441E-05),\n    -SCALE(-2.241701623E-05), -SCALE(-2.395598858E-05),\n    -SCALE(-2.554569073E-05), -SCALE(-2.718161704E-05),\n    -SCALE(-2.885844333E-05), -SCALE(-3.056998685E-05),\n    -SCALE(-3.230916263E-05), -SCALE(-3.406793985E-05),\n    -SCALE(-3.583733633E-05), -SCALE(-3.760734762E-05),\n    -SCALE(-3.936696885E-05), -SCALE(-4.110412556E-05),\n    -SCALE(-4.280570283E-05), -SCALE(-4.445751256E-05),\n    -SCALE(-4.604430433E-05), -SCALE(-4.754976908E-05),\n    -SCALE(-4.895655002E-05), -SCALE(-5.024627535E-05),\n     SCALE( 5.139957648E-05),  SCALE( 5.239612074E-05),\n     SCALE( 5.321469871E-05),  SCALE( 5.383323878E-05),\n     SCALE( 5.422891263E-05),  SCALE( 5.437819709E-05),\n     SCALE( 5.425697600E-05),  SCALE( 5.384063843E-05),\n     SCALE( 5.310418419E-05),  SCALE( 5.202236207E-05),\n     SCALE( 5.056979353E-05),  SCALE( 4.872112549E-05),\n     SCALE( 4.645117951E-05),  SCALE( 4.373511547E-05),\n     SCALE( 4.054862075E-05),  SCALE( 3.686808850E-05),\n    -SCALE( 3.267079956E-05), -SCALE( 2.793515523E-05),\n    -SCALE( 2.264085742E-05), -SCALE( 1.676913780E-05),\n    -SCALE( 1.030297699E-05), -SCALE( 3.227306706E-06),\n    -SCALE(-4.470633485E-06), -SCALE(-1.280130618E-05),\n    -SCALE(-2.177240640E-05), -SCALE(-3.138873581E-05),\n    -SCALE(-4.165195787E-05), -SCALE(-5.256036457E-05),\n    -SCALE(-6.410864444E-05), -SCALE(-7.628766616E-05),\n    -SCALE(-8.908427117E-05), -SCALE(-1.024810626E-04),\n    -SCALE(-1.164562127E-04), -SCALE(-1.309833024E-04),\n    -SCALE(-1.460311323E-04), -SCALE(-1.615635992E-04),\n    -SCALE(-1.775395358E-04), -SCALE(-1.939126523E-04),\n    -SCALE(-2.106313768E-04), -SCALE(-2.276388550E-04),\n    -SCALE(-2.448728774E-04), -SCALE(-2.622658503E-04),\n    -SCALE(-2.797449124E-04), -SCALE(-2.972317743E-04),\n    -SCALE(-3.146430245E-04), -SCALE(-3.318900708E-04),\n    -SCALE(-3.488793736E-04), -SCALE(-3.655125911E-04),\n    -SCALE(-3.816867538E-04), -SCALE(-3.972945851E-04),\n    -SCALE(-4.122247046E-04), -SCALE(-4.263620067E-04),\n    -SCALE(-4.395879805E-04), -SCALE(-4.517810594E-04),\n    -SCALE(-4.628172028E-04), -SCALE(-4.725702747E-04),\n    -SCALE(-4.809123348E-04), -SCALE(-4.877146275E-04),\n    -SCALE(-4.928477574E-04), -SCALE(-4.961824161E-04),\n    -SCALE(-4.975944757E-04), -SCALE(-4.969481961E-04),\n    -SCALE(-4.941228544E-04), -SCALE(-4.889960401E-04),\n     SCALE( 4.814492422E-04),  SCALE( 4.713678791E-04),\n     SCALE( 4.586426076E-04),  SCALE( 4.431701091E-04),\n     SCALE( 4.248536134E-04),  SCALE( 4.036037717E-04),\n     SCALE( 3.793396754E-04),  SCALE( 3.519894381E-04),\n     SCALE( 3.214911267E-04),  SCALE( 2.877934603E-04),\n     SCALE( 2.508567995E-04),  SCALE( 2.106537577E-04),\n     SCALE( 1.671699720E-04),  SCALE( 1.204049113E-04),\n     SCALE( 7.037253090E-05),  SCALE( 1.710198012E-05),\n    -SCALE(-3.936182839E-05), -SCALE(-9.895755647E-05),\n    -SCALE(-1.616069785E-04), -SCALE(-2.272142592E-04),\n    -SCALE(-2.956659591E-04), -SCALE(-3.668301215E-04),\n    -SCALE(-4.405563814E-04), -SCALE(-5.166754709E-04),\n    -SCALE(-5.949990009E-04), -SCALE(-6.753197522E-04),\n    -SCALE(-7.574109477E-04), -SCALE(-8.410271257E-04),\n    -SCALE(-9.259034996E-04), -SCALE(-1.011756598E-03),\n    -SCALE(-1.098284614E-03), -SCALE(-1.185167348E-03),\n    -SCALE(-1.272067428E-03), -SCALE(-1.358630019E-03),\n    -SCALE(-1.444484224E-03), -SCALE(-1.529243193E-03),\n    -SCALE(-1.612505526E-03), -SCALE(-1.693855622E-03),\n    -SCALE(-1.772865304E-03), -SCALE(-1.849094522E-03),\n    -SCALE(-1.922092517E-03), -SCALE(-1.991399564E-03),\n    -SCALE(-2.056547208E-03), -SCALE(-2.117061289E-03),\n    -SCALE(-2.172462177E-03), -SCALE(-2.222266514E-03),\n    -SCALE(-2.265989315E-03), -SCALE(-2.303145360E-03),\n    -SCALE(-2.333251061E-03), -SCALE(-2.355825622E-03),\n    -SCALE(-2.370394068E-03), -SCALE(-2.376487479E-03),\n    -SCALE(-2.373647178E-03), -SCALE(-2.361423569E-03),\n    -SCALE(-2.339380793E-03), -SCALE(-2.307097195E-03),\n    -SCALE(-2.264167881E-03), -SCALE(-2.210205887E-03),\n    -SCALE(-2.144844970E-03), -SCALE(-2.067740774E-03),\n    -SCALE(-1.978572691E-03), -SCALE(-1.877046190E-03),\n    -SCALE(-1.762894331E-03), -SCALE(-1.635878929E-03),\n     SCALE( 1.495792647E-03),  SCALE( 1.342460280E-03),\n     SCALE( 1.175740734E-03),  SCALE( 9.955273708E-04),\n     SCALE( 8.017504588E-04),  SCALE( 5.943773431E-04),\n     SCALE( 3.734139318E-04),  SCALE( 1.389056415E-04),\n     SCALE(-1.090620208E-04),  SCALE(-3.703625989E-04),\n     SCALE(-6.448282511E-04),  SCALE(-9.322494152E-04),\n     SCALE(-1.232374110E-03),  SCALE(-1.544908970E-03),\n     SCALE(-1.869517611E-03),  SCALE(-2.205822384E-03),\n    -SCALE(-2.553403843E-03), -SCALE(-2.911801683E-03),\n    -SCALE(-3.280514618E-03), -SCALE(-3.659002949E-03),\n    -SCALE(-4.046686925E-03), -SCALE(-4.442950245E-03),\n    -SCALE(-4.847140983E-03), -SCALE(-5.258570891E-03),\n    -SCALE(-5.676518660E-03), -SCALE(-6.100233644E-03),\n    -SCALE(-6.528933067E-03), -SCALE(-6.961807609E-03),\n    -SCALE(-7.398022339E-03), -SCALE(-7.836719044E-03),\n    -SCALE(-8.277016692E-03), -SCALE(-8.718019351E-03),\n    -SCALE(-9.158811532E-03), -SCALE(-9.598465636E-03),\n    -SCALE(-1.003604382E-02), -SCALE(-1.047059800E-02),\n    -SCALE(-1.090117730E-02), -SCALE(-1.132682897E-02),\n    -SCALE(-1.174659748E-02), -SCALE(-1.215953380E-02),\n    -SCALE(-1.256469358E-02), -SCALE(-1.296114177E-02),\n    -SCALE(-1.334795821E-02), -SCALE(-1.372423489E-02),\n    -SCALE(-1.408908330E-02), -SCALE(-1.444163360E-02),\n    -SCALE(-1.478104480E-02), -SCALE(-1.510649733E-02),\n    -SCALE(-1.541720331E-02), -SCALE(-1.571240649E-02),\n    -SCALE(-1.599138230E-02), -SCALE(-1.625344716E-02),\n    -SCALE(-1.649795473E-02), -SCALE(-1.672429405E-02),\n    -SCALE(-1.693190821E-02), -SCALE(-1.712027565E-02),\n    -SCALE(-1.728892699E-02), -SCALE(-1.743743755E-02),\n    -SCALE(-1.756543480E-02), -SCALE(-1.767260395E-02),\n    -SCALE(-1.775865816E-02), -SCALE(-1.782339066E-02),\n    -SCALE(-1.786663756E-02), -SCALE(-1.788828894E-02),\n     SCALE( 1.788828894E-02),  SCALE( 1.786663756E-02),\n     SCALE( 1.782339066E-02),  SCALE( 1.775865816E-02),\n     SCALE( 1.767260395E-02),  SCALE( 1.756543480E-02),\n     SCALE( 1.743743755E-02),  SCALE( 1.728892699E-02),\n     SCALE( 1.712027565E-02),  SCALE( 1.693190821E-02),\n     SCALE( 1.672429405E-02),  SCALE( 1.649795473E-02),\n     SCALE( 1.625344716E-02),  SCALE( 1.599138230E-02),\n     SCALE( 1.571240649E-02),  SCALE( 1.541720331E-02),\n    -SCALE( 1.510649733E-02), -SCALE( 1.478104480E-02),\n    -SCALE( 1.444163360E-02), -SCALE( 1.408908330E-02),\n    -SCALE( 1.372423489E-02), -SCALE( 1.334795821E-02),\n    -SCALE( 1.296114177E-02), -SCALE( 1.256469358E-02),\n    -SCALE( 1.215953380E-02), -SCALE( 1.174659748E-02),\n    -SCALE( 1.132682897E-02), -SCALE( 1.090117730E-02),\n    -SCALE( 1.047059800E-02), -SCALE( 1.003604382E-02),\n    -SCALE( 9.598465636E-03), -SCALE( 9.158811532E-03),\n    -SCALE( 8.718019351E-03), -SCALE( 8.277016692E-03),\n    -SCALE( 7.836719044E-03), -SCALE( 7.398022339E-03),\n    -SCALE( 6.961807609E-03), -SCALE( 6.528933067E-03),\n    -SCALE( 6.100233644E-03), -SCALE( 5.676518660E-03),\n    -SCALE( 5.258570891E-03), -SCALE( 4.847140983E-03),\n    -SCALE( 4.442950245E-03), -SCALE( 4.046686925E-03),\n    -SCALE( 3.659002949E-03), -SCALE( 3.280514618E-03),\n    -SCALE( 2.911801683E-03), -SCALE( 2.553403843E-03),\n    -SCALE( 2.205822384E-03), -SCALE( 1.869517611E-03),\n    -SCALE( 1.544908970E-03), -SCALE( 1.232374110E-03),\n    -SCALE( 9.322494152E-04), -SCALE( 6.448282511E-04),\n    -SCALE( 3.703625989E-04), -SCALE( 1.090620208E-04),\n    -SCALE(-1.389056415E-04), -SCALE(-3.734139318E-04),\n    -SCALE(-5.943773431E-04), -SCALE(-8.017504588E-04),\n    -SCALE(-9.955273708E-04), -SCALE(-1.175740734E-03),\n    -SCALE(-1.342460280E-03), -SCALE(-1.495792647E-03),\n     SCALE( 1.635878929E-03),  SCALE( 1.762894331E-03),\n     SCALE( 1.877046190E-03),  SCALE( 1.978572691E-03),\n     SCALE( 2.067740774E-03),  SCALE( 2.144844970E-03),\n     SCALE( 2.210205887E-03),  SCALE( 2.264167881E-03),\n     SCALE( 2.307097195E-03),  SCALE( 2.339380793E-03),\n     SCALE( 2.361423569E-03),  SCALE( 2.373647178E-03),\n     SCALE( 2.376487479E-03),  SCALE( 2.370394068E-03),\n     SCALE( 2.355825622E-03),  SCALE( 2.333251061E-03),\n    -SCALE( 2.303145360E-03), -SCALE( 2.265989315E-03),\n    -SCALE( 2.222266514E-03), -SCALE( 2.172462177E-03),\n    -SCALE( 2.117061289E-03), -SCALE( 2.056547208E-03),\n    -SCALE( 1.991399564E-03), -SCALE( 1.922092517E-03),\n    -SCALE( 1.849094522E-03), -SCALE( 1.772865304E-03),\n    -SCALE( 1.693855622E-03), -SCALE( 1.612505526E-03),\n    -SCALE( 1.529243193E-03), -SCALE( 1.444484224E-03),\n    -SCALE( 1.358630019E-03), -SCALE( 1.272067428E-03),\n    -SCALE( 1.185167348E-03), -SCALE( 1.098284614E-03),\n    -SCALE( 1.011756598E-03), -SCALE( 9.259034996E-04),\n    -SCALE( 8.410271257E-04), -SCALE( 7.574109477E-04),\n    -SCALE( 6.753197522E-04), -SCALE( 5.949990009E-04),\n    -SCALE( 5.166754709E-04), -SCALE( 4.405563814E-04),\n    -SCALE( 3.668301215E-04), -SCALE( 2.956659591E-04),\n    -SCALE( 2.272142592E-04), -SCALE( 1.616069785E-04),\n    -SCALE( 9.895755647E-05), -SCALE( 3.936182839E-05),\n    -SCALE(-1.710198012E-05), -SCALE(-7.037253090E-05),\n    -SCALE(-1.204049113E-04), -SCALE(-1.671699720E-04),\n    -SCALE(-2.106537577E-04), -SCALE(-2.508567995E-04),\n    -SCALE(-2.877934603E-04), -SCALE(-3.214911267E-04),\n    -SCALE(-3.519894381E-04), -SCALE(-3.793396754E-04),\n    -SCALE(-4.036037717E-04), -SCALE(-4.248536134E-04),\n    -SCALE(-4.431701091E-04), -SCALE(-4.586426076E-04),\n    -SCALE(-4.713678791E-04), -SCALE(-4.814492422E-04),\n     SCALE( 4.889960401E-04),  SCALE( 4.941228544E-04),\n     SCALE( 4.969481961E-04),  SCALE( 4.975944757E-04),\n     SCALE( 4.961824161E-04),  SCALE( 4.928477574E-04),\n     SCALE( 4.877146275E-04),  SCALE( 4.809123348E-04),\n     SCALE( 4.725702747E-04),  SCALE( 4.628172028E-04),\n     SCALE( 4.517810594E-04),  SCALE( 4.395879805E-04),\n     SCALE( 4.263620067E-04),  SCALE( 4.122247046E-04),\n     SCALE( 3.972945851E-04),  SCALE( 3.816867538E-04),\n    -SCALE( 3.655125911E-04), -SCALE( 3.488793736E-04),\n    -SCALE( 3.318900708E-04), -SCALE( 3.146430245E-04),\n    -SCALE( 2.972317743E-04), -SCALE( 2.797449124E-04),\n    -SCALE( 2.622658503E-04), -SCALE( 2.448728774E-04),\n    -SCALE( 2.276388550E-04), -SCALE( 2.106313768E-04),\n    -SCALE( 1.939126523E-04), -SCALE( 1.775395358E-04),\n    -SCALE( 1.615635992E-04), -SCALE( 1.460311323E-04),\n    -SCALE( 1.309833024E-04), -SCALE( 1.164562127E-04),\n    -SCALE( 1.024810626E-04), -SCALE( 8.908427117E-05),\n    -SCALE( 7.628766616E-05), -SCALE( 6.410864444E-05),\n    -SCALE( 5.256036457E-05), -SCALE( 4.165195787E-05),\n    -SCALE( 3.138873581E-05), -SCALE( 2.177240640E-05),\n    -SCALE( 1.280130618E-05), -SCALE( 4.470633485E-06),\n    -SCALE(-3.227306706E-06), -SCALE(-1.030297699E-05),\n    -SCALE(-1.676913780E-05), -SCALE(-2.264085742E-05),\n    -SCALE(-2.793515523E-05), -SCALE(-3.267079956E-05),\n    -SCALE(-3.686808850E-05), -SCALE(-4.054862075E-05),\n    -SCALE(-4.373511547E-05), -SCALE(-4.645117951E-05),\n    -SCALE(-4.872112549E-05), -SCALE(-5.056979353E-05),\n    -SCALE(-5.202236207E-05), -SCALE(-5.310418419E-05),\n    -SCALE(-5.384063843E-05), -SCALE(-5.425697600E-05),\n    -SCALE(-5.437819709E-05), -SCALE(-5.422891263E-05),\n    -SCALE(-5.383323878E-05), -SCALE(-5.321469871E-05),\n    -SCALE(-5.239612074E-05), -SCALE(-5.139957648E-05),\n     SCALE( 5.024627535E-05),  SCALE( 4.895655002E-05),\n     SCALE( 4.754976908E-05),  SCALE( 4.604430433E-05),\n     SCALE( 4.445751256E-05),  SCALE( 4.280570283E-05),\n     SCALE( 4.110412556E-05),  SCALE( 3.936696885E-05),\n     SCALE( 3.760734762E-05),  SCALE( 3.583733633E-05),\n     SCALE( 3.406793985E-05),  SCALE( 3.230916263E-05),\n     SCALE( 3.056998685E-05),  SCALE( 2.885844333E-05),\n     SCALE( 2.718161704E-05),  SCALE( 2.554569073E-05),\n    -SCALE( 2.395598858E-05), -SCALE( 2.241701623E-05),\n    -SCALE( 2.093250441E-05), -SCALE( 1.950545993E-05),\n    -SCALE( 1.813820381E-05), -SCALE( 1.683242772E-05),\n    -SCALE( 1.558924305E-05), -SCALE( 1.440921824E-05),\n    -SCALE( 1.329243969E-05), -SCALE( 1.223855270E-05),\n    -SCALE( 1.124680875E-05), -SCALE( 1.031611009E-05),\n    -SCALE( 9.445050637E-06), -SCALE( 8.631964192E-06),\n    -SCALE( 7.874960829E-06), -SCALE( 7.171964626E-06),\n    -SCALE( 6.520755960E-06), -SCALE( 5.918994248E-06),\n    -SCALE( 5.364252502E-06), -SCALE( 4.854050530E-06),\n    -SCALE( 4.385879038E-06), -SCALE( 3.957220997E-06),\n    -SCALE( 3.565570978E-06), -SCALE( 3.208459020E-06),\n    -SCALE( 2.883470643E-06), -SCALE( 2.588257530E-06),\n    -SCALE( 2.320550948E-06), -SCALE( 2.078171747E-06),\n    -SCALE( 1.859034001E-06), -SCALE( 1.661159786E-06),\n    -SCALE( 1.482681114E-06), -SCALE( 1.321840614E-06),\n    -SCALE( 1.176999604E-06), -SCALE( 1.046637067E-06),\n    -SCALE( 9.293416952E-07), -SCALE( 8.238164355E-07),\n    -SCALE( 7.288739425E-07), -SCALE( 6.434325428E-07),\n    -SCALE( 5.665120852E-07), -SCALE( 4.972276315E-07),\n    -SCALE( 4.347855338E-07), -SCALE( 3.784752209E-07),\n    -SCALE( 3.276689142E-07), -SCALE( 2.818143514E-07),\n    -SCALE( 2.404238444E-07), -SCALE( 2.030677564E-07),\n    -SCALE( 1.693738625E-07), -SCALE( 1.390191784E-07)\n};\n\n#undef SCALE\n\n// Annex D.8 - LFE interpolation FIR, 64x interpolation\nstatic const double lfe_fir_64[256] = {\n    2.658434387E-04, 9.029330686E-03, 7.939263433E-02, 2.425158769E-01,\n    3.430179358E-01, 2.398228943E-01, 7.746443897E-02, 8.622321300E-03,\n    8.179365250E-05, 9.450953454E-03, 8.134882897E-02, 2.451938838E-01,\n    3.429597318E-01, 2.371159792E-01, 7.556436211E-02, 8.229630999E-03,\n    9.439323912E-05, 9.887560271E-03, 8.333285898E-02, 2.478559017E-01,\n    3.428434134E-01, 2.343961596E-01, 7.369252294E-02, 7.850865833E-03,\n    1.082170274E-04, 1.033949479E-02, 8.534456789E-02, 2.505008876E-01,\n    3.426689506E-01, 2.316644788E-01, 7.184901088E-02, 7.485736627E-03,\n    1.233371440E-04, 1.080708485E-02, 8.738376945E-02, 2.531278133E-01,\n    3.424364924E-01, 2.289219648E-01, 7.003392279E-02, 7.133882027E-03,\n    1.397485757E-04, 1.129068248E-02, 8.945026249E-02, 2.557355762E-01,\n    3.421461284E-01, 2.261696160E-01, 6.824731827E-02, 6.794991903E-03,\n    1.575958013E-04, 1.179065090E-02, 9.154383838E-02, 2.583232224E-01,\n    3.417979777E-01, 2.234084606E-01, 6.648923457E-02, 6.468691397E-03,\n    1.769922383E-04, 1.230732165E-02, 9.366425127E-02, 2.608896792E-01,\n    3.413922191E-01, 2.206395119E-01, 6.475970894E-02, 6.154712290E-03,\n    1.981738606E-04, 1.284105983E-02, 9.581124038E-02, 2.634339035E-01,\n    3.409290314E-01, 2.178637981E-01, 6.305878609E-02, 5.852684379E-03,\n    2.211847313E-04, 1.339218579E-02, 9.798453748E-02, 2.659549415E-01,\n    3.404086530E-01, 2.150822729E-01, 6.138643622E-02, 5.562345497E-03,\n    2.460231190E-04, 1.396108977E-02, 1.001838669E-01, 2.684516609E-01,\n    3.398312926E-01, 2.122959495E-01, 5.974265561E-02, 5.283284001E-03,\n    2.726115927E-04, 1.454808749E-02, 1.024089083E-01, 2.709231377E-01,\n    3.391972482E-01, 2.095058411E-01, 5.812742189E-02, 5.015311297E-03,\n    3.013863170E-04, 1.515355054E-02, 1.046593264E-01, 2.733682692E-01,\n    3.385068178E-01, 2.067128718E-01, 5.654069409E-02, 4.758012015E-03,\n    3.328395542E-04, 1.577781141E-02, 1.069347933E-01, 2.757860720E-01,\n    3.377602994E-01, 2.039180547E-01, 5.498242006E-02, 4.511159845E-03,\n    3.658991191E-04, 1.642123051E-02, 1.092349365E-01, 2.781755328E-01,\n    3.369580209E-01, 2.011223286E-01, 5.345252529E-02, 4.274417181E-03,\n    4.018281470E-04, 1.708412915E-02, 1.115593687E-01, 2.805356979E-01,\n    3.361004293E-01, 1.983266175E-01, 5.195093155E-02, 4.047499038E-03,\n    4.401875485E-04, 1.776690222E-02, 1.139076948E-01, 2.828655839E-01,\n    3.351879120E-01, 1.955319196E-01, 5.047753453E-02, 3.830091329E-03,\n    4.812776169E-04, 1.846982725E-02, 1.162794977E-01, 2.851640880E-01,\n    3.342207968E-01, 1.927391142E-01, 4.903224111E-02, 3.621967277E-03,\n    5.252459669E-04, 1.919330470E-02, 1.186743453E-01, 2.874303460E-01,\n    3.331996202E-01, 1.899491698E-01, 4.761491716E-02, 3.422776936E-03,\n    5.721592461E-04, 1.993762329E-02, 1.210917681E-01, 2.896633744E-01,\n    3.321248591E-01, 1.871629506E-01, 4.622544348E-02, 3.232272575E-03,\n    6.222130032E-04, 2.070316114E-02, 1.235313043E-01, 2.918621898E-01,\n    3.309969604E-01, 1.843813360E-01, 4.486365616E-02, 3.050152911E-03,\n    6.755515351E-04, 2.149021253E-02, 1.259924471E-01, 2.940258980E-01,\n    3.298164308E-01, 1.816052496E-01, 4.352942482E-02, 2.876190469E-03,\n    7.324148901E-04, 2.229913883E-02, 1.284746826E-01, 2.961534858E-01,\n    3.285838962E-01, 1.788355410E-01, 4.222255200E-02, 2.710093278E-03,\n    7.928516716E-04, 2.313023806E-02, 1.309774816E-01, 2.982441187E-01,\n    3.272998929E-01, 1.760730892E-01, 4.094288871E-02, 2.551567042E-03,\n    8.570110658E-04, 2.398385666E-02, 1.335003078E-01, 3.002967536E-01,\n    3.259649575E-01, 1.733186990E-01, 3.969023004E-02, 2.400433412E-03,\n    9.251192096E-04, 2.486028522E-02, 1.360425949E-01, 3.023106754E-01,\n    3.245797157E-01, 1.705732346E-01, 3.846437484E-02, 2.256359672E-03,\n    9.974770946E-04, 2.575986087E-02, 1.386037618E-01, 3.042849004E-01,\n    3.231448531E-01, 1.678375006E-01, 3.726511076E-02, 2.119151875E-03,\n    1.073930296E-03, 2.668286115E-02, 1.411831975E-01, 3.062185347E-01,\n    3.216609657E-01, 1.651122719E-01, 3.609224036E-02, 1.988604199E-03,\n    1.155023579E-03, 2.762960829E-02, 1.437802613E-01, 3.081108034E-01,\n    3.201287389E-01, 1.623983532E-01, 3.494550660E-02, 1.864377526E-03,\n    1.240676851E-03, 2.860039286E-02, 1.463943720E-01, 3.099608123E-01,\n    3.185488880E-01, 1.596965194E-01, 3.382468969E-02, 1.746327500E-03,\n    1.331258914E-03, 2.959549613E-02, 1.490248144E-01, 3.117676973E-01,\n    3.169221282E-01, 1.570075154E-01, 3.272953629E-02, 1.634211512E-03,\n    1.426893868E-03, 3.061520495E-02, 1.516709626E-01, 3.135308027E-01,\n    3.152491748E-01, 1.543320864E-01, 3.165979683E-02, 1.527829794E-03\n};\n\n// Annex D.8 - LFE interpolation FIR, 128x interpolation\nstatic const double lfe_fir_128[256] = {\n    5.316857100E-04, 1.587849557E-01, 6.860344410E-01, 1.549285650E-01,\n    1.635869100E-04, 1.626973301E-01, 6.859180331E-01, 1.511284113E-01,\n    1.887860900E-04, 1.666653752E-01, 6.856853962E-01, 1.473847479E-01,\n    2.164336300E-04, 1.706887931E-01, 6.853365302E-01, 1.436977387E-01,\n    2.466738200E-04, 1.747671962E-01, 6.848715544E-01, 1.400675476E-01,\n    2.794966000E-04, 1.789001823E-01, 6.842908263E-01, 1.364943385E-01,\n    3.151909600E-04, 1.830873191E-01, 6.835945249E-01, 1.329781860E-01,\n    3.539837500E-04, 1.873281151E-01, 6.827830076E-01, 1.295191795E-01,\n    3.963469100E-04, 1.916220933E-01, 6.818566918E-01, 1.261173040E-01,\n    4.423685900E-04, 1.959686577E-01, 6.808158755E-01, 1.227726117E-01,\n    4.920452500E-04, 2.003673166E-01, 6.796611548E-01, 1.194850579E-01,\n    5.452220800E-04, 2.048173845E-01, 6.783930659E-01, 1.162546203E-01,\n    6.027714100E-04, 2.093182206E-01, 6.770122051E-01, 1.130811572E-01,\n    6.656776500E-04, 2.138691545E-01, 6.755192280E-01, 1.099646092E-01,\n    7.317967800E-04, 2.184694260E-01, 6.739146709E-01, 1.069048345E-01,\n    8.036546600E-04, 2.231182903E-01, 6.721994877E-01, 1.039016470E-01,\n    8.803732300E-04, 2.278149277E-01, 6.703743935E-01, 1.009548605E-01,\n    9.625531400E-04, 2.325585187E-01, 6.684402227E-01, 9.806428105E-02,\n    1.050489840E-03, 2.373482138E-01, 6.663978696E-01, 9.522963315E-02,\n    1.144316160E-03, 2.421830446E-01, 6.642482877E-01, 9.245070815E-02,\n    1.244423330E-03, 2.470620573E-01, 6.619924903E-01, 8.972713351E-02,\n    1.351100280E-03, 2.519843280E-01, 6.596315503E-01, 8.705867827E-02,\n    1.464826870E-03, 2.569487989E-01, 6.571664810E-01, 8.444493264E-02,\n    1.585700080E-03, 2.619544268E-01, 6.545983553E-01, 8.188561350E-02,\n    1.714018640E-03, 2.670000792E-01, 6.519285440E-01, 7.938029617E-02,\n    1.850234690E-03, 2.720846236E-01, 6.491580606E-01, 7.692859322E-02,\n    1.994950230E-03, 2.772069275E-01, 6.462883353E-01, 7.453006506E-02,\n    2.147856400E-03, 2.823657692E-01, 6.433205605E-01, 7.218432426E-02,\n    2.310042500E-03, 2.875599265E-01, 6.402561665E-01, 6.989086419E-02,\n    2.481348810E-03, 2.927881181E-01, 6.370964646E-01, 6.764923781E-02,\n    2.662512240E-03, 2.980490029E-01, 6.338429451E-01, 6.545893103E-02,\n    2.853781920E-03, 3.033412695E-01, 6.304970384E-01, 6.331945211E-02,\n    3.055653300E-03, 3.086635172E-01, 6.270602942E-01, 6.123027951E-02,\n    3.268416510E-03, 3.140144050E-01, 6.235341430E-01, 5.919086933E-02,\n    3.492647550E-03, 3.193923831E-01, 6.199202538E-01, 5.720067024E-02,\n    3.728747140E-03, 3.247960210E-01, 6.162202954E-01, 5.525910854E-02,\n    3.977200480E-03, 3.302238286E-01, 6.124358177E-01, 5.336561054E-02,\n    4.238294900E-03, 3.356742859E-01, 6.085684896E-01, 5.151961371E-02,\n    4.512710030E-03, 3.411457539E-01, 6.046201587E-01, 4.972046614E-02,\n    4.800856580E-03, 3.466366828E-01, 6.005923152E-01, 4.796761274E-02,\n    5.103122910E-03, 3.521454632E-01, 5.964869261E-01, 4.626038298E-02,\n    5.420174920E-03, 3.576703668E-01, 5.923057795E-01, 4.459818453E-02,\n    5.752369300E-03, 3.632097244E-01, 5.880505443E-01, 4.298033938E-02,\n    6.100293250E-03, 3.687619269E-01, 5.837231875E-01, 4.140623659E-02,\n    6.464532110E-03, 3.743250966E-01, 5.793255568E-01, 3.987516090E-02,\n    6.845539900E-03, 3.798975349E-01, 5.748594403E-01, 3.838652745E-02,\n    7.243919190E-03, 3.854774535E-01, 5.703269839E-01, 3.693958372E-02,\n    7.660165890E-03, 3.910630047E-01, 5.657299161E-01, 3.553372994E-02,\n    8.094980380E-03, 3.966524303E-01, 5.610702634E-01, 3.416819125E-02,\n    8.548815730E-03, 4.022437930E-01, 5.563499928E-01, 3.284239396E-02,\n    9.022301060E-03, 4.078352153E-01, 5.515710115E-01, 3.155555204E-02,\n    9.516004470E-03, 4.134248793E-01, 5.467353463E-01, 3.030703776E-02,\n    1.003060210E-02, 4.190107882E-01, 5.418450832E-01, 2.909611352E-02,\n    1.056654565E-02, 4.245910645E-01, 5.369022489E-01, 2.792212367E-02,\n    1.112466771E-02, 4.301636219E-01, 5.319088101E-01, 2.678431384E-02,\n    1.170534454E-02, 4.357266724E-01, 5.268667936E-01, 2.568206564E-02,\n    1.230939943E-02, 4.412781000E-01, 5.217782855E-01, 2.461459488E-02,\n    1.293735672E-02, 4.468160272E-01, 5.166453719E-01, 2.358125709E-02,\n    1.358995494E-02, 4.523383081E-01, 5.114701390E-01, 2.258131653E-02,\n    1.426773332E-02, 4.578429461E-01, 5.062545538E-01, 2.161412500E-02,\n    1.497144438E-02, 4.633280039E-01, 5.010007620E-01, 2.067894675E-02,\n    1.570170000E-02, 4.687913656E-01, 4.957108200E-01, 1.977507770E-02,\n    1.645922661E-02, 4.742309451E-01, 4.903867543E-01, 1.890186779E-02,\n    1.724460535E-02, 4.796448052E-01, 4.850307405E-01, 1.805862412E-02\n};\n\n#define SCALE(x)    ((x) * M_SQRT2 * 256)\n\n// Annex D.9 - 1024 tap FIR for X96 synthesis QMF\nstatic const double band_fir_x96[1024] = {\n     SCALE(-7.127938986604168E-08),  SCALE(-7.095090315087499E-08),\n     SCALE(-7.952503432137510E-08),  SCALE(-8.932687128137479E-08),\n     SCALE(-9.748319049487465E-08),  SCALE(-1.058665951072195E-07),\n     SCALE(-1.152736341186576E-07),  SCALE(-1.252310964561535E-07),\n     SCALE(-1.355563613797138E-07),  SCALE(-1.464093182119164E-07),\n     SCALE(-1.578742499812371E-07),  SCALE(-1.699459292657122E-07),\n     SCALE(-1.826418431101815E-07),  SCALE(-1.960059458775785E-07),\n     SCALE(-2.100789970600680E-07),  SCALE(-2.248975904755362E-07),\n     SCALE(-2.405024587792340E-07),  SCALE(-2.569387461577766E-07),\n     SCALE(-2.742537030854958E-07),  SCALE(-2.924966254175760E-07),\n     SCALE(-3.117198196826890E-07),  SCALE(-3.319786404047318E-07),\n     SCALE(-3.533313458884360E-07),  SCALE(-3.758391046541218E-07),\n     SCALE(-3.995662812166919E-07),  SCALE(-4.245804529615933E-07),\n     SCALE(-4.509524956369838E-07),  SCALE(-4.787565911260676E-07),\n     SCALE(-5.080703129463105E-07),  SCALE(-5.389746422333555E-07),\n     SCALE(-5.715542338879300E-07),  SCALE(-6.058974119201980E-07),\n    -SCALE(-6.420958008785305E-07), -SCALE(-6.802443284999140E-07),\n    -SCALE(-7.204416525901345E-07), -SCALE(-7.627901817207720E-07),\n    -SCALE(-8.073961036828060E-07), -SCALE(-8.543693702029365E-07),\n    -SCALE(-9.038233322489550E-07), -SCALE(-9.558747254049829E-07),\n    -SCALE(-1.010643712821376E-06), -SCALE(-1.068253890614633E-06),\n    -SCALE(-1.128832363715543E-06), -SCALE(-1.192509718464610E-06),\n    -SCALE(-1.259419343863326E-06), -SCALE(-1.329697405230052E-06),\n    -SCALE(-1.403482943378026E-06), -SCALE(-1.480917863497994E-06),\n    -SCALE(-1.562146591398006E-06), -SCALE(-1.647316037754536E-06),\n    -SCALE(-1.736575155397134E-06), -SCALE(-1.830074910452612E-06),\n    -SCALE(-1.927968090232205E-06), -SCALE(-2.030409266099076E-06),\n    -SCALE(-2.137554168666232E-06), -SCALE(-2.249559625377646E-06),\n    -SCALE(-2.366582812095056E-06), -SCALE(-2.488781197085654E-06),\n    -SCALE(-2.616312057164482E-06), -SCALE(-2.749332426639114E-06),\n    -SCALE(-2.887998457950138E-06), -SCALE(-3.032465363920388E-06),\n    -SCALE(-3.182886786597464E-06), -SCALE(-3.339414724085582E-06),\n    -SCALE(-3.502198552003754E-06), -SCALE(-3.671384926229468E-06),\n    -SCALE(-3.847116621801583E-06), -SCALE(-4.029532465769980E-06),\n    -SCALE(-4.218767020985225E-06), -SCALE(-4.414950504331232E-06),\n    -SCALE(-4.618207304054390E-06), -SCALE(-4.828655865889468E-06),\n    -SCALE(-5.046407670500340E-06), -SCALE(-5.271567145540585E-06),\n    -SCALE(-5.504230753545810E-06), -SCALE(-5.744486878502875E-06),\n    -SCALE(-5.992414242480480E-06), -SCALE(-6.248081786307280E-06),\n    -SCALE(-6.511547627860400E-06), -SCALE(-6.782858956580495E-06),\n    -SCALE(-7.062050754515410E-06), -SCALE(-7.349145669714490E-06),\n    -SCALE(-7.644152509859200E-06), -SCALE(-7.947066136436549E-06),\n    -SCALE(-8.257866642922776E-06), -SCALE(-8.576519215476810E-06),\n    -SCALE(-8.902971890012200E-06), -SCALE(-9.237155419546841E-06),\n    -SCALE(-9.578982598825311E-06), -SCALE(-9.928348166726454E-06),\n    -SCALE(-1.028512733460845E-05), -SCALE(-1.064917563432859E-05),\n    -SCALE(-1.102032704633465E-05), -SCALE(-1.139839388088106E-05),\n    -SCALE(-1.178316603669356E-05), -SCALE(-1.217441088925653E-05),\n    -SCALE(-1.257187157446922E-05), -SCALE(-1.297526685803031E-05),\n    -SCALE(-1.338428997824206E-05), -SCALE(-1.379860854096596E-05),\n    -SCALE(-1.421786336584378E-05), -SCALE(-1.464166838349645E-05),\n    -SCALE(-1.506960952767971E-05), -SCALE(-1.550124459778260E-05),\n    -SCALE(-1.593610134164050E-05), -SCALE(-1.637367742646690E-05),\n    -SCALE(-1.681344171653956E-05), -SCALE(-1.725483414306857E-05),\n    -SCALE(-1.769726156360750E-05), -SCALE(-1.814009771461820E-05),\n    -SCALE(-1.858268630848355E-05), -SCALE(-1.902434097009924E-05),\n    -SCALE(-1.946434074488017E-05), -SCALE(-1.990193003014108E-05),\n    -SCALE(-2.033632155746451E-05), -SCALE(-2.076669641777394E-05),\n    -SCALE(-2.119220163057428E-05), -SCALE(-2.161195008423191E-05),\n    -SCALE(-2.202502165289463E-05), -SCALE(-2.243046323951717E-05),\n    -SCALE(-2.282728860550347E-05), -SCALE(-2.321447837191817E-05),\n    -SCALE(-2.359098021649775E-05), -SCALE(-2.395570893976328E-05),\n    -SCALE(-2.430754772248991E-05), -SCALE(-2.464534820090372E-05),\n    -SCALE(-2.496793086354262E-05), -SCALE(-2.527408508232496E-05),\n     SCALE( 2.556256939919902E-05),  SCALE( 2.583211172456204E-05),\n     SCALE( 2.608141341583320E-05),  SCALE( 2.630914939052064E-05),\n     SCALE( 2.651396653512446E-05),  SCALE( 2.669448385046480E-05),\n     SCALE( 2.684929723999712E-05),  SCALE( 2.697697975324517E-05),\n     SCALE( 2.707608215301207E-05),  SCALE( 2.714513310366389E-05),\n     SCALE( 2.718264274615772E-05),  SCALE( 2.718710298053676E-05),\n     SCALE( 2.715699010579455E-05),  SCALE( 2.709076506473594E-05),\n     SCALE( 2.698687619105470E-05),  SCALE( 2.684375953903512E-05),\n     SCALE( 2.665984338990853E-05),  SCALE( 2.643354859248296E-05),\n     SCALE( 2.616329155063932E-05),  SCALE( 2.584748457743932E-05),\n     SCALE( 2.548454069800296E-05),  SCALE( 2.507287405244726E-05),\n     SCALE( 2.461090395766135E-05),  SCALE( 2.409705530058412E-05),\n     SCALE( 2.352976312853915E-05),  SCALE( 2.290747311740374E-05),\n     SCALE( 2.222864728099456E-05),  SCALE( 2.149176446183214E-05),\n     SCALE( 2.069532541857637E-05),  SCALE( 1.983785326550204E-05),\n     SCALE( 1.891789805352808E-05),  SCALE( 1.793403733553470E-05),\n    -SCALE( 1.688488402231131E-05), -SCALE( 1.576908692157790E-05),\n    -SCALE( 1.458533474050792E-05), -SCALE( 1.333235659026308E-05),\n    -SCALE( 1.200892908323512E-05), -SCALE( 1.061387697354165E-05),\n    -SCALE( 9.146080150692231E-06), -SCALE( 7.604474075726550E-06),\n    -SCALE( 5.988052382589700E-06), -SCALE( 4.295867784770884E-06),\n    -SCALE( 2.527049419980207E-06), -SCALE( 6.808031538695990E-07),\n    -SCALE(-1.243599082783966E-06), -SCALE(-3.246818706694593E-06),\n    -SCALE(-5.329426896805280E-06), -SCALE(-7.491903655942790E-06),\n    -SCALE(-9.734640752487110E-06), -SCALE(-1.205794140863581E-05),\n    -SCALE(-1.446201050055097E-05), -SCALE(-1.694695384810771E-05),\n    -SCALE(-1.951277238921524E-05), -SCALE(-2.215936159729271E-05),\n    -SCALE(-2.488650449141616E-05), -SCALE(-2.769387104186206E-05),\n    -SCALE(-3.058101208191696E-05), -SCALE(-3.354735876525904E-05),\n    -SCALE(-3.659221671654097E-05), -SCALE(-3.971476548553926E-05),\n    -SCALE(-4.291405238785664E-05), -SCALE(-4.618899196172456E-05),\n    -SCALE(-4.953836017695434E-05), -SCALE(-5.296079400014060E-05),\n    -SCALE(-5.645478762018535E-05), -SCALE(-6.001869197279105E-05),\n    -SCALE(-6.365070805378855E-05), -SCALE(-6.734888652588270E-05),\n    -SCALE(-7.111112575372286E-05), -SCALE(-7.493517141117804E-05),\n    -SCALE(-7.881860980632000E-05), -SCALE(-8.275886762862380E-05),\n    -SCALE(-8.675321306240340E-05), -SCALE(-9.079875548213924E-05),\n    -SCALE(-9.489243763625400E-05), -SCALE(-9.903103541547551E-05),\n    -SCALE(-1.032111605730492E-04), -SCALE(-1.074292607067401E-04),\n    -SCALE(-1.116816161426427E-04), -SCALE(-1.159643396677203E-04),\n    -SCALE(-1.202733737618488E-04), -SCALE(-1.246044908903475E-04),\n    -SCALE(-1.289533027076185E-04), -SCALE(-1.333152598388584E-04),\n    -SCALE(-1.376856378740834E-04), -SCALE(-1.420595376057812E-04),\n    -SCALE(-1.464319042632354E-04), -SCALE(-1.507975279169229E-04),\n    -SCALE(-1.551510331409437E-04), -SCALE(-1.594868790905897E-04),\n    -SCALE(-1.637993715464274E-04), -SCALE(-1.680826635644682E-04),\n    -SCALE(-1.723307577358468E-04), -SCALE(-1.765375064656002E-04),\n    -SCALE(-1.806966158461229E-04), -SCALE(-1.848016463895374E-04),\n    -SCALE(-1.888460252663805E-04), -SCALE(-1.928230469653129E-04),\n    -SCALE(-1.967258755680427E-04), -SCALE(-2.005475454710861E-04),\n    -SCALE(-2.042809749895736E-04), -SCALE(-2.079189673565927E-04),\n    -SCALE(-2.114542191049128E-04), -SCALE(-2.148793208048870E-04),\n    -SCALE(-2.181867649165566E-04), -SCALE(-2.213689470691719E-04),\n    -SCALE(-2.244181863585484E-04), -SCALE(-2.273267267668629E-04),\n    -SCALE(-2.300867481008122E-04), -SCALE(-2.326903665352515E-04),\n    -SCALE(-2.351296356350780E-04), -SCALE(-2.373965479929124E-04),\n    -SCALE(-2.394830702362197E-04), -SCALE(-2.413811459337238E-04),\n    -SCALE(-2.430827245294182E-04), -SCALE(-2.445797571768798E-04),\n    -SCALE(-2.458640761601700E-04), -SCALE(-2.469274156993822E-04),\n    -SCALE(-2.477619902517768E-04), -SCALE(-2.483604609263728E-04),\n    -SCALE(-2.487146183038166E-04), -SCALE(-2.488154045724704E-04),\n    -SCALE(-2.486547177024881E-04), -SCALE(-2.482254333360894E-04),\n    -SCALE(-2.475200821995122E-04), -SCALE(-2.465308179417657E-04),\n    -SCALE(-2.452500321752444E-04), -SCALE(-2.436703743734102E-04),\n     SCALE( 2.417845745791980E-04),  SCALE( 2.395854398583434E-04),\n     SCALE( 2.370659535642138E-04),  SCALE( 2.342192800869662E-04),\n     SCALE( 2.310387700701966E-04),  SCALE( 2.275179613297294E-04),\n     SCALE( 2.236505938503120E-04),  SCALE( 2.194306115956788E-04),\n     SCALE( 2.148521873332429E-04),  SCALE( 2.099097253875555E-04),\n     SCALE( 2.045978973917164E-04),  SCALE( 1.989116442431618E-04),\n     SCALE( 1.928461833795790E-04),  SCALE( 1.863970107085474E-04),\n     SCALE( 1.795599357837175E-04),  SCALE( 1.723310839515549E-04),\n     SCALE( 1.647069084035198E-04),  SCALE( 1.566841923938267E-04),\n     SCALE( 1.482600859779846E-04),  SCALE( 1.394321081840759E-04),\n     SCALE( 1.301981580423545E-04),  SCALE( 1.205565161870574E-04),\n     SCALE( 1.105058690666598E-04),  SCALE( 1.000453111637885E-04),\n     SCALE( 8.917436962303755E-05),  SCALE( 7.789300610544491E-05),\n     SCALE( 6.620163295915880E-05),  SCALE( 5.410111500896320E-05),\n     SCALE( 4.159279275517104E-05),  SCALE( 2.867848400338988E-05),\n     SCALE( 1.536049652046955E-05),  SCALE( 1.641629701930447E-06),\n    -SCALE(-1.247480140056488E-05), -SCALE(-2.698496475767416E-05),\n    -SCALE(-4.188450631602256E-05), -SCALE(-5.716854816951505E-05),\n    -SCALE(-7.283165337456365E-05), -SCALE(-8.886782533520320E-05),\n    -SCALE(-1.052705294604104E-04), -SCALE(-1.220326918528753E-04),\n    -SCALE(-1.391466488046540E-04), -SCALE(-1.566041455665768E-04),\n    -SCALE(-1.743963597795672E-04), -SCALE(-1.925139014261300E-04),\n    -SCALE(-2.109467883317648E-04), -SCALE(-2.296844445765594E-04),\n    -SCALE(-2.487156900488424E-04), -SCALE(-2.680287412777888E-04),\n    -SCALE(-2.876112401970844E-04), -SCALE(-3.074502529716603E-04),\n    -SCALE(-3.275322154221950E-04), -SCALE(-3.478429334738513E-04),\n    -SCALE(-3.683676476039790E-04), -SCALE(-3.890910333571532E-04),\n    -SCALE(-4.099971482282953E-04), -SCALE(-4.310694309740984E-04),\n    -SCALE(-4.522907395812775E-04), -SCALE(-4.736433535042661E-04),\n    -SCALE(-4.951089849262823E-04), -SCALE(-5.166687782268060E-04),\n    -SCALE(-5.383032870049990E-04), -SCALE(-5.599924762541345E-04),\n    -SCALE(-5.817157931755955E-04), -SCALE(-6.034521681004050E-04),\n    -SCALE(-6.251799639488680E-04), -SCALE(-6.468769776333065E-04),\n    -SCALE(-6.685205214586190E-04), -SCALE(-6.900874252648055E-04),\n    -SCALE(-7.115540021619675E-04), -SCALE(-7.328960503543460E-04),\n    -SCALE(-7.540889275341360E-04), -SCALE(-7.751075532553095E-04),\n    -SCALE(-7.959263867639895E-04), -SCALE(-8.165194293666030E-04),\n    -SCALE(-8.368602986989685E-04), -SCALE(-8.569222323017155E-04),\n    -SCALE(-8.766780920104490E-04), -SCALE(-8.961003654734095E-04),\n    -SCALE(-9.151611951498600E-04), -SCALE(-9.338323832499584E-04),\n    -SCALE(-9.520854714135470E-04), -SCALE(-9.698917421439440E-04),\n    -SCALE(-9.872221706725139E-04), -SCALE(-1.004047429744579E-03),\n    -SCALE(-1.020338043044835E-03), -SCALE(-1.036064390096491E-03),\n    -SCALE(-1.051196660616898E-03), -SCALE(-1.065704855603833E-03),\n    -SCALE(-1.079558856878201E-03), -SCALE(-1.092728433285052E-03),\n    -SCALE(-1.105183307573424E-03), -SCALE(-1.116893160529398E-03),\n    -SCALE(-1.127827655023416E-03), -SCALE(-1.137956440566105E-03),\n    -SCALE(-1.147249229489164E-03), -SCALE(-1.155675800049931E-03),\n    -SCALE(-1.163205988551180E-03), -SCALE(-1.169809696015420E-03),\n    -SCALE(-1.175457042899868E-03), -SCALE(-1.180118372021201E-03),\n    -SCALE(-1.183764158185287E-03), -SCALE(-1.186365015306024E-03),\n    -SCALE(-1.187891943390233E-03), -SCALE(-1.188316331684390E-03),\n    -SCALE(-1.187609780917844E-03), -SCALE(-1.185744107237668E-03),\n    -SCALE(-1.182691606532144E-03), -SCALE(-1.178425062841502E-03),\n    -SCALE(-1.172917669070769E-03), -SCALE(-1.166143029435388E-03),\n    -SCALE(-1.158075292551968E-03), -SCALE(-1.148689156870073E-03),\n    -SCALE(-1.137959857080735E-03), -SCALE(-1.125863169053070E-03),\n    -SCALE(-1.112375532031342E-03), -SCALE(-1.097474054394210E-03),\n    -SCALE(-1.081136518161085E-03), -SCALE(-1.063341381932592E-03),\n    -SCALE(-1.044067841074319E-03), -SCALE(-1.023295833844173E-03),\n    -SCALE(-1.001006116010387E-03), -SCALE(-9.771802661360279E-04),\n    -SCALE(-9.518007272200706E-04), -SCALE(-9.248508094554660E-04),\n    -SCALE(-8.963147092655810E-04), -SCALE(-8.661775139092965E-04),\n    -SCALE(-8.344252837566670E-04), -SCALE(-8.010450565557860E-04),\n     SCALE( 7.660248590280630E-04),  SCALE( 7.293537115784970E-04),\n     SCALE( 6.910217203263935E-04),  SCALE( 6.510200794896010E-04),\n     SCALE( 6.093410318069875E-04),  SCALE( 5.659778724459110E-04),\n     SCALE( 5.209250745440945E-04),  SCALE( 4.741782930361297E-04),\n     SCALE( 4.257343232947606E-04),  SCALE( 3.755911023931640E-04),\n     SCALE( 3.237477782338944E-04),  SCALE( 2.702047136138704E-04),\n     SCALE( 2.149635065251304E-04),  SCALE( 1.580269916310419E-04),\n     SCALE( 9.939925244214647E-05),  SCALE( 3.908562327914961E-05),\n     SCALE(-2.290727971715371E-05),  SCALE(-8.657155665857780E-05),\n     SCALE(-1.518980125188441E-04),  SCALE(-2.188761566878072E-04),\n     SCALE(-2.874942045551261E-04),  SCALE(-3.577390751948810E-04),\n     SCALE(-4.295963388434640E-04),  SCALE(-5.030502185326690E-04),\n     SCALE(-5.780836785397680E-04),  SCALE(-6.546784227970995E-04),\n     SCALE(-7.328147714529330E-04),  SCALE(-8.124716609148709E-04),\n     SCALE(-8.936267682438125E-04),  SCALE(-9.762565135043539E-04),\n     SCALE(-1.060335987079630E-03),  SCALE(-1.145838949770837E-03),\n    -SCALE(-1.232737907672045E-03), -SCALE(-1.321004112591985E-03),\n    -SCALE(-1.410607496458753E-03), -SCALE(-1.501516675908098E-03),\n    -SCALE(-1.593699118821068E-03), -SCALE(-1.687121144658436E-03),\n    -SCALE(-1.781747765280413E-03), -SCALE(-1.877542686278472E-03),\n    -SCALE(-1.974468495455718E-03), -SCALE(-2.072486671719865E-03),\n    -SCALE(-2.171557592248277E-03), -SCALE(-2.271640530170194E-03),\n    -SCALE(-2.372693596410548E-03), -SCALE(-2.474673741849360E-03),\n    -SCALE(-2.577536862984530E-03), -SCALE(-2.681237815643306E-03),\n    -SCALE(-2.785730610971646E-03), -SCALE(-2.890968412999295E-03),\n    -SCALE(-2.996903289082014E-03), -SCALE(-3.103486213203266E-03),\n    -SCALE(-3.210667388169048E-03), -SCALE(-3.318396256656389E-03),\n    -SCALE(-3.426621422085545E-03), -SCALE(-3.535290652053989E-03),\n    -SCALE(-3.644351033012211E-03), -SCALE(-3.753748970963593E-03),\n    -SCALE(-3.863430052185924E-03), -SCALE(-3.973339058810391E-03),\n    -SCALE(-4.083420450837847E-03), -SCALE(-4.193618368607346E-03),\n    -SCALE(-4.303876205087690E-03), -SCALE(-4.414136605908662E-03),\n    -SCALE(-4.524341897756710E-03), -SCALE(-4.634434107578317E-03),\n    -SCALE(-4.744354956658913E-03), -SCALE(-4.854045856535885E-03),\n    -SCALE(-4.963447825006078E-03), -SCALE(-5.072501497871895E-03),\n    -SCALE(-5.181147471348025E-03), -SCALE(-5.289326317382795E-03),\n    -SCALE(-5.396978578320565E-03), -SCALE(-5.504044759237560E-03),\n    -SCALE(-5.610465164666585E-03), -SCALE(-5.716179914026345E-03),\n    -SCALE(-5.821129444341225E-03), -SCALE(-5.925254521610190E-03),\n    -SCALE(-6.028495988202895E-03), -SCALE(-6.130794760236025E-03),\n    -SCALE(-6.232092022456570E-03), -SCALE(-6.332329249242580E-03),\n    -SCALE(-6.431448471736440E-03), -SCALE(-6.529392276231145E-03),\n    -SCALE(-6.626103501535170E-03), -SCALE(-6.721525246692210E-03),\n    -SCALE(-6.815601343450995E-03), -SCALE(-6.908276363015645E-03),\n    -SCALE(-6.999495292082720E-03), -SCALE(-7.089203549057705E-03),\n    -SCALE(-7.177347664780630E-03), -SCALE(-7.263875283956655E-03),\n    -SCALE(-7.348734515904140E-03), -SCALE(-7.431873934100050E-03),\n    -SCALE(-7.513243215430925E-03), -SCALE(-7.592793162768140E-03),\n    -SCALE(-7.670475562372150E-03), -SCALE(-7.746243173811765E-03),\n    -SCALE(-7.820049650783600E-03), -SCALE(-7.891849558781685E-03),\n    -SCALE(-7.961598843009079E-03), -SCALE(-8.029254840905250E-03),\n    -SCALE(-8.094776089836320E-03), -SCALE(-8.158122302753560E-03),\n    -SCALE(-8.219254024989381E-03), -SCALE(-8.278132675268024E-03),\n    -SCALE(-8.334721791143661E-03), -SCALE(-8.388987020627474E-03),\n    -SCALE(-8.440894692545369E-03), -SCALE(-8.490411808784576E-03),\n    -SCALE(-8.537507303362359E-03), -SCALE(-8.582152067202975E-03),\n    -SCALE(-8.624318234161430E-03), -SCALE(-8.663979162716030E-03),\n    -SCALE(-8.701109747179411E-03), -SCALE(-8.735686465917280E-03),\n    -SCALE(-8.767688130949044E-03), -SCALE(-8.797095815255481E-03),\n    -SCALE(-8.823890503946285E-03), -SCALE(-8.848053147748315E-03),\n    -SCALE(-8.869568188578319E-03), -SCALE(-8.888423592735640E-03),\n    -SCALE(-8.904608055568560E-03), -SCALE(-8.918110931856005E-03),\n    -SCALE(-8.928923499538055E-03), -SCALE(-8.937039001090346E-03),\n    -SCALE(-8.942452290029211E-03), -SCALE(-8.945159822376361E-03),\n     SCALE( 8.945159822376361E-03),  SCALE( 8.942452290029211E-03),\n     SCALE( 8.937039001090346E-03),  SCALE( 8.928923499538055E-03),\n     SCALE( 8.918110931856005E-03),  SCALE( 8.904608055568560E-03),\n     SCALE( 8.888423592735640E-03),  SCALE( 8.869568188578319E-03),\n     SCALE( 8.848053147748315E-03),  SCALE( 8.823890503946285E-03),\n     SCALE( 8.797095815255481E-03),  SCALE( 8.767688130949044E-03),\n     SCALE( 8.735686465917280E-03),  SCALE( 8.701109747179411E-03),\n     SCALE( 8.663979162716030E-03),  SCALE( 8.624318234161430E-03),\n     SCALE( 8.582152067202975E-03),  SCALE( 8.537507303362359E-03),\n     SCALE( 8.490411808784576E-03),  SCALE( 8.440894692545369E-03),\n     SCALE( 8.388987020627474E-03),  SCALE( 8.334721791143661E-03),\n     SCALE( 8.278132675268024E-03),  SCALE( 8.219254024989381E-03),\n     SCALE( 8.158122302753560E-03),  SCALE( 8.094776089836320E-03),\n     SCALE( 8.029254840905250E-03),  SCALE( 7.961598843009079E-03),\n     SCALE( 7.891849558781685E-03),  SCALE( 7.820049650783600E-03),\n     SCALE( 7.746243173811765E-03),  SCALE( 7.670475562372150E-03),\n    -SCALE( 7.592793162768140E-03), -SCALE( 7.513243215430925E-03),\n    -SCALE( 7.431873934100050E-03), -SCALE( 7.348734515904140E-03),\n    -SCALE( 7.263875283956655E-03), -SCALE( 7.177347664780630E-03),\n    -SCALE( 7.089203549057705E-03), -SCALE( 6.999495292082720E-03),\n    -SCALE( 6.908276363015645E-03), -SCALE( 6.815601343450995E-03),\n    -SCALE( 6.721525246692210E-03), -SCALE( 6.626103501535170E-03),\n    -SCALE( 6.529392276231145E-03), -SCALE( 6.431448471736440E-03),\n    -SCALE( 6.332329249242580E-03), -SCALE( 6.232092022456570E-03),\n    -SCALE( 6.130794760236025E-03), -SCALE( 6.028495988202895E-03),\n    -SCALE( 5.925254521610190E-03), -SCALE( 5.821129444341225E-03),\n    -SCALE( 5.716179914026345E-03), -SCALE( 5.610465164666585E-03),\n    -SCALE( 5.504044759237560E-03), -SCALE( 5.396978578320565E-03),\n    -SCALE( 5.289326317382795E-03), -SCALE( 5.181147471348025E-03),\n    -SCALE( 5.072501497871895E-03), -SCALE( 4.963447825006078E-03),\n    -SCALE( 4.854045856535885E-03), -SCALE( 4.744354956658913E-03),\n    -SCALE( 4.634434107578317E-03), -SCALE( 4.524341897756710E-03),\n    -SCALE( 4.414136605908662E-03), -SCALE( 4.303876205087690E-03),\n    -SCALE( 4.193618368607346E-03), -SCALE( 4.083420450837847E-03),\n    -SCALE( 3.973339058810391E-03), -SCALE( 3.863430052185924E-03),\n    -SCALE( 3.753748970963593E-03), -SCALE( 3.644351033012211E-03),\n    -SCALE( 3.535290652053989E-03), -SCALE( 3.426621422085545E-03),\n    -SCALE( 3.318396256656389E-03), -SCALE( 3.210667388169048E-03),\n    -SCALE( 3.103486213203266E-03), -SCALE( 2.996903289082014E-03),\n    -SCALE( 2.890968412999295E-03), -SCALE( 2.785730610971646E-03),\n    -SCALE( 2.681237815643306E-03), -SCALE( 2.577536862984530E-03),\n    -SCALE( 2.474673741849360E-03), -SCALE( 2.372693596410548E-03),\n    -SCALE( 2.271640530170194E-03), -SCALE( 2.171557592248277E-03),\n    -SCALE( 2.072486671719865E-03), -SCALE( 1.974468495455718E-03),\n    -SCALE( 1.877542686278472E-03), -SCALE( 1.781747765280413E-03),\n    -SCALE( 1.687121144658436E-03), -SCALE( 1.593699118821068E-03),\n    -SCALE( 1.501516675908098E-03), -SCALE( 1.410607496458753E-03),\n    -SCALE( 1.321004112591985E-03), -SCALE( 1.232737907672045E-03),\n    -SCALE( 1.145838949770837E-03), -SCALE( 1.060335987079630E-03),\n    -SCALE( 9.762565135043539E-04), -SCALE( 8.936267682438125E-04),\n    -SCALE( 8.124716609148709E-04), -SCALE( 7.328147714529330E-04),\n    -SCALE( 6.546784227970995E-04), -SCALE( 5.780836785397680E-04),\n    -SCALE( 5.030502185326690E-04), -SCALE( 4.295963388434640E-04),\n    -SCALE( 3.577390751948810E-04), -SCALE( 2.874942045551261E-04),\n    -SCALE( 2.188761566878072E-04), -SCALE( 1.518980125188441E-04),\n    -SCALE( 8.657155665857780E-05), -SCALE( 2.290727971715371E-05),\n    -SCALE(-3.908562327914961E-05), -SCALE(-9.939925244214647E-05),\n    -SCALE(-1.580269916310419E-04), -SCALE(-2.149635065251304E-04),\n    -SCALE(-2.702047136138704E-04), -SCALE(-3.237477782338944E-04),\n    -SCALE(-3.755911023931640E-04), -SCALE(-4.257343232947606E-04),\n    -SCALE(-4.741782930361297E-04), -SCALE(-5.209250745440945E-04),\n    -SCALE(-5.659778724459110E-04), -SCALE(-6.093410318069875E-04),\n    -SCALE(-6.510200794896010E-04), -SCALE(-6.910217203263935E-04),\n    -SCALE(-7.293537115784970E-04), -SCALE(-7.660248590280630E-04),\n     SCALE( 8.010450565557860E-04),  SCALE( 8.344252837566670E-04),\n     SCALE( 8.661775139092965E-04),  SCALE( 8.963147092655810E-04),\n     SCALE( 9.248508094554660E-04),  SCALE( 9.518007272200706E-04),\n     SCALE( 9.771802661360279E-04),  SCALE( 1.001006116010387E-03),\n     SCALE( 1.023295833844173E-03),  SCALE( 1.044067841074319E-03),\n     SCALE( 1.063341381932592E-03),  SCALE( 1.081136518161085E-03),\n     SCALE( 1.097474054394210E-03),  SCALE( 1.112375532031342E-03),\n     SCALE( 1.125863169053070E-03),  SCALE( 1.137959857080735E-03),\n     SCALE( 1.148689156870073E-03),  SCALE( 1.158075292551968E-03),\n     SCALE( 1.166143029435388E-03),  SCALE( 1.172917669070769E-03),\n     SCALE( 1.178425062841502E-03),  SCALE( 1.182691606532144E-03),\n     SCALE( 1.185744107237668E-03),  SCALE( 1.187609780917844E-03),\n     SCALE( 1.188316331684390E-03),  SCALE( 1.187891943390233E-03),\n     SCALE( 1.186365015306024E-03),  SCALE( 1.183764158185287E-03),\n     SCALE( 1.180118372021201E-03),  SCALE( 1.175457042899868E-03),\n     SCALE( 1.169809696015420E-03),  SCALE( 1.163205988551180E-03),\n    -SCALE( 1.155675800049931E-03), -SCALE( 1.147249229489164E-03),\n    -SCALE( 1.137956440566105E-03), -SCALE( 1.127827655023416E-03),\n    -SCALE( 1.116893160529398E-03), -SCALE( 1.105183307573424E-03),\n    -SCALE( 1.092728433285052E-03), -SCALE( 1.079558856878201E-03),\n    -SCALE( 1.065704855603833E-03), -SCALE( 1.051196660616898E-03),\n    -SCALE( 1.036064390096491E-03), -SCALE( 1.020338043044835E-03),\n    -SCALE( 1.004047429744579E-03), -SCALE( 9.872221706725139E-04),\n    -SCALE( 9.698917421439440E-04), -SCALE( 9.520854714135470E-04),\n    -SCALE( 9.338323832499584E-04), -SCALE( 9.151611951498600E-04),\n    -SCALE( 8.961003654734095E-04), -SCALE( 8.766780920104490E-04),\n    -SCALE( 8.569222323017155E-04), -SCALE( 8.368602986989685E-04),\n    -SCALE( 8.165194293666030E-04), -SCALE( 7.959263867639895E-04),\n    -SCALE( 7.751075532553095E-04), -SCALE( 7.540889275341360E-04),\n    -SCALE( 7.328960503543460E-04), -SCALE( 7.115540021619675E-04),\n    -SCALE( 6.900874252648055E-04), -SCALE( 6.685205214586190E-04),\n    -SCALE( 6.468769776333065E-04), -SCALE( 6.251799639488680E-04),\n    -SCALE( 6.034521681004050E-04), -SCALE( 5.817157931755955E-04),\n    -SCALE( 5.599924762541345E-04), -SCALE( 5.383032870049990E-04),\n    -SCALE( 5.166687782268060E-04), -SCALE( 4.951089849262823E-04),\n    -SCALE( 4.736433535042661E-04), -SCALE( 4.522907395812775E-04),\n    -SCALE( 4.310694309740984E-04), -SCALE( 4.099971482282953E-04),\n    -SCALE( 3.890910333571532E-04), -SCALE( 3.683676476039790E-04),\n    -SCALE( 3.478429334738513E-04), -SCALE( 3.275322154221950E-04),\n    -SCALE( 3.074502529716603E-04), -SCALE( 2.876112401970844E-04),\n    -SCALE( 2.680287412777888E-04), -SCALE( 2.487156900488424E-04),\n    -SCALE( 2.296844445765594E-04), -SCALE( 2.109467883317648E-04),\n    -SCALE( 1.925139014261300E-04), -SCALE( 1.743963597795672E-04),\n    -SCALE( 1.566041455665768E-04), -SCALE( 1.391466488046540E-04),\n    -SCALE( 1.220326918528753E-04), -SCALE( 1.052705294604104E-04),\n    -SCALE( 8.886782533520320E-05), -SCALE( 7.283165337456365E-05),\n    -SCALE( 5.716854816951505E-05), -SCALE( 4.188450631602256E-05),\n    -SCALE( 2.698496475767416E-05), -SCALE( 1.247480140056488E-05),\n    -SCALE(-1.641629701930447E-06), -SCALE(-1.536049652046955E-05),\n    -SCALE(-2.867848400338988E-05), -SCALE(-4.159279275517104E-05),\n    -SCALE(-5.410111500896320E-05), -SCALE(-6.620163295915880E-05),\n    -SCALE(-7.789300610544491E-05), -SCALE(-8.917436962303755E-05),\n    -SCALE(-1.000453111637885E-04), -SCALE(-1.105058690666598E-04),\n    -SCALE(-1.205565161870574E-04), -SCALE(-1.301981580423545E-04),\n    -SCALE(-1.394321081840759E-04), -SCALE(-1.482600859779846E-04),\n    -SCALE(-1.566841923938267E-04), -SCALE(-1.647069084035198E-04),\n    -SCALE(-1.723310839515549E-04), -SCALE(-1.795599357837175E-04),\n    -SCALE(-1.863970107085474E-04), -SCALE(-1.928461833795790E-04),\n    -SCALE(-1.989116442431618E-04), -SCALE(-2.045978973917164E-04),\n    -SCALE(-2.099097253875555E-04), -SCALE(-2.148521873332429E-04),\n    -SCALE(-2.194306115956788E-04), -SCALE(-2.236505938503120E-04),\n    -SCALE(-2.275179613297294E-04), -SCALE(-2.310387700701966E-04),\n    -SCALE(-2.342192800869662E-04), -SCALE(-2.370659535642138E-04),\n    -SCALE(-2.395854398583434E-04), -SCALE(-2.417845745791980E-04),\n     SCALE( 2.436703743734102E-04),  SCALE( 2.452500321752444E-04),\n     SCALE( 2.465308179417657E-04),  SCALE( 2.475200821995122E-04),\n     SCALE( 2.482254333360894E-04),  SCALE( 2.486547177024881E-04),\n     SCALE( 2.488154045724704E-04),  SCALE( 2.487146183038166E-04),\n     SCALE( 2.483604609263728E-04),  SCALE( 2.477619902517768E-04),\n     SCALE( 2.469274156993822E-04),  SCALE( 2.458640761601700E-04),\n     SCALE( 2.445797571768798E-04),  SCALE( 2.430827245294182E-04),\n     SCALE( 2.413811459337238E-04),  SCALE( 2.394830702362197E-04),\n     SCALE( 2.373965479929124E-04),  SCALE( 2.351296356350780E-04),\n     SCALE( 2.326903665352515E-04),  SCALE( 2.300867481008122E-04),\n     SCALE( 2.273267267668629E-04),  SCALE( 2.244181863585484E-04),\n     SCALE( 2.213689470691719E-04),  SCALE( 2.181867649165566E-04),\n     SCALE( 2.148793208048870E-04),  SCALE( 2.114542191049128E-04),\n     SCALE( 2.079189673565927E-04),  SCALE( 2.042809749895736E-04),\n     SCALE( 2.005475454710861E-04),  SCALE( 1.967258755680427E-04),\n     SCALE( 1.928230469653129E-04),  SCALE( 1.888460252663805E-04),\n    -SCALE( 1.848016463895374E-04), -SCALE( 1.806966158461229E-04),\n    -SCALE( 1.765375064656002E-04), -SCALE( 1.723307577358468E-04),\n    -SCALE( 1.680826635644682E-04), -SCALE( 1.637993715464274E-04),\n    -SCALE( 1.594868790905897E-04), -SCALE( 1.551510331409437E-04),\n    -SCALE( 1.507975279169229E-04), -SCALE( 1.464319042632354E-04),\n    -SCALE( 1.420595376057812E-04), -SCALE( 1.376856378740834E-04),\n    -SCALE( 1.333152598388584E-04), -SCALE( 1.289533027076185E-04),\n    -SCALE( 1.246044908903475E-04), -SCALE( 1.202733737618488E-04),\n    -SCALE( 1.159643396677203E-04), -SCALE( 1.116816161426427E-04),\n    -SCALE( 1.074292607067401E-04), -SCALE( 1.032111605730492E-04),\n    -SCALE( 9.903103541547551E-05), -SCALE( 9.489243763625400E-05),\n    -SCALE( 9.079875548213924E-05), -SCALE( 8.675321306240340E-05),\n    -SCALE( 8.275886762862380E-05), -SCALE( 7.881860980632000E-05),\n    -SCALE( 7.493517141117804E-05), -SCALE( 7.111112575372286E-05),\n    -SCALE( 6.734888652588270E-05), -SCALE( 6.365070805378855E-05),\n    -SCALE( 6.001869197279105E-05), -SCALE( 5.645478762018535E-05),\n    -SCALE( 5.296079400014060E-05), -SCALE( 4.953836017695434E-05),\n    -SCALE( 4.618899196172456E-05), -SCALE( 4.291405238785664E-05),\n    -SCALE( 3.971476548553926E-05), -SCALE( 3.659221671654097E-05),\n    -SCALE( 3.354735876525904E-05), -SCALE( 3.058101208191696E-05),\n    -SCALE( 2.769387104186206E-05), -SCALE( 2.488650449141616E-05),\n    -SCALE( 2.215936159729271E-05), -SCALE( 1.951277238921524E-05),\n    -SCALE( 1.694695384810771E-05), -SCALE( 1.446201050055097E-05),\n    -SCALE( 1.205794140863581E-05), -SCALE( 9.734640752487110E-06),\n    -SCALE( 7.491903655942790E-06), -SCALE( 5.329426896805280E-06),\n    -SCALE( 3.246818706694593E-06), -SCALE( 1.243599082783966E-06),\n    -SCALE(-6.808031538695990E-07), -SCALE(-2.527049419980207E-06),\n    -SCALE(-4.295867784770884E-06), -SCALE(-5.988052382589700E-06),\n    -SCALE(-7.604474075726550E-06), -SCALE(-9.146080150692231E-06),\n    -SCALE(-1.061387697354165E-05), -SCALE(-1.200892908323512E-05),\n    -SCALE(-1.333235659026308E-05), -SCALE(-1.458533474050792E-05),\n    -SCALE(-1.576908692157790E-05), -SCALE(-1.688488402231131E-05),\n    -SCALE(-1.793403733553470E-05), -SCALE(-1.891789805352808E-05),\n    -SCALE(-1.983785326550204E-05), -SCALE(-2.069532541857637E-05),\n    -SCALE(-2.149176446183214E-05), -SCALE(-2.222864728099456E-05),\n    -SCALE(-2.290747311740374E-05), -SCALE(-2.352976312853915E-05),\n    -SCALE(-2.409705530058412E-05), -SCALE(-2.461090395766135E-05),\n    -SCALE(-2.507287405244726E-05), -SCALE(-2.548454069800296E-05),\n    -SCALE(-2.584748457743932E-05), -SCALE(-2.616329155063932E-05),\n    -SCALE(-2.643354859248296E-05), -SCALE(-2.665984338990853E-05),\n    -SCALE(-2.684375953903512E-05), -SCALE(-2.698687619105470E-05),\n    -SCALE(-2.709076506473594E-05), -SCALE(-2.715699010579455E-05),\n    -SCALE(-2.718710298053676E-05), -SCALE(-2.718264274615772E-05),\n    -SCALE(-2.714513310366389E-05), -SCALE(-2.707608215301207E-05),\n    -SCALE(-2.697697975324517E-05), -SCALE(-2.684929723999712E-05),\n    -SCALE(-2.669448385046480E-05), -SCALE(-2.651396653512446E-05),\n    -SCALE(-2.630914939052064E-05), -SCALE(-2.608141341583320E-05),\n    -SCALE(-2.583211172456204E-05), -SCALE(-2.556256939919902E-05),\n     SCALE( 2.527408508232496E-05),  SCALE( 2.496793086354262E-05),\n     SCALE( 2.464534820090372E-05),  SCALE( 2.430754772248991E-05),\n     SCALE( 2.395570893976328E-05),  SCALE( 2.359098021649775E-05),\n     SCALE( 2.321447837191817E-05),  SCALE( 2.282728860550347E-05),\n     SCALE( 2.243046323951717E-05),  SCALE( 2.202502165289463E-05),\n     SCALE( 2.161195008423191E-05),  SCALE( 2.119220163057428E-05),\n     SCALE( 2.076669641777394E-05),  SCALE( 2.033632155746451E-05),\n     SCALE( 1.990193003014108E-05),  SCALE( 1.946434074488017E-05),\n     SCALE( 1.902434097009924E-05),  SCALE( 1.858268630848355E-05),\n     SCALE( 1.814009771461820E-05),  SCALE( 1.769726156360750E-05),\n     SCALE( 1.725483414306857E-05),  SCALE( 1.681344171653956E-05),\n     SCALE( 1.637367742646690E-05),  SCALE( 1.593610134164050E-05),\n     SCALE( 1.550124459778260E-05),  SCALE( 1.506960952767971E-05),\n     SCALE( 1.464166838349645E-05),  SCALE( 1.421786336584378E-05),\n     SCALE( 1.379860854096596E-05),  SCALE( 1.338428997824206E-05),\n     SCALE( 1.297526685803031E-05),  SCALE( 1.257187157446922E-05),\n    -SCALE( 1.217441088925653E-05), -SCALE( 1.178316603669356E-05),\n    -SCALE( 1.139839388088106E-05), -SCALE( 1.102032704633465E-05),\n    -SCALE( 1.064917563432859E-05), -SCALE( 1.028512733460845E-05),\n    -SCALE( 9.928348166726454E-06), -SCALE( 9.578982598825311E-06),\n    -SCALE( 9.237155419546841E-06), -SCALE( 8.902971890012200E-06),\n    -SCALE( 8.576519215476810E-06), -SCALE( 8.257866642922776E-06),\n    -SCALE( 7.947066136436549E-06), -SCALE( 7.644152509859200E-06),\n    -SCALE( 7.349145669714490E-06), -SCALE( 7.062050754515410E-06),\n    -SCALE( 6.782858956580495E-06), -SCALE( 6.511547627860400E-06),\n    -SCALE( 6.248081786307280E-06), -SCALE( 5.992414242480480E-06),\n    -SCALE( 5.744486878502875E-06), -SCALE( 5.504230753545810E-06),\n    -SCALE( 5.271567145540585E-06), -SCALE( 5.046407670500340E-06),\n    -SCALE( 4.828655865889468E-06), -SCALE( 4.618207304054390E-06),\n    -SCALE( 4.414950504331232E-06), -SCALE( 4.218767020985225E-06),\n    -SCALE( 4.029532465769980E-06), -SCALE( 3.847116621801583E-06),\n    -SCALE( 3.671384926229468E-06), -SCALE( 3.502198552003754E-06),\n    -SCALE( 3.339414724085582E-06), -SCALE( 3.182886786597464E-06),\n    -SCALE( 3.032465363920388E-06), -SCALE( 2.887998457950138E-06),\n    -SCALE( 2.749332426639114E-06), -SCALE( 2.616312057164482E-06),\n    -SCALE( 2.488781197085654E-06), -SCALE( 2.366582812095056E-06),\n    -SCALE( 2.249559625377646E-06), -SCALE( 2.137554168666232E-06),\n    -SCALE( 2.030409266099076E-06), -SCALE( 1.927968090232205E-06),\n    -SCALE( 1.830074910452612E-06), -SCALE( 1.736575155397134E-06),\n    -SCALE( 1.647316037754536E-06), -SCALE( 1.562146591398006E-06),\n    -SCALE( 1.480917863497994E-06), -SCALE( 1.403482943378026E-06),\n    -SCALE( 1.329697405230052E-06), -SCALE( 1.259419343863326E-06),\n    -SCALE( 1.192509718464610E-06), -SCALE( 1.128832363715543E-06),\n    -SCALE( 1.068253890614633E-06), -SCALE( 1.010643712821376E-06),\n    -SCALE( 9.558747254049829E-07), -SCALE( 9.038233322489550E-07),\n    -SCALE( 8.543693702029365E-07), -SCALE( 8.073961036828060E-07),\n    -SCALE( 7.627901817207720E-07), -SCALE( 7.204416525901345E-07),\n    -SCALE( 6.802443284999140E-07), -SCALE( 6.420958008785305E-07),\n    -SCALE( 6.058974119201980E-07), -SCALE( 5.715542338879300E-07),\n    -SCALE( 5.389746422333555E-07), -SCALE( 5.080703129463105E-07),\n    -SCALE( 4.787565911260676E-07), -SCALE( 4.509524956369838E-07),\n    -SCALE( 4.245804529615933E-07), -SCALE( 3.995662812166919E-07),\n    -SCALE( 3.758391046541218E-07), -SCALE( 3.533313458884360E-07),\n    -SCALE( 3.319786404047318E-07), -SCALE( 3.117198196826890E-07),\n    -SCALE( 2.924966254175760E-07), -SCALE( 2.742537030854958E-07),\n    -SCALE( 2.569387461577766E-07), -SCALE( 2.405024587792340E-07),\n    -SCALE( 2.248975904755362E-07), -SCALE( 2.100789970600680E-07),\n    -SCALE( 1.960059458775785E-07), -SCALE( 1.826418431101815E-07),\n    -SCALE( 1.699459292657122E-07), -SCALE( 1.578742499812371E-07),\n    -SCALE( 1.464093182119164E-07), -SCALE( 1.355563613797138E-07),\n    -SCALE( 1.252310964561535E-07), -SCALE( 1.152736341186576E-07),\n    -SCALE( 1.058665951072195E-07), -SCALE( 9.748319049487465E-08),\n    -SCALE( 8.932687128137479E-08), -SCALE( 7.952503432137510E-08),\n    -SCALE( 7.095090315087499E-08), -SCALE( 7.127938986604168E-08)\n};\n\n#undef SCALE\n"
  },
  {
    "path": "libdcadec/fixed_math.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef FIXED_MATH_H\n#define FIXED_MATH_H\n\nstatic inline int64_t round__(int64_t a, int bits)\n{\n    if (bits > 0)\n        return (a + (INT64_C(1) << (bits - 1))) & ~((INT64_C(1) << bits) - 1);\n    else\n        return a;\n}\n\nstatic inline int32_t norm__(int64_t a, int bits)\n{\n    if (bits > 0)\n        return (int32_t)((a + (INT64_C(1) << (bits - 1))) >> bits);\n    else\n        return (int32_t)a;\n}\n\nstatic inline int32_t mul__(int32_t a, int32_t b, int bits)\n{\n    return norm__((int64_t)a * b, bits);\n}\n\nstatic inline int32_t clip__(int32_t a, int bits)\n{\n#ifdef __ARM_FEATURE_SAT\n    int x;\n    __asm__(\"ssat %0, %2, %1\" : \"=r\"(x) : \"r\"(a), \"i\"(bits + 1));\n    return x;\n#else\n    if ((a + (1 << bits)) & ~((1 << (bits + 1)) - 1))\n        return (a >> 31) ^ ((1 << bits) - 1);\n    else\n        return a;\n#endif\n}\n\nstatic inline int64_t round20(int64_t a) { return round__(a, 20); }\nstatic inline int64_t round21(int64_t a) { return round__(a, 21); }\n\nstatic inline int32_t norm13(int64_t a) { return norm__(a, 13); }\nstatic inline int32_t norm16(int64_t a) { return norm__(a, 16); }\nstatic inline int32_t norm20(int64_t a) { return norm__(a, 20); }\nstatic inline int32_t norm21(int64_t a) { return norm__(a, 21); }\nstatic inline int32_t norm23(int64_t a) { return norm__(a, 23); }\n\nstatic inline int32_t mul3(int32_t a, int32_t b)\n{\n    return (a * b + (1 << 2)) >> 3;\n}\n\nstatic inline int32_t mul4(int32_t a, int32_t b)\n{\n    return (a * b + (1 << 3)) >> 4;\n}\n\nstatic inline int32_t mul15(int32_t a, int32_t b) { return mul__(a, b, 15); }\nstatic inline int32_t mul16(int32_t a, int32_t b) { return mul__(a, b, 16); }\nstatic inline int32_t mul17(int32_t a, int32_t b) { return mul__(a, b, 17); }\nstatic inline int32_t mul22(int32_t a, int32_t b) { return mul__(a, b, 22); }\nstatic inline int32_t mul23(int32_t a, int32_t b) { return mul__(a, b, 23); }\nstatic inline int32_t mul31(int32_t a, int32_t b) { return mul__(a, b, 31); }\n\nstatic inline int32_t clip23(int32_t a) { return clip__(a, 23); }\n\n#endif\n"
  },
  {
    "path": "libdcadec/huffman.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef HUFFMAN_H\n#define HUFFMAN_H\n\nstruct huffman {\n    const uint8_t *len;\n    const uint16_t *code;\n    int size;\n};\n\n#endif\n"
  },
  {
    "path": "libdcadec/idct.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef IDCT_H\n#define IDCT_H\n\n#define IDCT_BITS   7\n#define IDCT_SIZE   (1 << IDCT_BITS)\n\nstruct idct_context {\n    double cs[IDCT_SIZE / 2];\n    double ac[IDCT_SIZE / 2];\n    double as[IDCT_SIZE / 2];\n    uint8_t permute[IDCT_SIZE / 2];\n    int nbits;\n};\n\nstruct idct_context *idct_init(void *parent, int nbits, double scale) __attribute__((cold));\nvoid idct_fast(const struct idct_context *s, const double *input, double *output);\nvoid imdct_fast(const struct idct_context *s, const float *input, float *output);\n\nvoid idct_fixed32(int * restrict input, int * restrict output);\nvoid idct_fixed64(int * restrict input, int * restrict output);\n\n#endif\n"
  },
  {
    "path": "libdcadec/idct_fixed.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"common.h\"\n#include \"fixed_math.h\"\n#include \"idct.h\"\n\nstatic void sum_a(const int * restrict input, int * restrict output, int len)\n{\n    for (int i = 0; i < len; i++)\n        output[i] = input[2 * i] + input[2 * i + 1];\n}\n\nstatic void sum_b(const int * restrict input, int * restrict output, int len)\n{\n    output[0] = input[0];\n    for (int i = 1; i < len; i++)\n        output[i] = input[2 * i] + input[2 * i - 1];\n}\n\nstatic void sum_c(const int * restrict input, int * restrict output, int len)\n{\n    for (int i = 0; i < len; i++)\n        output[i] = input[2 * i];\n}\n\nstatic void sum_d(const int * restrict input, int * restrict output, int len)\n{\n    output[0] = input[1];\n    for (int i = 1; i < len; i++)\n        output[i] = input[2 * i - 1] + input[2 * i + 1];\n}\n\nstatic void dct_a(const int * restrict input, int * restrict output)\n{\n    //  floor(sin((2 * i + 1) * (2 * (7 - j) + 1) * PI / 32) * (1 << 23) + 0.5), i = 2 * k\n    // -floor(sin((2 * i + 1) * (2 * (7 - j) + 1) * PI / 32) * (1 << 23) + 0.5), i = 2 * k + 1\n    static const int cos_mod[8][8] = {\n         { 8348215,  8027397,  7398092,  6484482,  5321677,  3954362,  2435084,   822227 },\n         { 8027397,  5321677,   822227, -3954362, -7398092, -8348215, -6484482, -2435084 },\n         { 7398092,   822227, -6484482, -8027397, -2435084,  5321677,  8348215,  3954362 },\n         { 6484482, -3954362, -8027397,   822227,  8348215,  2435084, -7398092, -5321677 },\n         { 5321677, -7398092, -2435084,  8348215,  -822227, -8027397,  3954362,  6484482 },\n         { 3954362, -8348215,  5321677,  2435084, -8027397,  6484482,   822227, -7398092 },\n         { 2435084, -6484482,  8348215, -7398092,  3954362,   822227, -5321677,  8027397 },\n         {  822227, -2435084,  3954362, -5321677,  6484482, -7398092,  8027397, -8348215 }\n    };\n\n    for (int i = 0; i < 8; i++) {\n        int64_t res = INT64_C(0);\n        for (int j = 0; j < 8; j++)\n            res += (int64_t)cos_mod[i][j] * input[j];\n        output[i] = norm23(res);\n    }\n}\n\nstatic void dct_b(const int * restrict input, int * restrict output)\n{\n    // floor(cos((2 * i + 1) * (j + 1) * PI / 16) * (1 << 23) + 0.5)\n    static const int cos_mod[8][7] = {\n        {  8227423,  7750063,  6974873,  5931642,  4660461,  3210181,  1636536 },\n        {  6974873,  3210181, -1636536, -5931642, -8227423, -7750063, -4660461 },\n        {  4660461, -3210181, -8227423, -5931642,  1636536,  7750063,  6974873 },\n        {  1636536, -7750063, -4660461,  5931642,  6974873, -3210181, -8227423 },\n        { -1636536, -7750063,  4660461,  5931642, -6974873, -3210181,  8227423 },\n        { -4660461, -3210181,  8227423, -5931642, -1636536,  7750063, -6974873 },\n        { -6974873,  3210181,  1636536, -5931642,  8227423, -7750063,  4660461 },\n        { -8227423,  7750063, -6974873,  5931642, -4660461,  3210181, -1636536 }\n    };\n\n    for (int i = 0; i < 8; i++) {\n        int64_t res = (int64_t)input[0] * (1 << 23);\n        for (int j = 0; j < 7; j++)\n            res += (int64_t)cos_mod[i][j] * input[1 + j];\n        output[i] = norm23(res);\n    }\n}\n\nstatic void mod_a(const int * restrict input, int * restrict output)\n{\n    //  floor(0.5 / cos((2 * (     i) + 1) * PI / 64) * (1 << 23) + 0.5), i = 0 ..  8\n    // -floor(0.5 / sin((2 * (15 - i) + 1) * PI / 64) * (1 << 23) + 0.5), i = 8 .. 16\n    static const int cos_mod[16] = {\n          4199362,   4240198,   4323885,   4454708,\n          4639772,   4890013,   5221943,   5660703,\n         -6245623,  -7040975,  -8158494,  -9809974,\n        -12450076, -17261920, -28585092, -85479984\n    };\n\n    for (int i = 0; i < 8; i++)\n        output[i] = mul23(cos_mod[i], input[i] + input[8 + i]);\n\n    for (int i = 8, k = 7; i < 16; i++, k--)\n        output[i] = mul23(cos_mod[i], input[k] - input[8 + k]);\n}\n\nstatic void mod_b(int * restrict input, int * restrict output)\n{\n    // floor(0.5 / cos((2 * (    i) + 1) * PI / 32) * (1 << 23) + 0.5), i = 0 .. 4\n    // floor(0.5 / sin((2 * (7 - i) + 1) * PI / 32) * (1 << 23) + 0.5), i = 4 .. 8\n    static const int cos_mod[8] = {\n        4214598,  4383036,  4755871,  5425934,\n        6611520,  8897610, 14448934, 42791536\n    };\n\n    for (int i = 0; i < 8; i++)\n        input[8 + i] = mul23(cos_mod[i], input[8 + i]);\n\n    for (int i = 0; i < 8; i++)\n        output[i] = input[i] + input[8 + i];\n\n    for (int i = 8, k = 7; i < 16; i++, k--)\n        output[i] = input[k] - input[8 + k];\n}\n\nstatic void mod_c(const int * restrict input, int * restrict output)\n{\n    //  floor(0.125 / cos((2 * (     i) + 1) * PI / 128) * (1 << 23) + 0.5), i =  0 .. 16\n    // -floor(0.125 / sin((2 * (31 - i) + 1) * PI / 128) * (1 << 23) + 0.5), i = 16 .. 32\n    static const int cos_mod[32] = {\n         1048892,  1051425,   1056522,   1064244,\n         1074689,  1087987,   1104313,   1123884,\n         1146975,  1173922,   1205139,   1241133,\n         1282529,  1330095,   1384791,   1447815,\n        -1520688, -1605358,  -1704360,  -1821051,\n        -1959964, -2127368,  -2332183,  -2587535,\n        -2913561, -3342802,  -3931480,  -4785806,\n        -6133390, -8566050, -14253820, -42727120\n    };\n\n    for (int i = 0; i < 16; i++)\n        output[i] = mul23(cos_mod[i], input[i] + input[16 + i]);\n\n    for (int i = 16, k = 15; i < 32; i++, k--)\n        output[i] = mul23(cos_mod[i], input[k] - input[16 + k]);\n}\n\nstatic void clp_v(int *input, int len)\n{\n    for (int i = 0; i < len; i++)\n        input[i] = clip23(input[i]);\n}\n\nvoid idct_fixed32(int * restrict input, int * restrict output)\n{\n    int mag = 0;\n    for (int i = 0; i < 32; i++)\n        mag += abs(input[i]);\n\n    int shift = mag > 0x400000 ? 2 : 0;\n    int round = shift > 0 ? 1 << (shift - 1) : 0;\n\n    for (int i = 0; i < 32; i++)\n        input[i] = (input[i] + round) >> shift;\n\n    sum_a(input, output +  0, 16);\n    sum_b(input, output + 16, 16);\n    clp_v(output, 32);\n\n    sum_a(output +  0, input +  0, 8);\n    sum_b(output +  0, input +  8, 8);\n    sum_c(output + 16, input + 16, 8);\n    sum_d(output + 16, input + 24, 8);\n    clp_v(input, 32);\n\n    dct_a(input +  0, output +  0);\n    dct_b(input +  8, output +  8);\n    dct_b(input + 16, output + 16);\n    dct_b(input + 24, output + 24);\n    clp_v(output, 32);\n\n    mod_a(output +  0, input +  0);\n    mod_b(output + 16, input + 16);\n    clp_v(input, 32);\n\n    mod_c(input, output);\n\n    for (int i = 0; i < 32; i++)\n        output[i] = clip23(output[i] * (1 << shift));\n}\n\nstatic void mod64_a(const int * restrict input, int * restrict output)\n{\n    //  floor(0.5 / cos((2 * (     i) + 1) * PI / 128) * (1 << 23) + 0.5), i =  0 .. 16\n    // -floor(0.5 / sin((2 * (31 - i) + 1) * PI / 128) * (1 << 23) + 0.5), i = 16 .. 32\n    static const int cos_mod[32] = {\n          4195568,   4205700,   4226086,    4256977,\n          4298755,   4351949,   4417251,    4495537,\n          4587901,   4695690,   4820557,    4964534,\n          5130115,   5320382,   5539164,    5791261,\n         -6082752,  -6421430,  -6817439,   -7284203,\n         -7839855,  -8509474,  -9328732,  -10350140,\n        -11654242, -13371208, -15725922,  -19143224,\n        -24533560, -34264200, -57015280, -170908480\n    };\n\n    for (int i = 0; i < 16; i++)\n        output[i] = mul23(cos_mod[i], input[i] + input[16 + i]);\n\n    for (int i = 16, k = 15; i < 32; i++, k--)\n        output[i] = mul23(cos_mod[i], input[k] - input[16 + k]);\n}\n\nstatic void mod64_b(int * restrict input, int * restrict output)\n{\n    // floor(0.5 / cos((2 * (     i) + 1) * PI / 64) * (1 << 23) + 0.5), i = 0 ..  8\n    // floor(0.5 / sin((2 * (15 - i) + 1) * PI / 64) * (1 << 23) + 0.5), i = 8 .. 16\n    static const int cos_mod[16] = {\n         4199362,  4240198,  4323885,  4454708,\n         4639772,  4890013,  5221943,  5660703,\n         6245623,  7040975,  8158494,  9809974,\n        12450076, 17261920, 28585092, 85479984\n    };\n\n    for (int i = 0; i < 16; i++)\n        input[16 + i] = mul23(cos_mod[i], input[16 + i]);\n\n    for (int i = 0; i < 16; i++)\n        output[i] = input[i] + input[16 + i];\n\n    for (int i = 16, k = 15; i < 32; i++, k--)\n        output[i] = input[k] - input[16 + k];\n}\n\nstatic void mod64_c(const int * restrict input, int * restrict output)\n{\n    //  floor(0.125 / SQRT2 / cos((2 * (     i) + 1) * PI / 256) * (1 << 23) + 0.5), i =  0 .. 32\n    // -floor(0.125 / SQRT2 / sin((2 * (63 - i) + 1) * PI / 256) * (1 << 23) + 0.5), i = 32 .. 64\n    static const int cos_mod[64] = {\n          741511,    741958,    742853,    744199,\n          746001,    748262,    750992,    754197,\n          757888,    762077,    766777,    772003,\n          777772,    784105,    791021,    798546,\n          806707,    815532,    825054,    835311,\n          846342,    858193,    870912,    884554,\n          899181,    914860,    931667,    949686,\n          969011,    989747,   1012012,   1035941,\n        -1061684,  -1089412,  -1119320,  -1151629,\n        -1186595,  -1224511,  -1265719,  -1310613,\n        -1359657,  -1413400,  -1472490,  -1537703,\n        -1609974,  -1690442,  -1780506,  -1881904,\n        -1996824,  -2128058,  -2279225,  -2455101,\n        -2662128,  -2909200,  -3208956,  -3579983,\n        -4050785,  -4667404,  -5509372,  -6726913,\n        -8641940, -12091426, -20144284, -60420720\n    };\n\n    for (int i = 0; i < 32; i++)\n        output[i] = mul23(cos_mod[i], input[i] + input[32 + i]);\n\n    for (int i = 32, k = 31; i < 64; i++, k--)\n        output[i] = mul23(cos_mod[i], input[k] - input[32 + k]);\n}\n\nvoid idct_fixed64(int * restrict input, int * restrict output)\n{\n    int mag = 0;\n    for (int i = 0; i < 64; i++)\n        mag += abs(input[i]);\n\n    int shift = mag > 0x400000 ? 2 : 0;\n    int round = shift > 0 ? 1 << (shift - 1) : 0;\n\n    for (int i = 0; i < 64; i++)\n        input[i] = (input[i] + round) >> shift;\n\n    sum_a(input, output +  0, 32);\n    sum_b(input, output + 32, 32);\n    clp_v(output, 64);\n\n    sum_a(output +  0, input +  0, 16);\n    sum_b(output +  0, input + 16, 16);\n    sum_c(output + 32, input + 32, 16);\n    sum_d(output + 32, input + 48, 16);\n    clp_v(input, 64);\n\n    sum_a(input +  0, output +  0, 8);\n    sum_b(input +  0, output +  8, 8);\n    sum_c(input + 16, output + 16, 8);\n    sum_d(input + 16, output + 24, 8);\n    sum_c(input + 32, output + 32, 8);\n    sum_d(input + 32, output + 40, 8);\n    sum_c(input + 48, output + 48, 8);\n    sum_d(input + 48, output + 56, 8);\n    clp_v(output, 64);\n\n    dct_a(output +  0, input +  0);\n    dct_b(output +  8, input +  8);\n    dct_b(output + 16, input + 16);\n    dct_b(output + 24, input + 24);\n    dct_b(output + 32, input + 32);\n    dct_b(output + 40, input + 40);\n    dct_b(output + 48, input + 48);\n    dct_b(output + 56, input + 56);\n    clp_v(input, 64);\n\n    mod_a(input +  0, output +  0);\n    mod_b(input + 16, output + 16);\n    mod_b(input + 32, output + 32);\n    mod_b(input + 48, output + 48);\n    clp_v(output, 64);\n\n    mod64_a(output +  0, input +  0);\n    mod64_b(output + 32, input + 32);\n    clp_v(input, 64);\n\n    mod64_c(input, output);\n\n    for (int i = 0; i < 64; i++)\n        output[i] = clip23(output[i] * (1 << shift));\n}\n"
  },
  {
    "path": "libdcadec/idct_float.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"common.h\"\n#include \"idct.h\"\n\nstruct idct_context *idct_init(void *parent, int nbits, double scale)\n{\n    int i, j, k, p, base;\n\n    if (nbits < 2 || nbits > IDCT_BITS)\n        return NULL;\n\n    struct idct_context *s = ta_new(parent, struct idct_context);\n    if (!s)\n        return NULL;\n\n    int m = nbits;\n    int n = 1 << m;\n    int n2 = n >> 1;\n    int n4 = n >> 2;\n\n    for (i = base = 0; i < m - 1; i++, base += p) {\n        p = 1 << i;\n        for (j = 0; j < p; j++)\n            s->cs[base + j] = cos(M_PI * (4 * j + 1) * (n4 >> i) / n);\n    }\n\n    for (i = 0; i < n2; i++) {\n        double a = M_PI * (1.0 / (n << 2) + 1.0 * i / (n << 1));\n        s->ac[i] = scale * cos(a);\n        s->as[i] = scale * sin(a);\n    }\n\n    for (i = 1; i < n2 - 1; i++) {\n        for (j = k = 0; j < m - 1; j++)\n            k = (k << 1) | ((i >> j) & 1);\n        s->permute[i] = k;\n    }\n\n    s->nbits = nbits;\n    return s;\n}\n\nstatic void proc(const struct idct_context *s, double *x, int flag)\n{\n    double y[IDCT_SIZE / 2], tmp;\n    int i, j, k, p, q, base;\n\n    int m = s->nbits - 1;\n    int n = 1 << m;\n    int n2 = n >> 1;\n\n    for (i = 0; i < n; i++)\n        y[i] = x[i];\n\n    for (i = m - 2; i >= 0; i--) {\n        int f0 = n >> i;\n        int f1 = f0 >> 1;\n        int f2 = f1 >> 1;\n        int f3 = ((1 << i) - 1) << 1;\n        for (j = f2; j > 0; j--) {\n            for (k = f3; k >= 0; k--) {\n                p = f0 - j + k * f1;\n                q = f1 - j + k * f1;\n                y[q] -= y[p];\n                y[p] += y[p];\n            }\n        }\n    }\n\n    for (i = 1; i < n - 1; i++) {\n        k = s->permute[i];\n        if (i < k) {\n            tmp = y[i];\n            y[i] = y[k];\n            y[k] = tmp;\n        }\n    }\n\n    for (i = base = 0; i < m; i++, base += p) {\n        p = 1 << i;\n        q = 2 << i;\n        for (j = 0; j < p; j++) {\n            for (k = j; k < n; k += q) {\n                tmp = y[k + p] * s->cs[base + j];\n                y[k + p] = y[k] - tmp;\n                y[k] += tmp;\n            }\n        }\n    }\n\n    for (i = 0; i < n2; i++) {\n        x[2 * i] = y[i];\n        if (flag)\n            x[2 * i + 1] = -y[n - 1 - i];\n        else\n            x[2 * i + 1] =  y[n - 1 - i];\n    }\n}\n\nvoid idct_fast(const struct idct_context *s, const double *input, double *output)\n{\n    double a[IDCT_SIZE / 2];\n    double b[IDCT_SIZE / 2];\n    int i;\n\n    int m = s->nbits;\n    int n = 1 << m;\n    int n2 = n >> 1;\n\n    a[0] = input[0];\n    b[0] = input[n - 1];\n    for (i = 1; i < n2; i++) {\n        a[     i] = input[2 * i - 1] + input[2 * i];\n        b[n2 - i] = input[2 * i - 1] - input[2 * i];\n    }\n\n    proc(s, a, 0);\n    proc(s, b, 1);\n\n    for (i = 0; i < n2; i++) {\n        output[    i    ] = a[i] * s->ac[i] + b[i] * s->as[i];\n        output[n - i - 1] = a[i] * s->as[i] - b[i] * s->ac[i];\n    }\n}\n\nvoid imdct_fast(const struct idct_context *s, const float *input, float *output)\n{\n    double a[IDCT_SIZE / 2];\n    double b[IDCT_SIZE / 2];\n    int i;\n\n    int m = s->nbits + 1;\n    int n = 1 << m;\n    int n2 = n >> 1;\n    int n4 = n >> 2;\n\n    a[0] = input[0];\n    b[0] = input[n2 - 1];\n    for (i = 1; i < n4; i++) {\n        a[     i] = input[2 * i - 1] + input[2 * i];\n        b[n4 - i] = input[2 * i - 1] - input[2 * i];\n    }\n\n    proc(s, a, 0);\n    proc(s, b, 1);\n\n    for (i = 0; i < n4; i++) {\n        output[    n4 + i    ] = -a[i] * s->as[i] + b[i] * s->ac[i];\n        output[n - n4 - i - 1] = -a[i] * s->ac[i] - b[i] * s->as[i];\n    }\n\n    for (i = 0; i < n4; i++) {\n        output[    i    ] = -output[n2 - i - 1];\n        output[n - i - 1] =  output[n2 + i    ];\n    }\n}\n"
  },
  {
    "path": "libdcadec/interpolator.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"common.h\"\n#include \"interpolator.h\"\n\nstruct interpolator *interpolator_create(struct idct_context *parent, int flags)\n{\n    struct interpolator *dsp = ta_new(parent, struct interpolator);\n    if (!dsp)\n        return NULL;\n\n    dsp->idct = parent;\n    dsp->history = ta_znew_array_size(dsp,\n        (flags & DCADEC_FLAG_CORE_BIT_EXACT) ? sizeof(int) : sizeof(double),\n        (flags & DCADEC_FLAG_CORE_SYNTH_X96) ? 1024 : 512);\n    if (!dsp->history) {\n        ta_free(dsp);\n        return NULL;\n    }\n\n    if (flags & DCADEC_FLAG_CORE_BIT_EXACT) {\n        if (flags & DCADEC_FLAG_CORE_SYNTH_X96)\n            dsp->interpolate = interpolate_sub64_fixed;\n        else\n            dsp->interpolate = interpolate_sub32_fixed;\n    } else {\n        if (flags & DCADEC_FLAG_CORE_SYNTH_X96)\n            dsp->interpolate = interpolate_sub64_float;\n        else\n            dsp->interpolate = interpolate_sub32_float;\n    }\n\n    return dsp;\n}\n\nvoid interpolator_clear(struct interpolator *dsp)\n{\n    if (dsp)\n        memset(dsp->history, 0, ta_get_size(dsp->history));\n}\n"
  },
  {
    "path": "libdcadec/interpolator.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef INTERPOLATOR_H\n#define INTERPOLATOR_H\n\n#define MAX_LFE_HISTORY     12\n\nstruct interpolator;\nstruct idct_context;\n\ntypedef void (*interpolate_lfe_cb)(int *pcm_samples, int *lfe_samples,\n                                   int npcmblocks, bool dec_select);\n\ntypedef void (*interpolate_sub_cb)(struct interpolator *dsp, int *pcm_samples,\n                                   int **subband_samples_lo,\n                                   int **subband_samples_hi,\n                                   int nsamples, bool perfect);\n\nstruct interpolator {\n    struct idct_context *idct;\n    void *history;\n    interpolate_sub_cb interpolate;\n};\n\nstruct interpolator *interpolator_create(struct idct_context *parent, int flags)\n    __attribute__((cold));\nvoid interpolator_clear(struct interpolator *dsp) __attribute__((cold));\n\n#define INTERPOLATE_LFE(x) \\\n    void interpolate_##x(int *pcm_samples, int *lfe_samples, \\\n                         int npcmblocks, bool dec_select)\n\n#define INTERPOLATE_SUB(x) \\\n    void interpolate_##x(struct interpolator *dsp, int *pcm_samples, \\\n                         int **subband_samples_lo, \\\n                         int **subband_samples_hi, \\\n                         int nsamples, bool perfect)\n\nINTERPOLATE_LFE(lfe_float_fir);\nINTERPOLATE_LFE(lfe_float_fir_2x);\nINTERPOLATE_LFE(lfe_float_iir);\nINTERPOLATE_SUB(sub32_float);\nINTERPOLATE_SUB(sub64_float);\n\nINTERPOLATE_LFE(lfe_fixed_fir);\nINTERPOLATE_SUB(sub32_fixed);\nINTERPOLATE_SUB(sub64_fixed);\n\n#endif\n"
  },
  {
    "path": "libdcadec/interpolator_fixed.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"common.h\"\n#include \"interpolator.h\"\n#include \"idct.h\"\n#include \"fixed_math.h\"\n#include \"fir_fixed.h\"\n\nINTERPOLATE_LFE(lfe_fixed_fir)\n{\n    (void)dec_select;\n    assert(!dec_select);\n\n    // Select decimation factor\n    int nlfesamples = npcmblocks >> 1;\n\n    // Interpolation\n    for (int i = 0; i < nlfesamples; i++) {\n        int *src = lfe_samples + MAX_LFE_HISTORY + i;\n\n        // One decimated sample generates 64 interpolated ones\n        for (int j = 0; j < 32; j++) {\n            // Clear accumulation\n            int64_t res1 = INT64_C(0);\n            int64_t res2 = INT64_C(0);\n\n            // Accumulate\n            for (int k = 0; k < 8; k++) {\n                res1 += (int64_t)lfe_fir_64[      j * 8 + k] * src[-k];\n                res2 += (int64_t)lfe_fir_64[255 - j * 8 - k] * src[-k];\n            }\n\n            // Save interpolated samples\n            pcm_samples[     j] = clip23(norm23(res1));\n            pcm_samples[32 + j] = clip23(norm23(res2));\n        }\n\n        // Advance output pointer\n        pcm_samples += 64;\n    }\n\n    // Update history\n    for (int n = MAX_LFE_HISTORY - 1; n >= MAX_LFE_HISTORY - 8; n--)\n        lfe_samples[n] = lfe_samples[nlfesamples + n];\n}\n\nINTERPOLATE_SUB(sub32_fixed)\n{\n    (void)subband_samples_hi;\n    assert(!subband_samples_hi);\n\n    // Get history pointer\n    int *history = dsp->history;\n\n    // Select filter\n    const int32_t *filter_coeff = perfect ? band_fir_perfect : band_fir_nonperfect;\n\n    // Interpolation begins\n    for (int sample = 0; sample < nsamples; sample++) {\n        int i, j, k;\n\n        // Load in one sample from each subband\n        int input[32];\n        for (i = 0; i < 32; i++)\n            input[i] = subband_samples_lo[i][sample];\n\n        // Inverse DCT\n        int output[32];\n        idct_fixed32(input, output);\n\n        // Store history\n        for (i = 0, k = 31; i < 16; i++, k--) {\n            history[     i] = clip23(output[i] - output[k]);\n            history[16 + i] = clip23(output[i] + output[k]);\n        }\n\n        // One subband sample generates 32 interpolated ones\n        for (i = 0, k = 15; i < 16; i++, k--) {\n            // Clear accumulation\n            int64_t res1 = INT64_C(0);\n            int64_t res2 = INT64_C(0);\n\n            // Accumulate\n            for (j = 32; j < 512; j += 64) {\n                res1 += (int64_t)history[16 + i + j] * filter_coeff[     i + j];\n                res2 += (int64_t)history[16 + k + j] * filter_coeff[16 + i + j];\n            }\n\n            res1 = round21(res1);\n            res2 = round21(res2);\n\n            for (j = 0; j < 512; j += 64) {\n                res1 += (int64_t)history[i + j] * filter_coeff[     i + j];\n                res2 += (int64_t)history[k + j] * filter_coeff[16 + i + j];\n            }\n\n            // Save interpolated samples\n            pcm_samples[     i] = clip23(norm21(res1));\n            pcm_samples[16 + i] = clip23(norm21(res2));\n        }\n\n        // Advance output pointer\n        pcm_samples += 32;\n\n        // Shift history\n        for (i = 511; i >= 32; i--)\n            history[i] = history[i - 32];\n    }\n}\n\nINTERPOLATE_SUB(sub64_fixed)\n{\n    (void)perfect;\n\n    // Get history pointer\n    int *history = dsp->history;\n\n    // Interpolation begins\n    for (int sample = 0; sample < nsamples; sample++) {\n        int i, j, k;\n\n        // Load in one sample from each subband\n        int input[64];\n        if (subband_samples_hi) {\n            // Full 64 subbands, first 32 are residual coded\n            for (i =  0; i < 32; i++)\n                input[i] = subband_samples_lo[i][sample] + subband_samples_hi[i][sample];\n            for (i = 32; i < 64; i++)\n                input[i] = subband_samples_hi[i][sample];\n        } else {\n            // Only first 32 subbands\n            for (i =  0; i < 32; i++)\n                input[i] = subband_samples_lo[i][sample];\n            for (i = 32; i < 64; i++)\n                input[i] = 0;\n        }\n\n        // Inverse DCT\n        int output[64];\n        idct_fixed64(input, output);\n\n        // Store history\n        for (i = 0, k = 63; i < 32; i++, k--) {\n            history[     i] = clip23(output[i] - output[k]);\n            history[32 + i] = clip23(output[i] + output[k]);\n        }\n\n        // One subband sample generates 64 interpolated ones\n        for (i = 0, k = 31; i < 32; i++, k--) {\n            // Clear accumulation\n            int64_t res1 = INT64_C(0);\n            int64_t res2 = INT64_C(0);\n\n            // Accumulate\n            for (j = 64; j < 1024; j += 128) {\n                res1 += (int64_t)history[32 + i + j] * band_fir_x96[     i + j];\n                res2 += (int64_t)history[32 + k + j] * band_fir_x96[32 + i + j];\n            }\n\n            res1 = round20(res1);\n            res2 = round20(res2);\n\n            for (j = 0; j < 1024; j += 128) {\n                res1 += (int64_t)history[i + j] * band_fir_x96[     i + j];\n                res2 += (int64_t)history[k + j] * band_fir_x96[32 + i + j];\n            }\n\n            // Save interpolated samples\n            pcm_samples[     i] = clip23(norm20(res1));\n            pcm_samples[32 + i] = clip23(norm20(res2));\n        }\n\n        // Advance output pointer\n        pcm_samples += 64;\n\n        // Shift history\n        for (i = 1023; i >= 64; i--)\n            history[i] = history[i - 64];\n    }\n}\n"
  },
  {
    "path": "libdcadec/interpolator_float.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"common.h\"\n#include \"interpolator.h\"\n#include \"idct.h\"\n#include \"fixed_math.h\"\n#include \"fir_float.h\"\n\nstatic const double lfe_iir_scale = 0.001985816114019982;\n\nstatic const double lfe_iir[12] = {\n    -0.9698530866436986,  1.9696040724997900,  0.9999999999999996,\n    -1.9643358221499630, -0.9787938538720836,  1.9785545764679620,\n     1.0000000000000020, -1.9951847249255470, -0.9925096137076496,\n     1.9922787089263100,  1.0000000000000000, -1.9974180593495760\n};\n\nstatic inline int convert(double a)\n{\n    return clip23(lrint(a));\n}\n\nstatic void interpolate_lfe(int *pcm_samples, int *lfe_samples, int npcmblocks,\n                            const double *filter_coeff, bool dec_select)\n{\n    // Select decimation factor\n    int factor = 64 << dec_select;\n    int ncoeffs = 8 >> dec_select;\n    int nlfesamples = npcmblocks >> (dec_select + 1);\n\n    // Interpolation\n    for (int i = 0; i < nlfesamples; i++) {\n        int *src = lfe_samples + MAX_LFE_HISTORY + i;\n\n        // One decimated sample generates 64 or 128 interpolated ones\n        for (int j = 0; j < factor / 2; j++) {\n            // Clear accumulation\n            double res1 = 0.0;\n            double res2 = 0.0;\n\n            // Accumulate\n            for (int k = 0; k < ncoeffs; k++) {\n                res1 += filter_coeff[      j * ncoeffs + k] * src[-k];\n                res2 += filter_coeff[255 - j * ncoeffs - k] * src[-k];\n            }\n\n            // Save interpolated samples\n            pcm_samples[             j] = convert(res1);\n            pcm_samples[factor / 2 + j] = convert(res2);\n        }\n\n        // Advance output pointer\n        pcm_samples += factor;\n    }\n\n    // Update history\n    for (int n = MAX_LFE_HISTORY - 1; n >= MAX_LFE_HISTORY - 8; n--)\n        lfe_samples[n] = lfe_samples[nlfesamples + n];\n}\n\nINTERPOLATE_LFE(lfe_float_fir)\n{\n    (void)dec_select;\n    assert(!dec_select);\n\n    interpolate_lfe(pcm_samples, lfe_samples, npcmblocks, lfe_fir_64, false);\n}\n\nINTERPOLATE_LFE(lfe_float_fir_2x)\n{\n    (void)dec_select;\n    assert(dec_select);\n\n    interpolate_lfe(pcm_samples, lfe_samples, npcmblocks, lfe_fir_128, true);\n}\n\nINTERPOLATE_LFE(lfe_float_iir)\n{\n    // Select decimation factor\n    int factor = 64 << dec_select;\n    int nlfesamples = npcmblocks >> (dec_select + 1);\n\n    // Load history\n    double lfe_history[6];\n    for (int i = 0; i < 6; i++)\n        lfe_history[i] = ((double *)lfe_samples)[i];\n\n    // Interpolation\n    for (int i = 0; i < nlfesamples; i++) {\n        double res1 = lfe_samples[MAX_LFE_HISTORY + i] * lfe_iir_scale;\n        double res2;\n\n        // One decimated sample generates 64 or 128 interpolated ones\n        for (int j = 0; j < factor; j++) {\n            // Filter\n            for (int k = 0; k < 3; k++) {\n                double tmp1 = lfe_history[k * 2 + 0];\n                double tmp2 = lfe_history[k * 2 + 1];\n\n                res2 = tmp1 * lfe_iir[k * 4 + 0] + tmp2 * lfe_iir[k * 4 + 1] + res1;\n                res1 = tmp1 * lfe_iir[k * 4 + 2] + tmp2 * lfe_iir[k * 4 + 3] + res2;\n\n                lfe_history[k * 2 + 0] = tmp2;\n                lfe_history[k * 2 + 1] = res2;\n            }\n\n            // Save interpolated samples\n            *pcm_samples++ = convert(res1);\n            res1 = 0.0;\n        }\n    }\n\n    // Store history\n    for (int i = 0; i < 6; i++)\n        ((double *)lfe_samples)[i] = lfe_history[i];\n}\n\nINTERPOLATE_SUB(sub32_float)\n{\n    (void)subband_samples_hi;\n    assert(!subband_samples_hi);\n\n    // Get history pointer\n    double *history = dsp->history;\n\n    // Select filter\n    const double *filter_coeff = perfect ? band_fir_perfect : band_fir_nonperfect;\n\n    // Interpolation begins\n    for (int sample = 0; sample < nsamples; sample++) {\n        int i, j, k;\n\n        // Load in one sample from each subband\n        double input[32];\n        for (i = 0; i < 32; i++)\n            input[i] = subband_samples_lo[i][sample];\n\n        // Inverse DCT\n        double output[32];\n        idct_fast(dsp->idct, input, output);\n\n        // Store history\n        for (i = 0, k = 31; i < 16; i++, k--) {\n            history[     i] = output[i] - output[k];\n            history[16 + i] = output[i] + output[k];\n        }\n\n        // One subband sample generates 32 interpolated ones\n        for (i = 0, k = 15; i < 16; i++, k--) {\n            // Clear accumulation\n            double res1 = 0.0;\n            double res2 = 0.0;\n\n            // Accumulate\n            for (j = 0; j < 512; j += 64) {\n                res1 += history[i + j] * filter_coeff[     i + j];\n                res2 += history[k + j] * filter_coeff[16 + i + j];\n            }\n\n            for (j = 32; j < 512; j += 64) {\n                res1 += history[16 + i + j] * filter_coeff[     i + j];\n                res2 += history[16 + k + j] * filter_coeff[16 + i + j];\n            }\n\n            // Save interpolated samples\n            pcm_samples[     i] = convert(res1);\n            pcm_samples[16 + i] = convert(res2);\n        }\n\n        // Advance output pointer\n        pcm_samples += 32;\n\n        // Shift history\n        for (i = 511; i >= 32; i--)\n            history[i] = history[i - 32];\n    }\n}\n\nINTERPOLATE_SUB(sub64_float)\n{\n    (void)perfect;\n\n    // Get history pointer\n    double *history = dsp->history;\n\n    // Interpolation begins\n    for (int sample = 0; sample < nsamples; sample++) {\n        int i, j, k;\n\n        // Load in one sample from each subband\n        double input[64];\n        if (subband_samples_hi) {\n            // Full 64 subbands, first 32 are residual coded\n            for (i =  0; i < 32; i++)\n                input[i] = subband_samples_lo[i][sample] + subband_samples_hi[i][sample];\n            for (i = 32; i < 64; i++)\n                input[i] = subband_samples_hi[i][sample];\n        } else {\n            // Only first 32 subbands\n            for (i =  0; i < 32; i++)\n                input[i] = subband_samples_lo[i][sample];\n            for (i = 32; i < 64; i++)\n                input[i] = 0;\n        }\n\n        // Inverse DCT\n        double output[64];\n        idct_fast(dsp->idct, input, output);\n\n        // Store history\n        for (i = 0, k = 63; i < 32; i++, k--) {\n            history[     i] = output[i] - output[k];\n            history[32 + i] = output[i] + output[k];\n        }\n\n        // One subband sample generates 64 interpolated ones\n        for (i = 0, k = 31; i < 32; i++, k--) {\n            // Clear accumulation\n            double res1 = 0.0;\n            double res2 = 0.0;\n\n            // Accumulate\n            for (j = 0; j < 1024; j += 128) {\n                res1 += history[i + j] * band_fir_x96[     i + j];\n                res2 += history[k + j] * band_fir_x96[32 + i + j];\n            }\n\n            for (j = 64; j < 1024; j += 128) {\n                res1 += history[32 + i + j] * band_fir_x96[     i + j];\n                res2 += history[32 + k + j] * band_fir_x96[32 + i + j];\n            }\n\n            // Save interpolated samples\n            pcm_samples[     i] = convert(res1);\n            pcm_samples[32 + i] = convert(res2);\n        }\n\n        // Advance output pointer\n        pcm_samples += 64;\n\n        // Shift history\n        for (i = 1023; i >= 64; i--)\n            history[i] = history[i - 64];\n    }\n}\n"
  },
  {
    "path": "libdcadec/lbr_bitstream.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\nstruct bytestream {\n    uint8_t *data;\n    int total;\n    int index;\n};\n\nstatic void bits2_init(struct bitstream2 *bits, uint8_t *data, size_t size)\n{\n    bits->data = data;\n    bits->index = 0;\n    bits->accum = 0;\n    bits->avail = 0;\n    bits->count = size << 3;\n}\n\nstatic int bits2_peek(struct bitstream2 *bits, int n)\n{\n    assert(n > 0 && n <= 32);\n\n    while (bits->avail < n) {\n        bits->accum |= bits->data[bits->index++] << bits->avail;\n        bits->avail += 8;\n    }\n\n    return bits->accum & (0xffffffff >> (32 - n));\n}\n\nstatic void bits2_skip(struct bitstream2 *bits, int n)\n{\n    assert(n > 0 && n <= bits->avail);\n\n    bits->accum >>= n;\n    bits->avail -= n;\n    bits->count -= n;\n}\n\nstatic int bits2_get(struct bitstream2 *bits, int n)\n{\n    int v = bits2_peek(bits, n);\n    bits2_skip(bits, n);\n    return v;\n}\n\nstatic int bits2_getz(struct bitstream2 *bits, int n)\n{\n    if (n == 0)\n        return 0;\n    return bits2_get(bits, n);\n}\n\nstatic bool bits2_get1(struct bitstream2 *bits)\n{\n    return bits2_get(bits, 1);\n}\n\n#if 0\nstatic void bits2_skip_long(struct bitstream2 *bits, int n)\n{\n    if (n > bits->count)\n        n = bits->count;\n\n    bits->count -= n;\n\n    if (n <= bits->avail) {\n        bits->accum >>= n;\n        bits->avail -= n;\n        return;\n    }\n\n    n -= bits->avail;\n    bits->index += n >> 3;\n    bits->accum = 0;\n    bits->avail = 0;\n\n    n &= 7;\n    if (n) {\n        bits->accum = bits->data[bits->index++] >> n;\n        bits->avail = 8 - n;\n    }\n}\n#endif\n\nstatic int bits2_get_vlc(struct bitstream2 *bits, const uint8_t *table, size_t size)\n{\n    size_t index = 0;\n\n    assert(size && !(size & 1));\n    while (table[index] != 0xff) {\n        if (bits->count < 1)\n            return -1;\n        assert(table[index] == 1);\n        index += 2 * table[index + bits2_get1(bits)];\n        if (index >= size)\n            return -1;\n    }\n\n    if (table[index + 1])\n        return table[index + 1] - 1;\n\n    if (bits->count < 3)\n        return -1;\n\n    int n = bits2_get(bits, 3) + 1;\n    if (bits->count < n)\n        return -1;\n\n    return bits2_get(bits, n);\n}\n\nstatic void bytes_init(struct bytestream *bytes, uint8_t *data, size_t size)\n{\n    bytes->data = data;\n    bytes->total = size;\n    bytes->index = 0;\n}\n\nstatic int bytes_get(struct bytestream *bytes)\n{\n    uint8_t v = 0;\n\n    if (bytes->index < bytes->total)\n        v = bytes->data[bytes->index];\n\n    bytes->index++;\n    return v;\n}\n\nstatic int bytes_get16le(struct bytestream *bytes)\n{\n    uint16_t v = 0;\n\n    if (bytes->index + 1 < bytes->total)\n        v = DCA_MEM16LE(&bytes->data[bytes->index]);\n\n    bytes->index += 2;\n    return v;\n}\n\nstatic int bytes_get16be(struct bytestream *bytes)\n{\n    uint16_t v = 0;\n\n    if (bytes->index + 1 < bytes->total)\n        v = DCA_MEM16BE(&bytes->data[bytes->index]);\n\n    bytes->index += 2;\n    return v;\n}\n\nstatic int bytes_get32be(struct bytestream *bytes)\n{\n    uint32_t v = 0;\n\n    if (bytes->index + 3 < bytes->total)\n        v = DCA_MEM32BE(&bytes->data[bytes->index]);\n\n    bytes->index += 4;\n    return v;\n}\n"
  },
  {
    "path": "libdcadec/lbr_decoder.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"common.h\"\n#include \"exss_parser.h\"\n#include \"lbr_decoder.h\"\n#include \"idct.h\"\n\n#include \"lbr_bitstream.h\"\n#include \"lbr_tables.h\"\n#include \"lbr_huffman.h\"\n\n#include \"fixed_math.h\"\n\nenum LBRHeader {\n    LBR_HEADER_SYNC_ONLY    = 1,\n    LBR_HEADER_DECODER_INIT = 2\n};\n\nenum LBRFlags {\n    LBR_FLAG_24_BIT             = 0x01,\n    LBR_FLAG_LFE_PRESENT        = 0x02,\n    LBR_FLAG_BAND_LIMIT_2_3     = 0x04,\n    LBR_FLAG_BAND_LIMIT_1_2     = 0x08,\n    LBR_FLAG_BAND_LIMIT_1_3     = 0x0c,\n    LBR_FLAG_BAND_LIMIT_1_4     = 0x10,\n    LBR_FLAG_BAND_LIMIT_1_8     = 0x18,\n    LBR_FLAG_BAND_LIMIT_NONE    = 0x14,\n    LBR_FLAG_BAND_LIMIT_MASK    = 0x1c,\n    LBR_FLAG_DMIX_STEREO        = 0x20,\n    LBR_FLAG_DMIX_MULTI_CH      = 0x40\n};\n\nenum LBRChunks {\n    LBR_CHUNK_NULL              = 0x00,\n    LBR_CHUNK_PAD               = 0x01,\n    LBR_CHUNK_FRAME             = 0x04,\n    LBR_CHUNK_FRAME_NO_CSUM     = 0x06,\n    LBR_CHUNK_LFE               = 0x0a,\n    LBR_CHUNK_ECS               = 0x0b,\n    LBR_CHUNK_RESERVED_1        = 0x0c,\n    LBR_CHUNK_RESERVED_2        = 0x0d,\n    LBR_CHUNK_SCF               = 0x0e,\n    LBR_CHUNK_TONAL             = 0x10,\n    LBR_CHUNK_TONAL_GRP_1       = 0x11,\n    LBR_CHUNK_TONAL_GRP_2       = 0x12,\n    LBR_CHUNK_TONAL_GRP_3       = 0x13,\n    LBR_CHUNK_TONAL_GRP_4       = 0x14,\n    LBR_CHUNK_TONAL_GRP_5       = 0x15,\n    LBR_CHUNK_TONAL_SCF         = 0x16,\n    LBR_CHUNK_TONAL_SCF_GRP_1   = 0x17,\n    LBR_CHUNK_TONAL_SCF_GRP_2   = 0x18,\n    LBR_CHUNK_TONAL_SCF_GRP_3   = 0x19,\n    LBR_CHUNK_TONAL_SCF_GRP_4   = 0x1a,\n    LBR_CHUNK_TONAL_SCF_GRP_5   = 0x1b,\n    LBR_CHUNK_RES_GRID_LR       = 0x30,\n    LBR_CHUNK_RES_GRID_LR_LAST  = 0x3f,\n    LBR_CHUNK_RES_GRID_HR       = 0x40,\n    LBR_CHUNK_RES_GRID_HR_LAST  = 0x4f,\n    LBR_CHUNK_RES_TS_1          = 0x50,\n    LBR_CHUNK_RES_TS_1_LAST     = 0x5f,\n    LBR_CHUNK_RES_TS_2          = 0x60,\n    LBR_CHUNK_RES_TS_2_LAST     = 0x6f,\n    LBR_CHUNK_EXTENSION         = 0x7f\n};\n\nstruct lbr_chunk {\n    int id, len;\n    uint8_t *data;\n};\n\nstatic int parse_lfe_24(struct lbr_decoder *lbr)\n{\n    int ps = bits2_get(&lbr->bits, 24);\n    int si = ps >> 23;\n\n    float value = (((ps & 0x7fffff) ^ -si) + si) * (1.0 / 0x7fffff);\n\n    int step_i = bits2_get(&lbr->bits, 8);\n    if (step_i > 143)\n        return -1;\n\n    float step = lfe_step_size_24[step_i];\n\n    for (int i = 0; i < 64; i++) {\n        int code = bits2_get(&lbr->bits, 6);\n\n        float delta = step * 0.03125;\n        if (code & 16)\n            delta += step;\n        if (code & 8)\n            delta += step * 0.5;\n        if (code & 4)\n            delta += step * 0.25;\n        if (code & 2)\n            delta += step * 0.125;\n        if (code & 1)\n            delta += step * 0.0625;\n\n        if (code & 32) {\n            value -= delta;\n            if (value < -3.0)\n                value = -3.0;\n        } else {\n            value += delta;\n            if (value > 3.0)\n                value = 3.0;\n        }\n\n        step_i += lfe_delta_index_24[code & 31];\n        if (step_i < 0)\n            step_i = 0;\n        else if (step_i > 143)\n            step_i = 143;\n\n        step = lfe_step_size_24[step_i];\n        lbr->lfe_data[i] = value;\n    }\n\n    return 0;\n}\n\nstatic int parse_lfe_16(struct lbr_decoder *lbr)\n{\n    int ps = bits2_get(&lbr->bits, 16);\n    int si = ps >> 15;\n\n    float value = (((ps & 0x7fff) ^ -si) + si) * (1.0 / 0x7fff);\n\n    int step_i = bits2_get(&lbr->bits, 8);\n    if (step_i > 100)\n        return -1;\n\n    float step = lfe_step_size_16[step_i];\n\n    for (int i = 0; i < 64; i++) {\n        int code = bits2_get(&lbr->bits, 4);\n\n        float delta = step * 0.125;\n        if (code & 4)\n            delta += step;\n        if (code & 2)\n            delta += step * 0.5;\n        if (code & 1)\n            delta += step * 0.25;\n\n        if (code & 8) {\n            value -= delta;\n            if (value < -3.0)\n                value = -3.0;\n        } else {\n            value += delta;\n            if (value > 3.0)\n                value = 3.0;\n        }\n\n        step_i += lfe_delta_index_16[code & 7];\n        if (step_i < 0)\n            step_i = 0;\n        else if (step_i > 100)\n            step_i = 100;\n\n        step = lfe_step_size_16[step_i];\n        lbr->lfe_data[i] = value;\n    }\n\n    return 0;\n}\n\nstatic int parse_lfe_chunk(struct lbr_decoder *lbr, struct lbr_chunk *chunk)\n{\n    if (!chunk->len)\n        return 0;\n\n    bits2_init(&lbr->bits, chunk->data, chunk->len);\n\n    if (chunk->len >= 52)\n        return parse_lfe_24(lbr);\n    if (chunk->len >= 35)\n        return parse_lfe_16(lbr);\n\n    lbr_warn(\"LFE chunk too small\");\n    return 0;\n}\n\nstatic int parse_ecs_chunk(struct lbr_decoder *lbr, struct lbr_chunk *chunk)\n{\n    if (chunk->len < 2)\n        return 0;\n\n    bits2_init(&lbr->bits, chunk->data, chunk->len);\n\n    int start_sb = bits2_get(&lbr->bits, 7);\n    int end_sb = bits2_get(&lbr->bits, 7);\n\n    if (end_sb < start_sb || end_sb > lbr->nsubbands)\n        return -1;\n\n    for (int i = 0; i < lbr->nchannels * lbr->nsubbands * 4; i++) {\n        int sb = (i / 4) & (lbr->nsubbands - 1);\n        if (sb >= start_sb && sb < end_sb && bits2_get1(&lbr->bits)) {\n            DCA_SET_BIT(lbr->can_replace_sf, i);\n            if (bits2_get1(&lbr->bits))\n                DCA_SET_BIT(lbr->can_replace_ch, i);\n            if (lbr->bits.count < 2)\n                break;\n        }\n    }\n\n    return 0;\n}\n\nstatic int parse_tonal(struct lbr_decoder *lbr, int group)\n{\n    int first_ch = lbr->undo_dmix * 2;\n    int amp[LBR_CHANNELS];\n    int phs[LBR_CHANNELS];\n    unsigned int diff;\n\n    for (int sf = 0; sf < 1 << group; sf += diff ? 8 : 1) {\n        int sf_idx = ((lbr->framenum << group) + sf) & 31;\n        lbr->tonal_bounds[group][sf_idx][0] = lbr->ntones;\n\n        for (int freq = 1;; freq++) {\n            diff = bits2_get_vlc(&lbr->bits, huff_tnl_grp[group], huff_tnl_size[group]);\n            if (diff >= dca_countof(fst_amp))\n                return -1;\n\n            diff = bits2_getz(&lbr->bits, diff >> 2) + fst_amp[diff];\n            if (diff <= 1)\n                break;\n\n            freq += diff - 2;\n            if (freq >> (5 - group) > lbr->nsubbands * 4 - 5)\n                return -1;\n\n            int main_ch = bits2_getz(&lbr->bits, bits_for_ch_num[lbr->nchannels_total - 1]);\n            int value = bits2_get_vlc(&lbr->bits, huff_tnl_scf, sizeof(huff_tnl_scf));\n            if (value < 0)\n                return -1;\n\n            value += lbr->tonal_scf[freq_to_sf[freq >> (7 - group)]];\n            value += lbr->limited_range - 2;\n            if (value > 55)\n                return -1;\n            if (value < 0)\n                value = 0;\n\n            amp[main_ch] = value;\n            phs[main_ch] = bits2_get(&lbr->bits, 3);\n\n            for (int ch = 0; ch < lbr->nchannels_total; ch++) {\n                if (ch == main_ch)\n                    continue;\n\n                if (bits2_get1(&lbr->bits)) {\n                    if ((value = bits2_get_vlc(&lbr->bits, huff_damp, sizeof(huff_damp))) < 0)\n                        return -1;\n                    value = amp[main_ch] - value;\n                    if (value < 0)\n                        value = 0;\n                    amp[ch] = value;\n\n                    if ((value = bits2_get_vlc(&lbr->bits, huff_dph, sizeof(huff_dph))) < 0)\n                        return -1;\n                    phs[ch] = (phs[main_ch] - value) & 7;\n                } else {\n                    amp[ch] = 0;\n                    phs[ch] = 0;\n                }\n            }\n\n            struct lbr_tone *t = &lbr->tones[lbr->ntones];\n            lbr->ntones = (lbr->ntones + 1) & (LBR_TONES - 1);\n\n            t->x_freq = freq >> (5 - group);\n            t->f_delt = (freq & ((1 << (5 - group)) - 1)) << group;\n            t->ph_rot = 256 - (t->x_freq & 1) * 128 - t->f_delt * 4;\n\n            value = ph0_shift[(t->x_freq & 3) * 2 + (freq & 1)];\n            value -= (t->ph_rot << (5 - group)) - t->ph_rot;\n\n            for (int ch = 0; ch < lbr->nchannels; ch++) {\n                t->amp[ch] = amp[first_ch + ch];\n                t->phs[ch] = 128 - phs[first_ch + ch] * 32 + value;\n            }\n        }\n\n        lbr->tonal_bounds[group][sf_idx][1] = lbr->ntones;\n    }\n\n    return 0;\n}\n\nstatic int parse_tonal_chunk(struct lbr_decoder *lbr, struct lbr_chunk *chunk)\n{\n    if (!chunk->len)\n        return 0;\n\n    bits2_init(&lbr->bits, chunk->data, chunk->len);\n\n    if (chunk->id == LBR_CHUNK_SCF || chunk->id == LBR_CHUNK_TONAL_SCF) {\n        if (lbr->bits.count < 36)\n            return -1;\n        for (int sb = 0; sb < 6; sb++) {\n            lbr->tonal_scf[sb] = bits2_get(&lbr->bits, 6);\n            if (lbr->tonal_scf[sb] > 55)\n                return -1;\n        }\n    }\n\n    if (chunk->id == LBR_CHUNK_TONAL || chunk->id == LBR_CHUNK_TONAL_SCF)\n        for (int group = 0; group < 5; group++)\n            if (parse_tonal(lbr, group) < 0)\n                return -1;\n\n    return 0;\n}\n\nstatic int parse_tonal_group(struct lbr_decoder *lbr, struct lbr_chunk *chunk)\n{\n    if (!chunk->len)\n        return 0;\n\n    bits2_init(&lbr->bits, chunk->data, chunk->len);\n\n    return parse_tonal(lbr, chunk->id);\n}\n\nstatic int parse_scale_factors(struct lbr_decoder *lbr, uint8_t *scf)\n{\n    int sf = 0, prev, next, dist;\n\n    if (lbr->bits.count < 20)\n        return 0;\n    if ((prev = bits2_get_vlc(&lbr->bits, huff_fst_rsd_amp, sizeof(huff_fst_rsd_amp))) < 0)\n        return -1;\n    if (prev > 56)\n        return -1;\n\n    scf[sf] = prev;\n\n    while (true) {\n        if (lbr->bits.count < 20)\n            return 0;\n        if ((dist = bits2_get_vlc(&lbr->bits, huff_rsd_apprx, sizeof(huff_rsd_apprx))) < 0)\n            return -1;\n        dist++;\n        if (sf + dist > 7)\n            return -1;\n\n        if (lbr->bits.count < 20)\n            return 0;\n        if ((next = bits2_get_vlc(&lbr->bits, huff_rsd_amp, sizeof(huff_rsd_amp))) < 0)\n            return -1;\n        if (next > 112)\n            return -1;\n\n        if (next & 1)\n            next = prev + ((next + 1) >> 1);\n        else\n            next = prev - ( next      >> 1);\n\n        switch (dist) {\n        case 2:\n            if (next > prev)\n                scf[sf + 1] = prev + ((next - prev) >> 1);\n            else\n                scf[sf + 1] = prev - ((prev - next) >> 1);\n            break;\n\n        case 4:\n            if (next > prev) {\n                scf[sf + 1] = prev + ( (next - prev)      >> 2);\n                scf[sf + 2] = prev + ( (next - prev)      >> 1);\n                scf[sf + 3] = prev + (((next - prev) * 3) >> 2);\n            } else {\n                scf[sf + 1] = prev - ( (prev - next)      >> 2);\n                scf[sf + 2] = prev - ( (prev - next)      >> 1);\n                scf[sf + 3] = prev - (((prev - next) * 3) >> 2);\n            }\n            break;\n\n        default:\n            for (int i = 1; i < dist; i++)\n                scf[sf + i] = prev + (next - prev) * i / dist;\n            break;\n        }\n\n        scf[sf += dist] = next;\n        if (sf == 7)\n            break;\n\n        prev = next;\n    }\n\n    return 0;\n}\n\nstatic int parse_st_code(struct bitstream2 *bits, int min_v)\n{\n    int v;\n\n    if ((v = bits2_get_vlc(bits, huff_st_grid, sizeof(huff_st_grid))) < 0)\n        return -1;\n    if (v > 31)\n        return -1;\n\n    v += min_v;\n    if (v & 1)\n        v = 16 + (v >> 1);\n    else\n        v = 16 - (v >> 1);\n\n    if (v > 33)\n        v = 16;\n    return v;\n}\n\nstatic int parse_grid_1_chunk(struct lbr_decoder *lbr, struct lbr_chunk *chunk, int ch1, int ch2)\n{\n    int ch, sb, sf, value;\n\n    if (chunk->len < 3)\n        return 0;\n\n    bits2_init(&lbr->bits, chunk->data, chunk->len);\n\n    // Scale factors\n    int nsubbands = scf_to_grid_1[lbr->nsubbands - 1] + 1;\n    for (sb = 2; sb < nsubbands; sb++) {\n        if (parse_scale_factors(lbr, lbr->grid_1_scf[ch1][sb]) < 0)\n            return -1;\n        if (ch1 != ch2 && grid_1_to_scf[sb] < lbr->min_mono_subband)\n            if (parse_scale_factors(lbr, lbr->grid_1_scf[ch2][sb]) < 0)\n                return -1;\n    }\n\n    if (lbr->bits.count < 20)\n        return 0;\n\n    // Average values for third grid\n    for (sb = 0; sb < lbr->nsubbands - 4; sb++) {\n        if ((value = bits2_get_vlc(&lbr->bits, huff_avg_g3, sizeof(huff_avg_g3))) < 0)\n            return -1;\n        if (value > 72)\n            return -1;\n        lbr->grid_3_avg[ch1][sb] = value - 16;\n        if (ch1 != ch2) {\n            if (sb + 4 < lbr->min_mono_subband) {\n                if ((value = bits2_get_vlc(&lbr->bits, huff_avg_g3, sizeof(huff_avg_g3))) < 0)\n                    return -1;\n                if (value > 72)\n                    return -1;\n                lbr->grid_3_avg[ch2][sb] = value - 16;\n            } else {\n                lbr->grid_3_avg[ch2][sb] = lbr->grid_3_avg[ch1][sb];\n            }\n        }\n    }\n\n    if (lbr->bits.count < 8)\n        return 0;\n\n    // Stereo image for partial mono mode\n    if (ch1 != ch2) {\n        int min_v[2];\n\n        min_v[0] = bits2_get(&lbr->bits, 4);\n        min_v[1] = bits2_get(&lbr->bits, 4);\n\n        int nsubbands = (lbr->nsubbands - lbr->min_mono_subband + 3) / 4;\n        for (sb = 0; sb < nsubbands; sb++) {\n            for (ch = ch1; ch <= ch2; ch++) {\n                for (sf = 1; sf <= 4; sf++) {\n                    if ((value = parse_st_code(&lbr->bits, min_v[ch - ch1])) < 0)\n                        return -1;\n                    lbr->part_stereo[ch][sb][sf] = value;\n                }\n            }\n        }\n        if (lbr->bits.count >= 0)\n            lbr->part_stereo_pres |= 1 << ch1;\n    }\n\n    if (lbr->bits.count < 8)\n        return 0;\n\n    // Low resolution spatial information\n    if (ch1 == 0) {\n        for (ch = 2; ch < lbr->nchannels; ch++) {\n            if (lbr->bits.count < 8)\n                break;\n            int min_v = bits2_get(&lbr->bits, 4);\n            for (sb = 0; sb < lbr->nsubbands / 4; sb++) {\n                for (sf = 1; sf <= 4; sf++) {\n                    if ((value = parse_st_code(&lbr->bits, min_v)) < 0)\n                        return -1;\n                    lbr->spatial_info[ch - 2][sb][sf] = value;\n                }\n            }\n            if (lbr->bits.count >= 0)\n                lbr->spatial_info_pres |= 1 << ch;\n        }\n    }\n\n    return 0;\n}\n\nstatic int parse_grid_1_sec_ch(struct lbr_decoder *lbr, int ch2)\n{\n    int value;\n\n    if (lbr->bits.count < 20)\n        return 0;\n\n    // Scale factors\n    int nsubbands = scf_to_grid_1[lbr->nsubbands - 1] + 1;\n    for (int sb = 2; sb < nsubbands; sb++) {\n        if (grid_1_to_scf[sb] >= lbr->min_mono_subband)\n            if (parse_scale_factors(lbr, lbr->grid_1_scf[ch2][sb]) < 0)\n                return -1;\n    }\n\n    if (lbr->bits.count < 20)\n        return 0;\n\n    // Average values for third grid\n    for (int sb = 0; sb < lbr->nsubbands - 4; sb++) {\n        if (sb + 4 >= lbr->min_mono_subband) {\n            if ((value = bits2_get_vlc(&lbr->bits, huff_avg_g3, sizeof(huff_avg_g3))) < 0)\n                return -1;\n            if (value > 72)\n                return -1;\n            lbr->grid_3_avg[ch2][sb] = value - 16;\n            if (lbr->bits.count < 20)\n                break;\n        }\n    }\n\n    return 0;\n}\n\nstatic int parse_grid_code(struct bitstream2 *bits, const uint8_t *table, int n)\n{\n    int v = table[bits2_peek(bits, n)];\n    bits2_skip(bits, v >> 5);\n    return v & 31;\n}\n\nstatic int parse_grid_3_code(struct bitstream2 *bits)\n{\n    int v;\n\n    if ((v = parse_grid_code(bits, grid_3_codes_1, 5)) < 31)\n        return v;\n    if ((v = parse_grid_code(bits, grid_3_codes_2, 3)) < 31)\n        return v;\n    if ((v = parse_grid_code(bits, grid_3_codes_3, 4)) < 31)\n        return v;\n\n    v = bits2_get(bits, bits2_get(bits, 3) + 1);\n    if (v > 56)\n        v = 16;\n    return v;\n}\n\nstatic void parse_grid_3(struct lbr_decoder *lbr, int ch1, int ch2, int sb, bool flag)\n{\n    for (int ch = ch1; ch <= ch2; ch++) {\n        if ((ch != ch1 && sb + 4 >= lbr->min_mono_subband) != flag)\n            continue;\n\n        if (lbr->grid_3_pres[ch] & (1U << sb))\n            continue;\n\n        for (int i = 0; i < 8; i++) {\n            if (lbr->bits.count < 20)\n                return;\n            lbr->grid_3_scf[ch][sb][i] = parse_grid_3_code(&lbr->bits) - 16;\n        }\n\n        lbr->grid_3_pres[ch] |= 1U << sb;\n    }\n}\n\nstatic float lbr_rand(struct lbr_decoder *lbr, int sb)\n{\n    lbr->lbr_rand = 1103515245U * lbr->lbr_rand + 12345U;\n    return lbr->lbr_rand * lbr->sb_scf[sb];\n}\n\nstatic void parse_ch(struct lbr_decoder *lbr, int ch, int sb, int quant_level)\n{\n    int i, j, sf, ofs, code = -1, coding_method = -1;\n\n    if (lbr->bits.count < 20) {\n        lbr->bits.count = 0;\n        return;\n    }\n\n    for (sf = 0, ofs = 0; sf < 4; sf++, ofs += 32) {\n        float *samples = &lbr->time_samples[ch][sb][LBR_TIME_HISTORY + sf * 32];\n\n        if (lbr->undo_dmix && ch < lbr->nchannels) {\n            unsigned int bit = (ch * lbr->nsubbands + sb) * 4 + sf;\n            if (DCA_TEST_BIT(lbr->can_replace_sf, bit)) {\n                ofs = -32;\n                continue;\n            }\n        }\n\n        if (coding_method == -1)\n            coding_method = bits2_get1(&lbr->bits);\n\n        switch (quant_level) {\n        case 1:\n            for (i = 0; i < 4; i++, samples += 8) {\n                if (lbr->bits.count >= 8) {\n                    code = bits2_get(&lbr->bits, 8);\n                    for (j = 0; j < 8; j++)\n                        samples[j] = residual_level_2a[(code >> j) & 1];\n                } else {\n                    for (j = 0; j < 8; j++)\n                        samples[j] = lbr_rand(lbr, sb);\n                }\n            }\n            break;\n\n        case 2:\n            if (coding_method) {\n                for (i = 0; i < 32; i++) {\n                    if (lbr->bits.count < 2)\n                        samples[i] = lbr_rand(lbr, sb);\n                    else if (bits2_get1(&lbr->bits))\n                        samples[i] = residual_level_2b[bits2_get1(&lbr->bits)];\n                    else\n                        samples[i] = 0;\n                }\n                break;\n            }\n\n            for (i = 0; i < 32; i++) {\n                int mod = (ofs + i) % 5;\n\n                if (!mod) {\n                    if (lbr->bits.count >= 8) {\n                        code = bits2_get(&lbr->bits, 8);\n                        if (code > 242)\n                            code = 121;\n                    } else {\n                        code = 121;\n                    }\n\n                    code = residual_pack_5_in_8[code];\n                }\n\n                samples[i] = residual_level_3[(code >> mod * 2) & 3];\n            }\n            break;\n\n        case 3:\n            for (i = 0; i < 32; i++) {\n                int mod = (ofs + i) % 3;\n\n                if (!mod) {\n                    if (lbr->bits.count >= 7) {\n                        code = bits2_get(&lbr->bits, 7);\n                        if (code > 124)\n                            code = 62;\n                    } else {\n                        code = 62;\n                    }\n                }\n\n                samples[i] = residual_level_5[residual_pack_3_in_7[code][mod]];\n            }\n            break;\n\n        case 4:\n            for (i = 0; i < 32; i++) {\n                if (lbr->bits.count >= 6) {\n                    code = bits2_peek(&lbr->bits, 6);\n                    samples[i] = residual_level_8[residual_code_val[code]];\n                    bits2_skip(&lbr->bits, residual_code_len[code]);\n                } else {\n                    samples[i] = lbr_rand(lbr, sb);\n                }\n            }\n            break;\n\n        case 5:\n            for (i = 0; i < 32; i++) {\n                if (lbr->bits.count >= 4)\n                    samples[i] = residual_level_16[bits2_get(&lbr->bits, 4)];\n                else\n                    samples[i] = lbr_rand(lbr, sb);\n            }\n            break;\n        }\n    }\n\n    lbr->ch_pres[ch] |= 1U << sb;\n}\n\nstatic int parse_ts(struct lbr_decoder *lbr, int ch1, int ch2,\n                    int start_sb, int end_sb, bool flag)\n{\n    int sb_reorder;\n\n    for (int sb = start_sb; sb < end_sb; sb++) {\n        if (lbr->bits.count < 28) {\n            lbr->bits.count = 0;\n            break;\n        }\n\n        if (sb < 6) {\n            sb_reorder = sb;\n        } else if (flag && sb < lbr->max_mono_subband) {\n            sb_reorder = lbr->sb_indices[sb];\n        } else {\n            sb_reorder = bits2_get(&lbr->bits, lbr->limited_range + 3);\n            if (sb_reorder < 6)\n                sb_reorder = 6;\n            lbr->sb_indices[sb] = sb_reorder;\n        }\n        if (sb_reorder >= lbr->nsubbands)\n            return -1;\n\n        if (sb == 12) {\n            for (int sb = 0; sb < lbr->g3_avg_only_start_sb - 4; sb++)\n                parse_grid_3(lbr, ch1, ch2, sb, flag);\n        } else if (sb < 12 && sb_reorder >= 4) {\n            parse_grid_3(lbr, ch1, ch2, sb_reorder - 4, flag);\n        }\n\n        if (lbr->bits.count < 20) {\n            lbr->bits.count = 0;\n            break;\n        }\n\n        if (ch1 != ch2) {\n            if (!flag || sb_reorder >= lbr->max_mono_subband)\n                lbr->sec_ch_sbms[ch1 / 2][sb_reorder] = bits2_get(&lbr->bits, 8);\n            if (flag && sb_reorder >= lbr->min_mono_subband)\n                lbr->sec_ch_lrms[ch1 / 2][sb_reorder] = bits2_get(&lbr->bits, 8);\n        }\n\n        int quant_level = lbr->quant_levels[ch1 / 2][sb];\n        if (!quant_level)\n            return -1;\n\n        if (sb < lbr->max_mono_subband && sb_reorder >= lbr->min_mono_subband) {\n            if (!flag)\n                parse_ch(lbr, ch1, sb_reorder, quant_level);\n            else if (ch1 != ch2)\n                parse_ch(lbr, ch2, sb_reorder, quant_level);\n        } else {\n            parse_ch(lbr, ch1, sb_reorder, quant_level);\n            if (ch1 != ch2)\n                parse_ch(lbr, ch2, sb_reorder, quant_level);\n        }\n    }\n\n    return 0;\n}\n\nstatic void convert_lpc(float *coeff, const int *codes, const float *table)\n{\n    for (int i = 0; i < 8; i++) {\n        float rc = table[codes[i]];\n        for (int j = 0; j < (i + 1) / 2; j++) {\n            float tmp1 = coeff[    j    ];\n            float tmp2 = coeff[i - j - 1];\n            coeff[    j    ] = tmp1 + rc * tmp2;\n            coeff[i - j - 1] = tmp2 + rc * tmp1;\n        }\n        coeff[i] = rc;\n    }\n}\n\nstatic int parse_lpc(struct lbr_decoder *lbr, int ch1, int ch2, int start_sb, int end_sb)\n{\n    int f = lbr->framenum & 1;\n    int codes[16];\n\n    for (int sb = start_sb; sb < end_sb; sb++) {\n        int ncodes = 8 * (1 + (sb < 2));\n        for (int ch = ch1; ch <= ch2; ch++) {\n            if (lbr->bits.count < 4 * ncodes) {\n                memset(lbr->lpc_coeff[ch][sb][f], 0, sizeof(lbr->lpc_coeff[0][0][0]));\n                lbr->bits.count = 0;\n                return 0;\n            }\n            for (int i = 0; i < ncodes; i++)\n                codes[i] = bits2_get(&lbr->bits, 4);\n            for (int i = 0; i < ncodes / 8; i++)\n                convert_lpc(lbr->lpc_coeff[ch][sb][f][i], &codes[i * 8], lbr->lpc_tab);\n        }\n    }\n\n    return 0;\n}\n\nstatic int parse_high_res_grid(struct lbr_decoder *lbr, struct lbr_chunk *chunk, int ch1, int ch2)\n{\n    if (!chunk->len)\n        return 0;\n\n    bits2_init(&lbr->bits, chunk->data, chunk->len);\n\n    // Quantizer profile\n    int profile = bits2_get(&lbr->bits, 8);\n    int ol = (profile >> 3) & 7;\n    int st = profile >> 6;\n    int sb, max_sb = profile & 7;\n\n    // Calculate quantization levels\n    int quant_levels[LBR_SUBBANDS];\n    for (sb = 0; sb < lbr->nsubbands; sb++) {\n        int f = sb * lbr->limited_rate / lbr->nsubbands;\n        int a = 18000 / (12 * f / 1000 + 100 + 40 * st) + 20 * ol;\n        if (a <= 95)\n            quant_levels[sb] = 1;\n        else if (a <= 140)\n            quant_levels[sb] = 2;\n        else if (a <= 180)\n            quant_levels[sb] = 3;\n        else if (a <= 230)\n            quant_levels[sb] = 4;\n        else\n            quant_levels[sb] = 5;\n    }\n\n    // Reorder quantization levels for lower subbands\n    for (sb = 0; sb < 8; sb++)\n        lbr->quant_levels[ch1 / 2][sb] = quant_levels[sb_reorder[max_sb][sb]];\n    for (; sb < lbr->nsubbands; sb++)\n        lbr->quant_levels[ch1 / 2][sb] = quant_levels[sb];\n\n    // LPC for the first two subbands\n    if (parse_lpc(lbr, ch1, ch2, 0, 2) < 0)\n        return -1;\n\n    // Time-samples for the first two subbands of main channel\n    if (parse_ts(lbr, ch1, ch2, 0, 2, false) < 0)\n        return -1;\n\n    // First two bands of the first grid\n    for (sb = 0; sb < 2; sb++)\n        for (int ch = ch1; ch <= ch2; ch++)\n            if (parse_scale_factors(lbr, lbr->grid_1_scf[ch][sb]) < 0)\n                return -1;\n\n    return 0;\n}\n\nstatic int parse_grid_2_code(struct bitstream2 *bits)\n{\n    int v;\n\n    if ((v = parse_grid_code(bits, grid_2_codes_1, 5)) < 31)\n        return v;\n    if ((v = parse_grid_code(bits, grid_2_codes_2, 4)) < 31)\n        return v;\n    if ((v = parse_grid_code(bits, grid_2_codes_3, 5)) < 31)\n        return v;\n\n    v = bits2_get(bits, bits2_get(bits, 3) + 1);\n    if (v > 56)\n        v = 0;\n    return v;\n}\n\nstatic int parse_grid_2(struct lbr_decoder *lbr, int ch1, int ch2,\n                        int start_sb, int end_sb, bool flag)\n{\n    int nsubbands2 = scf_to_grid_2[lbr->nsubbands - 1] + 1;\n    if (end_sb > nsubbands2)\n        end_sb = nsubbands2;\n\n    for (int sb = start_sb; sb < end_sb; sb++) {\n        for (int ch = ch1; ch <= ch2; ch++) {\n            if ((ch != ch1 && grid_2_to_scf[sb] >= lbr->min_mono_subband) != flag) {\n                if (!flag)\n                    memcpy(lbr->grid_2_scf[ch2][sb], lbr->grid_2_scf[ch1][sb], sizeof(lbr->grid_2_scf[0][0]));\n                continue;\n            }\n\n            uint8_t *g2_scf = lbr->grid_2_scf[ch][sb];\n            for (int i = 0; i < 8; i++) {\n                if (lbr->bits.count > 1 && bits2_get1(&lbr->bits)) {\n                    for (int j = 0; j < 8; j++) {\n                        if (lbr->bits.count < 20)\n                            break;\n                        g2_scf[j] = parse_grid_2_code(&lbr->bits);\n                    }\n                } else {\n                    memset(g2_scf, 0, 8 * sizeof(*g2_scf));\n                }\n                g2_scf += 8;\n            }\n        }\n    }\n\n    return 0;\n}\n\nstatic int parse_ts1_chunk(struct lbr_decoder *lbr, struct lbr_chunk *chunk, int ch1, int ch2)\n{\n    if (!chunk->len)\n        return 0;\n    bits2_init(&lbr->bits, chunk->data, chunk->len);\n    if (parse_lpc(lbr, ch1, ch2, 2, 3) < 0)\n        return -1;\n    if (parse_ts(lbr, ch1, ch2, 2, 4, false) < 0)\n        return -1;\n    if (parse_grid_2(lbr, ch1, ch2, 0, 1, false) < 0)\n        return -1;\n    if (parse_ts(lbr, ch1, ch2, 4, 6, false) < 0)\n        return -1;\n    return 0;\n}\n\nstatic int parse_ts2_chunk(struct lbr_decoder *lbr, struct lbr_chunk *chunk, int ch1, int ch2)\n{\n    if (!chunk->len)\n        return 0;\n    bits2_init(&lbr->bits, chunk->data, chunk->len);\n    if (parse_grid_2(lbr, ch1, ch2, 1, 3, false) < 0)\n        return -1;\n    if (parse_ts(lbr, ch1, ch2, 6, lbr->max_mono_subband, false) < 0)\n        return -1;\n    if (ch1 != ch2) {\n        if (parse_grid_1_sec_ch(lbr, ch2) < 0)\n            return -1;\n        if (parse_grid_2(lbr, ch1, ch2, 0, 3, true) < 0)\n            return -1;\n    }\n    if (parse_ts(lbr, ch1, ch2, lbr->min_mono_subband, lbr->nsubbands, true) < 0)\n        return -1;\n    return 0;\n}\n\nstatic int init_tables(struct lbr_decoder *lbr)\n{\n    float scale = 256.0 * 0.25 * sqrt(1 << (2 - lbr->limited_range));\n    int i;\n\n    ta_free(lbr->imdct);\n\n    if (!(lbr->imdct = idct_init(lbr, lbr->freq_range + 5, scale)))\n        return -1;\n\n    for (i = 0; i < 256; i++)\n        lbr->sin_tab[i] = cos(M_PI * i / 128);\n\n    for (i = 0; i < 16; i++)\n        lbr->lpc_tab[i] = sin((i - 8) * (M_PI / ((i < 8) ? 17 : 15)));\n\n    int br_per_ch = lbr->bit_rate_scaled / lbr->nchannels;\n\n    if (br_per_ch < 14000)\n        scale = 0.85;\n    else if (br_per_ch < 32000)\n        scale = (br_per_ch - 14000) * (1.0 / 120000) + 0.85;\n    else\n        scale = 1.0;\n\n    scale *= 1.0 / INT_MAX;\n\n    for (i = 0; i < lbr->nsubbands; i++) {\n        if (i < 2)\n            lbr->sb_scf[i] = 0;\n        else if (i < 5)\n            lbr->sb_scf[i] = (i - 1) * 0.25 * 0.785 * scale;\n        else\n            lbr->sb_scf[i] = 0.785 * scale;\n    }\n\n    return 0;\n}\n\nstatic int parse_decoder_init(struct lbr_decoder *lbr, struct bytestream *bytes)\n{\n    int old_rate = lbr->sample_rate;\n    int old_band_limit = lbr->band_limit;\n\n    // Sample rate of LBR audio\n    unsigned int code = bytes_get(bytes);\n    if (code >= dca_countof(exss_sample_rates) || exss_sample_rates[code] > 48000) {\n        lbr_err(\"Invalid LBR sample rate\");\n        return -DCADEC_EBADDATA;\n    }\n    lbr->sample_rate = exss_sample_rates[code];\n\n    // LBR speaker mask\n    lbr->ch_mask = bytes_get16le(bytes);\n\n    // LBR bitstream version\n    if ((bytes_get16le(bytes) & 0xff00) != 0x0800) {\n        lbr_err(\"Unsupported LBR version\");\n        return -DCADEC_ENOSUP;\n    }\n\n    // Flags for LBR decoder initialization\n    lbr->flags = bytes_get(bytes);\n    if (lbr->flags & LBR_FLAG_DMIX_MULTI_CH) {\n        lbr_err(\"Unsupported multi-channel downmix\");\n        return -DCADEC_ENOSUP;\n    }\n\n    if (lbr->sample_rate != 48000)\n        lbr->flags &= ~LBR_FLAG_LFE_PRESENT;\n\n    // Most significant bit rate nibbles\n    int bit_rate_hi = bytes_get(bytes);\n\n    // Least significant original bit rate word\n    lbr->bit_rate_orig = bytes_get16le(bytes) | ((bit_rate_hi & 0x0F) << 16);\n\n    // Least significant scaled bit rate word\n    lbr->bit_rate_scaled = bytes_get16le(bytes) | ((bit_rate_hi & 0xF0) << 12);\n\n    lbr->nchannels = count_chs_for_mask(lbr->ch_mask & ~SPEAKER_PAIR_LFE1);\n    if (lbr->nchannels < 1 || lbr->nchannels > LBR_CHANNELS) {\n        lbr_err(\"Invalid LBR channel mask\");\n        return -DCADEC_EBADDATA;\n    }\n\n    switch (lbr->flags & LBR_FLAG_BAND_LIMIT_MASK) {\n    case LBR_FLAG_BAND_LIMIT_1_2:\n        lbr->band_limit = 1;\n        break;\n    case LBR_FLAG_BAND_LIMIT_1_4:\n        lbr->band_limit = 2;\n        break;\n    case LBR_FLAG_BAND_LIMIT_NONE:\n        lbr->band_limit = 0;\n        break;\n    default:\n        lbr_err(\"Invalid LBR band limit\");\n        return -DCADEC_EBADDATA;\n    }\n\n    if (lbr->sample_rate < 14000)\n        lbr->freq_range = 0;\n    else if (lbr->sample_rate < 28000)\n        lbr->freq_range = 1;\n    else\n        lbr->freq_range = 2;\n\n    if (lbr->bit_rate_orig >= 44000 * (lbr->nchannels + 2))\n        lbr->res_profile = 2;\n    else if (lbr->bit_rate_orig >= 25000 * (lbr->nchannels + 2))\n        lbr->res_profile = 1;\n    else\n        lbr->res_profile = 0;\n\n    lbr->limited_rate = lbr->sample_rate >> lbr->band_limit;\n    lbr->limited_range = lbr->freq_range - lbr->band_limit;\n    if (lbr->limited_range < 0) {\n        lbr_err(\"Invalid LBR band limit\");\n        return -DCADEC_EBADDATA;\n    }\n\n    lbr->nsubbands = 8 << lbr->limited_range;\n\n    static const uint16_t freq[3] = { 16000, 18000, 24000 };\n\n    lbr->g3_avg_only_start_sb = lbr->nsubbands * freq[lbr->res_profile] / (lbr->limited_rate / 2);\n    if (lbr->g3_avg_only_start_sb > lbr->nsubbands)\n        lbr->g3_avg_only_start_sb = lbr->nsubbands;\n\n    lbr->min_mono_subband = lbr->nsubbands *  2000 / (lbr->limited_rate / 2);\n    if (lbr->min_mono_subband > lbr->nsubbands)\n        lbr->min_mono_subband = lbr->nsubbands;\n\n    lbr->max_mono_subband = lbr->nsubbands * 14000 / (lbr->limited_rate / 2);\n    if (lbr->max_mono_subband > lbr->nsubbands)\n        lbr->max_mono_subband = lbr->nsubbands;\n\n    if (old_rate != lbr->sample_rate || old_band_limit != lbr->band_limit) {\n        lbr_clear(lbr);\n        if (init_tables(lbr) < 0)\n            return -DCADEC_ENOMEM;\n    }\n\n    lbr->nchannels_total = lbr->nchannels;\n    lbr->undo_dmix = false;\n    if (lbr->flags & LBR_FLAG_DMIX_STEREO) {\n        if (lbr->nchannels < 3 || lbr->nchannels > LBR_CHANNELS - 2) {\n            lbr_err(\"Invalid number of channels for stereo downmix\");\n            return -DCADEC_EBADDATA;\n        }\n        lbr->nchannels_total += 2;\n        if (lbr->ctx_flags & DCADEC_FLAG_KEEP_DMIX_2CH) {\n            lbr->nchannels = 2;\n            lbr->ch_mask = SPEAKER_PAIR_LR;\n            lbr->flags &= ~LBR_FLAG_LFE_PRESENT;\n        } else {\n            lbr->undo_dmix = true;\n        }\n    }\n\n    return 0;\n}\n\nint lbr_parse(struct lbr_decoder *lbr, uint8_t *data, size_t size, struct exss_asset *asset)\n{\n    int i, ret;\n\n    (void)size;\n\n    struct bytestream bytes;\n    bytes_init(&bytes, data + asset->lbr_offset, asset->lbr_size);\n\n    // LBR sync word\n    if (bytes_get32be(&bytes) != SYNC_WORD_LBR) {\n        lbr_err(\"Invalid LBR sync word\");\n        return -DCADEC_ENOSYNC;\n    }\n\n    // LBR header type\n    switch (bytes_get(&bytes)) {\n    case LBR_HEADER_SYNC_ONLY:\n        if (!lbr->sample_rate) {\n            lbr_err(\"LBR decoder not initialized\");\n            return -DCADEC_EBADDATA;\n        }\n        break;\n    case LBR_HEADER_DECODER_INIT:\n        if ((ret = parse_decoder_init(lbr, &bytes)) < 0) {\n            lbr->sample_rate = 0;\n            return ret;\n        }\n        break;\n    default:\n        lbr_err(\"Invalid LBR header type\");\n        return -DCADEC_EBADDATA;\n    }\n\n    int chunk_id = bytes_get(&bytes);\n    int chunk_len = (chunk_id & 0x80) ? bytes_get16be(&bytes) : bytes_get(&bytes);\n\n    if (bytes.index + chunk_len > bytes.total) {\n        lbr_err(\"Invalid LBR frame chunk size\");\n        return -DCADEC_EBADREAD;\n    }\n\n    bytes_init(&bytes, bytes.data + bytes.index, chunk_len);\n\n    switch (chunk_id & 0x7f) {\n    case LBR_CHUNK_FRAME: {\n        int checksum = bytes_get16be(&bytes);\n        uint16_t res = chunk_id;\n        res += (chunk_len >> 8) & 0xff;\n        res += chunk_len & 0xff;\n        for (int i = 0; i < chunk_len - 2; i++)\n            res += bytes.data[bytes.index + i];\n        if (checksum != res) {\n            lbr_err(\"Invalid LBR checksum\");\n            return -DCADEC_EBADCRC;\n        }\n        break;\n    }\n    case LBR_CHUNK_FRAME_NO_CSUM:\n        break;\n    default:\n        lbr_err(\"Invalid LBR frame chunk ID\");\n        return -DCADEC_EBADDATA;\n    }\n\n    memset(lbr->can_replace_sf, 0, sizeof(lbr->can_replace_sf));\n    memset(lbr->can_replace_ch, 0, sizeof(lbr->can_replace_ch));\n    memset(lbr->quant_levels, 0, sizeof(lbr->quant_levels));\n    memset(lbr->sb_indices, 0xff, sizeof(lbr->sb_indices));\n    memset(lbr->sec_ch_sbms, 0, sizeof(lbr->sec_ch_sbms));\n    memset(lbr->sec_ch_lrms, 0, sizeof(lbr->sec_ch_lrms));\n    memset(lbr->ch_pres, 0, sizeof(lbr->ch_pres));\n    memset(lbr->grid_1_scf, 0, sizeof(lbr->grid_1_scf));\n    memset(lbr->grid_2_scf, 0, sizeof(lbr->grid_2_scf));\n    memset(lbr->grid_3_avg, 0, sizeof(lbr->grid_3_avg));\n    memset(lbr->grid_3_scf, 0, sizeof(lbr->grid_3_scf));\n    memset(lbr->grid_3_pres, 0, sizeof(lbr->grid_3_pres));\n    memset(lbr->tonal_scf, 0, sizeof(lbr->tonal_scf));\n    memset(lbr->lfe_data, 0, sizeof(lbr->lfe_data));\n    lbr->part_stereo_pres = 0;\n    lbr->spatial_info_pres = 0;\n    lbr->framenum = (lbr->framenum + 1) & 31;\n\n    for (int ch = 0; ch < lbr->nchannels; ch++) {\n        for (int sb = 0; sb < lbr->nsubbands / 4; sb++) {\n            lbr->part_stereo[ch][sb][0] = lbr->part_stereo[ch][sb][4];\n            lbr->part_stereo[ch][sb][4] = 16;\n        }\n    }\n\n    for (int ch = 0; ch < lbr->nchannels - 2; ch++) {\n        for (int sb = 0; sb < lbr->nsubbands / 4; sb++) {\n            lbr->spatial_info[ch][sb][0] = lbr->spatial_info[ch][sb][4];\n            lbr->spatial_info[ch][sb][4] = 16;\n        }\n    }\n\n    for (int group = 0; group < 5; group++) {\n        for (int sf = 0; sf < 1 << group; sf++) {\n            int sf_idx = ((lbr->framenum << group) + sf) & 31;\n            lbr->tonal_bounds[group][sf_idx][0] =\n            lbr->tonal_bounds[group][sf_idx][1] = lbr->ntones;\n        }\n    }\n\n    struct {\n        struct lbr_chunk    lfe;\n        struct lbr_chunk    ecs;\n        struct lbr_chunk    tonal;\n        struct lbr_chunk    tonal_grp[5];\n        struct lbr_chunk    grid1[LBR_CHANNELS / 2];\n        struct lbr_chunk    hr_grid[LBR_CHANNELS / 2];\n        struct lbr_chunk    ts1[LBR_CHANNELS / 2];\n        struct lbr_chunk    ts2[LBR_CHANNELS / 2];\n    } chunk;\n\n    memset(&chunk, 0, sizeof(chunk));\n\n    while (bytes.index < bytes.total) {\n        int chunk_id = bytes_get(&bytes);\n        int chunk_len = (chunk_id & 0x80) ? bytes_get16be(&bytes) : bytes_get(&bytes);\n\n        if (chunk_len > bytes.total - bytes.index) {\n            chunk_len = bytes.total - bytes.index;\n            if (chunk_len < 0)\n                break;\n        }\n\n        chunk_id &= 0x7f;\n\n        switch (chunk_id) {\n        case LBR_CHUNK_LFE:\n            chunk.lfe.len  = chunk_len;\n            chunk.lfe.data = bytes.data + bytes.index;\n            break;\n\n        case LBR_CHUNK_ECS:\n            chunk.ecs.len  = chunk_len;\n            chunk.ecs.data = bytes.data + bytes.index;\n            break;\n\n        case LBR_CHUNK_SCF:\n        case LBR_CHUNK_TONAL:\n        case LBR_CHUNK_TONAL_SCF:\n            chunk.tonal.id   = chunk_id;\n            chunk.tonal.len  = chunk_len;\n            chunk.tonal.data = bytes.data + bytes.index;\n            break;\n\n        case LBR_CHUNK_TONAL_GRP_1:\n        case LBR_CHUNK_TONAL_GRP_2:\n        case LBR_CHUNK_TONAL_GRP_3:\n        case LBR_CHUNK_TONAL_GRP_4:\n        case LBR_CHUNK_TONAL_GRP_5:\n            i = LBR_CHUNK_TONAL_GRP_5 - chunk_id;\n            chunk.tonal_grp[i].id   = i;\n            chunk.tonal_grp[i].len  = chunk_len;\n            chunk.tonal_grp[i].data = bytes.data + bytes.index;\n            break;\n\n        case LBR_CHUNK_TONAL_SCF_GRP_1:\n        case LBR_CHUNK_TONAL_SCF_GRP_2:\n        case LBR_CHUNK_TONAL_SCF_GRP_3:\n        case LBR_CHUNK_TONAL_SCF_GRP_4:\n        case LBR_CHUNK_TONAL_SCF_GRP_5:\n            i = LBR_CHUNK_TONAL_SCF_GRP_5 - chunk_id;\n            chunk.tonal_grp[i].id   = i;\n            chunk.tonal_grp[i].len  = chunk_len;\n            chunk.tonal_grp[i].data = bytes.data + bytes.index;\n            break;\n\n        case LBR_CHUNK_RES_GRID_LR:\n        case LBR_CHUNK_RES_GRID_LR + 1:\n        case LBR_CHUNK_RES_GRID_LR + 2:\n        case LBR_CHUNK_RES_GRID_LR + 3:\n            i = chunk_id - LBR_CHUNK_RES_GRID_LR;\n            chunk.grid1[i].len  = chunk_len;\n            chunk.grid1[i].data = bytes.data + bytes.index;\n            break;\n\n        case LBR_CHUNK_RES_GRID_HR:\n        case LBR_CHUNK_RES_GRID_HR + 1:\n        case LBR_CHUNK_RES_GRID_HR + 2:\n        case LBR_CHUNK_RES_GRID_HR + 3:\n            i = chunk_id - LBR_CHUNK_RES_GRID_HR;\n            chunk.hr_grid[i].len  = chunk_len;\n            chunk.hr_grid[i].data = bytes.data + bytes.index;\n            break;\n\n        case LBR_CHUNK_RES_TS_1:\n        case LBR_CHUNK_RES_TS_1 + 1:\n        case LBR_CHUNK_RES_TS_1 + 2:\n        case LBR_CHUNK_RES_TS_1 + 3:\n            i = chunk_id - LBR_CHUNK_RES_TS_1;\n            chunk.ts1[i].len  = chunk_len;\n            chunk.ts1[i].data = bytes.data + bytes.index;\n            break;\n\n        case LBR_CHUNK_RES_TS_2:\n        case LBR_CHUNK_RES_TS_2 + 1:\n        case LBR_CHUNK_RES_TS_2 + 2:\n        case LBR_CHUNK_RES_TS_2 + 3:\n            i = chunk_id - LBR_CHUNK_RES_TS_2;\n            chunk.ts2[i].len  = chunk_len;\n            chunk.ts2[i].data = bytes.data + bytes.index;\n            break;\n        }\n\n        bytes.index += chunk_len;\n    }\n\n#define CHECK(x, s) \\\n    if (x < 0) { \\\n        lbr_err(\"Error parsing %s chunk\", s); \\\n        return -DCADEC_EBADDATA; \\\n    }\n\n    // LFE chunk\n    if (lbr->flags & LBR_FLAG_LFE_PRESENT)\n        CHECK(parse_lfe_chunk(lbr, &chunk.lfe), \"LFE\");\n\n    // Tonal chunks\n    CHECK(parse_tonal_chunk(lbr, &chunk.tonal), \"tonal\");\n    for (i = 0; i < 5; i++)\n        CHECK(parse_tonal_group(lbr, &chunk.tonal_grp[i]), \"tonal group\");\n\n    // ECS chunk and downmixed channel pair\n    if (lbr->undo_dmix) {\n        // Decode into unused channel pair at the end of array\n        int ch1 = LBR_CHANNELS - 2;\n        int ch2 = LBR_CHANNELS - 1;\n\n        CHECK(parse_ecs_chunk(lbr, &chunk.ecs), \"ECS\");\n        CHECK(parse_high_res_grid(lbr, &chunk.hr_grid[0], ch1, ch2), \"high-res grid\");\n\n        if (chunk.hr_grid[0].len) {\n            CHECK(parse_ts1_chunk(lbr, &chunk.ts1[0], ch1, ch2), \"TS 1\");\n            if (chunk.ts1[0].len)\n                CHECK(parse_ts2_chunk(lbr, &chunk.ts2[0], ch1, ch2), \"TS 2\");\n        }\n    }\n\n    // Residual chunks\n    for (int pair = 0; pair < (lbr->nchannels + 1) / 2; pair++) {\n        int ch1 = pair * 2;\n        int ch2 = DCA_MIN(ch1 + 1, lbr->nchannels - 1);\n\n        // Skip the first downmixed channel pair\n        i = pair + lbr->undo_dmix;\n\n        CHECK(parse_grid_1_chunk(lbr, &chunk.grid1[i], ch1, ch2), \"grid 1\");\n        CHECK(parse_high_res_grid(lbr, &chunk.hr_grid[i], ch1, ch2), \"high-res grid\");\n\n        if (chunk.grid1[i].len && chunk.hr_grid[i].len) {\n            CHECK(parse_ts1_chunk(lbr, &chunk.ts1[i], ch1, ch2), \"TS 1\");\n            if (chunk.ts1[i].len)\n                CHECK(parse_ts2_chunk(lbr, &chunk.ts2[i], ch1, ch2), \"TS 2\");\n        }\n    }\n\n#undef CHECK\n\n    return 0;\n}\n\nstatic void decode_grid(struct lbr_decoder *lbr, int ch)\n{\n    for (int sb = 0; sb < lbr->nsubbands; sb++) {\n        int g1_sb = scf_to_grid_1[sb];\n\n        uint8_t *g1_scf_a = lbr->grid_1_scf[ch][g1_sb    ];\n        uint8_t *g1_scf_b = lbr->grid_1_scf[ch][g1_sb + 1];\n\n        int w1 = grid_1_weights[g1_sb    ][sb];\n        int w2 = grid_1_weights[g1_sb + 1][sb];\n\n        uint8_t *hr_scf = lbr->high_res_scf[ch][sb];\n\n        if (sb < 4) {\n            for (int i = 0; i < 8; i++) {\n                int scf = w1 * g1_scf_a[i] + w2 * g1_scf_b[i];\n                hr_scf[i] = scf >> 7;\n            }\n        } else {\n            int8_t *g3_scf = lbr->grid_3_scf[ch][sb - 4];\n            int g3_avg = lbr->grid_3_avg[ch][sb - 4];\n\n            for (int i = 0; i < 8; i++) {\n                int scf = w1 * g1_scf_a[i] + w2 * g1_scf_b[i];\n                hr_scf[i] = (scf >> 7) - g3_avg - g3_scf[i];\n            }\n        }\n    }\n}\n\nstatic void replace_ts(struct lbr_decoder *lbr, int ch1)\n{\n    for (int sb = 0; sb < lbr->nsubbands; sb++) {\n        for (int sf = 0; sf < 4; sf++) {\n            unsigned int bit = (ch1 * lbr->nsubbands + sb) * 4 + sf;\n            if (DCA_TEST_BIT(lbr->can_replace_sf, bit)) {\n                int ch2 = LBR_CHANNELS - 2 + DCA_TEST_BIT(lbr->can_replace_ch, bit);\n                float *samples1 = &lbr->time_samples[ch1][sb][LBR_TIME_HISTORY + sf * 32];\n                float *samples2 = &lbr->time_samples[ch2][sb][LBR_TIME_HISTORY + sf * 32];\n                memcpy(samples1, samples2, 32 * sizeof(*samples1));\n            }\n        }\n    }\n}\n\nstatic void random_ts(struct lbr_decoder *lbr, int ch)\n{\n    for (int sb = 0; sb < lbr->nsubbands; sb++) {\n        float *samples = &lbr->time_samples[ch][sb][LBR_TIME_HISTORY];\n        int i, j;\n\n        if (lbr->ch_pres[ch] & (1U << sb))\n            continue;\n\n        if (sb < 2) {\n            memset(samples, 0, LBR_TIME_SAMPLES * sizeof(*samples));\n        } else if (sb < 10) {\n            for (i = 0; i < LBR_TIME_SAMPLES; i++)\n                samples[i] = lbr_rand(lbr, sb);\n        } else {\n            for (i = 0; i < LBR_TIME_SAMPLES / 8; i++, samples += 8) {\n                float accum[8] = { 0 };\n\n                for (int sb = 2; sb < 6; sb++) {\n                    float *other = &lbr->time_samples[ch][sb][LBR_TIME_HISTORY + i * 8];\n                    for (j = 0; j < 8; j++)\n                        accum[j] += fabs(other[j]);\n                }\n\n                for (j = 0; j < 8; j++)\n                    samples[j] = (accum[j] * 0.25 + 0.5) * lbr_rand(lbr, sb);\n            }\n        }\n    }\n}\n\nstatic void predict(float *samples, const float *coeff, int nsamples)\n{\n    for (int i = 0; i < nsamples; i++) {\n        double res = 0.0;\n        for (int j = 0; j < 8; j++)\n            res += coeff[j] * samples[i - j - 1];\n        samples[i] -= res;\n    }\n}\n\nstatic void synth_lpc(struct lbr_decoder *lbr, int ch, int sb)\n{\n    float *samples = &lbr->time_samples[ch][sb][LBR_TIME_HISTORY];\n    int f = lbr->framenum & 1;\n\n    if (!(lbr->ch_pres[ch] & (1U << sb)))\n        return;\n\n    if (sb < 2) {\n        predict(samples,      lbr->lpc_coeff[ch][sb][f^1][1],  16);\n        predict(samples + 16, lbr->lpc_coeff[ch][sb][f  ][0],  64);\n        predict(samples + 80, lbr->lpc_coeff[ch][sb][f  ][1],  48);\n    } else {\n        predict(samples,      lbr->lpc_coeff[ch][sb][f^1][0],  16);\n        predict(samples + 16, lbr->lpc_coeff[ch][sb][f  ][0], 112);\n    }\n}\n\nstatic void filter_ts(struct lbr_decoder *lbr, int ch1, int ch2)\n{\n    int i, j;\n\n    for (int sb = 0; sb < lbr->nsubbands; sb++) {\n        // Scale factors\n        for (int ch = ch1; ch <= ch2; ch++) {\n            float *samples = &lbr->time_samples[ch][sb][LBR_TIME_HISTORY];\n            uint8_t *hr_scf = lbr->high_res_scf[ch][sb];\n            if (sb < 4) {\n                for (i = 0; i < LBR_TIME_SAMPLES / 16; i++, samples += 16) {\n                    unsigned int scf = hr_scf[i];\n                    if (scf > 56)\n                        scf = 56;\n                    for (j = 0; j < 16; j++)\n                        samples[j] *= quant_amp[scf];\n                }\n            } else {\n                uint8_t *g2_scf = lbr->grid_2_scf[ch][scf_to_grid_2[sb]];\n                for (i = 0; i < LBR_TIME_SAMPLES / 2; i++, samples += 2) {\n                    unsigned int scf = hr_scf[i / 8] - g2_scf[i];\n                    if (scf > 56)\n                        scf = 56;\n                    samples[0] *= quant_amp[scf];\n                    samples[1] *= quant_amp[scf];\n                }\n            }\n        }\n\n        // Mid-side stereo\n        if (ch1 != ch2) {\n            float *samples_l = &lbr->time_samples[ch1][sb][LBR_TIME_HISTORY];\n            float *samples_r = &lbr->time_samples[ch2][sb][LBR_TIME_HISTORY];\n            int ch2_pres = lbr->ch_pres[ch2] & (1U << sb);\n\n            for (i = 0; i < LBR_TIME_SAMPLES / 16; i++) {\n                int sbms = (lbr->sec_ch_sbms[ch1 / 2][sb] >> i) & 1;\n                int lrms = (lbr->sec_ch_lrms[ch1 / 2][sb] >> i) & 1;\n\n                if (sb >= lbr->min_mono_subband) {\n                    if (lrms && ch2_pres) {\n                        if (sbms) {\n                            for (j = 0; j < 16; j++) {\n                                float tmp = samples_l[j];\n                                samples_l[j] =  samples_r[j];\n                                samples_r[j] = -tmp;\n                            }\n                        } else {\n                            for (j = 0; j < 16; j++) {\n                                float tmp = samples_l[j];\n                                samples_l[j] =  samples_r[j];\n                                samples_r[j] =  tmp;\n                            }\n                        }\n                    } else if (!ch2_pres) {\n                        if (sbms && (lbr->part_stereo_pres & (1 << ch1))) {\n                            for (j = 0; j < 16; j++)\n                                samples_r[j] = -samples_l[j];\n                        } else {\n                            for (j = 0; j < 16; j++)\n                                samples_r[j] =  samples_l[j];\n                        }\n                    }\n                } else if (sbms && ch2_pres) {\n                    for (j = 0; j < 16; j++) {\n                        float tmp = samples_l[j];\n                        samples_l[j] = (tmp + samples_r[j]) * 0.5;\n                        samples_r[j] = (tmp - samples_r[j]) * 0.5;\n                    }\n                }\n\n                samples_l += 16;\n                samples_r += 16;\n            }\n        }\n\n        // Inverse prediciton\n        if (sb < 3) {\n            synth_lpc(lbr, ch1, sb);\n            if (ch1 != ch2)\n                synth_lpc(lbr, ch2, sb);\n        }\n    }\n}\n\nstatic void decode_part_stereo(struct lbr_decoder *lbr, int ch1, int ch2)\n{\n    for (int ch = ch1; ch <= ch2; ch++) {\n        for (int sb = lbr->min_mono_subband; sb < lbr->nsubbands; sb++) {\n            if (lbr->ch_pres[ch2] & (1U << sb))\n                continue;\n\n            float *samples = &lbr->time_samples[ch][sb][LBR_TIME_HISTORY];\n            int pt_sb = (sb - lbr->min_mono_subband) / 4;\n\n            for (int sf = 1; sf <= 4; sf++) {\n                float prev = st_coeff[lbr->part_stereo[ch][pt_sb][sf - 1]];\n                float next = st_coeff[lbr->part_stereo[ch][pt_sb][sf    ]];\n\n                for (int i = 0; i < 32; i++)\n                    samples[i] *= (32 - i) * prev + i * next;\n\n                samples += 32;\n            }\n        }\n    }\n}\n\nstatic void decode_spatial_info(struct lbr_decoder *lbr, int ch1, int ch2)\n{\n    int ch_pres = ~lbr->ch_pres[ch1] | lbr->ch_pres[ch2];\n\n    for (int sb = 0; sb < lbr->nsubbands; sb++) {\n        if (ch_pres & (1U << sb))\n            continue;\n\n        float *samples_l = &lbr->time_samples[ch1][sb][LBR_TIME_HISTORY];\n        float *samples_r = &lbr->time_samples[ch2][sb][LBR_TIME_HISTORY];\n\n        for (int sf = 1; sf <= 4; sf++) {\n            float prev = st_coeff[lbr->spatial_info[ch2 - 2][sb / 4][sf - 1]];\n            float next = st_coeff[lbr->spatial_info[ch2 - 2][sb / 4][sf    ]];\n\n            for (int i = 0; i < 32; i++)\n                samples_r[i] = ((32 - i) * prev + i * next) * samples_l[i];\n\n            samples_l += 32;\n            samples_r += 32;\n        }\n    }\n}\n\nstatic void synth_tones(struct lbr_decoder *lbr, int ch, float *values,\n                        int group, int group_sf, int synth_idx)\n{\n    if (synth_idx < 0)\n        return;\n\n    int start =  lbr->tonal_bounds[group][group_sf][0];\n    int count = (lbr->tonal_bounds[group][group_sf][1] - start) & (LBR_TONES - 1);\n\n    for (int i = 0; i < count; i++) {\n        struct lbr_tone *t = &lbr->tones[(start + i) & (LBR_TONES - 1)];\n\n        if (t->amp[ch]) {\n            float amp = synth_env[synth_idx] * quant_amp[t->amp[ch]];\n            float s = amp * lbr->sin_tab[(t->phs[ch]     ) & 255];\n            float c = amp * lbr->sin_tab[(t->phs[ch] + 64) & 255];\n            const float *cf = corr_cf[t->f_delt];\n            int x_freq = t->x_freq;\n\n            switch (x_freq) {\n            case 0:\n                goto p0;\n            case 1:\n                values[3] += cf[0] * -c;\n                values[2] += cf[1] *  s;\n                values[1] += cf[2] *  c;\n                values[0] += cf[3] * -s;\n                goto p1;\n            case 2:\n                values[2] += cf[0] * -c;\n                values[1] += cf[1] *  s;\n                values[0] += cf[2] *  c;\n                goto p2;\n            case 3:\n                values[1] += cf[0] * -c;\n                values[0] += cf[1] *  s;\n                goto p3;\n            case 4:\n                values[0] += cf[0] * -c;\n                goto p4;\n            }\n\n            values[x_freq - 5] += cf[ 0] * -c;\n        p4: values[x_freq - 4] += cf[ 1] *  s;\n        p3: values[x_freq - 3] += cf[ 2] *  c;\n        p2: values[x_freq - 2] += cf[ 3] * -s;\n        p1: values[x_freq - 1] += cf[ 4] * -c;\n        p0: values[x_freq    ] += cf[ 5] *  s;\n            values[x_freq + 1] += cf[ 6] *  c;\n            values[x_freq + 2] += cf[ 7] * -s;\n            values[x_freq + 3] += cf[ 8] * -c;\n            values[x_freq + 4] += cf[ 9] *  s;\n            values[x_freq + 5] += cf[10] *  c;\n        }\n\n        t->phs[ch] += t->ph_rot;\n    }\n}\n\nstatic void base_func_synth(struct lbr_decoder *lbr, int ch, float *values, int sf)\n{\n    for (int group = 0; group < 5; group++) {\n        int group_sf = (lbr->framenum << group) + ((sf - 22) >> (5 - group));\n        int synth_idx = ((((sf - 22) & 31) << group) & 31) + (1 << group) - 1;\n\n        synth_tones(lbr, ch, values, group, (group_sf - 1) & 31, 30 - synth_idx);\n        synth_tones(lbr, ch, values, group, (group_sf    ) & 31,      synth_idx);\n    }\n}\n\n#define SW0     0.022810893\n#define SW1     0.41799772\n#define SW2     0.9084481\n#define SW3     0.99973983\n\n#define C1      0.068974845\n#define C2      0.34675997\n#define C3      0.29396889\n#define C4      0.19642374\n\n#define AL1     0.30865827\n#define AL2     0.038060233\n\nstatic void transform_channel(struct lbr_decoder *lbr, int ch)\n{\n    float values[LBR_SUBBANDS * 2][4];\n    int *output = lbr->channel_buffer[ch];\n    int noutsubbands = 8 << lbr->freq_range;\n    int step = 1 << (2 - lbr->freq_range);\n    int i, sf, nsubbands = lbr->nsubbands;\n\n    for (sf = 0; sf < LBR_TIME_SAMPLES / 4; sf++) {\n        // Short window and 8 point forward MDCT\n        for (i = 0; i < nsubbands; i++) {\n            float *samples = &lbr->time_samples[ch][i][LBR_TIME_HISTORY + sf * 4];\n\n            float a = samples[-4] * SW0 - samples[-1] * SW3;\n            float b = samples[-3] * SW1 - samples[-2] * SW2;\n            float c = samples[ 2] * SW1 + samples[ 1] * SW2;\n            float d = samples[ 3] * SW0 + samples[ 0] * SW3;\n\n            values[i][0] = C1 * b - C2 * c + C4 * a - C3 * d;\n            values[i][1] = C1 * d - C2 * a - C4 * b - C3 * c;\n            values[i][2] = C3 * b + C2 * d - C4 * c + C1 * a;\n            values[i][3] = C3 * a - C2 * b + C4 * d - C1 * c;\n        }\n\n        // Aliasing cancellation for high frequencies\n        for (i = 12; i < nsubbands - 1; i++) {\n            float a = values[i  ][3] * AL1;\n            float b = values[i+1][0] * AL1;\n            values[i  ][3] += b - a;\n            values[i+1][0] -= b + a;\n            a = values[i  ][2] * AL2;\n            b = values[i+1][1] * AL2;\n            values[i  ][2] += b - a;\n            values[i+1][1] -= b + a;\n        }\n\n        // Clear inactive subbands\n        if (nsubbands < noutsubbands)\n            memset(values[nsubbands], 0, (noutsubbands - nsubbands) * sizeof(values[0]));\n\n        base_func_synth(lbr, ch, values[0], sf);\n\n        imdct_fast(lbr->imdct, values[0], values[0]);\n\n        // Long window and overlap-add\n        const float *w1 = &long_window[0];\n        const float *w2 = &long_window[128 - 4 * step];\n        float *history = lbr->imdct_history[ch];\n        for (i = 0; i < noutsubbands; i++) {\n            output[0] = lrintf(w1[0 * step] * values[i][0] + history[0]);\n            output[1] = lrintf(w1[1 * step] * values[i][1] + history[1]);\n            output[2] = lrintf(w1[2 * step] * values[i][2] + history[2]);\n            output[3] = lrintf(w1[3 * step] * values[i][3] + history[3]);\n\n            history[0] = w2[3 * step] * values[noutsubbands + i][0];\n            history[1] = w2[2 * step] * values[noutsubbands + i][1];\n            history[2] = w2[1 * step] * values[noutsubbands + i][2];\n            history[3] = w2[0 * step] * values[noutsubbands + i][3];\n\n            output  += 4;\n            history += 4;\n            w1 += 4 * step;\n            w2 -= 4 * step;\n        }\n    }\n\n    // Update history for LPC and forward MDCT\n    for (i = 0; i < nsubbands; i++) {\n        float *samples = lbr->time_samples[ch][i];\n        memcpy(samples, samples + LBR_TIME_SAMPLES, LBR_TIME_HISTORY * sizeof(*samples));\n    }\n}\n\n#define LFE_IIR_SCALE   (64 * 0x7fffff * 0.0000078265894)\n\nstatic void interpolate_lfe(struct lbr_decoder *lbr)\n{\n    int *output = lbr->output_samples[SPEAKER_LFE1];\n\n    for (int i = 0; i < 64; i++) {\n        float res1 = lbr->lfe_data[i] * LFE_IIR_SCALE;\n        float res2;\n\n        for (int j = 0; j < 64; j++) {\n            for (int k = 0; k < 5; k++) {\n                float tmp1 = lbr->lfe_history[k][0];\n                float tmp2 = lbr->lfe_history[k][1];\n\n                res2 = tmp1 * lfe_iir[k][0] + tmp2 * lfe_iir[k][1] + res1;\n                res1 = tmp1 * lfe_iir[k][2] + tmp2 * lfe_iir[k][3] + res2;\n\n                lbr->lfe_history[k][0] = tmp2;\n                lbr->lfe_history[k][1] = res2;\n            }\n\n            *output++ = lrintf(res1);\n            res1 = 0.0;\n        }\n    }\n}\n\nint lbr_filter(struct lbr_decoder *lbr)\n{\n    if (lbr->undo_dmix) {\n        random_ts(lbr, LBR_CHANNELS - 2);\n        random_ts(lbr, LBR_CHANNELS - 1);\n    }\n\n    for (int pair = 0; pair < (lbr->nchannels + 1) / 2; pair++) {\n        int ch1 = pair * 2;\n        int ch2 = DCA_MIN(ch1 + 1, lbr->nchannels - 1);\n\n        decode_grid(lbr, ch1);\n        if (ch1 != ch2)\n            decode_grid(lbr, ch2);\n\n        if (lbr->undo_dmix) {\n            replace_ts(lbr, ch1);\n            if (ch1 != ch2)\n                replace_ts(lbr, ch2);\n        }\n\n        random_ts(lbr, ch1);\n        if (ch1 != ch2)\n            random_ts(lbr, ch2);\n\n        filter_ts(lbr, ch1, ch2);\n\n        if (ch1 != ch2 && (lbr->part_stereo_pres & (1 << ch1)) && 1)\n            decode_part_stereo(lbr, ch1, ch2);\n\n        if (ch1 >= 2 && (lbr->spatial_info_pres & (1 << ch1)) && 0) {\n            decode_spatial_info(lbr, 0, ch1);\n            if (ch1 != ch2 && (lbr->spatial_info_pres & (1 << ch2)))\n                decode_spatial_info(lbr, 1, ch2);\n        }\n\n        transform_channel(lbr, ch1);\n        if (ch1 != ch2)\n            transform_channel(lbr, ch2);\n    }\n\n    int ch = 0;\n    lbr->output_mask = 0;\n    if (lbr->ch_mask & SPEAKER_PAIR_LR) {\n        lbr->output_samples[SPEAKER_L] = lbr->channel_buffer[ch++];\n        lbr->output_samples[SPEAKER_R] = lbr->channel_buffer[ch++];\n        lbr->output_mask |= SPEAKER_MASK_L | SPEAKER_MASK_R;\n    }\n    if (lbr->ch_mask & SPEAKER_PAIR_LsRs) {\n        lbr->output_samples[SPEAKER_Ls] = lbr->channel_buffer[ch++];\n        lbr->output_samples[SPEAKER_Rs] = lbr->channel_buffer[ch++];\n        lbr->output_mask |= SPEAKER_MASK_Ls | SPEAKER_MASK_Rs;\n    }\n    if (lbr->ch_mask & SPEAKER_PAIR_C) {\n        lbr->output_samples[SPEAKER_C] = lbr->channel_buffer[ch++];\n        lbr->output_mask |= SPEAKER_MASK_C;\n    }\n    if (lbr->flags & LBR_FLAG_LFE_PRESENT) {\n        lbr->output_samples[SPEAKER_LFE1] = lbr->channel_buffer[ch++];\n        lbr->output_mask |= SPEAKER_MASK_LFE1;\n        interpolate_lfe(lbr);\n    }\n\n    return 0;\n}\n\nvoid lbr_clear(struct lbr_decoder *lbr)\n{\n    if (lbr) {\n        memset(lbr->part_stereo, 16, sizeof(lbr->part_stereo));\n        memset(lbr->spatial_info, 16, sizeof(lbr->spatial_info));\n        memset(lbr->lpc_coeff, 0, sizeof(lbr->lpc_coeff));\n        memset(lbr->time_samples, 0, sizeof(lbr->time_samples));\n        memset(lbr->imdct_history, 0, sizeof(lbr->imdct_history));\n        memset(lbr->tonal_bounds, 0, sizeof(lbr->tonal_bounds));\n        memset(lbr->lfe_history, 0, sizeof(lbr->lfe_history));\n        lbr->framenum = 0;\n        lbr->ntones = 0;\n    }\n}\n"
  },
  {
    "path": "libdcadec/lbr_decoder.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef LBR_DECODER_H\n#define LBR_DECODER_H\n\n#define LBR_CHANNELS    8\n#define LBR_SUBBANDS    32\n#define LBR_TONES       512\n\n#define LBR_TIME_SAMPLES    128\n#define LBR_TIME_HISTORY    8\n\n#define lbr_err(...)        dca_log(lbr, ERROR, __VA_ARGS__)\n#define lbr_warn(...)       dca_log(lbr, WARNING, __VA_ARGS__)\n#define lbr_info(...)       dca_log(lbr, INFO, __VA_ARGS__)\n#define lbr_debug(...)      dca_log(lbr, DEBUG, __VA_ARGS__)\n\nstruct exss_asset;\n\nstruct bitstream2 {\n    uint8_t *data;\n    int index;\n    uint32_t accum;\n    int avail;\n    int count;\n};\n\nstruct lbr_tone {\n    uint8_t x_freq;\n    uint8_t f_delt;\n    uint8_t ph_rot;\n    uint8_t pad;\n    uint8_t amp[LBR_CHANNELS];\n    uint8_t phs[LBR_CHANNELS];\n};\n\nstruct lbr_decoder {\n    struct dcadec_context   *ctx; ///< Parent context\n    struct bitstream2       bits; ///< Bitstream reader\n\n    int ctx_flags;\n\n    int sample_rate;\n    int ch_mask;\n    int flags;\n    int bit_rate_orig;\n    int bit_rate_scaled;\n\n    int nchannels;\n    int nchannels_total;\n    int undo_dmix;\n    int freq_range;\n    int band_limit;\n    int limited_rate;\n    int limited_range;\n    int res_profile;\n    int nsubbands;\n    int g3_avg_only_start_sb;\n    int min_mono_subband;\n    int max_mono_subband;\n\n    int framenum;\n    int lbr_rand;\n\n    uint8_t can_replace_sf[LBR_CHANNELS * LBR_SUBBANDS * 4 / 8];\n    uint8_t can_replace_ch[LBR_CHANNELS * LBR_SUBBANDS * 4 / 8];\n\n    uint8_t quant_levels[LBR_CHANNELS / 2][LBR_SUBBANDS];\n    uint8_t sb_indices[LBR_SUBBANDS];\n\n    uint8_t sec_ch_sbms[LBR_CHANNELS / 2][LBR_SUBBANDS];\n    uint8_t sec_ch_lrms[LBR_CHANNELS / 2][LBR_SUBBANDS];\n    uint32_t ch_pres[LBR_CHANNELS];\n\n    uint8_t grid_1_scf[LBR_CHANNELS][12][8];\n    uint8_t grid_2_scf[LBR_CHANNELS][6][64];\n\n    int8_t grid_3_avg[LBR_CHANNELS][28];\n    int8_t grid_3_scf[LBR_CHANNELS][28][8];\n    uint32_t grid_3_pres[LBR_CHANNELS];\n\n    uint8_t high_res_scf[LBR_CHANNELS][LBR_SUBBANDS][8];\n\n    uint8_t part_stereo[LBR_CHANNELS][LBR_SUBBANDS / 4][5];\n    uint8_t spatial_info[LBR_CHANNELS - 2][LBR_SUBBANDS / 4][5];\n\n    uint8_t part_stereo_pres;\n    uint8_t spatial_info_pres;\n\n    float lpc_coeff[LBR_CHANNELS][3][2][2][8];\n\n    float sb_scf[LBR_SUBBANDS];\n\n    float time_samples[LBR_CHANNELS][LBR_SUBBANDS][LBR_TIME_HISTORY + LBR_TIME_SAMPLES];\n    float imdct_history[LBR_CHANNELS][LBR_SUBBANDS * 4];\n\n    uint8_t tonal_scf[6];\n    uint16_t tonal_bounds[5][32][2];\n    struct lbr_tone tones[LBR_TONES];\n    int ntones;\n\n    float lfe_data[64];\n    float lfe_history[5][2];\n\n    struct idct_context *imdct;\n    float sin_tab[256];\n    float lpc_tab[16];\n\n    int channel_buffer[LBR_CHANNELS][LBR_TIME_SAMPLES * LBR_SUBBANDS];\n\n    int *output_samples[SPEAKER_COUNT];\n    int output_mask;\n};\n\nint lbr_parse(struct lbr_decoder *lbr, uint8_t *data, size_t size, struct exss_asset *asset);\nint lbr_filter(struct lbr_decoder *lbr);\nvoid lbr_clear(struct lbr_decoder *lbr) __attribute__((cold));\n\n#endif\n"
  },
  {
    "path": "libdcadec/lbr_huffman.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\nstatic const uint8_t huff_tnl_grp_0[] = {\n    0x01, 0x38, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x05, 0xFF, 0x04, 0x01, 0x26,\n    0x01, 0x24, 0x01, 0x22, 0x01, 0x20, 0x01, 0x18, 0x01, 0x02, 0xFF, 0x13,\n    0x01, 0x14, 0x01, 0x06, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x21, 0xFF, 0x1F,\n    0xFF, 0x1C, 0x01, 0x0C, 0x01, 0x0A, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x22,\n    0xFF, 0x25, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x23, 0xFF, 0x00, 0xFF, 0x24,\n    0xFF, 0x20, 0xFF, 0x1E, 0xFF, 0x18, 0x01, 0x02, 0xFF, 0x16, 0x01, 0x02,\n    0xFF, 0x17, 0x01, 0x02, 0xFF, 0x1D, 0xFF, 0x1B, 0xFF, 0x11, 0xFF, 0x0E,\n    0xFF, 0x07, 0x01, 0x0C, 0x01, 0x02, 0xFF, 0x0C, 0x01, 0x02, 0xFF, 0x01,\n    0x01, 0x06, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x1A, 0xFF, 0x03, 0xFF, 0x19,\n    0xFF, 0x14, 0xFF, 0x08, 0x01, 0x0E, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x0A,\n    0xFF, 0x0D, 0x01, 0x08, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x0F, 0xFF, 0x10,\n    0x01, 0x02, 0xFF, 0x12, 0xFF, 0x15, 0xFF, 0x0B, 0x01, 0x02, 0xFF, 0x09,\n    0xFF, 0x06\n};\n\nstatic const uint8_t huff_tnl_grp_1[] = {\n    0x01, 0x30, 0x01, 0x16, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x04, 0xFF, 0x07,\n    0x01, 0x02, 0xFF, 0x0A, 0x01, 0x0E, 0x01, 0x0C, 0x01, 0x0A, 0x01, 0x08,\n    0x01, 0x04, 0x01, 0x02, 0xFF, 0x03, 0xFF, 0x1B, 0x01, 0x02, 0xFF, 0x1D,\n    0xFF, 0x1C, 0xFF, 0x16, 0xFF, 0x15, 0xFF, 0x0F, 0xFF, 0x0E, 0x01, 0x18,\n    0x01, 0x02, 0xFF, 0x08, 0x01, 0x14, 0x01, 0x02, 0xFF, 0x10, 0x01, 0x02,\n    0xFF, 0x13, 0x01, 0x02, 0xFF, 0x17, 0x01, 0x02, 0xFF, 0x1A, 0x01, 0x02,\n    0xFF, 0x1E, 0x01, 0x08, 0x01, 0x06, 0x01, 0x02, 0xFF, 0x21, 0x01, 0x02,\n    0xFF, 0x22, 0xFF, 0x00, 0xFF, 0x20, 0xFF, 0x1F, 0xFF, 0x0C, 0xFF, 0x05,\n    0x01, 0x0E, 0x01, 0x02, 0xFF, 0x09, 0x01, 0x02, 0xFF, 0x01, 0x01, 0x08,\n    0x01, 0x06, 0x01, 0x02, 0xFF, 0x14, 0x01, 0x02, 0xFF, 0x19, 0xFF, 0x18,\n    0xFF, 0x12, 0xFF, 0x11, 0x01, 0x02, 0xFF, 0x06, 0x01, 0x02, 0xFF, 0x0B,\n    0xFF, 0x0D\n};\n\nstatic const uint8_t huff_tnl_grp_2[] = {\n    0x01, 0x38, 0x01, 0x1C, 0x01, 0x18, 0x01, 0x16, 0x01, 0x14, 0x01, 0x04,\n    0x01, 0x02, 0xFF, 0x0E, 0xFF, 0x11, 0x01, 0x02, 0xFF, 0x0F, 0x01, 0x0C,\n    0x01, 0x02, 0xFF, 0x17, 0x01, 0x02, 0xFF, 0x1C, 0x01, 0x02, 0xFF, 0x1D,\n    0x01, 0x04, 0x01, 0x02, 0xFF, 0x1E, 0xFF, 0x00, 0xFF, 0x1F, 0xFF, 0x19,\n    0xFF, 0x0A, 0xFF, 0x08, 0x01, 0x02, 0xFF, 0x09, 0xFF, 0x04, 0x01, 0x1A,\n    0x01, 0x0E, 0x01, 0x0C, 0x01, 0x0A, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x16,\n    0xFF, 0x03, 0x01, 0x02, 0xFF, 0x15, 0x01, 0x02, 0xFF, 0x1A, 0xFF, 0x1B,\n    0xFF, 0x0C, 0xFF, 0x0B, 0x01, 0x0A, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x10,\n    0xFF, 0x12, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x14, 0xFF, 0x18, 0xFF, 0x13,\n    0xFF, 0x0D, 0xFF, 0x05, 0x01, 0x02, 0xFF, 0x01, 0x01, 0x02, 0xFF, 0x06,\n    0xFF, 0x07\n};\n\nstatic const uint8_t huff_tnl_grp_3[] = {\n    0x01, 0x36, 0x01, 0x22, 0x01, 0x0C, 0x01, 0x0A, 0x01, 0x04, 0x01, 0x02,\n    0xFF, 0x08, 0xFF, 0x02, 0x01, 0x02, 0xFF, 0x07, 0x01, 0x02, 0xFF, 0x17,\n    0xFF, 0x0C, 0xFF, 0x05, 0x01, 0x10, 0x01, 0x0E, 0x01, 0x02, 0xFF, 0x0A,\n    0x01, 0x0A, 0x01, 0x02, 0xFF, 0x14, 0x01, 0x02, 0xFF, 0x19, 0x01, 0x02,\n    0xFF, 0x1A, 0x01, 0x02, 0xFF, 0x1B, 0xFF, 0x00, 0xFF, 0x16, 0xFF, 0x09,\n    0x01, 0x04, 0x01, 0x02, 0xFF, 0x0D, 0xFF, 0x11, 0xFF, 0x04, 0x01, 0x12,\n    0x01, 0x0A, 0x01, 0x06, 0x01, 0x02, 0xFF, 0x0E, 0x01, 0x02, 0xFF, 0x13,\n    0xFF, 0x18, 0x01, 0x02, 0xFF, 0x03, 0xFF, 0x0B, 0x01, 0x04, 0x01, 0x02,\n    0xFF, 0x15, 0xFF, 0x12, 0x01, 0x02, 0xFF, 0x10, 0xFF, 0x0F, 0xFF, 0x06,\n    0xFF, 0x01\n};\n\nstatic const uint8_t huff_tnl_grp_4[] = {\n    0x01, 0x2C, 0x01, 0x02, 0xFF, 0x02, 0x01, 0x12, 0x01, 0x10, 0x01, 0x08,\n    0x01, 0x06, 0x01, 0x02, 0xFF, 0x07, 0x01, 0x02, 0xFF, 0x0F, 0xFF, 0x15,\n    0xFF, 0x03, 0x01, 0x02, 0xFF, 0x06, 0x01, 0x02, 0xFF, 0x0D, 0x01, 0x02,\n    0xFF, 0x0E, 0xFF, 0x12, 0xFF, 0x04, 0x01, 0x08, 0x01, 0x02, 0xFF, 0x05,\n    0x01, 0x04, 0x01, 0x02, 0xFF, 0x0B, 0xFF, 0x0A, 0xFF, 0x14, 0x01, 0x0C,\n    0x01, 0x0A, 0x01, 0x08, 0x01, 0x02, 0xFF, 0x0C, 0x01, 0x02, 0xFF, 0x10,\n    0x01, 0x02, 0xFF, 0x16, 0xFF, 0x00, 0xFF, 0x11, 0xFF, 0x13, 0x01, 0x02,\n    0xFF, 0x08, 0xFF, 0x09, 0xFF, 0x01\n};\n\nstatic const uint8_t huff_tnl_scf[] = {\n    0x01, 0x1A, 0x01, 0x16, 0x01, 0x02, 0xFF, 0x03, 0x01, 0x12, 0x01, 0x10,\n    0x01, 0x02, 0xFF, 0x0B, 0x01, 0x0C, 0x01, 0x0A, 0x01, 0x02, 0xFF, 0x10,\n    0x01, 0x02, 0xFF, 0x11, 0x01, 0x02, 0xFF, 0x12, 0x01, 0x02, 0xFF, 0x13,\n    0xFF, 0x00, 0xFF, 0x0F, 0xFF, 0x0E, 0xFF, 0x09, 0xFF, 0x07, 0x01, 0x02,\n    0xFF, 0x02, 0xFF, 0x04, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x01, 0xFF, 0x05,\n    0x01, 0x08, 0x01, 0x06, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x0C, 0xFF, 0x0D,\n    0xFF, 0x0A, 0xFF, 0x08, 0xFF, 0x06\n};\n\nstatic const uint8_t huff_damp[] = {\n    0x01, 0x0C, 0x01, 0x02, 0xFF, 0x02, 0x01, 0x02, 0xFF, 0x03, 0x01, 0x02,\n    0xFF, 0x04, 0x01, 0x02, 0xFF, 0x05, 0x01, 0x02, 0xFF, 0x06, 0xFF, 0x00,\n    0xFF, 0x01\n};\n\nstatic const uint8_t huff_dph[] = {\n    0x01, 0x04, 0x01, 0x02, 0xFF, 0x02, 0xFF, 0x01, 0x01, 0x0C, 0x01, 0x04,\n    0x01, 0x02, 0xFF, 0x03, 0xFF, 0x07, 0x01, 0x06, 0x01, 0x02, 0xFF, 0x06,\n    0x01, 0x02, 0xFF, 0x05, 0xFF, 0x00, 0xFF, 0x04, 0xFF, 0x08\n};\n\nstatic const uint8_t huff_fst_rsd_amp[] = {\n    0x01, 0x26, 0x01, 0x1C, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x0C, 0xFF, 0x11,\n    0x01, 0x06, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x01, 0xFF, 0x08, 0xFF, 0x09,\n    0x01, 0x06, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x14, 0xFF, 0x03, 0xFF, 0x05,\n    0x01, 0x02, 0xFF, 0x06, 0x01, 0x02, 0xFF, 0x02, 0x01, 0x06, 0x01, 0x02,\n    0xFF, 0x16, 0x01, 0x02, 0xFF, 0x17, 0xFF, 0x00, 0xFF, 0x15, 0x01, 0x08,\n    0x01, 0x02, 0xFF, 0x0B, 0x01, 0x02, 0xFF, 0x13, 0x01, 0x02, 0xFF, 0x07,\n    0xFF, 0x04, 0xFF, 0x10, 0x01, 0x06, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x0A,\n    0xFF, 0x12, 0xFF, 0x0F, 0x01, 0x02, 0xFF, 0x0D, 0xFF, 0x0E\n};\n\nstatic const uint8_t huff_rsd_apprx[] = {\n    0x01, 0x02, 0xFF, 0x01, 0x01, 0x02, 0xFF, 0x02, 0x01, 0x02, 0xFF, 0x03,\n    0x01, 0x02, 0xFF, 0x04, 0x01, 0x02, 0xFF, 0x05, 0xFF, 0x00\n};\n\nstatic const uint8_t huff_rsd_amp[] = {\n    0x01, 0x20, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x02, 0xFF, 0x01, 0x01, 0x02,\n    0xFF, 0x05, 0x01, 0x18, 0x01, 0x16, 0x01, 0x12, 0x01, 0x0C, 0x01, 0x02,\n    0xFF, 0x0E, 0x01, 0x02, 0xFF, 0x14, 0x01, 0x02, 0xFF, 0x1A, 0x01, 0x04,\n    0x01, 0x02, 0xFF, 0x19, 0xFF, 0x20, 0xFF, 0x13, 0x01, 0x02, 0xFF, 0x10,\n    0x01, 0x02, 0xFF, 0x18, 0xFF, 0x11, 0x01, 0x02, 0xFF, 0x0C, 0xFF, 0x0D,\n    0xFF, 0x09, 0xFF, 0x07, 0x01, 0x02, 0xFF, 0x03, 0x01, 0x02, 0xFF, 0x04,\n    0x01, 0x1C, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x08, 0xFF, 0x0B, 0x01, 0x16,\n    0x01, 0x04, 0x01, 0x02, 0xFF, 0x12, 0xFF, 0x0F, 0x01, 0x10, 0x01, 0x0C,\n    0x01, 0x0A, 0x01, 0x02, 0xFF, 0x1E, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x24,\n    0xFF, 0x22, 0x01, 0x02, 0xFF, 0x1D, 0xFF, 0x00, 0xFF, 0x15, 0x01, 0x02,\n    0xFF, 0x1C, 0xFF, 0x17, 0xFF, 0x16, 0xFF, 0x0A, 0xFF, 0x06\n};\n\nstatic const uint8_t huff_avg_g3[] = {\n    0x01, 0x20, 0x01, 0x1E, 0x01, 0x0A, 0x01, 0x02, 0xFF, 0x0E, 0x01, 0x06,\n    0x01, 0x02, 0xFF, 0x0B, 0x01, 0x02, 0xFF, 0x13, 0xFF, 0x09, 0xFF, 0x0D,\n    0x01, 0x12, 0x01, 0x10, 0x01, 0x02, 0xFF, 0x0A, 0x01, 0x04, 0x01, 0x02,\n    0xFF, 0x14, 0xFF, 0x08, 0x01, 0x08, 0x01, 0x06, 0x01, 0x02, 0xFF, 0x06,\n    0x01, 0x02, 0xFF, 0x17, 0xFF, 0x00, 0xFF, 0x15, 0xFF, 0x07, 0xFF, 0x0C,\n    0xFF, 0x12, 0xFF, 0x10, 0x01, 0x02, 0xFF, 0x0F, 0xFF, 0x11\n};\n\nstatic const uint8_t huff_st_grid[] = {\n    0x01, 0x2A, 0x01, 0x28, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x04, 0xFF, 0x03,\n    0x01, 0x02, 0xFF, 0x08, 0x01, 0x20, 0x01, 0x0A, 0x01, 0x08, 0x01, 0x02,\n    0xFF, 0x0E, 0x01, 0x02, 0xFF, 0x07, 0x01, 0x02, 0xFF, 0x09, 0xFF, 0x16,\n    0xFF, 0x0C, 0x01, 0x14, 0x01, 0x0E, 0x01, 0x02, 0xFF, 0x10, 0x01, 0x02,\n    0xFF, 0x0B, 0x01, 0x02, 0xFF, 0x0D, 0x01, 0x04, 0x01, 0x02, 0xFF, 0x11,\n    0xFF, 0x0F, 0x01, 0x02, 0xFF, 0x18, 0xFF, 0x00, 0x01, 0x02, 0xFF, 0x12,\n    0x01, 0x02, 0xFF, 0x14, 0xFF, 0x02, 0xFF, 0x05, 0xFF, 0x0A, 0xFF, 0x01,\n    0xFF, 0x06\n};\n\nstatic const uint8_t * const huff_tnl_grp[] = {\n    huff_tnl_grp_0,\n    huff_tnl_grp_1,\n    huff_tnl_grp_2,\n    huff_tnl_grp_3,\n    huff_tnl_grp_4\n};\n\nstatic const size_t huff_tnl_size[] = {\n    sizeof(huff_tnl_grp_0),\n    sizeof(huff_tnl_grp_1),\n    sizeof(huff_tnl_grp_2),\n    sizeof(huff_tnl_grp_3),\n    sizeof(huff_tnl_grp_4)\n};\n"
  },
  {
    "path": "libdcadec/lbr_tables.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\nstatic const uint16_t fst_amp[44] = {\n       0,    1,    2,    3,\n       4,    6,    8,   10,\n      12,   16,   20,   24,\n      28,   36,   44,   52,\n      60,   76,   92,  108,\n     124,  156,  188,  220,\n     252,  316,  380,  444,\n     508,  636,  764,  892,\n    1020, 1276, 1532, 1788,\n    2044, 2556, 3068, 3580,\n    4092, 5116, 6140, 7164\n};\n\nstatic const uint8_t freq_to_sf[32] = {\n    0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,\n    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5\n};\n\nstatic const int8_t ph0_shift[8] = {\n    -32, +96, -96, +32, +96, -32, +32, -96\n};\n\nstatic const uint8_t bits_for_ch_num[8] = {\n    0, 1, 2, 2, 3, 3, 3, 3\n};\n\nstatic const uint8_t grid_1_to_scf[11] = {\n    0, 1, 2, 3, 4, 6, 7, 10, 14, 19, 26\n};\n\nstatic const uint8_t grid_2_to_scf[3] = {\n    4, 10, 18\n};\n\nstatic const uint8_t scf_to_grid_1[32] = {\n    0, 1, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7,\n    7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10\n};\n\nstatic const uint8_t scf_to_grid_2[32] = {\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,\n    1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2\n};\n\nstatic const uint8_t grid_2_codes_1[32] = {\n    66, 99, 65, 64, 66, 132, 65, 64, 66, 99, 65, 64, 66, 165, 65, 64,\n    66, 99, 65, 64, 66, 132, 65, 64, 66, 99, 65, 64, 66, 191, 65, 64\n};\n\nstatic const uint8_t grid_2_codes_2[16] = {\n    159, 38, 71, 38, 104, 38, 71, 38, 137, 38, 71, 38, 104, 38, 71, 38\n};\n\nstatic const uint8_t grid_2_codes_3[32] = {\n    74, 178, 108, 75, 74, 142, 112, 75, 74, 145, 108, 75, 74, 175, 112, 75,\n    74, 173, 108, 75, 74, 142, 112, 75, 74, 145, 108, 75, 74, 191, 112, 75\n};\n\nstatic const uint8_t grid_3_codes_1[32] = {\n    113, 48, 79, 48, 142, 48, 79, 48, 113, 48, 79, 48, 178, 48, 79, 48,\n    113, 48, 79, 48, 142, 48, 79, 48, 113, 48, 79, 48, 191, 48, 79, 48\n};\n\nstatic const uint8_t grid_3_codes_2[8] = {\n    45, 108, 45, 83, 45, 127, 45, 83\n};\n\nstatic const uint8_t grid_3_codes_3[16] = {\n    75, 52, 138, 52, 75, 52, 117, 52, 75, 52, 159, 52, 75, 52, 117, 52\n};\n\nstatic const uint8_t grid_1_weights[12][32] = {\n    {\n        128,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n    }, {\n          0, 128,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n    }, {\n          0,   0, 128,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n    }, {\n          0,   0,   0, 128,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n    }, {\n          0,   0,   0,   0, 128, 128,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n    }, {\n          0,   0,   0,   0,   0,   0, 128,  85,\n         43,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n    }, {\n          0,   0,   0,   0,   0,   0,   0,  43,\n         85, 128,  96,  64,  32,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n    }, {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,  32,  64,  96, 128, 102,  77,\n         51,  26,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n    }, {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,  26,  51,\n         77, 102, 128, 107,  85,  64,  43,  21,\n          0,   0,   0,   0,   0,   0,   0,   0,\n    }, {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,  21,  43,  64,  85, 107,\n        128, 110,  91,  73,  55,  37,  18,   0,\n    }, {\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,   0,   0,   0,   0,   0,   0,   0,\n          0,  18,  37,  55,  73,  91, 110, 128,\n    }\n};\n\nstatic const uint8_t sb_reorder[8][8] = {\n    { 0, 1, 2, 3, 4, 5, 6, 7 },\n    { 1, 0, 2, 3, 4, 5, 6, 7 },\n    { 3, 1, 0, 2, 4, 5, 6, 7 },\n    { 1, 2, 3, 0, 4, 5, 6, 7 },\n    { 1, 2, 5, 3, 0, 4, 6, 7 },\n    { 1, 2, 2, 5, 3, 0, 4, 6 },\n    { 1, 2, 2, 6, 5, 3, 0, 4 },\n    { 1, 2, 2, 6, 5, 4, 0, 3 }\n};\n\nstatic const int8_t lfe_delta_index_16[8] = {\n    -4, -3, -2, -1, 2, 4, 6, 8\n};\n\nstatic const int8_t lfe_delta_index_24[32] = {\n    -8, -8, -7, -7, -6, -6, -5, -5, -4, -4, -3, -3, -2, -2, -1, -1,\n     1,  1,  2,  2,  3,  3,  4,  4,  5,  5,  6,  6,  7,  7,  8,  8\n};\n\nstatic const uint8_t residual_code_len[64] = {\n    3, 2, 3, 2, 4, 2, 3, 2, 3, 2, 3, 2, 5, 2, 3, 2,\n    3, 2, 3, 2, 4, 2, 3, 2, 3, 2, 3, 2, 6, 2, 3, 2,\n    3, 2, 3, 2, 4, 2, 3, 2, 3, 2, 3, 2, 5, 2, 3, 2,\n    3, 2, 3, 2, 4, 2, 3, 2, 3, 2, 3, 2, 6, 2, 3, 2\n};\n\nstatic const uint8_t residual_code_val[64] = {\n    1, 2, 4, 3, 5, 2, 0, 3, 1, 2, 4, 3, 6, 2, 0, 3,\n    1, 2, 4, 3, 5, 2, 0, 3, 1, 2, 4, 3, 7, 2, 0, 3,\n    1, 2, 4, 3, 5, 2, 0, 3, 1, 2, 4, 3, 6, 2, 0, 3,\n    1, 2, 4, 3, 5, 2, 0, 3, 1, 2, 4, 3, 4, 2, 0, 3\n};\n\nstatic const uint16_t residual_pack_5_in_8[256] = {\n    0x0000, 0x0100, 0x0200, 0x0040, 0x0140, 0x0240, 0x0080, 0x0180,\n    0x0280, 0x0010, 0x0110, 0x0210, 0x0050, 0x0150, 0x0250, 0x0090,\n    0x0190, 0x0290, 0x0020, 0x0120, 0x0220, 0x0060, 0x0160, 0x0260,\n    0x00a0, 0x01a0, 0x02a0, 0x0004, 0x0104, 0x0204, 0x0044, 0x0144,\n    0x0244, 0x0084, 0x0184, 0x0284, 0x0014, 0x0114, 0x0214, 0x0054,\n    0x0154, 0x0254, 0x0094, 0x0194, 0x0294, 0x0024, 0x0124, 0x0224,\n    0x0064, 0x0164, 0x0264, 0x00a4, 0x01a4, 0x02a4, 0x0008, 0x0108,\n    0x0208, 0x0048, 0x0148, 0x0248, 0x0088, 0x0188, 0x0288, 0x0018,\n    0x0118, 0x0218, 0x0058, 0x0158, 0x0258, 0x0098, 0x0198, 0x0298,\n    0x0028, 0x0128, 0x0228, 0x0068, 0x0168, 0x0268, 0x00a8, 0x01a8,\n    0x02a8, 0x0001, 0x0101, 0x0201, 0x0041, 0x0141, 0x0241, 0x0081,\n    0x0181, 0x0281, 0x0011, 0x0111, 0x0211, 0x0051, 0x0151, 0x0251,\n    0x0091, 0x0191, 0x0291, 0x0021, 0x0121, 0x0221, 0x0061, 0x0161,\n    0x0261, 0x00a1, 0x01a1, 0x02a1, 0x0005, 0x0105, 0x0205, 0x0045,\n    0x0145, 0x0245, 0x0085, 0x0185, 0x0285, 0x0015, 0x0115, 0x0215,\n    0x0055, 0x0155, 0x0255, 0x0095, 0x0195, 0x0295, 0x0025, 0x0125,\n    0x0225, 0x0065, 0x0165, 0x0265, 0x00a5, 0x01a5, 0x02a5, 0x0009,\n    0x0109, 0x0209, 0x0049, 0x0149, 0x0249, 0x0089, 0x0189, 0x0289,\n    0x0019, 0x0119, 0x0219, 0x0059, 0x0159, 0x0259, 0x0099, 0x0199,\n    0x0299, 0x0029, 0x0129, 0x0229, 0x0069, 0x0169, 0x0269, 0x00a9,\n    0x01a9, 0x02a9, 0x0002, 0x0102, 0x0202, 0x0042, 0x0142, 0x0242,\n    0x0082, 0x0182, 0x0282, 0x0012, 0x0112, 0x0212, 0x0052, 0x0152,\n    0x0252, 0x0092, 0x0192, 0x0292, 0x0022, 0x0122, 0x0222, 0x0062,\n    0x0162, 0x0262, 0x00a2, 0x01a2, 0x02a2, 0x0006, 0x0106, 0x0206,\n    0x0046, 0x0146, 0x0246, 0x0086, 0x0186, 0x0286, 0x0016, 0x0116,\n    0x0216, 0x0056, 0x0156, 0x0256, 0x0096, 0x0196, 0x0296, 0x0026,\n    0x0126, 0x0226, 0x0066, 0x0166, 0x0266, 0x00a6, 0x01a6, 0x02a6,\n    0x000a, 0x010a, 0x020a, 0x004a, 0x014a, 0x024a, 0x008a, 0x018a,\n    0x028a, 0x001a, 0x011a, 0x021a, 0x005a, 0x015a, 0x025a, 0x009a,\n    0x019a, 0x029a, 0x002a, 0x012a, 0x022a, 0x006a, 0x016a, 0x026a,\n    0x00aa, 0x01aa, 0x02aa, 0x0003, 0x0103, 0x0203, 0x0043, 0x0143,\n    0x0243, 0x0083, 0x0183, 0x0283, 0x0013, 0x0113, 0x0213, 0x0053\n};\n\nstatic const uint8_t residual_pack_3_in_7[128][3] = {\n    { 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 2 }, { 0, 0, 3 },\n    { 0, 0, 4 }, { 0, 1, 0 }, { 0, 1, 1 }, { 0, 1, 2 },\n    { 0, 1, 3 }, { 0, 1, 4 }, { 0, 2, 0 }, { 0, 2, 1 },\n    { 0, 2, 2 }, { 0, 2, 3 }, { 0, 2, 4 }, { 0, 3, 0 },\n    { 0, 3, 1 }, { 0, 3, 2 }, { 0, 3, 3 }, { 0, 3, 4 },\n    { 0, 4, 0 }, { 0, 4, 1 }, { 0, 4, 2 }, { 0, 4, 3 },\n    { 0, 4, 4 }, { 1, 0, 0 }, { 1, 0, 1 }, { 1, 0, 2 },\n    { 1, 0, 3 }, { 1, 0, 4 }, { 1, 1, 0 }, { 1, 1, 1 },\n    { 1, 1, 2 }, { 1, 1, 3 }, { 1, 1, 4 }, { 1, 2, 0 },\n    { 1, 2, 1 }, { 1, 2, 2 }, { 1, 2, 3 }, { 1, 2, 4 },\n    { 1, 3, 0 }, { 1, 3, 1 }, { 1, 3, 2 }, { 1, 3, 3 },\n    { 1, 3, 4 }, { 1, 4, 0 }, { 1, 4, 1 }, { 1, 4, 2 },\n    { 1, 4, 3 }, { 1, 4, 4 }, { 2, 0, 0 }, { 2, 0, 1 },\n    { 2, 0, 2 }, { 2, 0, 3 }, { 2, 0, 4 }, { 2, 1, 0 },\n    { 2, 1, 1 }, { 2, 1, 2 }, { 2, 1, 3 }, { 2, 1, 4 },\n    { 2, 2, 0 }, { 2, 2, 1 }, { 2, 2, 2 }, { 2, 2, 3 },\n    { 2, 2, 4 }, { 2, 3, 0 }, { 2, 3, 1 }, { 2, 3, 2 },\n    { 2, 3, 3 }, { 2, 3, 4 }, { 2, 4, 0 }, { 2, 4, 1 },\n    { 2, 4, 2 }, { 2, 4, 3 }, { 2, 4, 4 }, { 3, 0, 0 },\n    { 3, 0, 1 }, { 3, 0, 2 }, { 3, 0, 3 }, { 3, 0, 4 },\n    { 3, 1, 0 }, { 3, 1, 1 }, { 3, 1, 2 }, { 3, 1, 3 },\n    { 3, 1, 4 }, { 3, 2, 0 }, { 3, 2, 1 }, { 3, 2, 2 },\n    { 3, 2, 3 }, { 3, 2, 4 }, { 3, 3, 0 }, { 3, 3, 1 },\n    { 3, 3, 2 }, { 3, 3, 3 }, { 3, 3, 4 }, { 3, 4, 0 },\n    { 3, 4, 1 }, { 3, 4, 2 }, { 3, 4, 3 }, { 3, 4, 4 },\n    { 4, 0, 0 }, { 4, 0, 1 }, { 4, 0, 2 }, { 4, 0, 3 },\n    { 4, 0, 4 }, { 4, 1, 0 }, { 4, 1, 1 }, { 4, 1, 2 },\n    { 4, 1, 3 }, { 4, 1, 4 }, { 4, 2, 0 }, { 4, 2, 1 },\n    { 4, 2, 2 }, { 4, 2, 3 }, { 4, 2, 4 }, { 4, 3, 0 },\n    { 4, 3, 1 }, { 4, 3, 2 }, { 4, 3, 3 }, { 4, 3, 4 },\n    { 4, 4, 0 }, { 4, 4, 1 }, { 4, 4, 2 }, { 4, 4, 3 },\n    { 4, 4, 4 }, { 5, 0, 0 }, { 5, 0, 1 }, { 5, 0, 2 }\n};\n\nstatic const float residual_level_2a[2] = {\n    -0.47, 0.47\n};\n\nstatic const float residual_level_2b[2] = {\n    -0.645, 0.645\n};\n\nstatic const float residual_level_3[3] = {\n    -0.645, 0.0, 0.645\n};\n\nstatic const float residual_level_5[5] = {\n    -0.875, -0.375, 0.0, 0.375, 0.875\n};\n\nstatic const float residual_level_8[8] = {\n    -1.0, -0.625, -0.291666667, 0.0, 0.25, 0.5, 0.75, 1.0\n};\n\nstatic const float residual_level_16[16] = {\n    -1.3125, -1.1375, -0.9625, -0.7875,\n    -0.6125, -0.4375, -0.2625, -0.0875,\n     0.0875,  0.2625,  0.4375,  0.6125,\n     0.7875,  0.9625,  1.1375,  1.3125\n};\n\nstatic const float synth_env[32] = {\n    0.00240763666390, 0.00960735979838, 0.02152983213390, 0.03806023374436,\n    0.05903936782582, 0.08426519384873, 0.11349477331863, 0.14644660940673,\n    0.18280335791818, 0.22221488349020, 0.26430163158700, 0.30865828381746,\n    0.35485766137277, 0.40245483899194, 0.45099142983522, 0.5,\n    0.54900857016478, 0.59754516100806, 0.64514233862723, 0.69134171618254,\n    0.73569836841300, 0.77778511650980, 0.81719664208182, 0.85355339059327,\n    0.88650522668137, 0.91573480615127, 0.94096063217418, 0.96193976625564,\n    0.97847016786610, 0.99039264020162, 0.99759236333610, 1.0\n};\n\nstatic const float corr_cf[32][11] = {\n    { -0.01179, 0.04281,  0.46712,  0.46345, -3.94525, 3.94525, -0.46345, -0.46712, -0.04281, 0.01179, -0.00299 },\n    { -0.00929, 0.04882,  0.45252,  0.37972, -3.85446, 4.03189, -0.55069, -0.4804,  -0.03599, 0.01445, -0.00229 },\n    { -0.00696, 0.05403,  0.43674,  0.29961, -3.75975, 4.11413, -0.64135, -0.49221, -0.02834, 0.01726, -0.00156 },\n    { -0.00481, 0.05847,  0.41993,  0.22319, -3.66138, 4.19175, -0.73529, -0.50241, -0.01983, 0.02021, -0.0008  },\n    { -0.00284, 0.06216,  0.40224,  0.15053, -3.55963, 4.26452, -0.83239, -0.51085, -0.01047, 0.02328, -0.00003 },\n    { -0.00105, 0.06515,  0.38378,  0.08168, -3.45475, 4.33225, -0.93249, -0.51738, -0.00024, 0.02646,  0.00074 },\n    {  0.00054, 0.06745,  0.36471,  0.01668, -3.34703, 4.39475, -1.03543, -0.52184,  0.01085, 0.02973,  0.00152 },\n    {  0.00195, 0.06912,  0.34515, -0.04445, -3.23676, 4.45185, -1.14105, -0.5241,   0.0228,  0.03306,  0.00228 },\n    {  0.00318, 0.07017,  0.32521, -0.10168, -3.12422, 4.50339, -1.24914, -0.524,    0.03561, 0.03643,  0.00302 },\n    {  0.00422, 0.07065,  0.30503, -0.15503, -3.00969, 4.54921, -1.35952, -0.52141,  0.04925, 0.03981,  0.00373 },\n    {  0.00508, 0.07061,  0.28471, -0.2045,  -2.89348, 4.58919, -1.47197, -0.51618,  0.0637,  0.04319,  0.0044  },\n    {  0.00577, 0.07007,  0.26436, -0.25013, -2.77587, 4.62321, -1.58627, -0.50818,  0.07895, 0.04652,  0.00501 },\n    {  0.00629, 0.06909,  0.2441,  -0.29194, -2.65716, 4.65118, -1.70219, -0.49727,  0.09494, 0.04979,  0.00556 },\n    {  0.00666, 0.06769,  0.224,   -0.33,    -2.53764, 4.67302, -1.81949, -0.48335,  0.11166, 0.05295,  0.00604 },\n    {  0.00687, 0.06592,  0.20416, -0.36435, -2.4176,  4.68866, -1.93791, -0.46627,  0.12904, 0.05597,  0.00642 },\n    {  0.00694, 0.06383,  0.18468, -0.39506, -2.29732, 4.69806, -2.0572,  -0.44593,  0.14705, 0.05881,  0.00671 },\n    {  0.00689, 0.06144,  0.16561, -0.42223, -2.1771,  4.7012,  -2.1771,  -0.42223,  0.16561, 0.06144,  0.00689 },\n    {  0.00671, 0.05881,  0.14705, -0.44593, -2.0572,  4.69806, -2.29732, -0.39506,  0.18468, 0.06383,  0.00694 },\n    {  0.00642, 0.05597,  0.12904, -0.46627, -1.93791, 4.68865, -2.41759, -0.36435,  0.20416, 0.06592,  0.00687 },\n    {  0.00604, 0.05295,  0.11166, -0.48334, -1.81949, 4.67301, -2.53763, -0.33,     0.224,   0.06769,  0.00666 },\n    {  0.00556, 0.04979,  0.09494, -0.49727, -1.70219, 4.65117, -2.65715, -0.29194,  0.24409, 0.06909,  0.00629 },\n    {  0.00501, 0.04652,  0.07894, -0.50818, -1.58627, 4.62321, -2.77587, -0.25013,  0.26436, 0.07007,  0.00577 },\n    {  0.0044,  0.04319,  0.0637,  -0.51618, -1.47197, 4.58919, -2.89348, -0.2045,   0.28471, 0.07061,  0.00508 },\n    {  0.00373, 0.03981,  0.04925, -0.52141, -1.35952, 4.54921, -3.0097,  -0.15503,  0.30503, 0.07065,  0.00422 },\n    {  0.00302, 0.03643,  0.03561, -0.524,   -1.24915, 4.50339, -3.12422, -0.10168,  0.32521, 0.07017,  0.00318 },\n    {  0.00228, 0.03306,  0.0228,  -0.5241,  -1.14105, 4.45186, -3.23677, -0.04445,  0.34515, 0.06912,  0.00195 },\n    {  0.00152, 0.02973,  0.01085, -0.52184, -1.03544, 4.39477, -3.34704,  0.01668,  0.36471, 0.06745,  0.00054 },\n    {  0.00074, 0.02646, -0.00024, -0.51738, -0.93249, 4.33226, -3.45476,  0.08168,  0.38378, 0.06515, -0.00105 },\n    { -0.00003, 0.02328, -0.01047, -0.51085, -0.83239, 4.26452, -3.55963,  0.15053,  0.40224, 0.06216, -0.00284 },\n    { -0.0008,  0.02021, -0.01983, -0.50241, -0.73529, 4.19174, -3.66138,  0.22319,  0.41993, 0.05847, -0.00481 },\n    { -0.00156, 0.01726, -0.02834, -0.49221, -0.64135, 4.11413, -3.75974,  0.29961,  0.43674, 0.05403, -0.00696 },\n    { -0.00229, 0.01445, -0.03599, -0.4804,  -0.55069, 4.03188, -3.85445,  0.37972,  0.45251, 0.04882, -0.00929 },\n};\n\nstatic const float quant_amp[57] = {\n   0.00048828125, 0.0014648438, 0.0023226703, 0.0032847517, 0.0046453401,\n   0.0065695033, 0.0092906803, 0.013139007, 0.018581361, 0.026278013,\n   0.037162721, 0.052556027, 0.074325442, 0.10511205, 0.14865088, 0.21022411,\n   0.29730177, 0.42044821, 0.59460354, 0.84089643, 1.1892071, 1.6817929,\n   2.3784142, 3.3635857, 4.7568283, 6.7271714, 9.5136566, 13.454343, 19.027313,\n   26.908686, 38.054626, 53.817371, 76.109253, 107.63474, 152.21851, 215.26949,\n   304.43701, 430.53897, 608.87402, 861.07794, 1217.748,  1722.1559, 2435.4961,\n   3444.3118, 4870.9922, 6888.6235, 9741.9844, 13777.247, 19483.969, 27554.494,\n   38967.938, 55108.988, 77935.875, 110217.98, 155871.75, 220435.95, 0.0\n};\n\nstatic const float st_coeff[34] = {\n   26.908686, 26.908686, 13.454342, 6.7271714, 3.3635857, 1.6817929,\n   0.84089643, 0.59460348, 0.42044821, 0.2973018, 0.21022411, 0.1486509,\n   0.1051121, 0.074325398, 0.052556001, 0.037162699, 0.03125, 0.026278,\n   0.0185814, 0.013139, 0.0092906998, 0.0065695001, 0.0046453001, 0.0032848001,\n   0.0023227001, 0.0016424, 0.0011613, 0.0005807, 0.0002903, 0.0001452,\n   0.0000726, 0.0000363, 0.0000182, 0.0\n};\n\nstatic const float long_window[128] = {\n    0.0, 0.0000074288241, 0.000052802097, 0.00017100701, 0.00039665322,\n    0.0007639461, 0.0013065579, 0.0020575011, 0.0030490046, 0.0043123914,\n    0.0058779628, 0.0077748829, 0.010031069, 0.012673087, 0.015726056, 0.019213546,\n    0.023157494, 0.027578127, 0.032493874, 0.037921317, 0.043875102, 0.05036791,\n    0.0574104, 0.065011166, 0.073176719, 0.081911445, 0.091217607, 0.10109533,\n    0.1115426, 0.12255528, 0.13412713, 0.14624982, 0.15891297, 0.17210421,\n    0.18580918, 0.20001164, 0.21469352, 0.22983496, 0.24541442, 0.26140878,\n    0.27779338, 0.29454213, 0.31162769, 0.32902139, 0.34669363, 0.36461368,\n    0.38275006, 0.40107045, 0.41954198, 0.43813133, 0.45680472, 0.47552827,\n    0.49426794, 0.5129897, 0.53165978, 0.55024469, 0.56871128, 0.58702713,\n    0.60516042, 0.62308013, 0.64075619, 0.65815955, 0.67526239, 0.69203806,\n    0.70846134, 0.72450846, 0.74015719, 0.75538683, 0.77017856, 0.78451514,\n    0.79838127, 0.81176347, 0.82465017, 0.8370316, 0.84890026, 0.86025023,\n    0.87107784, 0.88138127, 0.89116055, 0.90041775, 0.90915662, 0.91738296,\n    0.92510408, 0.932329, 0.93906844, 0.94533449, 0.95114064, 0.95650178,\n    0.96143377, 0.96595365, 0.9700793, 0.97382939, 0.97722322, 0.98028058,\n    0.98302156, 0.98546654, 0.98763585, 0.98954982, 0.9912284, 0.99269134,\n    0.99395788, 0.99504662, 0.99597543, 0.99676138, 0.99742073, 0.99796873,\n    0.99841964, 0.99878657, 0.99908173, 0.99931598, 0.99949932, 0.99964064,\n    0.99974757, 0.99982697, 0.99988467, 0.99992549, 0.99995363, 0.99997234,\n    0.99998432, 0.99999166, 0.99999589, 0.99999815, 0.99999928, 0.99999976,\n    0.99999994, 1.0, 1.0, 1.0\n};\n\nstatic const float lfe_step_size_16[101] = {\n    2.1362956633198035E-004, 2.4414807580797754E-004, 2.7466658528397473E-004,\n    2.7466658528397473E-004, 3.0518509475997192E-004, 3.3570360423596911E-004,\n    3.9674062318796350E-004, 4.2725913266396069E-004, 4.5777764213995788E-004,\n    5.1881466109195227E-004, 5.7985168004394665E-004, 6.1037018951994385E-004,\n    6.7140720847193823E-004, 7.6296273689992981E-004, 8.2399975585192419E-004,\n    9.1555528427991577E-004, 1.0071108127079073E-003, 1.0986663411358989E-003,\n    1.2207403790398877E-003, 1.3428144169438765E-003, 1.4648884548478652E-003,\n    1.6174810022278512E-003, 1.7700735496078372E-003, 1.9531846064638203E-003,\n    2.1362956633198035E-003, 2.3499252296517838E-003, 2.5940733054597613E-003,\n    2.8687398907437361E-003, 3.1434064760277108E-003, 3.4485915707876827E-003,\n    3.7842951750236518E-003, 4.1810357982116153E-003, 4.6082949308755760E-003,\n    5.0660725730155339E-003, 5.5543687246314890E-003, 6.1037018951994385E-003,\n    6.7445905941953795E-003, 7.4159978026673177E-003, 8.1484420300912512E-003,\n    8.9419232764671782E-003, 9.8574785607470940E-003, 1.0834070863979004E-002,\n    1.1932737205114903E-002, 1.3122959074678793E-002, 1.4435254982146673E-002,\n    1.5869624927518540E-002, 1.7456587420270394E-002, 1.9196142460402233E-002,\n    2.1118808557390057E-002, 2.3224585711233862E-002, 2.5543992431409649E-002,\n    2.8107547227393413E-002, 3.0915250099185155E-002, 3.4028138065736867E-002,\n    3.7415692617572556E-002, 4.1169469283120215E-002, 4.5258949552903834E-002,\n    4.9806207464827418E-002, 5.4780724509414958E-002, 6.0274056215094456E-002,\n    6.6286202581865905E-002, 7.2908719138157288E-002, 8.0202642902920618E-002,\n    8.8229010895107887E-002, 9.7048860133671075E-002, 1.0675374614703818E-001,\n    1.1743522446363720E-001, 1.2918485061189611E-001, 1.4209418012024294E-001,\n    1.5628528702658162E-001, 1.7191076387829218E-001, 1.8912320322275461E-001,\n    2.0804467909787286E-001, 2.2882778405102694E-001, 2.5171666615802485E-001,\n    2.7689443647572254E-001, 3.0457472457045198E-001, 3.3503219702749720E-001,\n    3.6854152043214211E-001, 4.0537736136967073E-001, 4.4593646046327096E-001,\n    4.9052400280770286E-001, 5.3956724753563035E-001, 5.9352397228919340E-001,\n    6.5288247322000792E-001, 7.1816156498916595E-001, 7.9000213629566329E-001,\n    8.6898403881954400E-001, 9.5590075380718409E-001, 1.0514847254860074E+000,\n    1.1566209906308176E+000, 1.2722861415448470E+000, 1.3995178075502792E+000,\n    1.5394756920072024E+000, 1.6934110538041323E+000, 1.8627582628864405E+000,\n    2.0490432447279274E+000, 2.2539445173497725E+000, 2.4793237098300120E+000,\n    2.7272865993224893E+000, 3.0000000000000000E+000\n};\n\nstatic const float lfe_step_size_24[144] = {\n    3.5762791128491298E-006, 3.9339070241340428E-006, 4.4107442391805934E-006,\n    4.7683721504655064E-006, 5.2452093655120570E-006, 5.8412558843202453E-006,\n    6.4373024031284336E-006, 7.0333489219366219E-006, 7.7486047445064479E-006,\n    8.4638605670762738E-006, 9.4175349971693751E-006, 1.0252000123500839E-005,\n    1.1324883857355578E-005, 1.2516976894971954E-005, 1.3709069932588331E-005,\n    1.5139581577727983E-005, 1.6570093222867636E-005, 1.8239023475530564E-005,\n    2.0146372335716766E-005, 2.2053721195902969E-005, 2.4318697967374082E-005,\n    2.6702884042606836E-005, 2.9444698029124504E-005, 3.2305721319403807E-005,\n    3.5643581824729662E-005, 3.9100651633817152E-005, 4.3034558657951193E-005,\n    4.7326093593370149E-005, 5.2094465743835655E-005, 5.7339675109347712E-005,\n    6.3061721689906320E-005, 6.9379814789273121E-005, 7.6293954407448102E-005,\n    8.3923349848192912E-005, 9.2268001111507552E-005, 1.0156632680491529E-004,\n    1.1169911762465449E-004, 1.2290479217824841E-004, 1.3518335046569711E-004,\n    1.4865400179076216E-004, 1.6355516476096688E-004, 1.7988683937631122E-004,\n    1.9788744424431852E-004, 2.1767618866875036E-004, 2.3949149125713007E-004,\n    2.6345256131321922E-004, 2.8979781744454115E-004, 3.1876567825861912E-004,\n    3.5059456236297636E-004, 3.8564209766889782E-004, 4.2426591208766842E-004,\n    4.6670442422681142E-004, 5.1331526199761173E-004, 5.6469447191887759E-004,\n    6.2108047259813216E-004, 6.8318851985794547E-004, 7.5149545091336386E-004,\n    8.2671652158695713E-004, 9.0932856909377204E-004, 1.0002852678639017E-003,\n    1.1003018737199156E-003, 1.2103320610919071E-003, 1.3314487137137310E-003,\n    1.4646055060154803E-003, 1.6109945310347714E-003, 1.7721655097205054E-003,\n    1.9493105351102991E-003, 2.1442177467605765E-003, 2.3586752842277626E-003,\n    2.5945904963720436E-003, 2.8539899413573674E-003, 3.1393770145627278E-003,\n    3.4533743206708813E-003, 3.7987236736683454E-003, 4.1785245154529228E-003,\n    4.5963531251374630E-003, 5.0560242004423382E-003, 5.5617100669992049E-003,\n    6.1178214690472445E-003, 6.7296036159519689E-003, 7.4025401356864135E-003,\n    8.1428299120461841E-003, 8.9571486660419298E-003, 9.8527681652031147E-003,\n    1.0838033060793050E-002, 1.1921884050593860E-002, 1.3114096297513997E-002,\n    1.4425517848195773E-002, 1.5868069633015350E-002, 1.7454864675386508E-002,\n    1.9200327301064409E-002, 2.1120431556753107E-002, 2.3232462791498040E-002,\n    2.5555613703204836E-002, 2.8111222757246822E-002, 3.0922297349250002E-002,\n    3.4014586688826884E-002, 3.7415985753057691E-002, 4.1157608170224208E-002,\n    4.5273428591898514E-002, 4.9800759530157987E-002, 5.4780847404104160E-002,\n    6.0258872539862694E-002, 6.6284783635709721E-002, 7.2913297762071824E-002,\n    8.0204615617348624E-002, 8.8225017574431602E-002, 9.7047578936526643E-002,\n    1.0675228914645780E-001, 1.1742748229831246E-001, 1.2917031397465634E-001,\n    1.4208735729305236E-001, 1.5629603341770570E-001, 1.7192568444319778E-001,\n    1.8911816944100493E-001, 2.0803001022696618E-001, 2.2883310661710579E-001,\n    2.5171640535788598E-001, 2.7688804589367461E-001, 3.0457679087839018E-001,\n    3.3503452957088109E-001, 3.6853794676517804E-001, 4.0539174144169587E-001,\n    4.4593089174400469E-001, 4.9052399283933557E-001, 5.3957635636047796E-001,\n    5.9353406352210802E-001, 6.5288742219059737E-001, 7.1817609288407480E-001,\n    7.8999373793527339E-001, 8.6899314749159184E-001, 9.5589243839889027E-001,\n    1.0514817299225008E+000, 1.1566298194682383E+000, 1.2722928848615747E+000,\n    1.3995221137430804E+000, 1.5394743131964581E+000, 1.6934218041207556E+000,\n    1.8627639845328312E+000, 2.0490403233814627E+000, 2.2539444272451910E+000,\n    2.4793389414952922E+000, 2.7272728356448215E+000, 2.9999998807906962E+000\n};\n\nstatic const float lfe_iir[5][4] = {\n    { -0.98618466, 1.9861259, 1.0, -1.9840510 },\n    { -0.98883152, 1.9887193, 1.0, -1.9979848 },\n    { -0.99252087, 1.9923381, 1.0, -1.9990897 },\n    { -0.99591690, 1.9956781, 1.0, -1.9993745 },\n    { -0.99872285, 1.9984550, 1.0, -1.9994639 }\n};\n"
  },
  {
    "path": "libdcadec/ta.c",
    "content": "/* Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#include <stdlib.h>\n#include <string.h>\n#include <stdio.h>\n#include <assert.h>\n\n#include \"compiler.h\"\n#include \"ta.h\"\n\n// Note: the actual minimum alignment is dictated by malloc(). It doesn't\n//       make sense to set this value higher than malloc's alignment.\n#define MIN_ALIGN 16\n\nstruct ta_header {\n    size_t size;                // size of the user allocation\n    struct ta_header *prev;     // ring list containing siblings\n    struct ta_header *next;\n    struct ta_ext_header *ext;\n};\n\nunion aligned_header {\n    struct ta_header ta;\n    // Make sure to satisfy typical alignment requirements\n    void *align_ptr;\n    int align_int;\n    double align_d;\n    long long align_ll;\n    char align_min[(sizeof(struct ta_header) + MIN_ALIGN - 1) & ~(MIN_ALIGN - 1)];\n};\n\n#define PTR_TO_HEADER(ptr) (&((union aligned_header *)(ptr) - 1)->ta)\n#define PTR_FROM_HEADER(h) ((void *)((union aligned_header *)(h) + 1))\n\n#define MAX_ALLOC (((size_t)-1) - sizeof(union aligned_header))\n\n// Needed for non-leaf allocations, or extended features such as destructors.\nstruct ta_ext_header {\n    struct ta_header *header;  // points back to normal header\n    struct ta_header children; // list of children, with this as sentinel\n    void (*destructor)(void *);\n};\n\n// ta_ext_header.children.size is set to this\n#define CHILDREN_SENTINEL ((size_t)-1)\n\nstatic struct ta_header *get_header(void *ptr)\n{\n    return ptr ? PTR_TO_HEADER(ptr) : NULL;\n}\n\nstatic struct ta_ext_header *get_or_alloc_ext_header(void *ptr)\n{\n    struct ta_header *h = get_header(ptr);\n    if (!h)\n        return NULL;\n    if (!h->ext) {\n        h->ext = malloc(sizeof(struct ta_ext_header));\n        if (!h->ext)\n            return NULL;\n        *h->ext = (struct ta_ext_header) {\n            .header = h,\n            .children = {\n                .next = &h->ext->children,\n                .prev = &h->ext->children,\n                // Needed by ta_find_parent():\n                .size = CHILDREN_SENTINEL,\n                .ext = h->ext,\n            },\n        };\n    }\n    return h->ext;\n}\n\n/* Set the parent allocation of ptr. If parent==NULL, remove the parent.\n * Setting parent==NULL (with ptr!=NULL) always succeeds, and unsets the\n * parent of ptr. Operations ptr==NULL always succeed and do nothing.\n * Returns true on success, false on OOM.\n *\n * Warning: if ta_parent is a direct or indirect child of ptr, things will go\n *          wrong. The function will apparently succeed, but creates circular\n *          parent links, which are not allowed.\n */\nbool ta_set_parent(void *ptr, void *ta_parent)\n{\n    struct ta_header *ch = get_header(ptr);\n    if (!ch)\n        return true;\n    struct ta_ext_header *parent_eh = get_or_alloc_ext_header(ta_parent);\n    if (ta_parent && !parent_eh) // do nothing on OOM\n        return false;\n    // Unlink from previous parent\n    if (ch->next) {\n        ch->next->prev = ch->prev;\n        ch->prev->next = ch->next;\n        ch->next = ch->prev = NULL;\n    }\n    // Link to new parent - insert at end of list (possibly orders destructors)\n    if (parent_eh) {\n        struct ta_header *children = &parent_eh->children;\n        ch->next = children;\n        ch->prev = children->prev;\n        children->prev->next = ch;\n        children->prev = ch;\n    }\n    return true;\n}\n\n/* Allocate size bytes of memory. If ta_parent is not NULL, this is used as\n * parent allocation (if ta_parent is freed, this allocation is automatically\n * freed as well). size==0 allocates a block of size 0 (i.e. returns non-NULL).\n * Returns NULL on OOM.\n */\nvoid *ta_alloc_size(void *ta_parent, size_t size)\n{\n    if (size >= MAX_ALLOC)\n        return NULL;\n    struct ta_header *h = malloc(sizeof(union aligned_header) + size);\n    if (!h)\n        return NULL;\n    *h = (struct ta_header) {.size = size};\n    void *ptr = PTR_FROM_HEADER(h);\n    if (!ta_set_parent(ptr, ta_parent)) {\n        ta_free(ptr);\n        return NULL;\n    }\n    return ptr;\n}\n\n/* Exactly the same as ta_alloc_size(), but the returned memory block is\n * initialized to 0.\n */\nvoid *ta_zalloc_size(void *ta_parent, size_t size)\n{\n    if (size >= MAX_ALLOC)\n        return NULL;\n    struct ta_header *h = calloc(1, sizeof(union aligned_header) + size);\n    if (!h)\n        return NULL;\n    *h = (struct ta_header) {.size = size};\n    void *ptr = PTR_FROM_HEADER(h);\n    if (!ta_set_parent(ptr, ta_parent)) {\n        ta_free(ptr);\n        return NULL;\n    }\n    return ptr;\n}\n\n/* Reallocate the allocation given by ptr and return a new pointer. Much like\n * realloc(), the returned pointer can be different, and on OOM, NULL is\n * returned.\n *\n * size==0 is equivalent to ta_free(ptr).\n * ptr==NULL is equivalent to ta_alloc_size(ta_parent, size).\n *\n * ta_parent is used only in the ptr==NULL case.\n *\n * Returns NULL if the operation failed.\n * NULL is also returned if size==0.\n */\nvoid *ta_realloc_size(void *ta_parent, void *ptr, size_t size)\n{\n    if (size >= MAX_ALLOC)\n        return NULL;\n    if (!size) {\n        ta_free(ptr);\n        return NULL;\n    }\n    if (!ptr)\n        return ta_alloc_size(ta_parent, size);\n    struct ta_header *h = get_header(ptr);\n    struct ta_header *old_h = h;\n    if (h->size == size)\n        return ptr;\n    h = realloc(h, sizeof(union aligned_header) + size);\n    if (!h)\n        return NULL;\n    h->size = size;\n    if (h != old_h) {\n        if (h->next) {\n            // Relink siblings\n            h->next->prev = h;\n            h->prev->next = h;\n        }\n        if (h->ext) {\n            // Relink children\n            h->ext->header = h;\n            h->ext->children.next->prev = &h->ext->children;\n            h->ext->children.prev->next = &h->ext->children;\n        }\n    }\n    return PTR_FROM_HEADER(h);\n}\n\n/* Return the allocated size of ptr. This returns the size parameter of the\n * most recent ta_alloc.../ta_realloc... call.\n * If ptr==NULL, return 0.\n */\nsize_t ta_get_size(void *ptr)\n{\n    struct ta_header *h = get_header(ptr);\n    return h ? h->size : 0;\n}\n\n/* Free all allocations that (recursively) have ptr as parent allocation, but\n * do not free ptr itself.\n */\nvoid ta_free_children(void *ptr)\n{\n    struct ta_header *h = get_header(ptr);\n    struct ta_ext_header *eh = h ? h->ext : NULL;\n    if (!eh)\n        return;\n    while (eh->children.next != &eh->children)\n        ta_free(PTR_FROM_HEADER(eh->children.next));\n}\n\n/* Free the given allocation, and all of its direct and indirect children.\n */\nvoid ta_free(void *ptr)\n{\n    struct ta_header *h = get_header(ptr);\n    if (!h)\n        return;\n    if (h->ext && h->ext->destructor)\n        h->ext->destructor(ptr);\n    ta_free_children(ptr);\n    if (h->next) {\n        // Unlink from sibling list\n        h->next->prev = h->prev;\n        h->prev->next = h->next;\n    }\n    free(h->ext);\n    free(h);\n}\n\n/* Set a destructor that is to be called when the given allocation is freed.\n * (Whether the allocation is directly freed with ta_free() or indirectly by\n * freeing its parent does not matter.) There is only one destructor. If an\n * destructor was already set, it's overwritten.\n *\n * The destructor will be called with ptr as argument. The destructor can do\n * almost anything, but it must not attempt to free or realloc ptr. The\n * destructor is run before the allocation's children are freed (also, before\n * their destructors are run).\n *\n * Returns false if ptr==NULL, or on OOM.\n */\nbool ta_set_destructor(void *ptr, void (*destructor)(void *))\n{\n    struct ta_ext_header *eh = get_or_alloc_ext_header(ptr);\n    if (!eh)\n        return false;\n    eh->destructor = destructor;\n    return true;\n}\n\n/* Return the ptr's parent allocation, or NULL if there isn't any.\n *\n * Warning: this has O(N) runtime complexity with N sibling allocations!\n */\nvoid *ta_find_parent(void *ptr)\n{\n    struct ta_header *h = get_header(ptr);\n    if (!h || !h->next)\n        return NULL;\n    for (struct ta_header *cur = h->next; cur != h; cur = cur->next) {\n        if (cur->size == CHILDREN_SENTINEL)\n            return PTR_FROM_HEADER(cur->ext->header);\n    }\n    return NULL;\n}\n\n/* Return a copy of str.\n * Returns NULL on OOM.\n */\nchar *ta_strdup(void *ta_parent, const char *str)\n{\n    if (str) {\n        size_t len = strlen(str) + 1;\n        char *dup = ta_alloc_size(ta_parent, len);\n        if (dup)\n            memcpy(dup, str, len);\n        return dup;\n    }\n    return NULL;\n}\n"
  },
  {
    "path": "libdcadec/ta.h",
    "content": "/* Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#ifndef TA_H_\n#define TA_H_\n\n#include <stddef.h>\n#include <stdbool.h>\n#include <stdarg.h>\n\nvoid *ta_alloc_size(void *ta_parent, size_t size);\nvoid *ta_zalloc_size(void *ta_parent, size_t size);\nvoid *ta_realloc_size(void *ta_parent, void *ptr, size_t size);\nsize_t ta_get_size(void *ptr);\nvoid ta_free(void *ptr);\nvoid ta_free_children(void *ptr);\nbool ta_set_destructor(void *ptr, void (*destructor)(void *));\nbool ta_set_parent(void *ptr, void *ta_parent);\nvoid *ta_find_parent(void *ptr);\nchar *ta_strdup(void *ta_parent, const char *str);\n\nstatic inline size_t ta_calc_array_size(size_t element_size, size_t count)\n{\n    if (count > (((size_t)-1) / element_size))\n        return (size_t)-1;\n    return element_size * count;\n}\n\nstatic inline int ta_zalloc_fast(void *ta_parent, void *ptr,\n                                 size_t count, size_t element_size)\n{\n    void **_ptr = ptr;\n    size_t old_size = ta_get_size(*_ptr);\n    size_t new_size = ta_calc_array_size(element_size, count);\n\n    if (old_size < new_size) {\n        ta_free(*_ptr);\n        if (!(*_ptr = ta_zalloc_size(ta_parent, new_size)))\n            return -1;\n        return 1;\n    }\n\n    return 0;\n}\n\nstatic inline int ta_alloc_fast(void *ta_parent, void *ptr,\n                                size_t count, size_t element_size)\n{\n    void **_ptr = ptr;\n    size_t old_size = ta_get_size(*_ptr);\n    size_t new_size = ta_calc_array_size(element_size, count);\n\n    if (old_size < new_size) {\n        ta_free(*_ptr);\n        if (!(*_ptr = ta_alloc_size(ta_parent, new_size)))\n            return -1;\n        return 1;\n    }\n\n    return 0;\n}\n\n#define ta_new(ta_parent, type)  (type *)ta_alloc_size(ta_parent, sizeof(type))\n#define ta_znew(ta_parent, type) (type *)ta_zalloc_size(ta_parent, sizeof(type))\n\n#define ta_new_array(ta_parent, type, count) \\\n    (type *)ta_alloc_size(ta_parent, ta_calc_array_size(sizeof(type), count))\n\n#define ta_znew_array(ta_parent, type, count) \\\n    (type *)ta_zalloc_size(ta_parent, ta_calc_array_size(sizeof(type), count))\n\n#define ta_new_array_size(ta_parent, element_size, count) \\\n    ta_alloc_size(ta_parent, ta_calc_array_size(element_size, count))\n\n#define ta_znew_array_size(ta_parent, element_size, count) \\\n    ta_zalloc_size(ta_parent, ta_calc_array_size(element_size, count))\n\n#define ta_realloc(ta_parent, ptr, type, count) \\\n    (type *)ta_realloc_size(ta_parent, ptr, ta_calc_array_size(sizeof(type), count))\n\n#endif\n"
  },
  {
    "path": "libdcadec/xll_decoder.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"common.h\"\n#include \"bitstream.h\"\n#include \"fixed_math.h\"\n#include \"xll_decoder.h\"\n#include \"exss_parser.h\"\n#include \"dmix_tables.h\"\n\n#include \"xll_tables.h\"\n\n#define XLL_PBR_SIZE    (240 << 10)\n\nstatic int parse_dmix_coeffs(struct xll_chset *chs)\n{\n    struct xll_decoder *xll = chs->decoder;\n    int m, n;\n\n    if (chs->primary_chset) {\n        m = dmix_primary_nch[chs->dmix_type];\n        n = chs->nchannels;\n    } else {\n        m = chs->hier_m;\n        n = chs->nchannels + 2; // Two extra columns for scales\n    }\n\n    // Reallocate downmix coefficients buffer\n    if (ta_zalloc_fast(xll->chset, &chs->dmix_coeff, m * n * 2, sizeof(int)) < 0)\n        return -DCADEC_ENOMEM;\n\n    // Setup buffer pointers for current and previous frame\n    bool valid = (chs->dmix_coeffs_signature == XLL_DMIX_SIGNATURE(chs));\n    chs->dmix_coeff_cur = chs->dmix_coeff + m * n * chs->dmix_coeffs_parity;\n    chs->dmix_coeff_pre = chs->dmix_coeff + m * n * (chs->dmix_coeffs_parity ^ valid);\n\n    if (chs->primary_chset) {\n        chs->dmix_scale_cur = chs->dmix_scale_pre = NULL;\n        chs->dmix_scale_inv_cur = chs->dmix_scale_inv_pre = NULL;\n    } else {\n        chs->dmix_scale_cur = chs->dmix_coeff_cur + m * chs->nchannels;\n        chs->dmix_scale_pre = chs->dmix_coeff_pre + m * chs->nchannels;\n        chs->dmix_scale_inv_cur = chs->dmix_coeff_cur + m * (chs->nchannels + 1);\n        chs->dmix_scale_inv_pre = chs->dmix_coeff_pre + m * (chs->nchannels + 1);\n    }\n\n    int *coeff_ptr = chs->dmix_coeff_cur;\n    for (int i = 0; i < m; i++) {\n        int scale_inv = 0;\n\n        // Downmix scale\n        // Only for non-primary channel sets\n        if (!chs->primary_chset) {\n            int code = bits_get(&xll->bits, 9);\n            int sign = (code >> 8) - 1;\n            unsigned int index = (code & 0xff) - 1;\n            if (index < 40 || index >= dca_countof(dmix_table)) {\n                xll_err(\"Invalid XLL downmix scale index\");\n                return -DCADEC_EBADDATA;\n            }\n            int scale = dmix_table[index];\n            scale_inv = dmix_table_inv[index - 40];\n            chs->dmix_scale_cur[i] = (scale ^ sign) - sign;\n            chs->dmix_scale_inv_cur[i] = (scale_inv ^ sign) - sign;\n        }\n\n        // Downmix coefficients\n        for (int j = 0; j < chs->nchannels; j++) {\n            int code = bits_get(&xll->bits, 9);\n            int sign = (code >> 8) - 1;\n            if (code &= 0xff) {\n                unsigned int index = code - 1;\n                if (index >= dca_countof(dmix_table)) {\n                    xll_err(\"Invalid XLL downmix coefficient index\");\n                    return -DCADEC_EBADDATA;\n                }\n                int coeff = dmix_table[index];\n                if (!chs->primary_chset)\n                    // Multiply by |InvDmixScale| to get |UndoDmixScale|\n                    coeff = mul16(scale_inv, coeff);\n                // Convert sign\n                *coeff_ptr++ = (coeff ^ sign) - sign;\n            } else {\n                *coeff_ptr++ = 0;\n            }\n        }\n    }\n\n    return 0;\n}\n\nstatic int chs_parse_header(struct xll_chset *chs, struct exss_asset *asset)\n{\n    struct xll_decoder *xll = chs->decoder;\n    int i, j, k, ret, header_pos = xll->bits.index;\n\n    // Size of channel set sub-header\n    int header_size = bits_get(&xll->bits, 10) + 1;\n\n    // Check CRC\n    if ((ret = bits_check_crc(&xll->bits, header_pos, header_pos + header_size * 8)) < 0) {\n        xll_err(\"Invalid XLL sub-header checksum\");\n        return ret;\n    }\n\n    // Number of channels in the channel set\n    chs->nchannels = bits_get(&xll->bits, 4) + 1;\n    if (chs->nchannels > XLL_MAX_CHANNELS) {\n        xll_err_once(\"Unsupported number of XLL channels (%d)\", chs->nchannels);\n        return -DCADEC_ENOSUP;\n    }\n\n    // Residual type\n    chs->residual_encode = bits_get(&xll->bits, chs->nchannels);\n\n    // PCM bit resolution\n    chs->pcm_bit_res = bits_get(&xll->bits, 5) + 1;\n\n    // Storage unit width\n    chs->storage_bit_res = bits_get(&xll->bits, 5) + 1;\n\n    // Original sampling frequency\n    chs->freq = exss_sample_rates[bits_get(&xll->bits, 4)];\n    if (chs->freq > 192000) {\n        xll_err_once(\"Unsupported XLL sampling frequency\");\n        return -DCADEC_ENOSUP;\n    }\n\n    // Sampling frequency modifier\n    chs->interpolate = bits_get(&xll->bits, 2);\n\n    // Which replacement set this channel set is member of\n    chs->replace_set_index = bits_get(&xll->bits, 2);\n    if (chs->replace_set_index) {\n        xll_err_once(\"Replacement sets are not supported\");\n        return -DCADEC_ENOSUP;\n    }\n\n    // Default replacement set flag\n    if (chs->replace_set_index)\n        bits_skip1(&xll->bits);\n\n    if (asset->one_to_one_map_ch_to_spkr) {\n        // Primary channel set flag\n        chs->primary_chset = bits_get1(&xll->bits);\n\n        // Downmix coefficients present in stream\n        chs->dmix_coeffs_present = bits_get1(&xll->bits);\n\n        // Downmix already performed by encoder\n        chs->dmix_embedded = chs->dmix_coeffs_present && bits_get1(&xll->bits);\n\n        // Downmix type\n        if (chs->dmix_coeffs_present && chs->primary_chset) {\n            chs->dmix_type = bits_get(&xll->bits, 3);\n            if (chs->dmix_type >= DMIX_TYPE_COUNT) {\n                xll_err(\"Invalid XLL primary channel set downmix type\");\n                return -DCADEC_EBADDATA;\n            }\n        }\n\n        // Whether the channel set is part of a hierarchy\n        chs->hier_chset = bits_get1(&xll->bits);\n\n        // Downmix coefficients\n        if (chs->dmix_coeffs_present && (ret = parse_dmix_coeffs(chs)) < 0)\n            return ret;\n\n        // Channel mask enabled\n        chs->ch_mask_enabled = bits_get1(&xll->bits);\n        if (chs->ch_mask_enabled) {\n            // Channel mask for set\n            chs->ch_mask = bits_get(&xll->bits, xll->ch_mask_nbits);\n            if (dca_popcount(chs->ch_mask) != chs->nchannels) {\n                xll_err(\"Invalid XLL channel mask\");\n                return -DCADEC_EBADDATA;\n            }\n        } else {\n            chs->ch_mask = 0;\n            // Angular speaker position table\n            for (i = 0; i < chs->nchannels; i++) {\n                bits_skip(&xll->bits, 9);\n                bits_skip(&xll->bits, 9);\n                bits_skip(&xll->bits, 7);\n            }\n        }\n    } else {\n        chs->primary_chset = true;\n        chs->dmix_coeffs_present = false;\n        chs->dmix_embedded = false;\n        chs->hier_chset = true;\n        chs->ch_mask_enabled = false;\n        chs->ch_mask = 0;\n\n        // Mapping coeffs present flag\n        if (bits_get1(&xll->bits)) {\n            xll_warn_once(\"Stream with speaker mapping coefficients\");\n\n            // Number of bits used to pack each\n            // channel-to-speaker mapping coefficient\n            int nchspkrcoefbits = 6 + 2 * bits_get(&xll->bits, 3);\n\n            // Number of loudspeaker configurations\n            int nspkrconfigs = bits_get(&xll->bits, 2) + 1;\n\n            for (i = 0; i < nspkrconfigs; i++) {\n                // Active channel mask for current configuration\n                int active_ch_mask = bits_get(&xll->bits, chs->nchannels);\n\n                // Number of speakers in current configuration\n                int nspeakers = bits_get(&xll->bits, 6) + 1;\n\n                // Speaker mask or polar coordinates flag\n                if (bits_get1(&xll->bits)) {\n                    // Speaker mask for current configuration\n                    bits_skip(&xll->bits, xll->ch_mask_nbits);\n                } else {\n                    // Angular speaker position table for current configuration\n                    for (j = 0; j < nspeakers; j++) {\n                        bits_skip(&xll->bits, 9);\n                        bits_skip(&xll->bits, 9);\n                        bits_skip(&xll->bits, 7);\n                    }\n                }\n\n                // Channel to loudspeaker mapping coefficients\n                for (j = 0; j < chs->nchannels; j++)\n                    if (active_ch_mask & (1 << j))\n                        bits_skip(&xll->bits, nchspkrcoefbits);\n            }\n        }\n    }\n\n    // Mark downmix coefficients invalid until filtering\n    chs->dmix_coeffs_signature = 0;\n\n    if (chs->freq > 96000)\n        // Extra frequency bands flag\n        chs->nfreqbands = 2 * (1 + bits_get1(&xll->bits));\n    else\n        chs->nfreqbands = 1;\n\n    if (chs->nfreqbands > XLL_MAX_BANDS) {\n        xll_err_once(\"Extra frequency bands are not supported\");\n        return -DCADEC_ENOSUP;\n    }\n\n    // Set the sampling frequency to that of the first frequency band.\n    // Frequency will be doubled again after bands assembly.\n    chs->freq >>= chs->nfreqbands - 1;\n\n    // Determine number of bits to read bit allocation coding parameter\n    if (chs->storage_bit_res > 16)\n        chs->nabits = 5;\n    else if (chs->storage_bit_res > 8)\n        chs->nabits = 4;\n    else\n        chs->nabits = 3;\n\n    // Account for embedded downmix and decimator saturation\n    if ((xll->nchsets > 1 || chs->nfreqbands > 1) && chs->nabits < 5)\n        chs->nabits++;\n\n    for (int band_i = 0; band_i < chs->nfreqbands; band_i++) {\n        struct xll_band *band = &chs->bands[band_i];\n\n        // Pairwise channel decorrelation\n        band->decor_enabled = bits_get1(&xll->bits);\n        if (band->decor_enabled && chs->nchannels > 1) {\n            // Original channel order\n            for (i = 0; i < chs->nchannels; i++) {\n                band->orig_order[i] = bits_get(&xll->bits, ch_nbits[chs->nchannels - 1]);\n                if (band->orig_order[i] >= chs->nchannels) {\n                    xll_err(\"Invalid original channel order\");\n                    return -DCADEC_EBADDATA;\n                }\n            }\n            // Pairwise channel coefficients\n            for (i = 0; i < chs->nchannels / 2; i++) {\n                if (bits_get1(&xll->bits))\n                    band->decor_coeff[i] = bits_get_signed_linear(&xll->bits, 7);\n                else\n                    band->decor_coeff[i] = 0;\n            }\n        } else {\n            for (i = 0; i < chs->nchannels; i++)\n                band->orig_order[i] = i;\n            for (i = 0; i < chs->nchannels / 2; i++)\n                band->decor_coeff[i] = 0;\n        }\n\n        // Adaptive predictor order\n        band->highest_pred_order = 0;\n        for (i = 0; i < chs->nchannels; i++) {\n            band->adapt_pred_order[i] = bits_get(&xll->bits, 4);\n            if (band->adapt_pred_order[i] > band->highest_pred_order)\n                band->highest_pred_order = band->adapt_pred_order[i];\n        }\n        if (band->highest_pred_order > xll->nsegsamples) {\n            xll_err(\"Invalid adaptive predicition order\");\n            return -DCADEC_EBADDATA;\n        }\n\n        // Fixed predictor order\n        for (i = 0; i < chs->nchannels; i++) {\n            if (band->adapt_pred_order[i] == 0)\n                band->fixed_pred_order[i] = bits_get(&xll->bits, 2);\n            else\n                band->fixed_pred_order[i] = 0;\n        }\n\n        // Adaptive predictor quantized reflection coefficients\n        for (i = 0; i < chs->nchannels; i++) {\n            for (j = 0; j < band->adapt_pred_order[i]; j++) {\n                k = bits_get_signed_linear(&xll->bits, 8);\n                if (k == -128) {\n                    xll_err(\"Invalid reflection coefficient index\");\n                    return -DCADEC_EBADDATA;\n                }\n                if (k < 0)\n                    band->adapt_refl_coeff[i][j] = -(int)refl_coeff_table[-k];\n                else\n                    band->adapt_refl_coeff[i][j] =  (int)refl_coeff_table[ k];\n            }\n        }\n\n        // Downmix performed by encoder in extension frequency band\n        band->dmix_embedded = chs->dmix_embedded && (band_i == 0 || bits_get1(&xll->bits));\n\n        // MSB/LSB split flag in extension frequency band\n        if ((band_i == 0 && xll->scalable_lsbs) || (band_i != 0 && bits_get1(&xll->bits))) {\n            // Size of LSB section in any segment\n            band->lsb_section_size = bits_get(&xll->bits, xll->seg_size_nbits);\n            if (band->lsb_section_size < 0 || band->lsb_section_size > xll->frame_size) {\n                xll_err(\"Invalid LSB section size\");\n                return -DCADEC_EBADDATA;\n            }\n\n            // Account for optional CRC bytes after LSB section\n            if (band->lsb_section_size && (xll->band_crc_present > 2 ||\n                                           (band_i == 0 && xll->band_crc_present > 1)))\n                band->lsb_section_size += 2;\n\n            // Number of bits to represent the samples in LSB part\n            for (i = 0; i < chs->nchannels; i++) {\n                band->nscalablelsbs[i] = bits_get(&xll->bits, 4);\n                if (band->nscalablelsbs[i] && !band->lsb_section_size) {\n                    xll_err(\"LSB section missing with non-zero LSB width\");\n                    return -DCADEC_EBADDATA;\n                }\n            }\n        } else {\n            band->lsb_section_size = 0;\n            for (i = 0; i < chs->nchannels; i++)\n                band->nscalablelsbs[i] = 0;\n        }\n\n        // Scalable resolution flag in extension frequency band\n        if ((band_i == 0 && xll->scalable_lsbs) || (band_i != 0 && bits_get1(&xll->bits))) {\n            // Number of bits discarded by authoring\n            for (i = 0; i < chs->nchannels; i++)\n                band->bit_width_adjust[i] = bits_get(&xll->bits, 4);\n        } else {\n            for (i = 0; i < chs->nchannels; i++)\n                band->bit_width_adjust[i] = 0;\n        }\n    }\n\n    // Reserved\n    // Byte align\n    // CRC16 of channel set sub-header\n    if ((ret = bits_seek(&xll->bits, header_pos + header_size * 8)) < 0)\n        xll_err(\"Read past end of XLL sub-header\");\n    return ret;\n}\n\nstatic int chs_alloc_msb_band_data(struct xll_chset *chs)\n{\n    struct xll_decoder *xll = chs->decoder;\n\n    // Reallocate MSB sample buffer\n    if (ta_zalloc_fast(xll->chset, &chs->sample_buffer1,\n                       (xll->nframesamples + XLL_DECI_HISTORY) *\n                       chs->nchannels * chs->nfreqbands, sizeof(int)) < 0)\n        return -DCADEC_ENOMEM;\n\n    int *ptr = chs->sample_buffer1 + XLL_DECI_HISTORY;\n    for (int band = 0; band < chs->nfreqbands; band++) {\n        for (int i = 0; i < chs->nchannels; i++) {\n            chs->bands[band].msb_sample_buffer[i] = ptr;\n            ptr += xll->nframesamples + XLL_DECI_HISTORY;\n        }\n    }\n\n    return 0;\n}\n\nstatic int chs_alloc_lsb_band_data(struct xll_chset *chs)\n{\n    struct xll_decoder *xll = chs->decoder;\n\n    // Number of frequency bands that have MSB/LSB split\n    int nfreqbands = 0;\n    for (int band = 0; band < chs->nfreqbands; band++)\n        if (chs->bands[band].lsb_section_size)\n            nfreqbands++;\n    if (!nfreqbands)\n        return 0;\n\n    // Reallocate LSB sample buffer\n    if (ta_zalloc_fast(xll->chset, &chs->sample_buffer2,\n                       xll->nframesamples * chs->nchannels * nfreqbands,\n                       sizeof(int)) < 0)\n        return -DCADEC_ENOMEM;\n\n    int *ptr = chs->sample_buffer2;\n    for (int band = 0; band < chs->nfreqbands; band++) {\n        if (chs->bands[band].lsb_section_size) {\n            for (int i = 0; i < chs->nchannels; i++) {\n                chs->bands[band].lsb_sample_buffer[i] = ptr;\n                ptr += xll->nframesamples;\n            }\n        } else {\n            for (int i = 0; i < chs->nchannels; i++)\n                chs->bands[band].lsb_sample_buffer[i] = NULL;\n        }\n    }\n\n    return 0;\n}\n\nstatic int chs_parse_band_data(struct xll_chset *chs, int band_i, int seg, int band_data_end)\n{\n    struct xll_decoder *xll = chs->decoder;\n    struct xll_band *band = &chs->bands[band_i];\n    int i, j, ret;\n\n    // Start unpacking MSB portion of the segment\n    // Unpack flag whether to reuse parameters from previous segment\n    if (!(seg && bits_get1(&xll->bits))) {\n        // Unpack segment type\n        // 0 - distinct coding parameters for each channel\n        // 1 - common coding parameters for all channels\n        chs->seg_common = bits_get1(&xll->bits);\n\n        // Determine number of coding parameters encoded in segment\n        int nparamsets = chs->seg_common ? 1 : chs->nchannels;\n\n        // Unpack Rice coding parameters\n        for (i = 0; i < nparamsets; i++) {\n            // Unpack Rice coding flag\n            // 0 - linear code, 1 - Rice code\n            chs->rice_code_flag[i] = bits_get1(&xll->bits);\n            // Unpack Hybrid Rice coding flag\n            // 0 - Rice code, 1 - Hybrid Rice code\n            if (!chs->seg_common && chs->rice_code_flag[i] && bits_get1(&xll->bits))\n                // Unpack binary code length for isolated samples\n                chs->bitalloc_hybrid_linear[i] = bits_get(&xll->bits, chs->nabits) + 1;\n            else\n                // 0 indicates no Hybrid Rice coding\n                chs->bitalloc_hybrid_linear[i] = 0;\n        }\n\n        // Unpack coding parameters\n        for (i = 0; i < nparamsets; i++) {\n            if (seg == 0) {\n                // Unpack coding parameter for part A of segment 0\n                chs->bitalloc_part_a[i] = bits_get(&xll->bits, chs->nabits);\n\n                // Adjust for the linear code\n                if (!chs->rice_code_flag[i] && chs->bitalloc_part_a[i])\n                    chs->bitalloc_part_a[i]++;\n\n                if (!chs->seg_common)\n                    chs->nsamples_part_a[i] = band->adapt_pred_order[i];\n                else\n                    chs->nsamples_part_a[i] = band->highest_pred_order;\n            } else {\n                chs->bitalloc_part_a[i] = 0;\n                chs->nsamples_part_a[i] = 0;\n            }\n\n            // Unpack coding parameter for part B of segment\n            chs->bitalloc_part_b[i] = bits_get(&xll->bits, chs->nabits);\n\n            // Adjust for the linear code\n            if (!chs->rice_code_flag[i] && chs->bitalloc_part_b[i])\n                chs->bitalloc_part_b[i]++;\n        }\n    }\n\n    // Unpack entropy codes\n    for (i = 0; i < chs->nchannels; i++) {\n        // Select index of coding parameters\n        int k = chs->seg_common ? 0 : i;\n\n        // Slice the segment into parts A and B\n        int *part_a = band->msb_sample_buffer[i] + seg * xll->nsegsamples;\n        int *part_b = part_a + chs->nsamples_part_a[k];\n        int nsamples_part_b = xll->nsegsamples - chs->nsamples_part_a[k];\n\n        if (!chs->rice_code_flag[k]) {\n            // Linear codes\n            // Unpack all residuals of part A of segment 0\n            bits_get_signed_linear_array(&xll->bits, part_a,\n                                         chs->nsamples_part_a[k],\n                                         chs->bitalloc_part_a[k]);\n\n            // Unpack all residuals of part B of segment 0 and others\n            bits_get_signed_linear_array(&xll->bits, part_b,\n                                         nsamples_part_b,\n                                         chs->bitalloc_part_b[k]);\n        } else {\n            // Rice codes\n            // Unpack all residuals of part A of segment 0\n            bits_get_signed_rice_array(&xll->bits, part_a,\n                                       chs->nsamples_part_a[k],\n                                       chs->bitalloc_part_a[k]);\n\n            if (chs->bitalloc_hybrid_linear[k]) {\n                // Hybrid Rice codes\n                // Unpack the number of isolated samples\n                int nisosamples = bits_get(&xll->bits, xll->nsegsamples_log2);\n\n                // Set all locations to 0\n                memset(part_b, 0, sizeof(*part_b) * nsamples_part_b);\n\n                // Extract the locations of isolated samples and flag by -1\n                for (j = 0; j < nisosamples; j++) {\n                    int loc = bits_get(&xll->bits, xll->nsegsamples_log2);\n                    if (loc >= nsamples_part_b) {\n                        xll_err(\"Invalid isolated sample location\");\n                        return -DCADEC_EBADDATA;\n                    }\n                    part_b[loc] = -1;\n                }\n\n                // Unpack all residuals of part B of segment 0 and others\n                for (j = 0; j < nsamples_part_b; j++) {\n                    if (part_b[j] == -1)\n                        part_b[j] = bits_get_signed_linear(&xll->bits,\n                                                           chs->bitalloc_hybrid_linear[k]);\n                    else\n                        part_b[j] = bits_get_signed_rice(&xll->bits,\n                                                         chs->bitalloc_part_b[k]);\n                }\n            } else {\n                // Rice codes\n                // Unpack all residuals of part B of segment 0 and others\n                bits_get_signed_rice_array(&xll->bits, part_b,\n                                           nsamples_part_b,\n                                           chs->bitalloc_part_b[k]);\n            }\n        }\n    }\n\n    // Unpack decimator history for frequency band 1\n    if (seg == 0 && band_i == XLL_BAND_1) {\n        int nbits = bits_get(&xll->bits, 5) + 1;\n        for (i = 0; i < chs->nchannels; i++)\n            for (j = 1; j < XLL_DECI_HISTORY; j++)\n                chs->deci_history[i][j] = bits_get_signed(&xll->bits, nbits);\n    }\n\n    // Start unpacking LSB portion of the segment\n    if (band->lsb_section_size) {\n        // Skip to the start of LSB portion\n        if ((ret = bits_seek(&xll->bits, band_data_end -\n                             band->lsb_section_size * 8)) < 0) {\n            xll_err(\"Read past end of band data\");\n            return ret;\n        }\n\n        // Unpack all LSB parts of residuals of this segment\n        for (i = 0; i < chs->nchannels; i++) {\n            if (band->nscalablelsbs[i]) {\n                bits_get_array(&xll->bits,\n                               band->lsb_sample_buffer[i] +\n                               seg * xll->nsegsamples,\n                               xll->nsegsamples,\n                               band->nscalablelsbs[i]);\n            }\n        }\n    }\n\n    // Skip to the end of band data\n    if ((ret = bits_seek(&xll->bits, band_data_end)) < 0)\n        xll_err(\"Read past end of band data\");\n    return ret;\n}\n\nstatic void chs_clear_band_data(struct xll_chset *chs, int band_i, int seg)\n{\n    struct xll_decoder *xll = chs->decoder;\n    struct xll_band *band = &chs->bands[band_i];\n\n    for (int i = 0; i < chs->nchannels; i++)\n        memset(band->msb_sample_buffer[i] +\n               seg * xll->nsegsamples, 0, xll->nsegsamples * sizeof(int));\n\n    if (seg == 0 && band_i == XLL_BAND_1)\n        memset(chs->deci_history, 0, sizeof(chs->deci_history));\n\n    if (band->lsb_section_size)\n        for (int i = 0; i < chs->nchannels; i++)\n            memset(band->lsb_sample_buffer[i] +\n                   seg * xll->nsegsamples, 0, xll->nsegsamples * sizeof(int));\n}\n\nvoid xll_clear_band_data(struct xll_chset *chs, int band_i)\n{\n    struct xll_decoder *xll = chs->decoder;\n    struct xll_band *band = &chs->bands[band_i];\n\n    for (int i = 0; i < chs->nchannels; i++)\n        memset(band->msb_sample_buffer[i], 0, xll->nframesamples * sizeof(int));\n\n    if (band_i == XLL_BAND_1)\n        memset(chs->deci_history, 0, sizeof(chs->deci_history));\n\n    if (band->lsb_section_size)\n        for (int i = 0; i < chs->nchannels; i++)\n            memset(band->lsb_sample_buffer[i], 0, xll->nframesamples * sizeof(int));\n\n    memset(band->nscalablelsbs, 0, sizeof(band->nscalablelsbs));\n    memset(band->bit_width_adjust, 0, sizeof(band->bit_width_adjust));\n}\n\nvoid xll_filter_band_data(struct xll_chset *chs, int band_i)\n{\n    struct xll_decoder *xll = chs->decoder;\n    struct xll_band *band = &chs->bands[band_i];\n    int nsamples = xll->nframesamples;\n    int i, j, k;\n\n    // Inverse adaptive or fixed prediction\n    for (i = 0; i < chs->nchannels; i++) {\n        int *buf = band->msb_sample_buffer[i];\n        int order = band->adapt_pred_order[i];\n        if (order > 0) {\n            int coeff[XLL_MAX_ADAPT_PRED_ORDER];\n            // Conversion from reflection coefficients to direct form coefficients\n            for (j = 0; j < order; j++) {\n                int rc = band->adapt_refl_coeff[i][j];\n                for (k = 0; k < (j + 1) / 2; k++) {\n                    int tmp1 = coeff[    k    ];\n                    int tmp2 = coeff[j - k - 1];\n                    coeff[    k    ] = tmp1 + mul16(rc, tmp2);\n                    coeff[j - k - 1] = tmp2 + mul16(rc, tmp1);\n                }\n                coeff[j] = rc;\n            }\n            for (j = 0; j < nsamples - order; j++) {\n                int64_t err = INT64_C(0);\n                for (k = 0; k < order; k++)\n                    err += (int64_t)buf[j + k] * coeff[order - k - 1];\n                // Round and scale the prediction\n                // Calculate the original sample\n                buf[j + k] -= clip23(norm16(err));\n            }\n        } else {\n            // Inverse fixed coefficient prediction\n            for (j = 0; j < band->fixed_pred_order[i]; j++)\n                for (k = 1; k < nsamples; k++)\n                    buf[k] += buf[k - 1];\n        }\n    }\n\n    // Inverse pairwise channel decorrellation\n    if (band->decor_enabled) {\n        for (i = 0; i < chs->nchannels / 2; i++) {\n            int coeff = band->decor_coeff[i];\n            if (coeff) {\n                int *src = band->msb_sample_buffer[i * 2 + 0];\n                int *dst = band->msb_sample_buffer[i * 2 + 1];\n                for (j = 0; j < nsamples; j++)\n                    dst[j] += mul3(src[j], coeff);\n            }\n        }\n\n        // Reorder channel pointers to the original order\n        int *tmp[XLL_MAX_CHANNELS];\n        for (i = 0; i < chs->nchannels; i++)\n            tmp[i] = band->msb_sample_buffer[i];\n        for (i = 0; i < chs->nchannels; i++)\n            band->msb_sample_buffer[band->orig_order[i]] = tmp[i];\n    }\n\n    // Map output channel pointers for frequency band 0\n    if (band_i == XLL_BAND_0)\n        for (i = 0; i < chs->nchannels; i++)\n            chs->out_sample_buffer[i] = band->msb_sample_buffer[i];\n}\n\nint xll_get_lsb_width(struct xll_chset *chs, int band, int ch)\n{\n    struct xll_decoder *xll = chs->decoder;\n    int adj = chs->bands[band].bit_width_adjust[ch];\n    int shift = chs->bands[band].nscalablelsbs[ch];\n\n    if (xll->fixed_lsb_width)\n        shift = xll->fixed_lsb_width;\n    else if (shift && adj)\n        shift += adj - 1;\n    else\n        shift += adj;\n\n    return shift;\n}\n\nvoid xll_assemble_msbs_lsbs(struct xll_chset *chs, int band_i)\n{\n    struct xll_decoder *xll = chs->decoder;\n    struct xll_band *band = &chs->bands[band_i];\n    int nsamples = xll->nframesamples;\n\n    for (int ch = 0; ch < chs->nchannels; ch++) {\n        int shift = xll_get_lsb_width(chs, band_i, ch);\n        if (shift) {\n            int *msb = band->msb_sample_buffer[ch];\n            if (band->nscalablelsbs[ch]) {\n                int *lsb = band->lsb_sample_buffer[ch];\n                int adj = band->bit_width_adjust[ch];\n                for (int n = 0; n < nsamples; n++)\n                    msb[n] = msb[n] * (1 << shift) + (lsb[n] << adj);\n            } else {\n                for (int n = 0; n < nsamples; n++)\n                    msb[n] = msb[n] * (1 << shift);\n            }\n        }\n    }\n}\n\nstatic void filter0(int *dst, const int *src, int nsamples)\n{\n    for (int n = 0; n < nsamples; n++)\n        dst[n] -= src[n];\n}\n\nstatic void filter1(int *dst, const int *src, int nsamples, int32_t coeff)\n{\n    for (int n = 0; n < nsamples; n++)\n        dst[n] -= mul22(src[n], coeff);\n}\n\nstatic void filter2(int *dst, const int *src, int nsamples, int32_t coeff)\n{\n    for (int n = 0; n < nsamples; n++)\n        dst[n] -= mul23(src[n], coeff);\n}\n\nstatic int chs_assemble_freq_bands(struct xll_chset *chs)\n{\n    struct xll_decoder *xll = chs->decoder;\n    int nsamples = xll->nframesamples;\n\n    assert(chs->nfreqbands > 1);\n\n    // Reallocate frequency band assembly buffer\n    if (ta_alloc_fast(xll->chset, &chs->sample_buffer3,\n                      2 * nsamples * chs->nchannels, sizeof(int)) < 0)\n        return -DCADEC_ENOMEM;\n\n    // Assemble frequency bands 0 and 1\n    int *ptr = chs->sample_buffer3;\n    for (int ch = 0; ch < chs->nchannels; ch++) {\n        // Remap output channel pointer to assembly buffer\n        chs->out_sample_buffer[ch] = ptr;\n\n        int *band0 = chs->bands[XLL_BAND_0].msb_sample_buffer[ch];\n        int *band1 = chs->bands[XLL_BAND_1].msb_sample_buffer[ch];\n\n        // Copy decimator history\n        for (int i = 1; i < XLL_DECI_HISTORY; i++)\n            band0[i - XLL_DECI_HISTORY] = chs->deci_history[ch][i];\n\n        // Filter\n        filter1(band0, band1, nsamples, band_coeff_table0[0]);\n        filter1(band1, band0, nsamples, band_coeff_table0[1]);\n        filter1(band0, band1, nsamples, band_coeff_table0[2]);\n        filter0(band1, band0, nsamples);\n\n        for (int i = 0; i < XLL_DECI_HISTORY; i++) {\n            filter2(band0, band1, nsamples, band_coeff_table1[i]);\n            filter2(band1, band0, nsamples, band_coeff_table2[i]);\n            filter2(band0, band1, nsamples, band_coeff_table1[i]);\n            band0--;\n        }\n\n        // Assemble\n        for (int i = 0; i < nsamples; i++) {\n            *ptr++ = *band1++;\n            *ptr++ = *++band0;\n        }\n    }\n\n    return 0;\n}\n\nint xll_assemble_freq_bands(struct xll_decoder *xll)\n{\n    int ret;\n\n    for (int i = 0; i < xll->nactivechsets; i++)\n        if ((ret = chs_assemble_freq_bands(&xll->chset[i])) < 0)\n            return ret;\n\n    return 0;\n}\n\nint xll_map_ch_to_spkr(struct xll_chset *chs, int ch)\n{\n    struct xll_decoder *xll = chs->decoder;\n\n    if (chs->ch_mask_enabled) {\n        for (int spkr = 0, pos = 0; spkr < xll->ch_mask_nbits; spkr++)\n            if (chs->ch_mask & (1U << spkr))\n                if (pos++ == ch)\n                    return spkr;\n        return -1;  // Invalid\n    }\n\n    // Map to LtRt\n    if (chs->nchannels == 2) {\n        if (ch == 0)\n            return SPEAKER_L;\n        if (ch == 1)\n            return SPEAKER_R;\n    }\n\n    return -1;\n}\n\nstatic int parse_common_header(struct xll_decoder *xll)\n{\n    int ret;\n\n    // XLL extension sync word\n    if (bits_get(&xll->bits, 32) != SYNC_WORD_XLL) {\n        xll_verbose(\"Invalid XLL sync word\");\n        return -DCADEC_ENOSYNC;\n    }\n\n    // Version number\n    int stream_ver = bits_get(&xll->bits, 4) + 1;\n    if (stream_ver > 1) {\n        xll_err_once(\"Unsupported XLL stream version (%d)\", stream_ver);\n        return -DCADEC_ENOSUP;\n    }\n\n    // Lossless frame header length\n    int header_size = bits_get(&xll->bits, 8) + 1;\n\n    // Check CRC\n    if ((ret = bits_check_crc(&xll->bits, 32, header_size * 8)) < 0) {\n        xll_err(\"Invalid XLL common header checksum\");\n        return ret;\n    }\n\n    // Number of bits used to read frame size\n    int frame_size_nbits = bits_get(&xll->bits, 5) + 1;\n\n    // Number of bytes in a lossless frame\n    xll->frame_size = bits_get(&xll->bits, frame_size_nbits);\n    if (xll->frame_size < 0 || xll->frame_size >= XLL_PBR_SIZE) {\n        xll_err(\"Invalid XLL frame size\");\n        return -DCADEC_EBADDATA;\n    }\n    xll->frame_size++;\n\n    // Number of channels sets per frame\n    xll->nchsets = bits_get(&xll->bits, 4) + 1;\n    if (xll->nchsets > 3)\n        xll_warn_once(\"Stream with %d channel sets\", xll->nchsets);\n\n    // Number of segments per frame\n    int nframesegs_log2 = bits_get(&xll->bits, 4);\n    xll->nframesegs = 1 << nframesegs_log2;\n    if (xll->nframesegs > 1024) {\n        xll_err(\"Too many segments per frame\");\n        return -DCADEC_EBADDATA;\n    }\n\n    // Samples in segment per one frequency band for the first channel set\n    // Maximum value is 256 for sampling frequencies <= 48 kHz\n    // Maximum value is 512 for sampling frequencies > 48 kHz\n    xll->nsegsamples_log2 = bits_get(&xll->bits, 4);\n    if (!xll->nsegsamples_log2) {\n        xll_err(\"Too few samples per segment\");\n        return -DCADEC_EBADDATA;\n    }\n    xll->nsegsamples = 1 << xll->nsegsamples_log2;\n    if (xll->nsegsamples > 512) {\n        xll_err(\"Too many samples per segment\");\n        return -DCADEC_EBADDATA;\n    }\n\n    // Samples in frame per one frequency band for the first channel set\n    xll->nframesamples_log2 = xll->nsegsamples_log2 + nframesegs_log2;\n    xll->nframesamples = 1 << xll->nframesamples_log2;\n    if (xll->nframesamples > 65536) {\n        xll_err(\"Too many samples per frame\");\n        return -DCADEC_EBADDATA;\n    }\n\n    // Number of bits used to read segment size\n    xll->seg_size_nbits = bits_get(&xll->bits, 5) + 1;\n\n    // Presence of CRC16 within each frequency band\n    // 0 - No CRC16 within band\n    // 1 - CRC16 placed at the end of MSB0\n    // 2 - CRC16 placed at the end of MSB0 and LSB0\n    // 3 - CRC16 placed at the end of MSB0 and LSB0 and other frequency bands\n    xll->band_crc_present = bits_get(&xll->bits, 2);\n    if (xll->band_crc_present)\n        xll_warn_once(\"Stream with band CRC present (%d)\", xll->band_crc_present);\n\n    // MSB/LSB split flag\n    xll->scalable_lsbs = bits_get1(&xll->bits);\n\n    // Channel position mask\n    xll->ch_mask_nbits = bits_get(&xll->bits, 5) + 1;\n\n    // Fixed LSB width\n    if (xll->scalable_lsbs)\n        xll->fixed_lsb_width = bits_get(&xll->bits, 4);\n    else\n        xll->fixed_lsb_width = 0;\n    if (xll->fixed_lsb_width)\n        xll_warn_once(\"Stream with fixed LSB width (%d)\", xll->fixed_lsb_width);\n\n    // Reserved\n    // Byte align\n    // Header CRC16 protection\n    if ((ret = bits_seek(&xll->bits, header_size * 8)) < 0)\n        xll_err(\"Read past end of XLL common header\");\n    return ret;\n}\n\nstatic int parse_sub_headers(struct xll_decoder *xll, struct exss_asset *asset)\n{\n    struct xll_chset *chs;\n    int i, ret;\n\n    // Reallocate channel sets\n    if (ta_zalloc_fast(xll, &xll->chset, xll->nchsets, sizeof(struct xll_chset)) < 0)\n        return -DCADEC_ENOMEM;\n\n    // Parse channel set headers\n    xll->nfreqbands = 0;\n    xll->nchannels = 0;\n    for (i = 0, chs = xll->chset; i < xll->nchsets; i++, chs++) {\n        chs->decoder = xll;\n        chs->hier_m = xll->nchannels;\n        if ((ret = chs_parse_header(chs, asset)) < 0)\n            return ret;\n        if (chs->nfreqbands > xll->nfreqbands)\n            xll->nfreqbands = chs->nfreqbands;\n        if (chs->hier_chset)\n            xll->nchannels += chs->nchannels;\n    }\n\n    // Number of active channel sets to decode\n    if (xll->flags & DCADEC_FLAG_KEEP_DMIX_2CH)\n        xll->nactivechsets = 1;\n    else if (xll->flags & DCADEC_FLAG_KEEP_DMIX_6CH)\n        xll->nactivechsets = (xll->chset->nchannels < 5 && xll->nchsets > 1) ? 2 : 1;\n    else\n        xll->nactivechsets = xll->nchsets;\n\n    return 0;\n}\n\nstatic int parse_navi_table(struct xll_decoder *xll)\n{\n    struct xll_chset *chs;\n    int i;\n\n    int navi_nb = xll->nfreqbands * xll->nframesegs * xll->nchsets;\n    if (navi_nb > 1024) {\n        xll_err(\"Too many NAVI entries\");\n        return -DCADEC_EBADDATA;\n    }\n\n    // Reallocate NAVI table\n    if (ta_alloc_fast(xll, &xll->navi, navi_nb, sizeof(*xll->navi)) < 0)\n        return -DCADEC_ENOMEM;\n\n    // Parse NAVI\n    int navi_pos = xll->bits.index;\n    int *navi_ptr = xll->navi;\n    for (int band = 0; band < xll->nfreqbands; band++) {\n        for (int seg = 0; seg < xll->nframesegs; seg++) {\n            for (i = 0, chs = xll->chset; i < xll->nchsets; i++, chs++) {\n                int size = 0;\n                if (chs->nfreqbands > band) {\n                    size = bits_get(&xll->bits, xll->seg_size_nbits);\n                    if (size < 0 || size >= xll->frame_size) {\n                        xll_err(\"Invalid NAVI size\");\n                        return -DCADEC_EBADDATA;\n                    }\n                    size++;\n                }\n                *navi_ptr++ = size;\n            }\n        }\n    }\n\n    // Byte align\n    // CRC16\n    bits_align1(&xll->bits);\n    bits_skip(&xll->bits, 16);\n\n    // Check CRC\n    int ret;\n    if ((ret = bits_check_crc(&xll->bits, navi_pos, xll->bits.index)) < 0)\n        xll_err(\"Invalid NAVI checksum\");\n    return ret;\n}\n\nstatic int parse_band_data(struct xll_decoder *xll)\n{\n    struct xll_chset *chs;\n    int i, ret;\n\n    for (i = 0, chs = xll->chset; i < xll->nactivechsets; i++, chs++) {\n        if ((ret = chs_alloc_msb_band_data(chs)) < 0)\n            return ret;\n        if ((ret = chs_alloc_lsb_band_data(chs)) < 0)\n            return ret;\n    }\n\n    xll->nfailedsegs = 0;\n\n    int navi_pos = xll->bits.index;\n    int *navi_ptr = xll->navi;\n    for (int band = 0; band < xll->nfreqbands; band++) {\n        for (int seg = 0; seg < xll->nframesegs; seg++) {\n            for (i = 0, chs = xll->chset; i < xll->nchsets; i++, chs++) {\n                if (chs->nfreqbands > band) {\n                    navi_pos += *navi_ptr * 8;\n                    if (navi_pos > xll->bits.total) {\n                        xll_err(\"Invalid NAVI position\");\n                        return -DCADEC_EBADREAD;\n                    }\n                    if (i < xll->nactivechsets &&\n                        (ret = chs_parse_band_data(chs, band, seg, navi_pos)) < 0) {\n                        if (xll->flags & DCADEC_FLAG_STRICT)\n                            return ret;\n                        // Zero band data and advance to next segment\n                        chs_clear_band_data(chs, band, seg);\n                        xll->nfailedsegs++;\n                    }\n                    xll->bits.index = navi_pos;\n                }\n                navi_ptr++;\n            }\n        }\n    }\n\n    return 0;\n}\n\nstatic int parse_frame(struct xll_decoder *xll, uint8_t *data, int size, struct exss_asset *asset)\n{\n    int ret;\n\n    bits_init(&xll->bits, data, size);\n    if ((ret = parse_common_header(xll)) < 0)\n        return ret;\n    if ((ret = parse_sub_headers(xll, asset)) < 0)\n        return ret;\n    if ((ret = parse_navi_table(xll)) < 0)\n        return ret;\n    if ((ret = parse_band_data(xll)) < 0)\n        return ret;\n    if ((ret = bits_seek(&xll->bits, xll->frame_size * 8)) < 0)\n        xll_err(\"Read past end of XLL frame\");\n    return ret;\n}\n\nstatic void clear_pbr(struct xll_decoder *xll)\n{\n    xll->pbr_length = 0;\n    xll->pbr_delay = 0;\n}\n\nstatic int copy_to_pbr(struct xll_decoder *xll, uint8_t *data, int size, int delay)\n{\n    if (size > XLL_PBR_SIZE) {\n        xll_err(\"PBR smoothing buffer overflow\");\n        return -DCADEC_EINVAL;\n    }\n    if (!xll->pbr_buffer && !(xll->pbr_buffer = ta_zalloc_size(xll, XLL_PBR_SIZE + DCADEC_BUFFER_PADDING)))\n        return -DCADEC_ENOMEM;\n    memcpy(xll->pbr_buffer, data, size);\n    xll->pbr_length = size;\n    xll->pbr_delay = delay;\n    return 0;\n}\n\nstatic int parse_frame_no_pbr(struct xll_decoder *xll, uint8_t *data, int size, struct exss_asset *asset)\n{\n    int ret = parse_frame(xll, data, size, asset);\n\n    // If XLL packet data didn't start with a sync word, we must have jumped\n    // right into the middle of PBR smoothing period\n    if (ret == -DCADEC_ENOSYNC && asset->xll_sync_present) {\n        if (asset->xll_sync_offset > size) {\n            xll_err(\"Invalid XLL sync word offset\");\n            return -DCADEC_EINVAL;\n        }\n        if (asset->xll_delay_nframes < 0) {\n            xll_err(\"Invalid XLL decoding delay\");\n            return -DCADEC_EINVAL;\n        }\n\n        // Skip to the next sync word in this packet\n        data += asset->xll_sync_offset;\n        size -= asset->xll_sync_offset;\n\n        // No data to buffer? Should not really happen.\n        if (size == 0)\n            return -DCADEC_ENOSYNC;\n\n        // If decoding delay is set, put the frame into PBR buffer and return\n        // failure code. Higher level decoder is expected to switch to lossy\n        // core decoding or mute its output until decoding delay expires.\n        if (asset->xll_delay_nframes > 0) {\n            if ((ret = copy_to_pbr(xll, data, size, asset->xll_delay_nframes)) < 0)\n                return ret;\n            return -DCADEC_ENOSYNC;\n        }\n\n        // Can't parse in place when data is not aligned properly. We could\n        // copy to PBR buffer first, but don't bother for now.\n        if (asset->xll_sync_offset & 3) {\n            xll_warn(\"Unsupported XLL sync word alignment\");\n            return -DCADEC_ENOSYNC;\n        }\n\n        // No decoding delay, just parse the frame in place\n        ret = parse_frame(xll, data, size, asset);\n    }\n\n    if (ret < 0)\n        return ret;\n\n    if (xll->frame_size > size)\n        return -DCADEC_EINVAL;\n\n    // If the XLL decoder didn't consume full packet, start PBR smoothing period\n    if (xll->frame_size < size)\n        if ((ret = copy_to_pbr(xll, data + xll->frame_size, size - xll->frame_size, 0)) < 0)\n            return ret;\n\n    return 0;\n}\n\nstatic int parse_frame_pbr(struct xll_decoder *xll, uint8_t *data, int size, struct exss_asset *asset)\n{\n    int ret;\n\n    if (size > XLL_PBR_SIZE - xll->pbr_length) {\n        xll_err(\"PBR smoothing buffer overflow\");\n        ret = -DCADEC_EINVAL;\n        goto fail;\n    }\n\n    memcpy(xll->pbr_buffer + xll->pbr_length, data, size);\n    xll->pbr_length += size;\n\n    // Respect decoding delay after synchronization error\n    if (xll->pbr_delay > 0 && --xll->pbr_delay) {\n        xll_verbose(\"Waiting until XLL decoding delay expires (%d)\", xll->pbr_delay);\n        return -DCADEC_ENOSYNC;\n    }\n\n    if ((ret = parse_frame(xll, xll->pbr_buffer, xll->pbr_length, asset)) < 0)\n        goto fail;\n\n    if (xll->frame_size > xll->pbr_length) {\n        ret = -DCADEC_EINVAL;\n        goto fail;\n    }\n\n    if (xll->frame_size == xll->pbr_length) {\n        // End of PBR smoothing period\n        clear_pbr(xll);\n    } else {\n        xll->pbr_length -= xll->frame_size;\n        memmove(xll->pbr_buffer, xll->pbr_buffer + xll->frame_size, xll->pbr_length);\n    }\n\n    return 0;\n\nfail:\n    // For now, throw out all PBR state on failure.\n    // Perhaps we can be smarter and try to at least resync.\n    clear_pbr(xll);\n    return ret;\n}\n\nstatic void clear_chs(struct xll_decoder *xll)\n{\n    if (xll->chset) {\n        for (int i = 0; i < xll->nchsets; i++) {\n            xll->chset[i].dmix_coeffs_signature = 0;\n            xll->chset[i].dmix_coeffs_parity = false;\n        }\n    }\n}\n\nint xll_parse(struct xll_decoder *xll, uint8_t *data, struct exss_asset *asset)\n{\n    int ret;\n\n    if (xll->hd_stream_id != asset->hd_stream_id) {\n        xll_clear(xll);\n        xll->hd_stream_id = asset->hd_stream_id;\n    }\n\n    if (xll->pbr_length)\n        ret = parse_frame_pbr(xll, data + asset->xll_offset, asset->xll_size, asset);\n    else\n        ret = parse_frame_no_pbr(xll, data + asset->xll_offset, asset->xll_size, asset);\n\n    if (ret < 0)\n        clear_chs(xll);\n\n    return ret;\n}\n\nvoid xll_clear(struct xll_decoder *xll)\n{\n    if (xll) {\n        clear_pbr(xll);\n        clear_chs(xll);\n    }\n}\n"
  },
  {
    "path": "libdcadec/xll_decoder.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef XLL_DECODER_H\n#define XLL_DECODER_H\n\n#include \"bitstream.h\"\n\n#define XLL_MAX_CHANNELS    8\n#define XLL_MAX_BANDS       2\n#define XLL_MAX_ADAPT_PRED_ORDER    16\n\n#define XLL_DECI_HISTORY    8\n\n#define XLL_BAND_0  0\n#define XLL_BAND_1  1\n\n#define XLL_DMIX_SIGNATURE(chs) \\\n    ((chs)->nchannels | ((chs)->hier_m << 4) | ((chs)->primary_chset << 12) \\\n     | ((chs)->dmix_embedded << 13) | ((chs)->hier_chset << 14) | ((chs)->dmix_type << 15))\n\n#define xll_err(...)        dca_log(xll, ERROR, __VA_ARGS__)\n#define xll_warn(...)       dca_log(xll, WARNING, __VA_ARGS__)\n#define xll_verbose(...)    dca_log(xll, VERBOSE, __VA_ARGS__)\n\n#define xll_err_once(...)     dca_log_once(xll, ERROR, __VA_ARGS__)\n#define xll_warn_once(...)    dca_log_once(xll, WARNING, __VA_ARGS__)\n\nstruct xll_decoder;\nstruct exss_asset;\n\nstruct xll_band {\n    bool    decor_enabled;                      ///< Pairwise channel decorrelation flag\n    int     orig_order[XLL_MAX_CHANNELS];       ///< Original channel order\n    int     decor_coeff[XLL_MAX_CHANNELS / 2];  ///< Pairwise channel coefficients\n\n    int     adapt_pred_order[XLL_MAX_CHANNELS]; ///< Adaptive predictor order\n    int     highest_pred_order;                 ///< Highest adaptive predictor order\n    int     fixed_pred_order[XLL_MAX_CHANNELS]; ///< Fixed predictor order\n    int     adapt_refl_coeff[XLL_MAX_CHANNELS][XLL_MAX_ADAPT_PRED_ORDER];   ///< Adaptive predictor reflection coefficients\n\n    bool    dmix_embedded;  ///< Downmix performed by encoder in frequency band\n\n    int     lsb_section_size;                   ///< Size of LSB section in any segment\n    int     nscalablelsbs[XLL_MAX_CHANNELS];    ///< Number of bits to represent the samples in LSB part\n    int     bit_width_adjust[XLL_MAX_CHANNELS]; ///< Number of bits discarded by authoring\n\n    int     *msb_sample_buffer[XLL_MAX_CHANNELS];   ///< MSB sample buffer pointers\n    int     *lsb_sample_buffer[XLL_MAX_CHANNELS];   ///< LSB sample buffer pointers or NULL\n};\n\nstruct xll_chset {\n    struct xll_decoder  *decoder;   ///< Parent context\n\n    // Channel set header\n    int     nchannels;          ///< Number of channels in the channel set (N)\n    int     residual_encode;    ///< Residual encoding mask (0 - residual, 1 - full channel)\n    int     pcm_bit_res;        ///< PCM bit resolution (variable)\n    int     storage_bit_res;    ///< Storage bit resolution (16 or 24)\n    int     freq;               ///< Original sampling frequency (max. 96000 Hz)\n    int     interpolate;        ///< Sampling frequency modifier\n    int     replace_set_index;  ///< Which replacement set this channel set is member of\n\n    bool    primary_chset;          ///< Primary channel set flag\n    bool    dmix_coeffs_present;    ///< Downmix coefficients present in stream\n    bool    dmix_embedded;          ///< Downmix already performed by encoder\n    int     dmix_type;              ///< Primary channel set downmix type\n    bool    hier_chset;             ///< Whether the channel set is part of a hierarchy\n    int     hier_m;                 ///< Number of preceding channels in a hierarchy (M)\n    int     *dmix_coeff;            ///< Downmixing coefficients buffer base\n    int     *dmix_coeff_cur;        ///< M*N downmixing coefficients for current frame\n    int     *dmix_coeff_pre;        ///< M*N downmixing coefficients for previous frame\n    int     *dmix_scale_cur;        ///< M downmixing scales for current frame\n    int     *dmix_scale_pre;        ///< M downmixing scales for previous frame\n    int     *dmix_scale_inv_cur;    ///< M inverse downmixing scales for current frame\n    int     *dmix_scale_inv_pre;    ///< M inverse downmixing scales for previous frame\n    int     dmix_coeffs_signature;  ///< Signature of downmixing parameters from previous frame\n    bool    dmix_coeffs_parity;     ///< Index of current downmixing coefficients buffer, flipped each frame\n    bool    ch_mask_enabled;        ///< Channel mask enabled\n    int     ch_mask;                ///< Channel mask for set\n\n    int     nfreqbands; ///< Number of frequency bands (1 or 2)\n    int     nabits;     ///< Number of bits to read bit allocation coding parameter\n\n    struct xll_band     bands[XLL_MAX_BANDS];   ///< Frequency bands\n\n    // Frequency band coding parameters\n    bool    seg_common;                                 ///< Segment type\n    bool    rice_code_flag[XLL_MAX_CHANNELS];           ///< Rice coding flag\n    int     bitalloc_hybrid_linear[XLL_MAX_CHANNELS];   ///< Binary code length for isolated samples\n    int     bitalloc_part_a[XLL_MAX_CHANNELS];          ///< Coding parameter for part A of segment\n    int     bitalloc_part_b[XLL_MAX_CHANNELS];          ///< Coding parameter for part B of segment\n    int     nsamples_part_a[XLL_MAX_CHANNELS];          ///< Number of samples in part A of segment\n\n    // Decimator history\n    int     deci_history[XLL_MAX_CHANNELS][XLL_DECI_HISTORY];   ///< Decimator history for frequency band 1\n\n    // Sample buffers\n    int     *out_sample_buffer[XLL_MAX_CHANNELS];   ///< Output sample buffer pointers\n\n    int     *sample_buffer1;    ///< MSB sample buffer base\n    int     *sample_buffer2;    ///< LSB sample buffer base\n    int     *sample_buffer3;    ///< Frequency band assembly buffer base\n};\n\nstruct xll_decoder {\n    struct dcadec_context   *ctx; ///< Parent context\n    struct bitstream        bits; ///< Bitstream reader\n\n    int     flags;  ///< Context flags\n\n    int     frame_size;             ///< Number of bytes in a lossless frame\n    int     nchsets;                ///< Number of channels sets per frame\n    int     nframesegs;             ///< Number of segments per frame\n    int     nsegsamples_log2;       ///< log2(nsegsamples)\n    int     nsegsamples;            ///< Samples in segment per one frequency band\n    int     nframesamples_log2;     ///< log2(nframesamples)\n    int     nframesamples;          ///< Samples in frame per one frequency band\n    int     seg_size_nbits;         ///< Number of bits used to read segment size\n    int     band_crc_present;       ///< Presence of CRC16 within each frequency band\n    bool    scalable_lsbs;          ///< MSB/LSB split flag\n    int     ch_mask_nbits;          ///< Number of bits used to read channel mask\n    int     fixed_lsb_width;        ///< Fixed LSB width\n\n    struct xll_chset    *chset;     ///< Channel sets\n\n    int     *navi;          ///< NAVI table\n\n    int     nfreqbands;     ///< Highest number of frequency bands\n    int     nchannels;      ///< Total number of channels in a hierarchy\n    int     nactivechsets;  ///< Number of active channel sets to decode\n\n    int     nfailedsegs;    ///< Number of frequency band segments that failed to decode\n\n    int     hd_stream_id;   ///< Previous DTS-HD stream ID for detecting changes\n\n    uint8_t     *pbr_buffer;    ///< Peak bit rate (PBR) smoothing buffer\n    int         pbr_length;     ///< Length in bytes of data currently buffered\n    int         pbr_delay;      ///< Delay in frames before decoding buffered data\n};\n\nvoid xll_clear_band_data(struct xll_chset *chs, int band) __attribute__((cold));\nvoid xll_filter_band_data(struct xll_chset *chs, int band);\nint xll_get_lsb_width(struct xll_chset *chs, int band, int ch);\nvoid xll_assemble_msbs_lsbs(struct xll_chset *chs, int band);\nint xll_assemble_freq_bands(struct xll_decoder *xll);\nint xll_map_ch_to_spkr(struct xll_chset *chs, int ch);\nint xll_parse(struct xll_decoder *xll, uint8_t *data, struct exss_asset *asset);\nvoid xll_clear(struct xll_decoder *xll) __attribute__((cold));\n\n#endif\n"
  },
  {
    "path": "libdcadec/xll_tables.h",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n// Section 8.4.3: Look-up table of quantized reflection coefficients\nstatic const uint16_t refl_coeff_table[128] = {\n        0,  3070,  5110,  7140,  9156, 11154, 13132, 15085,\n    17010, 18904, 20764, 22588, 24373, 26117, 27818, 29474,\n    31085, 32648, 34164, 35631, 37049, 38418, 39738, 41008,\n    42230, 43404, 44530, 45609, 46642, 47630, 48575, 49477,\n    50337, 51157, 51937, 52681, 53387, 54059, 54697, 55302,\n    55876, 56421, 56937, 57426, 57888, 58326, 58741, 59132,\n    59502, 59852, 60182, 60494, 60789, 61066, 61328, 61576,\n    61809, 62029, 62236, 62431, 62615, 62788, 62951, 63105,\n    63250, 63386, 63514, 63635, 63749, 63855, 63956, 64051,\n    64140, 64224, 64302, 64376, 64446, 64512, 64573, 64631,\n    64686, 64737, 64785, 64830, 64873, 64913, 64950, 64986,\n    65019, 65050, 65079, 65107, 65133, 65157, 65180, 65202,\n    65222, 65241, 65259, 65275, 65291, 65306, 65320, 65333,\n    65345, 65357, 65368, 65378, 65387, 65396, 65405, 65413,\n    65420, 65427, 65434, 65440, 65446, 65451, 65456, 65461,\n    65466, 65470, 65474, 65478, 65481, 65485, 65488, 65491\n};\n\nstatic const uint8_t ch_nbits[16] = {\n    0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4\n};\n\nstatic const int32_t band_coeff_table0[] = {\n    868669, -5931642, -1228483\n};\n\nstatic const int32_t band_coeff_table1[] = {\n      -20577,  122631,  -393647,  904476,\n    -1696305, 2825313, -4430736, 6791313\n};\n\nstatic const int32_t band_coeff_table2[] = {\n      41153,  -245210,  785564, -1788164,\n    3259333, -5074941, 6928550, -8204883\n};\n"
  },
  {
    "path": "msvc/dcadec/dcadec.vcxproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"12.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug DLL|Win32\">\n      <Configuration>Debug DLL</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug DLL|x64\">\n      <Configuration>Debug DLL</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release DLL|Win32\">\n      <Configuration>Release DLL</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release DLL|x64\">\n      <Configuration>Release DLL</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{594F41A5-3F08-4CF9-84F4-237466EC5EE8}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>dcadec</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v120</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v120</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug DLL|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v120</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug DLL|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v120</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v120</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v120</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release DLL|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v120</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release DLL|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v120</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug DLL|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug DLL|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release DLL|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release DLL|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <LinkIncremental>true</LinkIncremental>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <LinkIncremental>true</LinkIncremental>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug DLL|Win32'\">\n    <LinkIncremental>true</LinkIncremental>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug DLL|x64'\">\n    <LinkIncremental>true</LinkIncremental>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LinkIncremental>false</LinkIncremental>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <LinkIncremental>false</LinkIncremental>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release DLL|Win32'\">\n    <LinkIncremental>false</LinkIncremental>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release DLL|x64'\">\n    <LinkIncremental>false</LinkIncremental>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <AdditionalDependencies>$(OutDir)libdcadec.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <AdditionalDependencies>$(OutDir)libdcadec.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug DLL|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;DCADEC_SHARED;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <AdditionalDependencies>$(OutDir)libdcadec.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug DLL|x64'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;DCADEC_SHARED;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <AdditionalDependencies>$(OutDir)libdcadec.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <AdditionalDependencies>$(OutDir)libdcadec.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <AdditionalDependencies>$(OutDir)libdcadec.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release DLL|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;DCADEC_SHARED;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <AdditionalDependencies>$(OutDir)libdcadec.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release DLL|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;DCADEC_SHARED;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <AdditionalDependencies>$(OutDir)libdcadec.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\dcadec.c\" />\n    <ClCompile Include=\"..\\..\\getopt.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\getopt.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>\n"
  },
  {
    "path": "msvc/dcadec/dcadec.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"Resource Files\">\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\dcadec.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\getopt.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\getopt.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "msvc/dcadec.sln",
    "content": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2013\nVisualStudioVersion = 12.0.31101.0\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libdcadec\", \"libdcadec\\libdcadec.vcxproj\", \"{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"dcadec\", \"dcadec\\dcadec.vcxproj\", \"{594F41A5-3F08-4CF9-84F4-237466EC5EE8}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0} = {5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}\n\tEndProjectSection\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug DLL|Win32 = Debug DLL|Win32\n\t\tDebug DLL|x64 = Debug DLL|x64\n\t\tDebug|Win32 = Debug|Win32\n\t\tDebug|x64 = Debug|x64\n\t\tRelease DLL|Win32 = Release DLL|Win32\n\t\tRelease DLL|x64 = Release DLL|x64\n\t\tRelease|Win32 = Release|Win32\n\t\tRelease|x64 = Release|x64\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}.Debug DLL|Win32.Build.0 = Debug DLL|Win32\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}.Debug DLL|x64.ActiveCfg = Debug DLL|x64\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}.Debug DLL|x64.Build.0 = Debug DLL|x64\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}.Debug|x64.Build.0 = Debug|x64\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}.Release DLL|Win32.ActiveCfg = Release DLL|Win32\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}.Release DLL|Win32.Build.0 = Release DLL|Win32\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}.Release DLL|x64.ActiveCfg = Release DLL|x64\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}.Release DLL|x64.Build.0 = Release DLL|x64\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}.Release|Win32.Build.0 = Release|Win32\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}.Release|x64.ActiveCfg = Release|x64\n\t\t{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}.Release|x64.Build.0 = Release|x64\n\t\t{594F41A5-3F08-4CF9-84F4-237466EC5EE8}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32\n\t\t{594F41A5-3F08-4CF9-84F4-237466EC5EE8}.Debug DLL|Win32.Build.0 = Debug DLL|Win32\n\t\t{594F41A5-3F08-4CF9-84F4-237466EC5EE8}.Debug DLL|x64.ActiveCfg = Debug DLL|x64\n\t\t{594F41A5-3F08-4CF9-84F4-237466EC5EE8}.Debug DLL|x64.Build.0 = Debug DLL|x64\n\t\t{594F41A5-3F08-4CF9-84F4-237466EC5EE8}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{594F41A5-3F08-4CF9-84F4-237466EC5EE8}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{594F41A5-3F08-4CF9-84F4-237466EC5EE8}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{594F41A5-3F08-4CF9-84F4-237466EC5EE8}.Debug|x64.Build.0 = Debug|x64\n\t\t{594F41A5-3F08-4CF9-84F4-237466EC5EE8}.Release DLL|Win32.ActiveCfg = Release DLL|Win32\n\t\t{594F41A5-3F08-4CF9-84F4-237466EC5EE8}.Release DLL|Win32.Build.0 = Release DLL|Win32\n\t\t{594F41A5-3F08-4CF9-84F4-237466EC5EE8}.Release DLL|x64.ActiveCfg = Release DLL|x64\n\t\t{594F41A5-3F08-4CF9-84F4-237466EC5EE8}.Release DLL|x64.Build.0 = Release DLL|x64\n\t\t{594F41A5-3F08-4CF9-84F4-237466EC5EE8}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{594F41A5-3F08-4CF9-84F4-237466EC5EE8}.Release|Win32.Build.0 = Release|Win32\n\t\t{594F41A5-3F08-4CF9-84F4-237466EC5EE8}.Release|x64.ActiveCfg = Release|x64\n\t\t{594F41A5-3F08-4CF9-84F4-237466EC5EE8}.Release|x64.Build.0 = Release|x64\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "msvc/libdcadec/libdcadec.vcxproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"12.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug DLL|Win32\">\n      <Configuration>Debug DLL</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug DLL|x64\">\n      <Configuration>Debug DLL</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release DLL|Win32\">\n      <Configuration>Release DLL</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release DLL|x64\">\n      <Configuration>Release DLL</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\libdcadec\\bitstream.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\common.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\compiler.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\core_decoder.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\core_huffman.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\core_tables.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\core_vectors.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\dca_context.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\dca_frame.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\dca_stream.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\dca_waveout.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\dmix_tables.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\exss_parser.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\fir_fixed.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\fir_float.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\fixed_math.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\huffman.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\idct.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\interpolator.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\ta.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\xll_decoder.h\" />\n    <ClInclude Include=\"..\\..\\libdcadec\\xll_tables.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\libdcadec\\bitstream.c\" />\n    <ClCompile Include=\"..\\..\\libdcadec\\core_decoder.c\" />\n    <ClCompile Include=\"..\\..\\libdcadec\\dca_context.c\" />\n    <ClCompile Include=\"..\\..\\libdcadec\\dca_frame.c\" />\n    <ClCompile Include=\"..\\..\\libdcadec\\dca_stream.c\" />\n    <ClCompile Include=\"..\\..\\libdcadec\\dca_waveout.c\" />\n    <ClCompile Include=\"..\\..\\libdcadec\\dmix_tables.c\" />\n    <ClCompile Include=\"..\\..\\libdcadec\\exss_parser.c\" />\n    <ClCompile Include=\"..\\..\\libdcadec\\idct_fixed.c\" />\n    <ClCompile Include=\"..\\..\\libdcadec\\idct_float.c\" />\n    <ClCompile Include=\"..\\..\\libdcadec\\interpolator.c\" />\n    <ClCompile Include=\"..\\..\\libdcadec\\interpolator_fixed.c\" />\n    <ClCompile Include=\"..\\..\\libdcadec\\interpolator_float.c\" />\n    <ClCompile Include=\"..\\..\\libdcadec\\ta.c\" />\n    <ClCompile Include=\"..\\..\\libdcadec\\xll_decoder.c\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{5B5AAF6D-79E0-42AE-8B57-2BEFA8C571F0}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>libdcadec</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v120</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v120</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug DLL|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v120</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug DLL|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v120</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v120</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v120</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release DLL|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v120</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release DLL|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v120</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug DLL|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug DLL|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release DLL|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release DLL|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release DLL|Win32'\">\n    <TargetExt>.dll</TargetExt>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release DLL|x64'\">\n    <TargetExt>.dll</TargetExt>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug DLL|Win32'\">\n    <TargetExt>.dll</TargetExt>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug DLL|x64'\">\n    <TargetExt>.dll</TargetExt>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <DisableSpecificWarnings>4146</DisableSpecificWarnings>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <DisableSpecificWarnings>4146</DisableSpecificWarnings>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug DLL|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;DCADEC_SHARED;DCADEC_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <DisableSpecificWarnings>4146</DisableSpecificWarnings>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n      <OptimizeReferences>false</OptimizeReferences>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug DLL|x64'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;DCADEC_SHARED;DCADEC_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <DisableSpecificWarnings>4146</DisableSpecificWarnings>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n      <OptimizeReferences>false</OptimizeReferences>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <DisableSpecificWarnings>4146</DisableSpecificWarnings>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <DisableSpecificWarnings>4146</DisableSpecificWarnings>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release DLL|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;DCADEC_SHARED;DCADEC_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <DisableSpecificWarnings>4146</DisableSpecificWarnings>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release DLL|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;DCADEC_SHARED;DCADEC_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <DisableSpecificWarnings>4146</DisableSpecificWarnings>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>\n"
  },
  {
    "path": "msvc/libdcadec/libdcadec.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"Resource Files\">\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\libdcadec\\bitstream.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\common.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\compiler.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\core_decoder.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\core_huffman.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\core_tables.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\core_vectors.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\dca_context.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\dca_frame.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\dca_stream.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\dca_waveout.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\dmix_tables.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\exss_parser.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\fir_fixed.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\fir_float.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\fixed_math.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\huffman.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\idct.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\interpolator.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\ta.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\xll_decoder.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\libdcadec\\xll_tables.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\libdcadec\\bitstream.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\libdcadec\\core_decoder.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\libdcadec\\dca_context.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\libdcadec\\dca_frame.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\libdcadec\\dca_stream.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\libdcadec\\dca_waveout.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\libdcadec\\dmix_tables.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\libdcadec\\exss_parser.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\libdcadec\\idct_fixed.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\libdcadec\\idct_float.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\libdcadec\\interpolator.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\libdcadec\\interpolator_fixed.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\libdcadec\\interpolator_float.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\libdcadec\\ta.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\libdcadec\\xll_decoder.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>\n"
  },
  {
    "path": "test/checksum.txt",
    "content": "9415e0d4c7cd58ee793d7b2bfae34e4de411181c *decoded/dmix_0/core_51_24_48_768_0.wav\nde10f73b35c2db915f69c46ddc95468c25510bdf *decoded/dmix_0/core_51_24_48_768_1.wav\n15a63dd037994c3f4749ae8f6e27bdcae83835d8 *decoded/dmix_0/x96_51_24_96_1509.wav\n2ba74e27d61f041d4a2bb124a636182ed0104996 *decoded/dmix_0/x96_xch_61_24_96_3840.wav\n1b310b329e1f8df551798fdd104c6af6d5dec904 *decoded/dmix_0/x96_xxch_71_24_96_3840.wav\nb64efecbd7b2df7b5edb3dbda7f2b3f715c06eef *decoded/dmix_0/xbr_51_24_48_3840.wav\n346e21a2f26f798808709e4153ea68b6207e377c *decoded/dmix_0/xbr_xch_61_24_48_3840.wav\neabf815257bba4388e46c3330ee8456d793bb44d *decoded/dmix_0/xbr_xxch_71_24_48_3840.wav\n05529c0991df6e55811b582b263118a62f2ff1e7 *decoded/dmix_0/xch_61_24_48_768.wav\nd7f7cf50d55ce32aea4121549973db16cd5d5bd0 *decoded/dmix_0/xll_51_16_192_768_0.wav\nd7f7cf50d55ce32aea4121549973db16cd5d5bd0 *decoded/dmix_0/xll_51_16_192_768_1.wav\n15be906b3c57c90304702eab2cc83650e553da1d *decoded/dmix_0/xll_51_24_48_768.wav\n96d31af60dc3e8b5c568737ff697730b7c549ea0 *decoded/dmix_0/xll_51_24_48_none.wav\n431446b087a74257d338c290bd31a40e6e54e060 *decoded/dmix_0/xll_71_24_48_768_0.wav\n431446b087a74257d338c290bd31a40e6e54e060 *decoded/dmix_0/xll_71_24_48_768_1.wav\n045f5972843c5e442678d742fe1e6d3af1d062f9 *decoded/dmix_0/xll_71_24_96_768.wav\na3d3eb3ef1d6f96bb95c809d8b2c053133e25f20 *decoded/dmix_0/xll_x96_51_24_96_1509.wav\ne3cbf8670dd14208c34a66cae90c45c2eb20d6bb *decoded/dmix_0/xll_xch_61_24_48_768.wav\n009524ee6202a4f8e8daa6a4033a8e1c4909508d *decoded/dmix_0/xxch_71_24_48_2046.wav\n9415e0d4c7cd58ee793d7b2bfae34e4de411181c *decoded/dmix_2/core_51_24_48_768_0.wav\necd0b8b3a6a79691be3ad3da904e7e9c3b1f313d *decoded/dmix_2/core_51_24_48_768_1.wav\n15a63dd037994c3f4749ae8f6e27bdcae83835d8 *decoded/dmix_2/x96_51_24_96_1509.wav\n40b95e3e5afa4660bf858fff2e96df1ec3326716 *decoded/dmix_2/x96_xch_61_24_96_3840.wav\ndee2f9f5c98a23431325e194606f9541a0680ee6 *decoded/dmix_2/x96_xxch_71_24_96_3840.wav\nb64efecbd7b2df7b5edb3dbda7f2b3f715c06eef *decoded/dmix_2/xbr_51_24_48_3840.wav\n54fcc9441c3670b43d2df2e4018f5be4d481c9db *decoded/dmix_2/xbr_xch_61_24_48_3840.wav\n6e2e95df72687c818164d84ddc20f41a90935cdc *decoded/dmix_2/xbr_xxch_71_24_48_3840.wav\n55d2dd0ae8501134963655e149ee7420859d6996 *decoded/dmix_2/xch_61_24_48_768.wav\nd7f7cf50d55ce32aea4121549973db16cd5d5bd0 *decoded/dmix_2/xll_51_16_192_768_0.wav\n9b5e7b8109cadcccec7b98784856cdb87b787ca0 *decoded/dmix_2/xll_51_16_192_768_1.wav\n47043676e438e3727f398ff6f0b2b46ec3ab02f6 *decoded/dmix_2/xll_51_24_48_768.wav\n96d31af60dc3e8b5c568737ff697730b7c549ea0 *decoded/dmix_2/xll_51_24_48_none.wav\n1c0c7ad09c2d335bd3dae9f8b5b6bb803f211abe *decoded/dmix_2/xll_71_24_48_768_0.wav\n4b701b2b906a1af079774b23052e96fb8ee1a5fc *decoded/dmix_2/xll_71_24_48_768_1.wav\n359ea5c7b8abcbde36c469afa9b364ba4dc59f9f *decoded/dmix_2/xll_71_24_96_768.wav\na3d3eb3ef1d6f96bb95c809d8b2c053133e25f20 *decoded/dmix_2/xll_x96_51_24_96_1509.wav\nbf59eebc557f8240fe9545ecc8fddd4ff52c3fb6 *decoded/dmix_2/xll_xch_61_24_48_768.wav\nfb4040a45e51de1bde777b1c5e1116462e9d9aba *decoded/dmix_2/xxch_71_24_48_2046.wav\n9415e0d4c7cd58ee793d7b2bfae34e4de411181c *decoded/dmix_6/core_51_24_48_768_0.wav\nde10f73b35c2db915f69c46ddc95468c25510bdf *decoded/dmix_6/core_51_24_48_768_1.wav\n15a63dd037994c3f4749ae8f6e27bdcae83835d8 *decoded/dmix_6/x96_51_24_96_1509.wav\n40b95e3e5afa4660bf858fff2e96df1ec3326716 *decoded/dmix_6/x96_xch_61_24_96_3840.wav\ndee2f9f5c98a23431325e194606f9541a0680ee6 *decoded/dmix_6/x96_xxch_71_24_96_3840.wav\nb64efecbd7b2df7b5edb3dbda7f2b3f715c06eef *decoded/dmix_6/xbr_51_24_48_3840.wav\n54fcc9441c3670b43d2df2e4018f5be4d481c9db *decoded/dmix_6/xbr_xch_61_24_48_3840.wav\n6e2e95df72687c818164d84ddc20f41a90935cdc *decoded/dmix_6/xbr_xxch_71_24_48_3840.wav\n55d2dd0ae8501134963655e149ee7420859d6996 *decoded/dmix_6/xch_61_24_48_768.wav\nd7f7cf50d55ce32aea4121549973db16cd5d5bd0 *decoded/dmix_6/xll_51_16_192_768_0.wav\nd7f7cf50d55ce32aea4121549973db16cd5d5bd0 *decoded/dmix_6/xll_51_16_192_768_1.wav\n15be906b3c57c90304702eab2cc83650e553da1d *decoded/dmix_6/xll_51_24_48_768.wav\n96d31af60dc3e8b5c568737ff697730b7c549ea0 *decoded/dmix_6/xll_51_24_48_none.wav\n1c0c7ad09c2d335bd3dae9f8b5b6bb803f211abe *decoded/dmix_6/xll_71_24_48_768_0.wav\n179e28454bc831cbba30369357dfe6778b4cb1c5 *decoded/dmix_6/xll_71_24_48_768_1.wav\n359ea5c7b8abcbde36c469afa9b364ba4dc59f9f *decoded/dmix_6/xll_71_24_96_768.wav\na3d3eb3ef1d6f96bb95c809d8b2c053133e25f20 *decoded/dmix_6/xll_x96_51_24_96_1509.wav\nbf59eebc557f8240fe9545ecc8fddd4ff52c3fb6 *decoded/dmix_6/xll_xch_61_24_48_768.wav\nfb4040a45e51de1bde777b1c5e1116462e9d9aba *decoded/dmix_6/xxch_71_24_48_2046.wav\nf9567e7e8926a0d1247d551dfdee06922953fda2 *decoded/mono/xll_51_16_192_768_0_C.wav\nb338184ad40c7bfab8811ca465ee333d5da818ff *decoded/mono/xll_51_16_192_768_0_L.wav\nd5e0325811b8ca44093b33104fa390300068f1ec *decoded/mono/xll_51_16_192_768_0_LFE.wav\n63f9cb37032d724d30bfa4224e6dcd5ce76ee926 *decoded/mono/xll_51_16_192_768_0_Ls.wav\nb338184ad40c7bfab8811ca465ee333d5da818ff *decoded/mono/xll_51_16_192_768_0_R.wav\n63f9cb37032d724d30bfa4224e6dcd5ce76ee926 *decoded/mono/xll_51_16_192_768_0_Rs.wav\nf9567e7e8926a0d1247d551dfdee06922953fda2 *decoded/mono/xll_51_16_192_768_1_C.wav\nb338184ad40c7bfab8811ca465ee333d5da818ff *decoded/mono/xll_51_16_192_768_1_L.wav\nd5e0325811b8ca44093b33104fa390300068f1ec *decoded/mono/xll_51_16_192_768_1_LFE.wav\n63f9cb37032d724d30bfa4224e6dcd5ce76ee926 *decoded/mono/xll_51_16_192_768_1_Ls.wav\nb338184ad40c7bfab8811ca465ee333d5da818ff *decoded/mono/xll_51_16_192_768_1_R.wav\n63f9cb37032d724d30bfa4224e6dcd5ce76ee926 *decoded/mono/xll_51_16_192_768_1_Rs.wav\nbbbf7fd9a60805e384c6cc3c95bd48a2b74ed5e3 *decoded/mono/xll_51_24_48_768_C.wav\n1dd4af9b5a3bb56267d73a05a6d6276b9096c672 *decoded/mono/xll_51_24_48_768_L.wav\nd7fdbd9e826aa3de8aa4ee2156068369a3bbbf9a *decoded/mono/xll_51_24_48_768_LFE.wav\n2555b7da3430f24bc28512596da48dc24be65f95 *decoded/mono/xll_51_24_48_768_Ls.wav\n1dd4af9b5a3bb56267d73a05a6d6276b9096c672 *decoded/mono/xll_51_24_48_768_R.wav\n2555b7da3430f24bc28512596da48dc24be65f95 *decoded/mono/xll_51_24_48_768_Rs.wav\n241d6ed12c09bd02e89d9c2eddb8daac5e4688ba *decoded/mono/xll_51_24_48_none_C.wav\n5eeff9f6c2993ed8bbea174659133e8b0fb2eb2d *decoded/mono/xll_51_24_48_none_L.wav\n9bb05d6de708d22837128168ec951b8a91cedfa8 *decoded/mono/xll_51_24_48_none_LFE.wav\n5a0cb7df9dee257d81d7c08729bc2c5830c7807d *decoded/mono/xll_51_24_48_none_Ls.wav\nb54ee1a50ddfa843860e7c6e8a4643261e6babea *decoded/mono/xll_51_24_48_none_R.wav\n5d89b3afc78c63ca3dec1ea77b2a06be0d8ce4fa *decoded/mono/xll_51_24_48_none_Rs.wav\nbbbf7fd9a60805e384c6cc3c95bd48a2b74ed5e3 *decoded/mono/xll_71_24_48_768_0_C.wav\n1dd4af9b5a3bb56267d73a05a6d6276b9096c672 *decoded/mono/xll_71_24_48_768_0_L.wav\nd7fdbd9e826aa3de8aa4ee2156068369a3bbbf9a *decoded/mono/xll_71_24_48_768_0_LFE.wav\naf2edeaf1bb4b7992d4161615e6bc30be8277407 *decoded/mono/xll_71_24_48_768_0_Lsr.wav\n2555b7da3430f24bc28512596da48dc24be65f95 *decoded/mono/xll_71_24_48_768_0_Lss.wav\n1dd4af9b5a3bb56267d73a05a6d6276b9096c672 *decoded/mono/xll_71_24_48_768_0_R.wav\naf2edeaf1bb4b7992d4161615e6bc30be8277407 *decoded/mono/xll_71_24_48_768_0_Rsr.wav\n2555b7da3430f24bc28512596da48dc24be65f95 *decoded/mono/xll_71_24_48_768_0_Rss.wav\nbbbf7fd9a60805e384c6cc3c95bd48a2b74ed5e3 *decoded/mono/xll_71_24_48_768_1_C.wav\n1dd4af9b5a3bb56267d73a05a6d6276b9096c672 *decoded/mono/xll_71_24_48_768_1_L.wav\nd7fdbd9e826aa3de8aa4ee2156068369a3bbbf9a *decoded/mono/xll_71_24_48_768_1_LFE.wav\naf2edeaf1bb4b7992d4161615e6bc30be8277407 *decoded/mono/xll_71_24_48_768_1_Lsr.wav\n2555b7da3430f24bc28512596da48dc24be65f95 *decoded/mono/xll_71_24_48_768_1_Lss.wav\n1dd4af9b5a3bb56267d73a05a6d6276b9096c672 *decoded/mono/xll_71_24_48_768_1_R.wav\naf2edeaf1bb4b7992d4161615e6bc30be8277407 *decoded/mono/xll_71_24_48_768_1_Rsr.wav\n2555b7da3430f24bc28512596da48dc24be65f95 *decoded/mono/xll_71_24_48_768_1_Rss.wav\n5f6766f79859a43e86d5084fd141280a2da0e2b5 *decoded/mono/xll_71_24_96_768_C.wav\ne619c5dbb080298e4ec338766fc9082a748ced9e *decoded/mono/xll_71_24_96_768_L.wav\n62b25ecaafc86d4ff05cf7830e9ba4cca94c96e1 *decoded/mono/xll_71_24_96_768_LFE.wav\n8d538275a2a8cc1d94dd28a13ffbe5ecab01e31d *decoded/mono/xll_71_24_96_768_Lsr.wav\ne8c1bfdfa4917b45045b8a937e24d6c3851b4f3c *decoded/mono/xll_71_24_96_768_Lss.wav\ne619c5dbb080298e4ec338766fc9082a748ced9e *decoded/mono/xll_71_24_96_768_R.wav\n8d538275a2a8cc1d94dd28a13ffbe5ecab01e31d *decoded/mono/xll_71_24_96_768_Rsr.wav\ne8c1bfdfa4917b45045b8a937e24d6c3851b4f3c *decoded/mono/xll_71_24_96_768_Rss.wav\n5f6766f79859a43e86d5084fd141280a2da0e2b5 *decoded/mono/xll_x96_51_24_96_1509_C.wav\ne619c5dbb080298e4ec338766fc9082a748ced9e *decoded/mono/xll_x96_51_24_96_1509_L.wav\n62b25ecaafc86d4ff05cf7830e9ba4cca94c96e1 *decoded/mono/xll_x96_51_24_96_1509_LFE.wav\ne8c1bfdfa4917b45045b8a937e24d6c3851b4f3c *decoded/mono/xll_x96_51_24_96_1509_Ls.wav\ne619c5dbb080298e4ec338766fc9082a748ced9e *decoded/mono/xll_x96_51_24_96_1509_R.wav\ne8c1bfdfa4917b45045b8a937e24d6c3851b4f3c *decoded/mono/xll_x96_51_24_96_1509_Rs.wav\nbbbf7fd9a60805e384c6cc3c95bd48a2b74ed5e3 *decoded/mono/xll_xch_61_24_48_768_C.wav\naf2edeaf1bb4b7992d4161615e6bc30be8277407 *decoded/mono/xll_xch_61_24_48_768_Cs.wav\n1dd4af9b5a3bb56267d73a05a6d6276b9096c672 *decoded/mono/xll_xch_61_24_48_768_L.wav\nd7fdbd9e826aa3de8aa4ee2156068369a3bbbf9a *decoded/mono/xll_xch_61_24_48_768_LFE.wav\n2555b7da3430f24bc28512596da48dc24be65f95 *decoded/mono/xll_xch_61_24_48_768_Ls.wav\n1dd4af9b5a3bb56267d73a05a6d6276b9096c672 *decoded/mono/xll_xch_61_24_48_768_R.wav\n2555b7da3430f24bc28512596da48dc24be65f95 *decoded/mono/xll_xch_61_24_48_768_Rs.wav\n"
  },
  {
    "path": "test/stddev.c",
    "content": "/*\n * This file is part of libdcadec.\n *\n * This library is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by the\n * Free Software Foundation; either version 2.1 of the License, or (at your\n * option) any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n * for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this library; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <stdint.h>\n#include <string.h>\n#include <math.h>\n\n#define BUF 3000\n#define HDR 44\n\nint main(int argc, char **argv)\n{\n    uint8_t buf1[BUF], buf2[BUF], *p1, *p2;\n    int64_t acc = 0, cnt = 0;\n    size_t r1, r2, i;\n    double ref = 0.0;\n\n    if (argc != 4)\n        goto fail;\n\n    if (strcmp(argv[3], \"?\")) {\n        char *p;\n        ref = strtod(argv[3], &p);\n        if (*p || p == argv[3])\n            goto fail;\n    }\n\n    FILE *fp1 = fopen(argv[1], \"rb\");\n    FILE *fp2 = fopen(argv[2], \"rb\");\n    if (!fp1 || !fp2)\n        goto fail;\n\n    if (fread(buf1, HDR, 1, fp1) != 1 || fread(buf2, HDR, 1, fp2) != 1)\n        goto fail;\n\n    if (memcmp(buf1, buf2, HDR) || memcmp(buf1, \"RIFF\", 4))\n        goto fail;\n\n    int bps;\n    switch (buf1[34] | (buf1[35] << 8)) {\n    case 16:\n        bps = 2;\n        break;\n    case 24:\n        bps = 3;\n        break;\n    default:\n        goto fail;\n    }\n\n    do {\n        r1 = fread(buf1, 1, BUF, fp1);\n        r2 = fread(buf2, 1, BUF, fp2);\n        if (r1 != r2 || r1 % bps)\n            goto fail;\n\n        for (i = 0, p1 = buf1, p2 = buf2; i < r1 / bps; i++, p1 += bps, p2 += bps) {\n            int64_t d;\n\n            if (bps == 3) {\n                uint32_t u1 = (p1[0] << 8) | (p1[1] << 16) | ((uint32_t)p1[2] << 24);\n                uint32_t u2 = (p2[0] << 8) | (p2[1] << 16) | ((uint32_t)p2[2] << 24);\n                int32_t v1 = (int32_t)u1 >> 8;\n                int32_t v2 = (int32_t)u2 >> 8;\n                d = v1 - v2;\n            } else {\n                int16_t v1 = p1[0] | (p1[1] << 8);\n                int16_t v2 = p2[0] | (p2[1] << 8);\n                d = v1 - v2;\n            }\n\n            acc += d * d;\n        }\n\n        cnt += i;\n    } while (r1 == BUF);\n\n    if (!cnt)\n        goto fail;\n\n    double var = (double)acc / cnt;\n    double dev = sqrt(var);\n    if (strcmp(argv[3], \"?\")) {\n        if (fabs(dev - ref) > 0.1)\n            goto fail;\n        printf(\"%s: OK\\n\", argv[1]);\n    } else {\n        printf(\"%s: %f\\n\", argv[1], dev);\n    }\n\n    return 0;\n\nfail:\n    printf(\"%s: FAILED\\n\", argc > 1 ? argv[1] : \"???\");\n    return 1;\n}\n"
  },
  {
    "path": "test/stddev.txt",
    "content": "decoded/mono/core_51_24_48_768_0_C.wav: 2.282641\ndecoded/mono/core_51_24_48_768_0_L.wav: 1.783442\ndecoded/mono/core_51_24_48_768_0_LFE.wav: 0.000000\ndecoded/mono/core_51_24_48_768_0_Ls.wav: 1.780153\ndecoded/mono/core_51_24_48_768_0_R.wav: 1.737961\ndecoded/mono/core_51_24_48_768_0_Rs.wav: 1.761957\ndecoded/mono/core_51_24_48_768_1_C.wav: 2.258123\ndecoded/mono/core_51_24_48_768_1_L.wav: 1.828726\ndecoded/mono/core_51_24_48_768_1_LFE.wav: 0.000000\ndecoded/mono/core_51_24_48_768_1_Ls.wav: 1.727110\ndecoded/mono/core_51_24_48_768_1_R.wav: 1.800879\ndecoded/mono/core_51_24_48_768_1_Rs.wav: 1.710206\ndecoded/mono/x96_51_24_96_1509_C.wav: 3.372648\ndecoded/mono/x96_51_24_96_1509_L.wav: 2.959649\ndecoded/mono/x96_51_24_96_1509_LFE.wav: 0.549103\ndecoded/mono/x96_51_24_96_1509_Ls.wav: 3.121600\ndecoded/mono/x96_51_24_96_1509_R.wav: 2.959649\ndecoded/mono/x96_51_24_96_1509_Rs.wav: 3.053878\ndecoded/mono/x96_xch_61_24_96_3840_C.wav: 3.550590\ndecoded/mono/x96_xch_61_24_96_3840_Cs.wav: 2.152851\ndecoded/mono/x96_xch_61_24_96_3840_L.wav: 3.175529\ndecoded/mono/x96_xch_61_24_96_3840_LFE.wav: 0.549103\ndecoded/mono/x96_xch_61_24_96_3840_Ls.wav: 3.565754\ndecoded/mono/x96_xch_61_24_96_3840_R.wav: 3.175529\ndecoded/mono/x96_xch_61_24_96_3840_Rs.wav: 3.546978\ndecoded/mono/x96_xxch_71_24_96_3840_C.wav: 3.431600\ndecoded/mono/x96_xxch_71_24_96_3840_L.wav: 3.354502\ndecoded/mono/x96_xxch_71_24_96_3840_LFE.wav: 0.875697\ndecoded/mono/x96_xxch_71_24_96_3840_Lsr.wav: 2.181241\ndecoded/mono/x96_xxch_71_24_96_3840_Lss.wav: 4.218345\ndecoded/mono/x96_xxch_71_24_96_3840_R.wav: 3.485461\ndecoded/mono/x96_xxch_71_24_96_3840_Rsr.wav: 2.048544\ndecoded/mono/x96_xxch_71_24_96_3840_Rss.wav: 3.940506\ndecoded/mono/xbr_51_24_48_3840_C.wav: 2.499609\ndecoded/mono/xbr_51_24_48_3840_L.wav: 1.944418\ndecoded/mono/xbr_51_24_48_3840_LFE.wav: 0.000000\ndecoded/mono/xbr_51_24_48_3840_Ls.wav: 2.080297\ndecoded/mono/xbr_51_24_48_3840_R.wav: 1.950060\ndecoded/mono/xbr_51_24_48_3840_Rs.wav: 2.005242\ndecoded/mono/xbr_xch_61_24_48_3840_C.wav: 2.161339\ndecoded/mono/xbr_xch_61_24_48_3840_Cs.wav: 1.422133\ndecoded/mono/xbr_xch_61_24_48_3840_L.wav: 1.758212\ndecoded/mono/xbr_xch_61_24_48_3840_LFE.wav: 0.000000\ndecoded/mono/xbr_xch_61_24_48_3840_Ls.wav: 2.442103\ndecoded/mono/xbr_xch_61_24_48_3840_R.wav: 1.807914\ndecoded/mono/xbr_xch_61_24_48_3840_Rs.wav: 2.365627\ndecoded/mono/xbr_xxch_71_24_48_3840_C.wav: 2.798402\ndecoded/mono/xbr_xxch_71_24_48_3840_L.wav: 2.057641\ndecoded/mono/xbr_xxch_71_24_48_3840_LFE.wav: 0.000000\ndecoded/mono/xbr_xxch_71_24_48_3840_Lsr.wav: 1.502439\ndecoded/mono/xbr_xxch_71_24_48_3840_Lss.wav: 2.729415\ndecoded/mono/xbr_xxch_71_24_48_3840_R.wav: 2.024387\ndecoded/mono/xbr_xxch_71_24_48_3840_Rsr.wav: 1.485444\ndecoded/mono/xbr_xxch_71_24_48_3840_Rss.wav: 2.797617\ndecoded/mono/xch_61_24_48_768_C.wav: 2.111284\ndecoded/mono/xch_61_24_48_768_Cs.wav: 1.331705\ndecoded/mono/xch_61_24_48_768_L.wav: 1.850623\ndecoded/mono/xch_61_24_48_768_LFE.wav: 0.000000\ndecoded/mono/xch_61_24_48_768_Ls.wav: 1.999267\ndecoded/mono/xch_61_24_48_768_R.wav: 1.850623\ndecoded/mono/xch_61_24_48_768_Rs.wav: 2.159644\ndecoded/mono/xxch_71_24_48_2046_C.wav: 2.353314\ndecoded/mono/xxch_71_24_48_2046_L.wav: 1.915577\ndecoded/mono/xxch_71_24_48_2046_LFE.wav: 0.000000\ndecoded/mono/xxch_71_24_48_2046_Lsr.wav: 1.260309\ndecoded/mono/xxch_71_24_48_2046_Lss.wav: 2.389961\ndecoded/mono/xxch_71_24_48_2046_R.wav: 1.915577\ndecoded/mono/xxch_71_24_48_2046_Rsr.wav: 1.282964\ndecoded/mono/xxch_71_24_48_2046_Rss.wav: 2.442203\n"
  },
  {
    "path": "test/test.sh",
    "content": "#!/bin/sh\n\nset -e\n\nif [ ! -f samples/README ] ; then\n    echo \"ERROR: Run 'git submodule update --init test/samples' first.\"\n    exit 1\nfi\n\nexport LD_LIBRARY_PATH=../libdcadec\n\n[ -z $SHA1SUM ] && command -v sha1sum > /dev/null && SHA1SUM=sha1sum\n[ -z $SHA1SUM ] && command -v shasum > /dev/null && SHA1SUM=shasum\n\nif [ -z $SHA1SUM ] ; then\n    echo \"ERROR: Neither sha1sum nor shasum found\"\n    exit 1\nfi\n\nrm -rf decoded\nmkdir -p decoded/dmix_0 decoded/dmix_2 decoded/dmix_6 decoded/mono\nfor i in samples/*.dtshd ; do\n    ../dcadec -b -q $i decoded/dmix_0/$(basename $i .dtshd).wav\n    ../dcadec -b -q -2 $i decoded/dmix_2/$(basename $i .dtshd).wav\n    ../dcadec -b -q -6 $i decoded/dmix_6/$(basename $i .dtshd).wav\n    ../dcadec -i -m -q $i decoded/mono/$(basename $i .dtshd)_%s.wav\ndone\n\nLOSSY=\"\\\ndecoded/mono/core_*.wav \\\ndecoded/mono/x96_*.wav \\\ndecoded/mono/xbr_*.wav \\\ndecoded/mono/xch_*.wav \\\ndecoded/mono/xxch_*.wav\"\n\nif [ \"$1\" = \"--update\" ] ; then\n    $SHA1SUM -b decoded/dmix_0/*.wav decoded/dmix_2/*.wav decoded/dmix_6/*.wav > checksum.txt\n    $SHA1SUM -b samples/reference/xll_*.wav | sed 's|samples/reference|decoded/mono|' >> checksum.txt\n    for i in $LOSSY ; do\n        ./stddev $i samples/reference/$(basename $i) ?\n    done > stddev.txt\nelse\n    $SHA1SUM -c checksum.txt\n    for i in $LOSSY ; do\n        ./stddev $i samples/reference/$(basename $i) $(grep -F $i stddev.txt | cut -d ' ' -f 2)\n    done\nfi\n"
  }
]